Skip to content

Commit

Permalink
Merge branch 'cla-checking-final' of https://github.com/CesiumGS/cesium
Browse files Browse the repository at this point in the history
… into cla-checking-final
  • Loading branch information
siddheshranade committed Feb 5, 2024
2 parents 77d0a7f + 242c99a commit 1fb9710
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 30 deletions.
20 changes: 10 additions & 10 deletions Apps/Sandcastle/gallery/Camera Tutorial.html
Original file line number Diff line number Diff line change
Expand Up @@ -103,19 +103,19 @@
flags.looking = false;
}, Cesium.ScreenSpaceEventType.LEFT_UP);

function getFlagForKeyCode(keyCode) {
switch (keyCode) {
case "W".charCodeAt(0):
function getFlagForKeyCode(code) {
switch (code) {
case "KeyW":
return "moveForward";
case "S".charCodeAt(0):
case "KeyS":
return "moveBackward";
case "Q".charCodeAt(0):
case "KeyQ":
return "moveUp";
case "E".charCodeAt(0):
case "KeyE":
return "moveDown";
case "D".charCodeAt(0):
case "KeyD":
return "moveRight";
case "A".charCodeAt(0):
case "KeyA":
return "moveLeft";
default:
return undefined;
Expand All @@ -125,7 +125,7 @@
document.addEventListener(
"keydown",
function (e) {
const flagName = getFlagForKeyCode(e.keyCode);
const flagName = getFlagForKeyCode(e.code);
if (typeof flagName !== "undefined") {
flags[flagName] = true;
}
Expand All @@ -136,7 +136,7 @@
document.addEventListener(
"keyup",
function (e) {
const flagName = getFlagForKeyCode(e.keyCode);
const flagName = getFlagForKeyCode(e.code);
if (typeof flagName !== "undefined") {
flags[flagName] = false;
}
Expand Down
10 changes: 5 additions & 5 deletions Apps/Sandcastle/gallery/HeadingPitchRoll.html
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,8 @@ <h1>Loading...</h1>
});

document.addEventListener("keydown", function (e) {
switch (e.keyCode) {
case 40:
switch (e.code) {
case "ArrowDown":
if (e.shiftKey) {
// speed down
speed = Math.max(--speed, 1);
Expand All @@ -183,7 +183,7 @@ <h1>Loading...</h1>
}
}
break;
case 38:
case "ArrowUp":
if (e.shiftKey) {
// speed up
speed = Math.min(++speed, 100);
Expand All @@ -195,7 +195,7 @@ <h1>Loading...</h1>
}
}
break;
case 39:
case "ArrowRight":
if (e.shiftKey) {
// roll right
hpRoll.roll += deltaRadians;
Expand All @@ -210,7 +210,7 @@ <h1>Loading...</h1>
}
}
break;
case 37:
case "ArrowLeft":
if (e.shiftKey) {
// roll left until
hpRoll.roll -= deltaRadians;
Expand Down
16 changes: 8 additions & 8 deletions Apps/Sandcastle/gallery/Imagery Cutout.html
Original file line number Diff line number Diff line change
Expand Up @@ -111,15 +111,15 @@
moveSouth: false,
};

function getFlagForKeyCode(keyCode) {
switch (keyCode) {
case "W".charCodeAt(0):
function getFlagForKeyCode(code) {
switch (code) {
case "KeyW":
return "moveNorth";
case "S".charCodeAt(0):
case "KeyS":
return "moveSouth";
case "D".charCodeAt(0):
case "KeyD":
return "moveEast";
case "A".charCodeAt(0):
case "KeyA":
return "moveWest";
default:
return undefined;
Expand All @@ -129,7 +129,7 @@
document.addEventListener(
"keydown",
function (e) {
const flagName = getFlagForKeyCode(e.keyCode);
const flagName = getFlagForKeyCode(e.code);
if (typeof flagName !== "undefined") {
flags[flagName] = true;
}
Expand All @@ -140,7 +140,7 @@
document.addEventListener(
"keyup",
function (e) {
const flagName = getFlagForKeyCode(e.keyCode);
const flagName = getFlagForKeyCode(e.code);
if (typeof flagName !== "undefined") {
flags[flagName] = false;
}
Expand Down
10 changes: 5 additions & 5 deletions Apps/Sandcastle/gallery/LocalToFixedFrame.html
Original file line number Diff line number Diff line change
Expand Up @@ -196,22 +196,22 @@ <h1>Loading...</h1>
});

document.addEventListener("keydown", function (e) {
switch (e.keyCode) {
case 40:
switch (e.code) {
case "ArrowDown":
// pitch down
hpRoll.pitch -= deltaRadians;
if (hpRoll.pitch < -Cesium.Math.TWO_PI) {
hpRoll.pitch += Cesium.Math.TWO_PI;
}
break;
case 38:
case "ArrowUp":
// pitch up
hpRoll.pitch += deltaRadians;
if (hpRoll.pitch > Cesium.Math.TWO_PI) {
hpRoll.pitch -= Cesium.Math.TWO_PI;
}
break;
case 39:
case "ArrowRight":
if (e.shiftKey) {
// roll right
hpRoll.roll += deltaRadians;
Expand All @@ -226,7 +226,7 @@ <h1>Loading...</h1>
}
}
break;
case 37:
case "ArrowLeft":
if (e.shiftKey) {
// roll left until
hpRoll.roll -= deltaRadians;
Expand Down
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
- The `EntityCollection#add` method was documented to throw a `DeveloperError` for duplicate IDs, but did throw a `RuntimeError` in this case. This is now changed to throw a `DeveloperError`. [#11776](https://github.com/CesiumGS/cesium/pull/11776)
- Parts of the documentation have been updated to resolve potential issues with the generated TypedScript definitions. [#11776](https://github.com/CesiumGS/cesium/pull/11776)
- Fixed type definition for `Camera.constrainedAxis`. [#11475](https://github.com/CesiumGS/cesium/issues/11475)
- Fixed a geometry displacement on iOS devices that was caused by NaN value in `czm_translateRelativeToEye` function. [#7100](https://github.com/CesiumGS/cesium/issues/7100)

#### @cesium/widgets

Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -377,3 +377,4 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to contribute to Cesiu
- [Jared Webber](https://github.com/jaredwebber)
- [Anne Gropler](https://github.com/anne-gropler)
- [Harsh Lakhara](https://github.com/harshlakhara)
- [Pavlo Skakun](https://github.com/p-skakun)
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@
vec4 czm_translateRelativeToEye(vec3 high, vec3 low)
{
vec3 highDifference = high - czm_encodedCameraPositionMCHigh;
// This check handles the case when NaN values have gotten into `highDifference`.
// Such a thing could happen on devices running iOS.
if (length(highDifference) == 0.0) {
highDifference = vec3(0);
}
vec3 lowDifference = low - czm_encodedCameraPositionMCLow;

return vec4(highDifference + lowDifference, 1.0);
Expand Down
4 changes: 2 additions & 2 deletions packages/engine/Specs/Scene/SceneSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,10 @@ describe(
it("constructor sets options", function () {
const webglOptions = {
alpha: true,
depth: true, //TODO Change to false when https://bugzilla.mozilla.org/show_bug.cgi?id=745912 is fixed.
depth: false,
stencil: true,
antialias: false,
premultipliedAlpha: true, // Workaround IE 11.0.8, which does not honor false.
premultipliedAlpha: false,
preserveDrawingBuffer: true,
};
const mapProjection = new WebMercatorProjection();
Expand Down

0 comments on commit 1fb9710

Please sign in to comment.