diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100644 index 72abef0a7321..000000000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.npmignore b/.npmignore index 462e805a67f3..d9e2e3bb2e65 100644 --- a/.npmignore +++ b/.npmignore @@ -19,7 +19,6 @@ /index.release.html /Instrumented /launches -/logo.png /server.js /Source/copyrightHeader.js /Source/main.js diff --git a/Apps/CesiumViewer/CesiumViewer.js b/Apps/CesiumViewer/CesiumViewer.js index 1f3880728728..9d0cbfeb9ff5 100644 --- a/Apps/CesiumViewer/CesiumViewer.js +++ b/Apps/CesiumViewer/CesiumViewer.js @@ -3,7 +3,6 @@ define([ 'Cesium/Core/Cartesian3', 'Cesium/Core/defined', 'Cesium/Core/formatError', - 'Cesium/Core/getFilenameFromUri', 'Cesium/Core/Math', 'Cesium/Core/objectToQuery', 'Cesium/Core/queryToObject', @@ -19,7 +18,6 @@ define([ Cartesian3, defined, formatError, - getFilenameFromUri, CesiumMath, objectToQuery, queryToObject, diff --git a/Apps/CesiumViewer/favicon.ico b/Apps/CesiumViewer/favicon.ico index e28d548f0701..0b05a3cda16b 100644 Binary files a/Apps/CesiumViewer/favicon.ico and b/Apps/CesiumViewer/favicon.ico differ diff --git a/Apps/Sandcastle/CesiumSandcastle.js b/Apps/Sandcastle/CesiumSandcastle.js index a6456aa1b240..585947073935 100644 --- a/Apps/Sandcastle/CesiumSandcastle.js +++ b/Apps/Sandcastle/CesiumSandcastle.js @@ -160,12 +160,16 @@ require({ var currentTab = ''; var newDemo; var demoHtml = ''; - var demoJs = ''; + var demoCode = ''; var previousCode = ''; + var previousHtml = ''; var runGist = false; var gistCode; + var gistHtml; var sandcastleUrl = ''; + var defaultHtml = '\n
\n

Loading...

\n
'; + var galleryErrorMsg = document.createElement('span'); galleryErrorMsg.className = 'galleryError'; galleryErrorMsg.style.display = 'none'; @@ -504,7 +508,7 @@ require({ window.onbeforeunload = function (e) { var htmlText = (htmlEditor.getValue()).replace(/\s/g, ''); var jsText = (jsEditor.getValue()).replace(/\s/g, ''); - if (demoHtml !== htmlText || demoJs !== jsText) { + if (demoHtml !== htmlText || demoCode !== jsText) { return 'Be sure to save a copy of any important edits before leaving this page.'; } }; @@ -695,7 +699,7 @@ require({ if (demo.name === 'Gist Import') { jsEditor.setValue(gistCode); - htmlEditor.setValue('\n
\n

Loading...

\n
'); + htmlEditor.setValue(gistHtml); document.title = 'Gist Import - Cesium Sandcastle'; CodeMirror.commands.runCesium(jsEditor); return; @@ -719,17 +723,23 @@ require({ } var scriptCode = scriptMatch[1]; - demoJs = scriptCode.replace(/\s/g, ''); + demoCode = scriptCode.replace(/\s/g, ''); if (Cesium.defined(queryObject.gistId)) { Cesium.loadJsonp('https://api.github.com/gists/' + queryObject.gistId + '?access_token=dd8f755c2e5d9bbb26806bb93eaa2291f2047c60') .then(function(data) { var files = data.data.files; - var code = files[Object.keys(files)[0]].content; + var code = files['Cesium-Sandcastle.js'].content; + var htmlFile = files['Cesium-Sandcastle.html']; + var html = Cesium.defined(htmlFile) ? htmlFile.content : defaultHtml; // Use the default html for old gists jsEditor.setValue(code); - demoJs = code.replace(/\s/g, ''); + htmlEditor.setValue(html); + demoCode = code.replace(/\s/g, ''); + demoHtml = html.replace(/\s/g, ''); gistCode = code; + gistHtml = html; previousCode = code; + previousHtml = html; sandcastleUrl = Cesium.getBaseUri(window.location.href) + '?src=Hello%20World.html&label=Showcases&gist=' + gistId; CodeMirror.commands.runCesium(jsEditor); clearRun(); @@ -885,17 +895,22 @@ require({ var textArea = document.getElementById('link'); textArea.value = '\n\n'; var code = jsEditor.getValue(); - if (code === previousCode) { + var html = htmlEditor.getValue(); + if (code === previousCode && html === previousHtml) { textArea.value = sandcastleUrl; textArea.select(); return; } previousCode = code; + previousHtml = html; var data = { public : true, files : { 'Cesium-Sandcastle.js' : { content : code + }, + 'Cesium-Sandcastle.html' : { + content : html } } }; @@ -915,9 +930,10 @@ require({ registry.byId('buttonImport').on('click', function() { gistId = document.getElementById("gistId").value; - if (gistId.indexOf('/') !== -1) { - var index = gistId.lastIndexOf('/'); - gistId = gistId.substring(index + 1); + var gistParameter = '&gist='; + var gistIndex = gistId.indexOf(gistParameter); + if (gistIndex !== -1) { + gistId = gistId.substring(gistIndex + gistParameter.length); } window.location.href = Cesium.getBaseUri(window.location.href) + '?src=Hello%20World.html&label=Showcases&gist=' + gistId; }); @@ -926,7 +942,7 @@ require({ var htmlText = (htmlEditor.getValue()).replace(/\s/g, ''); var jsText = (jsEditor.getValue()).replace(/\s/g, ''); var confirmChange = true; - if (demoHtml !== htmlText || demoJs !== jsText) { + if (demoHtml !== htmlText || demoCode !== jsText) { confirmChange = window.confirm('You have unsaved changes. Are you sure you want to navigate away from this demo?'); } if (confirmChange) { @@ -1169,7 +1185,7 @@ require({ var htmlText = (htmlEditor.getValue()).replace(/\s/g, ''); var jsText = (jsEditor.getValue()).replace(/\s/g, ''); var confirmChange = true; - if (demoHtml !== htmlText || demoJs !== jsText) { + if (demoHtml !== htmlText || demoCode !== jsText) { confirmChange = window.confirm('You have unsaved changes. Are you sure you want to navigate away from this demo?'); } if (confirmChange) { diff --git a/Apps/Sandcastle/Sandcastle-header.js b/Apps/Sandcastle/Sandcastle-header.js index ed9c763c31f6..e75def7f5ebe 100644 --- a/Apps/Sandcastle/Sandcastle-header.js +++ b/Apps/Sandcastle/Sandcastle-header.js @@ -26,6 +26,30 @@ document.body.className = document.body.className.replace(/(?:\s|^)sandcastle-loading(?:\s|$)/, ' '); }, + addToggleButton : function(text, checked, onchange, toolbarID) { + window.Sandcastle.declare(onchange); + var input = document.createElement('input'); + input.checked = checked; + input.type = 'checkbox'; + input.style.pointerEvents = 'none'; + var label = document.createElement('label'); + label.appendChild(input); + label.appendChild(document.createTextNode(text)); + label.style.pointerEvents = 'none'; + var button = document.createElement('button'); + button.type = 'button'; + button.className = 'cesium-button'; + button.appendChild(label); + + button.onclick = function() { + window.Sandcastle.reset(); + window.Sandcastle.highlight(onchange); + input.checked = !input.checked; + onchange(input.checked); + }; + + document.getElementById(toolbarID || 'toolbar').appendChild(button); + }, addToolbarButton : function(text, onclick, toolbarID) { window.Sandcastle.declare(onclick); var button = document.createElement('button'); diff --git a/Apps/Sandcastle/gallery/Atmosphere Color.html b/Apps/Sandcastle/gallery/Atmosphere Color.html index f58f0517dec1..9e23fbd04f6e 100644 --- a/Apps/Sandcastle/gallery/Atmosphere Color.html +++ b/Apps/Sandcastle/gallery/Atmosphere Color.html @@ -56,14 +56,14 @@ -
-
- - - - - -
-

Loading...

-
- - - diff --git a/Apps/Sandcastle/images/Cesium_Logo_Color.jpg b/Apps/Sandcastle/images/Cesium_Logo_Color.jpg index 3cb934494e97..26d622e522bd 100644 Binary files a/Apps/Sandcastle/images/Cesium_Logo_Color.jpg and b/Apps/Sandcastle/images/Cesium_Logo_Color.jpg differ diff --git a/Apps/Sandcastle/images/Cesium_Logo_Color_Overlay.png b/Apps/Sandcastle/images/Cesium_Logo_Color_Overlay.png index 3a72b50e13dd..2cad188a786e 100644 Binary files a/Apps/Sandcastle/images/Cesium_Logo_Color_Overlay.png and b/Apps/Sandcastle/images/Cesium_Logo_Color_Overlay.png differ diff --git a/Apps/Sandcastle/images/Cesium_Logo_overlay.png b/Apps/Sandcastle/images/Cesium_Logo_overlay.png index fb156163effa..42a43316bd27 100644 Binary files a/Apps/Sandcastle/images/Cesium_Logo_overlay.png and b/Apps/Sandcastle/images/Cesium_Logo_overlay.png differ diff --git a/CHANGES.md b/CHANGES.md index 1402dc954190..bf16700c23fe 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,47 +1,60 @@ Change Log ========== -### 1.27 - 2016-11-01 +### 1.28 - 2016-12-01 +* Deprecated + * +* Breaking changes + * +* Improved terrain/imagery load ordering, especially when the terrain is already fully loaded and we add a new imagery layer. This results in a 25% reduction in load times in many cases. +* Billboard, Label, and PointPrimitive depth testing changed from `LESS` to `LEQUAL`, allowing label glyphs of equal depths to overlap. +* Billboard sizes were incorrectly rounded up from odd values to even values. This has been corrected, and as a result, odd-width and odd-height billboards will appear one pixel smaller than before. +* Label glyph positions have been adjusted and corrected. +* `TextureAtlas.borderWidthInPixels` has always been applied to the upper and right edges of each internal texture, but is now also applied to the bottom and left edges of the entire TextureAtlas, guaranteeing borders on all sides regardless of position within the atlas. +* Added support for saving html and css in Github Gists. [#4125](https://github.com/AnalyticalGraphicsInc/cesium/issues/4125) +* Fixed `Cartographic.fromCartesian` when the cartesian is not on the ellipsoid surface. [#4611](https://github.com/AnalyticalGraphicsInc/cesium/issues/4611) +* Added the ability to blend a `Model` with a color. [#4547](https://github.com/AnalyticalGraphicsInc/cesium/pull/4547) +### 1.27 - 2016-11-01 * Deprecated - * + * Individual heading, pitch, and roll options to `Transforms.headingPitchRollToFixedFrame` and `Transforms.headingPitchRollQuaternion` have been deprecated and will be removed in 1.30. Pass the new `HeadingPitchRoll` object instead. [#4498](https://github.com/AnalyticalGraphicsInc/cesium/pull/4498) * Breaking changes - * The `scene` parameter for creating `BillboardVisualizer`, `LabelVisualizer`, and `PointVisualizer` has been removed. Instead, pass an instance of `EntityCluster`. + * The `scene` parameter for creating `BillboardVisualizer`, `LabelVisualizer`, and `PointVisualizer` has been removed. Instead, pass an instance of `EntityCluster`. [#4514](https://github.com/AnalyticalGraphicsInc/cesium/pull/4514) +* Fixed an issue where a billboard entity would not render after toggling the show property. [#4408](https://github.com/AnalyticalGraphicsInc/cesium/issues/4408) +* Fixed a crash when zooming from touch input on viewer initialization. [#4177](https://github.com/AnalyticalGraphicsInc/cesium/issues/4177) +* Fixed a crash when clustering is enabled, an entity has a label graphics defined, but the label isn't visible. [#4414](https://github.com/AnalyticalGraphicsInc/cesium/issues/4414) +* Added the ability for KML files to load network links to other KML files within the same KMZ archive. [#4477](https://github.com/AnalyticalGraphicsInc/cesium/issues/4477) +* `KmlDataSource` and `GeoJsonDataSource` were not honoring the `clampToGround` option for billboards and labels and was instead always clamping, reducing performance in cases when it was unneeded. [#4459](https://github.com/AnalyticalGraphicsInc/cesium/pull/4459) +* Fixed `KmlDataSource` features to respect `timespan` and `timestamp` properties of its parents (e.g. Folders or NetworkLinks). [#4041](https://github.com/AnalyticalGraphicsInc/cesium/issues/4041) +* Fixed a `KmlDataSource` bug where features had duplicate IDs and only one was drawn. [#3941](https://github.com/AnalyticalGraphicsInc/cesium/issues/3941) +* `GeoJsonDataSource` now treats null crs values as a no-op instead of failing to load. [#4456](https://github.com/AnalyticalGraphicsInc/cesium/pull/4456) +* `GeoJsonDataSource` now gracefully handles missing style icons instead of failing to load. [#4452](https://github.com/AnalyticalGraphicsInc/cesium/pull/4452) +* Added `HeadingPitchRoll` [#4047](https://github.com/AnalyticalGraphicsInc/cesium/pull/4047) + * `HeadingPitchRoll.fromQuaternion` function for retrieving heading-pitch-roll angles from a quaternion. + * `HeadingPitchRoll.fromDegrees` function that returns a new HeadingPitchRoll instance from angles given in degrees. + * `HeadingPitchRoll.clone` function to duplicate HeadingPitchRoll instance. + * `HeadingPitchRoll.equals` and `HeadingPitchRoll.equalsEpsilon` functions for comparing two instances. + * Added `Matrix3.fromHeadingPitchRoll` Computes a 3x3 rotation matrix from the provided headingPitchRoll. +* Fixed primitive bounding sphere bug that would cause a crash when loading data sources. [#4431](https://github.com/AnalyticalGraphicsInc/cesium/issues/4431) +* Fixed `BoundingSphere` computation for `Primitive` instances with a modelMatrix. [#4428](https://github.com/AnalyticalGraphicsInc/cesium/issues/4428) +* Fixed a bug with rotated, textured rectangles. [#4430](https://github.com/AnalyticalGraphicsInc/cesium/pull/4430) +* Added the ability to specify retina options, such as `@2x.png`, via the `MapboxImageryProvider` `format` option. [#4453](https://github.com/AnalyticalGraphicsInc/cesium/pull/4453). +* Fixed a crash that could occur when specifying an imagery provider's `rectangle` option. [https://github.com/AnalyticalGraphicsInc/cesium/issues/4377](https://github.com/AnalyticalGraphicsInc/cesium/issues/4377) * Fixed a crash that would occur when using dynamic `distanceDisplayCondition` properties. [#4403](https://github.com/AnalyticalGraphicsInc/cesium/pull/4403) * Fixed several bugs that lead to billboards and labels being improperly clamped to terrain. [#4396](https://github.com/AnalyticalGraphicsInc/cesium/issues/4396), [#4062](https://github.com/AnalyticalGraphicsInc/cesium/issues/4062) * Fixed a bug affected models with multiple meshes without indices. [#4237](https://github.com/AnalyticalGraphicsInc/cesium/issues/4237) -* Fixed `BoundingSphere` computation for `Primitive` instances with a modelMatrix. [#4428](https://github.com/AnalyticalGraphicsInc/cesium/issues/4428) * Fixed a glTF transparency bug where `blendFuncSeparate` parameters were loaded in the wrong order. [#4435](https://github.com/AnalyticalGraphicsInc/cesium/pull/4435) * Fixed a bug where creating a custom geometry with attributes and indices that have values that are not a typed array would cause a crash. [#4419](https://github.com/AnalyticalGraphicsInc/cesium/pull/4419) -* `KmlDataSource` and `GeoJsonDataSource` were not honoring the `clampToGround` option for billboards and labels and was instead always clamping, reducing performance in cases when it was unneeded. -* Fixed a bug with rotated, textured rectangles. [#4430](https://github.com/AnalyticalGraphicsInc/cesium/pull/4430) * Fixed a bug when morphing from 2D to 3D. [#4388](https://github.com/AnalyticalGraphicsInc/cesium/pull/4388) -* Fixed a bug where when KML features had duplicate IDs, only one was drawn. [#3941](https://github.com/AnalyticalGraphicsInc/cesium/issues/3941) -* Fixed `KmlDataSource` features to respect `timespan` and `timestamp` properties of it's parents (eg. Folders or NetworkLinks). [#4041](https://github.com/AnalyticalGraphicsInc/cesium/issues/4041) -* Added the ability for KML files to load network links to other KML files within the same KMZ archive. [#4477](https://github.com/AnalyticalGraphicsInc/cesium/issues/4477) -* `GeoJsonDataSource` now treats null crs values as a no-op instead of failing to load. -* `GeoJsonDataSource` now gracefully handles missing style icons instead of failing to load. -* Improve `Geocoder` usability by selecting text on click [#4464](https://github.com/AnalyticalGraphicsInc/cesium/pull/4464) -* Added `Rectangle.simpleIntersection`. -* Added the ability to specify retina options, such as `@2x.png`, via the `MapboxImageryProvider` `format` option. -* Removed an unnecessary reprojection of Web Mercator imagery tiles to the Geographic projection on load. This should improve both visual quality and load performance slightly. -* Add `clusterBillboards`, `clusterLabels`, and `cluserPoints` properties to `EntityCluster` to selectively cluster screen space entities. -* Fix a issue where a billboard entity would not render after toggling the show propery. [#4408](https://github.com/AnalyticalGraphicsInc/cesium/issues/4408) -* Added `Transforms.northUpEastToFixedFrame` to compute a 4x4 local transformation matrix from a reference frame with an north-west-up axes. * Fixed `RectangleGeometry` rotation when the rectangle is close to the international date line [#3874](https://github.com/AnalyticalGraphicsInc/cesium/issues/3874) -* Added `HeadingPitchRoll` : - * `HeadingPitchRoll.fromQuaternion` function for retrieving heading-pitch-roll angles from a quaternion. - * `HeadingPitchRoll.fromDegrees` function that returns a new HeadingPitchRoll instance from angles given in degrees. - * `HeadingPitchRoll.clone` function to duplicate HeadingPitchRoll instance. - * `HeadingPitchRoll.equals` and `HeadingPitchRoll.equalsEpsilon` functions for comparing two instances. -* Added `Matrix3.fromHeadingPitchRoll` Computes a 3x3 rotation matrix from the provided headingPitchRoll. -* `Transforms.headingPitchRollToFixedFrame` and `Transforms.headingPitchRollQuaternion` now take a `HeadingPitchRoll` object in addition to separate heading, pitch, and roll values. Separate values will be deprecated in 1.30. -* Prevent execution of default device/browser behaviour when handling "pinch" touch event/gesture. -* Fixed a crash when zooming from touch input on viewer initialization. [#4177](https://github.com/AnalyticalGraphicsInc/cesium/issues/4177) -* Fix warning when using Webpack. [#4467](https://github.com/AnalyticalGraphicsInc/cesium/pull/4467) -* Fix primitive bounding sphere bug that would cause a crash when loading data sources. [#4431](https://github.com/AnalyticalGraphicsInc/cesium/issues/4431) -* Fix a crash when clustering is enabled, an entity has a label graphics defined, but the label isn't visible. [#4414](https://github.com/AnalyticalGraphicsInc/cesium/issues/4414) -* Added the ability to blend a `Model` with a color. [#4547](https://github.com/AnalyticalGraphicsInc/cesium/pull/4547) +* Added `clusterBillboards`, `clusterLabels`, and `cluserPoints` properties to `EntityCluster` to selectively cluster screen space entities. +* Prevent execution of default device/browser behavior when handling "pinch" touch event/gesture. [#4518](https://github.com/AnalyticalGraphicsInc/cesium/pull/4518). +* Fixed a shadow aliasing issue where polygon offset was not being applied. [#4559](https://github.com/AnalyticalGraphicsInc/cesium/pull/4559) +* Removed an unnecessary reprojection of Web Mercator imagery tiles to the Geographic projection on load. This should improve both visual quality and load performance slightly. [#4339](https://github.com/AnalyticalGraphicsInc/cesium/pull/4339) +* Added `Transforms.northUpEastToFixedFrame` to compute a 4x4 local transformation matrix from a reference frame with a north-west-up axes. +* Improved `Geocoder` usability by selecting text on click [#4464](https://github.com/AnalyticalGraphicsInc/cesium/pull/4464) +* Added `Rectangle.simpleIntersection` which is an optimized version of `Rectangle.intersection` for more constrained input. [#4339](https://github.com/AnalyticalGraphicsInc/cesium/pull/4339) +* Fixed warning when using Webpack. [#4467](https://github.com/AnalyticalGraphicsInc/cesium/pull/4467) ### 1.26 - 2016-10-03 diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 774adf62b504..ad690a20ec1e 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -65,6 +65,9 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to contribute to Cesiu * [Andrey Orlov](https://github.com/AndreyOrlov) * [The Imagineers](https://www.theimagineers.com/) * [Heerco Grond](https://github.com/HeercoGrond) +* [Camptocamp SA](https://www.camptocamp.com/) + * [Frédéric Junod](https://github.com/fredj) + * [Guillaume Beraudo](https://github.com/gberaudo) ## [Individual CLA](http://www.agi.com/licenses/individual-cla-agi-v1.0.txt) * [Victor Berchet](https://github.com/vicb) @@ -110,3 +113,6 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to contribute to Cesiu * [Tom Payne](https://github.com/twpayne) * [Leesa Fini](https://github.com/leesafini) * [Victor Malaret](https://github.com/malaretv) +* [David Friedman](https://github.com/duvifn) +* [Abhishek Potnis](https://github.com/abhishekvp) + diff --git a/Documentation/Contributors/CodingGuide/README.md b/Documentation/Contributors/CodingGuide/README.md index f56041866a22..fce089da7972 100644 --- a/Documentation/Contributors/CodingGuide/README.md +++ b/Documentation/Contributors/CodingGuide/README.md @@ -34,6 +34,7 @@ To some extent, this guide can be summarized as _make new code similar to existi * [Design](#design) * [Deprecation and Breaking Changes](#deprecation-and-breaking-changes) * [Third-Party Libraries](#third-party-libraries) +* [Widgets](#widgets) * [GLSL](#glsl) * [Naming](#naming-1) * [Formatting](#formatting-1) @@ -762,6 +763,32 @@ function Foo() { * Not pollute the global namespace. * Provide enough value to justify adding a third-party library whose integration needs to be maintained and has the potential to slightly count against Cesium when some users evaluate it (generally, fewer third-parties is better). +## Widgets + +Cesium includes a handful of standard widgets that are used in the Viewer, including animation and timeline controls, a base layer picker, and a geocoder. These widgets are all built using [Knockout](http://knockoutjs.com/)) for automatic UI refreshing. Knockout uses a Model View ViewModel (MVVM) design pattern. You can learn more about this design pattern in [Understanding MVVM - A Guide For JavaScript Developers](https://addyosmani.com/blog/understanding-mvvm-a-guide-for-javascript-developers/) + +To learn about using the Knockout library, see the [Get started](http://knockoutjs.com/) section of their home page. They also have a great [interactive tutorial](http://learn.knockoutjs.com/) with step by step instructions. + +Cesium also uses the [Knockout-ES5](http://blog.stevensanderson.com/2013/05/20/knockout-es5-a-plugin-to-simplify-your-syntax/) plugin to simplify knockout syntax. This lets us use knockout observables the same way we use other variables. Call `knockout.track` to create the observables. Here is an example from [BaseLayerPickerViewModel](https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Source/Widgets/BaseLayerPicker/BaseLayerPickerViewModel.js#L73) that makes observables for `tooltip`, `showInstructions` and `_touch` properties. + +``` javascript +knockout.track(this, ['tooltip', 'showInstructions', '_touch']); +``` + +### Knockout subscriptions + +Use a knockout subscription only when you are unable to accomplish what you need to do with a standard binding. For [example](https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Source/Widgets/Viewer/Viewer.js#L588), the `Viewer` subscribes to `FullscreenButtonViewModel.isFullscreenEnabled` because it needs to change the width of the timeline widget when that value changes. This cannot be done with binding because the value from `FullscreenButtonViewModel` is affecting a value not contained within that widget. + +Cesium includes a [`subscribeAndEvaluate`](https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Source/Widgets/subscribeAndEvaluate.js) helper function for subscribing to knockout observable. + +When using a subscription, always be sure to [dispose the subscription](https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Source/Widgets/Viewer/Viewer.js#L1413) when the viewmodel is no longer using it. Otherwise the listener will continue to be notified for the lifetime of the observable. + +``` +fullscreenSubscription = subscribeAndEvaluate(fullscreenButton.viewModel, 'isFullscreenEnabled', function(isFullscreenEnabled) { ... }); +// ...then later... +fullscreenSubscription.dispose(); +``` + ## GLSL ### Naming diff --git a/README.md b/README.md index 981de97c4833..657f4e2b003f 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,20 @@ We appreciate attribution by including the Cesium logo and link in your app. ### Demos ###

+  +  +  +  +  +  +  +  +  +  +  +  +  +        diff --git a/Source/Core/AttributeCompression.js b/Source/Core/AttributeCompression.js index d5e6973d29cf..0d943901ceec 100644 --- a/Source/Core/AttributeCompression.js +++ b/Source/Core/AttributeCompression.js @@ -2,14 +2,12 @@ define([ './Cartesian2', './Cartesian3', - './defaultValue', './defined', './DeveloperError', './Math' ], function( Cartesian2, Cartesian3, - defaultValue, defined, DeveloperError, CesiumMath) { diff --git a/Source/Core/BoundingSphere.js b/Source/Core/BoundingSphere.js index 78f7ddf1abba..5c729fd38142 100644 --- a/Source/Core/BoundingSphere.js +++ b/Source/Core/BoundingSphere.js @@ -11,7 +11,6 @@ define([ './Interval', './Matrix3', './Matrix4', - './Plane', './Rectangle' ], function( Cartesian3, @@ -25,7 +24,6 @@ define([ Interval, Matrix3, Matrix4, - Plane, Rectangle) { 'use strict'; diff --git a/Source/Core/Cartographic.js b/Source/Core/Cartographic.js index d6a5f5d08f13..a2eac65ec663 100644 --- a/Source/Core/Cartographic.js +++ b/Source/Core/Cartographic.js @@ -137,7 +137,7 @@ define([ return undefined; } - var n = Cartesian3.multiplyComponents(cartesian, oneOverRadiiSquared, cartesianToCartographicN); + var n = Cartesian3.multiplyComponents(p, oneOverRadiiSquared, cartesianToCartographicN); n = Cartesian3.normalize(n, n); var h = Cartesian3.subtract(cartesian, p, cartesianToCartographicH); diff --git a/Source/Core/CesiumTerrainProvider.js b/Source/Core/CesiumTerrainProvider.js index 61955ae9bd01..ef6f4e3e9f9b 100644 --- a/Source/Core/CesiumTerrainProvider.js +++ b/Source/Core/CesiumTerrainProvider.js @@ -17,10 +17,8 @@ define([ './loadArrayBuffer', './loadJson', './Math', - './Matrix3', './OrientedBoundingBox', './QuantizedMeshTerrainData', - './RuntimeError', './TerrainProvider', './throttleRequestByServer', './TileProviderError' @@ -42,10 +40,8 @@ define([ loadArrayBuffer, loadJson, CesiumMath, - Matrix3, OrientedBoundingBox, QuantizedMeshTerrainData, - RuntimeError, TerrainProvider, throttleRequestByServer, TileProviderError) { diff --git a/Source/Core/CircleGeometry.js b/Source/Core/CircleGeometry.js index bd225683229b..8aa557d4c33b 100644 --- a/Source/Core/CircleGeometry.js +++ b/Source/Core/CircleGeometry.js @@ -7,7 +7,6 @@ define([ './DeveloperError', './EllipseGeometry', './Ellipsoid', - './Math', './VertexFormat' ], function( Cartesian3, @@ -17,7 +16,6 @@ define([ DeveloperError, EllipseGeometry, Ellipsoid, - CesiumMath, VertexFormat) { 'use strict'; diff --git a/Source/Core/CorridorGeometry.js b/Source/Core/CorridorGeometry.js index 29aeb0c86b91..4fd13ea735a9 100644 --- a/Source/Core/CorridorGeometry.js +++ b/Source/Core/CorridorGeometry.js @@ -679,8 +679,8 @@ define([ function computeRectangle(positions, ellipsoid, width, cornerType) { var cleanPositions = arrayRemoveDuplicates(positions, Cartesian3.equalsEpsilon); - var length = cleanPositions.length - 1; - if (length === 0 || width === 0) { + var length = cleanPositions.length; + if (length < 2 || width <= 0) { return new Rectangle(); } var halfWidth = width * 0.5; @@ -709,14 +709,14 @@ define([ } // Compute the rest - for (var i = 0; i < length; ++i) { + for (var i = 0; i < length-1; ++i) { computeOffsetPoints(cleanPositions[i], cleanPositions[i+1], ellipsoid, halfWidth, scratchCartographicMin, scratchCartographicMax); } // Compute ending point - var last = cleanPositions[length]; - Cartesian3.subtract(last, cleanPositions[length-1], scratchCartesianOffset); + var last = cleanPositions[length-1]; + Cartesian3.subtract(last, cleanPositions[length-2], scratchCartesianOffset); Cartesian3.normalize(scratchCartesianOffset, scratchCartesianOffset); Cartesian3.multiplyByScalar(scratchCartesianOffset, halfWidth, scratchCartesianOffset); Cartesian3.add(last, scratchCartesianOffset, scratchCartesianEnds); diff --git a/Source/Core/CorridorGeometryLibrary.js b/Source/Core/CorridorGeometryLibrary.js index 5631968ee32b..7ffd2953ded6 100644 --- a/Source/Core/CorridorGeometryLibrary.js +++ b/Source/Core/CorridorGeometryLibrary.js @@ -3,7 +3,6 @@ define([ './Cartesian3', './CornerType', './defined', - './isArray', './Math', './Matrix3', './PolylinePipeline', @@ -13,7 +12,6 @@ define([ Cartesian3, CornerType, defined, - isArray, CesiumMath, Matrix3, PolylinePipeline, diff --git a/Source/Core/DistanceDisplayCondition.js b/Source/Core/DistanceDisplayCondition.js index 87ae8d9b8204..6c0a1df9e36c 100644 --- a/Source/Core/DistanceDisplayCondition.js +++ b/Source/Core/DistanceDisplayCondition.js @@ -1,11 +1,9 @@ /*global define*/ define([ - './Cartesian3', './defaultValue', './defined', './defineProperties' ], function( - Cartesian3, defaultValue, defined, defineProperties) { diff --git a/Source/Core/EllipsoidTangentPlane.js b/Source/Core/EllipsoidTangentPlane.js index 1533ca94f703..c2c178566c18 100644 --- a/Source/Core/EllipsoidTangentPlane.js +++ b/Source/Core/EllipsoidTangentPlane.js @@ -10,7 +10,6 @@ define([ './DeveloperError', './Ellipsoid', './IntersectionTests', - './Matrix3', './Matrix4', './Plane', './Ray', @@ -26,7 +25,6 @@ define([ DeveloperError, Ellipsoid, IntersectionTests, - Matrix3, Matrix4, Plane, Ray, diff --git a/Source/Core/FeatureDetection.js b/Source/Core/FeatureDetection.js index a2fa4fe0ae01..a018118b7369 100644 --- a/Source/Core/FeatureDetection.js +++ b/Source/Core/FeatureDetection.js @@ -29,11 +29,13 @@ define([ function isChrome() { if (!defined(isChromeResult)) { isChromeResult = false; - - var fields = (/ Chrome\/([\.0-9]+)/).exec(theNavigator.userAgent); - if (fields !== null) { - isChromeResult = true; - chromeVersionResult = extractVersion(fields[1]); + // Edge contains Chrome in the user agent too + if (!isEdge()) { + var fields = (/ Chrome\/([\.0-9]+)/).exec(theNavigator.userAgent); + if (fields !== null) { + isChromeResult = true; + chromeVersionResult = extractVersion(fields[1]); + } } } @@ -50,8 +52,8 @@ define([ if (!defined(isSafariResult)) { isSafariResult = false; - // Chrome contains Safari in the user agent too - if (!isChrome() && (/ Safari\/[\.0-9]+/).test(theNavigator.userAgent)) { + // Chrome and Edge contain Safari in the user agent too + if (!isChrome() && !isEdge() && (/ Safari\/[\.0-9]+/).test(theNavigator.userAgent)) { var fields = (/ Version\/([\.0-9]+)/).exec(theNavigator.userAgent); if (fields !== null) { isSafariResult = true; @@ -116,6 +118,24 @@ define([ return isInternetExplorer() && internetExplorerVersionResult; } + var isEdgeResult; + var edgeVersionResult; + function isEdge() { + if (!defined(isEdgeResult)) { + isEdgeResult = false; + var fields = (/ Edge\/([\.0-9]+)/).exec(theNavigator.userAgent); + if (fields !== null) { + isEdgeResult = true; + edgeVersionResult = extractVersion(fields[1]); + } + } + return isEdgeResult; + } + + function edgeVersion() { + return isEdge() && edgeVersionResult; + } + var isFirefoxResult; var firefoxVersionResult; function isFirefox() { @@ -193,6 +213,8 @@ define([ webkitVersion : webkitVersion, isInternetExplorer : isInternetExplorer, internetExplorerVersion : internetExplorerVersion, + isEdge : isEdge, + edgeVersion : edgeVersion, isFirefox : isFirefox, firefoxVersion : firefoxVersion, isWindows : isWindows, diff --git a/Source/Core/GeometryPipeline.js b/Source/Core/GeometryPipeline.js index 6252e4d763ed..c27a9dda80cd 100644 --- a/Source/Core/GeometryPipeline.js +++ b/Source/Core/GeometryPipeline.js @@ -15,7 +15,6 @@ define([ './GeographicProjection', './Geometry', './GeometryAttribute', - './GeometryInstance', './GeometryType', './IndexDatatype', './Intersect', @@ -42,7 +41,6 @@ define([ GeographicProjection, Geometry, GeometryAttribute, - GeometryInstance, GeometryType, IndexDatatype, Intersect, diff --git a/Source/Core/HeadingPitchRoll.js b/Source/Core/HeadingPitchRoll.js index 32229a9880f7..6428fc73a83b 100644 --- a/Source/Core/HeadingPitchRoll.js +++ b/Source/Core/HeadingPitchRoll.js @@ -1,14 +1,14 @@ /*global define*/ define([ - './defaultValue', - './defined', - './DeveloperError', - './Math' -], function( - defaultValue, - defined, - DeveloperError, - CesiumMath) { + './defaultValue', + './defined', + './DeveloperError', + './Math' + ], function( + defaultValue, + defined, + DeveloperError, + CesiumMath) { "use strict"; /** diff --git a/Source/Core/HeightmapTessellator.js b/Source/Core/HeightmapTessellator.js index 2b607744d693..fa222bf44dde 100644 --- a/Source/Core/HeightmapTessellator.js +++ b/Source/Core/HeightmapTessellator.js @@ -16,7 +16,7 @@ define([ './Rectangle', './TerrainEncoding', './Transforms', - './WebMercatorProjection', + './WebMercatorProjection' ], function( AxisAlignedBoundingBox, BoundingSphere, @@ -82,7 +82,7 @@ define([ * are provided, they're assumed to be consistent. * @param {Boolean} [options.isGeographic=true] True if the heightmap uses a {@link GeographicProjection}, or false if it uses * a {@link WebMercatorProjection}. - * @param {Cartesian3} [options.relativetoCenter=Cartesian3.ZERO] The positions will be computed as Cartesian3.subtract(worldPosition, relativeToCenter). + * @param {Cartesian3} [options.relativeToCenter=Cartesian3.ZERO] The positions will be computed as Cartesian3.subtract(worldPosition, relativeToCenter). * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid to which the heightmap applies. * @param {Object} [options.structure] An object describing the structure of the height data. * @param {Number} [options.structure.heightScale=1.0] The factor by which to multiply height samples in order to obtain @@ -200,7 +200,9 @@ define([ geographicNorth = rectangle.north; } - var relativeToCenter = defaultValue(options.relativeToCenter, Cartesian3.ZERO); + var relativeToCenter = options.relativeToCenter; + var hasRelativeToCenter = defined(relativeToCenter); + relativeToCenter = hasRelativeToCenter ? relativeToCenter : Cartesian3.ZERO; var exaggeration = defaultValue(options.exaggeration, 1.0); var includeWebMercatorT = defaultValue(options.includeWebMercatorT, false); @@ -390,10 +392,9 @@ define([ } var occludeePointInScaledSpace; - var center = options.relativetoCenter; - if (defined(center)) { + if (hasRelativeToCenter) { var occluder = new EllipsoidalOccluder(ellipsoid); - occludeePointInScaledSpace = occluder.computeHorizonCullingPoint(center, positions); + occludeePointInScaledSpace = occluder.computeHorizonCullingPoint(relativeToCenter, positions); } var aaBox = new AxisAlignedBoundingBox(minimum, maximum, relativeToCenter); diff --git a/Source/Core/Matrix3.js b/Source/Core/Matrix3.js index e896df174256..2faff37a7283 100644 --- a/Source/Core/Matrix3.js +++ b/Source/Core/Matrix3.js @@ -6,7 +6,6 @@ define([ './defineProperties', './DeveloperError', './freezeObject', - './HeadingPitchRoll', './Math' ], function( Cartesian3, @@ -15,7 +14,6 @@ define([ defineProperties, DeveloperError, freezeObject, - HeadingPitchRoll, CesiumMath) { 'use strict'; diff --git a/Source/Core/PolygonGeometry.js b/Source/Core/PolygonGeometry.js index 0b2d7dbca180..f8276fa5880b 100644 --- a/Source/Core/PolygonGeometry.js +++ b/Source/Core/PolygonGeometry.js @@ -14,7 +14,6 @@ define([ './EllipsoidTangentPlane', './Geometry', './GeometryAttribute', - './GeometryAttributes', './GeometryInstance', './GeometryPipeline', './IndexDatatype', @@ -41,7 +40,6 @@ define([ EllipsoidTangentPlane, Geometry, GeometryAttribute, - GeometryAttributes, GeometryInstance, GeometryPipeline, IndexDatatype, diff --git a/Source/Core/PolygonGeometryLibrary.js b/Source/Core/PolygonGeometryLibrary.js index 1a08ae5e9955..f36e24764715 100644 --- a/Source/Core/PolygonGeometryLibrary.js +++ b/Source/Core/PolygonGeometryLibrary.js @@ -1,13 +1,11 @@ /*global define*/ define([ './arrayRemoveDuplicates', - './Cartesian2', './Cartesian3', './ComponentDatatype', './defaultValue', './defined', './Ellipsoid', - './EllipsoidTangentPlane', './Geometry', './GeometryAttribute', './GeometryAttributes', @@ -20,13 +18,11 @@ define([ './WindingOrder' ], function( arrayRemoveDuplicates, - Cartesian2, Cartesian3, ComponentDatatype, defaultValue, defined, Ellipsoid, - EllipsoidTangentPlane, Geometry, GeometryAttribute, GeometryAttributes, diff --git a/Source/Core/PolygonPipeline.js b/Source/Core/PolygonPipeline.js index 3f3bb509e9dc..6ed1a3e0a33b 100644 --- a/Source/Core/PolygonPipeline.js +++ b/Source/Core/PolygonPipeline.js @@ -8,13 +8,10 @@ define([ './defined', './DeveloperError', './Ellipsoid', - './EllipsoidTangentPlane', './Geometry', './GeometryAttribute', './Math', - './pointInsideTriangle', './PrimitiveType', - './Queue', './WindingOrder' ], function( earcut, @@ -25,13 +22,10 @@ define([ defined, DeveloperError, Ellipsoid, - EllipsoidTangentPlane, Geometry, GeometryAttribute, CesiumMath, - pointInsideTriangle, PrimitiveType, - Queue, WindingOrder) { 'use strict'; diff --git a/Source/Core/PolylineGeometry.js b/Source/Core/PolylineGeometry.js index 228ff63ce286..4e652fde7efe 100644 --- a/Source/Core/PolylineGeometry.js +++ b/Source/Core/PolylineGeometry.js @@ -124,8 +124,8 @@ define([ if ((!defined(positions)) || (positions.length < 2)) { throw new DeveloperError('At least two positions are required.'); } - if (width < 1.0) { - throw new DeveloperError('width must be greater than or equal to one.'); + if (typeof width !== 'number') { + throw new DeveloperError('width must be a number'); } if (defined(colors) && ((colorsPerVertex && colors.length < positions.length) || (!colorsPerVertex && colors.length < positions.length - 1))) { throw new DeveloperError('colors has an invalid length.'); @@ -309,9 +309,11 @@ define([ var k; var positions = arrayRemoveDuplicates(polylineGeometry._positions, Cartesian3.equalsEpsilon); - var positionsLength = positions.length; - if (positionsLength < 2) { + + // A width of a pixel or less is not a valid geometry, but in order to support external data + // that may have errors we treat this as an empty geometry. + if (positionsLength < 2 || width <= 0.0) { return undefined; } diff --git a/Source/Core/PolylineVolumeGeometry.js b/Source/Core/PolylineVolumeGeometry.js index 4cf9b5cf04f9..4f65fbd941a6 100644 --- a/Source/Core/PolylineVolumeGeometry.js +++ b/Source/Core/PolylineVolumeGeometry.js @@ -9,7 +9,6 @@ define([ './CornerType', './defaultValue', './defined', - './oneTimeWarning', './DeveloperError', './Ellipsoid', './Geometry', @@ -18,6 +17,7 @@ define([ './GeometryPipeline', './IndexDatatype', './Math', + './oneTimeWarning', './PolygonPipeline', './PolylineVolumeGeometryLibrary', './PrimitiveType', @@ -33,7 +33,6 @@ define([ CornerType, defaultValue, defined, - oneTimeWarning, DeveloperError, Ellipsoid, Geometry, @@ -42,6 +41,7 @@ define([ GeometryPipeline, IndexDatatype, CesiumMath, + oneTimeWarning, PolygonPipeline, PolylineVolumeGeometryLibrary, PrimitiveType, diff --git a/Source/Core/TaskProcessor.js b/Source/Core/TaskProcessor.js index 2beefbcac620..0a7edeb4220c 100644 --- a/Source/Core/TaskProcessor.js +++ b/Source/Core/TaskProcessor.js @@ -1,6 +1,5 @@ /*global define*/ define([ - '../ThirdParty/Uri', '../ThirdParty/when', './buildModuleUrl', './defaultValue', @@ -12,7 +11,6 @@ define([ './RuntimeError', 'require' ], function( - Uri, when, buildModuleUrl, defaultValue, diff --git a/Source/Core/TerrainEncoding.js b/Source/Core/TerrainEncoding.js index 9241995d44e0..9b91b0f1c9e9 100644 --- a/Source/Core/TerrainEncoding.js +++ b/Source/Core/TerrainEncoding.js @@ -7,7 +7,6 @@ define([ './defaultValue', './defined', './Math', - './Matrix3', './Matrix4', './TerrainQuantization' ], function( @@ -18,7 +17,6 @@ define([ defaultValue, defined, CesiumMath, - Matrix3, Matrix4, TerrainQuantization) { 'use strict'; diff --git a/Source/Core/TranslationRotationScale.js b/Source/Core/TranslationRotationScale.js index bfbaff72d63a..dea95c42570e 100644 --- a/Source/Core/TranslationRotationScale.js +++ b/Source/Core/TranslationRotationScale.js @@ -3,13 +3,11 @@ define([ './Cartesian3', './defaultValue', './defined', - './Matrix4', './Quaternion' ], function( Cartesian3, defaultValue, defined, - Matrix4, Quaternion) { 'use strict'; diff --git a/Source/Core/TrustedServers.js b/Source/Core/TrustedServers.js index cc538ad2241c..027903d86a2b 100644 --- a/Source/Core/TrustedServers.js +++ b/Source/Core/TrustedServers.js @@ -1,14 +1,12 @@ /*global define*/ define([ - './defined', - './defineProperties', - './DeveloperError', - '../ThirdParty/Uri' -], function( - defined, - defineProperties, - DeveloperError, - Uri) { + '../ThirdParty/Uri', + './defined', + './DeveloperError' + ], function( + Uri, + defined, + DeveloperError) { 'use strict'; /** diff --git a/Source/Core/VideoSynchronizer.js b/Source/Core/VideoSynchronizer.js index 764753983f14..0f16ff61dbc6 100644 --- a/Source/Core/VideoSynchronizer.js +++ b/Source/Core/VideoSynchronizer.js @@ -4,8 +4,6 @@ define([ './defined', './defineProperties', './destroyObject', - './DeveloperError', - './Event', './Iso8601', './JulianDate' ], function( @@ -13,8 +11,6 @@ define([ defined, defineProperties, destroyObject, - DeveloperError, - Event, Iso8601, JulianDate) { 'use strict'; diff --git a/Source/Core/loadImage.js b/Source/Core/loadImage.js index 861e29343feb..ba299a24c860 100644 --- a/Source/Core/loadImage.js +++ b/Source/Core/loadImage.js @@ -1,18 +1,18 @@ /*global define*/ define([ '../ThirdParty/when', - './TrustedServers', './defaultValue', './defined', './DeveloperError', - './isCrossOriginUrl' + './isCrossOriginUrl', + './TrustedServers' ], function( when, - TrustedServers, defaultValue, defined, DeveloperError, - isCrossOriginUrl) { + isCrossOriginUrl, + TrustedServers) { 'use strict'; var dataUriRegex = /^data:/; diff --git a/Source/Core/loadWithXhr.js b/Source/Core/loadWithXhr.js index 01066b2341ec..a44debf511db 100644 --- a/Source/Core/loadWithXhr.js +++ b/Source/Core/loadWithXhr.js @@ -1,20 +1,20 @@ /*global define*/ define([ '../ThirdParty/when', - './TrustedServers', './defaultValue', './defined', './DeveloperError', './RequestErrorEvent', - './RuntimeError' + './RuntimeError', + './TrustedServers' ], function( when, - TrustedServers, defaultValue, defined, DeveloperError, RequestErrorEvent, - RuntimeError) { + RuntimeError, + TrustedServers) { 'use strict'; /** diff --git a/Source/Core/writeTextToCanvas.js b/Source/Core/writeTextToCanvas.js index f032aad58d95..c54ee0feaf90 100644 --- a/Source/Core/writeTextToCanvas.js +++ b/Source/Core/writeTextToCanvas.js @@ -87,16 +87,28 @@ define([ document.body.appendChild(canvas); var dimensions = measureText(context2D, text, stroke, fill); - dimensions.computedWidth = Math.max(dimensions.width, dimensions.bounds.maxx - dimensions.bounds.minx); canvas.dimensions = dimensions; document.body.removeChild(canvas); canvas.style.visibility = ''; - var baseline = dimensions.height - dimensions.ascent + padding; - canvas.width = dimensions.computedWidth + doublePadding; - canvas.height = dimensions.height + doublePadding; - var y = canvas.height - baseline; + //Some characters, such as the letter j, have a non-zero starting position. + //This value is used for kerning later, but we need to take it into account + //now in order to draw the text completely on the canvas + var x = -dimensions.bounds.minx; + + //Expand the width to include the starting position. + var width = Math.ceil(dimensions.width) + x + doublePadding; + + //While the height of the letter is correct, we need to adjust + //where we start drawing it so that letters like j and y properly dip + //below the line. + var height = dimensions.height + doublePadding; + var baseline = height - dimensions.ascent + doublePadding; + var y = height - baseline + doublePadding; + + canvas.width = width; + canvas.height = height; // Properties must be explicitly set again after changing width and height context2D.font = font; @@ -113,13 +125,13 @@ define([ if (stroke) { var strokeColor = defaultValue(options.strokeColor, Color.BLACK); context2D.strokeStyle = strokeColor.toCssColorString(); - context2D.strokeText(text, padding, y); + context2D.strokeText(text, x + padding, y); } if (fill) { var fillColor = defaultValue(options.fillColor, Color.WHITE); context2D.fillStyle = fillColor.toCssColorString(); - context2D.fillText(text, padding, y); + context2D.fillText(text, x + padding, y); } return canvas; diff --git a/Source/DataSources/BillboardVisualizer.js b/Source/DataSources/BillboardVisualizer.js index fdd03d1c4f08..b1595fd5dca5 100644 --- a/Source/DataSources/BillboardVisualizer.js +++ b/Source/DataSources/BillboardVisualizer.js @@ -5,7 +5,6 @@ define([ '../Core/Cartesian2', '../Core/Cartesian3', '../Core/Color', - '../Core/defaultValue', '../Core/defined', '../Core/destroyObject', '../Core/DeveloperError', @@ -15,7 +14,6 @@ define([ '../Scene/HorizontalOrigin', '../Scene/VerticalOrigin', './BoundingSphereState', - './EntityCluster', './Property' ], function( AssociativeArray, @@ -23,7 +21,6 @@ define([ Cartesian2, Cartesian3, Color, - defaultValue, defined, destroyObject, DeveloperError, @@ -33,7 +30,6 @@ define([ HorizontalOrigin, VerticalOrigin, BoundingSphereState, - EntityCluster, Property) { 'use strict'; diff --git a/Source/DataSources/ColorMaterialProperty.js b/Source/DataSources/ColorMaterialProperty.js index 2f3103a90687..dd034ef0ad6f 100644 --- a/Source/DataSources/ColorMaterialProperty.js +++ b/Source/DataSources/ColorMaterialProperty.js @@ -4,7 +4,6 @@ define([ '../Core/defined', '../Core/defineProperties', '../Core/Event', - './ConstantProperty', './createPropertyDescriptor', './Property' ], function( @@ -12,7 +11,6 @@ define([ defined, defineProperties, Event, - ConstantProperty, createPropertyDescriptor, Property) { 'use strict'; diff --git a/Source/DataSources/ConstantProperty.js b/Source/DataSources/ConstantProperty.js index 905a46007dde..39dd1257fbd0 100644 --- a/Source/DataSources/ConstantProperty.js +++ b/Source/DataSources/ConstantProperty.js @@ -1,15 +1,11 @@ /*global define*/ define([ - '../Core/defaultValue', '../Core/defined', '../Core/defineProperties', - '../Core/DeveloperError', '../Core/Event' ], function( - defaultValue, defined, defineProperties, - DeveloperError, Event) { 'use strict'; diff --git a/Source/DataSources/CylinderGeometryUpdater.js b/Source/DataSources/CylinderGeometryUpdater.js index 6556de373db0..669606b4c4bb 100644 --- a/Source/DataSources/CylinderGeometryUpdater.js +++ b/Source/DataSources/CylinderGeometryUpdater.js @@ -1,6 +1,5 @@ /*global define*/ define([ - '../Core/Cartesian3', '../Core/Color', '../Core/ColorGeometryInstanceAttribute', '../Core/CylinderGeometry', @@ -26,7 +25,6 @@ define([ './MaterialProperty', './Property' ], function( - Cartesian3, Color, ColorGeometryInstanceAttribute, CylinderGeometry, diff --git a/Source/DataSources/DataSourceDisplay.js b/Source/DataSources/DataSourceDisplay.js index edc756aa425b..3ca8cef027f0 100644 --- a/Source/DataSources/DataSourceDisplay.js +++ b/Source/DataSources/DataSourceDisplay.js @@ -16,7 +16,6 @@ define([ './CylinderGeometryUpdater', './EllipseGeometryUpdater', './EllipsoidGeometryUpdater', - './EntityCluster', './GeometryVisualizer', './LabelVisualizer', './ModelVisualizer', @@ -44,7 +43,6 @@ define([ CylinderGeometryUpdater, EllipseGeometryUpdater, EllipsoidGeometryUpdater, - EntityCluster, GeometryVisualizer, LabelVisualizer, ModelVisualizer, diff --git a/Source/DataSources/EntityCluster.js b/Source/DataSources/EntityCluster.js index e652c41c257a..e3d4641b965d 100644 --- a/Source/DataSources/EntityCluster.js +++ b/Source/DataSources/EntityCluster.js @@ -1,56 +1,38 @@ /*global define*/ define([ - '../Core/BoundingRectangle', - '../Core/Cartesian2', - '../Core/Cartesian3', - '../Core/Color', - '../Core/defaultValue', - '../Core/defined', - '../Core/defineProperties', - '../Core/destroyObject', - '../Core/EllipsoidalOccluder', - '../Core/Event', - '../Core/Matrix4', - '../Scene/Billboard', - '../Scene/BillboardCollection', - '../Scene/HeightReference', - '../Scene/HorizontalOrigin', - '../Scene/Label', - '../Scene/LabelCollection', - '../Scene/LabelStyle', - '../Scene/PointPrimitive', - '../Scene/PointPrimitiveCollection', - '../Scene/SceneTransforms', - '../Scene/VerticalOrigin', - '../ThirdParty/kdbush', - './Entity', - './Property' -], function( - BoundingRectangle, - Cartesian2, - Cartesian3, - Color, - defaultValue, - defined, - defineProperties, - destroyObject, - EllipsoidalOccluder, - Event, - Matrix4, - Billboard, - BillboardCollection, - HeightReference, - HorizontalOrigin, - Label, - LabelCollection, - LabelStyle, - PointPrimitive, - PointPrimitiveCollection, - SceneTransforms, - VerticalOrigin, - kdbush, - Entity, - Property) { + '../Core/BoundingRectangle', + '../Core/Cartesian2', + '../Core/Cartesian3', + '../Core/defaultValue', + '../Core/defined', + '../Core/defineProperties', + '../Core/EllipsoidalOccluder', + '../Core/Event', + '../Core/Matrix4', + '../Scene/Billboard', + '../Scene/BillboardCollection', + '../Scene/Label', + '../Scene/LabelCollection', + '../Scene/PointPrimitive', + '../Scene/PointPrimitiveCollection', + '../ThirdParty/kdbush' + ], function( + BoundingRectangle, + Cartesian2, + Cartesian3, + defaultValue, + defined, + defineProperties, + EllipsoidalOccluder, + Event, + Matrix4, + Billboard, + BillboardCollection, + Label, + LabelCollection, + PointPrimitive, + PointPrimitiveCollection, + kdbush) { 'use strict'; /** diff --git a/Source/DataSources/EntityView.js b/Source/DataSources/EntityView.js index f8f07f593871..e6653e3fa8d9 100644 --- a/Source/DataSources/EntityView.js +++ b/Source/DataSources/EntityView.js @@ -1,8 +1,6 @@ /*global define*/ define([ - '../Core/BoundingSphere', '../Core/Cartesian3', - '../Core/Cartesian4', '../Core/defaultValue', '../Core/defined', '../Core/defineProperties', @@ -16,9 +14,7 @@ define([ '../Core/Transforms', '../Scene/SceneMode' ], function( - BoundingSphere, Cartesian3, - Cartesian4, defaultValue, defined, defineProperties, diff --git a/Source/DataSources/KmlDataSource.js b/Source/DataSources/KmlDataSource.js index 8f9342107d32..0df12a27e333 100644 --- a/Source/DataSources/KmlDataSource.js +++ b/Source/DataSources/KmlDataSource.js @@ -41,7 +41,6 @@ define([ '../ThirdParty/zip', './BillboardGraphics', './CompositePositionProperty', - './ConstantPositionProperty', './CorridorGraphics', './DataSource', './DataSourceClock', @@ -101,7 +100,6 @@ define([ zip, BillboardGraphics, CompositePositionProperty, - ConstantPositionProperty, CorridorGraphics, DataSource, DataSourceClock, diff --git a/Source/DataSources/LabelVisualizer.js b/Source/DataSources/LabelVisualizer.js index 0042865047ca..7689eeff192b 100644 --- a/Source/DataSources/LabelVisualizer.js +++ b/Source/DataSources/LabelVisualizer.js @@ -15,7 +15,6 @@ define([ '../Scene/LabelStyle', '../Scene/VerticalOrigin', './BoundingSphereState', - './EntityCluster', './Property' ], function( AssociativeArray, @@ -33,7 +32,6 @@ define([ LabelStyle, VerticalOrigin, BoundingSphereState, - EntityCluster, Property) { 'use strict'; diff --git a/Source/DataSources/PointVisualizer.js b/Source/DataSources/PointVisualizer.js index 72cd7a7e3a90..f287439389dc 100644 --- a/Source/DataSources/PointVisualizer.js +++ b/Source/DataSources/PointVisualizer.js @@ -3,7 +3,6 @@ define([ '../Core/AssociativeArray', '../Core/Cartesian3', '../Core/Color', - '../Core/defaultValue', '../Core/defined', '../Core/destroyObject', '../Core/DeveloperError', @@ -11,13 +10,11 @@ define([ '../Core/NearFarScalar', '../Scene/HeightReference', './BoundingSphereState', - './EntityCluster', './Property' ], function( AssociativeArray, Cartesian3, Color, - defaultValue, defined, destroyObject, DeveloperError, @@ -25,7 +22,6 @@ define([ NearFarScalar, HeightReference, BoundingSphereState, - EntityCluster, Property) { 'use strict'; diff --git a/Source/DataSources/PolylineArrowMaterialProperty.js b/Source/DataSources/PolylineArrowMaterialProperty.js index 53c31faae493..5dba53c76041 100644 --- a/Source/DataSources/PolylineArrowMaterialProperty.js +++ b/Source/DataSources/PolylineArrowMaterialProperty.js @@ -4,7 +4,6 @@ define([ '../Core/defined', '../Core/defineProperties', '../Core/Event', - './ConstantProperty', './createPropertyDescriptor', './Property' ], function( @@ -12,7 +11,6 @@ define([ defined, defineProperties, Event, - ConstantProperty, createPropertyDescriptor, Property) { 'use strict'; diff --git a/Source/DataSources/PolylineGeometryUpdater.js b/Source/DataSources/PolylineGeometryUpdater.js index f0b600e34dc2..f4714c250878 100644 --- a/Source/DataSources/PolylineGeometryUpdater.js +++ b/Source/DataSources/PolylineGeometryUpdater.js @@ -10,7 +10,6 @@ define([ '../Core/DeveloperError', '../Core/DistanceDisplayCondition', '../Core/DistanceDisplayConditionGeometryInstanceAttribute', - '../Core/Ellipsoid', '../Core/Event', '../Core/GeometryInstance', '../Core/Iso8601', @@ -37,7 +36,6 @@ define([ DeveloperError, DistanceDisplayCondition, DistanceDisplayConditionGeometryInstanceAttribute, - Ellipsoid, Event, GeometryInstance, Iso8601, diff --git a/Source/DataSources/Property.js b/Source/DataSources/Property.js index 5183f79d46b8..3f201ddcda0a 100644 --- a/Source/DataSources/Property.js +++ b/Source/DataSources/Property.js @@ -3,14 +3,12 @@ define([ '../Core/defaultValue', '../Core/defined', '../Core/defineProperties', - '../Core/DeveloperError', - '../Core/Iso8601' + '../Core/DeveloperError' ], function( defaultValue, defined, defineProperties, - DeveloperError, - Iso8601) { + DeveloperError) { 'use strict'; /** diff --git a/Source/DataSources/StaticGroundGeometryColorBatch.js b/Source/DataSources/StaticGroundGeometryColorBatch.js index aa19dc270bba..bc0bda478422 100644 --- a/Source/DataSources/StaticGroundGeometryColorBatch.js +++ b/Source/DataSources/StaticGroundGeometryColorBatch.js @@ -2,7 +2,6 @@ define([ '../Core/AssociativeArray', '../Core/Color', - '../Core/ColorGeometryInstanceAttribute', '../Core/defined', '../Core/DistanceDisplayCondition', '../Core/DistanceDisplayConditionGeometryInstanceAttribute', @@ -13,7 +12,6 @@ define([ ], function( AssociativeArray, Color, - ColorGeometryInstanceAttribute, defined, DistanceDisplayCondition, DistanceDisplayConditionGeometryInstanceAttribute, diff --git a/Source/DataSources/VelocityOrientationProperty.js b/Source/DataSources/VelocityOrientationProperty.js index 08022a1b6277..5a23864f1b61 100644 --- a/Source/DataSources/VelocityOrientationProperty.js +++ b/Source/DataSources/VelocityOrientationProperty.js @@ -6,7 +6,6 @@ define([ '../Core/defineProperties', '../Core/Ellipsoid', '../Core/Event', - '../Core/JulianDate', '../Core/Matrix3', '../Core/Quaternion', '../Core/Transforms', @@ -19,7 +18,6 @@ define([ defineProperties, Ellipsoid, Event, - JulianDate, Matrix3, Quaternion, Transforms, diff --git a/Source/Renderer/ComputeCommand.js b/Source/Renderer/ComputeCommand.js index 0c7f29085be8..2e7678276f76 100644 --- a/Source/Renderer/ComputeCommand.js +++ b/Source/Renderer/ComputeCommand.js @@ -1,11 +1,9 @@ /*global define*/ define([ '../Core/defaultValue', - '../Core/PrimitiveType', '../Scene/Pass' ], function( defaultValue, - PrimitiveType, Pass) { 'use strict'; diff --git a/Source/Renderer/ComputeEngine.js b/Source/Renderer/ComputeEngine.js index 0a04d4a176a3..13235334a893 100644 --- a/Source/Renderer/ComputeEngine.js +++ b/Source/Renderer/ComputeEngine.js @@ -2,17 +2,11 @@ define([ '../Core/BoundingRectangle', '../Core/Color', - '../Core/ComponentDatatype', - '../Core/defaultValue', '../Core/defined', - '../Core/defineProperties', '../Core/destroyObject', '../Core/DeveloperError', - '../Core/Geometry', - '../Core/GeometryAttribute', '../Core/PrimitiveType', '../Shaders/ViewportQuadVS', - './BufferUsage', './ClearCommand', './DrawCommand', './Framebuffer', @@ -21,17 +15,11 @@ define([ ], function( BoundingRectangle, Color, - ComponentDatatype, - defaultValue, defined, - defineProperties, destroyObject, DeveloperError, - Geometry, - GeometryAttribute, PrimitiveType, ViewportQuadVS, - BufferUsage, ClearCommand, DrawCommand, Framebuffer, diff --git a/Source/Renderer/Context.js b/Source/Renderer/Context.js index 760b0d718346..ca41b53f505f 100644 --- a/Source/Renderer/Context.js +++ b/Source/Renderer/Context.js @@ -9,10 +9,8 @@ define([ '../Core/defineProperties', '../Core/destroyObject', '../Core/DeveloperError', - '../Core/FeatureDetection', '../Core/Geometry', '../Core/GeometryAttribute', - '../Core/Math', '../Core/Matrix4', '../Core/PrimitiveType', '../Core/RuntimeError', @@ -24,8 +22,6 @@ define([ './DrawCommand', './PassState', './PickFramebuffer', - './PixelDatatype', - './RenderbufferFormat', './RenderState', './ShaderCache', './ShaderProgram', @@ -43,10 +39,8 @@ define([ defineProperties, destroyObject, DeveloperError, - FeatureDetection, Geometry, GeometryAttribute, - CesiumMath, Matrix4, PrimitiveType, RuntimeError, @@ -58,8 +52,6 @@ define([ DrawCommand, PassState, PickFramebuffer, - PixelDatatype, - RenderbufferFormat, RenderState, ShaderCache, ShaderProgram, diff --git a/Source/Renderer/CubeMap.js b/Source/Renderer/CubeMap.js index 3f033e3391d8..4947d22d9e72 100644 --- a/Source/Renderer/CubeMap.js +++ b/Source/Renderer/CubeMap.js @@ -13,8 +13,7 @@ define([ './PixelDatatype', './Sampler', './TextureMagnificationFilter', - './TextureMinificationFilter', - './TextureWrap' + './TextureMinificationFilter' ], function( defaultValue, defined, @@ -29,8 +28,7 @@ define([ PixelDatatype, Sampler, TextureMagnificationFilter, - TextureMinificationFilter, - TextureWrap) { + TextureMinificationFilter) { 'use strict'; function CubeMap(options) { diff --git a/Source/Renderer/PassState.js b/Source/Renderer/PassState.js index 62d8c25c50d3..4a0e5515143a 100644 --- a/Source/Renderer/PassState.js +++ b/Source/Renderer/PassState.js @@ -1,8 +1,5 @@ /*global define*/ -define([ - '../Core/BoundingRectangle' - ], function( - BoundingRectangle) { +define([], function() { 'use strict'; /** diff --git a/Source/Renderer/RenderState.js b/Source/Renderer/RenderState.js index 523b8711e247..92aea5c35a45 100644 --- a/Source/Renderer/RenderState.js +++ b/Source/Renderer/RenderState.js @@ -5,7 +5,6 @@ define([ '../Core/defaultValue', '../Core/defined', '../Core/DeveloperError', - '../Core/RuntimeError', '../Core/WindingOrder', './ContextLimits', './WebGLConstants' @@ -15,7 +14,6 @@ define([ defaultValue, defined, DeveloperError, - RuntimeError, WindingOrder, ContextLimits, WebGLConstants) { diff --git a/Source/Renderer/Texture.js b/Source/Renderer/Texture.js index aa13b97ef5b6..bc2876a82f65 100644 --- a/Source/Renderer/Texture.js +++ b/Source/Renderer/Texture.js @@ -14,7 +14,6 @@ define([ './Sampler', './TextureMagnificationFilter', './TextureMinificationFilter', - './TextureWrap', './WebGLConstants' ], function( Cartesian2, @@ -31,7 +30,6 @@ define([ Sampler, TextureMagnificationFilter, TextureMinificationFilter, - TextureWrap, WebGLConstants) { 'use strict'; diff --git a/Source/Renderer/createUniformArray.js b/Source/Renderer/createUniformArray.js index 843aeb77060b..0a55769997ab 100644 --- a/Source/Renderer/createUniformArray.js +++ b/Source/Renderer/createUniformArray.js @@ -5,7 +5,6 @@ define([ '../Core/Cartesian4', '../Core/Color', '../Core/defined', - '../Core/defineProperties', '../Core/DeveloperError', '../Core/Matrix2', '../Core/Matrix3', @@ -17,7 +16,6 @@ define([ Cartesian4, Color, defined, - defineProperties, DeveloperError, Matrix2, Matrix3, diff --git a/Source/Scene/ArcGisMapServerImageryProvider.js b/Source/Scene/ArcGisMapServerImageryProvider.js index ac00c0c1d7c0..e8d4f067347e 100644 --- a/Source/Scene/ArcGisMapServerImageryProvider.js +++ b/Source/Scene/ArcGisMapServerImageryProvider.js @@ -9,7 +9,6 @@ define([ '../Core/defineProperties', '../Core/DeveloperError', '../Core/Event', - '../Core/GeographicProjection', '../Core/GeographicTilingScheme', '../Core/loadJson', '../Core/loadJsonp', @@ -33,7 +32,6 @@ define([ defineProperties, DeveloperError, Event, - GeographicProjection, GeographicTilingScheme, loadJson, loadJsonp, diff --git a/Source/Scene/BillboardCollection.js b/Source/Scene/BillboardCollection.js index 78836da2f652..34370f8819de 100644 --- a/Source/Scene/BillboardCollection.js +++ b/Source/Scene/BillboardCollection.js @@ -22,6 +22,7 @@ define([ '../Renderer/ShaderProgram', '../Renderer/ShaderSource', '../Renderer/VertexArrayFacade', + '../Renderer/WebGLConstants', '../Shaders/BillboardCollectionFS', '../Shaders/BillboardCollectionVS', './Billboard', @@ -55,6 +56,7 @@ define([ ShaderProgram, ShaderSource, VertexArrayFacade, + WebGLConstants, BillboardCollectionFS, BillboardCollectionVS, Billboard, @@ -915,7 +917,7 @@ define([ } var textureWidth = billboardCollection._textureAtlas.texture.width; - var imageWidth = Math.ceil(defaultValue(billboard.width, textureWidth * width) * 0.5); + var imageWidth = Math.round(defaultValue(billboard.width, textureWidth * width)); billboardCollection._maxSize = Math.max(billboardCollection._maxSize, imageWidth); var compressed0 = CesiumMath.clamp(imageWidth, 0.0, LEFT_SHIFT16); @@ -970,7 +972,7 @@ define([ } var dimensions = billboardCollection._textureAtlas.texture.dimensions; - var imageHeight = Math.ceil(defaultValue(billboard.height, dimensions.y * height) * 0.5); + var imageHeight = Math.round(defaultValue(billboard.height, dimensions.y * height)); billboardCollection._maxSize = Math.max(billboardCollection._maxSize, imageHeight); var red = Color.floatToByte(color.red); @@ -1424,7 +1426,8 @@ define([ if (!defined(this._rs)) { this._rs = RenderState.fromCache({ depthTest : { - enabled : true + enabled : true, + func : WebGLConstants.LEQUAL // Allows label glyphs and billboards to overlap. }, blending : BlendingState.ALPHA_BLEND }); diff --git a/Source/Scene/Camera.js b/Source/Scene/Camera.js index ee5dba704e7f..49799f1218ee 100644 --- a/Source/Scene/Camera.js +++ b/Source/Scene/Camera.js @@ -927,7 +927,7 @@ define([ } var globe = this._scene.globe; - var globeFinishedUpdating = !defined(globe) || (globe._surface.tileProvider.ready && !defined(globe._surface._tileLoadQueue.head) && globe._surface._debug.tilesWaitingForChildren === 0); + var globeFinishedUpdating = !defined(globe) || (globe._surface.tileProvider.ready && globe._surface._tileLoadQueueHigh.length === 0 && globe._surface._tileLoadQueueMedium.length === 0 && globe._surface._tileLoadQueueLow.length === 0 && globe._surface._debug.tilesWaitingForChildren === 0); if (this._suspendTerrainAdjustment) { this._suspendTerrainAdjustment = !globeFinishedUpdating; } diff --git a/Source/Scene/DebugCameraPrimitive.js b/Source/Scene/DebugCameraPrimitive.js index 12df3e1ddb1b..ffcf283e6cf1 100644 --- a/Source/Scene/DebugCameraPrimitive.js +++ b/Source/Scene/DebugCameraPrimitive.js @@ -10,7 +10,6 @@ define([ '../Core/defined', '../Core/destroyObject', '../Core/DeveloperError', - '../Core/Geometry', '../Core/GeometryAttribute', '../Core/GeometryAttributes', '../Core/GeometryInstance', @@ -29,7 +28,6 @@ define([ defined, destroyObject, DeveloperError, - Geometry, GeometryAttribute, GeometryAttributes, GeometryInstance, diff --git a/Source/Scene/DeviceOrientationCameraController.js b/Source/Scene/DeviceOrientationCameraController.js index 189c125f42b9..0b026cdc0a38 100644 --- a/Source/Scene/DeviceOrientationCameraController.js +++ b/Source/Scene/DeviceOrientationCameraController.js @@ -1,6 +1,5 @@ /*global define*/ define([ - '../Core/defaultValue', '../Core/defined', '../Core/destroyObject', '../Core/DeveloperError', @@ -8,7 +7,6 @@ define([ '../Core/Matrix3', '../Core/Quaternion' ], function( - defaultValue, defined, destroyObject, DeveloperError, diff --git a/Source/Scene/GetFeatureInfoFormat.js b/Source/Scene/GetFeatureInfoFormat.js index 8c370b3ae868..c5fac1744df5 100644 --- a/Source/Scene/GetFeatureInfoFormat.js +++ b/Source/Scene/GetFeatureInfoFormat.js @@ -1,14 +1,12 @@ /*global define*/ define([ '../Core/Cartographic', - '../Core/defaultValue', '../Core/defined', '../Core/DeveloperError', '../Core/RuntimeError', './ImageryLayerFeatureInfo' ], function( Cartographic, - defaultValue, defined, DeveloperError, RuntimeError, diff --git a/Source/Scene/Globe.js b/Source/Scene/Globe.js index e84b483997b0..ee15de74b801 100644 --- a/Source/Scene/Globe.js +++ b/Source/Scene/Globe.js @@ -12,7 +12,6 @@ define([ '../Core/Ellipsoid', '../Core/EllipsoidTerrainProvider', '../Core/Event', - '../Core/GeographicProjection', '../Core/IntersectionTests', '../Core/loadImage', '../Core/Ray', @@ -42,7 +41,6 @@ define([ Ellipsoid, EllipsoidTerrainProvider, Event, - GeographicProjection, IntersectionTests, loadImage, Ray, @@ -373,6 +371,10 @@ define([ var scratchGetHeightCartographic = new Cartographic(); var scratchGetHeightRay = new Ray(); + function tileIfContainsCartographic(tile, cartographic) { + return Rectangle.contains(tile.rectangle, cartographic) ? tile : undefined; + } + /** * Get the height of the surface at a given cartographic. * @@ -407,15 +409,10 @@ define([ } while (tile.renderable) { - var children = tile.children; - length = children.length; - - for (i = 0; i < length; ++i) { - tile = children[i]; - if (Rectangle.contains(tile.rectangle, cartographic)) { - break; - } - } + tile = tileIfContainsCartographic(tile.southwestChild, cartographic) || + tileIfContainsCartographic(tile.southeastChild, cartographic) || + tileIfContainsCartographic(tile.northwestChild, cartographic) || + tile.northeastChild; } while (defined(tile) && (!defined(tile.data) || !defined(tile.data.pickTerrain))) { diff --git a/Source/Scene/GlobeDepth.js b/Source/Scene/GlobeDepth.js index e2a28db927aa..20fa390c0bdf 100644 --- a/Source/Scene/GlobeDepth.js +++ b/Source/Scene/GlobeDepth.js @@ -3,7 +3,6 @@ define([ '../Core/BoundingRectangle', '../Core/Color', '../Core/defined', - '../Core/defineProperties', '../Core/destroyObject', '../Core/PixelFormat', '../Renderer/ClearCommand', @@ -16,7 +15,6 @@ define([ BoundingRectangle, Color, defined, - defineProperties, destroyObject, PixelFormat, ClearCommand, diff --git a/Source/Scene/GlobeSurfaceTile.js b/Source/Scene/GlobeSurfaceTile.js index 688680b4a8ac..3d0a226758ac 100644 --- a/Source/Scene/GlobeSurfaceTile.js +++ b/Source/Scene/GlobeSurfaceTile.js @@ -3,13 +3,11 @@ define([ '../Core/BoundingSphere', '../Core/Cartesian3', '../Core/Cartesian4', - '../Core/Cartographic', '../Core/defaultValue', '../Core/defined', '../Core/defineProperties', '../Core/IntersectionTests', '../Core/PixelFormat', - '../Core/Rectangle', '../Renderer/PixelDatatype', '../Renderer/Sampler', '../Renderer/Texture', @@ -20,19 +18,16 @@ define([ './QuadtreeTileLoadState', './SceneMode', './TerrainState', - './TileBoundingBox', './TileTerrain' ], function( BoundingSphere, Cartesian3, Cartesian4, - Cartographic, defaultValue, defined, defineProperties, IntersectionTests, PixelFormat, - Rectangle, PixelDatatype, Sampler, Texture, @@ -43,7 +38,6 @@ define([ QuadtreeTileLoadState, SceneMode, TerrainState, - TileBoundingBox, TileTerrain) { 'use strict'; @@ -449,8 +443,6 @@ define([ } function propagateNewUpsampledDataToChildren(tile) { - var surfaceTile = tile.data; - // Now that there's new data for this tile: // - child tiles that were previously upsampled need to be re-upsampled based on the new data. @@ -458,32 +450,34 @@ define([ // of its ancestors receives new (better) data and we want to re-upsample from the // new data. - if (defined(tile._children)) { - for (var childIndex = 0; childIndex < 4; ++childIndex) { - var childTile = tile._children[childIndex]; - if (childTile.state !== QuadtreeTileLoadState.START) { - var childSurfaceTile = childTile.data; - if (defined(childSurfaceTile.terrainData) && !childSurfaceTile.terrainData.wasCreatedByUpsampling()) { - // Data for the child tile has already been loaded. - continue; - } + propagateNewUpsampledDataToChild(tile, tile._southwestChild); + propagateNewUpsampledDataToChild(tile, tile._southeastChild); + propagateNewUpsampledDataToChild(tile, tile._northwestChild); + propagateNewUpsampledDataToChild(tile, tile._northeastChild); + } - // Restart the upsampling process, no matter its current state. - // We create a new instance rather than just restarting the existing one - // because there could be an asynchronous operation pending on the existing one. - if (defined(childSurfaceTile.upsampledTerrain)) { - childSurfaceTile.upsampledTerrain.freeResources(); - } - childSurfaceTile.upsampledTerrain = new TileTerrain({ - data : surfaceTile.terrainData, - x : tile.x, - y : tile.y, - level : tile.level - }); - - childTile.state = QuadtreeTileLoadState.LOADING; - } + function propagateNewUpsampledDataToChild(tile, childTile) { + if (defined(childTile) && childTile.state !== QuadtreeTileLoadState.START) { + var childSurfaceTile = childTile.data; + if (defined(childSurfaceTile.terrainData) && !childSurfaceTile.terrainData.wasCreatedByUpsampling()) { + // Data for the child tile has already been loaded. + return; + } + + // Restart the upsampling process, no matter its current state. + // We create a new instance rather than just restarting the existing one + // because there could be an asynchronous operation pending on the existing one. + if (defined(childSurfaceTile.upsampledTerrain)) { + childSurfaceTile.upsampledTerrain.freeResources(); } + childSurfaceTile.upsampledTerrain = new TileTerrain({ + data : tile.data.terrainData, + x : tile.x, + y : tile.y, + level : tile.level + }); + + childTile.state = QuadtreeTileLoadState.LOADING; } } @@ -494,40 +488,42 @@ define([ // - child tiles that were previously upsampled need to be re-upsampled based on the new data. // - child tiles that were previously deemed unavailable may now be available. - if (defined(tile.children)) { - for (var childIndex = 0; childIndex < 4; ++childIndex) { - var childTile = tile.children[childIndex]; - if (childTile.state !== QuadtreeTileLoadState.START) { - var childSurfaceTile = childTile.data; - if (defined(childSurfaceTile.terrainData) && !childSurfaceTile.terrainData.wasCreatedByUpsampling()) { - // Data for the child tile has already been loaded. - continue; - } + propagateNewLoadedDataToChildTile(tile, surfaceTile, tile.southwestChild); + propagateNewLoadedDataToChildTile(tile, surfaceTile, tile.southeastChild); + propagateNewLoadedDataToChildTile(tile, surfaceTile, tile.northwestChild); + propagateNewLoadedDataToChildTile(tile, surfaceTile, tile.northeastChild); + } - // Restart the upsampling process, no matter its current state. - // We create a new instance rather than just restarting the existing one - // because there could be an asynchronous operation pending on the existing one. - if (defined(childSurfaceTile.upsampledTerrain)) { - childSurfaceTile.upsampledTerrain.freeResources(); - } - childSurfaceTile.upsampledTerrain = new TileTerrain({ - data : surfaceTile.terrainData, - x : tile.x, - y : tile.y, - level : tile.level - }); - - if (surfaceTile.terrainData.isChildAvailable(tile.x, tile.y, childTile.x, childTile.y)) { - // Data is available for the child now. It might have been before, too. - if (!defined(childSurfaceTile.loadedTerrain)) { - // No load process is in progress, so start one. - childSurfaceTile.loadedTerrain = new TileTerrain(); - } - } + function propagateNewLoadedDataToChildTile(tile, surfaceTile, childTile) { + if (childTile.state !== QuadtreeTileLoadState.START) { + var childSurfaceTile = childTile.data; + if (defined(childSurfaceTile.terrainData) && !childSurfaceTile.terrainData.wasCreatedByUpsampling()) { + // Data for the child tile has already been loaded. + return; + } - childTile.state = QuadtreeTileLoadState.LOADING; + // Restart the upsampling process, no matter its current state. + // We create a new instance rather than just restarting the existing one + // because there could be an asynchronous operation pending on the existing one. + if (defined(childSurfaceTile.upsampledTerrain)) { + childSurfaceTile.upsampledTerrain.freeResources(); + } + childSurfaceTile.upsampledTerrain = new TileTerrain({ + data : surfaceTile.terrainData, + x : tile.x, + y : tile.y, + level : tile.level + }); + + if (surfaceTile.terrainData.isChildAvailable(tile.x, tile.y, childTile.x, childTile.y)) { + // Data is available for the child now. It might have been before, too. + if (!defined(childSurfaceTile.loadedTerrain)) { + // No load process is in progress, so start one. + childSurfaceTile.loadedTerrain = new TileTerrain(); } } + + childTile.state = QuadtreeTileLoadState.LOADING; } } diff --git a/Source/Scene/GlobeSurfaceTileProvider.js b/Source/Scene/GlobeSurfaceTileProvider.js index ee3685490408..20f3a40ecb2f 100644 --- a/Source/Scene/GlobeSurfaceTileProvider.js +++ b/Source/Scene/GlobeSurfaceTileProvider.js @@ -13,7 +13,6 @@ define([ '../Core/destroyObject', '../Core/DeveloperError', '../Core/Event', - '../Core/FeatureDetection', '../Core/GeometryInstance', '../Core/GeometryPipeline', '../Core/IndexDatatype', @@ -38,10 +37,8 @@ define([ '../Scene/Pass', '../Scene/PerInstanceColorAppearance', '../Scene/Primitive', - '../ThirdParty/when', './GlobeSurfaceTile', './ImageryLayer', - './ImageryState', './QuadtreeTileLoadState', './SceneMode', './ShadowMode' @@ -59,7 +56,6 @@ define([ destroyObject, DeveloperError, Event, - FeatureDetection, GeometryInstance, GeometryPipeline, IndexDatatype, @@ -84,10 +80,8 @@ define([ Pass, PerInstanceColorAppearance, Primitive, - when, GlobeSurfaceTile, ImageryLayer, - ImageryState, QuadtreeTileLoadState, SceneMode, ShadowMode) { diff --git a/Source/Scene/GroundPrimitive.js b/Source/Scene/GroundPrimitive.js index 3704f14a5c6a..c35c4b1828c5 100644 --- a/Source/Scene/GroundPrimitive.js +++ b/Source/Scene/GroundPrimitive.js @@ -1,6 +1,5 @@ /*global define*/ define([ - '../Core/AssociativeArray', '../Core/BoundingSphere', '../Core/buildModuleUrl', '../Core/Cartesian2', @@ -18,10 +17,7 @@ define([ '../Core/isArray', '../Core/loadJson', '../Core/Math', - '../Core/Matrix3', - '../Core/Matrix4', '../Core/OrientedBoundingBox', - '../Core/PolygonGeometry', '../Core/Rectangle', '../Renderer/DrawCommand', '../Renderer/RenderState', @@ -39,7 +35,6 @@ define([ './StencilFunction', './StencilOperation' ], function( - AssociativeArray, BoundingSphere, buildModuleUrl, Cartesian2, @@ -57,10 +52,7 @@ define([ isArray, loadJson, CesiumMath, - Matrix3, - Matrix4, OrientedBoundingBox, - PolygonGeometry, Rectangle, DrawCommand, RenderState, diff --git a/Source/Scene/ImageryLayer.js b/Source/Scene/ImageryLayer.js index 1aa9d3c1aed6..3a0a04d7f99e 100644 --- a/Source/Scene/ImageryLayer.js +++ b/Source/Scene/ImageryLayer.js @@ -1,10 +1,7 @@ /*global define*/ define([ - '../Core/BoundingRectangle', '../Core/Cartesian2', '../Core/Cartesian4', - '../Core/Color', - '../Core/ComponentDatatype', '../Core/defaultValue', '../Core/defined', '../Core/defineProperties', @@ -14,7 +11,6 @@ define([ '../Core/IndexDatatype', '../Core/Math', '../Core/PixelFormat', - '../Core/PrimitiveType', '../Core/Rectangle', '../Core/TerrainProvider', '../Core/TileProviderError', @@ -22,13 +18,9 @@ define([ '../Core/WebMercatorTilingScheme', '../Renderer/Buffer', '../Renderer/BufferUsage', - '../Renderer/ClearCommand', '../Renderer/ComputeCommand', '../Renderer/ContextLimits', - '../Renderer/DrawCommand', - '../Renderer/Framebuffer', '../Renderer/MipmapHint', - '../Renderer/RenderState', '../Renderer/Sampler', '../Renderer/ShaderProgram', '../Renderer/ShaderSource', @@ -44,11 +36,8 @@ define([ './ImageryState', './TileImagery' ], function( - BoundingRectangle, Cartesian2, Cartesian4, - Color, - ComponentDatatype, defaultValue, defined, defineProperties, @@ -58,7 +47,6 @@ define([ IndexDatatype, CesiumMath, PixelFormat, - PrimitiveType, Rectangle, TerrainProvider, TileProviderError, @@ -66,13 +54,9 @@ define([ WebMercatorTilingScheme, Buffer, BufferUsage, - ClearCommand, ComputeCommand, ContextLimits, - DrawCommand, - Framebuffer, MipmapHint, - RenderState, Sampler, ShaderProgram, ShaderSource, @@ -567,6 +551,10 @@ define([ imageryRectangle = imageryTileXYToRectangle(i, northwestTileCoordinates.y, imageryLevel); clippedImageryRectangle = Rectangle.simpleIntersection(imageryRectangle, imageryBounds, clippedRectangleScratch); + if (!defined(clippedImageryRectangle)) { + continue; + } + maxU = Math.min(1.0, (clippedImageryRectangle.east - terrainRectangle.west) / terrainRectangle.width); // If this is the eastern-most imagery tile mapped to this terrain tile, @@ -584,6 +572,11 @@ define([ imageryRectangle = imageryTileXYToRectangle(i, j, imageryLevel); clippedImageryRectangle = Rectangle.simpleIntersection(imageryRectangle, imageryBounds, clippedRectangleScratch); + + if (!defined(clippedImageryRectangle)) { + continue; + } + minV = Math.max(0.0, (clippedImageryRectangle.south - terrainRectangle.south) / terrainRectangle.height); // If this is the southern-most imagery tile mapped to this terrain tile, diff --git a/Source/Scene/LabelCollection.js b/Source/Scene/LabelCollection.js index bbaa96c887a8..ef069035280d 100644 --- a/Source/Scene/LabelCollection.js +++ b/Source/Scene/LabelCollection.js @@ -9,7 +9,6 @@ define([ '../Core/Matrix4', '../Core/writeTextToCanvas', './BillboardCollection', - './HeightReference', './HorizontalOrigin', './Label', './LabelStyle', @@ -25,7 +24,6 @@ define([ Matrix4, writeTextToCanvas, BillboardCollection, - HeightReference, HorizontalOrigin, Label, LabelStyle, @@ -227,8 +225,13 @@ define([ for (glyphIndex = 0; glyphIndex < glyphLength; ++glyphIndex) { glyph = glyphs[glyphIndex]; dimensions = glyph.dimensions; - totalWidth += dimensions.computedWidth; maxHeight = Math.max(maxHeight, dimensions.height); + + //Computing the total width must also account for the kering that occurs between letters. + totalWidth += dimensions.width - dimensions.bounds.minx; + if (glyphIndex < glyphLength - 1) { + totalWidth += glyphs[glyphIndex + 1].dimensions.bounds.minx; + } } var scale = label._scale; @@ -262,7 +265,13 @@ define([ glyph.billboard._setTranslate(glyphPixelOffset); } - glyphPixelOffset.x += dimensions.computedWidth * scale * resolutionScale; + //Compute the next x offset taking into acocunt the kerning performed + //on both the current letter as well as the next letter to be drawn + //as well as any applied scale. + if (glyphIndex < glyphLength - 1) { + var nextGlyph = glyphs[glyphIndex + 1]; + glyphPixelOffset.x += ((dimensions.width - dimensions.bounds.minx) + nextGlyph.dimensions.bounds.minx) * scale * resolutionScale; + } } } diff --git a/Source/Scene/Model.js b/Source/Scene/Model.js index aeb2b6014d9e..21ea901ad0d8 100644 --- a/Source/Scene/Model.js +++ b/Source/Scene/Model.js @@ -8,7 +8,6 @@ define([ '../Core/clone', '../Core/Color', '../Core/combine', - '../Core/ComponentDatatype', '../Core/defaultValue', '../Core/defined', '../Core/defineProperties', @@ -69,7 +68,6 @@ define([ clone, Color, combine, - ComponentDatatype, defaultValue, defined, defineProperties, diff --git a/Source/Scene/ModelNode.js b/Source/Scene/ModelNode.js index bf377a3b26c5..0f2503564c80 100644 --- a/Source/Scene/ModelNode.js +++ b/Source/Scene/ModelNode.js @@ -1,10 +1,8 @@ /*global define*/ define([ - '../Core/defaultValue', '../Core/defineProperties', '../Core/Matrix4' ], function( - defaultValue, defineProperties, Matrix4) { 'use strict'; diff --git a/Source/Scene/OrthographicFrustum.js b/Source/Scene/OrthographicFrustum.js index 4bf7cc0264dc..9c709b191809 100644 --- a/Source/Scene/OrthographicFrustum.js +++ b/Source/Scene/OrthographicFrustum.js @@ -1,6 +1,5 @@ /*global define*/ define([ - '../Core/Cartesian2', '../Core/Cartesian3', '../Core/Cartesian4', '../Core/defined', @@ -9,7 +8,6 @@ define([ '../Core/Matrix4', './CullingVolume' ], function( - Cartesian2, Cartesian3, Cartesian4, defined, diff --git a/Source/Scene/PerformanceDisplay.js b/Source/Scene/PerformanceDisplay.js index c27a6c4e48c6..d624d002b561 100644 --- a/Source/Scene/PerformanceDisplay.js +++ b/Source/Scene/PerformanceDisplay.js @@ -1,6 +1,5 @@ /*global define*/ define([ - '../Core/Color', '../Core/defaultValue', '../Core/defined', '../Core/destroyObject', @@ -8,7 +7,6 @@ define([ '../Core/getTimestamp', '../Widgets/getElement' ], function( - Color, defaultValue, defined, destroyObject, diff --git a/Source/Scene/PerspectiveOffCenterFrustum.js b/Source/Scene/PerspectiveOffCenterFrustum.js index 32b2001c8555..fdb5322fe548 100644 --- a/Source/Scene/PerspectiveOffCenterFrustum.js +++ b/Source/Scene/PerspectiveOffCenterFrustum.js @@ -1,19 +1,15 @@ /*global define*/ define([ - '../Core/Cartesian2', '../Core/Cartesian3', '../Core/Cartesian4', - '../Core/defaultValue', '../Core/defined', '../Core/defineProperties', '../Core/DeveloperError', '../Core/Matrix4', './CullingVolume' ], function( - Cartesian2, Cartesian3, Cartesian4, - defaultValue, defined, defineProperties, DeveloperError, diff --git a/Source/Scene/PickDepth.js b/Source/Scene/PickDepth.js index 38598d1d0fba..5e1f85e3e510 100644 --- a/Source/Scene/PickDepth.js +++ b/Source/Scene/PickDepth.js @@ -1,24 +1,20 @@ /*global define*/ define([ '../Core/defined', - '../Core/defineProperties', '../Core/destroyObject', '../Core/PixelFormat', '../Renderer/Framebuffer', '../Renderer/PixelDatatype', '../Renderer/RenderState', - '../Renderer/Texture', - '../Shaders/PostProcessFilters/PassThrough' + '../Renderer/Texture' ], function( defined, - defineProperties, destroyObject, PixelFormat, Framebuffer, PixelDatatype, RenderState, - Texture, - PassThrough) { + Texture) { 'use strict'; /** diff --git a/Source/Scene/PointAppearance.js b/Source/Scene/PointAppearance.js index a8e88aac6e2d..ee481d512c1c 100644 --- a/Source/Scene/PointAppearance.js +++ b/Source/Scene/PointAppearance.js @@ -1,6 +1,5 @@ /*global define*/ define([ - '../Core/clone', '../Core/Color', '../Core/combine', '../Core/defaultValue', @@ -11,7 +10,6 @@ define([ '../Shaders/Appearances/PointAppearanceVS', './Appearance' ], function( - clone, Color, combine, defaultValue, diff --git a/Source/Scene/PointPrimitiveCollection.js b/Source/Scene/PointPrimitiveCollection.js index 1d4a241b7dc4..2c469a20ef22 100644 --- a/Source/Scene/PointPrimitiveCollection.js +++ b/Source/Scene/PointPrimitiveCollection.js @@ -1,8 +1,6 @@ /*global define*/ define([ '../Core/BoundingSphere', - '../Core/Cartesian2', - '../Core/Cartesian3', '../Core/Color', '../Core/ComponentDatatype', '../Core/defaultValue', @@ -21,6 +19,7 @@ define([ '../Renderer/ShaderProgram', '../Renderer/ShaderSource', '../Renderer/VertexArrayFacade', + '../Renderer/WebGLConstants', '../Shaders/PointPrimitiveCollectionFS', '../Shaders/PointPrimitiveCollectionVS', './BlendingState', @@ -29,8 +28,6 @@ define([ './SceneMode' ], function( BoundingSphere, - Cartesian2, - Cartesian3, Color, ComponentDatatype, defaultValue, @@ -49,6 +46,7 @@ define([ ShaderProgram, ShaderSource, VertexArrayFacade, + WebGLConstants, PointPrimitiveCollectionFS, PointPrimitiveCollectionVS, BlendingState, @@ -852,7 +850,8 @@ define([ if (!defined(this._rs)) { this._rs = RenderState.fromCache({ depthTest : { - enabled : true + enabled : true, + func : WebGLConstants.LEQUAL }, blending : BlendingState.ALPHA_BLEND }); diff --git a/Source/Scene/Primitive.js b/Source/Scene/Primitive.js index ad03055caeec..51205cf09503 100644 --- a/Source/Scene/Primitive.js +++ b/Source/Scene/Primitive.js @@ -19,14 +19,11 @@ define([ '../Core/Geometry', '../Core/GeometryAttribute', '../Core/GeometryAttributes', - '../Core/GeometryInstance', - '../Core/GeometryInstanceAttribute', '../Core/isArray', '../Core/Matrix4', '../Core/RuntimeError', '../Core/subdivideArray', '../Core/TaskProcessor', - '../Renderer/Buffer', '../Renderer/BufferUsage', '../Renderer/ContextLimits', '../Renderer/DrawCommand', @@ -62,14 +59,11 @@ define([ Geometry, GeometryAttribute, GeometryAttributes, - GeometryInstance, - GeometryInstanceAttribute, isArray, Matrix4, RuntimeError, subdivideArray, TaskProcessor, - Buffer, BufferUsage, ContextLimits, DrawCommand, diff --git a/Source/Scene/PrimitivePipeline.js b/Source/Scene/PrimitivePipeline.js index aa50aab5f3db..dfffa094a7f5 100644 --- a/Source/Scene/PrimitivePipeline.js +++ b/Source/Scene/PrimitivePipeline.js @@ -1,9 +1,7 @@ /*global define*/ define([ '../Core/BoundingSphere', - '../Core/Color', '../Core/ComponentDatatype', - '../Core/defaultValue', '../Core/defined', '../Core/DeveloperError', '../Core/Ellipsoid', @@ -18,9 +16,7 @@ define([ '../Core/WebMercatorProjection' ], function( BoundingSphere, - Color, ComponentDatatype, - defaultValue, defined, DeveloperError, Ellipsoid, diff --git a/Source/Scene/QuadtreePrimitive.js b/Source/Scene/QuadtreePrimitive.js index 3c013df87671..782230e37ea2 100644 --- a/Source/Scene/QuadtreePrimitive.js +++ b/Source/Scene/QuadtreePrimitive.js @@ -95,8 +95,9 @@ define([ var ellipsoid = tilingScheme.ellipsoid; this._tilesToRender = []; - this._tileTraversalQueue = new Queue(); - this._tileLoadQueue = []; + this._tileLoadQueueHigh = []; // high priority tiles are preventing refinement + this._tileLoadQueueMedium = []; // medium priority tiles are being rendered + this._tileLoadQueueLow = []; // low priority tiles were refined past or are non-visible parts of quads. this._tileReplacementQueue = new TileReplacementQueue(); this._levelZeroTiles = undefined; this._levelZeroTilesReady = false; @@ -284,7 +285,9 @@ define([ debug.tilesRendered = 0; debug.tilesWaitingForChildren = 0; - this._tileLoadQueue.length = 0; + this._tileLoadQueueHigh.length = 0; + this._tileLoadQueueMedium.length = 0; + this._tileLoadQueueLow.length = 0; this._tileReplacementQueue.markStartOfRenderFrame(); }; @@ -386,6 +389,20 @@ define([ this._tileProvider = this._tileProvider && this._tileProvider.destroy(); }; + var comparisonPoint; + var centerScratch = new Cartographic(); + function compareDistanceToPoint(a, b) { + var center = Rectangle.center(a.rectangle, centerScratch); + var alon = center.longitude - comparisonPoint.longitude; + var alat = center.latitude - comparisonPoint.latitude; + + center = Rectangle.center(b.rectangle, centerScratch); + var blon = center.longitude - comparisonPoint.longitude; + var blat = center.latitude - comparisonPoint.latitude; + + return (alon * alon + alat * alat) - (blon * blon + blat * blat); + } + function selectTilesForRendering(primitive, frameState) { var debug = primitive._debug; if (debug.suspendLodUpdate) { @@ -399,9 +416,6 @@ define([ var tilesToRender = primitive._tilesToRender; tilesToRender.length = 0; - var traversalQueue = primitive._tileTraversalQueue; - traversalQueue.clear(); - // We can't render anything before the level zero tiles exist. if (!defined(primitive._levelZeroTiles)) { if (primitive._tileProvider.ready) { @@ -421,6 +435,12 @@ define([ var tile; var levelZeroTiles = primitive._levelZeroTiles; + // Sort the level zero tiles by the distance from the center to the camera. + // The level zero tiles aren't necessarily a nice neat quad, so we can use the + // quadtree ordering we use elsewhere in the tree + comparisonPoint = frameState.camera.positionCartographic; + levelZeroTiles.sort(compareDistanceToPoint); + var customDataAdded = primitive._addHeightCallbacks; var customDataRemoved = primitive._removeHeightCallbacks; var frameNumber = frameState.frameNumber; @@ -435,70 +455,212 @@ define([ customDataRemoved.length = 0; } - // Enqueue the root tiles that are renderable and visible. + // Our goal with load ordering is to first load all of the tiles we need to + // render the current scene at full detail. Loading any other tiles is just + // a form of prefetching, and we need not do it at all (other concerns aside). This + // simple and obvious statement gets more complicated when we realize that, because + // we don't have bounding volumes for the entire terrain tile pyramid, we don't + // precisely know which tiles we need to render the scene at full detail, until we do + // some loading. + // + // So our load priority is (from high to low): + // 1. Tiles that we _would_ render, except that they're not sufficiently loaded yet. + // Ideally this would only include tiles that we've already determined to be visible, + // but since we don't have reliable visibility information until a tile is loaded, + // and because we (currently) must have all children in a quad renderable before we + // can refine, this pretty much means tiles we'd like to refine to, regardless of + // visibility. (high) + // 2. Tiles that we're rendering. (medium) + // 3. All other tiles. (low) + // + // Within each priority group, tiles should be loaded in approximate near-to-far order, + // but currently they're just loaded in our traversal order which makes no guarantees + // about depth ordering. + + // Traverse in depth-first, near-to-far order. for (i = 0, len = levelZeroTiles.length; i < len; ++i) { tile = levelZeroTiles[i]; primitive._tileReplacementQueue.markTileRendered(tile); - if (tile.needsLoading) { - queueTileLoad(primitive, tile); - } - if (tile.renderable && tileProvider.computeTileVisibility(tile, frameState, occluders) !== Visibility.NONE) { - traversalQueue.enqueue(tile); + if (!tile.renderable) { + if (tile.needsLoading) { + primitive._tileLoadQueueHigh.push(tile); + } + ++debug.tilesWaitingForChildren; + } else if (tileProvider.computeTileVisibility(tile, frameState, occluders) !== Visibility.NONE) { + visitTile(primitive, frameState, tile); } else { - ++debug.tilesCulled; - if (!tile.renderable) { - ++debug.tilesWaitingForChildren; + if (tile.needsLoading) { + primitive._tileLoadQueueLow.push(tile); } + ++debug.tilesCulled; } } - // Traverse the tiles in breadth-first order. - // This ordering allows us to load bigger, lower-detail tiles before smaller, higher-detail ones. - // This maximizes the average detail across the scene and results in fewer sharp transitions - // between very different LODs. - while (defined((tile = traversalQueue.dequeue()))) { - ++debug.tilesVisited; + raiseTileLoadProgressEvent(primitive); + } - primitive._tileReplacementQueue.markTileRendered(tile); - tile._updateCustomData(frameNumber); + function visitTile(primitive, frameState, tile) { + var debug = primitive._debug; - if (tile.level > debug.maxDepth) { - debug.maxDepth = tile.level; - } + ++debug.tilesVisited; + + primitive._tileReplacementQueue.markTileRendered(tile); + tile._updateCustomData(frameState.frameNumber); - // There are a few different algorithms we could use here. - // This one doesn't load children unless we refine to them. - // We may want to revisit this in the future. + if (tile.level > debug.maxDepth) { + debug.maxDepth = tile.level; + } + + if (screenSpaceError(primitive, frameState, tile) < primitive.maximumScreenSpaceError) { + // This tile meets SSE requirements, so render it. + if (tile.needsLoading) { + // Rendered tile meeting SSE loads with medium priority. + primitive._tileLoadQueueMedium.push(tile); + } + addTileToRenderList(primitive, tile); + return; + } - if (screenSpaceError(primitive, frameState, tile) < primitive.maximumScreenSpaceError) { - // This tile meets SSE requirements, so render it. + var southwestChild = tile.southwestChild; + var southeastChild = tile.southeastChild; + var northwestChild = tile.northwestChild; + var northeastChild = tile.northeastChild; + var allAreRenderable = southwestChild.renderable && southeastChild.renderable && + northwestChild.renderable && northeastChild.renderable; + var allAreUpsampled = southwestChild.upsampledFromParent && southeastChild.upsampledFromParent && + northwestChild.upsampledFromParent && northeastChild.upsampledFromParent; + + if (allAreRenderable) { + if (allAreUpsampled) { + // No point in rendering the children because they're all upsampled. Render this tile instead. addTileToRenderList(primitive, tile); - } else if (queueChildrenLoadAndDetermineIfChildrenAreAllRenderable(primitive, tile)) { + + // Load the children even though we're (currently) not going to render them. + // A tile that is "upsampled only" right now might change its tune once it does more loading. + // A tile that is upsampled now and forever should also be done loading, so no harm done. + queueChildLoadNearToFar(primitive, frameState.camera.positionCartographic, southwestChild, southeastChild, northwestChild, northeastChild); + + if (tile.needsLoading) { + // Rendered tile that's not waiting on children loads with medium priority. + primitive._tileLoadQueueMedium.push(tile); + } + } else { // SSE is not good enough and children are loaded, so refine. - var children = tile.children; - // PERFORMANCE_IDEA: traverse children front-to-back so we can avoid sorting by distance later. - for (i = 0, len = children.length; i < len; ++i) { - if (tileProvider.computeTileVisibility(children[i], frameState, occluders) !== Visibility.NONE) { - traversalQueue.enqueue(children[i]); - } else { - ++debug.tilesCulled; - } + // No need to add the children to the load queue because they'll be added (if necessary) when they're visited. + visitVisibleChildrenNearToFar(primitive, southwestChild, southeastChild, northwestChild, northeastChild, frameState); + + if (tile.needsLoading) { + // Tile is not rendered, so load it with low priority. + primitive._tileLoadQueueLow.push(tile); } + } + } else { + // We'd like to refine but can't because not all of our children are renderable. Load the refinement blockers with high priority and + // render this tile in the meantime. + queueChildLoadNearToFar(primitive, frameState.camera.positionCartographic, southwestChild, southeastChild, northwestChild, northeastChild); + addTileToRenderList(primitive, tile); + + if (tile.needsLoading) { + // We will refine this tile when it's possible, so load this tile only with low priority. + primitive._tileLoadQueueLow.push(tile); + } + } + } + + function queueChildLoadNearToFar(primitive, cameraPosition, southwest, southeast, northwest, northeast) { + if (cameraPosition.longitude < southwest.east) { + if (cameraPosition.latitude < southwest.north) { + // Camera in southwest quadrant + queueChildTileLoad(primitive, southwest); + queueChildTileLoad(primitive, southeast); + queueChildTileLoad(primitive, northwest); + queueChildTileLoad(primitive, northeast); } else { - // SSE is not good enough but not all children are loaded, so render this tile anyway. - addTileToRenderList(primitive, tile); + // Camera in northwest quadrant + queueChildTileLoad(primitive, northwest); + queueChildTileLoad(primitive, southwest); + queueChildTileLoad(primitive, northeast); + queueChildTileLoad(primitive, southeast); + } + } else { + if (cameraPosition.latitude < southwest.north) { + // Camera southeast quadrant + queueChildTileLoad(primitive, southeast); + queueChildTileLoad(primitive, southwest); + queueChildTileLoad(primitive, northeast); + queueChildTileLoad(primitive, northwest); + } else { + // Camera in northeast quadrant + queueChildTileLoad(primitive, northeast); + queueChildTileLoad(primitive, northwest); + queueChildTileLoad(primitive, southeast); + queueChildTileLoad(primitive, southwest); } } + } - raiseTileLoadProgressEvent(primitive); + function queueChildTileLoad(primitive, childTile) { + primitive._tileReplacementQueue.markTileRendered(childTile); + if (childTile.needsLoading) { + if (childTile.renderable) { + primitive._tileLoadQueueLow.push(childTile); + } else { + // A tile blocking refine loads with high priority + primitive._tileLoadQueueHigh.push(childTile); + } + } + } + + function visitVisibleChildrenNearToFar(primitive, southwest, southeast, northwest, northeast, frameState) { + var cameraPosition = frameState.camera.positionCartographic; + var tileProvider = primitive._tileProvider; + var occluders = primitive._occluders; + + if (cameraPosition.longitude < southwest.rectangle.east) { + if (cameraPosition.latitude < southwest.rectangle.north) { + // Camera in southwest quadrant + visitIfVisible(primitive, southwest, tileProvider, frameState, occluders); + visitIfVisible(primitive, southeast, tileProvider, frameState, occluders); + visitIfVisible(primitive, northwest, tileProvider, frameState, occluders); + visitIfVisible(primitive, northeast, tileProvider, frameState, occluders); + } else { + // Camera in northwest quadrant + visitIfVisible(primitive, northwest, tileProvider, frameState, occluders); + visitIfVisible(primitive, southwest, tileProvider, frameState, occluders); + visitIfVisible(primitive, northeast, tileProvider, frameState, occluders); + visitIfVisible(primitive, southeast, tileProvider, frameState, occluders); + } + } else { + if (cameraPosition.latitude < southwest.rectangle.north) { + // Camera southeast quadrant + visitIfVisible(primitive, southeast, tileProvider, frameState, occluders); + visitIfVisible(primitive, southwest, tileProvider, frameState, occluders); + visitIfVisible(primitive, northeast, tileProvider, frameState, occluders); + visitIfVisible(primitive, northwest, tileProvider, frameState, occluders); + } else { + // Camera in northeast quadrant + visitIfVisible(primitive, northeast, tileProvider, frameState, occluders); + visitIfVisible(primitive, northwest, tileProvider, frameState, occluders); + visitIfVisible(primitive, southeast, tileProvider, frameState, occluders); + visitIfVisible(primitive, southwest, tileProvider, frameState, occluders); + } + } } + function visitIfVisible(primitive, tile, tileProvider, frameState, occluders) { + if (tileProvider.computeTileVisibility(tile, frameState, occluders) !== Visibility.NONE) { + visitTile(primitive, frameState, tile); + } else { + ++primitive._debug.tilesCulled; + primitive._tileReplacementQueue.markTileRendered(tile); + } + } /** * Checks if the load queue length has changed since the last time we raised a queue change event - if so, raises * a new one. */ function raiseTileLoadProgressEvent(primitive) { - var currentLoadQueueLength = primitive._tileLoadQueue.length; + var currentLoadQueueLength = primitive._tileLoadQueueHigh.length + primitive._tileLoadQueueMedium.length + primitive._tileLoadQueueLow.length; if (currentLoadQueueLength !== primitive._lastTileLoadQueueLength) { primitive._tileLoadProgressEvent.raiseEvent(currentLoadQueueLength); @@ -544,41 +706,13 @@ define([ ++primitive._debug.tilesRendered; } - function queueChildrenLoadAndDetermineIfChildrenAreAllRenderable(primitive, tile) { - var allRenderable = true; - var allUpsampledOnly = true; - - var children = tile.children; - for (var i = 0, len = children.length; i < len; ++i) { - var child = children[i]; - - primitive._tileReplacementQueue.markTileRendered(child); - - allUpsampledOnly = allUpsampledOnly && child.upsampledFromParent; - allRenderable = allRenderable && child.renderable; - - if (child.needsLoading) { - queueTileLoad(primitive, child); - } - } - - if (!allRenderable) { - ++primitive._debug.tilesWaitingForChildren; - } - - // If all children are upsampled from this tile, we just render this tile instead of its children. - return allRenderable && !allUpsampledOnly; - } - - function queueTileLoad(primitive, tile) { - primitive._tileLoadQueue.push(tile); - } - function processTileLoadQueue(primitive, frameState) { - var tileLoadQueue = primitive._tileLoadQueue; + var tileLoadQueueHigh = primitive._tileLoadQueueHigh; + var tileLoadQueueMedium = primitive._tileLoadQueueMedium; + var tileLoadQueueLow = primitive._tileLoadQueueLow; var tileProvider = primitive._tileProvider; - if (tileLoadQueue.length === 0) { + if (tileLoadQueueHigh.length === 0 && tileLoadQueueMedium.length === 0 && tileLoadQueueLow.length === 0) { return; } @@ -586,17 +720,18 @@ define([ // we're allowed to keep. primitive._tileReplacementQueue.trimTiles(primitive.tileCacheSize); - var startTime = getTimestamp(); - var timeSlice = primitive._loadQueueTimeSlice; - var endTime = startTime + timeSlice; + var endTime = getTimestamp() + primitive._loadQueueTimeSlice; + + processSinglePriorityLoadQueue(primitive, frameState, tileProvider, endTime, tileLoadQueueHigh); + processSinglePriorityLoadQueue(primitive, frameState, tileProvider, endTime, tileLoadQueueMedium); + processSinglePriorityLoadQueue(primitive, frameState, tileProvider, endTime, tileLoadQueueLow); + } - for (var i = tileLoadQueue.length - 1; i >= 0; --i) { - var tile = tileLoadQueue[i]; + function processSinglePriorityLoadQueue(primitive, frameState, tileProvider, endTime, loadQueue) { + for (var i = 0, len = loadQueue.length; i < len && getTimestamp() < endTime; ++i) { + var tile = loadQueue[i]; primitive._tileReplacementQueue.markTileRendered(tile); tileProvider.loadTile(frameState, tile); - if (getTimestamp() >= endTime) { - break; - } } } @@ -687,17 +822,11 @@ define([ } } - function tileDistanceSortFunction(a, b) { - return a._distance - b._distance; - } - function createRenderCommandsForSelectedTiles(primitive, frameState) { var tileProvider = primitive._tileProvider; var tilesToRender = primitive._tilesToRender; var tilesToUpdateHeights = primitive._tileToUpdateHeights; - tilesToRender.sort(tileDistanceSortFunction); - for (var i = 0, len = tilesToRender.length; i < len; ++i) { var tile = tilesToRender[i]; tileProvider.showTileThisFrame(tile, frameState); diff --git a/Source/Scene/QuadtreeTile.js b/Source/Scene/QuadtreeTile.js index bce4d3442a15..1609bf12dfe1 100644 --- a/Source/Scene/QuadtreeTile.js +++ b/Source/Scene/QuadtreeTile.js @@ -52,7 +52,11 @@ define([ this._level = options.level; this._parent = options.parent; this._rectangle = this._tilingScheme.tileXYToRectangle(this._x, this._y, this._level); - this._children = undefined; + + this._southwestChild = undefined; + this._southeastChild = undefined; + this._northwestChild = undefined; + this._northeastChild = undefined; // QuadtreeTileReplacementQueue gets/sets these private properties. this._replacementPrevious = undefined; @@ -254,39 +258,83 @@ define([ */ children : { get : function() { - if (!defined(this._children)) { - var tilingScheme = this.tilingScheme; - var level = this.level + 1; - var x = this.x * 2; - var y = this.y * 2; - this._children = [new QuadtreeTile({ - tilingScheme : tilingScheme, - x : x, - y : y, - level : level, - parent : this - }), new QuadtreeTile({ - tilingScheme : tilingScheme, - x : x + 1, - y : y, - level : level, + return [this.northwestChild, this.northeastChild, this.southwestChild, this.southeastChild]; + } + }, + + /** + * Gets the southwest child tile. + * @type {QuadtreeTile} + */ + southwestChild : { + get : function() { + if (!defined(this._southwestChild)) { + this._southwestChild = new QuadtreeTile({ + tilingScheme : this.tilingScheme, + x : this.x * 2, + y : this.y * 2 + 1, + level : this.level + 1, parent : this - }), new QuadtreeTile({ - tilingScheme : tilingScheme, - x : x, - y : y + 1, - level : level, + }); + } + return this._southwestChild; + } + }, + + /** + * Gets the southeast child tile. + * @type {QuadtreeTile} + */ + southeastChild : { + get : function() { + if (!defined(this._southeastChild)) { + this._southeastChild = new QuadtreeTile({ + tilingScheme : this.tilingScheme, + x : this.x * 2 + 1, + y : this.y * 2 + 1, + level : this.level + 1, parent : this - }), new QuadtreeTile({ - tilingScheme : tilingScheme, - x : x + 1, - y : y + 1, - level : level, + }); + } + return this._southeastChild; + } + }, + + /** + * Gets the northwest child tile. + * @type {QuadtreeTile} + */ + northwestChild : { + get : function() { + if (!defined(this._northwestChild)) { + this._northwestChild = new QuadtreeTile({ + tilingScheme : this.tilingScheme, + x : this.x * 2, + y : this.y * 2, + level : this.level + 1, parent : this - })]; + }); } + return this._northwestChild; + } + }, - return this._children; + /** + * Gets the northeast child tile. + * @type {QuadtreeTile} + */ + northeastChild : { + get : function() { + if (!defined(this._northeastChild)) { + this._northeastChild = new QuadtreeTile({ + tilingScheme : this.tilingScheme, + x : this.x * 2 + 1, + y : this.y * 2, + level : this.level + 1, + parent : this + }); + } + return this._northeastChild; } }, @@ -357,13 +405,21 @@ define([ this.data.freeResources(); } - if (defined(this._children)) { - for (var i = 0, len = this._children.length; i < len; ++i) { - this._children[i].freeResources(); - } - this._children = undefined; - } + freeTile(this._southwestChild); + this._southwestChild = undefined; + freeTile(this._southeastChild); + this._southeastChild = undefined; + freeTile(this._northwestChild); + this._northwestChild = undefined; + freeTile(this._northeastChild); + this._northeastChild = undefined; }; + function freeTile(tile) { + if (defined(tile)) { + tile.freeResources(); + } + } + return QuadtreeTile; }); diff --git a/Source/Scene/Scene.js b/Source/Scene/Scene.js index 29e04d1548d8..439e70b1baef 100644 --- a/Source/Scene/Scene.js +++ b/Source/Scene/Scene.js @@ -389,8 +389,6 @@ define([ this._mapProjection = defined(options.mapProjection) ? options.mapProjection : new GeographicProjection(); - this._transitioner = new SceneTransitioner(this, this._mapProjection.ellipsoid); - /** * The current morph transition time between 2D/Columbus View and 3D, * with 0.0 being 2D or Columbus View and 1.0 being 3D. @@ -2588,7 +2586,7 @@ define([ }; var scratchPackedDepth = new Cartesian4(); - var packedDepthScale = new Cartesian4(1.0, 1.0 / 255.0, 1.0 / 65025.0, 1.0 / 160581375.0); + var packedDepthScale = new Cartesian4(1.0, 1.0 / 255.0, 1.0 / 65025.0, 1.0 / 16581375.0); /** * Returns the cartesian position reconstructed from the depth buffer and window position. diff --git a/Source/Scene/SceneTransitioner.js b/Source/Scene/SceneTransitioner.js index 1951dfb99d34..59ccefbd81bb 100644 --- a/Source/Scene/SceneTransitioner.js +++ b/Source/Scene/SceneTransitioner.js @@ -2,12 +2,10 @@ define([ '../Core/Cartesian3', '../Core/Cartographic', - '../Core/defaultValue', '../Core/defined', '../Core/destroyObject', '../Core/DeveloperError', '../Core/EasingFunction', - '../Core/Ellipsoid', '../Core/Math', '../Core/Matrix4', '../Core/Ray', @@ -21,12 +19,10 @@ define([ ], function( Cartesian3, Cartographic, - defaultValue, defined, destroyObject, DeveloperError, EasingFunction, - Ellipsoid, CesiumMath, Matrix4, Ray, @@ -42,7 +38,7 @@ define([ /** * @private */ - function SceneTransitioner(scene, ellipsoid) { + function SceneTransitioner(scene) { //>>includeStart('debug', pragmas.debug); if (!defined(scene)) { throw new DeveloperError('scene is required.'); diff --git a/Source/Scene/ShadowMap.js b/Source/Scene/ShadowMap.js index 0ef5677758ee..e9f35afb74cb 100644 --- a/Source/Scene/ShadowMap.js +++ b/Source/Scene/ShadowMap.js @@ -22,7 +22,6 @@ define([ '../Core/Math', '../Core/Matrix4', '../Core/PixelFormat', - '../Core/PrimitiveType', '../Core/Quaternion', '../Core/SphereOutlineGeometry', '../Renderer/ClearCommand', @@ -37,7 +36,6 @@ define([ '../Renderer/RenderState', '../Renderer/Sampler', '../Renderer/ShaderProgram', - '../Renderer/ShaderSource', '../Renderer/Texture', '../Renderer/TextureMagnificationFilter', '../Renderer/TextureMinificationFilter', @@ -76,7 +74,6 @@ define([ CesiumMath, Matrix4, PixelFormat, - PrimitiveType, Quaternion, SphereOutlineGeometry, ClearCommand, @@ -91,7 +88,6 @@ define([ RenderState, Sampler, ShaderProgram, - ShaderSource, Texture, TextureMagnificationFilter, TextureMinificationFilter, @@ -184,9 +180,11 @@ define([ this._outOfViewPrevious = false; this._needsUpdate = true; - // In IE11 polygon offset is not functional. + // In IE11 and Edge polygon offset is not functional. + // TODO : Also disabled for instances of Firefox and Chrome running ANGLE that do not support depth textures. + // Re-enable once https://github.com/AnalyticalGraphicsInc/cesium/issues/4560 is resolved. var polygonOffsetSupported = true; - if (FeatureDetection.isInternetExplorer) { + if (FeatureDetection.isInternetExplorer() || FeatureDetection.isEdge() || ((FeatureDetection.isChrome() || FeatureDetection.isFirefox()) && FeatureDetection.isWindows() && !context.depthTexture)) { polygonOffsetSupported = false; } this._polygonOffsetSupported = polygonOffsetSupported; @@ -1470,10 +1468,10 @@ define([ var isTerrain = command.pass === Pass.GLOBE; var isOpaque = command.pass !== Pass.TRANSLUCENT; var isPointLight = shadowMap._isPointLight; - var useDepthTexture = shadowMap._usesDepthTexture; + var usesDepthTexture= shadowMap._usesDepthTexture; var castVS = ShadowMapShader.createShadowCastVertexShader(vertexShaderSource, isPointLight, isTerrain); - var castFS = ShadowMapShader.createShadowCastFragmentShader(fragmentShaderSource, isPointLight, useDepthTexture, isOpaque); + var castFS = ShadowMapShader.createShadowCastFragmentShader(fragmentShaderSource, isPointLight, usesDepthTexture, isOpaque); castShader = ShaderProgram.fromCache({ context : context, diff --git a/Source/Scene/ShadowMapShader.js b/Source/Scene/ShadowMapShader.js index 61d4c851313e..555b61b8e0ad 100644 --- a/Source/Scene/ShadowMapShader.js +++ b/Source/Scene/ShadowMapShader.js @@ -1,10 +1,8 @@ /*global define*/ define([ - '../Core/defaultValue', '../Core/defined', '../Renderer/ShaderSource' ], function( - defaultValue, defined, ShaderSource) { 'use strict'; @@ -48,7 +46,7 @@ define([ }); }; - ShadowMapShader.createShadowCastFragmentShader = function(fs, isPointLight, useDepthTexture, opaque) { + ShadowMapShader.createShadowCastFragmentShader = function(fs, isPointLight, usesDepthTexture, opaque) { var defines = fs.defines.slice(0); var sources = fs.sources.slice(0); @@ -92,7 +90,7 @@ define([ 'float distance = length(' + positionVaryingName + '); \n' + 'distance /= shadowMap_lightPositionEC.w; // radius \n' + 'gl_FragColor = czm_packDepth(distance); \n'; - } else if (useDepthTexture) { + } else if (usesDepthTexture) { fsSource += 'gl_FragColor = vec4(1.0); \n'; } else { fsSource += 'gl_FragColor = czm_packDepth(gl_FragCoord.z); \n'; @@ -134,6 +132,7 @@ define([ var hasPositionVarying = defined(positionVaryingName); var usesDepthTexture = shadowMap._usesDepthTexture; + var polygonOffsetSupported = shadowMap._polygonOffsetSupported; var isPointLight = shadowMap._isPointLight; var isSpotLight = shadowMap._isSpotLight; var hasCascades = shadowMap._numberOfCascades > 1; @@ -230,7 +229,9 @@ define([ if (isTerrain) { // Scale depth bias based on view distance to reduce z-fighting in distant terrain fsSource += ' shadowParameters.depthBias *= max(depth * 0.01, 1.0); \n'; - } else { + } else if (!polygonOffsetSupported) { + // If polygon offset isn't supported push the depth back based on view, however this + // causes light leaking at further away views fsSource += ' shadowParameters.depthBias *= mix(1.0, 100.0, depth * 0.0015); \n'; } diff --git a/Source/Scene/Sun.js b/Source/Scene/Sun.js index f1dfe1e0d18b..78d22a8b40b1 100644 --- a/Source/Scene/Sun.js +++ b/Source/Scene/Sun.js @@ -1,11 +1,9 @@ /*global define*/ define([ - '../Core/BoundingRectangle', '../Core/BoundingSphere', '../Core/Cartesian2', '../Core/Cartesian3', '../Core/Cartesian4', - '../Core/Color', '../Core/ComponentDatatype', '../Core/defined', '../Core/defineProperties', @@ -17,10 +15,8 @@ define([ '../Core/PrimitiveType', '../Renderer/Buffer', '../Renderer/BufferUsage', - '../Renderer/ClearCommand', '../Renderer/ComputeCommand', '../Renderer/DrawCommand', - '../Renderer/Framebuffer', '../Renderer/RenderState', '../Renderer/ShaderProgram', '../Renderer/Texture', @@ -32,12 +28,10 @@ define([ './SceneMode', './SceneTransforms' ], function( - BoundingRectangle, BoundingSphere, Cartesian2, Cartesian3, Cartesian4, - Color, ComponentDatatype, defined, defineProperties, @@ -49,10 +43,8 @@ define([ PrimitiveType, Buffer, BufferUsage, - ClearCommand, ComputeCommand, DrawCommand, - Framebuffer, RenderState, ShaderProgram, Texture, diff --git a/Source/Scene/TextureAtlas.js b/Source/Scene/TextureAtlas.js index adf579f2c555..e774a3317520 100644 --- a/Source/Scene/TextureAtlas.js +++ b/Source/Scene/TextureAtlas.js @@ -12,7 +12,6 @@ define([ '../Core/PixelFormat', '../Core/RuntimeError', '../Renderer/Framebuffer', - '../Renderer/RenderState', '../Renderer/Texture', '../ThirdParty/when' ], function( @@ -28,7 +27,6 @@ define([ PixelFormat, RuntimeError, Framebuffer, - RenderState, Texture, when) { 'use strict'; @@ -171,18 +169,19 @@ define([ var context = textureAtlas._context; var numImages = textureAtlas.numberOfImages; var scalingFactor = 2.0; + var borderWidthInPixels = textureAtlas._borderWidthInPixels; if (numImages > 0) { var oldAtlasWidth = textureAtlas._texture.width; var oldAtlasHeight = textureAtlas._texture.height; - var atlasWidth = scalingFactor * (oldAtlasWidth + image.width + textureAtlas._borderWidthInPixels); - var atlasHeight = scalingFactor * (oldAtlasHeight + image.height + textureAtlas._borderWidthInPixels); + var atlasWidth = scalingFactor * (oldAtlasWidth + image.width + borderWidthInPixels); + var atlasHeight = scalingFactor * (oldAtlasHeight + image.height + borderWidthInPixels); var widthRatio = oldAtlasWidth / atlasWidth; var heightRatio = oldAtlasHeight / atlasHeight; // Create new node structure, putting the old root node in the bottom left. - var nodeBottomRight = new TextureAtlasNode(new Cartesian2(oldAtlasWidth + textureAtlas._borderWidthInPixels, 0.0), new Cartesian2(atlasWidth, oldAtlasHeight)); + var nodeBottomRight = new TextureAtlasNode(new Cartesian2(oldAtlasWidth + borderWidthInPixels, borderWidthInPixels), new Cartesian2(atlasWidth, oldAtlasHeight)); var nodeBottomHalf = new TextureAtlasNode(new Cartesian2(), new Cartesian2(atlasWidth, oldAtlasHeight), textureAtlas._root, nodeBottomRight); - var nodeTopHalf = new TextureAtlasNode(new Cartesian2(0.0, oldAtlasHeight + textureAtlas._borderWidthInPixels), new Cartesian2(atlasWidth, atlasHeight)); + var nodeTopHalf = new TextureAtlasNode(new Cartesian2(borderWidthInPixels, oldAtlasHeight + borderWidthInPixels), new Cartesian2(atlasWidth, atlasHeight)); var nodeMain = new TextureAtlasNode(new Cartesian2(), new Cartesian2(atlasWidth, atlasHeight), nodeBottomHalf, nodeTopHalf); // Resize texture coordinates. @@ -219,8 +218,8 @@ define([ textureAtlas._root = nodeMain; } else { // First image exceeds initialSize - var initialWidth = scalingFactor * (image.width + textureAtlas._borderWidthInPixels); - var initialHeight = scalingFactor * (image.height + textureAtlas._borderWidthInPixels); + var initialWidth = scalingFactor * (image.width + 2 * borderWidthInPixels); + var initialHeight = scalingFactor * (image.height + 2 * borderWidthInPixels); if(initialWidth < textureAtlas._initialSize.x) { initialWidth = textureAtlas._initialSize.x; } @@ -234,7 +233,8 @@ define([ height : initialHeight, pixelFormat : textureAtlas._pixelFormat }); - textureAtlas._root = new TextureAtlasNode(new Cartesian2(), new Cartesian2(initialWidth, initialHeight)); + textureAtlas._root = new TextureAtlasNode(new Cartesian2(borderWidthInPixels, borderWidthInPixels), + new Cartesian2(initialWidth, initialHeight)); } } @@ -457,7 +457,7 @@ define([ * * @example * atlas = atlas && atlas.destroy(); - * + * * @see TextureAtlas#isDestroyed */ TextureAtlas.prototype.destroy = function() { diff --git a/Source/Scene/TileTerrain.js b/Source/Scene/TileTerrain.js index fa039c3a29d3..f152e32cdbb7 100644 --- a/Source/Scene/TileTerrain.js +++ b/Source/Scene/TileTerrain.js @@ -2,7 +2,6 @@ define([ '../Core/BoundingSphere', '../Core/Cartesian3', - '../Core/ComponentDatatype', '../Core/defined', '../Core/DeveloperError', '../Core/IndexDatatype', @@ -17,7 +16,6 @@ define([ ], function( BoundingSphere, Cartesian3, - ComponentDatatype, defined, DeveloperError, IndexDatatype, diff --git a/Source/Scene/UrlTemplateImageryProvider.js b/Source/Scene/UrlTemplateImageryProvider.js index 0e875b23de87..9e39944102c6 100644 --- a/Source/Scene/UrlTemplateImageryProvider.js +++ b/Source/Scene/UrlTemplateImageryProvider.js @@ -10,15 +10,14 @@ define([ '../Core/defineProperties', '../Core/DeveloperError', '../Core/Event', - '../Core/freezeObject', '../Core/GeographicTilingScheme', + '../Core/isArray', '../Core/loadJson', '../Core/loadText', '../Core/loadWithXhr', '../Core/loadXML', '../Core/Math', '../Core/Rectangle', - '../Core/TileProviderError', '../Core/WebMercatorTilingScheme', '../ThirdParty/when', './ImageryProvider' @@ -33,15 +32,14 @@ define([ defineProperties, DeveloperError, Event, - freezeObject, GeographicTilingScheme, + isArray, loadJson, loadText, loadWithXhr, loadXML, CesiumMath, Rectangle, - TileProviderError, WebMercatorTilingScheme, when, ImageryProvider) { @@ -548,7 +546,7 @@ define([ that._getFeatureInfoFormats = properties.getFeatureInfoFormats; that._subdomains = properties.subdomains; - if (Array.isArray(that._subdomains)) { + if (isArray(that._subdomains)) { that._subdomains = that._subdomains.slice(); } else if (defined(that._subdomains) && that._subdomains.length > 0) { that._subdomains = that._subdomains.split(''); diff --git a/Source/Scene/WebMapTileServiceImageryProvider.js b/Source/Scene/WebMapTileServiceImageryProvider.js index 2a3bd4df5c33..af3b17a23279 100644 --- a/Source/Scene/WebMapTileServiceImageryProvider.js +++ b/Source/Scene/WebMapTileServiceImageryProvider.js @@ -8,6 +8,7 @@ define([ '../Core/DeveloperError', '../Core/Event', '../Core/freezeObject', + '../Core/isArray', '../Core/objectToQuery', '../Core/queryToObject', '../Core/Rectangle', @@ -24,6 +25,7 @@ define([ DeveloperError, Event, freezeObject, + isArray, objectToQuery, queryToObject, Rectangle, @@ -153,7 +155,7 @@ define([ this._credit = typeof credit === 'string' ? new Credit(credit) : credit; this._subdomains = options.subdomains; - if (Array.isArray(this._subdomains)) { + if (isArray(this._subdomains)) { this._subdomains = this._subdomains.slice(); } else if (defined(this._subdomains) && this._subdomains.length > 0) { this._subdomains = this._subdomains.split(''); diff --git a/Source/Scene/createTileMapServiceImageryProvider.js b/Source/Scene/createTileMapServiceImageryProvider.js index 87f93461a71f..bc71467d1d25 100644 --- a/Source/Scene/createTileMapServiceImageryProvider.js +++ b/Source/Scene/createTileMapServiceImageryProvider.js @@ -2,12 +2,9 @@ define([ '../Core/Cartesian2', '../Core/Cartographic', - '../Core/Credit', '../Core/defaultValue', '../Core/defined', - '../Core/defineProperties', '../Core/DeveloperError', - '../Core/Event', '../Core/GeographicTilingScheme', '../Core/joinUrls', '../Core/loadXML', @@ -20,12 +17,9 @@ define([ ], function( Cartesian2, Cartographic, - Credit, defaultValue, defined, - defineProperties, DeveloperError, - Event, GeographicTilingScheme, joinUrls, loadXML, diff --git a/Source/Shaders/BillboardCollectionVS.glsl b/Source/Shaders/BillboardCollectionVS.glsl index 232661ddb6eb..c56ebd30516c 100644 --- a/Source/Shaders/BillboardCollectionVS.glsl +++ b/Source/Shaders/BillboardCollectionVS.glsl @@ -38,7 +38,9 @@ const float SHIFT_RIGHT1 = 1.0 / 2.0; vec4 computePositionWindowCoordinates(vec4 positionEC, vec2 imageSize, float scale, vec2 direction, vec2 origin, vec2 translate, vec2 pixelOffset, vec3 alignedAxis, bool validAlignedAxis, float rotation, bool sizeInMeters) { - vec2 halfSize = imageSize * scale * czm_resolutionScale; + // Note the halfSize cannot be computed in JavaScript because it is sent via + // compressed vertex attributes that coerce it to an integer. + vec2 halfSize = imageSize * scale * czm_resolutionScale * 0.5; halfSize *= ((direction * 2.0) - 1.0); vec2 originTranslate = origin * abs(halfSize); diff --git a/Source/Shaders/Builtin/Functions/packDepth.glsl b/Source/Shaders/Builtin/Functions/packDepth.glsl index 102b8182f8f0..b7c55255abf9 100644 --- a/Source/Shaders/Builtin/Functions/packDepth.glsl +++ b/Source/Shaders/Builtin/Functions/packDepth.glsl @@ -11,7 +11,7 @@ vec4 czm_packDepth(float depth) { // See Aras Pranckevičius' post Encoding Floats to RGBA // http://aras-p.info/blog/2009/07/30/encoding-floats-to-rgba-the-final/ - vec4 enc = vec4(1.0, 255.0, 65025.0, 160581375.0) * depth; + vec4 enc = vec4(1.0, 255.0, 65025.0, 16581375.0) * depth; enc = fract(enc); enc -= enc.yzww * vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0); return enc; diff --git a/Source/Shaders/Builtin/Functions/unpackDepth.glsl b/Source/Shaders/Builtin/Functions/unpackDepth.glsl index ef65efc258bf..d122e70b9179 100644 --- a/Source/Shaders/Builtin/Functions/unpackDepth.glsl +++ b/Source/Shaders/Builtin/Functions/unpackDepth.glsl @@ -12,5 +12,5 @@ { // See Aras Pranckevičius' post Encoding Floats to RGBA // http://aras-p.info/blog/2009/07/30/encoding-floats-to-rgba-the-final/ - return dot(packedDepth, vec4(1.0, 1.0 / 255.0, 1.0 / 65025.0, 1.0 / 160581375.0)); + return dot(packedDepth, vec4(1.0, 1.0 / 255.0, 1.0 / 65025.0, 1.0 / 16581375.0)); } diff --git a/Source/Widgets/CesiumInspector/CesiumInspectorViewModel.js b/Source/Widgets/CesiumInspector/CesiumInspectorViewModel.js index 57b76e94c8a3..cf787930de7b 100644 --- a/Source/Widgets/CesiumInspector/CesiumInspectorViewModel.js +++ b/Source/Widgets/CesiumInspector/CesiumInspectorViewModel.js @@ -1,6 +1,5 @@ /*global define*/ define([ - '../../Core/Color', '../../Core/defined', '../../Core/defineProperties', '../../Core/destroyObject', @@ -14,7 +13,6 @@ define([ '../../ThirdParty/knockout', '../createCommand' ], function( - Color, defined, defineProperties, destroyObject, @@ -805,7 +803,7 @@ define([ get : function() { var that = this; return createCommand(function() { - that.tile = that.tile.children[0]; + that.tile = that.tile.northwestChild; }); } }, @@ -820,7 +818,7 @@ define([ get : function() { var that = this; return createCommand(function() { - that.tile = that.tile.children[1]; + that.tile = that.tile.northeastChild; }); } }, @@ -835,7 +833,7 @@ define([ get : function() { var that = this; return createCommand(function() { - that.tile = that.tile.children[2]; + that.tile = that.tile.southwestChild; }); } }, @@ -850,7 +848,7 @@ define([ get : function() { var that = this; return createCommand(function() { - that.tile = that.tile.children[3]; + that.tile = that.tile.southeastChild; }); } }, diff --git a/Source/Widgets/CesiumWidget/CesiumWidget.js b/Source/Widgets/CesiumWidget/CesiumWidget.js index 9be63bd4cb24..df22bdfa1342 100644 --- a/Source/Widgets/CesiumWidget/CesiumWidget.js +++ b/Source/Widgets/CesiumWidget/CesiumWidget.js @@ -134,7 +134,7 @@ define([ } } - var cesiumLogoData = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHYAAAAaCAYAAABikagwAAAAAXNSR0IArs4c6QAAAAlwSFlzAAAN1wAADdcBQiibeAAAAAd0SU1FB9wGGRQyF371QVsAABOHSURBVGje7Vp5cFTHmf91v2Nm3owGnYMuEEJCOBiEjDlsDMYQjGMOOwmXcWxiLywpJ9iuTXZd612corJssFOxi8LerXizxEGUvWsivNxxHHCQ8WYBYSFzmUMCCXQjaUajOd/V+4f6Kc14kI/KZv/xq+p6M/PmO15/9/c1wa0vwpcMQAHgBuAFoPG7mz8jAGwASQBxADFhJQGYACwAjK+vrr/AJQ8jVMqfuwH4AGQByAaQnTNqXGHWqHGFbq8/g1BJsgw9GQ12Bds/qWsxEvEeAEEAfQDCAKKCgPGVcP//BOsIVQHgAZAJIACgsHTqvDvK7150T2bR2DFaZm6W4slwUypR20yaiUg4OtDbcaP36rlPPt6/7f2B3q5mAB0AeriAE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AAElFTkSuQmCC'; /** * A widget containing a Cesium scene. diff --git a/Source/Widgets/Geocoder/GeocoderViewModel.js b/Source/Widgets/Geocoder/GeocoderViewModel.js index c7d13cc633b4..d6227719787e 100644 --- a/Source/Widgets/Geocoder/GeocoderViewModel.js +++ b/Source/Widgets/Geocoder/GeocoderViewModel.js @@ -10,7 +10,6 @@ define([ '../../Core/loadJsonp', '../../Core/Matrix4', '../../Core/Rectangle', - '../../Scene/SceneMode', '../../ThirdParty/knockout', '../../ThirdParty/when', '../createCommand' @@ -25,7 +24,6 @@ define([ loadJsonp, Matrix4, Rectangle, - SceneMode, knockout, when, createCommand) { diff --git a/Source/Widgets/HomeButton/HomeButtonViewModel.js b/Source/Widgets/HomeButton/HomeButtonViewModel.js index 46c569ed5bbe..1c869d24bcb9 100644 --- a/Source/Widgets/HomeButton/HomeButtonViewModel.js +++ b/Source/Widgets/HomeButton/HomeButtonViewModel.js @@ -1,26 +1,14 @@ /*global define*/ define([ - '../../Core/Cartesian3', - '../../Core/defaultValue', '../../Core/defined', '../../Core/defineProperties', '../../Core/DeveloperError', - '../../Core/Matrix4', - '../../Core/Rectangle', - '../../Scene/Camera', - '../../Scene/SceneMode', '../../ThirdParty/knockout', '../createCommand' ], function( - Cartesian3, - defaultValue, defined, defineProperties, DeveloperError, - Matrix4, - Rectangle, - Camera, - SceneMode, knockout, createCommand) { 'use strict'; diff --git a/Source/Widgets/Images/Cesium_Logo_overlay.png b/Source/Widgets/Images/Cesium_Logo_overlay.png deleted file mode 100644 index fb156163effa..000000000000 Binary files a/Source/Widgets/Images/Cesium_Logo_overlay.png and /dev/null differ diff --git a/Source/Widgets/Timeline/Timeline.js b/Source/Widgets/Timeline/Timeline.js index 64c1ad99464a..29b5dfd0715a 100644 --- a/Source/Widgets/Timeline/Timeline.js +++ b/Source/Widgets/Timeline/Timeline.js @@ -378,15 +378,17 @@ define([ // epochJulian: a nearby time to be considered "zero seconds", should be a round-ish number by human standards. var epochJulian; + var gregorianDate = JulianDate.toGregorianDate(startJulian); if (duration > 315360000) { // 3650+ days visible, epoch is start of the first visible century. - epochJulian = JulianDate.fromIso8601(JulianDate.toDate(startJulian).toISOString().substring(0, 2) + '00-01-01T00:00:00Z'); + epochJulian = JulianDate.fromDate(new Date(Date.UTC(Math.floor(gregorianDate.year / 100) * 100, 0))); } else if (duration > 31536000) { // 365+ days visible, epoch is start of the first visible decade. - epochJulian = JulianDate.fromIso8601(JulianDate.toDate(startJulian).toISOString().substring(0, 3) + '0-01-01T00:00:00Z'); + epochJulian = JulianDate.fromDate(new Date(Date.UTC(Math.floor(gregorianDate.year / 10) * 10, 0))); } else if (duration > 86400) { // 1+ day(s) visible, epoch is start of the year. - epochJulian = JulianDate.fromIso8601(JulianDate.toDate(startJulian).toISOString().substring(0, 4) + '-01-01T00:00:00Z'); + epochJulian = JulianDate.fromDate(new Date(Date.UTC(gregorianDate.year, 0))); } else { // Less than a day on timeline, epoch is midnight of the visible day. - epochJulian = JulianDate.fromIso8601(JulianDate.toDate(startJulian).toISOString().substring(0, 10) + 'T00:00:00Z'); + epochJulian = JulianDate.fromDate(new Date(Date.UTC(gregorianDate.year, gregorianDate.month, gregorianDate.day))); } + // startTime: Seconds offset of the left side of the timeline from epochJulian. var startTime = JulianDate.secondsDifference(this._startJulian, JulianDate.addSeconds(epochJulian, epsilonTime, new JulianDate())); // endTime: Seconds offset of the right side of the timeline from epochJulian. diff --git a/Source/Widgets/Viewer/Viewer.js b/Source/Widgets/Viewer/Viewer.js index aa067441d541..aa66497dd207 100644 --- a/Source/Widgets/Viewer/Viewer.js +++ b/Source/Widgets/Viewer/Viewer.js @@ -8,7 +8,6 @@ define([ '../../Core/destroyObject', '../../Core/DeveloperError', '../../Core/EventHelper', - '../../Core/Fullscreen', '../../Core/isArray', '../../Core/Matrix4', '../../Core/Rectangle', @@ -22,7 +21,6 @@ define([ '../../DataSources/Property', '../../Scene/ImageryLayer', '../../Scene/SceneMode', - '../../Scene/ShadowMode', '../../ThirdParty/knockout', '../../ThirdParty/when', '../Animation/Animation', @@ -52,7 +50,6 @@ define([ destroyObject, DeveloperError, EventHelper, - Fullscreen, isArray, Matrix4, Rectangle, @@ -66,7 +63,6 @@ define([ Property, ImageryLayer, SceneMode, - ShadowMode, knockout, when, Animation, diff --git a/Source/Widgets/Viewer/viewerDragDropMixin.js b/Source/Widgets/Viewer/viewerDragDropMixin.js index bfb21466cda1..183424f9fe21 100644 --- a/Source/Widgets/Viewer/viewerDragDropMixin.js +++ b/Source/Widgets/Viewer/viewerDragDropMixin.js @@ -9,7 +9,6 @@ define([ '../../DataSources/CzmlDataSource', '../../DataSources/GeoJsonDataSource', '../../DataSources/KmlDataSource', - '../../Scene/GroundPrimitive', '../getElement' ], function( defaultValue, @@ -21,7 +20,6 @@ define([ CzmlDataSource, GeoJsonDataSource, KmlDataSource, - GroundPrimitive, getElement) { 'use strict'; diff --git a/Source/Widgets/shared.css b/Source/Widgets/shared.css index ef8ab4eae9b5..1bf709836175 100644 --- a/Source/Widgets/shared.css +++ b/Source/Widgets/shared.css @@ -70,6 +70,14 @@ color: #777; } +.cesium-button input, .cesium-button label { + cursor: pointer; +} + +.cesium-button input { + vertical-align: sub; +} + .cesium-toolbar-button { -moz-box-sizing: border-box; -webkit-box-sizing: border-box; diff --git a/Source/Workers/createGeometry.js b/Source/Workers/createGeometry.js index 1b0871fcfcec..7afe0f2c4f1b 100644 --- a/Source/Workers/createGeometry.js +++ b/Source/Workers/createGeometry.js @@ -2,13 +2,11 @@ define([ '../Core/defined', '../Scene/PrimitivePipeline', - '../ThirdParty/when', './createTaskProcessorWorker', 'require' ], function( defined, PrimitivePipeline, - when, createTaskProcessorWorker, require) { 'use strict'; diff --git a/Source/Workers/createVerticesFromQuantizedTerrainMesh.js b/Source/Workers/createVerticesFromQuantizedTerrainMesh.js index 2dcd5d9d5cb5..3a9d5118dad0 100644 --- a/Source/Workers/createVerticesFromQuantizedTerrainMesh.js +++ b/Source/Workers/createVerticesFromQuantizedTerrainMesh.js @@ -10,7 +10,6 @@ define([ '../Core/Ellipsoid', '../Core/IndexDatatype', '../Core/Math', - '../Core/Matrix3', '../Core/Matrix4', '../Core/OrientedBoundingBox', '../Core/TerrainEncoding', @@ -28,7 +27,6 @@ define([ Ellipsoid, IndexDatatype, CesiumMath, - Matrix3, Matrix4, OrientedBoundingBox, TerrainEncoding, diff --git a/Specs/Core/AxisAlignedBoundingBoxSpec.js b/Specs/Core/AxisAlignedBoundingBoxSpec.js index 25662097d1e6..07ea32ac8b1a 100644 --- a/Specs/Core/AxisAlignedBoundingBoxSpec.js +++ b/Specs/Core/AxisAlignedBoundingBoxSpec.js @@ -2,13 +2,11 @@ defineSuite([ 'Core/AxisAlignedBoundingBox', 'Core/Cartesian3', - 'Core/Cartesian4', 'Core/Intersect', 'Core/Plane' ], function( AxisAlignedBoundingBox, Cartesian3, - Cartesian4, Intersect, Plane) { 'use strict'; diff --git a/Specs/Core/BoundingSphereSpec.js b/Specs/Core/BoundingSphereSpec.js index b5d0d9c0f891..849ba66278c7 100644 --- a/Specs/Core/BoundingSphereSpec.js +++ b/Specs/Core/BoundingSphereSpec.js @@ -2,7 +2,6 @@ defineSuite([ 'Core/BoundingSphere', 'Core/Cartesian3', - 'Core/Cartesian4', 'Core/Cartographic', 'Core/Ellipsoid', 'Core/EncodedCartesian3', @@ -18,7 +17,6 @@ defineSuite([ ], function( BoundingSphere, Cartesian3, - Cartesian4, Cartographic, Ellipsoid, EncodedCartesian3, diff --git a/Specs/Core/CartographicSpec.js b/Specs/Core/CartographicSpec.js index db746ffe40e1..a2a3c129170b 100644 --- a/Specs/Core/CartographicSpec.js +++ b/Specs/Core/CartographicSpec.js @@ -111,6 +111,22 @@ defineSuite([ }).toThrowDeveloperError(); }); + it('fromCartesian works with a value that is above the ellipsoid surface', function() { + var cartographic1 = Cartographic.fromDegrees(35.766989, 33.333602, 3000); + var cartesian1 = Cartesian3.fromRadians(cartographic1.longitude, cartographic1.latitude, cartographic1.height); + var cartographic2 = Cartographic.fromCartesian(cartesian1); + + expect(cartographic2).toEqualEpsilon(cartographic1, CesiumMath.EPSILON8); + }); + + it('fromCartesian works with a value that is bellow the ellipsoid surface', function() { + var cartographic1 = Cartographic.fromDegrees(35.766989, 33.333602, -3000); + var cartesian1 = Cartesian3.fromRadians(cartographic1.longitude, cartographic1.latitude, cartographic1.height); + var cartographic2 = Cartographic.fromCartesian(cartesian1); + + expect(cartographic2).toEqualEpsilon(cartographic1, CesiumMath.EPSILON8); + }); + it('clone without a result parameter', function() { var cartographic = new Cartographic(1.0, 2.0, 3.0); var result = cartographic.clone(); diff --git a/Specs/Core/CesiumTerrainProviderSpec.js b/Specs/Core/CesiumTerrainProviderSpec.js index d9c50157ad3d..e479b6011e0d 100644 --- a/Specs/Core/CesiumTerrainProviderSpec.js +++ b/Specs/Core/CesiumTerrainProviderSpec.js @@ -2,7 +2,6 @@ defineSuite([ 'Core/CesiumTerrainProvider', 'Core/DefaultProxy', - 'Core/defined', 'Core/Ellipsoid', 'Core/GeographicTilingScheme', 'Core/getAbsoluteUri', @@ -12,12 +11,10 @@ defineSuite([ 'Core/QuantizedMeshTerrainData', 'Core/TerrainProvider', 'Specs/pollToPromise', - 'ThirdParty/Uri', 'ThirdParty/when' ], function( CesiumTerrainProvider, DefaultProxy, - defined, Ellipsoid, GeographicTilingScheme, getAbsoluteUri, @@ -27,7 +24,6 @@ defineSuite([ QuantizedMeshTerrainData, TerrainProvider, pollToPromise, - Uri, when) { 'use strict'; diff --git a/Specs/Core/ClockSpec.js b/Specs/Core/ClockSpec.js index b7ba51e50e97..5bc6e164a8f2 100644 --- a/Specs/Core/ClockSpec.js +++ b/Specs/Core/ClockSpec.js @@ -4,15 +4,13 @@ defineSuite([ 'Core/ClockRange', 'Core/ClockStep', 'Core/defined', - 'Core/JulianDate', - 'Specs/pollToPromise' + 'Core/JulianDate' ], function( Clock, ClockRange, ClockStep, defined, - JulianDate, - pollToPromise) { + JulianDate) { 'use strict'; it('sets default parameters when constructed', function() { diff --git a/Specs/Core/DistanceDisplayConditionSpec.js b/Specs/Core/DistanceDisplayConditionSpec.js index 0a0b3fc5c44c..22b35a8ae8d2 100644 --- a/Specs/Core/DistanceDisplayConditionSpec.js +++ b/Specs/Core/DistanceDisplayConditionSpec.js @@ -1,12 +1,8 @@ /*global defineSuite*/ defineSuite([ - 'Core/DistanceDisplayCondition', - 'Core/Cartesian3', - 'Core/Matrix4' + 'Core/DistanceDisplayCondition' ], function( - DistanceDisplayCondition, - Cartesian3, - Matrix4) { + DistanceDisplayCondition) { 'use strict'; it('default constructs', function() { diff --git a/Specs/Core/EllipsoidTangentPlaneSpec.js b/Specs/Core/EllipsoidTangentPlaneSpec.js index 1768014b2f6d..54e34c0e8641 100644 --- a/Specs/Core/EllipsoidTangentPlaneSpec.js +++ b/Specs/Core/EllipsoidTangentPlaneSpec.js @@ -3,18 +3,12 @@ defineSuite([ 'Core/EllipsoidTangentPlane', 'Core/Cartesian2', 'Core/Cartesian3', - 'Core/Ellipsoid', - 'Core/Math', - 'Core/Matrix3', - 'Core/OrientedBoundingBox' + 'Core/Ellipsoid' ], function( EllipsoidTangentPlane, Cartesian2, Cartesian3, - Ellipsoid, - CesiumMath, - Matrix3, - OrientedBoundingBox) { + Ellipsoid) { 'use strict'; it('constructor defaults to WGS84', function() { diff --git a/Specs/Core/FeatureDetectionSpec.js b/Specs/Core/FeatureDetectionSpec.js index eb96b8bf7c5d..d23e6cab9384 100644 --- a/Specs/Core/FeatureDetectionSpec.js +++ b/Specs/Core/FeatureDetectionSpec.js @@ -77,6 +77,18 @@ defineSuite([ } }); + it('detects Edge', function() { + var isEdge = FeatureDetection.isEdge(); + expect(typeof isEdge).toEqual('boolean'); + + if (isEdge) { + var edgeVersion = FeatureDetection.edgeVersion(); + checkVersionArray(edgeVersion); + + console.log('detected Edge ' + edgeVersion.join('.')); + } + }); + it('detects Firefox', function() { var isFirefox = FeatureDetection.isFirefox(); expect(typeof isFirefox).toEqual('boolean'); diff --git a/Specs/Core/HeadingPitchRollSpec.js b/Specs/Core/HeadingPitchRollSpec.js index cb0212267adf..93c150ea666e 100644 --- a/Specs/Core/HeadingPitchRollSpec.js +++ b/Specs/Core/HeadingPitchRollSpec.js @@ -1,12 +1,12 @@ /*global defineSuite*/ defineSuite([ - 'Core/HeadingPitchRoll', - 'Core/Math', - 'Core/Quaternion' -], function( - HeadingPitchRoll, - CesiumMath, - Quaternion) { + 'Core/HeadingPitchRoll', + 'Core/Math', + 'Core/Quaternion' + ], function( + HeadingPitchRoll, + CesiumMath, + Quaternion) { "use strict"; /*global it,expect*/ diff --git a/Specs/Core/HeightmapTerrainDataSpec.js b/Specs/Core/HeightmapTerrainDataSpec.js index 809ba6b61585..d0c64e8053ca 100644 --- a/Specs/Core/HeightmapTerrainDataSpec.js +++ b/Specs/Core/HeightmapTerrainDataSpec.js @@ -1,16 +1,12 @@ /*global defineSuite*/ defineSuite([ 'Core/HeightmapTerrainData', - 'Core/defined', 'Core/GeographicTilingScheme', - 'Core/TerrainData', - 'ThirdParty/when' + 'Core/TerrainData' ], function( HeightmapTerrainData, - defined, GeographicTilingScheme, - TerrainData, - when) { + TerrainData) { 'use strict'; it('conforms to TerrainData interface', function() { diff --git a/Specs/Core/Matrix3Spec.js b/Specs/Core/Matrix3Spec.js index 213593f49e66..df3c4c009bc3 100644 --- a/Specs/Core/Matrix3Spec.js +++ b/Specs/Core/Matrix3Spec.js @@ -1,16 +1,16 @@ /*global defineSuite*/ defineSuite([ - 'Core/Matrix3', - 'Core/Cartesian3', - 'Core/Math', - 'Core/HeadingPitchRoll', - 'Core/Quaternion' -], function( - Matrix3, - Cartesian3, - CesiumMath, - HeadingPitchRoll, - Quaternion) { + 'Core/Matrix3', + 'Core/Cartesian3', + 'Core/HeadingPitchRoll', + 'Core/Math', + 'Core/Quaternion' + ], function( + Matrix3, + Cartesian3, + HeadingPitchRoll, + CesiumMath, + Quaternion) { 'use strict'; it('default constructor creates values array with all zeros.', function() { diff --git a/Specs/Core/OrientedBoundingBoxSpec.js b/Specs/Core/OrientedBoundingBoxSpec.js index 9845c0dc700e..38f1a6855cb5 100644 --- a/Specs/Core/OrientedBoundingBoxSpec.js +++ b/Specs/Core/OrientedBoundingBoxSpec.js @@ -1,12 +1,10 @@ /*global defineSuite*/ defineSuite([ 'Core/OrientedBoundingBox', - 'Core/BoundingRectangle', 'Core/BoundingSphere', 'Core/Cartesian3', 'Core/Cartesian4', 'Core/Ellipsoid', - 'Core/EllipsoidTangentPlane', 'Core/Intersect', 'Core/Math', 'Core/Matrix3', @@ -16,12 +14,10 @@ defineSuite([ 'Core/Rectangle' ], function( OrientedBoundingBox, - BoundingRectangle, BoundingSphere, Cartesian3, Cartesian4, Ellipsoid, - EllipsoidTangentPlane, Intersect, CesiumMath, Matrix3, diff --git a/Specs/Core/PinBuilderSpec.js b/Specs/Core/PinBuilderSpec.js index 2895c3d66100..33d6b8ba4f99 100644 --- a/Specs/Core/PinBuilderSpec.js +++ b/Specs/Core/PinBuilderSpec.js @@ -3,13 +3,11 @@ defineSuite([ 'Core/PinBuilder', 'Core/buildModuleUrl', 'Core/Color', - 'Core/defined', 'ThirdParty/when' ], function( PinBuilder, buildModuleUrl, Color, - defined, when) { 'use strict'; diff --git a/Specs/Core/PolylineGeometrySpec.js b/Specs/Core/PolylineGeometrySpec.js index 63dfbb325331..4f7b6d3a27e8 100644 --- a/Specs/Core/PolylineGeometrySpec.js +++ b/Specs/Core/PolylineGeometrySpec.js @@ -4,7 +4,6 @@ defineSuite([ 'Core/Cartesian3', 'Core/Color', 'Core/Ellipsoid', - 'Core/Math', 'Core/VertexFormat', 'Specs/createPackableSpecs' ], function( @@ -12,7 +11,6 @@ defineSuite([ Cartesian3, Color, Ellipsoid, - CesiumMath, VertexFormat, createPackableSpecs) { 'use strict'; @@ -31,15 +29,6 @@ defineSuite([ }).toThrowDeveloperError(); }); - it('constructor throws with invalid width', function() { - expect(function() { - return new PolylineGeometry({ - positions : [Cartesian3.ZERO, Cartesian3.UNIT_X], - width : -1 - }); - }).toThrowDeveloperError(); - }); - it('constructor throws with invalid number of colors', function() { expect(function() { return new PolylineGeometry({ @@ -49,6 +38,19 @@ defineSuite([ }).toThrowDeveloperError(); }); + it('constructor returns undefined when line width is negative', function() { + var positions = [new Cartesian3(1.0, 0.0, 0.0), new Cartesian3(0.0, 1.0, 0.0), new Cartesian3(0.0, 0.0, 1.0)]; + var line = PolylineGeometry.createGeometry(new PolylineGeometry({ + positions : positions, + width : -1.0, + vertexFormat : VertexFormat.ALL, + granularity : Math.PI, + ellipsoid: Ellipsoid.UNIT_SPHERE + })); + + expect(line).toBeUndefined(); + }); + it('constructor computes all vertex attributes', function() { var positions = [new Cartesian3(1.0, 0.0, 0.0), new Cartesian3(0.0, 1.0, 0.0), new Cartesian3(0.0, 0.0, 1.0)]; var line = PolylineGeometry.createGeometry(new PolylineGeometry({ diff --git a/Specs/Core/QuantizedMeshTerrainDataSpec.js b/Specs/Core/QuantizedMeshTerrainDataSpec.js index b2981728f2fd..c66692cc7b95 100644 --- a/Specs/Core/QuantizedMeshTerrainDataSpec.js +++ b/Specs/Core/QuantizedMeshTerrainDataSpec.js @@ -3,7 +3,6 @@ defineSuite([ 'Core/QuantizedMeshTerrainData', 'Core/BoundingSphere', 'Core/Cartesian3', - 'Core/defined', 'Core/GeographicTilingScheme', 'Core/Math', 'Core/TerrainData', @@ -13,7 +12,6 @@ defineSuite([ QuantizedMeshTerrainData, BoundingSphere, Cartesian3, - defined, GeographicTilingScheme, CesiumMath, TerrainData, diff --git a/Specs/Core/TerrainEncodingSpec.js b/Specs/Core/TerrainEncodingSpec.js index 8b511b1bbee1..de33f7b07687 100644 --- a/Specs/Core/TerrainEncodingSpec.js +++ b/Specs/Core/TerrainEncodingSpec.js @@ -5,7 +5,6 @@ defineSuite([ 'Core/AxisAlignedBoundingBox', 'Core/Cartesian2', 'Core/Cartesian3', - 'Core/Math', 'Core/Matrix4', 'Core/TerrainQuantization', 'Core/Transforms' @@ -15,7 +14,6 @@ defineSuite([ AxisAlignedBoundingBox, Cartesian2, Cartesian3, - CesiumMath, Matrix4, TerrainQuantization, Transforms) { diff --git a/Specs/Core/TransformsSpec.js b/Specs/Core/TransformsSpec.js index 40221fc9bc1f..de42f2f68270 100644 --- a/Specs/Core/TransformsSpec.js +++ b/Specs/Core/TransformsSpec.js @@ -1,46 +1,38 @@ /*global defineSuite*/ defineSuite([ - 'Core/Transforms', - 'Core/Cartesian2', - 'Core/Cartesian3', - 'Core/Cartesian4', - 'Core/defined', - 'Core/DeveloperError', - 'Core/EarthOrientationParameters', - 'Core/Ellipsoid', - 'Core/GeographicProjection', - 'Core/HeadingPitchRoll', - 'Core/Iau2006XysData', - 'Core/JulianDate', - 'Core/loadJson', - 'Core/Math', - 'Core/Matrix3', - 'Core/Matrix4', - 'Core/Quaternion', - 'Core/TimeConstants', - 'Core/TimeInterval', - 'ThirdParty/when' -], function( - Transforms, - Cartesian2, - Cartesian3, - Cartesian4, - defined, - DeveloperError, - EarthOrientationParameters, - Ellipsoid, - GeographicProjection, - HeadingPitchRoll, - Iau2006XysData, - JulianDate, - loadJson, - CesiumMath, - Matrix3, - Matrix4, - Quaternion, - TimeConstants, - TimeInterval, - when) { + 'Core/Transforms', + 'Core/Cartesian2', + 'Core/Cartesian3', + 'Core/Cartesian4', + 'Core/EarthOrientationParameters', + 'Core/Ellipsoid', + 'Core/GeographicProjection', + 'Core/HeadingPitchRoll', + 'Core/Iau2006XysData', + 'Core/JulianDate', + 'Core/loadJson', + 'Core/Math', + 'Core/Matrix3', + 'Core/Matrix4', + 'Core/Quaternion', + 'Core/TimeInterval' + ], function( + Transforms, + Cartesian2, + Cartesian3, + Cartesian4, + EarthOrientationParameters, + Ellipsoid, + GeographicProjection, + HeadingPitchRoll, + Iau2006XysData, + JulianDate, + loadJson, + CesiumMath, + Matrix3, + Matrix4, + Quaternion, + TimeInterval) { 'use strict'; var negativeX = new Cartesian4(-1, 0, 0, 0); diff --git a/Specs/Core/TranslationRotationScaleSpec.js b/Specs/Core/TranslationRotationScaleSpec.js index 1b2b14344b13..ab51f2e833f1 100644 --- a/Specs/Core/TranslationRotationScaleSpec.js +++ b/Specs/Core/TranslationRotationScaleSpec.js @@ -2,12 +2,10 @@ defineSuite([ 'Core/TranslationRotationScale', 'Core/Cartesian3', - 'Core/Matrix4', 'Core/Quaternion' ], function( TranslationRotationScale, Cartesian3, - Matrix4, Quaternion) { 'use strict'; diff --git a/Specs/Core/TrustedServersSpec.js b/Specs/Core/TrustedServersSpec.js index 0eee872ec672..164b9b0340aa 100644 --- a/Specs/Core/TrustedServersSpec.js +++ b/Specs/Core/TrustedServersSpec.js @@ -1,8 +1,8 @@ /*global defineSuite*/ defineSuite([ - 'Core/TrustedServers' -], function( - TrustedServers) { + 'Core/TrustedServers' + ], function( + TrustedServers) { 'use strict'; afterEach(function() { diff --git a/Specs/Core/VRTheWorldTerrainProviderSpec.js b/Specs/Core/VRTheWorldTerrainProviderSpec.js index 1b367b597952..f04ccee3a016 100644 --- a/Specs/Core/VRTheWorldTerrainProviderSpec.js +++ b/Specs/Core/VRTheWorldTerrainProviderSpec.js @@ -2,7 +2,6 @@ defineSuite([ 'Core/VRTheWorldTerrainProvider', 'Core/DefaultProxy', - 'Core/defined', 'Core/GeographicTilingScheme', 'Core/HeightmapTerrainData', 'Core/loadImage', @@ -14,7 +13,6 @@ defineSuite([ ], function( VRTheWorldTerrainProvider, DefaultProxy, - defined, GeographicTilingScheme, HeightmapTerrainData, loadImage, diff --git a/Specs/Core/loadImageFromTypedArraySpec.js b/Specs/Core/loadImageFromTypedArraySpec.js index 8231513950b1..d16e6468ab4f 100644 --- a/Specs/Core/loadImageFromTypedArraySpec.js +++ b/Specs/Core/loadImageFromTypedArraySpec.js @@ -1,14 +1,10 @@ /*global defineSuite*/ defineSuite([ 'Core/loadImageFromTypedArray', - 'Core/defined', - 'Core/loadArrayBuffer', - 'ThirdParty/when' + 'Core/loadArrayBuffer' ], function( loadImageFromTypedArray, - defined, - loadArrayBuffer, - when) { + loadArrayBuffer) { 'use strict'; it('can load an image', function() { diff --git a/Specs/Core/loadImageSpec.js b/Specs/Core/loadImageSpec.js index b396a886f61d..2a31f4cb2bdb 100644 --- a/Specs/Core/loadImageSpec.js +++ b/Specs/Core/loadImageSpec.js @@ -1,11 +1,9 @@ /*global defineSuite*/ defineSuite([ 'Core/loadImage', - 'Core/defined', 'ThirdParty/when' ], function( loadImage, - defined, when) { 'use strict'; diff --git a/Specs/Core/loadImageViaBlobSpec.js b/Specs/Core/loadImageViaBlobSpec.js index 372d61c4fdf8..bfbe82e5b965 100644 --- a/Specs/Core/loadImageViaBlobSpec.js +++ b/Specs/Core/loadImageViaBlobSpec.js @@ -1,11 +1,9 @@ /*global defineSuite*/ defineSuite([ 'Core/loadImageViaBlob', - 'Core/defined', 'ThirdParty/when' ], function( loadImageViaBlob, - defined, when) { 'use strict'; diff --git a/Specs/Core/loadJsonpSpec.js b/Specs/Core/loadJsonpSpec.js index 066ce79e0a6c..9b735b692178 100644 --- a/Specs/Core/loadJsonpSpec.js +++ b/Specs/Core/loadJsonpSpec.js @@ -1,12 +1,10 @@ /*global defineSuite*/ defineSuite([ 'Core/loadJsonp', - 'Core/DefaultProxy', - 'Core/RequestErrorEvent' + 'Core/DefaultProxy' ], function( loadJsonp, - DefaultProxy, - RequestErrorEvent) { + DefaultProxy) { 'use strict'; it('throws with no url', function() { diff --git a/Specs/Core/loadWithXhrSpec.js b/Specs/Core/loadWithXhrSpec.js index 44cc1799f33a..6b2b5a5742ec 100644 --- a/Specs/Core/loadWithXhrSpec.js +++ b/Specs/Core/loadWithXhrSpec.js @@ -2,13 +2,11 @@ defineSuite([ 'Core/loadWithXhr', 'Core/loadImage', - 'Core/RequestErrorEvent', - 'Core/RuntimeError' + 'Core/RequestErrorEvent' ], function( loadWithXhr, loadImage, - RequestErrorEvent, - RuntimeError) { + RequestErrorEvent) { 'use strict'; it('throws with no url', function() { diff --git a/Specs/Core/sampleTerrainSpec.js b/Specs/Core/sampleTerrainSpec.js index 1cf13884d8c7..3ab1971a23f4 100644 --- a/Specs/Core/sampleTerrainSpec.js +++ b/Specs/Core/sampleTerrainSpec.js @@ -2,13 +2,11 @@ defineSuite([ 'Core/sampleTerrain', 'Core/Cartographic', - 'Core/CesiumTerrainProvider', - 'ThirdParty/when' + 'Core/CesiumTerrainProvider' ], function( sampleTerrain, Cartographic, - CesiumTerrainProvider, - when) { + CesiumTerrainProvider) { 'use strict'; var terrainProvider = new CesiumTerrainProvider({ diff --git a/Specs/Core/writeTextToCanvasSpec.js b/Specs/Core/writeTextToCanvasSpec.js index 96870daf1d5b..8d7afe453c2e 100644 --- a/Specs/Core/writeTextToCanvasSpec.js +++ b/Specs/Core/writeTextToCanvasSpec.js @@ -80,8 +80,10 @@ defineSuite([ stroke : false }); - // canvas1 is filled, so there should only be two "edges" - expect(getColorChangeCount(canvas1)).toEqual(2); + // canvas1 is filled, completely by the I on the left + // and then has empty space on the right, so there + // should only be one "edge": fill -> outside + expect(getColorChangeCount(canvas1)).toEqual(1); var canvas2 = writeTextToCanvas('I', { font : '90px "Open Sans"', @@ -90,8 +92,8 @@ defineSuite([ strokeColor : Color.BLUE }); - // canvas2 is stroked, so there should be four "edges" - expect(getColorChangeCount(canvas2)).toEqual(4); + // canvas2 is stroked, so there should be three "edges": outline -> inside -> outline -> outside + expect(getColorChangeCount(canvas2)).toEqual(3); }); it('background color defaults to transparent', function() { diff --git a/Specs/Data/Images/Blue2x2.png b/Specs/Data/Images/Blue2x2.png new file mode 100644 index 000000000000..e604f8cbee00 Binary files /dev/null and b/Specs/Data/Images/Blue2x2.png differ diff --git a/Specs/Data/Images/Green2x2.png b/Specs/Data/Images/Green2x2.png new file mode 100644 index 000000000000..2247add0559e Binary files /dev/null and b/Specs/Data/Images/Green2x2.png differ diff --git a/Specs/Data/Images/White2x2.png b/Specs/Data/Images/White2x2.png new file mode 100644 index 000000000000..7ea0256ddd34 Binary files /dev/null and b/Specs/Data/Images/White2x2.png differ diff --git a/Specs/DataSources/BillboardVisualizerSpec.js b/Specs/DataSources/BillboardVisualizerSpec.js index df82126feca4..d802621455e7 100644 --- a/Specs/DataSources/BillboardVisualizerSpec.js +++ b/Specs/DataSources/BillboardVisualizerSpec.js @@ -14,7 +14,6 @@ defineSuite([ 'DataSources/ConstantProperty', 'DataSources/EntityCluster', 'DataSources/EntityCollection', - 'Scene/BillboardCollection', 'Scene/HeightReference', 'Scene/HorizontalOrigin', 'Scene/VerticalOrigin', @@ -36,7 +35,6 @@ defineSuite([ ConstantProperty, EntityCluster, EntityCollection, - BillboardCollection, HeightReference, HorizontalOrigin, VerticalOrigin, diff --git a/Specs/DataSources/CallbackPropertySpec.js b/Specs/DataSources/CallbackPropertySpec.js index 759b39c17be5..96c992d8c23f 100644 --- a/Specs/DataSources/CallbackPropertySpec.js +++ b/Specs/DataSources/CallbackPropertySpec.js @@ -1,11 +1,9 @@ /*global defineSuite*/ defineSuite([ 'DataSources/CallbackProperty', - 'Core/Cartesian3', 'Core/JulianDate' ], function( CallbackProperty, - Cartesian3, JulianDate) { 'use strict'; diff --git a/Specs/DataSources/CzmlDataSourceSpec.js b/Specs/DataSources/CzmlDataSourceSpec.js index 4e96c76e68fe..5a6cbbe0fa81 100644 --- a/Specs/DataSources/CzmlDataSourceSpec.js +++ b/Specs/DataSources/CzmlDataSourceSpec.js @@ -9,7 +9,6 @@ defineSuite([ 'Core/ClockStep', 'Core/Color', 'Core/CornerType', - 'Core/defined', 'Core/Ellipsoid', 'Core/Event', 'Core/ExtrapolationType', @@ -33,7 +32,6 @@ defineSuite([ 'Scene/LabelStyle', 'Scene/ShadowMode', 'Scene/VerticalOrigin', - 'Specs/pollToPromise', 'ThirdParty/when' ], function( CzmlDataSource, @@ -45,7 +43,6 @@ defineSuite([ ClockStep, Color, CornerType, - defined, Ellipsoid, Event, ExtrapolationType, @@ -69,7 +66,6 @@ defineSuite([ LabelStyle, ShadowMode, VerticalOrigin, - pollToPromise, when) { 'use strict'; diff --git a/Specs/DataSources/EntityClusterSpec.js b/Specs/DataSources/EntityClusterSpec.js index ea5d75ec066d..466323b543a4 100644 --- a/Specs/DataSources/EntityClusterSpec.js +++ b/Specs/DataSources/EntityClusterSpec.js @@ -13,7 +13,7 @@ defineSuite([ 'Scene/SceneTransforms', 'Specs/createCanvas', 'Specs/createGlobe', - 'Specs/createScene', + 'Specs/createScene' ], function( EntityCluster, Cartesian2, @@ -44,7 +44,9 @@ defineSuite([ tileProvider : { ready : true }, - _tileLoadQueue : {}, + _tileLoadQueueHigh : [], + _tileLoadQueueMedium : [], + _tileLoadQueueLow : [], _debug : { tilesWaitingForChildren : 0 } diff --git a/Specs/DataSources/LabelVisualizerSpec.js b/Specs/DataSources/LabelVisualizerSpec.js index 5da3bf985806..55021d652b94 100644 --- a/Specs/DataSources/LabelVisualizerSpec.js +++ b/Specs/DataSources/LabelVisualizerSpec.js @@ -14,7 +14,6 @@ defineSuite([ 'DataSources/EntityCollection', 'DataSources/LabelGraphics', 'Scene/HorizontalOrigin', - 'Scene/LabelCollection', 'Scene/LabelStyle', 'Scene/VerticalOrigin', 'Specs/createGlobe', @@ -34,7 +33,6 @@ defineSuite([ EntityCollection, LabelGraphics, HorizontalOrigin, - LabelCollection, LabelStyle, VerticalOrigin, createGlobe, diff --git a/Specs/DataSources/PolylineGeometryUpdaterSpec.js b/Specs/DataSources/PolylineGeometryUpdaterSpec.js index 080f71c3cbd5..5dc3db3d66ef 100644 --- a/Specs/DataSources/PolylineGeometryUpdaterSpec.js +++ b/Specs/DataSources/PolylineGeometryUpdaterSpec.js @@ -22,7 +22,6 @@ defineSuite([ 'DataSources/SampledProperty', 'DataSources/TimeIntervalCollectionProperty', 'Scene/Globe', - 'Scene/PrimitiveCollection', 'Scene/ShadowMode', 'Specs/createDynamicProperty', 'Specs/createScene' @@ -49,7 +48,6 @@ defineSuite([ SampledProperty, TimeIntervalCollectionProperty, Globe, - PrimitiveCollection, ShadowMode, createDynamicProperty, createScene) { diff --git a/Specs/DataSources/PolylineVolumeGeometryUpdaterSpec.js b/Specs/DataSources/PolylineVolumeGeometryUpdaterSpec.js index 27618dda0ddf..811ef935437e 100644 --- a/Specs/DataSources/PolylineVolumeGeometryUpdaterSpec.js +++ b/Specs/DataSources/PolylineVolumeGeometryUpdaterSpec.js @@ -5,9 +5,9 @@ defineSuite([ 'Core/Cartesian3', 'Core/Color', 'Core/ColorGeometryInstanceAttribute', + 'Core/CornerType', 'Core/DistanceDisplayCondition', 'Core/DistanceDisplayConditionGeometryInstanceAttribute', - 'Core/CornerType', 'Core/JulianDate', 'Core/ShowGeometryInstanceAttribute', 'Core/TimeInterval', @@ -17,7 +17,6 @@ defineSuite([ 'DataSources/Entity', 'DataSources/GridMaterialProperty', 'DataSources/PolylineVolumeGraphics', - 'DataSources/PropertyArray', 'DataSources/SampledProperty', 'DataSources/TimeIntervalCollectionProperty', 'Scene/PrimitiveCollection', @@ -31,9 +30,9 @@ defineSuite([ Cartesian3, Color, ColorGeometryInstanceAttribute, + CornerType, DistanceDisplayCondition, DistanceDisplayConditionGeometryInstanceAttribute, - CornerType, JulianDate, ShowGeometryInstanceAttribute, TimeInterval, @@ -43,7 +42,6 @@ defineSuite([ Entity, GridMaterialProperty, PolylineVolumeGraphics, - PropertyArray, SampledProperty, TimeIntervalCollectionProperty, PrimitiveCollection, diff --git a/Specs/Renderer/SamplerSpec.js b/Specs/Renderer/SamplerSpec.js index f0c2860e1d81..42ed448636fd 100644 --- a/Specs/Renderer/SamplerSpec.js +++ b/Specs/Renderer/SamplerSpec.js @@ -1,13 +1,11 @@ /*global defineSuite*/ defineSuite([ 'Renderer/Sampler', - 'Renderer/TextureMagnificationFilter', 'Renderer/TextureMinificationFilter', 'Renderer/TextureWrap', 'Specs/createContext' ], function( Sampler, - TextureMagnificationFilter, TextureMinificationFilter, TextureWrap, createContext) { diff --git a/Specs/Renderer/ShaderProgramSpec.js b/Specs/Renderer/ShaderProgramSpec.js index c99c5d9e270f..c5528a195c65 100644 --- a/Specs/Renderer/ShaderProgramSpec.js +++ b/Specs/Renderer/ShaderProgramSpec.js @@ -1,13 +1,6 @@ /*global defineSuite*/ defineSuite([ 'Renderer/ShaderProgram', - 'Core/Cartesian2', - 'Core/Cartesian3', - 'Core/Cartesian4', - 'Core/Color', - 'Core/Matrix2', - 'Core/Matrix3', - 'Core/Matrix4', 'Core/PrimitiveType', 'Renderer/Buffer', 'Renderer/BufferUsage', @@ -19,13 +12,6 @@ defineSuite([ 'Specs/createContext' ], function( ShaderProgram, - Cartesian2, - Cartesian3, - Cartesian4, - Color, - Matrix2, - Matrix3, - Matrix4, PrimitiveType, Buffer, BufferUsage, diff --git a/Specs/Renderer/loadCubeMapSpec.js b/Specs/Renderer/loadCubeMapSpec.js index a23dd4b5f748..4968b19082ce 100644 --- a/Specs/Renderer/loadCubeMapSpec.js +++ b/Specs/Renderer/loadCubeMapSpec.js @@ -2,27 +2,23 @@ defineSuite([ 'Renderer/loadCubeMap', 'Core/Cartesian3', - 'Core/defined', 'Core/PrimitiveType', 'Renderer/Buffer', 'Renderer/BufferUsage', 'Renderer/DrawCommand', 'Renderer/ShaderProgram', 'Renderer/VertexArray', - 'Specs/createContext', - 'ThirdParty/when' + 'Specs/createContext' ], function( loadCubeMap, Cartesian3, - defined, PrimitiveType, Buffer, BufferUsage, DrawCommand, ShaderProgram, VertexArray, - createContext, - when) { + createContext) { 'use strict'; var context; diff --git a/Specs/Scene/ArcGisMapServerImageryProviderSpec.js b/Specs/Scene/ArcGisMapServerImageryProviderSpec.js index b2d9de777c58..14276f52a1f7 100644 --- a/Specs/Scene/ArcGisMapServerImageryProviderSpec.js +++ b/Specs/Scene/ArcGisMapServerImageryProviderSpec.js @@ -6,7 +6,6 @@ defineSuite([ 'Core/Cartographic', 'Core/DefaultProxy', 'Core/defined', - 'Core/GeographicProjection', 'Core/GeographicTilingScheme', 'Core/loadImage', 'Core/loadJsonp', @@ -30,7 +29,6 @@ defineSuite([ Cartographic, DefaultProxy, defined, - GeographicProjection, GeographicTilingScheme, loadImage, loadJsonp, diff --git a/Specs/Scene/BatchTableSpec.js b/Specs/Scene/BatchTableSpec.js index 87b1fdaeffff..015fa808b21d 100644 --- a/Specs/Scene/BatchTableSpec.js +++ b/Specs/Scene/BatchTableSpec.js @@ -1,18 +1,18 @@ /*global defineSuite*/ defineSuite([ - 'Scene/BatchTable', - 'Core/Cartesian4', - 'Core/ComponentDatatype', - 'Renderer/PixelDatatype', - 'Renderer/Texture', - 'Specs/createScene' -], function( - BatchTable, - Cartesian4, - ComponentDatatype, - PixelDatatype, - Texture, - createScene) { + 'Scene/BatchTable', + 'Core/Cartesian4', + 'Core/ComponentDatatype', + 'Renderer/PixelDatatype', + 'Renderer/Texture', + 'Specs/createScene' + ], function( + BatchTable, + Cartesian4, + ComponentDatatype, + PixelDatatype, + Texture, + createScene) { 'use strict'; var unsignedByteAttributes = [{ diff --git a/Specs/Scene/BillboardCollectionSpec.js b/Specs/Scene/BillboardCollectionSpec.js index c953eb6e1625..bb0e68eb2a11 100644 --- a/Specs/Scene/BillboardCollectionSpec.js +++ b/Specs/Scene/BillboardCollectionSpec.js @@ -7,16 +7,11 @@ defineSuite([ 'Core/Cartesian3', 'Core/CesiumTerrainProvider', 'Core/Color', - 'Core/defined', - 'Core/defineProperties', 'Core/DistanceDisplayCondition', - 'Core/Ellipsoid', - 'Core/Event', 'Core/loadImage', 'Core/Math', 'Core/NearFarScalar', 'Core/Rectangle', - 'Renderer/ContextLimits', 'Scene/Billboard', 'Scene/HeightReference', 'Scene/HorizontalOrigin', @@ -35,16 +30,11 @@ defineSuite([ Cartesian3, CesiumTerrainProvider, Color, - defined, - defineProperties, DistanceDisplayCondition, - Ellipsoid, - Event, loadImage, CesiumMath, NearFarScalar, Rectangle, - ContextLimits, Billboard, HeightReference, HorizontalOrigin, @@ -73,13 +63,13 @@ defineSuite([ camera = scene.camera; return when.join( - loadImage('./Data/Images/Green.png').then(function(result) { + loadImage('./Data/Images/Green2x2.png').then(function(result) { greenImage = result; }), - loadImage('./Data/Images/Blue.png').then(function(result) { + loadImage('./Data/Images/Blue2x2.png').then(function(result) { blueImage = result; }), - loadImage('./Data/Images/White.png').then(function(result) { + loadImage('./Data/Images/White2x2.png').then(function(result) { whiteImage = result; }), loadImage('./Data/Images/Blue10x10.png').then(function(result) { @@ -1438,11 +1428,11 @@ defineSuite([ scene.renderForSpecs(); var one = billboards.add({ - image : './Data/Images/Green.png' + image : './Data/Images/Green2x2.png' }); expect(one.ready).toEqual(false); - expect(one.image).toEqual('./Data/Images/Green.png'); + expect(one.image).toEqual('./Data/Images/Green2x2.png'); return pollToPromise(function() { return one.ready; @@ -1501,18 +1491,18 @@ defineSuite([ scene.renderForSpecs(); var one = billboards.add({ - image : './Data/Images/Green.png' + image : './Data/Images/Green2x2.png' }); expect(one.ready).toEqual(false); - expect(one.image).toEqual('./Data/Images/Green.png'); + expect(one.image).toEqual('./Data/Images/Green2x2.png'); return pollToPromise(function() { return one.ready; }).then(function() { expect(scene.renderForSpecs()).toEqual([0, 255, 0, 255]); - one.image = './Data/Images/Green.png'; + one.image = './Data/Images/Green2x2.png'; expect(one.ready).toEqual(true); expect(scene.renderForSpecs()).toEqual([0, 255, 0, 255]); @@ -1571,7 +1561,7 @@ defineSuite([ var one = billboards.add({ image : './Data/Images/Red16x16.png', - imageSubRegion : new BoundingRectangle(0.0, 0.0, 1.0, 2.0) + imageSubRegion : new BoundingRectangle(0.0, 0.0, 2.0, 3.0) }); expect(one.ready).toEqual(false); diff --git a/Specs/Scene/CameraEventAggregatorSpec.js b/Specs/Scene/CameraEventAggregatorSpec.js index 6e61c0bba0ec..17ee047fdf8d 100644 --- a/Specs/Scene/CameraEventAggregatorSpec.js +++ b/Specs/Scene/CameraEventAggregatorSpec.js @@ -3,7 +3,6 @@ defineSuite([ 'Scene/CameraEventAggregator', 'Core/Cartesian2', 'Core/combine', - 'Core/defined', 'Core/FeatureDetection', 'Core/KeyboardEventModifier', 'Scene/CameraEventType', @@ -14,7 +13,6 @@ defineSuite([ CameraEventAggregator, Cartesian2, combine, - defined, FeatureDetection, KeyboardEventModifier, CameraEventType, diff --git a/Specs/Scene/CameraFlightPathSpec.js b/Specs/Scene/CameraFlightPathSpec.js index 38bf6a6f2dbb..2b5ecc5dff4e 100644 --- a/Specs/Scene/CameraFlightPathSpec.js +++ b/Specs/Scene/CameraFlightPathSpec.js @@ -2,18 +2,14 @@ defineSuite([ 'Scene/CameraFlightPath', 'Core/Cartesian3', - 'Core/Cartographic', 'Core/Math', - 'Core/Rectangle', 'Scene/OrthographicFrustum', 'Scene/SceneMode', 'Specs/createScene' ], function( CameraFlightPath, Cartesian3, - Cartographic, CesiumMath, - Rectangle, OrthographicFrustum, SceneMode, createScene) { diff --git a/Specs/Scene/DebugAppearanceSpec.js b/Specs/Scene/DebugAppearanceSpec.js index 229e31d72582..ce9f5d1cd096 100644 --- a/Specs/Scene/DebugAppearanceSpec.js +++ b/Specs/Scene/DebugAppearanceSpec.js @@ -8,7 +8,6 @@ defineSuite([ 'Core/Rectangle', 'Core/RectangleGeometry', 'Core/VertexFormat', - 'Renderer/ClearCommand', 'Scene/Appearance', 'Scene/Primitive', 'Specs/createScene' @@ -21,7 +20,6 @@ defineSuite([ Rectangle, RectangleGeometry, VertexFormat, - ClearCommand, Appearance, Primitive, createScene) { diff --git a/Specs/Scene/DebugModelMatrixPrimitiveSpec.js b/Specs/Scene/DebugModelMatrixPrimitiveSpec.js index 8f95c8f24a4d..7210ab1fc002 100644 --- a/Specs/Scene/DebugModelMatrixPrimitiveSpec.js +++ b/Specs/Scene/DebugModelMatrixPrimitiveSpec.js @@ -1,13 +1,11 @@ /*global defineSuite*/ defineSuite([ 'Scene/DebugModelMatrixPrimitive', - 'Core/Cartesian2', 'Core/Cartesian3', 'Core/Matrix4', 'Specs/createScene' ], function( DebugModelMatrixPrimitive, - Cartesian2, Cartesian3, Matrix4, createScene) { diff --git a/Specs/Scene/DiscardMissingTileImagePolicySpec.js b/Specs/Scene/DiscardMissingTileImagePolicySpec.js index 63857e64dcaa..bf1281142743 100644 --- a/Specs/Scene/DiscardMissingTileImagePolicySpec.js +++ b/Specs/Scene/DiscardMissingTileImagePolicySpec.js @@ -2,7 +2,6 @@ defineSuite([ 'Scene/DiscardMissingTileImagePolicy', 'Core/Cartesian2', - 'Core/defined', 'Core/loadImage', 'Core/loadWithXhr', 'Specs/pollToPromise', @@ -10,7 +9,6 @@ defineSuite([ ], function( DiscardMissingTileImagePolicy, Cartesian2, - defined, loadImage, loadWithXhr, pollToPromise, diff --git a/Specs/Scene/EllipsoidPrimitiveSpec.js b/Specs/Scene/EllipsoidPrimitiveSpec.js index 96431a7a6162..764ea7575424 100644 --- a/Specs/Scene/EllipsoidPrimitiveSpec.js +++ b/Specs/Scene/EllipsoidPrimitiveSpec.js @@ -4,7 +4,6 @@ defineSuite([ 'Core/Cartesian3', 'Core/defined', 'Core/Matrix4', - 'Renderer/ClearCommand', 'Scene/Material', 'Specs/createScene' ], function( @@ -12,7 +11,6 @@ defineSuite([ Cartesian3, defined, Matrix4, - ClearCommand, Material, createScene) { 'use strict'; diff --git a/Specs/Scene/EllipsoidSurfaceAppearanceSpec.js b/Specs/Scene/EllipsoidSurfaceAppearanceSpec.js index 1919c32b5dc3..eb3815022919 100644 --- a/Specs/Scene/EllipsoidSurfaceAppearanceSpec.js +++ b/Specs/Scene/EllipsoidSurfaceAppearanceSpec.js @@ -5,7 +5,6 @@ defineSuite([ 'Core/GeometryInstance', 'Core/Rectangle', 'Core/RectangleGeometry', - 'Renderer/ClearCommand', 'Scene/Appearance', 'Scene/Material', 'Scene/Primitive', @@ -16,7 +15,6 @@ defineSuite([ GeometryInstance, Rectangle, RectangleGeometry, - ClearCommand, Appearance, Material, Primitive, diff --git a/Specs/Scene/GeometryRenderingSpec.js b/Specs/Scene/GeometryRenderingSpec.js index e732ef84f9d6..9b1e7effa501 100644 --- a/Specs/Scene/GeometryRenderingSpec.js +++ b/Specs/Scene/GeometryRenderingSpec.js @@ -15,7 +15,6 @@ defineSuite([ 'Core/EllipseGeometry', 'Core/Ellipsoid', 'Core/EllipsoidGeometry', - 'Core/GeographicProjection', 'Core/Geometry', 'Core/GeometryAttribute', 'Core/GeometryInstance', @@ -31,10 +30,8 @@ defineSuite([ 'Core/SphereGeometry', 'Core/Transforms', 'Core/WallGeometry', - 'Renderer/ClearCommand', 'Scene/EllipsoidSurfaceAppearance', 'Scene/Material', - 'Scene/OrthographicFrustum', 'Scene/PerInstanceColorAppearance', 'Scene/PolylineColorAppearance', 'Scene/Primitive', @@ -57,7 +54,6 @@ defineSuite([ EllipseGeometry, Ellipsoid, EllipsoidGeometry, - GeographicProjection, Geometry, GeometryAttribute, GeometryInstance, @@ -73,10 +69,8 @@ defineSuite([ SphereGeometry, Transforms, WallGeometry, - ClearCommand, EllipsoidSurfaceAppearance, Material, - OrthographicFrustum, PerInstanceColorAppearance, PolylineColorAppearance, Primitive, diff --git a/Specs/Scene/GlobeSpec.js b/Specs/Scene/GlobeSpec.js index bae5e841afa7..78de4c934908 100644 --- a/Specs/Scene/GlobeSpec.js +++ b/Specs/Scene/GlobeSpec.js @@ -3,10 +3,8 @@ defineSuite([ 'Scene/Globe', 'Core/CesiumTerrainProvider', 'Core/defined', - 'Core/Ellipsoid', 'Core/loadWithXhr', 'Core/Rectangle', - 'Renderer/ClearCommand', 'Scene/SingleTileImageryProvider', 'Specs/createScene', 'Specs/pollToPromise' @@ -14,10 +12,8 @@ defineSuite([ Globe, CesiumTerrainProvider, defined, - Ellipsoid, loadWithXhr, Rectangle, - ClearCommand, SingleTileImageryProvider, createScene, pollToPromise) { @@ -68,7 +64,7 @@ defineSuite([ return pollToPromise(function() { globe._surface._debug.enableDebugOutput = true; scene.render(); - return globe._surface.tileProvider.ready && !defined(globe._surface._tileLoadQueue.head) && globe._surface._debug.tilesWaitingForChildren === 0; + return globe._surface.tileProvider.ready && globe._surface._tileLoadQueueHigh.length === 0 && globe._surface._tileLoadQueueMedium.length === 0 && globe._surface._tileLoadQueueLow.length === 0 && globe._surface._debug.tilesWaitingForChildren === 0; }); } diff --git a/Specs/Scene/GlobeSurfaceTileProviderSpec.js b/Specs/Scene/GlobeSurfaceTileProviderSpec.js index 4f3d44b0de31..91ae16b315eb 100644 --- a/Specs/Scene/GlobeSurfaceTileProviderSpec.js +++ b/Specs/Scene/GlobeSurfaceTileProviderSpec.js @@ -9,7 +9,6 @@ defineSuite([ 'Core/Ellipsoid', 'Core/EllipsoidTerrainProvider', 'Core/GeographicProjection', - 'Core/Math', 'Core/Rectangle', 'Core/WebMercatorProjection', 'Renderer/ContextLimits', @@ -19,7 +18,6 @@ defineSuite([ 'Scene/Globe', 'Scene/GlobeSurfaceShaderSet', 'Scene/ImageryLayerCollection', - 'Scene/OrthographicFrustum', 'Scene/QuadtreeTile', 'Scene/QuadtreeTileProvider', 'Scene/SceneMode', @@ -37,7 +35,6 @@ defineSuite([ Ellipsoid, EllipsoidTerrainProvider, GeographicProjection, - CesiumMath, Rectangle, WebMercatorProjection, ContextLimits, @@ -47,7 +44,6 @@ defineSuite([ Globe, GlobeSurfaceShaderSet, ImageryLayerCollection, - OrthographicFrustum, QuadtreeTile, QuadtreeTileProvider, SceneMode, @@ -83,7 +79,7 @@ defineSuite([ // update until the load queue is empty. return pollToPromise(function() { scene.renderForSpecs(); - return globe._surface.tileProvider.ready && !defined(globe._surface._tileLoadQueue.head) && globe._surface._debug.tilesWaitingForChildren === 0; + return globe._surface.tileProvider.ready && globe._surface._tileLoadQueueHigh.length === 0 && globe._surface._tileLoadQueueMedium.length === 0 && globe._surface._tileLoadQueueLow.length === 0 && globe._surface._debug.tilesWaitingForChildren === 0; }); } diff --git a/Specs/Scene/GoogleEarthImageryProviderSpec.js b/Specs/Scene/GoogleEarthImageryProviderSpec.js index b642eed65e88..7df3ce2e74ea 100644 --- a/Specs/Scene/GoogleEarthImageryProviderSpec.js +++ b/Specs/Scene/GoogleEarthImageryProviderSpec.js @@ -2,7 +2,6 @@ defineSuite([ 'Scene/GoogleEarthImageryProvider', 'Core/DefaultProxy', - 'Core/defined', 'Core/GeographicTilingScheme', 'Core/loadImage', 'Core/loadWithXhr', @@ -16,7 +15,6 @@ defineSuite([ ], function( GoogleEarthImageryProvider, DefaultProxy, - defined, GeographicTilingScheme, loadImage, loadWithXhr, diff --git a/Specs/Scene/GroundPrimitiveSpec.js b/Specs/Scene/GroundPrimitiveSpec.js index a09afbb7360e..a64916d714dc 100644 --- a/Specs/Scene/GroundPrimitiveSpec.js +++ b/Specs/Scene/GroundPrimitiveSpec.js @@ -1,64 +1,40 @@ /*global defineSuite*/ defineSuite([ 'Scene/GroundPrimitive', - 'Core/Cartesian3', 'Core/Color', 'Core/ColorGeometryInstanceAttribute', - 'Core/ComponentDatatype', 'Core/destroyObject', 'Core/DistanceDisplayConditionGeometryInstanceAttribute', 'Core/Ellipsoid', - 'Core/Geometry', - 'Core/GeometryAttribute', 'Core/GeometryInstance', - 'Core/GeometryInstanceAttribute', 'Core/HeadingPitchRange', 'Core/Math', 'Core/PolygonGeometry', - 'Core/PrimitiveType', 'Core/Rectangle', 'Core/RectangleGeometry', - 'Core/RuntimeError', 'Core/ShowGeometryInstanceAttribute', - 'Core/Transforms', - 'Scene/MaterialAppearance', - 'Scene/OrthographicFrustum', 'Scene/Pass', 'Scene/PerInstanceColorAppearance', 'Scene/Primitive', - 'Scene/SceneMode', - 'Specs/BadGeometry', 'Specs/createScene', 'Specs/pollToPromise' ], function( GroundPrimitive, - Cartesian3, Color, ColorGeometryInstanceAttribute, - ComponentDatatype, destroyObject, DistanceDisplayConditionGeometryInstanceAttribute, Ellipsoid, - Geometry, - GeometryAttribute, GeometryInstance, - GeometryInstanceAttribute, HeadingPitchRange, CesiumMath, PolygonGeometry, - PrimitiveType, Rectangle, RectangleGeometry, - RuntimeError, ShowGeometryInstanceAttribute, - Transforms, - MaterialAppearance, - OrthographicFrustum, Pass, PerInstanceColorAppearance, Primitive, - SceneMode, - BadGeometry, createScene, pollToPromise) { 'use strict'; diff --git a/Specs/Scene/ImageryLayerCollectionSpec.js b/Specs/Scene/ImageryLayerCollectionSpec.js index 39f392a2f7a9..7749c1f490ff 100644 --- a/Specs/Scene/ImageryLayerCollectionSpec.js +++ b/Specs/Scene/ImageryLayerCollectionSpec.js @@ -304,7 +304,7 @@ defineSuite([ return pollToPromise(function() { globe._surface._debug.enableDebugOutput = true; scene.render(); - return globe._surface.tileProvider.ready && globe._surface._tileLoadQueue.length === 0 && globe._surface._debug.tilesWaitingForChildren === 0; + return globe._surface.tileProvider.ready && globe._surface._tileLoadQueueHigh.length === 0 && globe._surface._tileLoadQueueMedium.length === 0 && globe._surface._tileLoadQueueLow.length === 0 && globe._surface._debug.tilesWaitingForChildren === 0; }); } diff --git a/Specs/Scene/ImageryLayerSpec.js b/Specs/Scene/ImageryLayerSpec.js index 94ddc52ac0a2..88a8804b12fd 100644 --- a/Specs/Scene/ImageryLayerSpec.js +++ b/Specs/Scene/ImageryLayerSpec.js @@ -10,7 +10,6 @@ defineSuite([ 'Scene/ArcGisMapServerImageryProvider', 'Scene/BingMapsImageryProvider', 'Scene/createTileMapServiceImageryProvider', - 'Scene/Globe', 'Scene/GlobeSurfaceTile', 'Scene/Imagery', 'Scene/ImageryLayerCollection', @@ -32,7 +31,6 @@ defineSuite([ ArcGisMapServerImageryProvider, BingMapsImageryProvider, createTileMapServiceImageryProvider, - Globe, GlobeSurfaceTile, Imagery, ImageryLayerCollection, diff --git a/Specs/Scene/LabelCollectionSpec.js b/Specs/Scene/LabelCollectionSpec.js index 81a460109812..b23b9f579169 100644 --- a/Specs/Scene/LabelCollectionSpec.js +++ b/Specs/Scene/LabelCollectionSpec.js @@ -8,17 +8,14 @@ defineSuite([ 'Core/Color', 'Core/defined', 'Core/DistanceDisplayCondition', - 'Core/Ellipsoid', 'Core/Math', 'Core/NearFarScalar', 'Core/Rectangle', - 'Renderer/ContextLimits', + 'Scene/Globe', 'Scene/HeightReference', 'Scene/HorizontalOrigin', - 'Scene/Globe', 'Scene/Label', 'Scene/LabelStyle', - 'Scene/OrthographicFrustum', 'Scene/VerticalOrigin', 'Specs/createGlobe', 'Specs/createScene' @@ -31,17 +28,14 @@ defineSuite([ Color, defined, DistanceDisplayCondition, - Ellipsoid, CesiumMath, NearFarScalar, Rectangle, - ContextLimits, + Globe, HeightReference, HorizontalOrigin, - Globe, Label, LabelStyle, - OrthographicFrustum, VerticalOrigin, createGlobe, createScene) { diff --git a/Specs/Scene/MaterialAppearanceSpec.js b/Specs/Scene/MaterialAppearanceSpec.js index 28a305b88217..d2d535827b5a 100644 --- a/Specs/Scene/MaterialAppearanceSpec.js +++ b/Specs/Scene/MaterialAppearanceSpec.js @@ -7,7 +7,6 @@ defineSuite([ 'Core/GeometryInstance', 'Core/Rectangle', 'Core/RectangleGeometry', - 'Renderer/ClearCommand', 'Scene/Appearance', 'Scene/Material', 'Scene/Primitive', @@ -20,7 +19,6 @@ defineSuite([ GeometryInstance, Rectangle, RectangleGeometry, - ClearCommand, Appearance, Material, Primitive, diff --git a/Specs/Scene/MaterialSpec.js b/Specs/Scene/MaterialSpec.js index e6c3b44b71ca..0be40157f399 100644 --- a/Specs/Scene/MaterialSpec.js +++ b/Specs/Scene/MaterialSpec.js @@ -3,17 +3,11 @@ defineSuite([ 'Scene/Material', 'Core/Cartesian3', 'Core/Color', - 'Core/ColorGeometryInstanceAttribute', 'Core/defaultValue', 'Core/Ellipsoid', 'Core/GeometryInstance', - 'Core/Math', - 'Core/Matrix4', - 'Core/PolygonGeometry', 'Core/Rectangle', 'Core/RectangleGeometry', - 'Renderer/ClearCommand', - 'Scene/EllipsoidSurfaceAppearance', 'Scene/MaterialAppearance', 'Scene/PolylineCollection', 'Scene/Primitive', @@ -23,17 +17,11 @@ defineSuite([ Material, Cartesian3, Color, - ColorGeometryInstanceAttribute, defaultValue, Ellipsoid, GeometryInstance, - CesiumMath, - Matrix4, - PolygonGeometry, Rectangle, RectangleGeometry, - ClearCommand, - EllipsoidSurfaceAppearance, MaterialAppearance, PolylineCollection, Primitive, diff --git a/Specs/Scene/ModelSpec.js b/Specs/Scene/ModelSpec.js index ca98cf69586b..c9eeb1ab6532 100644 --- a/Specs/Scene/ModelSpec.js +++ b/Specs/Scene/ModelSpec.js @@ -8,7 +8,6 @@ defineSuite([ 'Core/clone', 'Core/Color', 'Core/combine', - 'Core/defaultValue', 'Core/defined', 'Core/defineProperties', 'Core/DistanceDisplayCondition', @@ -41,7 +40,6 @@ defineSuite([ clone, Color, combine, - defaultValue, defined, defineProperties, DistanceDisplayCondition, @@ -1913,7 +1911,9 @@ defineSuite([ tileProvider : { ready : true }, - _tileLoadQueue : {}, + _tileLoadQueueHigh : [], + _tileLoadQueueMedium : [], + _tileLoadQueueLow : [], _debug : { tilesWaitingForChildren : 0 } diff --git a/Specs/Scene/MoonSpec.js b/Specs/Scene/MoonSpec.js index e38e521411c5..a743dfe7ec6c 100644 --- a/Specs/Scene/MoonSpec.js +++ b/Specs/Scene/MoonSpec.js @@ -2,24 +2,20 @@ defineSuite([ 'Scene/Moon', 'Core/BoundingSphere', - 'Core/Cartesian3', 'Core/Color', 'Core/defined', 'Core/Ellipsoid', 'Core/Matrix3', - 'Core/Matrix4', 'Core/Simon1994PlanetaryPositions', 'Core/Transforms', 'Specs/createScene' ], function( Moon, BoundingSphere, - Cartesian3, Color, defined, Ellipsoid, Matrix3, - Matrix4, Simon1994PlanetaryPositions, Transforms, createScene) { diff --git a/Specs/Scene/PerInstanceColorAppearanceSpec.js b/Specs/Scene/PerInstanceColorAppearanceSpec.js index db0352c87045..4c87261aa69d 100644 --- a/Specs/Scene/PerInstanceColorAppearanceSpec.js +++ b/Specs/Scene/PerInstanceColorAppearanceSpec.js @@ -5,7 +5,6 @@ defineSuite([ 'Core/GeometryInstance', 'Core/Rectangle', 'Core/RectangleGeometry', - 'Renderer/ClearCommand', 'Scene/Appearance', 'Scene/Primitive', 'Specs/createScene' @@ -15,7 +14,6 @@ defineSuite([ GeometryInstance, Rectangle, RectangleGeometry, - ClearCommand, Appearance, Primitive, createScene) { diff --git a/Specs/Scene/PickSpec.js b/Specs/Scene/PickSpec.js index ee2e62e6d99f..4f462a08243f 100644 --- a/Specs/Scene/PickSpec.js +++ b/Specs/Scene/PickSpec.js @@ -1,34 +1,26 @@ /*global defineSuite*/ defineSuite([ 'Core/Cartesian2', - 'Core/Cartesian3', - 'Core/Ellipsoid', 'Core/FeatureDetection', 'Core/GeometryInstance', 'Core/Math', - 'Core/Matrix4', 'Core/Rectangle', 'Core/RectangleGeometry', 'Core/ShowGeometryInstanceAttribute', 'Scene/EllipsoidSurfaceAppearance', - 'Scene/OrthographicFrustum', 'Scene/PerspectiveFrustum', 'Scene/Primitive', 'Scene/SceneMode', 'Specs/createScene' ], 'Scene/Pick', function( Cartesian2, - Cartesian3, - Ellipsoid, FeatureDetection, GeometryInstance, CesiumMath, - Matrix4, Rectangle, RectangleGeometry, ShowGeometryInstanceAttribute, EllipsoidSurfaceAppearance, - OrthographicFrustum, PerspectiveFrustum, Primitive, SceneMode, diff --git a/Specs/Scene/PointPrimitiveCollectionSpec.js b/Specs/Scene/PointPrimitiveCollectionSpec.js index ef8f95a99aaa..521c33a6d4d4 100644 --- a/Specs/Scene/PointPrimitiveCollectionSpec.js +++ b/Specs/Scene/PointPrimitiveCollectionSpec.js @@ -10,7 +10,6 @@ defineSuite([ 'Core/Math', 'Core/NearFarScalar', 'Core/Rectangle', - 'Scene/OrthographicFrustum', 'Scene/PointPrimitive', 'Specs/createScene' ], function( @@ -24,7 +23,6 @@ defineSuite([ CesiumMath, NearFarScalar, Rectangle, - OrthographicFrustum, PointPrimitive, createScene) { 'use strict'; diff --git a/Specs/Scene/PrimitiveCollectionSpec.js b/Specs/Scene/PrimitiveCollectionSpec.js index 5f68ce96c6ee..d1495de85684 100644 --- a/Specs/Scene/PrimitiveCollectionSpec.js +++ b/Specs/Scene/PrimitiveCollectionSpec.js @@ -1,13 +1,10 @@ /*global defineSuite*/ defineSuite([ 'Scene/PrimitiveCollection', - 'Core/Cartesian3', 'Core/ColorGeometryInstanceAttribute', 'Core/defaultValue', 'Core/defined', 'Core/GeometryInstance', - 'Core/Math', - 'Core/Matrix4', 'Core/Rectangle', 'Core/RectangleGeometry', 'Scene/HorizontalOrigin', @@ -18,13 +15,10 @@ defineSuite([ 'Specs/createScene' ], function( PrimitiveCollection, - Cartesian3, ColorGeometryInstanceAttribute, defaultValue, defined, GeometryInstance, - CesiumMath, - Matrix4, Rectangle, RectangleGeometry, HorizontalOrigin, diff --git a/Specs/Scene/PrimitiveCullingSpec.js b/Specs/Scene/PrimitiveCullingSpec.js index f295209e315e..0adeeeaf5b9c 100644 --- a/Specs/Scene/PrimitiveCullingSpec.js +++ b/Specs/Scene/PrimitiveCullingSpec.js @@ -1,70 +1,44 @@ /*global defineSuite*/ defineSuite([ - 'Core/BoundingSphere', - 'Core/Cartesian2', 'Core/Cartesian3', 'Core/Color', 'Core/ColorGeometryInstanceAttribute', 'Core/defaultValue', - 'Core/Ellipsoid', 'Core/GeometryInstance', 'Core/loadImage', - 'Core/Math', - 'Core/Occluder', - 'Core/PolygonGeometry', 'Core/Rectangle', 'Core/RectangleGeometry', 'Core/Transforms', - 'Renderer/Sampler', - 'Renderer/TextureMagnificationFilter', - 'Renderer/TextureMinificationFilter', 'Scene/BillboardCollection', - 'Scene/EllipsoidSurfaceAppearance', 'Scene/Globe', 'Scene/HorizontalOrigin', 'Scene/LabelCollection', 'Scene/Material', - 'Scene/OrthographicFrustum', 'Scene/PerInstanceColorAppearance', 'Scene/PolylineCollection', 'Scene/Primitive', - 'Scene/PrimitiveCollection', 'Scene/SceneMode', - 'Scene/TextureAtlas', 'Scene/VerticalOrigin', 'Specs/createScene' ], 'Scene/PrimitiveCulling', function( - BoundingSphere, - Cartesian2, Cartesian3, Color, ColorGeometryInstanceAttribute, defaultValue, - Ellipsoid, GeometryInstance, loadImage, - CesiumMath, - Occluder, - PolygonGeometry, Rectangle, RectangleGeometry, Transforms, - Sampler, - TextureMagnificationFilter, - TextureMinificationFilter, BillboardCollection, - EllipsoidSurfaceAppearance, Globe, HorizontalOrigin, LabelCollection, Material, - OrthographicFrustum, PerInstanceColorAppearance, PolylineCollection, Primitive, - PrimitiveCollection, SceneMode, - TextureAtlas, VerticalOrigin, createScene) { 'use strict'; diff --git a/Specs/Scene/PrimitiveSpec.js b/Specs/Scene/PrimitiveSpec.js index dc3ded46321b..10819409f2f6 100644 --- a/Specs/Scene/PrimitiveSpec.js +++ b/Specs/Scene/PrimitiveSpec.js @@ -6,6 +6,7 @@ defineSuite([ 'Core/Cartesian3', 'Core/ColorGeometryInstanceAttribute', 'Core/ComponentDatatype', + 'Core/CylinderGeometry', 'Core/defined', 'Core/DistanceDisplayConditionGeometryInstanceAttribute', 'Core/Ellipsoid', @@ -17,16 +18,13 @@ defineSuite([ 'Core/Math', 'Core/Matrix4', 'Core/PolygonGeometry', - 'Core/CylinderGeometry', 'Core/PrimitiveType', 'Core/Rectangle', 'Core/RectangleGeometry', - 'Core/RuntimeError', 'Core/ShowGeometryInstanceAttribute', 'Core/Transforms', 'Scene/Camera', 'Scene/MaterialAppearance', - 'Scene/OrthographicFrustum', 'Scene/PerInstanceColorAppearance', 'Scene/SceneMode', 'Specs/BadGeometry', @@ -39,6 +37,7 @@ defineSuite([ Cartesian3, ColorGeometryInstanceAttribute, ComponentDatatype, + CylinderGeometry, defined, DistanceDisplayConditionGeometryInstanceAttribute, Ellipsoid, @@ -50,16 +49,13 @@ defineSuite([ CesiumMath, Matrix4, PolygonGeometry, - CylinderGeometry, PrimitiveType, Rectangle, RectangleGeometry, - RuntimeError, ShowGeometryInstanceAttribute, Transforms, Camera, MaterialAppearance, - OrthographicFrustum, PerInstanceColorAppearance, SceneMode, BadGeometry, diff --git a/Specs/Scene/QuadtreePrimitiveSpec.js b/Specs/Scene/QuadtreePrimitiveSpec.js index 57e606d5642c..03647b5f9b03 100644 --- a/Specs/Scene/QuadtreePrimitiveSpec.js +++ b/Specs/Scene/QuadtreePrimitiveSpec.js @@ -9,7 +9,8 @@ defineSuite([ 'Core/Visibility', 'Scene/QuadtreeTile', 'Scene/QuadtreeTileLoadState', - 'Specs/createScene' + 'Specs/createScene', + 'Specs/pollToPromise' ], function( QuadtreePrimitive, Cartesian3, @@ -20,7 +21,8 @@ defineSuite([ Visibility, QuadtreeTile, QuadtreeTileLoadState, - createScene) { + createScene, + pollToPromise) { 'use strict'; var scene; @@ -191,18 +193,14 @@ defineSuite([ expect(progressEventSpy.calls.mostRecent().args[0]).toEqual(1); // Simulate the second zero-level child having loaded with two children. - quadtree._levelZeroTiles[1]._children = [ - buildEmptyQuadtreeTile(tileProvider), - buildEmptyQuadtreeTile(tileProvider) - ]; quadtree._levelZeroTiles[1].state = QuadtreeTileLoadState.DONE; quadtree._levelZeroTiles[1].renderable = true; quadtree.beginFrame(scene.frameState); quadtree.update(scene.frameState); quadtree.endFrame(scene.frameState); - // Now this should be back to 2. - expect(progressEventSpy.calls.mostRecent().args[0]).toEqual(2); + // Now that tile's four children should be in the load queue. + expect(progressEventSpy.calls.mostRecent().args[0]).toEqual(4); }); it('forEachLoadedTile does not enumerate tiles in the START state', function() { @@ -355,12 +353,141 @@ defineSuite([ expect(position).toEqual(updatedPosition); }); - function buildEmptyQuadtreeTile(tileProvider) { - return new QuadtreeTile({ - x : 0, - y : 0, - level : 0, - tilingScheme : tileProvider.tilingScheme + it('gives correct priority to tile loads', function() { + var tileProvider = createSpyTileProvider(); + tileProvider.getReady.and.returnValue(true); + tileProvider.computeTileVisibility.and.returnValue(Visibility.FULL); + + var quadtree = new QuadtreePrimitive({ + tileProvider : tileProvider }); - } + + quadtree.beginFrame(scene.frameState); + quadtree.update(scene.frameState); + quadtree.endFrame(scene.frameState); + + // The root tiles should be in the high priority load queue + expect(quadtree._tileLoadQueueHigh.length).toBe(2); + expect(quadtree._tileLoadQueueHigh).toContain(quadtree._levelZeroTiles[0]); + expect(quadtree._tileLoadQueueHigh).toContain(quadtree._levelZeroTiles[1]); + expect(quadtree._tileLoadQueueMedium.length).toBe(0); + expect(quadtree._tileLoadQueueLow.length).toBe(0); + + // Mark the first root tile renderable (but not done loading) + quadtree._levelZeroTiles[0].renderable = true; + + quadtree.beginFrame(scene.frameState); + quadtree.update(scene.frameState); + quadtree.endFrame(scene.frameState); + + // That root tile should now load with low priority while its children should load with high. + expect(quadtree._tileLoadQueueHigh.length).toBe(5); + expect(quadtree._tileLoadQueueHigh).toContain(quadtree._levelZeroTiles[1]); + expect(quadtree._tileLoadQueueHigh).toContain(quadtree._levelZeroTiles[0].children[0]); + expect(quadtree._tileLoadQueueHigh).toContain(quadtree._levelZeroTiles[0].children[1]); + expect(quadtree._tileLoadQueueHigh).toContain(quadtree._levelZeroTiles[0].children[2]); + expect(quadtree._tileLoadQueueHigh).toContain(quadtree._levelZeroTiles[0].children[3]); + expect(quadtree._tileLoadQueueMedium.length).toBe(0); + expect(quadtree._tileLoadQueueLow.length).toBe(1); + expect(quadtree._tileLoadQueueLow).toContain(quadtree._levelZeroTiles[0]); + + // Mark the children of that root tile renderable too, so we can refine it + quadtree._levelZeroTiles[0].children[0].renderable = true; + quadtree._levelZeroTiles[0].children[1].renderable = true; + quadtree._levelZeroTiles[0].children[2].renderable = true; + quadtree._levelZeroTiles[0].children[3].renderable = true; + + quadtree.beginFrame(scene.frameState); + quadtree.update(scene.frameState); + quadtree.endFrame(scene.frameState); + + expect(quadtree._tileLoadQueueHigh.length).toBe(17); // levelZeroTiles[1] plus levelZeroTiles[0]'s 16 grandchildren + expect(quadtree._tileLoadQueueHigh).toContain(quadtree._levelZeroTiles[1]); + expect(quadtree._tileLoadQueueHigh).toContain(quadtree._levelZeroTiles[0].children[0].children[0]); + expect(quadtree._tileLoadQueueHigh).toContain(quadtree._levelZeroTiles[0].children[0].children[1]); + expect(quadtree._tileLoadQueueHigh).toContain(quadtree._levelZeroTiles[0].children[0].children[2]); + expect(quadtree._tileLoadQueueHigh).toContain(quadtree._levelZeroTiles[0].children[0].children[3]); + expect(quadtree._tileLoadQueueMedium.length).toBe(0); + expect(quadtree._tileLoadQueueLow.length).toBe(5); + expect(quadtree._tileLoadQueueLow).toContain(quadtree._levelZeroTiles[0]); + expect(quadtree._tileLoadQueueLow).toContain(quadtree._levelZeroTiles[0].children[0]); + expect(quadtree._tileLoadQueueLow).toContain(quadtree._levelZeroTiles[0].children[1]); + expect(quadtree._tileLoadQueueLow).toContain(quadtree._levelZeroTiles[0].children[2]); + expect(quadtree._tileLoadQueueLow).toContain(quadtree._levelZeroTiles[0].children[3]); + + // Mark the children of levelZeroTiles[0] upsampled + quadtree._levelZeroTiles[0].children[0].upsampledFromParent = true; + quadtree._levelZeroTiles[0].children[1].upsampledFromParent = true; + quadtree._levelZeroTiles[0].children[2].upsampledFromParent = true; + quadtree._levelZeroTiles[0].children[3].upsampledFromParent = true; + + quadtree.beginFrame(scene.frameState); + quadtree.update(scene.frameState); + quadtree.endFrame(scene.frameState); + + // levelZeroTiles[0] should move to medium priority. + // Its descendents should continue loading, so they have a chance to decide they're not upsampled later. + expect(quadtree._tileLoadQueueHigh.length).toBe(1); + expect(quadtree._tileLoadQueueHigh).toContain(quadtree._levelZeroTiles[1]); + expect(quadtree._tileLoadQueueMedium.length).toBe(1); + expect(quadtree._tileLoadQueueMedium).toContain(quadtree._levelZeroTiles[0]); + expect(quadtree._tileLoadQueueLow.length).toBe(4); + expect(quadtree._tileLoadQueueLow).toContain(quadtree._levelZeroTiles[0].children[0]); + expect(quadtree._tileLoadQueueLow).toContain(quadtree._levelZeroTiles[0].children[1]); + expect(quadtree._tileLoadQueueLow).toContain(quadtree._levelZeroTiles[0].children[2]); + expect(quadtree._tileLoadQueueLow).toContain(quadtree._levelZeroTiles[0].children[3]); + }); + + it('renders tiles in approximate near-to-far order', function() { + var tileProvider = createSpyTileProvider(); + tileProvider.getReady.and.returnValue(true); + tileProvider.computeTileVisibility.and.returnValue(Visibility.FULL); + + var quadtree = new QuadtreePrimitive({ + tileProvider : tileProvider + }); + + tileProvider.loadTile.and.callFake(function(frameState, tile) { + if (tile.level <= 1) { + tile.state = QuadtreeTileLoadState.DONE; + tile.renderable = true; + } + }); + + scene.camera.setView({ + destination : Cartesian3.fromDegrees(1.0, 1.0, 15000.0) + }); + scene.camera.update(scene.mode); + + return pollToPromise(function() { + quadtree.beginFrame(scene.frameState); + quadtree.update(scene.frameState); + quadtree.endFrame(scene.frameState); + + return quadtree._tilesToRender.filter(function(tile) { return tile.level === 1; }).length === 8; + }).then(function() { + quadtree.beginFrame(scene.frameState); + quadtree.update(scene.frameState); + quadtree.endFrame(scene.frameState); + + // Rendered tiles: + // +----+----+----+----+ + // |w.nw|w.ne|e.nw|e.ne| + // +----+----+----+----+ + // |w.sw|w.se|e.sw|e.se| + // +----+----+----+----+ + // camera is located in e.nw (east.northwestChild) + + var west = quadtree._levelZeroTiles.filter(function(tile) { return tile.x === 0; })[0]; + var east = quadtree._levelZeroTiles.filter(function(tile) { return tile.x === 1; })[0]; + expect(quadtree._tilesToRender[0]).toBe(east.northwestChild); + expect(quadtree._tilesToRender[1] === east.southwestChild || quadtree._tilesToRender[1] === east.northeastChild).toBe(true); + expect(quadtree._tilesToRender[2] === east.southwestChild || quadtree._tilesToRender[2] === east.northeastChild).toBe(true); + expect(quadtree._tilesToRender[3]).toBe(east.southeastChild); + expect(quadtree._tilesToRender[4]).toBe(west.northeastChild); + expect(quadtree._tilesToRender[5] === west.northwestChild || quadtree._tilesToRender[5] === west.southeastChild).toBe(true); + expect(quadtree._tilesToRender[6] === west.northwestChild || quadtree._tilesToRender[6] === west.southeastChild).toBe(true); + expect(quadtree._tilesToRender[7]).toBe(west.southwestChild); + }); + }); }, 'WebGL'); diff --git a/Specs/Scene/SceneTransformsSpec.js b/Specs/Scene/SceneTransformsSpec.js index de674888cb81..3592c301d076 100644 --- a/Specs/Scene/SceneTransformsSpec.js +++ b/Specs/Scene/SceneTransformsSpec.js @@ -1,23 +1,23 @@ /*global defineSuite*/ defineSuite([ 'Scene/SceneTransforms', - 'Scene/SceneMode', 'Core/Cartesian2', 'Core/Cartesian3', 'Core/Ellipsoid', 'Core/Math', 'Core/Rectangle', 'Scene/Camera', + 'Scene/SceneMode', 'Specs/createScene' ], function( SceneTransforms, - SceneMode, Cartesian2, Cartesian3, Ellipsoid, CesiumMath, Rectangle, Camera, + SceneMode, createScene) { 'use strict'; diff --git a/Specs/Scene/ScreenSpaceCameraControllerSpec.js b/Specs/Scene/ScreenSpaceCameraControllerSpec.js index f205c1ce6db6..e5cca443b05d 100644 --- a/Specs/Scene/ScreenSpaceCameraControllerSpec.js +++ b/Specs/Scene/ScreenSpaceCameraControllerSpec.js @@ -4,7 +4,6 @@ defineSuite([ 'Core/Cartesian2', 'Core/Cartesian3', 'Core/combine', - 'Core/defined', 'Core/Ellipsoid', 'Core/FeatureDetection', 'Core/GeographicProjection', @@ -26,7 +25,6 @@ defineSuite([ Cartesian2, Cartesian3, combine, - defined, Ellipsoid, FeatureDetection, GeographicProjection, @@ -72,7 +70,9 @@ defineSuite([ tileProvider : { ready : true }, - _tileLoadQueue : {}, + _tileLoadQueueHigh : [], + _tileLoadQueueMedium : [], + _tileLoadQueueLow : [], _debug : { tilesWaitingForChildren : 0 } diff --git a/Specs/Scene/ShadowMapSpec.js b/Specs/Scene/ShadowMapSpec.js index 692a68548a2f..5330c1c48417 100644 --- a/Specs/Scene/ShadowMapSpec.js +++ b/Specs/Scene/ShadowMapSpec.js @@ -247,7 +247,8 @@ defineSuite([ function loadGlobe() { return pollToPromise(function() { scene.render(); - return scene.globe._surface.tileProvider.ready && !defined(scene.globe._surface._tileLoadQueue.head) && scene.globe._surface._debug.tilesWaitingForChildren === 0; + var globe = scene.globe; + return globe._surface.tileProvider.ready && globe._surface._tileLoadQueueHigh.length === 0 && globe._surface._tileLoadQueueMedium.length === 0 && globe._surface._tileLoadQueueLow.length === 0 && globe._surface._debug.tilesWaitingForChildren === 0; }); } diff --git a/Specs/Scene/SkyAtmosphereSpec.js b/Specs/Scene/SkyAtmosphereSpec.js index d2b61728dc20..6e6121e261a8 100644 --- a/Specs/Scene/SkyAtmosphereSpec.js +++ b/Specs/Scene/SkyAtmosphereSpec.js @@ -4,7 +4,6 @@ defineSuite([ 'Core/Cartesian3', 'Core/Ellipsoid', 'Core/Math', - 'Renderer/ClearCommand', 'Scene/SceneMode', 'Specs/createScene' ], function( @@ -12,7 +11,6 @@ defineSuite([ Cartesian3, Ellipsoid, CesiumMath, - ClearCommand, SceneMode, createScene) { 'use strict'; diff --git a/Specs/Scene/SkyBoxSpec.js b/Specs/Scene/SkyBoxSpec.js index a109d5ed20d0..de55582f714f 100644 --- a/Specs/Scene/SkyBoxSpec.js +++ b/Specs/Scene/SkyBoxSpec.js @@ -1,16 +1,12 @@ /*global defineSuite*/ defineSuite([ 'Scene/SkyBox', - 'Core/Cartesian3', 'Core/loadImage', - 'Renderer/ClearCommand', 'Scene/SceneMode', 'Specs/createScene' ], function( SkyBox, - Cartesian3, loadImage, - ClearCommand, SceneMode, createScene) { 'use strict'; diff --git a/Specs/Scene/SunSpec.js b/Specs/Scene/SunSpec.js index 135e892f63dc..06b2a5693047 100644 --- a/Specs/Scene/SunSpec.js +++ b/Specs/Scene/SunSpec.js @@ -2,21 +2,15 @@ defineSuite([ 'Scene/Sun', 'Core/BoundingSphere', - 'Core/Cartesian3', 'Core/Color', - 'Core/Ellipsoid', 'Core/Math', - 'Core/Matrix4', 'Scene/SceneMode', 'Specs/createScene' ], function( Sun, BoundingSphere, - Cartesian3, Color, - Ellipsoid, CesiumMath, - Matrix4, SceneMode, createScene) { 'use strict'; diff --git a/Specs/Scene/TextureAtlasSpec.js b/Specs/Scene/TextureAtlasSpec.js index 2d2a81c164aa..d4bff44d253d 100644 --- a/Specs/Scene/TextureAtlasSpec.js +++ b/Specs/Scene/TextureAtlasSpec.js @@ -194,8 +194,8 @@ void main() {\n\ expect(texture.height).toEqual(atlasHeight); var coords = atlas.textureCoordinates[index]; - expect(coords.x).toEqual(0.0 / atlasWidth); - expect(coords.y).toEqual(0.0 / atlasHeight); + expect(coords.x).toEqual(1.0 / atlasWidth); + expect(coords.y).toEqual(1.0 / atlasHeight); expect(coords.width).toEqual(1.0 / atlasWidth); expect(coords.height).toEqual(1.0 / atlasHeight); }); @@ -383,23 +383,23 @@ void main() {\n\ expect(texture.width).toEqual(atlasWidth); expect(texture.height).toEqual(atlasHeight); - expect(c0.x).toEqualEpsilon(0.0 / atlasWidth, CesiumMath.EPSILON16); - expect(c0.y).toEqualEpsilon(0.0 / atlasHeight, CesiumMath.EPSILON16); + expect(c0.x).toEqualEpsilon(2.0 / atlasWidth, CesiumMath.EPSILON16); + expect(c0.y).toEqualEpsilon(2.0 / atlasHeight, CesiumMath.EPSILON16); expect(c0.width).toEqualEpsilon(greenImage.width / atlasWidth, CesiumMath.EPSILON16); expect(c0.height).toEqualEpsilon(greenImage.height / atlasHeight, CesiumMath.EPSILON16); - expect(c1.x).toEqualEpsilon((greenImage.width + atlas.borderWidthInPixels) / atlasWidth, CesiumMath.EPSILON16); - expect(c1.y).toEqualEpsilon(0.0 / atlasHeight, CesiumMath.EPSILON16); + expect(c1.x).toEqualEpsilon((greenImage.width + 2 * atlas.borderWidthInPixels) / atlasWidth, CesiumMath.EPSILON16); + expect(c1.y).toEqualEpsilon(2.0 / atlasHeight, CesiumMath.EPSILON16); expect(c1.width).toEqualEpsilon(blueImage.width / atlasWidth, CesiumMath.EPSILON16); expect(c1.height).toEqualEpsilon(blueImage.width / atlasHeight, CesiumMath.EPSILON16); - expect(c2.x).toEqualEpsilon((bigRedImage.width + atlas.borderWidthInPixels) / atlasWidth, CesiumMath.EPSILON16); - expect(c2.y).toEqualEpsilon(0.0 / atlasHeight, CesiumMath.EPSILON16); + expect(c2.x).toEqualEpsilon(2.0 / atlasWidth, CesiumMath.EPSILON16); + expect(c2.y).toEqualEpsilon((bigRedImage.height + atlas.borderWidthInPixels) / atlasHeight, CesiumMath.EPSILON16); expect(c2.width).toEqualEpsilon(bigRedImage.width / atlasWidth, CesiumMath.EPSILON16); expect(c2.height).toEqualEpsilon(bigRedImage.height / atlasHeight, CesiumMath.EPSILON16); - expect(c3.x).toEqualEpsilon(0.0 / atlasWidth, CesiumMath.EPSILON16); - expect(c3.y).toEqualEpsilon((greenImage.height + atlas.borderWidthInPixels) / atlasHeight, CesiumMath.EPSILON16); + expect(c3.x).toEqualEpsilon(2.0 / atlasWidth, CesiumMath.EPSILON16); + expect(c3.y).toEqualEpsilon((greenImage.height + 2 * atlas.borderWidthInPixels) / atlasHeight, CesiumMath.EPSILON16); expect(c3.width).toEqualEpsilon(bigBlueImage.width / atlasWidth, CesiumMath.EPSILON16); expect(c3.height).toEqualEpsilon(bigBlueImage.height / atlasHeight, CesiumMath.EPSILON16); }); @@ -577,20 +577,20 @@ void main() {\n\ var texture = atlas.texture; var coordinates = atlas.textureCoordinates; - var atlasWidth = 6.0; - var atlasHeight = 6.0; + var atlasWidth = 10.0; + var atlasHeight = 10.0; expect(atlas.borderWidthInPixels).toEqual(2); expect(atlas.numberOfImages).toEqual(2); expect(texture.width).toEqual(atlasWidth); expect(texture.height).toEqual(atlasHeight); - expect(coordinates[greenIndex].x).toEqual(0.0 / atlasWidth); - expect(coordinates[greenIndex].y).toEqual(0.0 / atlasHeight); + expect(coordinates[greenIndex].x).toEqual(atlas.borderWidthInPixels / atlasWidth); + expect(coordinates[greenIndex].y).toEqual(atlas.borderWidthInPixels / atlasHeight); expect(coordinates[greenIndex].width).toEqual(1.0 / atlasWidth); expect(coordinates[greenIndex].height).toEqual(1.0 / atlasHeight); - expect(coordinates[blueIndex].x).toEqual(3.0 / atlasWidth); - expect(coordinates[blueIndex].y).toEqual(0.0 / atlasHeight); + expect(coordinates[blueIndex].x).toEqual(5.0 / atlasWidth); + expect(coordinates[blueIndex].y).toEqual(2.0 / atlasHeight); expect(coordinates[blueIndex].width).toEqual(1.0 / atlasWidth); expect(coordinates[blueIndex].height).toEqual(1.0 / atlasHeight); }); diff --git a/Specs/Scene/TileCoordinatesImageryProviderSpec.js b/Specs/Scene/TileCoordinatesImageryProviderSpec.js index 82bfeea7559c..e6f4b954cf34 100644 --- a/Specs/Scene/TileCoordinatesImageryProviderSpec.js +++ b/Specs/Scene/TileCoordinatesImageryProviderSpec.js @@ -1,7 +1,6 @@ /*global defineSuite*/ defineSuite([ 'Scene/TileCoordinatesImageryProvider', - 'Core/defined', 'Core/Ellipsoid', 'Core/GeographicTilingScheme', 'Core/WebMercatorTilingScheme', @@ -10,7 +9,6 @@ defineSuite([ 'ThirdParty/when' ], function( TileCoordinatesImageryProvider, - defined, Ellipsoid, GeographicTilingScheme, WebMercatorTilingScheme, diff --git a/Specs/Scene/ViewportQuadSpec.js b/Specs/Scene/ViewportQuadSpec.js index ba5311e8fa3e..7184e72cf57f 100644 --- a/Specs/Scene/ViewportQuadSpec.js +++ b/Specs/Scene/ViewportQuadSpec.js @@ -4,7 +4,6 @@ defineSuite([ 'Core/BoundingRectangle', 'Core/Color', 'Core/loadImage', - 'Renderer/ClearCommand', 'Renderer/Texture', 'Scene/Material', 'Specs/createScene', @@ -14,7 +13,6 @@ defineSuite([ BoundingRectangle, Color, loadImage, - ClearCommand, Texture, Material, createScene, diff --git a/Specs/Scene/WebMapServiceImageryProviderSpec.js b/Specs/Scene/WebMapServiceImageryProviderSpec.js index b5f30a7ddb34..462499999dbc 100644 --- a/Specs/Scene/WebMapServiceImageryProviderSpec.js +++ b/Specs/Scene/WebMapServiceImageryProviderSpec.js @@ -3,7 +3,6 @@ defineSuite([ 'Scene/WebMapServiceImageryProvider', 'Core/Cartographic', 'Core/DefaultProxy', - 'Core/defined', 'Core/Ellipsoid', 'Core/GeographicTilingScheme', 'Core/loadImage', @@ -19,13 +18,11 @@ defineSuite([ 'Scene/ImageryProvider', 'Scene/ImageryState', 'Specs/pollToPromise', - 'ThirdParty/Uri', - 'ThirdParty/when' + 'ThirdParty/Uri' ], function( WebMapServiceImageryProvider, Cartographic, DefaultProxy, - defined, Ellipsoid, GeographicTilingScheme, loadImage, @@ -41,8 +38,7 @@ defineSuite([ ImageryProvider, ImageryState, pollToPromise, - Uri, - when) { + Uri) { 'use strict'; afterEach(function() { diff --git a/Specs/Scene/WebMapTileServiceImageryProviderSpec.js b/Specs/Scene/WebMapTileServiceImageryProviderSpec.js index 8dea133eea30..078a18542a65 100644 --- a/Specs/Scene/WebMapTileServiceImageryProviderSpec.js +++ b/Specs/Scene/WebMapTileServiceImageryProviderSpec.js @@ -3,7 +3,6 @@ defineSuite([ 'Scene/WebMapTileServiceImageryProvider', 'Core/Credit', 'Core/DefaultProxy', - 'Core/defined', 'Core/GeographicTilingScheme', 'Core/loadImage', 'Core/queryToObject', @@ -18,7 +17,6 @@ defineSuite([ WebMapTileServiceImageryProvider, Credit, DefaultProxy, - defined, GeographicTilingScheme, loadImage, queryToObject, diff --git a/Specs/Scene/createOpenStreetMapImageryProviderSpec.js b/Specs/Scene/createOpenStreetMapImageryProviderSpec.js index 94c79e28f307..77800b4d2983 100644 --- a/Specs/Scene/createOpenStreetMapImageryProviderSpec.js +++ b/Specs/Scene/createOpenStreetMapImageryProviderSpec.js @@ -8,7 +8,6 @@ defineSuite([ 'Core/WebMercatorTilingScheme', 'Scene/Imagery', 'Scene/ImageryLayer', - 'Scene/ImageryProvider', 'Scene/ImageryState', 'Scene/UrlTemplateImageryProvider', 'Specs/pollToPromise' @@ -21,7 +20,6 @@ defineSuite([ WebMercatorTilingScheme, Imagery, ImageryLayer, - ImageryProvider, ImageryState, UrlTemplateImageryProvider, pollToPromise) { diff --git a/Specs/Widgets/CesiumInspector/CesiumInspectorViewModelSpec.js b/Specs/Widgets/CesiumInspector/CesiumInspectorViewModelSpec.js index b74b124d4166..943895de0fc1 100644 --- a/Specs/Widgets/CesiumInspector/CesiumInspectorViewModelSpec.js +++ b/Specs/Widgets/CesiumInspector/CesiumInspectorViewModelSpec.js @@ -10,7 +10,6 @@ defineSuite([ 'Scene/EllipsoidSurfaceAppearance', 'Scene/Globe', 'Scene/GlobeSurfaceTile', - 'Scene/Material', 'Scene/Primitive', 'Scene/QuadtreeTile', 'Specs/createScene' @@ -25,7 +24,6 @@ defineSuite([ EllipsoidSurfaceAppearance, Globe, GlobeSurfaceTile, - Material, Primitive, QuadtreeTile, createScene) { diff --git a/Specs/Widgets/InfoBox/InfoBoxViewModelSpec.js b/Specs/Widgets/InfoBox/InfoBoxViewModelSpec.js index 2b4add7e8474..e269a982f702 100644 --- a/Specs/Widgets/InfoBox/InfoBoxViewModelSpec.js +++ b/Specs/Widgets/InfoBox/InfoBoxViewModelSpec.js @@ -1,10 +1,8 @@ /*global defineSuite*/ defineSuite([ - 'Widgets/InfoBox/InfoBoxViewModel', - 'Specs/pollToPromise' + 'Widgets/InfoBox/InfoBoxViewModel' ], function( - InfoBoxViewModel, - pollToPromise) { + InfoBoxViewModel) { 'use strict'; it('constructor sets expected values', function() { diff --git a/Specs/Widgets/SvgPathBindingHandlerSpec.js b/Specs/Widgets/SvgPathBindingHandlerSpec.js index e84f49cb8367..b1014541e0c8 100644 --- a/Specs/Widgets/SvgPathBindingHandlerSpec.js +++ b/Specs/Widgets/SvgPathBindingHandlerSpec.js @@ -1,9 +1,7 @@ /*global defineSuite*/ defineSuite([ - 'Widgets/SvgPathBindingHandler', 'ThirdParty/knockout' ], function( - SvgPathBindingHandler, knockout) { 'use strict'; diff --git a/Specs/Widgets/Viewer/ViewerSpec.js b/Specs/Widgets/Viewer/ViewerSpec.js index 5fd773162693..a5fbed70cfa6 100644 --- a/Specs/Widgets/Viewer/ViewerSpec.js +++ b/Specs/Widgets/Viewer/ViewerSpec.js @@ -1,6 +1,5 @@ /*global defineSuite*/ defineSuite([ - 'Widgets/Viewer/Viewer', 'Core/Cartesian3', 'Core/ClockRange', 'Core/ClockStep', @@ -35,7 +34,6 @@ defineSuite([ 'Widgets/SelectionIndicator/SelectionIndicator', 'Widgets/Timeline/Timeline' ], function( - Viewer, Cartesian3, ClockRange, ClockStep, diff --git a/Specs/createPackableArraySpecs.js b/Specs/createPackableArraySpecs.js index 47cd53a4c88e..2ea31b3fedc9 100644 --- a/Specs/createPackableArraySpecs.js +++ b/Specs/createPackableArraySpecs.js @@ -1,10 +1,8 @@ /*global define*/ define([ - 'Core/defaultValue', - 'Core/defined' + 'Core/defaultValue' ], function( - defaultValue, - defined) { + defaultValue) { 'use strict'; function createPackableArraySpecs(packable, unpackedArray, packedArray, namePrefix) { diff --git a/Specs/createScene.js b/Specs/createScene.js index 09111123dfbf..bbb1d7e7009f 100644 --- a/Specs/createScene.js +++ b/Specs/createScene.js @@ -4,7 +4,6 @@ define([ 'Core/clone', 'Core/defaultValue', 'Core/defined', - 'Core/queryToObject', 'Scene/Scene', 'Specs/createCanvas', 'Specs/destroyCanvas' @@ -13,7 +12,6 @@ define([ clone, defaultValue, defined, - queryToObject, Scene, createCanvas, destroyCanvas) { diff --git a/Specs/render.js b/Specs/render.js index b769b1e485ec..ed2caf3d0346 100644 --- a/Specs/render.js +++ b/Specs/render.js @@ -1,12 +1,10 @@ /*global define*/ define([ - 'Core/defaultValue', 'Core/defined', 'Core/Intersect', 'Scene/Pass', 'Scene/SceneMode' ], function( - defaultValue, defined, Intersect, Pass, diff --git a/Tools/jsdoc/cesium_template/static/images/CesiumLogo.png b/Tools/jsdoc/cesium_template/static/images/CesiumLogo.png index 90b5ccde9ce0..507d4b766e8a 100644 Binary files a/Tools/jsdoc/cesium_template/static/images/CesiumLogo.png and b/Tools/jsdoc/cesium_template/static/images/CesiumLogo.png differ diff --git a/Tools/jsdoc/cesium_template/static/styles/jsdoc-default.css b/Tools/jsdoc/cesium_template/static/styles/jsdoc-default.css index 23f3a31438ef..abce268cff35 100644 --- a/Tools/jsdoc/cesium_template/static/styles/jsdoc-default.css +++ b/Tools/jsdoc/cesium_template/static/styles/jsdoc-default.css @@ -148,8 +148,8 @@ div.menu position: relative; top: -7px; left: -2px; - width: 187px; - height: 35px; + width: 191px; + height: 40px; margin: 0; } diff --git a/favicon.ico b/favicon.ico index e28d548f0701..0b05a3cda16b 100644 Binary files a/favicon.ico and b/favicon.ico differ diff --git a/gulpfile.js b/gulpfile.js index 9ac3c301a40f..177bb2dd4d79 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -272,7 +272,6 @@ gulp.task('makeZipFile', ['release'], function() { 'Source/**', 'Specs/**', 'ThirdParty/**', - 'logo.png', 'favicon.ico', 'gulpfile.js', 'server.js', @@ -385,7 +384,6 @@ function deployCesium(bucketName, uploadDirectory, cacheControl, done) { 'favicon.ico', 'gulpfile.js', 'index.html', - 'logo.png', 'package.json', 'server.js', 'web.config', diff --git a/index.release.html b/index.release.html index a8db9870dfaf..1d26baa058b4 100644 --- a/index.release.html +++ b/index.release.html @@ -27,7 +27,7 @@

- +