0?(t.strm.data_type===N&&(t.strm.data_type=S(t)),k(t,t.l_desc),k(t,t.d_desc),s=z(t),n=t.opt_len+3+7>>>3,(r=t.static_len+3+7>>>3)<=n&&(n=r)):n=r=a+5,a+4<=n&&-1!==e?E(t,e,a,i):t.strategy===Z||r===n?(l(t,(D<<1)+(i?1:0),3),v(t,$,tt)):(l(t,(I<<1)+(i?1:0),3),B(t,t.l_desc.max_code+1,t.d_desc.max_code+1,s+1),v(t,t.dyn_ltree,t.dyn_dtree)),b(t),i&&g(t)},a._tr_tally=function(t,e,a){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&a,t.last_lit++,0===e?t.dyn_ltree[2*a]++:(t.matches++,e--,t.dyn_ltree[2*(at[a]+T+1)]++,t.dyn_dtree[2*s(e)]++),t.last_lit===t.lit_bufsize-1},a._tr_align=function(t){l(t,D<<1,3),h(t,Y,$),f(t)}},{"../utils/common":3}],15:[function(t,e,a){"use strict";e.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],"/":[function(t,e,a){"use strict";var i={};(0,t("./lib/utils/common").assign)(i,t("./lib/deflate"),t("./lib/inflate"),t("./lib/zlib/constants")),e.exports=i},{"./lib/deflate":1,"./lib/inflate":2,"./lib/utils/common":3,"./lib/zlib/constants":6}]},{},[])("/")});
diff --git a/Apps/Sandcastle/gallery/3D Models.html b/Apps/Sandcastle/gallery/3D Models.html
index 0384b95187ff..ee45d75686f1 100644
--- a/Apps/Sandcastle/gallery/3D Models.html
+++ b/Apps/Sandcastle/gallery/3D Models.html
@@ -10,10 +10,12 @@
@@ -86,7 +88,7 @@
Sandcastle.addToolbarMenu(options);
//Sandcastle_End
-Sandcastle.finishedLoading();
+ Sandcastle.finishedLoading();
}
if (typeof Cesium !== "undefined") {
startup(Cesium);
diff --git a/Apps/Sandcastle/gallery/3D Tiles Clipping Planes.html b/Apps/Sandcastle/gallery/3D Tiles Clipping Planes.html
index df2f4e429d3e..6270030f6cbe 100644
--- a/Apps/Sandcastle/gallery/3D Tiles Clipping Planes.html
+++ b/Apps/Sandcastle/gallery/3D Tiles Clipping Planes.html
@@ -258,6 +258,7 @@
viewer.scene.primitives.removeAll();
planeEntities = [];
targetY = 0.0;
+ tileset = undefined;
}
//Sandcastle_End
diff --git a/Apps/Sandcastle/gallery/Terrain Clipping Planes.html b/Apps/Sandcastle/gallery/Terrain Clipping Planes.html
index ecfa7394c8b0..1a041061c4b7 100644
--- a/Apps/Sandcastle/gallery/Terrain Clipping Planes.html
+++ b/Apps/Sandcastle/gallery/Terrain Clipping Planes.html
@@ -33,7 +33,9 @@
Loading...
+
Globe clipping planes enabled
+ Edge styling enabled
@@ -27,8 +29,9 @@
function startup(Cesium) {
'use strict';
//Sandcastle_Begin
-
-var viewer = new Cesium.Viewer('cesiumContainer');
+var viewer = new Cesium.Viewer('cesiumContainer', {
+ shouldAnimate: true
+});
var scene = viewer.scene;
var context = scene.context;
var camera = viewer.camera;
@@ -247,7 +250,7 @@
});
//Sandcastle_End
-Sandcastle.finishedLoading();
+ Sandcastle.finishedLoading();
}
if (typeof Cesium !== "undefined") {
startup(Cesium);
diff --git a/Apps/Sandcastle/gallery/development/Many Clipping Planes.html b/Apps/Sandcastle/gallery/development/Many Clipping Planes.html
index 09bb82d8b791..c6d28dfa42e8 100644
--- a/Apps/Sandcastle/gallery/development/Many Clipping Planes.html
+++ b/Apps/Sandcastle/gallery/development/Many Clipping Planes.html
@@ -4,8 +4,8 @@
-
-
+
+
Cesium Demo
@@ -49,14 +49,10 @@
infoBox: false,
selectionIndicator: false,
shouldAnimate : true,
- projectionPicker : true
+ projectionPicker : true,
+ terrainProvider: Cesium.createWorldTerrain()
});
-viewer.terrainProvider = new Cesium.CesiumTerrainProvider({
- url : 'https://assets.agi.com/stk-terrain/v1/tilesets/world/tiles',
- requestWaterMask : true,
- requestVertexNormals : true
-});
viewer.extend(Cesium.viewerCesium3DTilesInspectorMixin);
var globe = viewer.scene.globe;
@@ -114,7 +110,7 @@
}
function computePlanes() {
- var stepDegrees = 6.28319 / steps;
+ var stepDegrees = Cesium.Math.TWO_PI / steps;
clippingPlanes = [];
for (var i = 0; i < steps; i++) {
@@ -122,15 +118,14 @@
var dir = new Cesium.Cartesian3();
dir.x = 1.0;
dir.y = Math.tan(angle);
- if (angle > 1.57079632679) {
+ if (angle > Cesium.Math.PI_OVER_TWO) {
dir.x = -1.0;
dir.y *= -1.0;
}
- if (angle > 3.14159265359) {
+ if (angle > Cesium.Math.PI) {
dir.x = -1.0;
- dir.y = dir.y;
}
- if (angle > 4.71238898038) {
+ if (angle > (Cesium.Math.PI_OVER_TWO * 3)) {
dir.x = 1.0;
dir.y = -dir.y;
}
diff --git a/Apps/Sandcastle/index.html b/Apps/Sandcastle/index.html
index 2f40003d957e..0dcaac49fc97 100644
--- a/Apps/Sandcastle/index.html
+++ b/Apps/Sandcastle/index.html
@@ -82,11 +82,12 @@
+
Import Gist
diff --git a/CHANGES.md b/CHANGES.md
index 1d1ea21ea92e..0f29f2e425c3 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -16,7 +16,12 @@ Change Log
* Removed the 6-clipping-plane limit.
* Added support for Internet Explorer.
* Added a `ClippingPlane` object to be used with `ClippingPlaneCollection`.
+ * Added 3D Tiles use-case to Terrain Clipping Planes Sandcastle
* Updated `WebMapServiceImageryProvider` so it can take an srs or crs string to pass to the resource query parameters based on the WMS version. [#6223](https://github.com/AnalyticalGraphicsInc/cesium/issues/6223)
+* Sharing Sandcastle examples now works by storing the full example directly in the URL instead of creating GitHub gists, because anonymous gist creation was removed by GitHub. Loading existing gists will still work. [#6342](https://github.com/AnalyticalGraphicsInc/cesium/pull/6342)
+* Added additional query parameter options to the CesiumViewer demo application:
+ * sourceType specifies the type of data source if the URL doesn't have a known file extension.
+ * flyTo=false optionally disables the automatic flyTo after loading the data source.
* Added a multi-part CZML example to Sandcastle. [#6320](https://github.com/AnalyticalGraphicsInc/cesium/pull/6320)
* `Credit` has been modified to take an HTML string as the credit content [#6331](https://github.com/AnalyticalGraphicsInc/cesium/pull/6331)
diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md
index bc6872cb7891..a02f46bd13fd 100644
--- a/CONTRIBUTORS.md
+++ b/CONTRIBUTORS.md
@@ -172,3 +172,4 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to contribute to Cesiu
* [Y.Selim Abidin](https://github.com/SelimAbidin)
* [Tamar Cohen](https://github.com/tamarmot)
* [Stephen Wiseman](https://github.com/srwiseman)
+* [Gabriel Macario](https://github.com/gabriel-macario)
diff --git a/LICENSE.md b/LICENSE.md
index ba9a03ea62b6..4c062b3fc734 100644
--- a/LICENSE.md
+++ b/LICENSE.md
@@ -779,6 +779,19 @@ http://codemirror.net/
>
> Please note that some subdirectories of the CodeMirror distribution include their own LICENSE files, and are released under different licences.
+### clipboard.js
+
+https://clipboardjs.com/
+
+> The MIT License (MIT)
+> Copyright © 2018 Zeno Rocha
+>
+> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+>
+> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+>
+> THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
### JSHint
http://www.jshint.com/
diff --git a/Source/Core/AttributeCompression.js b/Source/Core/AttributeCompression.js
index ed4c4a88c5d2..3d47633b81b9 100644
--- a/Source/Core/AttributeCompression.js
+++ b/Source/Core/AttributeCompression.js
@@ -14,6 +14,9 @@ define([
CesiumMath) {
'use strict';
+ var RIGHT_SHIFT = 1.0 / 256.0;
+ var LEFT_SHIFT = 256.0;
+
/**
* Attribute compression and decompression functions.
*
@@ -80,6 +83,31 @@ define([
return AttributeCompression.octEncodeInRange(vector, 255, result);
};
+ var octEncodeScratch = new Cartesian2();
+ var uint8ForceArray = new Uint8Array(1);
+ function forceUint8(value) {
+ uint8ForceArray[0] = value;
+ return uint8ForceArray[0];
+ }
+ /**
+ * @param {Cartesian3} vector The normalized vector to be compressed into 4 byte 'oct' encoding.
+ * @param {Cartesian4} result The 4 byte oct-encoded unit length vector.
+ * @returns {Cartesian4} The 4 byte oct-encoded unit length vector.
+ *
+ * @exception {DeveloperError} vector must be normalized.
+ *
+ * @see AttributeCompression.octEncodeInRange
+ * @see AttributeCompression.octDecodeFromCartesian4
+ */
+ AttributeCompression.octEncodeToCartesian4 = function(vector, result) {
+ AttributeCompression.octEncodeInRange(vector, 65535, octEncodeScratch);
+ result.x = forceUint8(octEncodeScratch.x * RIGHT_SHIFT);
+ result.y = forceUint8(octEncodeScratch.x);
+ result.z = forceUint8(octEncodeScratch.y * RIGHT_SHIFT);
+ result.w = forceUint8(octEncodeScratch.y);
+ return result;
+ };
+
/**
* Decodes a unit-length vector in 'oct' encoding to a normalized 3-component vector.
*
@@ -89,7 +117,7 @@ define([
* @param {Cartesian3} result The decoded and normalized vector
* @returns {Cartesian3} The decoded and normalized vector.
*
- * @exception {DeveloperError} x and y must be an unsigned normalized integer between 0 and rangeMax.
+ * @exception {DeveloperError} x and y must be unsigned normalized integers between 0 and rangeMax.
*
* @see AttributeCompression.octEncodeInRange
*/
@@ -97,7 +125,7 @@ define([
//>>includeStart('debug', pragmas.debug);
Check.defined('result', result);
if (x < 0 || x > rangeMax || y < 0 || y > rangeMax) {
- throw new DeveloperError('x and y must be a signed normalized integer between 0 and ' + rangeMax);
+ throw new DeveloperError('x and y must be unsigned normalized integers between 0 and ' + rangeMax);
}
//>>includeEnd('debug');
@@ -131,6 +159,38 @@ define([
return AttributeCompression.octDecodeInRange(x, y, 255, result);
};
+ /**
+ * Decodes a unit-length vector in 4 byte 'oct' encoding to a normalized 3-component vector.
+ *
+ * @param {Cartesian4} encoded The oct-encoded unit length vector.
+ * @param {Cartesian3} result The decoded and normalized vector.
+ * @returns {Cartesian3} The decoded and normalized vector.
+ *
+ * @exception {DeveloperError} x, y, z, and w must be unsigned normalized integers between 0 and 255.
+ *
+ * @see AttributeCompression.octDecodeInRange
+ * @see AttributeCompression.octEncodeToCartesian4
+ */
+ AttributeCompression.octDecodeFromCartesian4 = function(encoded, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.typeOf.object('encoded', encoded);
+ Check.typeOf.object('result', result);
+ //>>includeEnd('debug');
+ var x = encoded.x;
+ var y = encoded.y;
+ var z = encoded.z;
+ var w = encoded.w;
+ //>>includeStart('debug', pragmas.debug);
+ if (x < 0 || x > 255 || y < 0 || y > 255 || z < 0 || z > 255 || w < 0 || w > 255) {
+ throw new DeveloperError('x, y, z, and w must be unsigned normalized integers between 0 and 255');
+ }
+ //>>includeEnd('debug');
+
+ var xOct16 = x * LEFT_SHIFT + y;
+ var yOct16 = z * LEFT_SHIFT + w;
+ return AttributeCompression.octDecodeInRange(xOct16, yOct16, 65535, result);
+ };
+
/**
* Packs an oct encoded vector into a single floating-point number.
*
diff --git a/Source/Core/BingMapsApi.js b/Source/Core/BingMapsApi.js
index 8700c0596c3c..6d6032d28297 100644
--- a/Source/Core/BingMapsApi.js
+++ b/Source/Core/BingMapsApi.js
@@ -1,9 +1,9 @@
define([
- './Credit',
- './defined'
-], function(
- Credit,
- defined) {
+ './Credit',
+ './defined'
+ ], function(
+ Credit,
+ defined) {
'use strict';
/**
diff --git a/Source/Core/BoundingSphere.js b/Source/Core/BoundingSphere.js
index a1549999b480..e799a3166b64 100644
--- a/Source/Core/BoundingSphere.js
+++ b/Source/Core/BoundingSphere.js
@@ -1,7 +1,6 @@
define([
'./Cartesian3',
'./Cartographic',
- './Math',
'./Check',
'./defaultValue',
'./defined',
@@ -9,13 +8,13 @@ define([
'./GeographicProjection',
'./Intersect',
'./Interval',
+ './Math',
'./Matrix3',
'./Matrix4',
'./Rectangle'
], function(
Cartesian3,
Cartographic,
- CesiumMath,
Check,
defaultValue,
defined,
@@ -23,6 +22,7 @@ define([
GeographicProjection,
Intersect,
Interval,
+ CesiumMath,
Matrix3,
Matrix4,
Rectangle) {
diff --git a/Source/Core/Cartesian4.js b/Source/Core/Cartesian4.js
index 479ce4d1f517..f4ab5ac8cde6 100644
--- a/Source/Core/Cartesian4.js
+++ b/Source/Core/Cartesian4.js
@@ -880,6 +880,7 @@ define([
*
* @param {Cartesian4} packedFloat A Cartesian4 containing a float packed to 4 values representable using uint8.
* @returns {Number} The unpacked float.
+ * @private
*/
Cartesian4.unpackFloat = function(packedFloat) {
//>>includeStart('debug', pragmas.debug);
diff --git a/Source/Core/DoublyLinkedList.js b/Source/Core/DoublyLinkedList.js
index c73ff464338c..fe3ef7c67aad 100644
--- a/Source/Core/DoublyLinkedList.js
+++ b/Source/Core/DoublyLinkedList.js
@@ -1,6 +1,6 @@
define([
- '../Core/defined',
- '../Core/defineProperties'
+ './defined',
+ './defineProperties'
], function(
defined,
defineProperties) {
@@ -29,6 +29,11 @@ define([
this.next = next;
}
+ /**
+ * Adds the item to the end of the list
+ * @param {Object} [item]
+ * @return {DoublyLinkedListNode}
+ */
DoublyLinkedList.prototype.add = function(item) {
var node = new DoublyLinkedListNode(item, this.tail, undefined);
@@ -36,7 +41,6 @@ define([
this.tail.next = node;
this.tail = node;
} else {
- // Insert into empty linked list
this.head = node;
this.tail = node;
}
@@ -46,6 +50,43 @@ define([
return node;
};
+ /**
+ * Adds the item to the front of the list
+ * @param {Object} [item]
+ * @return {DoublyLinkedListNode}
+ */
+ DoublyLinkedList.prototype.addFront = function(item) {
+ var node = new DoublyLinkedListNode(item, undefined, this.head);
+
+ if (defined(this.head)) {
+ this.head.previous = node;
+ this.head = node;
+ } else {
+ this.head = node;
+ this.tail = node;
+ }
+
+ ++this._length;
+
+ return node;
+ };
+
+ /**
+ * Moves the given node to the front of the list
+ * @param {DoublyLinkedListNode} node
+ */
+ DoublyLinkedList.prototype.moveToFront = function(node) {
+ if (!defined(node) || this.head === node) {
+ return;
+ }
+
+ remove(this, node);
+ node.next = this.head;
+ node.previous = undefined;
+ this.head.previous = node;
+ this.head = node;
+ };
+
function remove(list, node) {
if (defined(node.previous) && defined(node.next)) {
node.previous.next = node.next;
@@ -68,6 +109,10 @@ define([
node.previous = undefined;
}
+ /**
+ * Removes the given node from the list
+ * @param {DoublyLinkedListNode} node
+ */
DoublyLinkedList.prototype.remove = function(node) {
if (!defined(node)) {
return;
@@ -78,6 +123,43 @@ define([
--this._length;
};
+ /**
+ * Removes all nodes after the start index (inclusive)
+ * @param {Number} startIndex The index of the first node to remove
+ */
+ DoublyLinkedList.prototype.removeAfter = function(startIndex) {
+ var currentLength = this._length;
+ if (!defined(startIndex) || startIndex >= currentLength) {
+ return;
+ }
+
+ if (startIndex === 0) {
+ this.head = undefined;
+ this.tail = undefined;
+ this._length = 0;
+ return;
+ }
+
+ if (startIndex === currentLength - 1) {
+ this.remove(this.tail);
+ return;
+ }
+
+ var node = this.head;
+ for (var i = 0; i < startIndex; ++i) {
+ node = node.next;
+ }
+
+ node.previous.next = undefined;
+ this.tail = node.previous;
+ this._length = startIndex;
+ };
+
+ /**
+ * Moves nextNode after node
+ * @param {DoublyLinkedListNode} node
+ * @param {DoublyLinkedListNode} nextNode
+ */
DoublyLinkedList.prototype.splice = function(node, nextNode) {
if (node === nextNode) {
return;
diff --git a/Source/Core/IonResource.js b/Source/Core/IonResource.js
index 2cde017b22a2..d814869f6131 100644
--- a/Source/Core/IonResource.js
+++ b/Source/Core/IonResource.js
@@ -1,4 +1,5 @@
define([
+ '../ThirdParty/when',
'./Check',
'./Credit',
'./defaultValue',
@@ -6,9 +7,9 @@ define([
'./defineProperties',
'./Ion',
'./Resource',
- './RuntimeError',
- '../ThirdParty/when'
+ './RuntimeError'
], function(
+ when,
Check,
Credit,
defaultValue,
@@ -16,8 +17,7 @@ define([
defineProperties,
Ion,
Resource,
- RuntimeError,
- when) {
+ RuntimeError) {
'use strict';
/**
diff --git a/Source/Core/LRUCache.js b/Source/Core/LRUCache.js
new file mode 100644
index 000000000000..9512f3b9d487
--- /dev/null
+++ b/Source/Core/LRUCache.js
@@ -0,0 +1,174 @@
+define([
+ './defined',
+ './defineProperties',
+ './DeveloperError',
+ './DoublyLinkedList',
+ './getTimestamp'
+ ], function(
+ defined,
+ defineProperties,
+ DeveloperError,
+ DoublyLinkedList,
+ getTimestamp) {
+ 'use strict';
+
+ /**
+ * A cache for storing key-value pairs
+ * @param {Number} [capacity] The capacity of the cache. If undefined, the size will be unlimited.
+ * @param {Number} [expiration] The number of milliseconds before an item in the cache expires and will be discarded when LRUCache.prune is called. If undefined, items do not expire.
+ * @alias LRUCache
+ * @constructor
+ * @private
+ */
+ function LRUCache(capacity, expiration) {
+ this._list = new DoublyLinkedList();
+ this._hash = {};
+ this._hasCapacity = defined(capacity);
+ this._capacity = capacity;
+
+ this._hasExpiration = defined(expiration);
+ this._expiration = expiration;
+ this._interval = undefined;
+ }
+
+ defineProperties(LRUCache.prototype, {
+ /**
+ * Gets the cache length
+ * @memberof LRUCache.prototype
+ * @type {Number}
+ * @readonly
+ */
+ length : {
+ get : function() {
+ return this._list.length;
+ }
+ }
+ });
+
+ /**
+ * Retrieves the value associated with the provided key.
+ *
+ * @param {String|Number} key The key whose value is to be retrieved.
+ * @returns {Object} The associated value, or undefined if the key does not exist in the collection.
+ */
+ LRUCache.prototype.get = function(key) {
+ //>>includeStart('debug', pragmas.debug);
+ if (typeof key !== 'string' && typeof key !== 'number') {
+ throw new DeveloperError('key is required to be a string or number.');
+ }
+ //>>includeEnd('debug');
+ var list = this._list;
+ var node = this._hash[key];
+ if (defined(node)) {
+ list.moveToFront(node);
+ var item = node.item;
+ item.touch();
+ return item.value;
+ }
+ };
+
+ /**
+ * Associates the provided key with the provided value. If the key already
+ * exists, it is overwritten with the new value.
+ *
+ * @param {String|Number} key A unique identifier.
+ * @param {Object} value The value to associate with the provided key.
+ */
+ LRUCache.prototype.set = function(key, value) {
+ //>>includeStart('debug', pragmas.debug);
+ if (typeof key !== 'string' && typeof key !== 'number') {
+ throw new DeveloperError('key is required to be a string or number.');
+ }
+ //>>includeEnd('debug');
+ var hash = this._hash;
+ var list = this._list;
+
+ var node = hash[key];
+ var item;
+ if (!defined(node)) {
+ item = new Item(key, value);
+ node = list.addFront(item);
+ hash[key] = node;
+ if (this._hasExpiration) {
+ LRUCache._checkExpiration(this);
+ }
+ if (this._hasCapacity && list.length > this._capacity) {
+ var tail = list.tail;
+ delete this._hash[tail.item.key];
+ list.remove(tail);
+ }
+ } else {
+ item = node.item;
+ item.value = value;
+ item.touch();
+ list.moveToFront(node);
+ }
+ };
+
+ function prune(cache) {
+ var currentTime = getTimestamp();
+ var pruneAfter = currentTime - cache._expiration;
+
+ var list = cache._list;
+ var node = list.tail;
+ var index = list.length;
+ while (defined(node) && node.item.timestamp < pruneAfter) {
+ node = node.previous;
+ index--;
+ }
+
+ if (node === list.tail) {
+ return;
+ }
+
+ if (!defined(node)) {
+ node = list.head;
+ } else {
+ node = node.next;
+ }
+
+ while (defined(node)) {
+ delete cache._hash[node.item.key];
+ node = node.next;
+ }
+
+ list.removeAfter(index);
+ }
+
+ function checkExpiration(cache) {
+ if (defined(cache._interval)) {
+ return;
+ }
+ function loop() {
+ if (!cache._hasExpiration || cache.length === 0) {
+ clearInterval(cache._interval);
+ cache._interval = undefined;
+ return;
+ }
+
+ prune(cache);
+
+ if (cache.length === 0) {
+ clearInterval(cache._interval);
+ cache._interval = undefined;
+ }
+ }
+ cache._interval = setInterval(loop, 1000);
+ }
+
+ function Item(key, value) {
+ this.key = key;
+ this.value = value;
+ this.timestamp = getTimestamp();
+ }
+
+ Item.prototype.touch = function() {
+ this.timestamp = getTimestamp();
+ };
+
+ //exposed for testing
+ LRUCache._checkExpiration = checkExpiration;
+ LRUCache._prune = prune;
+
+ return LRUCache;
+});
diff --git a/Source/Core/MapboxApi.js b/Source/Core/MapboxApi.js
index 3d10d3117393..59b600f021ff 100644
--- a/Source/Core/MapboxApi.js
+++ b/Source/Core/MapboxApi.js
@@ -1,9 +1,9 @@
define([
- './Credit',
- './defined'
-], function(
- Credit,
- defined) {
+ './Credit',
+ './defined'
+ ], function(
+ Credit,
+ defined) {
'use strict';
var MapboxApi = {};
diff --git a/Source/Core/Resource.js b/Source/Core/Resource.js
index 75ce182e1e79..bb51d17e9cde 100644
--- a/Source/Core/Resource.js
+++ b/Source/Core/Resource.js
@@ -1,56 +1,57 @@
define([
- './appendForwardSlash',
- './Check',
- './clone',
- './combine',
- './defaultValue',
- './defined',
- './defineProperties',
- './deprecationWarning',
- './DeveloperError',
- './freezeObject',
- './getAbsoluteUri',
- './getBaseUri',
- './getExtensionFromUri',
- './isBlobUri',
- './isCrossOriginUrl',
- './isDataUri',
- './objectToQuery',
- './queryToObject',
- './Request',
- './RequestErrorEvent',
- './RequestScheduler',
- './RequestState',
- './RuntimeError',
- './TrustedServers',
- '../ThirdParty/Uri',
- '../ThirdParty/when'
-], function(appendForwardSlash,
- Check,
- clone,
- combine,
- defaultValue,
- defined,
- defineProperties,
- deprecationWarning,
- DeveloperError,
- freezeObject,
- getAbsoluteUri,
- getBaseUri,
- getExtensionFromUri,
- isBlobUri,
- isCrossOriginUrl,
- isDataUri,
- objectToQuery,
- queryToObject,
- Request,
- RequestErrorEvent,
- RequestScheduler,
- RequestState,
- RuntimeError,
- TrustedServers,
- Uri,
- when) {
+ '../ThirdParty/Uri',
+ '../ThirdParty/when',
+ './appendForwardSlash',
+ './Check',
+ './clone',
+ './combine',
+ './defaultValue',
+ './defined',
+ './defineProperties',
+ './deprecationWarning',
+ './DeveloperError',
+ './freezeObject',
+ './getAbsoluteUri',
+ './getBaseUri',
+ './getExtensionFromUri',
+ './isBlobUri',
+ './isCrossOriginUrl',
+ './isDataUri',
+ './objectToQuery',
+ './queryToObject',
+ './Request',
+ './RequestErrorEvent',
+ './RequestScheduler',
+ './RequestState',
+ './RuntimeError',
+ './TrustedServers'
+ ], function(
+ Uri,
+ when,
+ appendForwardSlash,
+ Check,
+ clone,
+ combine,
+ defaultValue,
+ defined,
+ defineProperties,
+ deprecationWarning,
+ DeveloperError,
+ freezeObject,
+ getAbsoluteUri,
+ getBaseUri,
+ getExtensionFromUri,
+ isBlobUri,
+ isCrossOriginUrl,
+ isDataUri,
+ objectToQuery,
+ queryToObject,
+ Request,
+ RequestErrorEvent,
+ RequestScheduler,
+ RequestState,
+ RuntimeError,
+ TrustedServers) {
'use strict';
var xhrBlobSupported = (function() {
diff --git a/Source/Core/ScreenSpaceEventHandler.js b/Source/Core/ScreenSpaceEventHandler.js
index 7a56624cae60..8b6be308ad7c 100644
--- a/Source/Core/ScreenSpaceEventHandler.js
+++ b/Source/Core/ScreenSpaceEventHandler.js
@@ -767,8 +767,6 @@ define([
* isDestroyed
will result in a {@link DeveloperError} exception. Therefore,
* assign the return value (undefined
) to the object as done in the example.
*
- * @returns {undefined}
- *
* @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.
*
*
diff --git a/Source/Core/Spline.js b/Source/Core/Spline.js
index 49ccd8f593b3..08bd316990cd 100644
--- a/Source/Core/Spline.js
+++ b/Source/Core/Spline.js
@@ -4,7 +4,7 @@ define([
'./defined',
'./DeveloperError',
'./Math'
-], function(
+ ], function(
Check,
defaultValue,
defined,
diff --git a/Source/Core/TaskProcessor.js b/Source/Core/TaskProcessor.js
index 0846180e1bf7..76809ccc3a09 100644
--- a/Source/Core/TaskProcessor.js
+++ b/Source/Core/TaskProcessor.js
@@ -264,8 +264,6 @@ define([
*
* Once an object is destroyed, it should not be used; calling any function other than
* isDestroyed
will result in a {@link DeveloperError} exception.
- *
- * @returns {undefined}
*/
TaskProcessor.prototype.destroy = function() {
if (defined(this._worker)) {
diff --git a/Source/Core/WeightSpline.js b/Source/Core/WeightSpline.js
index 4a8ba66f84d8..62c58fd18e31 100644
--- a/Source/Core/WeightSpline.js
+++ b/Source/Core/WeightSpline.js
@@ -5,7 +5,7 @@ define([
'./defineProperties',
'./DeveloperError',
'./Spline'
-], function(
+ ], function(
Check,
defaultValue,
defined,
diff --git a/Source/Core/binarySearch.js b/Source/Core/binarySearch.js
index 7c527f97553b..fad2dffc4c7e 100644
--- a/Source/Core/binarySearch.js
+++ b/Source/Core/binarySearch.js
@@ -1,6 +1,7 @@
define([
- './Check'
-], function(Check) {
+ './Check'
+ ], function(
+ Check) {
'use strict';
/**
diff --git a/Source/Core/sampleTerrain.js b/Source/Core/sampleTerrain.js
index 08b1bea181d4..e7abfd4bc12c 100644
--- a/Source/Core/sampleTerrain.js
+++ b/Source/Core/sampleTerrain.js
@@ -1,11 +1,17 @@
define([
'../ThirdParty/when',
- './Check'
+ './Check',
+ './defined',
+ './LRUCache'
], function(
when,
- Check) {
+ Check,
+ defined,
+ LRUCache) {
'use strict';
+ var cache = new LRUCache(256, 10000);
+
/**
* Initiates a terrain height query for an array of {@link Cartographic} positions by
* requesting tiles from a terrain provider, sampling, and interpolating. The interpolation
@@ -86,8 +92,18 @@ define([
var tilePromises = [];
for (i = 0; i < tileRequests.length; ++i) {
var tileRequest = tileRequests[i];
- var requestPromise = tileRequest.terrainProvider.requestTileGeometry(tileRequest.x, tileRequest.y, tileRequest.level);
- var tilePromise = when(requestPromise, createInterpolateFunction(tileRequest), createMarkFailedFunction(tileRequest));
+ var cacheKey = tileRequest.x + '-' + tileRequest.y + '-' + tileRequest.level;
+ var requestPromise;
+ var cachedTilePromise = cache.get(cacheKey);
+ if (defined(cachedTilePromise)) {
+ requestPromise = cachedTilePromise;
+ } else {
+ requestPromise = tileRequest.terrainProvider.requestTileGeometry(tileRequest.x, tileRequest.y, tileRequest.level);
+ cache.set(cacheKey, requestPromise);
+ }
+ var tilePromise = requestPromise
+ .then(createInterpolateFunction(tileRequest))
+ .otherwise(createMarkFailedFunction(tileRequest));
tilePromises.push(tilePromise);
}
diff --git a/Source/DataSources/DataSourceCollection.js b/Source/DataSources/DataSourceCollection.js
index 05b9d8ac9d37..3dc03d305cc7 100644
--- a/Source/DataSources/DataSourceCollection.js
+++ b/Source/DataSources/DataSourceCollection.js
@@ -197,8 +197,6 @@ define([
* isDestroyed
will result in a {@link DeveloperError} exception. Therefore,
* assign the return value (undefined
) to the object as done in the example.
*
- * @returns {undefined}
- *
* @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.
*
*
diff --git a/Source/DataSources/DataSourceDisplay.js b/Source/DataSources/DataSourceDisplay.js
index 6ba39af29ba2..9fc1c0d125bd 100644
--- a/Source/DataSources/DataSourceDisplay.js
+++ b/Source/DataSources/DataSourceDisplay.js
@@ -168,8 +168,6 @@ define([
* isDestroyed
will result in a {@link DeveloperError} exception. Therefore,
* assign the return value (undefined
) to the object as done in the example.
*
- * @returns {undefined}
- *
* @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.
*
*
diff --git a/Source/DataSources/DynamicGeometryBatch.js b/Source/DataSources/DynamicGeometryBatch.js
index a36d3479bfd0..efa761c7043b 100644
--- a/Source/DataSources/DynamicGeometryBatch.js
+++ b/Source/DataSources/DynamicGeometryBatch.js
@@ -1,29 +1,29 @@
define([
- '../Core/AssociativeArray',
- '../Core/Color',
- '../Core/ColorGeometryInstanceAttribute',
- '../Core/defined',
- '../Core/DistanceDisplayCondition',
- '../Core/DistanceDisplayConditionGeometryInstanceAttribute',
- '../Core/ShowGeometryInstanceAttribute',
- '../Scene/Primitive',
- './BoundingSphereState',
- './ColorMaterialProperty',
- './MaterialProperty',
- './Property'
-], function(
- AssociativeArray,
- Color,
- ColorGeometryInstanceAttribute,
- defined,
- DistanceDisplayCondition,
- DistanceDisplayConditionGeometryInstanceAttribute,
- ShowGeometryInstanceAttribute,
- Primitive,
- BoundingSphereState,
- ColorMaterialProperty,
- MaterialProperty,
- Property) {
+ '../Core/AssociativeArray',
+ '../Core/Color',
+ '../Core/ColorGeometryInstanceAttribute',
+ '../Core/defined',
+ '../Core/DistanceDisplayCondition',
+ '../Core/DistanceDisplayConditionGeometryInstanceAttribute',
+ '../Core/ShowGeometryInstanceAttribute',
+ '../Scene/Primitive',
+ './BoundingSphereState',
+ './ColorMaterialProperty',
+ './MaterialProperty',
+ './Property'
+ ], function(
+ AssociativeArray,
+ Color,
+ ColorGeometryInstanceAttribute,
+ defined,
+ DistanceDisplayCondition,
+ DistanceDisplayConditionGeometryInstanceAttribute,
+ ShowGeometryInstanceAttribute,
+ Primitive,
+ BoundingSphereState,
+ ColorMaterialProperty,
+ MaterialProperty,
+ Property) {
'use strict';
/**
diff --git a/Source/DataSources/DynamicGeometryUpdater.js b/Source/DataSources/DynamicGeometryUpdater.js
index 8129ec288cec..672a5db01d4d 100644
--- a/Source/DataSources/DynamicGeometryUpdater.js
+++ b/Source/DataSources/DynamicGeometryUpdater.js
@@ -1,31 +1,31 @@
define([
- '../Core/defined',
- '../Core/destroyObject',
- '../Core/BoundingSphere',
- '../Core/Check',
- '../Core/DeveloperError',
- '../Scene/GroundPrimitive',
- '../Scene/MaterialAppearance',
- '../Scene/PerInstanceColorAppearance',
- '../Scene/Primitive',
- './BoundingSphereState',
- './ColorMaterialProperty',
- './MaterialProperty',
- './Property'
-], function(
- defined,
- destroyObject,
- BoundingSphere,
- Check,
- DeveloperError,
- GroundPrimitive,
- MaterialAppearance,
- PerInstanceColorAppearance,
- Primitive,
- BoundingSphereState,
- ColorMaterialProperty,
- MaterialProperty,
- Property) {
+ '../Core/BoundingSphere',
+ '../Core/Check',
+ '../Core/defined',
+ '../Core/destroyObject',
+ '../Core/DeveloperError',
+ '../Scene/GroundPrimitive',
+ '../Scene/MaterialAppearance',
+ '../Scene/PerInstanceColorAppearance',
+ '../Scene/Primitive',
+ './BoundingSphereState',
+ './ColorMaterialProperty',
+ './MaterialProperty',
+ './Property'
+ ], function(
+ BoundingSphere,
+ Check,
+ defined,
+ destroyObject,
+ DeveloperError,
+ GroundPrimitive,
+ MaterialAppearance,
+ PerInstanceColorAppearance,
+ Primitive,
+ BoundingSphereState,
+ ColorMaterialProperty,
+ MaterialProperty,
+ Property) {
'use strict';
/**
diff --git a/Source/DataSources/EllipsoidGeometryUpdater.js b/Source/DataSources/EllipsoidGeometryUpdater.js
index f1a03bf342e6..34ecddc475b0 100644
--- a/Source/DataSources/EllipsoidGeometryUpdater.js
+++ b/Source/DataSources/EllipsoidGeometryUpdater.js
@@ -1,6 +1,6 @@
define([
- '../Core/Check',
'../Core/Cartesian3',
+ '../Core/Check',
'../Core/Color',
'../Core/ColorGeometryInstanceAttribute',
'../Core/defaultValue',
@@ -23,8 +23,8 @@ define([
'./MaterialProperty',
'./Property'
], function(
- Check,
Cartesian3,
+ Check,
Color,
ColorGeometryInstanceAttribute,
defaultValue,
diff --git a/Source/DataSources/EntityCluster.js b/Source/DataSources/EntityCluster.js
index 277f399dd0b9..6dddfde31ed8 100644
--- a/Source/DataSources/EntityCluster.js
+++ b/Source/DataSources/EntityCluster.js
@@ -778,8 +778,6 @@ define([
* Unlike other objects that use WebGL resources, this object can be reused. For example, if a data source is removed
* from a data source collection and added to another.
*
- *
- * @returns {undefined}
*/
EntityCluster.prototype.destroy = function() {
this._labelCollection = this._labelCollection && this._labelCollection.destroy();
diff --git a/Source/DataSources/GeometryUpdater.js b/Source/DataSources/GeometryUpdater.js
index de748fdc270f..0846738c42fc 100644
--- a/Source/DataSources/GeometryUpdater.js
+++ b/Source/DataSources/GeometryUpdater.js
@@ -1,37 +1,37 @@
define([
- '../Core/Check',
- '../Core/Color',
- '../Core/defaultValue',
- '../Core/defined',
- '../Core/defineProperties',
- '../Core/destroyObject',
- '../Core/DeveloperError',
- '../Core/DistanceDisplayCondition',
- '../Core/Event',
- '../Core/Iso8601',
- '../Core/oneTimeWarning',
- '../Scene/ClassificationType',
- '../Scene/ShadowMode',
- './ColorMaterialProperty',
- './ConstantProperty',
- './Property'
-], function(
- Check,
- Color,
- defaultValue,
- defined,
- defineProperties,
- destroyObject,
- DeveloperError,
- DistanceDisplayCondition,
- Event,
- Iso8601,
- oneTimeWarning,
- ClassificationType,
- ShadowMode,
- ColorMaterialProperty,
- ConstantProperty,
- Property) {
+ '../Core/Check',
+ '../Core/Color',
+ '../Core/defaultValue',
+ '../Core/defined',
+ '../Core/defineProperties',
+ '../Core/destroyObject',
+ '../Core/DeveloperError',
+ '../Core/DistanceDisplayCondition',
+ '../Core/Event',
+ '../Core/Iso8601',
+ '../Core/oneTimeWarning',
+ '../Scene/ClassificationType',
+ '../Scene/ShadowMode',
+ './ColorMaterialProperty',
+ './ConstantProperty',
+ './Property'
+ ], function(
+ Check,
+ Color,
+ defaultValue,
+ defined,
+ defineProperties,
+ destroyObject,
+ DeveloperError,
+ DistanceDisplayCondition,
+ Event,
+ Iso8601,
+ oneTimeWarning,
+ ClassificationType,
+ ShadowMode,
+ ColorMaterialProperty,
+ ConstantProperty,
+ Property) {
'use strict';
var defaultMaterial = new ColorMaterialProperty(Color.WHITE);
diff --git a/Source/DataSources/GeometryVisualizer.js b/Source/DataSources/GeometryVisualizer.js
index abe85d68011a..706d46ce814f 100644
--- a/Source/DataSources/GeometryVisualizer.js
+++ b/Source/DataSources/GeometryVisualizer.js
@@ -11,8 +11,8 @@ define([
'../Scene/MaterialAppearance',
'../Scene/PerInstanceColorAppearance',
'../Scene/ShadowMode',
- './BoxGeometryUpdater',
'./BoundingSphereState',
+ './BoxGeometryUpdater',
'./ColorMaterialProperty',
'./CorridorGeometryUpdater',
'./CylinderGeometryUpdater',
@@ -41,8 +41,8 @@ define([
MaterialAppearance,
PerInstanceColorAppearance,
ShadowMode,
- BoxGeometryUpdater,
BoundingSphereState,
+ BoxGeometryUpdater,
ColorMaterialProperty,
CorridorGeometryUpdater,
CylinderGeometryUpdater,
diff --git a/Source/DataSources/KmlDataSource.js b/Source/DataSources/KmlDataSource.js
index 1b31da27bfdb..7386cb470ac1 100644
--- a/Source/DataSources/KmlDataSource.js
+++ b/Source/DataSources/KmlDataSource.js
@@ -17,6 +17,8 @@ define([
'../Core/Event',
'../Core/getExtensionFromUri',
'../Core/getFilenameFromUri',
+ '../Core/HeadingPitchRange',
+ '../Core/HeadingPitchRoll',
'../Core/Iso8601',
'../Core/JulianDate',
'../Core/Math',
@@ -31,8 +33,6 @@ define([
'../Core/RuntimeError',
'../Core/TimeInterval',
'../Core/TimeIntervalCollection',
- '../Core/HeadingPitchRoll',
- '../Core/HeadingPitchRange',
'../Scene/HeightReference',
'../Scene/HorizontalOrigin',
'../Scene/LabelStyle',
@@ -49,6 +49,11 @@ define([
'./Entity',
'./EntityCluster',
'./EntityCollection',
+ './KmlCamera',
+ './KmlLookAt',
+ './KmlTour',
+ './KmlTourFlyTo',
+ './KmlTourWait',
'./LabelGraphics',
'./PathGraphics',
'./PolygonGraphics',
@@ -59,12 +64,7 @@ define([
'./SampledPositionProperty',
'./ScaledPositionProperty',
'./TimeIntervalCollectionProperty',
- './WallGraphics',
- './KmlLookAt',
- './KmlCamera',
- './KmlTour',
- './KmlTourFlyTo',
- './KmlTourWait'
+ './WallGraphics'
], function(
AssociativeArray,
BoundingRectangle,
@@ -84,6 +84,8 @@ define([
Event,
getExtensionFromUri,
getFilenameFromUri,
+ HeadingPitchRange,
+ HeadingPitchRoll,
Iso8601,
JulianDate,
CesiumMath,
@@ -98,8 +100,6 @@ define([
RuntimeError,
TimeInterval,
TimeIntervalCollection,
- HeadingPitchRoll,
- HeadingPitchRange,
HeightReference,
HorizontalOrigin,
LabelStyle,
@@ -116,6 +116,11 @@ define([
Entity,
EntityCluster,
EntityCollection,
+ KmlCamera,
+ KmlLookAt,
+ KmlTour,
+ KmlTourFlyTo,
+ KmlTourWait,
LabelGraphics,
PathGraphics,
PolygonGraphics,
@@ -126,12 +131,7 @@ define([
SampledPositionProperty,
ScaledPositionProperty,
TimeIntervalCollectionProperty,
- WallGraphics,
- KmlLookAt,
- KmlCamera,
- KmlTour,
- KmlTourFlyTo,
- KmlTourWait) {
+ WallGraphics) {
'use strict';
// IE 8 doesn't have a DOM parser and can't run Cesium anyway, so just bail.
diff --git a/Source/DataSources/KmlTour.js b/Source/DataSources/KmlTour.js
index 7b407595ac28..35408d7c28ed 100644
--- a/Source/DataSources/KmlTour.js
+++ b/Source/DataSources/KmlTour.js
@@ -1,10 +1,9 @@
define([
- '../Core/Event',
- '../Core/defined'
+ '../Core/defined',
+ '../Core/Event'
], function(
- Event,
- defined
- ) {
+ defined,
+ Event) {
'use strict';
/**
* @alias KMLTour
diff --git a/Source/DataSources/KmlTourFlyTo.js b/Source/DataSources/KmlTourFlyTo.js
index 497f4225fbf9..1f4faae15a63 100644
--- a/Source/DataSources/KmlTourFlyTo.js
+++ b/Source/DataSources/KmlTourFlyTo.js
@@ -1,14 +1,13 @@
define([
- '../Core/defined',
- '../Core/combine',
'../Core/BoundingSphere',
+ '../Core/combine',
+ '../Core/defined',
'../Core/EasingFunction'
], function(
- defined,
- combine,
BoundingSphere,
- EasingFunction
- ) {
+ combine,
+ defined,
+ EasingFunction) {
'use strict';
/**
* @alias KmlTourFlyTo
diff --git a/Source/DataSources/KmlTourWait.js b/Source/DataSources/KmlTourWait.js
index 13d1a78048fb..359087e8ac8d 100644
--- a/Source/DataSources/KmlTourWait.js
+++ b/Source/DataSources/KmlTourWait.js
@@ -1,8 +1,7 @@
define([
'../Core/defined'
], function(
- defined
- ) {
+ defined) {
'use strict';
/**
* @alias KmlTourWait
diff --git a/Source/DataSources/PlaneGeometryUpdater.js b/Source/DataSources/PlaneGeometryUpdater.js
index 50a231fd9e73..b82289a56337 100644
--- a/Source/DataSources/PlaneGeometryUpdater.js
+++ b/Source/DataSources/PlaneGeometryUpdater.js
@@ -1,6 +1,4 @@
define([
- '../Core/PlaneGeometry',
- '../Core/PlaneOutlineGeometry',
'../Core/Cartesian2',
'../Core/Cartesian3',
'../Core/Check',
@@ -12,8 +10,10 @@ define([
'../Core/GeometryInstance',
'../Core/Iso8601',
'../Core/Matrix4',
- '../Core/ShowGeometryInstanceAttribute',
+ '../Core/PlaneGeometry',
+ '../Core/PlaneOutlineGeometry',
'../Core/Quaternion',
+ '../Core/ShowGeometryInstanceAttribute',
'../Scene/MaterialAppearance',
'../Scene/PerInstanceColorAppearance',
'./ColorMaterialProperty',
@@ -21,8 +21,6 @@ define([
'./GeometryUpdater',
'./Property'
], function(
- PlaneGeometry,
- PlaneOutlineGeometry,
Cartesian2,
Cartesian3,
Check,
@@ -34,8 +32,10 @@ define([
GeometryInstance,
Iso8601,
Matrix4,
- ShowGeometryInstanceAttribute,
+ PlaneGeometry,
+ PlaneOutlineGeometry,
Quaternion,
+ ShowGeometryInstanceAttribute,
MaterialAppearance,
PerInstanceColorAppearance,
ColorMaterialProperty,
diff --git a/Source/DataSources/PlaneGraphics.js b/Source/DataSources/PlaneGraphics.js
index 9d30374dc7ce..ef344e672d89 100644
--- a/Source/DataSources/PlaneGraphics.js
+++ b/Source/DataSources/PlaneGraphics.js
@@ -6,7 +6,7 @@ define([
'../Core/Event',
'./createMaterialPropertyDescriptor',
'./createPropertyDescriptor'
-], function(
+ ], function(
defaultValue,
defined,
defineProperties,
diff --git a/Source/DataSources/PolylineVisualizer.js b/Source/DataSources/PolylineVisualizer.js
index 7c5dd65d0640..b381d2451d51 100644
--- a/Source/DataSources/PolylineVisualizer.js
+++ b/Source/DataSources/PolylineVisualizer.js
@@ -1,35 +1,35 @@
define([
- '../Core/AssociativeArray',
- '../Core/BoundingSphere',
- '../Core/Check',
- '../Core/defined',
- '../Core/destroyObject',
- '../Core/DeveloperError',
- '../Scene/PolylineColorAppearance',
- '../Scene/PolylineMaterialAppearance',
- '../Scene/ShadowMode',
- './BoundingSphereState',
- './ColorMaterialProperty',
- './DynamicGeometryBatch',
- './PolylineGeometryUpdater',
- './StaticGeometryColorBatch',
- './StaticGeometryPerMaterialBatch'
-], function(
- AssociativeArray,
- BoundingSphere,
- Check,
- defined,
- destroyObject,
- DeveloperError,
- PolylineColorAppearance,
- PolylineMaterialAppearance,
- ShadowMode,
- BoundingSphereState,
- ColorMaterialProperty,
- DynamicGeometryBatch,
- PolylineGeometryUpdater,
- StaticGeometryColorBatch,
- StaticGeometryPerMaterialBatch) {
+ '../Core/AssociativeArray',
+ '../Core/BoundingSphere',
+ '../Core/Check',
+ '../Core/defined',
+ '../Core/destroyObject',
+ '../Core/DeveloperError',
+ '../Scene/PolylineColorAppearance',
+ '../Scene/PolylineMaterialAppearance',
+ '../Scene/ShadowMode',
+ './BoundingSphereState',
+ './ColorMaterialProperty',
+ './DynamicGeometryBatch',
+ './PolylineGeometryUpdater',
+ './StaticGeometryColorBatch',
+ './StaticGeometryPerMaterialBatch'
+ ], function(
+ AssociativeArray,
+ BoundingSphere,
+ Check,
+ defined,
+ destroyObject,
+ DeveloperError,
+ PolylineColorAppearance,
+ PolylineMaterialAppearance,
+ ShadowMode,
+ BoundingSphereState,
+ ColorMaterialProperty,
+ DynamicGeometryBatch,
+ PolylineGeometryUpdater,
+ StaticGeometryColorBatch,
+ StaticGeometryPerMaterialBatch) {
'use strict';
var emptyArray = [];
diff --git a/Source/Renderer/Context.js b/Source/Renderer/Context.js
index 2815a53e8582..f3a1902328dd 100644
--- a/Source/Renderer/Context.js
+++ b/Source/Renderer/Context.js
@@ -1,65 +1,65 @@
define([
- '../Core/Check',
- '../Core/clone',
- '../Core/Color',
- '../Core/ComponentDatatype',
- '../Core/createGuid',
- '../Core/defaultValue',
- '../Core/defined',
- '../Core/defineProperties',
- '../Core/destroyObject',
- '../Core/DeveloperError',
- '../Core/Geometry',
- '../Core/GeometryAttribute',
- '../Core/Matrix4',
- '../Core/PrimitiveType',
- '../Core/RuntimeError',
- '../Core/WebGLConstants',
- '../Shaders/ViewportQuadVS',
- './BufferUsage',
- './ClearCommand',
- './ContextLimits',
- './CubeMap',
- './DrawCommand',
- './PassState',
- './PickFramebuffer',
- './RenderState',
- './ShaderCache',
- './ShaderProgram',
- './Texture',
- './UniformState',
- './VertexArray'
-], function(
- Check,
- clone,
- Color,
- ComponentDatatype,
- createGuid,
- defaultValue,
- defined,
- defineProperties,
- destroyObject,
- DeveloperError,
- Geometry,
- GeometryAttribute,
- Matrix4,
- PrimitiveType,
- RuntimeError,
- WebGLConstants,
- ViewportQuadVS,
- BufferUsage,
- ClearCommand,
- ContextLimits,
- CubeMap,
- DrawCommand,
- PassState,
- PickFramebuffer,
- RenderState,
- ShaderCache,
- ShaderProgram,
- Texture,
- UniformState,
- VertexArray) {
+ '../Core/Check',
+ '../Core/clone',
+ '../Core/Color',
+ '../Core/ComponentDatatype',
+ '../Core/createGuid',
+ '../Core/defaultValue',
+ '../Core/defined',
+ '../Core/defineProperties',
+ '../Core/destroyObject',
+ '../Core/DeveloperError',
+ '../Core/Geometry',
+ '../Core/GeometryAttribute',
+ '../Core/Matrix4',
+ '../Core/PrimitiveType',
+ '../Core/RuntimeError',
+ '../Core/WebGLConstants',
+ '../Shaders/ViewportQuadVS',
+ './BufferUsage',
+ './ClearCommand',
+ './ContextLimits',
+ './CubeMap',
+ './DrawCommand',
+ './PassState',
+ './PickFramebuffer',
+ './RenderState',
+ './ShaderCache',
+ './ShaderProgram',
+ './Texture',
+ './UniformState',
+ './VertexArray'
+ ], function(
+ Check,
+ clone,
+ Color,
+ ComponentDatatype,
+ createGuid,
+ defaultValue,
+ defined,
+ defineProperties,
+ destroyObject,
+ DeveloperError,
+ Geometry,
+ GeometryAttribute,
+ Matrix4,
+ PrimitiveType,
+ RuntimeError,
+ WebGLConstants,
+ ViewportQuadVS,
+ BufferUsage,
+ ClearCommand,
+ ContextLimits,
+ CubeMap,
+ DrawCommand,
+ PassState,
+ PickFramebuffer,
+ RenderState,
+ ShaderCache,
+ ShaderProgram,
+ Texture,
+ UniformState,
+ VertexArray) {
'use strict';
/*global WebGLRenderingContext*/
diff --git a/Source/Renderer/UniformState.js b/Source/Renderer/UniformState.js
index 00eddf4756f3..56951672c099 100644
--- a/Source/Renderer/UniformState.js
+++ b/Source/Renderer/UniformState.js
@@ -1,5 +1,4 @@
define([
- './Sampler',
'../Core/BoundingRectangle',
'../Core/Cartesian2',
'../Core/Cartesian3',
@@ -16,9 +15,9 @@ define([
'../Core/OrthographicFrustum',
'../Core/Simon1994PlanetaryPositions',
'../Core/Transforms',
- '../Scene/SceneMode'
+ '../Scene/SceneMode',
+ './Sampler'
], function(
- Sampler,
BoundingRectangle,
Cartesian2,
Cartesian3,
@@ -35,7 +34,8 @@ define([
OrthographicFrustum,
Simon1994PlanetaryPositions,
Transforms,
- SceneMode) {
+ SceneMode,
+ Sampler) {
'use strict';
/**
diff --git a/Source/Renderer/freezeRenderState.js b/Source/Renderer/freezeRenderState.js
index 01d88b6a77da..702359a34a8c 100644
--- a/Source/Renderer/freezeRenderState.js
+++ b/Source/Renderer/freezeRenderState.js
@@ -1,7 +1,8 @@
/*global define*/
define([
'../Core/freezeObject'
- ], function(freezeObject) {
+ ], function(
+ freezeObject) {
'use strict';
/**
diff --git a/Source/Scene/BatchTable.js b/Source/Scene/BatchTable.js
index bbe799c529c9..be1b9d5a45c2 100644
--- a/Source/Scene/BatchTable.js
+++ b/Source/Scene/BatchTable.js
@@ -16,8 +16,7 @@ define([
'../Renderer/Sampler',
'../Renderer/Texture',
'../Renderer/TextureMagnificationFilter',
- '../Renderer/TextureMinificationFilter',
- './getUnpackFloatFunction'
+ '../Renderer/TextureMinificationFilter'
], function(
Cartesian2,
Cartesian3,
@@ -36,8 +35,7 @@ define([
Sampler,
Texture,
TextureMagnificationFilter,
- TextureMinificationFilter,
- getUnpackFloatFunction) {
+ TextureMinificationFilter) {
'use strict';
/**
@@ -462,14 +460,6 @@ define([
'} \n';
}
- function getGlslUnpackFloat(batchTable) {
- if (!batchTable._packFloats) {
- return '';
- }
-
- return getUnpackFloatFunction('unpackFloat');
- }
-
function getComponentType(componentsPerAttribute) {
if (componentsPerAttribute === 1) {
return 'float';
@@ -506,10 +496,10 @@ define([
if (batchTable._packFloats && attribute.componentDatatype !== PixelDatatype.UNSIGNED_BYTE) {
glslFunction += 'vec4 textureValue; \n' +
- 'textureValue.x = unpackFloat(texture2D(batchTexture, st)); \n' +
- 'textureValue.y = unpackFloat(texture2D(batchTexture, st + vec2(batchTextureStep.x, 0.0))); \n' +
- 'textureValue.z = unpackFloat(texture2D(batchTexture, st + vec2(batchTextureStep.x * 2.0, 0.0))); \n' +
- 'textureValue.w = unpackFloat(texture2D(batchTexture, st + vec2(batchTextureStep.x * 3.0, 0.0))); \n';
+ 'textureValue.x = czm_unpackFloat(texture2D(batchTexture, st)); \n' +
+ 'textureValue.y = czm_unpackFloat(texture2D(batchTexture, st + vec2(batchTextureStep.x, 0.0))); \n' +
+ 'textureValue.z = czm_unpackFloat(texture2D(batchTexture, st + vec2(batchTextureStep.x * 2.0, 0.0))); \n' +
+ 'textureValue.w = czm_unpackFloat(texture2D(batchTexture, st + vec2(batchTextureStep.x * 3.0, 0.0))); \n';
} else {
glslFunction += ' vec4 textureValue = texture2D(batchTexture, st); \n';
@@ -544,7 +534,6 @@ define([
var batchTableShader = 'uniform sampler2D batchTexture; \n';
batchTableShader += getGlslComputeSt(this) + '\n';
- batchTableShader += getGlslUnpackFloat(this) + '\n';
var length = attributes.length;
for (var i = 0; i < length; ++i) {
@@ -581,8 +570,6 @@ define([
* isDestroyed
will result in a {@link DeveloperError} exception. Therefore,
* assign the return value (undefined
) to the object as done in the example.
*
- * @returns {undefined}
- *
* @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.
*
* @see BatchTable#isDestroyed
diff --git a/Source/Scene/BillboardCollection.js b/Source/Scene/BillboardCollection.js
index 2f5737f4558b..5a17cddcf2bb 100644
--- a/Source/Scene/BillboardCollection.js
+++ b/Source/Scene/BillboardCollection.js
@@ -1842,8 +1842,6 @@ define([
* isDestroyed
will result in a {@link DeveloperError} exception. Therefore,
* assign the return value (undefined
) to the object as done in the example.
*
- * @returns {undefined}
- *
* @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.
*
*
diff --git a/Source/Scene/CameraEventAggregator.js b/Source/Scene/CameraEventAggregator.js
index 5391377a99b0..002fd244205f 100644
--- a/Source/Scene/CameraEventAggregator.js
+++ b/Source/Scene/CameraEventAggregator.js
@@ -494,8 +494,6 @@ define([
* isDestroyed
will result in a {@link DeveloperError} exception. Therefore,
* assign the return value (undefined
) to the object as done in the example.
*
- * @returns {undefined}
- *
* @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.
*
*
diff --git a/Source/Scene/Cesium3DTile.js b/Source/Scene/Cesium3DTile.js
index e386a997586b..18101211d979 100644
--- a/Source/Scene/Cesium3DTile.js
+++ b/Source/Scene/Cesium3DTile.js
@@ -1067,7 +1067,7 @@ define([
var clippingPlanes = tileset.clippingPlanes;
var currentClippingPlanesState = 0;
if (defined(clippingPlanes) && tile._isClipped && clippingPlanes.enabled) {
- currentClippingPlanesState = clippingPlanes.clippingPlanesState();
+ currentClippingPlanesState = clippingPlanes.clippingPlanesState;
}
// If clippingPlaneState for tile changed, mark clippingPlanesDirty so content can update
if (currentClippingPlanesState !== tile._clippingPlanesState) {
diff --git a/Source/Scene/Cesium3DTileContent.js b/Source/Scene/Cesium3DTileContent.js
index 509220253ceb..a4466e35fe0d 100644
--- a/Source/Scene/Cesium3DTileContent.js
+++ b/Source/Scene/Cesium3DTileContent.js
@@ -326,8 +326,6 @@ define([
* not part of the public Cesium API.
*
*
- * @returns {undefined}
- *
* @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.
*
* @example
diff --git a/Source/Scene/Cesium3DTileset.js b/Source/Scene/Cesium3DTileset.js
index ddfbdcab4d21..e4590a8d60e1 100644
--- a/Source/Scene/Cesium3DTileset.js
+++ b/Source/Scene/Cesium3DTileset.js
@@ -3,7 +3,6 @@ define([
'../Core/Cartesian3',
'../Core/Cartographic',
'../Core/Check',
- '../Core/ClippingPlaneCollection',
'../Core/defaultValue',
'../Core/defined',
'../Core/defineProperties',
@@ -34,9 +33,10 @@ define([
'./Cesium3DTilesetTraversal',
'./Cesium3DTileStyleEngine',
'./ClassificationType',
+ './ClippingPlaneCollection',
'./LabelCollection',
- './PointCloudShading',
'./PointCloudEyeDomeLighting',
+ './PointCloudShading',
'./SceneMode',
'./ShadowMode',
'./TileBoundingRegion',
@@ -47,7 +47,6 @@ define([
Cartesian3,
Cartographic,
Check,
- ClippingPlaneCollection,
defaultValue,
defined,
defineProperties,
@@ -78,9 +77,10 @@ define([
Cesium3DTilesetTraversal,
Cesium3DTileStyleEngine,
ClassificationType,
+ ClippingPlaneCollection,
LabelCollection,
- PointCloudShading,
PointCloudEyeDomeLighting,
+ PointCloudShading,
SceneMode,
ShadowMode,
TileBoundingRegion,
@@ -822,7 +822,7 @@ define([
return this._clippingPlanes;
},
set : function(value) {
- ClippingPlaneCollection.setOwnership(value, this, '_clippingPlanes');
+ ClippingPlaneCollection.setOwner(value, this, '_clippingPlanes');
}
},
@@ -1934,8 +1934,6 @@ define([
* isDestroyed
will result in a {@link DeveloperError} exception. Therefore,
* assign the return value (undefined
) to the object as done in the example.
*
- * @returns {undefined}
- *
* @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.
*
* @example
@@ -1944,10 +1942,7 @@ define([
* @see Cesium3DTileset#isDestroyed
*/
Cesium3DTileset.prototype.destroy = function() {
- // Destroy debug labels
this._tileDebugLabels = this._tileDebugLabels && this._tileDebugLabels.destroy();
-
- // Destroy clipping plane collection
this._clippingPlanes = this._clippingPlanes && this._clippingPlanes.destroy();
// Traverse the tree and destroy all tiles
diff --git a/Source/Scene/ClassificationPrimitive.js b/Source/Scene/ClassificationPrimitive.js
index bd76d4f405da..dc6546b71dc6 100644
--- a/Source/Scene/ClassificationPrimitive.js
+++ b/Source/Scene/ClassificationPrimitive.js
@@ -981,8 +981,6 @@ define([
* assign the return value (undefined
) to the object as done in the example.
*
*
- * @returns {undefined}
- *
* @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.
*
* @example
diff --git a/Source/Core/ClippingPlane.js b/Source/Scene/ClippingPlane.js
similarity index 74%
rename from Source/Core/ClippingPlane.js
rename to Source/Scene/ClippingPlane.js
index 08b652212cc4..4a2fd18427d1 100644
--- a/Source/Core/ClippingPlane.js
+++ b/Source/Scene/ClippingPlane.js
@@ -1,8 +1,8 @@
define([
- './Cartesian3',
- './Check',
- './defined',
- './defineProperties'
+ '../Core/Cartesian3',
+ '../Core/Check',
+ '../Core/defined',
+ '../Core/defineProperties'
], function(
Cartesian3,
Check,
@@ -11,8 +11,8 @@ define([
'use strict';
/**
- * A Plane in Hessian Normal form to be used with ClippingPlaneCollection.
- * Compatible with mathematics functions in Plane.js
+ * A Plane in Hessian Normal form to be used with {@link ClippingPlaneCollection}.
+ * Compatible with mathematics functions in {@link Plane}
*
* @alias ClippingPlane
* @constructor
@@ -25,6 +25,11 @@ define([
* opposite to the normal; if zero, the plane passes through the origin.
*/
function ClippingPlane(normal, distance) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.typeOf.object('normal', normal);
+ Check.typeOf.number('distance', distance);
+ //>>includeEnd('debug');
+
this._distance = distance;
this._normal = new UpdateChangedCartesian3(normal, this);
this.onChangeCallback = undefined;
@@ -128,27 +133,49 @@ define([
this._cartesian3 = Cartesian3.clone(normal);
}
- function makeGetterStter(key) {
- return {
+ defineProperties(UpdateChangedCartesian3.prototype, {
+ x : {
get : function() {
- return this._cartesian3[key];
+ return this._cartesian3.x;
},
set : function(value) {
//>>includeStart('debug', pragmas.debug);
Check.typeOf.number('value', value);
//>>includeEnd('debug');
- if (defined(this._clippingPlane.onChangeCallback) && value !== this._cartesian3[key]) {
+ if (defined(this._clippingPlane.onChangeCallback) && value !== this._cartesian3.x) {
this._clippingPlane.onChangeCallback(this._clippingPlane.index);
}
- this._cartesian3[key] = value;
+ this._cartesian3.x = value;
}
- };
- }
-
- defineProperties(UpdateChangedCartesian3.prototype, {
- x : makeGetterStter('x'),
- y : makeGetterStter('y'),
- z : makeGetterStter('z')
+ },
+ y : {
+ get : function() {
+ return this._cartesian3.y;
+ },
+ set : function(value) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.typeOf.number('value', value);
+ //>>includeEnd('debug');
+ if (defined(this._clippingPlane.onChangeCallback) && value !== this._cartesian3.y) {
+ this._clippingPlane.onChangeCallback(this._clippingPlane.index);
+ }
+ this._cartesian3.y = value;
+ }
+ },
+ z : {
+ get : function() {
+ return this._cartesian3.z;
+ },
+ set : function(value) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.typeOf.number('value', value);
+ //>>includeEnd('debug');
+ if (defined(this._clippingPlane.onChangeCallback) && value !== this._cartesian3.z) {
+ this._clippingPlane.onChangeCallback(this._clippingPlane.index);
+ }
+ this._cartesian3.z = value;
+ }
+ }
});
return ClippingPlane;
diff --git a/Source/Core/ClippingPlaneCollection.js b/Source/Scene/ClippingPlaneCollection.js
similarity index 90%
rename from Source/Core/ClippingPlaneCollection.js
rename to Source/Scene/ClippingPlaneCollection.js
index b1ca230c41d8..d49db4ca419a 100644
--- a/Source/Core/ClippingPlaneCollection.js
+++ b/Source/Scene/ClippingPlaneCollection.js
@@ -1,38 +1,36 @@
define([
- './AttributeCompression',
- './Cartesian2',
- './Cartesian3',
- './Cartesian4',
- './Math',
- './Check',
- './ClippingPlane',
- './Color',
- './defaultValue',
- './defined',
- './defineProperties',
- './deprecationWarning',
- './destroyObject',
- './DeveloperError',
- './FeatureDetection',
- './Intersect',
- './Matrix4',
- './PixelFormat',
- './Plane',
+ '../Core/AttributeCompression',
+ '../Core/Cartesian2',
+ '../Core/Cartesian3',
+ '../Core/Cartesian4',
+ '../Core/Check',
+ '../Core/Color',
+ '../Core/defaultValue',
+ '../Core/defined',
+ '../Core/defineProperties',
+ '../Core/deprecationWarning',
+ '../Core/destroyObject',
+ '../Core/DeveloperError',
+ '../Core/FeatureDetection',
+ '../Core/Intersect',
+ '../Core/Math',
+ '../Core/Matrix4',
+ '../Core/PixelFormat',
+ '../Core/Plane',
'../Renderer/ContextLimits',
'../Renderer/PixelDatatype',
'../Renderer/Sampler',
'../Renderer/Texture',
'../Renderer/TextureMagnificationFilter',
'../Renderer/TextureMinificationFilter',
- '../Renderer/TextureWrap'
+ '../Renderer/TextureWrap',
+ './ClippingPlane'
], function(
AttributeCompression,
Cartesian2,
Cartesian3,
Cartesian4,
- CesiumMath,
Check,
- ClippingPlane,
Color,
defaultValue,
defined,
@@ -42,6 +40,7 @@ define([
DeveloperError,
FeatureDetection,
Intersect,
+ CesiumMath,
Matrix4,
PixelFormat,
Plane,
@@ -51,7 +50,8 @@ define([
Texture,
TextureMagnificationFilter,
TextureMinificationFilter,
- TextureWrap) {
+ TextureWrap,
+ ClippingPlane) {
'use strict';
/**
@@ -78,7 +78,7 @@ define([
// Do partial texture updates if just one plane is dirty.
// If many planes are dirty, refresh the entire texture.
this._dirtyIndex = -1;
- this._manyDirtyPlanes = false;
+ this._multipleDirtyPlanes = false;
// Add each plane to check if it's actually a Plane object instead of a ClippingPlane.
// Use of Plane objects will be deprecated.
@@ -90,8 +90,7 @@ define([
}
}
- this._enabled = false;
- this.enabled = defaultValue(options.enabled, true); // set using setter
+ this._enabled = defaultValue(options.enabled, true);
/**
* The 4x4 transformation matrix specifying an additional transform relative to the clipping planes
@@ -122,9 +121,9 @@ define([
// This is because in a Cesium3DTileset multiple models may reference the tileset's ClippingPlaneCollection.
this._owner = undefined;
- this._testIntersection = undefined;
- this._unionClippingRegions = undefined;
- this.unionClippingRegions = defaultValue(options.unionClippingRegions, false); // set using setter
+ var unionClippingRegions = defaultValue(options.unionClippingRegions, false);
+ this._unionClippingRegions = unionClippingRegions;
+ this._testIntersection = unionClippingRegions ? unionIntersectFunction : defaultIntersectFunction;
this._uint8View = undefined;
this._float32View = undefined;
@@ -182,7 +181,7 @@ define([
*
* @memberof ClippingPlaneCollection.prototype
* @type {Boolean}
- * @default false
+ * @default true
*/
enabled : {
get : function() {
@@ -221,13 +220,30 @@ define([
get : function() {
return this._owner;
}
+ },
+
+ /**
+ * Returns a Number encapsulating the state for this ClippingPlaneCollection.
+ *
+ * Clipping mode is encoded in the sign of the number, which is just the plane count.
+ * Used for checking if shader regeneration is necessary.
+ *
+ * @memberof ClippingPlaneCollection.prototype
+ * @returns {Number} A Number that describes the ClippingPlaneCollection's state.
+ * @readonly
+ * @private
+ */
+ clippingPlanesState : {
+ get : function() {
+ return this._unionClippingRegions ? this._planes.length : -this._planes.length;
+ }
}
});
function setIndexDirty(collection, index) {
// If there's already a different _dirtyIndex set, more than one plane has changed since update.
// Entire texture must be reloaded
- collection._manyDirtyPlanes = collection._manyDirtyPlanes || (collection._dirtyIndex !== -1 && collection._dirtyIndex !== index);
+ collection._multipleDirtyPlanes = collection._multipleDirtyPlanes || (collection._dirtyIndex !== -1 && collection._dirtyIndex !== index);
collection._dirtyIndex = index;
}
@@ -336,7 +352,7 @@ define([
}
// Indicate planes texture is dirty
- this._manyDirtyPlanes = true;
+ this._multipleDirtyPlanes = true;
planes.length = length;
return true;
@@ -359,25 +375,10 @@ define([
plane.index = -1;
}
}
- this._manyDirtyPlanes = true;
+ this._multipleDirtyPlanes = true;
this._planes = [];
};
- var octEncodeScratch = new Cartesian2();
- var rightShift = 1.0 / 256.0;
- /**
- * Encodes a normalized vector into 4 SNORM values in the range [0-255] following the 'oct' encoding.
- * oct32 precision is higher than the default oct16, hence the additional 2 uint16 values.
- */
- function oct32EncodeNormal(vector, result) {
- AttributeCompression.octEncodeInRange(vector, 65535, octEncodeScratch);
- result.x = octEncodeScratch.x * rightShift;
- result.y = octEncodeScratch.x;
- result.z = octEncodeScratch.y * rightShift;
- result.w = octEncodeScratch.y;
- return result;
- }
-
var distanceEncodeScratch = new Cartesian4();
var oct32EncodeScratch = new Cartesian4();
function packPlanesAsUint8(clippingPlaneCollection, startIndex, endIndex) {
@@ -387,7 +388,7 @@ define([
for (var i = startIndex; i < endIndex; ++i) {
var plane = planes[i];
- var oct32Normal = oct32EncodeNormal(plane.normal, oct32EncodeScratch);
+ var oct32Normal = AttributeCompression.octEncodeToCartesian4(plane.normal, oct32EncodeScratch);
uint8View[byteIndex] = oct32Normal.x;
uint8View[byteIndex + 1] = oct32Normal.y;
uint8View[byteIndex + 2] = oct32Normal.z;
@@ -426,8 +427,8 @@ define([
var maxSize = ContextLimits.maximumTextureSize;
var width = Math.min(pixelsNeeded, maxSize);
var height = Math.ceil(pixelsNeeded / width);
- result.x = width;
- result.y = height;
+ result.x = Math.max(width, 1);
+ result.y = Math.max(height, 1);
return result;
}
@@ -453,7 +454,11 @@ define([
if (defined(clippingPlanesTexture)) {
var currentPixelCount = clippingPlanesTexture.width * clippingPlanesTexture.height;
- // Recreate the texture if it isn't big enough or is 4 times larger than it needs to be
+ // Recreate the texture to double current requirement if it isn't big enough or is 4 times larger than it needs to be.
+ // Optimization note: this isn't exactly the classic resizeable array algorithm
+ // * not necessarily checking for resize after each add/remove operation
+ // * random-access deletes instead of just pops
+ // * alloc ops likely more expensive than demonstrable via big-O analysis
if (currentPixelCount < pixelsNeeded ||
pixelsNeeded < 0.25 * currentPixelCount) {
clippingPlanesTexture.destroy();
@@ -497,12 +502,12 @@ define([
}
this._clippingPlanesTexture = clippingPlanesTexture;
- this._manyDirtyPlanes = true;
+ this._multipleDirtyPlanes = true;
}
// Use of Plane objects will be deprecated.
// But until then, we have no way of telling if they changed since last frame, so we have to do a full udpate.
- var refreshFullTexture = this._manyDirtyPlanes || this._containsUntrackablePlanes;
+ var refreshFullTexture = this._multipleDirtyPlanes || this._containsUntrackablePlanes;
var dirtyIndex = this._dirtyIndex;
if (!refreshFullTexture && dirtyIndex === -1) {
@@ -544,7 +549,7 @@ define([
});
}
- this._manyDirtyPlanes = false;
+ this._multipleDirtyPlanes = false;
this._dirtyIndex = -1;
};
@@ -636,19 +641,6 @@ define([
return intersection;
};
- /**
- * Returns a Number encapsulating the state for this ClippingPlaneCollection.
- *
- * Clipping mode is encoded in the sign of the number, which is just the plane count.
- * Used for checking if shader regeneration is necessary.
- *
- * @returns {Number} A Number that describes the ClippingPlaneCollection's state.
- * @private
- */
- ClippingPlaneCollection.prototype.clippingPlanesState = function() {
- return this._unionClippingRegions ? this._planes.length : -this._planes.length;
- };
-
/**
* Sets the owner for the input ClippingPlaneCollection if there wasn't another owner.
* Destroys the owner's previous ClippingPlaneCollection if setting is successful.
@@ -658,7 +650,7 @@ define([
* @param {String} key The Key for the Object to reference the ClippingPlaneCollection
* @private
*/
- ClippingPlaneCollection.setOwnership = function(clippingPlaneCollection, owner, key) {
+ ClippingPlaneCollection.setOwner = function(clippingPlaneCollection, owner, key) {
// Don't destroy the ClippingPlaneCollection if it is already owned by newOwner
if (clippingPlaneCollection === owner[key]) {
return;
@@ -720,8 +712,6 @@ define([
* isDestroyed
will result in a {@link DeveloperError} exception. Therefore,
* assign the return value (undefined
) to the object as done in the example.
*
- * @returns {undefined}
- *
* @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.
*
*
diff --git a/Source/Scene/CreditDisplay.js b/Source/Scene/CreditDisplay.js
index 9ee25d1a8223..a332d99d9c41 100644
--- a/Source/Scene/CreditDisplay.js
+++ b/Source/Scene/CreditDisplay.js
@@ -1,15 +1,15 @@
define([
- '../Core/Check',
- '../Core/Credit',
- '../Core/defaultValue',
- '../Core/defined',
- '../Core/destroyObject'
-], function(
- Check,
- Credit,
- defaultValue,
- defined,
- destroyObject) {
+ '../Core/Check',
+ '../Core/Credit',
+ '../Core/defaultValue',
+ '../Core/defined',
+ '../Core/destroyObject'
+ ], function(
+ Check,
+ Credit,
+ defaultValue,
+ defined,
+ destroyObject) {
'use strict';
var mobileWidth = 576;
@@ -479,8 +479,6 @@ define([
* isDestroyed
will result in a {@link DeveloperError} exception. Therefore,
* assign the return value (undefined
) to the object as done in the example.
*
- * @returns {undefined}
- *
* @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.
*/
CreditDisplay.prototype.destroy = function() {
diff --git a/Source/Scene/DebugCameraPrimitive.js b/Source/Scene/DebugCameraPrimitive.js
index 02f990da1353..cce6d7011e13 100644
--- a/Source/Scene/DebugCameraPrimitive.js
+++ b/Source/Scene/DebugCameraPrimitive.js
@@ -246,8 +246,6 @@ define([
* assign the return value (undefined
) to the object as done in the example.
*
*
- * @returns {undefined}
- *
* @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.
*
* @example
diff --git a/Source/Scene/DebugModelMatrixPrimitive.js b/Source/Scene/DebugModelMatrixPrimitive.js
index 1113374a2896..6f58d389aa59 100644
--- a/Source/Scene/DebugModelMatrixPrimitive.js
+++ b/Source/Scene/DebugModelMatrixPrimitive.js
@@ -219,8 +219,6 @@ define([
* assign the return value (undefined
) to the object as done in the example.
*
*
- * @returns {undefined}
- *
* @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.
*
* @example
diff --git a/Source/Scene/DeviceOrientationCameraController.js b/Source/Scene/DeviceOrientationCameraController.js
index 710d1c1b8fe9..f06463247572 100644
--- a/Source/Scene/DeviceOrientationCameraController.js
+++ b/Source/Scene/DeviceOrientationCameraController.js
@@ -120,8 +120,6 @@ define([
* isDestroyed
will result in a {@link DeveloperError} exception. Therefore,
* assign the return value (undefined
) to the object as done in the example.
*
- * @returns {undefined}
- *
* @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.
*/
DeviceOrientationCameraController.prototype.destroy = function() {
diff --git a/Source/Scene/EllipsoidPrimitive.js b/Source/Scene/EllipsoidPrimitive.js
index cd4ceff8f342..ae455d5347d7 100644
--- a/Source/Scene/EllipsoidPrimitive.js
+++ b/Source/Scene/EllipsoidPrimitive.js
@@ -455,8 +455,6 @@ define([
* isDestroyed
will result in a {@link DeveloperError} exception. Therefore,
* assign the return value (undefined
) to the object as done in the example.
*
- * @returns {undefined}
- *
* @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.
*
*
diff --git a/Source/Scene/FrameRateMonitor.js b/Source/Scene/FrameRateMonitor.js
index ab51f3b42fc3..f0f7f2746d15 100644
--- a/Source/Scene/FrameRateMonitor.js
+++ b/Source/Scene/FrameRateMonitor.js
@@ -267,8 +267,6 @@ define([
*
* @memberof FrameRateMonitor
*
- * @returns {undefined}
- *
* @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.
*
* @see FrameRateMonitor#isDestroyed
diff --git a/Source/Scene/Globe.js b/Source/Scene/Globe.js
index 5d391dbebf31..456d5a30aecd 100644
--- a/Source/Scene/Globe.js
+++ b/Source/Scene/Globe.js
@@ -694,8 +694,6 @@ define([
* isDestroyed
will result in a {@link DeveloperError} exception. Therefore,
* assign the return value (undefined
) to the object as done in the example.
*
- * @returns {undefined}
- *
* @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.
*
*
diff --git a/Source/Scene/GlobeSurfaceShaderSet.js b/Source/Scene/GlobeSurfaceShaderSet.js
index 85c775b1c00c..8bf8b1716215 100644
--- a/Source/Scene/GlobeSurfaceShaderSet.js
+++ b/Source/Scene/GlobeSurfaceShaderSet.js
@@ -1,19 +1,19 @@
define([
- '../Core/ClippingPlaneCollection',
'../Core/defined',
'../Core/destroyObject',
'../Core/TerrainQuantization',
'../Renderer/ShaderProgram',
- '../Scene/SceneMode',
- './getClippingFunction'
+ './ClippingPlaneCollection',
+ './getClippingFunction',
+ './SceneMode'
], function(
- ClippingPlaneCollection,
defined,
destroyObject,
TerrainQuantization,
ShaderProgram,
- SceneMode,
- getClippingFunction) {
+ ClippingPlaneCollection,
+ getClippingFunction,
+ SceneMode) {
'use strict';
function GlobeSurfaceShader(numberOfDayTextures, flags, material, shaderProgram, clippingShaderState) {
@@ -100,7 +100,7 @@ define([
var currentClippingShaderState = 0;
if (defined(clippingPlanes)) {
- currentClippingShaderState = enableClippingPlanes ? clippingPlanes.clippingPlanesState() : 0;
+ currentClippingShaderState = enableClippingPlanes ? clippingPlanes.clippingPlanesState : 0;
}
var surfaceShader = surfaceTile.surfaceShader;
if (defined(surfaceShader) &&
diff --git a/Source/Scene/GlobeSurfaceTileProvider.js b/Source/Scene/GlobeSurfaceTileProvider.js
index 9d9ea96e7e7b..b613c393c04f 100644
--- a/Source/Scene/GlobeSurfaceTileProvider.js
+++ b/Source/Scene/GlobeSurfaceTileProvider.js
@@ -4,7 +4,6 @@ define([
'../Core/Cartesian2',
'../Core/Cartesian3',
'../Core/Cartesian4',
- '../Core/ClippingPlaneCollection',
'../Core/Color',
'../Core/ColorGeometryInstanceAttribute',
'../Core/combine',
@@ -40,6 +39,7 @@ define([
'../Scene/DepthFunction',
'../Scene/PerInstanceColorAppearance',
'../Scene/Primitive',
+ './ClippingPlaneCollection',
'./GlobeSurfaceTile',
'./ImageryLayer',
'./QuadtreeTileLoadState',
@@ -51,7 +51,6 @@ define([
Cartesian2,
Cartesian3,
Cartesian4,
- ClippingPlaneCollection,
Color,
ColorGeometryInstanceAttribute,
combine,
@@ -87,6 +86,7 @@ define([
DepthFunction,
PerInstanceColorAppearance,
Primitive,
+ ClippingPlaneCollection,
GlobeSurfaceTile,
ImageryLayer,
QuadtreeTileLoadState,
@@ -315,7 +315,7 @@ define([
return this._clippingPlanes;
},
set : function(value) {
- ClippingPlaneCollection.setOwnership(value, this, '_clippingPlanes');
+ ClippingPlaneCollection.setOwner(value, this, '_clippingPlanes');
}
}
});
@@ -673,8 +673,6 @@ define([
* isDestroyed
will result in a {@link DeveloperError} exception. Therefore,
* assign the return value (undefined
) to the object as done in the example.
*
- * @returns {undefined}
- *
* @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.
*
*
diff --git a/Source/Scene/GroundPrimitive.js b/Source/Scene/GroundPrimitive.js
index c8a68f040822..bc2defd39e78 100644
--- a/Source/Scene/GroundPrimitive.js
+++ b/Source/Scene/GroundPrimitive.js
@@ -847,8 +847,6 @@ define([
* assign the return value (undefined
) to the object as done in the example.
*
*
- * @returns {undefined}
- *
* @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.
*
* @example
diff --git a/Source/Scene/ImageryLayer.js b/Source/Scene/ImageryLayer.js
index c2f924dd164d..02350f6e274f 100644
--- a/Source/Scene/ImageryLayer.js
+++ b/Source/Scene/ImageryLayer.js
@@ -402,8 +402,6 @@ define([
* isDestroyed
will result in a {@link DeveloperError} exception. Therefore,
* assign the return value (undefined
) to the object as done in the example.
*
- * @returns {undefined}
- *
* @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.
*
*
diff --git a/Source/Scene/ImageryLayerCollection.js b/Source/Scene/ImageryLayerCollection.js
index f1407dd6b1d5..ab9f386ca57f 100644
--- a/Source/Scene/ImageryLayerCollection.js
+++ b/Source/Scene/ImageryLayerCollection.js
@@ -507,8 +507,6 @@ define([
* isDestroyed
will result in a {@link DeveloperError} exception. Therefore,
* assign the return value (undefined
) to the object as done in the example.
*
- * @returns {undefined}
- *
* @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.
*
*
diff --git a/Source/Scene/IonImageryProvider.js b/Source/Scene/IonImageryProvider.js
index 30557db55add..48205d1dea2d 100644
--- a/Source/Scene/IonImageryProvider.js
+++ b/Source/Scene/IonImageryProvider.js
@@ -7,6 +7,7 @@ define([
'../Core/defineProperties',
'../Core/DeveloperError',
'../Core/Event',
+ '../Core/IonResource',
'../Core/loadJson',
'../Core/Resource',
'../Core/RuntimeError',
@@ -14,7 +15,6 @@ define([
'./ArcGisMapServerImageryProvider',
'./BingMapsImageryProvider',
'./Cesium3DTileset',
- '../Core/IonResource',
'./createTileMapServiceImageryProvider',
'./GoogleEarthEnterpriseMapsProvider',
'./MapboxImageryProvider',
@@ -31,6 +31,7 @@ define([
defineProperties,
DeveloperError,
Event,
+ IonResource,
loadJson,
Resource,
RuntimeError,
@@ -38,7 +39,6 @@ define([
ArcGisMapServerImageryProvider,
BingMapsImageryProvider,
Cesium3DTileset,
- IonResource,
createTileMapServiceImageryProvider,
GoogleEarthEnterpriseMapsProvider,
MapboxImageryProvider,
diff --git a/Source/Scene/LabelCollection.js b/Source/Scene/LabelCollection.js
index b50118b57d04..0d88e4d859cb 100644
--- a/Source/Scene/LabelCollection.js
+++ b/Source/Scene/LabelCollection.js
@@ -847,8 +847,6 @@ define([
* isDestroyed
will result in a {@link DeveloperError} exception. Therefore,
* assign the return value (undefined
) to the object as done in the example.
*
- * @returns {undefined}
- *
* @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.
*
*
diff --git a/Source/Scene/Material.js b/Source/Scene/Material.js
index 830a3a7acf0f..d9852fefbde8 100644
--- a/Source/Scene/Material.js
+++ b/Source/Scene/Material.js
@@ -539,8 +539,6 @@ define([
* isDestroyed
will result in a {@link DeveloperError} exception. Therefore,
* assign the return value (undefined
) to the object as done in the example.
*
- * @returns {undefined}
- *
* @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.
*
*
diff --git a/Source/Scene/Model.js b/Source/Scene/Model.js
index efdc3966523e..891a0c57a719 100644
--- a/Source/Scene/Model.js
+++ b/Source/Scene/Model.js
@@ -4,7 +4,6 @@ define([
'../Core/Cartesian3',
'../Core/Cartesian4',
'../Core/Cartographic',
- '../Core/ClippingPlaneCollection',
'../Core/clone',
'../Core/Color',
'../Core/combine',
@@ -30,9 +29,9 @@ define([
'../Core/PixelFormat',
'../Core/Plane',
'../Core/PrimitiveType',
- '../Core/Resource',
'../Core/Quaternion',
'../Core/Queue',
+ '../Core/Resource',
'../Core/RuntimeError',
'../Core/Transforms',
'../Core/WebGLConstants',
@@ -62,8 +61,10 @@ define([
'./AttributeType',
'./Axis',
'./BlendingState',
+ './ClippingPlaneCollection',
'./ColorBlendMode',
'./DracoLoader',
+ './getClipAndStyleCode',
'./getClippingFunction',
'./HeightReference',
'./JobType',
@@ -82,7 +83,6 @@ define([
Cartesian3,
Cartesian4,
Cartographic,
- ClippingPlaneCollection,
clone,
Color,
combine,
@@ -108,9 +108,9 @@ define([
PixelFormat,
Plane,
PrimitiveType,
- Resource,
Quaternion,
Queue,
+ Resource,
RuntimeError,
Transforms,
WebGLConstants,
@@ -140,8 +140,10 @@ define([
AttributeType,
Axis,
BlendingState,
+ ClippingPlaneCollection,
ColorBlendMode,
DracoLoader,
+ getClipAndStyleCode,
getClippingFunction,
HeightReference,
JobType,
@@ -516,7 +518,7 @@ define([
*/
this.colorBlendAmount = defaultValue(options.colorBlendAmount, 0.5);
- this._colorShadingEnabled = isColorShadingEnabled(this);
+ this._colorShadingEnabled = false;
this._clippingPlanes = undefined;
this.clippingPlanes = options.clippingPlanes;
@@ -1027,7 +1029,7 @@ define([
return;
}
// Handle destroying, checking of unknown, checking for existing ownership
- ClippingPlaneCollection.setOwnership(value, this, '_clippingPlanes');
+ ClippingPlaneCollection.setOwner(value, this, '_clippingPlanes');
}
}
});
@@ -3860,19 +3862,12 @@ define([
shader += Model._getClippingFunction(clippingPlaneCollection) + '\n';
shader +=
'uniform sampler2D gltf_clippingPlanes; \n' +
- 'uniform vec4 gltf_clippingPlanesEdgeStyle; \n' +
'uniform mat4 gltf_clippingPlanesMatrix; \n' +
+ 'uniform vec4 gltf_clippingPlanesEdgeStyle; \n' +
'void main() \n' +
'{ \n' +
' gltf_clip_main(); \n' +
- ' float clipDistance = clip(gl_FragCoord, gltf_clippingPlanes, gltf_clippingPlanesMatrix);' +
- ' vec4 clippingPlanesEdgeColor = vec4(1.0); \n' +
- ' clippingPlanesEdgeColor.rgb = gltf_clippingPlanesEdgeStyle.rgb; \n' +
- ' float clippingPlanesEdgeWidth = gltf_clippingPlanesEdgeStyle.a; \n' +
- ' if (clipDistance > 0.0 && clipDistance < clippingPlanesEdgeWidth) \n' +
- ' { \n' +
- ' gl_FragColor = clippingPlanesEdgeColor;\n' +
- ' } \n' +
+ getClipAndStyleCode('gltf_clippingPlanes', 'gltf_clippingPlanesMatrix', 'gltf_clippingPlanesEdgeStyle') +
'} \n';
return shader;
}
@@ -4365,7 +4360,7 @@ define([
var currentClippingPlanesState = 0;
if (defined(clippingPlanes) && clippingPlanes.enabled) {
Matrix4.multiply(context.uniformState.view3D, modelMatrix, this._modelViewMatrix);
- currentClippingPlanesState = clippingPlanes.clippingPlanesState();
+ currentClippingPlanesState = clippingPlanes.clippingPlanesState;
}
var shouldRegenerateShaders = this._clippingPlanesState !== currentClippingPlanesState;
@@ -4561,8 +4556,6 @@ define([
* isDestroyed
will result in a {@link DeveloperError} exception. Therefore,
* assign the return value (undefined
) to the object as done in the example.
*
- * @returns {undefined}
- *
* @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.
*
*
diff --git a/Source/Scene/ModelAnimationCache.js b/Source/Scene/ModelAnimationCache.js
index d9e2d37efee0..5a7c55ab800b 100644
--- a/Source/Scene/ModelAnimationCache.js
+++ b/Source/Scene/ModelAnimationCache.js
@@ -1,5 +1,4 @@
define([
- './AttributeType',
'../Core/Cartesian3',
'../Core/ComponentDatatype',
'../Core/defaultValue',
@@ -11,9 +10,9 @@ define([
'../Core/WebGLConstants',
'../Core/WeightSpline',
'../ThirdParty/GltfPipeline/getAccessorByteStride',
- '../ThirdParty/GltfPipeline/numberOfComponentsForType'
+ '../ThirdParty/GltfPipeline/numberOfComponentsForType',
+ './AttributeType'
], function(
- AttributeType,
Cartesian3,
ComponentDatatype,
defaultValue,
@@ -25,7 +24,8 @@ define([
WebGLConstants,
WeightSpline,
getAccessorByteStride,
- numberOfComponentsForType) {
+ numberOfComponentsForType,
+ AttributeType) {
'use strict';
/**
diff --git a/Source/Scene/Moon.js b/Source/Scene/Moon.js
index ec9235296fa1..f8ff09af63c9 100644
--- a/Source/Scene/Moon.js
+++ b/Source/Scene/Moon.js
@@ -169,8 +169,6 @@ define([
* isDestroyed
will result in a {@link DeveloperError} exception. Therefore,
* assign the return value (undefined
) to the object as done in the example.
*
- * @returns {undefined}
- *
* @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.
*
*
diff --git a/Source/Scene/ParticleEmitter.js b/Source/Scene/ParticleEmitter.js
index 2970619eedb5..b3a0a580c695 100644
--- a/Source/Scene/ParticleEmitter.js
+++ b/Source/Scene/ParticleEmitter.js
@@ -1,6 +1,7 @@
define([
- '../Core/DeveloperError'
-], function(DeveloperError) {
+ '../Core/DeveloperError'
+ ], function(
+ DeveloperError) {
'use strict';
/**
diff --git a/Source/Scene/ParticleSystem.js b/Source/Scene/ParticleSystem.js
index df789f55a72d..6ce7467f73ca 100644
--- a/Source/Scene/ParticleSystem.js
+++ b/Source/Scene/ParticleSystem.js
@@ -807,8 +807,6 @@ define([
* isDestroyed
will result in a {@link DeveloperError} exception. Therefore,
* assign the return value (undefined
) to the object as done in the example.
*
- * @returns {undefined}
- *
* @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.
*
* @see ParticleSystem#isDestroyed
diff --git a/Source/Scene/PointCloud3DTileContent.js b/Source/Scene/PointCloud3DTileContent.js
index d50eb6507733..78638b9d62d3 100644
--- a/Source/Scene/PointCloud3DTileContent.js
+++ b/Source/Scene/PointCloud3DTileContent.js
@@ -2,7 +2,6 @@ define([
'../Core/Cartesian2',
'../Core/Cartesian3',
'../Core/Cartesian4',
- '../Core/ClippingPlaneCollection',
'../Core/Color',
'../Core/combine',
'../Core/ComponentDatatype',
@@ -35,6 +34,8 @@ define([
'./Cesium3DTileBatchTable',
'./Cesium3DTileFeature',
'./Cesium3DTileFeatureTable',
+ './ClippingPlaneCollection',
+ './getClipAndStyleCode',
'./getClippingFunction',
'./SceneMode',
'./ShadowMode'
@@ -42,7 +43,6 @@ define([
Cartesian2,
Cartesian3,
Cartesian4,
- ClippingPlaneCollection,
Color,
combine,
ComponentDatatype,
@@ -75,6 +75,8 @@ define([
Cesium3DTileBatchTable,
Cesium3DTileFeature,
Cesium3DTileFeatureTable,
+ ClippingPlaneCollection,
+ getClipAndStyleCode,
getClippingFunction,
SceneMode,
ShadowMode) {
@@ -1133,14 +1135,7 @@ define([
' gl_FragColor = v_color; \n';
if (hasClippedContent) {
- fs += ' float clipDistance = clip(gl_FragCoord, u_clippingPlanes, u_clippingPlanesMatrix);\n' +
- ' vec4 clippingPlanesEdgeColor = vec4(1.0); \n' +
- ' clippingPlanesEdgeColor.rgb = u_clippingPlanesEdgeStyle.rgb; \n' +
- ' float clippingPlanesEdgeWidth = u_clippingPlanesEdgeStyle.a; \n' +
- ' if (clipDistance > 0.0 && clipDistance < clippingPlanesEdgeWidth) \n' +
- ' { \n' +
- ' gl_FragColor = clippingPlanesEdgeColor; \n' +
- ' } \n';
+ fs += getClipAndStyleCode('u_clippingPlanes', 'u_clippingPlanesMatrix', 'u_clippingPlanesEdgeStyle');
}
fs += '} \n';
diff --git a/Source/Scene/PointCloudEyeDomeLighting.js b/Source/Scene/PointCloudEyeDomeLighting.js
index 880b1775ac08..bf5809dc9d3a 100644
--- a/Source/Scene/PointCloudEyeDomeLighting.js
+++ b/Source/Scene/PointCloudEyeDomeLighting.js
@@ -19,8 +19,8 @@ define([
'../Renderer/PixelDatatype',
'../Renderer/RenderState',
'../Renderer/Sampler',
- '../Renderer/ShaderSource',
'../Renderer/ShaderProgram',
+ '../Renderer/ShaderSource',
'../Renderer/Texture',
'../Renderer/TextureMagnificationFilter',
'../Renderer/TextureMinificationFilter',
@@ -53,8 +53,8 @@ define([
PixelDatatype,
RenderState,
Sampler,
- ShaderSource,
ShaderProgram,
+ ShaderSource,
Texture,
TextureMagnificationFilter,
TextureMinificationFilter,
@@ -65,8 +65,7 @@ define([
BlendingState,
StencilFunction,
StencilOperation,
- PointCloudEyeDomeLightingShader
- ) {
+ PointCloudEyeDomeLightingShader) {
'use strict';
/**
@@ -343,8 +342,6 @@ define([
* isDestroyed
will result in a {@link DeveloperError} exception. Therefore,
* assign the return value (undefined
) to the object as done in the example.
*
- * @returns {undefined}
- *
* @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.
*
* @example
diff --git a/Source/Scene/PointPrimitiveCollection.js b/Source/Scene/PointPrimitiveCollection.js
index aa42b0394272..6ef137937a75 100644
--- a/Source/Scene/PointPrimitiveCollection.js
+++ b/Source/Scene/PointPrimitiveCollection.js
@@ -1119,8 +1119,6 @@ define([
* isDestroyed
will result in a {@link DeveloperError} exception. Therefore,
* assign the return value (undefined
) to the object as done in the example.
*
- * @returns {undefined}
- *
* @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.
*
*
diff --git a/Source/Scene/PolylineCollection.js b/Source/Scene/PolylineCollection.js
index fc60c0fab733..936744c6ae0b 100644
--- a/Source/Scene/PolylineCollection.js
+++ b/Source/Scene/PolylineCollection.js
@@ -747,8 +747,6 @@ define([
* isDestroyed
will result in a {@link DeveloperError} exception. Therefore,
* assign the return value (undefined
) to the object as done in the example.
*
- * @returns {undefined}
- *
* @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.
*
*
diff --git a/Source/Scene/Primitive.js b/Source/Scene/Primitive.js
index 59455919c3cb..fb5cafcb962b 100644
--- a/Source/Scene/Primitive.js
+++ b/Source/Scene/Primitive.js
@@ -1993,8 +1993,6 @@ define([
* assign the return value (undefined
) to the object as done in the example.
*
*
- * @returns {undefined}
- *
* @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.
*
*
diff --git a/Source/Scene/PrimitiveCollection.js b/Source/Scene/PrimitiveCollection.js
index e2f38bcc6854..ee4ab3276e53 100644
--- a/Source/Scene/PrimitiveCollection.js
+++ b/Source/Scene/PrimitiveCollection.js
@@ -392,8 +392,6 @@ define([
* isDestroyed
will result in a {@link DeveloperError} exception. Therefore,
* assign the return value (undefined
) to the object as done in the example.
*
- * @returns {undefined}
- *
* @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.
*
*
diff --git a/Source/Scene/QuadtreePrimitive.js b/Source/Scene/QuadtreePrimitive.js
index 9be66c8071df..c0b44e083d06 100644
--- a/Source/Scene/QuadtreePrimitive.js
+++ b/Source/Scene/QuadtreePrimitive.js
@@ -414,8 +414,6 @@ define([
*
* @memberof QuadtreePrimitive
*
- * @returns {undefined}
- *
* @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.
*
*
diff --git a/Source/Scene/QuadtreeTileProvider.js b/Source/Scene/QuadtreeTileProvider.js
index b9ebabb8fc78..3e167f8c6b95 100644
--- a/Source/Scene/QuadtreeTileProvider.js
+++ b/Source/Scene/QuadtreeTileProvider.js
@@ -207,8 +207,6 @@ define([
*
* @memberof QuadtreeTileProvider
*
- * @returns {undefined}
- *
* @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.
*
*
diff --git a/Source/Scene/Scene.js b/Source/Scene/Scene.js
index 09f66661d748..5fa9f8c15c63 100644
--- a/Source/Scene/Scene.js
+++ b/Source/Scene/Scene.js
@@ -3742,8 +3742,6 @@ define([
* isDestroyed
will result in a {@link DeveloperError} exception. Therefore,
* assign the return value (undefined
) to the object as done in the example.
*
- * @returns {undefined}
- *
* @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.
*
*
diff --git a/Source/Scene/ScreenSpaceCameraController.js b/Source/Scene/ScreenSpaceCameraController.js
index 6a503930d742..89fd9be0825e 100644
--- a/Source/Scene/ScreenSpaceCameraController.js
+++ b/Source/Scene/ScreenSpaceCameraController.js
@@ -1995,8 +1995,6 @@ define([
* isDestroyed
will result in a {@link DeveloperError} exception. Therefore,
* assign the return value (undefined
) to the object as done in the example.
*
- * @returns {undefined}
- *
* @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.
*
*
diff --git a/Source/Scene/SkyAtmosphere.js b/Source/Scene/SkyAtmosphere.js
index e37242aaddb1..3ea52c8b4037 100644
--- a/Source/Scene/SkyAtmosphere.js
+++ b/Source/Scene/SkyAtmosphere.js
@@ -298,8 +298,6 @@ define([
* isDestroyed
will result in a {@link DeveloperError} exception. Therefore,
* assign the return value (undefined
) to the object as done in the example.
*
- * @returns {undefined}
- *
* @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.
*
*
diff --git a/Source/Scene/SkyBox.js b/Source/Scene/SkyBox.js
index d64c5952c1f0..c2c9ed8b26ef 100644
--- a/Source/Scene/SkyBox.js
+++ b/Source/Scene/SkyBox.js
@@ -231,8 +231,6 @@ define([
* isDestroyed
will result in a {@link DeveloperError} exception. Therefore,
* assign the return value (undefined
) to the object as done in the example.
*
- * @returns {undefined}
- *
* @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.
*
*
diff --git a/Source/Scene/Sun.js b/Source/Scene/Sun.js
index cd948ab45d84..383001aa558f 100644
--- a/Source/Scene/Sun.js
+++ b/Source/Scene/Sun.js
@@ -329,8 +329,6 @@ define([
* isDestroyed
will result in a {@link DeveloperError} exception. Therefore,
* assign the return value (undefined
) to the object as done in the example.
*
- * @returns {undefined}
- *
* @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.
*
*
diff --git a/Source/Scene/TextureAtlas.js b/Source/Scene/TextureAtlas.js
index 608be3d218f0..7f649e5c984d 100644
--- a/Source/Scene/TextureAtlas.js
+++ b/Source/Scene/TextureAtlas.js
@@ -450,8 +450,6 @@ define([
* isDestroyed
will result in a {@link DeveloperError} exception. Therefore,
* assign the return value (undefined
) to the object as done in the example.
*
- * @returns {undefined}
- *
* @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.
*
*
diff --git a/Source/Scene/Vector3DTileGeometry.js b/Source/Scene/Vector3DTileGeometry.js
index 594304602ba9..762b543d7767 100644
--- a/Source/Scene/Vector3DTileGeometry.js
+++ b/Source/Scene/Vector3DTileGeometry.js
@@ -467,8 +467,6 @@ define([
* assign the return value (undefined
) to the object as done in the example.
*
*
- * @returns {undefined}
- *
* @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.
*/
Vector3DTileGeometry.prototype.destroy = function() {
diff --git a/Source/Scene/Vector3DTilePoints.js b/Source/Scene/Vector3DTilePoints.js
index 95c444db3e65..9a3e2938ad57 100644
--- a/Source/Scene/Vector3DTilePoints.js
+++ b/Source/Scene/Vector3DTilePoints.js
@@ -496,8 +496,6 @@ define([
* assign the return value (undefined
) to the object as done in the example.
*
*
- * @returns {undefined}
- *
* @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.
*/
Vector3DTilePoints.prototype.destroy = function() {
diff --git a/Source/Scene/Vector3DTilePolygons.js b/Source/Scene/Vector3DTilePolygons.js
index 24cc861df2c2..a19e411eade6 100644
--- a/Source/Scene/Vector3DTilePolygons.js
+++ b/Source/Scene/Vector3DTilePolygons.js
@@ -445,8 +445,6 @@ define([
* assign the return value (undefined
) to the object as done in the example.
*
*
- * @returns {undefined}
- *
* @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.
*/
Vector3DTilePolygons.prototype.destroy = function() {
diff --git a/Source/Scene/Vector3DTilePolylines.js b/Source/Scene/Vector3DTilePolylines.js
index fa7dcac36a8b..d6bd69bce4b0 100644
--- a/Source/Scene/Vector3DTilePolylines.js
+++ b/Source/Scene/Vector3DTilePolylines.js
@@ -605,8 +605,6 @@ define([
* assign the return value (undefined
) to the object as done in the example.
*
*
- * @returns {undefined}
- *
* @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.
*/
Vector3DTilePolylines.prototype.destroy = function() {
diff --git a/Source/Scene/Vector3DTilePrimitive.js b/Source/Scene/Vector3DTilePrimitive.js
index 4b1e64a39b56..0b850231013b 100644
--- a/Source/Scene/Vector3DTilePrimitive.js
+++ b/Source/Scene/Vector3DTilePrimitive.js
@@ -1171,8 +1171,6 @@ define([
* assign the return value (undefined
) to the object as done in the example.
*
*
- * @returns {undefined}
- *
* @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.
*/
Vector3DTilePrimitive.prototype.destroy = function() {
diff --git a/Source/Scene/ViewportQuad.js b/Source/Scene/ViewportQuad.js
index 6762b940ac9c..4a9cb6c6451e 100644
--- a/Source/Scene/ViewportQuad.js
+++ b/Source/Scene/ViewportQuad.js
@@ -176,8 +176,6 @@ define([
* isDestroyed
will result in a {@link DeveloperError} exception. Therefore,
* assign the return value (undefined
) to the object as done in the example.
*
- * @returns {undefined}
- *
* @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.
*
*
diff --git a/Source/Scene/getClipAndStyleCode.js b/Source/Scene/getClipAndStyleCode.js
new file mode 100644
index 000000000000..a04cb5f51373
--- /dev/null
+++ b/Source/Scene/getClipAndStyleCode.js
@@ -0,0 +1,36 @@
+define([
+ '../Core/Check'
+ ], function(
+ Check) {
+ 'use strict';
+
+ /**
+ * Gets a GLSL snippet that clips a fragment using the `clip` function from {@link getClippingFunction} and styles it.
+ *
+ * @param {String} samplerUniformName Name of the uniform for the clipping planes texture sampler.
+ * @param {String} matrixUniformName Name of the uniform for the clipping planes matrix.
+ * @param {String} styleUniformName Name of the uniform for the clipping planes style, a vec4.
+ * @returns {String} A string containing GLSL that clips and styles the current fragment.
+ * @private
+ */
+ function getClipAndStyleCode(samplerUniformName, matrixUniformName, styleUniformName) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.typeOf.string('samplerUniformName', samplerUniformName);
+ Check.typeOf.string('matrixUniformName', matrixUniformName);
+ Check.typeOf.string('styleUniformName', styleUniformName);
+ //>>includeEnd('debug');
+
+ var shaderCode =
+ ' float clipDistance = clip(gl_FragCoord, ' + samplerUniformName + ', ' + matrixUniformName + '); \n' +
+ ' vec4 clippingPlanesEdgeColor = vec4(1.0); \n' +
+ ' clippingPlanesEdgeColor.rgb = ' + styleUniformName + '.rgb; \n' +
+ ' float clippingPlanesEdgeWidth = ' + styleUniformName + '.a; \n' +
+ ' if (clipDistance > 0.0 && clipDistance < clippingPlanesEdgeWidth) \n' +
+ ' { \n' +
+ ' gl_FragColor = clippingPlanesEdgeColor;\n' +
+ ' } \n';
+ return shaderCode;
+ }
+
+ return getClipAndStyleCode;
+});
diff --git a/Source/Scene/getClippingFunction.js b/Source/Scene/getClippingFunction.js
index 495700e3eb87..902eb9b87b7e 100644
--- a/Source/Scene/getClippingFunction.js
+++ b/Source/Scene/getClippingFunction.js
@@ -1,18 +1,16 @@
define([
'../Core/Check',
- '../Renderer/PixelDatatype',
- './getUnpackFloatFunction'
+ '../Renderer/PixelDatatype'
], function(
Check,
- PixelDatatype,
- getUnpackFloatFunction) {
+ PixelDatatype) {
'use strict';
/**
- * Gets the glsl functions needed to retrieve clipping planes from a ClippingPlaneCollection's texture.
+ * Gets the GLSL functions needed to retrieve clipping planes from a ClippingPlaneCollection's texture.
*
* @param {ClippingPlaneCollection} clippingPlaneCollection ClippingPlaneCollection with a defined texture.
- * @returns {String} A string containing glsl functions for retrieving clipping planes.
+ * @returns {String} A string containing GLSL functions for retrieving clipping planes.
* @private
*/
function getClippingFunction(clippingPlaneCollection) {
@@ -111,7 +109,7 @@ define([
pixelWidthString += '.0';
}
var pixelHeightString = pixelHeight + '';
- if (pixelHeightString.indexOf('.' === -1)) {
+ if (pixelHeightString.indexOf('.') === -1) {
pixelHeightString += '.0';
}
@@ -123,7 +121,7 @@ define([
' float u = (float(pixX) + 0.5) * ' + pixelWidthString + ';\n' + // sample from center of pixel
' float v = (float(pixY) + 0.5) * ' + pixelHeightString + ';\n' +
' vec4 plane = texture2D(packedClippingPlanes, vec2(u, v));\n' +
- ' return czm_transformPlane(transform, plane);\n' +
+ ' return czm_transformPlane(plane, transform);\n' +
'}\n';
return functionString;
}
@@ -137,13 +135,11 @@ define([
pixelWidthString += '.0';
}
var pixelHeightString = pixelHeight + '';
- if (pixelHeightString.indexOf('.' === -1)) {
+ if (pixelHeightString.indexOf('.') === -1) {
pixelHeightString += '.0';
}
var functionString =
- getUnpackFloatFunction('unpackFloatDistance') +
- '\n' +
'vec4 getClippingPlane(sampler2D packedClippingPlanes, int clippingPlaneNumber, mat4 transform)\n' +
'{\n' +
' int clippingPlaneStartIndex = clippingPlaneNumber * 2;\n' + // clipping planes are two pixels each
@@ -157,9 +153,9 @@ define([
' vec4 plane;\n' +
' plane.xyz = czm_octDecode(oct, 65535.0);\n' +
- ' plane.w = unpackFloatDistance(texture2D(packedClippingPlanes, vec2(u + ' + pixelWidthString + ', v)));\n' +
+ ' plane.w = czm_unpackFloat(texture2D(packedClippingPlanes, vec2(u + ' + pixelWidthString + ', v)));\n' +
- ' return czm_transformPlane(transform, plane);\n' +
+ ' return czm_transformPlane(plane, transform);\n' +
'}\n';
return functionString;
}
diff --git a/Source/Scene/getUnpackFloatFunction.js b/Source/Scene/getUnpackFloatFunction.js
deleted file mode 100644
index dae8fb286cab..000000000000
--- a/Source/Scene/getUnpackFloatFunction.js
+++ /dev/null
@@ -1,42 +0,0 @@
-define([
- '../Core/defined'
- ], function(
- defined) {
- 'use strict';
-
- var SHIFT_RIGHT_8 = 1.0 / 256.0;
- var SHIFT_RIGHT_16 = 1.0 / 65536.0;
- var SHIFT_RIGHT_24 = 1.0 / 16777216.0;
-
- var BIAS = 38.0;
-
- /**
- * Gets a glsl function that takes a vec4 representing a float packed to Uint8 RGBA and returns the unpacked float.
- *
- * @param {String} [functionName='unpackFloat'] An optional name for the glsl function.
- * @returns {String} A string containing a glsl function that takes a vec4 and returns a float.
- * @private
- * @see Cartesian4#packFloat
- */
- function getUnpackFloatFunction(functionName) {
- if (!defined(functionName)) {
- functionName = 'unpackFloat';
- }
- return 'float ' + functionName + '(vec4 value) \n' +
- '{ \n' +
- ' value *= 255.0; \n' +
- ' float temp = value.w / 2.0; \n' +
- ' float exponent = floor(temp); \n' +
- ' float sign = (temp - exponent) * 2.0; \n' +
- ' exponent = exponent - float(' + BIAS + '); \n' +
- ' sign = sign * 2.0 - 1.0; \n' +
- ' sign = -sign; \n' +
- ' float unpacked = sign * value.x * float(' + SHIFT_RIGHT_8 + '); \n' +
- ' unpacked += sign * value.y * float(' + SHIFT_RIGHT_16 + '); \n' +
- ' unpacked += sign * value.z * float(' + SHIFT_RIGHT_24 + '); \n' +
- ' return unpacked * pow(10.0, exponent); \n' +
- '} \n';
- }
-
- return getUnpackFloatFunction;
-});
diff --git a/Source/Shaders/Builtin/Functions/transformPlane.glsl b/Source/Shaders/Builtin/Functions/transformPlane.glsl
index 3f0412c891cb..6838805a827b 100644
--- a/Source/Shaders/Builtin/Functions/transformPlane.glsl
+++ b/Source/Shaders/Builtin/Functions/transformPlane.glsl
@@ -1,4 +1,4 @@
-vec4 czm_transformPlane(mat4 transform, vec4 clippingPlane) {
+vec4 czm_transformPlane(vec4 clippingPlane, mat4 transform) {
vec3 transformedDirection = normalize((transform * vec4(clippingPlane.xyz, 0.0)).xyz);
vec3 transformedPosition = (transform * vec4(clippingPlane.xyz * -clippingPlane.w, 1.0)).xyz;
vec4 transformedPlane;
diff --git a/Source/Shaders/Builtin/Functions/unpackDepth.glsl b/Source/Shaders/Builtin/Functions/unpackDepth.glsl
index d122e70b9179..b6a7ef75cc9f 100644
--- a/Source/Shaders/Builtin/Functions/unpackDepth.glsl
+++ b/Source/Shaders/Builtin/Functions/unpackDepth.glsl
@@ -1,12 +1,12 @@
/**
- * Unpacks a vec3 depth depth value to a float.
+ * Unpacks a vec4 depth value to a float in [0, 1) range.
*
* @name czm_unpackDepth
* @glslFunction
*
- * @param {vec3} packedDepth The packed depth.
+ * @param {vec4} packedDepth The packed depth.
*
- * @returns {float} The floating-point depth.
+ * @returns {float} The floating-point depth in [0, 1) range.
*/
float czm_unpackDepth(vec4 packedDepth)
{
diff --git a/Source/Shaders/Builtin/Functions/unpackFloat.glsl b/Source/Shaders/Builtin/Functions/unpackFloat.glsl
new file mode 100644
index 000000000000..f13ce3c451a4
--- /dev/null
+++ b/Source/Shaders/Builtin/Functions/unpackFloat.glsl
@@ -0,0 +1,30 @@
+#define SHIFT_RIGHT_8 0.00390625 //1.0 / 256.0
+#define SHIFT_RIGHT_16 0.00001525878 //1.0 / 65536.0
+#define SHIFT_RIGHT_24 5.960464477539063e-8//1.0 / 16777216.0
+
+#define BIAS 38.0
+
+/**
+ * Unpacks a vec4 value containing values expressable as uint8 to an arbitrary float.
+ *
+ * @name czm_unpackFloat
+ * @glslFunction
+ *
+ * @param {vec4} packedFloat The packed float.
+ *
+ * @returns {float} The floating-point depth in arbitrary range.
+ */
+ float czm_unpackFloat(vec4 packedFloat)
+{
+ packedFloat *= 255.0;
+ float temp = packedFloat.w / 2.0;
+ float exponent = floor(temp);
+ float sign = (temp - exponent) * 2.0;
+ exponent = exponent - float(BIAS);
+ sign = sign * 2.0 - 1.0;
+ sign = -sign;
+ float unpacked = sign * packedFloat.x * float(SHIFT_RIGHT_8);
+ unpacked += sign * packedFloat.y * float(SHIFT_RIGHT_16);
+ unpacked += sign * packedFloat.z * float(SHIFT_RIGHT_24);
+ return unpacked * pow(10.0, exponent);
+}
diff --git a/Source/Workers/createPlaneGeometry.js b/Source/Workers/createPlaneGeometry.js
index 23785ac71d65..eff9382e696b 100644
--- a/Source/Workers/createPlaneGeometry.js
+++ b/Source/Workers/createPlaneGeometry.js
@@ -1,9 +1,9 @@
define([
- '../Core/PlaneGeometry',
- '../Core/defined'
+ '../Core/defined',
+ '../Core/PlaneGeometry'
], function(
- PlaneGeometry,
- defined) {
+ defined,
+ PlaneGeometry) {
'use strict';
return function(planeGeometry, offset) {
diff --git a/Source/Workers/createPlaneOutlineGeometry.js b/Source/Workers/createPlaneOutlineGeometry.js
index c2f5a7a7ff4a..6a03dcd54e43 100644
--- a/Source/Workers/createPlaneOutlineGeometry.js
+++ b/Source/Workers/createPlaneOutlineGeometry.js
@@ -1,9 +1,9 @@
define([
- '../Core/PlaneOutlineGeometry',
- '../Core/defined'
+ '../Core/defined',
+ '../Core/PlaneOutlineGeometry'
], function(
- PlaneOutlineGeometry,
- defined) {
+ defined,
+ PlaneOutlineGeometry) {
'use strict';
return function(planeGeometry, offset) {
diff --git a/Specs/Core/AttributeCompressionSpec.js b/Specs/Core/AttributeCompressionSpec.js
index fc710e4e8a30..4addf8add446 100644
--- a/Specs/Core/AttributeCompressionSpec.js
+++ b/Specs/Core/AttributeCompressionSpec.js
@@ -2,12 +2,14 @@ defineSuite([
'Core/AttributeCompression',
'Core/Cartesian2',
'Core/Cartesian3',
+ 'Core/Cartesian4',
'Core/defined',
'Core/Math'
], function(
AttributeCompression,
Cartesian2,
Cartesian3,
+ Cartesian4,
defined,
CesiumMath) {
'use strict';
@@ -31,6 +33,18 @@ defineSuite([
expect(result).toEqual(new Cartesian2(128, 128));
});
+ it('oct encode(0, 0, -1) to 4 components', function() {
+ var result = new Cartesian4();
+ AttributeCompression.octEncodeToCartesian4(negativeUnitZ, result);
+ expect(result).toEqual(new Cartesian4(255, 255, 255, 255));
+ });
+
+ it('oct encode(0, 0, 1) to 4 components', function() {
+ var result = new Cartesian4();
+ AttributeCompression.octEncodeToCartesian4(Cartesian3.UNIT_Z, result);
+ expect(result).toEqual(new Cartesian4(128, 0, 128, 0));
+ });
+
it('oct extents are equal', function() {
var result = new Cartesian3();
// lower left
@@ -98,6 +112,25 @@ defineSuite([
}).toThrowDeveloperError();
});
+ it('throws 4-component oct decode out of bounds', function() {
+ var result = new Cartesian3();
+ expect(function() {
+ AttributeCompression.octDecodeFromCartesian4(new Cartesian4(256, 0, 0, 0), result);
+ }).toThrowDeveloperError();
+
+ expect(function() {
+ AttributeCompression.octDecodeFromCartesian4(new Cartesian4(0, 256, 0, 0), result);
+ }).toThrowDeveloperError();
+
+ expect(function() {
+ AttributeCompression.octDecodeFromCartesian4(new Cartesian4(0, 0, 256, 0), result);
+ }).toThrowDeveloperError();
+
+ expect(function() {
+ AttributeCompression.octDecodeFromCartesian4(new Cartesian4(0, 0, 0, 256), result);
+ }).toThrowDeveloperError();
+ });
+
it('oct encoding', function() {
var epsilon = CesiumMath.EPSILON1;
@@ -239,6 +272,76 @@ defineSuite([
expect(AttributeCompression.octDecodeInRange(encoded.x, encoded.y, rangeMax, result)).toEqualEpsilon(normal, epsilon);
});
+ it('oct encoding to 4 components', function() {
+ var epsilon = CesiumMath.EPSILON1;
+
+ var encoded = new Cartesian4();
+ var result = new Cartesian3();
+ var normal = new Cartesian3(0.0, 0.0, 1.0);
+ AttributeCompression.octEncodeToCartesian4(normal, encoded);
+ expect(AttributeCompression.octDecodeFromCartesian4(encoded, result)).toEqualEpsilon(normal, epsilon);
+
+ normal = new Cartesian3(0.0, 0.0, -1.0);
+ AttributeCompression.octEncodeToCartesian4(normal, encoded);
+ expect(AttributeCompression.octDecodeFromCartesian4(encoded, result)).toEqualEpsilon(normal, epsilon);
+
+ normal = new Cartesian3(0.0, 1.0, 0.0);
+ AttributeCompression.octEncodeToCartesian4(normal, encoded);
+ expect(AttributeCompression.octDecodeFromCartesian4(encoded, result)).toEqualEpsilon(normal, epsilon);
+
+ normal = new Cartesian3(0.0, -1.0, 0.0);
+ AttributeCompression.octEncodeToCartesian4(normal, encoded);
+ expect(AttributeCompression.octDecodeFromCartesian4(encoded, result)).toEqualEpsilon(normal, epsilon);
+
+ normal = new Cartesian3(1.0, 0.0, 0.0);
+ AttributeCompression.octEncodeToCartesian4(normal, encoded);
+ expect(AttributeCompression.octDecodeFromCartesian4(encoded, result)).toEqualEpsilon(normal, epsilon);
+
+ normal = new Cartesian3(-1.0, 0.0, 0.0);
+ AttributeCompression.octEncodeToCartesian4(normal, encoded);
+ expect(AttributeCompression.octDecodeFromCartesian4(encoded, result)).toEqualEpsilon(normal, epsilon);
+
+ normal = new Cartesian3(1.0, 1.0, 1.0);
+ Cartesian3.normalize(normal, normal);
+ AttributeCompression.octEncodeToCartesian4(normal, encoded);
+ expect(AttributeCompression.octDecodeFromCartesian4(encoded, result)).toEqualEpsilon(normal, epsilon);
+
+ normal = new Cartesian3(1.0, -1.0, 1.0);
+ Cartesian3.normalize(normal, normal);
+ AttributeCompression.octEncodeToCartesian4(normal, encoded);
+ expect(AttributeCompression.octDecodeFromCartesian4(encoded, result)).toEqualEpsilon(normal, epsilon);
+
+ normal = new Cartesian3(-1.0, -1.0, 1.0);
+ Cartesian3.normalize(normal, normal);
+ AttributeCompression.octEncodeToCartesian4(normal, encoded);
+ expect(AttributeCompression.octDecodeFromCartesian4(encoded, result)).toEqualEpsilon(normal, epsilon);
+
+ normal = new Cartesian3(-1.0, 1.0, 1.0);
+ Cartesian3.normalize(normal, normal);
+ AttributeCompression.octEncodeToCartesian4(normal, encoded);
+ expect(AttributeCompression.octDecodeFromCartesian4(encoded, result)).toEqualEpsilon(normal, epsilon);
+
+ normal = new Cartesian3(1.0, 1.0, -1.0);
+ Cartesian3.normalize(normal, normal);
+ AttributeCompression.octEncodeToCartesian4(normal, encoded);
+ expect(AttributeCompression.octDecodeFromCartesian4(encoded, result)).toEqualEpsilon(normal, epsilon);
+
+ normal = new Cartesian3(1.0, -1.0, -1.0);
+ Cartesian3.normalize(normal, normal);
+ AttributeCompression.octEncodeToCartesian4(normal, encoded);
+ expect(AttributeCompression.octDecodeFromCartesian4(encoded, result)).toEqualEpsilon(normal, epsilon);
+
+ normal = new Cartesian3(-1.0, 1.0, -1.0);
+ Cartesian3.normalize(normal, normal);
+ AttributeCompression.octEncodeToCartesian4(normal, encoded);
+ expect(AttributeCompression.octDecodeFromCartesian4(encoded, result)).toEqualEpsilon(normal, epsilon);
+
+ normal = new Cartesian3(-1.0, -1.0, -1.0);
+ Cartesian3.normalize(normal, normal);
+ AttributeCompression.octEncodeToCartesian4(normal, encoded);
+ expect(AttributeCompression.octDecodeFromCartesian4(encoded, result)).toEqualEpsilon(normal, epsilon);
+ });
+
it('octFloat encoding', function() {
var epsilon = CesiumMath.EPSILON1;
diff --git a/Specs/Core/DoublyLinkedListSpec.js b/Specs/Core/DoublyLinkedListSpec.js
index 1874ccc7fff4..da5ba6b7bcf6 100644
--- a/Specs/Core/DoublyLinkedListSpec.js
+++ b/Specs/Core/DoublyLinkedListSpec.js
@@ -63,6 +63,77 @@ defineSuite([
expect(node2.next).toEqual(node3);
});
+ it('adds to the front of the list', function() {
+ var list = new DoublyLinkedList();
+ var node = list.addFront(1);
+
+ // node
+ // ^ ^
+ // | |
+ // head tail
+ expect(list.head).toEqual(node);
+ expect(list.tail).toEqual(node);
+ expect(list.length).toEqual(1);
+
+ expect(node).toBeDefined();
+ expect(node.item).toEqual(1);
+ expect(node.previous).not.toBeDefined();
+ expect(node.next).not.toBeDefined();
+
+ var node2 = list.addFront(2);
+
+ // node2 <-> node
+ // ^ ^
+ // | |
+ // head tail
+ expect(list.head).toEqual(node2);
+ expect(list.tail).toEqual(node);
+ expect(list.length).toEqual(2);
+
+ expect(node2).toBeDefined();
+ expect(node2.item).toEqual(2);
+ expect(node2.previous).toBeUndefined();
+ expect(node2.next).toBe(node);
+
+ expect(node.previous).toBe(node2);
+ expect(node.next).toBeUndefined(node2);
+
+ var node3 = list.addFront(3);
+
+ // node3 <-> node2 <-> node
+ // ^ ^
+ // | |
+ // head tail
+ expect(list.head).toEqual(node3);
+ expect(list.tail).toEqual(node);
+ expect(list.length).toEqual(3);
+
+ expect(node3).toBeDefined();
+ expect(node3.item).toEqual(3);
+ expect(node3.previous).toBeUndefined();
+ expect(node3.next).toBe(node2);
+
+ expect(node2.previous).toEqual(node3);
+ expect(node2.next).toEqual(node);
+ });
+
+ it('moves node to the front of the list', function() {
+ var list = new DoublyLinkedList();
+ var node = list.add(1);
+ var node2 = list.add(2);
+ var node3 = list.add(3);
+ var node4 = list.add(4);
+
+ list.moveToFront(node);
+ expectOrder(list, [node, node2, node3, node4]);
+
+ list.moveToFront(node4);
+ expectOrder(list, [node4, node, node2, node3]);
+
+ list.moveToFront(node2);
+ expectOrder(list, [node2, node4, node, node3]);
+ });
+
it('removes from a list with one item', function() {
var list = new DoublyLinkedList();
var node = list.add(1);
@@ -122,6 +193,62 @@ defineSuite([
expect(list.length).toEqual(1);
});
+ it('removeAfter removes nothing', function() {
+ var list = new DoublyLinkedList();
+ var node = list.add(1);
+
+ list.removeAfter(undefined);
+
+ expect(list.head).toEqual(node);
+ expect(list.tail).toEqual(node);
+ expect(list.length).toEqual(1);
+
+ list.removeAfter(list.length);
+
+ expect(list.head).toEqual(node);
+ expect(list.tail).toEqual(node);
+ expect(list.length).toEqual(1);
+ });
+
+ it('removeAfter removes all', function() {
+ var list = new DoublyLinkedList();
+ list.add(1);
+ list.add(2);
+
+ list.removeAfter(0);
+
+ expect(list.head).toBeUndefined();
+ expect(list.tail).toBeUndefined();
+ expect(list.length).toEqual(0);
+ });
+
+ it('removeAfter removes tail', function() {
+ var list = new DoublyLinkedList();
+ var node = list.add(1);
+ list.add(2);
+
+ list.removeAfter(1);
+
+ expect(list.head).toEqual(node);
+ expect(list.tail).toEqual(node);
+ expect(list.length).toEqual(1);
+ });
+
+ it('removeAfter removes nodes after index (inclusive)', function() {
+ var list = new DoublyLinkedList();
+ var node1 = list.add(1);
+ var node2 = list.add(2);
+ list.add(3);
+ list.add(4);
+ list.add(5);
+
+ list.removeAfter(2);
+
+ expect(list.head).toEqual(node1);
+ expect(list.tail).toEqual(node2);
+ expect(list.length).toEqual(2);
+ });
+
function expectOrder(list, nodes) {
// Assumes at least one node is in the list
var length = nodes.length;
diff --git a/Specs/Core/FrustumOutlineGeometrySpec.js b/Specs/Core/FrustumOutlineGeometrySpec.js
index 71a46b75da84..e47e2207d8f0 100644
--- a/Specs/Core/FrustumOutlineGeometrySpec.js
+++ b/Specs/Core/FrustumOutlineGeometrySpec.js
@@ -7,7 +7,7 @@ defineSuite([
'Core/VertexFormat',
'Specs/createPackableSpecs'
], function(
- FrustumOutlineGeometry,
+ FrustumOutlineGeometry,
Cartesian3,
CesiumMath,
PerspectiveFrustum,
diff --git a/Specs/Core/IonResourceSpec.js b/Specs/Core/IonResourceSpec.js
index d03e943e626b..2a961007bf98 100644
--- a/Specs/Core/IonResourceSpec.js
+++ b/Specs/Core/IonResourceSpec.js
@@ -1,17 +1,17 @@
defineSuite([
- 'Core/IonResource',
- 'Core/Ion',
- 'Core/RequestErrorEvent',
- 'Core/Resource',
- 'Core/RuntimeError',
- 'ThirdParty/when'
-], function(
- IonResource,
- Ion,
- RequestErrorEvent,
- Resource,
- RuntimeError,
- when) {
+ 'Core/IonResource',
+ 'Core/Ion',
+ 'Core/RequestErrorEvent',
+ 'Core/Resource',
+ 'Core/RuntimeError',
+ 'ThirdParty/when'
+ ], function(
+ IonResource,
+ Ion,
+ RequestErrorEvent,
+ Resource,
+ RuntimeError,
+ when) {
'use strict';
var assetId = 123890213;
diff --git a/Specs/Core/LRUCacheSpec.js b/Specs/Core/LRUCacheSpec.js
new file mode 100644
index 000000000000..c53c723fbc5a
--- /dev/null
+++ b/Specs/Core/LRUCacheSpec.js
@@ -0,0 +1,122 @@
+defineSuite([
+ 'Core/LRUCache',
+ 'Core/getTimestamp'
+ ], function(
+ LRUCache,
+ getTimestamp) {
+ 'use strict';
+
+ it('can manipulate values', function() {
+ var cache = new LRUCache();
+
+ expect(cache.get('key1')).toBeUndefined();
+
+ cache.set('key1', 1);
+ cache.set('key2', 2);
+ cache.set('key3', 3);
+
+ expect(cache.get('key1')).toEqual(1);
+ expect(cache.get('key2')).toEqual(2);
+ expect(cache.get('key3')).toEqual(3);
+
+ cache.set('key2', 4);
+ expect(cache.get('key2')).toEqual(4);
+ });
+
+ it('set throws with undefined key', function() {
+ var cache = new LRUCache();
+ expect(function() {
+ cache.set(undefined, 1);
+ }).toThrowDeveloperError();
+ });
+
+ it('get throws with undefined key', function() {
+ var cache = new LRUCache();
+ expect(function() {
+ cache.get(undefined);
+ }).toThrowDeveloperError();
+ });
+
+ it('Overflows correctly when capacity is set', function() {
+ var cache = new LRUCache(3);
+
+ expect(cache.get('key1')).toBeUndefined();
+
+ cache.set('key1', 1);
+ cache.set('key2', 2);
+ cache.set('key3', 3);
+
+ expect(cache.get('key1')).toEqual(1); //[3, 2, 1]
+ expect(cache.get('key2')).toEqual(2);
+ expect(cache.get('key3')).toEqual(3);
+
+ cache.set('key4', 4); //[4, 3, 2]
+ expect(cache.get('key1')).toBeUndefined();
+ expect(cache.get('key2')).toEqual(2);
+ expect(cache.get('key3')).toEqual(3);
+ expect(cache.get('key4')).toEqual(4);
+
+ //set moves to the front of the list
+ cache.set('key2', 22); //[2, 4, 3]
+ expect(cache.get('key3')).toEqual(3);
+ expect(cache.get('key2')).toEqual(22);
+ expect(cache.get('key4')).toEqual(4);
+
+ cache.set('key3', 3); //[3, 2, 4]
+ expect(cache.get('key1')).toBeUndefined();
+ expect(cache.get('key2')).toEqual(22);
+ expect(cache.get('key3')).toEqual(3);
+ expect(cache.get('key4')).toEqual(4);
+
+ //get moves to the front of the list
+ cache.get('key4'); //[4, 3, 2]
+ cache.set('key1', 1); //[1, 3, 4]
+ expect(cache.get('key1')).toEqual(1);
+ expect(cache.get('key2')).toBeUndefined();
+ expect(cache.get('key3')).toEqual(3);
+ expect(cache.get('key4')).toEqual(4);
+ });
+
+ function spinWait(milliseconds) {
+ var endTime = getTimestamp() + milliseconds;
+ /*eslint-disable no-empty*/
+ while (getTimestamp() < endTime) {
+ }
+ /*eslint-enable no-empty*/
+ }
+
+ it('prune has no effect when no expiration is set', function() {
+ var cache = new LRUCache(3);
+ cache.set('key1', 1);
+ cache.set('key2', 2);
+ cache.set('key3', 3);
+
+ spinWait(3);
+
+ LRUCache._prune(cache);
+
+ expect(cache.get('key1')).toEqual(1);
+ expect(cache.get('key2')).toEqual(2);
+ expect(cache.get('key3')).toEqual(3);
+ });
+
+ it('prune removes expired entries', function() {
+ spyOn(LRUCache, '_checkExpiration');
+
+ var cache = new LRUCache(3, 10);
+ cache.set('key1', 1);
+ cache.set('key2', 2);
+
+ spinWait(10);
+
+ cache.set('key3', 3);
+
+ LRUCache._prune(cache);
+
+ expect(cache.get('key1')).toBeUndefined();
+ expect(cache.get('key2')).toBeUndefined();
+ expect(cache.get('key3')).toEqual(3);
+
+ expect(cache._list.length).toBe(1);
+ });
+});
diff --git a/Specs/Core/ResourceSpec.js b/Specs/Core/ResourceSpec.js
index 050e9ba050f7..90a855267735 100644
--- a/Specs/Core/ResourceSpec.js
+++ b/Specs/Core/ResourceSpec.js
@@ -1,13 +1,13 @@
defineSuite([
- 'Core/Resource',
- 'Core/DefaultProxy',
- 'Core/Request',
- 'ThirdParty/when'
-], function(
- Resource,
- DefaultProxy,
- Request,
- when) {
+ 'Core/Resource',
+ 'Core/DefaultProxy',
+ 'Core/Request',
+ 'ThirdParty/when'
+ ], function(
+ Resource,
+ DefaultProxy,
+ Request,
+ when) {
'use strict';
it('Constructor sets correct properties', function() {
diff --git a/Specs/DataSources/BoxGeometryUpdaterSpec.js b/Specs/DataSources/BoxGeometryUpdaterSpec.js
index d088a37cba3e..1a59fa76d025 100644
--- a/Specs/DataSources/BoxGeometryUpdaterSpec.js
+++ b/Specs/DataSources/BoxGeometryUpdaterSpec.js
@@ -1,31 +1,31 @@
defineSuite([
- 'DataSources/BoxGeometryUpdater',
- 'Core/Cartesian3',
- 'Core/JulianDate',
- 'Core/TimeIntervalCollection',
- 'DataSources/BoxGraphics',
- 'DataSources/ConstantPositionProperty',
- 'DataSources/ConstantProperty',
- 'DataSources/Entity',
- 'Scene/PrimitiveCollection',
- 'Specs/createDynamicGeometryUpdaterSpecs',
- 'Specs/createDynamicProperty',
- 'Specs/createGeometryUpdaterSpecs',
- 'Specs/createScene'
-], function(
- BoxGeometryUpdater,
- Cartesian3,
- JulianDate,
- TimeIntervalCollection,
- BoxGraphics,
- ConstantPositionProperty,
- ConstantProperty,
- Entity,
- PrimitiveCollection,
- createDynamicGeometryUpdaterSpecs,
- createDynamicProperty,
- createGeometryUpdaterSpecs,
- createScene) {
+ 'DataSources/BoxGeometryUpdater',
+ 'Core/Cartesian3',
+ 'Core/JulianDate',
+ 'Core/TimeIntervalCollection',
+ 'DataSources/BoxGraphics',
+ 'DataSources/ConstantPositionProperty',
+ 'DataSources/ConstantProperty',
+ 'DataSources/Entity',
+ 'Scene/PrimitiveCollection',
+ 'Specs/createDynamicGeometryUpdaterSpecs',
+ 'Specs/createDynamicProperty',
+ 'Specs/createGeometryUpdaterSpecs',
+ 'Specs/createScene'
+ ], function(
+ BoxGeometryUpdater,
+ Cartesian3,
+ JulianDate,
+ TimeIntervalCollection,
+ BoxGraphics,
+ ConstantPositionProperty,
+ ConstantProperty,
+ Entity,
+ PrimitiveCollection,
+ createDynamicGeometryUpdaterSpecs,
+ createDynamicProperty,
+ createGeometryUpdaterSpecs,
+ createScene) {
'use strict';
var scene;
diff --git a/Specs/DataSources/CorridorGeometryUpdaterSpec.js b/Specs/DataSources/CorridorGeometryUpdaterSpec.js
index 6d3a516d11a4..940a2718d92b 100644
--- a/Specs/DataSources/CorridorGeometryUpdaterSpec.js
+++ b/Specs/DataSources/CorridorGeometryUpdaterSpec.js
@@ -15,8 +15,8 @@ defineSuite([
'Scene/PrimitiveCollection',
'Specs/createDynamicGeometryUpdaterSpecs',
'Specs/createDynamicProperty',
- 'Specs/createGeometryUpdaterSpecs',
'Specs/createGeometryUpdaterGroundGeometrySpecs',
+ 'Specs/createGeometryUpdaterSpecs',
'Specs/createScene'
], function(
CorridorGeometryUpdater,
@@ -35,8 +35,8 @@ defineSuite([
PrimitiveCollection,
createDynamicGeometryUpdaterSpecs,
createDynamicProperty,
- createGeometryUpdaterSpecs,
createGeometryUpdaterGroundGeometrySpecs,
+ createGeometryUpdaterSpecs,
createScene) {
'use strict';
diff --git a/Specs/DataSources/DynamicGeometryUpdaterSpec.js b/Specs/DataSources/DynamicGeometryUpdaterSpec.js
index 819ea68f6f29..570029923260 100644
--- a/Specs/DataSources/DynamicGeometryUpdaterSpec.js
+++ b/Specs/DataSources/DynamicGeometryUpdaterSpec.js
@@ -1,15 +1,15 @@
defineSuite([
- 'DataSources/DynamicGeometryUpdater',
- 'DataSources/Entity',
- 'DataSources/GeometryUpdater',
- 'Scene/PrimitiveCollection',
- 'Specs/createScene'
-], function(
- DynamicGeometryUpdater,
- Entity,
- GeometryUpdater,
- PrimitiveCollection,
- createScene) {
+ 'DataSources/DynamicGeometryUpdater',
+ 'DataSources/Entity',
+ 'DataSources/GeometryUpdater',
+ 'Scene/PrimitiveCollection',
+ 'Specs/createScene'
+ ], function(
+ DynamicGeometryUpdater,
+ Entity,
+ GeometryUpdater,
+ PrimitiveCollection,
+ createScene) {
'use strict';
var scene;
diff --git a/Specs/DataSources/EllipseGeometryUpdaterSpec.js b/Specs/DataSources/EllipseGeometryUpdaterSpec.js
index d46f9c87b534..27cb00ba0eaa 100644
--- a/Specs/DataSources/EllipseGeometryUpdaterSpec.js
+++ b/Specs/DataSources/EllipseGeometryUpdaterSpec.js
@@ -12,8 +12,8 @@ defineSuite([
'Scene/PrimitiveCollection',
'Specs/createDynamicGeometryUpdaterSpecs',
'Specs/createDynamicProperty',
- 'Specs/createGeometryUpdaterSpecs',
'Specs/createGeometryUpdaterGroundGeometrySpecs',
+ 'Specs/createGeometryUpdaterSpecs',
'Specs/createScene'
], function(
EllipseGeometryUpdater,
@@ -29,8 +29,8 @@ defineSuite([
PrimitiveCollection,
createDynamicGeometryUpdaterSpecs,
createDynamicProperty,
- createGeometryUpdaterSpecs,
createGeometryUpdaterGroundGeometrySpecs,
+ createGeometryUpdaterSpecs,
createScene) {
'use strict';
diff --git a/Specs/DataSources/GeometryUpdaterSpec.js b/Specs/DataSources/GeometryUpdaterSpec.js
index 2f05a03d6c8f..b9bb32f7252a 100644
--- a/Specs/DataSources/GeometryUpdaterSpec.js
+++ b/Specs/DataSources/GeometryUpdaterSpec.js
@@ -1,13 +1,13 @@
defineSuite([
- 'DataSources/GeometryUpdater',
- 'DataSources/Entity',
- 'Scene/PrimitiveCollection',
- 'Specs/createScene'
-], function(
- GeometryUpdater,
- Entity,
- PrimitiveCollection,
- createScene) {
+ 'DataSources/GeometryUpdater',
+ 'DataSources/Entity',
+ 'Scene/PrimitiveCollection',
+ 'Specs/createScene'
+ ], function(
+ GeometryUpdater,
+ Entity,
+ PrimitiveCollection,
+ createScene) {
'use strict';
var scene;
diff --git a/Specs/DataSources/KmlDataSourceSpec.js b/Specs/DataSources/KmlDataSourceSpec.js
index 909c02ab113f..202d4da998a0 100644
--- a/Specs/DataSources/KmlDataSourceSpec.js
+++ b/Specs/DataSources/KmlDataSourceSpec.js
@@ -1,10 +1,5 @@
defineSuite([
'DataSources/KmlDataSource',
- 'DataSources/KmlLookAt',
- 'DataSources/KmlCamera',
- 'DataSources/KmlTour',
- 'DataSources/KmlTourWait',
- 'DataSources/KmlTourFlyTo',
'Core/BoundingRectangle',
'Core/Cartesian2',
'Core/Cartesian3',
@@ -15,6 +10,8 @@ defineSuite([
'Core/DefaultProxy',
'Core/Ellipsoid',
'Core/Event',
+ 'Core/HeadingPitchRange',
+ 'Core/HeadingPitchRoll',
'Core/Iso8601',
'Core/JulianDate',
'Core/Math',
@@ -23,11 +20,14 @@ defineSuite([
'Core/RequestErrorEvent',
'Core/Resource',
'Core/RuntimeError',
- 'Core/HeadingPitchRange',
- 'Core/HeadingPitchRoll',
'DataSources/ColorMaterialProperty',
'DataSources/EntityCollection',
'DataSources/ImageMaterialProperty',
+ 'DataSources/KmlCamera',
+ 'DataSources/KmlLookAt',
+ 'DataSources/KmlTour',
+ 'DataSources/KmlTourFlyTo',
+ 'DataSources/KmlTourWait',
'Scene/Camera',
'Scene/HeightReference',
'Scene/HorizontalOrigin',
@@ -38,11 +38,6 @@ defineSuite([
'ThirdParty/when'
], function(
KmlDataSource,
- KmlLookAt,
- KmlCamera,
- KmlTour,
- KmlTourWait,
- KmlTourFlyTo,
BoundingRectangle,
Cartesian2,
Cartesian3,
@@ -53,6 +48,8 @@ defineSuite([
DefaultProxy,
Ellipsoid,
Event,
+ HeadingPitchRange,
+ HeadingPitchRoll,
Iso8601,
JulianDate,
CesiumMath,
@@ -61,11 +58,14 @@ defineSuite([
RequestErrorEvent,
Resource,
RuntimeError,
- HeadingPitchRange,
- HeadingPitchRoll,
ColorMaterialProperty,
EntityCollection,
ImageMaterialProperty,
+ KmlCamera,
+ KmlLookAt,
+ KmlTour,
+ KmlTourFlyTo,
+ KmlTourWait,
Camera,
HeightReference,
HorizontalOrigin,
diff --git a/Specs/DataSources/KmlTourFlyToSpec.js b/Specs/DataSources/KmlTourFlyToSpec.js
index 49d61154f1ca..ed982b60e271 100644
--- a/Specs/DataSources/KmlTourFlyToSpec.js
+++ b/Specs/DataSources/KmlTourFlyToSpec.js
@@ -1,22 +1,21 @@
defineSuite([
'DataSources/KmlTourFlyTo',
- 'DataSources/KmlCamera',
- 'DataSources/KmlLookAt',
'Core/Cartesian3',
'Core/HeadingPitchRange',
'Core/HeadingPitchRoll',
'Core/Math',
+ 'DataSources/KmlCamera',
+ 'DataSources/KmlLookAt',
'Specs/pollToPromise'
], function(
KmlTourFlyTo,
- KmlCamera,
- KmlLookAt,
Cartesian3,
HeadingPitchRange,
HeadingPitchRoll,
CesiumMath,
- pollToPromise
- ) {
+ KmlCamera,
+ KmlLookAt,
+ pollToPromise) {
'use strict';
it('generates camera options for KmlLookAt', function() {
diff --git a/Specs/DataSources/KmlTourSpec.js b/Specs/DataSources/KmlTourSpec.js
index d9191ebea68f..91994729b047 100644
--- a/Specs/DataSources/KmlTourSpec.js
+++ b/Specs/DataSources/KmlTourSpec.js
@@ -1,22 +1,21 @@
defineSuite([
'DataSources/KmlTour',
- 'DataSources/KmlTourFlyTo',
- 'DataSources/KmlTourWait',
- 'DataSources/KmlLookAt',
'Core/Cartesian3',
'Core/HeadingPitchRange',
'Core/Math',
+ 'DataSources/KmlLookAt',
+ 'DataSources/KmlTourFlyTo',
+ 'DataSources/KmlTourWait',
'Specs/pollToPromise'
], function(
KmlTour,
- KmlTourFlyTo,
- KmlTourWait,
- KmlLookAt,
Cartesian3,
HeadingPitchRange,
CesiumMath,
- pollToPromise
- ) {
+ KmlLookAt,
+ KmlTourFlyTo,
+ KmlTourWait,
+ pollToPromise) {
'use strict';
function getLookAt() {
diff --git a/Specs/DataSources/ModelGraphicsSpec.js b/Specs/DataSources/ModelGraphicsSpec.js
index fbcaf606ffc1..f7d49e004a70 100644
--- a/Specs/DataSources/ModelGraphicsSpec.js
+++ b/Specs/DataSources/ModelGraphicsSpec.js
@@ -1,7 +1,6 @@
defineSuite([
'DataSources/ModelGraphics',
'Core/Cartesian3',
- 'Core/ClippingPlaneCollection',
'Core/Color',
'Core/DistanceDisplayCondition',
'Core/JulianDate',
@@ -9,13 +8,13 @@ defineSuite([
'DataSources/ConstantProperty',
'DataSources/NodeTransformationProperty',
'DataSources/PropertyBag',
+ 'Scene/ClippingPlaneCollection',
'Scene/ColorBlendMode',
'Scene/HeightReference',
'Scene/ShadowMode'
], function(
ModelGraphics,
Cartesian3,
- ClippingPlaneCollection,
Color,
DistanceDisplayCondition,
JulianDate,
@@ -23,6 +22,7 @@ defineSuite([
ConstantProperty,
NodeTransformationProperty,
PropertyBag,
+ ClippingPlaneCollection,
ColorBlendMode,
HeightReference,
ShadowMode) {
diff --git a/Specs/DataSources/ModelVisualizerSpec.js b/Specs/DataSources/ModelVisualizerSpec.js
index 1ef89c237d74..a7de662b5482 100644
--- a/Specs/DataSources/ModelVisualizerSpec.js
+++ b/Specs/DataSources/ModelVisualizerSpec.js
@@ -2,8 +2,6 @@ defineSuite([
'DataSources/ModelVisualizer',
'Core/BoundingSphere',
'Core/Cartesian3',
- 'Core/ClippingPlane',
- 'Core/ClippingPlaneCollection',
'Core/defined',
'Core/DistanceDisplayCondition',
'Core/JulianDate',
@@ -17,6 +15,8 @@ defineSuite([
'DataSources/EntityCollection',
'DataSources/ModelGraphics',
'DataSources/NodeTransformationProperty',
+ 'Scene/ClippingPlane',
+ 'Scene/ClippingPlaneCollection',
'Scene/Globe',
'Specs/createScene',
'Specs/pollToPromise'
@@ -24,8 +24,6 @@ defineSuite([
ModelVisualizer,
BoundingSphere,
Cartesian3,
- ClippingPlane,
- ClippingPlaneCollection,
defined,
DistanceDisplayCondition,
JulianDate,
@@ -39,6 +37,8 @@ defineSuite([
EntityCollection,
ModelGraphics,
NodeTransformationProperty,
+ ClippingPlane,
+ ClippingPlaneCollection,
Globe,
createScene,
pollToPromise) {
diff --git a/Specs/DataSources/PlaneGeometryUpdaterSpec.js b/Specs/DataSources/PlaneGeometryUpdaterSpec.js
index 94e00d69430c..2c761b09b80a 100644
--- a/Specs/DataSources/PlaneGeometryUpdaterSpec.js
+++ b/Specs/DataSources/PlaneGeometryUpdaterSpec.js
@@ -5,10 +5,10 @@ defineSuite([
'Core/JulianDate',
'Core/Plane',
'Core/TimeIntervalCollection',
- 'DataSources/PlaneGraphics',
'DataSources/ConstantPositionProperty',
'DataSources/ConstantProperty',
'DataSources/Entity',
+ 'DataSources/PlaneGraphics',
'Scene/PrimitiveCollection',
'Specs/createDynamicGeometryUpdaterSpecs',
'Specs/createDynamicProperty',
@@ -21,10 +21,10 @@ defineSuite([
JulianDate,
Plane,
TimeIntervalCollection,
- PlaneGraphics,
ConstantPositionProperty,
ConstantProperty,
Entity,
+ PlaneGraphics,
PrimitiveCollection,
createDynamicGeometryUpdaterSpecs,
createDynamicProperty,
diff --git a/Specs/DataSources/PolygonGeometryUpdaterSpec.js b/Specs/DataSources/PolygonGeometryUpdaterSpec.js
index 88563b464b76..1e87f87d4d5a 100644
--- a/Specs/DataSources/PolygonGeometryUpdaterSpec.js
+++ b/Specs/DataSources/PolygonGeometryUpdaterSpec.js
@@ -14,8 +14,8 @@ defineSuite([
'Scene/PrimitiveCollection',
'Specs/createDynamicGeometryUpdaterSpecs',
'Specs/createDynamicProperty',
- 'Specs/createGeometryUpdaterSpecs',
'Specs/createGeometryUpdaterGroundGeometrySpecs',
+ 'Specs/createGeometryUpdaterSpecs',
'Specs/createScene'
], function(
PolygonGeometryUpdater,
@@ -33,8 +33,8 @@ defineSuite([
PrimitiveCollection,
createDynamicGeometryUpdaterSpecs,
createDynamicProperty,
- createGeometryUpdaterSpecs,
createGeometryUpdaterGroundGeometrySpecs,
+ createGeometryUpdaterSpecs,
createScene) {
'use strict';
diff --git a/Specs/DataSources/PolylineVisualizerSpec.js b/Specs/DataSources/PolylineVisualizerSpec.js
index cc41610a21bb..b213f638c184 100644
--- a/Specs/DataSources/PolylineVisualizerSpec.js
+++ b/Specs/DataSources/PolylineVisualizerSpec.js
@@ -1,61 +1,61 @@
defineSuite([
- 'DataSources/PolylineVisualizer',
- 'Core/BoundingSphere',
- 'Core/Cartesian3',
- 'Core/Color',
- 'Core/ColorGeometryInstanceAttribute',
- 'Core/JulianDate',
- 'Core/ShowGeometryInstanceAttribute',
- 'DataSources/BoundingSphereState',
- 'DataSources/CallbackProperty',
- 'DataSources/ColorMaterialProperty',
- 'DataSources/ConstantPositionProperty',
- 'DataSources/ConstantProperty',
- 'DataSources/Entity',
- 'DataSources/EntityCollection',
- 'DataSources/PolylineArrowMaterialProperty',
- 'DataSources/PolylineGeometryUpdater',
- 'DataSources/PolylineGraphics',
- 'DataSources/SampledProperty',
- 'DataSources/StaticGeometryColorBatch',
- 'DataSources/StaticGeometryPerMaterialBatch',
- 'DataSources/StaticGroundGeometryColorBatch',
- 'DataSources/StaticOutlineGeometryBatch',
- 'Scene/PolylineColorAppearance',
- 'Scene/PolylineMaterialAppearance',
- 'Scene/ShadowMode',
- 'Specs/createDynamicProperty',
- 'Specs/createScene',
- 'Specs/pollToPromise'
-], function(
- PolylineVisualizer,
- BoundingSphere,
- Cartesian3,
- Color,
- ColorGeometryInstanceAttribute,
- JulianDate,
- ShowGeometryInstanceAttribute,
- BoundingSphereState,
- CallbackProperty,
- ColorMaterialProperty,
- ConstantPositionProperty,
- ConstantProperty,
- Entity,
- EntityCollection,
- PolylineArrowMaterialProperty,
- PolylineGeometryUpdater,
- PolylineGraphics,
- SampledProperty,
- StaticGeometryColorBatch,
- StaticGeometryPerMaterialBatch,
- StaticGroundGeometryColorBatch,
- StaticOutlineGeometryBatch,
- PolylineColorAppearance,
- PolylineMaterialAppearance,
- ShadowMode,
- createDynamicProperty,
- createScene,
- pollToPromise) {
+ 'DataSources/PolylineVisualizer',
+ 'Core/BoundingSphere',
+ 'Core/Cartesian3',
+ 'Core/Color',
+ 'Core/ColorGeometryInstanceAttribute',
+ 'Core/JulianDate',
+ 'Core/ShowGeometryInstanceAttribute',
+ 'DataSources/BoundingSphereState',
+ 'DataSources/CallbackProperty',
+ 'DataSources/ColorMaterialProperty',
+ 'DataSources/ConstantPositionProperty',
+ 'DataSources/ConstantProperty',
+ 'DataSources/Entity',
+ 'DataSources/EntityCollection',
+ 'DataSources/PolylineArrowMaterialProperty',
+ 'DataSources/PolylineGeometryUpdater',
+ 'DataSources/PolylineGraphics',
+ 'DataSources/SampledProperty',
+ 'DataSources/StaticGeometryColorBatch',
+ 'DataSources/StaticGeometryPerMaterialBatch',
+ 'DataSources/StaticGroundGeometryColorBatch',
+ 'DataSources/StaticOutlineGeometryBatch',
+ 'Scene/PolylineColorAppearance',
+ 'Scene/PolylineMaterialAppearance',
+ 'Scene/ShadowMode',
+ 'Specs/createDynamicProperty',
+ 'Specs/createScene',
+ 'Specs/pollToPromise'
+ ], function(
+ PolylineVisualizer,
+ BoundingSphere,
+ Cartesian3,
+ Color,
+ ColorGeometryInstanceAttribute,
+ JulianDate,
+ ShowGeometryInstanceAttribute,
+ BoundingSphereState,
+ CallbackProperty,
+ ColorMaterialProperty,
+ ConstantPositionProperty,
+ ConstantProperty,
+ Entity,
+ EntityCollection,
+ PolylineArrowMaterialProperty,
+ PolylineGeometryUpdater,
+ PolylineGraphics,
+ SampledProperty,
+ StaticGeometryColorBatch,
+ StaticGeometryPerMaterialBatch,
+ StaticGroundGeometryColorBatch,
+ StaticOutlineGeometryBatch,
+ PolylineColorAppearance,
+ PolylineMaterialAppearance,
+ ShadowMode,
+ createDynamicProperty,
+ createScene,
+ pollToPromise) {
'use strict';
var time = JulianDate.now();
diff --git a/Specs/DataSources/RectangleGeometryUpdaterSpec.js b/Specs/DataSources/RectangleGeometryUpdaterSpec.js
index 4cf3474bc57a..2608b931511f 100644
--- a/Specs/DataSources/RectangleGeometryUpdaterSpec.js
+++ b/Specs/DataSources/RectangleGeometryUpdaterSpec.js
@@ -11,8 +11,8 @@ defineSuite([
'Scene/PrimitiveCollection',
'Specs/createDynamicGeometryUpdaterSpecs',
'Specs/createDynamicProperty',
- 'Specs/createGeometryUpdaterSpecs',
'Specs/createGeometryUpdaterGroundGeometrySpecs',
+ 'Specs/createGeometryUpdaterSpecs',
'Specs/createScene'
], function(
RectangleGeometryUpdater,
@@ -27,8 +27,8 @@ defineSuite([
PrimitiveCollection,
createDynamicGeometryUpdaterSpecs,
createDynamicProperty,
- createGeometryUpdaterSpecs,
createGeometryUpdaterGroundGeometrySpecs,
+ createGeometryUpdaterSpecs,
createScene) {
'use strict';
diff --git a/Specs/DataSources/StaticGeometryColorBatchSpec.js b/Specs/DataSources/StaticGeometryColorBatchSpec.js
index 728ee85ad96a..58c4749896af 100644
--- a/Specs/DataSources/StaticGeometryColorBatchSpec.js
+++ b/Specs/DataSources/StaticGeometryColorBatchSpec.js
@@ -1,31 +1,31 @@
defineSuite([
- 'DataSources/StaticGeometryColorBatch',
- 'Core/Cartesian3',
- 'Core/Color',
- 'Core/JulianDate',
- 'DataSources/CallbackProperty',
- 'DataSources/EllipseGeometryUpdater',
- 'DataSources/Entity',
- 'DataSources/PolylineGeometryUpdater',
- 'Scene/PerInstanceColorAppearance',
- 'Scene/PolylineColorAppearance',
- 'Scene/ShadowMode',
- 'Specs/createScene',
- 'Specs/pollToPromise'
-], function(
- StaticGeometryColorBatch,
- Cartesian3,
- Color,
- JulianDate,
- CallbackProperty,
- EllipseGeometryUpdater,
- Entity,
- PolylineGeometryUpdater,
- PerInstanceColorAppearance,
- PolylineColorAppearance,
- ShadowMode,
- createScene,
- pollToPromise) {
+ 'DataSources/StaticGeometryColorBatch',
+ 'Core/Cartesian3',
+ 'Core/Color',
+ 'Core/JulianDate',
+ 'DataSources/CallbackProperty',
+ 'DataSources/EllipseGeometryUpdater',
+ 'DataSources/Entity',
+ 'DataSources/PolylineGeometryUpdater',
+ 'Scene/PerInstanceColorAppearance',
+ 'Scene/PolylineColorAppearance',
+ 'Scene/ShadowMode',
+ 'Specs/createScene',
+ 'Specs/pollToPromise'
+ ], function(
+ StaticGeometryColorBatch,
+ Cartesian3,
+ Color,
+ JulianDate,
+ CallbackProperty,
+ EllipseGeometryUpdater,
+ Entity,
+ PolylineGeometryUpdater,
+ PerInstanceColorAppearance,
+ PolylineColorAppearance,
+ ShadowMode,
+ createScene,
+ pollToPromise) {
'use strict';
var time = JulianDate.now();
diff --git a/Specs/DataSources/StaticGeometryPerMaterialBatchSpec.js b/Specs/DataSources/StaticGeometryPerMaterialBatchSpec.js
index 0dabe8dcbe96..95fe083d9a27 100644
--- a/Specs/DataSources/StaticGeometryPerMaterialBatchSpec.js
+++ b/Specs/DataSources/StaticGeometryPerMaterialBatchSpec.js
@@ -1,41 +1,41 @@
defineSuite([
- 'DataSources/StaticGeometryPerMaterialBatch',
- 'Core/Cartesian3',
- 'Core/Color',
- 'Core/JulianDate',
- 'DataSources/ConstantPositionProperty',
- 'DataSources/ConstantProperty',
- 'DataSources/EllipseGeometryUpdater',
- 'DataSources/EllipseGraphics',
- 'DataSources/Entity',
- 'DataSources/GridMaterialProperty',
- 'DataSources/PolylineArrowMaterialProperty',
- 'DataSources/PolylineGeometryUpdater',
- 'DataSources/PolylineGraphics',
- 'Scene/MaterialAppearance',
- 'Scene/PolylineMaterialAppearance',
- 'Scene/ShadowMode',
- 'Specs/createScene',
- 'Specs/pollToPromise'
-], function(
- StaticGeometryPerMaterialBatch,
- Cartesian3,
- Color,
- JulianDate,
- ConstantPositionProperty,
- ConstantProperty,
- EllipseGeometryUpdater,
- EllipseGraphics,
- Entity,
- GridMaterialProperty,
- PolylineArrowMaterialProperty,
- PolylineGeometryUpdater,
- PolylineGraphics,
- MaterialAppearance,
- PolylineMaterialAppearance,
- ShadowMode,
- createScene,
- pollToPromise) {
+ 'DataSources/StaticGeometryPerMaterialBatch',
+ 'Core/Cartesian3',
+ 'Core/Color',
+ 'Core/JulianDate',
+ 'DataSources/ConstantPositionProperty',
+ 'DataSources/ConstantProperty',
+ 'DataSources/EllipseGeometryUpdater',
+ 'DataSources/EllipseGraphics',
+ 'DataSources/Entity',
+ 'DataSources/GridMaterialProperty',
+ 'DataSources/PolylineArrowMaterialProperty',
+ 'DataSources/PolylineGeometryUpdater',
+ 'DataSources/PolylineGraphics',
+ 'Scene/MaterialAppearance',
+ 'Scene/PolylineMaterialAppearance',
+ 'Scene/ShadowMode',
+ 'Specs/createScene',
+ 'Specs/pollToPromise'
+ ], function(
+ StaticGeometryPerMaterialBatch,
+ Cartesian3,
+ Color,
+ JulianDate,
+ ConstantPositionProperty,
+ ConstantProperty,
+ EllipseGeometryUpdater,
+ EllipseGraphics,
+ Entity,
+ GridMaterialProperty,
+ PolylineArrowMaterialProperty,
+ PolylineGeometryUpdater,
+ PolylineGraphics,
+ MaterialAppearance,
+ PolylineMaterialAppearance,
+ ShadowMode,
+ createScene,
+ pollToPromise) {
'use strict';
var time = JulianDate.now();
diff --git a/Specs/DataSources/StaticGroundGeometryColorBatchSpec.js b/Specs/DataSources/StaticGroundGeometryColorBatchSpec.js
index 97f12c9a4361..d114d32f5342 100644
--- a/Specs/DataSources/StaticGroundGeometryColorBatchSpec.js
+++ b/Specs/DataSources/StaticGroundGeometryColorBatchSpec.js
@@ -1,27 +1,27 @@
defineSuite([
- 'DataSources/StaticGroundGeometryColorBatch',
- 'Core/Color',
- 'Core/Cartesian3',
- 'Core/JulianDate',
- 'DataSources/CallbackProperty',
- 'DataSources/EllipseGeometryUpdater',
- 'DataSources/Entity',
- 'Scene/ClassificationType',
- 'Scene/GroundPrimitive',
- 'Specs/createScene',
- 'Specs/pollToPromise'
-], function(
- StaticGroundGeometryColorBatch,
- Color,
- Cartesian3,
- JulianDate,
- CallbackProperty,
- EllipseGeometryUpdater,
- Entity,
- ClassificationType,
- GroundPrimitive,
- createScene,
- pollToPromise) {
+ 'DataSources/StaticGroundGeometryColorBatch',
+ 'Core/Cartesian3',
+ 'Core/Color',
+ 'Core/JulianDate',
+ 'DataSources/CallbackProperty',
+ 'DataSources/EllipseGeometryUpdater',
+ 'DataSources/Entity',
+ 'Scene/ClassificationType',
+ 'Scene/GroundPrimitive',
+ 'Specs/createScene',
+ 'Specs/pollToPromise'
+ ], function(
+ StaticGroundGeometryColorBatch,
+ Cartesian3,
+ Color,
+ JulianDate,
+ CallbackProperty,
+ EllipseGeometryUpdater,
+ Entity,
+ ClassificationType,
+ GroundPrimitive,
+ createScene,
+ pollToPromise) {
'use strict';
var time = JulianDate.now();
diff --git a/Specs/DataSources/StaticOutlineGeometryBatchSpec.js b/Specs/DataSources/StaticOutlineGeometryBatchSpec.js
index 88f9ca62088c..feeaccd746ce 100644
--- a/Specs/DataSources/StaticOutlineGeometryBatchSpec.js
+++ b/Specs/DataSources/StaticOutlineGeometryBatchSpec.js
@@ -1,25 +1,25 @@
defineSuite([
- 'DataSources/StaticOutlineGeometryBatch',
- 'Core/Cartesian3',
- 'Core/Color',
- 'Core/JulianDate',
- 'DataSources/CallbackProperty',
- 'DataSources/EllipseGeometryUpdater',
- 'DataSources/Entity',
- 'Scene/ShadowMode',
- 'Specs/createScene',
- 'Specs/pollToPromise'
-], function(
- StaticOutlineGeometryBatch,
- Cartesian3,
- Color,
- JulianDate,
- CallbackProperty,
- EllipseGeometryUpdater,
- Entity,
- ShadowMode,
- createScene,
- pollToPromise) {
+ 'DataSources/StaticOutlineGeometryBatch',
+ 'Core/Cartesian3',
+ 'Core/Color',
+ 'Core/JulianDate',
+ 'DataSources/CallbackProperty',
+ 'DataSources/EllipseGeometryUpdater',
+ 'DataSources/Entity',
+ 'Scene/ShadowMode',
+ 'Specs/createScene',
+ 'Specs/pollToPromise'
+ ], function(
+ StaticOutlineGeometryBatch,
+ Cartesian3,
+ Color,
+ JulianDate,
+ CallbackProperty,
+ EllipseGeometryUpdater,
+ Entity,
+ ShadowMode,
+ createScene,
+ pollToPromise) {
'use strict';
var time = JulianDate.now();
diff --git a/Specs/Renderer/BuiltinFunctionsSpec.js b/Specs/Renderer/BuiltinFunctionsSpec.js
index 623bab8ff0e6..19545dd3bd0c 100644
--- a/Specs/Renderer/BuiltinFunctionsSpec.js
+++ b/Specs/Renderer/BuiltinFunctionsSpec.js
@@ -1,6 +1,7 @@
defineSuite([
'Core/BoundingRectangle',
'Core/Cartesian3',
+ 'Core/Cartesian4',
'Core/EncodedCartesian3',
'Specs/createCamera',
'Specs/createContext',
@@ -8,6 +9,7 @@ defineSuite([
], 'Renderer/BuiltinFunctions', function(
BoundingRectangle,
Cartesian3,
+ Cartesian4,
EncodedCartesian3,
createCamera,
createContext,
@@ -374,7 +376,20 @@ defineSuite([
' 0.0, 2.0, 0.0, 0.0,' +
' 0.0, 0.0, 2.0, 0.0,' +
' 0.0, 0.0, 0.0, 1.0);' +
- ' gl_FragColor = vec4(all(equal(czm_transformPlane(uniformScale2, vec4(1.0, 0.0, 0.0, 10.0)), vec4(1.0, 0.0, 0.0, 20.0))));' +
+ ' gl_FragColor = vec4(all(equal(czm_transformPlane(vec4(1.0, 0.0, 0.0, 10.0), uniformScale2), vec4(1.0, 0.0, 0.0, 20.0))));' +
+ '}';
+ expect({
+ context : context,
+ fragmentShader : fs
+ }).contextToRender();
+ });
+
+ it('has czm_unpackFloat', function() {
+ var packed = Cartesian4.packFloat(1);
+ var vec4 = 'vec4(' + packed.x + ', ' + packed.y + ', ' + packed.z + ', ' + packed.w + ')';
+ var fs =
+ 'void main() { ' +
+ ' gl_FragColor = vec4(czm_unpackFloat(' + vec4 + '));' +
'}';
expect({
context : context,
diff --git a/Specs/Renderer/freezeRenderStateSpec.js b/Specs/Renderer/freezeRenderStateSpec.js
index c12030f324c9..7be321a90428 100644
--- a/Specs/Renderer/freezeRenderStateSpec.js
+++ b/Specs/Renderer/freezeRenderStateSpec.js
@@ -1,7 +1,7 @@
defineSuite([
'Renderer/freezeRenderState'
- ], function(
- freezeRenderState) {
+ ], function(
+ freezeRenderState) {
'use strict';
it('works as expected', function() {
diff --git a/Specs/Scene/Batched3DModel3DTileContentClassificationSpec.js b/Specs/Scene/Batched3DModel3DTileContentClassificationSpec.js
index 79c3fb6f48ea..781642d877dc 100644
--- a/Specs/Scene/Batched3DModel3DTileContentClassificationSpec.js
+++ b/Specs/Scene/Batched3DModel3DTileContentClassificationSpec.js
@@ -1,5 +1,4 @@
defineSuite([
- 'Scene/Batched3DModel3DTileContent',
'Core/Cartesian3',
'Core/Cartographic',
'Core/Color',
@@ -14,13 +13,13 @@ defineSuite([
'Core/RectangleGeometry',
'Core/Transforms',
'Renderer/Pass',
+ 'Scene/Batched3DModel3DTileContent',
'Scene/ClassificationType',
'Scene/PerInstanceColorAppearance',
'Scene/Primitive',
'Specs/Cesium3DTilesTester',
'Specs/createScene'
], 'Scene/Batched3DModel3DTileContentClassification', function(
- Batched3DModel3DTileContent,
Cartesian3,
Cartographic,
Color,
@@ -35,6 +34,7 @@ defineSuite([
RectangleGeometry,
Transforms,
Pass,
+ Batched3DModel3DTileContent,
ClassificationType,
PerInstanceColorAppearance,
Primitive,
diff --git a/Specs/Scene/Batched3DModel3DTileContentSpec.js b/Specs/Scene/Batched3DModel3DTileContentSpec.js
index 5f2be35499d9..b1ac299a4efb 100644
--- a/Specs/Scene/Batched3DModel3DTileContentSpec.js
+++ b/Specs/Scene/Batched3DModel3DTileContentSpec.js
@@ -1,27 +1,27 @@
defineSuite([
'Scene/Batched3DModel3DTileContent',
'Core/Cartesian3',
- 'Core/ClippingPlane',
- 'Core/ClippingPlaneCollection',
'Core/Color',
'Core/HeadingPitchRange',
'Core/HeadingPitchRoll',
'Core/Transforms',
+ 'Scene/ClippingPlane',
+ 'Scene/ClippingPlaneCollection',
+ 'Scene/Model',
'Specs/Cesium3DTilesTester',
- 'Specs/createScene',
- 'Scene/Model'
+ 'Specs/createScene'
], function(
Batched3DModel3DTileContent,
Cartesian3,
- ClippingPlane,
- ClippingPlaneCollection,
Color,
HeadingPitchRange,
HeadingPitchRoll,
Transforms,
+ ClippingPlane,
+ ClippingPlaneCollection,
+ Model,
Cesium3DTilesTester,
- createScene,
- Model) {
+ createScene) {
'use strict';
var scene;
diff --git a/Specs/Scene/Cesium3DTilesetSpec.js b/Specs/Scene/Cesium3DTilesetSpec.js
index ce63efab7177..ce9f61a122cb 100644
--- a/Specs/Scene/Cesium3DTilesetSpec.js
+++ b/Specs/Scene/Cesium3DTilesetSpec.js
@@ -1,8 +1,6 @@
defineSuite([
'Scene/Cesium3DTileset',
'Core/Cartesian3',
- 'Core/ClippingPlane',
- 'Core/ClippingPlaneCollection',
'Core/Color',
'Core/CullingVolume',
'Core/getAbsoluteUri',
@@ -23,6 +21,8 @@ defineSuite([
'Scene/Cesium3DTileContentState',
'Scene/Cesium3DTileRefine',
'Scene/Cesium3DTileStyle',
+ 'Scene/ClippingPlane',
+ 'Scene/ClippingPlaneCollection',
'Scene/CullFace',
'Specs/Cesium3DTilesTester',
'Specs/createScene',
@@ -31,8 +31,6 @@ defineSuite([
], function(
Cesium3DTileset,
Cartesian3,
- ClippingPlane,
- ClippingPlaneCollection,
Color,
CullingVolume,
getAbsoluteUri,
@@ -53,6 +51,8 @@ defineSuite([
Cesium3DTileContentState,
Cesium3DTileRefine,
Cesium3DTileStyle,
+ ClippingPlane,
+ ClippingPlaneCollection,
CullFace,
Cesium3DTilesTester,
createScene,
diff --git a/Specs/Scene/ClassificationModelSpec.js b/Specs/Scene/ClassificationModelSpec.js
index d941c8a3e447..019ccb253803 100644
--- a/Specs/Scene/ClassificationModelSpec.js
+++ b/Specs/Scene/ClassificationModelSpec.js
@@ -18,9 +18,9 @@ defineSuite([
'Scene/ClassificationType',
'Scene/PerInstanceColorAppearance',
'Scene/Primitive',
- 'ThirdParty/GltfPipeline/parseBinaryGltf',
'Specs/createScene',
- 'Specs/pollToPromise'
+ 'Specs/pollToPromise',
+ 'ThirdParty/GltfPipeline/parseBinaryGltf'
], function(
ClassificationModel,
Cartesian3,
@@ -41,9 +41,9 @@ defineSuite([
ClassificationType,
PerInstanceColorAppearance,
Primitive,
- parseBinaryGltf,
createScene,
- pollToPromise) {
+ pollToPromise,
+ parseBinaryGltf) {
'use strict';
var scene;
diff --git a/Specs/Core/ClippingPlaneCollectionSpec.js b/Specs/Scene/ClippingPlaneCollectionSpec.js
similarity index 95%
rename from Specs/Core/ClippingPlaneCollectionSpec.js
rename to Specs/Scene/ClippingPlaneCollectionSpec.js
index 9c41233a59ce..f8e4c0d2434b 100644
--- a/Specs/Core/ClippingPlaneCollectionSpec.js
+++ b/Specs/Scene/ClippingPlaneCollectionSpec.js
@@ -1,22 +1,22 @@
defineSuite([
- 'Core/ClippingPlaneCollection',
+ 'Scene/ClippingPlaneCollection',
'Core/AttributeCompression',
'Core/BoundingSphere',
'Core/Cartesian2',
'Core/Cartesian3',
'Core/Cartesian4',
- 'Core/ClippingPlane',
'Core/Color',
- 'Core/Math',
- 'Core/PixelFormat',
- 'Renderer/PixelDatatype',
'Core/Intersect',
+ 'Core/Math',
'Core/Matrix4',
+ 'Core/PixelFormat',
'Core/Plane',
- 'Specs/createScene',
+ 'Renderer/PixelDatatype',
'Renderer/TextureMagnificationFilter',
'Renderer/TextureMinificationFilter',
- 'Renderer/TextureWrap'
+ 'Renderer/TextureWrap',
+ 'Scene/ClippingPlane',
+ 'Specs/createScene'
], function(
ClippingPlaneCollection,
AttributeCompression,
@@ -24,18 +24,18 @@ defineSuite([
Cartesian2,
Cartesian3,
Cartesian4,
- ClippingPlane,
Color,
- CesiumMath,
- PixelFormat,
- PixelDatatype,
Intersect,
+ CesiumMath,
Matrix4,
+ PixelFormat,
Plane,
- createScene,
+ PixelDatatype,
TextureMagnificationFilter,
TextureMinificationFilter,
- TextureWrap) {
+ TextureWrap,
+ ClippingPlane,
+ createScene) {
'use strict';
var clippingPlanes;
@@ -49,9 +49,7 @@ defineSuite([
function decodeUint8Plane(pixel1, pixel2) {
// expect pixel1 to be the normal
- var xOct16 = pixel1.x * 256 + pixel1.y;
- var yOct16 = pixel1.z * 256 + pixel1.w;
- var normal = AttributeCompression.octDecodeInRange(xOct16, yOct16, 65535, new Cartesian3());
+ var normal = AttributeCompression.octDecodeFromCartesian4(pixel1, new Cartesian3());
// expect pixel2 to be the distance
var distance = Cartesian4.unpackFloat(pixel2);
@@ -259,6 +257,9 @@ defineSuite([
// One RGBA uint8 clipping plane consume 2 pixels of texture, allocation to be double that
expect(packedTexture.width).toEqual(4);
expect(packedTexture.height).toEqual(1);
+
+ clippingPlanes.destroy();
+ scene.destroyForSpecs();
});
});
@@ -388,6 +389,9 @@ defineSuite([
// One RGBA float clipping plane consume 1 pixels of texture, allocation to be double that
expect(packedTexture.width).toEqual(2);
expect(packedTexture.height).toEqual(1);
+
+ clippingPlanes.destroy();
+ scene.destroyForSpecs();
});
});
@@ -454,7 +458,7 @@ defineSuite([
modelMatrix : transform
});
- ClippingPlaneCollection.setOwnership(clippingPlanes1, clippedObject1, 'clippingPlanes');
+ ClippingPlaneCollection.setOwner(clippingPlanes1, clippedObject1, 'clippingPlanes');
expect(clippedObject1.clippingPlanes).toBe(clippingPlanes1);
expect(clippingPlanes1._owner).toBe(clippedObject1);
@@ -466,16 +470,16 @@ defineSuite([
});
// Expect detached clipping planes to be destroyed
- ClippingPlaneCollection.setOwnership(clippingPlanes2, clippedObject1, 'clippingPlanes');
+ ClippingPlaneCollection.setOwner(clippingPlanes2, clippedObject1, 'clippingPlanes');
expect(clippingPlanes1.isDestroyed()).toBe(true);
// Expect setting the same ClippingPlaneCollection again to not destroy the ClippingPlaneCollection
- ClippingPlaneCollection.setOwnership(clippingPlanes2, clippedObject1, 'clippingPlanes');
+ ClippingPlaneCollection.setOwner(clippingPlanes2, clippedObject1, 'clippingPlanes');
expect(clippingPlanes2.isDestroyed()).toBe(false);
// Expect failure when attaching one ClippingPlaneCollection to two objects
expect(function() {
- ClippingPlaneCollection.setOwnership(clippingPlanes2, clippedObject2, 'clippingPlanes');
+ ClippingPlaneCollection.setOwner(clippingPlanes2, clippedObject2, 'clippingPlanes');
}).toThrowDeveloperError();
});
@@ -604,16 +608,16 @@ defineSuite([
clippingPlanes = new ClippingPlaneCollection();
clippingPlanes.add(new ClippingPlane(Cartesian3.UNIT_X, -1.0));
- expect(clippingPlanes.clippingPlanesState()).toEqual(-1);
+ expect(clippingPlanes.clippingPlanesState).toEqual(-1);
var holdThisPlane = new ClippingPlane(Cartesian3.UNIT_X, -1.0);
clippingPlanes.add(holdThisPlane);
- expect(clippingPlanes.clippingPlanesState()).toEqual(-2);
+ expect(clippingPlanes.clippingPlanesState).toEqual(-2);
clippingPlanes.unionClippingRegions = true;
- expect(clippingPlanes.clippingPlanesState()).toEqual(2);
+ expect(clippingPlanes.clippingPlanesState).toEqual(2);
clippingPlanes.remove(holdThisPlane);
- expect(clippingPlanes.clippingPlanesState()).toEqual(1);
+ expect(clippingPlanes.clippingPlanesState).toEqual(1);
});
});
diff --git a/Specs/Core/ClippingPlaneSpec.js b/Specs/Scene/ClippingPlaneSpec.js
similarity index 99%
rename from Specs/Core/ClippingPlaneSpec.js
rename to Specs/Scene/ClippingPlaneSpec.js
index 2aa6e569daf9..f21e3d3faddd 100644
--- a/Specs/Core/ClippingPlaneSpec.js
+++ b/Specs/Scene/ClippingPlaneSpec.js
@@ -1,5 +1,5 @@
defineSuite([
- 'Core/ClippingPlane',
+ 'Scene/ClippingPlane',
'Core/Cartesian3',
'Core/Math',
'Core/Matrix3',
diff --git a/Specs/Scene/CreditDisplaySpec.js b/Specs/Scene/CreditDisplaySpec.js
index d3ff7c240ab3..01c5ab94d95f 100644
--- a/Specs/Scene/CreditDisplaySpec.js
+++ b/Specs/Scene/CreditDisplaySpec.js
@@ -1,11 +1,11 @@
defineSuite([
'Scene/CreditDisplay',
- 'Core/defined',
- 'Core/Credit'
+ 'Core/Credit',
+ 'Core/defined'
], function(
CreditDisplay,
- defined,
- Credit) {
+ Credit,
+ defined) {
'use strict';
var container;
diff --git a/Specs/Scene/GlobeSurfaceTileProviderSpec.js b/Specs/Scene/GlobeSurfaceTileProviderSpec.js
index 380e907415ba..fd672b422cca 100644
--- a/Specs/Scene/GlobeSurfaceTileProviderSpec.js
+++ b/Specs/Scene/GlobeSurfaceTileProviderSpec.js
@@ -2,8 +2,6 @@ defineSuite([
'Scene/GlobeSurfaceTileProvider',
'Core/Cartesian3',
'Core/CesiumTerrainProvider',
- 'Core/ClippingPlane',
- 'Core/ClippingPlaneCollection',
'Core/Color',
'Core/Credit',
'Core/defined',
@@ -16,6 +14,8 @@ defineSuite([
'Renderer/ContextLimits',
'Renderer/RenderState',
'Scene/BlendingState',
+ 'Scene/ClippingPlane',
+ 'Scene/ClippingPlaneCollection',
'Scene/Fog',
'Scene/Globe',
'Scene/GlobeSurfaceShaderSet',
@@ -33,8 +33,6 @@ defineSuite([
GlobeSurfaceTileProvider,
Cartesian3,
CesiumTerrainProvider,
- ClippingPlane,
- ClippingPlaneCollection,
Color,
Credit,
defined,
@@ -47,6 +45,8 @@ defineSuite([
ContextLimits,
RenderState,
BlendingState,
+ ClippingPlane,
+ ClippingPlaneCollection,
Fog,
Globe,
GlobeSurfaceShaderSet,
diff --git a/Specs/Scene/GoogleEarthEnterpriseImageryProviderSpec.js b/Specs/Scene/GoogleEarthEnterpriseImageryProviderSpec.js
index ad3691309150..de5a89418d29 100644
--- a/Specs/Scene/GoogleEarthEnterpriseImageryProviderSpec.js
+++ b/Specs/Scene/GoogleEarthEnterpriseImageryProviderSpec.js
@@ -16,8 +16,8 @@ defineSuite([
'Scene/ImageryProvider',
'Scene/ImageryState',
'Specs/pollToPromise',
- 'ThirdParty/when',
- 'ThirdParty/Uri'
+ 'ThirdParty/Uri',
+ 'ThirdParty/when'
], function(
GoogleEarthEnterpriseImageryProvider,
decodeGoogleEarthEnterpriseData,
@@ -36,8 +36,8 @@ defineSuite([
ImageryProvider,
ImageryState,
pollToPromise,
- when,
- Uri) {
+ Uri,
+ when) {
'use strict';
beforeEach(function() {
diff --git a/Specs/Scene/Instanced3DModel3DTileContentSpec.js b/Specs/Scene/Instanced3DModel3DTileContentSpec.js
index 0da44e7f15e9..c5e409bdc083 100644
--- a/Specs/Scene/Instanced3DModel3DTileContentSpec.js
+++ b/Specs/Scene/Instanced3DModel3DTileContentSpec.js
@@ -1,27 +1,27 @@
defineSuite([
'Core/Cartesian3',
- 'Core/ClippingPlane',
- 'Core/ClippingPlaneCollection',
'Core/Color',
'Core/HeadingPitchRange',
'Core/HeadingPitchRoll',
'Core/Transforms',
+ 'Scene/ClippingPlane',
+ 'Scene/ClippingPlaneCollection',
+ 'Scene/Model',
'Scene/TileBoundingSphere',
'Specs/Cesium3DTilesTester',
- 'Specs/createScene',
- 'Scene/Model'
+ 'Specs/createScene'
], 'Scene/Instanced3DModel3DTileContent', function(
Cartesian3,
- ClippingPlane,
- ClippingPlaneCollection,
Color,
HeadingPitchRange,
HeadingPitchRoll,
Transforms,
+ ClippingPlane,
+ ClippingPlaneCollection,
+ Model,
TileBoundingSphere,
Cesium3DTilesTester,
- createScene,
- Model) {
+ createScene) {
'use strict';
var scene;
diff --git a/Specs/Scene/IonImageryProviderSpec.js b/Specs/Scene/IonImageryProviderSpec.js
index b1b8cd0e62fb..7f33c677d529 100644
--- a/Specs/Scene/IonImageryProviderSpec.js
+++ b/Specs/Scene/IonImageryProviderSpec.js
@@ -1,39 +1,39 @@
defineSuite([
- 'Scene/IonImageryProvider',
- 'Core/IonResource',
- 'Core/Credit',
- 'Core/defaultValue',
- 'Core/RequestScheduler',
- 'Core/Resource',
- 'Core/RuntimeError',
- 'Scene/ArcGisMapServerImageryProvider',
- 'Scene/BingMapsImageryProvider',
- 'Scene/GoogleEarthEnterpriseMapsProvider',
- 'Scene/ImageryProvider',
- 'Scene/MapboxImageryProvider',
- 'Scene/SingleTileImageryProvider',
- 'Scene/UrlTemplateImageryProvider',
- 'Scene/WebMapServiceImageryProvider',
- 'Scene/WebMapTileServiceImageryProvider',
- 'ThirdParty/when'
-], function(
- IonImageryProvider,
- IonResource,
- Credit,
- defaultValue,
- RequestScheduler,
- Resource,
- RuntimeError,
- ArcGisMapServerImageryProvider,
- BingMapsImageryProvider,
- GoogleEarthEnterpriseMapsProvider,
- ImageryProvider,
- MapboxImageryProvider,
- SingleTileImageryProvider,
- UrlTemplateImageryProvider,
- WebMapServiceImageryProvider,
- WebMapTileServiceImageryProvider,
- when) {
+ 'Scene/IonImageryProvider',
+ 'Core/Credit',
+ 'Core/defaultValue',
+ 'Core/IonResource',
+ 'Core/RequestScheduler',
+ 'Core/Resource',
+ 'Core/RuntimeError',
+ 'Scene/ArcGisMapServerImageryProvider',
+ 'Scene/BingMapsImageryProvider',
+ 'Scene/GoogleEarthEnterpriseMapsProvider',
+ 'Scene/ImageryProvider',
+ 'Scene/MapboxImageryProvider',
+ 'Scene/SingleTileImageryProvider',
+ 'Scene/UrlTemplateImageryProvider',
+ 'Scene/WebMapServiceImageryProvider',
+ 'Scene/WebMapTileServiceImageryProvider',
+ 'ThirdParty/when'
+ ], function(
+ IonImageryProvider,
+ Credit,
+ defaultValue,
+ IonResource,
+ RequestScheduler,
+ Resource,
+ RuntimeError,
+ ArcGisMapServerImageryProvider,
+ BingMapsImageryProvider,
+ GoogleEarthEnterpriseMapsProvider,
+ ImageryProvider,
+ MapboxImageryProvider,
+ SingleTileImageryProvider,
+ UrlTemplateImageryProvider,
+ WebMapServiceImageryProvider,
+ WebMapTileServiceImageryProvider,
+ when) {
'use strict';
function createTestProvider(endpointData) {
diff --git a/Specs/Scene/ModelSpec.js b/Specs/Scene/ModelSpec.js
index a8ee41ed6f18..ef402d3f9d58 100644
--- a/Specs/Scene/ModelSpec.js
+++ b/Specs/Scene/ModelSpec.js
@@ -3,8 +3,6 @@ defineSuite([
'Core/Cartesian3',
'Core/Cartesian4',
'Core/CesiumTerrainProvider',
- 'Core/ClippingPlane',
- 'Core/ClippingPlaneCollection',
'Core/Color',
'Core/combine',
'Core/defaultValue',
@@ -28,6 +26,8 @@ defineSuite([
'Renderer/RenderState',
'Renderer/ShaderSource',
'Scene/Axis',
+ 'Scene/ClippingPlane',
+ 'Scene/ClippingPlaneCollection',
'Scene/ColorBlendMode',
'Scene/DracoLoader',
'Scene/HeightReference',
@@ -40,8 +40,6 @@ defineSuite([
Cartesian3,
Cartesian4,
CesiumTerrainProvider,
- ClippingPlane,
- ClippingPlaneCollection,
Color,
combine,
defaultValue,
@@ -65,6 +63,8 @@ defineSuite([
RenderState,
ShaderSource,
Axis,
+ ClippingPlane,
+ ClippingPlaneCollection,
ColorBlendMode,
DracoLoader,
HeightReference,
diff --git a/Specs/Scene/PickSpec.js b/Specs/Scene/PickSpec.js
index e32eeb0d72c1..638b8e51b7f7 100644
--- a/Specs/Scene/PickSpec.js
+++ b/Specs/Scene/PickSpec.js
@@ -10,8 +10,8 @@ defineSuite([
'Scene/EllipsoidSurfaceAppearance',
'Scene/Primitive',
'Scene/SceneMode',
- 'Specs/createScene',
- 'Specs/createCanvas'
+ 'Specs/createCanvas',
+ 'Specs/createScene'
], 'Scene/Pick', function(
FeatureDetection,
GeometryInstance,
@@ -24,8 +24,8 @@ defineSuite([
EllipsoidSurfaceAppearance,
Primitive,
SceneMode,
- createScene,
- createCanvas) {
+ createCanvas,
+ createScene) {
'use strict';
var scene;
diff --git a/Specs/Scene/PointCloud3DTileContentSpec.js b/Specs/Scene/PointCloud3DTileContentSpec.js
index 2b5b31cc6cd2..bb4064d13c22 100644
--- a/Specs/Scene/PointCloud3DTileContentSpec.js
+++ b/Specs/Scene/PointCloud3DTileContentSpec.js
@@ -1,7 +1,5 @@
defineSuite([
'Core/Cartesian3',
- 'Core/ClippingPlane',
- 'Core/ClippingPlaneCollection',
'Core/Color',
'Core/ComponentDatatype',
'Core/defined',
@@ -13,6 +11,8 @@ defineSuite([
'Core/Transforms',
'Renderer/Pass',
'Scene/Cesium3DTileStyle',
+ 'Scene/ClippingPlane',
+ 'Scene/ClippingPlaneCollection',
'Scene/Expression',
'Specs/Cesium3DTilesTester',
'Specs/createCanvas',
@@ -20,8 +20,6 @@ defineSuite([
'ThirdParty/when'
], 'Scene/PointCloud3DTileContent', function(
Cartesian3,
- ClippingPlane,
- ClippingPlaneCollection,
Color,
ComponentDatatype,
defined,
@@ -33,6 +31,8 @@ defineSuite([
Transforms,
Pass,
Cesium3DTileStyle,
+ ClippingPlane,
+ ClippingPlaneCollection,
Expression,
Cesium3DTilesTester,
createCanvas,
diff --git a/Specs/Scene/PointCloudEyeDomeLightingSpec.js b/Specs/Scene/PointCloudEyeDomeLightingSpec.js
index f2d33a541e44..ceeb8da6113f 100644
--- a/Specs/Scene/PointCloudEyeDomeLightingSpec.js
+++ b/Specs/Scene/PointCloudEyeDomeLightingSpec.js
@@ -5,8 +5,8 @@ defineSuite([
'Core/HeadingPitchRange',
'Core/HeadingPitchRoll',
'Core/Math',
- 'Core/Transforms',
'Core/PerspectiveFrustum',
+ 'Core/Transforms',
'Scene/PointCloud3DTileContent',
'Scene/PointCloudEyeDomeLighting',
'Specs/Cesium3DTilesTester',
@@ -18,8 +18,8 @@ defineSuite([
HeadingPitchRange,
HeadingPitchRoll,
CesiumMath,
- Transforms,
PerspectiveFrustum,
+ Transforms,
PointCloud3DTileContent,
PointCloudEyeDomeLighting,
Cesium3DTilesTester,
diff --git a/Specs/Scene/SceneSpec.js b/Specs/Scene/SceneSpec.js
index 43783f889c5b..37e8ed40d8e2 100644
--- a/Specs/Scene/SceneSpec.js
+++ b/Specs/Scene/SceneSpec.js
@@ -1,4 +1,5 @@
defineSuite([
+ 'Scene/Scene',
'Core/BoundingSphere',
'Core/Cartesian2',
'Core/Cartesian3',
@@ -34,7 +35,6 @@ defineSuite([
'Scene/Material',
'Scene/Primitive',
'Scene/PrimitiveCollection',
- 'Scene/Scene',
'Scene/SceneTransforms',
'Scene/ScreenSpaceCameraController',
'Scene/TweenCollection',
@@ -42,7 +42,8 @@ defineSuite([
'Specs/createScene',
'Specs/pollToPromise',
'Specs/render'
- ], 'Scene/Scene', function(
+ ], function(
+ Scene,
BoundingSphere,
Cartesian2,
Cartesian3,
@@ -78,7 +79,6 @@ defineSuite([
Material,
Primitive,
PrimitiveCollection,
- Scene,
SceneTransforms,
ScreenSpaceCameraController,
TweenCollection,
diff --git a/Specs/Scene/createTileMapServiceImageryProviderSpec.js b/Specs/Scene/createTileMapServiceImageryProviderSpec.js
index cc3a7fed8711..01f0102362bd 100644
--- a/Specs/Scene/createTileMapServiceImageryProviderSpec.js
+++ b/Specs/Scene/createTileMapServiceImageryProviderSpec.js
@@ -1,43 +1,43 @@
defineSuite([
- 'Scene/createTileMapServiceImageryProvider',
- 'Core/Cartesian2',
- 'Core/Cartographic',
- 'Core/DefaultProxy',
- 'Core/GeographicProjection',
- 'Core/GeographicTilingScheme',
- 'Core/getAbsoluteUri',
- 'Core/Math',
- 'Core/Rectangle',
- 'Core/RequestScheduler',
- 'Core/Resource',
- 'Core/WebMercatorProjection',
- 'Core/WebMercatorTilingScheme',
- 'Scene/Imagery',
- 'Scene/ImageryLayer',
- 'Scene/ImageryState',
- 'Scene/UrlTemplateImageryProvider',
- 'Specs/pollToPromise',
- 'ThirdParty/when'
-], function(
- createTileMapServiceImageryProvider,
- Cartesian2,
- Cartographic,
- DefaultProxy,
- GeographicProjection,
- GeographicTilingScheme,
- getAbsoluteUri,
- CesiumMath,
- Rectangle,
- RequestScheduler,
- Resource,
- WebMercatorProjection,
- WebMercatorTilingScheme,
- Imagery,
- ImageryLayer,
- ImageryState,
- UrlTemplateImageryProvider,
- pollToPromise,
- when) {
+ 'Scene/createTileMapServiceImageryProvider',
+ 'Core/Cartesian2',
+ 'Core/Cartographic',
+ 'Core/DefaultProxy',
+ 'Core/GeographicProjection',
+ 'Core/GeographicTilingScheme',
+ 'Core/getAbsoluteUri',
+ 'Core/Math',
+ 'Core/Rectangle',
+ 'Core/RequestScheduler',
+ 'Core/Resource',
+ 'Core/WebMercatorProjection',
+ 'Core/WebMercatorTilingScheme',
+ 'Scene/Imagery',
+ 'Scene/ImageryLayer',
+ 'Scene/ImageryState',
+ 'Scene/UrlTemplateImageryProvider',
+ 'Specs/pollToPromise',
+ 'ThirdParty/when'
+ ], function(
+ createTileMapServiceImageryProvider,
+ Cartesian2,
+ Cartographic,
+ DefaultProxy,
+ GeographicProjection,
+ GeographicTilingScheme,
+ getAbsoluteUri,
+ CesiumMath,
+ Rectangle,
+ RequestScheduler,
+ Resource,
+ WebMercatorProjection,
+ WebMercatorTilingScheme,
+ Imagery,
+ ImageryLayer,
+ ImageryState,
+ UrlTemplateImageryProvider,
+ pollToPromise,
+ when) {
'use strict';
beforeEach(function() {
diff --git a/Specs/createDynamicGeometryUpdaterSpecs.js b/Specs/createDynamicGeometryUpdaterSpecs.js
index 76c46a32c180..e9278ba3fbe1 100644
--- a/Specs/createDynamicGeometryUpdaterSpecs.js
+++ b/Specs/createDynamicGeometryUpdaterSpecs.js
@@ -1,21 +1,21 @@
define([
- 'Core/BoundingSphere',
- 'Core/JulianDate',
- 'Core/Math',
- 'DataSources/BoundingSphereState',
- 'DataSources/EllipsoidGeometryUpdater',
- 'Scene/PrimitiveCollection',
- 'Specs/createDynamicProperty',
- 'Specs/pollToPromise'
-], function(
- BoundingSphere,
- JulianDate,
- CesiumMath,
- BoundingSphereState,
- EllipsoidGeometryUpdater,
- PrimitiveCollection,
- createDynamicProperty,
- pollToPromise) {
+ 'Core/BoundingSphere',
+ 'Core/JulianDate',
+ 'Core/Math',
+ 'DataSources/BoundingSphereState',
+ 'DataSources/EllipsoidGeometryUpdater',
+ 'Scene/PrimitiveCollection',
+ 'Specs/createDynamicProperty',
+ 'Specs/pollToPromise'
+ ], function(
+ BoundingSphere,
+ JulianDate,
+ CesiumMath,
+ BoundingSphereState,
+ EllipsoidGeometryUpdater,
+ PrimitiveCollection,
+ createDynamicProperty,
+ pollToPromise) {
'use strict';
function createDynamicGeometryUpdaterSpecs(Updater, geometryPropertyName, createDynamicEntity, getScene) {
diff --git a/Specs/createGeometryUpdaterGroundGeometrySpecs.js b/Specs/createGeometryUpdaterGroundGeometrySpecs.js
index 0380d6366733..79b5268e9340 100644
--- a/Specs/createGeometryUpdaterGroundGeometrySpecs.js
+++ b/Specs/createGeometryUpdaterGroundGeometrySpecs.js
@@ -1,21 +1,21 @@
define([
- 'Core/Color',
- 'Core/JulianDate',
- 'DataSources/ColorMaterialProperty',
- 'DataSources/ConstantProperty',
- 'DataSources/GridMaterialProperty',
- 'DataSources/SampledProperty',
- 'Scene/GroundPrimitive',
- 'Scene/PrimitiveCollection'
-], function(
- Color,
- JulianDate,
- ColorMaterialProperty,
- ConstantProperty,
- GridMaterialProperty,
- SampledProperty,
- GroundPrimitive,
- PrimitiveCollection) {
+ 'Core/Color',
+ 'Core/JulianDate',
+ 'DataSources/ColorMaterialProperty',
+ 'DataSources/ConstantProperty',
+ 'DataSources/GridMaterialProperty',
+ 'DataSources/SampledProperty',
+ 'Scene/GroundPrimitive',
+ 'Scene/PrimitiveCollection'
+ ], function(
+ Color,
+ JulianDate,
+ ColorMaterialProperty,
+ ConstantProperty,
+ GridMaterialProperty,
+ SampledProperty,
+ GroundPrimitive,
+ PrimitiveCollection) {
'use strict';
function createGeometryUpdaterGroundGeometrySpecs(Updater, geometryPropertyName, createEntity, createDynamicEntity, getScene) {
diff --git a/Specs/createGeometryUpdaterSpecs.js b/Specs/createGeometryUpdaterSpecs.js
index 827fe2cf105f..630384662e43 100644
--- a/Specs/createGeometryUpdaterSpecs.js
+++ b/Specs/createGeometryUpdaterSpecs.js
@@ -1,35 +1,35 @@
define([
- 'Core/Color',
- 'Core/ColorGeometryInstanceAttribute',
- 'Core/DistanceDisplayCondition',
- 'Core/DistanceDisplayConditionGeometryInstanceAttribute',
- 'Core/JulianDate',
- 'Core/ShowGeometryInstanceAttribute',
- 'Core/TimeInterval',
- 'DataSources/ColorMaterialProperty',
- 'DataSources/ConstantProperty',
- 'DataSources/EllipsoidGeometryUpdater',
- 'DataSources/Entity',
- 'DataSources/GridMaterialProperty',
- 'DataSources/SampledProperty',
- 'DataSources/TimeIntervalCollectionProperty',
- 'Scene/ShadowMode'
-], function(
- Color,
- ColorGeometryInstanceAttribute,
- DistanceDisplayCondition,
- DistanceDisplayConditionGeometryInstanceAttribute,
- JulianDate,
- ShowGeometryInstanceAttribute,
- TimeInterval,
- ColorMaterialProperty,
- ConstantProperty,
- EllipsoidGeometryUpdater,
- Entity,
- GridMaterialProperty,
- SampledProperty,
- TimeIntervalCollectionProperty,
- ShadowMode) {
+ 'Core/Color',
+ 'Core/ColorGeometryInstanceAttribute',
+ 'Core/DistanceDisplayCondition',
+ 'Core/DistanceDisplayConditionGeometryInstanceAttribute',
+ 'Core/JulianDate',
+ 'Core/ShowGeometryInstanceAttribute',
+ 'Core/TimeInterval',
+ 'DataSources/ColorMaterialProperty',
+ 'DataSources/ConstantProperty',
+ 'DataSources/EllipsoidGeometryUpdater',
+ 'DataSources/Entity',
+ 'DataSources/GridMaterialProperty',
+ 'DataSources/SampledProperty',
+ 'DataSources/TimeIntervalCollectionProperty',
+ 'Scene/ShadowMode'
+ ], function(
+ Color,
+ ColorGeometryInstanceAttribute,
+ DistanceDisplayCondition,
+ DistanceDisplayConditionGeometryInstanceAttribute,
+ JulianDate,
+ ShowGeometryInstanceAttribute,
+ TimeInterval,
+ ColorMaterialProperty,
+ ConstantProperty,
+ EllipsoidGeometryUpdater,
+ Entity,
+ GridMaterialProperty,
+ SampledProperty,
+ TimeIntervalCollectionProperty,
+ ShadowMode) {
'use strict';
function createGeometryUpdaterSpecs(Updater, geometryPropertyName, createEntity, getScene) {
diff --git a/Specs/spec-main.js b/Specs/spec-main.js
index 46c12265d79b..62db1ae04b4f 100644
--- a/Specs/spec-main.js
+++ b/Specs/spec-main.js
@@ -148,6 +148,19 @@
}, timeout, categories);
};
+ var originalFit = window.fit;
+
+ window.fit = function(description, f, timeout, categories) {
+ originalFit(description, function(done) {
+ var result = f();
+ when(result, function() {
+ done();
+ }, function(e) {
+ done.fail('promise rejected: ' + e.toString());
+ });
+ }, timeout, categories);
+ };
+
var originalBeforeEach = window.beforeEach;
window.beforeEach = function(f) {