Skip to content

Commit 5d50f4e

Browse files
committed
Merge branch 'master' into more-typescript
2 parents d974b40 + 2a9ca28 commit 5d50f4e

14 files changed

+100
-12
lines changed

CHANGES.md

+6-3
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,16 @@
55
##### Additions :tada:
66

77
- Add a `toString` method to the `Resource` class in case an instance gets logged as a string. [#8722](https://github.com/CesiumGS/cesium/issues/8722)
8+
- Exposed `Transforms.rotationMatrixFromPositionVelocity` method from Cesium's private API. [#8927](https://github.com/CesiumGS/cesium/issues/8927)
89

910
##### Fixes :wrench:
1011

11-
- Improved `MaterialProperty` JSDoc and TypeScript type definitions, which were missing the ability to take primitive types in addition to Property instances in their constructor.
12-
- Fixed `EllipsoidGeodesic` JSDoc and TypeScript type definitions which incorrectly listed `result` as required.
12+
- Improved `MaterialProperty` JSDoc and TypeScript type definitions, which were missing the ability to take primitive types in addition to Property instances in their constructor. [#8904](https://github.com/CesiumGS/cesium/pull/8904)
13+
- Fixed `EllipsoidGeodesic` JSDoc and TypeScript type definitions which incorrectly listed `result` as required. [#8904](https://github.com/CesiumGS/cesium/pull/8904)
1314
- Fixed a bug with handling of PixelFormat's flipY. [#8893](https://github.com/CesiumGS/cesium/pull/8893)
14-
- Fixed JSDoc and TypeScript type definitions for all `ImageryProvider` types, which were missing `defaultNightAlpha` and `defaultDayAlpha` properties.
15+
- Fixed JSDoc and TypeScript type definitions for all `ImageryProvider` types, which were missing `defaultNightAlpha` and `defaultDayAlpha` properties. [#8908](https://github.com/CesiumGS/cesium/pull/8908)
16+
- Fixed JSDoc and TypeScript type definitions for `EllipsoidTangentPlane.fromPoints`, which takes an array of `Cartesian3`, not a single instance. [#8928](https://github.com/CesiumGS/cesium/pull/8928)
17+
- Fixed JSDoc and TypeScript type definitions for `EntityCollection.getById` and `CompositeEntityCollection.getById`, which can both return undefined. [#8928](https://github.com/CesiumGS/cesium/pull/8928)
1518
- Fixed JSDoc and TypeScript type definitions for `Viewer` options parameter, which was incorrectly listed as required.
1619
- Fixed a memory leak where some 3D Tiles requests were being unintentionally retained after the requests were cancelled. [#8843](https://github.com/CesiumGS/cesium/pull/8843)
1720

CONTRIBUTORS.md

+4
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,8 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to contribute to Cesiu
148148
- [Joseph Stein](https://github.com/nahgrin)
149149
- [EOX IT Services GmbH](https://eox.at)
150150
- [Daniel Santillan](https://github.com/santilland)
151+
- [Navagis, Inc.](https://navagis.com/)
152+
- [Jonathan Nogueira](https://github.com/LuminousPath)
151153

152154
## [Individual CLA](Documentation/Contributors/CLAs/individual-contributor-license-agreement-v1.0.pdf)
153155

@@ -260,3 +262,5 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to contribute to Cesiu
260262
- [Edvinas Pranka](https://github.com/epranka)
261263
- [James Bromwell](https://github.com/thw0rted)
262264
- [Brandon Nguyen](https://github.com/bn-dignitas)
265+
- [Wang Bao](https://github.com/xiaobaogeit)
266+
- [John Remsberg](https://github.com/easternmotors)

Source/Core/EllipsoidTangentPlane.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ var tmp = new AxisAlignedBoundingBox();
135135
* Creates a new instance from the provided ellipsoid and the center
136136
* point of the provided Cartesians.
137137
*
138-
* @param {Cartesian3} cartesians The list of positions surrounding the center point.
138+
* @param {Cartesian3[]} cartesians The list of positions surrounding the center point.
139139
* @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid to use.
140140
*/
141141
EllipsoidTangentPlane.fromPoints = function (cartesians, ellipsoid) {

Source/Core/Rectangle.js

+2
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ Object.defineProperties(Rectangle.prototype, {
5757
* Gets the width of the rectangle in radians.
5858
* @memberof Rectangle.prototype
5959
* @type {Number}
60+
* @readonly
6061
*/
6162
width: {
6263
get: function () {
@@ -68,6 +69,7 @@ Object.defineProperties(Rectangle.prototype, {
6869
* Gets the height of the rectangle in radians.
6970
* @memberof Rectangle.prototype
7071
* @type {Number}
72+
* @readonly
7173
*/
7274
height: {
7375
get: function () {

Source/Core/Transforms.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -949,7 +949,13 @@ var rightScratch = new Cartesian3();
949949
var upScratch = new Cartesian3();
950950

951951
/**
952-
* @private
952+
* Transform a position and velocity to a rotation matrix.
953+
*
954+
* @param {Cartesian3} position The position to transform.
955+
* @param {Cartesian3} velocity The velocity vector to transform.
956+
* @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid whose fixed frame is used in the transformation.
957+
* @param {Matrix3} [result] The object onto which to store the result.
958+
* @returns {Matrix3} The modified result parameter or a new Matrix3 instance if none was provided.
953959
*/
954960
Transforms.rotationMatrixFromPositionVelocity = function (
955961
position,

Source/Core/buildModuleUrl.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import Resource from "./Resource.js";
55

66
/*global CESIUM_BASE_URL*/
77

8-
var cesiumScriptRegex = /((?:.*\/)|^)Cesium\.js$/;
8+
var cesiumScriptRegex = /((?:.*\/)|^)Cesium\.js(?:\?|\#|$)/;
99
function getBaseUrlFromCesiumScript() {
1010
var scripts = document.getElementsByTagName("script");
1111
for (var i = 0, len = scripts.length; i < len; ++i) {

Source/DataSources/CompositeEntityCollection.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ CompositeEntityCollection.prototype.computeAvailability = function () {
463463
* Gets an entity with the specified id.
464464
*
465465
* @param {String} id The id of the entity to retrieve.
466-
* @returns {Entity} The entity with the provided id or undefined if the id did not exist in the collection.
466+
* @returns {Entity|undefined} The entity with the provided id or undefined if the id did not exist in the collection.
467467
*/
468468
CompositeEntityCollection.prototype.getById = function (id) {
469469
return this._composite.getById(id);

Source/DataSources/EntityCollection.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ EntityCollection.prototype.removeAll = function () {
397397
* Gets an entity with the specified id.
398398
*
399399
* @param {String} id The id of the entity to retrieve.
400-
* @returns {Entity} The entity with the provided id or undefined if the id did not exist in the collection.
400+
* @returns {Entity|undefined} The entity with the provided id or undefined if the id did not exist in the collection.
401401
*/
402402
EntityCollection.prototype.getById = function (id) {
403403
//>>includeStart('debug', pragmas.debug);

Source/Widgets/CesiumWidget/CesiumWidget.js

+7
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,7 @@ Object.defineProperties(CesiumWidget.prototype, {
393393
* @memberof CesiumWidget.prototype
394394
*
395395
* @type {Element}
396+
* @readonly
396397
*/
397398
container: {
398399
get: function () {
@@ -405,6 +406,7 @@ Object.defineProperties(CesiumWidget.prototype, {
405406
* @memberof CesiumWidget.prototype
406407
*
407408
* @type {HTMLCanvasElement}
409+
* @readonly
408410
*/
409411
canvas: {
410412
get: function () {
@@ -417,6 +419,7 @@ Object.defineProperties(CesiumWidget.prototype, {
417419
* @memberof CesiumWidget.prototype
418420
*
419421
* @type {Element}
422+
* @readonly
420423
*/
421424
creditContainer: {
422425
get: function () {
@@ -429,6 +432,7 @@ Object.defineProperties(CesiumWidget.prototype, {
429432
* @memberof CesiumWidget.prototype
430433
*
431434
* @type {Element}
435+
* @readonly
432436
*/
433437
creditViewport: {
434438
get: function () {
@@ -441,6 +445,7 @@ Object.defineProperties(CesiumWidget.prototype, {
441445
* @memberof CesiumWidget.prototype
442446
*
443447
* @type {Scene}
448+
* @readonly
444449
*/
445450
scene: {
446451
get: function () {
@@ -494,6 +499,7 @@ Object.defineProperties(CesiumWidget.prototype, {
494499
* @memberof CesiumWidget.prototype
495500
*
496501
* @type {Clock}
502+
* @readonly
497503
*/
498504
clock: {
499505
get: function () {
@@ -506,6 +512,7 @@ Object.defineProperties(CesiumWidget.prototype, {
506512
* @memberof CesiumWidget.prototype
507513
*
508514
* @type {ScreenSpaceEventHandler}
515+
* @readonly
509516
*/
510517
screenSpaceEventHandler: {
511518
get: function () {

Source/Widgets/Viewer/Viewer.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,8 @@ function enableVRUI(viewer, enabled) {
235235
* @property {ProviderViewModel[]} [terrainProviderViewModels=createDefaultTerrainProviderViewModels()] The array of ProviderViewModels to be selectable from the BaseLayerPicker. This value is only valid if `baseLayerPicker` is set to true.
236236
* @property {ImageryProvider} [imageryProvider=createWorldImagery()] The imagery provider to use. This value is only valid if `baseLayerPicker` is set to false.
237237
* @property {TerrainProvider} [terrainProvider=new EllipsoidTerrainProvider()] The terrain provider to use
238-
* @property {SkyBox} [skyBox] The skybox used to render the stars. When <code>undefined</code>, the default stars are used.
239-
* @property {SkyAtmosphere} [skyAtmosphere] Blue sky, and the glow around the Earth's limb. Set to <code>false</code> to turn it off.
238+
* @property {SkyBox|false} [skyBox] The skybox used to render the stars. When <code>undefined</code>, the default stars are used. If set to <code>false</code>, no skyBox, Sun, or Moon will be added.
239+
* @property {SkyAtmosphere|false} [skyAtmosphere] Blue sky, and the glow around the Earth's limb. Set to <code>false</code> to turn it off.
240240
* @property {Element|String} [fullscreenElement=document.body] The element or id to be placed into fullscreen mode when the full screen button is pressed.
241241
* @property {Boolean} [useDefaultRenderLoop=true] True if this widget should control the render loop, false otherwise.
242242
* @property {Number} [targetFrameRate] The target frame rate when using the default render loop.

Specs/Core/TransformsSpec.js

+53
Original file line numberDiff line numberDiff line change
@@ -1716,6 +1716,59 @@ describe("Core/Transforms", function () {
17161716
expect(returnedResult).toEqualEpsilon(expected, CesiumMath.EPSILON12);
17171717
});
17181718

1719+
it("rotationMatrixFromPositionVelocity works without a result parameter", function () {
1720+
var matrix = Transforms.rotationMatrixFromPositionVelocity(
1721+
Cartesian3.UNIT_X,
1722+
Cartesian3.UNIT_Y
1723+
);
1724+
var expected = new Matrix3(0, 0, 1, 1, 0, 0, 0, 1, 0);
1725+
expect(matrix).toEqualEpsilon(expected, CesiumMath.EPSILON14);
1726+
1727+
matrix = Transforms.rotationMatrixFromPositionVelocity(
1728+
Cartesian3.UNIT_X,
1729+
Cartesian3.UNIT_Z
1730+
);
1731+
expected = new Matrix3(0, 0, 1, 0, -1, 0, 1, 0, 0);
1732+
expect(matrix).toEqualEpsilon(expected, CesiumMath.EPSILON14);
1733+
1734+
matrix = Transforms.rotationMatrixFromPositionVelocity(
1735+
Cartesian3.UNIT_Y,
1736+
Cartesian3.UNIT_Z
1737+
);
1738+
expected = new Matrix3(0, 1, 0, 0, 0, 1, 1, 0, 0);
1739+
expect(matrix).toEqualEpsilon(expected, CesiumMath.EPSILON14);
1740+
});
1741+
1742+
it("rotationMatrixFromPositionVelocity works with a result parameter", function () {
1743+
var result = new Matrix3();
1744+
Transforms.rotationMatrixFromPositionVelocity(
1745+
Cartesian3.UNIT_X,
1746+
Cartesian3.UNIT_Y,
1747+
Ellipsoid.WGS84,
1748+
result
1749+
);
1750+
var expected = new Matrix3(0, 0, 1, 1, 0, 0, 0, 1, 0);
1751+
expect(result).toEqualEpsilon(expected, CesiumMath.EPSILON14);
1752+
1753+
Transforms.rotationMatrixFromPositionVelocity(
1754+
Cartesian3.UNIT_X,
1755+
Cartesian3.UNIT_Z,
1756+
Ellipsoid.WGS84,
1757+
result
1758+
);
1759+
expected = new Matrix3(0, 0, 1, 0, -1, 0, 1, 0, 0);
1760+
expect(result).toEqualEpsilon(expected, CesiumMath.EPSILON14);
1761+
1762+
Transforms.rotationMatrixFromPositionVelocity(
1763+
Cartesian3.UNIT_Y,
1764+
Cartesian3.UNIT_Z,
1765+
Ellipsoid.WGS84,
1766+
result
1767+
);
1768+
expected = new Matrix3(0, 1, 0, 0, 0, 1, 1, 0, 0);
1769+
expect(result).toEqualEpsilon(expected, CesiumMath.EPSILON14);
1770+
});
1771+
17191772
it("basisTo2D projects translation", function () {
17201773
var ellipsoid = Ellipsoid.WGS84;
17211774
var projection = new GeographicProjection(ellipsoid);

Specs/Core/buildModuleUrlSpec.js

+13
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,25 @@ describe("Core/buildModuleUrl", function () {
1717
var r = buildModuleUrl._cesiumScriptRegex;
1818

1919
expect(r.exec("Cesium.js")[1]).toEqual("");
20+
expect(r.exec("Cesium.js?v=1.7")[1]).toEqual("");
2021
expect(r.exec("assets/foo/Cesium.js")[1]).toEqual("assets/foo/");
22+
expect(r.exec("assets/foo/Cesium.js?v=1.7")[1]).toEqual("assets/foo/");
2123
expect(
2224
r.exec("http://example.invalid/Cesium/assets/foo/Cesium.js")[1]
2325
).toEqual("http://example.invalid/Cesium/assets/foo/");
26+
expect(
27+
r.exec("http://example.invalid/Cesium/assets/foo/Cesium.js?v=1.7")[1]
28+
).toEqual("http://example.invalid/Cesium/assets/foo/");
2429

30+
expect(r.exec("cesium.js")).toBeNull();
31+
expect(r.exec("Cesium.js%20")).toBeNull();
32+
expect(r.exec("Cesium.min.js")).toBeNull();
33+
expect(r.exec("CesiumSomething.js")).toBeNull();
34+
expect(r.exec("CesiumSomething.js?v=1.7")).toBeNull();
2535
expect(r.exec("assets/foo/bar.cesium.js")).toBeNull();
36+
expect(r.exec("assets/foo/bar.cesium.js?v=1.7")).toBeNull();
37+
expect(r.exec("assets/foo/CesiumSomething.js")).toBeNull();
38+
expect(r.exec("assets/foo/CesiumSomething.js?v=1.7")).toBeNull();
2639
});
2740

2841
it("CESIUM_BASE_URL works with trailing slash", function () {

Specs/TypeScript/tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
"strict": true
66
},
77
"include": [
8-
"../.."
8+
"../../Source"
99
],
1010
}

gulpfile.cjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1310,7 +1310,7 @@ function combineJavaScript(options) {
13101310
}
13111311

13121312
function glslToJavaScript(minify, minifyStateFilePath) {
1313-
fs.writeFileSync(minifyStateFilePath, minify);
1313+
fs.writeFileSync(minifyStateFilePath, minify.toString());
13141314
var minifyStateFileLastModified = fs.existsSync(minifyStateFilePath)
13151315
? fs.statSync(minifyStateFilePath).mtime.getTime()
13161316
: 0;

0 commit comments

Comments
 (0)