Skip to content

Commit

Permalink
Merge branch 'main' into tileset-get-height
Browse files Browse the repository at this point in the history
  • Loading branch information
ggetz committed Jan 9, 2024
2 parents dace85b + 6e8b5d8 commit 0ba6172
Show file tree
Hide file tree
Showing 18 changed files with 693 additions and 147 deletions.
64 changes: 64 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: deploy
on:
push:
branches-ignore:
- 'cesium.com'
- production
concurrency:
group: deploy-${{ github.ref }}
cancel-in-progress: true
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
statuses: write
contents: read
env:
BUILD_VERSION: ${{ github.ref_name }}.${{ github.run_number }}
AWS_ACCESS_KEY_ID: ${{ secrets.DEV_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.DEV_AWS_SECRET_ACCESS_KEY }}
AWS_REGION: us-east-1
BRANCH: ${{ github.ref_name }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_REPO: ${{ github.repository }}
GITHUB_SHA: ${{ github.sha }}
steps:
- uses: actions/checkout@v3
- name: install node 20
uses: actions/setup-node@v3
with:
node-version: '20'
- name: npm install
run: npm install
- name: set the version in package.json
run: npm run deploy-set-version -- --buildVersion $BUILD_VERSION
- name: create release zip
run: npm run make-zip
- name: package cesium module
run: npm pack &> /dev/null
- name: package workspace modules
run: npm pack --workspaces &> /dev/null
- name: build apps
run: npm run build-apps
- uses: ./.github/actions/verify-package
- name: deploy to s3
if: ${{ env.AWS_ACCESS_KEY_ID != '' }}
run: |
aws s3 sync . s3://cesium-public-builds/cesium/$BRANCH/ \
--cache-control "no-cache" \
--exclude ".git/*" \
--exclude ".concierge/*" \
--exclude ".github/*" \
--exclude ".husky/*" \
--exclude ".vscode/*" \
--exclude "Build/Coverage/*" \
--exclude "Build/CesiumDev/*" \
--exclude "Build/Specs/e2e" \
--exclude "Documentation/*" \
--exclude "node_modules/*" \
--exclude "scripts/*" \
--exclude "Tools/*" \
--delete
- name: set status
if: ${{ env.AWS_ACCESS_KEY_ID != '' }}
run: npm run deploy-status -- --status success --message Deployed
74 changes: 10 additions & 64 deletions .github/workflows/dev.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: dev
on:
push:
branches-ignore:
- 'cesium.com'
- production
branches:
- main
pull_request:
concurrency:
group: ${{ github.ref }}
group: dev-${{ github.ref }}
cancel-in-progress: true
jobs:
lint:
Expand Down Expand Up @@ -33,10 +33,10 @@ jobs:
BRANCH: ${{ github.ref_name }}
steps:
- uses: actions/checkout@v3
- name: install node 18
- name: install node 20
uses: actions/setup-node@v3
with:
node-version: '18'
node-version: '20'
- name: npm install
run: npm install
- name: build
Expand All @@ -50,73 +50,19 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: install node 18
- name: install node 20
uses: actions/setup-node@v3
with:
node-version: '18'
node-version: '20'
- name: npm install
run: npm install
- name: release build
run: npm run build-release
run: npm run make-zip
- name: release tests (chrome)
run: npm run test -- --browsers ChromeHeadless --failTaskOnError --webgl-stub --release --suppressPassed
- name: cloc
run: npm run cloc
deploy:
runs-on: ubuntu-latest
permissions:
statuses: write
contents: read
env:
BUILD_VERSION: ${{ github.ref_name }}.${{ github.run_number }}
AWS_ACCESS_KEY_ID: ${{ secrets.DEV_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.DEV_AWS_SECRET_ACCESS_KEY }}
AWS_REGION: us-east-1
BRANCH: ${{ github.ref_name }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_REPO: ${{ github.repository }}
GITHUB_SHA: ${{ github.sha }}
steps:
- uses: actions/checkout@v3
- name: install node 18
uses: actions/setup-node@v3
with:
node-version: '18'
- name: npm install
run: npm install
- name: set the version in package.json
run: npm run deploy-set-version -- --buildVersion $BUILD_VERSION
- name: create release zip
run: npm run make-zip
- name: package cesium module
run: npm pack &> /dev/null
- name: package workspace modules
run: npm pack --workspaces &> /dev/null
- name: build apps
run: npm run build-apps
- uses: ./.github/actions/verify-package
- name: deploy to s3
if: ${{ env.AWS_ACCESS_KEY_ID != '' }}
run: |
aws s3 sync . s3://cesium-public-builds/cesium/$BRANCH/ \
--cache-control "no-cache" \
--exclude ".git/*" \
--exclude ".concierge/*" \
--exclude ".github/*" \
--exclude ".husky/*" \
--exclude ".vscode/*" \
--exclude "Build/Coverage/*" \
--exclude "Build/CesiumDev/*" \
--exclude "Build/Specs/e2e" \
--exclude "Documentation/*" \
--exclude "node_modules/*" \
--exclude "scripts/*" \
--exclude "Tools/*" \
--delete
- name: set status
if: ${{ env.AWS_ACCESS_KEY_ID != '' }}
run: npm run deploy-status -- --status success --message Deployed
node-16:
node-18:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: main
on:
workflow_run:
workflows: [dev]
workflows: [dev, prod]
types: [completed]
branches:
- main
Expand Down
10 changes: 10 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,20 @@

- Added `Cesium3DTileset.getHeight` to sample height values of the loaded tiles. If using WebGL 1, the `enablePick` option must be set to true to use this function. [#11581](https://github.com/CesiumGS/cesium/pull/11581)
- Added `Cesium3DTileset.disableCameraCollision` to allow the camera from to go inside or below a 3D tileset, for instance, to be used with 3D Tiles interiors. [#11581](https://github.com/CesiumGS/cesium/pull/11581)
- The `Cesium3DTileset.dynamicScreenSpaceError` optimization is now enabled by default, as this improves performance for street-level horizon views. Furthermore, the default settings of this feature were tuned for improved performance. `Cesium3DTileset.dynamicScreenSpaceErrorDensity` was changed from 0.00278 to 0.0002. `Cesium3DTileset.dynamicScreenSpaceErrorFactor` was changed from 4 to 24. [#11718](https://github.com/CesiumGS/cesium/pull/11718)

##### Fixes :wrench:

- Fixed a bug where the `Cesium3DTileset` constructor was ignoring the options `dynamicScreenSpaceError`, `dynamicScreenSpaceErrorDensity`, `dynamicScreenSpaceErrorFactor` and `dynamicScreenSpaceErrorHeightFalloff`. [#11677](https://github.com/CesiumGS/cesium/issues/11677)
- Fix globe materials when lighting is false. Slope/Aspect material no longer rely on turning on lighting or shadows. [#11563](https://github.com/CesiumGS/cesium/issues/11563)
- Fixed a bug where `GregorianDate` constructor would not validate the input parameters for valid date. [#10075](https://github.com/CesiumGS/cesium/pull/10075)
- Fixed improper scaling of ellipsoid inner radii in 3D mode. [#11656](https://github.com/CesiumGS/cesium/issues/11656 and [#10245](https://github.com/CesiumGS/cesium/issues/10245)

#### @cesium/widgets

##### Fixes :wrench:

- Fixed a bug where the 3D Tiles Inspector's `dynamicScreenSpaceErrorDensity` slider did not update the tileset [#6143](https://github.com/CesiumGS/cesium/issues/6143)

### 1.113 - 2024-01-02

Expand Down
3 changes: 3 additions & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -372,3 +372,6 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to contribute to Cesiu
- [KOBAYASHI Ittoku](https://github.com/kittoku)
- [王康](https://github.com/yieryi)
- [孙永政](https://github.com/syzdev)
- [Subhajit Saha](https://github.com/subhajits)
- [Jared Webber](https://github.com/jaredwebber)
- [Anne Gropler](https://github.com/anne-gropler)
2 changes: 1 addition & 1 deletion packages/engine/LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright 2011-2022 CesiumJS Contributors
Copyright 2011-2024 CesiumJS Contributors

Apache License
Version 2.0, January 2004
Expand Down
85 changes: 85 additions & 0 deletions packages/engine/Source/Core/GregorianDate.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
import Check from "./Check.js";
import defaultValue from "./defaultValue.js";
import DeveloperError from "./DeveloperError.js";
import isLeapYear from "./isLeapYear.js";

const daysInYear = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];

/**
* Represents a Gregorian date in a more precise format than the JavaScript Date object.
* In addition to submillisecond precision, this object can also represent leap seconds.
Expand Down Expand Up @@ -25,6 +32,27 @@ function GregorianDate(
millisecond,
isLeapSecond
) {
const minimumYear = 1;
const minimumMonth = 1;
const minimumDay = 1;
const minimumHour = 0;
const minimumMinute = 0;
const minimumSecond = 0;
const minimumMillisecond = 0;

year = defaultValue(year, minimumYear);
month = defaultValue(month, minimumMonth);
day = defaultValue(day, minimumDay);
hour = defaultValue(hour, minimumHour);
minute = defaultValue(minute, minimumMinute);
second = defaultValue(second, minimumSecond);
millisecond = defaultValue(millisecond, minimumMillisecond);
isLeapSecond = defaultValue(isLeapSecond, false);
//>>includeStart('debug', pragmas.debug);
validateRange();
validateDate();
//>>includeEnd('debug');

/**
* Gets or sets the year as a whole number.
* @type {number}
Expand Down Expand Up @@ -65,5 +93,62 @@ function GregorianDate(
* @type {boolean}
*/
this.isLeapSecond = isLeapSecond;

function validateRange() {
const maximumYear = 9999;
const maximumMonth = 12;
const maximumDay = 31;
const maximumHour = 23;
const maximumMinute = 59;
const maximumSecond = 59;
const excludedMaximumMilisecond = 1000;

Check.typeOf.number.greaterThanOrEquals("Year", year, minimumYear);
Check.typeOf.number.lessThanOrEquals("Year", year, maximumYear);

Check.typeOf.number.greaterThanOrEquals("Month", month, minimumMonth);
Check.typeOf.number.lessThanOrEquals("Month", month, maximumMonth);

Check.typeOf.number.greaterThanOrEquals("Day", day, minimumDay);
Check.typeOf.number.lessThanOrEquals("Day", day, maximumDay);

Check.typeOf.number.greaterThanOrEquals("Hour", hour, minimumHour);
Check.typeOf.number.lessThanOrEquals("Hour", hour, maximumHour);

Check.typeOf.number.greaterThanOrEquals("Minute", minute, minimumMinute);
Check.typeOf.number.lessThanOrEquals("Minute", minute, maximumMinute);

Check.typeOf.bool("IsLeapSecond", isLeapSecond);

Check.typeOf.number.greaterThanOrEquals("Second", second, minimumSecond);
Check.typeOf.number.lessThanOrEquals(
"Second",
second,
isLeapSecond ? maximumSecond + 1 : maximumSecond
);

Check.typeOf.number.greaterThanOrEquals(
"Millisecond",
millisecond,
minimumMillisecond
);
Check.typeOf.number.lessThan(
"Millisecond",
millisecond,
excludedMaximumMilisecond
);
}

// Javascript date object supports only dates greater than 1901. Thus validating with custom logic
function validateDate() {
const daysInMonth =
month === 2 && isLeapYear(year)
? daysInYear[month - 1] + 1
: daysInYear[month - 1];

if (day > daysInMonth) {
throw new DeveloperError("Month and Day represents invalid date");
}
}
}
export default GregorianDate;
Original file line number Diff line number Diff line change
Expand Up @@ -547,11 +547,10 @@ DynamicEllipsoidGeometryUpdater.prototype.update = function (time) {
options.radii = Cartesian3.clone(in3D ? unitSphere : radii, options.radii);
if (defined(innerRadii)) {
if (in3D) {
const mag = Cartesian3.magnitude(radii);
options.innerRadii = Cartesian3.fromElements(
innerRadii.x / mag,
innerRadii.y / mag,
innerRadii.z / mag,
innerRadii.x / radii.x,
innerRadii.y / radii.y,
innerRadii.z / radii.z,
options.innerRadii
);
} else {
Expand Down
Loading

0 comments on commit 0ba6172

Please sign in to comment.