Skip to content

Commit

Permalink
Merge branch 'master' into wasm
Browse files Browse the repository at this point in the history
  • Loading branch information
ggetz committed Apr 23, 2018
2 parents 696e191 + 0df9363 commit bb60b41
Show file tree
Hide file tree
Showing 129 changed files with 1,952 additions and 598 deletions.
4 changes: 2 additions & 2 deletions Apps/Sandcastle/gallery/Imagery Layers Texture Filters.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@
layers.removeAll();

var layerLinear = layers.addImageryProvider(Cesium.createTileMapServiceImageryProvider({
url : require.toUrl('Assets/Textures/NaturalEarthII')
url : Cesium.buildModuleUrl('Assets/Textures/NaturalEarthII')
}));

var layerNearest = layers.addImageryProvider(Cesium.createTileMapServiceImageryProvider({
url : require.toUrl('Assets/Textures/NaturalEarthII')
url : Cesium.buildModuleUrl('Assets/Textures/NaturalEarthII')
}));

// Set the texture minification and magnification filters of layerNearest. Default is LINEAR.
Expand Down
13 changes: 12 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,16 @@ Change Log
### 1.45 - 2018-05-01

##### Additions :tada:
* Improved `MapboxImageryProvider` performance by 300% via `tiles.mapbox.com` subdomain switching. [#6426](https://github.com/AnalyticalGraphicsInc/cesium/issues/6426)
* Added `IonGeocoderService` and made it the default geocoding service for the `Geocoder` widget.
* Added option `logarithmicDepthBuffer` to `Scene`. With this option there is typically a single frustum using logarithmic depth rendered. This increases performance by issuing less draw calls to the GPU and helps to avoid artifacts on the connection of two frustums. [#5851](https://github.com/AnalyticalGraphicsInc/cesium/pull/5851)
* When a log depth buffer is supported, the frustum near and far planes default to `0.1` and `1e10` respectively.
* Added `Math.log2` to compute the base 2 logarithm of a number.
* Added 'PeliasGeocoderService', which provides geocoding via a [Pelias](https://pelias.io) server.
* Added `GeocodeType` enum and use it as an optional parameter to all `GeocoderService` instances to differentiate between autocomplete and search requests.
* Added `initWebAssemblyModule` function to `TaskProcessor` to load a Web Assembly module in a web worker. [#6420](https://github.com/AnalyticalGraphicsInc/cesium/pull/6420)
* Added `supportsWebAssembly` function to `FeatureDetection` to check if a browser supports loading Web Assembly modules. [#6420](https://github.com/AnalyticalGraphicsInc/cesium/pull/6420)
* Improved `MapboxImageryProvider` performance by 300% via `tiles.mapbox.com` subdomain switching. [#6426](https://github.com/AnalyticalGraphicsInc/cesium/issues/6426)
* Added ability to invoke `sampleTerrain` from node.js to enable offline terrain sampling

##### Fixes :wrench:
* Fixed bugs in `TimeIntervalCollection.removeInterval`. [#6418](https://github.com/AnalyticalGraphicsInc/cesium/pull/6418).
Expand All @@ -17,6 +24,10 @@ Change Log
* `GroundPrimitive`s and `ClassificationPrimitive`s will become ready when `show` is `false`. [#6428](https://github.com/AnalyticalGraphicsInc/cesium/pull/6428)
* Fix Firefox WebGL console warnings. [#5912](https://github.com/AnalyticalGraphicsInc/cesium/issues/5912)
* Fix parsing Cesium.js in older browsers that do not support all TypedArray types. [#6396](https://github.com/AnalyticalGraphicsInc/cesium/pull/6396)
* Fixed a bug causing crashes when setting colors on un-pickable models. [$6442](https://github.com/AnalyticalGraphicsInc/cesium/issues/6442)
* Fix flicker when adding, removing, or modifying entities. [#3945](https://github.com/AnalyticalGraphicsInc/cesium/issues/3945)
* Fixed crash bug in PolylineCollection when a polyline was updated and removed at the same time. [#6455](https://github.com/AnalyticalGraphicsInc/cesium/pull/6455)
* Fixed Imagery Layers Texture Filters Sandcastle example. [#6472](https://github.com/AnalyticalGraphicsInc/cesium/pull/6472).

### 1.44 - 2018-04-02

Expand Down
5 changes: 5 additions & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to contribute to Cesiu
* [Dave Whipps](https://github.com/dwhipps)
* [Geoscan](https://www.geoscan.aero)
* [Andrey Orlov](https://github.com/AndreyOrlov)
* [George Vinokhodov](https://github.com/Vineg)
* [The Imagineers](https://www.theimagineers.com/)
* [Heerco Grond](https://github.com/HeercoGrond)
* [Camptocamp SA](https://www.camptocamp.com/)
Expand Down Expand Up @@ -102,6 +103,8 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to contribute to Cesiu
* [Natanael Rivera](https://github.com/nrivera-Novetta/)
* [Justin Burr](https://github.com/jburr-nc/)
* [Jeremy Marzano](https://github.com/JeremyMarzano-ISPA/)
* [Orbit Logic](http://www.orbitlogic.com)
* [Roderick Green](https://github.com/roderickgreen/)

## [Individual CLA](Documentation/Contributors/CLAs/individual-cla-agi-v1.0.txt)
* [Victor Berchet](https://github.com/vicb)
Expand Down Expand Up @@ -174,3 +177,5 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to contribute to Cesiu
* [Tamar Cohen](https://github.com/tamarmot)
* [Stephen Wiseman](https://github.com/srwiseman)
* [Gabriel Macario](https://github.com/gabriel-macario)
* [Jonathan Puckey](https://github.com/puckey)
* [Mark Erikson](https://github.com/markerikson)
4 changes: 0 additions & 4 deletions Source/Core/EllipseGeometry.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,9 @@ define([
'./IndexDatatype',
'./Math',
'./Matrix3',
'./Matrix4',
'./PrimitiveType',
'./Quaternion',
'./Rectangle',
'./Transforms',
'./VertexFormat'
], function(
BoundingSphere,
Expand All @@ -46,11 +44,9 @@ define([
IndexDatatype,
CesiumMath,
Matrix3,
Matrix4,
PrimitiveType,
Quaternion,
Rectangle,
Transforms,
VertexFormat) {
'use strict';

Expand Down
9 changes: 9 additions & 0 deletions Source/Core/FeatureDetection.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,14 @@ define([
return isFirefox() && firefoxVersionResult;
}

var isNodeJsResult;
function isNodeJs() {
if (!defined(isNodeJsResult)) {
isNodeJsResult = typeof process === 'object' && Object.prototype.toString.call(process) === '[object process]'; // eslint-disable-line
}
return isNodeJsResult;
}

var hasPointerEvents;
function supportsPointerEvents() {
if (!defined(hasPointerEvents)) {
Expand Down Expand Up @@ -230,6 +238,7 @@ define([
isFirefox : isFirefox,
firefoxVersion : firefoxVersion,
isWindows : isWindows,
isNodeJs: isNodeJs,
hardwareConcurrency : defaultValue(theNavigator.hardwareConcurrency, 3),
supportsPointerEvents : supportsPointerEvents,
supportsImageRenderingPixelated: supportsImageRenderingPixelated,
Expand Down
32 changes: 32 additions & 0 deletions Source/Core/GeocodeType.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
define([
'../Core/freezeObject'
], function(
freezeObject) {
'use strict';

/**
* The type of geocoding to be performed by a {@link GeocoderService}.
* @exports GeocodeType
* @see Geocoder
*/
var GeocodeType = {
/**
* Perform a search where the input is considered complete.
*
* @type {Number}
* @constant
*/
SEARCH: 0,

/**
* Perform an auto-complete using partial input, typically
* reserved for providing possible results as a user is typing.
*
* @type {Number}
* @constant
*/
AUTOCOMPLETE: 1
};

return freezeObject(GeocodeType);
});
2 changes: 2 additions & 0 deletions Source/Core/GeocoderService.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ define([
* @constructor
*
* @see BingMapsGeocoderService
* @see PeliasGeocoderService
*/
function GeocoderService() {
}
Expand All @@ -25,6 +26,7 @@ define([
* @function
*
* @param {String} query The query to be sent to the geocoder service
* @param {GeocodeType} [type=GeocodeType.SEARCH] The type of geocode to perform.
* @returns {Promise<GeocoderResult[]>}
*/
GeocoderService.prototype.geocode = DeveloperError.throwInstantiationError;
Expand Down
2 changes: 0 additions & 2 deletions Source/Core/GoogleEarthEnterpriseMetadata.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
define([
'../ThirdParty/google-earth-dbroot-parser',
'../ThirdParty/when',
'./appendForwardSlash',
'./Check',
'./Credit',
'./defaultValue',
Expand All @@ -17,7 +16,6 @@ define([
], function(
dbrootParser,
when,
appendForwardSlash,
Check,
Credit,
defaultValue,
Expand Down
64 changes: 64 additions & 0 deletions Source/Core/IonGeocoderService.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
define([
'./Check',
'./defaultValue',
'./defined',
'./defineProperties',
'./Ion',
'./PeliasGeocoderService',
'./Rectangle',
'./Resource'
], function (
Check,
defaultValue,
defined,
defineProperties,
Ion,
PeliasGeocoderService,
Rectangle,
Resource) {
'use strict';

/**
* Provides geocoding through Cesium ion.
* @alias IonGeocoderService
* @constructor
*
* @param {Object} [options] Object with the following properties:
* @param {String} [options.accessToken=Ion.defaultAccessToken] The access token to use.
* @param {String|Resource} [options.server=Ion.defaultServer] The resource to the Cesium ion API server.
*
* @see Ion
*/
function IonGeocoderService(options) {
options = defaultValue(options, defaultValue.EMPTY_OBJECT);

var accessToken = defaultValue(options.accessToken, Ion.defaultAccessToken);
var server = Resource.createIfNeeded(defaultValue(options.server, Ion.defaultServer));
server.appendForwardSlash();

var searchEndpoint = server.getDerivedResource({
url: 'v1/geocode'
});

if (defined(accessToken)) {
searchEndpoint.appendQueryParameters({ access_token: accessToken });
}

this._accessToken = accessToken;
this._server = server;
this._pelias = new PeliasGeocoderService(searchEndpoint);
}

/**
* @function
*
* @param {String} query The query to be sent to the geocoder service
* @param {GeocodeType} [type=GeocodeType.SEARCH] The type of geocode to perform.
* @returns {Promise<GeocoderResult[]>}
*/
IonGeocoderService.prototype.geocode = function (query, geocodeType) {
return this._pelias.geocode(query, geocodeType);
};

return IonGeocoderService;
});
58 changes: 29 additions & 29 deletions Source/Core/Math.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,16 +195,14 @@ define([
* @param {Number} value The value to return the sign of.
* @returns {Number} The sign of value.
*/
CesiumMath.sign = function(value) {
if (value > 0) {
return 1;
CesiumMath.sign = defaultValue(Math.sign, function sign(value) {
value = +value; // coerce to number
if (value === 0 || value !== value) {
// zero or NaN
return value;
}
if (value < 0) {
return -1;
}

return 0;
};
return value > 0 ? 1 : -1;
});

/**
* Returns 1.0 if the given value is positive or zero, and -1.0 if it is negative.
Expand Down Expand Up @@ -264,12 +262,9 @@ define([
* @param {Number} value The number whose hyperbolic sine is to be returned.
* @returns {Number} The hyperbolic sine of <code>value</code>.
*/
CesiumMath.sinh = function(value) {
var part1 = Math.pow(Math.E, value);
var part2 = Math.pow(Math.E, -1.0 * value);

return (part1 - part2) * 0.5;
};
CesiumMath.sinh = defaultValue(Math.sinh, function sinh(value) {
return (Math.exp(value) - Math.exp(-value)) / 2.0;
});

/**
* Returns the hyperbolic cosine of a number.
Expand All @@ -290,12 +285,9 @@ define([
* @param {Number} value The number whose hyperbolic cosine is to be returned.
* @returns {Number} The hyperbolic cosine of <code>value</code>.
*/
CesiumMath.cosh = function(value) {
var part1 = Math.pow(Math.E, value);
var part2 = Math.pow(Math.E, -1.0 * value);

return (part1 + part2) * 0.5;
};
CesiumMath.cosh = defaultValue(Math.cosh, function cosh(value) {
return (Math.exp(value) + Math.exp(-value)) / 2.0;
});

/**
* Computes the linear interpolation of two values.
Expand Down Expand Up @@ -334,7 +326,7 @@ define([
* @type {Number}
* @constant
*/
CesiumMath.PI_OVER_TWO = Math.PI * 0.5;
CesiumMath.PI_OVER_TWO = Math.PI / 2.0;

/**
* pi/3
Expand Down Expand Up @@ -366,7 +358,7 @@ define([
* @type {Number}
* @constant
*/
CesiumMath.THREE_PI_OVER_TWO = (3.0 * Math.PI) * 0.5;
CesiumMath.THREE_PI_OVER_TWO = 3.0 * Math.PI / 2.0;

/**
* 2pi
Expand Down Expand Up @@ -835,19 +827,27 @@ define([
return Math.log(number) / Math.log(base);
};

function cbrt(number) {
var result = Math.pow(Math.abs(number), 1.0 / 3.0);
return number < 0.0 ? -result : result;
}

/**
* Finds the cube root of a number.
* Returns NaN if <code>number</code> is not provided.
*
* @param {Number} [number] The number.
* @returns {Number} The result.
*/
CesiumMath.cbrt = defined(Math.cbrt) ? Math.cbrt : cbrt;
CesiumMath.cbrt = defaultValue(Math.cbrt, function cbrt(number) {
var result = Math.pow(Math.abs(number), 1.0 / 3.0);
return number < 0.0 ? -result : result;
});

/**
* Finds the base 2 logarithm of a number.
*
* @param {Number} number The number.
* @returns {Number} The result.
*/
CesiumMath.log2 = defaultValue(Math.log2, function log2(number) {
return Math.log(number) * Math.LOG2E;
});

/**
* @private
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/OrthographicFrustum.js
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ define([
* @returns {Boolean} <code>true</code> if they are equal, <code>false</code> otherwise.
*/
OrthographicFrustum.prototype.equals = function(other) {
if (!defined(other)) {
if (!defined(other) || !(other instanceof OrthographicFrustum)) {
return false;
}

Expand Down
2 changes: 1 addition & 1 deletion Source/Core/OrthographicOffCenterFrustum.js
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ define([
* @returns {Boolean} <code>true</code> if they are equal, <code>false</code> otherwise.
*/
OrthographicOffCenterFrustum.prototype.equals = function(other) {
return (defined(other) &&
return (defined(other) && other instanceof OrthographicOffCenterFrustum &&
this.right === other.right &&
this.left === other.left &&
this.top === other.top &&
Expand Down
Loading

0 comments on commit bb60b41

Please sign in to comment.