diff --git a/.github/actions/check-for-CLA/index.js b/.github/actions/check-for-CLA/index.js index 56ece7b8e03b..68684a92624a 100644 --- a/.github/actions/check-for-CLA/index.js +++ b/.github/actions/check-for-CLA/index.js @@ -47,7 +47,7 @@ const getValuesFromGoogleSheet = async (sheetId, cellRanges) => { const checkIfIndividualCLAFound = async () => { const response = await getValuesFromGoogleSheet( GOOGLE_SHEETS_INFO.individualCLASheetId, - "D2:D" + "D2:D", ); const rows = response.data.values; @@ -68,7 +68,7 @@ const checkIfIndividualCLAFound = async () => { const checkIfCorporateCLAFound = async () => { const response = await getValuesFromGoogleSheet( GOOGLE_SHEETS_INFO.corporateCLASheetId, - "H2:H" + "H2:H", ); const rows = response.data.values; @@ -107,9 +107,9 @@ const getCommentBody = (hasSignedCLA, errorFoundOnCLACheck) => { const commentTemplate = fs.readFileSync( join( dirname(fileURLToPath(import.meta.url)), - "templates/pullRequestComment.hbs" + "templates/pullRequestComment.hbs", ), - "utf-8" + "utf-8", ); const getCommentFromTemplate = Handlebars.compile(commentTemplate); @@ -138,7 +138,7 @@ const postCommentOnPullRequest = async (hasSignedCLA, errorFoundOnCLACheck) => { accept: "application/vnd.github+json", "X-GitHub-Api-Version": "2022-11-28", }, - } + }, ); }; diff --git a/Apps/CesiumViewer/CesiumViewer.js b/Apps/CesiumViewer/CesiumViewer.js index 3a07da944985..37325b668f78 100644 --- a/Apps/CesiumViewer/CesiumViewer.js +++ b/Apps/CesiumViewer/CesiumViewer.js @@ -47,7 +47,7 @@ async function main() { let baseLayer; if (defined(endUserOptions.tmsImageryUrl)) { baseLayer = ImageryLayer.fromProviderAsync( - TileMapServiceImageryProvider.fromUrl(endUserOptions.tmsImageryUrl) + TileMapServiceImageryProvider.fromUrl(endUserOptions.tmsImageryUrl), ); } @@ -222,11 +222,11 @@ async function main() { let hpr = ""; if (defined(camera.heading)) { hpr = `,${CesiumMath.toDegrees(camera.heading)},${CesiumMath.toDegrees( - camera.pitch + camera.pitch, )},${CesiumMath.toDegrees(camera.roll)}`; } endUserOptions.view = `${CesiumMath.toDegrees( - position.longitude + position.longitude, )},${CesiumMath.toDegrees(position.latitude)},${position.height}${hpr}`; history.replaceState(undefined, "", `?${objectToQuery(endUserOptions)}`); } diff --git a/Apps/CesiumViewer/index.html b/Apps/CesiumViewer/index.html index 9bd37df259f2..5732efc965c0 100644 --- a/Apps/CesiumViewer/index.html +++ b/Apps/CesiumViewer/index.html @@ -1,4 +1,4 @@ - + diff --git a/Apps/HelloWorld.html b/Apps/HelloWorld.html index 277d7479d7b2..23831dbf99fe 100644 --- a/Apps/HelloWorld.html +++ b/Apps/HelloWorld.html @@ -1,4 +1,4 @@ - + diff --git a/Apps/Sandcastle/CesiumSandcastle.js b/Apps/Sandcastle/CesiumSandcastle.js index 9f8d87e99120..ddce4d5e04f4 100644 --- a/Apps/Sandcastle/CesiumSandcastle.js +++ b/Apps/Sandcastle/CesiumSandcastle.js @@ -94,7 +94,7 @@ require({ dojoscript, LinkButton, ClipboardJS, - pako + pako, ) { "use strict"; // attach clipboard handling to our Copy button @@ -234,7 +234,7 @@ require({ function clearRun() { domClass.remove( registry.byId("buttonRun").domNode, - "highlightToolbarButton" + "highlightToolbarButton", ); } @@ -336,8 +336,8 @@ require({ function openGalleryTooltip() { galleryTooltipTimer = undefined; - const selectedTabName = registry.byId("innerPanel").selectedChildWidget - .title; + const selectedTabName = + registry.byId("innerPanel").selectedChildWidget.title; let suffix = `${selectedTabName}Demos`; if (selectedTabName === "All") { suffix = "all"; @@ -395,7 +395,7 @@ require({ line = jsEditor.setGutterMarker( i, "searchGutter", - makeLineLabel(`Search: ${searchTerm}`, "searchMarker") + makeLineLabel(`Search: ${searchTerm}`, "searchMarker"), ); jsEditor.addLineClass(line, "text", "searchLine"); errorLines.push(line); @@ -415,7 +415,7 @@ require({ line = jsEditor.setGutterMarker( scriptLineToEditorLine(hint.line), "hintGutter", - makeLineLabel(hint.reason, "hintMarker") + makeLineLabel(hint.reason, "hintMarker"), ); jsEditor.addLineClass(line, "text", "hintLine"); errorLines.push(line); @@ -453,7 +453,7 @@ require({ { line: lineNumber - 1, ch: 0, - } + }, ); jsEditor.focus(); jsEditor.setSelection( @@ -464,7 +464,7 @@ require({ { line: lineNumber, ch: 0, - } + }, ); } } @@ -481,7 +481,7 @@ require({ line = jsEditor.setGutterMarker( lineNum, "highlightGutter", - makeLineLabel("highlighted by demo", "highlightMarker") + makeLineLabel("highlighted by demo", "highlightMarker"), ); jsEditor.addLineClass(line, "text", "highlightLine"); highlightLines.push(line); @@ -516,7 +516,7 @@ require({ demoContainer.scrollLeft -= (e.wheelDelta * 70) / 120; } }, - false + false, ); } else { demoContainer.addEventListener( @@ -526,7 +526,7 @@ require({ demoContainer.scrollLeft += (e.detail * 70) / 3; } }, - false + false, ); } } @@ -572,7 +572,7 @@ require({ Tab: "indentMore", "Shift-Tab": "indentLess", }, - } + }, ); window.onbeforeunload = function (e) { @@ -626,7 +626,7 @@ require({ appendConsole( "consoleError", "Make sure Cesium is built, see the Contributor's Guide for details.", - true + true, ); } }; @@ -673,7 +673,7 @@ require({ element.textContent = embedInSandcastleTemplate( jsEditor.getValue(), - isFirefox + isFirefox, ); bucketDoc.body.appendChild(element); } @@ -697,7 +697,7 @@ require({ appendConsole( "consoleError", `Error, first part of ${local.bucketName} must match first part of bucket.html exactly.`, - true + true, ); } else { const bodyAttributes = local.headers.match(/]*?)>/)[1]; @@ -719,7 +719,7 @@ require({ const pos = local.headers.indexOf(""); const extraHeaders = local.headers.substring( local.emptyBucket.length, - pos + pos, ); bucketDoc.head.innerHTML += extraHeaders; activateBucketScripts(bucketDoc); @@ -828,7 +828,7 @@ require({ appendConsole( "consoleError", `Unable to GET gist from GitHub API. This could be due to too many requests from your IP. Try again in an hour or copy and paste the code from the gist: https://gist.github.com/${queryObject.gist}`, - true + true, ); console.log(error); }); @@ -851,13 +851,13 @@ require({ const doc = parser.parseFromString(demo.code, "text/html"); const script = doc.querySelector( - 'script[id="cesium_sandcastle_script"]' + 'script[id="cesium_sandcastle_script"]', ); if (!script) { appendConsole( "consoleError", `Error reading source file: ${demo.name}`, - true + true, ); return; } @@ -867,7 +867,7 @@ require({ appendConsole( "consoleError", `Error reading source file: ${demo.name}`, - true + true, ); return; } @@ -903,7 +903,7 @@ require({ document.title = `${e.state.name} - Cesium Sandcastle`; } }, - false + false, ); window.addEventListener( @@ -930,7 +930,7 @@ require({ appendConsole( "consoleError", 'Documentation not available. Please run the "build-docs" build script to generate Cesium documentation.', - true + true, ); showGallery(); } @@ -938,7 +938,7 @@ require({ appendConsole( "consoleError", "Error loading gallery, please run the build script.", - true + true, ); } if (deferredLoadError) { @@ -946,9 +946,9 @@ require({ "consoleLog", `Unable to load demo named ${queryObject.src.replace( ".html", - "" + "", )}. Redirecting to HelloWorld.\n`, - true + true, ); } } @@ -970,7 +970,7 @@ require({ line = jsEditor.setGutterMarker( lineNumber, "errorGutter", - makeLineLabel(e.data.error, "errorMarker") + makeLineLabel(e.data.error, "errorMarker"), ); jsEditor.addLineClass(line, "text", "errorLine"); errorLines.push(line); @@ -986,7 +986,7 @@ require({ highlightLine(e.data.highlight); } }, - true + true, ); registry.byId("jsContainer").on("show", function () { @@ -1061,7 +1061,7 @@ require({ // we save a few bytes by omitting the leading [" and trailing "] since they are always the same jsonString = jsonString.substr(2, jsonString.length - 4); let base64String = btoa( - pako.deflate(jsonString, { raw: true, to: "string", level: 9 }) + pako.deflate(jsonString, { raw: true, to: "string", level: 9 }), ); base64String = base64String.replace(/\=+$/, ""); // remove padding @@ -1107,7 +1107,7 @@ require({ let confirmChange = true; if (demoHtml !== htmlText || demoCode !== jsText) { confirmChange = window.confirm( - "You have unsaved changes. Are you sure you want to navigate away from this demo?" + "You have unsaved changes. Are you sure you want to navigate away from this demo?", ); } if (confirmChange) { @@ -1132,7 +1132,7 @@ require({ local.headers }\n${htmlEditor.getValue()}\n` + `\n` + `\n` @@ -1143,20 +1143,20 @@ require({ let currentDemoName = queryObject.src; currentDemoName = currentDemoName.replace(".html", ""); const description = encodeHTML( - registry.byId("description").get("value").replace(/\n/g, "\\n") + registry.byId("description").get("value").replace(/\n/g, "\\n"), ).replace(/\"/g, """); const label = encodeHTML( - registry.byId("label").get("value").replace(/\n/g, "\\n") + registry.byId("label").get("value").replace(/\n/g, "\\n"), ).replace(/\"/g, """); let html = getDemoHtml(); html = html.replace( "", - `<meta name="description" content="${description}">\n <title>` + `<meta name="description" content="${description}">\n <title>`, ); html = html.replace( "<title>", - `<meta name="cesium-sandcastle-labels" content="${label}">\n <title>` + `<meta name="cesium-sandcastle-labels" content="${label}">\n <title>`, ); const octetBlob = new Blob([html], { @@ -1242,7 +1242,7 @@ require({ demo.description = description ? description : ""; const labelsMeta = doc.querySelector( - 'meta[name="cesium-sandcastle-labels"]' + 'meta[name="cesium-sandcastle-labels"]', ); const labels = labelsMeta && labelsMeta.getAttribute("content"); if (demo.isNew) { @@ -1356,7 +1356,7 @@ require({ let confirmChange = true; if (demoHtml !== htmlText || demoCode !== jsText) { confirmChange = window.confirm( - "You have unsaved changes. Are you sure you want to navigate away from this demo?" + "You have unsaved changes. Are you sure you want to navigate away from this demo?", ); } if (confirmChange) { diff --git a/Apps/Sandcastle/LinkButton.js b/Apps/Sandcastle/LinkButton.js index aa6a61ca5f73..6884c209065e 100644 --- a/Apps/Sandcastle/LinkButton.js +++ b/Apps/Sandcastle/LinkButton.js @@ -11,7 +11,7 @@ define([ _WidgetBase, declare, domClass, - template + template, ) { "use strict"; @@ -34,6 +34,6 @@ define([ this._set("label", content); (this.containerNode || this.focusNode).innerHTML = content; }, - } + }, ); }); diff --git a/Apps/Sandcastle/Sandcastle-client.js b/Apps/Sandcastle/Sandcastle-client.js index d6ebbb0e8858..5acd572c626e 100644 --- a/Apps/Sandcastle/Sandcastle-client.js +++ b/Apps/Sandcastle/Sandcastle-client.js @@ -22,7 +22,7 @@ { log: print(d1), }, - "*" + "*", ); }; @@ -33,7 +33,7 @@ { warn: defined(d1) ? d1.toString() : "undefined", }, - "*" + "*", ); }; @@ -45,7 +45,7 @@ { error: "undefined", }, - "*" + "*", ); return; } @@ -75,7 +75,7 @@ try { lineNumber = parseInt( stack.substring(lineStart + 1, lineEnd1), - 10 + 10, ); } catch (ex) {} /*eslint-enable no-empty*/ @@ -90,14 +90,14 @@ error: errorMsg, lineNumber: lineNumber, }, - "*" + "*", ); } else { window.parent.postMessage( { error: errorMsg, }, - "*" + "*", ); } }; @@ -129,7 +129,7 @@ url: url, lineNumber: lineNumber, }, - "*" + "*", ); } else { window.parent.postMessage( @@ -137,7 +137,7 @@ error: errorMsg, url: url, }, - "*" + "*", ); } console.originalError.apply(console, [errorMsg]); @@ -187,7 +187,7 @@ { highlight: Sandcastle.registered[i].lineNumber, }, - "*" + "*", ); return; } @@ -197,7 +197,7 @@ { highlight: 0, }, - "*" + "*", ); }; })(); diff --git a/Apps/Sandcastle/Sandcastle-header.js b/Apps/Sandcastle/Sandcastle-header.js index 58a042f62c12..5c9c0ad51570 100644 --- a/Apps/Sandcastle/Sandcastle-header.js +++ b/Apps/Sandcastle/Sandcastle-header.js @@ -24,7 +24,7 @@ document.body.className = document.body.className.replace( /(?:\s|^)sandcastle-loading(?:\s|$)/, - " " + " ", ); }, addToggleButton: function (text, checked, onchange, toolbarID) { @@ -101,7 +101,7 @@ if (window.location.protocol === "file:") { if ( window.confirm( - "You must host this app on a web server.\nSee contributor's guide for more info?" + "You must host this app on a web server.\nSee contributor's guide for more info?", ) ) { window.location = diff --git a/Apps/Sandcastle/gallery/3D Models Coloring.html b/Apps/Sandcastle/gallery/3D Models Coloring.html index 3f43b292dc4c..57c0aedc1daa 100644 --- a/Apps/Sandcastle/gallery/3D Models Coloring.html +++ b/Apps/Sandcastle/gallery/3D Models Coloring.html @@ -1,4 +1,4 @@ -<!DOCTYPE html> +<!doctype html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -18,10 +18,7 @@ ></script> <script type="module" src="../load-cesium-es6.js"></script> </head> - <body - class="sandcastle-loading" - data-sandcastle-bucket="bucket-requirejs.html" - > + <body class="sandcastle-loading" data-sandcastle-bucket="bucket-requirejs.html"> <style> @import url(../templates/bucket.css); #toolbar { @@ -72,9 +69,7 @@ </td> </tr> <tr> - <td - data-bind="style: { color: colorBlendAmountEnabled ? '' : 'gray'}" - > + <td data-bind="style: { color: colorBlendAmountEnabled ? '' : 'gray'}"> Mix </td> <td> @@ -176,17 +171,13 @@ const toolbar = document.getElementById("toolbar"); Cesium.knockout.applyBindings(viewModel, toolbar); - Cesium.knockout - .getObservable(viewModel, "color") - .subscribe(function (newValue) { - entity.model.color = getColor(newValue, viewModel.alpha); - }); + Cesium.knockout.getObservable(viewModel, "color").subscribe(function (newValue) { + entity.model.color = getColor(newValue, viewModel.alpha); + }); - Cesium.knockout - .getObservable(viewModel, "alpha") - .subscribe(function (newValue) { - entity.model.color = getColor(viewModel.color, newValue); - }); + Cesium.knockout.getObservable(viewModel, "alpha").subscribe(function (newValue) { + entity.model.color = getColor(viewModel.color, newValue); + }); Cesium.knockout .getObservable(viewModel, "colorBlendMode") @@ -206,19 +197,13 @@ Cesium.knockout .getObservable(viewModel, "silhouetteColor") .subscribe(function (newValue) { - entity.model.silhouetteColor = getColor( - newValue, - viewModel.silhouetteAlpha - ); + entity.model.silhouetteColor = getColor(newValue, viewModel.silhouetteAlpha); }); Cesium.knockout .getObservable(viewModel, "silhouetteAlpha") .subscribe(function (newValue) { - entity.model.silhouetteColor = getColor( - viewModel.silhouetteColor, - newValue - ); + entity.model.silhouetteColor = getColor(viewModel.silhouetteColor, newValue); }); Cesium.knockout @@ -233,16 +218,13 @@ const position = Cesium.Cartesian3.fromDegrees( -123.0744619, 44.0503706, - height + height, ); const heading = Cesium.Math.toRadians(135); const pitch = 0; const roll = 0; const hpr = new Cesium.HeadingPitchRoll(heading, pitch, roll); - const orientation = Cesium.Transforms.headingPitchRollQuaternion( - position, - hpr - ); + const orientation = Cesium.Transforms.headingPitchRollQuaternion(position, hpr); entity = viewer.entities.add({ name: url, @@ -257,7 +239,7 @@ colorBlendAmount: parseFloat(viewModel.colorBlendAmount), silhouetteColor: getColor( viewModel.silhouetteColor, - viewModel.silhouetteAlpha + viewModel.silhouetteAlpha, ), silhouetteSize: parseFloat(viewModel.silhouetteSize), }, @@ -269,19 +251,13 @@ { text: "Aircraft", onselect: function () { - createModel( - "../../SampleData/models/CesiumAir/Cesium_Air.glb", - 5000.0 - ); + createModel("../../SampleData/models/CesiumAir/Cesium_Air.glb", 5000.0); }, }, { text: "Ground Vehicle", onselect: function () { - createModel( - "../../SampleData/models/GroundVehicle/GroundVehicle.glb", - 0 - ); + createModel("../../SampleData/models/GroundVehicle/GroundVehicle.glb", 0); }, }, { @@ -289,7 +265,7 @@ onselect: function () { createModel( "../../SampleData/models/CesiumBalloon/CesiumBalloon.glb", - 1000.0 + 1000.0, ); }, }, @@ -298,26 +274,21 @@ onselect: function () { createModel( "../../SampleData/models/CesiumMilkTruck/CesiumMilkTruck.glb", - 0 + 0, ); }, }, { text: "Skinned Character", onselect: function () { - createModel( - "../../SampleData/models/CesiumMan/Cesium_Man.glb", - 0 - ); + createModel("../../SampleData/models/CesiumMan/Cesium_Man.glb", 0); }, }, ]; Sandcastle.addToolbarMenu(options); - Sandcastle.addToggleButton("Shadows", viewer.shadows, function ( - checked - ) { + Sandcastle.addToggleButton("Shadows", viewer.shadows, function (checked) { viewer.shadows = checked; }); diff --git a/Apps/Sandcastle/gallery/3D Models.html b/Apps/Sandcastle/gallery/3D Models.html index 6153306c0eb4..a2c16fc7a2af 100644 --- a/Apps/Sandcastle/gallery/3D Models.html +++ b/Apps/Sandcastle/gallery/3D Models.html @@ -1,4 +1,4 @@ -<!DOCTYPE html> +<!doctype html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -18,10 +18,7 @@ ></script> <script type="module" src="../load-cesium-es6.js"></script> </head> - <body - class="sandcastle-loading" - data-sandcastle-bucket="bucket-requirejs.html" - > + <body class="sandcastle-loading" data-sandcastle-bucket="bucket-requirejs.html"> <style> @import url(../templates/bucket.css); </style> @@ -45,16 +42,13 @@ const position = Cesium.Cartesian3.fromDegrees( -123.0744619, 44.0503706, - height + height, ); const heading = Cesium.Math.toRadians(135); const pitch = 0; const roll = 0; const hpr = new Cesium.HeadingPitchRoll(heading, pitch, roll); - const orientation = Cesium.Transforms.headingPitchRollQuaternion( - position, - hpr - ); + const orientation = Cesium.Transforms.headingPitchRollQuaternion(position, hpr); const entity = viewer.entities.add({ name: url, @@ -73,28 +67,19 @@ { text: "Aircraft", onselect: function () { - createModel( - "../../SampleData/models/CesiumAir/Cesium_Air.glb", - 5000.0 - ); + createModel("../../SampleData/models/CesiumAir/Cesium_Air.glb", 5000.0); }, }, { text: "Drone", onselect: function () { - createModel( - "../../SampleData/models/CesiumDrone/CesiumDrone.glb", - 150.0 - ); + createModel("../../SampleData/models/CesiumDrone/CesiumDrone.glb", 150.0); }, }, { text: "Ground Vehicle", onselect: function () { - createModel( - "../../SampleData/models/GroundVehicle/GroundVehicle.glb", - 0 - ); + createModel("../../SampleData/models/GroundVehicle/GroundVehicle.glb", 0); }, }, { @@ -102,7 +87,7 @@ onselect: function () { createModel( "../../SampleData/models/CesiumBalloon/CesiumBalloon.glb", - 1000.0 + 1000.0, ); }, }, @@ -111,26 +96,20 @@ onselect: function () { createModel( "../../SampleData/models/CesiumMilkTruck/CesiumMilkTruck.glb", - 0 + 0, ); }, }, { text: "Skinned Character", onselect: function () { - createModel( - "../../SampleData/models/CesiumMan/Cesium_Man.glb", - 0 - ); + createModel("../../SampleData/models/CesiumMan/Cesium_Man.glb", 0); }, }, { text: "Unlit Box", onselect: function () { - createModel( - "../../SampleData/models/BoxUnlit/BoxUnlit.gltf", - 10.0 - ); + createModel("../../SampleData/models/BoxUnlit/BoxUnlit.gltf", 10.0); }, }, { @@ -138,7 +117,7 @@ onselect: function () { createModel( "../../SampleData/models/DracoCompressed/CesiumMilkTruck.gltf", - 0 + 0, ); }, }, @@ -147,22 +126,19 @@ onselect: function () { if (!Cesium.FeatureDetection.supportsBasis(viewer.scene)) { window.alert( - "This browser does not support Basis Universal compressed textures" + "This browser does not support Basis Universal compressed textures", ); } createModel( "../../SampleData/models/CesiumBalloonKTX2/CesiumBalloonKTX2.glb", - 1000.0 + 1000.0, ); }, }, { text: "Instanced Box", onselect: function () { - createModel( - "../../SampleData/models/BoxInstanced/BoxInstanced.gltf", - 15 - ); + createModel("../../SampleData/models/BoxInstanced/BoxInstanced.gltf", 15); }, }, ]; diff --git a/Apps/Sandcastle/gallery/3D Tiles 1.1 CDB Yemen.html b/Apps/Sandcastle/gallery/3D Tiles 1.1 CDB Yemen.html index cc1e609e1210..99e12eb214b0 100644 --- a/Apps/Sandcastle/gallery/3D Tiles 1.1 CDB Yemen.html +++ b/Apps/Sandcastle/gallery/3D Tiles 1.1 CDB Yemen.html @@ -1,4 +1,4 @@ -<!DOCTYPE html> +<!doctype html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -7,10 +7,7 @@ name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no" /> - <meta - name="description" - content="Load a 3D Tiles 1.1 tileset converted from CDB." - /> + <meta name="description" content="Load a 3D Tiles 1.1 tileset converted from CDB." /> <meta name="cesium-sandcastle-labels" content="3D Tiles" /> <title>Cesium Demo @@ -21,10 +18,7 @@ > - + @@ -43,7 +40,7 @@ }); viewer.clock.currentTime = Cesium.JulianDate.fromIso8601( - "2021-11-09T20:27:37.016064475348684937Z" + "2021-11-09T20:27:37.016064475348684937Z", ); const scene = viewer.scene; @@ -53,12 +50,12 @@ destination: new Cesium.Cartesian3( -2703640.80485846, -4261161.990345464, - 3887439.511104276 + 3887439.511104276, ), orientation: new Cesium.HeadingPitchRoll( 0.22426651143535548, -0.2624145362506527, - 0.000006972977223185239 + 0.000006972977223185239, ), duration: 0, }); @@ -70,7 +67,7 @@ const translation = new Cesium.Cartesian3( -1.398521324920626, 0.7823052871729486, - 0.7015244410592609 + 0.7015244410592609, ); tileset.modelMatrix = Cesium.Matrix4.fromTranslation(translation); @@ -298,28 +295,17 @@ handler.setInputAction(function (movement) { if (enablePicking) { const pickedObject = scene.pick(movement.position); - if ( - Cesium.defined(pickedObject) && - Cesium.defined(pickedObject.featureId) - ) { - selectFeatureShader.setUniform( - "u_selectedFeature", - pickedObject.featureId - ); + if (Cesium.defined(pickedObject) && Cesium.defined(pickedObject.featureId)) { + selectFeatureShader.setUniform("u_selectedFeature", pickedObject.featureId); } else { - selectFeatureShader.setUniform( - "u_selectedFeature", - NOTHING_SELECTED - ); + selectFeatureShader.setUniform("u_selectedFeature", NOTHING_SELECTED); } } }, Cesium.ScreenSpaceEventType.LEFT_CLICK); // UI ============================================================================ - Sandcastle.addToggleButton("Enable picking", enablePicking, function ( - checked - ) { + Sandcastle.addToggleButton("Enable picking", enablePicking, function (checked) { enablePicking = checked; }); diff --git a/Apps/Sandcastle/gallery/3D Tiles 1.1 Photogrammetry.html b/Apps/Sandcastle/gallery/3D Tiles 1.1 Photogrammetry.html index 30cc0ccbfeca..c38b6c0d5cef 100644 --- a/Apps/Sandcastle/gallery/3D Tiles 1.1 Photogrammetry.html +++ b/Apps/Sandcastle/gallery/3D Tiles 1.1 Photogrammetry.html @@ -1,4 +1,4 @@ - + @@ -22,10 +22,7 @@ > - + @@ -39,16 +33,12 @@ const viewer = new Cesium.Viewer("cesiumContainer"); const scene = viewer.scene; - viewer.clock.currentTime = Cesium.JulianDate.fromIso8601( - "2022-08-01T00:00:00Z" - ); + viewer.clock.currentTime = Cesium.JulianDate.fromIso8601("2022-08-01T00:00:00Z"); let selectedFeature; let picking = false; - Sandcastle.addToggleButton("Per-feature selection", false, function ( - checked - ) { + Sandcastle.addToggleButton("Per-feature selection", false, function (checked) { picking = checked; if (!picking) { unselectFeature(selectedFeature); @@ -92,40 +82,10 @@ // Workaround until 3D Tiles has the concept of global batch ids: https://github.com/CesiumGS/3d-tiles/issues/265 const elementMap = {}; // Build a map of elements to features. const hiddenElements = [ - 112001, - 113180, - 131136, - 113167, - 71309, - 109652, - 111178, - 113156, - 113170, - 124846, - 114076, - 131122, - 113179, - 114325, - 131134, - 113164, - 113153, - 113179, - 109656, - 114095, - 114093, - 39225, - 39267, - 113149, - 113071, - 112003, - 39229, - 113160, - 39227, - 39234, - 113985, - 39230, - 112004, - 39223, + 112001, 113180, 131136, 113167, 71309, 109652, 111178, 113156, 113170, 124846, + 114076, 131122, 113179, 114325, 131134, 113164, 113153, 113179, 109656, 114095, + 114093, 39225, 39267, 113149, 113071, 112003, 39229, 113160, 39227, 39234, + 113985, 39230, 112004, 39223, ]; function getElement(feature) { @@ -192,11 +152,7 @@ viewer.zoomTo( tileset, - new Cesium.HeadingPitchRange( - 0.5, - -0.2, - tileset.boundingSphere.radius * 4.0 - ) + new Cesium.HeadingPitchRange(0.5, -0.2, tileset.boundingSphere.radius * 4.0), ); tileset.colorBlendMode = Cesium.Cesium3DTileColorBlendMode.REPLACE; diff --git a/Apps/Sandcastle/gallery/3D Tiles Batch Table Hierarchy.html b/Apps/Sandcastle/gallery/3D Tiles Batch Table Hierarchy.html index 293b44428ce3..d93c6ad78345 100644 --- a/Apps/Sandcastle/gallery/3D Tiles Batch Table Hierarchy.html +++ b/Apps/Sandcastle/gallery/3D Tiles Batch Table Hierarchy.html @@ -1,4 +1,4 @@ - + @@ -22,10 +22,7 @@ > - + @@ -46,12 +43,12 @@ const initialPosition = Cesium.Cartesian3.fromDegrees( -74.01881302800248, 40.69114333714821, - 753 + 753, ); const initialOrientation = new Cesium.HeadingPitchRoll.fromDegrees( 21.27879878293835, -21.34390550872461, - 0.0716951918898415 + 0.0716951918898415, ); viewer.scene.camera.setView({ destination: initialPosition, @@ -90,7 +87,7 @@ // Get default left click handler for when a feature is not picked on left click const clickHandler = viewer.screenSpaceEventHandler.getInputAction( - Cesium.ScreenSpaceEventType.LEFT_CLICK + Cesium.ScreenSpaceEventType.LEFT_CLICK, ); // Update the 'nameOverlay' for the given picked feature, @@ -102,9 +99,7 @@ } // A feature was picked, so show its overlay content nameOverlay.style.display = "block"; - nameOverlay.style.bottom = `${ - viewer.canvas.clientHeight - position.y - }px`; + nameOverlay.style.bottom = `${viewer.canvas.clientHeight - position.y}px`; nameOverlay.style.left = `${position.x}px`; const name = pickedFeature.getProperty("BIN"); nameOverlay.textContent = name; @@ -119,22 +114,20 @@ "BIN" }${pickedFeature.getProperty("BIN")}` + `DOITT ID${pickedFeature.getProperty( - "DOITT_ID" + "DOITT_ID", )}` + `SOURCE ID${pickedFeature.getProperty( - "SOURCE_ID" + "SOURCE_ID", )}` + `Longitude${pickedFeature.getProperty( - "Longitude" + "Longitude", )}` + `Latitude${pickedFeature.getProperty( - "Latitude" - )}` + - `Height${pickedFeature.getProperty( - "Height" + "Latitude", )}` + + `Height${pickedFeature.getProperty("Height")}` + `Terrain Height (Ellipsoid)${pickedFeature.getProperty( - "TerrainHeight" + "TerrainHeight", )}` + ``; return description; @@ -142,16 +135,16 @@ // If silhouettes are supported, silhouette features in blue on mouse over and silhouette green on mouse click. // If silhouettes are not supported, change the feature color to yellow on mouse over and green on mouse click. - if ( - Cesium.PostProcessStageLibrary.isSilhouetteSupported(viewer.scene) - ) { + if (Cesium.PostProcessStageLibrary.isSilhouetteSupported(viewer.scene)) { // Silhouettes are supported - const silhouetteBlue = Cesium.PostProcessStageLibrary.createEdgeDetectionStage(); + const silhouetteBlue = + Cesium.PostProcessStageLibrary.createEdgeDetectionStage(); silhouetteBlue.uniforms.color = Cesium.Color.BLUE; silhouetteBlue.uniforms.length = 0.01; silhouetteBlue.selected = []; - const silhouetteGreen = Cesium.PostProcessStageLibrary.createEdgeDetectionStage(); + const silhouetteGreen = + Cesium.PostProcessStageLibrary.createEdgeDetectionStage(); silhouetteGreen.uniforms.color = Cesium.Color.LIME; silhouetteGreen.uniforms.length = 0.01; silhouetteGreen.selected = []; @@ -160,13 +153,11 @@ Cesium.PostProcessStageLibrary.createSilhouetteStage([ silhouetteBlue, silhouetteGreen, - ]) + ]), ); // Silhouette a feature blue on hover. - viewer.screenSpaceEventHandler.setInputAction(function onMouseMove( - movement - ) { + viewer.screenSpaceEventHandler.setInputAction(function onMouseMove(movement) { // If a feature was previously highlighted, undo the highlight silhouetteBlue.selected = []; @@ -183,13 +174,10 @@ if (pickedFeature !== selected.feature) { silhouetteBlue.selected = [pickedFeature]; } - }, - Cesium.ScreenSpaceEventType.MOUSE_MOVE); + }, Cesium.ScreenSpaceEventType.MOUSE_MOVE); // Silhouette a feature on selection and show metadata in the InfoBox. - viewer.screenSpaceEventHandler.setInputAction(function onLeftClick( - movement - ) { + viewer.screenSpaceEventHandler.setInputAction(function onLeftClick(movement) { // If a feature was previously selected, undo the highlight silhouetteGreen.selected = []; @@ -216,11 +204,8 @@ // Set feature infobox description viewer.selectedEntity = selectedEntity; - selectedEntity.description = createPickedFeatureDescription( - pickedFeature - ); - }, - Cesium.ScreenSpaceEventType.LEFT_CLICK); + selectedEntity.description = createPickedFeatureDescription(pickedFeature); + }, Cesium.ScreenSpaceEventType.LEFT_CLICK); } else { // Silhouettes are not supported. Instead, change the feature color. @@ -231,9 +216,7 @@ }; // Color a feature yellow on hover. - viewer.screenSpaceEventHandler.setInputAction(function onMouseMove( - movement - ) { + viewer.screenSpaceEventHandler.setInputAction(function onMouseMove(movement) { // If a feature was previously highlighted, undo the highlight if (Cesium.defined(highlighted.feature)) { highlighted.feature.color = highlighted.originalColor; @@ -250,19 +233,13 @@ // Highlight the feature if it's not already selected. if (pickedFeature !== selected.feature) { highlighted.feature = pickedFeature; - Cesium.Color.clone( - pickedFeature.color, - highlighted.originalColor - ); + Cesium.Color.clone(pickedFeature.color, highlighted.originalColor); pickedFeature.color = Cesium.Color.YELLOW; } - }, - Cesium.ScreenSpaceEventType.MOUSE_MOVE); + }, Cesium.ScreenSpaceEventType.MOUSE_MOVE); // Color a feature on selection and show metadata in the InfoBox. - viewer.screenSpaceEventHandler.setInputAction(function onLeftClick( - movement - ) { + viewer.screenSpaceEventHandler.setInputAction(function onLeftClick(movement) { // If a feature was previously selected, undo the highlight if (Cesium.defined(selected.feature)) { selected.feature.color = selected.originalColor; @@ -281,10 +258,7 @@ selected.feature = pickedFeature; // Save the selected feature's original color if (pickedFeature === highlighted.feature) { - Cesium.Color.clone( - highlighted.originalColor, - selected.originalColor - ); + Cesium.Color.clone(highlighted.originalColor, selected.originalColor); highlighted.feature = undefined; } else { Cesium.Color.clone(pickedFeature.color, selected.originalColor); @@ -294,11 +268,8 @@ // Set feature infobox description viewer.selectedEntity = selectedEntity; - selectedEntity.description = createPickedFeatureDescription( - pickedFeature - ); - }, - Cesium.ScreenSpaceEventType.LEFT_CLICK); + selectedEntity.description = createPickedFeatureDescription(pickedFeature); + }, Cesium.ScreenSpaceEventType.LEFT_CLICK); } //Sandcastle_End }; if (typeof Cesium !== "undefined") { diff --git a/Apps/Sandcastle/gallery/3D Tiles Feature Styling.html b/Apps/Sandcastle/gallery/3D Tiles Feature Styling.html index ddadf3af6590..2098504bb378 100644 --- a/Apps/Sandcastle/gallery/3D Tiles Feature Styling.html +++ b/Apps/Sandcastle/gallery/3D Tiles Feature Styling.html @@ -1,4 +1,4 @@ - + @@ -22,10 +22,7 @@ - + @@ -171,12 +168,8 @@

Loading...

viewer.selectedEntity = undefined; const pickedBuilding = viewer.scene.pick(movement.position); if (pickedBuilding) { - const pickedLatitude = pickedBuilding.getProperty( - "cesium#latitude" - ); - const pickedLongitude = pickedBuilding.getProperty( - "cesium#longitude" - ); + const pickedLatitude = pickedBuilding.getProperty("cesium#latitude"); + const pickedLongitude = pickedBuilding.getProperty("cesium#longitude"); colorByDistanceToCoordinate(pickedLatitude, pickedLongitude); } }, Cesium.ScreenSpaceEventType.LEFT_CLICK); diff --git a/Apps/Sandcastle/gallery/3D Tiles Formats.html b/Apps/Sandcastle/gallery/3D Tiles Formats.html index 7c7d1fb50cf8..f49fbd3af3fb 100644 --- a/Apps/Sandcastle/gallery/3D Tiles Formats.html +++ b/Apps/Sandcastle/gallery/3D Tiles Formats.html @@ -1,4 +1,4 @@ - + @@ -8,10 +8,7 @@ name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no" /> - + Cesium Demo @@ -22,10 +19,7 @@ > - + @@ -56,8 +50,7 @@ tilesets: [ { name: "Tileset", - resource: - "../../SampleData/Cesium3DTiles/Tilesets/Tileset/tileset.json", + resource: "../../SampleData/Cesium3DTiles/Tilesets/Tileset/tileset.json", }, { name: "Translucent", @@ -96,8 +89,7 @@ }, { name: "Composite", - resource: - "../../SampleData/Cesium3DTiles/Composite/Composite/tileset.json", + resource: "../../SampleData/Cesium3DTiles/Composite/Composite/tileset.json", }, { name: "PointCloud", @@ -134,11 +126,9 @@ const toolbar = document.getElementById("toolbar"); Cesium.knockout.applyBindings(viewModel, toolbar); - Cesium.knockout - .getObservable(viewModel, "shadows") - .subscribe(function (enabled) { - viewer.shadows = enabled; - }); + Cesium.knockout.getObservable(viewModel, "shadows").subscribe(function (enabled) { + viewer.shadows = enabled; + }); let resourceToLoad; Cesium.knockout @@ -170,15 +160,12 @@ new Cesium.HeadingPitchRange( 0, -2.0, - Math.max(100.0 - tileset.boundingSphere.radius, 0.0) - ) + Math.max(100.0 - tileset.boundingSphere.radius, 0.0), + ), ); const properties = tileset.properties; - if ( - Cesium.defined(properties) && - Cesium.defined(properties.Height) - ) { + if (Cesium.defined(properties) && Cesium.defined(properties.Height)) { tileset.style = new Cesium.Cesium3DTileStyle({ color: { conditions: [ diff --git a/Apps/Sandcastle/gallery/3D Tiles Inspector.html b/Apps/Sandcastle/gallery/3D Tiles Inspector.html index 2d39ee01043d..2a9ba14b51c6 100644 --- a/Apps/Sandcastle/gallery/3D Tiles Inspector.html +++ b/Apps/Sandcastle/gallery/3D Tiles Inspector.html @@ -1,4 +1,4 @@ - + @@ -22,10 +22,7 @@ > - + @@ -55,11 +52,7 @@ viewer.zoomTo( tileset, - new Cesium.HeadingPitchRange( - 0.0, - -0.5, - tileset.boundingSphere.radius / 4.0 - ) + new Cesium.HeadingPitchRange(0.0, -0.5, tileset.boundingSphere.radius / 4.0), ); } catch (error) { console.log(`Error loading tileset: ${error}`); diff --git a/Apps/Sandcastle/gallery/3D Tiles Interactivity.html b/Apps/Sandcastle/gallery/3D Tiles Interactivity.html index a55fae14eb18..906d460ffeca 100644 --- a/Apps/Sandcastle/gallery/3D Tiles Interactivity.html +++ b/Apps/Sandcastle/gallery/3D Tiles Interactivity.html @@ -1,4 +1,4 @@ - + @@ -19,10 +19,7 @@ > - + @@ -49,12 +43,12 @@ const initialPosition = new Cesium.Cartesian3( -1111583.3721328347, -5855888.151574568, - 2262561.444696748 + 2262561.444696748, ); const initialOrientation = new Cesium.HeadingPitchRoll.fromDegrees( 100.0, -15.0, - 0.0 + 0.0, ); viewer.scene.camera.setView({ destination: initialPosition, diff --git a/Apps/Sandcastle/gallery/3D Tiles Photogrammetry Classification.html b/Apps/Sandcastle/gallery/3D Tiles Photogrammetry Classification.html index d2cff77c2412..022a732726e6 100644 --- a/Apps/Sandcastle/gallery/3D Tiles Photogrammetry Classification.html +++ b/Apps/Sandcastle/gallery/3D Tiles Photogrammetry Classification.html @@ -1,4 +1,4 @@ - + @@ -22,10 +22,7 @@ > - + @@ -54,7 +51,7 @@ classificationTilesetUrl, { classificationType: Cesium.ClassificationType.CESIUM_3D_TILE, - } + }, ); classificationTileset.style = new Cesium.Cesium3DTileStyle({ color: "rgba(255, 0, 0, 0.5)", @@ -66,16 +63,14 @@ classificationTilesetUrl, { show: false, - } + }, ); nonClassificationTileset.style = new Cesium.Cesium3DTileStyle({ color: "rgba(255, 0, 0, 0.5)", }); viewer.scene.primitives.add(nonClassificationTileset); - Sandcastle.addToggleButton("Show classification", true, function ( - checked - ) { + Sandcastle.addToggleButton("Show classification", true, function (checked) { classificationTileset.show = checked; nonClassificationTileset.show = !checked; }); diff --git a/Apps/Sandcastle/gallery/3D Tiles Photogrammetry.html b/Apps/Sandcastle/gallery/3D Tiles Photogrammetry.html index 7bfde7dcc8f4..598ee7e9ac69 100644 --- a/Apps/Sandcastle/gallery/3D Tiles Photogrammetry.html +++ b/Apps/Sandcastle/gallery/3D Tiles Photogrammetry.html @@ -1,4 +1,4 @@ - + @@ -22,10 +22,7 @@ > - + diff --git a/Apps/Sandcastle/gallery/3D Tiles Point Cloud Classification.html b/Apps/Sandcastle/gallery/3D Tiles Point Cloud Classification.html index 9b4728381221..fedb3b12bb33 100644 --- a/Apps/Sandcastle/gallery/3D Tiles Point Cloud Classification.html +++ b/Apps/Sandcastle/gallery/3D Tiles Point Cloud Classification.html @@ -1,4 +1,4 @@ - + @@ -22,10 +22,7 @@ > - + @@ -53,7 +50,7 @@ "../../SampleData/Cesium3DTiles/Classification/PointCloud/tileset.json", { classificationType: Cesium.ClassificationType.CESIUM_3D_TILE, - } + }, ); viewer.scene.primitives.add(classificationTileset); @@ -78,12 +75,12 @@ destination: new Cesium.Cartesian3( 4401744.644145314, 225051.41078911052, - 4595420.374784433 + 4595420.374784433, ), orientation: new Cesium.HeadingPitchRoll( 5.646733805039757, -0.276607153839886, - 6.281110875400085 + 6.281110875400085, ), }); @@ -94,9 +91,7 @@ }; // Color a feature yellow on hover. - viewer.screenSpaceEventHandler.setInputAction(function onMouseMove( - movement - ) { + viewer.screenSpaceEventHandler.setInputAction(function onMouseMove(movement) { // If a feature was previously highlighted, undo the highlight if (Cesium.defined(highlighted.feature)) { highlighted.feature.color = highlighted.originalColor; @@ -113,8 +108,8 @@ highlighted.feature = pickedFeature; Cesium.Color.clone(pickedFeature.color, highlighted.originalColor); pickedFeature.color = Cesium.Color.YELLOW.withAlpha(0.5); - }, - Cesium.ScreenSpaceEventType.MOUSE_MOVE); //Sandcastle_End + }, Cesium.ScreenSpaceEventType.MOUSE_MOVE); + //Sandcastle_End }; if (typeof Cesium !== "undefined") { window.startupCalled = true; diff --git a/Apps/Sandcastle/gallery/3D Tiles Point Cloud Shading.html b/Apps/Sandcastle/gallery/3D Tiles Point Cloud Shading.html index 1beeba7bff99..3d3dc2a6c10b 100644 --- a/Apps/Sandcastle/gallery/3D Tiles Point Cloud Shading.html +++ b/Apps/Sandcastle/gallery/3D Tiles Point Cloud Shading.html @@ -1,4 +1,4 @@ - + @@ -21,10 +21,7 @@ > - + @@ -45,12 +42,12 @@ destination: new Cesium.Cartesian3( 4401744.644145314, 225051.41078911052, - 4595420.374784433 + 4595420.374784433, ), orientation: new Cesium.HeadingPitchRoll( 5.646733805039757, -0.276607153839886, - 6.281110875400085 + 6.281110875400085, ), }); diff --git a/Apps/Sandcastle/gallery/3D Tiles Terrain Classification.html b/Apps/Sandcastle/gallery/3D Tiles Terrain Classification.html index 086aeaba8e03..581814432c70 100644 --- a/Apps/Sandcastle/gallery/3D Tiles Terrain Classification.html +++ b/Apps/Sandcastle/gallery/3D Tiles Terrain Classification.html @@ -1,4 +1,4 @@ - + @@ -22,10 +22,7 @@ > - + @@ -66,9 +63,7 @@ }; // Color a feature yellow on hover. - viewer.screenSpaceEventHandler.setInputAction(function onMouseMove( - movement - ) { + viewer.screenSpaceEventHandler.setInputAction(function onMouseMove(movement) { // If a feature was previously highlighted, undo the highlight if (Cesium.defined(highlighted.feature)) { highlighted.feature.color = highlighted.originalColor; @@ -85,8 +80,8 @@ highlighted.feature = pickedFeature; Cesium.Color.clone(pickedFeature.color, highlighted.originalColor); pickedFeature.color = Cesium.Color.YELLOW; - }, - Cesium.ScreenSpaceEventType.MOUSE_MOVE); //Sandcastle_End + }, Cesium.ScreenSpaceEventType.MOUSE_MOVE); + //Sandcastle_End }; if (typeof Cesium !== "undefined") { window.startupCalled = true; diff --git a/Apps/Sandcastle/gallery/3D Tiles Vertical Exaggeration.html b/Apps/Sandcastle/gallery/3D Tiles Vertical Exaggeration.html index ed5b9637b2dc..4e636b2f001c 100644 --- a/Apps/Sandcastle/gallery/3D Tiles Vertical Exaggeration.html +++ b/Apps/Sandcastle/gallery/3D Tiles Vertical Exaggeration.html @@ -1,4 +1,4 @@ - + @@ -7,19 +7,13 @@ name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no" /> - + Cesium Demo - + @@ -44,7 +41,7 @@ viewer.scene.skyAtmosphere.show = true; const currentTime = Cesium.JulianDate.fromIso8601( - "2020-01-09T23:00:39.018261982600961346Z" + "2020-01-09T23:00:39.018261982600961346Z", ); viewer.clock.currentTime = currentTime; @@ -69,7 +66,7 @@ viewer.dataSources.add(dataSource); footprint = dataSource.entities.values.find((entity) => - Cesium.defined(entity.polygon) + Cesium.defined(entity.polygon), ); footprint.polygon.outline = false; @@ -77,15 +74,13 @@ const cameraOffset = new Cesium.HeadingPitchRange( Cesium.Math.toRadians(95.0), Cesium.Math.toRadians(-75.0), - 800.0 + 800.0, ); viewer.zoomTo(footprint, cameraOffset); - viewer.homeButton.viewModel.command.beforeExecute.addEventListener( - (e) => { - e.cancel = true; - viewer.zoomTo(footprint, cameraOffset); - } - ); + viewer.homeButton.viewModel.command.beforeExecute.addEventListener((e) => { + e.cancel = true; + viewer.zoomTo(footprint, cameraOffset); + }); } catch (error) { console.log(`Error loading geojson. ${error}`); } @@ -104,18 +99,14 @@ // Add tileset of proposed project design let buildingTileset; try { - buildingTileset = await Cesium.Cesium3DTileset.fromIonAssetId( - 2533124 - ); + buildingTileset = await Cesium.Cesium3DTileset.fromIonAssetId(2533124); viewer.scene.primitives.add(buildingTileset); } catch (error) { console.log(`Error loading design tileset. ${error}`); } - Sandcastle.addToggleButton("Show proposed design", true, function ( - checked - ) { + Sandcastle.addToggleButton("Show proposed design", true, function (checked) { buildingTileset.show = checked; }); @@ -123,9 +114,7 @@ footprint.show = checked; }); - Sandcastle.addToggleButton("Clip target location", true, function ( - checked - ) { + Sandcastle.addToggleButton("Clip target location", true, function (checked) { clippingPolygons.enabled = checked; }); diff --git a/Apps/Sandcastle/gallery/Aerometrex San Francisco.html b/Apps/Sandcastle/gallery/Aerometrex San Francisco.html index e8d514509280..38ea645c9e3a 100755 --- a/Apps/Sandcastle/gallery/Aerometrex San Francisco.html +++ b/Apps/Sandcastle/gallery/Aerometrex San Francisco.html @@ -1,4 +1,4 @@ - + @@ -21,10 +21,7 @@ > - + @@ -51,12 +48,12 @@ destination: new Cesium.Cartesian3( -2703541.419456986, -4261164.971874713, - 3887416.257562123 + 3887416.257562123, ), orientation: new Cesium.HeadingPitchRoll( 5.959123393581913, -0.03131876941215883, - 0.0000033030489428043097 + 0.0000033030489428043097, ), duration: duration, }); @@ -68,12 +65,12 @@ destination: new Cesium.Cartesian3( -2704263.584923937, -4259336.981155519, - 3888978.5732662966 + 3888978.5732662966, ), orientation: new Cesium.HeadingPitchRoll( 2.4287691459386607, -0.49459905591668996, - 0.0000029701571779838787 + 0.0000029701571779838787, ), }); } @@ -84,12 +81,12 @@ destination: new Cesium.Cartesian3( -2702979.5635104137, -4261981.190435306, - 3887092.144148863 + 3887092.144148863, ), orientation: new Cesium.HeadingPitchRoll( 4.534265054628527, -0.08846186652294352, - 0.0000075141499165098935 + 0.0000075141499165098935, ), }); } @@ -100,12 +97,12 @@ destination: new Cesium.Cartesian3( -2705631.6783492276, -4259449.36938678, - 3887903.89229016 + 3887903.89229016, ), orientation: new Cesium.HeadingPitchRoll( 5.999439616451804, -0.20513082834763674, - 4.7213266807233367e-7 + 4.7213266807233367e-7, ), }); } diff --git a/Apps/Sandcastle/gallery/Ambient Occlusion.html b/Apps/Sandcastle/gallery/Ambient Occlusion.html index 4c7d10fe877d..c6017addff93 100644 --- a/Apps/Sandcastle/gallery/Ambient Occlusion.html +++ b/Apps/Sandcastle/gallery/Ambient Occlusion.html @@ -1,4 +1,4 @@ - + @@ -8,10 +8,7 @@ content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no" /> - + Cesium Demo - + @@ -40,10 +34,7 @@ Ambient Occlusion Only - + @@ -115,17 +106,11 @@ //Sandcastle_Begin const viewer = new Cesium.Viewer("cesiumContainer"); - viewer.clock.currentTime = Cesium.JulianDate.fromIso8601( - "2022-08-01T00:00:00Z" - ); + viewer.clock.currentTime = Cesium.JulianDate.fromIso8601("2022-08-01T00:00:00Z"); - if ( - !Cesium.PostProcessStageLibrary.isAmbientOcclusionSupported( - viewer.scene - ) - ) { + if (!Cesium.PostProcessStageLibrary.isAmbientOcclusionSupported(viewer.scene)) { window.alert( - "This browser does not support the ambient occlusion post process." + "This browser does not support the ambient occlusion post process.", ); } @@ -144,27 +129,22 @@ Cesium.knockout.applyBindings(viewModel, toolbar); for (const name in viewModel) { if (viewModel.hasOwnProperty(name)) { - Cesium.knockout - .getObservable(viewModel, name) - .subscribe(updatePostProcess); + Cesium.knockout.getObservable(viewModel, name).subscribe(updatePostProcess); } } function updatePostProcess() { - const ambientOcclusion = - viewer.scene.postProcessStages.ambientOcclusion; + const ambientOcclusion = viewer.scene.postProcessStages.ambientOcclusion; ambientOcclusion.enabled = Boolean(viewModel.show) || Boolean(viewModel.ambientOcclusionOnly); ambientOcclusion.uniforms.ambientOcclusionOnly = Boolean( - viewModel.ambientOcclusionOnly + viewModel.ambientOcclusionOnly, ); ambientOcclusion.uniforms.intensity = Number(viewModel.intensity); ambientOcclusion.uniforms.bias = Number(viewModel.bias); ambientOcclusion.uniforms.lengthCap = Number(viewModel.lengthCap); ambientOcclusion.uniforms.stepSize = Number(viewModel.stepSize); - ambientOcclusion.uniforms.blurStepSize = Number( - viewModel.blurStepSize - ); + ambientOcclusion.uniforms.blurStepSize = Number(viewModel.blurStepSize); } updatePostProcess(); @@ -172,22 +152,22 @@ camera.position = new Cesium.Cartesian3( 1234127.2294710164, -5086011.666443127, - 3633337.0413351045 + 3633337.0413351045, ); camera.direction = new Cesium.Cartesian3( -0.5310064396211631, -0.30299013818088416, - -0.7913464078682514 + -0.7913464078682514, ); camera.right = new Cesium.Cartesian3( -0.8468592075426076, 0.1574051185945647, - 0.507989282604011 + 0.507989282604011, ); camera.up = Cesium.Cartesian3.cross( camera.right, camera.direction, - new Cesium.Cartesian3() + new Cesium.Cartesian3(), ); try { diff --git a/Apps/Sandcastle/gallery/ArcGIS MapServer.html b/Apps/Sandcastle/gallery/ArcGIS MapServer.html index 327eecd6bf16..2d02b7e7c5c9 100644 --- a/Apps/Sandcastle/gallery/ArcGIS MapServer.html +++ b/Apps/Sandcastle/gallery/ArcGIS MapServer.html @@ -1,4 +1,4 @@ - + @@ -18,10 +18,7 @@ > - + @@ -49,11 +46,11 @@ const viewer = new Cesium.Viewer("cesiumContainer", { baseLayer: Cesium.ImageryLayer.fromProviderAsync( Cesium.ArcGisMapServerImageryProvider.fromBasemapType( - Cesium.ArcGisBaseMapType.SATELLITE + Cesium.ArcGisBaseMapType.SATELLITE, // other supported styles include: // Cesium.ArcGisMapServerImageryProvider.HILLSHADE // Cesium.ArcGisMapServerImageryProvider.OCEANS - ) + ), ), }); diff --git a/Apps/Sandcastle/gallery/ArcGIS Tiled Elevation Terrain.html b/Apps/Sandcastle/gallery/ArcGIS Tiled Elevation Terrain.html index 3b485c41240f..7b141571a260 100644 --- a/Apps/Sandcastle/gallery/ArcGIS Tiled Elevation Terrain.html +++ b/Apps/Sandcastle/gallery/ArcGIS Tiled Elevation Terrain.html @@ -1,4 +1,4 @@ - + @@ -18,10 +18,7 @@ > - + @@ -35,9 +32,10 @@ const viewer = new Cesium.Viewer("cesiumContainer"); try { - viewer.scene.terrainProvider = await Cesium.ArcGISTiledElevationTerrainProvider.fromUrl( - "https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer" - ); + viewer.scene.terrainProvider = + await Cesium.ArcGISTiledElevationTerrainProvider.fromUrl( + "https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer", + ); } catch (error) { window.alert(`Failed to load terrain. ${error}`); } //Sandcastle_End diff --git a/Apps/Sandcastle/gallery/ArcticDEM.html b/Apps/Sandcastle/gallery/ArcticDEM.html index 98a03141ddeb..c9bad7bef52e 100644 --- a/Apps/Sandcastle/gallery/ArcticDEM.html +++ b/Apps/Sandcastle/gallery/ArcticDEM.html @@ -1,4 +1,4 @@ - + @@ -21,10 +21,7 @@ > - + @@ -40,9 +37,8 @@ try { // High-resolution arctic terrain from the Arctic DEM project (Release 4), tiled and hosted by Cesium ion. // https://www.pgc.umn.edu/data/arcticdem/ - viewer.scene.terrainProvider = await Cesium.CesiumTerrainProvider.fromIonAssetId( - 3956 - ); + viewer.scene.terrainProvider = + await Cesium.CesiumTerrainProvider.fromIonAssetId(3956); } catch (error) { window.alert(`Failed to load terrain. ${error}`); } @@ -57,7 +53,7 @@ destination: Cesium.Cartesian3.fromRadians( -2.6399828792482234, 1.0993550795541742, - 5795 + 5795, ), orientation: { heading: 3.8455, @@ -74,7 +70,7 @@ destination: Cesium.Cartesian3.fromRadians( -2.610708034601548, 1.0671172431736584, - 1900 + 1900, ), orientation: { heading: 4.6, @@ -91,7 +87,7 @@ destination: Cesium.Cartesian3.fromRadians( -2.6928866820212813, 1.072394255273859, - 3700 + 3700, ), orientation: { heading: 1.6308222948889464, @@ -108,7 +104,7 @@ destination: Cesium.Cartesian3.fromRadians( -2.6395623497608596, 1.0976443174490356, - 2070 + 2070, ), orientation: { heading: 6.068794108659519, @@ -119,14 +115,14 @@ }, }, ], - "toolbar" + "toolbar", ); viewer.scene.camera.flyTo({ destination: Cesium.Cartesian3.fromRadians( -2.6399828792482234, 1.0993550795541742, - 5795 + 5795, ), orientation: { heading: 3.8455, diff --git a/Apps/Sandcastle/gallery/Atmosphere.html b/Apps/Sandcastle/gallery/Atmosphere.html index bfa27c86c06d..1f2741655f23 100644 --- a/Apps/Sandcastle/gallery/Atmosphere.html +++ b/Apps/Sandcastle/gallery/Atmosphere.html @@ -1,4 +1,4 @@ - + @@ -7,10 +7,7 @@ name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no" /> - + Cesium Demo @@ -21,10 +18,7 @@ > - + @@ -74,11 +68,7 @@ Sandcastle.declare(changeBillboardProperties); const entity = viewer.entities.add({ - position: Cesium.Cartesian3.fromDegrees( - -75.59777, - 40.03883, - 300000.0 - ), + position: Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883, 300000.0), billboard: { image: "../images/Cesium_Logo_overlay.png", }, @@ -148,12 +138,7 @@ position: Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883), billboard: { image: "../images/Cesium_Logo_overlay.png", - translucencyByDistance: new Cesium.NearFarScalar( - 1.5e2, - 2.0, - 1.5e7, - 0.5 - ), + translucencyByDistance: new Cesium.NearFarScalar(1.5e2, 2.0, 1.5e7, 0.5), }, }); } @@ -188,14 +173,9 @@ 1.0e3, 1.0, 1.5e6, - 0.0 - ), - translucencyByDistance: new Cesium.NearFarScalar( - 1.0e3, - 1.0, - 1.5e6, - 0.1 + 0.0, ), + translucencyByDistance: new Cesium.NearFarScalar(1.0e3, 1.0, 1.5e6, 0.1), }, }); }); @@ -277,12 +257,12 @@ destination: new Cesium.Cartesian3( -2357576.243142461, -3744417.5604860787, - 4581807.855903771 + 4581807.855903771, ), orientation: new Cesium.HeadingPitchRoll( 5.9920811504170475, -0.6032820429886212, - 6.28201303164098 + 6.28201303164098, ), }); } diff --git a/Apps/Sandcastle/gallery/Bing Maps Labels Only.html b/Apps/Sandcastle/gallery/Bing Maps Labels Only.html index 2a827d793e0b..f4c12739f24f 100644 --- a/Apps/Sandcastle/gallery/Bing Maps Labels Only.html +++ b/Apps/Sandcastle/gallery/Bing Maps Labels Only.html @@ -1,4 +1,4 @@ - + @@ -21,10 +21,7 @@ > - + @@ -149,9 +143,7 @@ Cesium.knockout.applyBindings(viewModel, toolbar); for (const name in viewModel) { if (viewModel.hasOwnProperty(name)) { - Cesium.knockout - .getObservable(viewModel, name) - .subscribe(updatePostProcess); + Cesium.knockout.getObservable(viewModel, name).subscribe(updatePostProcess); } } @@ -170,12 +162,12 @@ const target = Cesium.Cartesian3.fromDegrees( initialLon + lonIncrement, lat, - height + 7.5 + height + 7.5, ); const offset = new Cesium.Cartesian3( -37.048378684557974, -24.852967044804245, - 4.352023653686047 + 4.352023653686047, ); viewer.scene.camera.lookAt(target, offset); //Sandcastle_End diff --git a/Apps/Sandcastle/gallery/Blue Marble.html b/Apps/Sandcastle/gallery/Blue Marble.html index 977210bd83ec..626a53cfdcd3 100644 --- a/Apps/Sandcastle/gallery/Blue Marble.html +++ b/Apps/Sandcastle/gallery/Blue Marble.html @@ -1,4 +1,4 @@ - + @@ -21,10 +21,7 @@ > - + @@ -38,7 +35,7 @@ // Blue Marble Next Generation July, 2004 imagery from NASA const viewer = new Cesium.Viewer("cesiumContainer", { baseLayer: Cesium.ImageryLayer.fromProviderAsync( - Cesium.IonImageryProvider.fromAssetId(3845) + Cesium.IonImageryProvider.fromAssetId(3845), ), }); //Sandcastle_End diff --git a/Apps/Sandcastle/gallery/Box.html b/Apps/Sandcastle/gallery/Box.html index a6a97eac6127..52b433743102 100644 --- a/Apps/Sandcastle/gallery/Box.html +++ b/Apps/Sandcastle/gallery/Box.html @@ -1,4 +1,4 @@ - + @@ -18,10 +18,7 @@ > - + diff --git a/Apps/Sandcastle/gallery/CZML 3D Tiles.html b/Apps/Sandcastle/gallery/CZML 3D Tiles.html index 5adbfd88c8f1..9dbecfa905d6 100644 --- a/Apps/Sandcastle/gallery/CZML 3D Tiles.html +++ b/Apps/Sandcastle/gallery/CZML 3D Tiles.html @@ -1,4 +1,4 @@ - + @@ -18,10 +18,7 @@ > - + @@ -42,8 +39,7 @@ id: "BatchedColors", name: "BatchedColors", tileset: { - uri: - "../../SampleData/Cesium3DTiles/Batched/BatchedColors/tileset.json", + uri: "../../SampleData/Cesium3DTiles/Batched/BatchedColors/tileset.json", }, }, ]; @@ -53,7 +49,7 @@ }); const dataSourcePromise = viewer.dataSources.add( - Cesium.CzmlDataSource.load(czml) + Cesium.CzmlDataSource.load(czml), ); dataSourcePromise diff --git a/Apps/Sandcastle/gallery/CZML Billboard and Label.html b/Apps/Sandcastle/gallery/CZML Billboard and Label.html index c63aa7c703f9..e53cc0e30c51 100644 --- a/Apps/Sandcastle/gallery/CZML Billboard and Label.html +++ b/Apps/Sandcastle/gallery/CZML Billboard and Label.html @@ -1,4 +1,4 @@ - + @@ -18,10 +18,7 @@ > - + @@ -66,11 +63,7 @@ }, }, position: { - cartesian: [ - 1216361.4096947117, - -4736253.175342511, - 4081267.4865667094, - ], + cartesian: [1216361.4096947117, -4736253.175342511, 4081267.4865667094], }, }, ]; diff --git a/Apps/Sandcastle/gallery/CZML Box.html b/Apps/Sandcastle/gallery/CZML Box.html index e698bb0e70d8..e5d8931c6256 100644 --- a/Apps/Sandcastle/gallery/CZML Box.html +++ b/Apps/Sandcastle/gallery/CZML Box.html @@ -1,4 +1,4 @@ - + @@ -18,10 +18,7 @@ > - + diff --git a/Apps/Sandcastle/gallery/CZML Circles and Ellipses.html b/Apps/Sandcastle/gallery/CZML Circles and Ellipses.html index 09233ee270db..d602d6e97ebc 100644 --- a/Apps/Sandcastle/gallery/CZML Circles and Ellipses.html +++ b/Apps/Sandcastle/gallery/CZML Circles and Ellipses.html @@ -1,4 +1,4 @@ - + @@ -18,10 +18,7 @@ > - + @@ -83,8 +80,7 @@ }, { id: "shape3", - name: - "Blue translucent, rotated, and extruded ellipse with outline", + name: "Blue translucent, rotated, and extruded ellipse with outline", position: { cartographicDegrees: [-95.0, 40.0, 100000.0], }, diff --git a/Apps/Sandcastle/gallery/CZML Colors.html b/Apps/Sandcastle/gallery/CZML Colors.html index 0ab646b53ebd..6e71fb0ecebd 100644 --- a/Apps/Sandcastle/gallery/CZML Colors.html +++ b/Apps/Sandcastle/gallery/CZML Colors.html @@ -1,4 +1,4 @@ - + @@ -18,10 +18,7 @@ > - + diff --git a/Apps/Sandcastle/gallery/CZML Cones and Cylinders.html b/Apps/Sandcastle/gallery/CZML Cones and Cylinders.html index 65bab8ed8407..56a80efcc87d 100644 --- a/Apps/Sandcastle/gallery/CZML Cones and Cylinders.html +++ b/Apps/Sandcastle/gallery/CZML Cones and Cylinders.html @@ -1,4 +1,4 @@ - + @@ -18,10 +18,7 @@ > - + diff --git a/Apps/Sandcastle/gallery/CZML Corridor.html b/Apps/Sandcastle/gallery/CZML Corridor.html index 3a80bd542912..c603188156df 100644 --- a/Apps/Sandcastle/gallery/CZML Corridor.html +++ b/Apps/Sandcastle/gallery/CZML Corridor.html @@ -1,4 +1,4 @@ - + @@ -18,10 +18,7 @@ > - + @@ -44,17 +41,7 @@ name: "Red corridor on surface with rounded corners", corridor: { positions: { - cartographicDegrees: [ - -100.0, - 40.0, - 0, - -105.0, - 40.0, - 0, - -105.0, - 35.0, - 0, - ], + cartographicDegrees: [-100.0, 40.0, 0, -105.0, 40.0, 0, -105.0, 35.0, 0], }, width: 200000.0, material: { @@ -71,17 +58,7 @@ name: "Green corridor at height with mitered corners and outline", corridor: { positions: { - cartographicDegrees: [ - -90.0, - 40.0, - 0, - -95.0, - 40.0, - 0, - -95.0, - 35.0, - 0, - ], + cartographicDegrees: [-90.0, 40.0, 0, -95.0, 40.0, 0, -95.0, 35.0, 0], }, height: 100000.0, cornerType: "MITERED", @@ -104,17 +81,7 @@ name: "Blue extruded corridor with beveled corners and outline", corridor: { positions: { - cartographicDegrees: [ - -80.0, - 40.0, - 0, - -85.0, - 40.0, - 0, - -85.0, - 35.0, - 0, - ], + cartographicDegrees: [-80.0, 40.0, 0, -85.0, 40.0, 0, -85.0, 35.0, 0], }, height: 200000.0, extrudedHeight: 100000.0, diff --git a/Apps/Sandcastle/gallery/CZML Custom Properties.html b/Apps/Sandcastle/gallery/CZML Custom Properties.html index 08668919f590..b20add92fe4e 100644 --- a/Apps/Sandcastle/gallery/CZML Custom Properties.html +++ b/Apps/Sandcastle/gallery/CZML Custom Properties.html @@ -1,4 +1,4 @@ - + @@ -18,10 +18,7 @@ > - + @@ -91,18 +88,7 @@ polygon: { positions: { cartographicDegrees: [ - -109.03, - 41, - 0, - -102.03, - 41, - 0, - -102.03, - 37, - 0, - -109.03, - 37, - 0, + -109.03, 41, 0, -102.03, 41, 0, -102.03, 37, 0, -109.03, 37, 0, ], }, material: { @@ -137,7 +123,7 @@ function setExtrudedHeight(propertyName) { loadedPromise.then(function () { const customPropertyObject = dataSource.entities.getById( - "custom_property_object" + "custom_property_object", ); const property = customPropertyObject.properties[propertyName]; const colorado = dataSource.entities.getById("colorado"); @@ -167,7 +153,7 @@ }, }, ], - "propertiesMenu" + "propertiesMenu", ); viewer.dataSources.add(dataSource); diff --git a/Apps/Sandcastle/gallery/CZML Model - Node Transformations.html b/Apps/Sandcastle/gallery/CZML Model - Node Transformations.html index 10c8329c6c31..10de6e4428fe 100644 --- a/Apps/Sandcastle/gallery/CZML Model - Node Transformations.html +++ b/Apps/Sandcastle/gallery/CZML Model - Node Transformations.html @@ -1,4 +1,4 @@ - + @@ -18,10 +18,7 @@ > - + @@ -60,32 +57,19 @@ rotation: { epoch: "2015-01-01T00:00:00Z", unitQuaternion: [ - 0, - -0.23381920887303329, - -0.6909886782144156, - -0.0938384854833712, - 0.6775378681547408, - 10, - -0.4924076887347565, - -0.6304934596091216, - 0.20657864059632378, - 0.563327551886459, - 20, - -0.23381920887303329, - -0.6909886782144156, - -0.0938384854833712, - 0.6775378681547408, + 0, -0.23381920887303329, -0.6909886782144156, -0.0938384854833712, + 0.6775378681547408, 10, -0.4924076887347565, -0.6304934596091216, + 0.20657864059632378, 0.563327551886459, 20, -0.23381920887303329, + -0.6909886782144156, -0.0938384854833712, 0.6775378681547408, ], }, }, Skeleton_arm_joint_R__2_: { rotation: { unitQuaternion: [ - -0.2840422631464792, - -0.40211904424847345, + -0.2840422631464792, -0.40211904424847345, // eslint-disable-next-line no-loss-of-precision - 0.25175867757399086, - 0.7063888981321548, + 0.25175867757399086, 0.7063888981321548, ], }, }, @@ -99,7 +83,7 @@ }); const dataSourcePromise = viewer.dataSources.add( - Cesium.CzmlDataSource.load(czml) + Cesium.CzmlDataSource.load(czml), ); dataSourcePromise diff --git a/Apps/Sandcastle/gallery/CZML Model Articulations.html b/Apps/Sandcastle/gallery/CZML Model Articulations.html index b0646be054d3..39d5206b6b63 100644 --- a/Apps/Sandcastle/gallery/CZML Model Articulations.html +++ b/Apps/Sandcastle/gallery/CZML Model Articulations.html @@ -1,4 +1,4 @@ - + @@ -18,10 +18,7 @@ > - + @@ -53,8 +50,7 @@ cartographicDegrees: [-77, 37, 10000], }, model: { - gltf: - "https://cesium.com/public/SandcastleSampleData/launchvehicle.glb", + gltf: "https://cesium.com/public/SandcastleSampleData/launchvehicle.glb", scale: 2.0, minimumPixelSize: 128, runAnimations: false, @@ -83,7 +79,7 @@ }); const dataSourcePromise = viewer.dataSources.add( - Cesium.CzmlDataSource.load(czml) + Cesium.CzmlDataSource.load(czml), ); dataSourcePromise diff --git a/Apps/Sandcastle/gallery/CZML Model Data URL.html b/Apps/Sandcastle/gallery/CZML Model Data URL.html index e7862e2915aa..88c54c659a2f 100644 --- a/Apps/Sandcastle/gallery/CZML Model Data URL.html +++ b/Apps/Sandcastle/gallery/CZML Model Data URL.html @@ -1,4 +1,4 @@ - + @@ -18,10 +18,7 @@ > - + @@ -71,8 +68,7 @@ { name: "19bd138d-63f9-4012-890c-30ab6b478824", byteLength: 648, - uri: - "data:application/octet-stream;base64,AACAvwAAgL8AAIC/AACAPwAAgD8AAIC/AACAPwAAgL8AAIC/AACAvwAAgD8AAIC/AACAvwAAgL8AAIC/AACAvwAAgD8AAIA/AACAvwAAgD8AAIC/AACAvwAAgL8AAIA/AACAvwAAgD8AAIC/AACAPwAAgD8AAIA/AACAPwAAgD8AAIC/AACAvwAAgD8AAIA/AACAPwAAgL8AAIC/AACAPwAAgD8AAIC/AACAPwAAgD8AAIA/AACAPwAAgL8AAIA/AACAvwAAgL8AAIC/AACAPwAAgL8AAIC/AACAPwAAgL8AAIA/AACAvwAAgL8AAIA/AACAvwAAgL8AAIA/AACAPwAAgL8AAIA/AACAPwAAgD8AAIA/AACAvwAAgD8AAIA/AAAAAAAAAAAAAIC/AAAAAAAAAAAAAIC/AAAAAAAAAAAAAIC/AAAAAAAAAAAAAIC/AACAvwAAAAAAAAAAAACAvwAAAAAAAAAAAACAvwAAAAAAAAAAAACAvwAAAAAAAAAAAAAAAAAAgD8AAAAAAAAAAAAAgD8AAAAAAAAAAAAAgD8AAAAAAAAAAAAAgD8AAAAAAACAPwAAAAAAAAAAAACAPwAAAAAAAAAAAACAPwAAAAAAAAAAAACAPwAAAAAAAAAAAAAAAAAAgL8AAAAAAAAAAAAAgL8AAAAAAAAAAAAAgL8AAAAAAAAAAAAAgL8AAAAAAAAAAAAAAAAAAIA/AAAAAAAAAAAAAIA/AAAAAAAAAAAAAIA/AAAAAAAAAAAAAIA/AAABAAIAAAADAAEABAAFAAYABAAHAAUACAAJAAoACAALAAkADAANAA4ADAAOAA8AEAARABIAEAASABMAFAAVABYAFAAWABcA", + uri: "data:application/octet-stream;base64,AACAvwAAgL8AAIC/AACAPwAAgD8AAIC/AACAPwAAgL8AAIC/AACAvwAAgD8AAIC/AACAvwAAgL8AAIC/AACAvwAAgD8AAIA/AACAvwAAgD8AAIC/AACAvwAAgL8AAIA/AACAvwAAgD8AAIC/AACAPwAAgD8AAIA/AACAPwAAgD8AAIC/AACAvwAAgD8AAIA/AACAPwAAgL8AAIC/AACAPwAAgD8AAIC/AACAPwAAgD8AAIA/AACAPwAAgL8AAIA/AACAvwAAgL8AAIC/AACAPwAAgL8AAIC/AACAPwAAgL8AAIA/AACAvwAAgL8AAIA/AACAvwAAgL8AAIA/AACAPwAAgL8AAIA/AACAPwAAgD8AAIA/AACAvwAAgD8AAIA/AAAAAAAAAAAAAIC/AAAAAAAAAAAAAIC/AAAAAAAAAAAAAIC/AAAAAAAAAAAAAIC/AACAvwAAAAAAAAAAAACAvwAAAAAAAAAAAACAvwAAAAAAAAAAAACAvwAAAAAAAAAAAAAAAAAAgD8AAAAAAAAAAAAAgD8AAAAAAAAAAAAAgD8AAAAAAAAAAAAAgD8AAAAAAACAPwAAAAAAAAAAAACAPwAAAAAAAAAAAACAPwAAAAAAAAAAAACAPwAAAAAAAAAAAAAAAAAAgL8AAAAAAAAAAAAAgL8AAAAAAAAAAAAAgL8AAAAAAAAAAAAAgL8AAAAAAAAAAAAAAAAAAIA/AAAAAAAAAAAAAIA/AAAAAAAAAAAAAIA/AAAAAAAAAAAAAIA/AAABAAIAAAADAAEABAAFAAYABAAHAAUACAAJAAoACAALAAkADAANAA4ADAAOAA8AEAARABIAEAASABMAFAAVABYAFAAWABcA", }, ], bufferViews: [ @@ -160,7 +156,7 @@ }); const dataSourcePromise = viewer.dataSources.add( - Cesium.CzmlDataSource.load(czml) + Cesium.CzmlDataSource.load(czml), ); dataSourcePromise diff --git a/Apps/Sandcastle/gallery/CZML Model.html b/Apps/Sandcastle/gallery/CZML Model.html index dd11df82b266..ea0b1e03609a 100644 --- a/Apps/Sandcastle/gallery/CZML Model.html +++ b/Apps/Sandcastle/gallery/CZML Model.html @@ -1,4 +1,4 @@ - + @@ -18,10 +18,7 @@ > - + @@ -58,14 +55,12 @@ }); const dataSourcePromise = viewer.dataSources.add( - Cesium.CzmlDataSource.load(czml) + Cesium.CzmlDataSource.load(czml), ); dataSourcePromise .then(function (dataSource) { - viewer.trackedEntity = dataSource.entities.getById( - "aircraft model" - ); + viewer.trackedEntity = dataSource.entities.getById("aircraft model"); }) .catch(function (error) { window.alert(error); diff --git a/Apps/Sandcastle/gallery/CZML Path.html b/Apps/Sandcastle/gallery/CZML Path.html index ea38f129d0c5..99f234cefcf4 100644 --- a/Apps/Sandcastle/gallery/CZML Path.html +++ b/Apps/Sandcastle/gallery/CZML Path.html @@ -1,4 +1,4 @@ - + @@ -18,10 +18,7 @@ > - + @@ -78,7166 +75,898 @@ position: { epoch: "2012-08-04T10:00:00Z", cartographicDegrees: [ - 0, - -122.93797, - 39.50935, - 1776, - 10, - -122.93822, - 39.50918, - 1773, - 20, - -122.9385, - 39.50883, - 1772, - 30, - -122.93855, - 39.50842, - 1770, - 40, - -122.93868, - 39.50792, - 1770, - 50, - -122.93877, - 39.50743, - 1767, - 60, - -122.93862, - 39.50697, - 1771, - 70, - -122.93828, - 39.50648, - 1765, - 80, - -122.93818, - 39.50608, - 1770, - 90, - -122.93783, - 39.5057, - 1754, - 100, - -122.93777, - 39.50513, - 1732, - 110, - -122.93793, - 39.50458, - 1727, - 120, - -122.93815, - 39.50415, - 1717, - 130, - -122.9382, - 39.50362, - 1713, - 140, - -122.93818, - 39.5031, - 1703, - 150, - -122.93812, - 39.50258, - 1706, - 160, - -122.93792, - 39.5022, - 1707, - 170, - -122.93775, - 39.50177, - 1698, - 180, - -122.93745, - 39.50125, - 1693, - 190, - -122.93723, - 39.50073, - 1694, - 200, - -122.9373, - 39.50023, - 1702, - 210, - -122.93705, - 39.49987, - 1705, - 220, - -122.93642, - 39.4996, - 1699, - 230, - -122.93593, - 39.49927, - 1693, - 240, - -122.936, - 39.49895, - 1691, - 250, - -122.93645, - 39.49907, - 1689, - 260, - -122.93685, - 39.49915, - 1684, - 270, - -122.93708, - 39.4989, - 1680, - 280, - -122.93687, - 39.49843, - 1684, - 290, - -122.93685, - 39.49808, - 1691, - 300, - -122.93722, - 39.49815, - 1688, - 310, - -122.93712, - 39.49867, - 1680, - 320, - -122.93633, - 39.49893, - 1681, - 330, - -122.93615, - 39.4989, - 1682, - 340, - -122.936, - 39.49885, - 1682, - 350, - -122.93587, - 39.49877, - 1682, - 360, - -122.93577, - 39.49868, - 1683, - 370, - -122.93568, - 39.4986, - 1685, - 380, - -122.93563, - 39.49853, - 1685, - 390, - -122.9356, - 39.49845, - 1685, - 400, - -122.9356, - 39.4984, - 1685, - 410, - -122.93562, - 39.49835, - 1685, - 420, - -122.93565, - 39.4983, - 1686, - 430, - -122.93568, - 39.49827, - 1684, - 440, - -122.93572, - 39.49822, - 1684, - 450, - -122.93575, - 39.49817, - 1682, - 460, - -122.93577, - 39.49812, - 1682, - 470, - -122.93578, - 39.49805, - 1682, - 480, - -122.93573, - 39.498, - 1682, - 490, - -122.93567, - 39.49795, - 1681, - 500, - -122.93555, - 39.4979, - 1678, - 510, - -122.9354, - 39.49788, - 1676, - 520, - -122.93522, - 39.49792, - 1674, - 530, - -122.93502, - 39.49795, - 1674, - 540, - -122.93492, - 39.4981, - 1671, - 550, - -122.93483, - 39.49827, - 1669, - 560, - -122.93485, - 39.49842, - 1668, - 570, - -122.93493, - 39.49855, - 1665, - 580, - -122.93502, - 39.49868, - 1664, - 590, - -122.93517, - 39.4987, - 1665, - 600, - -122.9353, - 39.49873, - 1665, - 610, - -122.93543, - 39.49873, - 1663, - 620, - -122.93553, - 39.49873, - 1661, - 630, - -122.93567, - 39.49872, - 1660, - 640, - -122.93577, - 39.49868, - 1663, - 650, - -122.93585, - 39.49865, - 1665, - 660, - -122.93592, - 39.49862, - 1667, - 670, - -122.93597, - 39.4986, - 1665, - 680, - -122.93607, - 39.49857, - 1664, - 690, - -122.93617, - 39.49857, - 1664, - 700, - -122.93627, - 39.49857, - 1664, - 710, - -122.93638, - 39.49857, - 1664, - 720, - -122.9365, - 39.49857, - 1666, - 730, - -122.9366, - 39.49857, - 1666, - 740, - -122.93672, - 39.49852, - 1668, - 750, - -122.93678, - 39.49847, - 1672, - 760, - -122.93685, - 39.49842, - 1673, - 770, - -122.93693, - 39.4984, - 1672, - 780, - -122.937, - 39.49837, - 1670, - 790, - -122.93707, - 39.49832, - 1669, - 800, - -122.9371, - 39.49827, - 1671, - 810, - -122.93713, - 39.4982, - 1671, - 820, - -122.93712, - 39.49813, - 1669, - 830, - -122.93708, - 39.49805, - 1666, - 840, - -122.93702, - 39.49797, - 1663, - 850, - -122.9369, - 39.49787, - 1663, - 860, - -122.93675, - 39.4978, - 1664, - 870, - -122.93657, - 39.49773, - 1667, - 880, - -122.9364, - 39.49772, - 1670, - 890, - -122.93623, - 39.49773, - 1671, - 900, - -122.93608, - 39.49777, - 1670, - 910, - -122.93592, - 39.49777, - 1667, - 920, - -122.93573, - 39.49773, - 1667, - 930, - -122.93557, - 39.49767, - 1667, - 940, - -122.93547, - 39.49762, - 1666, - 950, - -122.93538, - 39.49753, - 1664, - 960, - -122.93537, - 39.49747, - 1661, - 970, - -122.93542, - 39.49738, - 1657, - 980, - -122.9355, - 39.49732, - 1655, - 990, - -122.9356, - 39.49727, - 1653, - 1000, - -122.93573, - 39.49725, - 1653, - 1010, - -122.93588, - 39.49725, - 1652, - 1020, - -122.93602, - 39.49728, - 1652, - 1030, - -122.93617, - 39.49732, - 1651, - 1040, - -122.93628, - 39.49738, - 1651, - 1050, - -122.93638, - 39.49745, - 1650, - 1060, - -122.9365, - 39.49752, - 1649, - 1070, - -122.93658, - 39.4976, - 1649, - 1080, - -122.93667, - 39.49768, - 1650, - 1090, - -122.93675, - 39.4978, - 1651, - 1100, - -122.93683, - 39.49788, - 1654, - 1110, - -122.93692, - 39.49797, - 1658, - 1120, - -122.93698, - 39.49803, - 1661, - 1130, - -122.93707, - 39.4981, - 1661, - 1140, - -122.93717, - 39.49817, - 1661, - 1150, - -122.93725, - 39.49822, - 1661, - 1160, - -122.93737, - 39.49825, - 1661, - 1170, - -122.93745, - 39.49823, - 1662, - 1180, - -122.93748, - 39.49817, - 1661, - 1190, - -122.93747, - 39.49808, - 1658, - 1200, - -122.93732, - 39.49803, - 1657, - 1210, - -122.93715, - 39.49807, - 1660, - 1220, - -122.937, - 39.49813, - 1663, - 1230, - -122.93692, - 39.49823, - 1666, - 1240, - -122.93688, - 39.49833, - 1666, - 1250, - -122.93692, - 39.49843, - 1665, - 1260, - -122.93698, - 39.49848, - 1663, - 1270, - -122.93708, - 39.4985, - 1661, - 1280, - -122.93717, - 39.49848, - 1660, - 1290, - -122.93725, - 39.49842, - 1659, - 1300, - -122.93728, - 39.49832, - 1661, - 1310, - -122.93725, - 39.49823, - 1663, - 1320, - -122.93717, - 39.49817, - 1663, - 1330, - -122.93705, - 39.49812, - 1666, - 1340, - -122.93692, - 39.49812, - 1666, - 1350, - -122.93675, - 39.49815, - 1667, - 1360, - -122.93663, - 39.49825, - 1668, - 1370, - -122.93657, - 39.49835, - 1670, - 1380, - -122.93655, - 39.49847, - 1672, - 1390, - -122.93657, - 39.49855, - 1673, - 1400, - -122.93663, - 39.49863, - 1673, - 1410, - -122.93675, - 39.49868, - 1671, - 1420, - -122.93685, - 39.49872, - 1672, - 1430, - -122.93695, - 39.4987, - 1674, - 1440, - -122.93702, - 39.49865, - 1677, - 1450, - -122.93703, - 39.49858, - 1679, - 1460, - -122.93705, - 39.4985, - 1680, - 1470, - -122.93702, - 39.49843, - 1681, - 1480, - -122.93693, - 39.49837, - 1682, - 1490, - -122.93682, - 39.49833, - 1683, - 1500, - -122.9367, - 39.49832, - 1683, - 1510, - -122.93653, - 39.4983, - 1684, - 1520, - -122.93638, - 39.49833, - 1686, - 1530, - -122.93627, - 39.49838, - 1688, - 1540, - -122.93613, - 39.49847, - 1688, - 1550, - -122.93605, - 39.49857, - 1688, - 1560, - -122.936, - 39.49868, - 1689, - 1570, - -122.93603, - 39.4988, - 1691, - 1580, - -122.93612, - 39.49888, - 1693, - 1590, - -122.9362, - 39.49893, - 1693, - 1600, - -122.9363, - 39.49893, - 1695, - 1610, - -122.93638, - 39.4989, - 1695, - 1620, - -122.93645, - 39.49883, - 1696, - 1630, - -122.93647, - 39.49877, - 1696, - 1640, - -122.93643, - 39.49868, - 1699, - 1650, - -122.93637, - 39.4986, - 1701, - 1660, - -122.93625, - 39.49857, - 1702, - 1670, - -122.9361, - 39.49857, - 1703, - 1680, - -122.93593, - 39.49858, - 1704, - 1690, - -122.9358, - 39.49862, - 1704, - 1700, - -122.93568, - 39.4987, - 1703, - 1710, - -122.93558, - 39.4988, - 1703, - 1720, - -122.93553, - 39.49892, - 1703, - 1730, - -122.93553, - 39.49905, - 1702, - 1740, - -122.93558, - 39.49917, - 1705, - 1750, - -122.93565, - 39.49925, - 1708, - 1760, - -122.93573, - 39.49932, - 1709, - 1770, - -122.93582, - 39.49933, - 1711, - 1780, - -122.93592, - 39.49932, - 1713, - 1790, - -122.93595, - 39.49927, - 1714, - 1800, - -122.93598, - 39.4992, - 1714, - 1810, - -122.93597, - 39.49912, - 1715, - 1820, - -122.93588, - 39.49903, - 1716, - 1830, - -122.93575, - 39.49897, - 1717, - 1840, - -122.9356, - 39.49895, - 1718, - 1850, - -122.93545, - 39.49895, - 1717, - 1860, - -122.93527, - 39.499, - 1717, - 1870, - -122.9351, - 39.49908, - 1719, - 1880, - -122.935, - 39.49918, - 1719, - 1890, - -122.93492, - 39.49932, - 1719, - 1900, - -122.93492, - 39.49945, - 1720, - 1910, - -122.93493, - 39.49957, - 1721, - 1920, - -122.935, - 39.49965, - 1722, - 1930, - -122.9351, - 39.49972, - 1724, - 1940, - -122.9352, - 39.49978, - 1726, - 1950, - -122.93528, - 39.4998, - 1727, - 1960, - -122.93535, - 39.49982, - 1728, - 1970, - -122.93543, - 39.49978, - 1727, - 1980, - -122.93548, - 39.49973, - 1726, - 1990, - -122.93552, - 39.49965, - 1728, - 2000, - -122.93548, - 39.49957, - 1729, - 2010, - -122.93542, - 39.49948, - 1728, - 2020, - -122.93527, - 39.49942, - 1729, - 2030, - -122.93512, - 39.49942, - 1731, - 2040, - -122.93495, - 39.49942, - 1732, - 2050, - -122.9348, - 39.49948, - 1731, - 2060, - -122.9347, - 39.49957, - 1732, - 2070, - -122.93463, - 39.49968, - 1733, - 2080, - -122.93462, - 39.49978, - 1733, - 2090, - -122.93463, - 39.4999, - 1732, - 2100, - -122.9347, - 39.49998, - 1733, - 2110, - -122.93478, - 39.50003, - 1736, - 2120, - -122.93487, - 39.50007, - 1739, - 2130, - -122.93495, - 39.50007, - 1740, - 2140, - -122.93502, - 39.50005, - 1741, - 2150, - -122.9351, - 39.5, - 1742, - 2160, - -122.93513, - 39.49993, - 1743, - 2170, - -122.93513, - 39.49985, - 1744, - 2180, - -122.9351, - 39.49977, - 1747, - 2190, - -122.93502, - 39.4997, - 1750, - 2200, - -122.9349, - 39.49967, - 1753, - 2210, - -122.93478, - 39.49965, - 1753, - 2220, - -122.93467, - 39.49965, - 1750, - 2230, - -122.9345, - 39.49967, - 1747, - 2240, - -122.93435, - 39.49973, - 1745, - 2250, - -122.9342, - 39.49983, - 1747, - 2260, - -122.9341, - 39.49995, - 1749, - 2270, - -122.93407, - 39.50003, - 1749, - 2280, - -122.93407, - 39.50013, - 1749, - 2290, - -122.9341, - 39.50025, - 1748, - 2300, - -122.9342, - 39.50032, - 1750, - 2310, - -122.9343, - 39.50037, - 1751, - 2320, - -122.9344, - 39.5004, - 1754, - 2330, - -122.9345, - 39.50042, - 1755, - 2340, - -122.93462, - 39.50042, - 1756, - 2350, - -122.93468, - 39.50038, - 1757, - 2360, - -122.93473, - 39.50032, - 1760, - 2370, - -122.93472, - 39.50025, - 1762, - 2380, - -122.93463, - 39.50017, - 1762, - 2390, - -122.93447, - 39.50012, - 1764, - 2400, - -122.93432, - 39.50013, - 1766, - 2410, - -122.93415, - 39.50015, - 1767, - 2420, - -122.93402, - 39.50023, - 1766, - 2430, - -122.9339, - 39.50032, - 1765, - 2440, - -122.9338, - 39.50043, - 1766, - 2450, - -122.93375, - 39.50057, - 1768, - 2460, - -122.93375, - 39.50068, - 1769, - 2470, - -122.9338, - 39.50077, - 1772, - 2480, - -122.93385, - 39.50082, - 1773, - 2490, - -122.93392, - 39.50085, - 1773, - 2500, - -122.93402, - 39.50088, - 1772, - 2510, - -122.93412, - 39.50087, - 1773, - 2520, - -122.93422, - 39.50083, - 1775, - 2530, - -122.9343, - 39.50078, - 1777, - 2540, - -122.93437, - 39.50073, - 1779, - 2550, - -122.9344, - 39.50067, - 1782, - 2560, - -122.93438, - 39.5006, - 1785, - 2570, - -122.93432, - 39.50053, - 1787, - 2580, - -122.9342, - 39.50048, - 1787, - 2590, - -122.93408, - 39.50048, - 1786, - 2600, - -122.93393, - 39.50052, - 1782, - 2610, - -122.93377, - 39.50057, - 1781, - 2620, - -122.93367, - 39.50065, - 1781, - 2630, - -122.93362, - 39.50083, - 1780, - 2640, - -122.93363, - 39.50098, - 1782, - 2650, - -122.93368, - 39.50108, - 1785, - 2660, - -122.93378, - 39.50118, - 1787, - 2670, - -122.93388, - 39.50125, - 1789, - 2680, - -122.93398, - 39.50128, - 1791, - 2690, - -122.93408, - 39.50128, - 1791, - 2700, - -122.93415, - 39.50125, - 1790, - 2710, - -122.9342, - 39.5012, - 1789, - 2720, - -122.93418, - 39.50113, - 1789, - 2730, - -122.93415, - 39.50108, - 1789, - 2740, - -122.93407, - 39.50102, - 1787, - 2750, - -122.93397, - 39.50098, - 1786, - 2760, - -122.93382, - 39.50097, - 1785, - 2770, - -122.93365, - 39.50097, - 1785, - 2780, - -122.9335, - 39.501, - 1785, - 2790, - -122.93337, - 39.50107, - 1782, - 2800, - -122.93323, - 39.50118, - 1782, - 2810, - -122.93317, - 39.5013, - 1783, - 2820, - -122.93317, - 39.50142, - 1785, - 2830, - -122.9332, - 39.50153, - 1786, - 2840, - -122.93327, - 39.50162, - 1786, - 2850, - -122.93337, - 39.50168, - 1785, - 2860, - -122.9335, - 39.50173, - 1787, - 2870, - -122.93365, - 39.50177, - 1790, - 2880, - -122.93377, - 39.50178, - 1791, - 2890, - -122.9339, - 39.50178, - 1791, - 2900, - -122.93402, - 39.50177, - 1790, - 2910, - -122.93413, - 39.50175, - 1788, - 2920, - -122.93425, - 39.50173, - 1786, - 2930, - -122.9344, - 39.50172, - 1785, - 2940, - -122.93452, - 39.5017, - 1785, - 2950, - -122.93465, - 39.50168, - 1785, - 2960, - -122.93477, - 39.50167, - 1784, - 2970, - -122.9349, - 39.50163, - 1781, - 2980, - -122.93503, - 39.5016, - 1778, - 2990, - -122.9351, - 39.50153, - 1778, - 3000, - -122.93512, - 39.50145, - 1781, - 3010, - -122.93507, - 39.50138, - 1781, - 3020, - -122.93498, - 39.50135, - 1778, - 3030, - -122.93485, - 39.50132, - 1775, - 3040, - -122.93468, - 39.50135, - 1773, - 3050, - -122.93453, - 39.50143, - 1772, - 3060, - -122.93442, - 39.50152, - 1773, - 3070, - -122.93435, - 39.50163, - 1772, - 3080, - -122.93435, - 39.50173, - 1770, - 3090, - -122.93442, - 39.50183, - 1767, - 3100, - -122.93453, - 39.50188, - 1766, - 3110, - -122.93467, - 39.50187, - 1765, - 3120, - -122.9348, - 39.50185, - 1764, - 3130, - -122.93488, - 39.50182, - 1763, - 3140, - -122.93498, - 39.50177, - 1763, - 3150, - -122.93505, - 39.50172, - 1761, - 3160, - -122.93512, - 39.50165, - 1759, - 3170, - -122.93522, - 39.50158, - 1757, - 3180, - -122.9353, - 39.50152, - 1757, - 3190, - -122.93538, - 39.50145, - 1757, - 3200, - -122.93545, - 39.50142, - 1755, - 3210, - -122.93553, - 39.50137, - 1751, - 3220, - -122.93562, - 39.5013, - 1746, - 3230, - -122.9357, - 39.50125, - 1744, - 3240, - -122.93578, - 39.50117, - 1741, - 3250, - -122.93583, - 39.50107, - 1741, - 3260, - -122.93587, - 39.50098, - 1741, - 3270, - -122.9359, - 39.5009, - 1740, - 3280, - -122.93592, - 39.5008, - 1739, - 3290, - -122.93592, - 39.50072, - 1739, - 3300, - -122.93585, - 39.50062, - 1741, - 3310, - -122.93577, - 39.50057, - 1744, - 3320, - -122.93565, - 39.50053, - 1743, - 3330, - -122.9355, - 39.50055, - 1741, - 3340, - -122.93535, - 39.50062, - 1737, - 3350, - -122.93522, - 39.50073, - 1735, - 3360, - -122.93517, - 39.50087, - 1735, - 3370, - -122.93518, - 39.50102, - 1735, - 3380, - -122.93525, - 39.50113, - 1733, - 3390, - -122.93537, - 39.5012, - 1731, - 3400, - -122.9355, - 39.50122, - 1728, - 3410, - -122.93565, - 39.5012, - 1726, - 3420, - -122.9358, - 39.50118, - 1726, - 3430, - -122.93595, - 39.50115, - 1726, - 3440, - -122.93607, - 39.50112, - 1728, - 3450, - -122.93617, - 39.50108, - 1731, - 3460, - -122.93625, - 39.50105, - 1734, - 3470, - -122.93633, - 39.50102, - 1736, - 3480, - -122.93638, - 39.50097, - 1737, - 3490, - -122.93642, - 39.50088, - 1738, - 3500, - -122.93638, - 39.5008, - 1738, - 3510, - -122.9363, - 39.50072, - 1739, - 3520, - -122.93617, - 39.50067, - 1740, - 3530, - -122.93602, - 39.50065, - 1742, - 3540, - -122.93583, - 39.50067, - 1742, - 3550, - -122.9357, - 39.50073, - 1743, - 3560, - -122.93558, - 39.50083, - 1744, - 3570, - -122.93552, - 39.50097, - 1745, - 3580, - -122.93552, - 39.50108, - 1744, - 3590, - -122.93557, - 39.5012, - 1744, - 3600, - -122.93567, - 39.50127, - 1743, - 3610, - -122.93577, - 39.50133, - 1743, - 3620, - -122.9359, - 39.50128, - 1747, - 3630, - -122.93595, - 39.50123, - 1752, - 3640, - -122.93598, - 39.50118, - 1755, - 3650, - -122.936, - 39.50112, - 1756, - 3660, - -122.936, - 39.50103, - 1756, - 3670, - -122.93595, - 39.50095, - 1757, - 3680, - -122.93585, - 39.50087, - 1761, - 3690, - -122.93572, - 39.50083, - 1764, - 3700, - -122.93557, - 39.50085, - 1767, - 3710, - -122.93543, - 39.5009, - 1769, - 3720, - -122.93532, - 39.50098, - 1768, - 3730, - -122.93522, - 39.5011, - 1767, - 3740, - -122.93518, - 39.50125, - 1766, - 3750, - -122.9352, - 39.5014, - 1766, - 3760, - -122.93527, - 39.50152, - 1768, - 3770, - -122.93537, - 39.5016, - 1770, - 3780, - -122.93548, - 39.50163, - 1773, - 3790, - -122.93558, - 39.50163, - 1773, - 3800, - -122.93567, - 39.50163, - 1774, - 3810, - -122.93577, - 39.5016, - 1776, - 3820, - -122.9358, - 39.50153, - 1778, - 3830, - -122.93578, - 39.50145, - 1780, - 3840, - -122.93573, - 39.50138, - 1781, - 3850, - -122.93563, - 39.5013, - 1781, - 3860, - -122.93547, - 39.50127, - 1781, - 3870, - -122.93527, - 39.50145, - 1783, - 3880, - -122.93515, - 39.50157, - 1786, - 3890, - -122.93513, - 39.5017, - 1790, - 3900, - -122.93515, - 39.50182, - 1793, - 3910, - -122.93522, - 39.50192, - 1797, - 3920, - -122.9353, - 39.50198, - 1797, - 3930, - -122.9354, - 39.502, - 1798, - 3940, - -122.93552, - 39.50197, - 1799, - 3950, - -122.93557, - 39.50192, - 1803, - 3960, - -122.93558, - 39.50185, - 1807, - 3970, - -122.93555, - 39.50177, - 1809, - 3980, - -122.93548, - 39.50168, - 1813, - 3990, - -122.93535, - 39.50163, - 1816, - 4000, - -122.93522, - 39.50163, - 1817, - 4010, - -122.93507, - 39.50163, - 1821, - 4020, - -122.93492, - 39.5017, - 1824, - 4030, - -122.9348, - 39.50177, - 1826, - 4040, - -122.9347, - 39.50187, - 1827, - 4050, - -122.93462, - 39.50198, - 1828, - 4060, - -122.9346, - 39.5021, - 1831, - 4070, - -122.93462, - 39.50223, - 1832, - 4080, - -122.93468, - 39.50235, - 1834, - 4090, - -122.93478, - 39.50243, - 1837, - 4100, - -122.93488, - 39.50247, - 1840, - 4110, - -122.93498, - 39.50248, - 1842, - 4120, - -122.93508, - 39.50247, - 1844, - 4130, - -122.93517, - 39.50242, - 1847, - 4140, - -122.93522, - 39.50238, - 1849, - 4150, - -122.93523, - 39.50232, - 1852, - 4160, - -122.9352, - 39.50225, - 1854, - 4170, - -122.93515, - 39.50217, - 1857, - 4180, - -122.93505, - 39.5021, - 1859, - 4190, - -122.93493, - 39.50207, - 1862, - 4200, - -122.9348, - 39.50205, - 1863, - 4210, - -122.93463, - 39.50207, - 1864, - 4220, - -122.9345, - 39.50213, - 1867, - 4230, - -122.93437, - 39.50223, - 1869, - 4240, - -122.9343, - 39.50237, - 1870, - 4250, - -122.93428, - 39.50248, - 1871, - 4260, - -122.9343, - 39.50262, - 1872, - 4270, - -122.93438, - 39.5027, - 1874, - 4280, - -122.93448, - 39.50277, - 1877, - 4290, - -122.9346, - 39.50277, - 1878, - 4300, - -122.9347, - 39.50273, - 1878, - 4310, - -122.93478, - 39.50265, - 1880, - 4320, - -122.9348, - 39.50257, - 1883, - 4330, - -122.9348, - 39.50247, - 1885, - 4340, - -122.93473, - 39.50238, - 1888, - 4350, - -122.93465, - 39.50232, - 1889, - 4360, - -122.93453, - 39.50227, - 1890, - 4370, - -122.93437, - 39.50225, - 1890, - 4380, - -122.93418, - 39.50227, - 1889, - 4390, - -122.93398, - 39.50233, - 1888, - 4400, - -122.93383, - 39.50245, - 1890, - 4410, - -122.93372, - 39.50257, - 1891, - 4420, - -122.93363, - 39.50272, - 1891, - 4430, - -122.93362, - 39.50285, - 1894, - 4440, - -122.93365, - 39.50298, - 1896, - 4450, - -122.93373, - 39.50312, - 1897, - 4460, - -122.93373, - 39.50312, - 1897, - 4470, - -122.93385, - 39.5032, - 1898, - 4480, - -122.93398, - 39.50327, - 1899, - 4490, - -122.9341, - 39.50328, - 1902, - 4500, - -122.93422, - 39.50328, - 1906, - 4510, - -122.93432, - 39.50325, - 1906, - 4520, - -122.93437, - 39.50322, - 1906, - 4530, - -122.9344, - 39.50313, - 1907, - 4540, - -122.9344, - 39.50307, - 1909, - 4550, - -122.93433, - 39.50302, - 1912, - 4560, - -122.93423, - 39.50295, - 1914, - 4570, - -122.93412, - 39.50292, - 1917, - 4580, - -122.93397, - 39.50292, - 1919, - 4590, - -122.9338, - 39.50295, - 1920, - 4600, - -122.93363, - 39.50303, - 1921, - 4610, - -122.93348, - 39.50315, - 1923, - 4620, - -122.9334, - 39.50328, - 1924, - 4630, - -122.93337, - 39.50342, - 1924, - 4640, - -122.9334, - 39.50357, - 1925, - 4650, - -122.93348, - 39.50367, - 1927, - 4660, - -122.93358, - 39.50372, - 1929, - 4670, - -122.93368, - 39.50373, - 1932, - 4680, - -122.93377, - 39.50373, - 1932, - 4690, - -122.93382, - 39.50368, - 1931, - 4700, - -122.93383, - 39.50362, - 1933, - 4710, - -122.93382, - 39.50355, - 1937, - 4720, - -122.93375, - 39.5035, - 1940, - 4730, - -122.93367, - 39.50345, - 1941, - 4740, - -122.93355, - 39.50342, - 1944, - 4750, - -122.9334, - 39.5034, - 1946, - 4760, - -122.93327, - 39.50342, - 1947, - 4770, - -122.93312, - 39.50347, - 1948, - 4780, - -122.93295, - 39.50353, - 1949, - 4790, - -122.93283, - 39.50363, - 1949, - 4800, - -122.93272, - 39.50377, - 1950, - 4810, - -122.93267, - 39.50388, - 1950, - 4820, - -122.93267, - 39.50402, - 1952, - 4830, - -122.93272, - 39.50415, - 1954, - 4840, - -122.93278, - 39.50423, - 1954, - 4850, - -122.93288, - 39.5043, - 1954, - 4860, - -122.933, - 39.50433, - 1954, - 4870, - -122.9331, - 39.50432, - 1956, - 4880, - -122.93322, - 39.50428, - 1958, - 4890, - -122.93327, - 39.50423, - 1960, - 4900, - -122.93327, - 39.50417, - 1964, - 4910, - -122.93323, - 39.50412, - 1967, - 4920, - -122.93317, - 39.50407, - 1968, - 4930, - -122.93308, - 39.50403, - 1966, - 4940, - -122.93295, - 39.504, - 1964, - 4950, - -122.9328, - 39.50397, - 1964, - 4960, - -122.93262, - 39.50395, - 1966, - 4970, - -122.93245, - 39.50397, - 1967, - 4980, - -122.9323, - 39.504, - 1970, - 4990, - -122.93215, - 39.50405, - 1971, - 5000, - -122.93203, - 39.50413, - 1970, - 5010, - -122.93192, - 39.50423, - 1967, - 5020, - -122.93182, - 39.5044, - 1965, - 5030, - -122.9318, - 39.50457, - 1964, - 5040, - -122.93185, - 39.50473, - 1966, - 5050, - -122.93193, - 39.50485, - 1968, - 5060, - -122.93202, - 39.50493, - 1969, - 5070, - -122.93215, - 39.50498, - 1969, - 5080, - -122.93227, - 39.50498, - 1969, - 5090, - -122.9324, - 39.50497, - 1969, - 5100, - -122.93252, - 39.50493, - 1970, - 5110, - -122.9326, - 39.5049, - 1973, - 5120, - -122.93267, - 39.50487, - 1977, - 5130, - -122.93273, - 39.50482, - 1980, - 5140, - -122.93275, - 39.50478, - 1981, - 5150, - -122.93273, - 39.50472, - 1982, - 5160, - -122.93267, - 39.50467, - 1982, - 5170, - -122.93253, - 39.50463, - 1981, - 5180, - -122.93237, - 39.50463, - 1979, - 5190, - -122.93217, - 39.50465, - 1978, - 5200, - -122.93197, - 39.50473, - 1977, - 5210, - -122.9318, - 39.50483, - 1976, - 5220, - -122.9317, - 39.50497, - 1975, - 5230, - -122.93165, - 39.50513, - 1974, - 5240, - -122.93168, - 39.50527, - 1972, - 5250, - -122.93177, - 39.50538, - 1970, - 5260, - -122.9319, - 39.50547, - 1967, - 5270, - -122.93222, - 39.50548, - 1963, - 5280, - -122.93232, - 39.50542, - 1969, - 5290, - -122.93242, - 39.50537, - 1973, - 5300, - -122.9325, - 39.50532, - 1977, - 5310, - -122.93257, - 39.50527, - 1978, - 5320, - -122.93263, - 39.50522, - 1978, - 5330, - -122.93273, - 39.50515, - 1979, - 5340, - -122.93282, - 39.50512, - 1981, - 5350, - -122.93293, - 39.5051, - 1984, - 5360, - -122.93307, - 39.50512, - 1989, - 5370, - -122.93317, - 39.50517, - 1993, - 5380, - -122.93327, - 39.50527, - 1994, - 5390, - -122.9333, - 39.50538, - 1996, - 5400, - -122.93328, - 39.50553, - 1996, - 5410, - -122.9332, - 39.50568, - 1995, - 5420, - -122.93308, - 39.50582, - 1997, - 5430, - -122.9329, - 39.50595, - 1999, - 5440, - -122.9327, - 39.50598, - 2002, - 5450, - -122.93255, - 39.50598, - 2009, - 5460, - -122.93243, - 39.50595, - 2012, - 5470, - -122.93237, - 39.5059, - 2011, - 5480, - -122.93232, - 39.50583, - 2010, - 5490, - -122.93235, - 39.50573, - 2011, - 5500, - -122.93243, - 39.50567, - 2013, - 5510, - -122.93255, - 39.50567, - 2017, - 5520, - -122.93268, - 39.5057, - 2018, - 5530, - -122.93278, - 39.50578, - 2019, - 5540, - -122.93287, - 39.50593, - 2021, - 5550, - -122.93295, - 39.50605, - 2022, - 5560, - -122.93305, - 39.50613, - 2023, - 5570, - -122.93315, - 39.5062, - 2023, - 5580, - -122.93323, - 39.50618, - 2026, - 5590, - -122.93328, - 39.50612, - 2027, - 5600, - -122.93323, - 39.50607, - 2028, - 5610, - -122.93313, - 39.50602, - 2029, - 5620, - -122.93297, - 39.506, - 2031, - 5630, - -122.9328, - 39.50605, - 2034, - 5640, - -122.93267, - 39.50612, - 2036, - 5650, - -122.93253, - 39.50623, - 2037, - 5660, - -122.93247, - 39.50633, - 2036, - 5670, - -122.93242, - 39.50648, - 2032, - 5680, - -122.93242, - 39.50665, - 2032, - 5690, - -122.93248, - 39.50678, - 2035, - 5700, - -122.93258, - 39.50688, - 2038, - 5710, - -122.9327, - 39.50693, - 2038, - 5720, - -122.93282, - 39.50693, - 2038, - 5730, - -122.9329, - 39.50688, - 2039, - 5740, - -122.93293, - 39.5068, - 2042, - 5750, - -122.93293, - 39.50673, - 2045, - 5760, - -122.93292, - 39.50665, - 2046, - 5770, - -122.93293, - 39.50655, - 2049, - 5780, - -122.933, - 39.5065, - 2056, - 5790, - -122.93305, - 39.50648, - 2063, - 5800, - -122.93312, - 39.50652, - 2064, - 5810, - -122.93322, - 39.50655, - 2062, - 5820, - -122.93333, - 39.50662, - 2061, - 5830, - -122.93345, - 39.50675, - 2061, - 5840, - -122.9335, - 39.5069, - 2061, - 5850, - -122.9335, - 39.50705, - 2062, - 5860, - -122.93345, - 39.50722, - 2063, - 5870, - -122.93335, - 39.50735, - 2063, - 5880, - -122.93322, - 39.50745, - 2062, - 5890, - -122.93303, - 39.50753, - 2064, - 5900, - -122.93287, - 39.50755, - 2067, - 5910, - -122.93273, - 39.50753, - 2070, - 5920, - -122.93262, - 39.5075, - 2072, - 5930, - -122.93253, - 39.50745, - 2075, - 5940, - -122.93248, - 39.5074, - 2079, - 5950, - -122.93247, - 39.50735, - 2080, - 5960, - -122.93245, - 39.50727, - 2082, - 5970, - -122.93248, - 39.5072, - 2084, - 5980, - -122.93257, - 39.50715, - 2087, - 5990, - -122.93267, - 39.50712, - 2091, - 6000, - -122.93277, - 39.50713, - 2094, - 6010, - -122.93288, - 39.50717, - 2095, - 6020, - -122.933, - 39.50723, - 2096, - 6030, - -122.93308, - 39.50733, - 2096, - 6040, - -122.93315, - 39.50747, - 2098, - 6050, - -122.9332, - 39.5076, - 2099, - 6060, - -122.93323, - 39.50773, - 2098, - 6070, - -122.93322, - 39.50788, - 2095, - 6080, - -122.9332, - 39.50805, - 2094, - 6090, - -122.93312, - 39.5082, - 2093, - 6100, - -122.933, - 39.50835, - 2093, - 6110, - -122.93287, - 39.50845, - 2094, - 6120, - -122.93272, - 39.50855, - 2095, - 6130, - -122.93255, - 39.5086, - 2095, - 6140, - -122.93238, - 39.50862, - 2096, - 6150, - -122.93225, - 39.50858, - 2097, - 6160, - -122.93215, - 39.50853, - 2098, - 6170, - -122.9321, - 39.50847, - 2100, - 6180, - -122.93207, - 39.50842, - 2101, - 6190, - -122.93208, - 39.50835, - 2103, - 6200, - -122.9321, - 39.50828, - 2106, - 6210, - -122.93213, - 39.50823, - 2109, - 6220, - -122.93217, - 39.50818, - 2111, - 6230, - -122.93222, - 39.50815, - 2113, - 6240, - -122.93228, - 39.50813, - 2113, - 6250, - -122.93235, - 39.50812, - 2112, - 6260, - -122.93247, - 39.5081, - 2111, - 6270, - -122.93258, - 39.5081, - 2110, - 6280, - -122.93273, - 39.50812, - 2110, - 6290, - -122.93288, - 39.50812, - 2111, - 6300, - -122.933, - 39.50812, - 2113, - 6310, - -122.9331, - 39.50808, - 2115, - 6320, - -122.93315, - 39.50803, - 2116, - 6330, - -122.93318, - 39.50798, - 2116, - 6340, - -122.93315, - 39.50793, - 2116, - 6350, - -122.9331, - 39.50788, - 2115, - 6360, - -122.93298, - 39.50783, - 2114, - 6370, - -122.93283, - 39.50783, - 2115, - 6380, - -122.93268, - 39.50787, - 2116, - 6390, - -122.93253, - 39.50792, - 2118, - 6400, - -122.9324, - 39.508, - 2120, - 6410, - -122.9323, - 39.50812, - 2122, - 6420, - -122.93222, - 39.50825, - 2122, - 6430, - -122.93218, - 39.50838, - 2122, - 6440, - -122.9322, - 39.50852, - 2123, - 6450, - -122.93228, - 39.50865, - 2122, - 6460, - -122.9324, - 39.50873, - 2123, - 6470, - -122.93253, - 39.5088, - 2123, - 6480, - -122.93263, - 39.50882, - 2124, - 6490, - -122.93272, - 39.50882, - 2121, - 6500, - -122.93282, - 39.50878, - 2117, - 6510, - -122.9329, - 39.50873, - 2116, - 6520, - -122.93298, - 39.50868, - 2117, - 6530, - -122.93307, - 39.50863, - 2119, - 6540, - -122.93312, - 39.5086, - 2119, - 6550, - -122.93318, - 39.50857, - 2117, - 6560, - -122.93327, - 39.50853, - 2116, - 6570, - -122.93335, - 39.5085, - 2115, - 6580, - -122.93343, - 39.50847, - 2114, - 6590, - -122.93352, - 39.50843, - 2114, - 6600, - -122.93362, - 39.50842, - 2114, - 6610, - -122.93372, - 39.50842, - 2114, - 6620, - -122.93382, - 39.50843, - 2108, - 6630, - -122.93395, - 39.5085, - 2101, - 6640, - -122.93408, - 39.50862, - 2096, - 6650, - -122.93422, - 39.50872, - 2094, - 6660, - -122.93437, - 39.50882, - 2094, - 6670, - -122.93448, - 39.5089, - 2093, - 6680, - -122.9346, - 39.50898, - 2090, - 6690, - -122.93472, - 39.50907, - 2085, - 6700, - -122.93485, - 39.50913, - 2081, - 6710, - -122.935, - 39.50922, - 2075, - 6720, - -122.93515, - 39.50927, - 2071, - 6730, - -122.9353, - 39.50933, - 2069, - 6740, - -122.93543, - 39.50938, - 2068, - 6750, - -122.93552, - 39.50943, - 2065, - 6760, - -122.93563, - 39.50947, - 2060, - 6770, - -122.93575, - 39.5095, - 2054, - 6780, - -122.93588, - 39.50952, - 2050, - 6790, - -122.93602, - 39.5095, - 2048, - 6800, - -122.93615, - 39.5095, - 2046, - 6810, - -122.93625, - 39.50947, - 2044, - 6820, - -122.93635, - 39.50943, - 2041, - 6830, - -122.93645, - 39.5094, - 2037, - 6840, - -122.93655, - 39.50935, - 2032, - 6850, - -122.93667, - 39.5093, - 2027, - 6860, - -122.93673, - 39.50923, - 2024, - 6870, - -122.93682, - 39.50915, - 2022, - 6880, - -122.93687, - 39.50908, - 2019, - 6890, - -122.93692, - 39.509, - 2015, - 6900, - -122.93695, - 39.5089, - 2011, - 6910, - -122.93695, - 39.5088, - 2009, - 6920, - -122.93697, - 39.5087, - 2007, - 6930, - -122.93698, - 39.50858, - 2005, - 6940, - -122.93698, - 39.5085, - 2003, - 6950, - -122.93698, - 39.50838, - 1998, - 6960, - -122.937, - 39.50825, - 1996, - 6970, - -122.937, - 39.50812, - 1997, - 6980, - -122.937, - 39.50798, - 1998, - 6990, - -122.93698, - 39.50787, - 1998, - 7000, - -122.93697, - 39.50775, - 1996, - 7010, - -122.93695, - 39.50763, - 1993, - 7020, - -122.93693, - 39.50753, - 1990, - 7030, - -122.93693, - 39.50742, - 1987, - 7040, - -122.93695, - 39.50732, - 1983, - 7050, - -122.93687, - 39.50673, - 1967, - 7060, - -122.93663, - 39.5061, - 1948, - 7070, - -122.93645, - 39.50553, - 1942, - 7080, - -122.93627, - 39.50498, - 1934, - 7090, - -122.93595, - 39.50445, - 1930, - 7100, - -122.93558, - 39.50385, - 1917, - 7110, - -122.93542, - 39.50317, - 1907, - 7120, - -122.93533, - 39.50258, - 1911, - 7130, - -122.93567, - 39.50247, - 1907, - 7140, - -122.93553, - 39.50302, - 1897, - 7150, - -122.93473, - 39.50302, - 1897, - 7160, - -122.93457, - 39.50282, - 1892, - 7170, - -122.93453, - 39.5027, - 1892, - 7180, - -122.93452, - 39.50262, - 1893, - 7190, - -122.93448, - 39.50253, - 1892, - 7200, - -122.93445, - 39.50243, - 1888, - 7210, - -122.93443, - 39.50233, - 1885, - 7220, - -122.93442, - 39.50222, - 1883, - 7230, - -122.93442, - 39.5021, - 1883, - 7240, - -122.93442, - 39.502, - 1883, - 7250, - -122.9344, - 39.50188, - 1882, - 7260, - -122.93438, - 39.5018, - 1881, - 7270, - -122.93433, - 39.50168, - 1879, - 7280, - -122.93427, - 39.50157, - 1876, - 7290, - -122.9342, - 39.50147, - 1875, - 7300, - -122.93413, - 39.50135, - 1874, - 7310, - -122.9341, - 39.50123, - 1875, - 7320, - -122.9341, - 39.50115, - 1876, - 7330, - -122.9341, - 39.50105, - 1876, - 7340, - -122.93415, - 39.50097, - 1873, - 7350, - -122.9342, - 39.5009, - 1871, - 7360, - -122.93425, - 39.50082, - 1871, - 7370, - -122.93432, - 39.50077, - 1872, - 7380, - -122.93437, - 39.50072, - 1871, - 7390, - -122.93443, - 39.50068, - 1868, - 7400, - -122.93452, - 39.50063, - 1864, - 7410, - -122.9346, - 39.50058, - 1863, - 7420, - -122.93468, - 39.50053, - 1862, - 7430, - -122.93477, - 39.50047, - 1859, - 7440, - -122.93487, - 39.50042, - 1857, - 7450, - -122.93495, - 39.50037, - 1856, - 7460, - -122.93505, - 39.5003, - 1856, - 7470, - -122.9351, - 39.50023, - 1856, - 7480, - -122.93513, - 39.50018, - 1855, - 7490, - -122.93517, - 39.50012, - 1854, - 7500, - -122.9352, - 39.50005, - 1853, - 7510, - -122.93522, - 39.49998, - 1851, - 7520, - -122.93523, - 39.4999, - 1849, - 7530, - -122.93523, - 39.49983, - 1848, - 7540, - -122.93522, - 39.49975, - 1847, - 7550, - -122.93522, - 39.49968, - 1846, - 7560, - -122.93522, - 39.4996, - 1844, - 7570, - -122.93522, - 39.4995, - 1843, - 7580, - -122.93522, - 39.4994, - 1845, - 7590, - -122.93522, - 39.4993, - 1847, - 7600, - -122.93522, - 39.4992, - 1850, - 7610, - -122.93518, - 39.49912, - 1852, - 7620, - -122.93512, - 39.49903, - 1856, - 7630, - -122.93503, - 39.499, - 1860, - 7640, - -122.93493, - 39.49898, - 1861, - 7650, - -122.93482, - 39.499, - 1861, - 7660, - -122.93468, - 39.49905, - 1859, - 7670, - -122.93453, - 39.49913, - 1858, - 7680, - -122.93442, - 39.4993, - 1858, - 7690, - -122.9344, - 39.49945, - 1861, - 7700, - -122.9344, - 39.49958, - 1866, - 7710, - -122.93445, - 39.4997, - 1868, - 7720, - -122.93453, - 39.49978, - 1869, - 7730, - -122.93465, - 39.49987, - 1869, - 7740, - -122.93477, - 39.4999, - 1869, - 7750, - -122.93488, - 39.4999, - 1871, - 7760, - -122.93498, - 39.49987, - 1873, - 7770, - -122.93503, - 39.49982, - 1876, - 7780, - -122.93503, - 39.49975, - 1878, - 7790, - -122.93503, - 39.49968, - 1879, - 7800, - -122.93498, - 39.49962, - 1882, - 7810, - -122.93488, - 39.49958, - 1884, - 7820, - -122.93475, - 39.49955, - 1884, - 7830, - -122.9346, - 39.49955, - 1886, - 7840, - -122.93442, - 39.4996, - 1887, - 7850, - -122.93427, - 39.49968, - 1890, - 7860, - -122.93415, - 39.4998, - 1894, - 7870, - -122.93408, - 39.4999, - 1897, - 7880, - -122.93405, - 39.50003, - 1898, - 7890, - -122.93405, - 39.50017, - 1898, - 7900, - -122.93412, - 39.50028, - 1898, - 7910, - -122.93422, - 39.5004, - 1897, - 7920, - -122.93437, - 39.50047, - 1899, - 7930, - -122.93447, - 39.5005, - 1901, - 7940, - -122.9346, - 39.5005, - 1903, - 7950, - -122.93468, - 39.50048, - 1904, - 7960, - -122.93472, - 39.50043, - 1906, - 7970, - -122.93473, - 39.50037, - 1909, - 7980, - -122.93473, - 39.50032, - 1911, - 7990, - -122.93468, - 39.50027, - 1913, - 8000, - -122.93462, - 39.5002, - 1915, - 8010, - -122.93452, - 39.50017, - 1918, - 8020, - -122.93437, - 39.50015, - 1921, - 8030, - -122.93422, - 39.50017, - 1923, - 8040, - -122.93405, - 39.50022, - 1923, - 8050, - -122.93385, - 39.50033, - 1923, - 8060, - -122.93375, - 39.50045, - 1924, - 8070, - -122.9337, - 39.50062, - 1925, - 8080, - -122.93373, - 39.50078, - 1928, - 8090, - -122.93382, - 39.50088, - 1930, - 8100, - -122.93395, - 39.50095, - 1931, - 8110, - -122.93407, - 39.50097, - 1931, - 8120, - -122.93415, - 39.50093, - 1932, - 8130, - -122.9342, - 39.50088, - 1933, - 8140, - -122.9342, - 39.50082, - 1935, - 8150, - -122.93415, - 39.50075, - 1938, - 8160, - -122.93403, - 39.50072, - 1941, - 8170, - -122.9339, - 39.5007, - 1943, - 8180, - -122.93373, - 39.5007, - 1945, - 8190, - -122.93358, - 39.50075, - 1947, - 8200, - -122.9334, - 39.50085, - 1949, - 8210, - -122.93327, - 39.50097, - 1952, - 8220, - -122.93318, - 39.5011, - 1954, - 8230, - -122.93317, - 39.50125, - 1955, - 8240, - -122.93322, - 39.50138, - 1955, - 8250, - -122.93332, - 39.5015, - 1954, - 8260, - -122.93345, - 39.50157, - 1954, - 8270, - -122.93358, - 39.50158, - 1954, - 8280, - -122.93368, - 39.50157, - 1955, - 8290, - -122.93378, - 39.50152, - 1956, - 8300, - -122.93382, - 39.50145, - 1956, - 8310, - -122.93385, - 39.50138, - 1956, - 8320, - -122.93385, - 39.50128, - 1955, - 8330, - -122.9338, - 39.5012, - 1958, - 8340, - -122.93373, - 39.50113, - 1962, - 8350, - -122.93363, - 39.5011, - 1963, - 8360, - -122.9335, - 39.50107, - 1963, - 8370, - -122.93333, - 39.50107, - 1964, - 8380, - -122.93315, - 39.5011, - 1963, - 8390, - -122.93297, - 39.50117, - 1964, - 8400, - -122.9328, - 39.5013, - 1965, - 8410, - -122.93272, - 39.50145, - 1969, - 8420, - -122.9327, - 39.50162, - 1973, - 8430, - -122.93275, - 39.50175, - 1975, - 8440, - -122.93285, - 39.50183, - 1978, - 8450, - -122.933, - 39.50187, - 1979, - 8460, - -122.9331, - 39.50185, - 1979, - 8470, - -122.93318, - 39.5018, - 1981, - 8480, - -122.9332, - 39.50172, - 1983, - 8490, - -122.93317, - 39.50167, - 1985, - 8500, - -122.93308, - 39.5016, - 1988, - 8510, - -122.93297, - 39.50158, - 1989, - 8520, - -122.93282, - 39.50158, - 1990, - 8530, - -122.93263, - 39.50162, - 1993, - 8540, - -122.9325, - 39.50172, - 1994, - 8550, - -122.93237, - 39.50183, - 1995, - 8560, - -122.93232, - 39.502, - 1997, - 8570, - -122.93233, - 39.50213, - 1999, - 8580, - -122.93242, - 39.50227, - 2003, - 8590, - -122.93252, - 39.50233, - 2005, - 8600, - -122.93263, - 39.50237, - 2006, - 8610, - -122.93275, - 39.50235, - 2006, - 8620, - -122.93283, - 39.50232, - 2005, - 8630, - -122.93288, - 39.50223, - 2003, - 8640, - -122.93287, - 39.50212, - 2004, - 8650, - -122.9328, - 39.50205, - 2004, - 8660, - -122.93265, - 39.50198, - 2004, - 8670, - -122.9325, - 39.50197, - 2005, - 8680, - -122.93232, - 39.50198, - 2006, - 8690, - -122.93212, - 39.50203, - 2008, - 8700, - -122.93197, - 39.50213, - 2012, - 8710, - -122.93185, - 39.50225, - 2014, - 8720, - -122.93178, - 39.5024, - 2016, - 8730, - -122.93178, - 39.50255, - 2018, - 8740, - -122.93185, - 39.50268, - 2021, - 8750, - -122.93195, - 39.50277, - 2023, - 8760, - -122.93205, - 39.50282, - 2024, - 8770, - -122.93217, - 39.50285, - 2025, - 8780, - -122.93227, - 39.50282, - 2025, - 8790, - -122.93235, - 39.50277, - 2025, - 8800, - -122.93242, - 39.50268, - 2025, - 8810, - -122.93242, - 39.50258, - 2024, - 8820, - -122.93237, - 39.50248, - 2024, - 8830, - -122.93228, - 39.5024, - 2023, - 8840, - -122.93217, - 39.50233, - 2023, - 8850, - -122.93202, - 39.5023, - 2023, - 8860, - -122.93185, - 39.50227, - 2023, - 8870, - -122.93167, - 39.50228, - 2025, - 8880, - -122.93147, - 39.50232, - 2028, - 8890, - -122.93133, - 39.5024, - 2030, - 8900, - -122.93118, - 39.5025, - 2031, - 8910, - -122.93113, - 39.50265, - 2033, - 8920, - -122.93112, - 39.50278, - 2035, - 8930, - -122.93118, - 39.50292, - 2038, - 8940, - -122.93128, - 39.503, - 2040, - 8950, - -122.9314, - 39.50302, - 2041, - 8960, - -122.9315, - 39.50298, - 2040, - 8970, - -122.93155, - 39.5029, - 2041, - 8980, - -122.93157, - 39.50282, - 2041, - 8990, - -122.93147, - 39.50273, - 2043, - 9000, - -122.93137, - 39.50268, - 2044, - 9010, - -122.93122, - 39.50265, - 2045, - 9020, - -122.93107, - 39.50265, - 2045, - 9030, - -122.9309, - 39.50268, - 2045, - 9040, - -122.93073, - 39.50277, - 2046, - 9050, - -122.9306, - 39.50288, - 2049, - 9060, - -122.93053, - 39.50303, - 2052, - 9070, - -122.9305, - 39.50315, - 2055, - 9080, - -122.93052, - 39.50327, - 2057, - 9090, - -122.93057, - 39.50338, - 2059, - 9100, - -122.93065, - 39.50347, - 2060, - 9110, - -122.93077, - 39.50352, - 2062, - 9120, - -122.93088, - 39.50352, - 2062, - 9130, - -122.93098, - 39.5035, - 2063, - 9140, - -122.93107, - 39.50343, - 2062, - 9150, - -122.9311, - 39.50335, - 2063, - 9160, - -122.93112, - 39.50325, - 2063, - 9170, - -122.93108, - 39.50315, - 2063, - 9180, - -122.93102, - 39.50307, - 2063, - 9190, - -122.93093, - 39.50298, - 2064, - 9200, - -122.9308, - 39.50292, - 2064, - 9210, - -122.93068, - 39.50287, - 2064, - 9220, - -122.93052, - 39.50283, - 2065, - 9230, - -122.93035, - 39.50285, - 2065, - 9240, - -122.93022, - 39.50292, - 2065, - 9250, - -122.93007, - 39.50302, - 2066, - 9260, - -122.93, - 39.50313, - 2066, - 9270, - -122.93, - 39.50327, - 2066, - 9280, - -122.93005, - 39.5034, - 2067, - 9290, - -122.93015, - 39.5035, - 2068, - 9300, - -122.93027, - 39.50355, - 2069, - 9310, - -122.93038, - 39.50355, - 2070, - 9320, - -122.9305, - 39.50353, - 2070, - 9330, - -122.9306, - 39.50348, - 2069, - 9340, - -122.93065, - 39.5034, - 2065, - 9350, - -122.93068, - 39.5033, - 2063, - 9360, - -122.93065, - 39.50318, - 2064, - 9370, - -122.9306, - 39.50308, - 2062, - 9380, - -122.93048, - 39.50298, - 2059, - 9390, - -122.93033, - 39.50292, - 2057, - 9400, - -122.93017, - 39.50288, - 2055, - 9410, - -122.92998, - 39.50288, - 2054, - 9420, - -122.9298, - 39.50293, - 2052, - 9430, - -122.92963, - 39.503, - 2050, - 9440, - -122.9295, - 39.50313, - 2048, - 9450, - -122.92943, - 39.50327, - 2047, - 9460, - -122.92945, - 39.5034, - 2048, - 9470, - -122.92945, - 39.5034, - 2048, - 9480, - -122.9295, - 39.5035, - 2049, - 9490, - -122.92958, - 39.5036, - 2050, - 9500, - -122.9297, - 39.50367, - 2051, - 9510, - -122.9298, - 39.5037, - 2052, - 9520, - -122.92992, - 39.50368, - 2053, - 9530, - -122.93002, - 39.50363, - 2052, - 9540, - -122.93007, - 39.50355, - 2051, - 9550, - -122.93008, - 39.50343, - 2048, - 9560, - -122.93002, - 39.50332, - 2046, - 9570, - -122.92992, - 39.50322, - 2044, - 9580, - -122.92975, - 39.50315, - 2041, - 9590, - -122.92957, - 39.50312, - 2039, - 9600, - -122.92935, - 39.50315, - 2037, - 9610, - -122.92917, - 39.50323, - 2033, - 9620, - -122.92903, - 39.50337, - 2031, - 9630, - -122.92895, - 39.50353, - 2029, - 9640, - -122.92897, - 39.50367, - 2029, - 9650, - -122.92903, - 39.5038, - 2030, - 9660, - -122.92913, - 39.5039, - 2033, - 9670, - -122.92923, - 39.50397, - 2036, - 9680, - -122.92935, - 39.50402, - 2037, - 9690, - -122.92947, - 39.50405, - 2036, - 9700, - -122.92958, - 39.50403, - 2035, - 9710, - -122.9297, - 39.50398, - 2031, - 9720, - -122.92982, - 39.50392, - 2028, - 9730, - -122.92992, - 39.50388, - 2028, - 9740, - -122.93002, - 39.50388, - 2028, - 9750, - -122.93008, - 39.5039, - 2028, - 9760, - -122.93015, - 39.50395, - 2023, - 9770, - -122.93022, - 39.50403, - 2015, - 9780, - -122.93032, - 39.50412, - 2013, - 9790, - -122.93043, - 39.5042, - 2013, - 9800, - -122.93053, - 39.50423, - 2014, - 9810, - -122.93063, - 39.50423, - 2013, - 9820, - -122.93073, - 39.50422, - 2011, - 9830, - -122.9308, - 39.50415, - 2007, - 9840, - -122.93085, - 39.50407, - 2004, - 9850, - -122.9309, - 39.50395, - 2002, - 9860, - -122.93095, - 39.50387, - 2001, - 9870, - -122.93098, - 39.50377, - 2001, - 9880, - -122.93102, - 39.50368, - 2000, - 9890, - -122.93105, - 39.50358, - 1999, - 9900, - -122.93107, - 39.50348, - 1998, - 9910, - -122.93108, - 39.5034, - 1997, - 9920, - -122.93108, - 39.5033, - 1993, - 9930, - -122.9311, - 39.50317, - 1989, - 9940, - -122.93113, - 39.50307, - 1987, - 9950, - -122.93117, - 39.50295, - 1989, - 9960, - -122.93118, - 39.50288, - 1990, - 9970, - -122.93123, - 39.5028, - 1988, - 9980, - -122.93127, - 39.50272, - 1983, - 9990, - -122.93133, - 39.50262, - 1980, - 10000, - -122.93142, - 39.50252, - 1979, - 10010, - -122.93148, - 39.50242, - 1980, - 10020, - -122.93153, - 39.50235, - 1980, - 10030, - -122.93155, - 39.50225, - 1979, - 10040, - -122.93153, - 39.50217, - 1978, - 10050, - -122.93147, - 39.50208, - 1976, - 10060, - -122.93133, - 39.50202, - 1971, - 10070, - -122.93117, - 39.50198, - 1967, - 10080, - -122.93098, - 39.50202, - 1963, - 10090, - -122.93078, - 39.5021, - 1960, - 10100, - -122.93067, - 39.5022, - 1961, - 10110, - -122.93057, - 39.50232, - 1961, - 10120, - -122.93052, - 39.50242, - 1961, - 10130, - -122.93048, - 39.50253, - 1960, - 10140, - -122.93047, - 39.50263, - 1958, - 10150, - -122.9305, - 39.50272, - 1956, - 10160, - -122.93057, - 39.50278, - 1954, - 10170, - -122.93065, - 39.50285, - 1951, - 10180, - -122.93075, - 39.50287, - 1949, - 10190, - -122.93087, - 39.50285, - 1945, - 10200, - -122.93097, - 39.50282, - 1941, - 10210, - -122.93107, - 39.50275, - 1939, - 10220, - -122.93115, - 39.50267, - 1936, - 10230, - -122.93122, - 39.5026, - 1934, - 10240, - -122.93128, - 39.50252, - 1932, - 10250, - -122.93135, - 39.50242, - 1929, - 10260, - -122.93142, - 39.50233, - 1926, - 10270, - -122.93148, - 39.50225, - 1924, - 10280, - -122.93152, - 39.50218, - 1924, - 10290, - -122.93157, - 39.50212, - 1923, - 10300, - -122.93163, - 39.50205, - 1920, - 10310, - -122.93172, - 39.50202, - 1915, - 10320, - -122.9318, - 39.50195, - 1909, - 10330, - -122.93188, - 39.50187, - 1904, - 10340, - -122.93197, - 39.50178, - 1900, - 10350, - -122.93208, - 39.5017, - 1896, - 10360, - -122.93218, - 39.50162, - 1896, - 10370, - -122.93228, - 39.50157, - 1897, - 10380, - -122.93237, - 39.50152, - 1897, - 10390, - -122.93243, - 39.50147, - 1894, - 10400, - -122.93252, - 39.50142, - 1891, - 10410, - -122.93262, - 39.50137, - 1890, - 10420, - -122.93268, - 39.50132, - 1888, - 10430, - -122.93302, - 39.50147, - 1877, - 10440, - -122.9323, - 39.5019, - 1865, - 10450, - -122.93167, - 39.50163, - 1851, - 10460, - -122.93178, - 39.50137, - 1842, - 10470, - -122.93185, - 39.5013, - 1840, - 10480, - -122.93193, - 39.50122, - 1838, - 10490, - -122.93202, - 39.50115, - 1835, - 10500, - -122.9321, - 39.50108, - 1833, - 10510, - -122.93218, - 39.50102, - 1831, - 10520, - -122.93227, - 39.50095, - 1829, - 10530, - -122.93235, - 39.50088, - 1827, - 10540, - -122.93243, - 39.50082, - 1824, - 10550, - -122.9325, - 39.50075, - 1822, - 10560, - -122.93258, - 39.50067, - 1819, - 10570, - -122.93263, - 39.5006, - 1818, - 10580, - -122.93268, - 39.50053, - 1816, - 10590, - -122.93275, - 39.50045, - 1813, - 10600, - -122.93282, - 39.50038, - 1811, - 10610, - -122.93288, - 39.5003, - 1807, - 10620, - -122.93295, - 39.50023, - 1804, - 10630, - -122.93307, - 39.50017, - 1800, - 10640, - -122.93318, - 39.5001, - 1795, - 10650, - -122.9333, - 39.50005, - 1793, - 10660, - -122.93342, - 39.5, - 1791, - 10670, - -122.93353, - 39.49995, - 1789, - 10680, - -122.93363, - 39.49992, - 1787, - 10690, - -122.93373, - 39.49987, - 1784, - 10700, - -122.93385, - 39.49982, - 1782, - 10710, - -122.93393, - 39.49978, - 1779, - 10720, - -122.93403, - 39.49973, - 1777, - 10730, - -122.93412, - 39.4997, - 1775, - 10740, - -122.9342, - 39.49965, - 1773, - 10750, - -122.9343, - 39.4996, - 1769, - 10760, - -122.93438, - 39.49955, - 1764, - 10770, - -122.93478, - 39.49922, - 1749, - 10780, - -122.93517, - 39.49888, - 1733, - 10790, - -122.93577, - 39.49863, - 1739, - 10800, - -122.93617, - 39.49847, - 1742, - 10810, - -122.93622, - 39.49908, - 1743, - 10820, - -122.93563, - 39.4991, - 1748, - 10830, - -122.936, - 39.49908, - 1753, - 10840, - -122.93605, - 39.49922, - 1753, - 10850, - -122.93602, - 39.49937, - 1753, - 10860, - -122.93592, - 39.49948, - 1754, - 10870, - -122.93577, - 39.49958, - 1756, - 10880, - -122.9356, - 39.4996, - 1756, - 10890, - -122.93545, - 39.49957, - 1755, - 10900, - -122.93535, - 39.49948, - 1755, - 10910, - -122.93535, - 39.4994, - 1756, - 10920, - -122.9354, - 39.49933, - 1756, - 10930, - -122.93548, - 39.49932, - 1757, - 10940, - -122.93558, - 39.49932, - 1758, - 10950, - -122.9357, - 39.49937, - 1758, - 10960, - -122.93577, - 39.49947, - 1759, - 10970, - -122.93582, - 39.4996, - 1759, - 10980, - -122.9358, - 39.49973, - 1759, - 10990, - -122.93568, - 39.49987, - 1759, - 11000, - -122.9355, - 39.49995, - 1761, - 11010, - -122.93533, - 39.49997, - 1763, - 11020, - -122.9352, - 39.49995, - 1763, - 11030, - -122.93508, - 39.49992, - 1763, - 11040, - -122.93505, - 39.49985, - 1761, - 11050, - -122.9351, - 39.49978, - 1759, - 11060, - -122.93522, - 39.49975, - 1759, - 11070, - -122.93533, - 39.49977, - 1759, - 11080, - -122.93545, - 39.49982, - 1760, - 11090, - -122.93557, - 39.49988, - 1763, - 11100, - -122.93565, - 39.49997, - 1765, - 11110, - -122.9357, - 39.50007, - 1767, - 11120, - -122.93573, - 39.50018, - 1767, - 11130, - -122.93573, - 39.50033, - 1765, - 11140, - -122.9357, - 39.50047, - 1762, - 11150, - -122.9356, - 39.50062, - 1761, - 11160, - -122.93547, - 39.50077, - 1761, - 11170, - -122.93533, - 39.50087, - 1762, - 11180, - -122.93518, - 39.50093, - 1763, - 11190, - -122.93503, - 39.501, - 1763, - 11200, - -122.93488, - 39.50103, - 1760, - 11210, - -122.93472, - 39.50103, - 1757, - 11220, - -122.93457, - 39.501, - 1757, - 11230, - -122.93445, - 39.50095, - 1757, - 11240, - -122.93438, - 39.50088, - 1758, - 11250, - -122.93437, - 39.50083, - 1758, - 11260, - -122.9344, - 39.50077, - 1756, - 11270, - -122.93448, - 39.50073, - 1755, - 11280, - -122.93458, - 39.50073, - 1756, - 11290, - -122.9347, - 39.50075, - 1758, - 11300, - -122.9348, - 39.50078, - 1760, - 11310, - -122.9349, - 39.5008, - 1761, - 11320, - -122.93502, - 39.50083, - 1762, - 11330, - -122.9351, - 39.50083, - 1762, - 11340, - -122.93517, - 39.50083, - 1762, - 11350, - -122.93522, - 39.5008, - 1763, - 11360, - -122.93523, - 39.50077, - 1763, - 11370, - -122.93525, - 39.50072, - 1763, - 11380, - -122.93525, - 39.50067, - 1763, - 11390, - -122.93525, - 39.50062, - 1764, - 11400, - -122.93527, - 39.50055, - 1766, - 11410, - -122.93527, - 39.5005, - 1766, - 11420, - -122.93528, - 39.50045, - 1766, - 11430, - -122.93533, - 39.50042, - 1765, - 11440, - -122.93538, - 39.5004, - 1764, - 11450, - -122.93545, - 39.50042, - 1763, - 11460, - -122.9355, - 39.50047, - 1760, - 11470, - -122.93558, - 39.50053, - 1756, - 11480, - -122.93568, - 39.50065, - 1750, - 11490, - -122.9358, - 39.50077, - 1747, - 11500, - -122.93592, - 39.50087, - 1744, - 11510, - -122.93605, - 39.50087, - 1750, - 11520, - -122.93615, - 39.50088, - 1751, - 11530, - -122.93623, - 39.50088, - 1751, - 11540, - -122.9363, - 39.50087, - 1751, - 11550, - -122.93637, - 39.50085, - 1751, - 11560, - -122.93643, - 39.50083, - 1750, - 11570, - -122.93648, - 39.5008, - 1749, - 11580, - -122.93653, - 39.50075, - 1748, - 11590, - -122.93655, - 39.50068, - 1747, - 11600, - -122.93655, - 39.50062, - 1747, - 11610, - -122.93653, - 39.50053, - 1749, - 11620, - -122.93652, - 39.50047, - 1749, - 11630, - -122.93648, - 39.5004, - 1749, - 11640, - -122.93643, - 39.50032, - 1751, - 11650, - -122.93638, - 39.50023, - 1753, - 11660, - -122.93633, - 39.50018, - 1754, - 11670, - -122.93628, - 39.50012, - 1753, - 11680, - -122.93622, - 39.50005, - 1753, - 11690, - -122.93617, - 39.49997, - 1753, - 11700, - -122.9361, - 39.49988, - 1751, - 11710, - -122.93605, - 39.49982, - 1751, - 11720, - -122.93605, - 39.49973, - 1751, - 11730, - -122.93607, - 39.49968, - 1752, - 11740, - -122.93612, - 39.49967, - 1753, - 11750, - -122.93618, - 39.49967, - 1753, - 11760, - -122.93627, - 39.49972, - 1753, - 11770, - -122.93635, - 39.49985, - 1752, - 11780, - -122.93638, - 39.49998, - 1753, - 11790, - -122.93635, - 39.50015, - 1757, - 11800, - -122.93627, - 39.50028, - 1762, - 11810, - -122.93615, - 39.5004, - 1763, - 11820, - -122.93598, - 39.50048, - 1762, - 11830, - -122.9358, - 39.50057, - 1761, - 11840, - -122.93563, - 39.5006, - 1760, - 11850, - -122.93543, - 39.50045, - 1761, - 11860, - -122.93533, - 39.50037, - 1760, - 11870, - -122.93528, - 39.50028, - 1759, - 11880, - -122.93528, - 39.5002, - 1758, - 11890, - -122.9353, - 39.50013, - 1757, - 11900, - -122.93533, - 39.50008, - 1758, - 11910, - -122.9354, - 39.50005, - 1759, - 11920, - -122.93545, - 39.50003, - 1760, - 11930, - -122.93552, - 39.50003, - 1759, - 11940, - -122.93558, - 39.50005, - 1759, - 11950, - -122.93565, - 39.50008, - 1760, - 11960, - -122.93573, - 39.50013, - 1761, - 11970, - -122.93582, - 39.50017, - 1760, - 11980, - -122.9359, - 39.5002, - 1757, - 11990, - -122.936, - 39.50025, - 1753, - 12000, - -122.93612, - 39.50027, - 1750, - 12010, - -122.93625, - 39.50028, - 1747, - 12020, - -122.93635, - 39.50025, - 1745, - 12030, - -122.93643, - 39.50022, - 1743, - 12040, - -122.9365, - 39.50018, - 1741, - 12050, - -122.93653, - 39.50013, - 1739, - 12060, - -122.93657, - 39.50008, - 1736, - 12070, - -122.93658, - 39.50002, - 1731, - 12080, - -122.93658, - 39.49993, - 1729, - 12090, - -122.93655, - 39.49983, - 1728, - 12100, - -122.9365, - 39.49978, - 1728, - 12110, - -122.93643, - 39.49972, - 1726, - 12120, - -122.93635, - 39.49965, - 1724, - 12130, - -122.93627, - 39.4996, - 1722, - 12140, - -122.9362, - 39.49953, - 1721, - 12150, - -122.93612, - 39.49945, - 1719, - 12160, - -122.93605, - 39.49938, - 1718, - 12170, - -122.93595, - 39.4993, - 1717, - 12180, - -122.93588, - 39.49923, - 1717, - 12190, - -122.9358, - 39.49918, - 1716, - 12200, - -122.9357, - 39.4991, - 1715, - 12210, - -122.93562, - 39.49903, - 1715, - 12220, - -122.93552, - 39.49898, - 1717, - 12230, - -122.93542, - 39.49892, - 1716, - 12240, - -122.93533, - 39.49887, - 1715, - 12250, - -122.93525, - 39.49878, - 1713, - 12260, - -122.93525, - 39.49858, - 1697, - 12270, - -122.93578, - 39.49835, - 1686, - 12280, - -122.93625, - 39.49823, - 1697, - 12290, - -122.93633, - 39.49793, - 1706, - 12300, - -122.93563, - 39.49818, - 1708, - 12310, - -122.936, - 39.49847, - 1719, - 12320, - -122.93622, - 39.49838, - 1724, - 12330, - -122.93628, - 39.49833, - 1727, - 12340, - -122.9363, - 39.49825, - 1731, - 12350, - -122.93628, - 39.49818, - 1733, - 12360, - -122.9362, - 39.49812, - 1735, - 12370, - -122.93607, - 39.49808, - 1735, - 12380, - -122.93593, - 39.49808, - 1735, - 12390, - -122.93573, - 39.49815, - 1736, - 12400, - -122.93558, - 39.49827, - 1735, - 12410, - -122.9355, - 39.49842, - 1740, - 12420, - -122.93548, - 39.49857, - 1746, - 12430, - -122.9355, - 39.49867, - 1749, - 12440, - -122.93557, - 39.49875, - 1749, - 12450, - -122.9357, - 39.49882, - 1750, - 12460, - -122.93582, - 39.49882, - 1751, - 12470, - -122.9359, - 39.49878, - 1750, - 12480, - -122.93593, - 39.49872, - 1748, - 12490, - -122.93588, - 39.49863, - 1750, - 12500, - -122.93577, - 39.49857, - 1752, - 12510, - -122.93562, - 39.49853, - 1756, - 12520, - -122.93543, - 39.49853, - 1760, - 12530, - -122.93523, - 39.49857, - 1763, - 12540, - -122.93507, - 39.49863, - 1764, - 12550, - -122.9349, - 39.49873, - 1765, - 12560, - -122.93477, - 39.49887, - 1769, - 12570, - -122.93468, - 39.49902, - 1772, - 12580, - -122.93467, - 39.4992, - 1775, - 12590, - -122.93467, - 39.49932, - 1776, - 12600, - -122.93473, - 39.49943, - 1776, - 12610, - -122.93483, - 39.49953, - 1774, - 12620, - -122.93493, - 39.49957, - 1771, - 12630, - -122.93507, - 39.49957, - 1767, - 12640, - -122.93518, - 39.49952, - 1769, - 12650, - -122.93527, - 39.49947, - 1771, - 12660, - -122.93532, - 39.4994, - 1771, - 12670, - -122.93532, - 39.49933, - 1770, - 12680, - -122.93525, - 39.49923, - 1768, - 12690, - -122.93517, - 39.4991, - 1767, - 12700, - -122.93517, - 39.49898, - 1767, - 12710, - -122.93523, - 39.49888, - 1769, - 12720, - -122.9353, - 39.4988, - 1772, - 12730, - -122.93535, - 39.49875, - 1776, - 12740, - -122.93543, - 39.4987, - 1778, - 12750, - -122.93552, - 39.49867, - 1779, - 12760, - -122.93563, - 39.49863, - 1780, - 12770, - -122.93577, - 39.4986, - 1784, - 12780, - -122.9359, - 39.49858, - 1787, - 12790, - -122.93603, - 39.49858, - 1787, - 12800, - -122.93615, - 39.49857, - 1787, - 12810, - -122.93625, - 39.49853, - 1788, - 12820, - -122.93633, - 39.49847, - 1789, - 12830, - -122.93633, - 39.49842, - 1789, - 12840, - -122.93628, - 39.49833, - 1792, - 12850, - -122.9362, - 39.49828, - 1794, - 12860, - -122.93608, - 39.49823, - 1795, - 12870, - -122.93592, - 39.49822, - 1797, - 12880, - -122.93573, - 39.49825, - 1798, - 12890, - -122.93558, - 39.49833, - 1799, - 12900, - -122.93545, - 39.49847, - 1800, - 12910, - -122.93542, - 39.4986, - 1802, - 12920, - -122.93545, - 39.49872, - 1806, - 12930, - -122.93553, - 39.4988, - 1809, - 12940, - -122.93563, - 39.49883, - 1810, - 12950, - -122.93575, - 39.49883, - 1812, - 12960, - -122.9358, - 39.49878, - 1815, - 12970, - -122.9358, - 39.49873, - 1817, - 12980, - -122.93575, - 39.49867, - 1819, - 12990, - -122.93567, - 39.49862, - 1819, - 13000, - -122.93553, - 39.49857, - 1820, - 13010, - -122.93535, - 39.49853, - 1823, - 13020, - -122.93518, - 39.49855, - 1823, - 13030, - -122.935, - 39.49862, - 1824, - 13040, - -122.93485, - 39.49872, - 1827, - 13050, - -122.93477, - 39.49882, - 1831, - 13060, - -122.93472, - 39.49892, - 1833, - 13070, - -122.93472, - 39.49903, - 1833, - 13080, - -122.93478, - 39.49913, - 1833, - 13090, - -122.93492, - 39.49923, - 1832, - 13100, - -122.93505, - 39.49928, - 1832, - 13110, - -122.93517, - 39.49925, - 1839, - 13120, - -122.93525, - 39.49923, - 1841, - 13130, - -122.9353, - 39.49918, - 1841, - 13140, - -122.9353, - 39.4991, - 1841, - 13150, - -122.93525, - 39.499, - 1840, - 13160, - -122.93517, - 39.49887, - 1842, - 13170, - -122.93513, - 39.49875, - 1846, - 13180, - -122.93515, - 39.49865, - 1851, - 13190, - -122.93522, - 39.49857, - 1854, - 13200, - -122.93532, - 39.49853, - 1855, - 13210, - -122.93543, - 39.49857, - 1856, - 13220, - -122.93555, - 39.49863, - 1860, - 13230, - -122.93562, - 39.49875, - 1861, - 13240, - -122.93563, - 39.49888, - 1861, - 13250, - -122.93558, - 39.49905, - 1862, - 13260, - -122.93548, - 39.49917, - 1863, - 13270, - -122.93532, - 39.49927, - 1865, - 13280, - -122.93515, - 39.49932, - 1867, - 13290, - -122.935, - 39.49933, - 1868, - 13300, - -122.93485, - 39.4993, - 1869, - 13310, - -122.93475, - 39.49923, - 1870, - 13320, - -122.9347, - 39.49915, - 1872, - 13330, - -122.9347, - 39.49907, - 1875, - 13340, - -122.93475, - 39.49902, - 1877, - 13350, - -122.93482, - 39.499, - 1878, - 13360, - -122.93493, - 39.499, - 1878, - 13370, - -122.93505, - 39.49905, - 1878, - 13380, - -122.93515, - 39.49917, - 1881, - 13390, - -122.9352, - 39.49928, - 1883, - 13400, - -122.93518, - 39.49943, - 1885, - 13410, - -122.93512, - 39.49957, - 1884, - 13420, - -122.935, - 39.49968, - 1883, - 13430, - -122.93482, - 39.4998, - 1883, - 13440, - -122.93465, - 39.49987, - 1883, - 13450, - -122.93447, - 39.49985, - 1884, - 13460, - -122.9343, - 39.49983, - 1885, - 13470, - -122.93418, - 39.49977, - 1885, - 13480, - -122.9341, - 39.4997, - 1885, - 13490, - -122.93405, - 39.4996, - 1888, - 13500, - -122.93407, - 39.49953, - 1892, - 13510, - -122.93413, - 39.49948, - 1895, - 13520, - -122.93422, - 39.49948, - 1899, - 13530, - -122.93432, - 39.49952, - 1901, - 13540, - -122.9344, - 39.4996, - 1902, - 13550, - -122.93447, - 39.49972, - 1902, - 13560, - -122.93448, - 39.49985, - 1904, - 13570, - -122.93445, - 39.5, - 1905, - 13580, - -122.93435, - 39.50013, - 1905, - 13590, - -122.9342, - 39.50027, - 1905, - 13600, - -122.93403, - 39.50033, - 1905, - 13610, - -122.93383, - 39.50037, - 1904, - 13620, - -122.93365, - 39.50037, - 1906, - 13630, - -122.93352, - 39.50032, - 1905, - 13640, - -122.93342, - 39.50025, - 1904, - 13650, - -122.9334, - 39.50015, - 1903, - 13660, - -122.93347, - 39.5001, - 1905, - 13670, - -122.93358, - 39.50007, - 1908, - 13680, - -122.9337, - 39.50008, - 1911, - 13690, - -122.93378, - 39.50015, - 1913, - 13700, - -122.93385, - 39.50025, - 1915, - 13710, - -122.93388, - 39.50037, - 1916, - 13720, - -122.93387, - 39.5005, - 1914, - 13730, - -122.9338, - 39.50067, - 1913, - 13740, - -122.93367, - 39.5008, - 1913, - 13750, - -122.93348, - 39.50092, - 1915, - 13760, - -122.93332, - 39.50097, - 1916, - 13770, - -122.93315, - 39.50098, - 1916, - 13780, - -122.933, - 39.50097, - 1915, - 13790, - -122.93288, - 39.50092, - 1912, - 13800, - -122.93278, - 39.50085, - 1910, - 13810, - -122.93275, - 39.50073, - 1910, - 13820, - -122.9328, - 39.50067, - 1911, - 13830, - -122.93288, - 39.50062, - 1911, - 13840, - -122.93298, - 39.50058, - 1909, - 13850, - -122.93313, - 39.50058, - 1908, - 13860, - -122.93328, - 39.5006, - 1913, - 13870, - -122.9334, - 39.50062, - 1916, - 13880, - -122.93352, - 39.5006, - 1918, - 13890, - -122.93358, - 39.50058, - 1920, - 13900, - -122.93363, - 39.50055, - 1921, - 13910, - -122.93365, - 39.50048, - 1921, - 13920, - -122.93363, - 39.50042, - 1921, - 13930, - -122.93357, - 39.50033, - 1921, - 13940, - -122.93347, - 39.50027, - 1924, - 13950, - -122.93335, - 39.50022, - 1927, - 13960, - -122.93322, - 39.50017, - 1928, - 13970, - -122.93307, - 39.50008, - 1929, - 13980, - -122.93297, - 39.50002, - 1929, - 13990, - -122.93298, - 39.49992, - 1934, - 14000, - -122.93305, - 39.49985, - 1937, - 14010, - -122.93313, - 39.49982, - 1938, - 14020, - -122.93323, - 39.49982, - 1938, - 14030, - -122.93335, - 39.49985, - 1936, - 14040, - -122.93345, - 39.49993, - 1937, - 14050, - -122.93353, - 39.50005, - 1938, - 14060, - -122.93357, - 39.50015, - 1939, - 14070, - -122.9336, - 39.50027, - 1939, - 14080, - -122.93358, - 39.5004, - 1938, - 14090, - -122.93355, - 39.50053, - 1937, - 14100, - -122.93348, - 39.50067, - 1937, - 14110, - -122.93338, - 39.50078, - 1937, - 14120, - -122.93327, - 39.50088, - 1939, - 14130, - -122.93312, - 39.50098, - 1941, - 14140, - -122.933, - 39.50105, - 1941, - 14150, - -122.93283, - 39.50113, - 1940, - 14160, - -122.93265, - 39.50118, - 1941, - 14170, - -122.9325, - 39.50122, - 1941, - 14180, - -122.9323, - 39.50123, - 1940, - 14190, - -122.9321, - 39.50122, - 1940, - 14200, - -122.93195, - 39.50118, - 1943, - 14210, - -122.93185, - 39.5011, - 1945, - 14220, - -122.93183, - 39.50103, - 1945, - 14230, - -122.93185, - 39.50095, - 1946, - 14240, - -122.93193, - 39.5009, - 1949, - 14250, - -122.93203, - 39.50088, - 1951, - 14260, - -122.93217, - 39.50092, - 1952, - 14270, - -122.93223, - 39.50102, - 1954, - 14280, - -122.93227, - 39.50113, - 1956, - 14290, - -122.93223, - 39.50128, - 1957, - 14300, - -122.93213, - 39.50142, - 1958, - 14310, - -122.93197, - 39.50153, - 1960, - 14320, - -122.93178, - 39.50158, - 1961, - 14330, - -122.93162, - 39.5016, - 1962, - 14340, - -122.93143, - 39.50158, - 1964, - 14350, - -122.9313, - 39.50155, - 1964, - 14360, - -122.93117, - 39.50148, - 1964, - 14370, - -122.93107, - 39.5014, - 1965, - 14380, - -122.93105, - 39.5013, - 1967, - 14390, - -122.9311, - 39.50122, - 1969, - 14400, - -122.93118, - 39.50118, - 1970, - 14410, - -122.9313, - 39.50118, - 1973, - 14420, - -122.93138, - 39.50125, - 1975, - 14430, - -122.93145, - 39.50137, - 1976, - 14440, - -122.93145, - 39.5015, - 1977, - 14450, - -122.9314, - 39.50165, - 1979, - 14460, - -122.9313, - 39.50177, - 1981, - 14470, - -122.93113, - 39.50188, - 1981, - 14480, - -122.93113, - 39.50188, - 1981, - 14490, - -122.93093, - 39.50193, - 1983, - 14500, - -122.93078, - 39.50193, - 1984, - 14510, - -122.93062, - 39.5019, - 1987, - 14520, - -122.9305, - 39.50183, - 1988, - 14530, - -122.93043, - 39.50177, - 1989, - 14540, - -122.93042, - 39.50168, - 1989, - 14550, - -122.93047, - 39.5016, - 1989, - 14560, - -122.93057, - 39.50157, - 1991, - 14570, - -122.93067, - 39.50158, - 1993, - 14580, - -122.93077, - 39.50163, - 1994, - 14590, - -122.93085, - 39.50173, - 1995, - 14600, - -122.93088, - 39.50185, - 1995, - 14610, - -122.93087, - 39.502, - 1997, - 14620, - -122.9308, - 39.50213, - 2000, - 14630, - -122.93067, - 39.50225, - 2001, - 14640, - -122.93048, - 39.50232, - 2001, - 14650, - -122.9303, - 39.50232, - 2002, - 14660, - -122.93015, - 39.50228, - 2002, - 14670, - -122.9301, - 39.50217, - 2002, - 14680, - -122.93012, - 39.50207, - 2001, - 14690, - -122.93018, - 39.50203, - 2004, - 14700, - -122.93028, - 39.50202, - 2006, - 14710, - -122.93037, - 39.50205, - 2006, - 14720, - -122.93045, - 39.50215, - 2005, - 14730, - -122.9305, - 39.50227, - 2005, - 14740, - -122.93052, - 39.5024, - 2006, - 14750, - -122.93053, - 39.50255, - 2006, - 14760, - -122.93057, - 39.50267, - 2007, - 14770, - -122.93065, - 39.50277, - 2007, - 14780, - -122.93075, - 39.50282, - 2010, - 14790, - -122.93082, - 39.50283, - 2009, - 14800, - -122.93088, - 39.5028, - 2008, - 14810, - -122.93095, - 39.50275, - 2005, - 14820, - -122.93097, - 39.50265, - 2003, - 14830, - -122.93092, - 39.50253, - 2002, - 14840, - -122.93083, - 39.50245, - 2001, - 14850, - -122.93072, - 39.50235, - 2001, - 14860, - -122.93057, - 39.5023, - 2002, - 14870, - -122.93042, - 39.50228, - 2003, - 14880, - -122.93022, - 39.5023, - 2003, - 14890, - -122.93007, - 39.50237, - 2004, - 14900, - -122.92992, - 39.50245, - 2003, - 14910, - -122.9298, - 39.50258, - 2003, - 14920, - -122.92973, - 39.5027, - 2003, - 14930, - -122.92972, - 39.50283, - 2004, - 14940, - -122.92975, - 39.50293, - 2005, - 14950, - -122.92978, - 39.50302, - 2006, - 14960, - -122.92983, - 39.50308, - 2006, - 14970, - -122.9299, - 39.50312, - 2006, - 14980, - -122.92997, - 39.50315, - 2005, - 14990, - -122.93005, - 39.50315, - 2003, - 15000, - -122.93013, - 39.50315, - 2001, - 15010, - -122.93023, - 39.50312, - 2000, - 15020, - -122.93032, - 39.50305, - 2000, - 15030, - -122.93037, - 39.50297, - 2002, - 15040, - -122.9304, - 39.50287, - 2003, - 15050, - -122.9304, - 39.50278, - 2004, - 15060, - -122.93037, - 39.5027, - 2004, - 15070, - -122.93033, - 39.50262, - 2002, - 15080, - -122.93028, - 39.50252, - 2000, - 15090, - -122.93023, - 39.50242, - 1999, - 15100, - -122.93015, - 39.50233, - 1999, - 15110, - -122.93005, - 39.50225, - 1999, - 15120, - -122.92993, - 39.50218, - 1998, - 15130, - -122.92982, - 39.50213, - 1997, - 15140, - -122.92968, - 39.5021, - 1993, - 15150, - -122.92953, - 39.50203, - 1988, - 15160, - -122.92942, - 39.50195, - 1985, - 15170, - -122.92932, - 39.50185, - 1985, - 15180, - -122.92927, - 39.50173, - 1984, - 15190, - -122.92928, - 39.50165, - 1984, - 15200, - -122.92932, - 39.50158, - 1982, - 15210, - -122.9294, - 39.50153, - 1980, - 15220, - -122.9295, - 39.5015, - 1977, - 15230, - -122.92962, - 39.50148, - 1976, - 15240, - -122.92973, - 39.50148, - 1975, - 15250, - -122.92985, - 39.5015, - 1974, - 15260, - -122.92997, - 39.50153, - 1973, - 15270, - -122.93008, - 39.50157, - 1971, - 15280, - -122.93023, - 39.50162, - 1970, - 15290, - -122.93035, - 39.50167, - 1971, - 15300, - -122.93047, - 39.50168, - 1972, - 15310, - -122.93058, - 39.5017, - 1973, - 15320, - -122.93067, - 39.5017, - 1973, - 15330, - -122.93077, - 39.50172, - 1972, - 15340, - -122.93087, - 39.5017, - 1970, - 15350, - -122.93097, - 39.5017, - 1969, - 15360, - -122.93107, - 39.5017, - 1966, - 15370, - -122.93118, - 39.5017, - 1963, - 15380, - -122.93132, - 39.50172, - 1961, - 15390, - -122.93147, - 39.50173, - 1959, - 15400, - -122.93158, - 39.50173, - 1958, - 15410, - -122.9321, - 39.50158, - 1953, - 15420, - -122.93253, - 39.50128, - 1954, - 15430, - -122.93303, - 39.50127, - 1948, - 15440, - -122.9335, - 39.50163, - 1948, - 15450, - -122.93335, - 39.50227, - 1940, - 15460, - -122.93292, - 39.50223, - 1930, - 15470, - -122.93285, - 39.50215, - 1929, - 15480, - -122.93282, - 39.50205, - 1929, - 15490, - -122.9328, - 39.50197, - 1928, - 15500, - -122.93283, - 39.5019, - 1927, - 15510, - -122.93287, - 39.50182, - 1928, - 15520, - -122.9329, - 39.50177, - 1927, - 15530, - -122.93295, - 39.50172, - 1925, - 15540, - -122.93303, - 39.50165, - 1925, - 15550, - -122.9331, - 39.5016, - 1928, - 15560, - -122.93317, - 39.50155, - 1930, - 15570, - -122.93322, - 39.5015, - 1931, - 15580, - -122.93325, - 39.50145, - 1931, - 15590, - -122.93328, - 39.50138, - 1931, - 15600, - -122.93333, - 39.50132, - 1932, - 15610, - -122.9334, - 39.50127, - 1931, - 15620, - -122.9335, - 39.50123, - 1933, - 15630, - -122.93358, - 39.50127, - 1935, - 15640, - -122.93368, - 39.50132, - 1935, - 15650, - -122.93377, - 39.50142, - 1934, - 15660, - -122.93383, - 39.50153, - 1933, - 15670, - -122.93387, - 39.50168, - 1932, - 15680, - -122.93383, - 39.50185, - 1932, - 15690, - -122.93373, - 39.502, - 1933, - 15700, - -122.93358, - 39.50212, - 1935, - 15710, - -122.9334, - 39.50218, - 1936, - 15720, - -122.93323, - 39.5022, - 1936, - 15730, - -122.93307, - 39.50217, - 1936, - 15740, - -122.93297, - 39.50212, - 1936, - 15750, - -122.9329, - 39.50205, - 1936, - 15760, - -122.9329, - 39.50198, - 1938, - 15770, - -122.93295, - 39.50197, - 1936, - 15780, - -122.93302, - 39.50195, - 1935, - 15790, - -122.9331, - 39.50197, - 1934, - 15800, - -122.9332, - 39.50202, - 1934, - 15810, - -122.93328, - 39.50212, - 1933, - 15820, - -122.93337, - 39.50222, - 1932, - 15830, - -122.93342, - 39.50237, - 1931, - 15840, - -122.93342, - 39.50253, - 1931, - 15850, - -122.93337, - 39.50268, - 1932, - 15860, - -122.93327, - 39.50282, - 1933, - 15870, - -122.93313, - 39.50292, - 1934, - 15880, - -122.93298, - 39.50298, - 1934, - 15890, - -122.9328, - 39.50302, - 1935, - 15900, - -122.93267, - 39.50302, - 1936, - 15910, - -122.93253, - 39.50297, - 1936, - 15920, - -122.93243, - 39.50292, - 1936, - 15930, - -122.93242, - 39.50285, - 1935, - 15940, - -122.93245, - 39.5028, - 1934, - 15950, - -122.93252, - 39.50278, - 1934, - 15960, - -122.93258, - 39.50277, - 1932, - 15970, - -122.9327, - 39.50277, - 1929, - 15980, - -122.93282, - 39.50278, - 1927, - 15990, - -122.93295, - 39.5028, - 1927, - 16000, - -122.93307, - 39.5028, - 1927, - 16010, - -122.93317, - 39.5028, - 1928, - 16020, - -122.93323, - 39.50278, - 1927, - 16030, - -122.9333, - 39.50277, - 1925, - 16040, - -122.93335, - 39.50273, - 1922, - 16050, - -122.9334, - 39.50268, - 1915, - 16060, - -122.93347, - 39.50262, - 1908, - 16070, - -122.93353, - 39.50252, - 1903, - 16080, - -122.93362, - 39.50243, - 1903, - 16090, - -122.93365, - 39.50237, - 1905, - 16100, - -122.93367, - 39.50232, - 1907, - 16110, - -122.93368, - 39.50227, - 1908, - 16120, - -122.93368, - 39.50223, - 1905, - 16130, - -122.9337, - 39.50217, - 1900, - 16140, - -122.93373, - 39.5021, - 1897, - 16150, - -122.93377, - 39.50202, - 1899, - 16160, - -122.93378, - 39.50195, - 1901, - 16170, - -122.93378, - 39.5019, - 1900, - 16180, - -122.93382, - 39.50183, - 1899, - 16190, - -122.93383, - 39.50177, - 1898, - 16200, - -122.93387, - 39.5017, - 1898, - 16210, - -122.9339, - 39.50163, - 1896, - 16220, - -122.93393, - 39.50157, - 1894, - 16230, - -122.93397, - 39.5015, - 1892, - 16240, - -122.93407, - 39.50115, - 1873, - 16250, - -122.9341, - 39.50062, - 1862, - 16260, - -122.93403, - 39.5001, - 1848, - 16270, - -122.93383, - 39.49948, - 1839, - 16280, - -122.93358, - 39.49892, - 1833, - 16290, - -122.93328, - 39.49837, - 1828, - 16300, - -122.93292, - 39.49788, - 1815, - 16310, - -122.9326, - 39.49735, - 1800, - 16320, - -122.93222, - 39.4968, - 1786, - 16330, - -122.93188, - 39.49625, - 1775, - 16340, - -122.93157, - 39.49568, - 1759, - 16350, - -122.93127, - 39.49512, - 1746, - 16360, - -122.93097, - 39.49458, - 1731, - 16370, - -122.93072, - 39.4941, - 1720, - 16380, - -122.93053, - 39.49353, - 1721, - 16390, - -122.93033, - 39.493, - 1728, - 16400, - -122.9301, - 39.49247, - 1728, - 16410, - -122.93002, - 39.49192, - 1709, - 16420, - -122.93, - 39.49135, - 1697, - 16430, - -122.92987, - 39.49075, - 1687, - 16440, - -122.9297, - 39.49017, - 1675, - 16450, - -122.92952, - 39.4896, - 1668, - 16460, - -122.9295, - 39.4891, - 1669, - 16470, - -122.92942, - 39.4886, - 1675, - 16480, - -122.92933, - 39.48797, - 1663, - 16490, - -122.92928, - 39.48737, - 1663, - 16500, - -122.92922, - 39.48675, - 1648, - 16510, - -122.92917, - 39.48617, - 1637, - 16520, - -122.92907, - 39.48562, - 1624, - 16530, - -122.92898, - 39.48517, - 1619, - 16540, - -122.92895, - 39.48473, - 1598, - 16550, - -122.92912, - 39.48413, - 1595, - 16560, - -122.92912, - 39.4835, - 1588, - 16570, - -122.92917, - 39.48288, - 1587, - 16580, - -122.92935, - 39.48238, - 1588, - 16590, - -122.92967, - 39.48192, - 1582, - 16600, - -122.92993, - 39.4815, - 1575, - 16610, - -122.9302, - 39.4811, - 1572, - 16620, - -122.93047, - 39.48068, - 1560, - 16630, - -122.93072, - 39.4802, - 1549, - 16640, - -122.93113, - 39.4798, - 1541, - 16650, - -122.93157, - 39.47938, - 1527, - 16660, - -122.93192, - 39.47892, - 1519, - 16670, - -122.93225, - 39.47847, - 1523, - 16680, - -122.93258, - 39.47808, - 1521, - 16690, - -122.9329, - 39.47765, - 1510, - 16700, - -122.93322, - 39.47722, - 1500, - 16710, - -122.93363, - 39.47685, - 1499, - 16720, - -122.93398, - 39.47647, - 1486, - 16730, - -122.93443, - 39.4761, - 1475, - 16740, - -122.93483, - 39.47568, - 1456, - 16750, - -122.93515, - 39.47517, - 1444, - 16760, - -122.93555, - 39.47477, - 1439, - 16770, - -122.93597, - 39.47425, - 1433, - 16780, - -122.93628, - 39.4739, - 1426, - 16790, - -122.9366, - 39.47355, - 1426, - 16800, - -122.93688, - 39.47317, - 1422, - 16810, - -122.93725, - 39.47275, - 1423, - 16820, - -122.93772, - 39.47232, - 1428, - 16830, - -122.93812, - 39.47192, - 1425, - 16840, - -122.93848, - 39.4715, - 1426, - 16850, - -122.93893, - 39.47112, - 1428, - 16860, - -122.93928, - 39.47067, - 1434, - 16870, - -122.9395, - 39.47022, - 1438, - 16880, - -122.93978, - 39.46978, - 1441, - 16890, - -122.94, - 39.46937, - 1438, - 16900, - -122.94023, - 39.4689, - 1432, - 16910, - -122.94053, - 39.46838, - 1415, - 16920, - -122.94075, - 39.46785, - 1399, - 16930, - -122.94093, - 39.46727, - 1383, - 16940, - -122.94118, - 39.46663, - 1367, - 16950, - -122.94137, - 39.466, - 1354, - 16960, - -122.94152, - 39.46533, - 1339, - 16970, - -122.94167, - 39.46467, - 1323, - 16980, - -122.94177, - 39.46402, - 1308, - 16990, - -122.94182, - 39.46335, - 1293, - 17000, - -122.94182, - 39.46272, - 1280, - 17010, - -122.94185, - 39.46208, - 1266, - 17020, - -122.9419, - 39.46143, - 1255, - 17030, - -122.94197, - 39.46075, - 1242, - 17040, - -122.94205, - 39.46008, - 1234, - 17050, - -122.94217, - 39.45943, - 1222, - 17060, - -122.94218, - 39.45878, - 1209, - 17070, - -122.94205, - 39.45812, - 1200, - 17080, - -122.94192, - 39.45747, - 1187, - 17090, - -122.94203, - 39.4568, - 1177, - 17100, - -122.94225, - 39.45618, - 1165, - 17110, - -122.9425, - 39.45553, - 1157, - 17120, - -122.94272, - 39.45493, - 1148, - 17130, - -122.94292, - 39.4543, - 1133, - 17140, - -122.94312, - 39.45367, - 1119, - 17150, - -122.9434, - 39.45308, - 1103, - 17160, - -122.94367, - 39.45247, - 1087, - 17170, - -122.94385, - 39.45185, - 1078, - 17180, - -122.94388, - 39.45123, - 1063, - 17190, - -122.94397, - 39.45062, - 1050, - 17200, - -122.94408, - 39.45, - 1035, - 17210, - -122.9442, - 39.44938, - 1025, - 17220, - -122.94438, - 39.4488, - 1014, - 17230, - -122.94447, - 39.44822, - 1004, - 17240, - -122.94462, - 39.44762, - 995, - 17250, - -122.94485, - 39.4471, - 992, - 17260, - -122.945, - 39.44657, - 980, - 17270, - -122.94523, - 39.44602, - 974, - 17280, - -122.9456, - 39.44557, - 964, - 17290, - -122.94595, - 39.44507, - 955, - 17300, - -122.94635, - 39.4446, - 941, - 17310, - -122.94675, - 39.44413, - 932, - 17320, - -122.94708, - 39.4437, - 922, - 17330, - -122.94752, - 39.44325, - 911, - 17340, - -122.94783, - 39.44278, - 905, - 17350, - -122.94788, - 39.4423, - 897, - 17360, - -122.9476, - 39.44187, - 886, - 17370, - -122.94702, - 39.44158, - 874, - 17380, - -122.9468, - 39.44117, - 867, - 17390, - -122.94737, - 39.4411, - 849, - 17400, - -122.94797, - 39.44112, - 836, - 17410, - -122.94862, - 39.44107, - 822, - 17420, - -122.94877, - 39.4408, - 812, - 17430, - -122.948, - 39.44087, - 806, - 17440, - -122.94803, - 39.44145, - 784, - 17450, - -122.9483, - 39.44157, - 777, - 17460, - -122.94843, - 39.4416, - 774, - 17470, - -122.94857, - 39.44163, - 773, - 17480, - -122.94868, - 39.44165, - 771, - 17490, - -122.9488, - 39.44167, - 769, - 17500, - -122.9489, - 39.44167, - 768, - 17510, - -122.949, - 39.44163, - 764, - 17520, - -122.94912, - 39.4416, - 759, - 17530, - -122.9492, - 39.44153, - 754, - 17540, - -122.94927, - 39.44143, - 749, - 17550, - -122.94932, - 39.44132, - 743, - 17560, - -122.9493, - 39.44117, - 737, - 17570, - -122.94925, - 39.44103, - 731, - 17580, - -122.94912, - 39.44088, - 727, - 17590, - -122.94897, - 39.44077, - 723, - 17600, - -122.94878, - 39.44067, - 719, - 17610, - -122.94863, - 39.44057, - 717, - 17620, - -122.94843, - 39.44048, - 712, - 17630, - -122.94822, - 39.4404, - 708, - 17640, - -122.94802, - 39.44033, - 704, - 17650, - -122.9478, - 39.44025, - 700, - 17660, - -122.9476, - 39.4402, - 697, - 17670, - -122.94738, - 39.44013, - 693, - 17680, - -122.94717, - 39.44005, - 689, - 17690, - -122.94697, - 39.44, - 685, - 17700, - -122.94673, - 39.43993, - 680, - 17710, - -122.9465, - 39.43988, - 676, - 17720, - -122.94627, - 39.43985, - 671, - 17730, - -122.94602, - 39.43982, - 666, - 17740, - -122.94578, - 39.43978, - 661, - 17750, - -122.94555, - 39.43977, - 657, - 17760, - -122.94528, - 39.43975, - 653, - 17770, - -122.94403, - 39.43993, - 627, - 17780, - -122.9434, - 39.44068, - 622, - 17790, - -122.94432, - 39.44108, - 597, - 17800, - -122.94505, - 39.44122, - 580, - 17810, - -122.94555, - 39.44123, - 572, - 17820, - -122.94562, - 39.44123, - 571, - 17830, - -122.94563, - 39.44123, - 571, - 17840, - -122.94562, - 39.44125, - 569, - 17850, - -122.94563, - 39.44125, - 569, - 17860, - -122.94563, - 39.44125, - 569, - 17870, - -122.94565, - 39.44125, - 568, - 17880, - -122.94563, - 39.44125, - 567, - 17890, - -122.94563, - 39.44125, - 566, + 0, -122.93797, 39.50935, 1776, 10, -122.93822, 39.50918, 1773, 20, + -122.9385, 39.50883, 1772, 30, -122.93855, 39.50842, 1770, 40, -122.93868, + 39.50792, 1770, 50, -122.93877, 39.50743, 1767, 60, -122.93862, 39.50697, + 1771, 70, -122.93828, 39.50648, 1765, 80, -122.93818, 39.50608, 1770, 90, + -122.93783, 39.5057, 1754, 100, -122.93777, 39.50513, 1732, 110, + -122.93793, 39.50458, 1727, 120, -122.93815, 39.50415, 1717, 130, + -122.9382, 39.50362, 1713, 140, -122.93818, 39.5031, 1703, 150, + -122.93812, 39.50258, 1706, 160, -122.93792, 39.5022, 1707, 170, + -122.93775, 39.50177, 1698, 180, -122.93745, 39.50125, 1693, 190, + -122.93723, 39.50073, 1694, 200, -122.9373, 39.50023, 1702, 210, + -122.93705, 39.49987, 1705, 220, -122.93642, 39.4996, 1699, 230, + -122.93593, 39.49927, 1693, 240, -122.936, 39.49895, 1691, 250, + -122.93645, 39.49907, 1689, 260, -122.93685, 39.49915, 1684, 270, + -122.93708, 39.4989, 1680, 280, -122.93687, 39.49843, 1684, 290, + -122.93685, 39.49808, 1691, 300, -122.93722, 39.49815, 1688, 310, + -122.93712, 39.49867, 1680, 320, -122.93633, 39.49893, 1681, 330, + -122.93615, 39.4989, 1682, 340, -122.936, 39.49885, 1682, 350, -122.93587, + 39.49877, 1682, 360, -122.93577, 39.49868, 1683, 370, -122.93568, 39.4986, + 1685, 380, -122.93563, 39.49853, 1685, 390, -122.9356, 39.49845, 1685, + 400, -122.9356, 39.4984, 1685, 410, -122.93562, 39.49835, 1685, 420, + -122.93565, 39.4983, 1686, 430, -122.93568, 39.49827, 1684, 440, + -122.93572, 39.49822, 1684, 450, -122.93575, 39.49817, 1682, 460, + -122.93577, 39.49812, 1682, 470, -122.93578, 39.49805, 1682, 480, + -122.93573, 39.498, 1682, 490, -122.93567, 39.49795, 1681, 500, + -122.93555, 39.4979, 1678, 510, -122.9354, 39.49788, 1676, 520, + -122.93522, 39.49792, 1674, 530, -122.93502, 39.49795, 1674, 540, + -122.93492, 39.4981, 1671, 550, -122.93483, 39.49827, 1669, 560, + -122.93485, 39.49842, 1668, 570, -122.93493, 39.49855, 1665, 580, + -122.93502, 39.49868, 1664, 590, -122.93517, 39.4987, 1665, 600, + -122.9353, 39.49873, 1665, 610, -122.93543, 39.49873, 1663, 620, + -122.93553, 39.49873, 1661, 630, -122.93567, 39.49872, 1660, 640, + -122.93577, 39.49868, 1663, 650, -122.93585, 39.49865, 1665, 660, + -122.93592, 39.49862, 1667, 670, -122.93597, 39.4986, 1665, 680, + -122.93607, 39.49857, 1664, 690, -122.93617, 39.49857, 1664, 700, + -122.93627, 39.49857, 1664, 710, -122.93638, 39.49857, 1664, 720, + -122.9365, 39.49857, 1666, 730, -122.9366, 39.49857, 1666, 740, + -122.93672, 39.49852, 1668, 750, -122.93678, 39.49847, 1672, 760, + -122.93685, 39.49842, 1673, 770, -122.93693, 39.4984, 1672, 780, -122.937, + 39.49837, 1670, 790, -122.93707, 39.49832, 1669, 800, -122.9371, 39.49827, + 1671, 810, -122.93713, 39.4982, 1671, 820, -122.93712, 39.49813, 1669, + 830, -122.93708, 39.49805, 1666, 840, -122.93702, 39.49797, 1663, 850, + -122.9369, 39.49787, 1663, 860, -122.93675, 39.4978, 1664, 870, + -122.93657, 39.49773, 1667, 880, -122.9364, 39.49772, 1670, 890, + -122.93623, 39.49773, 1671, 900, -122.93608, 39.49777, 1670, 910, + -122.93592, 39.49777, 1667, 920, -122.93573, 39.49773, 1667, 930, + -122.93557, 39.49767, 1667, 940, -122.93547, 39.49762, 1666, 950, + -122.93538, 39.49753, 1664, 960, -122.93537, 39.49747, 1661, 970, + -122.93542, 39.49738, 1657, 980, -122.9355, 39.49732, 1655, 990, + -122.9356, 39.49727, 1653, 1000, -122.93573, 39.49725, 1653, 1010, + -122.93588, 39.49725, 1652, 1020, -122.93602, 39.49728, 1652, 1030, + -122.93617, 39.49732, 1651, 1040, -122.93628, 39.49738, 1651, 1050, + -122.93638, 39.49745, 1650, 1060, -122.9365, 39.49752, 1649, 1070, + -122.93658, 39.4976, 1649, 1080, -122.93667, 39.49768, 1650, 1090, + -122.93675, 39.4978, 1651, 1100, -122.93683, 39.49788, 1654, 1110, + -122.93692, 39.49797, 1658, 1120, -122.93698, 39.49803, 1661, 1130, + -122.93707, 39.4981, 1661, 1140, -122.93717, 39.49817, 1661, 1150, + -122.93725, 39.49822, 1661, 1160, -122.93737, 39.49825, 1661, 1170, + -122.93745, 39.49823, 1662, 1180, -122.93748, 39.49817, 1661, 1190, + -122.93747, 39.49808, 1658, 1200, -122.93732, 39.49803, 1657, 1210, + -122.93715, 39.49807, 1660, 1220, -122.937, 39.49813, 1663, 1230, + -122.93692, 39.49823, 1666, 1240, -122.93688, 39.49833, 1666, 1250, + -122.93692, 39.49843, 1665, 1260, -122.93698, 39.49848, 1663, 1270, + -122.93708, 39.4985, 1661, 1280, -122.93717, 39.49848, 1660, 1290, + -122.93725, 39.49842, 1659, 1300, -122.93728, 39.49832, 1661, 1310, + -122.93725, 39.49823, 1663, 1320, -122.93717, 39.49817, 1663, 1330, + -122.93705, 39.49812, 1666, 1340, -122.93692, 39.49812, 1666, 1350, + -122.93675, 39.49815, 1667, 1360, -122.93663, 39.49825, 1668, 1370, + -122.93657, 39.49835, 1670, 1380, -122.93655, 39.49847, 1672, 1390, + -122.93657, 39.49855, 1673, 1400, -122.93663, 39.49863, 1673, 1410, + -122.93675, 39.49868, 1671, 1420, -122.93685, 39.49872, 1672, 1430, + -122.93695, 39.4987, 1674, 1440, -122.93702, 39.49865, 1677, 1450, + -122.93703, 39.49858, 1679, 1460, -122.93705, 39.4985, 1680, 1470, + -122.93702, 39.49843, 1681, 1480, -122.93693, 39.49837, 1682, 1490, + -122.93682, 39.49833, 1683, 1500, -122.9367, 39.49832, 1683, 1510, + -122.93653, 39.4983, 1684, 1520, -122.93638, 39.49833, 1686, 1530, + -122.93627, 39.49838, 1688, 1540, -122.93613, 39.49847, 1688, 1550, + -122.93605, 39.49857, 1688, 1560, -122.936, 39.49868, 1689, 1570, + -122.93603, 39.4988, 1691, 1580, -122.93612, 39.49888, 1693, 1590, + -122.9362, 39.49893, 1693, 1600, -122.9363, 39.49893, 1695, 1610, + -122.93638, 39.4989, 1695, 1620, -122.93645, 39.49883, 1696, 1630, + -122.93647, 39.49877, 1696, 1640, -122.93643, 39.49868, 1699, 1650, + -122.93637, 39.4986, 1701, 1660, -122.93625, 39.49857, 1702, 1670, + -122.9361, 39.49857, 1703, 1680, -122.93593, 39.49858, 1704, 1690, + -122.9358, 39.49862, 1704, 1700, -122.93568, 39.4987, 1703, 1710, + -122.93558, 39.4988, 1703, 1720, -122.93553, 39.49892, 1703, 1730, + -122.93553, 39.49905, 1702, 1740, -122.93558, 39.49917, 1705, 1750, + -122.93565, 39.49925, 1708, 1760, -122.93573, 39.49932, 1709, 1770, + -122.93582, 39.49933, 1711, 1780, -122.93592, 39.49932, 1713, 1790, + -122.93595, 39.49927, 1714, 1800, -122.93598, 39.4992, 1714, 1810, + -122.93597, 39.49912, 1715, 1820, -122.93588, 39.49903, 1716, 1830, + -122.93575, 39.49897, 1717, 1840, -122.9356, 39.49895, 1718, 1850, + -122.93545, 39.49895, 1717, 1860, -122.93527, 39.499, 1717, 1870, + -122.9351, 39.49908, 1719, 1880, -122.935, 39.49918, 1719, 1890, + -122.93492, 39.49932, 1719, 1900, -122.93492, 39.49945, 1720, 1910, + -122.93493, 39.49957, 1721, 1920, -122.935, 39.49965, 1722, 1930, + -122.9351, 39.49972, 1724, 1940, -122.9352, 39.49978, 1726, 1950, + -122.93528, 39.4998, 1727, 1960, -122.93535, 39.49982, 1728, 1970, + -122.93543, 39.49978, 1727, 1980, -122.93548, 39.49973, 1726, 1990, + -122.93552, 39.49965, 1728, 2000, -122.93548, 39.49957, 1729, 2010, + -122.93542, 39.49948, 1728, 2020, -122.93527, 39.49942, 1729, 2030, + -122.93512, 39.49942, 1731, 2040, -122.93495, 39.49942, 1732, 2050, + -122.9348, 39.49948, 1731, 2060, -122.9347, 39.49957, 1732, 2070, + -122.93463, 39.49968, 1733, 2080, -122.93462, 39.49978, 1733, 2090, + -122.93463, 39.4999, 1732, 2100, -122.9347, 39.49998, 1733, 2110, + -122.93478, 39.50003, 1736, 2120, -122.93487, 39.50007, 1739, 2130, + -122.93495, 39.50007, 1740, 2140, -122.93502, 39.50005, 1741, 2150, + -122.9351, 39.5, 1742, 2160, -122.93513, 39.49993, 1743, 2170, -122.93513, + 39.49985, 1744, 2180, -122.9351, 39.49977, 1747, 2190, -122.93502, + 39.4997, 1750, 2200, -122.9349, 39.49967, 1753, 2210, -122.93478, + 39.49965, 1753, 2220, -122.93467, 39.49965, 1750, 2230, -122.9345, + 39.49967, 1747, 2240, -122.93435, 39.49973, 1745, 2250, -122.9342, + 39.49983, 1747, 2260, -122.9341, 39.49995, 1749, 2270, -122.93407, + 39.50003, 1749, 2280, -122.93407, 39.50013, 1749, 2290, -122.9341, + 39.50025, 1748, 2300, -122.9342, 39.50032, 1750, 2310, -122.9343, + 39.50037, 1751, 2320, -122.9344, 39.5004, 1754, 2330, -122.9345, 39.50042, + 1755, 2340, -122.93462, 39.50042, 1756, 2350, -122.93468, 39.50038, 1757, + 2360, -122.93473, 39.50032, 1760, 2370, -122.93472, 39.50025, 1762, 2380, + -122.93463, 39.50017, 1762, 2390, -122.93447, 39.50012, 1764, 2400, + -122.93432, 39.50013, 1766, 2410, -122.93415, 39.50015, 1767, 2420, + -122.93402, 39.50023, 1766, 2430, -122.9339, 39.50032, 1765, 2440, + -122.9338, 39.50043, 1766, 2450, -122.93375, 39.50057, 1768, 2460, + -122.93375, 39.50068, 1769, 2470, -122.9338, 39.50077, 1772, 2480, + -122.93385, 39.50082, 1773, 2490, -122.93392, 39.50085, 1773, 2500, + -122.93402, 39.50088, 1772, 2510, -122.93412, 39.50087, 1773, 2520, + -122.93422, 39.50083, 1775, 2530, -122.9343, 39.50078, 1777, 2540, + -122.93437, 39.50073, 1779, 2550, -122.9344, 39.50067, 1782, 2560, + -122.93438, 39.5006, 1785, 2570, -122.93432, 39.50053, 1787, 2580, + -122.9342, 39.50048, 1787, 2590, -122.93408, 39.50048, 1786, 2600, + -122.93393, 39.50052, 1782, 2610, -122.93377, 39.50057, 1781, 2620, + -122.93367, 39.50065, 1781, 2630, -122.93362, 39.50083, 1780, 2640, + -122.93363, 39.50098, 1782, 2650, -122.93368, 39.50108, 1785, 2660, + -122.93378, 39.50118, 1787, 2670, -122.93388, 39.50125, 1789, 2680, + -122.93398, 39.50128, 1791, 2690, -122.93408, 39.50128, 1791, 2700, + -122.93415, 39.50125, 1790, 2710, -122.9342, 39.5012, 1789, 2720, + -122.93418, 39.50113, 1789, 2730, -122.93415, 39.50108, 1789, 2740, + -122.93407, 39.50102, 1787, 2750, -122.93397, 39.50098, 1786, 2760, + -122.93382, 39.50097, 1785, 2770, -122.93365, 39.50097, 1785, 2780, + -122.9335, 39.501, 1785, 2790, -122.93337, 39.50107, 1782, 2800, + -122.93323, 39.50118, 1782, 2810, -122.93317, 39.5013, 1783, 2820, + -122.93317, 39.50142, 1785, 2830, -122.9332, 39.50153, 1786, 2840, + -122.93327, 39.50162, 1786, 2850, -122.93337, 39.50168, 1785, 2860, + -122.9335, 39.50173, 1787, 2870, -122.93365, 39.50177, 1790, 2880, + -122.93377, 39.50178, 1791, 2890, -122.9339, 39.50178, 1791, 2900, + -122.93402, 39.50177, 1790, 2910, -122.93413, 39.50175, 1788, 2920, + -122.93425, 39.50173, 1786, 2930, -122.9344, 39.50172, 1785, 2940, + -122.93452, 39.5017, 1785, 2950, -122.93465, 39.50168, 1785, 2960, + -122.93477, 39.50167, 1784, 2970, -122.9349, 39.50163, 1781, 2980, + -122.93503, 39.5016, 1778, 2990, -122.9351, 39.50153, 1778, 3000, + -122.93512, 39.50145, 1781, 3010, -122.93507, 39.50138, 1781, 3020, + -122.93498, 39.50135, 1778, 3030, -122.93485, 39.50132, 1775, 3040, + -122.93468, 39.50135, 1773, 3050, -122.93453, 39.50143, 1772, 3060, + -122.93442, 39.50152, 1773, 3070, -122.93435, 39.50163, 1772, 3080, + -122.93435, 39.50173, 1770, 3090, -122.93442, 39.50183, 1767, 3100, + -122.93453, 39.50188, 1766, 3110, -122.93467, 39.50187, 1765, 3120, + -122.9348, 39.50185, 1764, 3130, -122.93488, 39.50182, 1763, 3140, + -122.93498, 39.50177, 1763, 3150, -122.93505, 39.50172, 1761, 3160, + -122.93512, 39.50165, 1759, 3170, -122.93522, 39.50158, 1757, 3180, + -122.9353, 39.50152, 1757, 3190, -122.93538, 39.50145, 1757, 3200, + -122.93545, 39.50142, 1755, 3210, -122.93553, 39.50137, 1751, 3220, + -122.93562, 39.5013, 1746, 3230, -122.9357, 39.50125, 1744, 3240, + -122.93578, 39.50117, 1741, 3250, -122.93583, 39.50107, 1741, 3260, + -122.93587, 39.50098, 1741, 3270, -122.9359, 39.5009, 1740, 3280, + -122.93592, 39.5008, 1739, 3290, -122.93592, 39.50072, 1739, 3300, + -122.93585, 39.50062, 1741, 3310, -122.93577, 39.50057, 1744, 3320, + -122.93565, 39.50053, 1743, 3330, -122.9355, 39.50055, 1741, 3340, + -122.93535, 39.50062, 1737, 3350, -122.93522, 39.50073, 1735, 3360, + -122.93517, 39.50087, 1735, 3370, -122.93518, 39.50102, 1735, 3380, + -122.93525, 39.50113, 1733, 3390, -122.93537, 39.5012, 1731, 3400, + -122.9355, 39.50122, 1728, 3410, -122.93565, 39.5012, 1726, 3420, + -122.9358, 39.50118, 1726, 3430, -122.93595, 39.50115, 1726, 3440, + -122.93607, 39.50112, 1728, 3450, -122.93617, 39.50108, 1731, 3460, + -122.93625, 39.50105, 1734, 3470, -122.93633, 39.50102, 1736, 3480, + -122.93638, 39.50097, 1737, 3490, -122.93642, 39.50088, 1738, 3500, + -122.93638, 39.5008, 1738, 3510, -122.9363, 39.50072, 1739, 3520, + -122.93617, 39.50067, 1740, 3530, -122.93602, 39.50065, 1742, 3540, + -122.93583, 39.50067, 1742, 3550, -122.9357, 39.50073, 1743, 3560, + -122.93558, 39.50083, 1744, 3570, -122.93552, 39.50097, 1745, 3580, + -122.93552, 39.50108, 1744, 3590, -122.93557, 39.5012, 1744, 3600, + -122.93567, 39.50127, 1743, 3610, -122.93577, 39.50133, 1743, 3620, + -122.9359, 39.50128, 1747, 3630, -122.93595, 39.50123, 1752, 3640, + -122.93598, 39.50118, 1755, 3650, -122.936, 39.50112, 1756, 3660, + -122.936, 39.50103, 1756, 3670, -122.93595, 39.50095, 1757, 3680, + -122.93585, 39.50087, 1761, 3690, -122.93572, 39.50083, 1764, 3700, + -122.93557, 39.50085, 1767, 3710, -122.93543, 39.5009, 1769, 3720, + -122.93532, 39.50098, 1768, 3730, -122.93522, 39.5011, 1767, 3740, + -122.93518, 39.50125, 1766, 3750, -122.9352, 39.5014, 1766, 3760, + -122.93527, 39.50152, 1768, 3770, -122.93537, 39.5016, 1770, 3780, + -122.93548, 39.50163, 1773, 3790, -122.93558, 39.50163, 1773, 3800, + -122.93567, 39.50163, 1774, 3810, -122.93577, 39.5016, 1776, 3820, + -122.9358, 39.50153, 1778, 3830, -122.93578, 39.50145, 1780, 3840, + -122.93573, 39.50138, 1781, 3850, -122.93563, 39.5013, 1781, 3860, + -122.93547, 39.50127, 1781, 3870, -122.93527, 39.50145, 1783, 3880, + -122.93515, 39.50157, 1786, 3890, -122.93513, 39.5017, 1790, 3900, + -122.93515, 39.50182, 1793, 3910, -122.93522, 39.50192, 1797, 3920, + -122.9353, 39.50198, 1797, 3930, -122.9354, 39.502, 1798, 3940, + -122.93552, 39.50197, 1799, 3950, -122.93557, 39.50192, 1803, 3960, + -122.93558, 39.50185, 1807, 3970, -122.93555, 39.50177, 1809, 3980, + -122.93548, 39.50168, 1813, 3990, -122.93535, 39.50163, 1816, 4000, + -122.93522, 39.50163, 1817, 4010, -122.93507, 39.50163, 1821, 4020, + -122.93492, 39.5017, 1824, 4030, -122.9348, 39.50177, 1826, 4040, + -122.9347, 39.50187, 1827, 4050, -122.93462, 39.50198, 1828, 4060, + -122.9346, 39.5021, 1831, 4070, -122.93462, 39.50223, 1832, 4080, + -122.93468, 39.50235, 1834, 4090, -122.93478, 39.50243, 1837, 4100, + -122.93488, 39.50247, 1840, 4110, -122.93498, 39.50248, 1842, 4120, + -122.93508, 39.50247, 1844, 4130, -122.93517, 39.50242, 1847, 4140, + -122.93522, 39.50238, 1849, 4150, -122.93523, 39.50232, 1852, 4160, + -122.9352, 39.50225, 1854, 4170, -122.93515, 39.50217, 1857, 4180, + -122.93505, 39.5021, 1859, 4190, -122.93493, 39.50207, 1862, 4200, + -122.9348, 39.50205, 1863, 4210, -122.93463, 39.50207, 1864, 4220, + -122.9345, 39.50213, 1867, 4230, -122.93437, 39.50223, 1869, 4240, + -122.9343, 39.50237, 1870, 4250, -122.93428, 39.50248, 1871, 4260, + -122.9343, 39.50262, 1872, 4270, -122.93438, 39.5027, 1874, 4280, + -122.93448, 39.50277, 1877, 4290, -122.9346, 39.50277, 1878, 4300, + -122.9347, 39.50273, 1878, 4310, -122.93478, 39.50265, 1880, 4320, + -122.9348, 39.50257, 1883, 4330, -122.9348, 39.50247, 1885, 4340, + -122.93473, 39.50238, 1888, 4350, -122.93465, 39.50232, 1889, 4360, + -122.93453, 39.50227, 1890, 4370, -122.93437, 39.50225, 1890, 4380, + -122.93418, 39.50227, 1889, 4390, -122.93398, 39.50233, 1888, 4400, + -122.93383, 39.50245, 1890, 4410, -122.93372, 39.50257, 1891, 4420, + -122.93363, 39.50272, 1891, 4430, -122.93362, 39.50285, 1894, 4440, + -122.93365, 39.50298, 1896, 4450, -122.93373, 39.50312, 1897, 4460, + -122.93373, 39.50312, 1897, 4470, -122.93385, 39.5032, 1898, 4480, + -122.93398, 39.50327, 1899, 4490, -122.9341, 39.50328, 1902, 4500, + -122.93422, 39.50328, 1906, 4510, -122.93432, 39.50325, 1906, 4520, + -122.93437, 39.50322, 1906, 4530, -122.9344, 39.50313, 1907, 4540, + -122.9344, 39.50307, 1909, 4550, -122.93433, 39.50302, 1912, 4560, + -122.93423, 39.50295, 1914, 4570, -122.93412, 39.50292, 1917, 4580, + -122.93397, 39.50292, 1919, 4590, -122.9338, 39.50295, 1920, 4600, + -122.93363, 39.50303, 1921, 4610, -122.93348, 39.50315, 1923, 4620, + -122.9334, 39.50328, 1924, 4630, -122.93337, 39.50342, 1924, 4640, + -122.9334, 39.50357, 1925, 4650, -122.93348, 39.50367, 1927, 4660, + -122.93358, 39.50372, 1929, 4670, -122.93368, 39.50373, 1932, 4680, + -122.93377, 39.50373, 1932, 4690, -122.93382, 39.50368, 1931, 4700, + -122.93383, 39.50362, 1933, 4710, -122.93382, 39.50355, 1937, 4720, + -122.93375, 39.5035, 1940, 4730, -122.93367, 39.50345, 1941, 4740, + -122.93355, 39.50342, 1944, 4750, -122.9334, 39.5034, 1946, 4760, + -122.93327, 39.50342, 1947, 4770, -122.93312, 39.50347, 1948, 4780, + -122.93295, 39.50353, 1949, 4790, -122.93283, 39.50363, 1949, 4800, + -122.93272, 39.50377, 1950, 4810, -122.93267, 39.50388, 1950, 4820, + -122.93267, 39.50402, 1952, 4830, -122.93272, 39.50415, 1954, 4840, + -122.93278, 39.50423, 1954, 4850, -122.93288, 39.5043, 1954, 4860, + -122.933, 39.50433, 1954, 4870, -122.9331, 39.50432, 1956, 4880, + -122.93322, 39.50428, 1958, 4890, -122.93327, 39.50423, 1960, 4900, + -122.93327, 39.50417, 1964, 4910, -122.93323, 39.50412, 1967, 4920, + -122.93317, 39.50407, 1968, 4930, -122.93308, 39.50403, 1966, 4940, + -122.93295, 39.504, 1964, 4950, -122.9328, 39.50397, 1964, 4960, + -122.93262, 39.50395, 1966, 4970, -122.93245, 39.50397, 1967, 4980, + -122.9323, 39.504, 1970, 4990, -122.93215, 39.50405, 1971, 5000, + -122.93203, 39.50413, 1970, 5010, -122.93192, 39.50423, 1967, 5020, + -122.93182, 39.5044, 1965, 5030, -122.9318, 39.50457, 1964, 5040, + -122.93185, 39.50473, 1966, 5050, -122.93193, 39.50485, 1968, 5060, + -122.93202, 39.50493, 1969, 5070, -122.93215, 39.50498, 1969, 5080, + -122.93227, 39.50498, 1969, 5090, -122.9324, 39.50497, 1969, 5100, + -122.93252, 39.50493, 1970, 5110, -122.9326, 39.5049, 1973, 5120, + -122.93267, 39.50487, 1977, 5130, -122.93273, 39.50482, 1980, 5140, + -122.93275, 39.50478, 1981, 5150, -122.93273, 39.50472, 1982, 5160, + -122.93267, 39.50467, 1982, 5170, -122.93253, 39.50463, 1981, 5180, + -122.93237, 39.50463, 1979, 5190, -122.93217, 39.50465, 1978, 5200, + -122.93197, 39.50473, 1977, 5210, -122.9318, 39.50483, 1976, 5220, + -122.9317, 39.50497, 1975, 5230, -122.93165, 39.50513, 1974, 5240, + -122.93168, 39.50527, 1972, 5250, -122.93177, 39.50538, 1970, 5260, + -122.9319, 39.50547, 1967, 5270, -122.93222, 39.50548, 1963, 5280, + -122.93232, 39.50542, 1969, 5290, -122.93242, 39.50537, 1973, 5300, + -122.9325, 39.50532, 1977, 5310, -122.93257, 39.50527, 1978, 5320, + -122.93263, 39.50522, 1978, 5330, -122.93273, 39.50515, 1979, 5340, + -122.93282, 39.50512, 1981, 5350, -122.93293, 39.5051, 1984, 5360, + -122.93307, 39.50512, 1989, 5370, -122.93317, 39.50517, 1993, 5380, + -122.93327, 39.50527, 1994, 5390, -122.9333, 39.50538, 1996, 5400, + -122.93328, 39.50553, 1996, 5410, -122.9332, 39.50568, 1995, 5420, + -122.93308, 39.50582, 1997, 5430, -122.9329, 39.50595, 1999, 5440, + -122.9327, 39.50598, 2002, 5450, -122.93255, 39.50598, 2009, 5460, + -122.93243, 39.50595, 2012, 5470, -122.93237, 39.5059, 2011, 5480, + -122.93232, 39.50583, 2010, 5490, -122.93235, 39.50573, 2011, 5500, + -122.93243, 39.50567, 2013, 5510, -122.93255, 39.50567, 2017, 5520, + -122.93268, 39.5057, 2018, 5530, -122.93278, 39.50578, 2019, 5540, + -122.93287, 39.50593, 2021, 5550, -122.93295, 39.50605, 2022, 5560, + -122.93305, 39.50613, 2023, 5570, -122.93315, 39.5062, 2023, 5580, + -122.93323, 39.50618, 2026, 5590, -122.93328, 39.50612, 2027, 5600, + -122.93323, 39.50607, 2028, 5610, -122.93313, 39.50602, 2029, 5620, + -122.93297, 39.506, 2031, 5630, -122.9328, 39.50605, 2034, 5640, + -122.93267, 39.50612, 2036, 5650, -122.93253, 39.50623, 2037, 5660, + -122.93247, 39.50633, 2036, 5670, -122.93242, 39.50648, 2032, 5680, + -122.93242, 39.50665, 2032, 5690, -122.93248, 39.50678, 2035, 5700, + -122.93258, 39.50688, 2038, 5710, -122.9327, 39.50693, 2038, 5720, + -122.93282, 39.50693, 2038, 5730, -122.9329, 39.50688, 2039, 5740, + -122.93293, 39.5068, 2042, 5750, -122.93293, 39.50673, 2045, 5760, + -122.93292, 39.50665, 2046, 5770, -122.93293, 39.50655, 2049, 5780, + -122.933, 39.5065, 2056, 5790, -122.93305, 39.50648, 2063, 5800, + -122.93312, 39.50652, 2064, 5810, -122.93322, 39.50655, 2062, 5820, + -122.93333, 39.50662, 2061, 5830, -122.93345, 39.50675, 2061, 5840, + -122.9335, 39.5069, 2061, 5850, -122.9335, 39.50705, 2062, 5860, + -122.93345, 39.50722, 2063, 5870, -122.93335, 39.50735, 2063, 5880, + -122.93322, 39.50745, 2062, 5890, -122.93303, 39.50753, 2064, 5900, + -122.93287, 39.50755, 2067, 5910, -122.93273, 39.50753, 2070, 5920, + -122.93262, 39.5075, 2072, 5930, -122.93253, 39.50745, 2075, 5940, + -122.93248, 39.5074, 2079, 5950, -122.93247, 39.50735, 2080, 5960, + -122.93245, 39.50727, 2082, 5970, -122.93248, 39.5072, 2084, 5980, + -122.93257, 39.50715, 2087, 5990, -122.93267, 39.50712, 2091, 6000, + -122.93277, 39.50713, 2094, 6010, -122.93288, 39.50717, 2095, 6020, + -122.933, 39.50723, 2096, 6030, -122.93308, 39.50733, 2096, 6040, + -122.93315, 39.50747, 2098, 6050, -122.9332, 39.5076, 2099, 6060, + -122.93323, 39.50773, 2098, 6070, -122.93322, 39.50788, 2095, 6080, + -122.9332, 39.50805, 2094, 6090, -122.93312, 39.5082, 2093, 6100, + -122.933, 39.50835, 2093, 6110, -122.93287, 39.50845, 2094, 6120, + -122.93272, 39.50855, 2095, 6130, -122.93255, 39.5086, 2095, 6140, + -122.93238, 39.50862, 2096, 6150, -122.93225, 39.50858, 2097, 6160, + -122.93215, 39.50853, 2098, 6170, -122.9321, 39.50847, 2100, 6180, + -122.93207, 39.50842, 2101, 6190, -122.93208, 39.50835, 2103, 6200, + -122.9321, 39.50828, 2106, 6210, -122.93213, 39.50823, 2109, 6220, + -122.93217, 39.50818, 2111, 6230, -122.93222, 39.50815, 2113, 6240, + -122.93228, 39.50813, 2113, 6250, -122.93235, 39.50812, 2112, 6260, + -122.93247, 39.5081, 2111, 6270, -122.93258, 39.5081, 2110, 6280, + -122.93273, 39.50812, 2110, 6290, -122.93288, 39.50812, 2111, 6300, + -122.933, 39.50812, 2113, 6310, -122.9331, 39.50808, 2115, 6320, + -122.93315, 39.50803, 2116, 6330, -122.93318, 39.50798, 2116, 6340, + -122.93315, 39.50793, 2116, 6350, -122.9331, 39.50788, 2115, 6360, + -122.93298, 39.50783, 2114, 6370, -122.93283, 39.50783, 2115, 6380, + -122.93268, 39.50787, 2116, 6390, -122.93253, 39.50792, 2118, 6400, + -122.9324, 39.508, 2120, 6410, -122.9323, 39.50812, 2122, 6420, + -122.93222, 39.50825, 2122, 6430, -122.93218, 39.50838, 2122, 6440, + -122.9322, 39.50852, 2123, 6450, -122.93228, 39.50865, 2122, 6460, + -122.9324, 39.50873, 2123, 6470, -122.93253, 39.5088, 2123, 6480, + -122.93263, 39.50882, 2124, 6490, -122.93272, 39.50882, 2121, 6500, + -122.93282, 39.50878, 2117, 6510, -122.9329, 39.50873, 2116, 6520, + -122.93298, 39.50868, 2117, 6530, -122.93307, 39.50863, 2119, 6540, + -122.93312, 39.5086, 2119, 6550, -122.93318, 39.50857, 2117, 6560, + -122.93327, 39.50853, 2116, 6570, -122.93335, 39.5085, 2115, 6580, + -122.93343, 39.50847, 2114, 6590, -122.93352, 39.50843, 2114, 6600, + -122.93362, 39.50842, 2114, 6610, -122.93372, 39.50842, 2114, 6620, + -122.93382, 39.50843, 2108, 6630, -122.93395, 39.5085, 2101, 6640, + -122.93408, 39.50862, 2096, 6650, -122.93422, 39.50872, 2094, 6660, + -122.93437, 39.50882, 2094, 6670, -122.93448, 39.5089, 2093, 6680, + -122.9346, 39.50898, 2090, 6690, -122.93472, 39.50907, 2085, 6700, + -122.93485, 39.50913, 2081, 6710, -122.935, 39.50922, 2075, 6720, + -122.93515, 39.50927, 2071, 6730, -122.9353, 39.50933, 2069, 6740, + -122.93543, 39.50938, 2068, 6750, -122.93552, 39.50943, 2065, 6760, + -122.93563, 39.50947, 2060, 6770, -122.93575, 39.5095, 2054, 6780, + -122.93588, 39.50952, 2050, 6790, -122.93602, 39.5095, 2048, 6800, + -122.93615, 39.5095, 2046, 6810, -122.93625, 39.50947, 2044, 6820, + -122.93635, 39.50943, 2041, 6830, -122.93645, 39.5094, 2037, 6840, + -122.93655, 39.50935, 2032, 6850, -122.93667, 39.5093, 2027, 6860, + -122.93673, 39.50923, 2024, 6870, -122.93682, 39.50915, 2022, 6880, + -122.93687, 39.50908, 2019, 6890, -122.93692, 39.509, 2015, 6900, + -122.93695, 39.5089, 2011, 6910, -122.93695, 39.5088, 2009, 6920, + -122.93697, 39.5087, 2007, 6930, -122.93698, 39.50858, 2005, 6940, + -122.93698, 39.5085, 2003, 6950, -122.93698, 39.50838, 1998, 6960, + -122.937, 39.50825, 1996, 6970, -122.937, 39.50812, 1997, 6980, -122.937, + 39.50798, 1998, 6990, -122.93698, 39.50787, 1998, 7000, -122.93697, + 39.50775, 1996, 7010, -122.93695, 39.50763, 1993, 7020, -122.93693, + 39.50753, 1990, 7030, -122.93693, 39.50742, 1987, 7040, -122.93695, + 39.50732, 1983, 7050, -122.93687, 39.50673, 1967, 7060, -122.93663, + 39.5061, 1948, 7070, -122.93645, 39.50553, 1942, 7080, -122.93627, + 39.50498, 1934, 7090, -122.93595, 39.50445, 1930, 7100, -122.93558, + 39.50385, 1917, 7110, -122.93542, 39.50317, 1907, 7120, -122.93533, + 39.50258, 1911, 7130, -122.93567, 39.50247, 1907, 7140, -122.93553, + 39.50302, 1897, 7150, -122.93473, 39.50302, 1897, 7160, -122.93457, + 39.50282, 1892, 7170, -122.93453, 39.5027, 1892, 7180, -122.93452, + 39.50262, 1893, 7190, -122.93448, 39.50253, 1892, 7200, -122.93445, + 39.50243, 1888, 7210, -122.93443, 39.50233, 1885, 7220, -122.93442, + 39.50222, 1883, 7230, -122.93442, 39.5021, 1883, 7240, -122.93442, 39.502, + 1883, 7250, -122.9344, 39.50188, 1882, 7260, -122.93438, 39.5018, 1881, + 7270, -122.93433, 39.50168, 1879, 7280, -122.93427, 39.50157, 1876, 7290, + -122.9342, 39.50147, 1875, 7300, -122.93413, 39.50135, 1874, 7310, + -122.9341, 39.50123, 1875, 7320, -122.9341, 39.50115, 1876, 7330, + -122.9341, 39.50105, 1876, 7340, -122.93415, 39.50097, 1873, 7350, + -122.9342, 39.5009, 1871, 7360, -122.93425, 39.50082, 1871, 7370, + -122.93432, 39.50077, 1872, 7380, -122.93437, 39.50072, 1871, 7390, + -122.93443, 39.50068, 1868, 7400, -122.93452, 39.50063, 1864, 7410, + -122.9346, 39.50058, 1863, 7420, -122.93468, 39.50053, 1862, 7430, + -122.93477, 39.50047, 1859, 7440, -122.93487, 39.50042, 1857, 7450, + -122.93495, 39.50037, 1856, 7460, -122.93505, 39.5003, 1856, 7470, + -122.9351, 39.50023, 1856, 7480, -122.93513, 39.50018, 1855, 7490, + -122.93517, 39.50012, 1854, 7500, -122.9352, 39.50005, 1853, 7510, + -122.93522, 39.49998, 1851, 7520, -122.93523, 39.4999, 1849, 7530, + -122.93523, 39.49983, 1848, 7540, -122.93522, 39.49975, 1847, 7550, + -122.93522, 39.49968, 1846, 7560, -122.93522, 39.4996, 1844, 7570, + -122.93522, 39.4995, 1843, 7580, -122.93522, 39.4994, 1845, 7590, + -122.93522, 39.4993, 1847, 7600, -122.93522, 39.4992, 1850, 7610, + -122.93518, 39.49912, 1852, 7620, -122.93512, 39.49903, 1856, 7630, + -122.93503, 39.499, 1860, 7640, -122.93493, 39.49898, 1861, 7650, + -122.93482, 39.499, 1861, 7660, -122.93468, 39.49905, 1859, 7670, + -122.93453, 39.49913, 1858, 7680, -122.93442, 39.4993, 1858, 7690, + -122.9344, 39.49945, 1861, 7700, -122.9344, 39.49958, 1866, 7710, + -122.93445, 39.4997, 1868, 7720, -122.93453, 39.49978, 1869, 7730, + -122.93465, 39.49987, 1869, 7740, -122.93477, 39.4999, 1869, 7750, + -122.93488, 39.4999, 1871, 7760, -122.93498, 39.49987, 1873, 7770, + -122.93503, 39.49982, 1876, 7780, -122.93503, 39.49975, 1878, 7790, + -122.93503, 39.49968, 1879, 7800, -122.93498, 39.49962, 1882, 7810, + -122.93488, 39.49958, 1884, 7820, -122.93475, 39.49955, 1884, 7830, + -122.9346, 39.49955, 1886, 7840, -122.93442, 39.4996, 1887, 7850, + -122.93427, 39.49968, 1890, 7860, -122.93415, 39.4998, 1894, 7870, + -122.93408, 39.4999, 1897, 7880, -122.93405, 39.50003, 1898, 7890, + -122.93405, 39.50017, 1898, 7900, -122.93412, 39.50028, 1898, 7910, + -122.93422, 39.5004, 1897, 7920, -122.93437, 39.50047, 1899, 7930, + -122.93447, 39.5005, 1901, 7940, -122.9346, 39.5005, 1903, 7950, + -122.93468, 39.50048, 1904, 7960, -122.93472, 39.50043, 1906, 7970, + -122.93473, 39.50037, 1909, 7980, -122.93473, 39.50032, 1911, 7990, + -122.93468, 39.50027, 1913, 8000, -122.93462, 39.5002, 1915, 8010, + -122.93452, 39.50017, 1918, 8020, -122.93437, 39.50015, 1921, 8030, + -122.93422, 39.50017, 1923, 8040, -122.93405, 39.50022, 1923, 8050, + -122.93385, 39.50033, 1923, 8060, -122.93375, 39.50045, 1924, 8070, + -122.9337, 39.50062, 1925, 8080, -122.93373, 39.50078, 1928, 8090, + -122.93382, 39.50088, 1930, 8100, -122.93395, 39.50095, 1931, 8110, + -122.93407, 39.50097, 1931, 8120, -122.93415, 39.50093, 1932, 8130, + -122.9342, 39.50088, 1933, 8140, -122.9342, 39.50082, 1935, 8150, + -122.93415, 39.50075, 1938, 8160, -122.93403, 39.50072, 1941, 8170, + -122.9339, 39.5007, 1943, 8180, -122.93373, 39.5007, 1945, 8190, + -122.93358, 39.50075, 1947, 8200, -122.9334, 39.50085, 1949, 8210, + -122.93327, 39.50097, 1952, 8220, -122.93318, 39.5011, 1954, 8230, + -122.93317, 39.50125, 1955, 8240, -122.93322, 39.50138, 1955, 8250, + -122.93332, 39.5015, 1954, 8260, -122.93345, 39.50157, 1954, 8270, + -122.93358, 39.50158, 1954, 8280, -122.93368, 39.50157, 1955, 8290, + -122.93378, 39.50152, 1956, 8300, -122.93382, 39.50145, 1956, 8310, + -122.93385, 39.50138, 1956, 8320, -122.93385, 39.50128, 1955, 8330, + -122.9338, 39.5012, 1958, 8340, -122.93373, 39.50113, 1962, 8350, + -122.93363, 39.5011, 1963, 8360, -122.9335, 39.50107, 1963, 8370, + -122.93333, 39.50107, 1964, 8380, -122.93315, 39.5011, 1963, 8390, + -122.93297, 39.50117, 1964, 8400, -122.9328, 39.5013, 1965, 8410, + -122.93272, 39.50145, 1969, 8420, -122.9327, 39.50162, 1973, 8430, + -122.93275, 39.50175, 1975, 8440, -122.93285, 39.50183, 1978, 8450, + -122.933, 39.50187, 1979, 8460, -122.9331, 39.50185, 1979, 8470, + -122.93318, 39.5018, 1981, 8480, -122.9332, 39.50172, 1983, 8490, + -122.93317, 39.50167, 1985, 8500, -122.93308, 39.5016, 1988, 8510, + -122.93297, 39.50158, 1989, 8520, -122.93282, 39.50158, 1990, 8530, + -122.93263, 39.50162, 1993, 8540, -122.9325, 39.50172, 1994, 8550, + -122.93237, 39.50183, 1995, 8560, -122.93232, 39.502, 1997, 8570, + -122.93233, 39.50213, 1999, 8580, -122.93242, 39.50227, 2003, 8590, + -122.93252, 39.50233, 2005, 8600, -122.93263, 39.50237, 2006, 8610, + -122.93275, 39.50235, 2006, 8620, -122.93283, 39.50232, 2005, 8630, + -122.93288, 39.50223, 2003, 8640, -122.93287, 39.50212, 2004, 8650, + -122.9328, 39.50205, 2004, 8660, -122.93265, 39.50198, 2004, 8670, + -122.9325, 39.50197, 2005, 8680, -122.93232, 39.50198, 2006, 8690, + -122.93212, 39.50203, 2008, 8700, -122.93197, 39.50213, 2012, 8710, + -122.93185, 39.50225, 2014, 8720, -122.93178, 39.5024, 2016, 8730, + -122.93178, 39.50255, 2018, 8740, -122.93185, 39.50268, 2021, 8750, + -122.93195, 39.50277, 2023, 8760, -122.93205, 39.50282, 2024, 8770, + -122.93217, 39.50285, 2025, 8780, -122.93227, 39.50282, 2025, 8790, + -122.93235, 39.50277, 2025, 8800, -122.93242, 39.50268, 2025, 8810, + -122.93242, 39.50258, 2024, 8820, -122.93237, 39.50248, 2024, 8830, + -122.93228, 39.5024, 2023, 8840, -122.93217, 39.50233, 2023, 8850, + -122.93202, 39.5023, 2023, 8860, -122.93185, 39.50227, 2023, 8870, + -122.93167, 39.50228, 2025, 8880, -122.93147, 39.50232, 2028, 8890, + -122.93133, 39.5024, 2030, 8900, -122.93118, 39.5025, 2031, 8910, + -122.93113, 39.50265, 2033, 8920, -122.93112, 39.50278, 2035, 8930, + -122.93118, 39.50292, 2038, 8940, -122.93128, 39.503, 2040, 8950, + -122.9314, 39.50302, 2041, 8960, -122.9315, 39.50298, 2040, 8970, + -122.93155, 39.5029, 2041, 8980, -122.93157, 39.50282, 2041, 8990, + -122.93147, 39.50273, 2043, 9000, -122.93137, 39.50268, 2044, 9010, + -122.93122, 39.50265, 2045, 9020, -122.93107, 39.50265, 2045, 9030, + -122.9309, 39.50268, 2045, 9040, -122.93073, 39.50277, 2046, 9050, + -122.9306, 39.50288, 2049, 9060, -122.93053, 39.50303, 2052, 9070, + -122.9305, 39.50315, 2055, 9080, -122.93052, 39.50327, 2057, 9090, + -122.93057, 39.50338, 2059, 9100, -122.93065, 39.50347, 2060, 9110, + -122.93077, 39.50352, 2062, 9120, -122.93088, 39.50352, 2062, 9130, + -122.93098, 39.5035, 2063, 9140, -122.93107, 39.50343, 2062, 9150, + -122.9311, 39.50335, 2063, 9160, -122.93112, 39.50325, 2063, 9170, + -122.93108, 39.50315, 2063, 9180, -122.93102, 39.50307, 2063, 9190, + -122.93093, 39.50298, 2064, 9200, -122.9308, 39.50292, 2064, 9210, + -122.93068, 39.50287, 2064, 9220, -122.93052, 39.50283, 2065, 9230, + -122.93035, 39.50285, 2065, 9240, -122.93022, 39.50292, 2065, 9250, + -122.93007, 39.50302, 2066, 9260, -122.93, 39.50313, 2066, 9270, -122.93, + 39.50327, 2066, 9280, -122.93005, 39.5034, 2067, 9290, -122.93015, + 39.5035, 2068, 9300, -122.93027, 39.50355, 2069, 9310, -122.93038, + 39.50355, 2070, 9320, -122.9305, 39.50353, 2070, 9330, -122.9306, + 39.50348, 2069, 9340, -122.93065, 39.5034, 2065, 9350, -122.93068, + 39.5033, 2063, 9360, -122.93065, 39.50318, 2064, 9370, -122.9306, + 39.50308, 2062, 9380, -122.93048, 39.50298, 2059, 9390, -122.93033, + 39.50292, 2057, 9400, -122.93017, 39.50288, 2055, 9410, -122.92998, + 39.50288, 2054, 9420, -122.9298, 39.50293, 2052, 9430, -122.92963, 39.503, + 2050, 9440, -122.9295, 39.50313, 2048, 9450, -122.92943, 39.50327, 2047, + 9460, -122.92945, 39.5034, 2048, 9470, -122.92945, 39.5034, 2048, 9480, + -122.9295, 39.5035, 2049, 9490, -122.92958, 39.5036, 2050, 9500, + -122.9297, 39.50367, 2051, 9510, -122.9298, 39.5037, 2052, 9520, + -122.92992, 39.50368, 2053, 9530, -122.93002, 39.50363, 2052, 9540, + -122.93007, 39.50355, 2051, 9550, -122.93008, 39.50343, 2048, 9560, + -122.93002, 39.50332, 2046, 9570, -122.92992, 39.50322, 2044, 9580, + -122.92975, 39.50315, 2041, 9590, -122.92957, 39.50312, 2039, 9600, + -122.92935, 39.50315, 2037, 9610, -122.92917, 39.50323, 2033, 9620, + -122.92903, 39.50337, 2031, 9630, -122.92895, 39.50353, 2029, 9640, + -122.92897, 39.50367, 2029, 9650, -122.92903, 39.5038, 2030, 9660, + -122.92913, 39.5039, 2033, 9670, -122.92923, 39.50397, 2036, 9680, + -122.92935, 39.50402, 2037, 9690, -122.92947, 39.50405, 2036, 9700, + -122.92958, 39.50403, 2035, 9710, -122.9297, 39.50398, 2031, 9720, + -122.92982, 39.50392, 2028, 9730, -122.92992, 39.50388, 2028, 9740, + -122.93002, 39.50388, 2028, 9750, -122.93008, 39.5039, 2028, 9760, + -122.93015, 39.50395, 2023, 9770, -122.93022, 39.50403, 2015, 9780, + -122.93032, 39.50412, 2013, 9790, -122.93043, 39.5042, 2013, 9800, + -122.93053, 39.50423, 2014, 9810, -122.93063, 39.50423, 2013, 9820, + -122.93073, 39.50422, 2011, 9830, -122.9308, 39.50415, 2007, 9840, + -122.93085, 39.50407, 2004, 9850, -122.9309, 39.50395, 2002, 9860, + -122.93095, 39.50387, 2001, 9870, -122.93098, 39.50377, 2001, 9880, + -122.93102, 39.50368, 2000, 9890, -122.93105, 39.50358, 1999, 9900, + -122.93107, 39.50348, 1998, 9910, -122.93108, 39.5034, 1997, 9920, + -122.93108, 39.5033, 1993, 9930, -122.9311, 39.50317, 1989, 9940, + -122.93113, 39.50307, 1987, 9950, -122.93117, 39.50295, 1989, 9960, + -122.93118, 39.50288, 1990, 9970, -122.93123, 39.5028, 1988, 9980, + -122.93127, 39.50272, 1983, 9990, -122.93133, 39.50262, 1980, 10000, + -122.93142, 39.50252, 1979, 10010, -122.93148, 39.50242, 1980, 10020, + -122.93153, 39.50235, 1980, 10030, -122.93155, 39.50225, 1979, 10040, + -122.93153, 39.50217, 1978, 10050, -122.93147, 39.50208, 1976, 10060, + -122.93133, 39.50202, 1971, 10070, -122.93117, 39.50198, 1967, 10080, + -122.93098, 39.50202, 1963, 10090, -122.93078, 39.5021, 1960, 10100, + -122.93067, 39.5022, 1961, 10110, -122.93057, 39.50232, 1961, 10120, + -122.93052, 39.50242, 1961, 10130, -122.93048, 39.50253, 1960, 10140, + -122.93047, 39.50263, 1958, 10150, -122.9305, 39.50272, 1956, 10160, + -122.93057, 39.50278, 1954, 10170, -122.93065, 39.50285, 1951, 10180, + -122.93075, 39.50287, 1949, 10190, -122.93087, 39.50285, 1945, 10200, + -122.93097, 39.50282, 1941, 10210, -122.93107, 39.50275, 1939, 10220, + -122.93115, 39.50267, 1936, 10230, -122.93122, 39.5026, 1934, 10240, + -122.93128, 39.50252, 1932, 10250, -122.93135, 39.50242, 1929, 10260, + -122.93142, 39.50233, 1926, 10270, -122.93148, 39.50225, 1924, 10280, + -122.93152, 39.50218, 1924, 10290, -122.93157, 39.50212, 1923, 10300, + -122.93163, 39.50205, 1920, 10310, -122.93172, 39.50202, 1915, 10320, + -122.9318, 39.50195, 1909, 10330, -122.93188, 39.50187, 1904, 10340, + -122.93197, 39.50178, 1900, 10350, -122.93208, 39.5017, 1896, 10360, + -122.93218, 39.50162, 1896, 10370, -122.93228, 39.50157, 1897, 10380, + -122.93237, 39.50152, 1897, 10390, -122.93243, 39.50147, 1894, 10400, + -122.93252, 39.50142, 1891, 10410, -122.93262, 39.50137, 1890, 10420, + -122.93268, 39.50132, 1888, 10430, -122.93302, 39.50147, 1877, 10440, + -122.9323, 39.5019, 1865, 10450, -122.93167, 39.50163, 1851, 10460, + -122.93178, 39.50137, 1842, 10470, -122.93185, 39.5013, 1840, 10480, + -122.93193, 39.50122, 1838, 10490, -122.93202, 39.50115, 1835, 10500, + -122.9321, 39.50108, 1833, 10510, -122.93218, 39.50102, 1831, 10520, + -122.93227, 39.50095, 1829, 10530, -122.93235, 39.50088, 1827, 10540, + -122.93243, 39.50082, 1824, 10550, -122.9325, 39.50075, 1822, 10560, + -122.93258, 39.50067, 1819, 10570, -122.93263, 39.5006, 1818, 10580, + -122.93268, 39.50053, 1816, 10590, -122.93275, 39.50045, 1813, 10600, + -122.93282, 39.50038, 1811, 10610, -122.93288, 39.5003, 1807, 10620, + -122.93295, 39.50023, 1804, 10630, -122.93307, 39.50017, 1800, 10640, + -122.93318, 39.5001, 1795, 10650, -122.9333, 39.50005, 1793, 10660, + -122.93342, 39.5, 1791, 10670, -122.93353, 39.49995, 1789, 10680, + -122.93363, 39.49992, 1787, 10690, -122.93373, 39.49987, 1784, 10700, + -122.93385, 39.49982, 1782, 10710, -122.93393, 39.49978, 1779, 10720, + -122.93403, 39.49973, 1777, 10730, -122.93412, 39.4997, 1775, 10740, + -122.9342, 39.49965, 1773, 10750, -122.9343, 39.4996, 1769, 10760, + -122.93438, 39.49955, 1764, 10770, -122.93478, 39.49922, 1749, 10780, + -122.93517, 39.49888, 1733, 10790, -122.93577, 39.49863, 1739, 10800, + -122.93617, 39.49847, 1742, 10810, -122.93622, 39.49908, 1743, 10820, + -122.93563, 39.4991, 1748, 10830, -122.936, 39.49908, 1753, 10840, + -122.93605, 39.49922, 1753, 10850, -122.93602, 39.49937, 1753, 10860, + -122.93592, 39.49948, 1754, 10870, -122.93577, 39.49958, 1756, 10880, + -122.9356, 39.4996, 1756, 10890, -122.93545, 39.49957, 1755, 10900, + -122.93535, 39.49948, 1755, 10910, -122.93535, 39.4994, 1756, 10920, + -122.9354, 39.49933, 1756, 10930, -122.93548, 39.49932, 1757, 10940, + -122.93558, 39.49932, 1758, 10950, -122.9357, 39.49937, 1758, 10960, + -122.93577, 39.49947, 1759, 10970, -122.93582, 39.4996, 1759, 10980, + -122.9358, 39.49973, 1759, 10990, -122.93568, 39.49987, 1759, 11000, + -122.9355, 39.49995, 1761, 11010, -122.93533, 39.49997, 1763, 11020, + -122.9352, 39.49995, 1763, 11030, -122.93508, 39.49992, 1763, 11040, + -122.93505, 39.49985, 1761, 11050, -122.9351, 39.49978, 1759, 11060, + -122.93522, 39.49975, 1759, 11070, -122.93533, 39.49977, 1759, 11080, + -122.93545, 39.49982, 1760, 11090, -122.93557, 39.49988, 1763, 11100, + -122.93565, 39.49997, 1765, 11110, -122.9357, 39.50007, 1767, 11120, + -122.93573, 39.50018, 1767, 11130, -122.93573, 39.50033, 1765, 11140, + -122.9357, 39.50047, 1762, 11150, -122.9356, 39.50062, 1761, 11160, + -122.93547, 39.50077, 1761, 11170, -122.93533, 39.50087, 1762, 11180, + -122.93518, 39.50093, 1763, 11190, -122.93503, 39.501, 1763, 11200, + -122.93488, 39.50103, 1760, 11210, -122.93472, 39.50103, 1757, 11220, + -122.93457, 39.501, 1757, 11230, -122.93445, 39.50095, 1757, 11240, + -122.93438, 39.50088, 1758, 11250, -122.93437, 39.50083, 1758, 11260, + -122.9344, 39.50077, 1756, 11270, -122.93448, 39.50073, 1755, 11280, + -122.93458, 39.50073, 1756, 11290, -122.9347, 39.50075, 1758, 11300, + -122.9348, 39.50078, 1760, 11310, -122.9349, 39.5008, 1761, 11320, + -122.93502, 39.50083, 1762, 11330, -122.9351, 39.50083, 1762, 11340, + -122.93517, 39.50083, 1762, 11350, -122.93522, 39.5008, 1763, 11360, + -122.93523, 39.50077, 1763, 11370, -122.93525, 39.50072, 1763, 11380, + -122.93525, 39.50067, 1763, 11390, -122.93525, 39.50062, 1764, 11400, + -122.93527, 39.50055, 1766, 11410, -122.93527, 39.5005, 1766, 11420, + -122.93528, 39.50045, 1766, 11430, -122.93533, 39.50042, 1765, 11440, + -122.93538, 39.5004, 1764, 11450, -122.93545, 39.50042, 1763, 11460, + -122.9355, 39.50047, 1760, 11470, -122.93558, 39.50053, 1756, 11480, + -122.93568, 39.50065, 1750, 11490, -122.9358, 39.50077, 1747, 11500, + -122.93592, 39.50087, 1744, 11510, -122.93605, 39.50087, 1750, 11520, + -122.93615, 39.50088, 1751, 11530, -122.93623, 39.50088, 1751, 11540, + -122.9363, 39.50087, 1751, 11550, -122.93637, 39.50085, 1751, 11560, + -122.93643, 39.50083, 1750, 11570, -122.93648, 39.5008, 1749, 11580, + -122.93653, 39.50075, 1748, 11590, -122.93655, 39.50068, 1747, 11600, + -122.93655, 39.50062, 1747, 11610, -122.93653, 39.50053, 1749, 11620, + -122.93652, 39.50047, 1749, 11630, -122.93648, 39.5004, 1749, 11640, + -122.93643, 39.50032, 1751, 11650, -122.93638, 39.50023, 1753, 11660, + -122.93633, 39.50018, 1754, 11670, -122.93628, 39.50012, 1753, 11680, + -122.93622, 39.50005, 1753, 11690, -122.93617, 39.49997, 1753, 11700, + -122.9361, 39.49988, 1751, 11710, -122.93605, 39.49982, 1751, 11720, + -122.93605, 39.49973, 1751, 11730, -122.93607, 39.49968, 1752, 11740, + -122.93612, 39.49967, 1753, 11750, -122.93618, 39.49967, 1753, 11760, + -122.93627, 39.49972, 1753, 11770, -122.93635, 39.49985, 1752, 11780, + -122.93638, 39.49998, 1753, 11790, -122.93635, 39.50015, 1757, 11800, + -122.93627, 39.50028, 1762, 11810, -122.93615, 39.5004, 1763, 11820, + -122.93598, 39.50048, 1762, 11830, -122.9358, 39.50057, 1761, 11840, + -122.93563, 39.5006, 1760, 11850, -122.93543, 39.50045, 1761, 11860, + -122.93533, 39.50037, 1760, 11870, -122.93528, 39.50028, 1759, 11880, + -122.93528, 39.5002, 1758, 11890, -122.9353, 39.50013, 1757, 11900, + -122.93533, 39.50008, 1758, 11910, -122.9354, 39.50005, 1759, 11920, + -122.93545, 39.50003, 1760, 11930, -122.93552, 39.50003, 1759, 11940, + -122.93558, 39.50005, 1759, 11950, -122.93565, 39.50008, 1760, 11960, + -122.93573, 39.50013, 1761, 11970, -122.93582, 39.50017, 1760, 11980, + -122.9359, 39.5002, 1757, 11990, -122.936, 39.50025, 1753, 12000, + -122.93612, 39.50027, 1750, 12010, -122.93625, 39.50028, 1747, 12020, + -122.93635, 39.50025, 1745, 12030, -122.93643, 39.50022, 1743, 12040, + -122.9365, 39.50018, 1741, 12050, -122.93653, 39.50013, 1739, 12060, + -122.93657, 39.50008, 1736, 12070, -122.93658, 39.50002, 1731, 12080, + -122.93658, 39.49993, 1729, 12090, -122.93655, 39.49983, 1728, 12100, + -122.9365, 39.49978, 1728, 12110, -122.93643, 39.49972, 1726, 12120, + -122.93635, 39.49965, 1724, 12130, -122.93627, 39.4996, 1722, 12140, + -122.9362, 39.49953, 1721, 12150, -122.93612, 39.49945, 1719, 12160, + -122.93605, 39.49938, 1718, 12170, -122.93595, 39.4993, 1717, 12180, + -122.93588, 39.49923, 1717, 12190, -122.9358, 39.49918, 1716, 12200, + -122.9357, 39.4991, 1715, 12210, -122.93562, 39.49903, 1715, 12220, + -122.93552, 39.49898, 1717, 12230, -122.93542, 39.49892, 1716, 12240, + -122.93533, 39.49887, 1715, 12250, -122.93525, 39.49878, 1713, 12260, + -122.93525, 39.49858, 1697, 12270, -122.93578, 39.49835, 1686, 12280, + -122.93625, 39.49823, 1697, 12290, -122.93633, 39.49793, 1706, 12300, + -122.93563, 39.49818, 1708, 12310, -122.936, 39.49847, 1719, 12320, + -122.93622, 39.49838, 1724, 12330, -122.93628, 39.49833, 1727, 12340, + -122.9363, 39.49825, 1731, 12350, -122.93628, 39.49818, 1733, 12360, + -122.9362, 39.49812, 1735, 12370, -122.93607, 39.49808, 1735, 12380, + -122.93593, 39.49808, 1735, 12390, -122.93573, 39.49815, 1736, 12400, + -122.93558, 39.49827, 1735, 12410, -122.9355, 39.49842, 1740, 12420, + -122.93548, 39.49857, 1746, 12430, -122.9355, 39.49867, 1749, 12440, + -122.93557, 39.49875, 1749, 12450, -122.9357, 39.49882, 1750, 12460, + -122.93582, 39.49882, 1751, 12470, -122.9359, 39.49878, 1750, 12480, + -122.93593, 39.49872, 1748, 12490, -122.93588, 39.49863, 1750, 12500, + -122.93577, 39.49857, 1752, 12510, -122.93562, 39.49853, 1756, 12520, + -122.93543, 39.49853, 1760, 12530, -122.93523, 39.49857, 1763, 12540, + -122.93507, 39.49863, 1764, 12550, -122.9349, 39.49873, 1765, 12560, + -122.93477, 39.49887, 1769, 12570, -122.93468, 39.49902, 1772, 12580, + -122.93467, 39.4992, 1775, 12590, -122.93467, 39.49932, 1776, 12600, + -122.93473, 39.49943, 1776, 12610, -122.93483, 39.49953, 1774, 12620, + -122.93493, 39.49957, 1771, 12630, -122.93507, 39.49957, 1767, 12640, + -122.93518, 39.49952, 1769, 12650, -122.93527, 39.49947, 1771, 12660, + -122.93532, 39.4994, 1771, 12670, -122.93532, 39.49933, 1770, 12680, + -122.93525, 39.49923, 1768, 12690, -122.93517, 39.4991, 1767, 12700, + -122.93517, 39.49898, 1767, 12710, -122.93523, 39.49888, 1769, 12720, + -122.9353, 39.4988, 1772, 12730, -122.93535, 39.49875, 1776, 12740, + -122.93543, 39.4987, 1778, 12750, -122.93552, 39.49867, 1779, 12760, + -122.93563, 39.49863, 1780, 12770, -122.93577, 39.4986, 1784, 12780, + -122.9359, 39.49858, 1787, 12790, -122.93603, 39.49858, 1787, 12800, + -122.93615, 39.49857, 1787, 12810, -122.93625, 39.49853, 1788, 12820, + -122.93633, 39.49847, 1789, 12830, -122.93633, 39.49842, 1789, 12840, + -122.93628, 39.49833, 1792, 12850, -122.9362, 39.49828, 1794, 12860, + -122.93608, 39.49823, 1795, 12870, -122.93592, 39.49822, 1797, 12880, + -122.93573, 39.49825, 1798, 12890, -122.93558, 39.49833, 1799, 12900, + -122.93545, 39.49847, 1800, 12910, -122.93542, 39.4986, 1802, 12920, + -122.93545, 39.49872, 1806, 12930, -122.93553, 39.4988, 1809, 12940, + -122.93563, 39.49883, 1810, 12950, -122.93575, 39.49883, 1812, 12960, + -122.9358, 39.49878, 1815, 12970, -122.9358, 39.49873, 1817, 12980, + -122.93575, 39.49867, 1819, 12990, -122.93567, 39.49862, 1819, 13000, + -122.93553, 39.49857, 1820, 13010, -122.93535, 39.49853, 1823, 13020, + -122.93518, 39.49855, 1823, 13030, -122.935, 39.49862, 1824, 13040, + -122.93485, 39.49872, 1827, 13050, -122.93477, 39.49882, 1831, 13060, + -122.93472, 39.49892, 1833, 13070, -122.93472, 39.49903, 1833, 13080, + -122.93478, 39.49913, 1833, 13090, -122.93492, 39.49923, 1832, 13100, + -122.93505, 39.49928, 1832, 13110, -122.93517, 39.49925, 1839, 13120, + -122.93525, 39.49923, 1841, 13130, -122.9353, 39.49918, 1841, 13140, + -122.9353, 39.4991, 1841, 13150, -122.93525, 39.499, 1840, 13160, + -122.93517, 39.49887, 1842, 13170, -122.93513, 39.49875, 1846, 13180, + -122.93515, 39.49865, 1851, 13190, -122.93522, 39.49857, 1854, 13200, + -122.93532, 39.49853, 1855, 13210, -122.93543, 39.49857, 1856, 13220, + -122.93555, 39.49863, 1860, 13230, -122.93562, 39.49875, 1861, 13240, + -122.93563, 39.49888, 1861, 13250, -122.93558, 39.49905, 1862, 13260, + -122.93548, 39.49917, 1863, 13270, -122.93532, 39.49927, 1865, 13280, + -122.93515, 39.49932, 1867, 13290, -122.935, 39.49933, 1868, 13300, + -122.93485, 39.4993, 1869, 13310, -122.93475, 39.49923, 1870, 13320, + -122.9347, 39.49915, 1872, 13330, -122.9347, 39.49907, 1875, 13340, + -122.93475, 39.49902, 1877, 13350, -122.93482, 39.499, 1878, 13360, + -122.93493, 39.499, 1878, 13370, -122.93505, 39.49905, 1878, 13380, + -122.93515, 39.49917, 1881, 13390, -122.9352, 39.49928, 1883, 13400, + -122.93518, 39.49943, 1885, 13410, -122.93512, 39.49957, 1884, 13420, + -122.935, 39.49968, 1883, 13430, -122.93482, 39.4998, 1883, 13440, + -122.93465, 39.49987, 1883, 13450, -122.93447, 39.49985, 1884, 13460, + -122.9343, 39.49983, 1885, 13470, -122.93418, 39.49977, 1885, 13480, + -122.9341, 39.4997, 1885, 13490, -122.93405, 39.4996, 1888, 13500, + -122.93407, 39.49953, 1892, 13510, -122.93413, 39.49948, 1895, 13520, + -122.93422, 39.49948, 1899, 13530, -122.93432, 39.49952, 1901, 13540, + -122.9344, 39.4996, 1902, 13550, -122.93447, 39.49972, 1902, 13560, + -122.93448, 39.49985, 1904, 13570, -122.93445, 39.5, 1905, 13580, + -122.93435, 39.50013, 1905, 13590, -122.9342, 39.50027, 1905, 13600, + -122.93403, 39.50033, 1905, 13610, -122.93383, 39.50037, 1904, 13620, + -122.93365, 39.50037, 1906, 13630, -122.93352, 39.50032, 1905, 13640, + -122.93342, 39.50025, 1904, 13650, -122.9334, 39.50015, 1903, 13660, + -122.93347, 39.5001, 1905, 13670, -122.93358, 39.50007, 1908, 13680, + -122.9337, 39.50008, 1911, 13690, -122.93378, 39.50015, 1913, 13700, + -122.93385, 39.50025, 1915, 13710, -122.93388, 39.50037, 1916, 13720, + -122.93387, 39.5005, 1914, 13730, -122.9338, 39.50067, 1913, 13740, + -122.93367, 39.5008, 1913, 13750, -122.93348, 39.50092, 1915, 13760, + -122.93332, 39.50097, 1916, 13770, -122.93315, 39.50098, 1916, 13780, + -122.933, 39.50097, 1915, 13790, -122.93288, 39.50092, 1912, 13800, + -122.93278, 39.50085, 1910, 13810, -122.93275, 39.50073, 1910, 13820, + -122.9328, 39.50067, 1911, 13830, -122.93288, 39.50062, 1911, 13840, + -122.93298, 39.50058, 1909, 13850, -122.93313, 39.50058, 1908, 13860, + -122.93328, 39.5006, 1913, 13870, -122.9334, 39.50062, 1916, 13880, + -122.93352, 39.5006, 1918, 13890, -122.93358, 39.50058, 1920, 13900, + -122.93363, 39.50055, 1921, 13910, -122.93365, 39.50048, 1921, 13920, + -122.93363, 39.50042, 1921, 13930, -122.93357, 39.50033, 1921, 13940, + -122.93347, 39.50027, 1924, 13950, -122.93335, 39.50022, 1927, 13960, + -122.93322, 39.50017, 1928, 13970, -122.93307, 39.50008, 1929, 13980, + -122.93297, 39.50002, 1929, 13990, -122.93298, 39.49992, 1934, 14000, + -122.93305, 39.49985, 1937, 14010, -122.93313, 39.49982, 1938, 14020, + -122.93323, 39.49982, 1938, 14030, -122.93335, 39.49985, 1936, 14040, + -122.93345, 39.49993, 1937, 14050, -122.93353, 39.50005, 1938, 14060, + -122.93357, 39.50015, 1939, 14070, -122.9336, 39.50027, 1939, 14080, + -122.93358, 39.5004, 1938, 14090, -122.93355, 39.50053, 1937, 14100, + -122.93348, 39.50067, 1937, 14110, -122.93338, 39.50078, 1937, 14120, + -122.93327, 39.50088, 1939, 14130, -122.93312, 39.50098, 1941, 14140, + -122.933, 39.50105, 1941, 14150, -122.93283, 39.50113, 1940, 14160, + -122.93265, 39.50118, 1941, 14170, -122.9325, 39.50122, 1941, 14180, + -122.9323, 39.50123, 1940, 14190, -122.9321, 39.50122, 1940, 14200, + -122.93195, 39.50118, 1943, 14210, -122.93185, 39.5011, 1945, 14220, + -122.93183, 39.50103, 1945, 14230, -122.93185, 39.50095, 1946, 14240, + -122.93193, 39.5009, 1949, 14250, -122.93203, 39.50088, 1951, 14260, + -122.93217, 39.50092, 1952, 14270, -122.93223, 39.50102, 1954, 14280, + -122.93227, 39.50113, 1956, 14290, -122.93223, 39.50128, 1957, 14300, + -122.93213, 39.50142, 1958, 14310, -122.93197, 39.50153, 1960, 14320, + -122.93178, 39.50158, 1961, 14330, -122.93162, 39.5016, 1962, 14340, + -122.93143, 39.50158, 1964, 14350, -122.9313, 39.50155, 1964, 14360, + -122.93117, 39.50148, 1964, 14370, -122.93107, 39.5014, 1965, 14380, + -122.93105, 39.5013, 1967, 14390, -122.9311, 39.50122, 1969, 14400, + -122.93118, 39.50118, 1970, 14410, -122.9313, 39.50118, 1973, 14420, + -122.93138, 39.50125, 1975, 14430, -122.93145, 39.50137, 1976, 14440, + -122.93145, 39.5015, 1977, 14450, -122.9314, 39.50165, 1979, 14460, + -122.9313, 39.50177, 1981, 14470, -122.93113, 39.50188, 1981, 14480, + -122.93113, 39.50188, 1981, 14490, -122.93093, 39.50193, 1983, 14500, + -122.93078, 39.50193, 1984, 14510, -122.93062, 39.5019, 1987, 14520, + -122.9305, 39.50183, 1988, 14530, -122.93043, 39.50177, 1989, 14540, + -122.93042, 39.50168, 1989, 14550, -122.93047, 39.5016, 1989, 14560, + -122.93057, 39.50157, 1991, 14570, -122.93067, 39.50158, 1993, 14580, + -122.93077, 39.50163, 1994, 14590, -122.93085, 39.50173, 1995, 14600, + -122.93088, 39.50185, 1995, 14610, -122.93087, 39.502, 1997, 14620, + -122.9308, 39.50213, 2000, 14630, -122.93067, 39.50225, 2001, 14640, + -122.93048, 39.50232, 2001, 14650, -122.9303, 39.50232, 2002, 14660, + -122.93015, 39.50228, 2002, 14670, -122.9301, 39.50217, 2002, 14680, + -122.93012, 39.50207, 2001, 14690, -122.93018, 39.50203, 2004, 14700, + -122.93028, 39.50202, 2006, 14710, -122.93037, 39.50205, 2006, 14720, + -122.93045, 39.50215, 2005, 14730, -122.9305, 39.50227, 2005, 14740, + -122.93052, 39.5024, 2006, 14750, -122.93053, 39.50255, 2006, 14760, + -122.93057, 39.50267, 2007, 14770, -122.93065, 39.50277, 2007, 14780, + -122.93075, 39.50282, 2010, 14790, -122.93082, 39.50283, 2009, 14800, + -122.93088, 39.5028, 2008, 14810, -122.93095, 39.50275, 2005, 14820, + -122.93097, 39.50265, 2003, 14830, -122.93092, 39.50253, 2002, 14840, + -122.93083, 39.50245, 2001, 14850, -122.93072, 39.50235, 2001, 14860, + -122.93057, 39.5023, 2002, 14870, -122.93042, 39.50228, 2003, 14880, + -122.93022, 39.5023, 2003, 14890, -122.93007, 39.50237, 2004, 14900, + -122.92992, 39.50245, 2003, 14910, -122.9298, 39.50258, 2003, 14920, + -122.92973, 39.5027, 2003, 14930, -122.92972, 39.50283, 2004, 14940, + -122.92975, 39.50293, 2005, 14950, -122.92978, 39.50302, 2006, 14960, + -122.92983, 39.50308, 2006, 14970, -122.9299, 39.50312, 2006, 14980, + -122.92997, 39.50315, 2005, 14990, -122.93005, 39.50315, 2003, 15000, + -122.93013, 39.50315, 2001, 15010, -122.93023, 39.50312, 2000, 15020, + -122.93032, 39.50305, 2000, 15030, -122.93037, 39.50297, 2002, 15040, + -122.9304, 39.50287, 2003, 15050, -122.9304, 39.50278, 2004, 15060, + -122.93037, 39.5027, 2004, 15070, -122.93033, 39.50262, 2002, 15080, + -122.93028, 39.50252, 2000, 15090, -122.93023, 39.50242, 1999, 15100, + -122.93015, 39.50233, 1999, 15110, -122.93005, 39.50225, 1999, 15120, + -122.92993, 39.50218, 1998, 15130, -122.92982, 39.50213, 1997, 15140, + -122.92968, 39.5021, 1993, 15150, -122.92953, 39.50203, 1988, 15160, + -122.92942, 39.50195, 1985, 15170, -122.92932, 39.50185, 1985, 15180, + -122.92927, 39.50173, 1984, 15190, -122.92928, 39.50165, 1984, 15200, + -122.92932, 39.50158, 1982, 15210, -122.9294, 39.50153, 1980, 15220, + -122.9295, 39.5015, 1977, 15230, -122.92962, 39.50148, 1976, 15240, + -122.92973, 39.50148, 1975, 15250, -122.92985, 39.5015, 1974, 15260, + -122.92997, 39.50153, 1973, 15270, -122.93008, 39.50157, 1971, 15280, + -122.93023, 39.50162, 1970, 15290, -122.93035, 39.50167, 1971, 15300, + -122.93047, 39.50168, 1972, 15310, -122.93058, 39.5017, 1973, 15320, + -122.93067, 39.5017, 1973, 15330, -122.93077, 39.50172, 1972, 15340, + -122.93087, 39.5017, 1970, 15350, -122.93097, 39.5017, 1969, 15360, + -122.93107, 39.5017, 1966, 15370, -122.93118, 39.5017, 1963, 15380, + -122.93132, 39.50172, 1961, 15390, -122.93147, 39.50173, 1959, 15400, + -122.93158, 39.50173, 1958, 15410, -122.9321, 39.50158, 1953, 15420, + -122.93253, 39.50128, 1954, 15430, -122.93303, 39.50127, 1948, 15440, + -122.9335, 39.50163, 1948, 15450, -122.93335, 39.50227, 1940, 15460, + -122.93292, 39.50223, 1930, 15470, -122.93285, 39.50215, 1929, 15480, + -122.93282, 39.50205, 1929, 15490, -122.9328, 39.50197, 1928, 15500, + -122.93283, 39.5019, 1927, 15510, -122.93287, 39.50182, 1928, 15520, + -122.9329, 39.50177, 1927, 15530, -122.93295, 39.50172, 1925, 15540, + -122.93303, 39.50165, 1925, 15550, -122.9331, 39.5016, 1928, 15560, + -122.93317, 39.50155, 1930, 15570, -122.93322, 39.5015, 1931, 15580, + -122.93325, 39.50145, 1931, 15590, -122.93328, 39.50138, 1931, 15600, + -122.93333, 39.50132, 1932, 15610, -122.9334, 39.50127, 1931, 15620, + -122.9335, 39.50123, 1933, 15630, -122.93358, 39.50127, 1935, 15640, + -122.93368, 39.50132, 1935, 15650, -122.93377, 39.50142, 1934, 15660, + -122.93383, 39.50153, 1933, 15670, -122.93387, 39.50168, 1932, 15680, + -122.93383, 39.50185, 1932, 15690, -122.93373, 39.502, 1933, 15700, + -122.93358, 39.50212, 1935, 15710, -122.9334, 39.50218, 1936, 15720, + -122.93323, 39.5022, 1936, 15730, -122.93307, 39.50217, 1936, 15740, + -122.93297, 39.50212, 1936, 15750, -122.9329, 39.50205, 1936, 15760, + -122.9329, 39.50198, 1938, 15770, -122.93295, 39.50197, 1936, 15780, + -122.93302, 39.50195, 1935, 15790, -122.9331, 39.50197, 1934, 15800, + -122.9332, 39.50202, 1934, 15810, -122.93328, 39.50212, 1933, 15820, + -122.93337, 39.50222, 1932, 15830, -122.93342, 39.50237, 1931, 15840, + -122.93342, 39.50253, 1931, 15850, -122.93337, 39.50268, 1932, 15860, + -122.93327, 39.50282, 1933, 15870, -122.93313, 39.50292, 1934, 15880, + -122.93298, 39.50298, 1934, 15890, -122.9328, 39.50302, 1935, 15900, + -122.93267, 39.50302, 1936, 15910, -122.93253, 39.50297, 1936, 15920, + -122.93243, 39.50292, 1936, 15930, -122.93242, 39.50285, 1935, 15940, + -122.93245, 39.5028, 1934, 15950, -122.93252, 39.50278, 1934, 15960, + -122.93258, 39.50277, 1932, 15970, -122.9327, 39.50277, 1929, 15980, + -122.93282, 39.50278, 1927, 15990, -122.93295, 39.5028, 1927, 16000, + -122.93307, 39.5028, 1927, 16010, -122.93317, 39.5028, 1928, 16020, + -122.93323, 39.50278, 1927, 16030, -122.9333, 39.50277, 1925, 16040, + -122.93335, 39.50273, 1922, 16050, -122.9334, 39.50268, 1915, 16060, + -122.93347, 39.50262, 1908, 16070, -122.93353, 39.50252, 1903, 16080, + -122.93362, 39.50243, 1903, 16090, -122.93365, 39.50237, 1905, 16100, + -122.93367, 39.50232, 1907, 16110, -122.93368, 39.50227, 1908, 16120, + -122.93368, 39.50223, 1905, 16130, -122.9337, 39.50217, 1900, 16140, + -122.93373, 39.5021, 1897, 16150, -122.93377, 39.50202, 1899, 16160, + -122.93378, 39.50195, 1901, 16170, -122.93378, 39.5019, 1900, 16180, + -122.93382, 39.50183, 1899, 16190, -122.93383, 39.50177, 1898, 16200, + -122.93387, 39.5017, 1898, 16210, -122.9339, 39.50163, 1896, 16220, + -122.93393, 39.50157, 1894, 16230, -122.93397, 39.5015, 1892, 16240, + -122.93407, 39.50115, 1873, 16250, -122.9341, 39.50062, 1862, 16260, + -122.93403, 39.5001, 1848, 16270, -122.93383, 39.49948, 1839, 16280, + -122.93358, 39.49892, 1833, 16290, -122.93328, 39.49837, 1828, 16300, + -122.93292, 39.49788, 1815, 16310, -122.9326, 39.49735, 1800, 16320, + -122.93222, 39.4968, 1786, 16330, -122.93188, 39.49625, 1775, 16340, + -122.93157, 39.49568, 1759, 16350, -122.93127, 39.49512, 1746, 16360, + -122.93097, 39.49458, 1731, 16370, -122.93072, 39.4941, 1720, 16380, + -122.93053, 39.49353, 1721, 16390, -122.93033, 39.493, 1728, 16400, + -122.9301, 39.49247, 1728, 16410, -122.93002, 39.49192, 1709, 16420, + -122.93, 39.49135, 1697, 16430, -122.92987, 39.49075, 1687, 16440, + -122.9297, 39.49017, 1675, 16450, -122.92952, 39.4896, 1668, 16460, + -122.9295, 39.4891, 1669, 16470, -122.92942, 39.4886, 1675, 16480, + -122.92933, 39.48797, 1663, 16490, -122.92928, 39.48737, 1663, 16500, + -122.92922, 39.48675, 1648, 16510, -122.92917, 39.48617, 1637, 16520, + -122.92907, 39.48562, 1624, 16530, -122.92898, 39.48517, 1619, 16540, + -122.92895, 39.48473, 1598, 16550, -122.92912, 39.48413, 1595, 16560, + -122.92912, 39.4835, 1588, 16570, -122.92917, 39.48288, 1587, 16580, + -122.92935, 39.48238, 1588, 16590, -122.92967, 39.48192, 1582, 16600, + -122.92993, 39.4815, 1575, 16610, -122.9302, 39.4811, 1572, 16620, + -122.93047, 39.48068, 1560, 16630, -122.93072, 39.4802, 1549, 16640, + -122.93113, 39.4798, 1541, 16650, -122.93157, 39.47938, 1527, 16660, + -122.93192, 39.47892, 1519, 16670, -122.93225, 39.47847, 1523, 16680, + -122.93258, 39.47808, 1521, 16690, -122.9329, 39.47765, 1510, 16700, + -122.93322, 39.47722, 1500, 16710, -122.93363, 39.47685, 1499, 16720, + -122.93398, 39.47647, 1486, 16730, -122.93443, 39.4761, 1475, 16740, + -122.93483, 39.47568, 1456, 16750, -122.93515, 39.47517, 1444, 16760, + -122.93555, 39.47477, 1439, 16770, -122.93597, 39.47425, 1433, 16780, + -122.93628, 39.4739, 1426, 16790, -122.9366, 39.47355, 1426, 16800, + -122.93688, 39.47317, 1422, 16810, -122.93725, 39.47275, 1423, 16820, + -122.93772, 39.47232, 1428, 16830, -122.93812, 39.47192, 1425, 16840, + -122.93848, 39.4715, 1426, 16850, -122.93893, 39.47112, 1428, 16860, + -122.93928, 39.47067, 1434, 16870, -122.9395, 39.47022, 1438, 16880, + -122.93978, 39.46978, 1441, 16890, -122.94, 39.46937, 1438, 16900, + -122.94023, 39.4689, 1432, 16910, -122.94053, 39.46838, 1415, 16920, + -122.94075, 39.46785, 1399, 16930, -122.94093, 39.46727, 1383, 16940, + -122.94118, 39.46663, 1367, 16950, -122.94137, 39.466, 1354, 16960, + -122.94152, 39.46533, 1339, 16970, -122.94167, 39.46467, 1323, 16980, + -122.94177, 39.46402, 1308, 16990, -122.94182, 39.46335, 1293, 17000, + -122.94182, 39.46272, 1280, 17010, -122.94185, 39.46208, 1266, 17020, + -122.9419, 39.46143, 1255, 17030, -122.94197, 39.46075, 1242, 17040, + -122.94205, 39.46008, 1234, 17050, -122.94217, 39.45943, 1222, 17060, + -122.94218, 39.45878, 1209, 17070, -122.94205, 39.45812, 1200, 17080, + -122.94192, 39.45747, 1187, 17090, -122.94203, 39.4568, 1177, 17100, + -122.94225, 39.45618, 1165, 17110, -122.9425, 39.45553, 1157, 17120, + -122.94272, 39.45493, 1148, 17130, -122.94292, 39.4543, 1133, 17140, + -122.94312, 39.45367, 1119, 17150, -122.9434, 39.45308, 1103, 17160, + -122.94367, 39.45247, 1087, 17170, -122.94385, 39.45185, 1078, 17180, + -122.94388, 39.45123, 1063, 17190, -122.94397, 39.45062, 1050, 17200, + -122.94408, 39.45, 1035, 17210, -122.9442, 39.44938, 1025, 17220, + -122.94438, 39.4488, 1014, 17230, -122.94447, 39.44822, 1004, 17240, + -122.94462, 39.44762, 995, 17250, -122.94485, 39.4471, 992, 17260, + -122.945, 39.44657, 980, 17270, -122.94523, 39.44602, 974, 17280, + -122.9456, 39.44557, 964, 17290, -122.94595, 39.44507, 955, 17300, + -122.94635, 39.4446, 941, 17310, -122.94675, 39.44413, 932, 17320, + -122.94708, 39.4437, 922, 17330, -122.94752, 39.44325, 911, 17340, + -122.94783, 39.44278, 905, 17350, -122.94788, 39.4423, 897, 17360, + -122.9476, 39.44187, 886, 17370, -122.94702, 39.44158, 874, 17380, + -122.9468, 39.44117, 867, 17390, -122.94737, 39.4411, 849, 17400, + -122.94797, 39.44112, 836, 17410, -122.94862, 39.44107, 822, 17420, + -122.94877, 39.4408, 812, 17430, -122.948, 39.44087, 806, 17440, + -122.94803, 39.44145, 784, 17450, -122.9483, 39.44157, 777, 17460, + -122.94843, 39.4416, 774, 17470, -122.94857, 39.44163, 773, 17480, + -122.94868, 39.44165, 771, 17490, -122.9488, 39.44167, 769, 17500, + -122.9489, 39.44167, 768, 17510, -122.949, 39.44163, 764, 17520, + -122.94912, 39.4416, 759, 17530, -122.9492, 39.44153, 754, 17540, + -122.94927, 39.44143, 749, 17550, -122.94932, 39.44132, 743, 17560, + -122.9493, 39.44117, 737, 17570, -122.94925, 39.44103, 731, 17580, + -122.94912, 39.44088, 727, 17590, -122.94897, 39.44077, 723, 17600, + -122.94878, 39.44067, 719, 17610, -122.94863, 39.44057, 717, 17620, + -122.94843, 39.44048, 712, 17630, -122.94822, 39.4404, 708, 17640, + -122.94802, 39.44033, 704, 17650, -122.9478, 39.44025, 700, 17660, + -122.9476, 39.4402, 697, 17670, -122.94738, 39.44013, 693, 17680, + -122.94717, 39.44005, 689, 17690, -122.94697, 39.44, 685, 17700, + -122.94673, 39.43993, 680, 17710, -122.9465, 39.43988, 676, 17720, + -122.94627, 39.43985, 671, 17730, -122.94602, 39.43982, 666, 17740, + -122.94578, 39.43978, 661, 17750, -122.94555, 39.43977, 657, 17760, + -122.94528, 39.43975, 653, 17770, -122.94403, 39.43993, 627, 17780, + -122.9434, 39.44068, 622, 17790, -122.94432, 39.44108, 597, 17800, + -122.94505, 39.44122, 580, 17810, -122.94555, 39.44123, 572, 17820, + -122.94562, 39.44123, 571, 17830, -122.94563, 39.44123, 571, 17840, + -122.94562, 39.44125, 569, 17850, -122.94563, 39.44125, 569, 17860, + -122.94563, 39.44125, 569, 17870, -122.94565, 39.44125, 568, 17880, + -122.94563, 39.44125, 567, 17890, -122.94563, 39.44125, 566, ], }, }, @@ -7249,9 +978,7 @@ shouldAnimate: true, }); - const dataSource = await viewer.dataSources.add( - Cesium.CzmlDataSource.load(czml) - ); + const dataSource = await viewer.dataSources.add(Cesium.CzmlDataSource.load(czml)); viewer.trackedEntity = dataSource.entities.getById("path"); //Sandcastle_End }; diff --git a/Apps/Sandcastle/gallery/CZML Point - Time Dynamic.html b/Apps/Sandcastle/gallery/CZML Point - Time Dynamic.html index 211171f84cb0..566470ba6ad7 100644 --- a/Apps/Sandcastle/gallery/CZML Point - Time Dynamic.html +++ b/Apps/Sandcastle/gallery/CZML Point - Time Dynamic.html @@ -1,4 +1,4 @@ - + @@ -18,10 +18,7 @@ > - + @@ -45,22 +42,8 @@ position: { epoch: "2012-08-04T16:00:00Z", cartographicDegrees: [ - 0, - -70, - 20, - 150000, - 100, - -80, - 44, - 150000, - 200, - -90, - 18, - 150000, - 300, - -98, - 52, - 150000, + 0, -70, 20, 150000, 100, -80, 44, 150000, 200, -90, 18, 150000, 300, -98, + 52, 150000, ], }, point: { diff --git a/Apps/Sandcastle/gallery/CZML Point.html b/Apps/Sandcastle/gallery/CZML Point.html index 078e3b4d0b6b..ef7f716fc992 100644 --- a/Apps/Sandcastle/gallery/CZML Point.html +++ b/Apps/Sandcastle/gallery/CZML Point.html @@ -1,4 +1,4 @@ - + @@ -18,10 +18,7 @@ > - + diff --git a/Apps/Sandcastle/gallery/CZML Polygon - Interpolating References.html b/Apps/Sandcastle/gallery/CZML Polygon - Interpolating References.html index 0d6dc2a72716..70eb956375c5 100644 --- a/Apps/Sandcastle/gallery/CZML Polygon - Interpolating References.html +++ b/Apps/Sandcastle/gallery/CZML Polygon - Interpolating References.html @@ -1,4 +1,4 @@ - + @@ -7,10 +7,7 @@ name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no" /> - + Cesium Demo @@ -21,10 +18,7 @@ > - + @@ -75,30 +69,8 @@ interval: "2012-08-04T16:00:00Z/2012-08-04T17:00:00Z", epoch: "2012-08-04T16:00:00Z", cartographicDegrees: [ - 0, - -60, - 35, - 30000, - 160, - -65, - 35, - 5000000, - 400, - -70, - 40, - 20000, - 800, - -62, - 45, - 200000, - 1800, - -65, - 40, - 650000, - 3600, - -60, - 35, - 3000, + 0, -60, 35, 30000, 160, -65, 35, 5000000, 400, -70, 40, 20000, 800, -62, + 45, 200000, 1800, -65, 40, 650000, 3600, -60, 35, 3000, ], }, }, @@ -117,22 +89,8 @@ interval: "2012-08-04T16:00:00Z/2012-08-04T17:00:00Z", epoch: "2012-08-04T16:00:00Z", cartographicDegrees: [ - 0, - -45, - 60, - 4000, - 400, - -40, - 70, - 2000000, - 1000, - -35, - 75, - 100000, - 3600, - -45, - 65, - 3000, + 0, -45, 60, 4000, 400, -40, 70, 2000000, 1000, -35, 75, 100000, 3600, -45, + 65, 3000, ], }, }, @@ -140,20 +98,7 @@ id: "Polygon with Dynamic Holes", polygon: { positions: { - cartographicDegrees: [ - -110, - 43, - 0, - -90, - 43, - 0, - -90, - 30, - 0, - -110, - 30, - 0, - ], + cartographicDegrees: [-110, 43, 0, -90, 43, 0, -90, 30, 0, -110, 30, 0], }, holes: { references: [ diff --git a/Apps/Sandcastle/gallery/CZML Polygon - Intervals, Availability.html b/Apps/Sandcastle/gallery/CZML Polygon - Intervals, Availability.html index ad1790d36782..7dd4454542ee 100644 --- a/Apps/Sandcastle/gallery/CZML Polygon - Intervals, Availability.html +++ b/Apps/Sandcastle/gallery/CZML Polygon - Intervals, Availability.html @@ -1,4 +1,4 @@ - + @@ -21,10 +21,7 @@ > - + @@ -55,20 +52,7 @@ positions: [ { interval: "2012-08-04T16:00:00Z/2012-08-04T16:20:00Z", - cartographicDegrees: [ - -50, - 20, - 0, - -50, - 40, - 0, - -40, - 40, - 0, - -40, - 20, - 0, - ], + cartographicDegrees: [-50, 20, 0, -50, 40, 0, -40, 40, 0, -40, 20, 0], }, { interval: "2012-08-04T16:20:00Z/2012-08-04T16:40:00Z", @@ -76,20 +60,7 @@ }, { interval: "2012-08-04T16:40:00Z/2012-08-04T17:00:00Z", - cartographicDegrees: [ - -35, - 50, - 0, - -40, - 50, - 0, - -40, - 20, - 0, - -35, - 20, - 0, - ], + cartographicDegrees: [-35, 50, 0, -40, 50, 0, -40, 20, 0, -35, 20, 0], }, ], holes: [ @@ -121,39 +92,9 @@ polygon: { positions: { cartographicDegrees: [ - -120, - 42, - 50000, - -124, - 42, - 30500, - -124.5, - 40, - 3000, - -123, - 38, - 0, - -122, - 36, - 0, - -120.8, - 34.2, - 0, - -118, - 34, - 0, - -117, - 32.2, - 6000, - -115.5, - 32.5, - 1530, - -115, - 35, - 1530, - -120, - 39, - 30500, + -120, 42, 50000, -124, 42, 30500, -124.5, 40, 3000, -123, 38, 0, -122, + 36, 0, -120.8, 34.2, 0, -118, 34, 0, -117, 32.2, 6000, -115.5, 32.5, + 1530, -115, 35, 1530, -120, 39, 30500, ], }, material: { @@ -174,33 +115,8 @@ polygon: { positions: { cartographicDegrees: [ - -75.5, - 42, - 0, - -79.8, - 42, - 0, - -79.9, - 42.3, - 0, - -80.5, - 42, - 0, - -80.5, - 39.8, - 0, - -75.7, - 39.8, - 0, - -74.5, - 40.2, - 0, - -75.2, - 40.8, - 0, - -74.7, - 41.3, - 0, + -75.5, 42, 0, -79.8, 42, 0, -79.9, 42.3, 0, -80.5, 42, 0, -80.5, 39.8, + 0, -75.7, 39.8, 0, -74.5, 40.2, 0, -75.2, 40.8, 0, -74.7, 41.3, 0, ], }, material: { diff --git a/Apps/Sandcastle/gallery/CZML Polygon.html b/Apps/Sandcastle/gallery/CZML Polygon.html index 547eeb9cdcef..46863d48dbb3 100644 --- a/Apps/Sandcastle/gallery/CZML Polygon.html +++ b/Apps/Sandcastle/gallery/CZML Polygon.html @@ -1,4 +1,4 @@ - + @@ -18,10 +18,7 @@ > - + @@ -45,21 +42,8 @@ polygon: { positions: { cartographicDegrees: [ - -115.0, - 37.0, - 0, - -115.0, - 32.0, - 0, - -107.0, - 33.0, - 0, - -102.0, - 31.0, - 0, - -102.0, - 35.0, - 0, + -115.0, 37.0, 0, -115.0, 32.0, 0, -107.0, 33.0, 0, -102.0, 31.0, 0, + -102.0, 35.0, 0, ], }, material: { @@ -76,17 +60,7 @@ name: "Checkerboard polygon on surface", polygon: { positions: { - cartographicDegrees: [ - -94.0, - 37.0, - 0, - -95.0, - 32.0, - 0, - -87.0, - 33.0, - 0, - ], + cartographicDegrees: [-94.0, 37.0, 0, -95.0, 32.0, 0, -87.0, 33.0, 0], }, material: { checkerboard: { @@ -105,17 +79,7 @@ name: "Green extruded polygon", polygon: { positions: { - cartographicDegrees: [ - -108.0, - 42.0, - 0, - -100.0, - 42.0, - 0, - -104.0, - 40.0, - 0, - ], + cartographicDegrees: [-108.0, 42.0, 0, -100.0, 42.0, 0, -104.0, 40.0, 0], }, material: { solidColor: { @@ -135,18 +99,8 @@ polygon: { positions: { cartographicDegrees: [ - -108.0, - 25.0, - 100000, - -100.0, - 25.0, - 100000, - -100.0, - 30.0, - 100000, - -108.0, - 30.0, - 300000, + -108.0, 25.0, 100000, -100.0, 25.0, 100000, -100.0, 30.0, 100000, + -108.0, 30.0, 300000, ], }, material: { @@ -170,36 +124,12 @@ polygon: { positions: { cartographicDegrees: [ - -82.0, - 40.8, - 0, - -83.0, - 36.5, - 0, - -76.0, - 35.6, - 0, - -73.5, - 43.6, - 0, + -82.0, 40.8, 0, -83.0, 36.5, 0, -76.0, 35.6, 0, -73.5, 43.6, 0, ], }, holes: { cartographicDegrees: [ - [ - -81.0, - 40.0, - 0, - -81.0, - 38.2, - 0, - -79.0, - 38.2, - 0, - -78.0, - 40.8, - 0, - ], + [-81.0, 40.0, 0, -81.0, 38.2, 0, -79.0, 38.2, 0, -78.0, 40.8, 0], [-77.5, 36.7, 0, -78.5, 37.0, 0, -76.5, 39.6, 0], ], }, diff --git a/Apps/Sandcastle/gallery/CZML Polyline Volume.html b/Apps/Sandcastle/gallery/CZML Polyline Volume.html index 0b90904f91fb..9822d819e94b 100644 --- a/Apps/Sandcastle/gallery/CZML Polyline Volume.html +++ b/Apps/Sandcastle/gallery/CZML Polyline Volume.html @@ -1,4 +1,4 @@ - + @@ -18,10 +18,7 @@ > - + @@ -45,28 +42,11 @@ polylineVolume: { positions: { cartographicDegrees: [ - -90.0, - 32.0, - 0, - -90.0, - 36.0, - 100000, - -94.0, - 36.0, - 0, + -90.0, 32.0, 0, -90.0, 36.0, 100000, -94.0, 36.0, 0, ], }, shape: { - cartesian2: [ - -50000, - -50000, - 50000, - -50000, - 50000, - 50000, - -50000, - 50000, - ], + cartesian2: [-50000, -50000, 50000, -50000, 50000, 50000, -50000, 50000], }, cornerType: "BEVELED", material: { @@ -88,46 +68,19 @@ polylineVolume: { positions: { cartographicDegrees: [ - -95.0, - 32.0, - 0, - -95.0, - 36.0, - 100000, - -99.0, - 36.0, - 200000, + -95.0, 32.0, 0, -95.0, 36.0, 100000, -99.0, 36.0, 200000, ], }, shape: { cartesian2: [ - 70000, - 0, - 45048.44339512096, - 21694.186955877907, - 43644.28613011135, - 54728.203772762085, - 11126.046697815722, - 48746.39560909118, - -15576.465376942004, - 68244.95385272766, - -31174.490092936674, - 39091.57412340149, - -63067.82075316933, - 30371.861738229076, - -50000, - 6.123233995736766e-12, - -63067.82075316934, - -30371.86173822906, - -31174.490092936685, - -39091.574123401486, - -15576.465376942022, - -68244.95385272766, - 11126.046697815711, - -48746.39560909118, - 43644.28613011134, - -54728.20377276209, - 45048.44339512095, + 70000, 0, 45048.44339512096, 21694.186955877907, 43644.28613011135, + 54728.203772762085, 11126.046697815722, 48746.39560909118, + -15576.465376942004, 68244.95385272766, -31174.490092936674, + 39091.57412340149, -63067.82075316933, 30371.861738229076, -50000, + 6.123233995736766e-12, -63067.82075316934, -30371.86173822906, + -31174.490092936685, -39091.574123401486, -15576.465376942022, + -68244.95385272766, 11126.046697815711, -48746.39560909118, + 43644.28613011134, -54728.20377276209, 45048.44339512095, -21694.186955877918, ], }, diff --git a/Apps/Sandcastle/gallery/CZML Polyline.html b/Apps/Sandcastle/gallery/CZML Polyline.html index 87e571605e88..31fbc7d75553 100644 --- a/Apps/Sandcastle/gallery/CZML Polyline.html +++ b/Apps/Sandcastle/gallery/CZML Polyline.html @@ -1,4 +1,4 @@ - + @@ -18,10 +18,7 @@ > - + @@ -78,8 +75,7 @@ }, { id: "orangeLine", - name: - "Orange line with black outline at height and following the surface", + name: "Orange line with black outline at height and following the surface", polyline: { positions: { cartographicDegrees: [-75, 39, 250000, -125, 39, 250000], diff --git a/Apps/Sandcastle/gallery/CZML Position Definitions.html b/Apps/Sandcastle/gallery/CZML Position Definitions.html index 0d15bfe6e50d..357553c9490c 100644 --- a/Apps/Sandcastle/gallery/CZML Position Definitions.html +++ b/Apps/Sandcastle/gallery/CZML Position Definitions.html @@ -1,4 +1,4 @@ - + @@ -18,10 +18,7 @@ > - + @@ -61,11 +58,7 @@ id: "point2", name: "point in cartesian coordinates", position: { - cartesian: [ - 1216469.9357990976, - -4736121.71856379, - 4081386.8856866374, - ], + cartesian: [1216469.9357990976, -4736121.71856379, 4081386.8856866374], }, point: { color: { diff --git a/Apps/Sandcastle/gallery/CZML Rectangle.html b/Apps/Sandcastle/gallery/CZML Rectangle.html index b324fae6e2b0..a7b1478f6069 100644 --- a/Apps/Sandcastle/gallery/CZML Rectangle.html +++ b/Apps/Sandcastle/gallery/CZML Rectangle.html @@ -1,4 +1,4 @@ - + @@ -18,10 +18,7 @@ > - + diff --git a/Apps/Sandcastle/gallery/CZML Reference Properties.html b/Apps/Sandcastle/gallery/CZML Reference Properties.html index 34a606fb7988..d2723f81d0e7 100644 --- a/Apps/Sandcastle/gallery/CZML Reference Properties.html +++ b/Apps/Sandcastle/gallery/CZML Reference Properties.html @@ -1,4 +1,4 @@ - + @@ -18,10 +18,7 @@ > - + @@ -98,21 +95,8 @@ polygon: { positions: { cartographicDegrees: [ - -115.0, - 37.0, - 0, - -115.0, - 32.0, - 0, - -107.0, - 33.0, - 0, - -102.0, - 31.0, - 0, - -102.0, - 35.0, - 0, + -115.0, 37.0, 0, -115.0, 32.0, 0, -107.0, 33.0, 0, -102.0, 31.0, 0, + -102.0, 35.0, 0, ], }, height: 0, diff --git a/Apps/Sandcastle/gallery/CZML Spheres and Ellipsoids.html b/Apps/Sandcastle/gallery/CZML Spheres and Ellipsoids.html index 13f7d81192ed..45d83934b788 100644 --- a/Apps/Sandcastle/gallery/CZML Spheres and Ellipsoids.html +++ b/Apps/Sandcastle/gallery/CZML Spheres and Ellipsoids.html @@ -1,4 +1,4 @@ - + @@ -18,10 +18,7 @@ > - + diff --git a/Apps/Sandcastle/gallery/CZML Wall.html b/Apps/Sandcastle/gallery/CZML Wall.html index ce0c7c2f9474..b900b2418918 100644 --- a/Apps/Sandcastle/gallery/CZML Wall.html +++ b/Apps/Sandcastle/gallery/CZML Wall.html @@ -1,4 +1,4 @@ - + @@ -18,10 +18,7 @@ > - + @@ -44,39 +41,10 @@ wall: { positions: { cartographicDegrees: [ - -115.0, - 50.0, - 1500000, - -112.5, - 50.0, - 500000, - -110.0, - 50.0, - 1500000, - -107.5, - 50.0, - 500000, - -105.0, - 50.0, - 1500000, - -102.5, - 50.0, - 500000, - -100.0, - 50.0, - 1500000, - -97.5, - 50.0, - 500000, - -95.0, - 50.0, - 1500000, - -92.5, - 50.0, - 500000, - -90.0, - 50.0, - 1500000, + -115.0, 50.0, 1500000, -112.5, 50.0, 500000, -110.0, 50.0, 1500000, + -107.5, 50.0, 500000, -105.0, 50.0, 1500000, -102.5, 50.0, 500000, + -100.0, 50.0, 1500000, -97.5, 50.0, 500000, -95.0, 50.0, 1500000, -92.5, + 50.0, 500000, -90.0, 50.0, 1500000, ], }, material: { diff --git a/Apps/Sandcastle/gallery/CZML ZIndex.html b/Apps/Sandcastle/gallery/CZML ZIndex.html index 60528c8e308a..5648851973a7 100644 --- a/Apps/Sandcastle/gallery/CZML ZIndex.html +++ b/Apps/Sandcastle/gallery/CZML ZIndex.html @@ -1,4 +1,4 @@ - + @@ -18,10 +18,7 @@ > - + @@ -63,17 +60,7 @@ name: "Green corridor", corridor: { positions: { - cartographicDegrees: [ - -90.0, - 43.0, - 0, - -95.0, - 43.0, - 0, - -95.0, - 38.0, - 0, - ], + cartographicDegrees: [-90.0, 43.0, 0, -95.0, 43.0, 0, -95.0, 38.0, 0], }, width: 200000.0, zIndex: 3, @@ -92,21 +79,8 @@ polygon: { positions: { cartographicDegrees: [ - -115.0, - 47.0, - 0, - -115.0, - 42.0, - 0, - -107.0, - 43.0, - 0, - -102.0, - 41.0, - 0, - -102.0, - 45.0, - 0, + -115.0, 47.0, 0, -115.0, 42.0, 0, -107.0, 43.0, 0, -102.0, 41.0, 0, + -102.0, 45.0, 0, ], }, zIndex: 1, diff --git a/Apps/Sandcastle/gallery/CZML.html b/Apps/Sandcastle/gallery/CZML.html index fb751de1aa4d..895ff23bad72 100644 --- a/Apps/Sandcastle/gallery/CZML.html +++ b/Apps/Sandcastle/gallery/CZML.html @@ -1,4 +1,4 @@ - + @@ -21,10 +21,7 @@ > - + @@ -42,7 +39,7 @@ Sandcastle.addDefaultToolbarButton("Satellites", function () { viewer.dataSources.add( - Cesium.CzmlDataSource.load("../../SampleData/simple.czml") + Cesium.CzmlDataSource.load("../../SampleData/simple.czml"), ); viewer.camera.flyHome(0); @@ -50,7 +47,7 @@ Sandcastle.addToolbarButton("Vehicle", function () { viewer.dataSources.add( - Cesium.CzmlDataSource.load("../../SampleData/Vehicle.czml") + Cesium.CzmlDataSource.load("../../SampleData/Vehicle.czml"), ); viewer.scene.camera.setView({ diff --git a/Apps/Sandcastle/gallery/Callback Position Property.html b/Apps/Sandcastle/gallery/Callback Position Property.html index 19dab3dadcad..272509b8b934 100644 --- a/Apps/Sandcastle/gallery/Callback Position Property.html +++ b/Apps/Sandcastle/gallery/Callback Position Property.html @@ -1,4 +1,4 @@ - + @@ -21,10 +21,7 @@ > - + @@ -55,7 +52,7 @@ const stop = Cesium.JulianDate.addSeconds( start, duration, - new Cesium.JulianDate() + new Cesium.JulianDate(), ); // Make sure viewer is at the desired time. @@ -77,11 +74,7 @@ // Prepare point samples. Before and after points are used to // calculate the first and last tangents for the spline. - const before = Cesium.Cartesian3.fromDegrees( - -112.87962, - 36.27375, - 620.01 - ); + const before = Cesium.Cartesian3.fromDegrees(-112.87962, 36.27375, 620.01); const points = [ Cesium.Cartesian3.fromDegrees(-112.87709, 36.27782, 620.01), Cesium.Cartesian3.fromDegrees(-112.87351, 36.27992, 617.9), @@ -93,22 +86,18 @@ Cesium.Cartesian3.fromDegrees(-112.84086, 36.27739, 638.81), Cesium.Cartesian3.fromDegrees(-112.83682, 36.27995, 643.31), ]; - const after = Cesium.Cartesian3.fromDegrees( - -112.83506, - 36.2822, - 643.31 - ); + const after = Cesium.Cartesian3.fromDegrees(-112.83506, 36.2822, 643.31); // Calculate first and last tangents. const firstTangent = Cesium.Cartesian3.subtract( points[0], before, - new Cesium.Cartesian3() + new Cesium.Cartesian3(), ); const lastTangent = Cesium.Cartesian3.subtract( after, points[8], - new Cesium.Cartesian3() + new Cesium.Cartesian3(), ); // Create the position spline. @@ -120,19 +109,14 @@ }); // Create the callback position property and make it return spline evaluations. - const position = new Cesium.CallbackPositionProperty(function ( - time, - result - ) { + const position = new Cesium.CallbackPositionProperty(function (time, result) { const splineTime = - (delta * Cesium.JulianDate.secondsDifference(time, start)) / - duration; + (delta * Cesium.JulianDate.secondsDifference(time, start)) / duration; if (splineTime < firstTime || splineTime > lastTime) { return undefined; } return positionSpline.evaluate(splineTime, result); - }, - false); + }, false); const orientation = new Cesium.VelocityOrientationProperty(position); @@ -191,10 +175,7 @@ } const time = clock.currentTime; const entityPosition = position.getValue(time, scratchPosition); - const entityOrientation = orientation.getValue( - time, - scratchOrientation - ); + const entityOrientation = orientation.getValue(time, scratchOrientation); if (entityPosition === undefined || entityOrientation === undefined) { return; } @@ -202,7 +183,7 @@ entityPosition, entityOrientation, Cesium.Cartesian3.ONE, - scratchTransform + scratchTransform, ); camera.lookAtTransform(transform, offset); }); diff --git a/Apps/Sandcastle/gallery/Callback Property.html b/Apps/Sandcastle/gallery/Callback Property.html index 65e589a54f84..bd7fba4636ad 100644 --- a/Apps/Sandcastle/gallery/Callback Property.html +++ b/Apps/Sandcastle/gallery/Callback Property.html @@ -1,4 +1,4 @@ - + @@ -21,10 +21,7 @@ > - + @@ -59,7 +56,7 @@ return Cesium.Cartesian3.fromDegreesArray( [startLongitude, startLatitude, endLongitude, startLatitude], Cesium.Ellipsoid.WGS84, - result + result, ); }, isConstant), width: 5, @@ -69,7 +66,7 @@ const startCartographic = Cesium.Cartographic.fromDegrees( startLongitude, - startLatitude + startLatitude, ); // use scratch object to avoid new allocations per frame. @@ -94,13 +91,10 @@ endCartographic = Cesium.Cartographic.fromCartesian(endPoint); geodesic.setEndPoints(startCartographic, endCartographic); - const midpointCartographic = geodesic.interpolateUsingFraction( - 0.5, - scratch - ); + const midpointCartographic = geodesic.interpolateUsingFraction(0.5, scratch); return Cesium.Cartesian3.fromRadians( midpointCartographic.longitude, - midpointCartographic.latitude + midpointCartographic.latitude, ); } diff --git a/Apps/Sandcastle/gallery/Camera Tutorial.html b/Apps/Sandcastle/gallery/Camera Tutorial.html index 77e6612de98d..34002df723d6 100644 --- a/Apps/Sandcastle/gallery/Camera Tutorial.html +++ b/Apps/Sandcastle/gallery/Camera Tutorial.html @@ -1,4 +1,4 @@ - + @@ -21,10 +21,7 @@ > - + @@ -46,9 +43,7 @@ q/e - move up/down - - left mouse button down plus mouse move changes the look direction - + left mouse button down plus mouse move changes the look direction @@ -90,9 +85,7 @@ handler.setInputAction(function (movement) { flags.looking = true; - mousePosition = startMousePosition = Cesium.Cartesian3.clone( - movement.position - ); + mousePosition = startMousePosition = Cesium.Cartesian3.clone(movement.position); }, Cesium.ScreenSpaceEventType.LEFT_DOWN); handler.setInputAction(function (movement) { @@ -130,7 +123,7 @@ flags[flagName] = true; } }, - false + false, ); document.addEventListener( @@ -141,7 +134,7 @@ flags[flagName] = false; } }, - false + false, ); viewer.clock.onTick.addEventListener(function (clock) { @@ -161,9 +154,7 @@ } // Change movement speed based on the distance of the camera to the surface of the ellipsoid. - const cameraHeight = ellipsoid.cartesianToCartographic( - camera.position - ).height; + const cameraHeight = ellipsoid.cartesianToCartographic(camera.position).height; const moveRate = cameraHeight / 100.0; if (flags.moveForward) { diff --git a/Apps/Sandcastle/gallery/Camera.html b/Apps/Sandcastle/gallery/Camera.html index 69710e5112fe..84b8a2838ad9 100644 --- a/Apps/Sandcastle/gallery/Camera.html +++ b/Apps/Sandcastle/gallery/Camera.html @@ -1,4 +1,4 @@ - + @@ -21,10 +21,7 @@ > - + @@ -48,11 +45,7 @@ Cesium.Math.setRandomNumberSeed(3); const start = Cesium.JulianDate.fromDate(new Date(2015, 2, 25, 16)); - const stop = Cesium.JulianDate.addSeconds( - start, - 360, - new Cesium.JulianDate() - ); + const stop = Cesium.JulianDate.addSeconds(start, 360, new Cesium.JulianDate()); viewer.clock.startTime = start.clone(); viewer.clock.stopTime = stop.clone(); @@ -66,20 +59,19 @@ const startAngle = Cesium.Math.nextRandomNumber() * 360.0; const endAngle = startAngle + 360.0; - const increment = - (Cesium.Math.nextRandomNumber() * 2.0 - 1.0) * 10.0 + 45.0; + const increment = (Cesium.Math.nextRandomNumber() * 2.0 - 1.0) * 10.0 + 45.0; for (let i = startAngle; i < endAngle; i += increment) { const radians = Cesium.Math.toRadians(i); const timeIncrement = i - startAngle; const time = Cesium.JulianDate.addSeconds( start, timeIncrement, - new Cesium.JulianDate() + new Cesium.JulianDate(), ); const position = Cesium.Cartesian3.fromDegrees( lon + radius * 1.5 * Math.cos(radians), lat + radius * Math.sin(radians), - Cesium.Math.nextRandomNumber() * 500 + 1800 + Cesium.Math.nextRandomNumber() * 500 + 1800, ); property.addSample(time, position); } @@ -90,8 +82,7 @@ const latitude = 36.0994841; const radius = 0.03; - const modelURI = - "../../SampleData/models/CesiumBalloon/CesiumBalloon.glb"; + const modelURI = "../../SampleData/models/CesiumBalloon/CesiumBalloon.glb"; const entity = viewer.entities.add({ availability: new Cesium.TimeIntervalCollection([ new Cesium.TimeInterval({ @@ -135,7 +126,7 @@ transform = Cesium.Matrix4.fromRotationTranslation( Cesium.Matrix3.fromQuaternion(orientation), - position + position, ); } @@ -166,11 +157,7 @@ stop: stop, }), ]), - position: computeCirclularFlight( - longitude, - latitude, - balloonRadius - ), + position: computeCirclularFlight(longitude, latitude, balloonRadius), model: { uri: modelURI, minimumPixelSize: 64, diff --git a/Apps/Sandcastle/gallery/Cartographic Limit Rectangle.html b/Apps/Sandcastle/gallery/Cartographic Limit Rectangle.html index 7b6da076857a..8e2e0bddff6c 100644 --- a/Apps/Sandcastle/gallery/Cartographic Limit Rectangle.html +++ b/Apps/Sandcastle/gallery/Cartographic Limit Rectangle.html @@ -1,4 +1,4 @@ - + @@ -21,10 +21,7 @@ > - + @@ -47,7 +44,7 @@ -180.0, -23.43687, 180.0, - 23.43687 + 23.43687, ); globe.cartographicLimitRectangle = coffeeBeltRectangle; @@ -70,7 +67,7 @@ outlineWidth: 4.0, outlineColor: Cesium.Color.WHITE, }, - }) + }), ); } diff --git a/Apps/Sandcastle/gallery/Cesium Inspector.html b/Apps/Sandcastle/gallery/Cesium Inspector.html index 203ee283221d..670a90acb21a 100644 --- a/Apps/Sandcastle/gallery/Cesium Inspector.html +++ b/Apps/Sandcastle/gallery/Cesium Inspector.html @@ -1,4 +1,4 @@ - + @@ -21,10 +21,7 @@ > - + @@ -59,49 +56,40 @@ }), modelMatrix: Cesium.Matrix4.multiplyByTranslation( Cesium.Transforms.eastNorthUpToFixedFrame( - Cesium.Cartesian3.fromDegrees(-105.0, 45.0) + Cesium.Cartesian3.fromDegrees(-105.0, 45.0), ), new Cesium.Cartesian3(0.0, 0.0, 250000), - new Cesium.Matrix4() + new Cesium.Matrix4(), ), attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.RED.withAlpha(0.5) + Cesium.Color.RED.withAlpha(0.5), ), }, }), appearance: new Cesium.PerInstanceColorAppearance({ closed: true, }), - }) + }), ); scene.primitives.add( new Cesium.Primitive({ geometryInstances: new Cesium.GeometryInstance({ geometry: new Cesium.RectangleGeometry({ - rectangle: Cesium.Rectangle.fromDegrees( - -100.0, - 30.0, - -93.0, - 37.0 - ), + rectangle: Cesium.Rectangle.fromDegrees(-100.0, 30.0, -93.0, 37.0), height: 100000, vertexFormat: Cesium.PerInstanceColorAppearance.VERTEX_FORMAT, }), attributes: { - color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.BLUE - ), + color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.BLUE), }, }), appearance: new Cesium.PerInstanceColorAppearance(), - }) + }), ); - const billboards = scene.primitives.add( - new Cesium.BillboardCollection() - ); + const billboards = scene.primitives.add(new Cesium.BillboardCollection()); billboards.add({ position: Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883, 150000), image: "../images/Cesium_Logo_overlay.png", diff --git a/Apps/Sandcastle/gallery/Cesium OSM Buildings.html b/Apps/Sandcastle/gallery/Cesium OSM Buildings.html index 1f8cd5375449..a71b89836518 100755 --- a/Apps/Sandcastle/gallery/Cesium OSM Buildings.html +++ b/Apps/Sandcastle/gallery/Cesium OSM Buildings.html @@ -1,4 +1,4 @@ - + @@ -11,10 +11,7 @@ name="description" content="Worldwide 3D buildings with rich metadata from OpenStreetMap." /> - + Cesium Demo - + diff --git a/Apps/Sandcastle/gallery/Cesium Widget.html b/Apps/Sandcastle/gallery/Cesium Widget.html index 18eb5692f8b9..ab81249db25b 100644 --- a/Apps/Sandcastle/gallery/Cesium Widget.html +++ b/Apps/Sandcastle/gallery/Cesium Widget.html @@ -1,4 +1,4 @@ - + @@ -21,10 +21,7 @@ > - + diff --git a/Apps/Sandcastle/gallery/Cesium World Terrain.html b/Apps/Sandcastle/gallery/Cesium World Terrain.html index 0dd1e8ce99dc..2f1043fb76c2 100644 --- a/Apps/Sandcastle/gallery/Cesium World Terrain.html +++ b/Apps/Sandcastle/gallery/Cesium World Terrain.html @@ -1,4 +1,4 @@ - + @@ -21,10 +21,7 @@ > - + @@ -42,12 +39,12 @@ const target = new Cesium.Cartesian3( -2489625.0836225147, -4393941.44443024, - 3882535.9454173897 + 3882535.9454173897, ); const offset = new Cesium.Cartesian3( -6857.40902037546, 412.3284835694358, - 2147.5545426812023 + 2147.5545426812023, ); viewer.camera.lookAt(target, offset); viewer.camera.lookAtTransform(Cesium.Matrix4.IDENTITY); diff --git a/Apps/Sandcastle/gallery/Circles and Ellipses.html b/Apps/Sandcastle/gallery/Circles and Ellipses.html index b453cc28d76c..9e43d7bde003 100644 --- a/Apps/Sandcastle/gallery/Circles and Ellipses.html +++ b/Apps/Sandcastle/gallery/Circles and Ellipses.html @@ -1,4 +1,4 @@ - + @@ -21,10 +21,7 @@ > - + diff --git a/Apps/Sandcastle/gallery/Clamp Entities to Ground.html b/Apps/Sandcastle/gallery/Clamp Entities to Ground.html index cdda0b4e48a6..0a048fbe0d93 100644 --- a/Apps/Sandcastle/gallery/Clamp Entities to Ground.html +++ b/Apps/Sandcastle/gallery/Clamp Entities to Ground.html @@ -1,4 +1,4 @@ - + @@ -21,10 +21,7 @@ > - + @@ -145,12 +142,7 @@ const e = viewer.entities.add({ corridor: { positions: Cesium.Cartesian3.fromDegreesArray([ - -122.19, - 46.1914, - -122.21, - 46.21, - -122.23, - 46.21, + -122.19, 46.1914, -122.21, 46.21, -122.23, 46.21, ]), width: 2000.0, material: Cesium.Color.GREEN.withAlpha(0.5), @@ -171,22 +163,22 @@ new Cesium.Cartesian3( -2358138.847340281, -3744072.459541374, - 4581158.5714175375 + 4581158.5714175375, ), new Cesium.Cartesian3( -2357231.4925370603, -3745103.7886602185, - 4580702.9757762635 + 4580702.9757762635, ), new Cesium.Cartesian3( -2355912.902205431, -3744249.029778454, - 4582402.154378103 + 4582402.154378103, ), new Cesium.Cartesian3( -2357208.0209552636, -3743553.4420488174, - 4581961.863286629 + 4581961.863286629, ), ], }, @@ -200,13 +192,9 @@ { text: "Draw Textured Polygon", onselect: function () { - if ( - !Cesium.Entity.supportsMaterialsforEntitiesOnTerrain( - viewer.scene - ) - ) { + if (!Cesium.Entity.supportsMaterialsforEntitiesOnTerrain(viewer.scene)) { window.alert( - "Terrain Entity materials are not supported on this platform" + "Terrain Entity materials are not supported on this platform", ); return; } @@ -219,22 +207,22 @@ new Cesium.Cartesian3( -2358138.847340281, -3744072.459541374, - 4581158.5714175375 + 4581158.5714175375, ), new Cesium.Cartesian3( -2357231.4925370603, -3745103.7886602185, - 4580702.9757762635 + 4580702.9757762635, ), new Cesium.Cartesian3( -2355912.902205431, -3744249.029778454, - 4582402.154378103 + 4582402.154378103, ), new Cesium.Cartesian3( -2357208.0209552636, -3743553.4420488174, - 4581961.863286629 + 4581961.863286629, ), ], }, @@ -253,12 +241,7 @@ viewer.entities.removeAll(); const e = viewer.entities.add({ rectangle: { - coordinates: Cesium.Rectangle.fromDegrees( - -122.3, - 46.0, - -122.0, - 46.3 - ), + coordinates: Cesium.Rectangle.fromDegrees(-122.3, 46.0, -122.0, 46.3), material: Cesium.Color.RED.withAlpha(0.5), }, }); @@ -287,21 +270,14 @@ text: "Draw polyline", onselect: function () { if (!Cesium.Entity.supportsPolylinesOnTerrain(viewer.scene)) { - window.alert( - "Polylines on terrain are not supported on this platform" - ); + window.alert("Polylines on terrain are not supported on this platform"); } viewer.entities.removeAll(); viewer.entities.add({ polyline: { positions: Cesium.Cartesian3.fromDegreesArray([ - 86.953793, - 27.928257, - 86.953793, - 27.988257, - 86.896497, - 27.988257, + 86.953793, 27.928257, 86.953793, 27.988257, 86.896497, 27.988257, ]), clampToGround: true, width: 5, @@ -316,12 +292,12 @@ const target = new Cesium.Cartesian3( 300770.50872389384, 5634912.131394585, - 2978152.2865545116 + 2978152.2865545116, ); const offset = new Cesium.Cartesian3( 6344.974098678562, -793.3419798081741, - 2499.9508860763162 + 2499.9508860763162, ); viewer.camera.lookAt(target, offset); viewer.camera.lookAtTransform(Cesium.Matrix4.IDENTITY); diff --git a/Apps/Sandcastle/gallery/Clamp Model to Ground.html b/Apps/Sandcastle/gallery/Clamp Model to Ground.html index 499937256ccc..130491a4254d 100644 --- a/Apps/Sandcastle/gallery/Clamp Model to Ground.html +++ b/Apps/Sandcastle/gallery/Clamp Model to Ground.html @@ -1,4 +1,4 @@ - + @@ -24,10 +24,7 @@ > - + @@ -49,7 +46,7 @@ destination: Cesium.Cartesian3.fromRadians( -1.3193669086512454, 0.698810888305128, - 220 + 220, ), orientation: { heading: -1.3, @@ -72,14 +69,12 @@ let entity, positionProperty; try { const dataSource = await Cesium.CzmlDataSource.load( - "../../SampleData/ClampToGround.czml" + "../../SampleData/ClampToGround.czml", ); viewer.dataSources.add(dataSource); entity = dataSource.entities.getById("CesiumMilkTruck"); positionProperty = entity.position; - entity.orientation = new Cesium.VelocityOrientationProperty( - positionProperty - ); + entity.orientation = new Cesium.VelocityOrientationProperty(positionProperty); } catch (error) { console.log(`Error loading CZML: ${error}`); } @@ -93,18 +88,15 @@ entity.model.uri = "../../SampleData/models/CesiumMilkTruck/CesiumMilkTruck.glb"; entity.model.scale = 2.5; - entity.model.heightReference = - Cesium.HeightReference.CLAMP_TO_GROUND; + entity.model.heightReference = Cesium.HeightReference.CLAMP_TO_GROUND; }, }, { text: "Relative to ground", onselect: () => { - entity.model.uri = - "../../SampleData/models/CesiumAir/Cesium_Air.glb"; + entity.model.uri = "../../SampleData/models/CesiumAir/Cesium_Air.glb"; entity.model.scale = 1.0; - entity.model.heightReference = - Cesium.HeightReference.RELATIVE_TO_GROUND; + entity.model.heightReference = Cesium.HeightReference.RELATIVE_TO_GROUND; }, }, { @@ -113,18 +105,15 @@ entity.model.uri = "../../SampleData/models/CesiumMilkTruck/CesiumMilkTruck.glb"; entity.model.scale = 2.5; - entity.model.heightReference = - Cesium.HeightReference.CLAMP_TO_TERRAIN; + entity.model.heightReference = Cesium.HeightReference.CLAMP_TO_TERRAIN; }, }, { text: "Relative to terrain only", onselect: () => { - entity.model.uri = - "../../SampleData/models/CesiumAir/Cesium_Air.glb"; + entity.model.uri = "../../SampleData/models/CesiumAir/Cesium_Air.glb"; entity.model.scale = 1.0; - entity.model.heightReference = - Cesium.HeightReference.RELATIVE_TO_TERRAIN; + entity.model.heightReference = Cesium.HeightReference.RELATIVE_TO_TERRAIN; }, }, { @@ -133,25 +122,21 @@ entity.model.uri = "../../SampleData/models/CesiumMilkTruck/CesiumMilkTruck.glb"; entity.model.scale = 1.0; - entity.model.heightReference = - Cesium.HeightReference.CLAMP_TO_3D_TILE; + entity.model.heightReference = Cesium.HeightReference.CLAMP_TO_3D_TILE; }, }, { text: "Relative to 3D Tiles only", onselect: () => { - entity.model.uri = - "../../SampleData/models/CesiumAir/Cesium_Air.glb"; + entity.model.uri = "../../SampleData/models/CesiumAir/Cesium_Air.glb"; entity.model.scale = 1.0; - entity.model.heightReference = - Cesium.HeightReference.RELATIVE_TO_3D_TILE; + entity.model.heightReference = Cesium.HeightReference.RELATIVE_TO_3D_TILE; }, }, { text: "No clamping", onselect: () => { - entity.model.uri = - "../../SampleData/models/CesiumDrone/CesiumDrone.glb"; + entity.model.uri = "../../SampleData/models/CesiumDrone/CesiumDrone.glb"; entity.model.scale = 2.5; entity.model.heightReference = Cesium.HeightReference.NONE; }, @@ -160,26 +145,18 @@ Sandcastle.addDefaultToolbarMenu(clampingOptions); - Sandcastle.addToggleButton( - "Show 3D tileset", - tileset.show, - (checked) => { - tileset.show = checked; - } - ); - Sandcastle.addToggleButton( - "Show globe", - scene.globe.show, - (checked) => { - scene.globe.show = checked; - } - ); + Sandcastle.addToggleButton("Show 3D tileset", tileset.show, (checked) => { + tileset.show = checked; + }); + Sandcastle.addToggleButton("Show globe", scene.globe.show, (checked) => { + scene.globe.show = checked; + }); Sandcastle.addToggleButton( "Track entity", Cesium.defined(viewer.trackedEntity), (checked) => { viewer.trackedEntity = checked ? entity : undefined; - } + }, ); //Sandcastle_End }; diff --git a/Apps/Sandcastle/gallery/Clamp to 3D Model.html b/Apps/Sandcastle/gallery/Clamp to 3D Model.html index 030ae3e9e83a..968f91b28fff 100644 --- a/Apps/Sandcastle/gallery/Clamp to 3D Model.html +++ b/Apps/Sandcastle/gallery/Clamp to 3D Model.html @@ -1,4 +1,4 @@ - + @@ -21,10 +21,7 @@ > - + @@ -103,7 +100,7 @@ return Cesium.Cartographic.toCartesian( cartographic, Cesium.Ellipsoid.WGS84, - result + result, ); } viewer.trackedEntity = entity; diff --git a/Apps/Sandcastle/gallery/Classification Types.html b/Apps/Sandcastle/gallery/Classification Types.html index e7db822b24fe..5c3564ed29d7 100644 --- a/Apps/Sandcastle/gallery/Classification Types.html +++ b/Apps/Sandcastle/gallery/Classification Types.html @@ -1,4 +1,4 @@ - + @@ -21,10 +21,7 @@ > - + @@ -46,11 +43,7 @@ const boundingSphere = tileset.boundingSphere; viewer.camera.viewBoundingSphere( boundingSphere, - new Cesium.HeadingPitchRange( - 0.0, - -0.5, - boundingSphere.radius + 500.0 - ) + new Cesium.HeadingPitchRange(0.0, -0.5, boundingSphere.radius + 500.0), ); viewer.camera.lookAtTransform(Cesium.Matrix4.IDENTITY); } catch (error) { @@ -61,15 +54,10 @@ polygon: { hierarchy: new Cesium.PolygonHierarchy( Cesium.Cartesian3.fromRadiansArray([ - -1.3194369277314022, - 0.6988062530900625, - -1.3193955980204217, - 0.6988091578771254, - -1.3193931220959367, - 0.698743632490865, - -1.3194358224045408, - 0.6987471965556998, - ]) + -1.3194369277314022, 0.6988062530900625, -1.3193955980204217, + 0.6988091578771254, -1.3193931220959367, 0.698743632490865, + -1.3194358224045408, 0.6987471965556998, + ]), ), material: Cesium.Color.RED.withAlpha(0.5), classificationType: Cesium.ClassificationType.BOTH, @@ -79,28 +67,13 @@ const polyline = viewer.entities.add({ polyline: { positions: Cesium.Cartesian3.fromDegreesArray([ - -75.60217330403601, - 40.04102882709425, - -75.59968252414251, - 40.04093615560871, - -75.598020153828, - 40.04079437042357, - -75.59674934074435, - 40.040816173283304, - -75.59630042791713, - 40.03986900370842, - -75.59563636849978, - 40.03930996506271, - -75.59492397899098, - 40.03873932846581, - -75.59457991226778, - 40.038392701955786, - -75.59424838652453, - 40.03775403572295, - -75.59387104290336, - 40.03677022167725, - -75.59355000490342, - 40.03588760913535, + -75.60217330403601, 40.04102882709425, -75.59968252414251, + 40.04093615560871, -75.598020153828, 40.04079437042357, -75.59674934074435, + 40.040816173283304, -75.59630042791713, 40.03986900370842, + -75.59563636849978, 40.03930996506271, -75.59492397899098, + 40.03873932846581, -75.59457991226778, 40.038392701955786, + -75.59424838652453, 40.03775403572295, -75.59387104290336, + 40.03677022167725, -75.59355000490342, 40.03588760913535, ]), width: 8, material: new Cesium.PolylineOutlineMaterialProperty({ @@ -116,19 +89,15 @@ { text: "Classify Both", onselect: function () { - polygon.polygon.classificationType = - Cesium.ClassificationType.BOTH; - polyline.polyline.classificationType = - Cesium.ClassificationType.BOTH; + polygon.polygon.classificationType = Cesium.ClassificationType.BOTH; + polyline.polyline.classificationType = Cesium.ClassificationType.BOTH; }, }, { text: "Classify Terrain", onselect: function () { - polygon.polygon.classificationType = - Cesium.ClassificationType.TERRAIN; - polyline.polyline.classificationType = - Cesium.ClassificationType.TERRAIN; + polygon.polygon.classificationType = Cesium.ClassificationType.TERRAIN; + polyline.polyline.classificationType = Cesium.ClassificationType.TERRAIN; }, }, { @@ -152,13 +121,9 @@ { text: "Textured Material", onselect: function () { - if ( - !Cesium.Entity.supportsMaterialsforEntitiesOnTerrain( - viewer.scene - ) - ) { + if (!Cesium.Entity.supportsMaterialsforEntitiesOnTerrain(viewer.scene)) { window.alert( - "Terrain Entity materials are not supported on this platform" + "Terrain Entity materials are not supported on this platform", ); } polygon.polygon.material = "../images/Cesium_Logo_Color.jpg"; diff --git a/Apps/Sandcastle/gallery/Classification.html b/Apps/Sandcastle/gallery/Classification.html index ea896e4a2c3a..462a5dd14b66 100644 --- a/Apps/Sandcastle/gallery/Classification.html +++ b/Apps/Sandcastle/gallery/Classification.html @@ -1,4 +1,4 @@ - + @@ -21,10 +21,7 @@ > - + @@ -73,9 +70,7 @@ // Add tileset of proposed new building let buildingTileset; try { - buildingTileset = await Cesium.Cesium3DTileset.fromIonAssetId( - 1670818 - ); + buildingTileset = await Cesium.Cesium3DTileset.fromIonAssetId(1670818); scene.primitives.add(buildingTileset); } catch (error) { console.log(`Error loading building tileset. @@ -86,7 +81,7 @@ const cameraOffset = new Cesium.HeadingPitchRange( Cesium.Math.toRadians(95.0), Cesium.Math.toRadians(-18.0), - 600.0 + 600.0, ); viewer.zoomTo(buildingTileset, cameraOffset); @@ -108,7 +103,7 @@ [-105.00715641889735, 39.751312128419926], [-105.00715641889735, 39.75135429046085], [-105.0077102972673, 39.75198671798765], - ].flat(2) + ].flat(2), ), }), ]; @@ -150,9 +145,7 @@ }); // Toggle between default and inverse clipping - Sandcastle.addToggleButton("Inverse clipping", false, function ( - checked - ) { + Sandcastle.addToggleButton("Inverse clipping", false, function (checked) { worldTileset.clippingPolygons.inverse = checked; scene.globe.clippingPolygons.inverse = checked; }); @@ -160,24 +153,20 @@ Sandcastle.addToolbarButton("Remove last polygon", () => { if (worldTileset.clippingPolygons.length > 0) { worldTileset.clippingPolygons.remove( - worldTileset.clippingPolygons.get( - worldTileset.clippingPolygons.length - 1 - ) + worldTileset.clippingPolygons.get(worldTileset.clippingPolygons.length - 1), ); } if (scene.globe.clippingPolygons.length > 0) { scene.globe.clippingPolygons.remove( - scene.globe.clippingPolygons.get( - scene.globe.clippingPolygons.length - 1 - ) + scene.globe.clippingPolygons.get(scene.globe.clippingPolygons.length - 1), ); } }); // Allow clicking new positions to viewer.cesiumWidget.screenSpaceEventHandler.removeInputAction( - Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK + Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK, ); function createPoint(worldPosition) { const point = viewer.entities.add({ @@ -194,7 +183,7 @@ polygon: { hierarchy: positionData, material: new Cesium.ColorMaterialProperty( - Cesium.Color.WHITE.withAlpha(0.7) + Cesium.Color.WHITE.withAlpha(0.7), ), }, }); @@ -247,13 +236,13 @@ worldTileset.clippingPolygons.add( new Cesium.ClippingPolygon({ positions: positions, - }) + }), ); scene.globe.clippingPolygons.add( new Cesium.ClippingPolygon({ positions: positions, - }) + }), ); } diff --git a/Apps/Sandcastle/gallery/Clock.html b/Apps/Sandcastle/gallery/Clock.html index 631860739e78..31b0bacaaf32 100644 --- a/Apps/Sandcastle/gallery/Clock.html +++ b/Apps/Sandcastle/gallery/Clock.html @@ -1,4 +1,4 @@ - + @@ -18,10 +18,7 @@ > - + diff --git a/Apps/Sandcastle/gallery/Cloud Parameters.html b/Apps/Sandcastle/gallery/Cloud Parameters.html index 2d4a629c8faa..c1041be59629 100644 --- a/Apps/Sandcastle/gallery/Cloud Parameters.html +++ b/Apps/Sandcastle/gallery/Cloud Parameters.html @@ -1,4 +1,4 @@ - + @@ -21,10 +21,7 @@ > - + @@ -36,10 +33,7 @@ Scale with Max Size - + @@ -131,11 +125,7 @@ step="0.01" data-bind="value: slice, valueUpdate: 'input', enable: renderSlice" /> - + @@ -164,11 +154,7 @@ //Sandcastle_Begin const viewer = new Cesium.Viewer("cesiumContainer"); const scene = viewer.scene; - const position = Cesium.Cartesian3.fromDegrees( - -123.0744619, - 44.0503706, - 50 - ); + const position = Cesium.Cartesian3.fromDegrees(-123.0744619, 44.0503706, 50); function getColor(colorName) { return Cesium.Color[colorName.toUpperCase()]; @@ -180,7 +166,7 @@ new Cesium.CloudCollection({ noiseDetail: 16.0, noiseOffset: Cesium.Cartesian3.ZERO, - }) + }), ); const cloudParameters = { @@ -199,14 +185,11 @@ const cloud = clouds.add({ position: position, - scale: new Cesium.Cartesian2( - cloudParameters.scaleX, - cloudParameters.scaleY - ), + scale: new Cesium.Cartesian2(cloudParameters.scaleX, cloudParameters.scaleY), maximumSize: new Cesium.Cartesian3( cloudParameters.maximumSizeX, cloudParameters.maximumSizeY, - cloudParameters.maximumSizeZ + cloudParameters.maximumSizeZ, ), color: getColor(cloudParameters.color), slice: cloudParameters.renderSlice ? cloudParameters.slice : -1.0, @@ -247,7 +230,7 @@ cloud.maximumSize = new Cesium.Cartesian3( value, cloud.maximumSize.y, - cloud.maximumSize.z + cloud.maximumSize.z, ); if (cloudParameters.scaleWithMaximumSize) { cloud.scale = new Cesium.Cartesian2(value, cloud.scale.y); @@ -261,7 +244,7 @@ cloud.maximumSize = new Cesium.Cartesian3( cloud.maximumSize.x, value, - cloud.maximumSize.z + cloud.maximumSize.z, ); if (cloudParameters.scaleWithMaximumSize) { cloud.scale = new Cesium.Cartesian2(cloud.scale.x, value); @@ -275,7 +258,7 @@ cloud.maximumSize = new Cesium.Cartesian3( cloud.maximumSize.x, cloud.maximumSize.y, - value + value, ); }); diff --git a/Apps/Sandcastle/gallery/Clouds.html b/Apps/Sandcastle/gallery/Clouds.html index 378563cf940c..1cc6fb17d3b2 100644 --- a/Apps/Sandcastle/gallery/Clouds.html +++ b/Apps/Sandcastle/gallery/Clouds.html @@ -1,4 +1,4 @@ - + @@ -18,10 +18,7 @@ > - + @@ -48,9 +45,7 @@ Cesium.Math.setRandomNumberSeed(2.5); function getRandomNumberInRange(minValue, maxValue) { - return ( - minValue + Cesium.Math.nextRandomNumber() * (maxValue - minValue) - ); + return minValue + Cesium.Math.nextRandomNumber() * (maxValue - minValue); } const clouds = new Cesium.CloudCollection(); @@ -107,15 +102,7 @@ }); } - let long, - lat, - height, - scaleX, - scaleY, - aspectRatio, - cloudHeight, - depth, - slice; + let long, lat, height, scaleX, scaleY, aspectRatio, cloudHeight, depth, slice; // randomly generate clouds in a certain area function createRandomClouds( @@ -125,7 +112,7 @@ startLat, stopLat, minHeight, - maxHeight + maxHeight, ) { const rangeLong = stopLong - startLong; const rangeLat = stopLat - startLat; @@ -145,7 +132,7 @@ maximumSize: new Cesium.Cartesian3( aspectRatio * cloudHeight, cloudHeight, - depth + depth, ), slice: slice, }); @@ -181,35 +168,15 @@ /////////////////////////// const start = Cesium.JulianDate.fromDate(new Date(2021, 7, 21, 12)); - const stop = Cesium.JulianDate.addSeconds( - start, - 90, - new Cesium.JulianDate() - ); + const stop = Cesium.JulianDate.addSeconds(start, 90, new Cesium.JulianDate()); function computeBalloonFlight(long, lat, height0, height1) { const property = new Cesium.SampledPositionProperty(); const time0 = start.clone(); - const time1 = Cesium.JulianDate.addSeconds( - time0, - 30, - new Cesium.JulianDate() - ); - const time2 = Cesium.JulianDate.addSeconds( - time1, - 15, - new Cesium.JulianDate() - ); - const time3 = Cesium.JulianDate.addSeconds( - time2, - 30, - new Cesium.JulianDate() - ); - const time4 = Cesium.JulianDate.addSeconds( - time3, - 15, - new Cesium.JulianDate() - ); + const time1 = Cesium.JulianDate.addSeconds(time0, 30, new Cesium.JulianDate()); + const time2 = Cesium.JulianDate.addSeconds(time1, 15, new Cesium.JulianDate()); + const time3 = Cesium.JulianDate.addSeconds(time2, 30, new Cesium.JulianDate()); + const time4 = Cesium.JulianDate.addSeconds(time3, 15, new Cesium.JulianDate()); const position0 = Cesium.Cartesian3.fromDegrees(long, lat, height0); const position1 = Cesium.Cartesian3.fromDegrees(long, lat, height1); diff --git a/Apps/Sandcastle/gallery/Clustering.html b/Apps/Sandcastle/gallery/Clustering.html index 14ce64eaa7c3..a555999067c6 100644 --- a/Apps/Sandcastle/gallery/Clustering.html +++ b/Apps/Sandcastle/gallery/Clustering.html @@ -1,4 +1,4 @@ - + @@ -18,10 +18,7 @@ > - + @@ -38,12 +35,7 @@ name: "Red corridor on surface with rounded corners", corridor: { positions: Cesium.Cartesian3.fromDegreesArray([ - -100.0, - 40.0, - -105.0, - 40.0, - -105.0, - 35.0, + -100.0, 40.0, -105.0, 40.0, -105.0, 35.0, ]), width: 200000.0, material: Cesium.Color.RED.withAlpha(0.5), @@ -54,12 +46,7 @@ name: "Green corridor at height with mitered corners and outline", corridor: { positions: Cesium.Cartesian3.fromDegreesArray([ - -90.0, - 40.0, - -95.0, - 40.0, - -95.0, - 35.0, + -90.0, 40.0, -95.0, 40.0, -95.0, 35.0, ]), height: 100000.0, width: 200000.0, @@ -73,12 +60,7 @@ name: "Blue extruded corridor with beveled corners and outline", corridor: { positions: Cesium.Cartesian3.fromDegreesArray([ - -80.0, - 40.0, - -85.0, - 40.0, - -85.0, - 35.0, + -80.0, 40.0, -85.0, 40.0, -85.0, 35.0, ]), height: 200000.0, extrudedHeight: 100000.0, diff --git a/Apps/Sandcastle/gallery/Custom DataSource.html b/Apps/Sandcastle/gallery/Custom DataSource.html index 1b24d40d6411..befe14976721 100644 --- a/Apps/Sandcastle/gallery/Custom DataSource.html +++ b/Apps/Sandcastle/gallery/Custom DataSource.html @@ -1,4 +1,4 @@ - + @@ -8,10 +8,7 @@ content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no" /> - + Cesium Demo - + @@ -325,21 +319,19 @@ const surfacePosition = Cesium.Cartesian3.fromDegrees( longitude, latitude, - 0 + 0, ); const heightPosition = Cesium.Cartesian3.fromDegrees( longitude, latitude, - height * heightScale + height * heightScale, ); //WebGL Globe only contains lines, so that's the only graphics we create. const polyline = new Cesium.PolylineGraphics(); polyline.material = new Cesium.ColorMaterialProperty(color); polyline.width = new Cesium.ConstantProperty(2); - polyline.arcType = new Cesium.ConstantProperty( - Cesium.ArcType.NONE - ); + polyline.arcType = new Cesium.ConstantProperty(Cesium.ArcType.NONE); polyline.positions = new Cesium.ConstantProperty([ surfacePosition, heightPosition, @@ -374,24 +366,19 @@ //Now that we've defined our own DataSource, we can use it to load //any JSON data formatted for WebGL Globe. const dataSource = new WebGLGlobeDataSource(); - dataSource - .loadUrl("../../SampleData/population909500.json") - .then(function () { - //After the initial load, create buttons to let the user switch among series. - function createSeriesSetter(seriesName) { - return function () { - dataSource.seriesToDisplay = seriesName; - }; - } + dataSource.loadUrl("../../SampleData/population909500.json").then(function () { + //After the initial load, create buttons to let the user switch among series. + function createSeriesSetter(seriesName) { + return function () { + dataSource.seriesToDisplay = seriesName; + }; + } - for (let i = 0; i < dataSource.seriesNames.length; i++) { - const seriesName = dataSource.seriesNames[i]; - Sandcastle.addToolbarButton( - seriesName, - createSeriesSetter(seriesName) - ); - } - }); + for (let i = 0; i < dataSource.seriesNames.length; i++) { + const seriesName = dataSource.seriesNames[i]; + Sandcastle.addToolbarButton(seriesName, createSeriesSetter(seriesName)); + } + }); //Create a Viewer instances and add the DataSource. const viewer = new Cesium.Viewer("cesiumContainer", { diff --git a/Apps/Sandcastle/gallery/Custom Geocoder.html b/Apps/Sandcastle/gallery/Custom Geocoder.html index 41b486948117..91c7bdbf0016 100644 --- a/Apps/Sandcastle/gallery/Custom Geocoder.html +++ b/Apps/Sandcastle/gallery/Custom Geocoder.html @@ -1,4 +1,4 @@ - + @@ -21,10 +21,7 @@ > - + @@ -43,10 +34,7 @@ }); const scene = viewer.scene; - const position = Cesium.Cartesian3.fromDegrees( - -123.0744619, - 44.0503706 - ); + const position = Cesium.Cartesian3.fromDegrees(-123.0744619, 44.0503706); const url = "../../SampleData/models/CesiumMan/Cesium_Man.glb"; const entity = (viewer.trackedEntity = viewer.entities.add({ name: url, @@ -66,7 +54,7 @@ if (czm_selected()) { vec3 highlighted = highlight.a * highlight.rgb + (1.0 - highlight.a) * color.rgb; out_FragColor = vec4(highlighted, 1.0); - } else { + } else { out_FragColor = color; } } @@ -80,7 +68,7 @@ return new Cesium.Color(1.0, 0.0, 0.0, 0.5); }, }, - }) + }), ); stage.selected = []; diff --git a/Apps/Sandcastle/gallery/Custom Post Process.html b/Apps/Sandcastle/gallery/Custom Post Process.html index 9112bbe4cdea..39f5450cb271 100644 --- a/Apps/Sandcastle/gallery/Custom Post Process.html +++ b/Apps/Sandcastle/gallery/Custom Post Process.html @@ -1,4 +1,4 @@ - + @@ -8,10 +8,7 @@ content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no" /> - + Cesium Demo - + @@ -39,10 +33,7 @@ shouldAnimate: true, }); - const position = Cesium.Cartesian3.fromDegrees( - -123.0744619, - 44.0503706 - ); + const position = Cesium.Cartesian3.fromDegrees(-123.0744619, 44.0503706); const url = "../../SampleData/models/CesiumMan/Cesium_Man.glb"; viewer.trackedEntity = viewer.entities.add({ name: url, @@ -53,29 +44,29 @@ }); const fragmentShaderSource = ` - uniform sampler2D colorTexture; - in vec2 v_textureCoordinates; - const int KERNEL_WIDTH = 16; - void main(void) - { - vec2 step = czm_pixelRatio / czm_viewport.zw; - vec2 integralPos = v_textureCoordinates - mod(v_textureCoordinates, 8.0 * step); - vec3 averageValue = vec3(0.0); - for (int i = 0; i < KERNEL_WIDTH; i++) - { - for (int j = 0; j < KERNEL_WIDTH; j++) - { - averageValue += texture(colorTexture, integralPos + step * vec2(i, j)).rgb; - } - } - averageValue /= float(KERNEL_WIDTH * KERNEL_WIDTH); - out_FragColor = vec4(averageValue, 1.0); + uniform sampler2D colorTexture; + in vec2 v_textureCoordinates; + const int KERNEL_WIDTH = 16; + void main(void) + { + vec2 step = czm_pixelRatio / czm_viewport.zw; + vec2 integralPos = v_textureCoordinates - mod(v_textureCoordinates, 8.0 * step); + vec3 averageValue = vec3(0.0); + for (int i = 0; i < KERNEL_WIDTH; i++) + { + for (int j = 0; j < KERNEL_WIDTH; j++) + { + averageValue += texture(colorTexture, integralPos + step * vec2(i, j)).rgb; + } + } + averageValue /= float(KERNEL_WIDTH * KERNEL_WIDTH); + out_FragColor = vec4(averageValue, 1.0); } `; viewer.scene.postProcessStages.add( new Cesium.PostProcessStage({ fragmentShader: fragmentShaderSource, - }) + }), ); //Sandcastle_End }; diff --git a/Apps/Sandcastle/gallery/Custom Shaders 3D Tiles.html b/Apps/Sandcastle/gallery/Custom Shaders 3D Tiles.html index fd48cd444b11..459f9eb890c5 100644 --- a/Apps/Sandcastle/gallery/Custom Shaders 3D Tiles.html +++ b/Apps/Sandcastle/gallery/Custom Shaders 3D Tiles.html @@ -1,4 +1,4 @@ - + @@ -18,10 +18,7 @@ > - + diff --git a/Apps/Sandcastle/gallery/DataSource Ordering.html b/Apps/Sandcastle/gallery/DataSource Ordering.html index c258f0d0ab67..45fa783c0f6c 100644 --- a/Apps/Sandcastle/gallery/DataSource Ordering.html +++ b/Apps/Sandcastle/gallery/DataSource Ordering.html @@ -1,4 +1,4 @@ - + @@ -21,10 +21,7 @@ > - + diff --git a/Apps/Sandcastle/gallery/Depth of Field.html b/Apps/Sandcastle/gallery/Depth of Field.html index ba4d136e4cf5..10ba3add6271 100644 --- a/Apps/Sandcastle/gallery/Depth of Field.html +++ b/Apps/Sandcastle/gallery/Depth of Field.html @@ -1,4 +1,4 @@ - + @@ -8,10 +8,7 @@ content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no" /> - + Cesium Demo - + @@ -131,22 +125,16 @@ Cesium.knockout.applyBindings(viewModel, toolbar); for (const name in viewModel) { if (viewModel.hasOwnProperty(name)) { - Cesium.knockout - .getObservable(viewModel, name) - .subscribe(updatePostProcess); + Cesium.knockout.getObservable(viewModel, name).subscribe(updatePostProcess); } } - if ( - !Cesium.PostProcessStageLibrary.isDepthOfFieldSupported(viewer.scene) - ) { - window.alert( - "This browser does not support the depth of field post process." - ); + if (!Cesium.PostProcessStageLibrary.isDepthOfFieldSupported(viewer.scene)) { + window.alert("This browser does not support the depth of field post process."); } const depthOfField = viewer.scene.postProcessStages.add( - Cesium.PostProcessStageLibrary.createDepthOfFieldStage() + Cesium.PostProcessStageLibrary.createDepthOfFieldStage(), ); function updatePostProcess() { @@ -161,12 +149,12 @@ const target = Cesium.Cartesian3.fromDegrees( initialLon + lonIncrement, lat, - height + 7.5 + height + 7.5, ); const offset = new Cesium.Cartesian3( -37.048378684557974, -24.852967044804245, - 4.352023653686047 + 4.352023653686047, ); viewer.scene.camera.lookAt(target, offset); //Sandcastle_End diff --git a/Apps/Sandcastle/gallery/Distance Display Conditions.html b/Apps/Sandcastle/gallery/Distance Display Conditions.html index 8571526a0c4c..7567770cdedb 100644 --- a/Apps/Sandcastle/gallery/Distance Display Conditions.html +++ b/Apps/Sandcastle/gallery/Distance Display Conditions.html @@ -1,4 +1,4 @@ - + @@ -18,10 +18,7 @@ > - + @@ -41,25 +38,15 @@ position: Cesium.Cartesian3.fromDegrees(-77, 40.5), billboard: { image: "../images/facility.gif", - distanceDisplayCondition: new Cesium.DistanceDisplayCondition( - 5.5e6 - ), + distanceDisplayCondition: new Cesium.DistanceDisplayCondition(5.5e6), }, rectangle: { - coordinates: Cesium.Rectangle.fromDegrees( - -80.5, - 39.7, - -75.1, - 42.0 - ), + coordinates: Cesium.Rectangle.fromDegrees(-80.5, 39.7, -75.1, 42.0), height: 0.0, material: Cesium.Color.RED.withAlpha(0.5), outline: true, outlineColor: Cesium.Color.RED, - distanceDisplayCondition: new Cesium.DistanceDisplayCondition( - 0.0, - 5.5e6 - ), + distanceDisplayCondition: new Cesium.DistanceDisplayCondition(0.0, 5.5e6), }, }); } @@ -67,17 +54,10 @@ function addPointAndModel() { Sandcastle.declare(addPointAndModel); - const position = Cesium.Cartesian3.fromDegrees( - -75.59777, - 40.03883, - 0.0 - ); + const position = Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883, 0.0); const heading = Cesium.Math.toRadians(135); const hpr = new Cesium.HeadingPitchRoll(heading, 0.0, 0.0); - const orientation = Cesium.Transforms.headingPitchRollQuaternion( - position, - hpr - ); + const orientation = Cesium.Transforms.headingPitchRollQuaternion(position, hpr); viewer.entities.add({ position: position, @@ -85,16 +65,11 @@ point: { pixelSize: 10, color: Cesium.Color.YELLOW, - distanceDisplayCondition: new Cesium.DistanceDisplayCondition( - 250.5 - ), + distanceDisplayCondition: new Cesium.DistanceDisplayCondition(250.5), }, model: { uri: "../../SampleData/models/GroundVehicle/GroundVehicle.glb", - distanceDisplayCondition: new Cesium.DistanceDisplayCondition( - 0.0, - 250.5 - ), + distanceDisplayCondition: new Cesium.DistanceDisplayCondition(0.0, 250.5), }, }); } diff --git a/Apps/Sandcastle/gallery/Drawing on Terrain.html b/Apps/Sandcastle/gallery/Drawing on Terrain.html index 80d118801acb..70bb8e0c92bb 100644 --- a/Apps/Sandcastle/gallery/Drawing on Terrain.html +++ b/Apps/Sandcastle/gallery/Drawing on Terrain.html @@ -1,4 +1,4 @@ - + @@ -21,10 +21,7 @@ > - + @@ -53,7 +50,7 @@ }); viewer.cesiumWidget.screenSpaceEventHandler.removeInputAction( - Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK + Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK, ); function createPoint(worldPosition) { const point = viewer.entities.add({ @@ -82,7 +79,7 @@ polygon: { hierarchy: positionData, material: new Cesium.ColorMaterialProperty( - Cesium.Color.WHITE.withAlpha(0.7) + Cesium.Color.WHITE.withAlpha(0.7), ), }, }); @@ -146,9 +143,7 @@ text: "Draw Lines", onselect: function () { if (!Cesium.Entity.supportsPolylinesOnTerrain(viewer.scene)) { - window.alert( - "This browser does not support polylines on terrain." - ); + window.alert("This browser does not support polylines on terrain."); } terminateShape(); @@ -168,7 +163,7 @@ // Zoom in to an area with mountains viewer.camera.lookAt( Cesium.Cartesian3.fromDegrees(-122.2058, 46.1955, 1000.0), - new Cesium.Cartesian3(5000.0, 5000.0, 5000.0) + new Cesium.Cartesian3(5000.0, 5000.0, 5000.0), ); viewer.camera.lookAtTransform(Cesium.Matrix4.IDENTITY); //Sandcastle_End diff --git a/Apps/Sandcastle/gallery/Earth at Night.html b/Apps/Sandcastle/gallery/Earth at Night.html index 4792b1e48b64..e3d14bafc1bf 100644 --- a/Apps/Sandcastle/gallery/Earth at Night.html +++ b/Apps/Sandcastle/gallery/Earth at Night.html @@ -1,4 +1,4 @@ - + @@ -21,10 +21,7 @@ > - + @@ -38,7 +35,7 @@ // The Earth at Night, also known as Black Marble 2017 and Night Lights const viewer = new Cesium.Viewer("cesiumContainer", { baseLayer: new Cesium.ImageryLayer.fromProviderAsync( - Cesium.IonImageryProvider.fromAssetId(3812) + Cesium.IonImageryProvider.fromAssetId(3812), ), }); @@ -50,7 +47,7 @@ const imageryLayers = viewer.imageryLayers; const nightLayer = imageryLayers.get(0); const dayLayer = Cesium.ImageryLayer.fromProviderAsync( - Cesium.IonImageryProvider.fromAssetId(3845) + Cesium.IonImageryProvider.fromAssetId(3845), ); imageryLayers.add(dayLayer); imageryLayers.lowerToBottom(dayLayer); @@ -72,7 +69,7 @@ dynamicLighting, function (checked) { updateLighting(checked); - } + }, ); //Sandcastle_End }; diff --git a/Apps/Sandcastle/gallery/Elevation Band Material.html b/Apps/Sandcastle/gallery/Elevation Band Material.html index b5c20ad2b9a2..1d0c8c552817 100644 --- a/Apps/Sandcastle/gallery/Elevation Band Material.html +++ b/Apps/Sandcastle/gallery/Elevation Band Material.html @@ -1,4 +1,4 @@ - + @@ -7,10 +7,7 @@ name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no" /> - + Cesium Demo @@ -21,10 +18,7 @@ > - + @@ -128,7 +122,7 @@ destination: new Cesium.Cartesian3( 290637.5534733206, 5637471.593707632, - 2978256.8126927214 + 2978256.8126927214, ), orientation: { heading: 4.747266966349747, @@ -152,9 +146,7 @@ Cesium.knockout.applyBindings(viewModel, toolbar); for (const name in viewModel) { if (viewModel.hasOwnProperty(name)) { - Cesium.knockout - .getObservable(viewModel, name) - .subscribe(updateMaterial); + Cesium.knockout.getObservable(viewModel, name).subscribe(updateMaterial); } } @@ -165,9 +157,7 @@ const band3Position = Number(viewModel.band3Position); const bandThickness = Number(viewModel.bandThickness); const bandTransparency = Number(viewModel.bandTransparency); - const backgroundTransparency = Number( - viewModel.backgroundTransparency - ); + const backgroundTransparency = Number(viewModel.backgroundTransparency); const layers = []; const backgroundLayer = { @@ -195,14 +185,9 @@ const gridCount = 50; for (let i = 0; i < gridCount; i++) { const lerper = i / (gridCount - 1); - const heightBelow = Cesium.Math.lerp( - gridStartHeight, - gridEndHeight, - lerper - ); + const heightBelow = Cesium.Math.lerp(gridStartHeight, gridEndHeight, lerper); const heightAbove = heightBelow + 10.0; - const alpha = - Cesium.Math.lerp(0.2, 0.4, lerper) * backgroundTransparency; + const alpha = Cesium.Math.lerp(0.2, 0.4, lerper) * backgroundTransparency; layers.push({ entries: [ { diff --git a/Apps/Sandcastle/gallery/Export KML.html b/Apps/Sandcastle/gallery/Export KML.html index d0e44c7e9bfa..242a6407ca34 100644 --- a/Apps/Sandcastle/gallery/Export KML.html +++ b/Apps/Sandcastle/gallery/Export KML.html @@ -1,4 +1,4 @@ - + @@ -21,10 +21,7 @@ > - + @@ -55,8 +52,7 @@ cartographicDegrees: [-77, 37, 0], }, model: { - gltf: - "../../SampleData/models/CesiumMilkTruck/CesiumMilkTruck.glb", + gltf: "../../SampleData/models/CesiumMilkTruck/CesiumMilkTruck.glb", }, }, ]; @@ -115,7 +111,7 @@ reset(); filenameToSave = "Satellites.kmz"; dataSourcePromise = Cesium.CzmlDataSource.load( - "../../SampleData/simple.czml" + "../../SampleData/simple.czml", ); viewer.dataSources.add(dataSourcePromise); @@ -128,17 +124,13 @@ reset(); filenameToSave = "Model.kmz"; dataSourcePromise = Cesium.CzmlDataSource.load(modelCzml); - viewer.dataSources - .add(dataSourcePromise) - .then(function (dataSource) { - viewer.trackedEntity = dataSource.entities.getById( - "truck model" - ); - }); + viewer.dataSources.add(dataSourcePromise).then(function (dataSource) { + viewer.trackedEntity = dataSource.entities.getById("truck model"); + }); }, }, ], - "propertiesMenu" + "propertiesMenu", ); Sandcastle.addToolbarButton("Download", function () { diff --git a/Apps/Sandcastle/gallery/FXAA.html b/Apps/Sandcastle/gallery/FXAA.html index 628cdcfa7267..8fcb8d2b06ee 100644 --- a/Apps/Sandcastle/gallery/FXAA.html +++ b/Apps/Sandcastle/gallery/FXAA.html @@ -1,4 +1,4 @@ - + @@ -18,10 +18,7 @@ > - + @@ -40,12 +37,12 @@ destination: new Cesium.Cartesian3( 1331419.302230775, -4656681.5022043325, - 4136232.6465900405 + 4136232.6465900405, ), orientation: new Cesium.HeadingPitchRoll( 6.032455545102689, -0.056832496140112765, - 6.282360923090216 + 6.282360923090216, ), endTransform: Cesium.Matrix4.IDENTITY, }); diff --git a/Apps/Sandcastle/gallery/Fog Post Process.html b/Apps/Sandcastle/gallery/Fog Post Process.html index 821fbdf249a2..8896ca04c059 100644 --- a/Apps/Sandcastle/gallery/Fog Post Process.html +++ b/Apps/Sandcastle/gallery/Fog Post Process.html @@ -1,4 +1,4 @@ - + @@ -8,10 +8,7 @@ content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no" /> - + Cesium Demo - + @@ -39,12 +33,12 @@ destination: new Cesium.Cartesian3( 1216356.033078094, -4736402.278325668, - 4081270.375520902 + 4081270.375520902, ), orientation: new Cesium.HeadingPitchRoll( 0.08033365594766728, -0.29519015695063455, - 0.00027759141518046704 + 0.00027759141518046704, ), endTransform: Cesium.Matrix4.IDENTITY, }); @@ -54,40 +48,40 @@ } const fragmentShaderSource = ` - float getDistance(sampler2D depthTexture, vec2 texCoords) - { - float depth = czm_unpackDepth(texture(depthTexture, texCoords)); - if (depth == 0.0) { - return czm_infinity; - } - vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, depth); - return -eyeCoordinate.z / eyeCoordinate.w; - } - float interpolateByDistance(vec4 nearFarScalar, float distance) - { - float startDistance = nearFarScalar.x; - float startValue = nearFarScalar.y; - float endDistance = nearFarScalar.z; - float endValue = nearFarScalar.w; - float t = clamp((distance - startDistance) / (endDistance - startDistance), 0.0, 1.0); - return mix(startValue, endValue, t); - } - vec4 alphaBlend(vec4 sourceColor, vec4 destinationColor) - { - return sourceColor * vec4(sourceColor.aaa, 1.0) + destinationColor * (1.0 - sourceColor.a); - } - uniform sampler2D colorTexture; - uniform sampler2D depthTexture; - uniform vec4 fogByDistance; - uniform vec4 fogColor; - in vec2 v_textureCoordinates; - void main(void) - { - float distance = getDistance(depthTexture, v_textureCoordinates); - vec4 sceneColor = texture(colorTexture, v_textureCoordinates); - float blendAmount = interpolateByDistance(fogByDistance, distance); - vec4 finalFogColor = vec4(fogColor.rgb, fogColor.a * blendAmount); - out_FragColor = alphaBlend(finalFogColor, sceneColor); + float getDistance(sampler2D depthTexture, vec2 texCoords) + { + float depth = czm_unpackDepth(texture(depthTexture, texCoords)); + if (depth == 0.0) { + return czm_infinity; + } + vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, depth); + return -eyeCoordinate.z / eyeCoordinate.w; + } + float interpolateByDistance(vec4 nearFarScalar, float distance) + { + float startDistance = nearFarScalar.x; + float startValue = nearFarScalar.y; + float endDistance = nearFarScalar.z; + float endValue = nearFarScalar.w; + float t = clamp((distance - startDistance) / (endDistance - startDistance), 0.0, 1.0); + return mix(startValue, endValue, t); + } + vec4 alphaBlend(vec4 sourceColor, vec4 destinationColor) + { + return sourceColor * vec4(sourceColor.aaa, 1.0) + destinationColor * (1.0 - sourceColor.a); + } + uniform sampler2D colorTexture; + uniform sampler2D depthTexture; + uniform vec4 fogByDistance; + uniform vec4 fogColor; + in vec2 v_textureCoordinates; + void main(void) + { + float distance = getDistance(depthTexture, v_textureCoordinates); + vec4 sceneColor = texture(colorTexture, v_textureCoordinates); + float blendAmount = interpolateByDistance(fogByDistance, distance); + vec4 finalFogColor = vec4(fogColor.rgb, fogColor.a * blendAmount); + out_FragColor = alphaBlend(finalFogColor, sceneColor); } `; @@ -99,7 +93,7 @@ fogByDistance: new Cesium.Cartesian4(10, 0.0, 200, 1.0), fogColor: Cesium.Color.BLACK, }, - }) + }), ); try { diff --git a/Apps/Sandcastle/gallery/GPX.html b/Apps/Sandcastle/gallery/GPX.html index 56dbcf2cc2bd..6380c10f015a 100755 --- a/Apps/Sandcastle/gallery/GPX.html +++ b/Apps/Sandcastle/gallery/GPX.html @@ -1,4 +1,4 @@ - + @@ -19,10 +19,7 @@ > - + @@ -47,12 +44,9 @@ onselect: function () { viewer.dataSources .add( - Cesium.GpxDataSource.load( - "../../SampleData/gpx/lamina.gpx", - { - clampToGround: true, - } - ) + Cesium.GpxDataSource.load("../../SampleData/gpx/lamina.gpx", { + clampToGround: true, + }), ) .then(function (dataSource) { viewer.zoomTo(dataSource.entities); @@ -64,12 +58,9 @@ onselect: function () { viewer.dataSources .add( - Cesium.GpxDataSource.load( - "../../SampleData/gpx/route.gpx", - { - clampToGround: true, - } - ) + Cesium.GpxDataSource.load("../../SampleData/gpx/route.gpx", { + clampToGround: true, + }), ) .then(function (dataSource) { viewer.zoomTo(dataSource.entities); @@ -83,7 +74,7 @@ .add( Cesium.GpxDataSource.load("../../SampleData/gpx/wpt.gpx", { clampToGround: true, - }) + }), ) .then(function (dataSource) { viewer.zoomTo(dataSource.entities); @@ -95,10 +86,9 @@ onselect: function () { viewer.dataSources .add( - Cesium.GpxDataSource.load( - "../../SampleData/gpx/complexTrk.gpx", - { clampToGround: true } - ) + Cesium.GpxDataSource.load("../../SampleData/gpx/complexTrk.gpx", { + clampToGround: true, + }), ) .then(function (dataSource) { viewer.zoomTo(dataSource.entities); @@ -110,18 +100,15 @@ onselect: function () { viewer.dataSources .add( - Cesium.GpxDataSource.load( - "../../SampleData/gpx/lamina.gpx", - { - clampToGround: true, - trackColor: Cesium.Color.YELLOW, - waypointImage: pinBuilder.fromMakiIconId( - "bicycle", - Cesium.Color.BLUE, - 48 - ), - } - ) + Cesium.GpxDataSource.load("../../SampleData/gpx/lamina.gpx", { + clampToGround: true, + trackColor: Cesium.Color.YELLOW, + waypointImage: pinBuilder.fromMakiIconId( + "bicycle", + Cesium.Color.BLUE, + 48, + ), + }), ) .then(function (dataSource) { viewer.zoomTo(dataSource.entities); @@ -129,7 +116,7 @@ }, }, ], - "toolbar" + "toolbar", ); Sandcastle.reset = function () { diff --git a/Apps/Sandcastle/gallery/GeoJSON and TopoJSON.html b/Apps/Sandcastle/gallery/GeoJSON and TopoJSON.html index cd7100cbf2e3..b4f6c76e5e72 100644 --- a/Apps/Sandcastle/gallery/GeoJSON and TopoJSON.html +++ b/Apps/Sandcastle/gallery/GeoJSON and TopoJSON.html @@ -1,4 +1,4 @@ - + @@ -11,10 +11,7 @@ name="description" content="Load GeoJSON or TopoJSON data and apply custom styling." /> - + Cesium Demo - + @@ -43,23 +37,18 @@ //Example 1: Load with default styling. Sandcastle.addDefaultToolbarButton("Default styling", function () { viewer.dataSources.add( - Cesium.GeoJsonDataSource.load( - "../../SampleData/ne_10m_us_states.topojson" - ) + Cesium.GeoJsonDataSource.load("../../SampleData/ne_10m_us_states.topojson"), ); }); //Example 2: Load with basic styling options. Sandcastle.addToolbarButton("Basic styling", function () { viewer.dataSources.add( - Cesium.GeoJsonDataSource.load( - "../../SampleData/ne_10m_us_states.topojson", - { - stroke: Cesium.Color.HOTPINK, - fill: Cesium.Color.PINK.withAlpha(0.5), - strokeWidth: 3, - } - ) + Cesium.GeoJsonDataSource.load("../../SampleData/ne_10m_us_states.topojson", { + stroke: Cesium.Color.HOTPINK, + fill: Cesium.Color.PINK.withAlpha(0.5), + strokeWidth: 3, + }), ); }); @@ -69,7 +58,7 @@ Cesium.Math.setRandomNumberSeed(0); const promise = Cesium.GeoJsonDataSource.load( - "../../SampleData/ne_10m_us_states.topojson" + "../../SampleData/ne_10m_us_states.topojson", ); promise .then(function (dataSource) { @@ -101,8 +90,7 @@ //Extrude the polygon based on the state's population. Each entity //stores the properties for the GeoJSON feature it was created from //Since the population is a huge number, we divide by 50. - entity.polygon.extrudedHeight = - entity.properties.Population / 50.0; + entity.polygon.extrudedHeight = entity.properties.Population / 50.0; } }) .catch(function (error) { @@ -118,7 +106,7 @@ //Set the camera to a US centered tilted view and switch back to moving in world coordinates. viewer.camera.lookAt( Cesium.Cartesian3.fromDegrees(-98.0, 40.0), - new Cesium.Cartesian3(0.0, -4790000.0, 3930000.0) + new Cesium.Cartesian3(0.0, -4790000.0, 3930000.0), ); viewer.camera.lookAtTransform(Cesium.Matrix4.IDENTITY); }; diff --git a/Apps/Sandcastle/gallery/GeoJSON simplestyle.html b/Apps/Sandcastle/gallery/GeoJSON simplestyle.html index b1aa48eacbe7..4d2449862f8d 100644 --- a/Apps/Sandcastle/gallery/GeoJSON simplestyle.html +++ b/Apps/Sandcastle/gallery/GeoJSON simplestyle.html @@ -1,4 +1,4 @@ - + @@ -7,10 +7,7 @@ name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no" /> - + Cesium Demo @@ -21,10 +18,7 @@ > - + @@ -48,7 +42,7 @@ }); const dataSource = Cesium.GeoJsonDataSource.load( - "../../SampleData/simplestyles.geojson" + "../../SampleData/simplestyles.geojson", ); viewer.dataSources.add(dataSource); viewer.zoomTo(dataSource); diff --git a/Apps/Sandcastle/gallery/Geometry Height Reference.html b/Apps/Sandcastle/gallery/Geometry Height Reference.html index 70c23c7678ae..247787e4a6d1 100644 --- a/Apps/Sandcastle/gallery/Geometry Height Reference.html +++ b/Apps/Sandcastle/gallery/Geometry Height Reference.html @@ -1,4 +1,4 @@ - + @@ -21,10 +21,7 @@ > - + @@ -165,8 +162,8 @@ new Cesium.HeadingPitchRange( -Cesium.Math.PI / 2, -Cesium.Math.PI_OVER_FOUR, - 2000 - ) + 2000, + ), ); viewer.camera.lookAtTransform(Cesium.Matrix4.IDENTITY); } diff --git a/Apps/Sandcastle/gallery/Geometry and Appearances.html b/Apps/Sandcastle/gallery/Geometry and Appearances.html index 60133cd465ff..77eed74eff32 100644 --- a/Apps/Sandcastle/gallery/Geometry and Appearances.html +++ b/Apps/Sandcastle/gallery/Geometry and Appearances.html @@ -1,4 +1,4 @@ - + @@ -21,10 +21,7 @@ > - + @@ -64,17 +61,8 @@ polygon: { hierarchy: new Cesium.PolygonHierarchy( Cesium.Cartesian3.fromDegreesArray([ - -107.0, - 27.0, - -107.0, - 22.0, - -102.0, - 23.0, - -97.0, - 21.0, - -97.0, - 25.0, - ]) + -107.0, 27.0, -107.0, 22.0, -102.0, 23.0, -97.0, 21.0, -97.0, 25.0, + ]), ), outline: true, outlineColor: Cesium.Color.WHITE, @@ -113,12 +101,7 @@ entities.add({ rectangle: { - coordinates: Cesium.Rectangle.fromDegrees( - -118.0, - 38.0, - -116.0, - 40.0 - ), + coordinates: Cesium.Rectangle.fromDegrees(-118.0, 38.0, -116.0, 40.0), extrudedHeight: 500000.0, outline: true, outlineColor: Cesium.Color.WHITE, @@ -147,15 +130,8 @@ polygon: { hierarchy: new Cesium.PolygonHierarchy( Cesium.Cartesian3.fromDegreesArray([ - -118.0, - 30.0, - -115.0, - 30.0, - -117.1, - 31.1, - -118.0, - 33.0, - ]) + -118.0, 30.0, -115.0, 30.0, -117.1, 31.1, -118.0, 33.0, + ]), ), height: 300000.0, extrudedHeight: 700000.0, @@ -171,15 +147,8 @@ cylinder: { hierarchy: new Cesium.PolygonHierarchy( Cesium.Cartesian3.fromDegreesArray([ - -118.0, - 30.0, - -115.0, - 30.0, - -117.1, - 31.1, - -118.0, - 33.0, - ]) + -118.0, 30.0, -115.0, 30.0, -117.1, 31.1, -118.0, 33.0, + ]), ), length: 200000.0, topRadius: 150000.0, @@ -230,12 +199,7 @@ entities.add({ wall: { positions: Cesium.Cartesian3.fromDegreesArray([ - -95.0, - 50.0, - -85.0, - 50.0, - -75.0, - 50.0, + -95.0, 50.0, -85.0, 50.0, -75.0, 50.0, ]), maximumHeights: [500000, 1000000, 500000], minimumHeights: [0, 500000, 0], @@ -257,50 +221,22 @@ polygon: { hierarchy: { positions: Cesium.Cartesian3.fromDegreesArray([ - -109.0, - 30.0, - -95.0, - 30.0, - -95.0, - 40.0, - -109.0, - 40.0, + -109.0, 30.0, -95.0, 30.0, -95.0, 40.0, -109.0, 40.0, ]), holes: [ { positions: Cesium.Cartesian3.fromDegreesArray([ - -107.0, - 31.0, - -107.0, - 39.0, - -97.0, - 39.0, - -97.0, - 31.0, + -107.0, 31.0, -107.0, 39.0, -97.0, 39.0, -97.0, 31.0, ]), holes: [ { positions: Cesium.Cartesian3.fromDegreesArray([ - -105.0, - 33.0, - -99.0, - 33.0, - -99.0, - 37.0, - -105.0, - 37.0, + -105.0, 33.0, -99.0, 33.0, -99.0, 37.0, -105.0, 37.0, ]), holes: [ { positions: Cesium.Cartesian3.fromDegreesArray([ - -103.0, - 34.0, - -101.0, - 34.0, - -101.0, - 36.0, - -103.0, - 36.0, + -103.0, 34.0, -101.0, 34.0, -101.0, 36.0, -103.0, 36.0, ]), }, ], @@ -335,12 +271,7 @@ entities.add({ rectangle: { - coordinates: Cesium.Rectangle.fromDegrees( - -110.0, - 38.0, - -107.0, - 40.0 - ), + coordinates: Cesium.Rectangle.fromDegrees(-110.0, 38.0, -107.0, 40.0), height: 700000.0, extrudedHeight: 1000000.0, rotation: Cesium.Math.toRadians(45), @@ -364,17 +295,8 @@ polygon: { hierarchy: new Cesium.PolygonHierarchy( Cesium.Cartesian3.fromDegreesArray([ - -113.0, - 30.0, - -110.0, - 30.0, - -110.0, - 33.0, - -111.5, - 31.0, - -113.0, - 33.0, - ]) + -113.0, 30.0, -110.0, 30.0, -110.0, 33.0, -111.5, 31.0, -113.0, 33.0, + ]), ), extrudedHeight: 300000.0, material: Cesium.Color.fromRandom({ alpha: 1.0 }), @@ -386,15 +308,8 @@ cylinder: { hierarchy: new Cesium.PolygonHierarchy( Cesium.Cartesian3.fromDegreesArray([ - -118.0, - 30.0, - -115.0, - 30.0, - -117.1, - 31.1, - -118.0, - 33.0, - ]) + -118.0, 30.0, -115.0, 30.0, -117.1, 31.1, -118.0, 33.0, + ]), ), length: 400000.0, topRadius: 0.0, @@ -418,12 +333,7 @@ entities.add({ rectangle: { - coordinates: Cesium.Rectangle.fromDegrees( - -67.0, - 27.0, - -63.0, - 32.0 - ), + coordinates: Cesium.Rectangle.fromDegrees(-67.0, 27.0, -63.0, 32.0), height: height, material: Cesium.Color.fromRandom({ alpha: 0.5 }), }, @@ -481,21 +391,8 @@ entities.add({ wall: { positions: Cesium.Cartesian3.fromDegreesArrayHeights([ - -90.0, - 43.0, - 100000.0, - -87.5, - 45.0, - 100000.0, - -85.0, - 43.0, - 100000.0, - -87.5, - 41.0, - 100000.0, - -90.0, - 43.0, - 100000.0, + -90.0, 43.0, 100000.0, -87.5, 45.0, 100000.0, -85.0, 43.0, 100000.0, -87.5, + 41.0, 100000.0, -90.0, 43.0, 100000.0, ]), material: new Cesium.CheckerboardMaterialProperty({ repeat: new Cesium.Cartesian2(20.0, 6.0), @@ -506,12 +403,7 @@ entities.add({ corridor: { positions: Cesium.Cartesian3.fromDegreesArray([ - -120.0, - 45.0, - -125.0, - 50.0, - -125.0, - 55.0, + -120.0, 45.0, -125.0, 50.0, -125.0, 55.0, ]), width: 100000, material: Cesium.Color.fromRandom({ alpha: 1.0 }), @@ -521,12 +413,7 @@ entities.add({ corridor: { positions: Cesium.Cartesian3.fromDegreesArray([ - -120.0, - 45.0, - -125.0, - 50.0, - -125.0, - 55.0, + -120.0, 45.0, -125.0, 50.0, -125.0, 55.0, ]), width: 100000, height: 300000, @@ -538,12 +425,7 @@ entities.add({ corridor: { positions: Cesium.Cartesian3.fromDegreesArray([ - -120.0, - 45.0, - -125.0, - 50.0, - -125.0, - 55.0, + -120.0, 45.0, -125.0, 50.0, -125.0, 55.0, ]), width: 100000, height: 700000, @@ -561,7 +443,7 @@ const r = i % 2 === 0 ? rOuter : rInner; const p = new Cesium.Cartesian2( Math.cos(i * angle) * r, - Math.sin(i * angle) * r + Math.sin(i * angle) * r, ); pos.push(p); } @@ -571,15 +453,7 @@ entities.add({ polylineVolume: { positions: Cesium.Cartesian3.fromDegreesArrayHeights([ - -102.0, - 15.0, - 100000.0, - -105.0, - 20.0, - 200000.0, - -110.0, - 20.0, - 100000.0, + -102.0, 15.0, 100000.0, -105.0, 20.0, 200000.0, -110.0, 20.0, 100000.0, ]), shape: starPositions(7, 30000.0, 20000.0), outline: true, @@ -592,12 +466,7 @@ entities.add({ polylineVolume: { positions: Cesium.Cartesian3.fromDegreesArray([ - -102.0, - 15.0, - -105.0, - 20.0, - -110.0, - 20.0, + -102.0, 15.0, -105.0, 20.0, -110.0, 20.0, ]), shape: starPositions(7, 30000.0, 20000.0), material: Cesium.Color.fromRandom({ alpha: 1.0 }), @@ -611,8 +480,8 @@ positions.push( new Cesium.Cartesian2( radius * Math.cos(radians), - radius * Math.sin(radians) - ) + radius * Math.sin(radians), + ), ); } return positions; @@ -621,12 +490,7 @@ entities.add({ polylineVolume: { positions: Cesium.Cartesian3.fromDegreesArray([ - -104.0, - 13.0, - -107.0, - 18.0, - -112.0, - 18.0, + -104.0, 13.0, -107.0, 18.0, -112.0, 18.0, ]), shape: computeCircle(40000.0), material: Cesium.Color.WHITE, diff --git a/Apps/Sandcastle/gallery/Globe Interior.html b/Apps/Sandcastle/gallery/Globe Interior.html index cd01f50f821b..0deb07a51e34 100644 --- a/Apps/Sandcastle/gallery/Globe Interior.html +++ b/Apps/Sandcastle/gallery/Globe Interior.html @@ -1,4 +1,4 @@ - + @@ -21,10 +21,7 @@ > - + @@ -74,7 +71,7 @@ -120.0, 0.0, -30.0, - 45.0 + 45.0, ); } @@ -106,7 +103,7 @@ radii: new Cesium.Cartesian3( innerCoreRadius, innerCoreRadius, - innerCoreRadius + innerCoreRadius, ), material: Cesium.Color.YELLOW, }, @@ -119,7 +116,7 @@ radii: new Cesium.Cartesian3( outerCoreRadius, outerCoreRadius, - outerCoreRadius + outerCoreRadius, ), material: Cesium.Color.ORANGE, }, @@ -129,11 +126,7 @@ name: "Mantle", position: Cesium.Cartesian3.ZERO, ellipsoid: { - radii: new Cesium.Cartesian3( - mantleRadius, - mantleRadius, - mantleRadius - ), + radii: new Cesium.Cartesian3(mantleRadius, mantleRadius, mantleRadius), material: Cesium.Color.RED, }, }); diff --git "a/Apps/Sandcastle/gallery/Globe Materials \342\200\223 Water Mask Elevation Map.html" "b/Apps/Sandcastle/gallery/Globe Materials \342\200\223 Water Mask Elevation Map.html" index b05b26863f85..06910c978201 100644 --- "a/Apps/Sandcastle/gallery/Globe Materials \342\200\223 Water Mask Elevation Map.html" +++ "b/Apps/Sandcastle/gallery/Globe Materials \342\200\223 Water Mask Elevation Map.html" @@ -1,4 +1,4 @@ - + @@ -18,10 +18,7 @@ > - + @@ -92,8 +89,7 @@ const globe = viewer.scene.globe; const material = customElevationMaterial; - const shadingUniforms = - material.materials.elevationRampMaterial.uniforms; + const shadingUniforms = material.materials.elevationRampMaterial.uniforms; shadingUniforms.minimumHeight = minHeight; shadingUniforms.maximumHeight = maxHeight; shadingUniforms.image = getColorRamp(); @@ -114,19 +110,12 @@ scene.preRender.addEventListener(function (scene, time) { const surfaceNormal = globe.ellipsoid.geodeticSurfaceNormal( scene.camera.positionWC, - scratchNormal - ); - const negativeNormal = Cesium.Cartesian3.negate( - surfaceNormal, - surfaceNormal + scratchNormal, ); + const negativeNormal = Cesium.Cartesian3.negate(surfaceNormal, surfaceNormal); scene.light.direction = Cesium.Cartesian3.normalize( - Cesium.Cartesian3.add( - negativeNormal, - scene.camera.rightWC, - surfaceNormal - ), - scene.light.direction + Cesium.Cartesian3.add(negativeNormal, scene.camera.rightWC, surfaceNormal), + scene.light.direction, ); }); //Sandcastle_End diff --git a/Apps/Sandcastle/gallery/Globe Materials.html b/Apps/Sandcastle/gallery/Globe Materials.html index a957d77116bb..ea2551357a80 100644 --- a/Apps/Sandcastle/gallery/Globe Materials.html +++ b/Apps/Sandcastle/gallery/Globe Materials.html @@ -1,4 +1,4 @@ - + @@ -18,10 +18,7 @@ > - + @@ -44,22 +38,21 @@ new Cesium.Resource({ url: "http://www.earthenterprise.org/3d", proxy: new Cesium.DefaultProxy("/proxy/"), - }) + }), ); - viewer.scene.terrainProvider = Cesium.GoogleEarthEnterpriseTerrainProvider.fromMetadata( - geeMetadata - ); + viewer.scene.terrainProvider = + Cesium.GoogleEarthEnterpriseTerrainProvider.fromMetadata(geeMetadata); const layers = viewer.scene.imageryLayers; const blackMarble = new Cesium.ImageryLayer( new Cesium.GoogleEarthEnterpriseImageryProvider({ metadata: geeMetadata, - }) + }), ); layers.add(blackMarble); } catch (error) { - console.log(`Failed to create Google Earth providers from metadata. Confirm GEE service is correctly configured. + console.log(`Failed to create Google Earth providers from metadata. Confirm GEE service is correctly configured. ${error}`); } diff --git a/Apps/Sandcastle/gallery/Google Photorealistic 3D Tiles with Building Insert.html b/Apps/Sandcastle/gallery/Google Photorealistic 3D Tiles with Building Insert.html index 84f5cd4e59c3..6437a2fb7c19 100644 --- a/Apps/Sandcastle/gallery/Google Photorealistic 3D Tiles with Building Insert.html +++ b/Apps/Sandcastle/gallery/Google Photorealistic 3D Tiles with Building Insert.html @@ -1,4 +1,4 @@ - + @@ -16,10 +16,7 @@ - + @@ -70,7 +67,7 @@ [-105.00715641889735, 39.751312128419926], [-105.00715641889735, 39.75135429046085], [-105.0077102972673, 39.75198671798765], - ].flat(2) + ].flat(2), ), material: Cesium.Color.YELLOW.withAlpha(0.6), classificationType: Cesium.ClassificationType.CESIUM_3D_TILE, @@ -81,9 +78,7 @@ // Add tileset of proposed new building let buildingTileset; try { - buildingTileset = await Cesium.Cesium3DTileset.fromIonAssetId( - 1670818 - ); + buildingTileset = await Cesium.Cesium3DTileset.fromIonAssetId(1670818); viewer.scene.primitives.add(buildingTileset); } catch (error) { console.log(`Error loading building tileset. @@ -94,21 +89,17 @@ const cameraOffset = new Cesium.HeadingPitchRange( Cesium.Math.toRadians(95.0), Cesium.Math.toRadians(-18.0), - 600.0 + 600.0, ); viewer.zoomTo(buildingTileset, cameraOffset); // Enable toggling of new building visibility - Sandcastle.addToggleButton("Show proposed building", true, function ( - checked - ) { + Sandcastle.addToggleButton("Show proposed building", true, function (checked) { buildingTileset.show = checked; }); // Enable toggling of target location highlight - Sandcastle.addToggleButton("Highlight target location", true, function ( - checked - ) { + Sandcastle.addToggleButton("Highlight target location", true, function (checked) { if (checked) { viewer.entities.add(targetHighlight); } else { diff --git a/Apps/Sandcastle/gallery/Google Photorealistic 3D Tiles.html b/Apps/Sandcastle/gallery/Google Photorealistic 3D Tiles.html index 63e67341a908..d4d68c1c97d6 100644 --- a/Apps/Sandcastle/gallery/Google Photorealistic 3D Tiles.html +++ b/Apps/Sandcastle/gallery/Google Photorealistic 3D Tiles.html @@ -1,4 +1,4 @@ - + @@ -16,10 +16,7 @@ - + @@ -57,12 +54,12 @@ destination: new Cesium.Cartesian3( -2693797.551060477, -4297135.517094725, - 3854700.7470414364 + 3854700.7470414364, ), orientation: new Cesium.HeadingPitchRoll( 4.6550106925119925, -0.2863894863138836, - 1.3561760425773173e-7 + 1.3561760425773173e-7, ), }); //Sandcastle_End Sandcastle.finishedLoading(); diff --git a/Apps/Sandcastle/gallery/HTML Overlays.html b/Apps/Sandcastle/gallery/HTML Overlays.html index a2b0a9528ac1..d35dcb4b3ef4 100644 --- a/Apps/Sandcastle/gallery/HTML Overlays.html +++ b/Apps/Sandcastle/gallery/HTML Overlays.html @@ -1,4 +1,4 @@ - + @@ -7,10 +7,7 @@ name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no" /> - + Cesium Demo @@ -21,10 +18,7 @@ > - + @@ -52,7 +46,7 @@ const position = Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883); const canvasPosition = viewer.scene.cartesianToCanvasCoordinates( position, - scratch + scratch, ); if (Cesium.defined(canvasPosition)) { htmlOverlay.style.top = `${canvasPosition.y}px`; diff --git a/Apps/Sandcastle/gallery/HeadingPitchRoll.html b/Apps/Sandcastle/gallery/HeadingPitchRoll.html index 353588185bf3..26c92dc047c0 100644 --- a/Apps/Sandcastle/gallery/HeadingPitchRoll.html +++ b/Apps/Sandcastle/gallery/HeadingPitchRoll.html @@ -1,4 +1,4 @@ - + @@ -18,10 +18,7 @@ > - + @@ -33,9 +30,7 @@

Loading...

- + @@ -114,15 +109,11 @@

Loading...

let speed = 10; const deltaRadians = Cesium.Math.toRadians(3.0); - let position = Cesium.Cartesian3.fromDegrees( - -123.0744619, - 44.0503706, - 5000.0 - ); + let position = Cesium.Cartesian3.fromDegrees(-123.0744619, 44.0503706, 5000.0); let speedVector = new Cesium.Cartesian3(); const fixedFrameTransform = Cesium.Transforms.localFrameToFixedFrameGenerator( "north", - "west" + "west", ); const headingSpan = document.getElementById("heading"); @@ -139,10 +130,10 @@

Loading...

position, hpRoll, Cesium.Ellipsoid.WGS84, - fixedFrameTransform + fixedFrameTransform, ), minimumPixelSize: 128, - }) + }), ); planePrimitive.readyEvent.addEventListener(() => { @@ -153,12 +144,7 @@

Loading...

}); // Zoom to model - r = - 2.0 * - Math.max( - planePrimitive.boundingSphere.radius, - camera.frustum.near - ); + r = 2.0 * Math.max(planePrimitive.boundingSphere.radius, camera.frustum.near); controller.minimumZoomDistance = r * 0.5; const center = planePrimitive.boundingSphere.center; const heading = Cesium.Math.toRadians(230.0); @@ -233,12 +219,12 @@

Loading...

speedVector = Cesium.Cartesian3.multiplyByScalar( Cesium.Cartesian3.UNIT_X, speed / 10, - speedVector + speedVector, ); position = Cesium.Matrix4.multiplyByPoint( planePrimitive.modelMatrix, speedVector, - position + position, ); pathPosition.addSample(Cesium.JulianDate.now(), position); Cesium.Transforms.headingPitchRollToFixedFrame( @@ -246,7 +232,7 @@

Loading...

hpRoll, Cesium.Ellipsoid.WGS84, fixedFrameTransform, - planePrimitive.modelMatrix + planePrimitive.modelMatrix, ); if (fromBehind.checked) { @@ -262,9 +248,7 @@

Loading...

} viewer.scene.preRender.addEventListener(function (scene, time) { - headingSpan.innerHTML = Cesium.Math.toDegrees(hpRoll.heading).toFixed( - 1 - ); + headingSpan.innerHTML = Cesium.Math.toDegrees(hpRoll.heading).toFixed(1); pitchSpan.innerHTML = Cesium.Math.toDegrees(hpRoll.pitch).toFixed(1); rollSpan.innerHTML = Cesium.Math.toDegrees(hpRoll.roll).toFixed(1); speedSpan.innerHTML = speed.toFixed(1); diff --git a/Apps/Sandcastle/gallery/Hello World.html b/Apps/Sandcastle/gallery/Hello World.html index d0309eaf2ea3..e0243a45af91 100644 --- a/Apps/Sandcastle/gallery/Hello World.html +++ b/Apps/Sandcastle/gallery/Hello World.html @@ -1,4 +1,4 @@ - + @@ -21,10 +21,7 @@ > - + diff --git a/Apps/Sandcastle/gallery/High Dynamic Range.html b/Apps/Sandcastle/gallery/High Dynamic Range.html index 4f1f3cb88ebd..00aefefcac0e 100644 --- a/Apps/Sandcastle/gallery/High Dynamic Range.html +++ b/Apps/Sandcastle/gallery/High Dynamic Range.html @@ -1,4 +1,4 @@ - + @@ -18,10 +18,7 @@ > - + @@ -57,7 +51,7 @@

Loading...

// If this is not specified, or the URL is invalid no geoid conversion will be applied. // The source data used in this transcoding service was compiled from https://earth-info.nga.mil/#tab_wgs84-data and is based on EGM2008 Gravity Model const geoidService = await Cesium.ArcGISTiledElevationTerrainProvider.fromUrl( - "https://tiles.arcgis.com/tiles/z2tnIkrLQ2BRzr6P/arcgis/rest/services/EGM2008/ImageServer" + "https://tiles.arcgis.com/tiles/z2tnIkrLQ2BRzr6P/arcgis/rest/services/EGM2008/ImageServer", ); // Create i3s options to pass optional parameters useful for debugging and visualizing const i3sOptions = { @@ -67,7 +61,7 @@

Loading...

// Create I3S data provider const i3sProvider = await Cesium.I3SDataProvider.fromUrl( tours["San Francisco"], - i3sOptions + i3sOptions, ); // Add the i3s layer provider as a primitive data type @@ -80,17 +74,13 @@

Loading...

destination: Cesium.Ellipsoid.WGS84.cartographicToCartesian(center), }); } catch (error) { - console.log( - `There was an error creating the I3S Data Provider: ${error}` - ); + console.log(`There was an error creating the I3S Data Provider: ${error}`); } // An entity object which will hold info about the currently selected feature for infobox display const selectedEntity = new Cesium.Entity(); // Show metadata in the InfoBox. - viewer.screenSpaceEventHandler.setInputAction(function onLeftClick( - movement - ) { + viewer.screenSpaceEventHandler.setInputAction(function onLeftClick(movement) { // Pick a new feature const pickedFeature = viewer.scene.pick(movement.position); if (!Cesium.defined(pickedFeature)) { @@ -109,12 +99,9 @@

Loading...

let description = "No attributes"; let name; - const fields = i3sNode.getFieldsForPickedPosition( - pickedPosition - ); + const fields = i3sNode.getFieldsForPickedPosition(pickedPosition); if (Object.keys(fields).length > 0) { - description = - '
- Click on the 3D window then use the keyboard to change settings. - Click on the 3D window then use the keyboard to change settings.
Heading: °
'; + description = '
'; for (const fieldName in fields) { if (i3sNode.fields.hasOwnProperty(fieldName)) { description += ``; } text += "
${fieldName}`; @@ -135,15 +122,11 @@

Loading...

}); } } - }, - Cesium.ScreenSpaceEventType.LEFT_CLICK); + }, Cesium.ScreenSpaceEventType.LEFT_CLICK); function isNameProperty(propertyName) { const name = propertyName.toLowerCase(); - if ( - name.localeCompare("name") === 0 || - name.localeCompare("objname") === 0 - ) { + if (name.localeCompare("name") === 0 || name.localeCompare("objname") === 0) { return true; } return false; diff --git a/Apps/Sandcastle/gallery/I3S Building Scene Layer.html b/Apps/Sandcastle/gallery/I3S Building Scene Layer.html index eaf58aada313..e777e08e4b7d 100644 --- a/Apps/Sandcastle/gallery/I3S Building Scene Layer.html +++ b/Apps/Sandcastle/gallery/I3S Building Scene Layer.html @@ -1,4 +1,4 @@ - + @@ -7,10 +7,7 @@ name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no" /> - + I3S Building Scene Cesium Demo @@ -22,10 +19,7 @@ - + @@ -57,7 +51,7 @@

Loading...

// If this is not specified, or the URL is invalid no geoid conversion will be applied. // The source data used in this transcoding service was compiled from https://earth-info.nga.mil/#tab_wgs84-data and is based on EGM2008 Gravity Model const geoidService = await Cesium.ArcGISTiledElevationTerrainProvider.fromUrl( - "https://tiles.arcgis.com/tiles/z2tnIkrLQ2BRzr6P/arcgis/rest/services/EGM2008/ImageServer" + "https://tiles.arcgis.com/tiles/z2tnIkrLQ2BRzr6P/arcgis/rest/services/EGM2008/ImageServer", ); // Create i3s options to pass optional parameters useful for debugging and visualizing const i3sOptions = { @@ -67,7 +61,7 @@

Loading...

// Create I3S data provider const i3sProvider = await Cesium.I3SDataProvider.fromUrl( tours["New York"], - i3sOptions + i3sOptions, ); // Add the i3s layer provider as a primitive data type @@ -80,17 +74,13 @@

Loading...

destination: Cesium.Ellipsoid.WGS84.cartographicToCartesian(center), }); } catch (error) { - console.log( - `There was an error creating the I3S Data Provider: ${error}` - ); + console.log(`There was an error creating the I3S Data Provider: ${error}`); } // An entity object which will hold info about the currently selected feature for infobox display const selectedEntity = new Cesium.Entity(); // Show metadata in the InfoBox. - viewer.screenSpaceEventHandler.setInputAction(function onLeftClick( - movement - ) { + viewer.screenSpaceEventHandler.setInputAction(function onLeftClick(movement) { // Pick a new feature const pickedFeature = viewer.scene.pick(movement.position); if (!Cesium.defined(pickedFeature)) { @@ -109,12 +99,9 @@

Loading...

let description = "No attributes"; let name; - const fields = i3sNode.getFieldsForPickedPosition( - pickedPosition - ); + const fields = i3sNode.getFieldsForPickedPosition(pickedPosition); if (Object.keys(fields).length > 0) { - description = - ''; + description = '
'; for (const fieldName in fields) { if (i3sNode.fields.hasOwnProperty(fieldName)) { description += ` @@ -60,9 +50,7 @@ const viewer = new Cesium.Viewer("cesiumContainer"); if (!viewer.scene.specularEnvironmentMapsSupported) { - window.alert( - "This browser does not support specular environment maps." - ); + window.alert("This browser does not support specular environment maps."); } const modelURL = "../../SampleData/models/Pawns/Pawns.glb"; @@ -81,61 +69,54 @@ const L00 = new Cesium.Cartesian3( 1.234897375106812, 1.221635103225708, - 1.273374080657959 + 1.273374080657959, ); const L1_1 = new Cesium.Cartesian3( 1.136140108108521, 1.171419978141785, - 1.287894368171692 + 1.287894368171692, ); const L10 = new Cesium.Cartesian3( 1.245410919189453, 1.245791077613831, - 1.283067107200623 + 1.283067107200623, ); const L11 = new Cesium.Cartesian3( 1.107124328613281, 1.112697005271912, - 1.153419137001038 + 1.153419137001038, ); const L2_2 = new Cesium.Cartesian3( 1.08641505241394, 1.079904079437256, - 1.10212504863739 + 1.10212504863739, ); const L2_1 = new Cesium.Cartesian3( 1.190043210983276, 1.186099290847778, - 1.214627981185913 + 1.214627981185913, ); const L20 = new Cesium.Cartesian3( 0.017783647403121, 0.020140396431088, - 0.025317270308733 + 0.025317270308733, ); const L21 = new Cesium.Cartesian3( 1.087014317512512, 1.084779262542725, - 1.111417651176453 + 1.111417651176453, ); const L22 = new Cesium.Cartesian3( -0.052426788955927, -0.048315055668354, - -0.041973855346441 + -0.041973855346441, ); const coefficients = [L00, L1_1, L10, L11, L2_2, L2_1, L20, L21, L22]; const height = 0.0; const hpr = new Cesium.HeadingPitchRoll(0.0, 0.0, 0.0); - const origin = Cesium.Cartesian3.fromDegrees( - -123.0744619, - 44.0503706, - height - ); - const modelMatrix = Cesium.Transforms.headingPitchRollToFixedFrame( - origin, - hpr - ); + const origin = Cesium.Cartesian3.fromDegrees(-123.0744619, 44.0503706, height); + const modelMatrix = Cesium.Transforms.headingPitchRollToFixedFrame(origin, hpr); try { const model = viewer.scene.primitives.add( @@ -143,7 +124,7 @@ url: modelURL, modelMatrix: modelMatrix, minimumPixelSize: 128, - }) + }), ); model.readyEvent.addEventListener(() => { @@ -151,17 +132,13 @@ // Zoom to model const controller = viewer.scene.screenSpaceCameraController; - const r = - 2.0 * Math.max(model.boundingSphere.radius, camera.frustum.near); + const r = 2.0 * Math.max(model.boundingSphere.radius, camera.frustum.near); controller.minimumZoomDistance = r * 0.5; const center = model.boundingSphere.center; const heading = Cesium.Math.toRadians(230.0); const pitch = Cesium.Math.toRadians(-20.0); - camera.lookAt( - center, - new Cesium.HeadingPitchRange(heading, pitch, r * 2.0) - ); + camera.lookAt(center, new Cesium.HeadingPitchRange(heading, pitch, r * 2.0)); camera.lookAtTransform(Cesium.Matrix4.IDENTITY); const ibl = model.imageBasedLighting; @@ -200,7 +177,7 @@ ibl.sphericalHarmonicCoefficients = undefined; ibl.specularEnvironmentMaps = undefined; } - } + }, ); }); } catch (error) { diff --git a/Apps/Sandcastle/gallery/Imagery Adjustment.html b/Apps/Sandcastle/gallery/Imagery Adjustment.html index e5197c7c0423..259c4ceff464 100644 --- a/Apps/Sandcastle/gallery/Imagery Adjustment.html +++ b/Apps/Sandcastle/gallery/Imagery Adjustment.html @@ -1,4 +1,4 @@ - + @@ -21,10 +21,7 @@ > - + @@ -52,8 +49,8 @@ const viewer = new Cesium.Viewer("cesiumContainer", { baseLayer: Cesium.ImageryLayer.fromProviderAsync( Cesium.TileMapServiceImageryProvider.fromUrl( - Cesium.buildModuleUrl("Assets/Textures/NaturalEarthII") - ) + Cesium.buildModuleUrl("Assets/Textures/NaturalEarthII"), + ), ), baseLayerPicker: false, }); @@ -66,12 +63,7 @@ const scene = viewer.scene; - const defaultImageryLayerCutout = Cesium.Rectangle.fromDegrees( - -90, - 20, - -70, - 40 - ); + const defaultImageryLayerCutout = Cesium.Rectangle.fromDegrees(-90, 20, -70, 40); // Cut a rectangle out of the base layer const layers = viewer.imageryLayers; @@ -81,25 +73,17 @@ // Fit a SingleTileImageryProvider inside the cutout on the lowest layer const logo = Cesium.ImageryLayer.fromProviderAsync( - Cesium.SingleTileImageryProvider.fromUrl( - "../images/Cesium_Logo_overlay.png", - { - rectangle: defaultImageryLayerCutout, - } - ) + Cesium.SingleTileImageryProvider.fromUrl("../images/Cesium_Logo_overlay.png", { + rectangle: defaultImageryLayerCutout, + }), ); layers.add(logo); // Add an Earth at Night layer and a "traveling" cutout const earthAtNight = Cesium.ImageryLayer.fromProviderAsync( - Cesium.IonImageryProvider.fromAssetId(3812) - ); - earthAtNight.cutoutRectangle = Cesium.Rectangle.fromDegrees( - -100, - 10, - -60, - 50 + Cesium.IonImageryProvider.fromAssetId(3812), ); + earthAtNight.cutoutRectangle = Cesium.Rectangle.fromDegrees(-100, 10, -60, 50); earthAtNight.alpha = 0.9; layers.add(earthAtNight); @@ -134,7 +118,7 @@ flags[flagName] = true; } }, - false + false, ); document.addEventListener( @@ -145,7 +129,7 @@ flags[flagName] = false; } }, - false + false, ); const moveIncrement = 0.05; diff --git a/Apps/Sandcastle/gallery/Imagery Layers Manipulation.html b/Apps/Sandcastle/gallery/Imagery Layers Manipulation.html index 66e5b1e31e1d..4e309a339dd7 100644 --- a/Apps/Sandcastle/gallery/Imagery Layers Manipulation.html +++ b/Apps/Sandcastle/gallery/Imagery Layers Manipulation.html @@ -1,4 +1,4 @@ - + @@ -21,10 +21,7 @@ > - + @@ -47,24 +38,16 @@ const layers = viewer.scene.imageryLayers; const blackMarble = Cesium.ImageryLayer.fromProviderAsync( - Cesium.IonImageryProvider.fromAssetId(3812) + Cesium.IonImageryProvider.fromAssetId(3812), ); blackMarble.alpha = 0.5; blackMarble.brightness = 2.0; layers.add(blackMarble); const cesiumLogo = Cesium.ImageryLayer.fromProviderAsync( - Cesium.SingleTileImageryProvider.fromUrl( - "../images/Cesium_Logo_overlay.png", - { - rectangle: Cesium.Rectangle.fromDegrees( - -75.0, - 28.0, - -67.0, - 29.75 - ), - } - ) + Cesium.SingleTileImageryProvider.fromUrl("../images/Cesium_Logo_overlay.png", { + rectangle: Cesium.Rectangle.fromDegrees(-75.0, 28.0, -67.0, 29.75), + }), ); layers.add(cesiumLogo); //Sandcastle_End diff --git a/Apps/Sandcastle/gallery/Interpolation.html b/Apps/Sandcastle/gallery/Interpolation.html index d3538bb1165f..d0559b27d7a8 100644 --- a/Apps/Sandcastle/gallery/Interpolation.html +++ b/Apps/Sandcastle/gallery/Interpolation.html @@ -1,4 +1,4 @@ - + @@ -21,10 +21,7 @@ > - + @@ -55,11 +52,7 @@ //Set bounds of our simulation time const start = Cesium.JulianDate.fromDate(new Date(2015, 2, 25, 16)); - const stop = Cesium.JulianDate.addSeconds( - start, - 360, - new Cesium.JulianDate() - ); + const stop = Cesium.JulianDate.addSeconds(start, 360, new Cesium.JulianDate()); //Make sure viewer is at the desired time. viewer.clock.startTime = start.clone(); @@ -76,15 +69,11 @@ const property = new Cesium.SampledPositionProperty(); for (let i = 0; i <= 360; i += 45) { const radians = Cesium.Math.toRadians(i); - const time = Cesium.JulianDate.addSeconds( - start, - i, - new Cesium.JulianDate() - ); + const time = Cesium.JulianDate.addSeconds(start, i, new Cesium.JulianDate()); const position = Cesium.Cartesian3.fromDegrees( lon + radius * 1.5 * Math.cos(radians), lat + radius * Math.sin(radians), - Cesium.Math.nextRandomNumber() * 500 + 1750 + Cesium.Math.nextRandomNumber() * 500 + 1750, ); property.addSample(time, position); @@ -143,7 +132,7 @@ viewer.trackedEntity = undefined; viewer.zoomTo( viewer.entities, - new Cesium.HeadingPitchRange(0, Cesium.Math.toRadians(-90)) + new Cesium.HeadingPitchRange(0, Cesium.Math.toRadians(-90)), ); }); @@ -155,8 +144,8 @@ new Cesium.HeadingPitchRange( Cesium.Math.toRadians(-90), Cesium.Math.toRadians(-15), - 7500 - ) + 7500, + ), ); }); @@ -182,8 +171,7 @@ onselect: function () { entity.position.setInterpolationOptions({ interpolationDegree: 5, - interpolationAlgorithm: - Cesium.LagrangePolynomialApproximation, + interpolationAlgorithm: Cesium.LagrangePolynomialApproximation, }); }, }, @@ -197,7 +185,7 @@ }, }, ], - "interpolationMenu" + "interpolationMenu", ); //Sandcastle_End }; diff --git a/Apps/Sandcastle/gallery/Japan Buildings.html b/Apps/Sandcastle/gallery/Japan Buildings.html index c767e78b5860..1d9ad46e45b6 100644 --- a/Apps/Sandcastle/gallery/Japan Buildings.html +++ b/Apps/Sandcastle/gallery/Japan Buildings.html @@ -1,4 +1,4 @@ - + @@ -11,10 +11,7 @@ name="description" content="Worldwide 3D buildings with rich metadata from OpenStreetMap." /> - + Cesium Demo - + @@ -63,18 +57,18 @@ destination: new Cesium.Cartesian3( -3558117.165209301, 3887175.058311886, - 3582090.381367681 + 3582090.381367681, ), orientation: { direction: new Cesium.Cartesian3( 0.915045649098936, -0.16130516440787898, - 0.3696919041586574 + 0.3696919041586574, ), up: new Cesium.Cartesian3( -0.20924973638933655, 0.5937271886242537, - 0.7769829942214522 + 0.7769829942214522, ), }, }; @@ -83,18 +77,18 @@ destination: new Cesium.Cartesian3( -3959788.9678092706, 3353283.9088315447, - 3697270.0292328526 + 3697270.0292328526, ), orientation: { direction: new Cesium.Cartesian3( 0.1473261076519599, -0.9210400676146971, - 0.3605276852787276 + 0.3605276852787276, ), up: new Cesium.Cartesian3( -0.6082716434343354, 0.20305763470537083, - 0.7673155835649066 + 0.7673155835649066, ), }, }; @@ -103,18 +97,18 @@ destination: new Cesium.Cartesian3( -3746418.0787567603, 3649244.7209161296, - 3638967.47570257 + 3638967.47570257, ), orientation: { direction: new Cesium.Cartesian3( 0.9417381486076588, -0.026110036454204615, - 0.335331963065526 + 0.335331963065526, ), up: new Cesium.Cartesian3( -0.2518896785254185, 0.6059364940549604, - 0.7545810460280222 + 0.7545810460280222, ), }, }; @@ -123,18 +117,18 @@ destination: new Cesium.Cartesian3( -3644464.457824361, 2916376.559037763, - 4333280.277694175 + 4333280.277694175, ), orientation: { direction: new Cesium.Cartesian3( -0.3679337542668949, -0.8827113216318188, - -0.2923105799215557 + -0.2923105799215557, ), up: new Cesium.Cartesian3( -0.7773373481004832, 0.11948179734604299, - 0.6176331818734058 + 0.6176331818734058, ), }, }; @@ -143,18 +137,18 @@ destination: new Cesium.Cartesian3( -3720805.8497414757, 3554280.4145123693, - 3756470.8341226312 + 3756470.8341226312, ), orientation: { direction: new Cesium.Cartesian3( -0.29857010298659575, 0.04749330012764362, - -0.9532052664801844 + -0.9532052664801844, ), up: new Cesium.Cartesian3( -0.7423221317622432, 0.6161776077834791, - 0.2632166566959398 + 0.2632166566959398, ), }, }; @@ -163,18 +157,18 @@ destination: new Cesium.Cartesian3( -3938455.040928949, 3417079.906560689, - 3662889.160230748 + 3662889.160230748, ), orientation: { direction: new Cesium.Cartesian3( 0.09245366141098484, 0.5115481128951291, - -0.854266263342487 + -0.854266263342487, ), up: new Cesium.Cartesian3( -0.6151172847807794, 0.703996434356258, - 0.35499260045470854 + 0.35499260045470854, ), }, }; @@ -183,18 +177,18 @@ destination: new Cesium.Cartesian3( -3930814.3315207073, 3422614.91809806, - 3665138.546010887 + 3665138.546010887, ), orientation: { direction: new Cesium.Cartesian3( 0.8178889459747928, 0.5717362258573416, - 0.06461702635254533 + 0.06461702635254533, ), up: new Cesium.Cartesian3( -0.49123560987022913, 0.6353948538216464, - 0.595785997932473 + 0.595785997932473, ), }, }; @@ -257,16 +251,14 @@ scene.preRender.addEventListener(function (scene, time) { scene.light.direction = Cesium.Cartesian3.clone( scene.camera.directionWC, - scene.light.direction + scene.light.direction, ); }); - viewer.homeButton.viewModel.command.beforeExecute.addEventListener( - (e) => { - e.cancel = true; - scene.camera.flyTo(hiroshima); - } - ); + viewer.homeButton.viewModel.command.beforeExecute.addEventListener((e) => { + e.cancel = true; + scene.camera.flyTo(hiroshima); + }); //Sandcastle_End }; diff --git a/Apps/Sandcastle/gallery/KML Tours.html b/Apps/Sandcastle/gallery/KML Tours.html index 9c4620781964..e418008b4135 100644 --- a/Apps/Sandcastle/gallery/KML Tours.html +++ b/Apps/Sandcastle/gallery/KML Tours.html @@ -1,4 +1,4 @@ - + @@ -18,10 +18,7 @@ > - + @@ -44,8 +41,8 @@ .add( Cesium.KmlDataSource.load( "../../SampleData/kml/eiffel-tower-flyto.kml", - options - ) + options, + ), ) .then(function (dataSource) { tour = dataSource.kmlTours[0]; diff --git a/Apps/Sandcastle/gallery/KML.html b/Apps/Sandcastle/gallery/KML.html index 4539bf976e46..2e580090a54f 100644 --- a/Apps/Sandcastle/gallery/KML.html +++ b/Apps/Sandcastle/gallery/KML.html @@ -1,4 +1,4 @@ - + @@ -18,10 +18,7 @@ > - + @@ -49,8 +46,8 @@ viewer.dataSources.add( Cesium.KmlDataSource.load( "../../SampleData/kml/facilities/facilities.kml", - options - ) + options, + ), ); }, }, @@ -61,8 +58,8 @@ viewer.dataSources.add( Cesium.KmlDataSource.load( "../../SampleData/kml/gdpPerCapita2008.kmz", - options - ) + options, + ), ); }, }, @@ -73,8 +70,8 @@ .add( Cesium.KmlDataSource.load( "../../SampleData/kml/bikeRide.kml", - options - ) + options, + ), ) .then(function (dataSource) { viewer.clock.shouldAnimate = false; @@ -89,7 +86,7 @@ }, }, ], - "toolbar" + "toolbar", ); Sandcastle.reset = function () { diff --git a/Apps/Sandcastle/gallery/Labels.html b/Apps/Sandcastle/gallery/Labels.html index 4de6651f0c2e..c8844879a737 100644 --- a/Apps/Sandcastle/gallery/Labels.html +++ b/Apps/Sandcastle/gallery/Labels.html @@ -1,4 +1,4 @@ - + @@ -18,10 +18,7 @@ > - + @@ -63,11 +60,7 @@ function setProperties() { Sandcastle.declare(setProperties); const entity = viewer.entities.add({ - position: Cesium.Cartesian3.fromDegrees( - -75.1641667, - 39.9522222, - 300000.0 - ), + position: Cesium.Cartesian3.fromDegrees(-75.1641667, 39.9522222, 300000.0), label: { text: "Philadelphia", }, @@ -84,16 +77,8 @@ viewer.entities.add({ position: Cesium.Cartesian3.fromDegrees(-75.1641667, 39.9522222), billboard: { - position: Cesium.Cartesian3.fromDegrees( - -75.1641667, - 39.9522222 - ), - scaleByDistance: new Cesium.NearFarScalar( - 1.5e2, - 5.0, - 1.5e7, - 0.5 - ), + position: Cesium.Cartesian3.fromDegrees(-75.1641667, 39.9522222), + scaleByDistance: new Cesium.NearFarScalar(1.5e2, 5.0, 1.5e7, 0.5), image: image, }, label: { @@ -106,7 +91,7 @@ 1.5e2, 3.0, 1.5e7, - 0.5 + 0.5, ), }, }); @@ -120,24 +105,14 @@ position: Cesium.Cartesian3.fromDegrees(-73.94, 40.67), label: { text: "New York", - translucencyByDistance: new Cesium.NearFarScalar( - 1.5e2, - 1.0, - 1.5e8, - 0.0 - ), + translucencyByDistance: new Cesium.NearFarScalar(1.5e2, 1.0, 1.5e8, 0.0), }, }); viewer.entities.add({ position: Cesium.Cartesian3.fromDegrees(-84.39, 33.75), label: { text: "Atlanta", - translucencyByDistance: new Cesium.NearFarScalar( - 1.5e5, - 1.0, - 1.5e7, - 0.0 - ), + translucencyByDistance: new Cesium.NearFarScalar(1.5e5, 1.0, 1.5e7, 0.0), }, }); } @@ -186,10 +161,7 @@ labelListenerCallback = viewer.scene.preUpdate.addEventListener( function (scene, time) { entity.label.outlineWidth += outlineDelta; - if ( - entity.label.outlineWidth >= 4.0 || - entity.label.outlineWidth <= 0.0 - ) { + if (entity.label.outlineWidth >= 4.0 || entity.label.outlineWidth <= 0.0) { outlineDelta *= -1.0; } @@ -198,7 +170,7 @@ fontDelta *= -1.0; } entity.label.font = `${fontSize}px Calibri`; - } + }, ); } diff --git a/Apps/Sandcastle/gallery/LensFlare.html b/Apps/Sandcastle/gallery/LensFlare.html index 9942d7288696..106730c744bc 100644 --- a/Apps/Sandcastle/gallery/LensFlare.html +++ b/Apps/Sandcastle/gallery/LensFlare.html @@ -1,4 +1,4 @@ - + @@ -8,10 +8,7 @@ content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no" /> - + Cesium Demo - + @@ -120,14 +114,12 @@ Cesium.knockout.applyBindings(viewModel, toolbar); for (const name in viewModel) { if (viewModel.hasOwnProperty(name)) { - Cesium.knockout - .getObservable(viewModel, name) - .subscribe(updatePostProcess); + Cesium.knockout.getObservable(viewModel, name).subscribe(updatePostProcess); } } const lensFlare = viewer.scene.postProcessStages.add( - Cesium.PostProcessStageLibrary.createLensFlareStage() + Cesium.PostProcessStageLibrary.createLensFlareStage(), ); function updatePostProcess() { @@ -145,28 +137,25 @@ camera.position = new Cesium.Cartesian3( 40010447.97500168, 56238683.46406788, - 20776576.752223067 + 20776576.752223067, ); camera.direction = new Cesium.Cartesian3( -0.5549701431494752, -0.7801872010801355, - -0.2886452346452218 + -0.2886452346452218, ); camera.up = new Cesium.Cartesian3( -0.3016252360948521, -0.13464820558887716, - 0.9438707950150912 + 0.9438707950150912, ); camera.right = Cesium.Cartesian3.cross( camera.direction, camera.up, - new Cesium.Cartesian3() + new Cesium.Cartesian3(), ); - viewer.clock.currentTime = new Cesium.JulianDate( - 2458047, - 27399.860215000022 - ); + viewer.clock.currentTime = new Cesium.JulianDate(2458047, 27399.860215000022); //Sandcastle_End }; if (typeof Cesium !== "undefined") { diff --git a/Apps/Sandcastle/gallery/Lighting.html b/Apps/Sandcastle/gallery/Lighting.html index 05603bd3bcc2..8bdd8b1380e4 100644 --- a/Apps/Sandcastle/gallery/Lighting.html +++ b/Apps/Sandcastle/gallery/Lighting.html @@ -1,4 +1,4 @@ - + @@ -18,10 +18,7 @@ > - + @@ -50,24 +47,19 @@ const icrfToFixed = scratchIcrfToFixed; const date = viewer.clock.currentTime; if ( - !Cesium.defined( - Cesium.Transforms.computeIcrfToFixedMatrix(date, icrfToFixed) - ) + !Cesium.defined(Cesium.Transforms.computeIcrfToFixedMatrix(date, icrfToFixed)) ) { Cesium.Transforms.computeTemeToPseudoFixedMatrix(date, icrfToFixed); } - const moonPosition = Cesium.Simon1994PlanetaryPositions.computeMoonPositionInEarthInertialFrame( - date, - scratchMoonPosition - ); - Cesium.Matrix3.multiplyByVector( - icrfToFixed, - moonPosition, - moonPosition - ); + const moonPosition = + Cesium.Simon1994PlanetaryPositions.computeMoonPositionInEarthInertialFrame( + date, + scratchMoonPosition, + ); + Cesium.Matrix3.multiplyByVector(icrfToFixed, moonPosition, moonPosition); const moonDirection = Cesium.Cartesian3.normalize( moonPosition, - scratchMoonDirection + scratchMoonDirection, ); return Cesium.Cartesian3.negate(moonDirection, result); } @@ -76,7 +68,7 @@ direction: new Cesium.Cartesian3( 0.2454278300540191, 0.8842635425193919, - 0.39729481195458805 + 0.39729481195458805, ), }); @@ -96,7 +88,7 @@ direction: new Cesium.Cartesian3( -0.2454278300540191, 0.8842635425193919, - 0.39729481195458805 + 0.39729481195458805, ), color: Cesium.Color.fromCssColorString("#deca7c"), }); @@ -105,7 +97,7 @@ if (scene.light === flashlight) { scene.light.direction = Cesium.Cartesian3.clone( scene.camera.directionWC, - scene.light.direction + scene.light.direction, ); } else if (scene.light === moonLight) { scene.light.direction = getMoonDirection(scene.light.direction); @@ -116,7 +108,7 @@ position: Cesium.Cartesian3.fromRadians( -2.1463338399937277, 0.6677959688982861, - 32.18991401746337 + 32.18991401746337, ), model: { uri: "../../SampleData/models/CesiumBalloon/CesiumBalloon.glb", @@ -128,7 +120,7 @@ position: Cesium.Cartesian3.fromRadians( -2.14633449752228, 0.667796065242357, - 24.47647034111423 + 24.47647034111423, ), cylinder: { length: 8.0, @@ -142,7 +134,7 @@ position: Cesium.Cartesian3.fromRadians( -2.1463332294173365, 0.6677959755384729, - 26.2876064083145 + 26.2876064083145, ), ellipsoid: { radii: new Cesium.Cartesian3(2.5, 2.5, 2.5), @@ -155,7 +147,7 @@ const endTime = Cesium.JulianDate.addDays( currentTime, 2, - new Cesium.JulianDate() + new Cesium.JulianDate(), ); viewer.clock.currentTime = currentTime; @@ -174,12 +166,12 @@ destination: new Cesium.Cartesian3( -2729490.8390059783, -4206389.878855597, - 3928671.2763356343 + 3928671.2763356343, ), orientation: new Cesium.HeadingPitchRoll( 2.2482480507178426, -0.20084951548781982, - 0.002593933673552762 + 0.002593933673552762, ), endTransform: Cesium.Matrix4.IDENTITY, }); diff --git a/Apps/Sandcastle/gallery/LocalToFixedFrame.html b/Apps/Sandcastle/gallery/LocalToFixedFrame.html index bf4419b2829c..e7724dd432fb 100644 --- a/Apps/Sandcastle/gallery/LocalToFixedFrame.html +++ b/Apps/Sandcastle/gallery/LocalToFixedFrame.html @@ -1,4 +1,4 @@ - + @@ -21,10 +21,7 @@ > - + @@ -36,9 +33,7 @@

Loading...

${fieldName}`; @@ -135,15 +122,11 @@

Loading...

}); } } - }, - Cesium.ScreenSpaceEventType.LEFT_CLICK); + }, Cesium.ScreenSpaceEventType.LEFT_CLICK); function isNameProperty(propertyName) { const name = propertyName.toLowerCase(); - if ( - name.localeCompare("name") === 0 || - name.localeCompare("objname") === 0 - ) { + if (name.localeCompare("name") === 0 || name.localeCompare("objname") === 0) { return true; } return false; diff --git a/Apps/Sandcastle/gallery/I3S IntegratedMesh Layer.html b/Apps/Sandcastle/gallery/I3S IntegratedMesh Layer.html index b908895276db..d2f32238087e 100644 --- a/Apps/Sandcastle/gallery/I3S IntegratedMesh Layer.html +++ b/Apps/Sandcastle/gallery/I3S IntegratedMesh Layer.html @@ -1,4 +1,4 @@ - + @@ -7,10 +7,7 @@ name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no" /> - + I3S Consumption Cesium Demo @@ -22,10 +19,7 @@ - + @@ -58,7 +52,7 @@

Loading...

// If this is not specified, or the URL is invalid no geoid conversion will be applied. // The source data used in this transcoding service was compiled from https://earth-info.nga.mil/#tab_wgs84-data and is based on EGM2008 Gravity Model const geoidService = await Cesium.ArcGISTiledElevationTerrainProvider.fromUrl( - "https://tiles.arcgis.com/tiles/z2tnIkrLQ2BRzr6P/arcgis/rest/services/EGM2008/ImageServer" + "https://tiles.arcgis.com/tiles/z2tnIkrLQ2BRzr6P/arcgis/rest/services/EGM2008/ImageServer", ); // Create i3s options to pass optional parameters useful for debugging and visualizing @@ -69,7 +63,7 @@

Loading...

// Create I3S data provider const i3sProvider = await Cesium.I3SDataProvider.fromUrl( tours.Frankfurt, - i3sOptions + i3sOptions, ); // Add the i3s layer provider as a primitive data type @@ -82,9 +76,7 @@

Loading...

destination: Cesium.Ellipsoid.WGS84.cartographicToCartesian(center), }); } catch (error) { - console.log( - `There was an error creating the I3S Data Provider: ${error}` - ); + console.log(`There was an error creating the I3S Data Provider: ${error}`); } //Sandcastle_End }; if (typeof Cesium !== "undefined") { diff --git a/Apps/Sandcastle/gallery/Image-Based Lighting.html b/Apps/Sandcastle/gallery/Image-Based Lighting.html index 448a7ee13bed..da68bd9c130b 100644 --- a/Apps/Sandcastle/gallery/Image-Based Lighting.html +++ b/Apps/Sandcastle/gallery/Image-Based Lighting.html @@ -1,4 +1,4 @@ - + @@ -7,10 +7,7 @@ name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no" /> - + Cesium Demo @@ -21,10 +18,7 @@ > - + @@ -43,11 +37,7 @@ step="0.01" data-bind="value: luminanceAtZenith, valueUpdate: 'input'" /> - +
- + @@ -90,34 +85,22 @@

Loading...

}, { pos: Cesium.Cartesian3.fromDegrees(-123.075, 44.05, 5500.0), - converter: Cesium.Transforms.localFrameToFixedFrameGenerator( - "north", - "west" - ), + converter: Cesium.Transforms.localFrameToFixedFrameGenerator("north", "west"), comments: "North West Up\nlocal Frame", }, { pos: Cesium.Cartesian3.fromDegrees(-123.075, 44.04, 4500.0), - converter: Cesium.Transforms.localFrameToFixedFrameGenerator( - "south", - "up" - ), + converter: Cesium.Transforms.localFrameToFixedFrameGenerator("south", "up"), comments: "South Up West\nlocal Frame", }, { pos: Cesium.Cartesian3.fromDegrees(-123.075, 44.05, 4500.0), - converter: Cesium.Transforms.localFrameToFixedFrameGenerator( - "up", - "east" - ), + converter: Cesium.Transforms.localFrameToFixedFrameGenerator("up", "east"), comments: "Up East North\nlocal Frame", }, { pos: Cesium.Cartesian3.fromDegrees(-123.075, 44.04, 5500.0), - converter: Cesium.Transforms.localFrameToFixedFrameGenerator( - "down", - "east" - ), + converter: Cesium.Transforms.localFrameToFixedFrameGenerator("down", "east"), comments: "Down East South\nlocal Frame", }, ]; @@ -137,10 +120,10 @@

Loading...

position, hpRoll, Cesium.Ellipsoid.WGS84, - converter + converter, ), minimumPixelSize: 128, - }) + }), ); primitives.push({ @@ -155,14 +138,14 @@

Loading...

position, hprRollZero, Cesium.Ellipsoid.WGS84, - converter + converter, ); scene.primitives.add( new Cesium.DebugModelMatrixPrimitive({ modelMatrix: modelMatrix, length: 300.0, width: 10.0, - }) + }), ); const positionLabel = position.clone(); @@ -259,15 +242,13 @@

Loading...

hpRoll, Cesium.Ellipsoid.WGS84, converter, - primitive.modelMatrix + primitive.modelMatrix, ); } }); viewer.scene.preRender.addEventListener(function (scene, time) { - headingSpan.innerHTML = Cesium.Math.toDegrees(hpRoll.heading).toFixed( - 1 - ); + headingSpan.innerHTML = Cesium.Math.toDegrees(hpRoll.heading).toFixed(1); pitchSpan.innerHTML = Cesium.Math.toDegrees(hpRoll.pitch).toFixed(1); rollSpan.innerHTML = Cesium.Math.toDegrees(hpRoll.roll).toFixed(1); }); diff --git a/Apps/Sandcastle/gallery/MSAA.html b/Apps/Sandcastle/gallery/MSAA.html index dcf26f60c78c..5fbf79be4078 100644 --- a/Apps/Sandcastle/gallery/MSAA.html +++ b/Apps/Sandcastle/gallery/MSAA.html @@ -1,4 +1,4 @@ - + @@ -18,10 +18,7 @@ > - + @@ -36,9 +33,7 @@ terrain: Cesium.Terrain.fromWorldTerrain(), }); - viewer.clock.currentTime = Cesium.JulianDate.fromIso8601( - "2022-08-01T00:00:00Z" - ); + viewer.clock.currentTime = Cesium.JulianDate.fromIso8601("2022-08-01T00:00:00Z"); const scene = viewer.scene; if (!scene.msaaSupported) { @@ -50,16 +45,13 @@ const position = Cesium.Cartesian3.fromDegrees( -123.0744619, 44.0503706, - height + height, ); const heading = Cesium.Math.toRadians(135); const pitch = 0; const roll = 0; const hpr = new Cesium.HeadingPitchRoll(heading, pitch, roll); - const orientation = Cesium.Transforms.headingPitchRollQuaternion( - position, - hpr - ); + const orientation = Cesium.Transforms.headingPitchRollQuaternion(position, hpr); const entity = viewer.entities.add({ name: url, @@ -74,7 +66,7 @@ const target = Cesium.Cartesian3.fromDegrees( -123.0744619, 44.0503706, - height + 7.5 + height + 7.5, ); const offset = new Cesium.Cartesian3(50.0, -15.0, 0.0); viewer.scene.camera.lookAt(target, offset); @@ -85,9 +77,7 @@ currentAssetId = assetId; try { - const tileset = await Cesium.Cesium3DTileset.fromIonAssetId( - assetId - ); + const tileset = await Cesium.Cesium3DTileset.fromIonAssetId(assetId); if (currentAssetId !== assetId) { // Another scenario was loaded. Discard the result. @@ -110,12 +100,12 @@ destination: new Cesium.Cartesian3( 1331419.302230775, -4656681.5022043325, - 4136232.6465900405 + 4136232.6465900405, ), orientation: new Cesium.HeadingPitchRoll( 6.032455545102689, -0.056832496140112765, - 6.282360923090216 + 6.282360923090216, ), endTransform: Cesium.Matrix4.IDENTITY, }); @@ -131,7 +121,7 @@ destination: new Cesium.Cartesian3( 1234138.7804841248, -5086063.633843134, - 3633284.606361642 + 3633284.606361642, ), orientation: { heading: 0.4304630387656614, @@ -150,7 +140,7 @@ scene.primitives.removeAll(); createModel( "../../SampleData/models/CesiumBalloon/CesiumBalloon.glb", - 1000.0 + 1000.0, ); }, }, diff --git a/Apps/Sandcastle/gallery/Manually Controlled Animation.html b/Apps/Sandcastle/gallery/Manually Controlled Animation.html index dca08d980e75..12084ff831f7 100644 --- a/Apps/Sandcastle/gallery/Manually Controlled Animation.html +++ b/Apps/Sandcastle/gallery/Manually Controlled Animation.html @@ -1,4 +1,4 @@ - + @@ -18,10 +18,7 @@ > - + @@ -42,7 +39,7 @@ const stop = Cesium.JulianDate.addSeconds( start, totalSeconds, - new Cesium.JulianDate() + new Cesium.JulianDate(), ); viewer.clock.startTime = start.clone(); viewer.clock.stopTime = stop.clone(); @@ -56,18 +53,15 @@ const startPosition = new Cesium.Cartesian3( -2379556.799372864, -4665528.205030263, - 3628013.106599678 + 3628013.106599678, ); const endPosition = new Cesium.Cartesian3( -2379603.7074103747, -4665623.48990283, - 3627860.82704567 + 3627860.82704567, ); // A velocity vector property will give us the entity's speed and direction at any given time. - const velocityVectorProperty = new Cesium.VelocityVectorProperty( - position, - false - ); + const velocityVectorProperty = new Cesium.VelocityVectorProperty(position, false); const velocityVector = new Cesium.Cartesian3(); const numberOfSamples = 100; @@ -78,7 +72,7 @@ const time = Cesium.JulianDate.addSeconds( start, factor * totalSeconds, - new Cesium.JulianDate() + new Cesium.JulianDate(), ); // Lerp using a non-linear factor so that the model accelerates. @@ -87,15 +81,12 @@ startPosition, endPosition, locationFactor, - new Cesium.Cartesian3() + new Cesium.Cartesian3(), ); position.addSample(time, location); distance.addSample( time, - (totalDistance += Cesium.Cartesian3.distance( - location, - prevLocation - )) + (totalDistance += Cesium.Cartesian3.distance(location, prevLocation)), ); prevLocation = location; } @@ -114,7 +105,7 @@ await Cesium.Model.fromGltfAsync({ url: "../../SampleData/models/CesiumMan/Cesium_Man.glb", scale: 4, - }) + }), ); modelPrimitive.readyEvent.addEventListener(() => { @@ -137,12 +128,12 @@ pos, vel, viewer.scene.globe.ellipsoid, - rotation + rotation, ); Cesium.Matrix4.fromRotationTranslation( rotation, pos, - modelPrimitive.modelMatrix + modelPrimitive.modelMatrix, ); }); } catch (error) { @@ -156,10 +147,7 @@ text: new Cesium.CallbackProperty(updateSpeedLabel, false), font: "20px sans-serif", showBackground: true, - distanceDisplayCondition: new Cesium.DistanceDisplayCondition( - 0.0, - 100.0 - ), + distanceDisplayCondition: new Cesium.DistanceDisplayCondition(0.0, 100.0), eyeOffset: new Cesium.Cartesian3(0, 7.2, 0), }, }); diff --git a/Apps/Sandcastle/gallery/Map Pins.html b/Apps/Sandcastle/gallery/Map Pins.html index b0d9b6709ad7..0412b4f78fe7 100644 --- a/Apps/Sandcastle/gallery/Map Pins.html +++ b/Apps/Sandcastle/gallery/Map Pins.html @@ -1,4 +1,4 @@ - + @@ -18,10 +18,7 @@ > - + @@ -59,7 +56,7 @@ const url = Cesium.buildModuleUrl("Assets/Textures/maki/grocery.png"); const groceryPin = Promise.resolve( - pinBuilder.fromUrl(url, Cesium.Color.GREEN, 48) + pinBuilder.fromUrl(url, Cesium.Color.GREEN, 48), ).then(function (canvas) { return viewer.entities.add({ name: "Grocery store", @@ -73,7 +70,7 @@ //Create a red pin representing a hospital from the maki icon set. const hospitalPin = Promise.resolve( - pinBuilder.fromMakiIconId("hospital", Cesium.Color.RED, 48) + pinBuilder.fromMakiIconId("hospital", Cesium.Color.RED, 48), ).then(function (canvas) { return viewer.entities.add({ name: "Hospital", @@ -89,7 +86,7 @@ Promise.all([bluePin, questionPin, groceryPin, hospitalPin]).then( function (pins) { viewer.zoomTo(pins); - } + }, ); //Sandcastle_End diff --git a/Apps/Sandcastle/gallery/Materials.html b/Apps/Sandcastle/gallery/Materials.html index 692e73892040..803d899b99a8 100644 --- a/Apps/Sandcastle/gallery/Materials.html +++ b/Apps/Sandcastle/gallery/Materials.html @@ -1,4 +1,4 @@ - + @@ -21,10 +21,7 @@ > - + @@ -90,9 +87,7 @@ function applyCheckerboardMaterial(primitive, scene) { Sandcastle.declare(applyCheckerboardMaterial); // For highlighting in Sandcastle. - primitive.appearance.material = Cesium.Material.fromType( - "Checkerboard" - ); + primitive.appearance.material = Cesium.Material.fromType("Checkerboard"); } function applyColorMaterial(primitive, scene) { @@ -117,19 +112,19 @@ }, }, source: ` - czm_material czm_getMaterial(czm_materialInput materialInput) { - czm_material material = czm_getDefaultMaterial(materialInput); - vec4 color; - float heightValue = texture(heightField, materialInput.st).r; - color.rgb = mix(vec3(0.2, 0.6, 0.2), vec3(1.0, 0.5, 0.2), heightValue); - color.a = (1.0 - texture(image, materialInput.st).r) * 0.7; - color = czm_gammaCorrect(color); - material.diffuse = color.rgb; - material.alpha = color.a; - material.normal = bumpMap.normal; + czm_material czm_getMaterial(czm_materialInput materialInput) { + czm_material material = czm_getDefaultMaterial(materialInput); + vec4 color; + float heightValue = texture(heightField, materialInput.st).r; + color.rgb = mix(vec3(0.2, 0.6, 0.2), vec3(1.0, 0.5, 0.2), heightValue); + color.a = (1.0 - texture(image, materialInput.st).r) * 0.7; + color = czm_gammaCorrect(color); + material.diffuse = color.rgb; + material.alpha = color.a; + material.normal = bumpMap.normal; material.specular = step(0.1, heightValue); // Specular mountain tops material.shininess = 8.0; // Sharpen highlight - return material; + return material; } `, }, @@ -191,9 +186,7 @@ type: "Water", uniforms: { specularMap: "../images/earthspec1k.jpg", - normalMap: Cesium.buildModuleUrl( - "Assets/Textures/waterNormals.jpg" - ), + normalMap: Cesium.buildModuleUrl("Assets/Textures/waterNormals.jpg"), frequency: 10000.0, animationSpeed: 0.01, amplitude: 1.0, @@ -297,9 +290,7 @@ function applyRimLightingMaterial(primitive, scene) { Sandcastle.declare(applyRimLightingMaterial); // For highlighting in Sandcastle. - primitive.appearance.material = Cesium.Material.fromType( - "RimLighting" - ); + primitive.appearance.material = Cesium.Material.fromType("RimLighting"); } function applyPolylineArrowMaterial(primitive, scene) { @@ -370,7 +361,7 @@ onselect: function () { if (!Cesium.FeatureDetection.supportsBasis(scene)) { window.alert( - "This browser does not support Basis Universal compressed textures" + "This browser does not support Basis Universal compressed textures", ); } toggleRectangleVisibility(); @@ -383,7 +374,7 @@ onselect: function () { if (!Cesium.FeatureDetection.supportsBasis(scene)) { window.alert( - "This browser does not support Basis Universal compressed textures" + "This browser does not support Basis Universal compressed textures", ); } toggleRectangleVisibility(); @@ -559,31 +550,21 @@ new Cesium.Primitive({ geometryInstances: new Cesium.GeometryInstance({ geometry: new Cesium.RectangleGeometry({ - rectangle: Cesium.Rectangle.fromDegrees( - -120.0, - 20.0, - -60.0, - 40.0 - ), + rectangle: Cesium.Rectangle.fromDegrees(-120.0, 20.0, -60.0, 40.0), vertexFormat: Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT, }), }), appearance: new Cesium.EllipsoidSurfaceAppearance({ aboveGround: false, }), - }) + }), ); worldRectangle = scene.primitives.add( new Cesium.Primitive({ geometryInstances: new Cesium.GeometryInstance({ geometry: new Cesium.RectangleGeometry({ - rectangle: Cesium.Rectangle.fromDegrees( - -180.0, - -90.0, - 180.0, - 90.0 - ), + rectangle: Cesium.Rectangle.fromDegrees(-180.0, -90.0, 180.0, 90.0), vertexFormat: Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT, }), }), @@ -591,23 +572,14 @@ aboveGround: false, }), show: false, - }) + }), ); - const polylines = scene.primitives.add( - new Cesium.PolylineCollection() - ); + const polylines = scene.primitives.add(new Cesium.PolylineCollection()); polyline = polylines.add({ positions: Cesium.PolylinePipeline.generateCartesianArc({ positions: Cesium.Cartesian3.fromDegreesArray([ - -110.0, - 42.0, - -85.0, - 36.0, - -100.0, - 25.0, - -77.0, - 12.0, + -110.0, 42.0, -85.0, 36.0, -100.0, 25.0, -77.0, 12.0, ]), }), width: 10.0, diff --git a/Apps/Sandcastle/gallery/Montreal Point Cloud.html b/Apps/Sandcastle/gallery/Montreal Point Cloud.html index 2ffa1b493b47..2dcef33cfd28 100644 --- a/Apps/Sandcastle/gallery/Montreal Point Cloud.html +++ b/Apps/Sandcastle/gallery/Montreal Point Cloud.html @@ -1,4 +1,4 @@ - + @@ -21,10 +21,7 @@ > - + @@ -99,9 +93,8 @@ // Follow the vehicle with the camera. if (!viewer.trackedEntity) { - viewer.trackedEntity = vehicleEntity = dataSource.entities.getById( - "Vehicle" - ); + viewer.trackedEntity = vehicleEntity = + dataSource.entities.getById("Vehicle"); } }); } @@ -117,7 +110,7 @@ // This example uses time offsets from the start to identify which parts need loading. const timeOffset = Cesium.JulianDate.secondsDifference( clock.currentTime, - clock.startTime + clock.startTime, ); // Filter the list of parts to just the ones that need loading right now. @@ -136,7 +129,7 @@ if (vehicleEntity) { const fuel = vehicleEntity.properties.fuel_remaining.getValue( - clock.currentTime + clock.currentTime, ); if (Cesium.defined(fuel)) { fuelDisplay.textContent = `Fuel: ${fuel.toFixed(2)} gal`; diff --git a/Apps/Sandcastle/gallery/Multiple Synced Views.html b/Apps/Sandcastle/gallery/Multiple Synced Views.html index 13f6272c40f5..e17c597cf970 100644 --- a/Apps/Sandcastle/gallery/Multiple Synced Views.html +++ b/Apps/Sandcastle/gallery/Multiple Synced Views.html @@ -1,4 +1,4 @@ - + @@ -7,10 +7,7 @@ name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no" /> - + Cesium Demo @@ -21,10 +18,7 @@ > - + @@ -38,7 +35,7 @@ // Natural Earth II with Shaded Relief, Water, and Drainages from http://www.naturalearthdata.com const viewer = new Cesium.Viewer("cesiumContainer", { baseLayer: Cesium.ImageryLayer.fromProviderAsync( - Cesium.IonImageryProvider.fromAssetId(3813) + Cesium.IonImageryProvider.fromAssetId(3813), ), }); //Sandcastle_End diff --git a/Apps/Sandcastle/gallery/Offline.html b/Apps/Sandcastle/gallery/Offline.html index e6d5405b96ed..0de72ec6747a 100644 --- a/Apps/Sandcastle/gallery/Offline.html +++ b/Apps/Sandcastle/gallery/Offline.html @@ -1,4 +1,4 @@ - + @@ -21,10 +21,7 @@ > - + @@ -43,8 +40,8 @@ const viewer = new Cesium.Viewer("cesiumContainer", { baseLayer: Cesium.ImageryLayer.fromProviderAsync( Cesium.TileMapServiceImageryProvider.fromUrl( - Cesium.buildModuleUrl("Assets/Textures/NaturalEarthII") - ) + Cesium.buildModuleUrl("Assets/Textures/NaturalEarthII"), + ), ), baseLayerPicker: false, geocoder: false, diff --git a/Apps/Sandcastle/gallery/PAMAP Terrain.html b/Apps/Sandcastle/gallery/PAMAP Terrain.html index cdcbfc9ea97b..657f566b4bbd 100644 --- a/Apps/Sandcastle/gallery/PAMAP Terrain.html +++ b/Apps/Sandcastle/gallery/PAMAP Terrain.html @@ -1,4 +1,4 @@ - + @@ -21,10 +21,7 @@ > - + @@ -40,9 +37,8 @@ try { // High resolution terrain of Pennsylvania curated by Pennsylvania Spatial Data Access (PASDA) // http://www.pasda.psu.edu/ - viewer.terrainProvider = await Cesium.CesiumTerrainProvider.fromIonAssetId( - 3957 - ); + viewer.terrainProvider = + await Cesium.CesiumTerrainProvider.fromIonAssetId(3957); } catch (error) { window.alert(`Failed to load terrain. ${error}`); } @@ -57,7 +53,7 @@ destination: Cesium.Cartesian3.fromRadians( -1.3324415110874286, 0.6954224325279967, - 236.6770689945084 + 236.6770689945084, ), orientation: { heading: Cesium.Math.toRadians(310), @@ -74,7 +70,7 @@ destination: Cesium.Cartesian3.fromRadians( -1.358985133937573, 0.7123252393978314, - 451.05748252867375 + 451.05748252867375, ), orientation: { heading: Cesium.Math.toRadians(85), @@ -91,7 +87,7 @@ destination: Cesium.Cartesian3.fromRadians( -1.3700147546199826, 0.706808606166025, - 993.7916313325215 + 993.7916313325215, ), orientation: { heading: Cesium.Math.toRadians(90), @@ -108,7 +104,7 @@ destination: Cesium.Cartesian3.fromRadians( -1.3218297501066052, 0.713358272291525, - 240.87968743408845 + 240.87968743408845, ), orientation: { heading: Cesium.Math.toRadians(200), @@ -125,7 +121,7 @@ destination: Cesium.Cartesian3.fromRadians( -1.349379633251472, 0.720297672225785, - 656.268309953562 + 656.268309953562, ), orientation: { heading: Cesium.Math.toRadians(200), @@ -136,14 +132,14 @@ }, }, ], - "toolbar" + "toolbar", ); viewer.scene.camera.flyTo({ destination: Cesium.Cartesian3.fromRadians( -1.3324415110874286, 0.6954224325279967, - 236.6770689945084 + 236.6770689945084, ), orientation: { heading: Cesium.Math.toRadians(310), diff --git a/Apps/Sandcastle/gallery/Parallels and Meridians.html b/Apps/Sandcastle/gallery/Parallels and Meridians.html index 5dfbde37d231..a0ff126bba0a 100644 --- a/Apps/Sandcastle/gallery/Parallels and Meridians.html +++ b/Apps/Sandcastle/gallery/Parallels and Meridians.html @@ -1,4 +1,4 @@ - + @@ -21,10 +21,7 @@ > - + @@ -101,18 +98,8 @@ } function makeGrid(numberOfDivisions, color, show) { - const parallels = makeParallelsRecursive( - -90, - 90, - numberOfDivisions, - color - ); - const meridians = makeMeridiansRecursive( - -180, - 180, - numberOfDivisions, - color - ); + const parallels = makeParallelsRecursive(-90, 90, numberOfDivisions, color); + const meridians = makeMeridiansRecursive(-180, 180, numberOfDivisions, color); meridians.push(meridian(180, color)); const allLines = parallels.concat(meridians); @@ -123,12 +110,7 @@ return allLines; } - function makeParallelsRecursive( - minLatitude, - maxLatitude, - depth, - color - ) { + function makeParallelsRecursive(minLatitude, maxLatitude, depth, color) { let result = []; const midpoint = (minLatitude + maxLatitude) / 2; result.push(parallel(midpoint, color)); @@ -138,13 +120,13 @@ minLatitude, midpoint, depth - 1, - color + color, ); const northernLines = makeParallelsRecursive( midpoint, maxLatitude, depth - 1, - color + color, ); result = southernLines.concat(result, northernLines); } @@ -152,12 +134,7 @@ return result; } - function makeMeridiansRecursive( - minLongitude, - maxLongitude, - depth, - color - ) { + function makeMeridiansRecursive(minLongitude, maxLongitude, depth, color) { let result = []; const midpoint = (minLongitude + maxLongitude) / 2; result.push(meridian(midpoint, color)); @@ -167,13 +144,13 @@ minLongitude, midpoint, depth - 1, - color + color, ); const easternLines = makeMeridiansRecursive( midpoint, maxLongitude, depth - 1, - color + color, ); result = westernLines.concat(result, easternLines); } @@ -223,12 +200,12 @@ selectedPoint.parallel = parallel( toDegrees(cartographic.latitude), red, - finerGranularity + finerGranularity, ); selectedPoint.meridian = meridian( toDegrees(cartographic.longitude), red, - finerGranularity + finerGranularity, ); selectedPoint.label = labelCoordinates(cartographic); @@ -236,18 +213,10 @@ const antipode = new Cesium.Cartographic.fromDegrees( antipodeLongitude, antipodeLatitude, - 0 - ); - antipodalPoint.parallel = parallel( - antipodeLatitude, - cyan, - finerGranularity - ); - antipodalPoint.meridian = meridian( - antipodeLongitude, - cyan, - finerGranularity + 0, ); + antipodalPoint.parallel = parallel(antipodeLatitude, cyan, finerGranularity); + antipodalPoint.meridian = meridian(antipodeLongitude, cyan, finerGranularity); antipodalPoint.label = labelCoordinates(antipode); antipodalPoint.parallel.show = showAntipodalPoint; @@ -274,15 +243,11 @@ primitives.equator.show = checked; }); - Sandcastle.addToggleButton("Show prime meridian", true, function ( - checked - ) { + Sandcastle.addToggleButton("Show prime meridian", true, function (checked) { primitives.primeMeridian.show = checked; }); - Sandcastle.addToggleButton("Show low-resolution grid", false, function ( - checked - ) { + Sandcastle.addToggleButton("Show low-resolution grid", false, function (checked) { primitives.lowResolutionGrid.forEach(function (line) { line.show = checked; }); @@ -295,12 +260,10 @@ primitives.higherResolutionGrid.forEach(function (line) { line.show = checked; }); - } + }, ); - Sandcastle.addToggleButton("Show antipodal point", false, function ( - checked - ) { + Sandcastle.addToggleButton("Show antipodal point", false, function (checked) { showAntipodalPoint = checked; const antipodalPoint = primitives.antipodalPoint; diff --git a/Apps/Sandcastle/gallery/Partial Ellipsoids.html b/Apps/Sandcastle/gallery/Partial Ellipsoids.html index 14981aa8e429..c5830dbc3c18 100644 --- a/Apps/Sandcastle/gallery/Partial Ellipsoids.html +++ b/Apps/Sandcastle/gallery/Partial Ellipsoids.html @@ -1,4 +1,4 @@ - + @@ -7,10 +7,7 @@ name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no" /> - + Cesium Demo @@ -21,10 +18,7 @@ > - + @@ -37,11 +31,7 @@ //Sandcastle_Begin const viewer = new Cesium.Viewer("cesiumContainer"); - const saturnPosition = Cesium.Cartesian3.fromDegrees( - -95.0, - 45.0, - 300000.0 - ); + const saturnPosition = Cesium.Cartesian3.fromDegrees(-95.0, 45.0, 300000.0); viewer.entities.add({ name: "Saturn", position: saturnPosition, @@ -59,8 +49,8 @@ new Cesium.HeadingPitchRoll( Cesium.Math.toRadians(30.0), Cesium.Math.toRadians(30.0), - 0.0 - ) + 0.0, + ), ), ellipsoid: { radii: new Cesium.Cartesian3(400000.0, 400000.0, 400000.0), @@ -79,8 +69,8 @@ new Cesium.HeadingPitchRoll( Cesium.Math.toRadians(30.0), Cesium.Math.toRadians(30.0), - 0.0 - ) + 0.0, + ), ), ellipsoid: { radii: new Cesium.Cartesian3(460000.0, 460000.0, 460000.0), @@ -185,7 +175,7 @@ position: Cesium.Cartesian3.fromDegrees(-102.0, 35.0, 20000.0), orientation: Cesium.Transforms.headingPitchRollQuaternion( Cesium.Cartesian3.fromDegrees(-102.0, 35.0, 20000.0), - new Cesium.HeadingPitchRoll(Cesium.Math.PI / 1.5, 0, 0.0) + new Cesium.HeadingPitchRoll(Cesium.Math.PI / 1.5, 0, 0.0), ), ellipsoid: { radii: new Cesium.Cartesian3(500000.0, 500000.0, 500000.0), diff --git a/Apps/Sandcastle/gallery/Particle System Fireworks.html b/Apps/Sandcastle/gallery/Particle System Fireworks.html index 6293257b7386..7074b6d29d0d 100644 --- a/Apps/Sandcastle/gallery/Particle System Fireworks.html +++ b/Apps/Sandcastle/gallery/Particle System Fireworks.html @@ -1,4 +1,4 @@ - + @@ -18,10 +18,7 @@ > - + @@ -42,7 +39,7 @@ Cesium.Math.setRandomNumberSeed(315); const modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame( - Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883) + Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883), ); const emitterInitialLocation = new Cesium.Cartesian3(0.0, 0.0, 100.0); @@ -76,44 +73,40 @@ const position = Cesium.Cartesian3.add( emitterInitialLocation, offset, - new Cesium.Cartesian3() + new Cesium.Cartesian3(), ); const emitterModelMatrix = Cesium.Matrix4.fromTranslation( position, - emitterModelMatrixScratch + emitterModelMatrixScratch, ); const particleToWorld = Cesium.Matrix4.multiply( modelMatrix, emitterModelMatrix, - new Cesium.Matrix4() + new Cesium.Matrix4(), ); const worldToParticle = Cesium.Matrix4.inverseTransformation( particleToWorld, - particleToWorld + particleToWorld, ); const size = Cesium.Math.randomBetween( minimumExplosionSize, - maximumExplosionSize + maximumExplosionSize, ); const particlePositionScratch = new Cesium.Cartesian3(); const force = function (particle) { const position = Cesium.Matrix4.multiplyByPoint( worldToParticle, particle.position, - particlePositionScratch + particlePositionScratch, ); if (Cesium.Cartesian3.magnitudeSquared(position) >= size * size) { - Cesium.Cartesian3.clone( - Cesium.Cartesian3.ZERO, - particle.velocity - ); + Cesium.Cartesian3.clone(Cesium.Cartesian3.ZERO, particle.velocity); } }; const normalSize = - (size - minimumExplosionSize) / - (maximumExplosionSize - minimumExplosionSize); + (size - minimumExplosionSize) / (maximumExplosionSize - minimumExplosionSize); const minLife = 0.3; const maxLife = 1.0; const life = normalSize * (maxLife - minLife) + minLife; @@ -133,7 +126,7 @@ updateCallback: force, modelMatrix: modelMatrix, emitterModelMatrix: emitterModelMatrix, - }) + }), ); } @@ -176,9 +169,7 @@ const y = Cesium.Math.randomBetween(yMin, yMax); const z = Cesium.Math.randomBetween(zMin, zMax); const offset = new Cesium.Cartesian3(x, y, z); - const color = Cesium.Color.fromRandom( - colorOptions[i % colorOptions.length] - ); + const color = Cesium.Color.fromRandom(colorOptions[i % colorOptions.length]); const bursts = []; for (let j = 0; j < 3; ++j) { @@ -187,7 +178,7 @@ time: Cesium.Math.nextRandomNumber() * lifetime, minimum: burstSize, maximum: burstSize, - }) + }), ); } @@ -202,14 +193,12 @@ const toFireworks = Cesium.Cartesian3.subtract( emitterInitialLocation, cameraOffset, - new Cesium.Cartesian3() + new Cesium.Cartesian3(), ); Cesium.Cartesian3.normalize(toFireworks, toFireworks); const angle = Cesium.Math.PI_OVER_TWO - - Math.acos( - Cesium.Cartesian3.dot(toFireworks, Cesium.Cartesian3.UNIT_Z) - ); + Math.acos(Cesium.Cartesian3.dot(toFireworks, Cesium.Cartesian3.UNIT_Z)); camera.lookUp(angle); //Sandcastle_End }; diff --git a/Apps/Sandcastle/gallery/Particle System Tails.html b/Apps/Sandcastle/gallery/Particle System Tails.html index c3674b6a58f0..c854dc615b1c 100644 --- a/Apps/Sandcastle/gallery/Particle System Tails.html +++ b/Apps/Sandcastle/gallery/Particle System Tails.html @@ -1,4 +1,4 @@ - + @@ -7,14 +7,8 @@ name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no" /> - - + + Cesium Demo - + @@ -41,26 +32,19 @@ const viewer = new Cesium.Viewer("cesiumContainer", { shouldAnimate: true, }); - const planePosition = Cesium.Cartesian3.fromDegrees( - -75.59777, - 40.03883, - 800.0 - ); + const planePosition = Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883, 800.0); const particlesOffset = new Cesium.Cartesian3( -8.950115473940969, 34.852766731753945, - -30.235411095432937 + -30.235411095432937, ); const cameraLocation = Cesium.Cartesian3.add( planePosition, particlesOffset, - new Cesium.Cartesian3() + new Cesium.Cartesian3(), ); const resetCamera = function () { - viewer.camera.lookAt( - cameraLocation, - new Cesium.Cartesian3(-450, -300, 200) - ); + viewer.camera.lookAt(cameraLocation, new Cesium.Cartesian3(-450, -300, 200)); }; resetCamera(); @@ -82,14 +66,10 @@ } // Add plane to scene - const hpr = new Cesium.HeadingPitchRoll( - 0.0, - Cesium.Math.PI_OVER_TWO, - 0.0 - ); + const hpr = new Cesium.HeadingPitchRoll(0.0, Cesium.Math.PI_OVER_TWO, 0.0); const orientation = Cesium.Transforms.headingPitchRollQuaternion( planePosition, - hpr + hpr, ); const entity = viewer.entities.add({ model: { @@ -103,16 +83,16 @@ // creating particles model matrix const translationOffset = Cesium.Matrix4.fromTranslation( particlesOffset, - new Cesium.Matrix4() + new Cesium.Matrix4(), ); const translationOfPlane = Cesium.Matrix4.fromTranslation( planePosition, - new Cesium.Matrix4() + new Cesium.Matrix4(), ); const particlesModelMatrix = Cesium.Matrix4.multiplyTransformation( translationOfPlane, translationOffset, - new Cesium.Matrix4() + new Cesium.Matrix4(), ); // creating the particle systems @@ -186,37 +166,34 @@ scratchCartesian3 = Cesium.Cartesian3.normalize( particle.position, - new Cesium.Cartesian3() + new Cesium.Cartesian3(), ); scratchCartesian3 = Cesium.Cartesian3.multiplyByScalar( scratchCartesian3, -40.0 * dt, - scratchCartesian3 + scratchCartesian3, ); scratchCartesian3 = Cesium.Cartesian3.add( particle.position, scratchCartesian3, - scratchCartesian3 + scratchCartesian3, ); scratchCartographic = Cesium.Cartographic.fromCartesian( scratchCartesian3, Cesium.Ellipsoid.WGS84, - scratchCartographic + scratchCartographic, ); - const angle = - (Cesium.Math.PI * 2.0 * iteration) / options.numberOfSystems; + const angle = (Cesium.Math.PI * 2.0 * iteration) / options.numberOfSystems; iteration += options.iterationOffset; scratchCartographic.longitude += Math.cos(angle) * options.cartographicStep * 30.0 * dt; scratchCartographic.latitude += Math.sin(angle) * options.cartographicStep * 30.0 * dt; - particle.position = Cesium.Cartographic.toCartesian( - scratchCartographic - ); + particle.position = Cesium.Cartographic.toCartesian(scratchCartographic); }; }; @@ -227,19 +204,16 @@ function createParticleSystems(options, systemsArray) { const length = options.numberOfSystems; for (let i = 0; i < length; ++i) { - scratchAngleForOffset = - (Math.PI * 2.0 * i) / options.numberOfSystems; - scratchOffset.x += - options.baseRadius * Math.cos(scratchAngleForOffset); - scratchOffset.y += - options.baseRadius * Math.sin(scratchAngleForOffset); + scratchAngleForOffset = (Math.PI * 2.0 * i) / options.numberOfSystems; + scratchOffset.x += options.baseRadius * Math.cos(scratchAngleForOffset); + scratchOffset.y += options.baseRadius * Math.sin(scratchAngleForOffset); const emitterModelMatrix = Cesium.Matrix4.fromTranslation( scratchOffset, - matrix4Scratch + matrix4Scratch, ); const color = Cesium.Color.fromRandom( - options.colorOptions[i % options.colorOptions.length] + options.colorOptions[i % options.colorOptions.length], ); const force = forceFunction(options, i); @@ -257,7 +231,7 @@ updateCallback: force, modelMatrix: particlesModelMatrix, emitterModelMatrix: emitterModelMatrix, - }) + }), ); systemsArray.push(item); } diff --git a/Apps/Sandcastle/gallery/Particle System Weather.html b/Apps/Sandcastle/gallery/Particle System Weather.html index 81c76315c2ee..4e0315e5bf60 100644 --- a/Apps/Sandcastle/gallery/Particle System Weather.html +++ b/Apps/Sandcastle/gallery/Particle System Weather.html @@ -1,4 +1,4 @@ - + @@ -8,10 +8,7 @@ content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no" /> - + Cesium Demo - + @@ -47,7 +41,7 @@ destination: new Cesium.Cartesian3( 277096.634865404, 5647834.481964232, - 2985563.7039122293 + 2985563.7039122293, ), orientation: { heading: 4.731089976107251, @@ -62,31 +56,31 @@ const snowRadius = 100000.0; const minimumSnowImageSize = new Cesium.Cartesian2( snowParticleSize, - snowParticleSize + snowParticleSize, ); const maximumSnowImageSize = new Cesium.Cartesian2( snowParticleSize * 2.0, - snowParticleSize * 2.0 + snowParticleSize * 2.0, ); let snowGravityScratch = new Cesium.Cartesian3(); const snowUpdate = function (particle, dt) { snowGravityScratch = Cesium.Cartesian3.normalize( particle.position, - snowGravityScratch + snowGravityScratch, ); Cesium.Cartesian3.multiplyByScalar( snowGravityScratch, Cesium.Math.randomBetween(-30.0, -300.0), - snowGravityScratch + snowGravityScratch, ); particle.velocity = Cesium.Cartesian3.add( particle.velocity, snowGravityScratch, - particle.velocity + particle.velocity, ); const distance = Cesium.Cartesian3.distance( scene.camera.position, - particle.position + particle.position, ); if (distance > snowRadius) { particle.endColor.alpha = 0.0; @@ -100,29 +94,29 @@ const rainRadius = 100000.0; const rainImageSize = new Cesium.Cartesian2( rainParticleSize, - rainParticleSize * 2.0 + rainParticleSize * 2.0, ); let rainGravityScratch = new Cesium.Cartesian3(); const rainUpdate = function (particle, dt) { rainGravityScratch = Cesium.Cartesian3.normalize( particle.position, - rainGravityScratch + rainGravityScratch, ); rainGravityScratch = Cesium.Cartesian3.multiplyByScalar( rainGravityScratch, -1050.0, - rainGravityScratch + rainGravityScratch, ); particle.position = Cesium.Cartesian3.add( particle.position, rainGravityScratch, - particle.position + particle.position, ); const distance = Cesium.Cartesian3.distance( scene.camera.position, - particle.position + particle.position, ); if (distance > rainRadius) { particle.endColor.alpha = 0.0; @@ -139,9 +133,7 @@ scene.primitives.removeAll(); scene.primitives.add( new Cesium.ParticleSystem({ - modelMatrix: new Cesium.Matrix4.fromTranslation( - scene.camera.position - ), + modelMatrix: new Cesium.Matrix4.fromTranslation(scene.camera.position), minimumSpeed: -1.0, maximumSpeed: 0.0, lifetime: 15.0, @@ -155,7 +147,7 @@ minimumImageSize: minimumSnowImageSize, maximumImageSize: maximumSnowImageSize, updateCallback: snowUpdate, - }) + }), ); scene.skyAtmosphere.hueShift = -0.8; @@ -177,9 +169,7 @@ scene.primitives.removeAll(); scene.primitives.add( new Cesium.ParticleSystem({ - modelMatrix: new Cesium.Matrix4.fromTranslation( - scene.camera.position - ), + modelMatrix: new Cesium.Matrix4.fromTranslation(scene.camera.position), speed: -1.0, lifetime: 15.0, emitter: new Cesium.SphereEmitter(rainRadius), @@ -191,7 +181,7 @@ endColor: new Cesium.Color(0.27, 0.5, 0.7, 0.98), imageSize: rainImageSize, updateCallback: rainUpdate, - }) + }), ); scene.skyAtmosphere.hueShift = -0.97; diff --git a/Apps/Sandcastle/gallery/Particle System.html b/Apps/Sandcastle/gallery/Particle System.html index 163c9a214cda..c0e266a0f371 100644 --- a/Apps/Sandcastle/gallery/Particle System.html +++ b/Apps/Sandcastle/gallery/Particle System.html @@ -1,4 +1,4 @@ - + @@ -18,10 +18,7 @@ > - + @@ -39,10 +33,7 @@ shouldAnimate: true, }); - const position = Cesium.Cartesian3.fromDegrees( - -123.0744619, - 44.0503706 - ); + const position = Cesium.Cartesian3.fromDegrees(-123.0744619, 44.0503706); const url = "../../SampleData/models/CesiumMan/Cesium_Man.glb"; viewer.trackedEntity = viewer.entities.add({ name: url, @@ -52,21 +43,17 @@ }, }); - if ( - !Cesium.PostProcessStageLibrary.isSilhouetteSupported(viewer.scene) - ) { - window.alert( - "This browser does not support the silhouette post process." - ); + if (!Cesium.PostProcessStageLibrary.isSilhouetteSupported(viewer.scene)) { + window.alert("This browser does not support the silhouette post process."); } const stages = viewer.scene.postProcessStages; const silhouette = stages.add( - Cesium.PostProcessStageLibrary.createSilhouetteStage() + Cesium.PostProcessStageLibrary.createSilhouetteStage(), ); silhouette.uniforms.color = Cesium.Color.LIME; const blackAndWhite = stages.add( - Cesium.PostProcessStageLibrary.createBlackAndWhiteStage() + Cesium.PostProcessStageLibrary.createBlackAndWhiteStage(), ); blackAndWhite.uniforms.gradations = 5.0; diff --git a/Apps/Sandcastle/gallery/Physically-Based Materials.html b/Apps/Sandcastle/gallery/Physically-Based Materials.html index f1703793bd2e..9fbfe15631d2 100644 --- a/Apps/Sandcastle/gallery/Physically-Based Materials.html +++ b/Apps/Sandcastle/gallery/Physically-Based Materials.html @@ -1,4 +1,4 @@ - + @@ -21,10 +21,7 @@ > - + @@ -51,9 +48,7 @@ terrain: Cesium.Terrain.fromWorldTerrain(), }); - Sandcastle.addToggleButton("Shadows", viewer.shadows, function ( - checked - ) { + Sandcastle.addToggleButton("Shadows", viewer.shadows, function (checked) { viewer.shadows = checked; }); @@ -63,16 +58,13 @@ const position = new Cesium.Cartesian3( -1371108.6511167218, -5508684.080096612, - 2901825.449865087 + 2901825.449865087, ); const heading = Cesium.Math.toRadians(180); const pitch = Cesium.Math.toRadians(2); const roll = Cesium.Math.toRadians(-6); const hpr = new Cesium.HeadingPitchRoll(heading, pitch, roll); - const orientation = Cesium.Transforms.headingPitchRollQuaternion( - position, - hpr - ); + const orientation = Cesium.Transforms.headingPitchRollQuaternion(position, hpr); const entity = viewer.entities.add({ name: "truck", @@ -92,7 +84,7 @@ destination: new Cesium.Cartesian3( -1371203.1456494154, -5508700.033950869, - 2901802.2749172337 + 2901802.2749172337, ), orientation: { heading: Cesium.Math.toRadians(67.64973594265429), @@ -106,7 +98,7 @@ destination: new Cesium.Cartesian3( -1371214.9554156072, -5508700.8494476415, - 2901826.794611029 + 2901826.794611029, ), orientation: { heading: Cesium.Math.toRadians(80.5354269423926), @@ -120,7 +112,7 @@ destination: new Cesium.Cartesian3( -1371190.7755780201, -5508732.668834588, - 2901827.2625979027 + 2901827.2625979027, ), orientation: { heading: Cesium.Math.toRadians(68.29411482061157), @@ -134,7 +126,7 @@ destination: new Cesium.Cartesian3( -1371052.4616855076, -5508691.745389906, - 2901861.440673151 + 2901861.440673151, ), orientation: { heading: Cesium.Math.toRadians(236.4536374528137), @@ -156,40 +148,36 @@ text: "Front reflection", onselect: function () { viewer.scene.camera.flyTo(frontView); - viewer.clockViewModel.clock.currentTime = Cesium.JulianDate.fromIso8601( - "2017-07-11T20:00:00Z" - ); + viewer.clockViewModel.clock.currentTime = + Cesium.JulianDate.fromIso8601("2017-07-11T20:00:00Z"); }, }, { text: "Three quarters sunrise", onselect: function () { viewer.scene.camera.flyTo(threeQuartersView); - viewer.clockViewModel.clock.currentTime = Cesium.JulianDate.fromIso8601( - "2017-07-11T11:00:00Z" - ); + viewer.clockViewModel.clock.currentTime = + Cesium.JulianDate.fromIso8601("2017-07-11T11:00:00Z"); }, }, { text: "Top reflection", onselect: function () { viewer.scene.camera.flyTo(topView); - viewer.clockViewModel.clock.currentTime = Cesium.JulianDate.fromIso8601( - "2017-07-11T12:00:00Z" - ); + viewer.clockViewModel.clock.currentTime = + Cesium.JulianDate.fromIso8601("2017-07-11T12:00:00Z"); }, }, { text: "Upward angle side reflection", onselect: function () { viewer.scene.camera.flyTo(upwardsView); - viewer.clockViewModel.clock.currentTime = Cesium.JulianDate.fromIso8601( - "2017-07-11T23:00:00Z" - ); + viewer.clockViewModel.clock.currentTime = + Cesium.JulianDate.fromIso8601("2017-07-11T23:00:00Z"); }, }, ], - "toolbar" + "toolbar", ); //Sandcastle_End }; diff --git a/Apps/Sandcastle/gallery/Picking.html b/Apps/Sandcastle/gallery/Picking.html index 157c973b6072..939a265746f2 100644 --- a/Apps/Sandcastle/gallery/Picking.html +++ b/Apps/Sandcastle/gallery/Picking.html @@ -1,4 +1,4 @@ - + @@ -21,10 +21,7 @@ > - + @@ -66,17 +63,15 @@ handler.setInputAction(function (movement) { const cartesian = viewer.camera.pickEllipsoid( movement.endPosition, - scene.globe.ellipsoid + scene.globe.ellipsoid, ); if (cartesian) { - const cartographic = Cesium.Cartographic.fromCartesian( - cartesian - ); + const cartographic = Cesium.Cartographic.fromCartesian(cartesian); const longitudeString = Cesium.Math.toDegrees( - cartographic.longitude + cartographic.longitude, ).toFixed(2); const latitudeString = Cesium.Math.toDegrees( - cartographic.latitude + cartographic.latitude, ).toFixed(2); entity.position = cartesian; @@ -88,7 +83,7 @@ entity.label.show = false; } }, Cesium.ScreenSpaceEventType.MOUSE_MOVE); - } + }, ); Sandcastle.addToolbarButton("Pick Entity", function () { @@ -117,33 +112,20 @@ const pickedEntities = new Cesium.EntityCollection(); const pickColor = Cesium.Color.YELLOW.withAlpha(0.5); function makeProperty(entity, color) { - const colorProperty = new Cesium.CallbackProperty(function ( - time, - result - ) { + const colorProperty = new Cesium.CallbackProperty(function (time, result) { if (pickedEntities.contains(entity)) { return pickColor.clone(result); } return color.clone(result); - }, - false); + }, false); - entity.polygon.material = new Cesium.ColorMaterialProperty( - colorProperty - ); + entity.polygon.material = new Cesium.ColorMaterialProperty(colorProperty); } const red = viewer.entities.add({ polygon: { hierarchy: Cesium.Cartesian3.fromDegreesArray([ - -70.0, - 30.0, - -60.0, - 30.0, - -60.0, - 40.0, - -70.0, - 40.0, + -70.0, 30.0, -60.0, 30.0, -60.0, 40.0, -70.0, 40.0, ]), height: 0, }, @@ -153,14 +135,7 @@ const blue = viewer.entities.add({ polygon: { hierarchy: Cesium.Cartesian3.fromDegreesArray([ - -75.0, - 34.0, - -63.0, - 34.0, - -63.0, - 40.0, - -75.0, - 40.0, + -75.0, 34.0, -63.0, 34.0, -63.0, 40.0, -75.0, 40.0, ]), height: 0, }, @@ -170,14 +145,7 @@ const green = viewer.entities.add({ polygon: { hierarchy: Cesium.Cartesian3.fromDegreesArray([ - -67.0, - 36.0, - -55.0, - 36.0, - -55.0, - 30.0, - -67.0, - 30.0, + -67.0, 36.0, -55.0, 36.0, -55.0, 30.0, -67.0, 30.0, ]), height: 0, }, @@ -205,8 +173,7 @@ name: "milktruck", position: Cesium.Cartesian3.fromDegrees(-123.0744619, 44.0503706), model: { - uri: - "../../SampleData/models/CesiumMilkTruck/CesiumMilkTruck.glb", + uri: "../../SampleData/models/CesiumMilkTruck/CesiumMilkTruck.glb", }, }); viewer.zoomTo(modelEntity); @@ -230,19 +197,15 @@ const scene = viewer.scene; if (scene.mode !== Cesium.SceneMode.MORPHING) { if (scene.pickPositionSupported) { - const cartesian = viewer.scene.pickPosition( - movement.endPosition - ); + const cartesian = viewer.scene.pickPosition(movement.endPosition); if (Cesium.defined(cartesian)) { - const cartographic = Cesium.Cartographic.fromCartesian( - cartesian - ); + const cartographic = Cesium.Cartographic.fromCartesian(cartesian); const longitudeString = Cesium.Math.toDegrees( - cartographic.longitude + cartographic.longitude, ).toFixed(2); const latitudeString = Cesium.Math.toDegrees( - cartographic.latitude + cartographic.latitude, ).toFixed(2); const heightString = cartographic.height.toFixed(2); @@ -257,7 +220,7 @@ 0.0, 0.0, -cartographic.height * - (scene.mode === Cesium.SceneMode.SCENE2D ? 1.5 : 1.0) + (scene.mode === Cesium.SceneMode.SCENE2D ? 1.5 : 1.0), ); foundPosition = true; diff --git a/Apps/Sandcastle/gallery/Plane.html b/Apps/Sandcastle/gallery/Plane.html index 9def7814cbe0..56fff30f13e5 100644 --- a/Apps/Sandcastle/gallery/Plane.html +++ b/Apps/Sandcastle/gallery/Plane.html @@ -1,4 +1,4 @@ - + @@ -18,10 +18,7 @@ > - + diff --git a/Apps/Sandcastle/gallery/Points.html b/Apps/Sandcastle/gallery/Points.html index 5f8626910a09..57e81a71cc5f 100644 --- a/Apps/Sandcastle/gallery/Points.html +++ b/Apps/Sandcastle/gallery/Points.html @@ -1,4 +1,4 @@ - + @@ -18,10 +18,7 @@ > - + @@ -65,11 +62,7 @@ Sandcastle.declare(changePointProperties); const entity = viewer.entities.add({ - position: Cesium.Cartesian3.fromDegrees( - -75.59777, - 40.03883, - 300000.0 - ), + position: Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883, 300000.0), point: { pixelSize: 2, }, @@ -127,12 +120,7 @@ position: Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883), point: { pixelSize: 20, - translucencyByDistance: new Cesium.NearFarScalar( - 1.5e2, - 1.0, - 1.5e7, - 0.2 - ), + translucencyByDistance: new Cesium.NearFarScalar(1.5e2, 1.0, 1.5e7, 0.2), }, }); } diff --git a/Apps/Sandcastle/gallery/Polygon.html b/Apps/Sandcastle/gallery/Polygon.html index 1629c38b80c2..5d092754b07c 100644 --- a/Apps/Sandcastle/gallery/Polygon.html +++ b/Apps/Sandcastle/gallery/Polygon.html @@ -1,4 +1,4 @@ - + @@ -21,10 +21,7 @@ > - + @@ -41,16 +38,7 @@ name: "Red polygon on surface", polygon: { hierarchy: Cesium.Cartesian3.fromDegreesArray([ - -115.0, - 37.0, - -115.0, - 32.0, - -107.0, - 33.0, - -102.0, - 31.0, - -102.0, - 35.0, + -115.0, 37.0, -115.0, 32.0, -107.0, 33.0, -102.0, 31.0, -102.0, 35.0, ]), material: Cesium.Color.RED, }, @@ -60,12 +48,7 @@ name: "Green extruded polygon", polygon: { hierarchy: Cesium.Cartesian3.fromDegreesArray([ - -108.0, - 42.0, - -100.0, - 42.0, - -104.0, - 40.0, + -108.0, 42.0, -100.0, 42.0, -104.0, 40.0, ]), extrudedHeight: 500000.0, material: Cesium.Color.GREEN, @@ -75,25 +58,11 @@ }); const texturedPolygon = viewer.entities.add({ - name: - "Extruded textured polygon with per-position heights and custom texture coordinates", + name: "Extruded textured polygon with per-position heights and custom texture coordinates", polygon: { hierarchy: Cesium.Cartesian3.fromDegreesArrayHeights([ - -118.4, - 40.4, - 50000, - -118.4, - 37, - 30000, - -114.2, - 38.0, - 35000, - -108.0, - 37, - 30000, - -108.0, - 40.4, - 50000, + -118.4, 40.4, 50000, -118.4, 37, 30000, -114.2, 38.0, 35000, -108.0, 37, + 30000, -108.0, 40.4, 50000, ]), textureCoordinates: { positions: [ @@ -111,41 +80,17 @@ }); const texturedPolygonWithHoles = viewer.entities.add({ - name: - "Textured polygon with per-position heights, holes and custom texture coordinates", + name: "Textured polygon with per-position heights, holes and custom texture coordinates", polygon: { hierarchy: { positions: Cesium.Cartesian3.fromDegreesArrayHeights([ - -130, - 40.0, - 50000, - -130, - 36.0, - 30000, - -125, - 37, - 35000, - -120, - 36.0, - 30000, - -120, - 40.0, - 50000, + -130, 40.0, 50000, -130, 36.0, 30000, -125, 37, 35000, -120, 36.0, 30000, + -120, 40.0, 50000, ]), holes: [ { positions: Cesium.Cartesian3.fromDegreesArrayHeights([ - -128, - 39.2, - 46000, - -128, - 38.6, - 42000, - -127, - 38.6, - 42000, - -127, - 39.2, + -128, 39.2, 46000, -128, 38.6, 42000, -127, 38.6, 42000, -127, 39.2, 46000, ]), }, @@ -179,18 +124,8 @@ name: "Orange polygon with per-position heights and outline", polygon: { hierarchy: Cesium.Cartesian3.fromDegreesArrayHeights([ - -108.0, - 25.0, - 100000, - -100.0, - 25.0, - 100000, - -100.0, - 30.0, - 100000, - -108.0, - 30.0, - 300000, + -108.0, 25.0, 100000, -100.0, 25.0, 100000, -100.0, 30.0, 100000, -108.0, + 30.0, 300000, ]), extrudedHeight: 0, perPositionHeight: true, @@ -205,50 +140,22 @@ polygon: { hierarchy: { positions: Cesium.Cartesian3.fromDegreesArray([ - -99.0, - 30.0, - -85.0, - 30.0, - -85.0, - 40.0, - -99.0, - 40.0, + -99.0, 30.0, -85.0, 30.0, -85.0, 40.0, -99.0, 40.0, ]), holes: [ { positions: Cesium.Cartesian3.fromDegreesArray([ - -97.0, - 31.0, - -97.0, - 39.0, - -87.0, - 39.0, - -87.0, - 31.0, + -97.0, 31.0, -97.0, 39.0, -87.0, 39.0, -87.0, 31.0, ]), holes: [ { positions: Cesium.Cartesian3.fromDegreesArray([ - -95.0, - 33.0, - -89.0, - 33.0, - -89.0, - 37.0, - -95.0, - 37.0, + -95.0, 33.0, -89.0, 33.0, -89.0, 37.0, -95.0, 37.0, ]), holes: [ { positions: Cesium.Cartesian3.fromDegreesArray([ - -93.0, - 34.0, - -91.0, - 34.0, - -91.0, - 36.0, - -93.0, - 36.0, + -93.0, 34.0, -91.0, 34.0, -91.0, 36.0, -93.0, 36.0, ]), }, ], @@ -267,15 +174,7 @@ name: "Cyan vertical polygon with per-position heights and outline", polygon: { hierarchy: Cesium.Cartesian3.fromDegreesArrayHeights([ - -90.0, - 41.0, - 0.0, - -85.0, - 41.0, - 500000.0, - -80.0, - 41.0, - 0.0, + -90.0, 41.0, 0.0, -85.0, 41.0, 500000.0, -80.0, 41.0, 0.0, ]), perPositionHeight: true, material: Cesium.Color.CYAN.withAlpha(0.5), @@ -288,14 +187,7 @@ name: "Purple polygon using rhumb lines with outline", polygon: { hierarchy: Cesium.Cartesian3.fromDegreesArray([ - -120.0, - 45.0, - -80.0, - 45.0, - -80.0, - 55.0, - -120.0, - 55.0, + -120.0, 45.0, -80.0, 45.0, -80.0, 55.0, -120.0, 55.0, ]), extrudedHeight: 50000, material: Cesium.Color.PURPLE, diff --git a/Apps/Sandcastle/gallery/Polyline Dash.html b/Apps/Sandcastle/gallery/Polyline Dash.html index 39404d174301..37b5ff8a4be4 100644 --- a/Apps/Sandcastle/gallery/Polyline Dash.html +++ b/Apps/Sandcastle/gallery/Polyline Dash.html @@ -1,4 +1,4 @@ - + @@ -18,10 +18,7 @@ > - + @@ -38,12 +35,7 @@ name: "Red dashed line", polyline: { positions: Cesium.Cartesian3.fromDegreesArrayHeights([ - -75, - 38, - 250000, - -125, - 38, - 250000, + -75, 38, 250000, -125, 38, 250000, ]), width: 5, material: new Cesium.PolylineDashMaterialProperty({ @@ -56,12 +48,7 @@ name: "Wide blue dashed line with a gap color", polyline: { positions: Cesium.Cartesian3.fromDegreesArrayHeights([ - -75, - 40, - 250000, - -125, - 40, - 250000, + -75, 40, 250000, -125, 40, 250000, ]), width: 30, material: new Cesium.PolylineDashMaterialProperty({ @@ -75,12 +62,7 @@ name: "Orange dashed line with a short dash length", polyline: { positions: Cesium.Cartesian3.fromDegreesArrayHeights([ - -75, - 42, - 250000, - -125, - 42, - 250000, + -75, 42, 250000, -125, 42, 250000, ]), width: 5, material: new Cesium.PolylineDashMaterialProperty({ @@ -94,12 +76,7 @@ name: "Cyan dashed line with a dash pattern.", polyline: { positions: Cesium.Cartesian3.fromDegreesArrayHeights([ - -75, - 44, - 250000, - -125, - 44, - 250000, + -75, 44, 250000, -125, 44, 250000, ]), width: 10, material: new Cesium.PolylineDashMaterialProperty({ @@ -113,12 +90,7 @@ name: "Yellow dashed line with a dash pattern.", polyline: { positions: Cesium.Cartesian3.fromDegreesArrayHeights([ - -75, - 46, - 250000, - -125, - 46, - 250000, + -75, 46, 250000, -125, 46, 250000, ]), width: 10, material: new Cesium.PolylineDashMaterialProperty({ diff --git a/Apps/Sandcastle/gallery/Polyline Volume.html b/Apps/Sandcastle/gallery/Polyline Volume.html index ebe05f3354ff..c8beddec1b8c 100644 --- a/Apps/Sandcastle/gallery/Polyline Volume.html +++ b/Apps/Sandcastle/gallery/Polyline Volume.html @@ -1,4 +1,4 @@ - + @@ -21,10 +21,7 @@ > - + @@ -44,8 +41,8 @@ positions.push( new Cesium.Cartesian2( radius * Math.cos(radians), - radius * Math.sin(radians) - ) + radius * Math.sin(radians), + ), ); } return positions; @@ -59,7 +56,7 @@ const r = i % 2 === 0 ? rOuter : rInner; positions[i] = new Cesium.Cartesian2( Math.cos(i * angle) * r, - Math.sin(i * angle) * r + Math.sin(i * angle) * r, ); } return positions; @@ -69,12 +66,7 @@ name: "Red tube with rounded corners", polylineVolume: { positions: Cesium.Cartesian3.fromDegreesArray([ - -85.0, - 32.0, - -85.0, - 36.0, - -89.0, - 36.0, + -85.0, 32.0, -85.0, 36.0, -89.0, 36.0, ]), shape: computeCircle(60000.0), material: Cesium.Color.RED, @@ -85,15 +77,7 @@ name: "Green box with beveled corners and outline", polylineVolume: { positions: Cesium.Cartesian3.fromDegreesArrayHeights([ - -90.0, - 32.0, - 0.0, - -90.0, - 36.0, - 100000.0, - -94.0, - 36.0, - 0.0, + -90.0, 32.0, 0.0, -90.0, 36.0, 100000.0, -94.0, 36.0, 0.0, ]), shape: [ new Cesium.Cartesian2(-50000, -50000), @@ -112,15 +96,7 @@ name: "Blue star with mitered corners and outline", polylineVolume: { positions: Cesium.Cartesian3.fromDegreesArrayHeights([ - -95.0, - 32.0, - 0.0, - -95.0, - 36.0, - 100000.0, - -99.0, - 36.0, - 200000.0, + -95.0, 32.0, 0.0, -95.0, 36.0, 100000.0, -99.0, 36.0, 200000.0, ]), shape: computeStar(7, 70000, 50000), cornerType: Cesium.CornerType.MITERED, diff --git a/Apps/Sandcastle/gallery/Polyline.html b/Apps/Sandcastle/gallery/Polyline.html index 5cb479e116a8..3bbcc7d43dc2 100644 --- a/Apps/Sandcastle/gallery/Polyline.html +++ b/Apps/Sandcastle/gallery/Polyline.html @@ -1,4 +1,4 @@ - + @@ -21,10 +21,7 @@ > - + @@ -71,16 +68,10 @@ }); const orangeOutlined = viewer.entities.add({ - name: - "Orange line with black outline at height and following the surface", + name: "Orange line with black outline at height and following the surface", polyline: { positions: Cesium.Cartesian3.fromDegreesArrayHeights([ - -75, - 39, - 250000, - -125, - 39, - 250000, + -75, 39, 250000, -125, 39, 250000, ]), width: 5, material: new Cesium.PolylineOutlineMaterialProperty({ @@ -95,18 +86,11 @@ name: "Purple straight arrow at height", polyline: { positions: Cesium.Cartesian3.fromDegreesArrayHeights([ - -75, - 43, - 500000, - -125, - 43, - 500000, + -75, 43, 500000, -125, 43, 500000, ]), width: 10, arcType: Cesium.ArcType.NONE, - material: new Cesium.PolylineArrowMaterialProperty( - Cesium.Color.PURPLE - ), + material: new Cesium.PolylineArrowMaterialProperty(Cesium.Color.PURPLE), }, }); @@ -114,12 +98,7 @@ name: "Blue dashed line", polyline: { positions: Cesium.Cartesian3.fromDegreesArrayHeights([ - -75, - 45, - 500000, - -125, - 45, - 500000, + -75, 45, 500000, -125, 45, 500000, ]), width: 4, material: new Cesium.PolylineDashMaterialProperty({ diff --git a/Apps/Sandcastle/gallery/Polylines on 3D Tiles.html b/Apps/Sandcastle/gallery/Polylines on 3D Tiles.html index 6b85c768ceaa..135dae3579af 100644 --- a/Apps/Sandcastle/gallery/Polylines on 3D Tiles.html +++ b/Apps/Sandcastle/gallery/Polylines on 3D Tiles.html @@ -1,4 +1,4 @@ - + @@ -21,10 +21,7 @@ > - + @@ -39,15 +36,13 @@ const viewer = new Cesium.Viewer("cesiumContainer"); const scene = viewer.scene; - viewer.clock.currentTime = Cesium.JulianDate.fromIso8601( - "2022-08-01T00:00:00Z" - ); + viewer.clock.currentTime = Cesium.JulianDate.fromIso8601("2022-08-01T00:00:00Z"); scene.camera.setView({ destination: new Cesium.Cartesian3( 1234151.4883992162, -5086036.79436967, - 3633328.4278331124 + 3633328.4278331124, ), orientation: { heading: 5.593695742186853, @@ -108,12 +103,8 @@ const pipes = viewer.entities.add({ polyline: { positions: Cesium.Cartesian3.fromDegreesArray([ - -76.36053390920833, - 34.949935893493596, - -76.36055481641581, - 34.94993589886988, - -76.36055477047704, - 34.94992280693651, + -76.36053390920833, 34.949935893493596, -76.36055481641581, + 34.94993589886988, -76.36055477047704, 34.94992280693651, ]), width: 6, material: new Cesium.PolylineDashMaterialProperty({ @@ -138,15 +129,9 @@ const route = viewer.entities.add({ polyline: { positions: Cesium.Cartesian3.fromDegreesArray([ - -75.59604807301078, - 40.03948512841901, - -75.59644577413066, - 40.039316280505446, - -75.59584544997564, - 40.03846271524258, - -75.59661425371488, - 40.03814087821916, - -75.59664726332451, + -75.59604807301078, 40.03948512841901, -75.59644577413066, + 40.039316280505446, -75.59584544997564, 40.03846271524258, + -75.59661425371488, 40.03814087821916, -75.59664726332451, 40.03818297772907, ]), width: 6, @@ -178,7 +163,7 @@ destination: new Cesium.Cartesian3( 1234151.4883992162, -5086036.79436967, - 3633328.4278331124 + 3633328.4278331124, ), orientation: { heading: 5.593695742186853, @@ -206,7 +191,7 @@ destination: new Cesium.Cartesian3( 1216596.5376729995, -4736445.416889214, - 4081406.990364228 + 4081406.990364228, ), orientation: { heading: 5.153176564030707, diff --git a/Apps/Sandcastle/gallery/Post Processing.html b/Apps/Sandcastle/gallery/Post Processing.html index ad33bb13c0cc..3a8ceecf5b27 100644 --- a/Apps/Sandcastle/gallery/Post Processing.html +++ b/Apps/Sandcastle/gallery/Post Processing.html @@ -1,4 +1,4 @@ - + @@ -8,10 +8,7 @@ content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no" /> - + Cesium Demo - + @@ -84,10 +78,7 @@ shouldAnimate: true, }); - const position = Cesium.Cartesian3.fromDegrees( - -123.0744619, - 44.0503706 - ); + const position = Cesium.Cartesian3.fromDegrees(-123.0744619, 44.0503706); const url = "../../SampleData/models/CesiumMan/Cesium_Man.glb"; viewer.trackedEntity = viewer.entities.add({ name: url, @@ -111,41 +102,33 @@ Cesium.knockout.applyBindings(viewModel, toolbar); for (const name in viewModel) { if (viewModel.hasOwnProperty(name)) { - Cesium.knockout - .getObservable(viewModel, name) - .subscribe(updatePostProcess); + Cesium.knockout.getObservable(viewModel, name).subscribe(updatePostProcess); } } - if ( - !Cesium.PostProcessStageLibrary.isSilhouetteSupported(viewer.scene) - ) { - window.alert( - "This browser does not support the silhouette post process." - ); + if (!Cesium.PostProcessStageLibrary.isSilhouetteSupported(viewer.scene)) { + window.alert("This browser does not support the silhouette post process."); } const stages = viewer.scene.postProcessStages; const silhouette = stages.add( - Cesium.PostProcessStageLibrary.createSilhouetteStage() + Cesium.PostProcessStageLibrary.createSilhouetteStage(), ); const blackAndWhite = stages.add( - Cesium.PostProcessStageLibrary.createBlackAndWhiteStage() + Cesium.PostProcessStageLibrary.createBlackAndWhiteStage(), ); const brightness = stages.add( - Cesium.PostProcessStageLibrary.createBrightnessStage() + Cesium.PostProcessStageLibrary.createBrightnessStage(), ); const nightVision = stages.add( - Cesium.PostProcessStageLibrary.createNightVisionStage() + Cesium.PostProcessStageLibrary.createNightVisionStage(), ); function updatePostProcess() { silhouette.enabled = Boolean(viewModel.silhouette); silhouette.uniforms.color = Cesium.Color.YELLOW; blackAndWhite.enabled = Boolean(viewModel.blackAndWhiteShow); - blackAndWhite.uniforms.gradations = Number( - viewModel.blackAndWhiteGradations - ); + blackAndWhite.uniforms.gradations = Number(viewModel.blackAndWhiteGradations); brightness.enabled = Boolean(viewModel.brightnessShow); brightness.uniforms.brightness = Number(viewModel.brightnessValue); nightVision.enabled = Boolean(viewModel.nightVisionShow); diff --git a/Apps/Sandcastle/gallery/Procedural Terrain.html b/Apps/Sandcastle/gallery/Procedural Terrain.html index c09fa8d923bb..ac3b11eb7452 100644 --- a/Apps/Sandcastle/gallery/Procedural Terrain.html +++ b/Apps/Sandcastle/gallery/Procedural Terrain.html @@ -1,4 +1,4 @@ - + @@ -18,10 +18,7 @@ > - + @@ -96,8 +93,7 @@ const u = (x + xx / (width - 1)) / Math.pow(2, level); const v = (y + yy / (height - 1)) / Math.pow(2, level); - const heightValue = - 9000 * terrainNoise(u * 1750 - 10, v * 1500); + const heightValue = 9000 * terrainNoise(u * 1750 - 10, v * 1500); const index = yy * width + xx; buffer[index] = heightValue; @@ -151,12 +147,12 @@ destination: new Cesium.Cartesian3( 339907.1874329616, 5654554.279066735, - 2936259.008266917 + 2936259.008266917, ), orientation: new Cesium.HeadingPitchRoll( 5.473742192009368, -0.2225518333236931, - 6.28274245960864 + 6.28274245960864, ), }); diff --git a/Apps/Sandcastle/gallery/Projection.html b/Apps/Sandcastle/gallery/Projection.html index db56148bbc8c..5b3b8b9ce59f 100644 --- a/Apps/Sandcastle/gallery/Projection.html +++ b/Apps/Sandcastle/gallery/Projection.html @@ -1,4 +1,4 @@ - + @@ -21,10 +21,7 @@ > - + @@ -43,20 +40,9 @@ // start with orthographic projection viewer.projectionPicker.viewModel.switchToOrthographic(); - const position = Cesium.Cartesian3.fromDegrees( - -123.0744619, - 44.0503706, - 0.0 - ); - const hpr = new Cesium.HeadingPitchRoll( - Cesium.Math.toRadians(135), - 0.0, - 0.0 - ); - const orientation = Cesium.Transforms.headingPitchRollQuaternion( - position, - hpr - ); + const position = Cesium.Cartesian3.fromDegrees(-123.0744619, 44.0503706, 0.0); + const hpr = new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(135), 0.0, 0.0); + const orientation = Cesium.Transforms.headingPitchRollQuaternion(position, hpr); const entity = viewer.entities.add({ position: position, diff --git a/Apps/Sandcastle/gallery/Rectangle.html b/Apps/Sandcastle/gallery/Rectangle.html index 675f9750034b..8c2e02d18391 100644 --- a/Apps/Sandcastle/gallery/Rectangle.html +++ b/Apps/Sandcastle/gallery/Rectangle.html @@ -1,4 +1,4 @@ - + @@ -21,10 +21,7 @@ > - + @@ -40,26 +37,15 @@ const redRectangle = viewer.entities.add({ name: "Red translucent rectangle", rectangle: { - coordinates: Cesium.Rectangle.fromDegrees( - -110.0, - 20.0, - -80.0, - 25.0 - ), + coordinates: Cesium.Rectangle.fromDegrees(-110.0, 20.0, -80.0, 25.0), material: Cesium.Color.RED.withAlpha(0.5), }, }); const greenRectangle = viewer.entities.add({ - name: - "Green translucent, rotated, and extruded rectangle at height with outline", + name: "Green translucent, rotated, and extruded rectangle at height with outline", rectangle: { - coordinates: Cesium.Rectangle.fromDegrees( - -110.0, - 30.0, - -100.0, - 40.0 - ), + coordinates: Cesium.Rectangle.fromDegrees(-110.0, 30.0, -100.0, 40.0), material: Cesium.Color.GREEN.withAlpha(0.5), rotation: Cesium.Math.toRadians(45), extrudedHeight: 300000.0, diff --git a/Apps/Sandcastle/gallery/Resolution Scaling.html b/Apps/Sandcastle/gallery/Resolution Scaling.html index 4cd03e6b44d8..da1c5c8afc56 100644 --- a/Apps/Sandcastle/gallery/Resolution Scaling.html +++ b/Apps/Sandcastle/gallery/Resolution Scaling.html @@ -1,4 +1,4 @@ - + @@ -21,10 +21,7 @@ > - + diff --git a/Apps/Sandcastle/gallery/Rotatable 2D Map.html b/Apps/Sandcastle/gallery/Rotatable 2D Map.html index 3321a1020146..d278a92753a5 100644 --- a/Apps/Sandcastle/gallery/Rotatable 2D Map.html +++ b/Apps/Sandcastle/gallery/Rotatable 2D Map.html @@ -1,4 +1,4 @@ - + @@ -7,10 +7,7 @@ name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no" /> - + Cesium Demo @@ -21,10 +18,7 @@ > - + diff --git a/Apps/Sandcastle/gallery/Sample Height from 3D Tiles.html b/Apps/Sandcastle/gallery/Sample Height from 3D Tiles.html index 7d563a6b72c0..01b4da3f5c64 100644 --- a/Apps/Sandcastle/gallery/Sample Height from 3D Tiles.html +++ b/Apps/Sandcastle/gallery/Sample Height from 3D Tiles.html @@ -1,4 +1,4 @@ - + @@ -21,10 +21,7 @@ > - + @@ -41,21 +38,19 @@ const scene = viewer.scene; if (!scene.clampToHeightSupported) { - window.alert( - "This browser does not support clampToHeightMostDetailed." - ); + window.alert("This browser does not support clampToHeightMostDetailed."); } scene.camera.setView({ destination: new Cesium.Cartesian3( 1216411.0748779264, -4736313.10747583, - 4081359.5125561724 + 4081359.5125561724, ), orientation: new Cesium.HeadingPitchRoll( 4.239925103568368, -0.4911293834802475, - 6.279849292088564 + 6.279849292088564, ), endTransform: Cesium.Matrix4.IDENTITY, }); @@ -73,12 +68,12 @@ const cartesian1 = new Cesium.Cartesian3( 1216390.063324395, -4736314.814479433, - 4081341.9787972216 + 4081341.9787972216, ); const cartesian2 = new Cesium.Cartesian3( 1216329.5413318684, -4736272.029009798, - 4081407.9342479417 + 4081407.9342479417, ); const count = 30; @@ -89,13 +84,11 @@ cartesian1, cartesian2, offset, - new Cesium.Cartesian3() + new Cesium.Cartesian3(), ); } - const clampedCartesians = await scene.clampToHeightMostDetailed( - cartesians - ); + const clampedCartesians = await scene.clampToHeightMostDetailed(cartesians); for (let i = 0; i < count; ++i) { viewer.entities.add({ diff --git a/Apps/Sandcastle/gallery/Scene Rendering Performance.html b/Apps/Sandcastle/gallery/Scene Rendering Performance.html index 028cb0f6ac9f..db130f98358a 100644 --- a/Apps/Sandcastle/gallery/Scene Rendering Performance.html +++ b/Apps/Sandcastle/gallery/Scene Rendering Performance.html @@ -1,4 +1,4 @@ - + @@ -21,10 +21,7 @@ > - + @@ -38,7 +35,7 @@ // Sentinel-2 (mostly) cloudless global imagery between 10 and 60 meter resolution. const viewer = new Cesium.Viewer("cesiumContainer", { baseLayer: Cesium.ImageryLayer.fromProviderAsync( - Cesium.IonImageryProvider.fromAssetId(3954) + Cesium.IonImageryProvider.fromAssetId(3954), ), }); //Sandcastle_End diff --git a/Apps/Sandcastle/gallery/Shadows.html b/Apps/Sandcastle/gallery/Shadows.html index 676b184c1149..92ab1573a711 100644 --- a/Apps/Sandcastle/gallery/Shadows.html +++ b/Apps/Sandcastle/gallery/Shadows.html @@ -1,4 +1,4 @@ - + @@ -18,10 +18,7 @@ > - + diff --git a/Apps/Sandcastle/gallery/Spheres and Ellipsoids.html b/Apps/Sandcastle/gallery/Spheres and Ellipsoids.html index c7a477d501bb..8f8a78064eda 100644 --- a/Apps/Sandcastle/gallery/Spheres and Ellipsoids.html +++ b/Apps/Sandcastle/gallery/Spheres and Ellipsoids.html @@ -1,4 +1,4 @@ - + @@ -18,10 +18,7 @@ > - + diff --git a/Apps/Sandcastle/gallery/SplitDirection.html b/Apps/Sandcastle/gallery/SplitDirection.html index 9afc74a99854..65430d759424 100644 --- a/Apps/Sandcastle/gallery/SplitDirection.html +++ b/Apps/Sandcastle/gallery/SplitDirection.html @@ -1,4 +1,4 @@ - + @@ -16,10 +16,7 @@ - + @@ -97,7 +94,7 @@ magnitude, lines, billboardEyeOffsets, - labelEyeOffsets + labelEyeOffsets, ) { const x = magnitude * Math.cos(angle); const y = magnitude * Math.sin(angle); @@ -111,7 +108,7 @@ const diff = Cesium.Cartesian3.subtract( entityPosition, camera.positionWC, - new Cesium.Cartesian3() + new Cesium.Cartesian3(), ); const distance = Cesium.Cartesian3.dot(camera.directionWC, diff); @@ -120,12 +117,12 @@ drawingBufferHeight, distance, pixelRatio, - new Cesium.Cartesian2() + new Cesium.Cartesian2(), ); Cesium.Cartesian2.multiplyByScalar( offset, Cesium.Cartesian2.maximumComponent(dimensions), - offset + offset, ); let labelOffset; @@ -135,24 +132,16 @@ entity.billboard.eyeOffset = eyeOffset; if (Cesium.defined(entity.label)) { labelOffset = entity.label.eyeOffset; - entity.label.eyeOffset = new Cesium.Cartesian3( - offset.x, - offset.y, - -10.0 - ); + entity.label.eyeOffset = new Cesium.Cartesian3(offset.x, offset.y, -10.0); } const endPoint = Cesium.Matrix4.multiplyByPoint( camera.viewMatrix, entityPosition, - new Cesium.Cartesian3() + new Cesium.Cartesian3(), ); Cesium.Cartesian3.add(eyeOffset, endPoint, endPoint); - Cesium.Matrix4.multiplyByPoint( - camera.inverseViewMatrix, - endPoint, - endPoint - ); + Cesium.Matrix4.multiplyByPoint(camera.inverseViewMatrix, endPoint, endPoint); lines.push(endPoint); billboardEyeOffsets.push(billboardOffset); @@ -206,9 +195,7 @@ while (i < length) { let object = billboardEntities[i]; if (pickedEntities.length === 0) { - starBurstState.center = Cesium.Cartesian3.clone( - object.primitive.position - ); + starBurstState.center = Cesium.Cartesian3.clone(object.primitive.position); } if (!Cesium.defined(angleIncrease)) { @@ -229,7 +216,7 @@ magnitude, lines, billboardEyeOffsets, - labelEyeOffsets + labelEyeOffsets, ); pickedEntities.push(object); @@ -246,16 +233,13 @@ magnitude, lines, billboardEyeOffsets, - labelEyeOffsets + labelEyeOffsets, ); pickedEntities.push(object); } angle += angleIncrease; - if ( - reflectedAngle - angleIncrease * 0.5 < - angle + angleIncrease * 0.5 - ) { + if (reflectedAngle - angleIncrease * 0.5 < angle + angleIncrease * 0.5) { magnitude += magIncrease; angle = angleStart; angleIncrease = maxDimension / magnitude; @@ -272,7 +256,7 @@ starBurstState.maxDimension = Math.max( pickedEntity.primitive.width, pickedEntity.primitive.height, - starBurstState.maxDimension + starBurstState.maxDimension, ); instances.push( @@ -284,10 +268,10 @@ }), attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.WHITE + Cesium.Color.WHITE, ), }, - }) + }), ); } @@ -299,7 +283,7 @@ translucent: false, }), asynchronous: false, - }) + }), ); viewer.selectedEntity = undefined; @@ -322,12 +306,12 @@ // If the mouse is inside the circle, show the label of the billboard the mouse is hovering over. const screenPosition = Cesium.SceneTransforms.worldToWindowCoordinates( scene, - starBurstState.center + starBurstState.center, ); const fromCenter = Cesium.Cartesian2.subtract( mousePosition, screenPosition, - new Cesium.Cartesian2() + new Cesium.Cartesian2(), ); const radius = starBurstState.radius; @@ -390,10 +374,7 @@ } if (pickedObject !== currentObject) { - if ( - Cesium.defined(pickedObject) && - Cesium.defined(pickedObject.id.label) - ) { + if (Cesium.defined(pickedObject) && Cesium.defined(pickedObject.id.label)) { if (Cesium.defined(currentObject)) { currentObject.id.label.show = false; } diff --git a/Apps/Sandcastle/gallery/Terrain Clipping Planes.html b/Apps/Sandcastle/gallery/Terrain Clipping Planes.html index a31336922fad..0bc6d6d74ea1 100644 --- a/Apps/Sandcastle/gallery/Terrain Clipping Planes.html +++ b/Apps/Sandcastle/gallery/Terrain Clipping Planes.html @@ -1,4 +1,4 @@ - + @@ -7,10 +7,7 @@ name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no" /> - + Cesium Demo @@ -21,10 +18,7 @@ > - + @@ -50,9 +44,7 @@ viewer.scene.globe.enableLighting = true; // adjust time so scene is lit by sun - viewer.clock.currentTime = Cesium.JulianDate.fromIso8601( - "2023-01-01T00:00:00" - ); + viewer.clock.currentTime = Cesium.JulianDate.fromIso8601("2023-01-01T00:00:00"); // setup alternative terrain providers const ellipsoidProvider = new Cesium.EllipsoidTerrainProvider(); @@ -60,31 +52,29 @@ // Sine wave const customHeightmapWidth = 32; const customHeightmapHeight = 32; - const customHeightmapProvider = new Cesium.CustomHeightmapTerrainProvider( - { - width: customHeightmapWidth, - height: customHeightmapHeight, - callback: function (x, y, level) { - const width = customHeightmapWidth; - const height = customHeightmapHeight; - const buffer = new Float32Array(width * height); + const customHeightmapProvider = new Cesium.CustomHeightmapTerrainProvider({ + width: customHeightmapWidth, + height: customHeightmapHeight, + callback: function (x, y, level) { + const width = customHeightmapWidth; + const height = customHeightmapHeight; + const buffer = new Float32Array(width * height); - for (let yy = 0; yy < height; yy++) { - for (let xx = 0; xx < width; xx++) { - const u = (x + xx / (width - 1)) / Math.pow(2, level); - const v = (y + yy / (height - 1)) / Math.pow(2, level); + for (let yy = 0; yy < height; yy++) { + for (let xx = 0; xx < width; xx++) { + const u = (x + xx / (width - 1)) / Math.pow(2, level); + const v = (y + yy / (height - 1)) / Math.pow(2, level); - const heightValue = 4000 * (Math.sin(8000 * v) * 0.5 + 0.5); + const heightValue = 4000 * (Math.sin(8000 * v) * 0.5 + 0.5); - const index = yy * width + xx; - buffer[index] = heightValue; - } + const index = yy * width + xx; + buffer[index] = heightValue; } + } - return buffer; - }, - } - ); + return buffer; + }, + }); Sandcastle.addToolbarMenu( [ @@ -95,7 +85,7 @@ Cesium.Terrain.fromWorldTerrain({ requestWaterMask: true, requestVertexNormals: true, - }) + }), ); viewer.scene.globe.enableLighting = true; }, @@ -112,7 +102,7 @@ viewer.scene.setTerrain( Cesium.Terrain.fromWorldTerrain({ requestVertexNormals: true, - }) + }), ); viewer.scene.globe.enableLighting = true; }, @@ -123,7 +113,7 @@ viewer.scene.setTerrain( Cesium.Terrain.fromWorldTerrain({ requestWaterMask: true, - }) + }), ); }, }, @@ -148,9 +138,9 @@ "http://www.vr-theworld.com/vr-theworld/tiles1.0.0/73/", { credit: "Terrain data courtesy VT MÄK", - } - ) - ) + }, + ), + ), ); }, }, @@ -160,14 +150,14 @@ viewer.scene.setTerrain( new Cesium.Terrain( Cesium.ArcGISTiledElevationTerrainProvider.fromUrl( - "https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer" - ) - ) + "https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer", + ), + ), ); }, }, ], - "terrainMenu" + "terrainMenu", ); Sandcastle.addDefaultToolbarMenu( @@ -184,12 +174,12 @@ const target = new Cesium.Cartesian3( -2489625.0836225147, -4393941.44443024, - 3882535.9454173897 + 3882535.9454173897, ); const offset = new Cesium.Cartesian3( -6857.40902037546, 412.3284835694358, - 2147.5545426812023 + 2147.5545426812023, ); viewer.camera.lookAt(target, offset); viewer.camera.lookAtTransform(Cesium.Matrix4.IDENTITY); @@ -201,19 +191,19 @@ const target = new Cesium.Cartesian3( -2708814.85583248, -4254159.450845907, - 3891403.9457429945 + 3891403.9457429945, ); const offset = new Cesium.Cartesian3( 70642.66030209465, -31661.517948317807, - 35505.179997143336 + 35505.179997143336, ); viewer.camera.lookAt(target, offset); viewer.camera.lookAtTransform(Cesium.Matrix4.IDENTITY); }, }, ], - "zoomButtons" + "zoomButtons", ); let terrainSamplePositions; @@ -222,12 +212,12 @@ const target = new Cesium.Cartesian3( 300770.50872389384, 5634912.131394585, - 2978152.2865545116 + 2978152.2865545116, ); const offset = new Cesium.Cartesian3( 6344.974098678562, -793.3419798081741, - 2499.9508860763162 + 2499.9508860763162, ); viewer.camera.lookAt(target, offset); viewer.camera.lookAtTransform(Cesium.Matrix4.IDENTITY); @@ -279,21 +269,13 @@ everestLongitude - rectangleHalfSize, everestLatitude - rectangleHalfSize, everestLongitude + rectangleHalfSize, - everestLatitude + rectangleHalfSize + everestLatitude + rectangleHalfSize, ); const terrainSamplePositions = []; for (let y = 0; y < gridHeight; ++y) { for (let x = 0; x < gridWidth; ++x) { - const longitude = Cesium.Math.lerp( - e.west, - e.east, - x / (gridWidth - 1) - ); - const latitude = Cesium.Math.lerp( - e.south, - e.north, - y / (gridHeight - 1) - ); + const longitude = Cesium.Math.lerp(e.west, e.east, x / (gridWidth - 1)); + const latitude = Cesium.Math.lerp(e.south, e.north, y / (gridHeight - 1)); const position = new Cesium.Cartographic(longitude, latitude); terrainSamplePositions.push(position); } @@ -306,7 +288,7 @@ viewer.scene.globe.enableLighting, function (checked) { viewer.scene.globe.enableLighting = checked; - } + }, ); Sandcastle.addToggleButton( @@ -314,7 +296,7 @@ viewer.scene.fog.enabled, function (checked) { viewer.scene.fog.enabled = checked; - } + }, ); Sandcastle.addToolbarButton( @@ -322,15 +304,11 @@ function () { const terrainSamplePositions = createGrid(0.005); Promise.resolve( - Cesium.sampleTerrain( - viewer.terrainProvider, - 9, - terrainSamplePositions - ) + Cesium.sampleTerrain(viewer.terrainProvider, 9, terrainSamplePositions), ).then(sampleTerrainSuccess); lookAtMtEverest(); }, - "sampleButtons" + "sampleButtons", ); Sandcastle.addToolbarButton( @@ -338,7 +316,7 @@ function () { if (!Cesium.defined(viewer.terrainProvider.availability)) { window.alert( - "sampleTerrainMostDetailed is not supported for the selected terrain provider" + "sampleTerrainMostDetailed is not supported for the selected terrain provider", ); return; } @@ -346,12 +324,12 @@ Promise.resolve( Cesium.sampleTerrainMostDetailed( viewer.terrainProvider, - terrainSamplePositions - ) + terrainSamplePositions, + ), ).then(sampleTerrainSuccess); lookAtMtEverest(); }, - "sampleButtons" + "sampleButtons", ); //Sandcastle_End }; diff --git a/Apps/Sandcastle/gallery/Time Dynamic Point Cloud.html b/Apps/Sandcastle/gallery/Time Dynamic Point Cloud.html index b1e8c9c48b9d..29f7f588d4be 100644 --- a/Apps/Sandcastle/gallery/Time Dynamic Point Cloud.html +++ b/Apps/Sandcastle/gallery/Time Dynamic Point Cloud.html @@ -1,4 +1,4 @@ - + @@ -21,10 +21,7 @@ > - + @@ -66,7 +63,7 @@ { iso8601Dates: dates, dataCallback: dataCallback, - } + }, ); const pointCloud = new Cesium.TimeDynamicPointCloud({ @@ -89,10 +86,7 @@ clock.stopTime = stop; clock.clockRange = Cesium.ClockRange.LOOP_STOP; - viewer.zoomTo( - pointCloud, - new Cesium.HeadingPitchRange(0.0, -0.5, 50.0) - ); + viewer.zoomTo(pointCloud, new Cesium.HeadingPitchRange(0.0, -0.5, 50.0)); //Sandcastle_End }; if (typeof Cesium !== "undefined") { diff --git a/Apps/Sandcastle/gallery/Time Dynamic Wheels.html b/Apps/Sandcastle/gallery/Time Dynamic Wheels.html index a860726eeac3..72e4aca8a98a 100644 --- a/Apps/Sandcastle/gallery/Time Dynamic Wheels.html +++ b/Apps/Sandcastle/gallery/Time Dynamic Wheels.html @@ -1,4 +1,4 @@ - + @@ -21,10 +21,7 @@ > - + @@ -45,7 +42,7 @@ const stop = Cesium.JulianDate.addSeconds( start, totalSeconds, - new Cesium.JulianDate() + new Cesium.JulianDate(), ); viewer.clock.startTime = start.clone(); viewer.clock.stopTime = stop.clone(); @@ -58,18 +55,15 @@ const startPosition = new Cesium.Cartesian3( -2379556.799372864, -4665528.205030263, - 3628013.106599678 + 3628013.106599678, ); const endPosition = new Cesium.Cartesian3( -2379603.7074103747, -4665623.48990283, - 3627860.82704567 + 3627860.82704567, ); // A velocity vector property will give us the entity's speed and direction at any given time. - const velocityVectorProperty = new Cesium.VelocityVectorProperty( - position, - false - ); + const velocityVectorProperty = new Cesium.VelocityVectorProperty(position, false); const velocityVector = new Cesium.Cartesian3(); // Store the wheel's rotation over time in a SampledProperty. const wheelAngleProperty = new Cesium.SampledProperty(Number); @@ -81,7 +75,7 @@ const time = Cesium.JulianDate.addSeconds( start, factor * totalSeconds, - new Cesium.JulianDate() + new Cesium.JulianDate(), ); // Lerp using a non-linear factor so that the vehicle accelerates. @@ -90,7 +84,7 @@ startPosition, endPosition, locationFactor, - new Cesium.Cartesian3() + new Cesium.Cartesian3(), ); position.addSample(time, location); // Rotate the wheels based on how fast the vehicle is moving at each timestep. @@ -101,8 +95,7 @@ const rotationsPerSecond = metersPerSecond / circumference; wheelAngle += - ((Math.PI * 2 * totalSeconds) / numberOfSamples) * - rotationsPerSecond; + ((Math.PI * 2 * totalSeconds) / numberOfSamples) * rotationsPerSecond; wheelAngleProperty.addSample(time, wheelAngle); } @@ -114,17 +107,13 @@ return `${kmPerHour} km/hr`; } - const rotationProperty = new Cesium.CallbackProperty(function ( - time, - result - ) { + const rotationProperty = new Cesium.CallbackProperty(function (time, result) { return Cesium.Quaternion.fromAxisAngle( Cesium.Cartesian3.UNIT_X, wheelAngleProperty.getValue(time), - result + result, ); - }, - false); + }, false); const wheelTransformation = new Cesium.NodeTransformationProperty({ rotation: rotationProperty, @@ -149,10 +138,7 @@ text: new Cesium.CallbackProperty(updateSpeedLabel, false), font: "20px sans-serif", showBackground: true, - distanceDisplayCondition: new Cesium.DistanceDisplayCondition( - 0.0, - 100.0 - ), + distanceDisplayCondition: new Cesium.DistanceDisplayCondition(0.0, 100.0), eyeOffset: new Cesium.Cartesian3(0, 3.5, 0), }, }); diff --git a/Apps/Sandcastle/gallery/Underground Color.html b/Apps/Sandcastle/gallery/Underground Color.html index d6d53f3fa848..ef52899aa286 100644 --- a/Apps/Sandcastle/gallery/Underground Color.html +++ b/Apps/Sandcastle/gallery/Underground Color.html @@ -1,4 +1,4 @@ - + @@ -21,10 +21,7 @@ > - + @@ -35,8 +32,8 @@ const viewer = new Cesium.Viewer("cesiumContainer", { baseLayer: Cesium.ImageryLayer.fromProviderAsync( Cesium.TileMapServiceImageryProvider.fromUrl( - Cesium.buildModuleUrl("Assets/Textures/NaturalEarthII") - ) + Cesium.buildModuleUrl("Assets/Textures/NaturalEarthII"), + ), ), baseLayerPicker: false, geocoder: false, @@ -59,9 +56,7 @@ const scratchColor = new Cesium.Color(); - ProceduralSingleTileVoxelProvider.prototype.requestData = function ( - options - ) { + ProceduralSingleTileVoxelProvider.prototype.requestData = function (options) { if (options.tileLevel >= 1) { return undefined; } @@ -78,8 +73,7 @@ for (let z = 0; z < dimensions.z; z++) { for (let y = 0; y < dimensions.y; y++) { - const indexZY = - z * dimensions.y * dimensions.x + y * dimensions.x; + const indexZY = z * dimensions.y * dimensions.x + y * dimensions.x; for (let x = 0; x < dimensions.x; x++) { const lerperX = x / (dimensions.x - 1); const lerperY = y / (dimensions.y - 1); @@ -117,9 +111,7 @@ this._allVoxelData = new Array(this._levelCount); const allVoxelData = this._allVoxelData; - const channelCount = Cesium.MetadataType.getComponentCount( - this.types[0] - ); + const channelCount = Cesium.MetadataType.getComponentCount(this.types[0]); const { dimensions } = this; for (let level = 0; level < this._levelCount; level++) { @@ -129,7 +121,7 @@ const voxelCountZ = dimensions.z * dimAtLevel; const voxelsPerLevel = voxelCountX * voxelCountY * voxelCountZ; const levelData = (allVoxelData[level] = new Array( - voxelsPerLevel * channelCount + voxelsPerLevel * channelCount, )); for (let z = 0; z < voxelCountX; z++) { @@ -147,9 +139,7 @@ } } - ProceduralMultiTileVoxelProvider.prototype.requestData = function ( - options - ) { + ProceduralMultiTileVoxelProvider.prototype.requestData = function (options) { const { tileLevel, tileX, tileY, tileZ } = options; if (tileLevel >= this._levelCount) { @@ -162,28 +152,25 @@ const paddedDimensions = Cesium.Cartesian3.fromElements( dimensions.x + paddingBefore.x + paddingAfter.x, dimensions.y + paddingBefore.y + paddingAfter.y, - dimensions.z + paddingBefore.z + paddingAfter.z + dimensions.z + paddingBefore.z + paddingAfter.z, ); const dimAtLevel = Math.pow(2, tileLevel); const dimensionsGlobal = Cesium.Cartesian3.fromElements( dimensions.x * dimAtLevel, dimensions.y * dimAtLevel, - dimensions.z * dimAtLevel + dimensions.z * dimAtLevel, ); const minimumGlobalCoord = Cesium.Cartesian3.ZERO; const maximumGlobalCoord = new Cesium.Cartesian3( dimensionsGlobal.x - 1, dimensionsGlobal.y - 1, - dimensionsGlobal.z - 1 + dimensionsGlobal.z - 1, ); let coordGlobal = new Cesium.Cartesian3(); const dataGlobal = this._allVoxelData; const dataTile = new Float32Array( - paddedDimensions.x * - paddedDimensions.y * - paddedDimensions.z * - channelCount + paddedDimensions.x * paddedDimensions.y * paddedDimensions.z * channelCount, ); for (let z = 0; z < paddedDimensions.z; z++) { @@ -198,11 +185,11 @@ tileX * dimensions.x + (x - paddingBefore.x), tileY * dimensions.y + (y - paddingBefore.y), tileZ * dimensions.z + (z - paddingBefore.z), - coordGlobal + coordGlobal, ), minimumGlobalCoord, maximumGlobalCoord, - coordGlobal + coordGlobal, ); const indexGlobal = @@ -228,7 +215,7 @@ provider: provider, customShader: customShader, modelMatrix: modelMatrix, - }) + }), ); viewer.voxelInspector.viewModel.voxelPrimitive = voxelPrimitive; @@ -263,8 +250,8 @@ Cesium.Cartesian3.fromElements( Cesium.Ellipsoid.WGS84.maximumRadius, Cesium.Ellipsoid.WGS84.maximumRadius, - Cesium.Ellipsoid.WGS84.maximumRadius - ) + Cesium.Ellipsoid.WGS84.maximumRadius, + ), ); Sandcastle.addToolbarMenu([ @@ -272,94 +259,70 @@ text: "Ellipsoid - Procedural Tile", onselect: function () { const provider = new ProceduralSingleTileVoxelProvider( - Cesium.VoxelShapeType.ELLIPSOID + Cesium.VoxelShapeType.ELLIPSOID, ); provider.minBounds.z = 0.0; provider.maxBounds.z = 1000000.0; - const primitive = createPrimitive( - provider, - customShaderColor, - modelMatrix - ); + const primitive = createPrimitive(provider, customShaderColor, modelMatrix); }, }, { text: "Cylinder - Procedural Tile", onselect: function () { const provider = new ProceduralSingleTileVoxelProvider( - Cesium.VoxelShapeType.CYLINDER - ); - const primitive = createPrimitive( - provider, - customShaderColor, - modelMatrix + Cesium.VoxelShapeType.CYLINDER, ); + const primitive = createPrimitive(provider, customShaderColor, modelMatrix); }, }, { text: "Box - Procedural Tile", onselect: function () { const provider = new ProceduralSingleTileVoxelProvider( - Cesium.VoxelShapeType.BOX - ); - const primitive = createPrimitive( - provider, - customShaderColor, - modelMatrix + Cesium.VoxelShapeType.BOX, ); + const primitive = createPrimitive(provider, customShaderColor, modelMatrix); }, }, { text: "Box - Procedural Tileset", onselect: function () { const provider = new ProceduralMultiTileVoxelProvider( - Cesium.VoxelShapeType.BOX - ); - const primitive = createPrimitive( - provider, - customShaderColor, - modelMatrix + Cesium.VoxelShapeType.BOX, ); + const primitive = createPrimitive(provider, customShaderColor, modelMatrix); }, }, { text: "Box - 3D Tiles", onselect: async function () { const provider = await Cesium.Cesium3DTilesVoxelProvider.fromUrl( - "../../SampleData/Cesium3DTiles/Voxel/VoxelBox3DTiles/tileset.json" - ); - const primitive = createPrimitive( - provider, - customShaderWhite, - modelMatrix + "../../SampleData/Cesium3DTiles/Voxel/VoxelBox3DTiles/tileset.json", ); + const primitive = createPrimitive(provider, customShaderWhite, modelMatrix); }, }, { text: "Ellipsoid - Procedural Tileset", onselect: function () { const provider = new ProceduralMultiTileVoxelProvider( - Cesium.VoxelShapeType.ELLIPSOID + Cesium.VoxelShapeType.ELLIPSOID, ); provider.minBounds.z = 0.0; provider.maxBounds.z = 1000000.0; - const primitive = createPrimitive( - provider, - customShaderColor, - modelMatrix - ); + const primitive = createPrimitive(provider, customShaderColor, modelMatrix); }, }, { text: "Ellipsoid - 3D Tiles", onselect: async function () { const provider = await Cesium.Cesium3DTilesVoxelProvider.fromUrl( - "../../SampleData/Cesium3DTiles/Voxel/VoxelEllipsoid3DTiles/tileset.json" + "../../SampleData/Cesium3DTiles/Voxel/VoxelEllipsoid3DTiles/tileset.json", ); const primitive = createPrimitive( provider, customShaderWhite, - Cesium.Matrix4.IDENTITY + Cesium.Matrix4.IDENTITY, ); }, }, @@ -367,26 +330,18 @@ text: "Cylinder - Procedural Tileset", onselect: function () { const provider = new ProceduralMultiTileVoxelProvider( - Cesium.VoxelShapeType.CYLINDER - ); - const primitive = createPrimitive( - provider, - customShaderColor, - modelMatrix + Cesium.VoxelShapeType.CYLINDER, ); + const primitive = createPrimitive(provider, customShaderColor, modelMatrix); }, }, { text: "Cylinder - 3D Tiles", onselect: async function () { const provider = await Cesium.Cesium3DTilesVoxelProvider.fromUrl( - "../../SampleData/Cesium3DTiles/Voxel/VoxelCylinder3DTiles/tileset.json" - ); - const primitive = createPrimitive( - provider, - customShaderWhite, - modelMatrix + "../../SampleData/Cesium3DTiles/Voxel/VoxelCylinder3DTiles/tileset.json", ); + const primitive = createPrimitive(provider, customShaderWhite, modelMatrix); }, }, ]); diff --git a/Apps/Sandcastle/gallery/Wall.html b/Apps/Sandcastle/gallery/Wall.html index 8ab9df064171..eb2f28622f5f 100644 --- a/Apps/Sandcastle/gallery/Wall.html +++ b/Apps/Sandcastle/gallery/Wall.html @@ -1,4 +1,4 @@ - + @@ -18,10 +18,7 @@ > - + @@ -38,12 +35,7 @@ name: "Red wall at height", wall: { positions: Cesium.Cartesian3.fromDegreesArrayHeights([ - -115.0, - 44.0, - 200000.0, - -90.0, - 44.0, - 200000.0, + -115.0, 44.0, 200000.0, -90.0, 44.0, 200000.0, ]), minimumHeights: [100000.0, 100000.0], material: Cesium.Color.RED, @@ -54,21 +46,8 @@ name: "Green wall from surface with outline", wall: { positions: Cesium.Cartesian3.fromDegreesArrayHeights([ - -107.0, - 43.0, - 100000.0, - -97.0, - 43.0, - 100000.0, - -97.0, - 40.0, - 100000.0, - -107.0, - 40.0, - 100000.0, - -107.0, - 43.0, - 100000.0, + -107.0, 43.0, 100000.0, -97.0, 43.0, 100000.0, -97.0, 40.0, 100000.0, + -107.0, 40.0, 100000.0, -107.0, 43.0, 100000.0, ]), material: Cesium.Color.GREEN, outline: true, @@ -79,55 +58,15 @@ name: "Blue wall with sawtooth heights and outline", wall: { positions: Cesium.Cartesian3.fromDegreesArray([ - -115.0, - 50.0, - -112.5, - 50.0, - -110.0, - 50.0, - -107.5, - 50.0, - -105.0, - 50.0, - -102.5, - 50.0, - -100.0, - 50.0, - -97.5, - 50.0, - -95.0, - 50.0, - -92.5, - 50.0, - -90.0, + -115.0, 50.0, -112.5, 50.0, -110.0, 50.0, -107.5, 50.0, -105.0, 50.0, + -102.5, 50.0, -100.0, 50.0, -97.5, 50.0, -95.0, 50.0, -92.5, 50.0, -90.0, 50.0, ]), maximumHeights: [ - 100000, - 200000, - 100000, - 200000, - 100000, - 200000, - 100000, - 200000, - 100000, - 200000, - 100000, - ], - minimumHeights: [ - 0, - 100000, - 0, - 100000, - 0, - 100000, - 0, - 100000, - 0, - 100000, - 0, + 100000, 200000, 100000, 200000, 100000, 200000, 100000, 200000, 100000, + 200000, 100000, ], + minimumHeights: [0, 100000, 0, 100000, 0, 100000, 0, 100000, 0, 100000, 0], material: Cesium.Color.BLUE.withAlpha(0.5), outline: true, outlineColor: Cesium.Color.BLACK, diff --git a/Apps/Sandcastle/gallery/Washington DC 2017.html b/Apps/Sandcastle/gallery/Washington DC 2017.html index 2f650a702f3f..ecc36df2757d 100644 --- a/Apps/Sandcastle/gallery/Washington DC 2017.html +++ b/Apps/Sandcastle/gallery/Washington DC 2017.html @@ -1,4 +1,4 @@ - + @@ -21,10 +21,7 @@ > - + @@ -39,7 +36,7 @@ const viewer = new Cesium.Viewer("cesiumContainer"); const imageryLayer = Cesium.ImageryLayer.fromProviderAsync( - Cesium.IonImageryProvider.fromAssetId(3827) + Cesium.IonImageryProvider.fromAssetId(3827), ); viewer.imageryLayers.add(imageryLayer); diff --git a/Apps/Sandcastle/gallery/Web Map Service (WMS).html b/Apps/Sandcastle/gallery/Web Map Service (WMS).html index a41813c4c84a..c93a28c028f8 100644 --- a/Apps/Sandcastle/gallery/Web Map Service (WMS).html +++ b/Apps/Sandcastle/gallery/Web Map Service (WMS).html @@ -1,4 +1,4 @@ - + @@ -7,10 +7,7 @@ name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no" /> - + Cesium Demo @@ -21,10 +18,7 @@ > - + @@ -40,25 +34,19 @@ // Add a WMS imagery layer const layer = new Cesium.ImageryLayer( new Cesium.WebMapServiceImageryProvider({ - url: - "https://services.ga.gov.au/gis/services/NM_Hydrology_and_Marine_Points/MapServer/WMSServer", + url: "https://services.ga.gov.au/gis/services/NM_Hydrology_and_Marine_Points/MapServer/WMSServer", layers: "Bores", parameters: { transparent: true, format: "image/png", }, - }) + }), ); viewer.imageryLayers.add(layer); // Start off looking at Australia. viewer.camera.setView({ - destination: Cesium.Rectangle.fromDegrees( - 114.591, - -45.837, - 148.97, - -5.73 - ), + destination: Cesium.Rectangle.fromDegrees(114.591, -45.837, 148.97, -5.73), }); //Sandcastle_End }; if (typeof Cesium !== "undefined") { diff --git a/Apps/Sandcastle/gallery/Web Map Tile Service with Time.html b/Apps/Sandcastle/gallery/Web Map Tile Service with Time.html index 40433786ca3b..c8b0654f75eb 100644 --- a/Apps/Sandcastle/gallery/Web Map Tile Service with Time.html +++ b/Apps/Sandcastle/gallery/Web Map Tile Service with Time.html @@ -1,4 +1,4 @@ - + @@ -21,10 +21,7 @@ > - + @@ -65,8 +62,7 @@ // This comes from NASA's GIBS API. // See https://wiki.earthdata.nasa.gov/display/GIBS/GIBS+API+for+Developers#GIBSAPIforDevelopers-OGCWebMapService(WMS) const provider = new Cesium.WebMapTileServiceImageryProvider({ - url: - "https://gibs.earthdata.nasa.gov/wmts/epsg4326/best/MODIS_Terra_CorrectedReflectance_TrueColor/default/{Time}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.jpg", + url: "https://gibs.earthdata.nasa.gov/wmts/epsg4326/best/MODIS_Terra_CorrectedReflectance_TrueColor/default/{Time}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.jpg", layer: "MODIS_Terra_CorrectedReflectance_TrueColor", style: "default", tileMatrixSetID: "250m", diff --git a/Apps/Sandcastle/gallery/Z-Indexing Geometry.html b/Apps/Sandcastle/gallery/Z-Indexing Geometry.html index 17d6581b37c9..9b2c7b01cc13 100644 --- a/Apps/Sandcastle/gallery/Z-Indexing Geometry.html +++ b/Apps/Sandcastle/gallery/Z-Indexing Geometry.html @@ -1,4 +1,4 @@ - + @@ -21,10 +21,7 @@ > - + @@ -40,12 +37,7 @@ viewer.entities.add({ id: "Red rectangle, zIndex 1", rectangle: { - coordinates: Cesium.Rectangle.fromDegrees( - -110.0, - 20.0, - -100.5, - 30.0 - ), + coordinates: Cesium.Rectangle.fromDegrees(-110.0, 20.0, -100.5, 30.0), material: Cesium.Color.RED, zIndex: 1, }, @@ -54,12 +46,7 @@ viewer.entities.add({ id: "Textured rectangle, zIndex 2", rectangle: { - coordinates: Cesium.Rectangle.fromDegrees( - -112.0, - 25.0, - -102.5, - 35.0 - ), + coordinates: Cesium.Rectangle.fromDegrees(-112.0, 25.0, -102.5, 35.0), material: "../images/Cesium_Logo_Color.jpg", zIndex: 2, }, @@ -68,12 +55,7 @@ viewer.entities.add({ id: "Blue rectangle, zIndex 3", rectangle: { - coordinates: Cesium.Rectangle.fromDegrees( - -110.0, - 31.0, - -100.5, - 41.0 - ), + coordinates: Cesium.Rectangle.fromDegrees(-110.0, 31.0, -100.5, 41.0), material: Cesium.Color.BLUE, zIndex: 3, }, @@ -108,27 +90,20 @@ if (!Cesium.Entity.supportsPolylinesOnTerrain(viewer.scene)) { window.alert( - "Polylines on terrain are not supported on this platform, Z-index will be ignored" + "Polylines on terrain are not supported on this platform, Z-index will be ignored", ); } - if ( - !Cesium.Entity.supportsMaterialsforEntitiesOnTerrain(viewer.scene) - ) { + if (!Cesium.Entity.supportsMaterialsforEntitiesOnTerrain(viewer.scene)) { window.alert( - "Textured materials on terrain polygons are not supported on this platform, Z-index will be ignored" + "Textured materials on terrain polygons are not supported on this platform, Z-index will be ignored", ); } viewer.entities.add({ id: "Polyline, zIndex 2", polyline: { - positions: Cesium.Cartesian3.fromDegreesArray([ - -120.0, - 22.0, - -80.0, - 22.0, - ]), + positions: Cesium.Cartesian3.fromDegreesArray([-120.0, 22.0, -80.0, 22.0]), width: 8.0, material: new Cesium.PolylineGlowMaterialProperty({ glowPower: 0.2, diff --git a/Apps/Sandcastle/gallery/development/3D Models Articulations.html b/Apps/Sandcastle/gallery/development/3D Models Articulations.html index 97a795c2b986..c42eb44ba3d5 100644 --- a/Apps/Sandcastle/gallery/development/3D Models Articulations.html +++ b/Apps/Sandcastle/gallery/development/3D Models Articulations.html @@ -1,4 +1,4 @@ - + @@ -7,10 +7,7 @@ name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no" /> - + Cesium Demo @@ -21,10 +18,7 @@ > - + @@ -75,19 +72,15 @@ Cesium.JulianDate.addSeconds( referenceMinimum, viewLoadTime, - referenceMaximum + referenceMaximum, ); tileset._heatmap.setReferenceMinimumMaximum( referenceMinimum, referenceMaximum, - heatmapTileProperty + heatmapTileProperty, ); } else if (heatmapTileProperty === "_priorityDeferred") { - tileset._heatmap.setReferenceMinimumMaximum( - -1, - 1, - heatmapTileProperty - ); + tileset._heatmap.setReferenceMinimumMaximum(-1, 1, heatmapTileProperty); } } @@ -100,18 +93,18 @@ destination: new Cartesian3( 1333596.036282181, -4655169.681831507, - 4137566.3043841794 + 4137566.3043841794, ), orientation: { direction: new Cartesian3( 0.16082862107778806, 0.8832766751525227, - 0.4404048929947557 + 0.4404048929947557, ), up: new Cartesian3( 0.27688172689171486, -0.4686726309748134, - 0.8388578391411791 + 0.8388578391411791, ), }, duration: 0, @@ -126,18 +119,18 @@ destination: new Cartesian3( 1334667.3697728787, -4654198.808294234, - 4137970.3278586734 + 4137970.3278586734, ), orientation: { direction: new Cartesian3( -0.27073345520322445, 0.8195770495850765, - 0.504972133911511 + 0.504972133911511, ), up: new Cartesian3( 0.12792976837875633, -0.48927851021971713, - 0.8626937543530335 + 0.8626937543530335, ), }, duration: flightDuration, @@ -153,18 +146,18 @@ destination: new Cartesian3( 1334615.6546409938, -4653003.089826743, - 4139331.5003454844 + 4139331.5003454844, ), orientation: { direction: new Cartesian3( -0.2708199805903497, 0.8196978379289465, - 0.5047296232713642 + 0.5047296232713642, ), up: new Cartesian3( 0.12789117766285887, -0.48903793608573193, - 0.8628358730054139 + 0.8628358730054139, ), }, duration: flightDuration, @@ -176,7 +169,7 @@ destinationFunctions[3] = function () { console.log( - `Total Loads and Time (ignoring first view and flight time): ${tourLoads}, ${tourTime}` + `Total Loads and Time (ignoring first view and flight time): ${tourLoads}, ${tourTime}`, ); }; @@ -219,15 +212,12 @@ duration -= currentDestination === 0 ? 0 : flightDuration; const flightLoads = totalLoaded - lastTotalLoaded; console.log( - `view ${currentDestination} flight loads, final view time: ${flightLoads}, ${duration}` + `view ${currentDestination} flight loads, final view time: ${flightLoads}, ${duration}`, ); lastTotalLoaded = totalLoaded; tourTime += currentDestination === 0 ? 0 : duration; tourLoads += currentDestination === 0 ? 0 : flightLoads; - if ( - doTour && - currentDestination < destinationFunctions.length - 1 - ) { + if (doTour && currentDestination < destinationFunctions.length - 1) { destinationFunctions[++currentDestination](); } tileset.allTilesLoaded.removeEventListener(timerListener); @@ -258,7 +248,7 @@ easingFunction: Cesium.EasingFunction.LINEAR_NONE,\n\ });\n\ timeAll();\n\ -});` +});`, ); }); //Sandcastle_End }; diff --git a/Apps/Sandcastle/gallery/development/3D Tiles Picking.html b/Apps/Sandcastle/gallery/development/3D Tiles Picking.html index 418a7761dddb..10c3b2367a66 100644 --- a/Apps/Sandcastle/gallery/development/3D Tiles Picking.html +++ b/Apps/Sandcastle/gallery/development/3D Tiles Picking.html @@ -1,4 +1,4 @@ - + @@ -7,10 +7,7 @@ name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no" /> - + Cesium Demo @@ -21,10 +18,7 @@ > - + @@ -90,7 +84,7 @@ scene.primitives.remove(tileset); try { tileset = await Cesium.Cesium3DTileset.fromUrl( - "../../SampleData/Cesium3DTiles/Instanced/InstancedWithBatchTable/tileset.json" + "../../SampleData/Cesium3DTiles/Instanced/InstancedWithBatchTable/tileset.json", ); scene.primitives.add(tileset); viewer.zoomTo(tileset); diff --git a/Apps/Sandcastle/gallery/development/3D Tiles Split.html b/Apps/Sandcastle/gallery/development/3D Tiles Split.html index 0ec89e25de08..cdf56ad3ef46 100644 --- a/Apps/Sandcastle/gallery/development/3D Tiles Split.html +++ b/Apps/Sandcastle/gallery/development/3D Tiles Split.html @@ -1,4 +1,4 @@ - + @@ -22,10 +22,7 @@ > - + @@ -46,7 +43,7 @@ const billboardCollection = viewer.scene.primitives.add( new Cesium.BillboardCollection({ scene: viewer.scene, - }) + }), ); // seneca @@ -61,21 +58,13 @@ centerLongitude - rectangleHalfSize, centerLatitude - rectangleHalfSize, centerLongitude + rectangleHalfSize, - centerLatitude + rectangleHalfSize + centerLatitude + rectangleHalfSize, ); for (let y = 0; y < gridHeight; ++y) { for (let x = 0; x < gridWidth; ++x) { - const longitude = Cesium.Math.lerp( - e.west, - e.east, - x / (gridWidth - 1) - ); - const latitude = Cesium.Math.lerp( - e.south, - e.north, - y / (gridHeight - 1) - ); + const longitude = Cesium.Math.lerp(e.west, e.east, x / (gridWidth - 1)); + const latitude = Cesium.Math.lerp(e.south, e.north, y / (gridHeight - 1)); const position = new Cesium.Cartographic(longitude, latitude); billboardCollection.add({ @@ -92,7 +81,7 @@ if (!Cesium.defined(billboard)) { billboard = billboardCollection.add({ position: ellipsoid.cartographicToCartesian( - new Cesium.Cartographic(centerLongitude, centerLatitude, 1000.0) + new Cesium.Cartographic(centerLongitude, centerLatitude, 1000.0), ), image: "../images/Cesium_Logo_overlay.png", scale: 0.7, @@ -113,8 +102,7 @@ text: "Relative to ground", onselect: function () { if (Cesium.defined(billboard)) { - billboard.heightReference = - Cesium.HeightReference.RELATIVE_TO_GROUND; + billboard.heightReference = Cesium.HeightReference.RELATIVE_TO_GROUND; } }, }, @@ -122,8 +110,7 @@ text: "Clamp to ground", onselect: function () { if (Cesium.defined(billboard)) { - billboard.heightReference = - Cesium.HeightReference.CLAMP_TO_GROUND; + billboard.heightReference = Cesium.HeightReference.CLAMP_TO_GROUND; } }, }, @@ -141,25 +128,17 @@ Sandcastle.addToolbarButton("Increase longitude", function () { if (Cesium.defined(billboard)) { - const cartographic = ellipsoid.cartesianToCartographic( - billboard.position - ); + const cartographic = ellipsoid.cartesianToCartographic(billboard.position); cartographic.longitude += lonGran; - billboard.position = ellipsoid.cartographicToCartesian( - cartographic - ); + billboard.position = ellipsoid.cartographicToCartesian(cartographic); } }); Sandcastle.addToolbarButton("Decrease longitude", function () { if (Cesium.defined(billboard)) { - const cartographic = ellipsoid.cartesianToCartographic( - billboard.position - ); + const cartographic = ellipsoid.cartesianToCartographic(billboard.position); cartographic.longitude -= lonGran; - billboard.position = ellipsoid.cartographicToCartesian( - cartographic - ); + billboard.position = ellipsoid.cartographicToCartesian(cartographic); } }); //Sandcastle_End diff --git a/Apps/Sandcastle/gallery/development/Billboards Instancing.html b/Apps/Sandcastle/gallery/development/Billboards Instancing.html index 35fa357413f5..bc23457ef6e6 100644 --- a/Apps/Sandcastle/gallery/development/Billboards Instancing.html +++ b/Apps/Sandcastle/gallery/development/Billboards Instancing.html @@ -1,4 +1,4 @@ - + @@ -18,10 +18,7 @@ > - + @@ -61,7 +58,7 @@ centerLongitude - rectangleHalfSize, centerLatitude - rectangleHalfSize, centerLongitude + rectangleHalfSize, - centerLatitude + rectangleHalfSize + centerLatitude + rectangleHalfSize, ); function resetBillboardCollection() { @@ -72,27 +69,15 @@ billboardCollection = scene.primitives.add( new Cesium.BillboardCollection({ scene: scene, - }) + }), ); const gridSize = Math.sqrt(billboardCount); for (let y = 0; y < gridSize; ++y) { for (let x = 0; x < gridSize; ++x) { - const longitude = Cesium.Math.lerp( - e.west, - e.east, - x / (gridSize - 1) - ); - const latitude = Cesium.Math.lerp( - e.south, - e.north, - y / (gridSize - 1) - ); - const position = new Cesium.Cartographic( - longitude, - latitude, - 10000.0 - ); + const longitude = Cesium.Math.lerp(e.west, e.east, x / (gridSize - 1)); + const latitude = Cesium.Math.lerp(e.south, e.north, y / (gridSize - 1)); + const position = new Cesium.Cartographic(longitude, latitude, 10000.0); billboardCollection.add({ position: ellipsoid.cartographicToCartesian(position), diff --git a/Apps/Sandcastle/gallery/development/Billboards.html b/Apps/Sandcastle/gallery/development/Billboards.html index 1d03e06817ac..d6f130787322 100644 --- a/Apps/Sandcastle/gallery/development/Billboards.html +++ b/Apps/Sandcastle/gallery/development/Billboards.html @@ -1,4 +1,4 @@ - + @@ -21,10 +21,7 @@ > - + @@ -41,9 +38,7 @@ function addBillboard() { Sandcastle.declare(addBillboard); - const billboards = scene.primitives.add( - new Cesium.BillboardCollection() - ); + const billboards = scene.primitives.add(new Cesium.BillboardCollection()); billboards.add({ image: "../images/Cesium_Logo_overlay.png", position: Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883), @@ -53,9 +48,7 @@ function setBillboardProperties() { Sandcastle.declare(setBillboardProperties); - const billboards = scene.primitives.add( - new Cesium.BillboardCollection() - ); + const billboards = scene.primitives.add(new Cesium.BillboardCollection()); billboards.add({ image: "../images/Cesium_Logo_overlay.png", // default: undefined show: true, // default @@ -77,9 +70,7 @@ function changeBillboardProperties() { Sandcastle.declare(changeBillboardProperties); - const billboards = scene.primitives.add( - new Cesium.BillboardCollection() - ); + const billboards = scene.primitives.add(new Cesium.BillboardCollection()); // add() returns a Billboard object containing functions to change // the billboard's position and appearance. @@ -87,11 +78,7 @@ image: "../images/Cesium_Logo_overlay.png", }); - b.position = Cesium.Cartesian3.fromDegrees( - -75.59777, - 40.03883, - 300000.0 - ); + b.position = Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883, 300000.0); b.scale = 3.0; b.color = new Cesium.Color(1.0, 1.0, 1.0, 0.25); } @@ -105,12 +92,10 @@ const range = 100.0; viewer.camera.lookAt( center, - new Cesium.HeadingPitchRange(heading, pitch, range) + new Cesium.HeadingPitchRange(heading, pitch, range), ); - const billboards = scene.primitives.add( - new Cesium.BillboardCollection() - ); + const billboards = scene.primitives.add(new Cesium.BillboardCollection()); billboards.add({ image: "../images/Cesium_Logo_overlay.png", sizeInMeters: true, @@ -124,9 +109,7 @@ const logoUrl = "../images/Cesium_Logo_overlay.png"; const facilityUrl = "../images/facility.gif"; - const billboards = scene.primitives.add( - new Cesium.BillboardCollection() - ); + const billboards = scene.primitives.add(new Cesium.BillboardCollection()); billboards.add({ image: logoUrl, position: Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883), @@ -144,9 +127,7 @@ function scaleByDistance() { Sandcastle.declare(scaleByDistance); - const billboards = scene.primitives.add( - new Cesium.BillboardCollection() - ); + const billboards = scene.primitives.add(new Cesium.BillboardCollection()); billboards.add({ image: "../images/facility.gif", position: Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883), @@ -157,18 +138,11 @@ function fadeByDistance() { Sandcastle.declare(fadeByDistance); - const billboards = scene.primitives.add( - new Cesium.BillboardCollection() - ); + const billboards = scene.primitives.add(new Cesium.BillboardCollection()); billboards.add({ image: "../images/Cesium_Logo_overlay.png", position: Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883), - translucencyByDistance: new Cesium.NearFarScalar( - 1.5e2, - 1.0, - 1.5e7, - 0.2 - ), + translucencyByDistance: new Cesium.NearFarScalar(1.5e2, 1.0, 1.5e7, 0.2), }); } @@ -176,15 +150,11 @@ Sandcastle.declare(offsetByDistance); Promise.all([ Cesium.Resource.createIfNeeded( - "../images/Cesium_Logo_overlay.png" - ).fetchImage(), - Cesium.Resource.createIfNeeded( - "../images/facility.gif" + "../images/Cesium_Logo_overlay.png", ).fetchImage(), + Cesium.Resource.createIfNeeded("../images/facility.gif").fetchImage(), ]).then(function (images) { - const billboards = scene.primitives.add( - new Cesium.BillboardCollection() - ); + const billboards = scene.primitives.add(new Cesium.BillboardCollection()); // As viewer zooms closer to facility billboard, // increase pixelOffset on CesiumLogo billboard to this height @@ -207,14 +177,9 @@ 1.0e3, 1.0, 1.5e6, - 0.0 - ), - translucencyByDistance: new Cesium.NearFarScalar( - 1.0e3, - 1.0, - 1.5e6, - 0.1 + 0.0, ), + translucencyByDistance: new Cesium.NearFarScalar(1.0e3, 1.0, 1.5e6, 0.1), }); }); } @@ -238,9 +203,7 @@ context2D.fillStyle = "rgb(255, 255, 255)"; context2D.fill(); - const billboards = scene.primitives.add( - new Cesium.BillboardCollection() - ); + const billboards = scene.primitives.add(new Cesium.BillboardCollection()); billboards.add({ imageId: "custom canvas point", image: canvas, @@ -266,9 +229,7 @@ function addMarkerBillboards() { Sandcastle.declare(addMarkerBillboards); - const billboards = scene.primitives.add( - new Cesium.BillboardCollection() - ); + const billboards = scene.primitives.add(new Cesium.BillboardCollection()); // Add several billboards based on the above image in the atlas. billboards.add({ @@ -306,13 +267,9 @@ function inReferenceFrame() { Sandcastle.declare(inReferenceFrame); - const billboards = scene.primitives.add( - new Cesium.BillboardCollection() - ); + const billboards = scene.primitives.add(new Cesium.BillboardCollection()); const center = Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883); - billboards.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame( - center - ); + billboards.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(center); const facilityUrl = "../images/facility.gif"; diff --git a/Apps/Sandcastle/gallery/development/Box Outline.html b/Apps/Sandcastle/gallery/development/Box Outline.html index 97a9e0a5b2c9..e185696d3b0b 100644 --- a/Apps/Sandcastle/gallery/development/Box Outline.html +++ b/Apps/Sandcastle/gallery/development/Box Outline.html @@ -1,4 +1,4 @@ - + @@ -18,10 +18,7 @@ > - + @@ -47,7 +44,7 @@ const boxModelMatrix = Cesium.Matrix4.multiplyByTranslation( Cesium.Transforms.eastNorthUpToFixedFrame(positionOnEllipsoid), new Cesium.Cartesian3(0.0, 0.0, dimensions.z * 0.5), - new Cesium.Matrix4() + new Cesium.Matrix4(), ); // Create a box outline geometry. @@ -61,9 +58,7 @@ geometry: boxOutlineGeometry, modelMatrix: boxModelMatrix, attributes: { - color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.WHITE - ), + color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.WHITE), }, }); @@ -77,7 +72,7 @@ lineWidth: Math.min(2.0, scene.maximumAliasedLineWidth), }, }), - }) + }), ); //Sandcastle_End }; diff --git a/Apps/Sandcastle/gallery/development/Box.html b/Apps/Sandcastle/gallery/development/Box.html index 7729332f0631..ed7ace760e45 100644 --- a/Apps/Sandcastle/gallery/development/Box.html +++ b/Apps/Sandcastle/gallery/development/Box.html @@ -1,4 +1,4 @@ - + @@ -18,10 +18,7 @@ > - + @@ -46,7 +43,7 @@ const boxModelMatrix = Cesium.Matrix4.multiplyByTranslation( Cesium.Transforms.eastNorthUpToFixedFrame(positionOnEllipsoid), new Cesium.Cartesian3(0.0, 0.0, dimensions.z * 0.5), - new Cesium.Matrix4() + new Cesium.Matrix4(), ); // Create a box geometry. const boxGeometry = Cesium.BoxGeometry.fromDimensions({ @@ -60,7 +57,7 @@ modelMatrix: boxModelMatrix, attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor( - new Cesium.Color(1.0, 0.0, 0.0, 0.5) + new Cesium.Color(1.0, 0.0, 0.0, 0.5), ), }, }); @@ -71,7 +68,7 @@ appearance: new Cesium.PerInstanceColorAppearance({ closed: true, }), - }) + }), ); //Sandcastle_End }; diff --git a/Apps/Sandcastle/gallery/development/Circle Outline.html b/Apps/Sandcastle/gallery/development/Circle Outline.html index f88e4adc29d5..22779c6510a6 100644 --- a/Apps/Sandcastle/gallery/development/Circle Outline.html +++ b/Apps/Sandcastle/gallery/development/Circle Outline.html @@ -1,4 +1,4 @@ - + @@ -18,10 +18,7 @@ > - + @@ -47,9 +44,7 @@ let circleOutlineInstance = new Cesium.GeometryInstance({ geometry: circleOutlineGeometry, attributes: { - color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.WHITE - ), + color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.WHITE), }, }); // Add the geometry instance to primitives. @@ -62,7 +57,7 @@ lineWidth: Math.min(2.0, scene.maximumAliasedLineWidth), }, }), - }) + }), ); // Example 2: Draw a green extruded circle. @@ -81,9 +76,7 @@ circleOutlineInstance = new Cesium.GeometryInstance({ geometry: circleOutlineGeometry, attributes: { - color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.WHITE - ), + color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.WHITE), }, }); // Add the geometry instance to primitives. @@ -96,7 +89,7 @@ lineWidth: Math.min(2.0, scene.maximumAliasedLineWidth), }, }), - }) + }), ); //Sandcastle_End }; diff --git a/Apps/Sandcastle/gallery/development/Circle.html b/Apps/Sandcastle/gallery/development/Circle.html index 47ff4f66d84b..2731dbd8b93b 100644 --- a/Apps/Sandcastle/gallery/development/Circle.html +++ b/Apps/Sandcastle/gallery/development/Circle.html @@ -1,4 +1,4 @@ - + @@ -21,10 +21,7 @@ > - + @@ -54,7 +51,7 @@ geometry: circleGeometry, attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor( - new Cesium.Color(1.0, 0.0, 0.0, 0.5) + new Cesium.Color(1.0, 0.0, 0.0, 0.5), ), }, }); @@ -65,7 +62,7 @@ appearance: new Cesium.PerInstanceColorAppearance({ closed: true, }), - }) + }), ); // Example 2: Draw a green extruded circle. @@ -85,7 +82,7 @@ geometry: circleGeometry, attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor( - new Cesium.Color(0.0, 1.0, 0.0, 0.5) + new Cesium.Color(0.0, 1.0, 0.0, 0.5), ), }, }); @@ -96,7 +93,7 @@ appearance: new Cesium.PerInstanceColorAppearance({ closed: true, }), - }) + }), ); // Example 3: Draw a blue circle at a height. @@ -114,9 +111,7 @@ const blueCircleInstance = new Cesium.GeometryInstance({ geometry: circleGeometry, attributes: { - color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.BLUE - ), + color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.BLUE), }, }); // Add the geometry instance to primitives. @@ -127,7 +122,7 @@ closed: true, translucent: false, }), - }) + }), ); //Sandcastle_End }; diff --git a/Apps/Sandcastle/gallery/development/Coplanar Polygon Outline.html b/Apps/Sandcastle/gallery/development/Coplanar Polygon Outline.html index c0a1de8a5562..3f1a9a517ae5 100644 --- a/Apps/Sandcastle/gallery/development/Coplanar Polygon Outline.html +++ b/Apps/Sandcastle/gallery/development/Coplanar Polygon Outline.html @@ -1,4 +1,4 @@ - + @@ -21,10 +21,7 @@ > - + @@ -41,24 +38,12 @@ const polygonOutline1 = new Cesium.GeometryInstance({ geometry: Cesium.CoplanarPolygonOutlineGeometry.fromPositions({ positions: Cesium.Cartesian3.fromDegreesArrayHeights([ - -94.0, - 40.0, - 0.0, - -93.0, - 40.0, - 200000.0, - -92.0, - 40.0, - 200000.0, - -91.0, - 40.0, + -94.0, 40.0, 0.0, -93.0, 40.0, 200000.0, -92.0, 40.0, 200000.0, -91.0, 40.0, 0.0, ]), }), attributes: { - color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.WHITE - ), + color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.WHITE), }, }); @@ -66,50 +51,20 @@ geometry: new Cesium.CoplanarPolygonOutlineGeometry({ polygonHierarchy: { positions: Cesium.Cartesian3.fromDegreesArrayHeights([ - -99.0, - 38.0, - 100000, - -97.0, - 38.0, - 100000, - -97.0, - 40.0, - 100000, - -99.0, - 40.0, - 100000, + -99.0, 38.0, 100000, -97.0, 38.0, 100000, -97.0, 40.0, 100000, -99.0, + 40.0, 100000, ]), holes: [ { positions: Cesium.Cartesian3.fromDegreesArrayHeights([ - -98.5, - 38.5, - 100000, - -98.5, - 39.5, - 100000, - -97.5, - 39.5, - 100000, - -97.5, - 38.5, - 100000, + -98.5, 38.5, 100000, -98.5, 39.5, 100000, -97.5, 39.5, 100000, -97.5, + 38.5, 100000, ]), holes: [ { positions: Cesium.Cartesian3.fromDegreesArrayHeights([ - -98.25, - 38.75, - 100000, - -97.75, - 38.75, - 100000, - -97.75, - 39.25, - 100000, - -98.25, - 39.25, - 100000, + -98.25, 38.75, 100000, -97.75, 38.75, 100000, -97.75, 39.25, + 100000, -98.25, 39.25, 100000, ]), }, ], @@ -118,9 +73,7 @@ }, }), attributes: { - color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.WHITE - ), + color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.WHITE), }, }); @@ -133,7 +86,7 @@ lineWidth: Math.min(2.0, scene.maximumAliasedLineWidth), }, }), - }) + }), ); //Sandcastle_End }; diff --git a/Apps/Sandcastle/gallery/development/Coplanar Polygon.html b/Apps/Sandcastle/gallery/development/Coplanar Polygon.html index eecb78f4f0cc..996e034232d4 100644 --- a/Apps/Sandcastle/gallery/development/Coplanar Polygon.html +++ b/Apps/Sandcastle/gallery/development/Coplanar Polygon.html @@ -1,4 +1,4 @@ - + @@ -18,10 +18,7 @@ > - + @@ -38,17 +35,7 @@ const polygonGeometry1 = Cesium.CoplanarPolygonGeometry.fromPositions({ vertexFormat: Cesium.PerInstanceColorAppearance.VERTEX_FORMAT, positions: Cesium.Cartesian3.fromDegreesArrayHeights([ - -91.0, - 40.0, - 0.0, - -90.0, - 40.0, - 200000.0, - -89.0, - 40.0, - 200000.0, - -88.0, - 40.0, + -91.0, 40.0, 0.0, -90.0, 40.0, 200000.0, -89.0, 40.0, 200000.0, -88.0, 40.0, 0.0, ]), }); @@ -57,50 +44,20 @@ vertexFormat: Cesium.PerInstanceColorAppearance.VERTEX_FORMAT, polygonHierarchy: { positions: Cesium.Cartesian3.fromDegreesArrayHeights([ - -99.0, - 38.0, - 100000, - -97.0, - 38.0, - 100000, - -97.0, - 40.0, - 100000, - -99.0, - 40.0, + -99.0, 38.0, 100000, -97.0, 38.0, 100000, -97.0, 40.0, 100000, -99.0, 40.0, 100000, ]), holes: [ { positions: Cesium.Cartesian3.fromDegreesArrayHeights([ - -98.5, - 38.5, - 100000, - -98.5, - 39.5, - 100000, - -97.5, - 39.5, - 100000, - -97.5, - 38.5, - 100000, + -98.5, 38.5, 100000, -98.5, 39.5, 100000, -97.5, 39.5, 100000, -97.5, + 38.5, 100000, ]), holes: [ { positions: Cesium.Cartesian3.fromDegreesArrayHeights([ - -98.25, - 38.75, - 100000, - -97.75, - 38.75, - 100000, - -97.75, - 39.25, - 100000, - -98.25, - 39.25, - 100000, + -98.25, 38.75, 100000, -97.75, 38.75, 100000, -97.75, 39.25, 100000, + -98.25, 39.25, 100000, ]), }, ], @@ -112,18 +69,14 @@ const polygonInstance1 = new Cesium.GeometryInstance({ geometry: polygonGeometry1, attributes: { - color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.BLUE - ), + color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.BLUE), }, }); const polygonInstance2 = new Cesium.GeometryInstance({ geometry: polygonGeometry2, attributes: { - color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.RED - ), + color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.RED), }, }); @@ -134,24 +87,14 @@ translucent: false, closed: false, }), - }) + }), ); const polygonGeometry = Cesium.CoplanarPolygonGeometry.fromPositions({ vertexFormat: Cesium.VertexFormat.ALL, positions: Cesium.Cartesian3.fromDegreesArrayHeights([ - -95.0, - 40.0, - 100000.0, - -94.0, - 42.0, - 200000.0, - -93.0, - 42.0, - 200000.0, - -92.0, - 40.0, - 100000.0, + -95.0, 40.0, 100000.0, -94.0, 42.0, 200000.0, -93.0, 42.0, 200000.0, -92.0, + 40.0, 100000.0, ]), stRotation: Cesium.Math.toRadians(-20), }); @@ -165,10 +108,9 @@ geometryInstances: polygonInstance, appearance: new Cesium.MaterialAppearance({ material: Cesium.Material.fromType("Checkerboard"), - materialSupport: - Cesium.MaterialAppearance.MaterialSupport.TEXTURED, + materialSupport: Cesium.MaterialAppearance.MaterialSupport.TEXTURED, }), - }) + }), ); //Sandcastle_End }; if (typeof Cesium !== "undefined") { diff --git a/Apps/Sandcastle/gallery/development/Corridor Outline.html b/Apps/Sandcastle/gallery/development/Corridor Outline.html index 349c05fc9d8c..71437028faff 100644 --- a/Apps/Sandcastle/gallery/development/Corridor Outline.html +++ b/Apps/Sandcastle/gallery/development/Corridor Outline.html @@ -1,4 +1,4 @@ - + @@ -18,10 +18,7 @@ > - + @@ -40,12 +37,7 @@ // Create the corridor outline geometry. let corridorOutlineGeometry = new Cesium.CorridorOutlineGeometry({ positions: Cesium.Cartesian3.fromDegreesArray([ - -100.0, - 40.0, - -105.0, - 40.0, - -105.0, - 35.0, + -100.0, 40.0, -105.0, 40.0, -105.0, 35.0, ]), width: 200000.0, }); @@ -53,9 +45,7 @@ const corridorOutline = new Cesium.GeometryInstance({ geometry: corridorOutlineGeometry, attributes: { - color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.WHITE - ), + color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.WHITE), }, }); @@ -64,12 +54,7 @@ // height of the geometry with the extrudedHeight option. corridorOutlineGeometry = new Cesium.CorridorOutlineGeometry({ positions: Cesium.Cartesian3.fromDegreesArray([ - -90.0, - 40.0, - -95.0, - 40.0, - -95.0, - 35.0, + -90.0, 40.0, -95.0, 40.0, -95.0, 35.0, ]), width: 200000.0, cornerType: Cesium.CornerType.MITERED, @@ -79,9 +64,7 @@ const extrudedCorridorOutline = new Cesium.GeometryInstance({ geometry: corridorOutlineGeometry, attributes: { - color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.WHITE - ), + color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.WHITE), }, }); @@ -95,7 +78,7 @@ lineWidth: Math.min(2.0, scene.maximumAliasedLineWidth), }, }), - }) + }), ); //Sandcastle_End }; diff --git a/Apps/Sandcastle/gallery/development/Corridor.html b/Apps/Sandcastle/gallery/development/Corridor.html index f0e96be95995..38f2be361e6a 100644 --- a/Apps/Sandcastle/gallery/development/Corridor.html +++ b/Apps/Sandcastle/gallery/development/Corridor.html @@ -1,4 +1,4 @@ - + @@ -18,10 +18,7 @@ > - + @@ -41,12 +38,7 @@ // Create the corridor geometry. let corridorGeometry = new Cesium.CorridorGeometry({ positions: Cesium.Cartesian3.fromDegreesArray([ - -100.0, - 40.0, - -105.0, - 40.0, - -105.0, - 35.0, + -100.0, 40.0, -105.0, 40.0, -105.0, 35.0, ]), width: 200000.0, vertexFormat: Cesium.PerInstanceColorAppearance.VERTEX_FORMAT, @@ -58,7 +50,7 @@ geometry: corridorGeometry, attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor( - new Cesium.Color(1.0, 0.0, 0.0, 0.5) + new Cesium.Color(1.0, 0.0, 0.0, 0.5), ), }, }); @@ -69,7 +61,7 @@ appearance: new Cesium.PerInstanceColorAppearance({ closed: true, }), - }) + }), ); // Example 2: Draw a green corridor at a height. @@ -80,12 +72,7 @@ // option to draw mitered corners. corridorGeometry = new Cesium.CorridorGeometry({ positions: Cesium.Cartesian3.fromDegreesArray([ - -90.0, - 40.0, - -95.0, - 40.0, - -95.0, - 35.0, + -90.0, 40.0, -95.0, 40.0, -95.0, 35.0, ]), height: 100000.0, width: 200000.0, @@ -98,9 +85,7 @@ const greenCorridorInstance = new Cesium.GeometryInstance({ geometry: corridorGeometry, attributes: { - color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.GREEN - ), + color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.GREEN), }, }); // Add the geometry instance to primitives. @@ -111,7 +96,7 @@ closed: true, translucent: false, }), - }) + }), ); // Example 3: Draw a blue extruded corridor. @@ -122,12 +107,7 @@ // to draw beveled corners. corridorGeometry = new Cesium.CorridorGeometry({ positions: Cesium.Cartesian3.fromDegreesArray([ - -80.0, - 40.0, - -85.0, - 40.0, - -85.0, - 35.0, + -80.0, 40.0, -85.0, 40.0, -85.0, 35.0, ]), height: 200000.0, extrudedHeight: 100000.0, @@ -141,7 +121,7 @@ geometry: corridorGeometry, attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor( - new Cesium.Color(0.0, 0.0, 1.0, 0.5) + new Cesium.Color(0.0, 0.0, 1.0, 0.5), ), }, }); @@ -152,7 +132,7 @@ appearance: new Cesium.PerInstanceColorAppearance({ closed: true, }), - }) + }), ); //Sandcastle_End }; if (typeof Cesium !== "undefined") { diff --git a/Apps/Sandcastle/gallery/development/Custom Primitive.html b/Apps/Sandcastle/gallery/development/Custom Primitive.html index 7218987c7e94..64ab294f1f52 100644 --- a/Apps/Sandcastle/gallery/development/Custom Primitive.html +++ b/Apps/Sandcastle/gallery/development/Custom Primitive.html @@ -1,4 +1,4 @@ - + @@ -18,10 +18,7 @@ > - + @@ -45,7 +42,7 @@ const modelMatrix = Cesium.Matrix4.multiplyByTranslation( Cesium.Transforms.eastNorthUpToFixedFrame(positionOnEllipsoid), new Cesium.Cartesian3(0.0, 0.0, length * 0.5), - new Cesium.Matrix4() + new Cesium.Matrix4(), ); // Create the cylinder outline geometry. The numberOfVerticalLines // option can be used to specify the number of lines connecting @@ -61,9 +58,7 @@ geometry: cylinderOutlineGeometry, modelMatrix: modelMatrix, attributes: { - color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.WHITE - ), + color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.WHITE), }, }); // Add the instance to primitives. @@ -76,7 +71,7 @@ lineWidth: Math.min(2.0, scene.maximumAliasedLineWidth), }, }), - }) + }), ); //Sandcastle_End }; diff --git a/Apps/Sandcastle/gallery/development/Cylinder.html b/Apps/Sandcastle/gallery/development/Cylinder.html index 5a57f3d36217..17bb0bdb6d70 100644 --- a/Apps/Sandcastle/gallery/development/Cylinder.html +++ b/Apps/Sandcastle/gallery/development/Cylinder.html @@ -1,4 +1,4 @@ - + @@ -18,10 +18,7 @@ > - + @@ -47,7 +44,7 @@ let modelMatrix = Cesium.Matrix4.multiplyByTranslation( Cesium.Transforms.eastNorthUpToFixedFrame(positionOnEllipsoid), new Cesium.Cartesian3(0.0, 0.0, length * 0.5), - new Cesium.Matrix4() + new Cesium.Matrix4(), ); // Create the cylinder geometry. let cylinderGeometry = new Cesium.CylinderGeometry({ @@ -63,9 +60,7 @@ geometry: cylinderGeometry, modelMatrix: modelMatrix, attributes: { - color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.GREEN - ), + color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.GREEN), }, }); @@ -75,7 +70,7 @@ modelMatrix = Cesium.Matrix4.multiplyByTranslation( Cesium.Transforms.eastNorthUpToFixedFrame(positionOnEllipsoid), new Cesium.Cartesian3(0.0, 0.0, length * 0.5), - new Cesium.Matrix4() + new Cesium.Matrix4(), ); // Create the cylinder geometry. To create a cone, set the // top radius to zero. @@ -91,9 +86,7 @@ geometry: cylinderGeometry, modelMatrix: modelMatrix, attributes: { - color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.RED - ), + color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.RED), }, }); @@ -105,7 +98,7 @@ closed: true, translucent: false, }), - }) + }), ); //Sandcastle_End }; diff --git a/Apps/Sandcastle/gallery/development/Display Conditions.html b/Apps/Sandcastle/gallery/development/Display Conditions.html index 1c38d42e364d..fe1fa2a209dc 100644 --- a/Apps/Sandcastle/gallery/development/Display Conditions.html +++ b/Apps/Sandcastle/gallery/development/Display Conditions.html @@ -1,4 +1,4 @@ - + @@ -18,10 +18,7 @@ > - + @@ -38,43 +35,35 @@ function addBillboardAndPrimitive() { Sandcastle.declare(addBillboardAndPrimitive); - const billboards = scene.primitives.add( - new Cesium.BillboardCollection() - ); + const billboards = scene.primitives.add(new Cesium.BillboardCollection()); billboards.add({ image: "../images/facility.gif", position: Cesium.Cartesian3.fromDegrees(-77, 40.5), - distanceDisplayCondition: new Cesium.DistanceDisplayCondition( - 5.5e6 - ), + distanceDisplayCondition: new Cesium.DistanceDisplayCondition(5.5e6), }); scene.primitives.add( new Cesium.Primitive({ geometryInstances: new Cesium.GeometryInstance({ geometry: new Cesium.RectangleGeometry({ - rectangle: Cesium.Rectangle.fromDegrees( - -80.5, - 39.7, - -75.1, - 42.0 - ), + rectangle: Cesium.Rectangle.fromDegrees(-80.5, 39.7, -75.1, 42.0), vertexFormat: Cesium.PerInstanceColorAppearance.VERTEX_FORMAT, }), attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor( - new Cesium.Color(1.0, 0.0, 0.0, 0.5) - ), - distanceDisplayCondition: new Cesium.DistanceDisplayConditionGeometryInstanceAttribute( - 0.0, - 5.5e6 + new Cesium.Color(1.0, 0.0, 0.0, 0.5), ), + distanceDisplayCondition: + new Cesium.DistanceDisplayConditionGeometryInstanceAttribute( + 0.0, + 5.5e6, + ), }, }), appearance: new Cesium.PerInstanceColorAppearance({ closed: true, }), - }) + }), ); } @@ -84,28 +73,21 @@ const position = Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883); const pointPrimitives = scene.primitives.add( - new Cesium.PointPrimitiveCollection() + new Cesium.PointPrimitiveCollection(), ); pointPrimitives.add({ color: Cesium.Color.YELLOW, position: position, - distanceDisplayCondition: new Cesium.DistanceDisplayCondition( - 250.5 - ), + distanceDisplayCondition: new Cesium.DistanceDisplayCondition(250.5), }); try { scene.primitives.add( await Cesium.Model.fromGltfAsync({ url: "../../SampleData/models/GroundVehicle/GroundVehicle.glb", - modelMatrix: Cesium.Transforms.eastNorthUpToFixedFrame( - position - ), - distanceDisplayCondition: new Cesium.DistanceDisplayCondition( - 0.0, - 250.5 - ), - }) + modelMatrix: Cesium.Transforms.eastNorthUpToFixedFrame(position), + distanceDisplayCondition: new Cesium.DistanceDisplayCondition(0.0, 250.5), + }), ); } catch (error) { window.alert(error); diff --git a/Apps/Sandcastle/gallery/development/Ellipse Outline.html b/Apps/Sandcastle/gallery/development/Ellipse Outline.html index 9201ba04d348..6968c0d09b43 100644 --- a/Apps/Sandcastle/gallery/development/Ellipse Outline.html +++ b/Apps/Sandcastle/gallery/development/Ellipse Outline.html @@ -1,4 +1,4 @@ - + @@ -18,10 +18,7 @@ > - + @@ -49,9 +46,7 @@ const ellipseOutlineInstance = new Cesium.GeometryInstance({ geometry: ellipseOutlineGeometry, attributes: { - color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.WHITE - ), + color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.WHITE), }, }); @@ -75,26 +70,21 @@ const extrudedEllipseOutlineInstance = new Cesium.GeometryInstance({ geometry: ellipseOutlineGeometry, attributes: { - color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.WHITE - ), + color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.WHITE), }, }); // Add both ellipse outline instances to primitives. scene.primitives.add( new Cesium.Primitive({ - geometryInstances: [ - ellipseOutlineInstance, - extrudedEllipseOutlineInstance, - ], + geometryInstances: [ellipseOutlineInstance, extrudedEllipseOutlineInstance], appearance: new Cesium.PerInstanceColorAppearance({ flat: true, renderState: { lineWidth: Math.min(2.0, scene.maximumAliasedLineWidth), }, }), - }) + }), ); //Sandcastle_End }; if (typeof Cesium !== "undefined") { diff --git a/Apps/Sandcastle/gallery/development/Ellipse.html b/Apps/Sandcastle/gallery/development/Ellipse.html index e0eb58f1d6ce..8599cfc898e2 100644 --- a/Apps/Sandcastle/gallery/development/Ellipse.html +++ b/Apps/Sandcastle/gallery/development/Ellipse.html @@ -1,4 +1,4 @@ - + @@ -18,10 +18,7 @@ > - + @@ -51,9 +48,7 @@ const redEllipseInstance = new Cesium.GeometryInstance({ geometry: ellipseGeometry, attributes: { - color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.RED - ), + color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.RED), }, }); @@ -76,9 +71,7 @@ const greenEllipseInstance = new Cesium.GeometryInstance({ geometry: ellipseGeometry, attributes: { - color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.GREEN - ), + color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.GREEN), }, }); @@ -99,9 +92,7 @@ const blueEllipseInstance = new Cesium.GeometryInstance({ geometry: ellipseGeometry, attributes: { - color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.BLUE - ), + color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.BLUE), }, }); @@ -117,7 +108,7 @@ translucent: false, closed: true, }), - }) + }), ); //Sandcastle_End }; diff --git a/Apps/Sandcastle/gallery/development/Ellipsoid Outline.html b/Apps/Sandcastle/gallery/development/Ellipsoid Outline.html index 867c86da985b..4a5e263e0dc8 100644 --- a/Apps/Sandcastle/gallery/development/Ellipsoid Outline.html +++ b/Apps/Sandcastle/gallery/development/Ellipsoid Outline.html @@ -1,4 +1,4 @@ - + @@ -18,10 +18,7 @@ > - + @@ -44,7 +41,7 @@ const modelMatrix = Cesium.Matrix4.multiplyByTranslation( Cesium.Transforms.eastNorthUpToFixedFrame(positionOnEllipsoid), new Cesium.Cartesian3(0.0, 0.0, radii.z), - new Cesium.Matrix4() + new Cesium.Matrix4(), ); // Create a ellipsoid geometry. const ellipsoidOutlineGeometry = new Cesium.EllipsoidOutlineGeometry({ @@ -58,9 +55,7 @@ geometry: ellipsoidOutlineGeometry, modelMatrix: modelMatrix, attributes: { - color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.WHITE - ), + color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.WHITE), }, }); // Add the geometry instance to primitives. @@ -73,7 +68,7 @@ lineWidth: Math.min(2.0, scene.maximumAliasedLineWidth), }, }), - }) + }), ); //Sandcastle_End }; diff --git a/Apps/Sandcastle/gallery/development/Ellipsoid Surface.html b/Apps/Sandcastle/gallery/development/Ellipsoid Surface.html index f46de33cf419..65696cbbe6b8 100644 --- a/Apps/Sandcastle/gallery/development/Ellipsoid Surface.html +++ b/Apps/Sandcastle/gallery/development/Ellipsoid Surface.html @@ -1,4 +1,4 @@ - + @@ -21,10 +21,7 @@ > - + @@ -47,19 +44,14 @@ new Cesium.Primitive({ geometryInstances: new Cesium.GeometryInstance({ geometry: new Cesium.RectangleGeometry({ - rectangle: Cesium.Rectangle.fromDegrees( - -120.0, - 30.0, - -110.0, - 40.0 - ), + rectangle: Cesium.Rectangle.fromDegrees(-120.0, 30.0, -110.0, 40.0), vertexFormat: Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT, }), }), appearance: new Cesium.EllipsoidSurfaceAppearance({ material: Cesium.Material.fromType("Stripe"), }), - }) + }), ); // Dot Material @@ -67,19 +59,14 @@ new Cesium.Primitive({ geometryInstances: new Cesium.GeometryInstance({ geometry: new Cesium.RectangleGeometry({ - rectangle: Cesium.Rectangle.fromDegrees( - -110.0, - 30.0, - -100.0, - 40.0 - ), + rectangle: Cesium.Rectangle.fromDegrees(-110.0, 30.0, -100.0, 40.0), vertexFormat: Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT, }), }), appearance: new Cesium.EllipsoidSurfaceAppearance({ material: Cesium.Material.fromType("Dot"), }), - }) + }), ); // Checkerboard Material @@ -87,19 +74,14 @@ new Cesium.Primitive({ geometryInstances: new Cesium.GeometryInstance({ geometry: new Cesium.RectangleGeometry({ - rectangle: Cesium.Rectangle.fromDegrees( - -100.0, - 30.0, - -90.0, - 40.0 - ), + rectangle: Cesium.Rectangle.fromDegrees(-100.0, 30.0, -90.0, 40.0), vertexFormat: Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT, }), }), appearance: new Cesium.EllipsoidSurfaceAppearance({ material: Cesium.Material.fromType("Checkerboard"), }), - }) + }), ); // Grid Material @@ -107,19 +89,14 @@ new Cesium.Primitive({ geometryInstances: new Cesium.GeometryInstance({ geometry: new Cesium.RectangleGeometry({ - rectangle: Cesium.Rectangle.fromDegrees( - -90.0, - 30.0, - -80.0, - 40.0 - ), + rectangle: Cesium.Rectangle.fromDegrees(-90.0, 30.0, -80.0, 40.0), vertexFormat: Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT, }), }), appearance: new Cesium.EllipsoidSurfaceAppearance({ material: Cesium.Material.fromType("Grid"), }), - }) + }), ); //Sandcastle_End }; diff --git a/Apps/Sandcastle/gallery/development/Ellipsoid.html b/Apps/Sandcastle/gallery/development/Ellipsoid.html index 27720c6d4adc..00511b06226e 100644 --- a/Apps/Sandcastle/gallery/development/Ellipsoid.html +++ b/Apps/Sandcastle/gallery/development/Ellipsoid.html @@ -1,4 +1,4 @@ - + @@ -18,10 +18,7 @@ > - + @@ -46,7 +43,7 @@ const modelMatrix = Cesium.Matrix4.multiplyByTranslation( Cesium.Transforms.eastNorthUpToFixedFrame(positionOnEllipsoid), new Cesium.Cartesian3(0.0, 0.0, radii.z), - new Cesium.Matrix4() + new Cesium.Matrix4(), ); // Create a ellipsoid geometry. const ellipsoidGeometry = new Cesium.EllipsoidGeometry({ @@ -59,9 +56,7 @@ geometry: ellipsoidGeometry, modelMatrix: modelMatrix, attributes: { - color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.BLUE - ), + color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.BLUE), }, }); // Add the geometry instance to primitives. @@ -72,7 +67,7 @@ translucent: false, closed: true, }), - }) + }), ); //Sandcastle_End }; diff --git a/Apps/Sandcastle/gallery/development/Fog.html b/Apps/Sandcastle/gallery/development/Fog.html index 1cee8891ab10..dbd30f10b647 100644 --- a/Apps/Sandcastle/gallery/development/Fog.html +++ b/Apps/Sandcastle/gallery/development/Fog.html @@ -1,4 +1,4 @@ - + @@ -18,10 +18,7 @@ > - + @@ -81,11 +78,9 @@ viewer.scene.fog.density = newValue; }); - Cesium.knockout - .getObservable(viewModel, "sse") - .subscribe(function (newValue) { - viewer.scene.fog.screenSpaceErrorFactor = newValue; - }); + Cesium.knockout.getObservable(viewModel, "sse").subscribe(function (newValue) { + viewer.scene.fog.screenSpaceErrorFactor = newValue; + }); viewModel.enabled = viewer.scene.fog.enabled; viewModel.density = viewer.scene.fog.density; @@ -96,7 +91,7 @@ destination: new Cesium.Cartesian3( -2467730.5740817646, -4390507.315824514, - 3906155.113316938 + 3906155.113316938, ), orientation: { heading: 4.492211521856625, @@ -110,7 +105,7 @@ destination: new Cesium.Cartesian3( -734001.9511656855, -4214090.596769834, - 4715898.125886317 + 4715898.125886317, ), orientation: { heading: 5.634257362559497, diff --git a/Apps/Sandcastle/gallery/development/Frustum.html b/Apps/Sandcastle/gallery/development/Frustum.html index 82ea8dc2d3a5..b5b1e72e4580 100644 --- a/Apps/Sandcastle/gallery/development/Frustum.html +++ b/Apps/Sandcastle/gallery/development/Frustum.html @@ -1,4 +1,4 @@ - + @@ -18,10 +18,7 @@ > - + @@ -36,20 +33,14 @@ const viewer = new Cesium.Viewer("cesiumContainer"); const scene = viewer.scene; - const positionOnEllipsoid = Cesium.Cartesian3.fromDegrees( - -105.0, - 45.0, - 20.0 - ); + const positionOnEllipsoid = Cesium.Cartesian3.fromDegrees(-105.0, 45.0, 20.0); - const enu = Cesium.Transforms.eastNorthUpToFixedFrame( - positionOnEllipsoid - ); + const enu = Cesium.Transforms.eastNorthUpToFixedFrame(positionOnEllipsoid); const rotation = Cesium.Matrix4.getMatrix3(enu, new Cesium.Matrix3()); Cesium.Matrix3.multiply( rotation, Cesium.Matrix3.fromRotationX(-Cesium.Math.PI_OVER_TWO), - rotation + rotation, ); const orientation = Cesium.Quaternion.fromRotationMatrix(rotation); @@ -71,7 +62,7 @@ geometry: frustumGeometry, attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor( - new Cesium.Color(1.0, 0.0, 0.0, 0.5) + new Cesium.Color(1.0, 0.0, 0.0, 0.5), ), }, id: "frustum", @@ -84,7 +75,7 @@ closed: true, flat: true, }), - }) + }), ); scene.primitives.add( new Cesium.Primitive({ @@ -96,14 +87,14 @@ }), attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor( - new Cesium.Color(0.0, 0.0, 0.0, 1.0) + new Cesium.Color(0.0, 0.0, 0.0, 1.0), ), }, }), appearance: new Cesium.PerInstanceColorAppearance({ flat: true, }), - }) + }), ); const removeListener = scene.postRender.addEventListener(() => { @@ -111,8 +102,8 @@ return; } - const bs = frustumPrimitive.getGeometryInstanceAttributes("frustum") - .boundingSphere; + const bs = + frustumPrimitive.getGeometryInstanceAttributes("frustum").boundingSphere; scene.camera.viewBoundingSphere(bs); scene.camera.lookAtTransform(Cesium.Matrix4.IDENTITY); diff --git a/Apps/Sandcastle/gallery/development/Geometry Offset Attribute box cylinder ellipsoid.html b/Apps/Sandcastle/gallery/development/Geometry Offset Attribute box cylinder ellipsoid.html index 9c93e561567f..356e5feed865 100644 --- a/Apps/Sandcastle/gallery/development/Geometry Offset Attribute box cylinder ellipsoid.html +++ b/Apps/Sandcastle/gallery/development/Geometry Offset Attribute box cylinder ellipsoid.html @@ -1,4 +1,4 @@ - + @@ -18,10 +18,7 @@ > - + @@ -45,13 +42,13 @@ let offset = Cesium.Cartesian3.multiplyByScalar( ellipsoid.geodeticSurfaceNormal(center1), 100000, - new Cesium.Cartesian3() + new Cesium.Cartesian3(), ); const dimensions = new Cesium.Cartesian3(400000.0, 300000.0, 500000.0); const boxModelMatrix = Cesium.Matrix4.multiplyByTranslation( Cesium.Transforms.eastNorthUpToFixedFrame(center1), new Cesium.Cartesian3(0.0, 0.0, dimensions.z * 0.5), - new Cesium.Matrix4() + new Cesium.Matrix4(), ); const i1 = new Cesium.GeometryInstance({ @@ -64,11 +61,9 @@ modelMatrix: boxModelMatrix, attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor( - new Cesium.Color(1.0, 0.0, 0.0, 0.5) - ), - offset: Cesium.OffsetGeometryInstanceAttribute.fromCartesian3( - offset + new Cesium.Color(1.0, 0.0, 0.0, 0.5), ), + offset: Cesium.OffsetGeometryInstanceAttribute.fromCartesian3(offset), }, }); @@ -80,12 +75,8 @@ }), modelMatrix: boxModelMatrix, attributes: { - color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.WHITE - ), - offset: Cesium.OffsetGeometryInstanceAttribute.fromCartesian3( - offset - ), + color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.WHITE), + offset: Cesium.OffsetGeometryInstanceAttribute.fromCartesian3(offset), }, }); @@ -93,7 +84,7 @@ offset = Cesium.Cartesian3.multiplyByScalar( ellipsoid.geodeticSurfaceNormal(center2), 100000, - new Cesium.Cartesian3() + new Cesium.Cartesian3(), ); const length = 400000.0; const topRad = 200000.0; @@ -101,7 +92,7 @@ const cylinderModelMatrix = Cesium.Matrix4.multiplyByTranslation( Cesium.Transforms.eastNorthUpToFixedFrame(center2), new Cesium.Cartesian3(0.0, 0.0, length * 0.5), - new Cesium.Matrix4() + new Cesium.Matrix4(), ); const i2 = new Cesium.GeometryInstance({ @@ -116,11 +107,9 @@ modelMatrix: cylinderModelMatrix, attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor( - new Cesium.Color(1.0, 0.0, 0.0, 0.5) - ), - offset: Cesium.OffsetGeometryInstanceAttribute.fromCartesian3( - offset + new Cesium.Color(1.0, 0.0, 0.0, 0.5), ), + offset: Cesium.OffsetGeometryInstanceAttribute.fromCartesian3(offset), }, }); @@ -135,12 +124,8 @@ }), modelMatrix: cylinderModelMatrix, attributes: { - color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.WHITE - ), - offset: Cesium.OffsetGeometryInstanceAttribute.fromCartesian3( - offset - ), + color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.WHITE), + offset: Cesium.OffsetGeometryInstanceAttribute.fromCartesian3(offset), }, }); @@ -148,13 +133,13 @@ offset = Cesium.Cartesian3.multiplyByScalar( ellipsoid.geodeticSurfaceNormal(center3), 100000, - new Cesium.Cartesian3() + new Cesium.Cartesian3(), ); const radii = new Cesium.Cartesian3(200000.0, 200000.0, 300000.0); const ellipsoidModelMatrix = Cesium.Matrix4.multiplyByTranslation( Cesium.Transforms.eastNorthUpToFixedFrame(center3), new Cesium.Cartesian3(0.0, 0.0, radii.z), - new Cesium.Matrix4() + new Cesium.Matrix4(), ); const i3 = new Cesium.GeometryInstance({ id: id3, @@ -166,11 +151,9 @@ modelMatrix: ellipsoidModelMatrix, attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor( - new Cesium.Color(1.0, 0.0, 0.0, 0.5) - ), - offset: Cesium.OffsetGeometryInstanceAttribute.fromCartesian3( - offset + new Cesium.Color(1.0, 0.0, 0.0, 0.5), ), + offset: Cesium.OffsetGeometryInstanceAttribute.fromCartesian3(offset), }, }); const o3 = new Cesium.GeometryInstance({ @@ -183,12 +166,8 @@ }), modelMatrix: ellipsoidModelMatrix, attributes: { - color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.WHITE - ), - offset: Cesium.OffsetGeometryInstanceAttribute.fromCartesian3( - offset - ), + color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.WHITE), + offset: Cesium.OffsetGeometryInstanceAttribute.fromCartesian3(offset), }, }); @@ -199,7 +178,7 @@ closed: true, }), asynchronous: false, - }) + }), ); const o = scene.primitives.add( new Cesium.Primitive({ @@ -211,7 +190,7 @@ }, }), asynchronous: false, - }) + }), ); Sandcastle.addToolbarButton("Move box", function () { @@ -219,22 +198,22 @@ offset = Cesium.Cartesian3.multiplyByScalar( ellipsoid.geodeticSurfaceNormal(center1), 150000, - new Cesium.Cartesian3() + new Cesium.Cartesian3(), ); attributes.offset = Cesium.OffsetGeometryInstanceAttribute.toValue( offset, - attributes.offset + attributes.offset, ); attributes = o.getGeometryInstanceAttributes(id1); offset = Cesium.Cartesian3.multiplyByScalar( ellipsoid.geodeticSurfaceNormal(center1), 150000, - new Cesium.Cartesian3() + new Cesium.Cartesian3(), ); attributes.offset = Cesium.OffsetGeometryInstanceAttribute.toValue( offset, - attributes.offset + attributes.offset, ); }); @@ -243,22 +222,22 @@ offset = Cesium.Cartesian3.multiplyByScalar( ellipsoid.geodeticSurfaceNormal(center2), 150000, - new Cesium.Cartesian3() + new Cesium.Cartesian3(), ); attributes.offset = Cesium.OffsetGeometryInstanceAttribute.toValue( offset, - attributes.offset + attributes.offset, ); attributes = o.getGeometryInstanceAttributes(id2); offset = Cesium.Cartesian3.multiplyByScalar( ellipsoid.geodeticSurfaceNormal(center2), 150000, - new Cesium.Cartesian3() + new Cesium.Cartesian3(), ); attributes.offset = Cesium.OffsetGeometryInstanceAttribute.toValue( offset, - attributes.offset + attributes.offset, ); }); @@ -267,22 +246,22 @@ offset = Cesium.Cartesian3.multiplyByScalar( ellipsoid.geodeticSurfaceNormal(center3), 150000, - new Cesium.Cartesian3() + new Cesium.Cartesian3(), ); attributes.offset = Cesium.OffsetGeometryInstanceAttribute.toValue( offset, - attributes.offset + attributes.offset, ); attributes = o.getGeometryInstanceAttributes(id3); offset = Cesium.Cartesian3.multiplyByScalar( ellipsoid.geodeticSurfaceNormal(center3), 150000, - new Cesium.Cartesian3() + new Cesium.Cartesian3(), ); attributes.offset = Cesium.OffsetGeometryInstanceAttribute.toValue( offset, - attributes.offset + attributes.offset, ); }); //Sandcastle_End diff --git a/Apps/Sandcastle/gallery/development/Geometry Offset Attribute.html b/Apps/Sandcastle/gallery/development/Geometry Offset Attribute.html index c101eea0c942..edc516c0f208 100644 --- a/Apps/Sandcastle/gallery/development/Geometry Offset Attribute.html +++ b/Apps/Sandcastle/gallery/development/Geometry Offset Attribute.html @@ -1,4 +1,4 @@ - + @@ -18,10 +18,7 @@ > - + @@ -47,7 +44,7 @@ let offset = Cesium.Cartesian3.multiplyByScalar( ellipsoid.geodeticSurfaceNormal(center1), 100000, - new Cesium.Cartesian3() + new Cesium.Cartesian3(), ); const i1 = new Cesium.GeometryInstance({ @@ -61,11 +58,9 @@ }), attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor( - new Cesium.Color(1.0, 0.0, 0.0, 0.5) - ), - offset: Cesium.OffsetGeometryInstanceAttribute.fromCartesian3( - offset + new Cesium.Color(1.0, 0.0, 0.0, 0.5), ), + offset: Cesium.OffsetGeometryInstanceAttribute.fromCartesian3(offset), }, }); const o1 = new Cesium.GeometryInstance({ @@ -77,12 +72,8 @@ offsetAttribute: Cesium.GeometryOffsetAttribute.TOP, }), attributes: { - color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.WHITE - ), - offset: Cesium.OffsetGeometryInstanceAttribute.fromCartesian3( - offset - ), + color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.WHITE), + offset: Cesium.OffsetGeometryInstanceAttribute.fromCartesian3(offset), }, }); @@ -101,10 +92,10 @@ }), attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor( - new Cesium.Color(0.0, 1.0, 0.0, 0.5) + new Cesium.Color(0.0, 1.0, 0.0, 0.5), ), offset: Cesium.OffsetGeometryInstanceAttribute.fromCartesian3( - Cesium.Cartesian3.ZERO + Cesium.Cartesian3.ZERO, ), }, }); @@ -117,11 +108,9 @@ offsetAttribute: Cesium.GeometryOffsetAttribute.TOP, }), attributes: { - color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.WHITE - ), + color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.WHITE), offset: Cesium.OffsetGeometryInstanceAttribute.fromCartesian3( - Cesium.Cartesian3.ZERO + Cesium.Cartesian3.ZERO, ), }, }); @@ -132,7 +121,7 @@ offset = Cesium.Cartesian3.multiplyByScalar( ellipsoid.geodeticSurfaceNormal(center3), 100000, - new Cesium.Cartesian3() + new Cesium.Cartesian3(), ); const i3 = new Cesium.GeometryInstance({ id: id3, @@ -145,11 +134,9 @@ }), attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor( - new Cesium.Color(0.0, 0.0, 1.0, 0.5) - ), - offset: Cesium.OffsetGeometryInstanceAttribute.fromCartesian3( - offset + new Cesium.Color(0.0, 0.0, 1.0, 0.5), ), + offset: Cesium.OffsetGeometryInstanceAttribute.fromCartesian3(offset), }, }); const o3 = new Cesium.GeometryInstance({ @@ -161,12 +148,8 @@ offsetAttribute: Cesium.GeometryOffsetAttribute.ALL, }), attributes: { - color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.WHITE - ), - offset: Cesium.OffsetGeometryInstanceAttribute.fromCartesian3( - offset - ), + color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.WHITE), + offset: Cesium.OffsetGeometryInstanceAttribute.fromCartesian3(offset), }, }); @@ -177,7 +160,7 @@ closed: true, }), asynchronous: false, - }) + }), ); const o = scene.primitives.add( new Cesium.Primitive({ @@ -189,7 +172,7 @@ }, }), asynchronous: false, - }) + }), ); Sandcastle.addToolbarButton("1", function () { @@ -197,22 +180,22 @@ offset = Cesium.Cartesian3.multiplyByScalar( ellipsoid.geodeticSurfaceNormal(center1), 150000, - new Cesium.Cartesian3() + new Cesium.Cartesian3(), ); attributes.offset = Cesium.OffsetGeometryInstanceAttribute.toValue( offset, - attributes.offset + attributes.offset, ); attributes = o.getGeometryInstanceAttributes(id1); offset = Cesium.Cartesian3.multiplyByScalar( ellipsoid.geodeticSurfaceNormal(center1), 150000, - new Cesium.Cartesian3() + new Cesium.Cartesian3(), ); attributes.offset = Cesium.OffsetGeometryInstanceAttribute.toValue( offset, - attributes.offset + attributes.offset, ); }); Sandcastle.addToolbarButton("2", function () { @@ -220,22 +203,22 @@ offset = Cesium.Cartesian3.multiplyByScalar( ellipsoid.geodeticSurfaceNormal(center2), 100000, - new Cesium.Cartesian3() + new Cesium.Cartesian3(), ); attributes.offset = Cesium.OffsetGeometryInstanceAttribute.toValue( offset, - attributes.offset + attributes.offset, ); attributes = o.getGeometryInstanceAttributes(id2); offset = Cesium.Cartesian3.multiplyByScalar( ellipsoid.geodeticSurfaceNormal(center2), 100000, - new Cesium.Cartesian3() + new Cesium.Cartesian3(), ); attributes.offset = Cesium.OffsetGeometryInstanceAttribute.toValue( offset, - attributes.offset + attributes.offset, ); }); Sandcastle.addToolbarButton("3", function () { @@ -243,22 +226,22 @@ offset = Cesium.Cartesian3.multiplyByScalar( ellipsoid.geodeticSurfaceNormal(center3), 150000, - new Cesium.Cartesian3() + new Cesium.Cartesian3(), ); attributes.offset = Cesium.OffsetGeometryInstanceAttribute.toValue( offset, - attributes.offset + attributes.offset, ); attributes = o.getGeometryInstanceAttributes(id3); offset = Cesium.Cartesian3.multiplyByScalar( ellipsoid.geodeticSurfaceNormal(center3), 150000, - new Cesium.Cartesian3() + new Cesium.Cartesian3(), ); attributes.offset = Cesium.OffsetGeometryInstanceAttribute.toValue( offset, - attributes.offset + attributes.offset, ); }); diff --git a/Apps/Sandcastle/gallery/development/Geometry and Appearances.html b/Apps/Sandcastle/gallery/development/Geometry and Appearances.html index 95f22d7cfd0b..88e0caca9a95 100644 --- a/Apps/Sandcastle/gallery/development/Geometry and Appearances.html +++ b/Apps/Sandcastle/gallery/development/Geometry and Appearances.html @@ -1,4 +1,4 @@ - + @@ -21,10 +21,7 @@ > - + @@ -40,7 +37,7 @@ const scene = viewer.scene; const primitives = scene.primitives; const solidWhite = Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.WHITE + Cesium.Color.WHITE, ); // Combine instances for a rectangle, polygon, ellipse, and circle into a single primitive. @@ -63,16 +60,7 @@ }); let positions = Cesium.Cartesian3.fromDegreesArray([ - -107.0, - 27.0, - -107.0, - 22.0, - -102.0, - 23.0, - -97.0, - 21.0, - -97.0, - 25.0, + -107.0, 27.0, -107.0, 22.0, -102.0, 23.0, -97.0, 21.0, -97.0, 25.0, ]); let polygonInstance = new Cesium.GeometryInstance({ @@ -147,7 +135,7 @@ appearance: new Cesium.EllipsoidSurfaceAppearance({ material: Cesium.Material.fromType("Stripe"), }), - }) + }), ); primitives.add( new Cesium.Primitive({ @@ -164,7 +152,7 @@ lineWidth: Math.min(4.0, scene.maximumAliasedLineWidth), }, }), - }) + }), ); // Create extruded rectangle @@ -178,7 +166,7 @@ }), attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.fromRandom({ alpha: 1.0 }) + Cesium.Color.fromRandom({ alpha: 1.0 }), ), }, }); @@ -212,7 +200,7 @@ }), attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.fromRandom({ alpha: 1.0 }) + Cesium.Color.fromRandom({ alpha: 1.0 }), ), }, }); @@ -233,14 +221,7 @@ // Create extruded polygon let polygonHierarchy = { positions: Cesium.Cartesian3.fromDegreesArray([ - -118.0, - 30.0, - -115.0, - 30.0, - -117.1, - 31.1, - -118.0, - 33.0, + -118.0, 30.0, -115.0, 30.0, -117.1, 31.1, -118.0, 33.0, ]), }; height = 300000.0; @@ -254,7 +235,7 @@ }), attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.fromRandom({ alpha: 1.0 }) + Cesium.Color.fromRandom({ alpha: 1.0 }), ), }, }); @@ -275,10 +256,10 @@ let bottomRadius = 150000.0; let modelMatrix = Cesium.Matrix4.multiplyByTranslation( Cesium.Transforms.eastNorthUpToFixedFrame( - Cesium.Cartesian3.fromDegrees(-70.0, 45.0) + Cesium.Cartesian3.fromDegrees(-70.0, 45.0), ), new Cesium.Cartesian3(0.0, 0.0, 100000.0), - new Cesium.Matrix4() + new Cesium.Matrix4(), ); let cylinderInstance = new Cesium.GeometryInstance({ geometry: new Cesium.CylinderGeometry({ @@ -290,7 +271,7 @@ modelMatrix: modelMatrix, attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.fromRandom({ alpha: 1.0 }) + Cesium.Color.fromRandom({ alpha: 1.0 }), ), }, }); @@ -318,7 +299,7 @@ translucent: false, closed: true, }), - }) + }), ); primitives.add( new Cesium.Primitive({ @@ -335,7 +316,7 @@ lineWidth: Math.min(4.0, scene.maximumAliasedLineWidth), }, }), - }) + }), ); // Create box and ellipsoid boxes, and use the instance's @@ -382,35 +363,35 @@ boxModelMatrix = Cesium.Matrix4.multiplyByUniformScale( Cesium.Matrix4.multiplyByTranslation( Cesium.Transforms.eastNorthUpToFixedFrame( - Cesium.Cartesian3.fromDegrees(-106.0, 45.0) + Cesium.Cartesian3.fromDegrees(-106.0, 45.0), ), new Cesium.Cartesian3(0.0, 0.0, height), - new Cesium.Matrix4() + new Cesium.Matrix4(), ), 90000.0, - new Cesium.Matrix4() + new Cesium.Matrix4(), ); ellipsoidModelMatrix = Cesium.Matrix4.multiplyByUniformScale( Cesium.Matrix4.multiplyByTranslation( Cesium.Transforms.eastNorthUpToFixedFrame( - Cesium.Cartesian3.fromDegrees(-102.0, 45.0) + Cesium.Cartesian3.fromDegrees(-102.0, 45.0), ), new Cesium.Cartesian3(0.0, 0.0, height), - new Cesium.Matrix4() + new Cesium.Matrix4(), ), 90000.0, - new Cesium.Matrix4() + new Cesium.Matrix4(), ); sphereModelMatrix = Cesium.Matrix4.multiplyByUniformScale( Cesium.Matrix4.multiplyByTranslation( Cesium.Transforms.eastNorthUpToFixedFrame( - Cesium.Cartesian3.fromDegrees(-98.0, 45.0) + Cesium.Cartesian3.fromDegrees(-98.0, 45.0), ), new Cesium.Cartesian3(0.0, 0.0, height), - new Cesium.Matrix4() + new Cesium.Matrix4(), ), 90000.0, - new Cesium.Matrix4() + new Cesium.Matrix4(), ); instances.push( @@ -419,10 +400,10 @@ modelMatrix: boxModelMatrix, attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.fromRandom({ alpha: 1.0 }) + Cesium.Color.fromRandom({ alpha: 1.0 }), ), }, - }) + }), ); outlineInstances.push( new Cesium.GeometryInstance({ @@ -431,7 +412,7 @@ attributes: { color: solidWhite, }, - }) + }), ); instances.push( @@ -440,10 +421,10 @@ modelMatrix: ellipsoidModelMatrix, attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.fromRandom({ alpha: 1.0 }) + Cesium.Color.fromRandom({ alpha: 1.0 }), ), }, - }) + }), ); outlineInstances.push( new Cesium.GeometryInstance({ @@ -452,7 +433,7 @@ attributes: { color: solidWhite, }, - }) + }), ); instances.push( @@ -461,10 +442,10 @@ modelMatrix: sphereModelMatrix, attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.fromRandom({ alpha: 1.0 }) + Cesium.Color.fromRandom({ alpha: 1.0 }), ), }, - }) + }), ); outlineInstances.push( new Cesium.GeometryInstance({ @@ -473,7 +454,7 @@ attributes: { color: solidWhite, }, - }) + }), ); } @@ -484,7 +465,7 @@ translucent: false, closed: true, }), - }) + }), ); primitives.add( new Cesium.Primitive({ @@ -496,17 +477,12 @@ lineWidth: Math.min(4.0, scene.maximumAliasedLineWidth), }, }), - }) + }), ); // Create a single wall positions = Cesium.Cartesian3.fromDegreesArray([ - -95.0, - 50.0, - -85.0, - 50.0, - -75.0, - 50.0, + -95.0, 50.0, -85.0, 50.0, -75.0, 50.0, ]); const maximumHeights = [500000, 1000000, 500000]; const minimumHeights = [0, 500000, 0]; @@ -520,7 +496,7 @@ }), attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.fromRandom({ alpha: 0.7 }) + Cesium.Color.fromRandom({ alpha: 0.7 }), ), }, }); @@ -532,12 +508,7 @@ minimumHeights: minimumHeights, }), attributes: { - color: new Cesium.ColorGeometryInstanceAttribute( - 0.7, - 0.7, - 0.7, - 1.0 - ), + color: new Cesium.ColorGeometryInstanceAttribute(0.7, 0.7, 0.7, 1.0), }, }); @@ -545,7 +516,7 @@ new Cesium.Primitive({ geometryInstances: wallInstance, appearance: new Cesium.PerInstanceColorAppearance(), - }) + }), ); primitives.add( new Cesium.Primitive({ @@ -557,7 +528,7 @@ lineWidth: Math.min(4.0, scene.maximumAliasedLineWidth), }, }), - }) + }), ); rectangle = Cesium.Rectangle.fromDegrees(-92.0, 30.0, -85.0, 40.0); @@ -570,50 +541,22 @@ polygonHierarchy = { positions: Cesium.Cartesian3.fromDegreesArray([ - -109.0, - 30.0, - -95.0, - 30.0, - -95.0, - 40.0, - -109.0, - 40.0, + -109.0, 30.0, -95.0, 30.0, -95.0, 40.0, -109.0, 40.0, ]), holes: [ { positions: Cesium.Cartesian3.fromDegreesArray([ - -107.0, - 31.0, - -107.0, - 39.0, - -97.0, - 39.0, - -97.0, - 31.0, + -107.0, 31.0, -107.0, 39.0, -97.0, 39.0, -97.0, 31.0, ]), holes: [ { positions: Cesium.Cartesian3.fromDegreesArray([ - -105.0, - 33.0, - -99.0, - 33.0, - -99.0, - 37.0, - -105.0, - 37.0, + -105.0, 33.0, -99.0, 33.0, -99.0, 37.0, -105.0, 37.0, ]), holes: [ { positions: Cesium.Cartesian3.fromDegreesArray([ - -103.0, - 34.0, - -101.0, - 34.0, - -101.0, - 36.0, - -103.0, - 36.0, + -103.0, 34.0, -101.0, 34.0, -101.0, 36.0, -103.0, 36.0, ]), }, ], @@ -664,7 +607,7 @@ appearance: new Cesium.EllipsoidSurfaceAppearance({ material: Cesium.Material.fromType("Stripe"), }), - }) + }), ); // Create extruded rectangle @@ -682,7 +625,7 @@ }), attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.fromRandom({ alpha: 1.0 }) + Cesium.Color.fromRandom({ alpha: 1.0 }), ), }, }); @@ -706,7 +649,7 @@ }), attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.fromRandom({ alpha: 1.0 }) + Cesium.Color.fromRandom({ alpha: 1.0 }), ), }, }); @@ -714,16 +657,7 @@ // Create extruded polygon polygonHierarchy = { positions: Cesium.Cartesian3.fromDegreesArray([ - -113.0, - 30.0, - -110.0, - 30.0, - -110.0, - 33.0, - -111.5, - 31.0, - -113.0, - 33.0, + -113.0, 30.0, -110.0, 30.0, -110.0, 33.0, -111.5, 31.0, -113.0, 33.0, ]), }; extrudedHeight = 300000.0; @@ -735,7 +669,7 @@ }), attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.fromRandom({ alpha: 1.0 }) + Cesium.Color.fromRandom({ alpha: 1.0 }), ), }, }); @@ -746,10 +680,10 @@ bottomRadius = 200000.0; modelMatrix = Cesium.Matrix4.multiplyByTranslation( Cesium.Transforms.eastNorthUpToFixedFrame( - Cesium.Cartesian3.fromDegrees(-70.0, 40.0) + Cesium.Cartesian3.fromDegrees(-70.0, 40.0), ), new Cesium.Cartesian3(0.0, 0.0, 200000.0), - new Cesium.Matrix4() + new Cesium.Matrix4(), ); cylinderInstance = new Cesium.GeometryInstance({ geometry: new Cesium.CylinderGeometry({ @@ -761,7 +695,7 @@ modelMatrix: modelMatrix, attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.fromRandom({ alpha: 1.0 }) + Cesium.Color.fromRandom({ alpha: 1.0 }), ), }, }); @@ -778,7 +712,7 @@ translucent: false, closed: true, }), - }) + }), ); // Combine instances each with a unique color. @@ -802,10 +736,10 @@ }), attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.fromRandom({ alpha: 0.5 }) + Cesium.Color.fromRandom({ alpha: 0.5 }), ), }, - }) + }), ); instances.push( @@ -817,10 +751,10 @@ }), attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.fromRandom({ alpha: 0.5 }) + Cesium.Color.fromRandom({ alpha: 0.5 }), ), }, - }) + }), ); } @@ -828,7 +762,7 @@ new Cesium.Primitive({ geometryInstances: instances, appearance: new Cesium.PerInstanceColorAppearance(), - }) + }), ); // Create box and ellipsoid boxes, and use the instance's @@ -858,35 +792,35 @@ boxModelMatrix = Cesium.Matrix4.multiplyByUniformScale( Cesium.Matrix4.multiplyByTranslation( Cesium.Transforms.eastNorthUpToFixedFrame( - Cesium.Cartesian3.fromDegrees(-108.0, 45.0) + Cesium.Cartesian3.fromDegrees(-108.0, 45.0), ), new Cesium.Cartesian3(0.0, 0.0, height), - new Cesium.Matrix4() + new Cesium.Matrix4(), ), 90000.0, - new Cesium.Matrix4() + new Cesium.Matrix4(), ); ellipsoidModelMatrix = Cesium.Matrix4.multiplyByUniformScale( Cesium.Matrix4.multiplyByTranslation( Cesium.Transforms.eastNorthUpToFixedFrame( - Cesium.Cartesian3.fromDegrees(-104.0, 45.0) + Cesium.Cartesian3.fromDegrees(-104.0, 45.0), ), new Cesium.Cartesian3(0.0, 0.0, height), - new Cesium.Matrix4() + new Cesium.Matrix4(), ), 90000.0, - new Cesium.Matrix4() + new Cesium.Matrix4(), ); sphereModelMatrix = Cesium.Matrix4.multiplyByUniformScale( Cesium.Matrix4.multiplyByTranslation( Cesium.Transforms.eastNorthUpToFixedFrame( - Cesium.Cartesian3.fromDegrees(-100.0, 45.0) + Cesium.Cartesian3.fromDegrees(-100.0, 45.0), ), new Cesium.Cartesian3(0.0, 0.0, height), - new Cesium.Matrix4() + new Cesium.Matrix4(), ), 90000.0, - new Cesium.Matrix4() + new Cesium.Matrix4(), ); instances.push( new Cesium.GeometryInstance({ @@ -894,10 +828,10 @@ modelMatrix: boxModelMatrix, attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.fromRandom({ alpha: 0.5 }) + Cesium.Color.fromRandom({ alpha: 0.5 }), ), }, - }) + }), ); instances.push( @@ -906,10 +840,10 @@ modelMatrix: ellipsoidModelMatrix, attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.fromRandom({ alpha: 0.5 }) + Cesium.Color.fromRandom({ alpha: 0.5 }), ), }, - }) + }), ); instances.push( @@ -918,10 +852,10 @@ modelMatrix: sphereModelMatrix, attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.fromRandom({ alpha: 0.5 }) + Cesium.Color.fromRandom({ alpha: 0.5 }), ), }, - }) + }), ); } @@ -932,7 +866,7 @@ translucent: true, closed: true, }), - }) + }), ); positions = []; @@ -958,7 +892,7 @@ lineWidth: Math.min(4.0, scene.maximumAliasedLineWidth), }, }), - }) + }), ); // create a polyline with a material @@ -977,11 +911,9 @@ }), }), appearance: new Cesium.PolylineMaterialAppearance({ - material: Cesium.Material.fromType( - Cesium.Material.PolylineGlowType - ), + material: Cesium.Material.fromType(Cesium.Material.PolylineGlowType), }), - }) + }), ); // create a polyline with per segment colors @@ -1003,7 +935,7 @@ }), }), appearance: new Cesium.PolylineColorAppearance(), - }) + }), ); // create a polyline with per vertex colors @@ -1026,26 +958,13 @@ }), }), appearance: new Cesium.PolylineColorAppearance(), - }) + }), ); // Create a single wall positions = Cesium.Cartesian3.fromDegreesArrayHeights([ - -90.0, - 43.0, - 100000.0, - -87.5, - 45.0, - 100000.0, - -85.0, - 43.0, - 100000.0, - -87.5, - 41.0, - 100000.0, - -90.0, - 43.0, - 100000.0, + -90.0, 43.0, 100000.0, -87.5, 45.0, 100000.0, -85.0, 43.0, 100000.0, -87.5, + 41.0, 100000.0, -90.0, 43.0, 100000.0, ]); wallInstance = new Cesium.GeometryInstance({ @@ -1062,16 +981,11 @@ repeat: new Cesium.Cartesian2(20.0, 6.0), }), }), - }) + }), ); positions = Cesium.Cartesian3.fromDegreesArray([ - -120.0, - 45.0, - -125.0, - 50.0, - -125.0, - 55.0, + -120.0, 45.0, -125.0, 50.0, -125.0, 55.0, ]); const width = 100000; @@ -1083,7 +997,7 @@ }), attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.fromRandom({ alpha: 1.0 }) + Cesium.Color.fromRandom({ alpha: 1.0 }), ), }, }); @@ -1098,7 +1012,7 @@ }), attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.fromRandom({ alpha: 0.7 }) + Cesium.Color.fromRandom({ alpha: 0.7 }), ), }, }); @@ -1123,7 +1037,7 @@ }), attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.fromRandom({ alpha: 0.7 }) + Cesium.Color.fromRandom({ alpha: 0.7 }), ), }, }); @@ -1135,7 +1049,7 @@ translucent: true, closed: true, }), - }) + }), ); primitives.add( @@ -1148,7 +1062,7 @@ lineWidth: Math.min(4.0, scene.maximumAliasedLineWidth), }, }), - }) + }), ); function starPositions(arms, rOuter, rInner) { @@ -1158,7 +1072,7 @@ const r = i % 2 === 0 ? rOuter : rInner; const p = new Cesium.Cartesian2( Math.cos(i * angle) * r, - Math.sin(i * angle) * r + Math.sin(i * angle) * r, ); pos.push(p); } @@ -1166,15 +1080,7 @@ } positions = Cesium.Cartesian3.fromDegreesArrayHeights([ - -102.0, - 15.0, - 100000.0, - -105.0, - 20.0, - 200000.0, - -110.0, - 20.0, - 100000.0, + -102.0, 15.0, 100000.0, -105.0, 20.0, 200000.0, -110.0, 20.0, 100000.0, ]); const polylineVolumeFill = new Cesium.GeometryInstance({ geometry: new Cesium.PolylineVolumeGeometry({ @@ -1184,7 +1090,7 @@ }), attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.fromRandom({ alpha: 1.0 }) + Cesium.Color.fromRandom({ alpha: 1.0 }), ), }, }); @@ -1202,19 +1108,14 @@ const polylineVolume = new Cesium.GeometryInstance({ geometry: new Cesium.PolylineVolumeGeometry({ polylinePositions: Cesium.Cartesian3.fromDegreesArray([ - -102.0, - 15.0, - -105.0, - 20.0, - -110.0, - 20.0, + -102.0, 15.0, -105.0, 20.0, -110.0, 20.0, ]), vertexFormat: Cesium.PerInstanceColorAppearance.VERTEX_FORMAT, shapePositions: starPositions(7, 30000, 20000), }), attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.fromRandom({ alpha: 1.0 }) + Cesium.Color.fromRandom({ alpha: 1.0 }), ), }, }); @@ -1226,8 +1127,8 @@ positions.push( new Cesium.Cartesian2( radius * Math.cos(radians), - radius * Math.sin(radians) - ) + radius * Math.sin(radians), + ), ); } return positions; @@ -1236,12 +1137,7 @@ const tubeGeometry = new Cesium.GeometryInstance({ geometry: new Cesium.PolylineVolumeGeometry({ polylinePositions: Cesium.Cartesian3.fromDegreesArray([ - -104.0, - 13.0, - -107.0, - 18.0, - -112.0, - 18.0, + -104.0, 13.0, -107.0, 18.0, -112.0, 18.0, ]), vertexFormat: Cesium.PerInstanceColorAppearance.VERTEX_FORMAT, shapePositions: computeCircle(40000.0), @@ -1253,16 +1149,12 @@ primitives.add( new Cesium.Primitive({ - geometryInstances: [ - tubeGeometry, - polylineVolume, - polylineVolumeFill, - ], + geometryInstances: [tubeGeometry, polylineVolume, polylineVolumeFill], appearance: new Cesium.PerInstanceColorAppearance({ translucent: false, closed: true, }), - }) + }), ); primitives.add( @@ -1275,7 +1167,7 @@ lineWidth: 1.0, }, }), - }) + }), ); //Sandcastle_End }; diff --git a/Apps/Sandcastle/gallery/development/Ground Polyline Material.html b/Apps/Sandcastle/gallery/development/Ground Polyline Material.html index 8114048e9668..5ec25c8d9fa3 100644 --- a/Apps/Sandcastle/gallery/development/Ground Polyline Material.html +++ b/Apps/Sandcastle/gallery/development/Ground Polyline Material.html @@ -1,4 +1,4 @@ - + @@ -21,10 +21,7 @@ > - + @@ -41,9 +38,7 @@ const scene = viewer.scene; if (!Cesium.GroundPolylinePrimitive.isSupported(scene)) { - window.alert( - "Polylines on terrain are not supported on this platform." - ); + window.alert("Polylines on terrain are not supported on this platform."); } // Polyline Glow @@ -52,20 +47,15 @@ geometryInstances: new Cesium.GeometryInstance({ geometry: new Cesium.GroundPolylineGeometry({ positions: Cesium.Cartesian3.fromDegreesArray([ - -122.2558, - 46.1955, - -122.1058, - 46.1955, + -122.2558, 46.1955, -122.1058, 46.1955, ]), width: 10.0, }), }), appearance: new Cesium.PolylineMaterialAppearance({ - material: Cesium.Material.fromType( - Cesium.Material.PolylineGlowType - ), + material: Cesium.Material.fromType(Cesium.Material.PolylineGlowType), }), - }) + }), ); // Polyline Dash @@ -74,20 +64,15 @@ geometryInstances: new Cesium.GeometryInstance({ geometry: new Cesium.GroundPolylineGeometry({ positions: Cesium.Cartesian3.fromDegreesArray([ - -122.2558, - 46.1975, - -122.1058, - 46.1975, + -122.2558, 46.1975, -122.1058, 46.1975, ]), width: 10.0, }), }), appearance: new Cesium.PolylineMaterialAppearance({ - material: Cesium.Material.fromType( - Cesium.Material.PolylineDashType - ), + material: Cesium.Material.fromType(Cesium.Material.PolylineDashType), }), - }) + }), ); // Polyline Outline @@ -96,25 +81,20 @@ geometryInstances: new Cesium.GeometryInstance({ geometry: new Cesium.GroundPolylineGeometry({ positions: Cesium.Cartesian3.fromDegreesArray([ - -122.2558, - 46.1995, - -122.1058, - 46.1995, + -122.2558, 46.1995, -122.1058, 46.1995, ]), width: 10.0, }), }), appearance: new Cesium.PolylineMaterialAppearance({ - material: Cesium.Material.fromType( - Cesium.Material.PolylineOutlineType - ), + material: Cesium.Material.fromType(Cesium.Material.PolylineOutlineType), }), - }) + }), ); viewer.camera.lookAt( Cesium.Cartesian3.fromDegrees(-122.2058, 46.1955, 1000.0), - new Cesium.Cartesian3(5000.0, 5000.0, 5000.0) + new Cesium.Cartesian3(5000.0, 5000.0, 5000.0), ); viewer.camera.lookAtTransform(Cesium.Matrix4.IDENTITY); //Sandcastle_End }; diff --git a/Apps/Sandcastle/gallery/development/Ground Primitive Materials.html b/Apps/Sandcastle/gallery/development/Ground Primitive Materials.html index d2165b9ddbdd..d16604d836fe 100644 --- a/Apps/Sandcastle/gallery/development/Ground Primitive Materials.html +++ b/Apps/Sandcastle/gallery/development/Ground Primitive Materials.html @@ -1,4 +1,4 @@ - + @@ -7,10 +7,7 @@ name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no" /> - + Cesium Demo @@ -21,10 +18,7 @@ > - + @@ -43,9 +37,7 @@ }); if (!Cesium.GroundPrimitive.supportsMaterials(viewer.scene)) { - window.alert( - "GroundPrimitive materials are not supported on this platform." - ); + window.alert("GroundPrimitive materials are not supported on this platform."); } let rectangle; @@ -102,9 +94,7 @@ function applyCheckerboardMaterial(primitive, scene) { Sandcastle.declare(applyCheckerboardMaterial); // For highlighting in Sandcastle. - primitive.appearance.material = Cesium.Material.fromType( - "Checkerboard" - ); + primitive.appearance.material = Cesium.Material.fromType("Checkerboard"); } function applyColorMaterial(primitive, scene) { @@ -198,9 +188,7 @@ type: "Water", uniforms: { specularMap: "../images/earthspec1k.jpg", - normalMap: Cesium.buildModuleUrl( - "Assets/Textures/waterNormals.jpg" - ), + normalMap: Cesium.buildModuleUrl("Assets/Textures/waterNormals.jpg"), frequency: 10000.0, animationSpeed: 0.01, amplitude: 1.0, @@ -290,9 +278,7 @@ function applyRimLightingMaterial(primitive, scene) { Sandcastle.declare(applyRimLightingMaterial); // For highlighting in Sandcastle. - primitive.appearance.material = Cesium.Material.fromType( - "RimLighting" - ); + primitive.appearance.material = Cesium.Material.fromType("RimLighting"); } function createButtons(scene) { @@ -476,22 +462,22 @@ new Cesium.Cartesian3( -2358138.847340281, -3744072.459541374, - 4581158.5714175375 + 4581158.5714175375, ), new Cesium.Cartesian3( -2357231.4925370603, -3745103.7886602185, - 4580702.9757762635 + 4580702.9757762635, ), new Cesium.Cartesian3( -2355912.902205431, -3744249.029778454, - 4582402.154378103 + 4582402.154378103, ), new Cesium.Cartesian3( -2357208.0209552636, -3743553.4420488174, - 4581961.863286629 + 4581961.863286629, ), ]), vertexFormat: Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT, @@ -501,19 +487,14 @@ aboveGround: false, }), classificationType: Cesium.ClassificationType.TERRAIN, - }) + }), ); worldRectangle = scene.primitives.add( new Cesium.GroundPrimitive({ geometryInstances: new Cesium.GeometryInstance({ geometry: new Cesium.RectangleGeometry({ - rectangle: Cesium.Rectangle.fromDegrees( - -179.99, - -89.99, - 179.99, - 89.99 - ), + rectangle: Cesium.Rectangle.fromDegrees(-179.99, -89.99, 179.99, 89.99), vertexFormat: Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT, }), }), @@ -522,18 +503,18 @@ }), show: false, classificationType: Cesium.ClassificationType.TERRAIN, - }) + }), ); const initialPosition = Cesium.Cartesian3.fromRadians( -2.1344873183780484, 0.8071380277370774, - 5743.394497982162 + 5743.394497982162, ); const initialOrientation = new Cesium.HeadingPitchRoll.fromDegrees( 112.99596671210358, -21.34390550872461, - 0.0716951918898415 + 0.0716951918898415, ); viewer.scene.camera.setView({ destination: initialPosition, diff --git a/Apps/Sandcastle/gallery/development/Ground Primitive.html b/Apps/Sandcastle/gallery/development/Ground Primitive.html index efc45fe992f5..03d9ea3307a3 100644 --- a/Apps/Sandcastle/gallery/development/Ground Primitive.html +++ b/Apps/Sandcastle/gallery/development/Ground Primitive.html @@ -1,4 +1,4 @@ - + @@ -21,10 +21,7 @@ > - + @@ -43,18 +40,14 @@ viewer.extend(Cesium.viewerCesiumInspectorMixin); function offsetPositions(positions, degreeOffset) { - positions = scene.globe.ellipsoid.cartesianArrayToCartographicArray( - positions - ); + positions = scene.globe.ellipsoid.cartesianArrayToCartographicArray(positions); const delta = Cesium.Math.toRadians(degreeOffset); for (let i = 0; i < positions.length; ++i) { const position = positions[i]; position.latitude += delta; position.longitude += delta; } - return scene.globe.ellipsoid.cartographicArrayToCartesianArray( - positions - ); + return scene.globe.ellipsoid.cartographicArrayToCartesianArray(positions); } function createOverlappingPolygons(withAlpha) { @@ -62,22 +55,22 @@ new Cesium.Cartesian3( -2358138.847340281, -3744072.459541374, - 4581158.5714175375 + 4581158.5714175375, ), new Cesium.Cartesian3( -2357231.4925370603, -3745103.7886602185, - 4580702.9757762635 + 4580702.9757762635, ), new Cesium.Cartesian3( -2355912.902205431, -3744249.029778454, - 4582402.154378103 + 4582402.154378103, ), new Cesium.Cartesian3( -2357208.0209552636, -3743553.4420488174, - 4581961.863286629 + 4581961.863286629, ), ]; let polygonHierarchy = { positions: positions }; @@ -99,7 +92,7 @@ id: "polygon 1", }), classificationType: Cesium.ClassificationType.TERRAIN, - }) + }), ); // Same polygon slightly offset and overlapping. @@ -123,7 +116,7 @@ id: "polygon 2", }), classificationType: Cesium.ClassificationType.TERRAIN, - }) + }), ); // Same polygon slightly offset and overlapping. @@ -147,7 +140,7 @@ id: "polygon 3", }), classificationType: Cesium.ClassificationType.TERRAIN, - }) + }), ); } @@ -156,13 +149,13 @@ new Cesium.Cartesian3( -2354331.3069306486, -3742016.2427205616, - 4581875.591571755 + 4581875.591571755, ), new Cesium.HeadingPitchRange( Cesium.Math.toRadians(20.0), Cesium.Math.toRadians(-35.0), - 10000.0 - ) + 10000.0, + ), ); viewer.camera.lookAtTransform(Cesium.Matrix4.IDENTITY); } @@ -179,29 +172,23 @@ handler = new Cesium.ScreenSpaceEventHandler(scene.canvas); handler.setInputAction(function (movement) { const pickedObject = scene.pick(movement.endPosition); - if ( - Cesium.defined(pickedObject) && - pickedObject !== currentObject - ) { + if (Cesium.defined(pickedObject) && pickedObject !== currentObject) { if (Cesium.defined(currentObject)) { currentObject.primitive.getGeometryInstanceAttributes( - currentObject.id + currentObject.id, ).color = lastColor; } currentObject = pickedObject; const attributes = currentObject.primitive.getGeometryInstanceAttributes( - currentObject.id + currentObject.id, ); lastColor = attributes.color; attributes.color = [255, 255, 0, 128]; - } else if ( - !Cesium.defined(pickedObject) && - Cesium.defined(currentObject) - ) { + } else if (!Cesium.defined(pickedObject) && Cesium.defined(currentObject)) { currentObject.primitive.getGeometryInstanceAttributes( - currentObject.id + currentObject.id, ).color = lastColor; currentObject = undefined; } @@ -247,19 +234,14 @@ instances.push( new Cesium.GeometryInstance({ geometry: new Cesium.RectangleGeometry({ - rectangle: Cesium.Rectangle.fromDegrees( - west, - south, - east, - north - ), + rectangle: Cesium.Rectangle.fromDegrees(west, south, east, north), }), attributes: { color: color, show: show, }, id: `rectangle${i}`, - }) + }), ); } @@ -267,31 +249,21 @@ } Sandcastle.addToolbarButton("Batching", function () { - const color = new Cesium.ColorGeometryInstanceAttribute( - 0.0, - 1.0, - 1.0, - 0.5 - ); + const color = new Cesium.ColorGeometryInstanceAttribute(0.0, 1.0, 1.0, 0.5); const show = new Cesium.ShowGeometryInstanceAttribute(true); const instances = createBatchedInstances(color, show); scene.groundPrimitives.add( new Cesium.GroundPrimitive({ geometryInstances: instances, classificationType: Cesium.ClassificationType.TERRAIN, - }) + }), ); viewOverlappingPolygons(); }); Sandcastle.addToolbarButton("Batch Picking", function () { - let color = new Cesium.ColorGeometryInstanceAttribute( - 0.0, - 1.0, - 1.0, - 0.5 - ); + let color = new Cesium.ColorGeometryInstanceAttribute(0.0, 1.0, 1.0, 0.5); let show = new Cesium.ShowGeometryInstanceAttribute(true); let instances = createBatchedInstances(color, show); @@ -299,7 +271,7 @@ new Cesium.GroundPrimitive({ geometryInstances: instances, classificationType: Cesium.ClassificationType.TERRAIN, - }) + }), ); color = new Cesium.ColorGeometryInstanceAttribute(1.0, 0.0, 1.0, 0.5); @@ -316,7 +288,7 @@ new Cesium.GroundPrimitive({ geometryInstances: instances, classificationType: Cesium.ClassificationType.TERRAIN, - }) + }), ); viewOverlappingPolygons(); @@ -332,31 +304,22 @@ pickedObject.id.indexOf(pickIdPrefix) === -1 ) { if (Cesium.defined(currentObject)) { - primitive.getGeometryInstanceAttributes( - currentObject.id - ).show = [1]; + primitive.getGeometryInstanceAttributes(currentObject.id).show = [1]; pickPrimitive.getGeometryInstanceAttributes( - pickIdPrefix + currentObject.id + pickIdPrefix + currentObject.id, ).show = [0]; } currentObject = pickedObject; - primitive.getGeometryInstanceAttributes(currentObject.id).show = [ - 0, - ]; + primitive.getGeometryInstanceAttributes(currentObject.id).show = [0]; pickPrimitive.getGeometryInstanceAttributes( - pickIdPrefix + currentObject.id + pickIdPrefix + currentObject.id, ).show = [1]; - } else if ( - !Cesium.defined(pickedObject) && - Cesium.defined(currentObject) - ) { - primitive.getGeometryInstanceAttributes(currentObject.id).show = [ - 1, - ]; + } else if (!Cesium.defined(pickedObject) && Cesium.defined(currentObject)) { + primitive.getGeometryInstanceAttributes(currentObject.id).show = [1]; pickPrimitive.getGeometryInstanceAttributes( - pickIdPrefix + currentObject.id + pickIdPrefix + currentObject.id, ).show = [0]; currentObject = undefined; } @@ -374,13 +337,13 @@ }), attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor( - new Cesium.Color(1.0, 0.0, 0.0, 0.5) + new Cesium.Color(1.0, 0.0, 0.0, 0.5), ), }, id: "circle", }), classificationType: Cesium.ClassificationType.TERRAIN, - }) + }), ); // Ellipse Geometry @@ -394,13 +357,13 @@ }), attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor( - new Cesium.Color(0.0, 1.0, 1.0, 0.5) + new Cesium.Color(0.0, 1.0, 1.0, 0.5), ), }, id: "ellipse", }), classificationType: Cesium.ClassificationType.TERRAIN, - }) + }), ); // Corridor Geometry @@ -409,24 +372,19 @@ geometryInstances: new Cesium.GeometryInstance({ geometry: new Cesium.CorridorGeometry({ positions: Cesium.Cartesian3.fromDegreesArray([ - -112.0, - 40.0, - -117.0, - 40.0, - -117.0, - 35.0, + -112.0, 40.0, -117.0, 40.0, -117.0, 35.0, ]), width: 200000.0, }), attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor( - new Cesium.Color(0.0, 0.0, 1.0, 0.5) + new Cesium.Color(0.0, 0.0, 1.0, 0.5), ), }, id: "corridor", }), classificationType: Cesium.ClassificationType.TERRAIN, - }) + }), ); // Rectangle geometry @@ -434,23 +392,18 @@ new Cesium.GroundPrimitive({ geometryInstances: new Cesium.GeometryInstance({ geometry: new Cesium.RectangleGeometry({ - rectangle: Cesium.Rectangle.fromDegrees( - -100.0, - 30.0, - -90.0, - 40.0 - ), + rectangle: Cesium.Rectangle.fromDegrees(-100.0, 30.0, -90.0, 40.0), rotation: Cesium.Math.toRadians(45), }), attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor( - new Cesium.Color(0.0, 1.0, 0.0, 0.5) + new Cesium.Color(0.0, 1.0, 0.0, 0.5), ), }, id: "rectangle", }), classificationType: Cesium.ClassificationType.TERRAIN, - }) + }), ); // Rhumb line polygon geometry @@ -460,27 +413,20 @@ geometry: new Cesium.PolygonGeometry({ polygonHierarchy: new Cesium.PolygonHierarchy( Cesium.Cartesian3.fromDegreesArray([ - -130, - 55, - -100, - 55, - -100, - 45, - -130, - 45, - ]) + -130, 55, -100, 55, -100, 45, -130, 45, + ]), ), arcType: Cesium.ArcType.RHUMB, }), attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor( - new Cesium.Color(1.0, 1.0, 0.0, 0.5) + new Cesium.Color(1.0, 1.0, 0.0, 0.5), ), }, id: "rhumbPolygon", }), classificationType: Cesium.ClassificationType.TERRAIN, - }) + }), ); }); @@ -491,7 +437,7 @@ //Set the camera to a US centered tilted view and switch back to moving in world coordinates. viewer.camera.lookAt( Cesium.Cartesian3.fromDegrees(-98.0, 40.0), - new Cesium.Cartesian3(0.0, -4790000.0, 3930000.0) + new Cesium.Cartesian3(0.0, -4790000.0, 3930000.0), ); viewer.camera.lookAtTransform(Cesium.Matrix4.IDENTITY); }; diff --git a/Apps/Sandcastle/gallery/development/Labels.html b/Apps/Sandcastle/gallery/development/Labels.html index 0caa12625233..fcb2ba0e213e 100644 --- a/Apps/Sandcastle/gallery/development/Labels.html +++ b/Apps/Sandcastle/gallery/development/Labels.html @@ -1,4 +1,4 @@ - + @@ -18,10 +18,7 @@ > - + @@ -70,11 +67,7 @@ text: "Philadelphia", }); - l.position = Cesium.Cartesian3.fromDegrees( - -75.1641667, - 39.9522222, - 300000.0 - ); + l.position = Cesium.Cartesian3.fromDegrees(-75.1641667, 39.9522222, 300000.0); l.scale = 2.0; } @@ -83,9 +76,7 @@ scene.primitives.removeAll(); const center = Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883); const labels = scene.primitives.add(new Cesium.LabelCollection()); - labels.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame( - center - ); + labels.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(center); labels.add({ position: new Cesium.Cartesian3(0.0, 0.0, 0.0), text: "Center", @@ -117,9 +108,7 @@ scene.primitives.removeAll(); const image = new Image(); image.onload = function () { - const billboards = scene.primitives.add( - new Cesium.BillboardCollection() - ); + const billboards = scene.primitives.add(new Cesium.BillboardCollection()); billboards.add({ position: Cesium.Cartesian3.fromDegrees(-75.1641667, 39.9522222), scaleByDistance: new Cesium.NearFarScalar(1.5e2, 5.0, 1.5e7, 0.5), @@ -138,7 +127,7 @@ 1.5e2, 3.0, 1.5e7, - 0.5 + 0.5, ), }); }; @@ -152,22 +141,12 @@ labels.add({ position: Cesium.Cartesian3.fromDegrees(-73.94, 40.67), text: "New York", - translucencyByDistance: new Cesium.NearFarScalar( - 1.5e2, - 1.0, - 1.5e8, - 0.0 - ), + translucencyByDistance: new Cesium.NearFarScalar(1.5e2, 1.0, 1.5e8, 0.0), }); labels.add({ position: Cesium.Cartesian3.fromDegrees(-84.39, 33.75), text: "Atlanta", - translucencyByDistance: new Cesium.NearFarScalar( - 1.5e5, - 1.0, - 1.5e7, - 0.0 - ), + translucencyByDistance: new Cesium.NearFarScalar(1.5e5, 1.0, 1.5e7, 0.0), }); } diff --git a/Apps/Sandcastle/gallery/development/Many Clipping Planes.html b/Apps/Sandcastle/gallery/development/Many Clipping Planes.html index 79ef45f31501..d3ea8f944f94 100644 --- a/Apps/Sandcastle/gallery/development/Many Clipping Planes.html +++ b/Apps/Sandcastle/gallery/development/Many Clipping Planes.html @@ -1,4 +1,4 @@ - + @@ -21,10 +21,7 @@ > - + @@ -59,9 +56,7 @@
- Click on the 3D window then use the keyboard to change settings. - Click on the 3D window then use the keyboard to change settings.
Heading: °
- + - + @@ -41,24 +38,17 @@ geometryInstances: new Cesium.GeometryInstance({ geometry: new Cesium.WallGeometry({ positions: Cesium.Cartesian3.fromDegreesArrayHeights([ - -95.5, - 50.0, - 300000.0, - -90.5, - 50.0, - 300000.0, + -95.5, 50.0, 300000.0, -90.5, 50.0, 300000.0, ]), vertexFormat: - Cesium.MaterialAppearance.MaterialSupport.TEXTURED - .vertexFormat, + Cesium.MaterialAppearance.MaterialSupport.TEXTURED.vertexFormat, }), }), appearance: new Cesium.MaterialAppearance({ material: Cesium.Material.fromType("Checkerboard"), - materialSupport: - Cesium.MaterialAppearance.MaterialSupport.TEXTURED, + materialSupport: Cesium.MaterialAppearance.MaterialSupport.TEXTURED, }), - }) + }), ); // Striped Wall @@ -67,24 +57,17 @@ geometryInstances: new Cesium.GeometryInstance({ geometry: new Cesium.WallGeometry({ positions: Cesium.Cartesian3.fromDegreesArrayHeights([ - -100.5, - 50.0, - 300000.0, - -95.5, - 50.0, - 300000.0, + -100.5, 50.0, 300000.0, -95.5, 50.0, 300000.0, ]), vertexFormat: - Cesium.MaterialAppearance.MaterialSupport.TEXTURED - .vertexFormat, + Cesium.MaterialAppearance.MaterialSupport.TEXTURED.vertexFormat, }), }), appearance: new Cesium.MaterialAppearance({ material: Cesium.Material.fromType("Stripe"), - materialSupport: - Cesium.MaterialAppearance.MaterialSupport.TEXTURED, + materialSupport: Cesium.MaterialAppearance.MaterialSupport.TEXTURED, }), - }) + }), ); //Sandcastle_End }; diff --git a/Apps/Sandcastle/gallery/development/Multiple Shadows.html b/Apps/Sandcastle/gallery/development/Multiple Shadows.html index e72b532ec680..c64366e2eba8 100644 --- a/Apps/Sandcastle/gallery/development/Multiple Shadows.html +++ b/Apps/Sandcastle/gallery/development/Multiple Shadows.html @@ -1,4 +1,4 @@ - + @@ -18,10 +18,7 @@ > - + @@ -45,16 +42,16 @@ -120.0 + i * 10, 30.0, -110.0 + i * 10, - 40.0 + 40.0, ), vertexFormat: Cesium.PerInstanceColorAppearance.VERTEX_FORMAT, }), attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.fromRandom({ alpha: 0.7 }) + Cesium.Color.fromRandom({ alpha: 0.7 }), ), }, - }) + }), ); } @@ -62,7 +59,7 @@ new Cesium.Primitive({ geometryInstances: instances, appearance: new Cesium.PerInstanceColorAppearance(), - }) + }), ); //Sandcastle_End }; diff --git a/Apps/Sandcastle/gallery/development/Pick From Ray.html b/Apps/Sandcastle/gallery/development/Pick From Ray.html index 98a720f1e535..a28e72fa6ad9 100644 --- a/Apps/Sandcastle/gallery/development/Pick From Ray.html +++ b/Apps/Sandcastle/gallery/development/Pick From Ray.html @@ -1,4 +1,4 @@ - + @@ -18,10 +18,7 @@ > - + @@ -38,7 +35,7 @@ if (!scene.pickPositionSupported) { window.alert( - "This browser does not support pickPosition or getting position from pickFromRay." + "This browser does not support pickPosition or getting position from pickFromRay.", ); } @@ -50,7 +47,7 @@ }); const tileset = await Cesium.Cesium3DTileset.fromUrl( - "../../SampleData/Cesium3DTiles/Tilesets/Tileset/tileset.json" + "../../SampleData/Cesium3DTiles/Tilesets/Tileset/tileset.json", ); viewer.scene.primitives.add(tileset); @@ -66,12 +63,12 @@ const blueCartographic = new Cesium.Cartographic( -1.3196863177294136, 0.6988508714746624, - 30.0 + 30.0, ); let redCartographic = new Cesium.Cartographic( -1.319671841889412, 0.6989153500784591, - 30.0 + 30.0, ); const blueSphere = viewer.entities.add({ @@ -100,9 +97,7 @@ positions: arrowPositions, width: 10, arcType: Cesium.ArcType.NONE, - material: new Cesium.PolylineArrowMaterialProperty( - Cesium.Color.YELLOW - ), + material: new Cesium.PolylineArrowMaterialProperty(Cesium.Color.YELLOW), }, }); @@ -115,7 +110,7 @@ for (i = 0; i < pickedFeatures.length; ++i) { pickedFeatures[i].color = Cesium.Color.fromAlpha( Cesium.Color.WHITE, - pickedFeatures[i].color.alpha + pickedFeatures[i].color.alpha, ); } for (i = 0; i < intersectionMarkers.length; ++i) { @@ -133,7 +128,7 @@ pickedFeatures.push(object); object.color = Cesium.Color.fromAlpha( Cesium.Color.YELLOW, - object.color.alpha + object.color.alpha, ); } intersectionMarkers.push( @@ -143,7 +138,7 @@ radii: new Cesium.Cartesian3(3.0, 3.0, 3.0), material: Cesium.Color.RED, }, - }) + }), ); } } @@ -154,7 +149,7 @@ const end = Cesium.Cartographic.toCartesian(redCartographic); const direction = Cesium.Cartesian3.normalize( Cesium.Cartesian3.subtract(end, start, new Cesium.Cartesian3()), - new Cesium.Cartesian3() + new Cesium.Cartesian3(), ); const ray = new Cesium.Ray(start, direction); diff --git a/Apps/Sandcastle/gallery/development/Picking.html b/Apps/Sandcastle/gallery/development/Picking.html index 740c7a55d9de..eba7b1729c50 100644 --- a/Apps/Sandcastle/gallery/development/Picking.html +++ b/Apps/Sandcastle/gallery/development/Picking.html @@ -1,4 +1,4 @@ - + @@ -18,10 +18,7 @@ > - + @@ -68,10 +65,7 @@ handler = new Cesium.ScreenSpaceEventHandler(scene.canvas); handler.setInputAction(function (movement) { const pickedObject = scene.pick(movement.endPosition); - if ( - Cesium.defined(pickedObject) && - pickedObject.id === entity - ) { + if (Cesium.defined(pickedObject) && pickedObject.id === entity) { entity.billboard.color = Cesium.Color.YELLOW; } else { entity.billboard.color = Cesium.Color.WHITE; @@ -92,10 +86,7 @@ handler = new Cesium.ScreenSpaceEventHandler(scene.canvas); handler.setInputAction(function (movement) { const pickedObject = scene.pick(movement.endPosition); - if ( - Cesium.defined(pickedObject) && - pickedObject.id === entity - ) { + if (Cesium.defined(pickedObject) && pickedObject.id === entity) { entity.label.fillColor = Cesium.Color.YELLOW; } else { entity.label.fillColor = Cesium.Color.WHITE; @@ -117,10 +108,7 @@ handler = new Cesium.ScreenSpaceEventHandler(scene.canvas); handler.setInputAction(function (movement) { const pickedObject = scene.pick(movement.endPosition); - if ( - Cesium.defined(pickedObject) && - pickedObject.id === entity - ) { + if (Cesium.defined(pickedObject) && pickedObject.id === entity) { entity.point.color = Cesium.Color.YELLOW; } else { entity.point.color = Cesium.Color.WHITE; @@ -135,12 +123,7 @@ const id = "line"; const line = polylines.add({ positions: Cesium.Cartesian3.fromDegreesArrayHeights([ - -84.0, - 50.0, - 0.0, - -100.0, - 30.0, - 0.0, + -84.0, 50.0, 0.0, -100.0, 30.0, 0.0, ]), width: 5.0, id: id, @@ -166,44 +149,32 @@ geometryInstances: new Cesium.GeometryInstance({ geometry: new Cesium.PolylineGeometry({ positions: Cesium.Cartesian3.fromDegreesArrayHeights([ - -84.0, - 50.0, - 0.0, - -100.0, - 30.0, - 0.0, + -84.0, 50.0, 0.0, -100.0, 30.0, 0.0, ]), width: 5.0, - vertexFormat: - Cesium.PolylineColorAppearance.VERTEX_FORMAT, + vertexFormat: Cesium.PolylineColorAppearance.VERTEX_FORMAT, }), attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.WHITE + Cesium.Color.WHITE, ), }, id: id, }), appearance: new Cesium.PolylineColorAppearance(), asynchronous: false, - }) + }), ); handler = new Cesium.ScreenSpaceEventHandler(scene.canvas); handler.setInputAction(function (movement) { const pickedObject = scene.pick(movement.endPosition); if (Cesium.defined(pickedObject) && pickedObject.id === id) { - primitive.getGeometryInstanceAttributes( - id - ).color = Cesium.ColorGeometryInstanceAttribute.toValue( - Cesium.Color.YELLOW - ); + primitive.getGeometryInstanceAttributes(id).color = + Cesium.ColorGeometryInstanceAttribute.toValue(Cesium.Color.YELLOW); } else { - primitive.getGeometryInstanceAttributes( - id - ).color = Cesium.ColorGeometryInstanceAttribute.toValue( - Cesium.Color.WHITE - ); + primitive.getGeometryInstanceAttributes(id).color = + Cesium.ColorGeometryInstanceAttribute.toValue(Cesium.Color.WHITE); } }, Cesium.ScreenSpaceEventType.MOUSE_MOVE); }, @@ -216,28 +187,18 @@ name: "box", position: Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883), box: { - dimensions: new Cesium.Cartesian3( - 400000.0, - 300000.0, - 500000.0 - ), + dimensions: new Cesium.Cartesian3(400000.0, 300000.0, 500000.0), material: Cesium.Color.WHITE, }, }); - entity.box.material.color = new Cesium.CallbackProperty( - function () { - return color; - }, - false - ); + entity.box.material.color = new Cesium.CallbackProperty(function () { + return color; + }, false); handler = new Cesium.ScreenSpaceEventHandler(scene.canvas); handler.setInputAction(function (movement) { const pickedObject = scene.pick(movement.endPosition); - if ( - Cesium.defined(pickedObject) && - pickedObject.id === entity - ) { + if (Cesium.defined(pickedObject) && pickedObject.id === entity) { color = Cesium.Color.YELLOW; } else { color = Cesium.Color.WHITE; @@ -253,41 +214,30 @@ new Cesium.GroundPrimitive({ geometryInstances: new Cesium.GeometryInstance({ geometry: new Cesium.RectangleGeometry({ - rectangle: Cesium.Rectangle.fromDegrees( - -100.0, - 30.0, - -90.0, - 40.0 - ), + rectangle: Cesium.Rectangle.fromDegrees(-100.0, 30.0, -90.0, 40.0), rotation: Cesium.Math.toRadians(45), }), attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.WHITE + Cesium.Color.WHITE, ), }, id: id, }), asynchronous: false, classificationType: Cesium.ClassificationType.TERRAIN, - }) + }), ); handler = new Cesium.ScreenSpaceEventHandler(scene.canvas); handler.setInputAction(function (movement) { const pickedObject = scene.pick(movement.endPosition); if (Cesium.defined(pickedObject) && pickedObject.id === id) { - primitive.getGeometryInstanceAttributes( - id - ).color = Cesium.ColorGeometryInstanceAttribute.toValue( - Cesium.Color.YELLOW - ); + primitive.getGeometryInstanceAttributes(id).color = + Cesium.ColorGeometryInstanceAttribute.toValue(Cesium.Color.YELLOW); } else { - primitive.getGeometryInstanceAttributes( - id - ).color = Cesium.ColorGeometryInstanceAttribute.toValue( - Cesium.Color.WHITE - ); + primitive.getGeometryInstanceAttributes(id).color = + Cesium.ColorGeometryInstanceAttribute.toValue(Cesium.Color.WHITE); } }, Cesium.ScreenSpaceEventType.MOUSE_MOVE); }, @@ -295,18 +245,11 @@ { text: "Model", onselect: function () { - const position = Cesium.Cartesian3.fromDegrees( - -75.59777, - 40.03883 - ); - const hpr = new Cesium.HeadingPitchRoll( - Cesium.Math.toRadians(135), - 0, - 0 - ); + const position = Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883); + const hpr = new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(135), 0, 0); const orientation = Cesium.Transforms.headingPitchRollQuaternion( position, - hpr + hpr, ); const entity = viewer.entities.add({ @@ -321,10 +264,7 @@ handler = new Cesium.ScreenSpaceEventHandler(scene.canvas); handler.setInputAction(function (movement) { const pickedObject = scene.pick(movement.endPosition); - if ( - Cesium.defined(pickedObject) && - pickedObject.id === entity - ) { + if (Cesium.defined(pickedObject) && pickedObject.id === entity) { entity.model.color = Cesium.Color.YELLOW; } else { entity.model.color = Cesium.Color.WHITE; @@ -335,8 +275,7 @@ { text: "Batched 3D Model", onselect: async function () { - const url = - "../../SampleData/Cesium3DTiles/Tilesets/Tileset/tileset.json"; + const url = "../../SampleData/Cesium3DTiles/Tilesets/Tileset/tileset.json"; loadedResource = url; tileset = await Cesium.Cesium3DTileset.fromUrl(url); if (loadedResource !== url) { @@ -349,8 +288,8 @@ new Cesium.HeadingPitchRange( 0, -2.0, - Math.max(100.0 - tileset.boundingSphere.radius, 0.0) - ) + Math.max(100.0 - tileset.boundingSphere.radius, 0.0), + ), ); handler = new Cesium.ScreenSpaceEventHandler(scene.canvas); @@ -364,10 +303,7 @@ return; } highlighted.feature = pickedFeature; - Cesium.Color.clone( - pickedFeature.color, - highlighted.originalColor - ); + Cesium.Color.clone(pickedFeature.color, highlighted.originalColor); pickedFeature.color = Cesium.Color.YELLOW; }, Cesium.ScreenSpaceEventType.MOUSE_MOVE); }, @@ -390,8 +326,8 @@ new Cesium.HeadingPitchRange( 0, -2.0, - Math.max(100.0 - tileset.boundingSphere.radius, 0.0) - ) + Math.max(100.0 - tileset.boundingSphere.radius, 0.0), + ), ); handler = new Cesium.ScreenSpaceEventHandler(scene.canvas); @@ -405,10 +341,7 @@ return; } highlighted.feature = pickedFeature; - Cesium.Color.clone( - pickedFeature.color, - highlighted.originalColor - ); + Cesium.Color.clone(pickedFeature.color, highlighted.originalColor); pickedFeature.color = Cesium.Color.YELLOW; }, Cesium.ScreenSpaceEventType.MOUSE_MOVE); }, @@ -431,8 +364,8 @@ new Cesium.HeadingPitchRange( 0, -2.0, - Math.max(100.0 - tileset.boundingSphere.radius, 0.0) - ) + Math.max(100.0 - tileset.boundingSphere.radius, 0.0), + ), ); tileset.style = new Cesium.Cesium3DTileStyle({ @@ -442,11 +375,9 @@ handler = new Cesium.ScreenSpaceEventHandler(scene.canvas); handler.setInputAction(function (movement) { if (Cesium.defined(highlighted.feature)) { - highlighted.feature.primitive.style = new Cesium.Cesium3DTileStyle( - { - pointSize: 10.0, - } - ); + highlighted.feature.primitive.style = new Cesium.Cesium3DTileStyle({ + pointSize: 10.0, + }); highlighted.feature = undefined; } const pickedFeature = viewer.scene.pick(movement.endPosition); @@ -479,22 +410,22 @@ camera.position = new Cesium.Cartesian3( 6382696.762766026, 20.61495686957654, - -83.83598213685399 + -83.83598213685399, ); camera.direction = new Cesium.Cartesian3( -0.9999999739409788, 0.00022792812935066512, - 0.000012915478344419502 + 0.000012915478344419502, ); camera.up = new Cesium.Cartesian3( 0.00001291547800893194, -2.9438010410026854e-9, - 0.9999999999165953 + 0.9999999999165953, ); camera.right = new Cesium.Cartesian3.cross( camera.direction, camera.up, - camera.right + camera.right, ); handler = new Cesium.ScreenSpaceEventHandler(scene.canvas); @@ -508,10 +439,7 @@ return; } highlighted.feature = pickedFeature; - Cesium.Color.clone( - pickedFeature.color, - highlighted.originalColor - ); + Cesium.Color.clone(pickedFeature.color, highlighted.originalColor); pickedFeature.color = Cesium.Color.YELLOW; }, Cesium.ScreenSpaceEventType.MOUSE_MOVE); }, @@ -534,22 +462,22 @@ camera.position = new Cesium.Cartesian3( 6382696.762766026, 20.61495686957654, - -83.83598213685399 + -83.83598213685399, ); camera.direction = new Cesium.Cartesian3( -0.9999999739409788, 0.00022792812935066512, - 0.000012915478344419502 + 0.000012915478344419502, ); camera.up = new Cesium.Cartesian3( 0.00001291547800893194, -2.9438010410026854e-9, - 0.9999999999165953 + 0.9999999999165953, ); camera.right = new Cesium.Cartesian3.cross( camera.direction, camera.up, - camera.right + camera.right, ); handler = new Cesium.ScreenSpaceEventHandler(scene.canvas); @@ -563,10 +491,7 @@ return; } highlighted.feature = pickedFeature; - Cesium.Color.clone( - pickedFeature.color, - highlighted.originalColor - ); + Cesium.Color.clone(pickedFeature.color, highlighted.originalColor); pickedFeature.color = Cesium.Color.YELLOW; }, Cesium.ScreenSpaceEventType.MOUSE_MOVE); }, diff --git a/Apps/Sandcastle/gallery/development/PointPrimitives.html b/Apps/Sandcastle/gallery/development/PointPrimitives.html index 8539616d1698..68c365e32c20 100644 --- a/Apps/Sandcastle/gallery/development/PointPrimitives.html +++ b/Apps/Sandcastle/gallery/development/PointPrimitives.html @@ -1,4 +1,4 @@ - + @@ -18,10 +18,7 @@ > - + @@ -39,7 +36,7 @@ Sandcastle.declare(addPointPrimitive); const pointPrimitives = scene.primitives.add( - new Cesium.PointPrimitiveCollection() + new Cesium.PointPrimitiveCollection(), ); pointPrimitives.add({ color: Cesium.Color.YELLOW, @@ -51,7 +48,7 @@ Sandcastle.declare(setPointPrimitiveProperties); const pointPrimitives = scene.primitives.add( - new Cesium.PointPrimitiveCollection() + new Cesium.PointPrimitiveCollection(), ); pointPrimitives.add({ position: Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883), @@ -67,7 +64,7 @@ Sandcastle.declare(changePointPrimitiveProperties); const pointPrimitives = scene.primitives.add( - new Cesium.PointPrimitiveCollection() + new Cesium.PointPrimitiveCollection(), ); // add() returns a PointPrimitive object containing functions to change @@ -76,11 +73,7 @@ pixelSize: 2, }); - p.position = Cesium.Cartesian3.fromDegrees( - -75.59777, - 40.03883, - 300000.0 - ); + p.position = Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883, 300000.0); p.pixelSize = 20.0; p.color = new Cesium.Color(1.0, 1.0, 1.0, 0.25); } @@ -89,7 +82,7 @@ Sandcastle.declare(addMultiplePointPrimitives); const pointPrimitives = scene.primitives.add( - new Cesium.PointPrimitiveCollection() + new Cesium.PointPrimitiveCollection(), ); pointPrimitives.add({ position: Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883), @@ -112,7 +105,7 @@ Sandcastle.declare(scaleByDistance); const pointPrimitives = scene.primitives.add( - new Cesium.PointPrimitiveCollection() + new Cesium.PointPrimitiveCollection(), ); pointPrimitives.add({ position: Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883), @@ -127,17 +120,12 @@ Sandcastle.declare(fadeByDistance); const pointPrimitives = scene.primitives.add( - new Cesium.PointPrimitiveCollection() + new Cesium.PointPrimitiveCollection(), ); pointPrimitives.add({ position: Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883), pixelSize: 20, - translucencyByDistance: new Cesium.NearFarScalar( - 1.5e2, - 1.0, - 1.5e7, - 0.2 - ), + translucencyByDistance: new Cesium.NearFarScalar(1.5e2, 1.0, 1.5e7, 0.2), }); } @@ -145,12 +133,10 @@ Sandcastle.declare(inReferenceFrame); const pointPrimitives = scene.primitives.add( - new Cesium.PointPrimitiveCollection() + new Cesium.PointPrimitiveCollection(), ); const center = Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883); - pointPrimitives.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame( - center - ); + pointPrimitives.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(center); // center pointPrimitives.add({ @@ -184,7 +170,7 @@ const numPoints = 100000; const pointPrimitives = scene.primitives.add( - new Cesium.PointPrimitiveCollection() + new Cesium.PointPrimitiveCollection(), ); const base = scene.globe.ellipsoid.radii.x; const color = Cesium.Color.LIGHTSKYBLUE; @@ -194,7 +180,7 @@ const position = new Cesium.Cartesian3( 16000000 * Math.random() - 8000000, -((4000000 * j) / numPoints + base), - 2000000 * Math.random() - 1000000 + 2000000 * Math.random() - 1000000, ); pointPrimitives.add({ diff --git a/Apps/Sandcastle/gallery/development/Polygon Outline.html b/Apps/Sandcastle/gallery/development/Polygon Outline.html index f13992715007..4559da04f5db 100644 --- a/Apps/Sandcastle/gallery/development/Polygon Outline.html +++ b/Apps/Sandcastle/gallery/development/Polygon Outline.html @@ -1,4 +1,4 @@ - + @@ -18,10 +18,7 @@ > - + @@ -38,25 +35,14 @@ // Example 1: Draw the outline of a polygon on the globe surface. let positions = Cesium.Cartesian3.fromDegreesArray([ - -95, - 37.0, - -95, - 32.0, - -90, - 33.0, - -87, - 31.0, - -87, - 35.0, + -95, 37.0, -95, 32.0, -90, 33.0, -87, 31.0, -87, 35.0, ]); const polygonOutlineInstance = new Cesium.GeometryInstance({ geometry: Cesium.PolygonOutlineGeometry.fromPositions({ positions: positions, }), attributes: { - color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.WHITE - ), + color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.WHITE), }, }); @@ -67,26 +53,12 @@ // edges and the positions of the holes. const polygonHierarchy = { positions: Cesium.Cartesian3.fromDegreesArray([ - -108.0, - 30.0, - -98.0, - 30.0, - -98.0, - 40.0, - -108.0, - 40.0, + -108.0, 30.0, -98.0, 30.0, -98.0, 40.0, -108.0, 40.0, ]), holes: [ { positions: Cesium.Cartesian3.fromDegreesArray([ - -106.0, - 31.0, - -106.0, - 39.0, - -100.0, - 39.0, - -100.0, - 31.0, + -106.0, 31.0, -106.0, 39.0, -100.0, 39.0, -100.0, 31.0, ]), }, ], @@ -99,23 +71,13 @@ extrudedHeight: 500000.0, }), attributes: { - color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.WHITE - ), + color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.WHITE), }, }); // Example 3: Draw a polygon outline with per position heights. positions = Cesium.Cartesian3.fromDegreesArrayHeights([ - -95, - 44.0, - 400000, - -95, - 39.0, - 100000, - -87, - 42.0, - 100000, + -95, 44.0, 400000, -95, 39.0, 100000, -87, 42.0, 100000, ]); // Set the perPositionHeight option to true for the polygon // to use the heights each position. @@ -125,9 +87,7 @@ perPositionHeight: true, }), attributes: { - color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.WHITE - ), + color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.WHITE), }, }); @@ -145,7 +105,7 @@ lineWidth: Math.min(2.0, scene.maximumAliasedLineWidth), }, }), - }) + }), ); //Sandcastle_End }; diff --git a/Apps/Sandcastle/gallery/development/Polygon Texture Coordinates.html b/Apps/Sandcastle/gallery/development/Polygon Texture Coordinates.html index e9e307bcc8e8..54a6bbd307c0 100644 --- a/Apps/Sandcastle/gallery/development/Polygon Texture Coordinates.html +++ b/Apps/Sandcastle/gallery/development/Polygon Texture Coordinates.html @@ -1,4 +1,4 @@ - + @@ -21,10 +21,7 @@ > - + @@ -41,16 +38,7 @@ // Example 1: Small textured polygon. let positions = Cesium.Cartesian3.fromDegreesArray([ - -117.4, - 37.4, - -117.4, - 37, - -117.2, - 37.1, - -117.0, - 37, - -117.0, - 37.4, + -117.4, 37.4, -117.4, 37, -117.2, 37.1, -117.0, 37, -117.0, 37.4, ]); let textureCoordinates = { positions: [ @@ -64,8 +52,7 @@ const smallFlatInstance = new Cesium.GeometryInstance({ geometry: Cesium.PolygonGeometry.fromPositions({ positions: positions, - vertexFormat: - Cesium.MaterialAppearance.MaterialSupport.TEXTURED.vertexFormat, + vertexFormat: Cesium.MaterialAppearance.MaterialSupport.TEXTURED.vertexFormat, textureCoordinates: textureCoordinates, }), }); @@ -73,62 +60,27 @@ // Example 2: Small textured polygon with holes. let polygonHierarchy = { positions: Cesium.Cartesian3.fromDegreesArray([ - -116.5, - 37.5, - -116.5, - 37, - -116, - 37, - -116, - 37.5, + -116.5, 37.5, -116.5, 37, -116, 37, -116, 37.5, ]), holes: [ { positions: Cesium.Cartesian3.fromDegreesArray([ - -116.1, - 37.2, - -116.1, - 37.15, - -116.05, - 37.15, - -116.05, - 37.2, + -116.1, 37.2, -116.1, 37.15, -116.05, 37.15, -116.05, 37.2, ]), }, { positions: Cesium.Cartesian3.fromDegreesArray([ - -116.35, - 37.35, - -116.35, - 37.15, - -116.15, - 37.15, - -116.15, - 37.35, + -116.35, 37.35, -116.35, 37.15, -116.15, 37.15, -116.15, 37.35, ]), holes: [ { positions: Cesium.Cartesian3.fromDegreesArray([ - -116.3, - 37.3, - -116.3, - 37.2, - -116.2, - 37.2, - -116.2, - 37.3, + -116.3, 37.3, -116.3, 37.2, -116.2, 37.2, -116.2, 37.3, ]), holes: [ { positions: Cesium.Cartesian3.fromDegreesArray([ - -116.27, - 37.27, - -116.27, - 37.23, - -116.23, - 37.23, - -116.23, - 37.27, + -116.27, 37.27, -116.27, 37.23, -116.23, 37.23, -116.23, 37.27, ]), }, ], @@ -186,8 +138,7 @@ const smallHoleyFlatInstance = new Cesium.GeometryInstance({ geometry: new Cesium.PolygonGeometry({ polygonHierarchy: polygonHierarchy, - vertexFormat: - Cesium.MaterialAppearance.MaterialSupport.TEXTURED.vertexFormat, + vertexFormat: Cesium.MaterialAppearance.MaterialSupport.TEXTURED.vertexFormat, textureCoordinates: textureCoordinates, }), }); @@ -195,37 +146,14 @@ // Example 3: Large (subdivided) textured polygon with perPositionHeights. polygonHierarchy = { positions: Cesium.Cartesian3.fromDegreesArrayHeights([ - -115, - 38.0, - 50000, - -115, - 36.0, - 30000, - -114, - 36.5, - 35000, - -113, - 36.0, - 30000, - -113, - 38.0, - 50000, + -115, 38.0, 50000, -115, 36.0, 30000, -114, 36.5, 35000, -113, 36.0, 30000, + -113, 38.0, 50000, ]), holes: [ { positions: Cesium.Cartesian3.fromDegreesArrayHeights([ - -114.6, - 37.6, - 46000, - -114.6, - 37.2, - 42000, - -114.2, - 37.2, - 42000, - -114.2, - 37.6, - 46000, + -114.6, 37.6, 46000, -114.6, 37.2, 42000, -114.2, 37.2, 42000, -114.2, + 37.6, 46000, ]), }, ], @@ -253,24 +181,14 @@ geometry: new Cesium.PolygonGeometry({ polygonHierarchy: polygonHierarchy, perPositionHeight: true, - vertexFormat: - Cesium.MaterialAppearance.MaterialSupport.TEXTURED.vertexFormat, + vertexFormat: Cesium.MaterialAppearance.MaterialSupport.TEXTURED.vertexFormat, textureCoordinates: textureCoordinates, }), }); // Example 4: Large (subdivided) textured polygon with RHUMB arc type. positions = Cesium.Cartesian3.fromDegreesArray([ - -112, - 38, - -112, - 36, - -111, - 36.5, - -110, - 36, - -110, - 38, + -112, 38, -112, 36, -111, 36.5, -110, 36, -110, 38, ]); textureCoordinates = { positions: [ @@ -284,8 +202,7 @@ const largeFlatInstance = new Cesium.GeometryInstance({ geometry: Cesium.PolygonGeometry.fromPositions({ positions: positions, - vertexFormat: - Cesium.MaterialAppearance.MaterialSupport.TEXTURED.vertexFormat, + vertexFormat: Cesium.MaterialAppearance.MaterialSupport.TEXTURED.vertexFormat, textureCoordinates: textureCoordinates, arcType: Cesium.ArcType.RHUMB, }), @@ -293,16 +210,7 @@ // Example 5: Textured extruded polygon. positions = Cesium.Cartesian3.fromDegreesArray([ - -109.4, - 37.4, - -109.4, - 37, - -109.2, - 37.1, - -109.0, - 37, - -109.0, - 37.4, + -109.4, 37.4, -109.4, 37, -109.2, 37.1, -109.0, 37, -109.0, 37.4, ]); textureCoordinates = { positions: [ @@ -317,29 +225,15 @@ geometry: Cesium.PolygonGeometry.fromPositions({ positions: positions, extrudedHeight: 50000, - vertexFormat: - Cesium.MaterialAppearance.MaterialSupport.TEXTURED.vertexFormat, + vertexFormat: Cesium.MaterialAppearance.MaterialSupport.TEXTURED.vertexFormat, textureCoordinates: textureCoordinates, }), }); // Example 6: Textured extruded polygon with perPositionHeights. positions = Cesium.Cartesian3.fromDegreesArrayHeights([ - -108.4, - 37.4, - 50000, - -108.4, - 37, - 30000, - -108.2, - 37.1, - 35000, - -108.0, - 37, - 30000, - -108.0, - 37.4, - 50000, + -108.4, 37.4, 50000, -108.4, 37, 30000, -108.2, 37.1, 35000, -108.0, 37, 30000, + -108.0, 37.4, 50000, ]); textureCoordinates = { positions: [ @@ -354,8 +248,7 @@ geometry: Cesium.PolygonGeometry.fromPositions({ positions: positions, extrudedHeight: 0, - vertexFormat: - Cesium.MaterialAppearance.MaterialSupport.TEXTURED.vertexFormat, + vertexFormat: Cesium.MaterialAppearance.MaterialSupport.TEXTURED.vertexFormat, perPositionHeight: true, textureCoordinates: textureCoordinates, }), @@ -381,24 +274,16 @@ }, }, }), - materialSupport: - Cesium.MaterialAppearance.MaterialSupport.TEXTURED, + materialSupport: Cesium.MaterialAppearance.MaterialSupport.TEXTURED, translucent: false, }), - }) + }), ); // Example 7: Ground primitive - custom texture coordinates are not expected to work, but the polygon should render. positions = Cesium.Cartesian3.fromDegreesArray([ - -105, - 37.5, - -105, - 37.0, - -100, - 37.0, - -100, - 37.5, + -105, 37.5, -105, 37.0, -100, 37.0, -100, 37.5, ]); textureCoordinates = { positions: [ @@ -429,7 +314,7 @@ }), }), classificationType: Cesium.ClassificationType.TERRAIN, - }) + }), ); //Sandcastle_End }; diff --git a/Apps/Sandcastle/gallery/development/Polygon.html b/Apps/Sandcastle/gallery/development/Polygon.html index 9dc7d26fe3bc..a229fcbe3219 100644 --- a/Apps/Sandcastle/gallery/development/Polygon.html +++ b/Apps/Sandcastle/gallery/development/Polygon.html @@ -1,4 +1,4 @@ - + @@ -21,10 +21,7 @@ > - + @@ -44,16 +41,7 @@ // Create the polygon geometry. The positions here are // in counter clockwise order. let positions = Cesium.Cartesian3.fromDegreesArray([ - -115.0, - 37.0, - -115.0, - 32.0, - -107.0, - 33.0, - -102.0, - 31.0, - -102.0, - 35.0, + -115.0, 37.0, -115.0, 32.0, -107.0, 33.0, -102.0, 31.0, -102.0, 35.0, ]); // Create a geometry instance using the polygon geometry. const redPolygonInstance = new Cesium.GeometryInstance({ @@ -62,9 +50,7 @@ vertexFormat: Cesium.PerInstanceColorAppearance.VERTEX_FORMAT, }), attributes: { - color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.RED - ), + color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.RED), }, }); @@ -75,50 +61,22 @@ // edges and the positions of the holes. const polygonHierarchy = { positions: Cesium.Cartesian3.fromDegreesArray([ - -99.0, - 30.0, - -85.0, - 30.0, - -85.0, - 40.0, - -99.0, - 40.0, + -99.0, 30.0, -85.0, 30.0, -85.0, 40.0, -99.0, 40.0, ]), holes: [ { positions: Cesium.Cartesian3.fromDegreesArray([ - -97.0, - 31.0, - -97.0, - 39.0, - -87.0, - 39.0, - -87.0, - 31.0, + -97.0, 31.0, -97.0, 39.0, -87.0, 39.0, -87.0, 31.0, ]), holes: [ { positions: Cesium.Cartesian3.fromDegreesArray([ - -95.0, - 33.0, - -89.0, - 33.0, - -89.0, - 37.0, - -95.0, - 37.0, + -95.0, 33.0, -89.0, 33.0, -89.0, 37.0, -95.0, 37.0, ]), holes: [ { positions: Cesium.Cartesian3.fromDegreesArray([ - -93.0, - 34.0, - -91.0, - 34.0, - -91.0, - 36.0, - -93.0, - 36.0, + -93.0, 34.0, -91.0, 34.0, -91.0, 36.0, -93.0, 36.0, ]), }, ], @@ -134,9 +92,7 @@ vertexFormat: Cesium.PerInstanceColorAppearance.VERTEX_FORMAT, }), attributes: { - color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.BLUE - ), + color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.BLUE), }, }); @@ -145,12 +101,7 @@ // To extrude, use the extruded height option to specify // the height of the polygon geometry. positions = Cesium.Cartesian3.fromDegreesArray([ - -108.0, - 42.0, - -100.0, - 42.0, - -104.0, - 40.0, + -108.0, 42.0, -100.0, 42.0, -104.0, 40.0, ]); const greenPolygonInstance = new Cesium.GeometryInstance({ geometry: Cesium.PolygonGeometry.fromPositions({ @@ -159,9 +110,7 @@ vertexFormat: Cesium.PerInstanceColorAppearance.VERTEX_FORMAT, }), attributes: { - color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.GREEN - ), + color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.GREEN), }, }); @@ -169,17 +118,7 @@ // per position heights. positions = Cesium.Cartesian3.fromDegreesArrayHeights([ - -108.0, - 25.0, - 100000, - -100.0, - 25.0, - 100000, - -100.0, - 30.0, - 100000, - -108.0, - 30.0, + -108.0, 25.0, 100000, -100.0, 25.0, 100000, -100.0, 30.0, 100000, -108.0, 30.0, 300000, ]); // Set the perPositionHeight option to true for the polygon @@ -194,9 +133,7 @@ perPositionHeight: true, }), attributes: { - color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.ORANGE - ), + color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.ORANGE), }, }); @@ -205,36 +142,13 @@ let hierarchy = { positions: Cesium.Cartesian3.fromDegreesArrayHeights([ - -130, - 40.0, - 50000, - -130, - 36.0, - 30000, - -125, - 37, - 35000, - -120, - 36.0, - 30000, - -120, - 40.0, - 50000, + -130, 40.0, 50000, -130, 36.0, 30000, -125, 37, 35000, -120, 36.0, 30000, + -120, 40.0, 50000, ]), holes: [ { positions: Cesium.Cartesian3.fromDegreesArrayHeights([ - -128, - 39.2, - 46000, - -128, - 38.6, - 42000, - -127, - 38.6, - 42000, - -127, - 39.2, + -128, 39.2, 46000, -128, 38.6, 42000, -127, 38.6, 42000, -127, 39.2, 46000, ]), }, @@ -265,29 +179,15 @@ geometry: new Cesium.PolygonGeometry({ polygonHierarchy: hierarchy, perPositionHeight: true, - vertexFormat: - Cesium.MaterialAppearance.MaterialSupport.TEXTURED.vertexFormat, + vertexFormat: Cesium.MaterialAppearance.MaterialSupport.TEXTURED.vertexFormat, textureCoordinates: textureCoordinates, }), }); hierarchy = { positions: Cesium.Cartesian3.fromDegreesArrayHeights([ - -118.4, - 40.4, - 50000, - -118.4, - 37, - 30000, - -114.2, - 38.0, - 35000, - -108.0, - 37, - 30000, - -108.0, - 40.4, - 50000, + -118.4, 40.4, 50000, -118.4, 37, 30000, -114.2, 38.0, 35000, -108.0, 37, + 30000, -108.0, 40.4, 50000, ]), }; @@ -309,8 +209,7 @@ polygonHierarchy: hierarchy, perPositionHeight: true, extrudedHeight: 0, - vertexFormat: - Cesium.MaterialAppearance.MaterialSupport.TEXTURED.vertexFormat, + vertexFormat: Cesium.MaterialAppearance.MaterialSupport.TEXTURED.vertexFormat, textureCoordinates: textureCoordinates, }), }); @@ -328,7 +227,7 @@ closed: true, translucent: false, }), - }) + }), ); // Add each textured polygon instance to primitives. @@ -351,7 +250,7 @@ }), materialSupport: Cesium.MaterialAppearance.MaterialSupport.TEXTURED, translucent: false, - }) + }), ); //Sandcastle_End }; diff --git a/Apps/Sandcastle/gallery/development/Polyline Color.html b/Apps/Sandcastle/gallery/development/Polyline Color.html index 4023d162a6ef..16245f14dc75 100644 --- a/Apps/Sandcastle/gallery/development/Polyline Color.html +++ b/Apps/Sandcastle/gallery/development/Polyline Color.html @@ -1,4 +1,4 @@ - + @@ -7,10 +7,7 @@ name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no" /> - + Cesium Demo @@ -21,10 +18,7 @@ > - + @@ -60,7 +54,7 @@ }), }), appearance: new Cesium.PolylineColorAppearance(), - }) + }), ); // Example 2: Draw a polyline with per vertex colors @@ -85,7 +79,7 @@ }), }), appearance: new Cesium.PolylineColorAppearance(), - }) + }), ); //Sandcastle_End }; diff --git a/Apps/Sandcastle/gallery/development/Polyline Material.html b/Apps/Sandcastle/gallery/development/Polyline Material.html index 9c5680eb86f5..d90b700cf251 100644 --- a/Apps/Sandcastle/gallery/development/Polyline Material.html +++ b/Apps/Sandcastle/gallery/development/Polyline Material.html @@ -1,4 +1,4 @@ - + @@ -21,10 +21,7 @@ > - + @@ -44,21 +41,16 @@ geometryInstances: new Cesium.GeometryInstance({ geometry: new Cesium.PolylineGeometry({ positions: Cesium.Cartesian3.fromDegreesArray([ - -120.0, - 40.0, - -80.0, - 40.0, + -120.0, 40.0, -80.0, 40.0, ]), width: 10.0, vertexFormat: Cesium.PolylineMaterialAppearance.VERTEX_FORMAT, }), }), appearance: new Cesium.PolylineMaterialAppearance({ - material: Cesium.Material.fromType( - Cesium.Material.PolylineGlowType - ), + material: Cesium.Material.fromType(Cesium.Material.PolylineGlowType), }), - }) + }), ); // Polyline Arrow @@ -67,21 +59,16 @@ geometryInstances: new Cesium.GeometryInstance({ geometry: new Cesium.PolylineGeometry({ positions: Cesium.Cartesian3.fromDegreesArray([ - -120.0, - 35.0, - -80.0, - 35.0, + -120.0, 35.0, -80.0, 35.0, ]), width: 10.0, vertexFormat: Cesium.PolylineMaterialAppearance.VERTEX_FORMAT, }), }), appearance: new Cesium.PolylineMaterialAppearance({ - material: Cesium.Material.fromType( - Cesium.Material.PolylineArrowType - ), + material: Cesium.Material.fromType(Cesium.Material.PolylineArrowType), }), - }) + }), ); // Polyline Outline @@ -90,21 +77,16 @@ geometryInstances: new Cesium.GeometryInstance({ geometry: new Cesium.PolylineGeometry({ positions: Cesium.Cartesian3.fromDegreesArray([ - -120.0, - 30.0, - -80.0, - 30.0, + -120.0, 30.0, -80.0, 30.0, ]), width: 10.0, vertexFormat: Cesium.PolylineMaterialAppearance.VERTEX_FORMAT, }), }), appearance: new Cesium.PolylineMaterialAppearance({ - material: Cesium.Material.fromType( - Cesium.Material.PolylineOutlineType - ), + material: Cesium.Material.fromType(Cesium.Material.PolylineOutlineType), }), - }) + }), ); //Sandcastle_End }; diff --git a/Apps/Sandcastle/gallery/development/Polyline Volume Outline.html b/Apps/Sandcastle/gallery/development/Polyline Volume Outline.html index e2df012ef973..367c3919286f 100644 --- a/Apps/Sandcastle/gallery/development/Polyline Volume Outline.html +++ b/Apps/Sandcastle/gallery/development/Polyline Volume Outline.html @@ -1,4 +1,4 @@ - + @@ -18,10 +18,7 @@ > - + @@ -53,20 +50,13 @@ const boxOutline = new Cesium.GeometryInstance({ geometry: new Cesium.PolylineVolumeOutlineGeometry({ polylinePositions: Cesium.Cartesian3.fromDegreesArray([ - -89.0, - 32.0, - -89.0, - 36.0, - -93.0, - 36.0, + -89.0, 32.0, -89.0, 36.0, -93.0, 36.0, ]), shapePositions: boxPositions(), cornerType: Cesium.CornerType.MITERED, }), attributes: { - color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.WHITE - ), + color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.WHITE), }, }); @@ -80,7 +70,7 @@ const r = i % 2 === 0 ? rOuter : rInner; const p = new Cesium.Cartesian2( Math.cos(i * angle) * r, - Math.sin(i * angle) * r + Math.sin(i * angle) * r, ); pos.push(p); } @@ -90,18 +80,13 @@ const starOutline = new Cesium.GeometryInstance({ geometry: new Cesium.PolylineVolumeOutlineGeometry({ polylinePositions: Cesium.Cartesian3.fromDegreesArray([ - -95.0, - 32.0, - -95.0, - 36.0, + -95.0, 32.0, -95.0, 36.0, ]), shapePositions: starPositions(5, 70000, 40000), cornerType: Cesium.CornerType.ROUNDED, }), attributes: { - color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.WHITE - ), + color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.WHITE), }, }); @@ -115,7 +100,7 @@ lineWidth: Math.min(2.0, scene.maximumAliasedLineWidth), }, }), - }) + }), ); //Sandcastle_End }; diff --git a/Apps/Sandcastle/gallery/development/Polyline Volume.html b/Apps/Sandcastle/gallery/development/Polyline Volume.html index 058bf9b26a29..d156688778e6 100644 --- a/Apps/Sandcastle/gallery/development/Polyline Volume.html +++ b/Apps/Sandcastle/gallery/development/Polyline Volume.html @@ -1,4 +1,4 @@ - + @@ -21,10 +21,7 @@ > - + @@ -49,8 +46,8 @@ positions.push( new Cesium.Cartesian2( radius * Math.cos(radians), - radius * Math.sin(radians) - ) + radius * Math.sin(radians), + ), ); } return positions; @@ -60,20 +57,13 @@ const redTube = new Cesium.GeometryInstance({ geometry: new Cesium.PolylineVolumeGeometry({ polylinePositions: Cesium.Cartesian3.fromDegreesArray([ - -85.0, - 32.0, - -85.0, - 36.0, - -89.0, - 36.0, + -85.0, 32.0, -85.0, 36.0, -89.0, 36.0, ]), vertexFormat: Cesium.PerInstanceColorAppearance.VERTEX_FORMAT, shapePositions: computeCircle(60000.0), }), attributes: { - color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.RED - ), + color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.RED), }, }); @@ -93,24 +83,14 @@ const greenBox = new Cesium.GeometryInstance({ geometry: new Cesium.PolylineVolumeGeometry({ polylinePositions: Cesium.Cartesian3.fromDegreesArrayHeights([ - -90.0, - 32.0, - 0.0, - -90.0, - 36.0, - 100000.0, - -94.0, - 36.0, - 0.0, + -90.0, 32.0, 0.0, -90.0, 36.0, 100000.0, -94.0, 36.0, 0.0, ]), vertexFormat: Cesium.PerInstanceColorAppearance.VERTEX_FORMAT, shapePositions: boxPositions(), cornerType: Cesium.CornerType.BEVELED, }), attributes: { - color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.GREEN - ), + color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.GREEN), }, }); @@ -124,7 +104,7 @@ const r = i % 2 === 0 ? rOuter : rInner; const p = new Cesium.Cartesian2( Math.cos(i * angle) * r, - Math.sin(i * angle) * r + Math.sin(i * angle) * r, ); pos.push(p); } @@ -134,24 +114,14 @@ const blueStar = new Cesium.GeometryInstance({ geometry: new Cesium.PolylineVolumeGeometry({ polylinePositions: Cesium.Cartesian3.fromDegreesArrayHeights([ - -95.0, - 32.0, - 0.0, - -95.0, - 36.0, - 100000.0, - -99.0, - 36.0, - 200000.0, + -95.0, 32.0, 0.0, -95.0, 36.0, 100000.0, -99.0, 36.0, 200000.0, ]), vertexFormat: Cesium.PerInstanceColorAppearance.VERTEX_FORMAT, shapePositions: starPositions(7, 70000, 50000), cornerType: Cesium.CornerType.ROUNDED, }), attributes: { - color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.BLUE - ), + color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.BLUE), }, }); @@ -163,7 +133,7 @@ translucent: false, closed: true, }), - }) + }), ); //Sandcastle_End }; diff --git a/Apps/Sandcastle/gallery/development/Polyline.html b/Apps/Sandcastle/gallery/development/Polyline.html index 1a1bef62af54..7f06a46b4d8a 100644 --- a/Apps/Sandcastle/gallery/development/Polyline.html +++ b/Apps/Sandcastle/gallery/development/Polyline.html @@ -1,4 +1,4 @@ - + @@ -18,10 +18,7 @@ > - + @@ -43,22 +40,19 @@ geometryInstances: new Cesium.GeometryInstance({ geometry: new Cesium.PolylineGeometry({ positions: Cesium.Cartesian3.fromDegreesArray([ - -124.0, - 40.0, - -80.0, - 40.0, + -124.0, 40.0, -80.0, 40.0, ]), width: 5.0, vertexFormat: Cesium.PolylineColorAppearance.VERTEX_FORMAT, }), attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor( - new Cesium.Color(1.0, 0.0, 0.0, 0.8) + new Cesium.Color(1.0, 0.0, 0.0, 0.8), ), }, }), appearance: new Cesium.PolylineColorAppearance(), - }) + }), ); // Example 2: Draw a straight blue polyline @@ -71,25 +65,18 @@ geometryInstances: new Cesium.GeometryInstance({ geometry: new Cesium.PolylineGeometry({ positions: Cesium.Cartesian3.fromDegreesArrayHeights([ - -84.0, - 50.0, - 0.0, - -100.0, - 30.0, - 1000000.0, + -84.0, 50.0, 0.0, -100.0, 30.0, 1000000.0, ]), width: 5.0, vertexFormat: Cesium.PolylineColorAppearance.VERTEX_FORMAT, arcType: Cesium.ArcType.NONE, }), attributes: { - color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.BLUE - ), + color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.BLUE), }, }), appearance: new Cesium.PolylineColorAppearance(), - }) + }), ); //Sandcastle_End }; diff --git a/Apps/Sandcastle/gallery/development/Polylines On Terrain.html b/Apps/Sandcastle/gallery/development/Polylines On Terrain.html index 2d7fbf10c883..131f60edaa34 100644 --- a/Apps/Sandcastle/gallery/development/Polylines On Terrain.html +++ b/Apps/Sandcastle/gallery/development/Polylines On Terrain.html @@ -1,4 +1,4 @@ - + @@ -21,10 +21,7 @@ > - + @@ -61,9 +58,7 @@ }); if (!Cesium.GroundPolylinePrimitive.isSupported(viewer.scene)) { - window.alert( - "Polylines on terrain are not supported on this platform." - ); + window.alert("Polylines on terrain are not supported on this platform."); } const polylineIds = ["polyline1", "polyline2"]; @@ -87,9 +82,8 @@ .subscribe(function (newValue) { lineWidth = parseFloat(viewModel.lineWidth); if (Cesium.defined(selectedId)) { - const attributes = polylineOnTerrainPrimitive.getGeometryInstanceAttributes( - selectedId - ); + const attributes = + polylineOnTerrainPrimitive.getGeometryInstanceAttributes(selectedId); lineWidth = parseFloat(viewModel.lineWidth); attributes.width = [lineWidth]; } @@ -106,7 +100,7 @@ -112.1340164450331, 36.05494287836128, -112.0840164450331, - 36.10494287836128 + 36.10494287836128, ), vertexFormat: Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT, }), @@ -117,7 +111,7 @@ material: Cesium.Material.fromType("Color"), }), classificationType: Cesium.ClassificationType.TERRAIN, - }) + }), ); const leftHandler = new Cesium.ScreenSpaceEventHandler(scene.canvas); @@ -130,9 +124,8 @@ selectedId = pickedObject.id; // Sync line width in toolbar with selected - const attributes = polylineOnTerrainPrimitive.getGeometryInstanceAttributes( - selectedId - ); + const attributes = + polylineOnTerrainPrimitive.getGeometryInstanceAttributes(selectedId); viewModel.lineWidth = attributes.width[0]; } } else { @@ -162,16 +155,9 @@ ]); const loopPositions = Cesium.Cartesian3.fromDegreesArray([ - -111.94500779274114, - 36.27638678884143, - -111.90983004392696, - 36.07985366173454, - -111.80360100637773, - 36.13694878292542, - -111.85510122419183, - 36.26029588763386, - -111.69141601804614, - 36.05128770351902, + -111.94500779274114, 36.27638678884143, -111.90983004392696, 36.07985366173454, + -111.80360100637773, 36.13694878292542, -111.85510122419183, 36.26029588763386, + -111.69141601804614, 36.05128770351902, ]); function createPolylines(debugShowShadowVolume) { @@ -185,7 +171,7 @@ attributes: { show: new Cesium.ShowGeometryInstanceAttribute(), color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.fromCssColorString("green").withAlpha(0.7) + Cesium.Color.fromCssColorString("green").withAlpha(0.7), ), }, }); @@ -200,7 +186,7 @@ attributes: { show: new Cesium.ShowGeometryInstanceAttribute(), color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.fromCssColorString("#67ADDF").withAlpha(0.7) + Cesium.Color.fromCssColorString("#67ADDF").withAlpha(0.7), ), }, }); @@ -216,79 +202,63 @@ polylineOnTerrainPrimitive.appearance = new Cesium.PolylineColorAppearance(); } function applyColorMaterial() { - polylineOnTerrainPrimitive.appearance = new Cesium.PolylineMaterialAppearance( - { - material: Cesium.Material.fromType("Color", { - color: new Cesium.Color(0.7, 0.0, 1.0, 1.0), - }), - } - ); + polylineOnTerrainPrimitive.appearance = new Cesium.PolylineMaterialAppearance({ + material: Cesium.Material.fromType("Color", { + color: new Cesium.Color(0.7, 0.0, 1.0, 1.0), + }), + }); } function applyGlowMaterial() { - polylineOnTerrainPrimitive.appearance = new Cesium.PolylineMaterialAppearance( - { - material: Cesium.Material.fromType("PolylineGlow", { - innerWidth: 1.0, - }), - } - ); + polylineOnTerrainPrimitive.appearance = new Cesium.PolylineMaterialAppearance({ + material: Cesium.Material.fromType("PolylineGlow", { + innerWidth: 1.0, + }), + }); } function applyArrow() { - polylineOnTerrainPrimitive.appearance = new Cesium.PolylineMaterialAppearance( - { - material: Cesium.Material.fromType("PolylineArrow"), - } - ); + polylineOnTerrainPrimitive.appearance = new Cesium.PolylineMaterialAppearance({ + material: Cesium.Material.fromType("PolylineArrow"), + }); } function applyDash() { - polylineOnTerrainPrimitive.appearance = new Cesium.PolylineMaterialAppearance( - { - material: Cesium.Material.fromType("PolylineDash", { - color: Cesium.Color.YELLOW, - }), - } - ); + polylineOnTerrainPrimitive.appearance = new Cesium.PolylineMaterialAppearance({ + material: Cesium.Material.fromType("PolylineDash", { + color: Cesium.Color.YELLOW, + }), + }); } function applyOutline() { - polylineOnTerrainPrimitive.appearance = new Cesium.PolylineMaterialAppearance( - { - material: Cesium.Material.fromType("PolylineOutline"), - } - ); + polylineOnTerrainPrimitive.appearance = new Cesium.PolylineMaterialAppearance({ + material: Cesium.Material.fromType("PolylineOutline"), + }); } Sandcastle.addToolbarButton("Toggle instance show", function () { if (Cesium.defined(selectedId)) { - const attributes = polylineOnTerrainPrimitive.getGeometryInstanceAttributes( - selectedId - ); + const attributes = + polylineOnTerrainPrimitive.getGeometryInstanceAttributes(selectedId); attributes.show = [attributes.show[0] ? 0 : 1]; } }); Sandcastle.addToolbarButton("Show all", function () { if (Cesium.defined(selectedId)) { - let attributes = polylineOnTerrainPrimitive.getGeometryInstanceAttributes( - "polyline1" - ); + let attributes = + polylineOnTerrainPrimitive.getGeometryInstanceAttributes("polyline1"); attributes.show = [1]; - attributes = polylineOnTerrainPrimitive.getGeometryInstanceAttributes( - "polyline2" - ); + attributes = + polylineOnTerrainPrimitive.getGeometryInstanceAttributes("polyline2"); attributes.show = [1]; } }); - Sandcastle.addToolbarButton( - "Toggle debugShowShadowVolume", - function () { - const debugShowShadowVolume = !polylineOnTerrainPrimitive.debugShowShadowVolume; - const appearance = polylineOnTerrainPrimitive.appearance; - scene.groundPrimitives.remove(polylineOnTerrainPrimitive); - createPolylines(debugShowShadowVolume); - polylineOnTerrainPrimitive.appearance = appearance; - } - ); + Sandcastle.addToolbarButton("Toggle debugShowShadowVolume", function () { + const debugShowShadowVolume = !polylineOnTerrainPrimitive.debugShowShadowVolume; + const appearance = polylineOnTerrainPrimitive.appearance; + scene.groundPrimitives.remove(polylineOnTerrainPrimitive); + createPolylines(debugShowShadowVolume); + polylineOnTerrainPrimitive.appearance = appearance; + }); Sandcastle.addToolbarButton("Toggle z-index", function () { if (groundPrimitiveOnTop) { @@ -302,7 +272,7 @@ function lookAt() { viewer.camera.lookAt( polylinePositions[1], - new Cesium.Cartesian3(50000.0, 50000.0, 50000.0) + new Cesium.Cartesian3(50000.0, 50000.0, 50000.0), ); viewer.camera.lookAtTransform(Cesium.Matrix4.IDENTITY); } diff --git a/Apps/Sandcastle/gallery/development/Polylines.html b/Apps/Sandcastle/gallery/development/Polylines.html index 7a24afd24473..9452881f2ce7 100644 --- a/Apps/Sandcastle/gallery/development/Polylines.html +++ b/Apps/Sandcastle/gallery/development/Polylines.html @@ -1,4 +1,4 @@ - + @@ -18,10 +18,7 @@ > - + @@ -33,19 +30,12 @@ "use strict"; //Sandcastle_Begin function createPrimitives(scene) { - const polylines = scene.primitives.add( - new Cesium.PolylineCollection() - ); + const polylines = scene.primitives.add(new Cesium.PolylineCollection()); // A simple polyline with two points. const polyline = polylines.add({ positions: Cesium.PolylinePipeline.generateCartesianArc({ - positions: Cesium.Cartesian3.fromDegreesArray([ - -120.0, - 40.0, - -110.0, - 30.0, - ]), + positions: Cesium.Cartesian3.fromDegreesArray([-120.0, 40.0, -110.0, 30.0]), }), material: Cesium.Material.fromType("Color", { color: new Cesium.Color(1.0, 1.0, 1.0, 1.0), @@ -57,22 +47,12 @@ const widePolyline = polylines.add({ positions: Cesium.PolylinePipeline.generateCartesianArc({ positions: Cesium.Cartesian3.fromDegreesArray([ - -105.0, - 40.0, - -100.0, - 38.0, - -105.0, - 35.0, - -100.0, - 32.0, + -105.0, 40.0, -100.0, 38.0, -105.0, 35.0, -100.0, 32.0, ]), }), - material: Cesium.Material.fromType( - Cesium.Material.PolylineOutlineType, - { - outlineWidth: 5.0, - } - ), + material: Cesium.Material.fromType(Cesium.Material.PolylineOutlineType, { + outlineWidth: 5.0, + }), width: 10.0, }); Sandcastle.declare(widePolyline); // For highlighting on mouseover in Sandcastle. @@ -80,21 +60,13 @@ // Apply a polyline glow material const coloredPolyline = polylines.add({ positions: Cesium.PolylinePipeline.generateCartesianArc({ - positions: Cesium.Cartesian3.fromDegreesArray([ - -95.0, - 30.0, - -85.0, - 40.0, - ]), + positions: Cesium.Cartesian3.fromDegreesArray([-95.0, 30.0, -85.0, 40.0]), + }), + material: Cesium.Material.fromType(Cesium.Material.PolylineGlowType, { + glowPower: 0.2, + taperPower: 0.2, + color: new Cesium.Color(1.0, 0.5, 0.0, 1.0), }), - material: Cesium.Material.fromType( - Cesium.Material.PolylineGlowType, - { - glowPower: 0.2, - taperPower: 0.2, - color: new Cesium.Color(1.0, 0.5, 0.0, 1.0), - } - ), width: 10.0, }); Sandcastle.declare(coloredPolyline); // For highlighting on mouseover in Sandcastle. @@ -103,14 +75,7 @@ const loopPolyline = polylines.add({ positions: Cesium.PolylinePipeline.generateCartesianArc({ positions: Cesium.Cartesian3.fromDegreesArray([ - -105.0, - 30.0, - -105.0, - 25.0, - -100.0, - 22.0, - -100.0, - 28.0, + -105.0, 30.0, -105.0, 25.0, -100.0, 22.0, -100.0, 28.0, ]), }), width: 3.0, @@ -120,13 +85,9 @@ // Draw a line in a local reference frame // The arrow points to the east, i.e. along the local x-axis. - const localPolylines = scene.primitives.add( - new Cesium.PolylineCollection() - ); + const localPolylines = scene.primitives.add(new Cesium.PolylineCollection()); const center = Cesium.Cartesian3.fromDegrees(-80.0, 35.0); - localPolylines.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame( - center - ); + localPolylines.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(center); const localPolyline = localPolylines.add({ positions: [ @@ -134,9 +95,7 @@ new Cesium.Cartesian3(1000000.0, 0.0, 0.0), ], width: 10.0, - material: Cesium.Material.fromType( - Cesium.Material.PolylineArrowType - ), + material: Cesium.Material.fromType(Cesium.Material.PolylineArrowType), }); Sandcastle.declare(localPolyline); // For highlighting on mouseover in Sandcastle. @@ -144,12 +103,7 @@ const fadingPolyline = polylines.add({ positions: Cesium.PolylinePipeline.generateCartesianArc({ positions: Cesium.Cartesian3.fromDegreesArrayHeights([ - -75, - 43, - 500000, - -125, - 43, - 500000, + -75, 43, 500000, -125, 43, 500000, ]), }), width: 5, @@ -169,12 +123,7 @@ // A rhumb line with two points. const rhumbLine = polylines.add({ positions: Cesium.PolylinePipeline.generateCartesianRhumbArc({ - positions: Cesium.Cartesian3.fromDegreesArray([ - -130.0, - 30.0, - -75.0, - 30.0, - ]), + positions: Cesium.Cartesian3.fromDegreesArray([-130.0, 30.0, -75.0, 30.0]), }), width: 5, material: Cesium.Material.fromType("Color", { diff --git a/Apps/Sandcastle/gallery/development/Rectangle Outline.html b/Apps/Sandcastle/gallery/development/Rectangle Outline.html index b466066cc8f1..6daf5da78dbc 100644 --- a/Apps/Sandcastle/gallery/development/Rectangle Outline.html +++ b/Apps/Sandcastle/gallery/development/Rectangle Outline.html @@ -1,4 +1,4 @@ - + @@ -18,10 +18,7 @@ > - + @@ -44,9 +41,7 @@ rectangle: Cesium.Rectangle.fromDegrees(-100.0, 30.0, -90.0, 40.0), }), attributes: { - color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.WHITE - ), + color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.WHITE), }, }); @@ -60,7 +55,7 @@ lineWidth: Math.min(2.0, scene.maximumAliasedLineWidth), }, }), - }) + }), ); //Sandcastle_End }; diff --git a/Apps/Sandcastle/gallery/development/Rectangle.html b/Apps/Sandcastle/gallery/development/Rectangle.html index 4123baa8643b..eb16c7cafccf 100644 --- a/Apps/Sandcastle/gallery/development/Rectangle.html +++ b/Apps/Sandcastle/gallery/development/Rectangle.html @@ -1,4 +1,4 @@ - + @@ -18,10 +18,7 @@ > - + @@ -44,7 +41,7 @@ }), attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor( - new Cesium.Color(1.0, 0.0, 0.0, 0.5) + new Cesium.Color(1.0, 0.0, 0.0, 0.5), ), }, }); @@ -65,7 +62,7 @@ }), attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor( - new Cesium.Color(0.0, 1.0, 0.0, 0.5) + new Cesium.Color(0.0, 1.0, 0.0, 0.5), ), }, }); @@ -77,7 +74,7 @@ appearance: new Cesium.PerInstanceColorAppearance({ closed: true, }), - }) + }), ); //Sandcastle_End }; diff --git a/Apps/Sandcastle/gallery/development/Shadows.html b/Apps/Sandcastle/gallery/development/Shadows.html index ad840163f0aa..442a3a8bd60e 100644 --- a/Apps/Sandcastle/gallery/development/Shadows.html +++ b/Apps/Sandcastle/gallery/development/Shadows.html @@ -1,4 +1,4 @@ - + @@ -18,10 +18,7 @@ > - + @@ -45,9 +39,7 @@ positions: Cesium.Cartesian3.fromDegreesArray([-127, 70, -80, 20]), }), attributes: { - color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.YELLOW - ), + color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.YELLOW), }, }); @@ -56,7 +48,7 @@ const colors = []; for (let j = 0; j <= 50; j += 5) { positions.push( - Cesium.Cartesian3.fromDegrees(-124.0 + j, 40, 50000.0 * (j % 10)) + Cesium.Cartesian3.fromDegrees(-124.0 + j, 40, 50000.0 * (j % 10)), ); colors.push(Cesium.Color.fromRandom({ alpha: 1.0 })); } @@ -95,7 +87,7 @@ lineWidth: Math.min(2.0, scene.maximumAliasedLineWidth), }, }), - }) + }), ); // Add perSegment and perVertex polyline instances to primitives. @@ -108,7 +100,7 @@ lineWidth: Math.min(2.0, scene.maximumAliasedLineWidth), }, }), - }) + }), ); //Sandcastle_End diff --git a/Apps/Sandcastle/gallery/development/Sphere Outline.html b/Apps/Sandcastle/gallery/development/Sphere Outline.html index ed0e8ad49e91..a9dbae875274 100644 --- a/Apps/Sandcastle/gallery/development/Sphere Outline.html +++ b/Apps/Sandcastle/gallery/development/Sphere Outline.html @@ -1,4 +1,4 @@ - + @@ -18,10 +18,7 @@ > - + @@ -44,7 +41,7 @@ const modelMatrix = Cesium.Matrix4.multiplyByTranslation( Cesium.Transforms.eastNorthUpToFixedFrame(positionOnEllipsoid), new Cesium.Cartesian3(0.0, 0.0, radius), - new Cesium.Matrix4() + new Cesium.Matrix4(), ); // Create the sphere outline geometry instance. Use the // stackPartitions and slicePartitions options to determine @@ -57,9 +54,7 @@ }), modelMatrix: modelMatrix, attributes: { - color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.WHITE - ), + color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.WHITE), }, }); // Add the instance to primitives. @@ -72,7 +67,7 @@ lineWidth: Math.min(2.0, scene.maximumAliasedLineWidth), }, }), - }) + }), ); //Sandcastle_End }; diff --git a/Apps/Sandcastle/gallery/development/Sphere.html b/Apps/Sandcastle/gallery/development/Sphere.html index 3eaa3590650c..076128f89dd9 100644 --- a/Apps/Sandcastle/gallery/development/Sphere.html +++ b/Apps/Sandcastle/gallery/development/Sphere.html @@ -1,4 +1,4 @@ - + @@ -18,10 +18,7 @@ > - + @@ -46,7 +43,7 @@ const modelMatrix = Cesium.Matrix4.multiplyByTranslation( Cesium.Transforms.eastNorthUpToFixedFrame(positionOnEllipsoid), new Cesium.Cartesian3(0.0, 0.0, radius), - new Cesium.Matrix4() + new Cesium.Matrix4(), ); // Create a sphere geometry. const sphereGeometry = new Cesium.SphereGeometry({ @@ -59,9 +56,7 @@ geometry: sphereGeometry, modelMatrix: modelMatrix, attributes: { - color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.RED - ), + color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.RED), }, }); // Add the sphere instance to primitives @@ -72,7 +67,7 @@ translucent: false, closed: true, }), - }) + }), ); //Sandcastle_End }; diff --git a/Apps/Sandcastle/gallery/development/Terrain Entity Batching.html b/Apps/Sandcastle/gallery/development/Terrain Entity Batching.html index 0b9e79eeda80..19d856167194 100644 --- a/Apps/Sandcastle/gallery/development/Terrain Entity Batching.html +++ b/Apps/Sandcastle/gallery/development/Terrain Entity Batching.html @@ -1,4 +1,4 @@ - + @@ -21,10 +21,7 @@ > - + @@ -46,62 +43,62 @@ new Cesium.Cartesian3( -2353381.4891308164, -3747386.1222378365, - 4577999.291515961 + 4577999.291515961, ), new Cesium.Cartesian3( -2359513.937204245, -3743087.2343810294, - 4578357.188560644 + 4578357.188560644, ), new Cesium.Cartesian3( -2356102.0286082155, -3739921.552293276, - 4582670.218770547 + 4582670.218770547, ), new Cesium.Cartesian3( -2353889.0353209395, -3741183.2274413602, - 4582776.909071608 + 4582776.909071608, ), new Cesium.Cartesian3( -2355072.390487758, -3742865.615615464, - 4580808.044684757 + 4580808.044684757, ), new Cesium.Cartesian3( -2356109.6661414686, -3741994.0607898533, - 4580985.489703348 + 4580985.489703348, ), new Cesium.Cartesian3( -2357041.8328847606, -3743225.9693035223, - 4579509.2148039425 + 4579509.2148039425, ), new Cesium.Cartesian3( -2354586.752280607, -3744890.9511893727, - 4579411.591389144 + 4579411.591389144, ), new Cesium.Cartesian3( -2353213.0268325945, -3743712.1202877173, - 4581070.08828045 + 4581070.08828045, ), new Cesium.Cartesian3( -2353637.930711704, -3743402.9513476435, - 4581104.219550749 + 4581104.219550749, ), new Cesium.Cartesian3( -2352875.095159641, -3742564.819171856, - 4582173.540953957 + 4582173.540953957, ), new Cesium.Cartesian3( -2350669.646050987, -3743751.6823160048, - 4582334.8406995395 + 4582334.8406995395, ), ]; @@ -132,7 +129,7 @@ cornerLon, cornerLat, cornerLon + 0.009, - cornerLat + 0.009 + cornerLat + 0.009, ), material: Cesium.Color.fromRandom().withAlpha(0.5), classificationType: Cesium.ClassificationType.TERRAIN, @@ -155,7 +152,7 @@ -122.17778, 46.36169, -120.17778, - 48.36169 + 48.36169, ), material: checkerboard, classificationType: Cesium.ClassificationType.TERRAIN, @@ -167,7 +164,7 @@ position: Cesium.Cartesian3.fromDegrees( -121.70711316136793, 45.943757948892845, - 0.0 + 0.0, ), name: "ellipse", ellipse: { diff --git a/Apps/Sandcastle/gallery/development/Terrain Performance.html b/Apps/Sandcastle/gallery/development/Terrain Performance.html index 3c2517bdc424..0db156ec70cb 100644 --- a/Apps/Sandcastle/gallery/development/Terrain Performance.html +++ b/Apps/Sandcastle/gallery/development/Terrain Performance.html @@ -1,4 +1,4 @@ - + @@ -21,10 +21,7 @@ > - + @@ -96,7 +93,7 @@ statistics.numberOfActiveRequestsEver } requests, min/max/avg frame FPS ${minFrameRate}/${maxFrameRate}/${ sumFrameRate / frameRateSamples - }` + }`, ); scene.postRender.removeEventListener(viewReady); } @@ -106,22 +103,22 @@ camera.position = new Cesium.Cartesian3( 302950.1757410969, 5637093.359233209, - 2976894.491577989 + 2976894.491577989, ); camera.direction = new Cesium.Cartesian3( -0.9648960658153797, -0.24110066659365145, - -0.10414437451009724 + -0.10414437451009724, ); camera.right = new Cesium.Cartesian3( -0.02152846103178338, 0.46781654381873394, - -0.8835633574877908 + -0.8835633574877908, ); camera.up = new Cesium.Cartesian3( -0.26174817580950865, 0.8503047394302772, - 0.456584868959543 + 0.456584868959543, ); flightComplete = true; } @@ -130,22 +127,22 @@ camera.position = new Cesium.Cartesian3( 301989.1870802739, 5637745.915399717, - 2977153.0443453398 + 2977153.0443453398, ); camera.direction = new Cesium.Cartesian3( 0.021398841015326783, -0.8909524564021135, - -0.45359211857597476 + -0.45359211857597476, ); camera.right = new Cesium.Cartesian3( 0.21237352569072232, 0.4473925820246778, - -0.8687562161705573 + -0.8687562161705573, ); camera.up = new Cesium.Cartesian3( -0.9769542339275126, 0.07774058129659328, - -0.19878839712310903 + -0.19878839712310903, ); flightComplete = true; } @@ -154,22 +151,22 @@ camera.position = new Cesium.Cartesian3( 302760.41072832496, 5637092.977453635, - 2977284.6758398763 + 2977284.6758398763, ); camera.direction = new Cesium.Cartesian3( -0.7254568510163212, -0.3330925403210976, - -0.6022970337764594 + -0.6022970337764594, ); camera.right = new Cesium.Cartesian3( 0.4750641658993092, 0.39087207931336604, - -0.7883736778277414 + -0.7883736778277414, ); camera.up = new Cesium.Cartesian3( -0.49802248502640617, 0.8580608237157107, - 0.12532049797395203 + 0.12532049797395203, ); flightComplete = true; } @@ -178,7 +175,7 @@ const position = new Cesium.Cartesian3( 302955.90876054496, 5639614.4908250235, - 2981096.1048591887 + 2981096.1048591887, ); camera.flyTo({ destination: position, @@ -193,36 +190,31 @@ camera.position = new Cesium.Cartesian3( 302950.1757410969, 5637093.359233209, - 2976894.491577989 + 2976894.491577989, ); camera.direction = new Cesium.Cartesian3( -0.9648960658153797, -0.24110066659365145, - -0.10414437451009724 + -0.10414437451009724, ); camera.right = new Cesium.Cartesian3( -0.02152846103178338, 0.46781654381873394, - -0.8835633574877908 + -0.8835633574877908, ); camera.up = new Cesium.Cartesian3( -0.26174817580950865, 0.8503047394302772, - 0.456584868959543 + 0.456584868959543, ); - const startCartographic = Cesium.Cartographic.fromCartesian( - camera.position - ); + const startCartographic = Cesium.Cartographic.fromCartesian(camera.position); let longitude = startCartographic.longitude; const endLongitude = longitude + 0.01; const latitude = startCartographic.latitude; const height = startCartographic.height; let startTime = window.performance.now(); - const removeCallback = scene.preRender.addEventListener(function ( - scene, - time - ) { + const removeCallback = scene.preRender.addEventListener(function (scene, time) { const endTime = window.performance.now(); const delta = endTime - startTime; startTime = endTime; @@ -231,11 +223,7 @@ flightComplete = true; removeCallback(); } - camera.position = Cesium.Cartesian3.fromRadians( - longitude, - latitude, - height - ); + camera.position = Cesium.Cartesian3.fromRadians(longitude, latitude, height); }); } diff --git a/Apps/Sandcastle/gallery/development/Terrain Tweaks.html b/Apps/Sandcastle/gallery/development/Terrain Tweaks.html index 18d98e711140..4a75c4145fbf 100644 --- a/Apps/Sandcastle/gallery/development/Terrain Tweaks.html +++ b/Apps/Sandcastle/gallery/development/Terrain Tweaks.html @@ -1,4 +1,4 @@ - + @@ -18,10 +18,7 @@ > - + @@ -40,21 +37,19 @@ new Cesium.EllipsoidPrimitive({ center: Cesium.Cartesian3.fromDegrees(-75.0, 40.0, 500000.0), radii: new Cesium.Cartesian3(500000.0, 500000.0, 500000.0), - material: Cesium.Material.fromType( - Cesium.Material.RimLightingType - ), - }) + material: Cesium.Material.fromType(Cesium.Material.RimLightingType), + }), ); Sandcastle.declare(e); // For Sandcastle highlighting. const e2 = scene.primitives.add( new Cesium.EllipsoidPrimitive({ modelMatrix: Cesium.Transforms.eastNorthUpToFixedFrame( - Cesium.Cartesian3.fromDegrees(-95.0, 40.0, 500000.0) + Cesium.Cartesian3.fromDegrees(-95.0, 40.0, 500000.0), ), radii: new Cesium.Cartesian3(300000.0, 300000.0, 500000.0), material: Cesium.Material.fromType(Cesium.Material.StripeType), - }) + }), ); Sandcastle.declare(e2); // For Sandcastle highlighting. } diff --git a/Apps/Sandcastle/gallery/development/Wall Outline.html b/Apps/Sandcastle/gallery/development/Wall Outline.html index 0ecd0d637a9f..06d45ada4736 100644 --- a/Apps/Sandcastle/gallery/development/Wall Outline.html +++ b/Apps/Sandcastle/gallery/development/Wall Outline.html @@ -1,4 +1,4 @@ - + @@ -18,10 +18,7 @@ > - + @@ -39,17 +36,12 @@ // Create the instance of the wall geometry outline. const instance = new Cesium.GeometryInstance({ geometry: new Cesium.WallOutlineGeometry.fromConstantHeights({ - positions: Cesium.Cartesian3.fromDegreesArray([ - -120.0, - 60.0, - -90.0, - 60.0, - ]), + positions: Cesium.Cartesian3.fromDegreesArray([-120.0, 60.0, -90.0, 60.0]), maximumHeight: 500000, }), attributes: { color: new Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.WHITE + Cesium.Color.WHITE, ), }, }); @@ -64,7 +56,7 @@ lineWidth: Math.min(2.0, scene.maximumAliasedLineWidth), }, }), - }) + }), ); //Sandcastle_End }; diff --git a/Apps/Sandcastle/gallery/development/Wall.html b/Apps/Sandcastle/gallery/development/Wall.html index 223e3cc86377..f693c615ebbd 100644 --- a/Apps/Sandcastle/gallery/development/Wall.html +++ b/Apps/Sandcastle/gallery/development/Wall.html @@ -1,4 +1,4 @@ - + @@ -18,10 +18,7 @@ > - + @@ -42,20 +39,13 @@ // the heights of the top and bottom of the wall. const redWallInstance = new Cesium.GeometryInstance({ geometry: Cesium.WallGeometry.fromConstantHeights({ - positions: Cesium.Cartesian3.fromDegreesArray([ - -115.0, - 44.0, - -90.0, - 44.0, - ]), + positions: Cesium.Cartesian3.fromDegreesArray([-115.0, 44.0, -90.0, 44.0]), maximumHeight: 200000.0, minimumHeight: 100000.0, vertexFormat: Cesium.PerInstanceColorAppearance.VERTEX_FORMAT, }), attributes: { - color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.RED - ), + color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.RED), }, }); @@ -66,24 +56,13 @@ const greenWallInstance = new Cesium.GeometryInstance({ geometry: Cesium.WallGeometry.fromConstantHeights({ positions: Cesium.Cartesian3.fromDegreesArray([ - -107.0, - 43.0, - -97.0, - 43.0, - -97.0, - 40.0, - -107.0, - 40.0, - -107.0, - 43.0, + -107.0, 43.0, -97.0, 43.0, -97.0, 40.0, -107.0, 40.0, -107.0, 43.0, ]), maximumHeight: 100000.0, vertexFormat: Cesium.PerInstanceColorAppearance.VERTEX_FORMAT, }), attributes: { - color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.GREEN - ), + color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.GREEN), }, }); @@ -92,55 +71,14 @@ // for maximumHeights (and optionally minumumHeights) // with a length equal to the number of positions. const positions = Cesium.Cartesian3.fromDegreesArray([ - -115.0, - 50.0, - -112.5, - 50.0, - -110.0, - 50.0, - -107.5, - 50.0, - -105.0, - 50.0, - -102.5, - 50.0, - -100.0, - 50.0, - -97.5, - 50.0, - -95.0, - 50.0, - -92.5, - 50.0, - -90.0, - 50.0, + -115.0, 50.0, -112.5, 50.0, -110.0, 50.0, -107.5, 50.0, -105.0, 50.0, -102.5, + 50.0, -100.0, 50.0, -97.5, 50.0, -95.0, 50.0, -92.5, 50.0, -90.0, 50.0, ]); const maximumHeights = [ - 100000, - 200000, - 100000, - 200000, - 100000, - 200000, - 100000, - 200000, - 100000, - 200000, + 100000, 200000, 100000, 200000, 100000, 200000, 100000, 200000, 100000, 200000, 100000, ]; - const minimumHeights = [ - 0, - 100000, - 0, - 100000, - 0, - 100000, - 0, - 100000, - 0, - 100000, - 0, - ]; + const minimumHeights = [0, 100000, 0, 100000, 0, 100000, 0, 100000, 0, 100000, 0]; const blueWallInstance = new Cesium.GeometryInstance({ geometry: new Cesium.WallGeometry({ @@ -150,24 +88,18 @@ vertexFormat: Cesium.PerInstanceColorAppearance.VERTEX_FORMAT, }), attributes: { - color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.BLUE - ), + color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.BLUE), }, }); // Add all wall instances to primitives. scene.primitives.add( new Cesium.Primitive({ - geometryInstances: [ - blueWallInstance, - redWallInstance, - greenWallInstance, - ], + geometryInstances: [blueWallInstance, redWallInstance, greenWallInstance], appearance: new Cesium.PerInstanceColorAppearance({ translucent: false, }), - }) + }), ); //Sandcastle_End }; diff --git a/Apps/Sandcastle/gallery/glTF PBR Extensions.html b/Apps/Sandcastle/gallery/glTF PBR Extensions.html index 3029425bd1de..6168860f97fa 100644 --- a/Apps/Sandcastle/gallery/glTF PBR Extensions.html +++ b/Apps/Sandcastle/gallery/glTF PBR Extensions.html @@ -1,4 +1,4 @@ - + @@ -16,10 +16,7 @@ - + @@ -42,28 +39,19 @@ const { scene, camera, clock } = viewer; if (!scene.specularEnvironmentMapsSupported) { - window.alert( - "This browser does not support specular environment maps." - ); + window.alert("This browser does not support specular environment maps."); } const height = 20.0; const hpr = new Cesium.HeadingPitchRoll(0.0, 0.0, 0.0); - const origin = Cesium.Cartesian3.fromDegrees( - -123.0744619, - 44.0503706, - height - ); - const modelMatrix = Cesium.Transforms.headingPitchRollToFixedFrame( - origin, - hpr - ); + const origin = Cesium.Cartesian3.fromDegrees(-123.0744619, 44.0503706, height); + const modelMatrix = Cesium.Transforms.headingPitchRollToFixedFrame(origin, hpr); scene.light = new Cesium.DirectionalLight({ direction: new Cesium.Cartesian3( 0.2454278300540191, 0.8842635425193919, - 0.39729481195458805 + 0.39729481195458805, ), intensity: 0.0, }); @@ -82,47 +70,47 @@ const L00 = new Cesium.Cartesian3( 1.234897375106812, 1.221635103225708, - 1.273374080657959 + 1.273374080657959, ); const L1_1 = new Cesium.Cartesian3( 1.136140108108521, 1.171419978141785, - 1.287894368171692 + 1.287894368171692, ); const L10 = new Cesium.Cartesian3( 1.245410919189453, 1.245791077613831, - 1.283067107200623 + 1.283067107200623, ); const L11 = new Cesium.Cartesian3( 1.107124328613281, 1.112697005271912, - 1.153419137001038 + 1.153419137001038, ); const L2_2 = new Cesium.Cartesian3( 1.08641505241394, 1.079904079437256, - 1.10212504863739 + 1.10212504863739, ); const L2_1 = new Cesium.Cartesian3( 1.190043210983276, 1.186099290847778, - 1.214627981185913 + 1.214627981185913, ); const L20 = new Cesium.Cartesian3( 0.017783647403121, 0.020140396431088, - 0.025317270308733 + 0.025317270308733, ); const L21 = new Cesium.Cartesian3( 1.087014317512512, 1.084779262542725, - 1.111417651176453 + 1.111417651176453, ); const L22 = new Cesium.Cartesian3( -0.052426788955927, -0.048315055668354, - -0.041973855346441 + -0.041973855346441, ); const coefficients = [L00, L1_1, L10, L11, L2_2, L2_1, L20, L21, L22]; @@ -138,8 +126,7 @@ onselect: () => { imageBasedLighting.sphericalHarmonicCoefficients = coefficients; imageBasedLighting.specularEnvironmentMaps = environmentMapURL; - imageBasedLighting.imageBasedLightingFactor = - Cesium.Cartesian2.ONE; + imageBasedLighting.imageBasedLightingFactor = Cesium.Cartesian2.ONE; scene.light.intensity = 0.0; }, }, @@ -148,16 +135,14 @@ onselect: () => { imageBasedLighting.sphericalHarmonicCoefficients = undefined; imageBasedLighting.specularEnvironmentMaps = undefined; - imageBasedLighting.imageBasedLightingFactor = - Cesium.Cartesian2.ONE; + imageBasedLighting.imageBasedLightingFactor = Cesium.Cartesian2.ONE; scene.light.intensity = 1.0; }, }, { text: "Direct lighting only", onselect: () => { - imageBasedLighting.imageBasedLightingFactor = - Cesium.Cartesian2.ZERO; + imageBasedLighting.imageBasedLightingFactor = Cesium.Cartesian2.ZERO; scene.light.intensity = 1.0; }, }, @@ -270,7 +255,7 @@ Cesium.Matrix4.multiplyByUniformScale( model.modelMatrix, scale, - model.modelMatrix + model.modelMatrix, ); radius *= scale; } @@ -279,7 +264,7 @@ const pitch = 0.0; camera.lookAt( model.boundingSphere.center, - new Cesium.HeadingPitchRange(heading, pitch, radius * 2.0) + new Cesium.HeadingPitchRange(heading, pitch, radius * 2.0), ); } //Sandcastle_End diff --git a/Apps/Sandcastle/index.html b/Apps/Sandcastle/index.html index 03f0dddfec2b..c6745b6a770f 100644 --- a/Apps/Sandcastle/index.html +++ b/Apps/Sandcastle/index.html @@ -1,4 +1,4 @@ - + @@ -30,7 +30,7 @@ if (window.location.protocol === "file:") { if ( confirm( - "You must host this app on a web server.\nSee contributor's guide for more info?" + "You must host this app on a web server.\nSee contributor's guide for more info?", ) ) { window.location = diff --git a/Apps/Sandcastle/standalone.html b/Apps/Sandcastle/standalone.html index 54e348a6c6ec..7bdfff33f922 100644 --- a/Apps/Sandcastle/standalone.html +++ b/Apps/Sandcastle/standalone.html @@ -1,4 +1,4 @@ - + @@ -71,7 +71,7 @@ document.head.appendChild(scriptElement); scriptElement.innerHTML = window.embedInSandcastleTemplate( code, - isFirefox + isFirefox, ); } diff --git a/Apps/Sandcastle/templates/bucket-requirejs.html b/Apps/Sandcastle/templates/bucket-requirejs.html index bde1e75919fc..8abfa3142e4b 100644 --- a/Apps/Sandcastle/templates/bucket-requirejs.html +++ b/Apps/Sandcastle/templates/bucket-requirejs.html @@ -1,4 +1,4 @@ - + diff --git a/Apps/Sandcastle/templates/bucket.html b/Apps/Sandcastle/templates/bucket.html index f03f1f56af4a..eca73df143de 100644 --- a/Apps/Sandcastle/templates/bucket.html +++ b/Apps/Sandcastle/templates/bucket.html @@ -1,4 +1,4 @@ - + diff --git a/Apps/TimelineDemo/TimelineDemo.js b/Apps/TimelineDemo/TimelineDemo.js index 5f865c99146d..4d30f2817db7 100644 --- a/Apps/TimelineDemo/TimelineDemo.js +++ b/Apps/TimelineDemo/TimelineDemo.js @@ -21,7 +21,7 @@ define(["dijit/dijit", "dojo"], function (dijit, dojo) { function updateScrubTime(julianDate) { document.getElementById("mousePos").innerHTML = `${timeline.makeLabel( - julianDate + julianDate, )} UTC`; } @@ -64,7 +64,7 @@ define(["dijit/dijit", "dojo"], function (dijit, dojo) { `
Start: ${timeline.makeLabel(e.startJulian)} UTC` + `
 Stop: ${timeline.makeLabel(e.endJulian)} UTC` + `
 Span: ${spanToString( - e.totalSpan + e.totalSpan, )}
  Tic: ${spanToString(e.mainTicSpan)}`; updateScrubTime(clock.currentTime); } @@ -90,7 +90,7 @@ define(["dijit/dijit", "dojo"], function (dijit, dojo) { }), 8, Color.RED, - new Color(0.55, 0.55, 0.55, 0.25) + new Color(0.55, 0.55, 0.55, 0.25), ); timeline.addTrack( @@ -99,7 +99,7 @@ define(["dijit/dijit", "dojo"], function (dijit, dojo) { stop: endJulian, }), 8, - Color.LIME + Color.LIME, ); const middle = JulianDate.secondsDifference(endJulian, startJulian) / 4; @@ -110,7 +110,7 @@ define(["dijit/dijit", "dojo"], function (dijit, dojo) { }), 8, Color.DEEPSKYBLUE, - new Color(0.55, 0.55, 0.55, 0.25) + new Color(0.55, 0.55, 0.55, 0.25), ); const clockViewModel = new ClockViewModel(clock); @@ -215,7 +215,7 @@ define(["dijit/dijit", "dojo"], function (dijit, dojo) { timeline.resize(); animation.resize(); }, - false + false, ); dojo.ready(function () { diff --git a/Apps/TimelineDemo/index.html b/Apps/TimelineDemo/index.html index 94e2a0143815..b86bcb590e42 100644 --- a/Apps/TimelineDemo/index.html +++ b/Apps/TimelineDemo/index.html @@ -1,4 +1,4 @@ - + diff --git a/CHANGES.md b/CHANGES.md index 93e8690b691e..fa462272d0bd 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2146,7 +2146,7 @@ _This is an npm-only release to fix a publishing issue_. - This is to make clipping planes' coordinates always relative to the object they're attached to. So if you were positioning the clipping planes as in the example below, this is no longer necessary: ```javascript clippingPlanes.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame( - tileset.boundingSphere.center + tileset.boundingSphere.center, ); ``` - This also fixes several issues with clipping planes not using the correct transform for tilesets with children. diff --git a/Documentation/Contributors/CodingGuide/README.md b/Documentation/Contributors/CodingGuide/README.md index 99ade2899769..921781f393c2 100644 --- a/Documentation/Contributors/CodingGuide/README.md +++ b/Documentation/Contributors/CodingGuide/README.md @@ -181,7 +181,6 @@ Cartesian3.fromDegrees(); // Not Cartesin3.fromAngle() ```javascript "use strict"; - ``` - :speedboat: To avoid type coercion (implicit type conversion), test for equality with `===` and `!==`, e.g., @@ -369,7 +368,7 @@ function getTransform(node) { return Matrix4.fromTranslationQuaternionRotationScale( node.translation, node.rotation, - node.scale + node.scale, ); } } @@ -386,7 +385,7 @@ function getTransform(node) { return Matrix4.fromTranslationQuaternionRotationScale( node.translation, node.rotation, - node.scale + node.scale, ); } ``` @@ -444,7 +443,7 @@ Cartesian3.fromRadians = function (longitude, latitude, height) { ```javascript this._mapProjection = defaultValue( options.mapProjection, - new GeographicProjection() + new GeographicProjection(), ); ``` @@ -820,7 +819,7 @@ When the overhead of getter/setter functions is prohibitive or reference-type se ```javascript function Model(options) { this.modelMatrix = Matrix4.clone( - defaultValue(options.modelMatrix, Matrix4.IDENTITY) + defaultValue(options.modelMatrix, Matrix4.IDENTITY), ); this._modelMatrix = Matrix4.clone(this.modelMatrix); } @@ -922,7 +921,7 @@ A public identifier (class, function, property) should be deprecated before bein function Foo() { deprecationWarning( "Foo", - "Foo was deprecated in CesiumJS 1.01. It will be removed in 1.03. Use newFoo instead." + "Foo was deprecated in CesiumJS 1.01. It will be removed in 1.03. Use newFoo instead.", ); // ... } diff --git a/Documentation/Contributors/PerformanceTestingGuide/README.md b/Documentation/Contributors/PerformanceTestingGuide/README.md index adfc888ad445..e4ccab3e089c 100644 --- a/Documentation/Contributors/PerformanceTestingGuide/README.md +++ b/Documentation/Contributors/PerformanceTestingGuide/README.md @@ -46,12 +46,12 @@ viewer.scene.camera.setView({ destination: new Cesium.Cartesian3( 2881774.230386411, 1342620.6006856258, - 5510835.220814708 + 5510835.220814708, ), orientation: new Cesium.HeadingPitchRoll( 5.708910165980631, -0.2293856922649915, - 2.875174018868165e-7 + 2.875174018868165e-7, ), }); ``` diff --git a/Documentation/Contributors/TestingGuide/README.md b/Documentation/Contributors/TestingGuide/README.md index 23a9c5131573..915c8bf38d38 100644 --- a/Documentation/Contributors/TestingGuide/README.md +++ b/Documentation/Contributors/TestingGuide/README.md @@ -421,11 +421,11 @@ it("angleBetween works for acute angles", function () { const y = new Cartesian3(1.0, 1.0, 0.0); expect(Cartesian3.angleBetween(x, y)).toEqualEpsilon( CesiumMath.PI_OVER_FOUR, - CesiumMath.EPSILON14 + CesiumMath.EPSILON14, ); expect(Cartesian3.angleBetween(y, x)).toEqualEpsilon( CesiumMath.PI_OVER_FOUR, - CesiumMath.EPSILON14 + CesiumMath.EPSILON14, ); }); ``` @@ -533,7 +533,7 @@ it("does not render when show is false", function () { scene.primitives.add( new DebugModelMatrixPrimitive({ show: false, - }) + }), ); expect(scene).toRender([0, 0, 0, 255]); }); @@ -777,13 +777,13 @@ it("Zooms to longitude, latitude, height", function () { viewModel.search(); expect(Camera.prototype.flyTo).toHaveBeenCalled(); expect(Camera.prototype.flyTo.calls.mostRecent().args[0].destination).toEqual( - Cartesian3.fromDegrees(1.0, 2.0, 3.0) + Cartesian3.fromDegrees(1.0, 2.0, 3.0), ); viewModel.searchText = "1.0 2.0 3.0"; viewModel.search(); expect(Camera.prototype.flyTo.calls.mostRecent().args[0].destination).toEqual( - Cartesian3.fromDegrees(1.0, 2.0, 3.0) + Cartesian3.fromDegrees(1.0, 2.0, 3.0), ); }); ``` @@ -895,7 +895,7 @@ it("fromUrl throws if the SRS is not supported", async function () { metadata.spatialReference.latestWkid = 1234; await expectAsync( - ArcGISTiledElevationTerrainProvider.fromUrl(baseUrl) + ArcGISTiledElevationTerrainProvider.fromUrl(baseUrl), ).toBeRejectedWithError(RuntimeError, "Invalid spatial reference"); }); ``` @@ -905,7 +905,7 @@ Since developer errors are removed for release builds, CesiumJS's `toBeRejectedW ```javascript it("fromUrl throws without url", async function () { await expectAsync(Cesium3DTileset.fromUrl()).toBeRejectedWithDeveloperError( - "url is required, actual value was undefined" + "url is required, actual value was undefined", ); }); ``` @@ -967,7 +967,7 @@ describe( // ... }, - "WebGL" + "WebGL", ); ``` diff --git a/Documentation/OfflineGuide/README.md b/Documentation/OfflineGuide/README.md index e50e84fa1cac..3ea2feaebf65 100644 --- a/Documentation/OfflineGuide/README.md +++ b/Documentation/OfflineGuide/README.md @@ -22,8 +22,8 @@ This example shows how to configure CesiumJS to avoid use of online data sources const viewer = new Cesium.Viewer("cesiumContainer", { baseLayer: Cesium.ImageryLayer.fromProviderAsync( Cesium.TileMapServiceImageryProvider.fromUrl( - Cesium.buildModuleUrl("Assets/Textures/NaturalEarthII") - ) + Cesium.buildModuleUrl("Assets/Textures/NaturalEarthII"), + ), ), baseLayerPicker: false, geocoder: false, @@ -59,7 +59,7 @@ Most other files loaded in CesiumJS, such as 3D Tiles or glTF, are static assets ```js try { const tileset = await Cesium.Cesium3DTileset.fromUrl( - "http://localhost:8003/example/tileset.json" + "http://localhost:8003/example/tileset.json", ); viewer.scene.primitives.add(tileset); } catch (error) { diff --git a/Specs/Cesium3DTilesTester.js b/Specs/Cesium3DTilesTester.js index b52d0e73cea8..430c177ce7eb 100644 --- a/Specs/Cesium3DTilesTester.js +++ b/Specs/Cesium3DTilesTester.js @@ -106,7 +106,7 @@ Cesium3DTilesTester.loadTileset = async function (scene, url, options) { options = defaultValue(options, {}); options.cullRequestsWhileMoving = defaultValue( options.cullRequestsWhileMoving, - false + false, ); const tileset = await Cesium3DTileset.fromUrl(url, options); @@ -119,7 +119,7 @@ Cesium3DTilesTester.loadTileset = async function (scene, url, options) { Cesium3DTilesTester.createContentForMockTile = async function ( arrayBuffer, - type + type, ) { const tileset = {}; const url = Resource.createIfNeeded(""); @@ -128,19 +128,19 @@ Cesium3DTilesTester.createContentForMockTile = async function ( mockTile, url, arrayBuffer, - 0 + 0, ); }; Cesium3DTilesTester.tileDestroys = function (scene, url, options) { - return Cesium3DTilesTester.loadTileset(scene, url, options).then(function ( - tileset - ) { - const content = tileset.root.content; - expect(content.isDestroyed()).toEqual(false); - scene.primitives.remove(tileset); - expect(content.isDestroyed()).toEqual(true); - }); + return Cesium3DTilesTester.loadTileset(scene, url, options).then( + function (tileset) { + const content = tileset.root.content; + expect(content.isDestroyed()).toEqual(false); + scene.primitives.remove(tileset); + expect(content.isDestroyed()).toEqual(true); + }, + ); }; Cesium3DTilesTester.generateBatchedTileBuffer = function (options) { @@ -208,7 +208,7 @@ Cesium3DTilesTester.generateInstancedTileBuffer = function (options) { const featureTableBinary = defaultValue( options.featureTableBinary, - new Uint8Array(0) + new Uint8Array(0), ); const featureTableBinaryByteLength = featureTableBinary.length; @@ -222,7 +222,7 @@ Cesium3DTilesTester.generateInstancedTileBuffer = function (options) { const batchTableBinary = defaultValue( options.batchTableBinary, - new Uint8Array(0) + new Uint8Array(0), ); const batchTableBinaryByteLength = batchTableBinary.length; @@ -292,7 +292,7 @@ Cesium3DTilesTester.generatePointCloudTileBuffer = function (options) { featureTableJsonString = padStringToByteAlignment(featureTableJsonString, 4); const featureTableJsonByteLength = defaultValue( options.featureTableJsonByteLength, - featureTableJsonString.length + featureTableJsonString.length, ); const featureTableBinary = new ArrayBuffer(12); // Enough space to hold 3 floats diff --git a/Specs/Data/WMS/GetFeatureInfo.html b/Specs/Data/WMS/GetFeatureInfo.html index d4f17e22c1e7..b2fb32bcc5b0 100644 --- a/Specs/Data/WMS/GetFeatureInfo.html +++ b/Specs/Data/WMS/GetFeatureInfo.html @@ -1,4 +1,4 @@ - + HTML yeah! diff --git a/Specs/DomEventSimulator.js b/Specs/DomEventSimulator.js index bbff151ae5c0..8a6093ff6146 100644 --- a/Specs/DomEventSimulator.js +++ b/Specs/DomEventSimulator.js @@ -33,7 +33,7 @@ function createMouseEvent(type, options) { shiftKey, metaKey, button, - relatedTarget + relatedTarget, ); return event; } @@ -89,7 +89,7 @@ function createMouseWheelEvent(type, options) { button, relatedTarget, modifiersList, - wheelDelta + wheelDelta, ); return event; } @@ -140,7 +140,7 @@ function createWheelEvent(type, options) { ctrlKey, altKey, shiftKey, - metaKey + metaKey, ); event.initWheelEvent( type, @@ -158,7 +158,7 @@ function createWheelEvent(type, options) { deltaX, deltaY, deltaZ, - deltaMode + deltaMode, ); return event; } @@ -241,7 +241,7 @@ function createPointerEvent(type, options) { pointerId, pointerType, hwTimestamp, - isPrimary + isPrimary, ); } else { event = new window.PointerEvent(type, { @@ -295,7 +295,7 @@ function createDeviceOrientationEvent(type, options) { alpha, beta, gamma, - absolute + absolute, ); } else { event = new DeviceOrientationEvent("deviceorientation", { @@ -356,7 +356,7 @@ const DomEventSimulator = { }, fireDeviceOrientation: function (element, options) { element.dispatchEvent( - createDeviceOrientationEvent("deviceorientation", options) + createDeviceOrientationEvent("deviceorientation", options), ); }, fireMockEvent: function (eventHandler, event) { diff --git a/Specs/ImplicitTilingTester.js b/Specs/ImplicitTilingTester.js index 7513a4b497de..3cce276c929b 100644 --- a/Specs/ImplicitTilingTester.js +++ b/Specs/ImplicitTilingTester.js @@ -85,7 +85,7 @@ function ImplicitTilingTester() {} */ ImplicitTilingTester.generateSubtreeBuffers = function ( subtreeDescription, - constantOnly + constantOnly, ) { constantOnly = defaultValue(constantOnly, false); @@ -127,14 +127,13 @@ function makeBufferViews(subtreeDescription, subtreeJson) { const parsedAvailability = { tileAvailability: parseAvailability(subtreeDescription.tileAvailability), childSubtreeAvailability: parseAvailability( - subtreeDescription.childSubtreeAvailability + subtreeDescription.childSubtreeAvailability, ), }; if (hasContent) { - parsedAvailability.contentAvailability = subtreeDescription.contentAvailability.map( - parseAvailability - ); + parsedAvailability.contentAvailability = + subtreeDescription.contentAvailability.map(parseAvailability); } // to simulate additional buffer views for metadata or other purposes. @@ -151,33 +150,33 @@ function makeBufferViews(subtreeDescription, subtreeJson) { const useLegacySchema = defaultValue( subtreeDescription.useLegacySchema, - false + false, ); const bufferViewJsonArray = []; gatherBufferViews( bufferViewsU8, bufferViewJsonArray, parsedAvailability.tileAvailability, - useLegacySchema + useLegacySchema, ); if (hasContent) { - parsedAvailability.contentAvailability.forEach(function ( - contentAvailability - ) { - gatherBufferViews( - bufferViewsU8, - bufferViewJsonArray, - contentAvailability, - useLegacySchema - ); - }); + parsedAvailability.contentAvailability.forEach( + function (contentAvailability) { + gatherBufferViews( + bufferViewsU8, + bufferViewJsonArray, + contentAvailability, + useLegacySchema, + ); + }, + ); } gatherBufferViews( bufferViewsU8, bufferViewJsonArray, parsedAvailability.childSubtreeAvailability, - useLegacySchema + useLegacySchema, ); // to simulate additional buffer views for metadata or other purposes. @@ -186,7 +185,7 @@ function makeBufferViews(subtreeDescription, subtreeJson) { bufferViewsU8, bufferViewJsonArray, parsedAvailability.other, - useLegacySchema + useLegacySchema, ); } if (bufferViewJsonArray.length > 0) { @@ -210,11 +209,11 @@ function makeBufferViews(subtreeDescription, subtreeJson) { }, }; } else if (contentAvailabilityArray.length > 1) { - subtreeJson.contentAvailability = contentAvailabilityArray.map(function ( - x - ) { - return x.availabilityJson; - }); + subtreeJson.contentAvailability = contentAvailabilityArray.map( + function (x) { + return x.availabilityJson; + }, + ); } else { subtreeJson.contentAvailability = contentAvailabilityArray[0].availabilityJson; @@ -236,7 +235,7 @@ function gatherBufferViews( bufferViewsU8, bufferViewJsonArray, parsedBitstream, - useLegacySchema + useLegacySchema, ) { if (defined(parsedBitstream.constant)) { parsedBitstream.availabilityJson = { @@ -340,7 +339,7 @@ function parseAvailability(availability) { const includeAvailableCount = availability.includeAvailableCount; const parsed = parseAvailabilityDescriptor( availability.descriptor, - includeAvailableCount + includeAvailableCount, ); parsed.isInternal = availability.isInternal; parsed.shareBuffer = availability.shareBuffer; @@ -399,10 +398,10 @@ function addMetadata( bufferViewsU8, subtreeJson, metadataOptions, - useLegacySchema + useLegacySchema, ) { const propertyTableResults = MetadataTester.createPropertyTables( - metadataOptions.propertyTables + metadataOptions.propertyTables, ); // Add bufferViews to the list ----------------------------------- @@ -445,7 +444,7 @@ function addMetadata( const tileProperties = getPropertiesObjectFromPropertyTable( tileTable, firstMetadataIndex, - useLegacySchema + useLegacySchema, ); const propertyTables = []; @@ -479,7 +478,7 @@ function addMetadata( const contentProperties = getPropertiesObjectFromPropertyTable( contentTable, firstMetadataIndex, - useLegacySchema + useLegacySchema, ); const contentMetadata = { class: contentTable.class, @@ -501,7 +500,7 @@ function addMetadata( function getPropertiesObjectFromPropertyTable( propertyTable, firstMetadataIndex, - useLegacySchema + useLegacySchema, ) { const tableProperties = propertyTable.properties; const properties = {}; diff --git a/Specs/MetadataTester.js b/Specs/MetadataTester.js index 119015be69d4..09f8de4de4bb 100644 --- a/Specs/MetadataTester.js +++ b/Specs/MetadataTester.js @@ -84,7 +84,7 @@ function createProperties(options) { count = values.length; const valuesBuffer = addPadding( - createValuesBuffer(values, classProperty) + createValuesBuffer(values, classProperty), ); const valuesBufferView = bufferViewIndex++; bufferViews[valuesBufferView] = valuesBuffer; @@ -114,8 +114,8 @@ function createProperties(options) { createArrayOffsetBuffer( values, classProperty.type, - arrayOffsetBufferType - ) + arrayOffsetBufferType, + ), ); const arrayOffsetBufferView = bufferViewIndex++; bufferViews[arrayOffsetBufferView] = arrayOffsetBuffer; @@ -125,10 +125,10 @@ function createProperties(options) { if (classProperty.type === MetadataType.STRING) { const stringOffsetBufferType = defaultValue( stringOffsetType, - offsetType + offsetType, ); const stringOffsetBuffer = addPadding( - createStringOffsetBuffer(values, stringOffsetBufferType) + createStringOffsetBuffer(values, stringOffsetBufferType), ); const stringOffsetBufferView = bufferViewIndex++; bufferViews[stringOffsetBufferView] = stringOffsetBuffer; @@ -418,7 +418,7 @@ function createBuffer(values, componentType) { //>>includeStart('debug', pragmas.debug); default: throw new DeveloperError( - `${componentType} is not a valid component type` + `${componentType} is not a valid component type`, ); //>>includeEnd('debug'); } diff --git a/Specs/MockImageryProvider.js b/Specs/MockImageryProvider.js index e4116178c041..8d7b1b035464 100644 --- a/Specs/MockImageryProvider.js +++ b/Specs/MockImageryProvider.js @@ -38,7 +38,7 @@ MockImageryProvider.prototype.requestImage = function (x, y, level, request) { MockImageryProvider.prototype.requestImageWillSucceed = function ( xOrTile, y, - level + level, ) { this._requestImageWillSucceed[createTileKey(xOrTile, y, level)] = true; return this; @@ -47,7 +47,7 @@ MockImageryProvider.prototype.requestImageWillSucceed = function ( MockImageryProvider.prototype.requestImageWillFail = function ( xOrTile, y, - level + level, ) { this._requestImageWillSucceed[createTileKey(xOrTile, y, level)] = false; return this; @@ -56,7 +56,7 @@ MockImageryProvider.prototype.requestImageWillFail = function ( MockImageryProvider.prototype.requestImageWillDefer = function ( xOrTile, y, - level + level, ) { this._requestImageWillSucceed[createTileKey(xOrTile, y, level)] = undefined; return this; @@ -66,7 +66,7 @@ MockImageryProvider.prototype.requestImageWillWaitOn = function ( promise, xOrTile, y, - level + level, ) { this._requestImageWillSucceed[createTileKey(xOrTile, y, level)] = promise; return this; diff --git a/Specs/MockTerrainProvider.js b/Specs/MockTerrainProvider.js index 9a482e38182f..7adfe37b1cd9 100644 --- a/Specs/MockTerrainProvider.js +++ b/Specs/MockTerrainProvider.js @@ -12,11 +12,12 @@ import { function MockTerrainProvider() { this.tilingScheme = new GeographicTilingScheme(); this.heightmapWidth = 65; - this.levelZeroMaximumGeometricError = TerrainProvider.getEstimatedLevelZeroGeometricErrorForAHeightmap( - this.tilingScheme.ellipsoid, - this.heightmapWidth, - this.tilingScheme.getNumberOfXTilesAtLevel(0) - ); + this.levelZeroMaximumGeometricError = + TerrainProvider.getEstimatedLevelZeroGeometricErrorForAHeightmap( + this.tilingScheme.ellipsoid, + this.heightmapWidth, + this.tilingScheme.getNumberOfXTilesAtLevel(0), + ); this.hasWaterMask = true; this.errorEvent = new Event(); @@ -32,11 +33,10 @@ MockTerrainProvider.prototype.requestTileGeometry = function ( x, y, level, - request + request, ) { - const willSucceed = this._requestTileGeometryWillSucceed[ - createTileKey(x, y, level) - ]; + const willSucceed = + this._requestTileGeometryWillSucceed[createTileKey(x, y, level)]; if (willSucceed === undefined) { return undefined; // defer by default } @@ -58,7 +58,7 @@ MockTerrainProvider.prototype.requestTileGeometry = function ( MockTerrainProvider.prototype.getTileDataAvailable = function ( xOrTile, y, - level + level, ) { return this._tileDataAvailable[createTileKey(xOrTile, y, level)]; }; @@ -70,7 +70,7 @@ MockTerrainProvider.prototype.getLevelMaximumGeometricError = function (level) { MockTerrainProvider.prototype.requestTileGeometryWillSucceed = function ( xOrTile, y, - level + level, ) { this._requestTileGeometryWillSucceed[createTileKey(xOrTile, y, level)] = true; return this; @@ -80,34 +80,31 @@ MockTerrainProvider.prototype.requestTileGeometryWillSucceedWith = function ( terrainData, xOrTile, y, - level + level, ) { this._requestTileGeometryWillSucceed[createTileKey(xOrTile, y, level)] = true; - this._requestTileGeometryWillSucceedWith[ - createTileKey(xOrTile, y, level) - ] = terrainData; + this._requestTileGeometryWillSucceedWith[createTileKey(xOrTile, y, level)] = + terrainData; return this; }; MockTerrainProvider.prototype.requestTileGeometryWillFail = function ( xOrTile, y, - level + level, ) { - this._requestTileGeometryWillSucceed[ - createTileKey(xOrTile, y, level) - ] = false; + this._requestTileGeometryWillSucceed[createTileKey(xOrTile, y, level)] = + false; return this; }; MockTerrainProvider.prototype.requestTileGeometryWillDefer = function ( xOrTile, y, - level + level, ) { - this._requestTileGeometryWillSucceed[ - createTileKey(xOrTile, y, level) - ] = undefined; + this._requestTileGeometryWillSucceed[createTileKey(xOrTile, y, level)] = + undefined; return this; }; @@ -115,11 +112,10 @@ MockTerrainProvider.prototype.requestTileGeometryWillWaitOn = function ( promise, xOrTile, y, - level + level, ) { - this._requestTileGeometryWillSucceed[ - createTileKey(xOrTile, y, level) - ] = promise; + this._requestTileGeometryWillSucceed[createTileKey(xOrTile, y, level)] = + promise; return this; }; @@ -128,7 +124,7 @@ MockTerrainProvider.prototype.willHaveWaterMask = function ( includeWater, xOrTile, y, - level + level, ) { this._willHaveWaterMask[createTileKey(xOrTile, y, level)] = includeLand || includeWater @@ -143,7 +139,7 @@ MockTerrainProvider.prototype.willHaveWaterMask = function ( MockTerrainProvider.prototype.createMeshWillSucceed = function ( xOrTile, y, - level + level, ) { this._createMeshWillSucceed[createTileKey(xOrTile, y, level)] = true; return this; @@ -152,7 +148,7 @@ MockTerrainProvider.prototype.createMeshWillSucceed = function ( MockTerrainProvider.prototype.createMeshWillFail = function ( xOrTile, y, - level + level, ) { this._createMeshWillSucceed[createTileKey(xOrTile, y, level)] = false; return this; @@ -161,7 +157,7 @@ MockTerrainProvider.prototype.createMeshWillFail = function ( MockTerrainProvider.prototype.createMeshWillDefer = function ( xOrTile, y, - level + level, ) { this._createMeshWillSucceed[createTileKey(xOrTile, y, level)] = undefined; return this; @@ -171,7 +167,7 @@ MockTerrainProvider.prototype.createMeshWillWaitOn = function ( promise, xOrTile, y, - level + level, ) { this._createMeshWillSucceed[createTileKey(xOrTile, y, level)] = promise; return this; @@ -180,7 +176,7 @@ MockTerrainProvider.prototype.createMeshWillWaitOn = function ( MockTerrainProvider.prototype.upsampleWillSucceed = function ( xOrTile, y, - level + level, ) { this._upsampleWillSucceed[createTileKey(xOrTile, y, level)] = true; return this; @@ -209,7 +205,7 @@ MockTerrainProvider.prototype.willBeUnavailable = function (xOrTile, y, level) { MockTerrainProvider.prototype.willBeUnknownAvailability = function ( xOrTile, y, - level + level, ) { this._tileDataAvailable[createTileKey(xOrTile, y, level)] = undefined; return this; @@ -257,7 +253,7 @@ function createTerrainData(terrainProvider, x, y, level, upsampled) { thisY, thisLevel, descendantX, - descendantY + descendantY, ) { const willSucceed = terrainProvider._upsampleWillSucceed[ diff --git a/Specs/ShaderBuilderTester.js b/Specs/ShaderBuilderTester.js index 3f01f3b537f8..af6819864728 100644 --- a/Specs/ShaderBuilderTester.js +++ b/Specs/ShaderBuilderTester.js @@ -14,7 +14,7 @@ function expectEqualUnordered(array1, array2) { ShaderBuilderTester.expectHasAttributes = function ( shaderBuilder, positionAttributeLine, - expectedAttributeLines + expectedAttributeLines, ) { expect(shaderBuilder._positionAttributeLine).toEqual(positionAttributeLine); expectEqualUnordered(shaderBuilder._attributeLines, expectedAttributeLines); @@ -22,63 +22,63 @@ ShaderBuilderTester.expectHasAttributes = function ( ShaderBuilderTester.expectHasVertexDefines = function ( shaderBuilder, - expectedDefines + expectedDefines, ) { expectEqualUnordered( shaderBuilder._vertexShaderParts.defineLines, - expectedDefines + expectedDefines, ); }; ShaderBuilderTester.expectHasFragmentDefines = function ( shaderBuilder, - expectedDefines + expectedDefines, ) { expectEqualUnordered( shaderBuilder._fragmentShaderParts.defineLines, - expectedDefines + expectedDefines, ); }; ShaderBuilderTester.expectHasVertexUniforms = function ( shaderBuilder, - expectedUniforms + expectedUniforms, ) { expectEqualUnordered( shaderBuilder._vertexShaderParts.uniformLines, - expectedUniforms + expectedUniforms, ); }; ShaderBuilderTester.expectHasFragmentUniforms = function ( shaderBuilder, - expectedUniforms + expectedUniforms, ) { expectEqualUnordered( shaderBuilder._fragmentShaderParts.uniformLines, - expectedUniforms + expectedUniforms, ); }; ShaderBuilderTester.expectHasVaryings = function ( shaderBuilder, - expectedVaryings + expectedVaryings, ) { expect(shaderBuilder._vertexShaderParts.varyingLines).toEqual( jasmine.arrayWithExactContents( - expectedVaryings.map((varying) => jasmine.stringContaining(varying)) - ) + expectedVaryings.map((varying) => jasmine.stringContaining(varying)), + ), ); expect(shaderBuilder._fragmentShaderParts.varyingLines).toEqual( jasmine.arrayWithExactContents( - expectedVaryings.map((varying) => jasmine.stringContaining(varying)) - ) + expectedVaryings.map((varying) => jasmine.stringContaining(varying)), + ), ); }; ShaderBuilderTester.expectHasVertexStructIds = function ( shaderBuilder, - expectedStructIds + expectedStructIds, ) { expect(shaderBuilder._vertexShaderParts.structIds).toEqual(expectedStructIds); }; @@ -87,7 +87,7 @@ ShaderBuilderTester.expectHasVertexStruct = function ( shaderBuilder, structId, structName, - expectedFields + expectedFields, ) { expectHasLine(shaderBuilder._vertexShaderParts.structIds, structId); const struct = shaderBuilder._structs[structId]; @@ -98,10 +98,10 @@ ShaderBuilderTester.expectHasVertexStruct = function ( ShaderBuilderTester.expectHasFragmentStructIds = function ( shaderBuilder, - expectedStructIds + expectedStructIds, ) { expect(shaderBuilder._fragmentShaderParts.structIds).toEqual( - expectedStructIds + expectedStructIds, ); }; @@ -109,7 +109,7 @@ ShaderBuilderTester.expectHasFragmentStruct = function ( shaderBuilder, structId, structName, - expectedFields + expectedFields, ) { expectHasLine(shaderBuilder._fragmentShaderParts.structIds, structId); const struct = shaderBuilder._structs[structId]; @@ -120,10 +120,10 @@ ShaderBuilderTester.expectHasFragmentStruct = function ( ShaderBuilderTester.expectHasVertexFunctionIds = function ( shaderBuilder, - expectedFunctionIds + expectedFunctionIds, ) { expect(shaderBuilder._vertexShaderParts.functionIds).toEqual( - expectedFunctionIds + expectedFunctionIds, ); }; @@ -131,7 +131,7 @@ ShaderBuilderTester.expectHasVertexFunction = function ( shaderBuilder, functionId, signature, - bodyLines + bodyLines, ) { expectHasLine(shaderBuilder._vertexShaderParts.functionIds, functionId); const func = shaderBuilder._functions[functionId]; @@ -144,7 +144,7 @@ ShaderBuilderTester.expectHasVertexFunctionUnordered = function ( shaderBuilder, functionId, signature, - bodyLines + bodyLines, ) { expectHasLine(shaderBuilder._vertexShaderParts.functionIds, functionId); const func = shaderBuilder._functions[functionId]; @@ -155,10 +155,10 @@ ShaderBuilderTester.expectHasVertexFunctionUnordered = function ( ShaderBuilderTester.expectHasFragmentFunctionIds = function ( shaderBuilder, - expectedFunctionIds + expectedFunctionIds, ) { expect(shaderBuilder._fragmentShaderParts.functionIds).toEqual( - expectedFunctionIds + expectedFunctionIds, ); }; @@ -166,7 +166,7 @@ ShaderBuilderTester.expectHasFragmentFunction = function ( shaderBuilder, functionId, signature, - bodyLines + bodyLines, ) { expectHasLine(shaderBuilder._fragmentShaderParts.functionIds, functionId); const func = shaderBuilder._functions[functionId]; @@ -179,7 +179,7 @@ ShaderBuilderTester.expectHasFragmentFunctionUnordered = function ( shaderBuilder, functionId, signature, - bodyLines + bodyLines, ) { expectHasLine(shaderBuilder._fragmentShaderParts.functionIds, functionId); const func = shaderBuilder._functions[functionId]; @@ -190,7 +190,7 @@ ShaderBuilderTester.expectHasFragmentFunctionUnordered = function ( ShaderBuilderTester.expectVertexLinesContains = function ( shaderBuilder, - expectedString + expectedString, ) { let hasLine = false; const lines = shaderBuilder._vertexShaderParts.shaderLines; @@ -208,16 +208,16 @@ ShaderBuilderTester.expectVertexLinesContains = function ( ShaderBuilderTester.expectVertexLinesEqual = function ( shaderBuilder, - expectedVertexLines + expectedVertexLines, ) { expect(shaderBuilder._vertexShaderParts.shaderLines).toEqual( - expectedVertexLines + expectedVertexLines, ); }; ShaderBuilderTester.expectFragmentLinesContains = function ( shaderBuilder, - expectedString + expectedString, ) { const lines = shaderBuilder._fragmentShaderParts.shaderLines; for (let i = 0; i < lines; i++) { @@ -228,10 +228,10 @@ ShaderBuilderTester.expectFragmentLinesContains = function ( ShaderBuilderTester.expectFragmentLinesEqual = function ( shaderBuilder, - expectedFragmentLines + expectedFragmentLines, ) { expect(shaderBuilder._fragmentShaderParts.shaderLines).toEqual( - expectedFragmentLines + expectedFragmentLines, ); }; diff --git a/Specs/SpecRunner.html b/Specs/SpecRunner.html index 6ff81e56d106..919b169b3940 100644 --- a/Specs/SpecRunner.html +++ b/Specs/SpecRunner.html @@ -1,4 +1,4 @@ - + @@ -15,7 +15,7 @@ document.write(' diff --git a/Specs/TerrainTileProcessor.js b/Specs/TerrainTileProcessor.js index 7831cb00f5f9..35e2aac381aa 100644 --- a/Specs/TerrainTileProcessor.js +++ b/Specs/TerrainTileProcessor.js @@ -9,7 +9,7 @@ import { function TerrainTileProcessor( frameState, terrainProvider, - imageryLayerCollection + imageryLayerCollection, ) { this.frameState = frameState; this.terrainProvider = terrainProvider; @@ -70,7 +70,7 @@ TerrainTileProcessor.prototype.process = function (tiles, maxIterations) { tile, that.frameState, that.terrainProvider, - that.imageryLayerCollection + that.imageryLayerCollection, ); const afterState = getState(tile); changed = @@ -99,18 +99,17 @@ TerrainTileProcessor.prototype.mockWebGL = function () { "isDestroyed", ]); return vertexArray; - } + }, ); - spyOn(ImageryLayer.prototype, "_createTextureWebGL").and.callFake(function ( - context, - imagery - ) { - const texture = jasmine.createSpyObj("Texture", ["destroy"]); - texture.width = imagery.image.width; - texture.height = imagery.image.height; - return texture; - }); + spyOn(ImageryLayer.prototype, "_createTextureWebGL").and.callFake( + function (context, imagery) { + const texture = jasmine.createSpyObj("Texture", ["destroy"]); + texture.width = imagery.image.width; + texture.height = imagery.image.height; + return texture; + }, + ); spyOn(ImageryLayer.prototype, "_finalizeReprojectTexture"); diff --git a/Specs/TestWorkers/transferArrayBuffer.js b/Specs/TestWorkers/transferArrayBuffer.js index f79f22d0973c..5f16001f287e 100644 --- a/Specs/TestWorkers/transferArrayBuffer.js +++ b/Specs/TestWorkers/transferArrayBuffer.js @@ -1,10 +1,9 @@ import { createTaskProcessorWorker } from "@cesium/engine"; -export default createTaskProcessorWorker(function ( - parameters, - transferableObjects -) { - const arrayBuffer = new ArrayBuffer(parameters.byteLength); - transferableObjects.push(arrayBuffer); - return arrayBuffer; -}); +export default createTaskProcessorWorker( + function (parameters, transferableObjects) { + const arrayBuffer = new ArrayBuffer(parameters.byteLength); + transferableObjects.push(arrayBuffer); + return arrayBuffer; + }, +); diff --git a/Specs/TypeScript/index.ts b/Specs/TypeScript/index.ts index 54c04526cd1e..44d522cfd21d 100644 --- a/Specs/TypeScript/index.ts +++ b/Specs/TypeScript/index.ts @@ -184,7 +184,7 @@ property = positionProperty = new TimeIntervalCollectionPositionProperty(); property = positionProperty = new ReferenceProperty( new EntityCollection(), "object1", - ["billboard", "scale"] + ["billboard", "scale"], ); // Verify MaterialProperty instances conform to the expected MaterialProperty and Property interfaces diff --git a/Specs/addDefaultMatchers.js b/Specs/addDefaultMatchers.js index b35b1418e1e7..9ad56f65c30a 100644 --- a/Specs/addDefaultMatchers.js +++ b/Specs/addDefaultMatchers.js @@ -18,7 +18,7 @@ import equals from "./equals.js"; function createMissingFunctionMessageFunction( item, actualPrototype, - expectedInterfacePrototype + expectedInterfacePrototype, ) { return function () { return `Expected function '${item}' to exist on ${actualPrototype.constructor.name} because it should implement interface ${expectedInterfacePrototype.constructor.name}.`; @@ -274,7 +274,7 @@ function createDefaultMatchers(debug) { message: createMissingFunctionMessageFunction( item, actualPrototype, - expectedInterfacePrototype + expectedInterfacePrototype, ), }; } @@ -399,7 +399,7 @@ function createDefaultMatchers(debug) { compare: function (actual, expected, args) { const scene = actual; const result = scene.pickVoxel( - defaultValue(args, new Cartesian2(0, 0)) + defaultValue(args, new Cartesian2(0, 0)), ); const webglStub = !!window.webglStub; @@ -467,14 +467,14 @@ function createDefaultMatchers(debug) { ray, limit, objectsToExclude, - width + width, ) { const scene = actual; const results = scene.drillPickFromRay( ray, limit, objectsToExclude, - width + width, ); const webglStub = !!window.webglStub; @@ -499,7 +499,7 @@ function createDefaultMatchers(debug) { expected, position, objectsToExclude, - width + width, ) { const scene = actual; const results = scene.sampleHeight(position, objectsToExclude, width); @@ -526,13 +526,13 @@ function createDefaultMatchers(debug) { expected, cartesian, objectsToExclude, - width + width, ) { const scene = actual; const results = scene.clampToHeight( cartesian, objectsToExclude, - width + width, ); const webglStub = !!window.webglStub; @@ -708,7 +708,7 @@ function createDefaultMatchers(debug) { toThrowDeveloperError: makeThrowFunction( debug, DeveloperError, - "DeveloperError" + "DeveloperError", ), }; } @@ -718,7 +718,7 @@ function createDefaultAsyncMatchers(debug) { toBeRejectedWithDeveloperError: makeAsyncThrowFunction( debug, DeveloperError, - "DeveloperError" + "DeveloperError", ), }; } @@ -796,7 +796,7 @@ function renderEquals(util, actual, expected, expectEqual) { message = `Expected ${ expectEqual ? "" : "not " }to render [${typedArrayToArray( - expected + expected, )}], but actually rendered [${typedArrayToArray(actualRgba)}].`; } @@ -883,19 +883,19 @@ function contextRenderAndReadPixels(options) { if (!defined(fs) && !defined(sp)) { throw new DeveloperError( - "options.fragmentShader or options.shaderProgram is required." + "options.fragmentShader or options.shaderProgram is required.", ); } if (defined(fs) && defined(sp)) { throw new DeveloperError( - "Both options.fragmentShader and options.shaderProgram can not be used at the same time." + "Both options.fragmentShader and options.shaderProgram can not be used at the same time.", ); } if (defined(vs) && defined(sp)) { throw new DeveloperError( - "Both options.vertexShader and options.shaderProgram can not be used at the same time." + "Both options.vertexShader and options.shaderProgram can not be used at the same time.", ); } diff --git a/Specs/concatTypedArrays.js b/Specs/concatTypedArrays.js index 3ac362b5a2a2..d665a8f96624 100644 --- a/Specs/concatTypedArrays.js +++ b/Specs/concatTypedArrays.js @@ -14,7 +14,7 @@ function concatTypedArrays(arrays) { const data = new Uint8Array( array.buffer, array.byteOffset, - array.byteLength + array.byteLength, ); buffer.set(data, byteOffset); byteOffset += data.length; diff --git a/Specs/createDynamicGeometryUpdaterSpecs.js b/Specs/createDynamicGeometryUpdaterSpecs.js index b7567a7e434c..20d0b1737bab 100644 --- a/Specs/createDynamicGeometryUpdaterSpecs.js +++ b/Specs/createDynamicGeometryUpdaterSpecs.js @@ -14,7 +14,7 @@ function createDynamicGeometryUpdaterSpecs( Updater, geometryPropertyName, createDynamicEntity, - getScene + getScene, ) { const time = JulianDate.now(); @@ -36,7 +36,7 @@ function createDynamicGeometryUpdaterSpecs( const groundPrimitives = new PrimitiveCollection(); const dynamicUpdater = updater.createDynamicUpdater( primitives, - groundPrimitives + groundPrimitives, ); expect(primitives.length).toBe(0); expect(groundPrimitives.length).toBe(0); @@ -87,7 +87,7 @@ function createDynamicGeometryUpdaterSpecs( updater._onEntityPropertyChanged(entity, updater._geometryPropertyName); const dynamicUpdater = updater.createDynamicUpdater( scene.primitives, - scene.groundPrimitives + scene.groundPrimitives, ); dynamicUpdater.update(time); @@ -105,7 +105,7 @@ function createDynamicGeometryUpdaterSpecs( const attributes = primitive.getGeometryInstanceAttributes(entity); expect(result).toEqualEpsilon( attributes.boundingSphere, - CesiumMath.EPSILON6 + CesiumMath.EPSILON6, ); updater.destroy(); @@ -124,7 +124,7 @@ function createDynamicGeometryUpdaterSpecs( const dynamicUpdater = updater.createDynamicUpdater( scene.primitives, - scene.groundPrimitives + scene.groundPrimitives, ); dynamicUpdater.update(time); @@ -141,7 +141,7 @@ function createDynamicGeometryUpdaterSpecs( const attributes = primitive.getGeometryInstanceAttributes(entity); expect(result).toEqualEpsilon( attributes.boundingSphere, - CesiumMath.EPSILON6 + CesiumMath.EPSILON6, ); updater.destroy(); @@ -155,7 +155,7 @@ function createDynamicGeometryUpdaterSpecs( const updater = new Updater(entity, scene); const dynamicUpdater = updater.createDynamicUpdater( scene.primitives, - scene.groundPrimitives + scene.groundPrimitives, ); expect(function () { diff --git a/Specs/createFrameState.js b/Specs/createFrameState.js index 8f4ba1c1f6b2..a7838a72bdcf 100644 --- a/Specs/createFrameState.js +++ b/Specs/createFrameState.js @@ -16,9 +16,9 @@ function createFrameState(context, camera, frameNumber, time) { new CreditDisplay( document.createElement("div"), undefined, - document.createElement("div") + document.createElement("div"), ), - new JobScheduler() + new JobScheduler(), ); const projection = new GeographicProjection(); @@ -26,7 +26,7 @@ function createFrameState(context, camera, frameNumber, time) { frameState.frameNumber = defaultValue(frameNumber, 1.0); frameState.time = defaultValue( time, - JulianDate.fromDate(new Date("January 1, 2011 12:00:00 EST")) + JulianDate.fromDate(new Date("January 1, 2011 12:00:00 EST")), ); camera = defaultValue( @@ -35,13 +35,13 @@ function createFrameState(context, camera, frameNumber, time) { drawingBufferWidth: 1, drawingBufferHeight: 1, mapProjection: projection, - }) + }), ); frameState.camera = camera; frameState.cullingVolume = camera.frustum.computeCullingVolume( camera.position, camera.direction, - camera.up + camera.up, ); frameState.verticalExaggeration = 1.0; diff --git a/Specs/createGeometryUpdaterGroundGeometrySpecs.js b/Specs/createGeometryUpdaterGroundGeometrySpecs.js index e91f6b743cc1..60df92fc25da 100644 --- a/Specs/createGeometryUpdaterGroundGeometrySpecs.js +++ b/Specs/createGeometryUpdaterGroundGeometrySpecs.js @@ -16,7 +16,7 @@ function createGeometryUpdaterGroundGeometrySpecs( geometryPropertyName, createEntity, createDynamicEntity, - getScene + getScene, ) { const time = JulianDate.now(); @@ -147,7 +147,7 @@ function createGeometryUpdaterGroundGeometrySpecs( graphics.heightReference = new ConstantProperty(HeightReference.NONE); graphics.extrudedHeightReference = new ConstantProperty( - HeightReference.NONE + HeightReference.NONE, ); updater._onEntityPropertyChanged(entity, geometryPropertyName); instance = updater.createFillGeometryInstance(time); @@ -157,7 +157,7 @@ function createGeometryUpdaterGroundGeometrySpecs( graphics.heightReference = new ConstantProperty(HeightReference.NONE); graphics.extrudedHeightReference = new ConstantProperty( - HeightReference.CLAMP_TO_GROUND + HeightReference.CLAMP_TO_GROUND, ); updater._onEntityPropertyChanged(entity, geometryPropertyName); instance = updater.createFillGeometryInstance(time); @@ -167,112 +167,112 @@ function createGeometryUpdaterGroundGeometrySpecs( graphics.heightReference = new ConstantProperty(HeightReference.NONE); graphics.extrudedHeightReference = new ConstantProperty( - HeightReference.RELATIVE_TO_GROUND + HeightReference.RELATIVE_TO_GROUND, ); updater._onEntityPropertyChanged(entity, geometryPropertyName); instance = updater.createFillGeometryInstance(time); expect(instance.geometry._offsetAttribute).toEqual( - GeometryOffsetAttribute.TOP + GeometryOffsetAttribute.TOP, ); instance = updater.createOutlineGeometryInstance(time); expect(instance.geometry._offsetAttribute).toEqual( - GeometryOffsetAttribute.TOP + GeometryOffsetAttribute.TOP, ); graphics.heightReference = new ConstantProperty( - HeightReference.CLAMP_TO_GROUND + HeightReference.CLAMP_TO_GROUND, ); graphics.extrudedHeightReference = new ConstantProperty( - HeightReference.NONE + HeightReference.NONE, ); updater._onEntityPropertyChanged(entity, geometryPropertyName); instance = updater.createFillGeometryInstance(time); expect(instance.geometry._offsetAttribute).toEqual( - GeometryOffsetAttribute.TOP + GeometryOffsetAttribute.TOP, ); instance = updater.createOutlineGeometryInstance(time); expect(instance.geometry._offsetAttribute).toEqual( - GeometryOffsetAttribute.TOP + GeometryOffsetAttribute.TOP, ); graphics.heightReference = new ConstantProperty( - HeightReference.CLAMP_TO_GROUND + HeightReference.CLAMP_TO_GROUND, ); graphics.extrudedHeightReference = new ConstantProperty( - HeightReference.CLAMP_TO_GROUND + HeightReference.CLAMP_TO_GROUND, ); updater._onEntityPropertyChanged(entity, geometryPropertyName); instance = updater.createFillGeometryInstance(time); expect(instance.geometry._offsetAttribute).toEqual( - GeometryOffsetAttribute.TOP + GeometryOffsetAttribute.TOP, ); instance = updater.createOutlineGeometryInstance(time); expect(instance.geometry._offsetAttribute).toEqual( - GeometryOffsetAttribute.TOP + GeometryOffsetAttribute.TOP, ); graphics.heightReference = new ConstantProperty( - HeightReference.CLAMP_TO_GROUND + HeightReference.CLAMP_TO_GROUND, ); graphics.extrudedHeightReference = new ConstantProperty( - HeightReference.RELATIVE_TO_GROUND + HeightReference.RELATIVE_TO_GROUND, ); updater._onEntityPropertyChanged(entity, geometryPropertyName); instance = updater.createFillGeometryInstance(time); expect(instance.geometry._offsetAttribute).toEqual( - GeometryOffsetAttribute.ALL + GeometryOffsetAttribute.ALL, ); instance = updater.createOutlineGeometryInstance(time); expect(instance.geometry._offsetAttribute).toEqual( - GeometryOffsetAttribute.ALL + GeometryOffsetAttribute.ALL, ); graphics.heightReference = new ConstantProperty( - HeightReference.RELATIVE_TO_GROUND + HeightReference.RELATIVE_TO_GROUND, ); graphics.extrudedHeightReference = new ConstantProperty( - HeightReference.NONE + HeightReference.NONE, ); updater._onEntityPropertyChanged(entity, geometryPropertyName); instance = updater.createFillGeometryInstance(time); expect(instance.geometry._offsetAttribute).toEqual( - GeometryOffsetAttribute.TOP + GeometryOffsetAttribute.TOP, ); instance = updater.createOutlineGeometryInstance(time); expect(instance.geometry._offsetAttribute).toEqual( - GeometryOffsetAttribute.TOP + GeometryOffsetAttribute.TOP, ); graphics.heightReference = new ConstantProperty( - HeightReference.RELATIVE_TO_GROUND + HeightReference.RELATIVE_TO_GROUND, ); graphics.extrudedHeightReference = new ConstantProperty( - HeightReference.CLAMP_TO_GROUND + HeightReference.CLAMP_TO_GROUND, ); updater._onEntityPropertyChanged(entity, geometryPropertyName); instance = updater.createFillGeometryInstance(time); expect(instance.geometry._offsetAttribute).toEqual( - GeometryOffsetAttribute.TOP + GeometryOffsetAttribute.TOP, ); instance = updater.createOutlineGeometryInstance(time); expect(instance.geometry._offsetAttribute).toEqual( - GeometryOffsetAttribute.TOP + GeometryOffsetAttribute.TOP, ); graphics.heightReference = new ConstantProperty( - HeightReference.RELATIVE_TO_GROUND + HeightReference.RELATIVE_TO_GROUND, ); graphics.extrudedHeightReference = new ConstantProperty( - HeightReference.RELATIVE_TO_GROUND + HeightReference.RELATIVE_TO_GROUND, ); updater._onEntityPropertyChanged(entity, geometryPropertyName); instance = updater.createFillGeometryInstance(time); expect(instance.geometry._offsetAttribute).toEqual( - GeometryOffsetAttribute.ALL + GeometryOffsetAttribute.ALL, ); instance = updater.createOutlineGeometryInstance(time); expect(instance.geometry._offsetAttribute).toEqual( - GeometryOffsetAttribute.ALL + GeometryOffsetAttribute.ALL, ); graphics.height = undefined; @@ -303,7 +303,7 @@ function createGeometryUpdaterGroundGeometrySpecs( const groundPrimitives = new PrimitiveCollection(); const dynamicUpdater = updater.createDynamicUpdater( primitives, - groundPrimitives + groundPrimitives, ); expect(dynamicUpdater.isDestroyed()).toBe(false); expect(primitives.length).toBe(0); @@ -332,14 +332,14 @@ function createGeometryUpdaterGroundGeometrySpecs( const groundPrimitives = new PrimitiveCollection(); const dynamicUpdater = updater.createDynamicUpdater( primitives, - groundPrimitives + groundPrimitives, ); dynamicUpdater.update(time); if (GroundPrimitive.isSupported(getScene())) { expect(groundPrimitives.get(0).classificationType).toEqual( - ClassificationType.BOTH + ClassificationType.BOTH, ); } diff --git a/Specs/createGeometryUpdaterSpecs.js b/Specs/createGeometryUpdaterSpecs.js index bfd85501ee98..52fe5cb28f2c 100644 --- a/Specs/createGeometryUpdaterSpecs.js +++ b/Specs/createGeometryUpdaterSpecs.js @@ -20,7 +20,7 @@ function createGeometryUpdaterSpecs( Updater, geometryPropertyName, createEntity, - getScene + getScene, ) { const time = JulianDate.now(); @@ -40,7 +40,7 @@ function createGeometryUpdaterSpecs( expect(updater.outlineWidth).toBe(1.0); expect(updater.shadowsProperty.getValue()).toBe(ShadowMode.DISABLED); expect(updater.distanceDisplayConditionProperty.getValue()).toEqual( - new DistanceDisplayCondition() + new DistanceDisplayCondition(), ); expect(updater.isDynamic).toBe(false); expect(updater.onTerrain).toBe(false); @@ -77,7 +77,7 @@ function createGeometryUpdaterSpecs( expect(updater.isClosed).toBe(updater._getIsClosed(updater._options)); expect(updater.fillEnabled).toBe(true); expect(updater.fillMaterialProperty).toEqual( - new ColorMaterialProperty(Color.WHITE) + new ColorMaterialProperty(Color.WHITE), ); expect(updater.outlineEnabled).toBe(false); expect(updater.hasConstantFill).toBe(true); @@ -85,10 +85,10 @@ function createGeometryUpdaterSpecs( expect(updater.outlineColorProperty).toBe(undefined); expect(updater.outlineWidth).toBe(1.0); expect(updater.shadowsProperty).toEqual( - new ConstantProperty(ShadowMode.DISABLED) + new ConstantProperty(ShadowMode.DISABLED), ); expect(updater.distanceDisplayConditionProperty).toEqual( - new ConstantProperty(new DistanceDisplayCondition()) + new ConstantProperty(new DistanceDisplayCondition()), ); expect(updater.isDynamic).toBe(false); }); @@ -96,12 +96,12 @@ function createGeometryUpdaterSpecs( it("material is correctly exposed.", function () { const entity = createEntity(); entity[geometryPropertyName].material = new GridMaterialProperty( - Color.BLUE + Color.BLUE, ); const updater = new Updater(entity, getScene()); expect(updater.fillMaterialProperty).toBe( - entity[geometryPropertyName].material + entity[geometryPropertyName].material, ); }); @@ -133,7 +133,7 @@ function createGeometryUpdaterSpecs( start: time1, stop: time2, data: false, - }) + }), ); fill.intervals.addInterval( new TimeInterval({ @@ -141,7 +141,7 @@ function createGeometryUpdaterSpecs( stop: time3, isStartIncluded: false, data: true, - }) + }), ); const colorMaterial = new ColorMaterialProperty(); @@ -156,7 +156,7 @@ function createGeometryUpdaterSpecs( start: time1, stop: time2, data: false, - }) + }), ); outline.intervals.addInterval( new TimeInterval({ @@ -164,7 +164,7 @@ function createGeometryUpdaterSpecs( stop: time3, isStartIncluded: false, data: true, - }) + }), ); const outlineColor = new SampledProperty(Color); @@ -184,20 +184,20 @@ function createGeometryUpdaterSpecs( let attributes = instance.attributes; expect(attributes.color.value).toEqual( ColorGeometryInstanceAttribute.toValue( - colorMaterial.color.getValue(time2) - ) + colorMaterial.color.getValue(time2), + ), ); expect(attributes.show.value).toEqual( - ShowGeometryInstanceAttribute.toValue(fill.getValue(time2)) + ShowGeometryInstanceAttribute.toValue(fill.getValue(time2)), ); instance = updater.createOutlineGeometryInstance(time2); attributes = instance.attributes; expect(attributes.color.value).toEqual( - ColorGeometryInstanceAttribute.toValue(outlineColor.getValue(time2)) + ColorGeometryInstanceAttribute.toValue(outlineColor.getValue(time2)), ); expect(attributes.show.value).toEqual( - ShowGeometryInstanceAttribute.toValue(outline.getValue(time2)) + ShowGeometryInstanceAttribute.toValue(outline.getValue(time2)), ); }); @@ -209,7 +209,7 @@ function createGeometryUpdaterSpecs( const instance = updater.createFillGeometryInstance(new JulianDate()); const attributes = instance.attributes; expect(attributes.show.value).toEqual( - ShowGeometryInstanceAttribute.toValue(false) + ShowGeometryInstanceAttribute.toValue(false), ); }); @@ -221,7 +221,7 @@ function createGeometryUpdaterSpecs( const instance = updater.createFillGeometryInstance(new JulianDate()); const attributes = instance.attributes; expect(attributes.show.value).toEqual( - ShowGeometryInstanceAttribute.toValue(false) + ShowGeometryInstanceAttribute.toValue(false), ); }); @@ -288,36 +288,36 @@ function createGeometryUpdaterSpecs( if (options.material instanceof ColorMaterialProperty) { expect(attributes.color.value).toEqual( ColorGeometryInstanceAttribute.toValue( - options.material.color.getValue(time) - ) + options.material.color.getValue(time), + ), ); } else { expect(attributes.color).toBeUndefined(); } expect(attributes.show.value).toEqual( - ShowGeometryInstanceAttribute.toValue(true) + ShowGeometryInstanceAttribute.toValue(true), ); if (options.distanceDisplayCondition) { expect(attributes.distanceDisplayCondition.value).toEqual( DistanceDisplayConditionGeometryInstanceAttribute.toValue( - options.distanceDisplayCondition - ) + options.distanceDisplayCondition, + ), ); } instance = updater.createOutlineGeometryInstance(time); attributes = instance.attributes; expect(attributes.color.value).toEqual( - ColorGeometryInstanceAttribute.toValue(options.outlineColor) + ColorGeometryInstanceAttribute.toValue(options.outlineColor), ); expect(attributes.show.value).toEqual( - ShowGeometryInstanceAttribute.toValue(true) + ShowGeometryInstanceAttribute.toValue(true), ); if (options.distanceDisplayCondition) { expect(attributes.distanceDisplayCondition.value).toEqual( DistanceDisplayConditionGeometryInstanceAttribute.toValue( - options.distanceDisplayCondition - ) + options.distanceDisplayCondition, + ), ); } } @@ -355,7 +355,7 @@ function createGeometryUpdaterSpecs( start: time1, stop: time2, data: false, - }) + }), ); fill.intervals.addInterval( new TimeInterval({ @@ -363,7 +363,7 @@ function createGeometryUpdaterSpecs( stop: time3, isStartIncluded: false, data: true, - }) + }), ); const colorMaterial = new ColorMaterialProperty(); @@ -378,7 +378,7 @@ function createGeometryUpdaterSpecs( start: time1, stop: time2, data: false, - }) + }), ); outline.intervals.addInterval( new TimeInterval({ @@ -386,7 +386,7 @@ function createGeometryUpdaterSpecs( stop: time3, isStartIncluded: false, data: true, - }) + }), ); const outlineColor = new SampledProperty(Color); @@ -407,20 +407,20 @@ function createGeometryUpdaterSpecs( let attributes = instance.attributes; expect(attributes.color.value).toEqual( ColorGeometryInstanceAttribute.toValue( - colorMaterial.color.getValue(time2) - ) + colorMaterial.color.getValue(time2), + ), ); expect(attributes.show.value).toEqual( - ShowGeometryInstanceAttribute.toValue(fill.getValue(time2)) + ShowGeometryInstanceAttribute.toValue(fill.getValue(time2)), ); instance = updater.createOutlineGeometryInstance(time2); attributes = instance.attributes; expect(attributes.color.value).toEqual( - ColorGeometryInstanceAttribute.toValue(outlineColor.getValue(time2)) + ColorGeometryInstanceAttribute.toValue(outlineColor.getValue(time2)), ); expect(attributes.show.value).toEqual( - ShowGeometryInstanceAttribute.toValue(outline.getValue(time2)) + ShowGeometryInstanceAttribute.toValue(outline.getValue(time2)), ); }); @@ -439,7 +439,7 @@ function createGeometryUpdaterSpecs( start: time1, stop: time2, data: Color.BLUE, - }) + }), ); color.intervals.addInterval( new TimeInterval({ @@ -447,7 +447,7 @@ function createGeometryUpdaterSpecs( stop: time4, isStartIncluded: false, data: Color.YELLOW, - }) + }), ); colorMaterial.color = color; @@ -457,7 +457,7 @@ function createGeometryUpdaterSpecs( start: time1, stop: time2, data: Color.RED, - }) + }), ); outlineColor.intervals.addInterval( new TimeInterval({ @@ -465,7 +465,7 @@ function createGeometryUpdaterSpecs( stop: time4, isStartIncluded: false, data: Color.GREEN, - }) + }), ); const entity = createEntity(); @@ -480,13 +480,13 @@ function createGeometryUpdaterSpecs( let instance = updater.createFillGeometryInstance(missingTime); let attributes = instance.attributes; expect(attributes.color.value).toEqual( - ColorGeometryInstanceAttribute.toValue(Color.WHITE) + ColorGeometryInstanceAttribute.toValue(Color.WHITE), ); instance = updater.createOutlineGeometryInstance(missingTime); attributes = instance.attributes; expect(attributes.color.value).toEqual( - ColorGeometryInstanceAttribute.toValue(Color.BLACK) + ColorGeometryInstanceAttribute.toValue(Color.BLACK), ); }); } diff --git a/Specs/createPackableArraySpecs.js b/Specs/createPackableArraySpecs.js index 8d77067e94c2..4d5fc9f41696 100644 --- a/Specs/createPackableArraySpecs.js +++ b/Specs/createPackableArraySpecs.js @@ -5,7 +5,7 @@ function createPackableArraySpecs( unpackedArray, packedArray, stride, - namePrefix + namePrefix, ) { namePrefix = defaultValue(namePrefix, ""); diff --git a/Specs/createPackableSpecs.js b/Specs/createPackableSpecs.js index bd1ee9e98a14..b2678604b830 100644 --- a/Specs/createPackableSpecs.js +++ b/Specs/createPackableSpecs.js @@ -65,13 +65,13 @@ function createPackableSpecs(packable, instance, packedInstance, namePrefix) { packedInstance, 0, 0, - packedForInterpolation + packedForInterpolation, ); const value = packable.unpackInterpolationResult( packedForInterpolation, packedInstance, 0, - 0 + 0, ); const result = packable.unpack(packedInstance); expect(value).toEqual(result); diff --git a/Specs/createScene.js b/Specs/createScene.js index 619ec4c6f4a8..a2cee81a68b5 100644 --- a/Specs/createScene.js +++ b/Specs/createScene.js @@ -18,7 +18,7 @@ function createScene(options) { const debugWidth = window.debugCanvasWidth; const debugHeight = defaultValue( window.debugCanvasHeight, - window.debugCanvasWidth + window.debugCanvasWidth, ); // save the canvas so we don't try to clone an HTMLCanvasElement @@ -36,11 +36,11 @@ function createScene(options) { contextOptions.webgl = defaultValue(contextOptions.webgl, {}); contextOptions.webgl.antialias = defaultValue( contextOptions.webgl.antialias, - false + false, ); contextOptions.webgl.stencil = defaultValue( contextOptions.webgl.stencil, - true + true, ); if (!!window.webglStub) { contextOptions.getWebGLStub = getWebGLStub; diff --git a/Specs/customizeJasmine.js b/Specs/customizeJasmine.js index c85af29111e9..96a2834e80ce 100644 --- a/Specs/customizeJasmine.js +++ b/Specs/customizeJasmine.js @@ -9,7 +9,7 @@ function customizeJasmine( webglStub, release, debugCanvasWidth, - debugCanvasHeight + debugCanvasHeight, ) { // set this for uniform test resolution across devices window.devicePixelRatio = 1; diff --git a/Specs/e2e/cesium.html b/Specs/e2e/cesium.html index 1a9da835b430..c2b4766c600b 100644 --- a/Specs/e2e/cesium.html +++ b/Specs/e2e/cesium.html @@ -1,4 +1,4 @@ - + diff --git a/Specs/e2e/models.spec.js b/Specs/e2e/models.spec.js index 885cd8795ae0..3468bd8963f1 100644 --- a/Specs/e2e/models.spec.js +++ b/Specs/e2e/models.spec.js @@ -11,7 +11,7 @@ test("loads animated model", async ({ cesiumPage }) => { const position = Cesium.Cartesian3.fromDegrees( -123.0744619, 44.0503706, - 150.0 + 150.0, ); const heading = Cesium.Math.toRadians(135); const pitch = 0; @@ -19,7 +19,7 @@ test("loads animated model", async ({ cesiumPage }) => { const hpr = new Cesium.HeadingPitchRoll(heading, pitch, roll); const orientation = Cesium.Transforms.headingPitchRollQuaternion( position, - hpr + hpr, ); const entity = viewer.entities.add({ @@ -50,7 +50,7 @@ test("loads draco model", async ({ cesiumPage }) => { const position = Cesium.Cartesian3.fromDegrees( -123.0744619, 44.0503706, - 0.0 + 0.0, ); const heading = Cesium.Math.toRadians(135); const pitch = 0; @@ -58,15 +58,14 @@ test("loads draco model", async ({ cesiumPage }) => { const hpr = new Cesium.HeadingPitchRoll(heading, pitch, roll); const orientation = Cesium.Transforms.headingPitchRollQuaternion( position, - hpr + hpr, ); const entity = viewer.entities.add({ position: position, orientation: orientation, model: { - uri: - "../../Apps/SampleData/models/DracoCompressed/CesiumMilkTruck.gltf", + uri: "../../Apps/SampleData/models/DracoCompressed/CesiumMilkTruck.gltf", minimumPixelSize: 128, maximumScale: 20000, }, @@ -88,7 +87,7 @@ test("loads model with KTX2 textures", async ({ cesiumPage }) => { const position = Cesium.Cartesian3.fromDegrees( -123.0744619, 44.0503706, - 1000.0 + 1000.0, ); const heading = Cesium.Math.toRadians(135); const pitch = 0; @@ -96,15 +95,14 @@ test("loads model with KTX2 textures", async ({ cesiumPage }) => { const hpr = new Cesium.HeadingPitchRoll(heading, pitch, roll); const orientation = Cesium.Transforms.headingPitchRollQuaternion( position, - hpr + hpr, ); const entity = viewer.entities.add({ position: position, orientation: orientation, model: { - uri: - "../../Apps/SampleData/models/CesiumBalloonKTX2/CesiumBalloonKTX2.glb", + uri: "../../Apps/SampleData/models/CesiumBalloonKTX2/CesiumBalloonKTX2.glb", minimumPixelSize: 128, maximumScale: 20000, }, diff --git a/Specs/e2e/picking.spec.js b/Specs/e2e/picking.spec.js index 169c16c21fb6..d51631436d59 100644 --- a/Specs/e2e/picking.spec.js +++ b/Specs/e2e/picking.spec.js @@ -26,15 +26,15 @@ test("Shows cartographic position on mouse over", async ({ cesiumPage }) => { handler.setInputAction(function (movement) { const cartesian = viewer.camera.pickEllipsoid( movement.endPosition, - scene.globe.ellipsoid + scene.globe.ellipsoid, ); if (cartesian) { const cartographic = Cesium.Cartographic.fromCartesian(cartesian); const longitudeString = Cesium.Math.toDegrees( - cartographic.longitude + cartographic.longitude, ).toFixed(2); const latitudeString = Cesium.Math.toDegrees( - cartographic.latitude + cartographic.latitude, ).toFixed(2); entity.position = cartesian; diff --git a/Specs/getWebGLStub.js b/Specs/getWebGLStub.js index 6d355a5c229c..6a7e8d4d8a3e 100644 --- a/Specs/getWebGLStub.js +++ b/Specs/getWebGLStub.js @@ -173,7 +173,7 @@ function getStub() { function getStubWarning() { //>>includeStart('debug', pragmas.debug); throw new DeveloperError( - "A stub for this get/is function is not defined. Can it use getStub() or does it need a new one?" + "A stub for this get/is function is not defined. Can it use getStub() or does it need a new one?", ); //>>includeEnd('debug'); } @@ -193,7 +193,7 @@ function getContextAttributesStub(options) { powerPreference: defaultValue(options.powerPreference, false), failIfMajorPerformanceCaveat: defaultValue( options.failIfMajorPerformanceCaveat, - false + false, ), }; @@ -249,7 +249,7 @@ function getParameterStub(options) { //>>includeStart('debug', pragmas.debug); if (!defined(value)) { throw new DeveloperError( - `A WebGL parameter stub for ${pname} is not defined. Add it.` + `A WebGL parameter stub for ${pname} is not defined. Add it.`, ); } //>>includeEnd('debug'); @@ -275,7 +275,7 @@ function getProgramParameterStub(program, pname) { //>>includeStart('debug', pragmas.debug); throw new DeveloperError( - `A WebGL parameter stub for ${pname} is not defined. Add it.` + `A WebGL parameter stub for ${pname} is not defined. Add it.`, ); //>>includeEnd('debug'); } @@ -284,7 +284,7 @@ function getShaderParameterStub(shader, pname) { //>>includeStart('debug', pragmas.debug); if (pname !== WebGLConstants.COMPILE_STATUS) { throw new DeveloperError( - `A WebGL parameter stub for ${pname} is not defined. Add it.` + `A WebGL parameter stub for ${pname} is not defined. Add it.`, ); } //>>includeEnd('debug'); @@ -296,7 +296,7 @@ function getShaderPrecisionStub(shadertype, precisiontype) { //>>includeStart('debug', pragmas.debug); if (shadertype !== WebGLConstants.FRAGMENT_SHADER) { throw new DeveloperError( - "getShaderPrecision only has a stub for FRAGMENT_SHADER. Update it." + "getShaderPrecision only has a stub for FRAGMENT_SHADER. Update it.", ); } @@ -305,7 +305,7 @@ function getShaderPrecisionStub(shadertype, precisiontype) { precisiontype !== WebGLConstants.HIGH_INT ) { throw new DeveloperError( - "getShaderPrecision only has a stub for HIGH_FLOAT and HIGH_INT. Update it." + "getShaderPrecision only has a stub for HIGH_FLOAT and HIGH_INT. Update it.", ); } //>>includeEnd('debug'); diff --git a/Specs/karma-main.js b/Specs/karma-main.js index e0f9aac10319..70163a76c391 100644 --- a/Specs/karma-main.js +++ b/Specs/karma-main.js @@ -34,5 +34,5 @@ customizeJasmine( webglStub, release, debugCanvasWidth, - debugCanvasHeight + debugCanvasHeight, ); diff --git a/Specs/pick.js b/Specs/pick.js index 0745c53a34f9..ca5e29874caa 100644 --- a/Specs/pick.js +++ b/Specs/pick.js @@ -31,9 +31,9 @@ function pick(frameState, primitives, x, y) { new CreditDisplay( document.createElement("div"), undefined, - document.createElement("div") + document.createElement("div"), ), - new JobScheduler() + new JobScheduler(), ).passes; frameState.passes.pick = true; diff --git a/Specs/pollToPromise.js b/Specs/pollToPromise.js index 0e6c3eead363..37feaf8375ad 100644 --- a/Specs/pollToPromise.js +++ b/Specs/pollToPromise.js @@ -23,7 +23,7 @@ function pollToPromise(f, options) { resolve(); } else if (getTimestamp() > endTimestamp) { reject( - new Error(`Timeout - function did not complete within ${timeout}ms`) + new Error(`Timeout - function did not complete within ${timeout}ms`), ); } else { setTimeout(poller, pollInterval); diff --git a/Specs/spec-main.js b/Specs/spec-main.js index 45ba3a2e4af5..b08c0ce1dad9 100644 --- a/Specs/spec-main.js +++ b/Specs/spec-main.js @@ -67,5 +67,5 @@ customizeJasmine( webglStub, release, debugCanvasWidth, - debugCanvasHeight + debugCanvasHeight, ); diff --git a/Specs/testDefinitionChanged.js b/Specs/testDefinitionChanged.js index 37d696d730fc..a29e68154f61 100644 --- a/Specs/testDefinitionChanged.js +++ b/Specs/testDefinitionChanged.js @@ -10,7 +10,7 @@ function testDefinitionChanged(property, name, value1, value2) { property, name, property[name], - oldValue + oldValue, ); listener.calls.reset(); @@ -19,7 +19,7 @@ function testDefinitionChanged(property, name, value1, value2) { property, name, property[name], - property[name] + property[name], ); listener.calls.reset(); diff --git a/Specs/testMaterialDefinitionChanged.js b/Specs/testMaterialDefinitionChanged.js index c9d4219ba917..479d2ab6acbc 100644 --- a/Specs/testMaterialDefinitionChanged.js +++ b/Specs/testMaterialDefinitionChanged.js @@ -10,7 +10,7 @@ function testMaterialDefinitionChanged(property, name, value1, value2) { property, name, property[name], - oldValue + oldValue, ); listener.calls.reset(); @@ -19,7 +19,7 @@ function testMaterialDefinitionChanged(property, name, value1, value2) { property, name, property[name], - property[name] + property[name], ); listener.calls.reset(); diff --git a/Tools/jsdoc/cesium_template/publish.js b/Tools/jsdoc/cesium_template/publish.js index 101e1d3bf314..403da932e31f 100644 --- a/Tools/jsdoc/cesium_template/publish.js +++ b/Tools/jsdoc/cesium_template/publish.js @@ -304,7 +304,7 @@ exports.publish = function (taffyData, opts, tutorials) { if ( example.match( - /^\s*
([\s\S]+?)<\/caption>(\s*[\n\r])([\s\S]+)$/i + /^\s*([\s\S]+?)<\/caption>(\s*[\n\r])([\s\S]+)$/i, ) ) { caption = RegExp.$1; @@ -373,7 +373,7 @@ exports.publish = function (taffyData, opts, tutorials) { .replace("{filename}", docletPath); if (process.env.CESIUM_PACKAGES) { doclet.meta.package = process.env.CESIUM_PACKAGES.split(",").find( - (package) => doclet.meta.sourceUrl.indexOf(package) > -1 + (package) => doclet.meta.sourceUrl.indexOf(package) > -1, ); } } @@ -425,7 +425,7 @@ exports.publish = function (taffyData, opts, tutorials) { view.nav = buildNav(members); attachModuleSymbols( find({ kind: ["class", "function"], longname: { left: "module:" } }), - members.modules + members.modules, ); if (members.globals.length) { @@ -449,7 +449,7 @@ exports.publish = function (taffyData, opts, tutorials) { }, ]) .concat(files), - indexUrl + indexUrl, ); view.layout = origLayout; diff --git a/Tools/jsdoc/cesium_template/static/javascript/cesiumDoc.js b/Tools/jsdoc/cesium_template/static/javascript/cesiumDoc.js index ecff98ccacbf..d1f22148f43d 100644 --- a/Tools/jsdoc/cesium_template/static/javascript/cesiumDoc.js +++ b/Tools/jsdoc/cesium_template/static/javascript/cesiumDoc.js @@ -22,7 +22,7 @@ function getQueryParameter(name) { var match = new RegExp("[?&]" + name + "=([^&]*)").exec( - window.location.search + window.location.search, ); return match && decodeURIComponent(match[1].replace(/\+/g, " ")); } diff --git a/Tools/jsdoc/cesium_template/static/javascript/html5.js b/Tools/jsdoc/cesium_template/static/javascript/html5.js index 76d07505ed90..922207c35835 100644 --- a/Tools/jsdoc/cesium_template/static/javascript/html5.js +++ b/Tools/jsdoc/cesium_template/static/javascript/html5.js @@ -18,8 +18,8 @@ b = c.cache[a] ? c.cache[a].cloneNode() : r.test(a) - ? (c.cache[a] = c.createElem(a)).cloneNode() - : c.createElem(a); + ? (c.cache[a] = c.createElem(a)).cloneNode() + : c.createElem(a); return b.canHaveChildren && !s.test(a) ? c.frag.appendChild(b) : b; } function t(a, b) { @@ -41,7 +41,7 @@ b.frag.createElement(a); return 'c("' + a + '")'; }) + - ");return n}" + ");return n}", )(e, b.frag); } function q(a) { @@ -62,7 +62,8 @@ } var k = l.html5 || {}, s = /^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i, - r = /^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i, + r = + /^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i, j, o = "_html5shiv", h = 0, diff --git a/Tools/jsdoc/cesium_template/static/styles/jsdoc-default.css b/Tools/jsdoc/cesium_template/static/styles/jsdoc-default.css index 37265871bd53..d96290826e09 100644 --- a/Tools/jsdoc/cesium_template/static/styles/jsdoc-default.css +++ b/Tools/jsdoc/cesium_template/static/styles/jsdoc-default.css @@ -2,7 +2,9 @@ font-family: "Source Sans Pro"; font-style: normal; font-weight: 400; - src: local("Source Sans Pro"), local("SourceSansPro-Regular"), + src: + local("Source Sans Pro"), + local("SourceSansPro-Regular"), url(../fonts/SourceSansPro.woff) format("woff"); } diff --git a/gulpfile.js b/gulpfile.js index 1d311bc9e254..a8283e79b7fe 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -198,7 +198,7 @@ export const buildWatch = gulp.series(build, async function buildWatch() { removePragmas: removePragmas, sourcemap: sourcemap, }); - } + }, ); gulp.watch( @@ -209,7 +209,7 @@ export const buildWatch = gulp.series(build, async function buildWatch() { async () => { createCombinedSpecList(); await specs.rebuild(); - } + }, ); gulp.watch( @@ -219,7 +219,7 @@ export const buildWatch = gulp.series(build, async function buildWatch() { }, async () => { await specs.rebuild(); - } + }, ); process.on("SIGINT", () => { @@ -264,7 +264,7 @@ export async function buildTs() { directory === "engine" ? processEngineSource : undefined, // Handle engine's module naming exceptions directory === "engine" ? processEngineModules : undefined, - importModules + importModules, ); importModules[directory] = workspaceModules; } @@ -346,31 +346,31 @@ export async function prepare() { // Copy Draco3D files from node_modules into Source copyFileSync( "node_modules/draco3d/draco_decoder.wasm", - "packages/engine/Source/ThirdParty/draco_decoder.wasm" + "packages/engine/Source/ThirdParty/draco_decoder.wasm", ); // Copy pako and zip.js worker files to Source/ThirdParty copyFileSync( "node_modules/pako/dist/pako_inflate.min.js", - "packages/engine/Source/ThirdParty/Workers/pako_inflate.min.js" + "packages/engine/Source/ThirdParty/Workers/pako_inflate.min.js", ); copyFileSync( "node_modules/pako/dist/pako_deflate.min.js", - "packages/engine/Source/ThirdParty/Workers/pako_deflate.min.js" + "packages/engine/Source/ThirdParty/Workers/pako_deflate.min.js", ); copyFileSync( "node_modules/@zip.js/zip.js/dist/z-worker-pako.js", - "packages/engine/Source/ThirdParty/Workers/z-worker-pako.js" + "packages/engine/Source/ThirdParty/Workers/z-worker-pako.js", ); // Copy prism.js and prism.css files into Tools copyFileSync( "node_modules/prismjs/prism.js", - "Tools/jsdoc/cesium_template/static/javascript/prism.js" + "Tools/jsdoc/cesium_template/static/javascript/prism.js", ); copyFileSync( "node_modules/prismjs/themes/prism.min.css", - "Tools/jsdoc/cesium_template/static/styles/prism.css" + "Tools/jsdoc/cesium_template/static/styles/prism.css", ); // Copy jasmine runner files into Specs @@ -398,7 +398,7 @@ export async function buildDocs() { CESIUM_VERSION: version, CESIUM_PACKAGES: packageJson.workspaces, }), - } + }, ); const stream = gulp @@ -438,7 +438,7 @@ export const websiteRelease = gulp.series( }); }, combineForSandcastle, - buildDocs + buildDocs, ); export const buildRelease = gulp.series( @@ -462,12 +462,12 @@ export const buildRelease = gulp.series( node: true, sourcemap: false, }); - } + }, ); export const release = gulp.series( buildRelease, - gulp.parallel(buildTs, buildDocs) + gulp.parallel(buildTs, buildDocs), ); export const postversion = async function () { @@ -494,7 +494,7 @@ export const postversion = async function () { const packageJson = require(packageJsonPath); if (!Object.hasOwn(packageJson.dependencies, workspace)) { console.log( - `Skipping update for ${workspace} as it is not a dependency.` + `Skipping update for ${workspace} as it is not a dependency.`, ); return; } @@ -557,7 +557,7 @@ async function pruneScriptsForZip(packageJsonPath) { // Write to a temporary package.json file. const noPreparePackageJson = join( dirname(packageJsonPath), - "package.noprepare.json" + "package.noprepare.json", ); await writeFile(noPreparePackageJson, JSON.stringify(contentsJson, null, 2)); @@ -573,10 +573,10 @@ export const makeZip = gulp.series(release, async function createZipFile() { const packageJsonSrc = await pruneScriptsForZip("package.json"); const enginePackageJsonSrc = await pruneScriptsForZip( - "packages/engine/package.json" + "packages/engine/package.json", ); const widgetsPackageJsonSrc = await pruneScriptsForZip( - "packages/widgets/package.json" + "packages/widgets/package.json", ); const src = gulp @@ -586,7 +586,7 @@ export const makeZip = gulp.series(release, async function createZipFile() { if (file.basename === "index.release") { file.basename = "index"; } - }) + }), ) .pipe(enginePackageJsonSrc) .pipe(widgetsPackageJsonSrc) @@ -596,7 +596,7 @@ export const makeZip = gulp.series(release, async function createZipFile() { if (file.basename === "package.noprepare") { file.basename = "package"; } - }) + }), ) .pipe( gulp.src( @@ -617,8 +617,8 @@ export const makeZip = gulp.series(release, async function createZipFile() { { encoding: false, base: ".", - } - ) + }, + ), ) .pipe( gulp.src( @@ -656,8 +656,8 @@ export const makeZip = gulp.series(release, async function createZipFile() { { encoding: false, base: ".", - } - ) + }, + ), ) .pipe( gulpTap(function (file) { @@ -667,7 +667,7 @@ export const makeZip = gulp.series(release, async function createZipFile() { if (file.isDirectory()) { file.stat.mode = parseInt("40777", 8); } - }) + }), ) .pipe(gulpZip(`Cesium-${version}.zip`)) .pipe(gulp.dest(".")); @@ -732,7 +732,7 @@ async function setStatus(state, targetUrl, description, context) { Authorization: `token ${process.env.GITHUB_TOKEN}`, "User-Agent": "Cesium", }, - } + }, ); const result = await response.json(); @@ -782,7 +782,7 @@ export async function runCoverage(options) { try { const generatedCode = instrumenter.instrumentSync( source, - args.path + args.path, ); return { contents: generatedCode }; @@ -793,7 +793,7 @@ export async function runCoverage(options) { }, }; } - } + }, ); }, }; @@ -913,7 +913,7 @@ export async function runCoverage(options) { ], }, }, - { promiseConfig: true, throwErrors: true } + { promiseConfig: true, throwErrors: true }, ); return new Promise((resolve, reject) => { @@ -921,7 +921,7 @@ export async function runCoverage(options) { let html = "
    "; folders.forEach(function (folder) { html += `
  • ${folder}
  • `; }); html += "
"; @@ -1112,7 +1112,7 @@ export async function test() { ], }, }, - { promiseConfig: true, throwErrors: true } + { promiseConfig: true, throwErrors: true }, ); return new Promise((resolve, reject) => { @@ -1144,7 +1144,7 @@ function generateTypeScriptDefinitions( configurationPath, processSourceFunc, processModulesFunc, - importModules + importModules, ) { // Run JSDoc with tsd-jsdoc to generate an initial definition file. execSync(`npx jsdoc --configure ${configurationPath}`, { @@ -1192,23 +1192,23 @@ function generateTypeScriptDefinitions( .replace( /= "WebGLConstants\.(.+)"/gm, // eslint-disable-next-line no-unused-vars - (match, p1) => `= WebGLConstants.${p1}` + (match, p1) => `= WebGLConstants.${p1}`, ) // Strip const enums which can cause errors - https://www.typescriptlang.org/docs/handbook/enums.html#const-enum-pitfalls .replace(/^(\s*)(export )?const enum (\S+) {(\s*)$/gm, "$1$2enum $3 {$4") // Replace JSDoc generation version of defined with an improved version using TS type predicates .replace( /defined\(value: any\): boolean/gm, - "defined(value: Type): value is NonNullable" + "defined(value: Type): value is NonNullable", ) .replace( /\/\*\*[\*\s\w]*?\*\/\nexport const Check: any;/m, - `\n${readFileSync("./packages/engine/Source/Core/Check.d.ts").toString()}` + `\n${readFileSync("./packages/engine/Source/Core/Check.d.ts").toString()}`, ) // Fix https://github.com/CesiumGS/cesium/issues/10498 so we can use the rest parameter expand tuple .replace( "raiseEvent(...arguments: Parameters[]): void;", - "raiseEvent(...arguments: Parameters): void;" + "raiseEvent(...arguments: Parameters): void;", ); // Wrap the source to actually be inside of a declared cesium module @@ -1222,10 +1222,10 @@ ${source} let imports = ""; Object.keys(importModules).forEach((workspace) => { const workspaceModules = Array.from(importModules[workspace]).filter( - (importModule) => source.indexOf(importModule) !== -1 + (importModule) => source.indexOf(importModule) !== -1, ); imports += `import { ${workspaceModules.join( - ",\n" + ",\n", )} } from "@${scope}/${workspace}";\n`; }); source = imports + source; @@ -1255,7 +1255,7 @@ function processEngineSource(definitionsPath, source) { const node = typeScript.createSourceFile( definitionsPath, source, - typeScript.ScriptTarget.Latest + typeScript.ScriptTarget.Latest, ); let firstNode; node.forEachChild((child) => { @@ -1276,7 +1276,7 @@ function processEngineSource(definitionsPath, source) { newSource += printer.printNode( typeScript.EmitHint.Unspecified, firstNode, - node + node, ); newSource += "\n\n"; node.forEachChild((child) => { @@ -1287,7 +1287,7 @@ function processEngineSource(definitionsPath, source) { newSource += printer.printNode( typeScript.EmitHint.Unspecified, child, - node + node, ); newSource += "\n\n"; } @@ -1325,7 +1325,7 @@ function createTypeScriptDefinitions() { const node = typeScript.createSourceFile( "Source/Cesium.d.ts", source, - typeScript.ScriptTarget.Latest + typeScript.ScriptTarget.Latest, ); let firstNode; node.forEachChild((child) => { @@ -1346,7 +1346,7 @@ function createTypeScriptDefinitions() { newSource += printer.printNode( typeScript.EmitHint.Unspecified, firstNode, - node + node, ); newSource += "\n\n"; node.forEachChild((child) => { @@ -1357,7 +1357,7 @@ function createTypeScriptDefinitions() { newSource += printer.printNode( typeScript.EmitHint.Unspecified, child, - node + node, ); newSource += "\n\n"; } @@ -1399,23 +1399,23 @@ function createTypeScriptDefinitions() { .replace( /= "WebGLConstants\.(.+)"/gm, // eslint-disable-next-line no-unused-vars - (match, p1) => `= WebGLConstants.${p1}` + (match, p1) => `= WebGLConstants.${p1}`, ) // Strip const enums which can cause errors - https://www.typescriptlang.org/docs/handbook/enums.html#const-enum-pitfalls .replace(/^(\s*)(export )?const enum (\S+) {(\s*)$/gm, "$1$2enum $3 {$4") // Replace JSDoc generation version of defined with an improved version using TS type predicates .replace( /defined\(value: any\): boolean/gm, - "defined(value: Type): value is NonNullable" + "defined(value: Type): value is NonNullable", ) .replace( /\/\*\*[\*\s\w]*?\*\/\nexport const Check: any;/m, - `\n${readFileSync("./packages/engine/Source/Core/Check.d.ts").toString()}` + `\n${readFileSync("./packages/engine/Source/Core/Check.d.ts").toString()}`, ) // Fix https://github.com/CesiumGS/cesium/issues/10498 to have rest parameter expand tuple .replace( "raiseEvent(...arguments: Parameters[]): void;", - "raiseEvent(...arguments: Parameters): void;" + "raiseEvent(...arguments: Parameters): void;", ); // Wrap the source to actually be inside of a declared cesium module @@ -1463,7 +1463,7 @@ async function getLicenseDataFromThirdPartyExtra(path, discoveredDependencies) { module.name, discoveredDependencies, module.license, - module.notes + module.notes, ); if (result) { @@ -1478,7 +1478,7 @@ async function getLicenseDataFromThirdPartyExtra(path, discoveredDependencies) { module.name, discoveredDependencies, module.license, - module.notes + module.notes, ); if (result) { @@ -1490,7 +1490,7 @@ async function getLicenseDataFromThirdPartyExtra(path, discoveredDependencies) { discoveredDependencies.push(module.name); return module; } - }) + }), ); } @@ -1507,7 +1507,7 @@ async function getLicenseDataFromPackage( packageName, discoveredDependencies, licenseOverride, - notes + notes, ) { if ( !packageJson.dependencies[packageName] && @@ -1532,7 +1532,7 @@ async function getLicenseDataFromPackage( if (!contents) { return Promise.reject( - new Error(`Unable to read ${packageName} license information`) + new Error(`Unable to read ${packageName} license information`), ); } @@ -1576,7 +1576,7 @@ export async function buildThirdParty() { // Generate ThirdParty.json from ThirdParty.extra.json and package.json const licenseInfo = await getLicenseDataFromThirdPartyExtra( "ThirdParty.extra.json", - discoveredDependencies + discoveredDependencies, ); licenseJson = licenseJson.concat(licenseInfo); @@ -1607,7 +1607,7 @@ async function buildSandcastle() { ], { encoding: false, - } + }, ); if (isProduction) { @@ -1617,15 +1617,15 @@ async function buildSandcastle() { gulpReplace( ' ', ' \n' + - ' ' - ) + ' ', + ), ) .pipe( gulpReplace( ' ', ' \n' + - ' ' - ) + ' ', + ), ) // Fix relative paths for new location .pipe(gulpReplace("../../../Build", "..")) @@ -1637,7 +1637,7 @@ async function buildSandcastle() { .pipe(gulpReplace("../Apps/Sandcastle", ".")) .pipe(gulpReplace("../../SampleData", "../SampleData")) .pipe( - gulpReplace("../../Build/Documentation", "/learn/cesiumjs/ref-doc/") + gulpReplace("../../Build/Documentation", "/learn/cesiumjs/ref-doc/"), ) .pipe(gulp.dest("Build/Sandcastle")); } else { @@ -1647,15 +1647,15 @@ async function buildSandcastle() { gulpReplace( ' ', ' \n' + - ' ' - ) + ' ', + ), ) .pipe( gulpReplace( ' ', ' \n' + - ' ' - ) + ' ', + ), ) // Fix relative paths for new location .pipe(gulpReplace("../../../Build", "../../..")) @@ -1672,7 +1672,7 @@ async function buildSandcastle() { { base: "Apps/Sandcastle", encoding: false, - } + }, ); if (isProduction) { imageStream = imageStream.pipe(gulp.dest("Build/Sandcastle")); @@ -1700,8 +1700,8 @@ async function buildSandcastle() { gulpReplace( ' ', ' \n' + - ' ' - ) + ' ', + ), ) .pipe(gulpReplace("../../Build", ".")) .pipe(gulp.dest("Build/Sandcastle")); @@ -1765,7 +1765,7 @@ async function buildCesiumViewer() { ], { encoding: false, - } + }, ) .pipe( gulp.src( @@ -1780,8 +1780,8 @@ async function buildCesiumViewer() { base: "Build/Cesium", nodir: true, encoding: false, - } - ) + }, + ), ) .pipe(gulp.src(["web.config"])) .pipe(gulp.dest(cesiumViewerOutputDirectory)); diff --git a/index.html b/index.html index 7ffefd7ff360..37c59ab3a7f4 100644 --- a/index.html +++ b/index.html @@ -1,4 +1,4 @@ - + Cesium diff --git a/index.release.html b/index.release.html index 249062aaaa91..0cf60e9f9de2 100644 --- a/index.release.html +++ b/index.release.html @@ -1,4 +1,4 @@ - + Cesium @@ -163,7 +163,7 @@

External links

document.body.innerHTML = ""; document.write("

This file must be hosted in a web server.
"); document.write( - 'Need help? Ask on our Community Forum.

' + 'Need help? Ask on our Community Forum.

', ); } diff --git a/packages/engine/Source/Core/ApproximateTerrainHeights.js b/packages/engine/Source/Core/ApproximateTerrainHeights.js index 35d982aa667d..c8dc1230cdc3 100644 --- a/packages/engine/Source/Core/ApproximateTerrainHeights.js +++ b/packages/engine/Source/Core/ApproximateTerrainHeights.js @@ -44,7 +44,7 @@ ApproximateTerrainHeights.initialize = function () { return initPromise; } initPromise = Resource.fetchJson( - buildModuleUrl("Assets/approximateTerrainHeights.json") + buildModuleUrl("Assets/approximateTerrainHeights.json"), ).then(function (json) { ApproximateTerrainHeights._terrainHeights = json; }); @@ -61,13 +61,13 @@ ApproximateTerrainHeights.initialize = function () { */ ApproximateTerrainHeights.getMinimumMaximumHeights = function ( rectangle, - ellipsoid + ellipsoid, ) { //>>includeStart('debug', pragmas.debug); Check.defined("rectangle", rectangle); if (!defined(ApproximateTerrainHeights._terrainHeights)) { throw new DeveloperError( - "You must call ApproximateTerrainHeights.initialize and wait for the promise to resolve before using this function" + "You must call ApproximateTerrainHeights.initialize and wait for the promise to resolve before using this function", ); } //>>includeEnd('debug'); @@ -89,26 +89,26 @@ ApproximateTerrainHeights.getMinimumMaximumHeights = function ( // Compute min by taking the center of the NE->SW diagonal and finding distance to the surface ellipsoid.cartographicToCartesian( Rectangle.northeast(rectangle, scratchDiagonalCartographic), - scratchDiagonalCartesianNE + scratchDiagonalCartesianNE, ); ellipsoid.cartographicToCartesian( Rectangle.southwest(rectangle, scratchDiagonalCartographic), - scratchDiagonalCartesianSW + scratchDiagonalCartesianSW, ); Cartesian3.midpoint( scratchDiagonalCartesianSW, scratchDiagonalCartesianNE, - scratchCenterCartesian + scratchCenterCartesian, ); const surfacePosition = ellipsoid.scaleToGeodeticSurface( scratchCenterCartesian, - scratchSurfaceCartesian + scratchSurfaceCartesian, ); if (defined(surfacePosition)) { const distance = Cartesian3.distance( scratchCenterCartesian, - surfacePosition + surfacePosition, ); minTerrainHeight = Math.min(minTerrainHeight, -distance); } else { @@ -118,7 +118,7 @@ ApproximateTerrainHeights.getMinimumMaximumHeights = function ( minTerrainHeight = Math.max( ApproximateTerrainHeights._defaultMinTerrainHeight, - minTerrainHeight + minTerrainHeight, ); return { @@ -138,7 +138,7 @@ ApproximateTerrainHeights.getBoundingSphere = function (rectangle, ellipsoid) { Check.defined("rectangle", rectangle); if (!defined(ApproximateTerrainHeights._terrainHeights)) { throw new DeveloperError( - "You must call ApproximateTerrainHeights.initialize and wait for the promise to resolve before using this function" + "You must call ApproximateTerrainHeights.initialize and wait for the promise to resolve before using this function", ); } //>>includeEnd('debug'); @@ -161,7 +161,7 @@ ApproximateTerrainHeights.getBoundingSphere = function (rectangle, ellipsoid) { rectangle, ellipsoid, maxTerrainHeight, - scratchBoundingSphere + scratchBoundingSphere, ); return BoundingSphere.union(result, scratchBoundingSphere, result); @@ -172,25 +172,25 @@ function getTileXYLevel(rectangle) { rectangle.east, rectangle.north, 0.0, - scratchCorners[0] + scratchCorners[0], ); Cartographic.fromRadians( rectangle.west, rectangle.north, 0.0, - scratchCorners[1] + scratchCorners[1], ); Cartographic.fromRadians( rectangle.east, rectangle.south, 0.0, - scratchCorners[2] + scratchCorners[2], ); Cartographic.fromRadians( rectangle.west, rectangle.south, 0.0, - scratchCorners[3] + scratchCorners[3], ); // Determine which tile the bounding rectangle is in diff --git a/packages/engine/Source/Core/ArcGISTiledElevationTerrainProvider.js b/packages/engine/Source/Core/ArcGISTiledElevationTerrainProvider.js index bc796406b8c0..41154ff6aa04 100644 --- a/packages/engine/Source/Core/ArcGISTiledElevationTerrainProvider.js +++ b/packages/engine/Source/Core/ArcGISTiledElevationTerrainProvider.js @@ -73,7 +73,8 @@ TerrainProviderBuilder.prototype.build = function (provider) { provider._hasAvailability = this.hasAvailability; provider._tilesAvailable = this.tilesAvailable; provider._tilesAvailabilityLoaded = this.tilesAvailabilityLoaded; - provider._levelZeroMaximumGeometricError = this.levelZeroMaximumGeometricError; + provider._levelZeroMaximumGeometricError = + this.levelZeroMaximumGeometricError; provider._terrainDataStructure = this.terrainDataStructure; }; @@ -94,10 +95,10 @@ function parseMetadataSuccess(terrainProviderBuilder, metadata) { extent.xmin, extent.ymin, extent.xmax, - extent.ymax + extent.ymax, ); terrainProviderBuilder.tilingScheme = new GeographicTilingScheme( - tilingSchemeOptions + tilingSchemeOptions, ); } else if (wkid === 3857) { // Clamp extent to EPSG 3857 bounds @@ -118,14 +119,14 @@ function parseMetadataSuccess(terrainProviderBuilder, metadata) { tilingSchemeOptions.rectangleSouthwestInMeters = new Cartesian2( extent.xmin, - extent.ymin + extent.ymin, ); tilingSchemeOptions.rectangleNortheastInMeters = new Cartesian2( extent.xmax, - extent.ymax + extent.ymax, ); terrainProviderBuilder.tilingScheme = new WebMercatorTilingScheme( - tilingSchemeOptions + tilingSchemeOptions, ); } else { throw new RuntimeError("Invalid spatial reference"); @@ -149,30 +150,31 @@ function parseMetadataSuccess(terrainProviderBuilder, metadata) { if (hasAvailability) { terrainProviderBuilder.tilesAvailable = new TileAvailability( terrainProviderBuilder.tilingScheme, - terrainProviderBuilder.lodCount + terrainProviderBuilder.lodCount, ); terrainProviderBuilder.tilesAvailable.addAvailableTileRange( 0, 0, 0, terrainProviderBuilder.tilingScheme.getNumberOfXTilesAtLevel(0), - terrainProviderBuilder.tilingScheme.getNumberOfYTilesAtLevel(0) + terrainProviderBuilder.tilingScheme.getNumberOfYTilesAtLevel(0), ); terrainProviderBuilder.tilesAvailabilityLoaded = new TileAvailability( terrainProviderBuilder.tilingScheme, - terrainProviderBuilder.lodCount + terrainProviderBuilder.lodCount, ); } - terrainProviderBuilder.levelZeroMaximumGeometricError = TerrainProvider.getEstimatedLevelZeroGeometricErrorForAHeightmap( - terrainProviderBuilder.tilingScheme.ellipsoid, - terrainProviderBuilder.width, - terrainProviderBuilder.tilingScheme.getNumberOfXTilesAtLevel(0) - ); + terrainProviderBuilder.levelZeroMaximumGeometricError = + TerrainProvider.getEstimatedLevelZeroGeometricErrorForAHeightmap( + terrainProviderBuilder.tilingScheme.ellipsoid, + terrainProviderBuilder.width, + terrainProviderBuilder.tilingScheme.getNumberOfXTilesAtLevel(0), + ); if (metadata.bandCount > 1) { console.log( - "ArcGISTiledElevationTerrainProvider: Terrain data has more than 1 band. Using the first one." + "ArcGISTiledElevationTerrainProvider: Terrain data has more than 1 band. Using the first one.", ); } @@ -192,7 +194,7 @@ function parseMetadataSuccess(terrainProviderBuilder, metadata) { async function requestMetadata( terrainProviderBuilder, metadataResource, - provider + provider, ) { try { const metadata = await metadataResource.fetchJson(); @@ -203,7 +205,7 @@ async function requestMetadata( undefined, provider, defined(provider) ? provider._errorEvent : undefined, - message + message, ); throw error; @@ -400,7 +402,7 @@ ArcGISTiledElevationTerrainProvider.prototype.requestTileGeometry = function ( x, y, level, - request + request, ) { const tileResource = this._resource.getDerivedResource({ url: `tile/${level}/${y}/${x}`, @@ -419,7 +421,7 @@ ArcGISTiledElevationTerrainProvider.prototype.requestTileGeometry = function ( this, level + 1, x * 2, - y * 2 + y * 2, ); availabilityPromise = availabilityResult.promise; @@ -499,11 +501,10 @@ function isTileAvailable(that, level, x, y) { * @param {number} level The tile level for which to get the maximum geometric error. * @returns {number} The maximum geometric error. */ -ArcGISTiledElevationTerrainProvider.prototype.getLevelMaximumGeometricError = function ( - level -) { - return this._levelZeroMaximumGeometricError / (1 << level); -}; +ArcGISTiledElevationTerrainProvider.prototype.getLevelMaximumGeometricError = + function (level) { + return this._levelZeroMaximumGeometricError / (1 << level); + }; /** * Determines whether data for a tile is available to be loaded. @@ -516,7 +517,7 @@ ArcGISTiledElevationTerrainProvider.prototype.getLevelMaximumGeometricError = fu ArcGISTiledElevationTerrainProvider.prototype.getTileDataAvailable = function ( x, y, - level + level, ) { if (!this._hasAvailability) { return undefined; @@ -540,13 +541,10 @@ ArcGISTiledElevationTerrainProvider.prototype.getTileDataAvailable = function ( * @param {number} level The level of the tile for which to request geometry. * @returns {undefined} This provider does not support loading availability. */ -ArcGISTiledElevationTerrainProvider.prototype.loadTileDataAvailability = function ( - x, - y, - level -) { - return undefined; -}; +ArcGISTiledElevationTerrainProvider.prototype.loadTileDataAvailability = + function (x, y, level) { + return undefined; + }; function findRange(origin, width, height, data) { const endCol = width - 1; @@ -710,7 +708,7 @@ function requestAvailability(that, level, x, y) { yOffset, dim, dim, - result.data + result.data, ); // Mark whole area as having availability loaded @@ -719,7 +717,7 @@ function requestAvailability(that, level, x, y) { xOffset, yOffset, xOffset + dim, - yOffset + dim + yOffset + dim, ); const tilesAvailable = that._tilesAvailable; @@ -730,7 +728,7 @@ function requestAvailability(that, level, x, y) { range.startX, range.startY, range.endX, - range.endY + range.endY, ); } diff --git a/packages/engine/Source/Core/AttributeCompression.js b/packages/engine/Source/Core/AttributeCompression.js index b6b521cc0097..aa390cbcdb70 100644 --- a/packages/engine/Source/Core/AttributeCompression.js +++ b/packages/engine/Source/Core/AttributeCompression.js @@ -121,7 +121,7 @@ AttributeCompression.octDecodeInRange = function (x, y, rangeMax, result) { Check.defined("result", result); if (x < 0 || x > rangeMax || y < 0 || y > rangeMax) { throw new DeveloperError( - `x and y must be unsigned normalized integers between 0 and ${rangeMax}` + `x and y must be unsigned normalized integers between 0 and ${rangeMax}`, ); } //>>includeEnd('debug'); @@ -188,7 +188,7 @@ AttributeCompression.octDecodeFromCartesian4 = function (encoded, result) { w > 255 ) { throw new DeveloperError( - "x, y, z, and w must be unsigned normalized integers between 0 and 255" + "x, y, z, and w must be unsigned normalized integers between 0 and 255", ); } //>>includeEnd('debug'); @@ -313,7 +313,7 @@ AttributeCompression.octUnpack = function (packed, v1, v2, v3) { * */ AttributeCompression.compressTextureCoordinates = function ( - textureCoordinates + textureCoordinates, ) { //>>includeStart('debug', pragmas.debug); Check.defined("textureCoordinates", textureCoordinates); @@ -335,7 +335,7 @@ AttributeCompression.compressTextureCoordinates = function ( */ AttributeCompression.decompressTextureCoordinates = function ( compressed, - result + result, ) { //>>includeStart('debug', pragmas.debug); Check.defined("compressed", compressed); @@ -365,7 +365,7 @@ function zigZagDecode(value) { AttributeCompression.zigZagDeltaDecode = function ( uBuffer, vBuffer, - heightBuffer + heightBuffer, ) { //>>includeStart('debug', pragmas.debug); Check.defined("uBuffer", uBuffer); @@ -374,14 +374,14 @@ AttributeCompression.zigZagDeltaDecode = function ( "uBuffer.length", "vBuffer.length", uBuffer.length, - vBuffer.length + vBuffer.length, ); if (defined(heightBuffer)) { Check.typeOf.number.equals( "uBuffer.length", "heightBuffer.length", uBuffer.length, - heightBuffer.length + heightBuffer.length, ); } //>>includeEnd('debug'); @@ -422,7 +422,7 @@ AttributeCompression.dequantize = function ( typedArray, componentDatatype, type, - count + count, ) { //>>includeStart('debug', pragmas.debug); Check.defined("typedArray", typedArray); @@ -456,13 +456,13 @@ AttributeCompression.dequantize = function ( //>>includeStart('debug', pragmas.debug); default: throw new DeveloperError( - `Cannot dequantize component datatype: ${componentDatatype}` + `Cannot dequantize component datatype: ${componentDatatype}`, ); //>>includeEnd('debug'); } const dequantizedTypedArray = new Float32Array( - count * componentsPerAttribute + count * componentsPerAttribute, ); for (let i = 0; i < count; i++) { @@ -470,7 +470,7 @@ AttributeCompression.dequantize = function ( const index = i * componentsPerAttribute + j; dequantizedTypedArray[index] = Math.max( typedArray[index] / divisor, - -1.0 + -1.0, ); } } @@ -495,7 +495,7 @@ AttributeCompression.decodeRGB565 = function (typedArray, result) { "result.length", "typedArray.length * 3", result.length, - expectedLength + expectedLength, ); } //>>includeEnd('debug'); diff --git a/packages/engine/Source/Core/AxisAlignedBoundingBox.js b/packages/engine/Source/Core/AxisAlignedBoundingBox.js index 41af002cd3c8..d5ddea4992a3 100644 --- a/packages/engine/Source/Core/AxisAlignedBoundingBox.js +++ b/packages/engine/Source/Core/AxisAlignedBoundingBox.js @@ -197,12 +197,12 @@ AxisAlignedBoundingBox.intersectPlane = function (box, plane) { intersectScratch = Cartesian3.subtract( box.maximum, box.minimum, - intersectScratch + intersectScratch, ); const h = Cartesian3.multiplyByScalar( intersectScratch, 0.5, - intersectScratch + intersectScratch, ); //The positive half diagonal const normal = plane.normal; const e = diff --git a/packages/engine/Source/Core/BingMapsGeocoderService.js b/packages/engine/Source/Core/BingMapsGeocoderService.js index a9292e57015d..647658fcd2d3 100644 --- a/packages/engine/Source/Core/BingMapsGeocoderService.js +++ b/packages/engine/Source/Core/BingMapsGeocoderService.js @@ -43,7 +43,7 @@ function BingMapsGeocoderService(options) { this._credit = new Credit( ``, - false + false, ); } diff --git a/packages/engine/Source/Core/BoundingRectangle.js b/packages/engine/Source/Core/BoundingRectangle.js index 220164a84168..ae678725057a 100644 --- a/packages/engine/Source/Core/BoundingRectangle.js +++ b/packages/engine/Source/Core/BoundingRectangle.js @@ -182,10 +182,10 @@ BoundingRectangle.fromRectangle = function (rectangle, projection, result) { projection = defaultValue(projection, defaultProjection); const lowerLeft = projection.project( - Rectangle.southwest(rectangle, fromRectangleLowerLeft) + Rectangle.southwest(rectangle, fromRectangleLowerLeft), ); const upperRight = projection.project( - Rectangle.northeast(rectangle, fromRectangleUpperRight) + Rectangle.northeast(rectangle, fromRectangleUpperRight), ); Cartesian2.subtract(upperRight, lowerLeft, upperRight); @@ -214,7 +214,7 @@ BoundingRectangle.clone = function (rectangle, result) { rectangle.x, rectangle.y, rectangle.width, - rectangle.height + rectangle.height, ); } diff --git a/packages/engine/Source/Core/BoundingSphere.js b/packages/engine/Source/Core/BoundingSphere.js index 9ee58a40d09d..e43530a8f8a9 100644 --- a/packages/engine/Source/Core/BoundingSphere.js +++ b/packages/engine/Source/Core/BoundingSphere.js @@ -123,13 +123,13 @@ BoundingSphere.fromPoints = function (positions, result) { // Compute x-, y-, and z-spans (Squared distances b/n each component's min. and max.). const xSpan = Cartesian3.magnitudeSquared( - Cartesian3.subtract(xMax, xMin, fromPointsScratch) + Cartesian3.subtract(xMax, xMin, fromPointsScratch), ); const ySpan = Cartesian3.magnitudeSquared( - Cartesian3.subtract(yMax, yMin, fromPointsScratch) + Cartesian3.subtract(yMax, yMin, fromPointsScratch), ); const zSpan = Cartesian3.magnitudeSquared( - Cartesian3.subtract(zMax, zMin, fromPointsScratch) + Cartesian3.subtract(zMax, zMin, fromPointsScratch), ); // Set the diameter endpoints to the largest span. @@ -155,7 +155,7 @@ BoundingSphere.fromPoints = function (positions, result) { // Calculate the radius of the initial sphere found by Ritter's algorithm let radiusSquared = Cartesian3.magnitudeSquared( - Cartesian3.subtract(diameter2, ritterCenter, fromPointsScratch) + Cartesian3.subtract(diameter2, ritterCenter, fromPointsScratch), ); let ritterRadius = Math.sqrt(radiusSquared); @@ -173,7 +173,7 @@ BoundingSphere.fromPoints = function (positions, result) { const naiveCenter = Cartesian3.midpoint( minBoxPt, maxBoxPt, - fromPointsNaiveCenterScratch + fromPointsNaiveCenterScratch, ); // Begin 2nd pass to find naive radius and modify the ritter sphere. @@ -183,7 +183,7 @@ BoundingSphere.fromPoints = function (positions, result) { // Find the furthest point from the naive center to calculate the naive radius. const r = Cartesian3.magnitude( - Cartesian3.subtract(currentPos, naiveCenter, fromPointsScratch) + Cartesian3.subtract(currentPos, naiveCenter, fromPointsScratch), ); if (r > naiveRadius) { naiveRadius = r; @@ -191,7 +191,7 @@ BoundingSphere.fromPoints = function (positions, result) { // Make adjustments to the Ritter Sphere to include all points. const oldCenterToPointSquared = Cartesian3.magnitudeSquared( - Cartesian3.subtract(currentPos, ritterCenter, fromPointsScratch) + Cartesian3.subtract(currentPos, ritterCenter, fromPointsScratch), ); if (oldCenterToPointSquared > radiusSquared) { const oldCenterToPoint = Math.sqrt(oldCenterToPointSquared); @@ -243,7 +243,7 @@ BoundingSphere.fromRectangle2D = function (rectangle, projection, result) { projection, 0.0, 0.0, - result + result, ); }; @@ -263,7 +263,7 @@ BoundingSphere.fromRectangleWithHeights2D = function ( projection, minimumHeight, maximumHeight, - result + result, ) { if (!defined(result)) { result = new BoundingSphere(); @@ -285,11 +285,11 @@ BoundingSphere.fromRectangleWithHeights2D = function ( const lowerLeft = projection.project( fromRectangle2DSouthwest, - fromRectangle2DLowerLeft + fromRectangle2DLowerLeft, ); const upperRight = projection.project( fromRectangle2DNortheast, - fromRectangle2DUpperRight + fromRectangle2DUpperRight, ); const width = upperRight.x - lowerLeft.x; @@ -321,7 +321,7 @@ BoundingSphere.fromRectangle3D = function ( rectangle, ellipsoid, surfaceHeight, - result + result, ) { ellipsoid = defaultValue(ellipsoid, Ellipsoid.default); surfaceHeight = defaultValue(surfaceHeight, 0.0); @@ -340,7 +340,7 @@ BoundingSphere.fromRectangle3D = function ( rectangle, ellipsoid, surfaceHeight, - fromRectangle3DScratch + fromRectangle3DScratch, ); return BoundingSphere.fromPoints(positions, result); }; @@ -448,13 +448,13 @@ BoundingSphere.fromVertices = function (positions, center, stride, result) { // Compute x-, y-, and z-spans (Squared distances b/n each component's min. and max.). const xSpan = Cartesian3.magnitudeSquared( - Cartesian3.subtract(xMax, xMin, fromPointsScratch) + Cartesian3.subtract(xMax, xMin, fromPointsScratch), ); const ySpan = Cartesian3.magnitudeSquared( - Cartesian3.subtract(yMax, yMin, fromPointsScratch) + Cartesian3.subtract(yMax, yMin, fromPointsScratch), ); const zSpan = Cartesian3.magnitudeSquared( - Cartesian3.subtract(zMax, zMin, fromPointsScratch) + Cartesian3.subtract(zMax, zMin, fromPointsScratch), ); // Set the diameter endpoints to the largest span. @@ -480,7 +480,7 @@ BoundingSphere.fromVertices = function (positions, center, stride, result) { // Calculate the radius of the initial sphere found by Ritter's algorithm let radiusSquared = Cartesian3.magnitudeSquared( - Cartesian3.subtract(diameter2, ritterCenter, fromPointsScratch) + Cartesian3.subtract(diameter2, ritterCenter, fromPointsScratch), ); let ritterRadius = Math.sqrt(radiusSquared); @@ -498,7 +498,7 @@ BoundingSphere.fromVertices = function (positions, center, stride, result) { const naiveCenter = Cartesian3.midpoint( minBoxPt, maxBoxPt, - fromPointsNaiveCenterScratch + fromPointsNaiveCenterScratch, ); // Begin 2nd pass to find naive radius and modify the ritter sphere. @@ -510,7 +510,7 @@ BoundingSphere.fromVertices = function (positions, center, stride, result) { // Find the furthest point from the naive center to calculate the naive radius. const r = Cartesian3.magnitude( - Cartesian3.subtract(currentPos, naiveCenter, fromPointsScratch) + Cartesian3.subtract(currentPos, naiveCenter, fromPointsScratch), ); if (r > naiveRadius) { naiveRadius = r; @@ -518,7 +518,7 @@ BoundingSphere.fromVertices = function (positions, center, stride, result) { // Make adjustments to the Ritter Sphere to include all points. const oldCenterToPointSquared = Cartesian3.magnitudeSquared( - Cartesian3.subtract(currentPos, ritterCenter, fromPointsScratch) + Cartesian3.subtract(currentPos, ritterCenter, fromPointsScratch), ); if (oldCenterToPointSquared > radiusSquared) { const oldCenterToPoint = Math.sqrt(oldCenterToPointSquared); @@ -568,7 +568,7 @@ BoundingSphere.fromVertices = function (positions, center, stride, result) { BoundingSphere.fromEncodedCartesianVertices = function ( positionsHigh, positionsLow, - result + result, ) { if (!defined(result)) { result = new BoundingSphere(); @@ -637,13 +637,13 @@ BoundingSphere.fromEncodedCartesianVertices = function ( // Compute x-, y-, and z-spans (Squared distances b/n each component's min. and max.). const xSpan = Cartesian3.magnitudeSquared( - Cartesian3.subtract(xMax, xMin, fromPointsScratch) + Cartesian3.subtract(xMax, xMin, fromPointsScratch), ); const ySpan = Cartesian3.magnitudeSquared( - Cartesian3.subtract(yMax, yMin, fromPointsScratch) + Cartesian3.subtract(yMax, yMin, fromPointsScratch), ); const zSpan = Cartesian3.magnitudeSquared( - Cartesian3.subtract(zMax, zMin, fromPointsScratch) + Cartesian3.subtract(zMax, zMin, fromPointsScratch), ); // Set the diameter endpoints to the largest span. @@ -669,7 +669,7 @@ BoundingSphere.fromEncodedCartesianVertices = function ( // Calculate the radius of the initial sphere found by Ritter's algorithm let radiusSquared = Cartesian3.magnitudeSquared( - Cartesian3.subtract(diameter2, ritterCenter, fromPointsScratch) + Cartesian3.subtract(diameter2, ritterCenter, fromPointsScratch), ); let ritterRadius = Math.sqrt(radiusSquared); @@ -687,7 +687,7 @@ BoundingSphere.fromEncodedCartesianVertices = function ( const naiveCenter = Cartesian3.midpoint( minBoxPt, maxBoxPt, - fromPointsNaiveCenterScratch + fromPointsNaiveCenterScratch, ); // Begin 2nd pass to find naive radius and modify the ritter sphere. @@ -699,7 +699,7 @@ BoundingSphere.fromEncodedCartesianVertices = function ( // Find the furthest point from the naive center to calculate the naive radius. const r = Cartesian3.magnitude( - Cartesian3.subtract(currentPos, naiveCenter, fromPointsScratch) + Cartesian3.subtract(currentPos, naiveCenter, fromPointsScratch), ); if (r > naiveRadius) { naiveRadius = r; @@ -707,7 +707,7 @@ BoundingSphere.fromEncodedCartesianVertices = function ( // Make adjustments to the Ritter Sphere to include all points. const oldCenterToPointSquared = Cartesian3.magnitudeSquared( - Cartesian3.subtract(currentPos, ritterCenter, fromPointsScratch) + Cartesian3.subtract(currentPos, ritterCenter, fromPointsScratch), ); if (oldCenterToPointSquared > radiusSquared) { const oldCenterToPoint = Math.sqrt(oldCenterToPointSquared); @@ -835,7 +835,7 @@ BoundingSphere.fromBoundingSpheres = function (boundingSpheres, result) { radius = Math.max( radius, Cartesian3.distance(center, tmp.center, fromBoundingSpheresScratch) + - tmp.radius + tmp.radius, ); } result.radius = radius; @@ -856,7 +856,7 @@ const fromOrientedBoundingBoxScratchW = new Cartesian3(); */ BoundingSphere.fromOrientedBoundingBox = function ( orientedBoundingBox, - result + result, ) { //>>includeStart('debug', pragmas.debug); Check.defined("orientedBoundingBox", orientedBoundingBox); @@ -901,11 +901,11 @@ BoundingSphere.fromTransformation = function (transformation, result) { const center = Matrix4.getTranslation( transformation, - scratchFromTransformationCenter + scratchFromTransformationCenter, ); const scale = Matrix4.getScale( transformation, - scratchFromTransformationScale + scratchFromTransformationScale, ); const radius = 0.5 * Cartesian3.magnitude(scale); result.center = Cartesian3.clone(center, result.center); @@ -1022,7 +1022,7 @@ BoundingSphere.union = function (left, right, result) { const toRightCenter = Cartesian3.subtract( rightCenter, leftCenter, - unionScratch + unionScratch, ); const centerSeparation = Cartesian3.magnitude(toRightCenter); @@ -1046,7 +1046,7 @@ BoundingSphere.union = function (left, right, result) { const center = Cartesian3.multiplyByScalar( toRightCenter, (-leftRadius + halfDistanceBetweenTangentPoints) / centerSeparation, - unionScratchCenter + unionScratchCenter, ); Cartesian3.add(center, leftCenter, center); Cartesian3.clone(center, result.center); @@ -1073,7 +1073,7 @@ BoundingSphere.expand = function (sphere, point, result) { result = BoundingSphere.clone(sphere, result); const radius = Cartesian3.magnitude( - Cartesian3.subtract(point, result.center, expandScratch) + Cartesian3.subtract(point, result.center, expandScratch), ); if (radius > result.radius) { result.radius = radius; @@ -1134,7 +1134,7 @@ BoundingSphere.transform = function (sphere, transform, result) { result.center = Matrix4.multiplyByPoint( transform, sphere.center, - result.center + result.center, ); result.radius = Matrix4.getMaximumScale(transform) * sphere.radius; @@ -1165,7 +1165,7 @@ BoundingSphere.distanceSquaredTo = function (sphere, cartesian) { const diff = Cartesian3.subtract( sphere.center, cartesian, - distanceSquaredToScratch + distanceSquaredToScratch, ); const distance = Cartesian3.magnitude(diff) - sphere.radius; @@ -1204,7 +1204,7 @@ BoundingSphere.transformWithoutScale = function (sphere, transform, result) { result.center = Matrix4.multiplyByPoint( transform, sphere.center, - result.center + result.center, ); result.radius = sphere.radius; @@ -1229,7 +1229,7 @@ BoundingSphere.computePlaneDistances = function ( sphere, position, direction, - result + result, ) { //>>includeStart('debug', pragmas.debug); Check.typeOf.object("sphere", sphere); @@ -1244,7 +1244,7 @@ BoundingSphere.computePlaneDistances = function ( const toCenter = Cartesian3.subtract( sphere.center, position, - scratchCartesian3 + scratchCartesian3, ); const mag = Cartesian3.dot(direction, toCenter); @@ -1296,7 +1296,7 @@ BoundingSphere.projectTo2D = function (sphere, projection, result) { const east = Cartesian3.cross( Cartesian3.UNIT_Z, normal, - projectTo2DEastScratch + projectTo2DEastScratch, ); Cartesian3.normalize(east, east); const north = Cartesian3.cross(normal, east, projectTo2DNorthScratch); @@ -1359,7 +1359,7 @@ BoundingSphere.projectTo2D = function (sphere, projection, result) { Cartesian3.add(center, position, position); const cartographic = ellipsoid.cartesianToCartographic( position, - projectTo2DCartographicScratch + projectTo2DCartographicScratch, ); projection.project(cartographic, position); } @@ -1455,13 +1455,13 @@ BoundingSphere.prototype.distanceSquaredTo = function (cartesian) { BoundingSphere.prototype.computePlaneDistances = function ( position, direction, - result + result, ) { return BoundingSphere.computePlaneDistances( this, position, direction, - result + result, ); }; diff --git a/packages/engine/Source/Core/BoxGeometry.js b/packages/engine/Source/Core/BoxGeometry.js index 405107e0afd5..d6b4e6bc321a 100644 --- a/packages/engine/Source/Core/BoxGeometry.js +++ b/packages/engine/Source/Core/BoxGeometry.js @@ -53,7 +53,7 @@ function BoxGeometry(options) { options.offsetAttribute === GeometryOffsetAttribute.TOP ) { throw new DeveloperError( - "GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry." + "GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.", ); } //>>includeEnd('debug'); @@ -167,12 +167,12 @@ BoxGeometry.pack = function (value, array, startingIndex) { Cartesian3.pack( value._maximum, array, - startingIndex + Cartesian3.packedLength + startingIndex + Cartesian3.packedLength, ); VertexFormat.pack( value._vertexFormat, array, - startingIndex + 2 * Cartesian3.packedLength + startingIndex + 2 * Cartesian3.packedLength, ); array[ startingIndex + 2 * Cartesian3.packedLength + VertexFormat.packedLength @@ -210,12 +210,12 @@ BoxGeometry.unpack = function (array, startingIndex, result) { const max = Cartesian3.unpack( array, startingIndex + Cartesian3.packedLength, - scratchMax + scratchMax, ); const vertexFormat = VertexFormat.unpack( array, startingIndex + 2 * Cartesian3.packedLength, - scratchVertexFormat + scratchVertexFormat, ); const offsetAttribute = array[ @@ -885,7 +885,7 @@ BoxGeometry.getUnitBox = function () { BoxGeometry.fromDimensions({ dimensions: new Cartesian3(1.0, 1.0, 1.0), vertexFormat: VertexFormat.POSITION_ONLY, - }) + }), ); } return unitBoxGeometry; diff --git a/packages/engine/Source/Core/BoxOutlineGeometry.js b/packages/engine/Source/Core/BoxOutlineGeometry.js index 5e18ee05e9b1..1933cdad1a40 100644 --- a/packages/engine/Source/Core/BoxOutlineGeometry.js +++ b/packages/engine/Source/Core/BoxOutlineGeometry.js @@ -48,7 +48,7 @@ function BoxOutlineGeometry(options) { options.offsetAttribute === GeometryOffsetAttribute.TOP ) { throw new DeveloperError( - "GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry." + "GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.", ); } //>>includeEnd('debug'); @@ -155,7 +155,7 @@ BoxOutlineGeometry.pack = function (value, array, startingIndex) { Cartesian3.pack(value._max, array, startingIndex + Cartesian3.packedLength); array[startingIndex + Cartesian3.packedLength * 2] = defaultValue( value._offsetAttribute, - -1 + -1, ); return array; @@ -188,7 +188,7 @@ BoxOutlineGeometry.unpack = function (array, startingIndex, result) { const max = Cartesian3.unpack( array, startingIndex + Cartesian3.packedLength, - scratchMax + scratchMax, ); const offsetAttribute = array[startingIndex + Cartesian3.packedLength * 2]; diff --git a/packages/engine/Source/Core/Cartesian2.js b/packages/engine/Source/Core/Cartesian2.js index 9d7d8137359c..6993889d5a8b 100644 --- a/packages/engine/Source/Core/Cartesian2.js +++ b/packages/engine/Source/Core/Cartesian2.js @@ -163,7 +163,7 @@ Cartesian2.packArray = function (array, result) { } else if (!Array.isArray(result) && result.length !== resultLength) { //>>includeStart('debug', pragmas.debug); throw new DeveloperError( - "If result is a typed array, it must have exactly array.length * 2 elements" + "If result is a typed array, it must have exactly array.length * 2 elements", ); //>>includeEnd('debug'); } else if (result.length !== resultLength) { @@ -646,7 +646,7 @@ Cartesian2.angleBetween = function (left, right) { Cartesian2.normalize(left, angleBetweenScratch); Cartesian2.normalize(right, angleBetweenScratch2); return CesiumMath.acosClamped( - Cartesian2.dot(angleBetweenScratch, angleBetweenScratch2) + Cartesian2.dot(angleBetweenScratch, angleBetweenScratch2), ); }; @@ -716,7 +716,7 @@ Cartesian2.equalsEpsilon = function ( left, right, relativeEpsilon, - absoluteEpsilon + absoluteEpsilon, ) { return ( left === right || @@ -726,13 +726,13 @@ Cartesian2.equalsEpsilon = function ( left.x, right.x, relativeEpsilon, - absoluteEpsilon + absoluteEpsilon, ) && CesiumMath.equalsEpsilon( left.y, right.y, relativeEpsilon, - absoluteEpsilon + absoluteEpsilon, )) ); }; @@ -803,13 +803,13 @@ Cartesian2.prototype.equals = function (right) { Cartesian2.prototype.equalsEpsilon = function ( right, relativeEpsilon, - absoluteEpsilon + absoluteEpsilon, ) { return Cartesian2.equalsEpsilon( this, right, relativeEpsilon, - absoluteEpsilon + absoluteEpsilon, ); }; diff --git a/packages/engine/Source/Core/Cartesian3.js b/packages/engine/Source/Core/Cartesian3.js index 685587b8fffd..c4415d6bace4 100644 --- a/packages/engine/Source/Core/Cartesian3.js +++ b/packages/engine/Source/Core/Cartesian3.js @@ -191,7 +191,7 @@ Cartesian3.packArray = function (array, result) { } else if (!Array.isArray(result) && result.length !== resultLength) { //>>includeStart('debug', pragmas.debug); throw new DeveloperError( - "If result is a typed array, it must have exactly array.length * 3 elements" + "If result is a typed array, it must have exactly array.length * 3 elements", ); //>>includeEnd('debug'); } else if (result.length !== resultLength) { @@ -679,8 +679,8 @@ Cartesian3.angleBetween = function (left, right) { Cartesian3.cross( angleBetweenScratch, angleBetweenScratch2, - angleBetweenScratch - ) + angleBetweenScratch, + ), ); return Math.atan2(sine, cosine); }; @@ -780,7 +780,7 @@ Cartesian3.equalsEpsilon = function ( left, right, relativeEpsilon, - absoluteEpsilon + absoluteEpsilon, ) { return ( left === right || @@ -790,19 +790,19 @@ Cartesian3.equalsEpsilon = function ( left.x, right.x, relativeEpsilon, - absoluteEpsilon + absoluteEpsilon, ) && CesiumMath.equalsEpsilon( left.y, right.y, relativeEpsilon, - absoluteEpsilon + absoluteEpsilon, ) && CesiumMath.equalsEpsilon( left.z, right.z, relativeEpsilon, - absoluteEpsilon + absoluteEpsilon, )) ); }; @@ -878,7 +878,7 @@ Cartesian3.fromDegrees = function ( latitude, height, ellipsoid, - result + result, ) { //>>includeStart('debug', pragmas.debug); Check.typeOf.number("longitude", longitude); @@ -897,7 +897,7 @@ let scratchK = new Cartesian3(); Cartesian3._ellipsoidRadiiSquared = new Cartesian3( 6378137.0 * 6378137.0, 6378137.0 * 6378137.0, - 6356752.3142451793 * 6356752.3142451793 + 6356752.3142451793 * 6356752.3142451793, ); /** @@ -918,7 +918,7 @@ Cartesian3.fromRadians = function ( latitude, height, ellipsoid, - result + result, ) { //>>includeStart('debug', pragmas.debug); Check.typeOf.number("longitude", longitude); @@ -964,7 +964,7 @@ Cartesian3.fromDegreesArray = function (coordinates, ellipsoid, result) { Check.defined("coordinates", coordinates); if (coordinates.length < 2 || coordinates.length % 2 !== 0) { throw new DeveloperError( - "the number of coordinates must be a multiple of 2 and at least 2" + "the number of coordinates must be a multiple of 2 and at least 2", ); } //>>includeEnd('debug'); @@ -985,7 +985,7 @@ Cartesian3.fromDegreesArray = function (coordinates, ellipsoid, result) { latitude, 0, ellipsoid, - result[index] + result[index], ); } @@ -1008,7 +1008,7 @@ Cartesian3.fromRadiansArray = function (coordinates, ellipsoid, result) { Check.defined("coordinates", coordinates); if (coordinates.length < 2 || coordinates.length % 2 !== 0) { throw new DeveloperError( - "the number of coordinates must be a multiple of 2 and at least 2" + "the number of coordinates must be a multiple of 2 and at least 2", ); } //>>includeEnd('debug'); @@ -1029,7 +1029,7 @@ Cartesian3.fromRadiansArray = function (coordinates, ellipsoid, result) { latitude, 0, ellipsoid, - result[index] + result[index], ); } @@ -1052,7 +1052,7 @@ Cartesian3.fromDegreesArrayHeights = function (coordinates, ellipsoid, result) { Check.defined("coordinates", coordinates); if (coordinates.length < 3 || coordinates.length % 3 !== 0) { throw new DeveloperError( - "the number of coordinates must be a multiple of 3 and at least 3" + "the number of coordinates must be a multiple of 3 and at least 3", ); } //>>includeEnd('debug'); @@ -1074,7 +1074,7 @@ Cartesian3.fromDegreesArrayHeights = function (coordinates, ellipsoid, result) { latitude, height, ellipsoid, - result[index] + result[index], ); } @@ -1097,7 +1097,7 @@ Cartesian3.fromRadiansArrayHeights = function (coordinates, ellipsoid, result) { Check.defined("coordinates", coordinates); if (coordinates.length < 3 || coordinates.length % 3 !== 0) { throw new DeveloperError( - "the number of coordinates must be a multiple of 3 and at least 3" + "the number of coordinates must be a multiple of 3 and at least 3", ); } //>>includeEnd('debug'); @@ -1119,7 +1119,7 @@ Cartesian3.fromRadiansArrayHeights = function (coordinates, ellipsoid, result) { latitude, height, ellipsoid, - result[index] + result[index], ); } @@ -1200,13 +1200,13 @@ Cartesian3.prototype.equals = function (right) { Cartesian3.prototype.equalsEpsilon = function ( right, relativeEpsilon, - absoluteEpsilon + absoluteEpsilon, ) { return Cartesian3.equalsEpsilon( this, right, relativeEpsilon, - absoluteEpsilon + absoluteEpsilon, ); }; diff --git a/packages/engine/Source/Core/Cartesian4.js b/packages/engine/Source/Core/Cartesian4.js index fa841cc9b2aa..a2bffc45b705 100644 --- a/packages/engine/Source/Core/Cartesian4.js +++ b/packages/engine/Source/Core/Cartesian4.js @@ -191,7 +191,7 @@ Cartesian4.packArray = function (array, result) { } else if (!Array.isArray(result) && result.length !== resultLength) { //>>includeStart('debug', pragmas.debug); throw new DeveloperError( - "If result is a typed array, it must have exactly array.length * 4 elements" + "If result is a typed array, it must have exactly array.length * 4 elements", ); //>>includeEnd('debug'); } else if (result.length !== resultLength) { @@ -774,7 +774,7 @@ Cartesian4.equalsEpsilon = function ( left, right, relativeEpsilon, - absoluteEpsilon + absoluteEpsilon, ) { return ( left === right || @@ -784,25 +784,25 @@ Cartesian4.equalsEpsilon = function ( left.x, right.x, relativeEpsilon, - absoluteEpsilon + absoluteEpsilon, ) && CesiumMath.equalsEpsilon( left.y, right.y, relativeEpsilon, - absoluteEpsilon + absoluteEpsilon, ) && CesiumMath.equalsEpsilon( left.z, right.z, relativeEpsilon, - absoluteEpsilon + absoluteEpsilon, ) && CesiumMath.equalsEpsilon( left.w, right.w, relativeEpsilon, - absoluteEpsilon + absoluteEpsilon, )) ); }; @@ -889,13 +889,13 @@ Cartesian4.prototype.equals = function (right) { Cartesian4.prototype.equalsEpsilon = function ( right, relativeEpsilon, - absoluteEpsilon + absoluteEpsilon, ) { return Cartesian4.equalsEpsilon( this, right, relativeEpsilon, - absoluteEpsilon + absoluteEpsilon, ); }; diff --git a/packages/engine/Source/Core/Cartographic.js b/packages/engine/Source/Core/Cartographic.js index 3f0317b6f679..091d80895ca8 100644 --- a/packages/engine/Source/Core/Cartographic.js +++ b/packages/engine/Source/Core/Cartographic.js @@ -98,12 +98,12 @@ const cartesianToCartographicH = new Cartesian3(); Cartographic._ellipsoidOneOverRadii = new Cartesian3( 1.0 / 6378137.0, 1.0 / 6378137.0, - 1.0 / 6356752.3142451793 + 1.0 / 6356752.3142451793, ); Cartographic._ellipsoidOneOverRadiiSquared = new Cartesian3( 1.0 / (6378137.0 * 6378137.0), 1.0 / (6378137.0 * 6378137.0), - 1.0 / (6356752.3142451793 * 6356752.3142451793) + 1.0 / (6356752.3142451793 * 6356752.3142451793), ); Cartographic._ellipsoidCenterToleranceSquared = CesiumMath.EPSILON1; @@ -133,7 +133,7 @@ Cartographic.fromCartesian = function (cartesian, ellipsoid, result) { oneOverRadii, oneOverRadiiSquared, centerToleranceSquared, - cartesianToCartographicP + cartesianToCartographicP, ); if (!defined(p)) { @@ -143,7 +143,7 @@ Cartographic.fromCartesian = function (cartesian, ellipsoid, result) { let n = Cartesian3.multiplyComponents( p, oneOverRadiiSquared, - cartesianToCartographicN + cartesianToCartographicN, ); n = Cartesian3.normalize(n, n); @@ -182,7 +182,7 @@ Cartographic.toCartesian = function (cartographic, ellipsoid, result) { cartographic.latitude, cartographic.height, ellipsoid, - result + result, ); }; @@ -201,7 +201,7 @@ Cartographic.clone = function (cartographic, result) { return new Cartographic( cartographic.longitude, cartographic.latitude, - cartographic.height + cartographic.height, ); } result.longitude = cartographic.longitude; diff --git a/packages/engine/Source/Core/CatmullRomSpline.js b/packages/engine/Source/Core/CatmullRomSpline.js index 8f7c4ea6d9f2..b2181f642e67 100644 --- a/packages/engine/Source/Core/CatmullRomSpline.js +++ b/packages/engine/Source/Core/CatmullRomSpline.js @@ -37,7 +37,7 @@ function createEvaluateFunction(spline) { } const i = (spline._lastTimeIndex = spline.findTimeInterval( time, - spline._lastTimeIndex + spline._lastTimeIndex, )); const u = (time - times[i]) / (times[i + 1] - times[i]); @@ -64,7 +64,7 @@ function createEvaluateFunction(spline) { coefs = Matrix4.multiplyByVector( HermiteSpline.hermiteCoefficientMatrix, timeVec, - timeVec + timeVec, ); } else if (i === points.length - 2) { p0 = points[i]; @@ -77,7 +77,7 @@ function createEvaluateFunction(spline) { coefs = Matrix4.multiplyByVector( HermiteSpline.hermiteCoefficientMatrix, timeVec, - timeVec + timeVec, ); } else { p0 = points[i - 1]; @@ -87,7 +87,7 @@ function createEvaluateFunction(spline) { coefs = Matrix4.multiplyByVector( CatmullRomSpline.catmullRomCoefficientMatrix, timeVec, - timeVec + timeVec, ); } result = Cartesian3.multiplyByScalar(p0, coefs.x, result); @@ -163,7 +163,7 @@ function CatmullRomSpline(options) { "times.length", "points.length", times.length, - points.length + points.length, ); //>>includeEnd('debug'); @@ -272,7 +272,7 @@ CatmullRomSpline.catmullRomCoefficientMatrix = new Matrix4( 0.5, -0.5, 0.0, - 0.0 + 0.0, ); /** diff --git a/packages/engine/Source/Core/CesiumTerrainProvider.js b/packages/engine/Source/Core/CesiumTerrainProvider.js index 9ce3f464f3b3..64497322ab0b 100644 --- a/packages/engine/Source/Core/CesiumTerrainProvider.js +++ b/packages/engine/Source/Core/CesiumTerrainProvider.js @@ -104,7 +104,8 @@ TerrainProviderBuilder.prototype.build = function (provider) { provider._availability = this.availability; provider._tilingScheme = this.tilingScheme; provider._requestWaterMask = this.requestWaterMask; - provider._levelZeroMaximumGeometricError = this.levelZeroMaximumGeometricError; + provider._levelZeroMaximumGeometricError = + this.levelZeroMaximumGeometricError; provider._heightmapStructure = this.heightmapStructure; provider._layers = this.layers; @@ -120,7 +121,7 @@ async function parseMetadataSuccess(terrainProviderBuilder, data, provider) { terrainProviderBuilder.previousError, provider, defined(provider) ? provider._errorEvent : undefined, - message + message, ); throw new RuntimeError(message); @@ -133,7 +134,7 @@ async function parseMetadataSuccess(terrainProviderBuilder, data, provider) { terrainProviderBuilder.previousError, provider, defined(provider) ? provider._errorEvent : undefined, - message + message, ); throw new RuntimeError(message); @@ -166,7 +167,7 @@ async function parseMetadataSuccess(terrainProviderBuilder, data, provider) { terrainProviderBuilder.previousError, provider, defined(provider) ? provider._errorEvent : undefined, - message + message, ); throw new RuntimeError(message); @@ -177,7 +178,7 @@ async function parseMetadataSuccess(terrainProviderBuilder, data, provider) { const maxZoom = data.maxzoom; terrainProviderBuilder.overallMaxZoom = Math.max( terrainProviderBuilder.overallMaxZoom, - maxZoom + maxZoom, ); // Keeps track of which of the availability containing tiles have been loaded @@ -199,17 +200,18 @@ async function parseMetadataSuccess(terrainProviderBuilder, data, provider) { terrainProviderBuilder.previousError, provider, defined(provider) ? provider._errorEvent : undefined, - message + message, ); throw new RuntimeError(message); } - terrainProviderBuilder.levelZeroMaximumGeometricError = TerrainProvider.getEstimatedLevelZeroGeometricErrorForAHeightmap( - terrainProviderBuilder.tilingScheme.ellipsoid, - terrainProviderBuilder.heightmapWidth, - terrainProviderBuilder.tilingScheme.getNumberOfXTilesAtLevel(0) - ); + terrainProviderBuilder.levelZeroMaximumGeometricError = + TerrainProvider.getEstimatedLevelZeroGeometricErrorForAHeightmap( + terrainProviderBuilder.tilingScheme.ellipsoid, + terrainProviderBuilder.heightmapWidth, + terrainProviderBuilder.tilingScheme.getNumberOfXTilesAtLevel(0), + ); if (!data.scheme || data.scheme === "tms" || data.scheme === "slippyMap") { terrainProviderBuilder.scheme = data.scheme; } else { @@ -218,7 +220,7 @@ async function parseMetadataSuccess(terrainProviderBuilder, data, provider) { terrainProviderBuilder.previousError, provider, defined(provider) ? provider._errorEvent : undefined, - message + message, ); throw new RuntimeError(message); @@ -257,13 +259,12 @@ async function parseMetadataSuccess(terrainProviderBuilder, data, provider) { if (defined(availableTiles) && !defined(availabilityLevels)) { availability = new TileAvailability( terrainProviderBuilder.tilingScheme, - availableTiles.length + availableTiles.length, ); for (let level = 0; level < availableTiles.length; ++level) { const rangesAtLevel = availableTiles[level]; - const yTiles = terrainProviderBuilder.tilingScheme.getNumberOfYTilesAtLevel( - level - ); + const yTiles = + terrainProviderBuilder.tilingScheme.getNumberOfYTilesAtLevel(level); if (!defined(terrainProviderBuilder.overallAvailability[level])) { terrainProviderBuilder.overallAvailability[level] = []; } @@ -287,18 +288,18 @@ async function parseMetadataSuccess(terrainProviderBuilder, data, provider) { range.startX, yStart, range.endX, - yEnd + yEnd, ); } } } else if (defined(availabilityLevels)) { availabilityTilesLoaded = new TileAvailability( terrainProviderBuilder.tilingScheme, - maxZoom + maxZoom, ); availability = new TileAvailability( terrainProviderBuilder.tilingScheme, - maxZoom + maxZoom, ); terrainProviderBuilder.overallAvailability[0] = [[0, 0, 1, 0]]; availability.addAvailableTileRange(0, 0, 0, 1, 0); @@ -331,29 +332,27 @@ async function parseMetadataSuccess(terrainProviderBuilder, data, provider) { availabilityLevels: availabilityLevels, availabilityTilesLoaded: availabilityTilesLoaded, littleEndianExtensionSize: littleEndianExtensionSize, - }) + }), ); const parentUrl = data.parentUrl; if (defined(parentUrl)) { if (!defined(availability)) { console.log( - "A layer.json can't have a parentUrl if it does't have an available array." + "A layer.json can't have a parentUrl if it does't have an available array.", ); return true; } - terrainProviderBuilder.lastResource = terrainProviderBuilder.lastResource.getDerivedResource( - { + terrainProviderBuilder.lastResource = + terrainProviderBuilder.lastResource.getDerivedResource({ url: parentUrl, - } - ); + }); terrainProviderBuilder.lastResource.appendForwardSlash(); // Terrain always expects a directory - terrainProviderBuilder.layerJsonResource = terrainProviderBuilder.lastResource.getDerivedResource( - { + terrainProviderBuilder.layerJsonResource = + terrainProviderBuilder.lastResource.getDerivedResource({ url: "layer.json", - } - ); + }); await requestLayerJson(terrainProviderBuilder); return true; } @@ -371,7 +370,7 @@ function parseMetadataFailure(terrainProviderBuilder, error, provider) { terrainProviderBuilder.previousError, provider, defined(provider) ? provider._errorEvent : undefined, - message + message, ); // If we can retry, do so. Otherwise throw the error. @@ -387,10 +386,11 @@ async function metadataSuccess(terrainProviderBuilder, data, provider) { const length = terrainProviderBuilder.overallAvailability.length; if (length > 0) { - const availability = (terrainProviderBuilder.availability = new TileAvailability( - terrainProviderBuilder.tilingScheme, - terrainProviderBuilder.overallMaxZoom - )); + const availability = (terrainProviderBuilder.availability = + new TileAvailability( + terrainProviderBuilder.tilingScheme, + terrainProviderBuilder.overallMaxZoom, + )); for (let level = 0; level < length; ++level) { const levelRanges = terrainProviderBuilder.overallAvailability[level]; for (let i = 0; i < levelRanges.length; ++i) { @@ -400,7 +400,7 @@ async function metadataSuccess(terrainProviderBuilder, data, provider) { range[0], range[1], range[2], - range[3] + range[3], ); } } @@ -430,7 +430,7 @@ async function requestLayerJson(terrainProviderBuilder, provider) { scheme: "tms", tiles: ["{z}/{x}/{y}.terrain?v={version}"], }, - provider + provider, ); return true; @@ -493,7 +493,7 @@ function CesiumTerrainProvider(options) { */ this._requestVertexNormals = defaultValue( options.requestVertexNormals, - false + false, ); /** @@ -579,7 +579,7 @@ function createHeightmapTerrainData(provider, buffer, level, x, y) { const heightBuffer = new Uint16Array( buffer, 0, - provider._heightmapWidth * provider._heightmapWidth + provider._heightmapWidth * provider._heightmapWidth, ); return new HeightmapTerrainData({ buffer: heightBuffer, @@ -587,7 +587,7 @@ function createHeightmapTerrainData(provider, buffer, level, x, y) { waterMask: new Uint8Array( buffer, heightBuffer.byteLength + 1, - buffer.byteLength - heightBuffer.byteLength - 1 + buffer.byteLength - heightBuffer.byteLength - 1, ), width: provider._heightmapWidth, height: provider._heightmapWidth, @@ -615,7 +615,7 @@ function createQuantizedMeshTerrainData(provider, buffer, level, x, y, layer) { const center = new Cartesian3( view.getFloat64(pos, true), view.getFloat64(pos + 8, true), - view.getFloat64(pos + 16, true) + view.getFloat64(pos + 16, true), ); pos += cartesian3Length; @@ -628,16 +628,16 @@ function createQuantizedMeshTerrainData(provider, buffer, level, x, y, layer) { new Cartesian3( view.getFloat64(pos, true), view.getFloat64(pos + 8, true), - view.getFloat64(pos + 16, true) + view.getFloat64(pos + 16, true), ), - view.getFloat64(pos + cartesian3Length, true) + view.getFloat64(pos + cartesian3Length, true), ); pos += boundingSphereLength; const horizonOcclusionPoint = new Cartesian3( view.getFloat64(pos, true), view.getFloat64(pos + 8, true), - view.getFloat64(pos + 16, true) + view.getFloat64(pos + 16, true), ); pos += cartesian3Length; @@ -657,7 +657,7 @@ function createQuantizedMeshTerrainData(provider, buffer, level, x, y, layer) { const vBuffer = encodedVertexBuffer.subarray(vertexCount, 2 * vertexCount); const heightBuffer = encodedVertexBuffer.subarray( vertexCount * 2, - 3 * vertexCount + 3 * vertexCount, ); AttributeCompression.zigZagDeltaDecode(uBuffer, vBuffer, heightBuffer); @@ -673,7 +673,7 @@ function createQuantizedMeshTerrainData(provider, buffer, level, x, y, layer) { vertexCount, buffer, pos, - triangleCount * triangleElements + triangleCount * triangleElements, ); pos += triangleCount * triangleLength; @@ -696,7 +696,7 @@ function createQuantizedMeshTerrainData(provider, buffer, level, x, y, layer) { vertexCount, buffer, pos, - westVertexCount + westVertexCount, ); pos += westVertexCount * bytesPerIndex; @@ -706,7 +706,7 @@ function createQuantizedMeshTerrainData(provider, buffer, level, x, y, layer) { vertexCount, buffer, pos, - southVertexCount + southVertexCount, ); pos += southVertexCount * bytesPerIndex; @@ -716,7 +716,7 @@ function createQuantizedMeshTerrainData(provider, buffer, level, x, y, layer) { vertexCount, buffer, pos, - eastVertexCount + eastVertexCount, ); pos += eastVertexCount * bytesPerIndex; @@ -726,7 +726,7 @@ function createQuantizedMeshTerrainData(provider, buffer, level, x, y, layer) { vertexCount, buffer, pos, - northVertexCount + northVertexCount, ); pos += northVertexCount * bytesPerIndex; @@ -757,16 +757,15 @@ function createQuantizedMeshTerrainData(provider, buffer, level, x, y, layer) { const metadata = getJsonFromTypedArray( new Uint8Array(buffer), pos + Uint32Array.BYTES_PER_ELEMENT, - stringLength + stringLength, ); const availableTiles = metadata.available; if (defined(availableTiles)) { for (let offset = 0; offset < availableTiles.length; ++offset) { const availableLevel = level + offset + 1; const rangesAtLevel = availableTiles[offset]; - const yTiles = provider._tilingScheme.getNumberOfYTilesAtLevel( - availableLevel - ); + const yTiles = + provider._tilingScheme.getNumberOfYTilesAtLevel(availableLevel); for ( let rangeIndex = 0; @@ -781,14 +780,14 @@ function createQuantizedMeshTerrainData(provider, buffer, level, x, y, layer) { range.startX, yStart, range.endX, - yEnd + yEnd, ); layer.availability.addAvailableTileRange( availableLevel, range.startX, yStart, range.endX, - yEnd + yEnd, ); } } @@ -811,7 +810,7 @@ function createQuantizedMeshTerrainData(provider, buffer, level, x, y, layer) { rectangle, minimumHeight, maximumHeight, - provider._tilingScheme.ellipsoid + provider._tilingScheme.ellipsoid, ); return new QuantizedMeshTerrainData({ @@ -856,7 +855,7 @@ CesiumTerrainProvider.prototype.requestTileGeometry = function ( x, y, level, - request + request, ) { const layers = this._layers; let layerToUse; @@ -884,13 +883,13 @@ CesiumTerrainProvider.prototype.requestTileGeometry = function ( y, level, layer, - i === 0 + i === 0, ); if (availabilityUnloaded.result) { // We can't know yet since the availability is not yet loaded unknownAvailability = true; availabilityPromise = availabilityPromise.then( - () => availabilityUnloaded.promise + () => availabilityUnloaded.promise, ); } } @@ -937,7 +936,7 @@ function requestTileGeometry(provider, x, y, level, layerToUse, request) { extensionList.push( layerToUse.littleEndianExtensionSize ? "octvertexnormals" - : "vertexnormals" + : "vertexnormals", ); } if (provider._requestWaterMask && layerToUse.hasWaterMask) { @@ -998,7 +997,7 @@ function requestTileGeometry(provider, x, y, level, layerToUse, request) { level, x, y, - layerToUse + layerToUse, ); }); } @@ -1150,7 +1149,7 @@ Object.defineProperties(CesiumTerrainProvider.prototype, { * @returns {number} The maximum geometric error. */ CesiumTerrainProvider.prototype.getLevelMaximumGeometricError = function ( - level + level, ) { return this._levelZeroMaximumGeometricError / (1 << level); }; @@ -1238,11 +1237,10 @@ CesiumTerrainProvider.fromUrl = async function (url, options) { const terrainProviderBuilder = new TerrainProviderBuilder(options); terrainProviderBuilder.lastResource = resource; - terrainProviderBuilder.layerJsonResource = terrainProviderBuilder.lastResource.getDerivedResource( - { + terrainProviderBuilder.layerJsonResource = + terrainProviderBuilder.lastResource.getDerivedResource({ url: "layer.json", - } - ); + }); await requestLayerJson(terrainProviderBuilder); @@ -1301,7 +1299,7 @@ CesiumTerrainProvider.prototype.getTileDataAvailable = function (x, y, level) { CesiumTerrainProvider.prototype.loadTileDataAvailability = function ( x, y, - level + level, ) { if ( !defined(this._availability) || @@ -1383,7 +1381,7 @@ function checkLayer(provider, x, y, level, layer, topLayer) { tile.y, tile.level, layer, - request + request, ); if (defined(requestPromise)) { layer.availabilityPromiseCache[cacheKey] = requestPromise; diff --git a/packages/engine/Source/Core/Check.d.ts b/packages/engine/Source/Core/Check.d.ts index e35676a3312c..7930f5175152 100644 --- a/packages/engine/Source/Core/Check.d.ts +++ b/packages/engine/Source/Core/Check.d.ts @@ -84,7 +84,7 @@ export const Check: { lessThanOrEquals( name: string, test: any, - limit: number + limit: number, ): asserts test is number; /** * Throws if test is not typeof 'number' and greater than limit @@ -97,7 +97,7 @@ export const Check: { greaterThan( name: string, test: any, - limit: number + limit: number, ): asserts test is number; /** * Throws if test is not typeof 'number' and greater than or equal to limit @@ -110,7 +110,7 @@ export const Check: { greaterThanOrEquals( name: string, test: any, - limit: number + limit: number, ): asserts test is number; /** * Throws if test1 and test2 is not typeof 'number' and not equal in value diff --git a/packages/engine/Source/Core/Check.js b/packages/engine/Source/Core/Check.js index 83f0c9ab0b11..7fced35d2b39 100644 --- a/packages/engine/Source/Core/Check.js +++ b/packages/engine/Source/Core/Check.js @@ -43,7 +43,7 @@ Check.defined = function (name, test) { Check.typeOf.func = function (name, test) { if (typeof test !== "function") { throw new DeveloperError( - getFailedTypeErrorMessage(typeof test, "function", name) + getFailedTypeErrorMessage(typeof test, "function", name), ); } }; @@ -58,7 +58,7 @@ Check.typeOf.func = function (name, test) { Check.typeOf.string = function (name, test) { if (typeof test !== "string") { throw new DeveloperError( - getFailedTypeErrorMessage(typeof test, "string", name) + getFailedTypeErrorMessage(typeof test, "string", name), ); } }; @@ -73,7 +73,7 @@ Check.typeOf.string = function (name, test) { Check.typeOf.number = function (name, test) { if (typeof test !== "number") { throw new DeveloperError( - getFailedTypeErrorMessage(typeof test, "number", name) + getFailedTypeErrorMessage(typeof test, "number", name), ); } }; @@ -90,7 +90,7 @@ Check.typeOf.number.lessThan = function (name, test, limit) { Check.typeOf.number(name, test); if (test >= limit) { throw new DeveloperError( - `Expected ${name} to be less than ${limit}, actual value was ${test}` + `Expected ${name} to be less than ${limit}, actual value was ${test}`, ); } }; @@ -107,7 +107,7 @@ Check.typeOf.number.lessThanOrEquals = function (name, test, limit) { Check.typeOf.number(name, test); if (test > limit) { throw new DeveloperError( - `Expected ${name} to be less than or equal to ${limit}, actual value was ${test}` + `Expected ${name} to be less than or equal to ${limit}, actual value was ${test}`, ); } }; @@ -124,7 +124,7 @@ Check.typeOf.number.greaterThan = function (name, test, limit) { Check.typeOf.number(name, test); if (test <= limit) { throw new DeveloperError( - `Expected ${name} to be greater than ${limit}, actual value was ${test}` + `Expected ${name} to be greater than ${limit}, actual value was ${test}`, ); } }; @@ -141,7 +141,7 @@ Check.typeOf.number.greaterThanOrEquals = function (name, test, limit) { Check.typeOf.number(name, test); if (test < limit) { throw new DeveloperError( - `Expected ${name} to be greater than or equal to ${limit}, actual value was ${test}` + `Expected ${name} to be greater than or equal to ${limit}, actual value was ${test}`, ); } }; @@ -156,7 +156,7 @@ Check.typeOf.number.greaterThanOrEquals = function (name, test, limit) { Check.typeOf.object = function (name, test) { if (typeof test !== "object") { throw new DeveloperError( - getFailedTypeErrorMessage(typeof test, "object", name) + getFailedTypeErrorMessage(typeof test, "object", name), ); } }; @@ -171,7 +171,7 @@ Check.typeOf.object = function (name, test) { Check.typeOf.bool = function (name, test) { if (typeof test !== "boolean") { throw new DeveloperError( - getFailedTypeErrorMessage(typeof test, "boolean", name) + getFailedTypeErrorMessage(typeof test, "boolean", name), ); } }; @@ -186,7 +186,7 @@ Check.typeOf.bool = function (name, test) { Check.typeOf.bigint = function (name, test) { if (typeof test !== "bigint") { throw new DeveloperError( - getFailedTypeErrorMessage(typeof test, "bigint", name) + getFailedTypeErrorMessage(typeof test, "bigint", name), ); } }; @@ -205,7 +205,7 @@ Check.typeOf.number.equals = function (name1, name2, test1, test2) { Check.typeOf.number(name2, test2); if (test1 !== test2) { throw new DeveloperError( - `${name1} must be equal to ${name2}, the actual values are ${test1} and ${test2}` + `${name1} must be equal to ${name2}, the actual values are ${test1} and ${test2}`, ); } }; diff --git a/packages/engine/Source/Core/CircleGeometry.js b/packages/engine/Source/Core/CircleGeometry.js index c713363cbe71..0f4b0c2bf1e8 100644 --- a/packages/engine/Source/Core/CircleGeometry.js +++ b/packages/engine/Source/Core/CircleGeometry.js @@ -113,26 +113,26 @@ CircleGeometry.unpack = function (array, startingIndex, result) { const ellipseGeometry = EllipseGeometry.unpack( array, startingIndex, - scratchEllipseGeometry + scratchEllipseGeometry, ); scratchOptions.center = Cartesian3.clone( ellipseGeometry._center, - scratchOptions.center + scratchOptions.center, ); scratchOptions.ellipsoid = Ellipsoid.clone( ellipseGeometry._ellipsoid, - scratchOptions.ellipsoid + scratchOptions.ellipsoid, ); scratchOptions.ellipsoid = Ellipsoid.clone( ellipseGeometry._ellipsoid, - scratchEllipseGeometry._ellipsoid + scratchEllipseGeometry._ellipsoid, ); scratchOptions.height = ellipseGeometry._height; scratchOptions.extrudedHeight = ellipseGeometry._extrudedHeight; scratchOptions.granularity = ellipseGeometry._granularity; scratchOptions.vertexFormat = VertexFormat.clone( ellipseGeometry._vertexFormat, - scratchOptions.vertexFormat + scratchOptions.vertexFormat, ); scratchOptions.stRotation = ellipseGeometry._stRotation; scratchOptions.shadowVolume = ellipseGeometry._shadowVolume; @@ -164,7 +164,7 @@ CircleGeometry.createGeometry = function (circleGeometry) { CircleGeometry.createShadowVolume = function ( circleGeometry, minHeightFunc, - maxHeightFunc + maxHeightFunc, ) { const granularity = circleGeometry._ellipseGeometry._granularity; const ellipsoid = circleGeometry._ellipseGeometry._ellipsoid; diff --git a/packages/engine/Source/Core/CircleOutlineGeometry.js b/packages/engine/Source/Core/CircleOutlineGeometry.js index f7b29d09151c..98662f200a21 100644 --- a/packages/engine/Source/Core/CircleOutlineGeometry.js +++ b/packages/engine/Source/Core/CircleOutlineGeometry.js @@ -78,7 +78,7 @@ CircleOutlineGeometry.pack = function (value, array, startingIndex) { return EllipseOutlineGeometry.pack( value._ellipseGeometry, array, - startingIndex + startingIndex, ); }; @@ -111,15 +111,15 @@ CircleOutlineGeometry.unpack = function (array, startingIndex, result) { const ellipseGeometry = EllipseOutlineGeometry.unpack( array, startingIndex, - scratchEllipseGeometry + scratchEllipseGeometry, ); scratchOptions.center = Cartesian3.clone( ellipseGeometry._center, - scratchOptions.center + scratchOptions.center, ); scratchOptions.ellipsoid = Ellipsoid.clone( ellipseGeometry._ellipsoid, - scratchOptions.ellipsoid + scratchOptions.ellipsoid, ); scratchOptions.height = ellipseGeometry._height; scratchOptions.extrudedHeight = ellipseGeometry._extrudedHeight; diff --git a/packages/engine/Source/Core/Clock.js b/packages/engine/Source/Core/Clock.js index 8bdea4fbf34c..272b9dc78915 100644 --- a/packages/engine/Source/Core/Clock.js +++ b/packages/engine/Source/Core/Clock.js @@ -139,7 +139,7 @@ function Clock(options) { this.shouldAnimate = defaultValue(options.shouldAnimate, false); this.clockStep = defaultValue( options.clockStep, - ClockStep.SYSTEM_CLOCK_MULTIPLIER + ClockStep.SYSTEM_CLOCK_MULTIPLIER, ); } @@ -273,14 +273,14 @@ Clock.prototype.tick = function () { currentTime = JulianDate.addSeconds( currentTime, multiplier, - currentTime + currentTime, ); } else { const milliseconds = currentSystemTime - this._lastSystemTime; currentTime = JulianDate.addSeconds( currentTime, multiplier * (milliseconds / 1000.0), - currentTime + currentTime, ); } @@ -303,7 +303,7 @@ Clock.prototype.tick = function () { currentTime = JulianDate.addSeconds( startTime, JulianDate.secondsDifference(currentTime, stopTime), - currentTime + currentTime, ); this.onStop.raiseEvent(this); } diff --git a/packages/engine/Source/Core/Color.js b/packages/engine/Source/Core/Color.js index 23683732133b..ab6860c00d25 100644 --- a/packages/engine/Source/Core/Color.js +++ b/packages/engine/Source/Core/Color.js @@ -173,7 +173,7 @@ Color.fromRgba = function (rgba, result) { scratchUint8Array[1], scratchUint8Array[2], scratchUint8Array[3], - result + result, ); }; @@ -293,7 +293,7 @@ Color.fromRandom = function (options, result) { Check.typeOf.number.lessThanOrEquals( "minimumGreen", minimumGreen, - maximumGreen + maximumGreen, ); //>>includeEnd('debug'); green = @@ -310,7 +310,7 @@ Color.fromRandom = function (options, result) { Check.typeOf.number.lessThanOrEquals( "minimumBlue", minimumBlue, - maximumBlue + maximumBlue, ); //>>includeEnd('debug'); @@ -327,7 +327,7 @@ Color.fromRandom = function (options, result) { Check.typeOf.number.lessThanOrEquals( "minumumAlpha", minimumAlpha, - maximumAlpha + maximumAlpha, ); //>>includeEnd('debug'); @@ -350,11 +350,14 @@ Color.fromRandom = function (options, result) { //#rgba const rgbaMatcher = /^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])?$/i; //#rrggbbaa -const rrggbbaaMatcher = /^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})?$/i; +const rrggbbaaMatcher = + /^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})?$/i; //rgb(), rgba(), or rgb%() -const rgbParenthesesMatcher = /^rgba?\s*\(\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i; +const rgbParenthesesMatcher = + /^rgba?\s*\(\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i; //hsl() or hsla() -const hslParenthesesMatcher = /^hsla?\s*\(\s*([0-9.]+)\s*[,\s]+\s*([0-9.]+%)\s*[,\s]+\s*([0-9.]+%)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i; +const hslParenthesesMatcher = + /^hsla?\s*\(\s*([0-9.]+)\s*[,\s]+\s*([0-9.]+%)\s*[,\s]+\s*([0-9.]+%)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i; /** * Creates a Color instance from a CSS color value. @@ -425,7 +428,7 @@ Color.fromCssColorString = function (color, result) { parseFloat(matches[2]) / 100.0, parseFloat(matches[3]) / 100.0, parseFloat(defaultValue(matches[4], "1.0")), - result + result, ); } diff --git a/packages/engine/Source/Core/ColorGeometryInstanceAttribute.js b/packages/engine/Source/Core/ColorGeometryInstanceAttribute.js index 1b409b4255b3..87992d602b2f 100644 --- a/packages/engine/Source/Core/ColorGeometryInstanceAttribute.js +++ b/packages/engine/Source/Core/ColorGeometryInstanceAttribute.js @@ -131,7 +131,7 @@ ColorGeometryInstanceAttribute.fromColor = function (color) { color.red, color.green, color.blue, - color.alpha + color.alpha, ); }; diff --git a/packages/engine/Source/Core/ComponentDatatype.js b/packages/engine/Source/Core/ComponentDatatype.js index 9e92afe2696b..4e6a3892148a 100644 --- a/packages/engine/Source/Core/ComponentDatatype.js +++ b/packages/engine/Source/Core/ComponentDatatype.js @@ -168,7 +168,7 @@ ComponentDatatype.fromTypedArray = function (array) { //>>includeStart('debug', pragmas.debug); throw new DeveloperError( - "array must be an Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, or Float64Array." + "array must be an Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, or Float64Array.", ); //>>includeEnd('debug'); }; @@ -213,7 +213,7 @@ ComponentDatatype.validate = function (componentDatatype) { */ ComponentDatatype.createTypedArray = function ( componentDatatype, - valuesOrLength + valuesOrLength, ) { //>>includeStart('debug', pragmas.debug); if (!defined(componentDatatype)) { @@ -263,7 +263,7 @@ ComponentDatatype.createArrayBufferView = function ( componentDatatype, buffer, byteOffset, - length + length, ) { //>>includeStart('debug', pragmas.debug); if (!defined(componentDatatype)) { @@ -278,7 +278,7 @@ ComponentDatatype.createArrayBufferView = function ( length = defaultValue( length, (buffer.byteLength - byteOffset) / - ComponentDatatype.getSizeInBytes(componentDatatype) + ComponentDatatype.getSizeInBytes(componentDatatype), ); switch (componentDatatype) { diff --git a/packages/engine/Source/Core/CompressedTextureBuffer.js b/packages/engine/Source/Core/CompressedTextureBuffer.js index 0974f06d5305..f9f3fe7d76d6 100644 --- a/packages/engine/Source/Core/CompressedTextureBuffer.js +++ b/packages/engine/Source/Core/CompressedTextureBuffer.js @@ -16,7 +16,7 @@ function CompressedTextureBuffer( pixelDatatype, width, height, - buffer + buffer, ) { this._format = internalFormat; this._datatype = pixelDatatype; @@ -110,7 +110,7 @@ CompressedTextureBuffer.clone = function (object) { object._datatype, object._width, object._height, - object._buffer + object._buffer, ); }; diff --git a/packages/engine/Source/Core/ConstantSpline.js b/packages/engine/Source/Core/ConstantSpline.js index 032003de3a3f..858330ec09ac 100644 --- a/packages/engine/Source/Core/ConstantSpline.js +++ b/packages/engine/Source/Core/ConstantSpline.js @@ -58,7 +58,7 @@ Object.defineProperties(ConstantSpline.prototype, { ConstantSpline.prototype.findTimeInterval = function (time) { //>>includeStart('debug', pragmas.debug); throw new DeveloperError( - "findTimeInterval cannot be called on a ConstantSpline." + "findTimeInterval cannot be called on a ConstantSpline.", ); //>>includeEnd('debug'); }; diff --git a/packages/engine/Source/Core/CoplanarPolygonGeometry.js b/packages/engine/Source/Core/CoplanarPolygonGeometry.js index eba53cf61bd7..8d2c7def35cb 100644 --- a/packages/engine/Source/Core/CoplanarPolygonGeometry.js +++ b/packages/engine/Source/Core/CoplanarPolygonGeometry.js @@ -47,7 +47,7 @@ function createGeometryFromPolygon( projectPointTo2D, normal, tangent, - bitangent + bitangent, ) { const positions = polygon.positions; let indices = PolygonPipeline.triangulate(polygon.positions2D, polygon.holes); @@ -59,7 +59,7 @@ function createGeometryFromPolygon( const newIndices = IndexDatatype.createTypedArray( positions.length, - indices.length + indices.length, ); newIndices.set(indices); @@ -68,7 +68,7 @@ function createGeometryFromPolygon( let rotation = Quaternion.fromAxisAngle( normal, stRotation, - quaternionScratch + quaternionScratch, ); textureMatrix = Matrix3.fromQuaternion(rotation, textureMatrix); @@ -76,21 +76,21 @@ function createGeometryFromPolygon( rotation = Quaternion.fromAxisAngle( normal, -stRotation, - quaternionScratch + quaternionScratch, ); const tangentRotation = Matrix3.fromQuaternion( rotation, - tangentRotationScratch + tangentRotationScratch, ); tangent = Cartesian3.normalize( Matrix3.multiplyByVector(tangentRotation, tangent, tangent), - tangent + tangent, ); if (vertexFormat.bitangent) { bitangent = Cartesian3.normalize( Cartesian3.cross(normal, tangent, bitangent), - bitangent + bitangent, ); } } @@ -141,7 +141,7 @@ function createGeometryFromPolygon( const p = Matrix3.multiplyByVector( textureMatrix, position, - scratchPosition + scratchPosition, ); const st = projectPointTo2D(p, stScratch); Cartesian2.subtract(st, stOrigin, st); @@ -259,7 +259,7 @@ function CoplanarPolygonGeometry(options) { this._polygonHierarchy = polygonHierarchy; this._stRotation = defaultValue(options.stRotation, 0.0); this._ellipsoid = Ellipsoid.clone( - defaultValue(options.ellipsoid, Ellipsoid.default) + defaultValue(options.ellipsoid, Ellipsoid.default), ); this._workerName = "createCoplanarPolygonGeometry"; this._textureCoordinates = textureCoordinates; @@ -271,14 +271,14 @@ function CoplanarPolygonGeometry(options) { this.packedLength = PolygonGeometryLibrary.computeHierarchyPackedLength( polygonHierarchy, - Cartesian3 + Cartesian3, ) + VertexFormat.packedLength + Ellipsoid.packedLength + (defined(textureCoordinates) ? PolygonGeometryLibrary.computeHierarchyPackedLength( textureCoordinates, - Cartesian2 + Cartesian2, ) : 1) + 2; @@ -350,7 +350,7 @@ CoplanarPolygonGeometry.pack = function (value, array, startingIndex) { value._polygonHierarchy, array, startingIndex, - Cartesian3 + Cartesian3, ); Ellipsoid.pack(value._ellipsoid, array, startingIndex); @@ -365,7 +365,7 @@ CoplanarPolygonGeometry.pack = function (value, array, startingIndex) { value._textureCoordinates, array, startingIndex, - Cartesian2 + Cartesian2, ); } else { array[startingIndex++] = -1.0; @@ -398,7 +398,7 @@ CoplanarPolygonGeometry.unpack = function (array, startingIndex, result) { const polygonHierarchy = PolygonGeometryLibrary.unpackPolygonHierarchy( array, startingIndex, - Cartesian3 + Cartesian3, ); startingIndex = polygonHierarchy.startingIndex; delete polygonHierarchy.startingIndex; @@ -409,7 +409,7 @@ CoplanarPolygonGeometry.unpack = function (array, startingIndex, result) { const vertexFormat = VertexFormat.unpack( array, startingIndex, - scratchVertexFormat + scratchVertexFormat, ); startingIndex += VertexFormat.packedLength; @@ -420,7 +420,7 @@ CoplanarPolygonGeometry.unpack = function (array, startingIndex, result) { : PolygonGeometryLibrary.unpackPolygonHierarchy( array, startingIndex, - Cartesian2 + Cartesian2, ); if (defined(textureCoordinates)) { startingIndex = textureCoordinates.startingIndex; @@ -461,7 +461,7 @@ CoplanarPolygonGeometry.createGeometry = function (polygonGeometry) { outerPositions = arrayRemoveDuplicates( outerPositions, Cartesian3.equalsEpsilon, - true + true, ); if (outerPositions.length < 3) { return; @@ -473,12 +473,13 @@ CoplanarPolygonGeometry.createGeometry = function (polygonGeometry) { let axis1 = axis1Scratch; const axis2 = axis2Scratch; - const validGeometry = CoplanarPolygonGeometryLibrary.computeProjectTo2DArguments( - outerPositions, - centerScratch, - axis1, - axis2 - ); + const validGeometry = + CoplanarPolygonGeometryLibrary.computeProjectTo2DArguments( + outerPositions, + centerScratch, + axis1, + axis2, + ); if (!validGeometry) { return undefined; } @@ -490,12 +491,12 @@ CoplanarPolygonGeometry.createGeometry = function (polygonGeometry) { !Cartesian3.equalsEpsilon( centerScratch, Cartesian3.ZERO, - CesiumMath.EPSILON6 + CesiumMath.EPSILON6, ) ) { const surfaceNormal = polygonGeometry._ellipsoid.geodeticSurfaceNormal( centerScratch, - surfaceNormalScratch + surfaceNormalScratch, ); if (Cartesian3.dot(normal, surfaceNormal) < 0) { normal = Cartesian3.negate(normal, normal); @@ -503,16 +504,18 @@ CoplanarPolygonGeometry.createGeometry = function (polygonGeometry) { } } - const projectPoints = CoplanarPolygonGeometryLibrary.createProjectPointsTo2DFunction( - centerScratch, - axis1, - axis2 - ); - const projectPoint = CoplanarPolygonGeometryLibrary.createProjectPointTo2DFunction( - centerScratch, - axis1, - axis2 - ); + const projectPoints = + CoplanarPolygonGeometryLibrary.createProjectPointsTo2DFunction( + centerScratch, + axis1, + axis2, + ); + const projectPoint = + CoplanarPolygonGeometryLibrary.createProjectPointTo2DFunction( + centerScratch, + axis1, + axis2, + ); if (vertexFormat.tangent) { tangent = Cartesian3.clone(axis1, tangent); @@ -525,7 +528,7 @@ CoplanarPolygonGeometry.createGeometry = function (polygonGeometry) { polygonHierarchy, hasTextureCoordinates, projectPoints, - false + false, ); const hierarchy = results.hierarchy; const polygons = results.polygons; @@ -539,7 +542,7 @@ CoplanarPolygonGeometry.createGeometry = function (polygonGeometry) { textureCoordinates, true, dummyFunction, - false + false, ).polygons : undefined; @@ -554,7 +557,7 @@ CoplanarPolygonGeometry.createGeometry = function (polygonGeometry) { projectPoint, outerPositions, stRotation, - scratchBR + scratchBR, ); const geometries = []; @@ -569,7 +572,7 @@ CoplanarPolygonGeometry.createGeometry = function (polygonGeometry) { projectPoint, normal, tangent, - bitangent + bitangent, ), }); @@ -578,11 +581,11 @@ CoplanarPolygonGeometry.createGeometry = function (polygonGeometry) { const geometry = GeometryPipeline.combineInstances(geometries)[0]; geometry.attributes.position.values = new Float64Array( - geometry.attributes.position.values + geometry.attributes.position.values, ); geometry.indices = IndexDatatype.createTypedArray( geometry.attributes.position.values.length / 3, - geometry.indices + geometry.indices, ); const attributes = geometry.attributes; diff --git a/packages/engine/Source/Core/CoplanarPolygonGeometryLibrary.js b/packages/engine/Source/Core/CoplanarPolygonGeometryLibrary.js index 8137fc757af9..7445eb60a38a 100644 --- a/packages/engine/Source/Core/CoplanarPolygonGeometryLibrary.js +++ b/packages/engine/Source/Core/CoplanarPolygonGeometryLibrary.js @@ -22,7 +22,7 @@ CoplanarPolygonGeometryLibrary.validOutline = function (positions) { const orientedBoundingBox = OrientedBoundingBox.fromPoints( positions, - obbScratch + obbScratch, ); const halfAxes = orientedBoundingBox.halfAxes; const xAxis = Matrix3.getColumn(halfAxes, 0, scratchXAxis); @@ -45,7 +45,7 @@ CoplanarPolygonGeometryLibrary.computeProjectTo2DArguments = function ( positions, centerResult, planeAxis1Result, - planeAxis2Result + planeAxis2Result, ) { //>>includeStart('debug', pragmas.debug); Check.defined("positions", positions); @@ -56,7 +56,7 @@ CoplanarPolygonGeometryLibrary.computeProjectTo2DArguments = function ( const orientedBoundingBox = OrientedBoundingBox.fromPoints( positions, - obbScratch + obbScratch, ); const halfAxes = orientedBoundingBox.halfAxes; const xAxis = Matrix3.getColumn(halfAxes, 0, scratchXAxis); @@ -108,7 +108,7 @@ function projectTo2D(position, center, axis1, axis2, result) { CoplanarPolygonGeometryLibrary.createProjectPointsTo2DFunction = function ( center, axis1, - axis2 + axis2, ) { return function (positions) { const positionResults = new Array(positions.length); @@ -123,7 +123,7 @@ CoplanarPolygonGeometryLibrary.createProjectPointsTo2DFunction = function ( CoplanarPolygonGeometryLibrary.createProjectPointTo2DFunction = function ( center, axis1, - axis2 + axis2, ) { return function (position, result) { return projectTo2D(position, center, axis1, axis2, result); diff --git a/packages/engine/Source/Core/CoplanarPolygonOutlineGeometry.js b/packages/engine/Source/Core/CoplanarPolygonOutlineGeometry.js index 0f9009676708..011799c84f8d 100644 --- a/packages/engine/Source/Core/CoplanarPolygonOutlineGeometry.js +++ b/packages/engine/Source/Core/CoplanarPolygonOutlineGeometry.js @@ -87,7 +87,7 @@ function CoplanarPolygonOutlineGeometry(options) { this.packedLength = PolygonGeometryLibrary.computeHierarchyPackedLength( polygonHierarchy, - Cartesian3 + Cartesian3, ) + 1; } @@ -134,7 +134,7 @@ CoplanarPolygonOutlineGeometry.pack = function (value, array, startingIndex) { value._polygonHierarchy, array, startingIndex, - Cartesian3 + Cartesian3, ); array[startingIndex] = value.packedLength; @@ -156,7 +156,7 @@ const scratchOptions = { CoplanarPolygonOutlineGeometry.unpack = function ( array, startingIndex, - result + result, ) { //>>includeStart('debug', pragmas.debug); Check.defined("array", array); @@ -167,7 +167,7 @@ CoplanarPolygonOutlineGeometry.unpack = function ( const polygonHierarchy = PolygonGeometryLibrary.unpackPolygonHierarchy( array, startingIndex, - Cartesian3 + Cartesian3, ); startingIndex = polygonHierarchy.startingIndex; delete polygonHierarchy.startingIndex; @@ -196,7 +196,7 @@ CoplanarPolygonOutlineGeometry.createGeometry = function (polygonGeometry) { outerPositions = arrayRemoveDuplicates( outerPositions, Cartesian3.equalsEpsilon, - true + true, ); if (outerPositions.length < 3) { return; @@ -208,7 +208,7 @@ CoplanarPolygonOutlineGeometry.createGeometry = function (polygonGeometry) { const polygons = PolygonGeometryLibrary.polygonOutlinesFromHierarchy( polygonHierarchy, - false + false, ); if (polygons.length === 0) { diff --git a/packages/engine/Source/Core/CorridorGeometry.js b/packages/engine/Source/Core/CorridorGeometry.js index 4e80a59f09e5..0b5ead6bfcc0 100644 --- a/packages/engine/Source/Core/CorridorGeometry.js +++ b/packages/engine/Source/Core/CorridorGeometry.js @@ -43,7 +43,7 @@ function addNormals(attr, normal, left, front, back, vertexFormat) { const bitangents = attr.bitangents; const forward = Cartesian3.normalize( Cartesian3.cross(left, normal, scratch1), - scratch1 + scratch1, ); if (vertexFormat.normal) { CorridorGeometryLibrary.addAttribute(normals, normal, front, back); @@ -133,19 +133,19 @@ function combine(computedPositions, vertexFormat, ellipsoid) { leftPos = Cartesian3.fromArray( firstEndPositions, (halfLength - 1 - i) * 3, - leftPos + leftPos, ); rightPos = Cartesian3.fromArray( firstEndPositions, (halfLength + i) * 3, - rightPos + rightPos, ); CorridorGeometryLibrary.addAttribute(finalPositions, rightPos, front); CorridorGeometryLibrary.addAttribute( finalPositions, leftPos, undefined, - back + back, ); addNormals(attr, normal, left, front, back, vertexFormat); @@ -179,15 +179,15 @@ function combine(computedPositions, vertexFormat, ellipsoid) { for (i = 0; i < length; i += 3) { rightNormal = ellipsoid.geodeticSurfaceNormal( Cartesian3.fromArray(rightEdge, i, scratch1), - scratch1 + scratch1, ); leftNormal = ellipsoid.geodeticSurfaceNormal( Cartesian3.fromArray(leftEdge, length - i, scratch2), - scratch2 + scratch2, ); normal = Cartesian3.normalize( Cartesian3.add(rightNormal, leftNormal, normal), - normal + normal, ); addNormals(attr, normal, left, front, back, vertexFormat); @@ -208,15 +208,15 @@ function combine(computedPositions, vertexFormat, ellipsoid) { rightNormal = ellipsoid.geodeticSurfaceNormal( Cartesian3.fromArray(rightEdge, length, scratch1), - scratch1 + scratch1, ); leftNormal = ellipsoid.geodeticSurfaceNormal( Cartesian3.fromArray(leftEdge, length, scratch2), - scratch2 + scratch2, ); normal = Cartesian3.normalize( Cartesian3.add(rightNormal, leftNormal, normal), - normal + normal, ); compIndex += 3; for (i = 0; i < corners.length; i++) { @@ -244,17 +244,17 @@ function combine(computedPositions, vertexFormat, ellipsoid) { finalPositions, outsidePoint, undefined, - back + back, ); previousPoint = Cartesian3.fromArray( finalPositions, (start - j - 1) * 3, - previousPoint + previousPoint, ); nextPoint = Cartesian3.fromArray(finalPositions, pivot * 3, nextPoint); left = Cartesian3.normalize( Cartesian3.subtract(previousPoint, nextPoint, left), - left + left, ); addNormals(attr, normal, left, undefined, back, vertexFormat); back -= 3; @@ -262,21 +262,21 @@ function combine(computedPositions, vertexFormat, ellipsoid) { outsidePoint = Cartesian3.fromArray( finalPositions, pivot * 3, - outsidePoint + outsidePoint, ); previousPoint = Cartesian3.subtract( Cartesian3.fromArray(finalPositions, start * 3, previousPoint), outsidePoint, - previousPoint + previousPoint, ); nextPoint = Cartesian3.subtract( Cartesian3.fromArray(finalPositions, (start - j) * 3, nextPoint), outsidePoint, - nextPoint + nextPoint, ); left = Cartesian3.normalize( Cartesian3.add(previousPoint, nextPoint, left), - left + left, ); addNormals(attr, normal, left, front, undefined, vertexFormat); front += 3; @@ -293,21 +293,21 @@ function combine(computedPositions, vertexFormat, ellipsoid) { CorridorGeometryLibrary.addAttribute( finalPositions, outsidePoint, - front + front, ); previousPoint = Cartesian3.fromArray( finalPositions, pivot * 3, - previousPoint + previousPoint, ); nextPoint = Cartesian3.fromArray( finalPositions, (start + j) * 3, - nextPoint + nextPoint, ); left = Cartesian3.normalize( Cartesian3.subtract(previousPoint, nextPoint, left), - left + left, ); addNormals(attr, normal, left, front, undefined, vertexFormat); front += 3; @@ -315,21 +315,21 @@ function combine(computedPositions, vertexFormat, ellipsoid) { outsidePoint = Cartesian3.fromArray( finalPositions, pivot * 3, - outsidePoint + outsidePoint, ); previousPoint = Cartesian3.subtract( Cartesian3.fromArray(finalPositions, (start + j) * 3, previousPoint), outsidePoint, - previousPoint + previousPoint, ); nextPoint = Cartesian3.subtract( Cartesian3.fromArray(finalPositions, start * 3, nextPoint), outsidePoint, - nextPoint + nextPoint, ); left = Cartesian3.normalize( Cartesian3.negate(Cartesian3.add(nextPoint, previousPoint, left), left), - left + left, ); addNormals(attr, normal, left, undefined, back, vertexFormat); back -= 3; @@ -347,15 +347,15 @@ function combine(computedPositions, vertexFormat, ellipsoid) { for (j = 0; j < leftEdge.length; j += 3) { rightNormal = ellipsoid.geodeticSurfaceNormal( Cartesian3.fromArray(rightEdge, j, scratch1), - scratch1 + scratch1, ); leftNormal = ellipsoid.geodeticSurfaceNormal( Cartesian3.fromArray(leftEdge, length - j, scratch2), - scratch2 + scratch2, ); normal = Cartesian3.normalize( Cartesian3.add(rightNormal, leftNormal, normal), - normal + normal, ); addNormals(attr, normal, left, front, back, vertexFormat); @@ -379,7 +379,7 @@ function combine(computedPositions, vertexFormat, ellipsoid) { normal = Cartesian3.fromArray( computedNormals, computedNormals.length - 3, - normal + normal, ); addNormals(attr, normal, left, front, back, vertexFormat); @@ -394,14 +394,14 @@ function combine(computedPositions, vertexFormat, ellipsoid) { leftPos = Cartesian3.fromArray( lastEndPositions, (endPositionLength - i - 1) * 3, - leftPos + leftPos, ); rightPos = Cartesian3.fromArray(lastEndPositions, i * 3, rightPos); CorridorGeometryLibrary.addAttribute( finalPositions, leftPos, undefined, - back + back, ); CorridorGeometryLibrary.addAttribute(finalPositions, rightPos, front); addNormals(attr, normal, left, front, back, vertexFormat); @@ -573,33 +573,33 @@ function extrudedAttributes(attributes, vertexFormat) { bottomPosition = Cartesian3.fromArray( positions, i + threeSize, - bottomPosition + bottomPosition, ); previousPosition = Cartesian3.fromArray( positions, (i + 3) % threeSize, - previousPosition + previousPosition, ); bottomPosition = Cartesian3.subtract( bottomPosition, topPosition, - bottomPosition + bottomPosition, ); previousPosition = Cartesian3.subtract( previousPosition, topPosition, - previousPosition + previousPosition, ); normal = Cartesian3.normalize( Cartesian3.cross(bottomPosition, previousPosition, normal), - normal + normal, ); if (vertexFormat.normal) { CorridorGeometryLibrary.addAttribute(normals, normal, attrIndexOffset); CorridorGeometryLibrary.addAttribute( normals, normal, - attrIndexOffset + 3 + attrIndexOffset + 3, ); CorridorGeometryLibrary.addAttribute(normals, normal, attrIndex); CorridorGeometryLibrary.addAttribute(normals, normal, attrIndex + 3); @@ -610,45 +610,45 @@ function extrudedAttributes(attributes, vertexFormat) { CorridorGeometryLibrary.addAttribute( bitangents, bitangent, - attrIndexOffset + attrIndexOffset, ); CorridorGeometryLibrary.addAttribute( bitangents, bitangent, - attrIndexOffset + 3 + attrIndexOffset + 3, ); CorridorGeometryLibrary.addAttribute( bitangents, bitangent, - attrIndex + attrIndex, ); CorridorGeometryLibrary.addAttribute( bitangents, bitangent, - attrIndex + 3 + attrIndex + 3, ); } if (vertexFormat.tangent) { tangent = Cartesian3.normalize( Cartesian3.cross(bitangent, normal, tangent), - tangent + tangent, ); CorridorGeometryLibrary.addAttribute( tangents, tangent, - attrIndexOffset + attrIndexOffset, ); CorridorGeometryLibrary.addAttribute( tangents, tangent, - attrIndexOffset + 3 + attrIndexOffset + 3, ); CorridorGeometryLibrary.addAttribute(tangents, tangent, attrIndex); CorridorGeometryLibrary.addAttribute( tangents, tangent, - attrIndex + 3 + attrIndex + 3, ); } } @@ -758,18 +758,18 @@ function computePositionsExtruded(params, vertexFormat) { positions = PolygonPipeline.scaleToGeodeticHeight( positions, height, - ellipsoid + ellipsoid, ); wallPositions = addWallPositions(positions, 0, wallPositions); extrudedPositions = PolygonPipeline.scaleToGeodeticHeight( extrudedPositions, extrudedHeight, - ellipsoid + ellipsoid, ); wallPositions = addWallPositions( extrudedPositions, length * 2, - wallPositions + wallPositions, ); newPositions.set(positions); newPositions.set(extrudedPositions, length); @@ -821,7 +821,7 @@ function computePositionsExtruded(params, vertexFormat) { const twoSize = size + size; const newIndices = IndexDatatype.createTypedArray( newPositions.length / 3, - iLength * 2 + twoSize * 3 + iLength * 2 + twoSize * 3, ); newIndices.set(indices); let index = iLength; @@ -867,20 +867,20 @@ function computeOffsetPoints( ellipsoid, halfWidth, min, - max + max, ) { // Compute direction of offset the point const direction = Cartesian3.subtract( position2, position1, - scratchCartesian1 + scratchCartesian1, ); Cartesian3.normalize(direction, direction); const normal = ellipsoid.geodeticSurfaceNormal(position1, scratchCartesian2); const offsetDirection = Cartesian3.cross( direction, normal, - scratchCartesian1 + scratchCartesian1, ); Cartesian3.multiplyByScalar(offsetDirection, halfWidth, offsetDirection); @@ -925,7 +925,7 @@ function computeRectangle(positions, ellipsoid, width, cornerType, result) { positions = scaleToSurface(positions, ellipsoid); const cleanPositions = arrayRemoveDuplicates( positions, - Cartesian3.equalsEpsilon + Cartesian3.equalsEpsilon, ); const length = cleanPositions.length; if (length < 2 || width <= 0) { @@ -947,31 +947,31 @@ function computeRectangle(positions, ellipsoid, width, cornerType, result) { Cartesian3.multiplyByScalar( scratchCartesianOffset, halfWidth, - scratchCartesianOffset + scratchCartesianOffset, ); Cartesian3.add(first, scratchCartesianOffset, scratchCartesianEnds); ellipsoid.cartesianToCartographic( scratchCartesianEnds, - scratchCartographic + scratchCartographic, ); lat = scratchCartographic.latitude; lon = scratchCartographic.longitude; scratchCartographicMin.latitude = Math.min( scratchCartographicMin.latitude, - lat + lat, ); scratchCartographicMin.longitude = Math.min( scratchCartographicMin.longitude, - lon + lon, ); scratchCartographicMax.latitude = Math.max( scratchCartographicMax.latitude, - lat + lat, ); scratchCartographicMax.longitude = Math.max( scratchCartographicMax.longitude, - lon + lon, ); } @@ -983,7 +983,7 @@ function computeRectangle(positions, ellipsoid, width, cornerType, result) { ellipsoid, halfWidth, scratchCartographicMin, - scratchCartographicMax + scratchCartographicMax, ); } @@ -994,7 +994,7 @@ function computeRectangle(positions, ellipsoid, width, cornerType, result) { Cartesian3.multiplyByScalar( scratchCartesianOffset, halfWidth, - scratchCartesianOffset + scratchCartesianOffset, ); Cartesian3.add(last, scratchCartesianOffset, scratchCartesianEnds); computeOffsetPoints( @@ -1003,32 +1003,32 @@ function computeRectangle(positions, ellipsoid, width, cornerType, result) { ellipsoid, halfWidth, scratchCartographicMin, - scratchCartographicMax + scratchCartographicMax, ); if (cornerType === CornerType.ROUNDED) { // Compute end cap ellipsoid.cartesianToCartographic( scratchCartesianEnds, - scratchCartographic + scratchCartographic, ); lat = scratchCartographic.latitude; lon = scratchCartographic.longitude; scratchCartographicMin.latitude = Math.min( scratchCartographicMin.latitude, - lat + lat, ); scratchCartographicMin.longitude = Math.min( scratchCartographicMin.longitude, - lon + lon, ); scratchCartographicMax.latitude = Math.max( scratchCartographicMax.latitude, - lat + lat, ); scratchCartographicMax.longitude = Math.max( scratchCartographicMax.longitude, - lon + lon, ); } @@ -1084,10 +1084,10 @@ function CorridorGeometry(options) { this._positions = positions; this._ellipsoid = Ellipsoid.clone( - defaultValue(options.ellipsoid, Ellipsoid.default) + defaultValue(options.ellipsoid, Ellipsoid.default), ); this._vertexFormat = VertexFormat.clone( - defaultValue(options.vertexFormat, VertexFormat.DEFAULT) + defaultValue(options.vertexFormat, VertexFormat.DEFAULT), ); this._width = width; this._height = Math.max(height, extrudedHeight); @@ -1095,7 +1095,7 @@ function CorridorGeometry(options) { this._cornerType = defaultValue(options.cornerType, CornerType.ROUNDED); this._granularity = defaultValue( options.granularity, - CesiumMath.RADIANS_PER_DEGREE + CesiumMath.RADIANS_PER_DEGREE, ); this._shadowVolume = defaultValue(options.shadowVolume, false); this._workerName = "createCorridorGeometry"; @@ -1199,7 +1199,7 @@ CorridorGeometry.unpack = function (array, startingIndex, result) { const vertexFormat = VertexFormat.unpack( array, startingIndex, - scratchVertexFormat + scratchVertexFormat, ); startingIndex += VertexFormat.packedLength; @@ -1282,7 +1282,7 @@ CorridorGeometry.createGeometry = function (corridorGeometry) { positions = scaleToSurface(positions, ellipsoid); const cleanPositions = arrayRemoveDuplicates( positions, - Cartesian3.equalsEpsilon + Cartesian3.equalsEpsilon, ); if (cleanPositions.length < 2 || width <= 0) { @@ -1295,7 +1295,7 @@ CorridorGeometry.createGeometry = function (corridorGeometry) { height, extrudedHeight, 0, - CesiumMath.EPSILON2 + CesiumMath.EPSILON2, ); const vertexFormat = corridorGeometry._vertexFormat; @@ -1320,7 +1320,7 @@ CorridorGeometry.createGeometry = function (corridorGeometry) { attr.attributes.position.values = PolygonPipeline.scaleToGeodeticHeight( attr.attributes.position.values, height, - ellipsoid + ellipsoid, ); if (defined(corridorGeometry._offsetAttribute)) { @@ -1341,7 +1341,7 @@ CorridorGeometry.createGeometry = function (corridorGeometry) { const boundingSphere = BoundingSphere.fromVertices( attributes.position.values, undefined, - 3 + 3, ); if (!vertexFormat.position) { attr.attributes.position.values = undefined; @@ -1362,7 +1362,7 @@ CorridorGeometry.createGeometry = function (corridorGeometry) { CorridorGeometry.createShadowVolume = function ( corridorGeometry, minHeightFunc, - maxHeightFunc + maxHeightFunc, ) { const granularity = corridorGeometry._granularity; const ellipsoid = corridorGeometry._ellipsoid; @@ -1394,7 +1394,7 @@ Object.defineProperties(CorridorGeometry.prototype, { this._positions, this._ellipsoid, this._width, - this._cornerType + this._cornerType, ); } return this._rectangle; diff --git a/packages/engine/Source/Core/CorridorGeometryLibrary.js b/packages/engine/Source/Core/CorridorGeometryLibrary.js index f564f6b85513..42bbc3031485 100644 --- a/packages/engine/Source/Core/CorridorGeometryLibrary.js +++ b/packages/engine/Source/Core/CorridorGeometryLibrary.js @@ -37,11 +37,11 @@ function computeRoundCorner( startPoint, endPoint, cornerType, - leftIsOutside + leftIsOutside, ) { const angle = Cartesian3.angleBetween( Cartesian3.subtract(startPoint, cornerPoint, scratch1), - Cartesian3.subtract(endPoint, cornerPoint, scratch2) + Cartesian3.subtract(endPoint, cornerPoint, scratch2), ); const granularity = cornerType === CornerType.BEVELED @@ -61,14 +61,14 @@ function computeRoundCorner( Quaternion.fromAxisAngle( Cartesian3.negate(cornerPoint, scratch1), angle / granularity, - quaterion + quaterion, ), - rotMatrix + rotMatrix, ); } else { m = Matrix3.fromQuaternion( Quaternion.fromAxisAngle(cornerPoint, angle / granularity, quaterion), - rotMatrix + rotMatrix, ); } @@ -93,7 +93,7 @@ function addEndCaps(calculatedPositions) { startPoint = Cartesian3.fromArray( calculatedPositions[1], leftEdge.length - 3, - startPoint + startPoint, ); endPoint = Cartesian3.fromArray(calculatedPositions[0], 0, endPoint); cornerPoint = Cartesian3.midpoint(startPoint, endPoint, cornerPoint); @@ -102,7 +102,7 @@ function addEndCaps(calculatedPositions) { startPoint, endPoint, CornerType.ROUNDED, - false + false, ); const length = calculatedPositions.length - 1; @@ -111,7 +111,7 @@ function addEndCaps(calculatedPositions) { startPoint = Cartesian3.fromArray( rightEdge, rightEdge.length - 3, - startPoint + startPoint, ); endPoint = Cartesian3.fromArray(leftEdge, 0, endPoint); cornerPoint = Cartesian3.midpoint(startPoint, endPoint, cornerPoint); @@ -120,7 +120,7 @@ function addEndCaps(calculatedPositions) { startPoint, endPoint, CornerType.ROUNDED, - false + false, ); return [firstEndCap, lastEndCap]; @@ -130,7 +130,7 @@ function computeMiteredCorner( position, leftCornerDirection, lastPoint, - leftIsOutside + leftIsOutside, ) { let cornerPoint = scratch1; if (leftIsOutside) { @@ -138,7 +138,7 @@ function computeMiteredCorner( } else { leftCornerDirection = Cartesian3.negate( leftCornerDirection, - leftCornerDirection + leftCornerDirection, ); cornerPoint = Cartesian3.add(position, leftCornerDirection, cornerPoint); } @@ -184,7 +184,7 @@ CorridorGeometryLibrary.addAttribute = function ( attribute, value, front, - back + back, ) { const x = value.x; const y = value.y; @@ -232,7 +232,7 @@ CorridorGeometryLibrary.computePositions = function (params) { forward = Cartesian3.normalize( Cartesian3.subtract(nextPosition, position, forward), - forward + forward, ); normal = ellipsoid.geodeticSurfaceNormal(position, normal); left = Cartesian3.normalize(Cartesian3.cross(normal, forward, left), left); @@ -254,17 +254,17 @@ CorridorGeometryLibrary.computePositions = function (params) { nextPosition = positions[i + 1]; forward = Cartesian3.normalize( Cartesian3.subtract(nextPosition, position, forward), - forward + forward, ); cornerDirection = Cartesian3.normalize( Cartesian3.add(forward, backward, cornerDirection), - cornerDirection + cornerDirection, ); const forwardProjection = Cartesian3.multiplyByScalar( normal, Cartesian3.dot(forward, normal), - scratchForwardProjection + scratchForwardProjection, ); Cartesian3.subtract(forward, forwardProjection, forwardProjection); Cartesian3.normalize(forwardProjection, forwardProjection); @@ -272,7 +272,7 @@ CorridorGeometryLibrary.computePositions = function (params) { const backwardProjection = Cartesian3.multiplyByScalar( normal, Cartesian3.dot(backward, normal), - scratchBackwardProjection + scratchBackwardProjection, ); Cartesian3.subtract(backward, backwardProjection, backwardProjection); Cartesian3.normalize(backwardProjection, backwardProjection); @@ -280,19 +280,19 @@ CorridorGeometryLibrary.computePositions = function (params) { const doCorner = !CesiumMath.equalsEpsilon( Math.abs(Cartesian3.dot(forwardProjection, backwardProjection)), 1.0, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); if (doCorner) { cornerDirection = Cartesian3.cross( cornerDirection, normal, - cornerDirection + cornerDirection, ); cornerDirection = Cartesian3.cross( normal, cornerDirection, - cornerDirection + cornerDirection, ); cornerDirection = Cartesian3.normalize(cornerDirection, cornerDirection); const scalar = @@ -300,31 +300,31 @@ CorridorGeometryLibrary.computePositions = function (params) { Math.max( 0.25, Cartesian3.magnitude( - Cartesian3.cross(cornerDirection, backward, scratch1) - ) + Cartesian3.cross(cornerDirection, backward, scratch1), + ), ); const leftIsOutside = PolylineVolumeGeometryLibrary.angleIsGreaterThanPi( forward, backward, position, - ellipsoid + ellipsoid, ); cornerDirection = Cartesian3.multiplyByScalar( cornerDirection, scalar, - cornerDirection + cornerDirection, ); if (leftIsOutside) { rightPos = Cartesian3.add(position, cornerDirection, rightPos); center = Cartesian3.add( rightPos, Cartesian3.multiplyByScalar(left, width, center), - center + center, ); leftPos = Cartesian3.add( rightPos, Cartesian3.multiplyByScalar(left, width * 2, leftPos), - leftPos + leftPos, ); scaleArray2[0] = Cartesian3.clone(previousPos, scaleArray2[0]); scaleArray2[1] = Cartesian3.clone(center, scaleArray2[1]); @@ -337,7 +337,7 @@ CorridorGeometryLibrary.computePositions = function (params) { subdividedPositions, left, width, - calculatedPositions + calculatedPositions, ); if (saveAttributes) { calculatedLefts.push(left.x, left.y, left.z); @@ -346,17 +346,17 @@ CorridorGeometryLibrary.computePositions = function (params) { startPoint = Cartesian3.clone(leftPos, startPoint); left = Cartesian3.normalize( Cartesian3.cross(normal, forward, left), - left + left, ); leftPos = Cartesian3.add( rightPos, Cartesian3.multiplyByScalar(left, width * 2, leftPos), - leftPos + leftPos, ); previousPos = Cartesian3.add( rightPos, Cartesian3.multiplyByScalar(left, width, previousPos), - previousPos + previousPos, ); if ( cornerType === CornerType.ROUNDED || @@ -368,7 +368,7 @@ CorridorGeometryLibrary.computePositions = function (params) { startPoint, leftPos, cornerType, - leftIsOutside + leftIsOutside, ), }); } else { @@ -377,7 +377,7 @@ CorridorGeometryLibrary.computePositions = function (params) { position, Cartesian3.negate(cornerDirection, cornerDirection), leftPos, - leftIsOutside + leftIsOutside, ), }); } @@ -387,17 +387,17 @@ CorridorGeometryLibrary.computePositions = function (params) { leftPos, Cartesian3.negate( Cartesian3.multiplyByScalar(left, width, center), - center + center, ), - center + center, ); rightPos = Cartesian3.add( leftPos, Cartesian3.negate( Cartesian3.multiplyByScalar(left, width * 2, rightPos), - rightPos + rightPos, ), - rightPos + rightPos, ); scaleArray2[0] = Cartesian3.clone(previousPos, scaleArray2[0]); scaleArray2[1] = Cartesian3.clone(center, scaleArray2[1]); @@ -410,7 +410,7 @@ CorridorGeometryLibrary.computePositions = function (params) { subdividedPositions, left, width, - calculatedPositions + calculatedPositions, ); if (saveAttributes) { calculatedLefts.push(left.x, left.y, left.z); @@ -419,23 +419,23 @@ CorridorGeometryLibrary.computePositions = function (params) { startPoint = Cartesian3.clone(rightPos, startPoint); left = Cartesian3.normalize( Cartesian3.cross(normal, forward, left), - left + left, ); rightPos = Cartesian3.add( leftPos, Cartesian3.negate( Cartesian3.multiplyByScalar(left, width * 2, rightPos), - rightPos + rightPos, ), - rightPos + rightPos, ); previousPos = Cartesian3.add( leftPos, Cartesian3.negate( Cartesian3.multiplyByScalar(left, width, previousPos), - previousPos + previousPos, ), - previousPos + previousPos, ); if ( cornerType === CornerType.ROUNDED || @@ -447,7 +447,7 @@ CorridorGeometryLibrary.computePositions = function (params) { startPoint, rightPos, cornerType, - leftIsOutside + leftIsOutside, ), }); } else { @@ -456,7 +456,7 @@ CorridorGeometryLibrary.computePositions = function (params) { position, cornerDirection, rightPos, - leftIsOutside + leftIsOutside, ), }); } @@ -478,7 +478,7 @@ CorridorGeometryLibrary.computePositions = function (params) { subdividedPositions, left, width, - calculatedPositions + calculatedPositions, ); if (saveAttributes) { calculatedLefts.push(left.x, left.y, left.z); diff --git a/packages/engine/Source/Core/CorridorOutlineGeometry.js b/packages/engine/Source/Core/CorridorOutlineGeometry.js index b786b07f6bc1..5718f107d2f0 100644 --- a/packages/engine/Source/Core/CorridorOutlineGeometry.js +++ b/packages/engine/Source/Core/CorridorOutlineGeometry.js @@ -94,19 +94,19 @@ function combine(computedPositions, cornerType) { leftPos = Cartesian3.fromArray( firstEndPositions, (halfLength - 1 - i) * 3, - leftPos + leftPos, ); rightPos = Cartesian3.fromArray( firstEndPositions, (halfLength + i) * 3, - rightPos + rightPos, ); CorridorGeometryLibrary.addAttribute(finalPositions, rightPos, front); CorridorGeometryLibrary.addAttribute( finalPositions, leftPos, undefined, - back + back, ); LL = front / 3; @@ -164,7 +164,7 @@ function combine(computedPositions, cornerType) { finalPositions, outsidePoint, undefined, - back + back, ); back -= 3; } @@ -184,7 +184,7 @@ function combine(computedPositions, cornerType) { CorridorGeometryLibrary.addAttribute( finalPositions, outsidePoint, - front + front, ); front += 3; } @@ -230,14 +230,14 @@ function combine(computedPositions, cornerType) { leftPos = Cartesian3.fromArray( lastEndPositions, (endPositionLength - i - 1) * 3, - leftPos + leftPos, ); rightPos = Cartesian3.fromArray(lastEndPositions, i * 3, rightPos); CorridorGeometryLibrary.addAttribute( finalPositions, leftPos, undefined, - back + back, ); CorridorGeometryLibrary.addAttribute(finalPositions, rightPos, front); @@ -292,12 +292,12 @@ function computePositionsExtruded(params) { positions = PolygonPipeline.scaleToGeodeticHeight( positions, height, - ellipsoid + ellipsoid, ); extrudedPositions = PolygonPipeline.scaleToGeodeticHeight( extrudedPositions, extrudedHeight, - ellipsoid + ellipsoid, ); newPositions.set(positions); newPositions.set(extrudedPositions, length); @@ -325,7 +325,7 @@ function computePositionsExtruded(params) { const iLength = indices.length; const newIndices = IndexDatatype.createTypedArray( newPositions.length / 3, - (iLength + wallIndices.length) * 2 + (iLength + wallIndices.length) * 2, ); newIndices.set(indices); let index = iLength; @@ -390,7 +390,7 @@ function CorridorOutlineGeometry(options) { this._positions = positions; this._ellipsoid = Ellipsoid.clone( - defaultValue(options.ellipsoid, Ellipsoid.default) + defaultValue(options.ellipsoid, Ellipsoid.default), ); this._width = width; this._height = Math.max(height, extrudedHeight); @@ -398,7 +398,7 @@ function CorridorOutlineGeometry(options) { this._cornerType = defaultValue(options.cornerType, CornerType.ROUNDED); this._granularity = defaultValue( options.granularity, - CesiumMath.RADIANS_PER_DEGREE + CesiumMath.RADIANS_PER_DEGREE, ); this._offsetAttribute = options.offsetAttribute; this._workerName = "createCorridorOutlineGeometry"; @@ -532,7 +532,7 @@ CorridorOutlineGeometry.createGeometry = function (corridorOutlineGeometry) { positions = scaleToSurface(positions, ellipsoid); const cleanPositions = arrayRemoveDuplicates( positions, - Cartesian3.equalsEpsilon + Cartesian3.equalsEpsilon, ); if (cleanPositions.length < 2 || width <= 0) { @@ -545,7 +545,7 @@ CorridorOutlineGeometry.createGeometry = function (corridorOutlineGeometry) { height, extrudedHeight, 0, - CesiumMath.EPSILON2 + CesiumMath.EPSILON2, ); const params = { @@ -568,7 +568,7 @@ CorridorOutlineGeometry.createGeometry = function (corridorOutlineGeometry) { attr.attributes.position.values = PolygonPipeline.scaleToGeodeticHeight( attr.attributes.position.values, height, - ellipsoid + ellipsoid, ); if (defined(corridorOutlineGeometry._offsetAttribute)) { @@ -590,7 +590,7 @@ CorridorOutlineGeometry.createGeometry = function (corridorOutlineGeometry) { const boundingSphere = BoundingSphere.fromVertices( attributes.position.values, undefined, - 3 + 3, ); return new Geometry({ diff --git a/packages/engine/Source/Core/CullingVolume.js b/packages/engine/Source/Core/CullingVolume.js index 080d4a0a7688..67b7724c27f0 100644 --- a/packages/engine/Source/Core/CullingVolume.js +++ b/packages/engine/Source/Core/CullingVolume.js @@ -91,7 +91,7 @@ CullingVolume.fromBoundingSphere = function (boundingSphere, result) { plane1.z = -faceNormal.z; plane1.w = -Cartesian3.dot( Cartesian3.negate(faceNormal, scratchPlaneNormal), - scratchPlaneCenter + scratchPlaneCenter, ); planeIndex += 2; @@ -117,7 +117,7 @@ CullingVolume.prototype.computeVisibility = function (boundingVolume) { let intersecting = false; for (let k = 0, len = planes.length; k < len; ++k) { const result = boundingVolume.intersectPlane( - Plane.fromCartesian4(planes[k], scratchPlane) + Plane.fromCartesian4(planes[k], scratchPlane), ); if (result === Intersect.OUTSIDE) { return Intersect.OUTSIDE; @@ -143,7 +143,7 @@ CullingVolume.prototype.computeVisibility = function (boundingVolume) { */ CullingVolume.prototype.computeVisibilityWithPlaneMask = function ( boundingVolume, - parentPlaneMask + parentPlaneMask, ) { //>>includeStart('debug', pragmas.debug); if (!defined(boundingVolume)) { @@ -176,7 +176,7 @@ CullingVolume.prototype.computeVisibilityWithPlaneMask = function ( } const result = boundingVolume.intersectPlane( - Plane.fromCartesian4(planes[k], scratchPlane) + Plane.fromCartesian4(planes[k], scratchPlane), ); if (result === Intersect.OUTSIDE) { return CullingVolume.MASK_OUTSIDE; diff --git a/packages/engine/Source/Core/CustomHeightmapTerrainProvider.js b/packages/engine/Source/Core/CustomHeightmapTerrainProvider.js index 0df50356e674..eeefc818e31a 100644 --- a/packages/engine/Source/Core/CustomHeightmapTerrainProvider.js +++ b/packages/engine/Source/Core/CustomHeightmapTerrainProvider.js @@ -75,11 +75,12 @@ function CustomHeightmapTerrainProvider(options) { this._height = options.height; const maxTileDimensions = Math.max(this._width, this._height); - this._levelZeroMaximumGeometricError = TerrainProvider.getEstimatedLevelZeroGeometricErrorForAHeightmap( - this._tilingScheme.ellipsoid, - maxTileDimensions, - this._tilingScheme.getNumberOfXTilesAtLevel(0) - ); + this._levelZeroMaximumGeometricError = + TerrainProvider.getEstimatedLevelZeroGeometricErrorForAHeightmap( + this._tilingScheme.ellipsoid, + maxTileDimensions, + this._tilingScheme.getNumberOfXTilesAtLevel(0), + ); this._errorEvent = new Event(); @@ -216,7 +217,7 @@ CustomHeightmapTerrainProvider.prototype.requestTileGeometry = function ( x, y, level, - request + request, ) { const promise = this._callback(x, y, level); if (!defined(promise)) { @@ -247,11 +248,10 @@ CustomHeightmapTerrainProvider.prototype.requestTileGeometry = function ( * @param {number} level The tile level for which to get the maximum geometric error. * @returns {number} The maximum geometric error. */ -CustomHeightmapTerrainProvider.prototype.getLevelMaximumGeometricError = function ( - level -) { - return this._levelZeroMaximumGeometricError / (1 << level); -}; +CustomHeightmapTerrainProvider.prototype.getLevelMaximumGeometricError = + function (level) { + return this._levelZeroMaximumGeometricError / (1 << level); + }; /** * Determines whether data for a tile is available to be loaded. @@ -264,7 +264,7 @@ CustomHeightmapTerrainProvider.prototype.getLevelMaximumGeometricError = functio CustomHeightmapTerrainProvider.prototype.getTileDataAvailable = function ( x, y, - level + level, ) { return undefined; }; @@ -280,7 +280,7 @@ CustomHeightmapTerrainProvider.prototype.getTileDataAvailable = function ( CustomHeightmapTerrainProvider.prototype.loadTileDataAvailability = function ( x, y, - level + level, ) { return undefined; }; diff --git a/packages/engine/Source/Core/CylinderGeometry.js b/packages/engine/Source/Core/CylinderGeometry.js index a2b620c57a72..2733c91d36a2 100644 --- a/packages/engine/Source/Core/CylinderGeometry.js +++ b/packages/engine/Source/Core/CylinderGeometry.js @@ -68,7 +68,7 @@ function CylinderGeometry(options) { } if (slices < 3) { throw new DeveloperError( - "options.slices must be greater than or equal to 3." + "options.slices must be greater than or equal to 3.", ); } if ( @@ -76,7 +76,7 @@ function CylinderGeometry(options) { options.offsetAttribute === GeometryOffsetAttribute.TOP ) { throw new DeveloperError( - "GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry." + "GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.", ); } //>>includeEnd('debug'); @@ -159,7 +159,7 @@ CylinderGeometry.unpack = function (array, startingIndex, result) { const vertexFormat = VertexFormat.unpack( array, startingIndex, - scratchVertexFormat + scratchVertexFormat, ); startingIndex += VertexFormat.packedLength; @@ -221,7 +221,7 @@ CylinderGeometry.createGeometry = function (cylinderGeometry) { topRadius, bottomRadius, slices, - true + true, ); const st = vertexFormat.st ? new Float32Array(numVertices * 2) : undefined; @@ -264,7 +264,7 @@ CylinderGeometry.createGeometry = function (cylinderGeometry) { if (computeTangent) { tangent = Cartesian3.normalize( Cartesian3.cross(Cartesian3.UNIT_Z, normal, tangent), - tangent + tangent, ); } @@ -289,7 +289,7 @@ CylinderGeometry.createGeometry = function (cylinderGeometry) { if (vertexFormat.bitangent) { bitangent = Cartesian3.normalize( Cartesian3.cross(normal, tangent, bitangent), - bitangent + bitangent, ); bitangents[bitangentIndex++] = bitangent.x; bitangents[bitangentIndex++] = bitangent.y; @@ -429,7 +429,7 @@ CylinderGeometry.createGeometry = function (cylinderGeometry) { const boundingSphere = new BoundingSphere( Cartesian3.ZERO, - Cartesian2.magnitude(radiusScratch) + Cartesian2.magnitude(radiusScratch), ); if (defined(cylinderGeometry._offsetAttribute)) { @@ -471,7 +471,7 @@ CylinderGeometry.getUnitCylinder = function () { bottomRadius: 1.0, length: 1.0, vertexFormat: VertexFormat.POSITION_ONLY, - }) + }), ); } return unitCylinderGeometry; diff --git a/packages/engine/Source/Core/CylinderGeometryLibrary.js b/packages/engine/Source/Core/CylinderGeometryLibrary.js index c6784a518572..f29beccd698f 100644 --- a/packages/engine/Source/Core/CylinderGeometryLibrary.js +++ b/packages/engine/Source/Core/CylinderGeometryLibrary.js @@ -13,7 +13,7 @@ CylinderGeometryLibrary.computePositions = function ( topRadius, bottomRadius, slices, - fill + fill, ) { const topZ = length * 0.5; const bottomZ = -topZ; diff --git a/packages/engine/Source/Core/CylinderOutlineGeometry.js b/packages/engine/Source/Core/CylinderOutlineGeometry.js index bd587dcb4084..45e7e57fa094 100644 --- a/packages/engine/Source/Core/CylinderOutlineGeometry.js +++ b/packages/engine/Source/Core/CylinderOutlineGeometry.js @@ -55,7 +55,7 @@ function CylinderOutlineGeometry(options) { const slices = defaultValue(options.slices, 128); const numberOfVerticalLines = Math.max( defaultValue(options.numberOfVerticalLines, 16), - 0 + 0, ); //>>includeStart('debug', pragmas.debug); @@ -68,7 +68,7 @@ function CylinderOutlineGeometry(options) { options.offsetAttribute === GeometryOffsetAttribute.TOP ) { throw new DeveloperError( - "GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry." + "GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.", ); } //>>includeEnd('debug'); @@ -197,7 +197,7 @@ CylinderOutlineGeometry.createGeometry = function (cylinderGeometry) { topRadius, bottomRadius, slices, - false + false, ); let numIndices = slices * 2; let numSide; @@ -241,7 +241,7 @@ CylinderOutlineGeometry.createGeometry = function (cylinderGeometry) { const boundingSphere = new BoundingSphere( Cartesian3.ZERO, - Cartesian2.magnitude(radiusScratch) + Cartesian2.magnitude(radiusScratch), ); if (defined(cylinderGeometry._offsetAttribute)) { diff --git a/packages/engine/Source/Core/DeveloperError.js b/packages/engine/Source/Core/DeveloperError.js index a330471eef23..9094cdc3e5a8 100644 --- a/packages/engine/Source/Core/DeveloperError.js +++ b/packages/engine/Source/Core/DeveloperError.js @@ -69,7 +69,7 @@ DeveloperError.prototype.toString = function () { */ DeveloperError.throwInstantiationError = function () { throw new DeveloperError( - "This function defines an interface and should not be called directly." + "This function defines an interface and should not be called directly.", ); }; export default DeveloperError; diff --git a/packages/engine/Source/Core/DistanceDisplayConditionGeometryInstanceAttribute.js b/packages/engine/Source/Core/DistanceDisplayConditionGeometryInstanceAttribute.js index 6bf81bd70db0..d999a65cfdff 100644 --- a/packages/engine/Source/Core/DistanceDisplayConditionGeometryInstanceAttribute.js +++ b/packages/engine/Source/Core/DistanceDisplayConditionGeometryInstanceAttribute.js @@ -39,7 +39,7 @@ function DistanceDisplayConditionGeometryInstanceAttribute(near, far) { //>>includeStart('debug', pragmas.debug); if (far <= near) { throw new DeveloperError( - "far distance must be greater than near distance." + "far distance must be greater than near distance.", ); } //>>includeEnd('debug'); @@ -107,7 +107,7 @@ Object.defineProperties( return false; }, }, - } + }, ); /** @@ -127,25 +127,24 @@ Object.defineProperties( * } * }); */ -DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition = function ( - distanceDisplayCondition -) { - //>>includeStart('debug', pragmas.debug); - if (!defined(distanceDisplayCondition)) { - throw new DeveloperError("distanceDisplayCondition is required."); - } - if (distanceDisplayCondition.far <= distanceDisplayCondition.near) { - throw new DeveloperError( - "distanceDisplayCondition.far distance must be greater than distanceDisplayCondition.near distance." - ); - } - //>>includeEnd('debug'); +DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition = + function (distanceDisplayCondition) { + //>>includeStart('debug', pragmas.debug); + if (!defined(distanceDisplayCondition)) { + throw new DeveloperError("distanceDisplayCondition is required."); + } + if (distanceDisplayCondition.far <= distanceDisplayCondition.near) { + throw new DeveloperError( + "distanceDisplayCondition.far distance must be greater than distanceDisplayCondition.near distance.", + ); + } + //>>includeEnd('debug'); - return new DistanceDisplayConditionGeometryInstanceAttribute( - distanceDisplayCondition.near, - distanceDisplayCondition.far - ); -}; + return new DistanceDisplayConditionGeometryInstanceAttribute( + distanceDisplayCondition.near, + distanceDisplayCondition.far, + ); + }; /** * Converts a distance display condition to a typed array that can be used to assign a distance display condition attribute. @@ -160,7 +159,7 @@ DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition = */ DistanceDisplayConditionGeometryInstanceAttribute.toValue = function ( distanceDisplayCondition, - result + result, ) { //>>includeStart('debug', pragmas.debug); if (!defined(distanceDisplayCondition)) { diff --git a/packages/engine/Source/Core/DoubleEndedPriorityQueue.js b/packages/engine/Source/Core/DoubleEndedPriorityQueue.js index e0abcf5f6e0f..d87eb287c582 100644 --- a/packages/engine/Source/Core/DoubleEndedPriorityQueue.js +++ b/packages/engine/Source/Core/DoubleEndedPriorityQueue.js @@ -22,7 +22,7 @@ function DoubleEndedPriorityQueue(options) { Check.typeOf.number.greaterThanOrEquals( "options.maximumLength", options.maximumLength, - 0 + 0, ); } //>>includeEnd('debug'); @@ -370,7 +370,7 @@ function pushDown(that, index) { const grandChildStart = 2 * leftChildIndex + 1; const grandChildCount = Math.max( Math.min(length - grandChildStart, 4), - 0 + 0, ); for (let i = 0; i < grandChildCount; i++) { const grandChildIndex = grandChildStart + i; diff --git a/packages/engine/Source/Core/EarthOrientationParameters.js b/packages/engine/Source/Core/EarthOrientationParameters.js index 514d9284a584..76a34e141422 100644 --- a/packages/engine/Source/Core/EarthOrientationParameters.js +++ b/packages/engine/Source/Core/EarthOrientationParameters.js @@ -117,7 +117,7 @@ EarthOrientationParameters.fromUrl = async function (url, options) { eopData = await resource.fetchJson(); } catch (e) { throw new RuntimeError( - `An error occurred while retrieving the EOP data from the URL ${resource.url}.` + `An error occurred while retrieving the EOP data from the URL ${resource.url}.`, ); } @@ -189,7 +189,7 @@ EarthOrientationParameters.prototype.compute = function (date, result) { const nextIndexDate = dates[lastIndex + 1]; const isAfterPrevious = JulianDate.lessThanOrEquals( previousIndexDate, - date + date, ); const isAfterLastSample = !defined(nextIndexDate); const isBeforeNext = @@ -241,35 +241,31 @@ function compareLeapSecondDates(leapSecond, dateToFind) { function onDataReady(eop, eopData) { if (!defined(eopData.columnNames)) { throw new RuntimeError( - "Error in loaded EOP data: The columnNames property is required." + "Error in loaded EOP data: The columnNames property is required.", ); } if (!defined(eopData.samples)) { throw new RuntimeError( - "Error in loaded EOP data: The samples property is required." + "Error in loaded EOP data: The samples property is required.", ); } const dateColumn = eopData.columnNames.indexOf("modifiedJulianDateUtc"); - const xPoleWanderRadiansColumn = eopData.columnNames.indexOf( - "xPoleWanderRadians" - ); - const yPoleWanderRadiansColumn = eopData.columnNames.indexOf( - "yPoleWanderRadians" - ); - const ut1MinusUtcSecondsColumn = eopData.columnNames.indexOf( - "ut1MinusUtcSeconds" - ); + const xPoleWanderRadiansColumn = + eopData.columnNames.indexOf("xPoleWanderRadians"); + const yPoleWanderRadiansColumn = + eopData.columnNames.indexOf("yPoleWanderRadians"); + const ut1MinusUtcSecondsColumn = + eopData.columnNames.indexOf("ut1MinusUtcSeconds"); const xCelestialPoleOffsetRadiansColumn = eopData.columnNames.indexOf( - "xCelestialPoleOffsetRadians" + "xCelestialPoleOffsetRadians", ); const yCelestialPoleOffsetRadiansColumn = eopData.columnNames.indexOf( - "yCelestialPoleOffsetRadians" - ); - const taiMinusUtcSecondsColumn = eopData.columnNames.indexOf( - "taiMinusUtcSeconds" + "yCelestialPoleOffsetRadians", ); + const taiMinusUtcSecondsColumn = + eopData.columnNames.indexOf("taiMinusUtcSeconds"); if ( dateColumn < 0 || @@ -281,7 +277,7 @@ function onDataReady(eop, eopData) { taiMinusUtcSecondsColumn < 0 ) { throw new RuntimeError( - "Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns" + "Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns", ); } @@ -319,7 +315,7 @@ function onDataReady(eop, eopData) { const leapSecondIndex = binarySearch( leapSeconds, date, - compareLeapSecondDates + compareLeapSecondDates, ); if (leapSecondIndex < 0) { const leapSecond = new LeapSecond(date, taiMinusUtc); @@ -407,27 +403,27 @@ function interpolate(eop, dates, samples, date, before, after, result) { result.xPoleWander = linearInterp( factor, samples[startBefore + eop._xPoleWanderRadiansColumn], - samples[startAfter + eop._xPoleWanderRadiansColumn] + samples[startAfter + eop._xPoleWanderRadiansColumn], ); result.yPoleWander = linearInterp( factor, samples[startBefore + eop._yPoleWanderRadiansColumn], - samples[startAfter + eop._yPoleWanderRadiansColumn] + samples[startAfter + eop._yPoleWanderRadiansColumn], ); result.xPoleOffset = linearInterp( factor, samples[startBefore + eop._xCelestialPoleOffsetRadiansColumn], - samples[startAfter + eop._xCelestialPoleOffsetRadiansColumn] + samples[startAfter + eop._xCelestialPoleOffsetRadiansColumn], ); result.yPoleOffset = linearInterp( factor, samples[startBefore + eop._yCelestialPoleOffsetRadiansColumn], - samples[startAfter + eop._yCelestialPoleOffsetRadiansColumn] + samples[startAfter + eop._yCelestialPoleOffsetRadiansColumn], ); result.ut1MinusUtc = linearInterp( factor, beforeUt1MinusUtc, - afterUt1MinusUtc + afterUt1MinusUtc, ); return result; } diff --git a/packages/engine/Source/Core/EarthOrientationParametersSample.js b/packages/engine/Source/Core/EarthOrientationParametersSample.js index 336e564da4b8..9ff066aa6c0f 100644 --- a/packages/engine/Source/Core/EarthOrientationParametersSample.js +++ b/packages/engine/Source/Core/EarthOrientationParametersSample.js @@ -17,7 +17,7 @@ function EarthOrientationParametersSample( yPoleWander, xPoleOffset, yPoleOffset, - ut1MinusUtc + ut1MinusUtc, ) { /** * The pole wander about the X axis, in radians. diff --git a/packages/engine/Source/Core/EllipseGeometry.js b/packages/engine/Source/Core/EllipseGeometry.js index 0a225fdca1fc..1815080ded86 100644 --- a/packages/engine/Source/Core/EllipseGeometry.js +++ b/packages/engine/Source/Core/EllipseGeometry.js @@ -77,12 +77,12 @@ function computeTopBottomAttributes(positions, options, extrude) { const projection = new GeographicProjection(ellipsoid); const projectedCenter = projection.project( ellipsoid.cartesianToCartographic(center, scratchCartographic), - projectedCenterScratch + projectedCenterScratch, ); const geodeticNormal = ellipsoid.scaleToGeodeticSurface( center, - scratchCartesian1 + scratchCartesian1, ); ellipsoid.geodeticSurfaceNormal(geodeticNormal, geodeticNormal); @@ -92,14 +92,14 @@ function computeTopBottomAttributes(positions, options, extrude) { let rotation = Quaternion.fromAxisAngle( geodeticNormal, stRotation, - quaternionScratch + quaternionScratch, ); textureMatrix = Matrix3.fromQuaternion(rotation, textureMatrix); rotation = Quaternion.fromAxisAngle( geodeticNormal, -stRotation, - quaternionScratch + quaternionScratch, ); tangentMatrix = Matrix3.fromQuaternion(rotation, tangentMatrix); } else { @@ -110,12 +110,12 @@ function computeTopBottomAttributes(positions, options, extrude) { const minTexCoord = Cartesian2.fromElements( Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY, - scratchMinTexCoord + scratchMinTexCoord, ); const maxTexCoord = Cartesian2.fromElements( Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY, - scratchMaxTexCoord + scratchMaxTexCoord, ); let length = positions.length; @@ -130,11 +130,11 @@ function computeTopBottomAttributes(positions, options, extrude) { const rotatedPoint = Matrix3.multiplyByVector( textureMatrix, position, - scratchCartesian2 + scratchCartesian2, ); const projectedPoint = projection.project( ellipsoid.cartesianToCartographic(rotatedPoint, scratchCartographic), - scratchCartesian3 + scratchCartesian3, ); Cartesian3.subtract(projectedPoint, projectedCenter, projectedPoint); @@ -180,7 +180,7 @@ function computeTopBottomAttributes(positions, options, extrude) { if (vertexFormat.tangent || vertexFormat.bitangent) { tangent = Cartesian3.normalize( Cartesian3.cross(Cartesian3.UNIT_Z, normal, tangent), - tangent + tangent, ); Matrix3.multiplyByVector(tangentMatrix, tangent, tangent); } @@ -209,7 +209,7 @@ function computeTopBottomAttributes(positions, options, extrude) { if (vertexFormat.bitangent) { bitangent = Cartesian3.normalize( Cartesian3.cross(normal, tangent, bitangent), - bitangent + bitangent, ); bitangents[i] = bitangent.x; bitangents[i1] = bitangent.y; @@ -242,7 +242,7 @@ function computeTopBottomAttributes(positions, options, extrude) { const finalPositions = EllipseGeometryLibrary.raisePositionsToHeight( positions, options, - extrude + extrude, ); attributes.position = new GeometryAttribute({ componentDatatype: ComponentDatatype.DOUBLE, @@ -419,21 +419,21 @@ function computeEllipse(options) { boundingSphereCenter = Cartesian3.multiplyByScalar( options.ellipsoid.geodeticSurfaceNormal(center, boundingSphereCenter), options.height, - boundingSphereCenter + boundingSphereCenter, ); boundingSphereCenter = Cartesian3.add( center, boundingSphereCenter, - boundingSphereCenter + boundingSphereCenter, ); const boundingSphere = new BoundingSphere( boundingSphereCenter, - options.semiMajorAxis + options.semiMajorAxis, ); const cep = EllipseGeometryLibrary.computeEllipsePositions( options, true, - false + false, ); const positions = cep.positions; const numPts = cep.numPts; @@ -484,30 +484,30 @@ function computeWallAttributes(positions, options) { const projection = new GeographicProjection(ellipsoid); const projectedCenter = projection.project( ellipsoid.cartesianToCartographic(center, scratchCartographic), - projectedCenterScratch + projectedCenterScratch, ); const geodeticNormal = ellipsoid.scaleToGeodeticSurface( center, - scratchCartesian1 + scratchCartesian1, ); ellipsoid.geodeticSurfaceNormal(geodeticNormal, geodeticNormal); const rotation = Quaternion.fromAxisAngle( geodeticNormal, stRotation, - quaternionScratch + quaternionScratch, ); const textureMatrix = Matrix3.fromQuaternion(rotation, textureMatrixScratch); const minTexCoord = Cartesian2.fromElements( Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY, - scratchMinTexCoord + scratchMinTexCoord, ); const maxTexCoord = Cartesian2.fromElements( Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY, - scratchMaxTexCoord + scratchMaxTexCoord, ); let length = positions.length; @@ -522,11 +522,11 @@ function computeWallAttributes(positions, options) { const rotatedPoint = Matrix3.multiplyByVector( textureMatrix, position, - scratchCartesian2 + scratchCartesian2, ); const projectedPoint = projection.project( ellipsoid.cartesianToCartographic(rotatedPoint, scratchCartographic), - scratchCartesian3 + scratchCartesian3, ); Cartesian3.subtract(projectedPoint, projectedCenter, projectedPoint); @@ -560,18 +560,18 @@ function computeWallAttributes(positions, options) { let scaledNormal = Cartesian3.multiplyByScalar( normal, height, - scratchCartesian4 + scratchCartesian4, ); position = Cartesian3.add(position, scaledNormal, position); scaledNormal = Cartesian3.multiplyByScalar( normal, extrudedHeight, - scaledNormal + scaledNormal, ); extrudedPosition = Cartesian3.add( extrudedPosition, scaledNormal, - extrudedPosition + extrudedPosition, ); if (vertexFormat.position) { @@ -589,18 +589,18 @@ function computeWallAttributes(positions, options) { const next = Cartesian3.fromArray( positions, (i + 3) % length, - scratchCartesian4 + scratchCartesian4, ); Cartesian3.subtract(next, position, next); const bottom = Cartesian3.subtract( extrudedPosition, position, - scratchCartesian3 + scratchCartesian3, ); normal = Cartesian3.normalize( Cartesian3.cross(bottom, next, normal), - normal + normal, ); if (vertexFormat.normal) { @@ -616,7 +616,7 @@ function computeWallAttributes(positions, options) { if (vertexFormat.tangent) { tangent = Cartesian3.normalize( Cartesian3.cross(bitangent, normal, tangent), - tangent + tangent, ); tangents[i] = tangent.x; tangents[i1] = tangent.y; @@ -750,43 +750,43 @@ function computeExtrudedEllipse(options) { let scaledNormal = Cartesian3.multiplyByScalar( ellipsoid.geodeticSurfaceNormal(center, scratchCartesian1), options.height, - scratchCartesian1 + scratchCartesian1, ); topBoundingSphere.center = Cartesian3.add( center, scaledNormal, - topBoundingSphere.center + topBoundingSphere.center, ); topBoundingSphere.radius = semiMajorAxis; scaledNormal = Cartesian3.multiplyByScalar( ellipsoid.geodeticSurfaceNormal(center, scaledNormal), options.extrudedHeight, - scaledNormal + scaledNormal, ); bottomBoundingSphere.center = Cartesian3.add( center, scaledNormal, - bottomBoundingSphere.center + bottomBoundingSphere.center, ); bottomBoundingSphere.radius = semiMajorAxis; const cep = EllipseGeometryLibrary.computeEllipsePositions( options, true, - true + true, ); const positions = cep.positions; const numPts = cep.numPts; const outerPositions = cep.outerPositions; const boundingSphere = BoundingSphere.union( topBoundingSphere, - bottomBoundingSphere + bottomBoundingSphere, ); const topBottomAttributes = computeTopBottomAttributes( positions, options, - true + true, ); let indices = topIndices(numPts); const length = indices.length; @@ -800,7 +800,7 @@ function computeExtrudedEllipse(options) { const topBottomIndices = IndexDatatype.createTypedArray( (posLength * 2) / 3, - indices + indices, ); const topBottomGeo = new Geometry({ @@ -813,7 +813,7 @@ function computeExtrudedEllipse(options) { indices = computeWallIndices(outerPositions); const wallIndices = IndexDatatype.createTypedArray( (outerPositions.length * 2) / 3, - indices + indices, ); const wallGeo = new Geometry({ @@ -845,7 +845,7 @@ function computeRectangle( rotation, granularity, ellipsoid, - result + result, ) { const cep = EllipseGeometryLibrary.computeEllipsePositions( { @@ -856,7 +856,7 @@ function computeRectangle( granularity: granularity, }, false, - true + true, ); const positionsFlat = cep.outerPositions; const positionsCount = positionsFlat.length / 3; @@ -926,7 +926,7 @@ function EllipseGeometry(options) { const semiMinorAxis = options.semiMinorAxis; const granularity = defaultValue( options.granularity, - CesiumMath.RADIANS_PER_DEGREE + CesiumMath.RADIANS_PER_DEGREE, ); const vertexFormat = defaultValue(options.vertexFormat, VertexFormat.DEFAULT); @@ -936,7 +936,7 @@ function EllipseGeometry(options) { Check.typeOf.number("options.semiMinorAxis", semiMinorAxis); if (semiMajorAxis < semiMinorAxis) { throw new DeveloperError( - "semiMajorAxis must be greater than or equal to the semiMinorAxis." + "semiMajorAxis must be greater than or equal to the semiMinorAxis.", ); } if (granularity <= 0.0) { @@ -1056,7 +1056,7 @@ EllipseGeometry.unpack = function (array, startingIndex, result) { const vertexFormat = VertexFormat.unpack( array, startingIndex, - scratchVertexFormat + scratchVertexFormat, ); startingIndex += VertexFormat.packedLength; @@ -1125,7 +1125,7 @@ EllipseGeometry.computeRectangle = function (options, result) { const semiMinorAxis = options.semiMinorAxis; const granularity = defaultValue( options.granularity, - CesiumMath.RADIANS_PER_DEGREE + CesiumMath.RADIANS_PER_DEGREE, ); const rotation = defaultValue(options.rotation, 0.0); @@ -1135,7 +1135,7 @@ EllipseGeometry.computeRectangle = function (options, result) { Check.typeOf.number("options.semiMinorAxis", semiMinorAxis); if (semiMajorAxis < semiMinorAxis) { throw new DeveloperError( - "semiMajorAxis must be greater than or equal to the semiMinorAxis." + "semiMajorAxis must be greater than or equal to the semiMinorAxis.", ); } if (granularity <= 0.0) { @@ -1150,7 +1150,7 @@ EllipseGeometry.computeRectangle = function (options, result) { rotation, granularity, ellipsoid, - result + result, ); }; @@ -1174,12 +1174,12 @@ EllipseGeometry.createGeometry = function (ellipseGeometry) { height, extrudedHeight, 0, - CesiumMath.EPSILON2 + CesiumMath.EPSILON2, ); ellipseGeometry._center = ellipseGeometry._ellipsoid.scaleToGeodeticSurface( ellipseGeometry._center, - ellipseGeometry._center + ellipseGeometry._center, ); const options = { center: ellipseGeometry._center, @@ -1231,7 +1231,7 @@ EllipseGeometry.createGeometry = function (ellipseGeometry) { EllipseGeometry.createShadowVolume = function ( ellipseGeometry, minHeightFunc, - maxHeightFunc + maxHeightFunc, ) { const granularity = ellipseGeometry._granularity; const ellipsoid = ellipseGeometry._ellipsoid; @@ -1269,7 +1269,7 @@ function textureCoordinateRotationPoints(ellipseGeometry) { granularity: ellipseGeometry._granularity, }, false, - true + true, ); const positionsFlat = cep.outerPositions; const positionsCount = positionsFlat.length / 3; @@ -1284,7 +1284,7 @@ function textureCoordinateRotationPoints(ellipseGeometry) { positions, stRotation, ellipsoid, - boundingRectangle + boundingRectangle, ); } @@ -1301,7 +1301,7 @@ Object.defineProperties(EllipseGeometry.prototype, { this._semiMinorAxis, this._rotation, this._granularity, - this._ellipsoid + this._ellipsoid, ); } return this._rectangle; @@ -1314,9 +1314,8 @@ Object.defineProperties(EllipseGeometry.prototype, { textureCoordinateRotationPoints: { get: function () { if (!defined(this._textureCoordinateRotationPoints)) { - this._textureCoordinateRotationPoints = textureCoordinateRotationPoints( - this - ); + this._textureCoordinateRotationPoints = + textureCoordinateRotationPoints(this); } return this._textureCoordinateRotationPoints; }, diff --git a/packages/engine/Source/Core/EllipseGeometryLibrary.js b/packages/engine/Source/Core/EllipseGeometryLibrary.js index acf09c2a2f33..25030fb725a9 100644 --- a/packages/engine/Source/Core/EllipseGeometryLibrary.js +++ b/packages/engine/Source/Core/EllipseGeometryLibrary.js @@ -20,7 +20,7 @@ function pointOnEllipsoid( bSqr, mag, unitPos, - result + result, ) { const azimuth = theta + rotation; @@ -59,7 +59,7 @@ const scratchNormal = new Cartesian3(); EllipseGeometryLibrary.raisePositionsToHeight = function ( positions, options, - extrude + extrude, ) { const ellipsoid = options.ellipsoid; const height = options.height; @@ -82,7 +82,7 @@ EllipseGeometryLibrary.raisePositionsToHeight = function ( const scaledNormal = Cartesian3.multiplyByScalar( normal, height, - scratchCartesian3 + scratchCartesian3, ); Cartesian3.add(position, scaledNormal, position); @@ -113,7 +113,7 @@ const northVecScratch = new Cartesian3(); EllipseGeometryLibrary.computeEllipsePositions = function ( options, addFillPositions, - addEdgePositions + addEdgePositions, ) { const semiMinorAxis = options.semiMinorAxis; const semiMajorAxis = options.semiMajorAxis; @@ -193,7 +193,7 @@ EllipseGeometryLibrary.computeEllipsePositions = function ( bSqr, mag, unitPos, - position + position, ); if (addFillPositions) { positions[positionIndex++] = position.x; @@ -217,7 +217,7 @@ EllipseGeometryLibrary.computeEllipsePositions = function ( bSqr, mag, unitPos, - position + position, ); reflectedPosition = pointOnEllipsoid( Math.PI - theta, @@ -229,7 +229,7 @@ EllipseGeometryLibrary.computeEllipsePositions = function ( bSqr, mag, unitPos, - reflectedPosition + reflectedPosition, ); if (addFillPositions) { @@ -244,7 +244,7 @@ EllipseGeometryLibrary.computeEllipsePositions = function ( position, reflectedPosition, t, - scratchCartesian3 + scratchCartesian3, ); positions[positionIndex++] = interiorPosition.x; positions[positionIndex++] = interiorPosition.y; @@ -282,7 +282,7 @@ EllipseGeometryLibrary.computeEllipsePositions = function ( bSqr, mag, unitPos, - position + position, ); reflectedPosition = pointOnEllipsoid( theta + Math.PI, @@ -294,7 +294,7 @@ EllipseGeometryLibrary.computeEllipsePositions = function ( bSqr, mag, unitPos, - reflectedPosition + reflectedPosition, ); if (addFillPositions) { @@ -309,7 +309,7 @@ EllipseGeometryLibrary.computeEllipsePositions = function ( position, reflectedPosition, t, - scratchCartesian3 + scratchCartesian3, ); positions[positionIndex++] = interiorPosition.x; positions[positionIndex++] = interiorPosition.y; @@ -342,7 +342,7 @@ EllipseGeometryLibrary.computeEllipsePositions = function ( bSqr, mag, unitPos, - position + position, ); const r = {}; diff --git a/packages/engine/Source/Core/EllipseOutlineGeometry.js b/packages/engine/Source/Core/EllipseOutlineGeometry.js index 0fc77099dba2..346bbc3e71bd 100644 --- a/packages/engine/Source/Core/EllipseOutlineGeometry.js +++ b/packages/engine/Source/Core/EllipseOutlineGeometry.js @@ -22,21 +22,21 @@ function computeEllipse(options) { boundingSphereCenter = Cartesian3.multiplyByScalar( options.ellipsoid.geodeticSurfaceNormal(center, boundingSphereCenter), options.height, - boundingSphereCenter + boundingSphereCenter, ); boundingSphereCenter = Cartesian3.add( center, boundingSphereCenter, - boundingSphereCenter + boundingSphereCenter, ); const boundingSphere = new BoundingSphere( boundingSphereCenter, - options.semiMajorAxis + options.semiMajorAxis, ); const positions = EllipseGeometryLibrary.computeEllipsePositions( options, false, - true + true, ).outerPositions; const attributes = new GeometryAttributes({ @@ -46,7 +46,7 @@ function computeEllipse(options) { values: EllipseGeometryLibrary.raisePositionsToHeight( positions, options, - false + false, ), }), }); @@ -75,31 +75,31 @@ function computeExtrudedEllipse(options) { let scaledNormal = Cartesian3.multiplyByScalar( ellipsoid.geodeticSurfaceNormal(center, scratchCartesian1), options.height, - scratchCartesian1 + scratchCartesian1, ); topBoundingSphere.center = Cartesian3.add( center, scaledNormal, - topBoundingSphere.center + topBoundingSphere.center, ); topBoundingSphere.radius = semiMajorAxis; scaledNormal = Cartesian3.multiplyByScalar( ellipsoid.geodeticSurfaceNormal(center, scaledNormal), options.extrudedHeight, - scaledNormal + scaledNormal, ); bottomBoundingSphere.center = Cartesian3.add( center, scaledNormal, - bottomBoundingSphere.center + bottomBoundingSphere.center, ); bottomBoundingSphere.radius = semiMajorAxis; let positions = EllipseGeometryLibrary.computeEllipsePositions( options, false, - true + true, ).outerPositions; const attributes = new GeometryAttributes({ position: new GeometryAttribute({ @@ -108,7 +108,7 @@ function computeExtrudedEllipse(options) { values: EllipseGeometryLibrary.raisePositionsToHeight( positions, options, - true + true, ), }), }); @@ -116,7 +116,7 @@ function computeExtrudedEllipse(options) { positions = attributes.position.values; const boundingSphere = BoundingSphere.union( topBoundingSphere, - bottomBoundingSphere + bottomBoundingSphere, ); let length = positions.length / 3; @@ -141,12 +141,12 @@ function computeExtrudedEllipse(options) { numberOfVerticalLines = CesiumMath.clamp( numberOfVerticalLines, 0, - length / 2 + length / 2, ); const indices = IndexDatatype.createTypedArray( length, - length * 2 + numberOfVerticalLines * 2 + length * 2 + numberOfVerticalLines * 2, ); length /= 2; @@ -219,7 +219,7 @@ function EllipseOutlineGeometry(options) { const semiMinorAxis = options.semiMinorAxis; const granularity = defaultValue( options.granularity, - CesiumMath.RADIANS_PER_DEGREE + CesiumMath.RADIANS_PER_DEGREE, ); //>>includeStart('debug', pragmas.debug); @@ -234,7 +234,7 @@ function EllipseOutlineGeometry(options) { } if (semiMajorAxis < semiMinorAxis) { throw new DeveloperError( - "semiMajorAxis must be greater than or equal to the semiMinorAxis." + "semiMajorAxis must be greater than or equal to the semiMinorAxis.", ); } if (granularity <= 0.0) { @@ -255,7 +255,7 @@ function EllipseOutlineGeometry(options) { this._extrudedHeight = Math.min(extrudedHeight, height); this._numberOfVerticalLines = Math.max( defaultValue(options.numberOfVerticalLines, 16), - 0 + 0, ); this._offsetAttribute = options.offsetAttribute; this._workerName = "createEllipseOutlineGeometry"; @@ -403,12 +403,12 @@ EllipseOutlineGeometry.createGeometry = function (ellipseGeometry) { height, extrudedHeight, 0, - CesiumMath.EPSILON2 + CesiumMath.EPSILON2, ); ellipseGeometry._center = ellipseGeometry._ellipsoid.scaleToGeodeticSurface( ellipseGeometry._center, - ellipseGeometry._center + ellipseGeometry._center, ); const options = { center: ellipseGeometry._center, diff --git a/packages/engine/Source/Core/Ellipsoid.js b/packages/engine/Source/Core/Ellipsoid.js index b76f3f3a04a0..def0d0862dee 100644 --- a/packages/engine/Source/Core/Ellipsoid.js +++ b/packages/engine/Source/Core/Ellipsoid.js @@ -26,19 +26,19 @@ function initialize(ellipsoid, x, y, z) { ellipsoid._radiiToTheFourth = new Cartesian3( x * x * x * x, y * y * y * y, - z * z * z * z + z * z * z * z, ); ellipsoid._oneOverRadii = new Cartesian3( x === 0.0 ? 0.0 : 1.0 / x, y === 0.0 ? 0.0 : 1.0 / y, - z === 0.0 ? 0.0 : 1.0 / z + z === 0.0 ? 0.0 : 1.0 / z, ); ellipsoid._oneOverRadiiSquared = new Cartesian3( x === 0.0 ? 0.0 : 1.0 / (x * x), y === 0.0 ? 0.0 : 1.0 / (y * y), - z === 0.0 ? 0.0 : 1.0 / (z * z) + z === 0.0 ? 0.0 : 1.0 / (z * z), ); ellipsoid._minimumRadius = Math.min(x, y, z); @@ -230,7 +230,7 @@ Ellipsoid.fromCartesian3 = function (cartesian, result) { * @constant */ Ellipsoid.WGS84 = Object.freeze( - new Ellipsoid(6378137.0, 6378137.0, 6356752.3142451793) + new Ellipsoid(6378137.0, 6378137.0, 6356752.3142451793), ); /** @@ -251,8 +251,8 @@ Ellipsoid.MOON = Object.freeze( new Ellipsoid( CesiumMath.LUNAR_RADIUS, CesiumMath.LUNAR_RADIUS, - CesiumMath.LUNAR_RADIUS - ) + CesiumMath.LUNAR_RADIUS, + ), ); Ellipsoid._default = Ellipsoid.WGS84; @@ -366,7 +366,7 @@ Ellipsoid.prototype.geocentricSurfaceNormal = Cartesian3.normalize; */ Ellipsoid.prototype.geodeticSurfaceNormalCartographic = function ( cartographic, - result + result, ) { //>>includeStart('debug', pragmas.debug); Check.typeOf.object("cartographic", cartographic); @@ -414,7 +414,7 @@ Ellipsoid.prototype.geodeticSurfaceNormal = function (cartesian, result) { result = Cartesian3.multiplyComponents( cartesian, this._oneOverRadiiSquared, - result + result, ); return Cartesian3.normalize(result, result); }; @@ -466,7 +466,7 @@ Ellipsoid.prototype.cartographicToCartesian = function (cartographic, result) { */ Ellipsoid.prototype.cartographicArrayToCartesianArray = function ( cartographics, - result + result, ) { //>>includeStart('debug', pragmas.debug); Check.defined("cartographics", cartographics); @@ -542,7 +542,7 @@ Ellipsoid.prototype.cartesianToCartographic = function (cartesian, result) { */ Ellipsoid.prototype.cartesianArrayToCartographicArray = function ( cartesians, - result + result, ) { //>>includeStart('debug', pragmas.debug); Check.defined("cartesians", cartesians); @@ -575,7 +575,7 @@ Ellipsoid.prototype.scaleToGeodeticSurface = function (cartesian, result) { this._oneOverRadii, this._oneOverRadiiSquared, this._centerToleranceSquared, - result + result, ); }; @@ -606,7 +606,7 @@ Ellipsoid.prototype.scaleToGeocentricSurface = function (cartesian, result) { Math.sqrt( positionX * positionX * oneOverRadiiSquared.x + positionY * positionY * oneOverRadiiSquared.y + - positionZ * positionZ * oneOverRadiiSquared.z + positionZ * positionZ * oneOverRadiiSquared.z, ); return Cartesian3.multiplyByScalar(cartesian, beta, result); @@ -624,7 +624,7 @@ Ellipsoid.prototype.scaleToGeocentricSurface = function (cartesian, result) { */ Ellipsoid.prototype.transformPositionToScaledSpace = function ( position, - result + result, ) { if (!defined(result)) { result = new Cartesian3(); @@ -645,7 +645,7 @@ Ellipsoid.prototype.transformPositionToScaledSpace = function ( */ Ellipsoid.prototype.transformPositionFromScaledSpace = function ( position, - result + result, ) { if (!defined(result)) { result = new Cartesian3(); @@ -696,7 +696,7 @@ Ellipsoid.prototype.toString = function () { Ellipsoid.prototype.getSurfaceNormalIntersectionWithZAxis = function ( position, buffer, - result + result, ) { //>>includeStart('debug', pragmas.debug); Check.typeOf.object("position", position); @@ -705,11 +705,11 @@ Ellipsoid.prototype.getSurfaceNormalIntersectionWithZAxis = function ( !CesiumMath.equalsEpsilon( this._radii.x, this._radii.y, - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ) ) { throw new DeveloperError( - "Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y)" + "Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y)", ); } @@ -758,11 +758,11 @@ Ellipsoid.prototype.getLocalCurvature = function (surfacePosition, result) { const primeVerticalEndpoint = this.getSurfaceNormalIntersectionWithZAxis( surfacePosition, 0.0, - scratchEndpoint + scratchEndpoint, ); const primeVerticalRadius = Cartesian3.distance( surfacePosition, - primeVerticalEndpoint + primeVerticalEndpoint, ); // meridional radius = (1 - e^2) * primeVerticalRadius^3 / a^2 // where 1 - e^2 = b^2 / a^2, @@ -775,25 +775,17 @@ Ellipsoid.prototype.getLocalCurvature = function (surfacePosition, result) { return Cartesian2.fromElements( 1.0 / primeVerticalRadius, 1.0 / meridionalRadius, - result + result, ); }; const abscissas = [ - 0.14887433898163, - 0.43339539412925, - 0.67940956829902, - 0.86506336668898, - 0.97390652851717, - 0.0, + 0.14887433898163, 0.43339539412925, 0.67940956829902, 0.86506336668898, + 0.97390652851717, 0.0, ]; const weights = [ - 0.29552422471475, - 0.26926671930999, - 0.21908636251598, - 0.14945134915058, - 0.066671344308684, - 0.0, + 0.29552422471475, 0.26926671930999, 0.21908636251598, 0.14945134915058, + 0.066671344308684, 0.0, ]; /** @@ -879,7 +871,7 @@ Ellipsoid.prototype.surfaceArea = function (rectangle) { c2 * (b2 * cosTheta * cosTheta + a2 * sinTheta * sinTheta) * sinPhi * - sinPhi + sinPhi, ); }) ); diff --git a/packages/engine/Source/Core/EllipsoidGeodesic.js b/packages/engine/Source/Core/EllipsoidGeodesic.js index b15475b93bce..ef15944b1c25 100644 --- a/packages/engine/Source/Core/EllipsoidGeodesic.js +++ b/packages/engine/Source/Core/EllipsoidGeodesic.js @@ -90,7 +90,7 @@ function computeDeltaLambda( sigma, sineSigma, cosineSigma, - cosineTwiceSigmaMidpoint + cosineTwiceSigmaMidpoint, ) { const C = computeC(f, cosineSquaredAlpha); @@ -115,7 +115,7 @@ function vincentyInverseFormula( firstLongitude, firstLatitude, secondLongitude, - secondLatitude + secondLatitude, ) { const eff = (major - minor) / major; const l = secondLongitude - firstLongitude; @@ -151,7 +151,7 @@ function vincentyInverseFormula( const temp = cs - sc * cosineLambda; sineSigma = Math.sqrt( - cosineU2 * cosineU2 * sineLambda * sineLambda + temp * temp + cosineU2 * cosineU2 * sineLambda * sineLambda + temp * temp, ); cosineSigma = ss + cc * cosineLambda; @@ -184,7 +184,7 @@ function vincentyInverseFormula( sigma, sineSigma, cosineSigma, - cosineTwiceSigmaMidpoint + cosineTwiceSigmaMidpoint, ); } while (Math.abs(lambda - lambdaDot) > CesiumMath.EPSILON12); @@ -219,7 +219,7 @@ function vincentyInverseFormula( const startHeading = Math.atan2( cosineU2 * sineLambda, - cs - sc * cosineLambda + cs - sc * cosineLambda, ); const endHeading = Math.atan2(cosineU1 * sineLambda, cs * cosineLambda - sc); @@ -234,20 +234,21 @@ const scratchCart2 = new Cartesian3(); function computeProperties(ellipsoidGeodesic, start, end, ellipsoid) { const firstCartesian = Cartesian3.normalize( ellipsoid.cartographicToCartesian(start, scratchCart2), - scratchCart1 + scratchCart1, ); const lastCartesian = Cartesian3.normalize( ellipsoid.cartographicToCartesian(end, scratchCart2), - scratchCart2 + scratchCart2, ); //>>includeStart('debug', pragmas.debug); Check.typeOf.number.greaterThanOrEquals( "value", Math.abs( - Math.abs(Cartesian3.angleBetween(firstCartesian, lastCartesian)) - Math.PI + Math.abs(Cartesian3.angleBetween(firstCartesian, lastCartesian)) - + Math.PI, ), - 0.0125 + 0.0125, ); //>>includeEnd('debug'); @@ -258,12 +259,12 @@ function computeProperties(ellipsoidGeodesic, start, end, ellipsoid) { start.longitude, start.latitude, end.longitude, - end.latitude + end.latitude, ); ellipsoidGeodesic._start = Cartographic.clone( start, - ellipsoidGeodesic._start + ellipsoidGeodesic._start, ); ellipsoidGeodesic._end = Cartographic.clone(end, ellipsoidGeodesic._end); ellipsoidGeodesic._start.height = 0; @@ -409,11 +410,11 @@ EllipsoidGeodesic.prototype.setEndPoints = function (start, end) { */ EllipsoidGeodesic.prototype.interpolateUsingFraction = function ( fraction, - result + result, ) { return this.interpolateUsingSurfaceDistance( this._distance * fraction, - result + result, ); }; @@ -428,7 +429,7 @@ EllipsoidGeodesic.prototype.interpolateUsingFraction = function ( */ EllipsoidGeodesic.prototype.interpolateUsingSurfaceDistance = function ( distance, - result + result, ) { //>>includeStart('debug', pragmas.debug); Check.defined("distance", this._distance); @@ -496,7 +497,7 @@ EllipsoidGeodesic.prototype.interpolateUsingSurfaceDistance = function ( const lambda = Math.atan2( sineSigma * constants.sineHeading, - cc - ss * constants.cosineHeading + cc - ss * constants.cosineHeading, ); const l = @@ -508,7 +509,7 @@ EllipsoidGeodesic.prototype.interpolateUsingSurfaceDistance = function ( sigma, sineSigma, cosineSigma, - cosineTwiceSigmaMidpoint + cosineTwiceSigmaMidpoint, ); if (defined(result)) { diff --git a/packages/engine/Source/Core/EllipsoidGeometry.js b/packages/engine/Source/Core/EllipsoidGeometry.js index e6a8409dc78b..3912ad9c4d10 100644 --- a/packages/engine/Source/Core/EllipsoidGeometry.js +++ b/packages/engine/Source/Core/EllipsoidGeometry.js @@ -70,12 +70,12 @@ function EllipsoidGeometry(options) { //>>includeStart('debug', pragmas.debug); if (slicePartitions < 3) { throw new DeveloperError( - "options.slicePartitions cannot be less than three." + "options.slicePartitions cannot be less than three.", ); } if (stackPartitions < 3) { throw new DeveloperError( - "options.stackPartitions cannot be less than three." + "options.stackPartitions cannot be less than three.", ); } //>>includeEnd('debug'); @@ -183,7 +183,7 @@ EllipsoidGeometry.unpack = function (array, startingIndex, result) { const vertexFormat = VertexFormat.unpack( array, startingIndex, - scratchVertexFormat + scratchVertexFormat, ); startingIndex += VertexFormat.packedLength; @@ -252,10 +252,10 @@ EllipsoidGeometry.createGeometry = function (ellipsoidGeometry) { slicePartitions = Math.round( (slicePartitions * Math.abs(maximumClock - minimumClock)) / - CesiumMath.TWO_PI + CesiumMath.TWO_PI, ); stackPartitions = Math.round( - (stackPartitions * Math.abs(maximumCone - minimumCone)) / CesiumMath.PI + (stackPartitions * Math.abs(maximumCone - minimumCone)) / CesiumMath.PI, ); if (slicePartitions < 2) { @@ -275,13 +275,14 @@ EllipsoidGeometry.createGeometry = function (ellipsoidGeometry) { const thetas = [minimumClock]; for (i = 0; i < stackPartitions; i++) { phis.push( - minimumCone + (i * (maximumCone - minimumCone)) / (stackPartitions - 1) + minimumCone + (i * (maximumCone - minimumCone)) / (stackPartitions - 1), ); } phis.push(maximumCone); for (j = 0; j < slicePartitions; j++) { thetas.push( - minimumClock + (j * (maximumClock - minimumClock)) / (slicePartitions - 1) + minimumClock + + (j * (maximumClock - minimumClock)) / (slicePartitions - 1), ); } thetas.push(maximumClock); @@ -641,7 +642,7 @@ EllipsoidGeometry.getUnitEllipsoid = function () { new EllipsoidGeometry({ radii: new Cartesian3(1.0, 1.0, 1.0), vertexFormat: VertexFormat.POSITION_ONLY, - }) + }), ); } return unitEllipsoidGeometry; diff --git a/packages/engine/Source/Core/EllipsoidOutlineGeometry.js b/packages/engine/Source/Core/EllipsoidOutlineGeometry.js index 53b1fd403a97..0fbd1edd2434 100644 --- a/packages/engine/Source/Core/EllipsoidOutlineGeometry.js +++ b/packages/engine/Source/Core/EllipsoidOutlineGeometry.js @@ -68,7 +68,7 @@ function EllipsoidOutlineGeometry(options) { } if (subdivisions < 0) { throw new DeveloperError( - "options.subdivisions must be greater than or equal to zero." + "options.subdivisions must be greater than or equal to zero.", ); } if ( @@ -76,7 +76,7 @@ function EllipsoidOutlineGeometry(options) { options.offsetAttribute === GeometryOffsetAttribute.TOP ) { throw new DeveloperError( - "GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry." + "GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.", ); } //>>includeEnd('debug'); @@ -244,10 +244,10 @@ EllipsoidOutlineGeometry.createGeometry = function (ellipsoidGeometry) { slicePartitions = Math.round( (slicePartitions * Math.abs(maximumClock - minimumClock)) / - CesiumMath.TWO_PI + CesiumMath.TWO_PI, ); stackPartitions = Math.round( - (stackPartitions * Math.abs(maximumCone - minimumCone)) / CesiumMath.PI + (stackPartitions * Math.abs(maximumCone - minimumCone)) / CesiumMath.PI, ); if (slicePartitions < 2) { diff --git a/packages/engine/Source/Core/EllipsoidRhumbLine.js b/packages/engine/Source/Core/EllipsoidRhumbLine.js index 9c61eed0a00c..834b8a857b74 100644 --- a/packages/engine/Source/Core/EllipsoidRhumbLine.js +++ b/packages/engine/Source/Core/EllipsoidRhumbLine.js @@ -176,16 +176,16 @@ function calculateHeading( firstLongitude, firstLatitude, secondLongitude, - secondLatitude + secondLatitude, ) { const sigma1 = calculateSigma(ellipsoidRhumbLine._ellipticity, firstLatitude); const sigma2 = calculateSigma( ellipsoidRhumbLine._ellipticity, - secondLatitude + secondLatitude, ); return Math.atan2( CesiumMath.negativePiToPi(secondLongitude - firstLongitude), - sigma2 - sigma1 + sigma2 - sigma1, ); } @@ -196,7 +196,7 @@ function calculateArcLength( firstLongitude, firstLatitude, secondLongitude, - secondLatitude + secondLatitude, ) { const heading = ellipsoidRhumbLine._heading; const deltaLongitude = secondLongitude - firstLongitude; @@ -209,7 +209,7 @@ function calculateArcLength( CesiumMath.equalsEpsilon( Math.abs(heading), CesiumMath.PI_OVER_TWO, - CesiumMath.EPSILON8 + CesiumMath.EPSILON8, ) ) { //If heading is close to 90 degrees @@ -230,12 +230,12 @@ function calculateArcLength( const M1 = calculateM( ellipsoidRhumbLine._ellipticity, major, - firstLatitude + firstLatitude, ); const M2 = calculateM( ellipsoidRhumbLine._ellipticity, major, - secondLatitude + secondLatitude, ); distance = (M2 - M1) / Math.cos(heading); @@ -249,20 +249,21 @@ const scratchCart2 = new Cartesian3(); function computeProperties(ellipsoidRhumbLine, start, end, ellipsoid) { const firstCartesian = Cartesian3.normalize( ellipsoid.cartographicToCartesian(start, scratchCart2), - scratchCart1 + scratchCart1, ); const lastCartesian = Cartesian3.normalize( ellipsoid.cartographicToCartesian(end, scratchCart2), - scratchCart2 + scratchCart2, ); //>>includeStart('debug', pragmas.debug); Check.typeOf.number.greaterThanOrEquals( "value", Math.abs( - Math.abs(Cartesian3.angleBetween(firstCartesian, lastCartesian)) - Math.PI + Math.abs(Cartesian3.angleBetween(firstCartesian, lastCartesian)) - + Math.PI, ), - 0.0125 + 0.0125, ); //>>includeEnd('debug'); @@ -273,12 +274,12 @@ function computeProperties(ellipsoidRhumbLine, start, end, ellipsoid) { ellipsoidRhumbLine._ellipticitySquared = (majorSquared - minorSquared) / majorSquared; ellipsoidRhumbLine._ellipticity = Math.sqrt( - ellipsoidRhumbLine._ellipticitySquared + ellipsoidRhumbLine._ellipticitySquared, ); ellipsoidRhumbLine._start = Cartographic.clone( start, - ellipsoidRhumbLine._start + ellipsoidRhumbLine._start, ); ellipsoidRhumbLine._start.height = 0; @@ -290,7 +291,7 @@ function computeProperties(ellipsoidRhumbLine, start, end, ellipsoid) { start.longitude, start.latitude, end.longitude, - end.latitude + end.latitude, ); ellipsoidRhumbLine._distance = calculateArcLength( ellipsoidRhumbLine, @@ -299,7 +300,7 @@ function computeProperties(ellipsoidRhumbLine, start, end, ellipsoid) { start.longitude, start.latitude, end.longitude, - end.latitude + end.latitude, ); } @@ -309,7 +310,7 @@ function interpolateUsingSurfaceDistance( distance, major, ellipticity, - result + result, ) { if (distance === 0.0) { return Cartographic.clone(start, result); @@ -490,7 +491,7 @@ EllipsoidRhumbLine.fromStartHeadingDistance = function ( heading, distance, ellipsoid, - result + result, ) { //>>includeStart('debug', pragmas.debug); Check.defined("start", start); @@ -512,7 +513,7 @@ EllipsoidRhumbLine.fromStartHeadingDistance = function ( heading, distance, e.maximumRadius, - ellipticity + ellipticity, ); if ( @@ -550,11 +551,11 @@ EllipsoidRhumbLine.prototype.setEndPoints = function (start, end) { */ EllipsoidRhumbLine.prototype.interpolateUsingFraction = function ( fraction, - result + result, ) { return this.interpolateUsingSurfaceDistance( fraction * this._distance, - result + result, ); }; @@ -569,13 +570,13 @@ EllipsoidRhumbLine.prototype.interpolateUsingFraction = function ( */ EllipsoidRhumbLine.prototype.interpolateUsingSurfaceDistance = function ( distance, - result + result, ) { //>>includeStart('debug', pragmas.debug); Check.typeOf.number("distance", distance); if (!defined(this._distance) || this._distance === 0.0) { throw new DeveloperError( - "EllipsoidRhumbLine must have distinct start and end set." + "EllipsoidRhumbLine must have distinct start and end set.", ); } //>>includeEnd('debug'); @@ -586,7 +587,7 @@ EllipsoidRhumbLine.prototype.interpolateUsingSurfaceDistance = function ( distance, this._ellipsoid.maximumRadius, this._ellipticity, - result + result, ); }; @@ -602,13 +603,13 @@ EllipsoidRhumbLine.prototype.interpolateUsingSurfaceDistance = function ( */ EllipsoidRhumbLine.prototype.findIntersectionWithLongitude = function ( intersectionLongitude, - result + result, ) { //>>includeStart('debug', pragmas.debug); Check.typeOf.number("intersectionLongitude", intersectionLongitude); if (!defined(this._distance) || this._distance === 0.0) { throw new DeveloperError( - "EllipsoidRhumbLine must have distinct start and end set." + "EllipsoidRhumbLine must have distinct start and end set.", ); } //>>includeEnd('debug'); @@ -624,7 +625,7 @@ EllipsoidRhumbLine.prototype.findIntersectionWithLongitude = function ( CesiumMath.equalsEpsilon( Math.abs(intersectionLongitude), Math.PI, - CesiumMath.EPSILON14 + CesiumMath.EPSILON14, ) ) { intersectionLongitude = CesiumMath.sign(start.longitude) * Math.PI; @@ -645,14 +646,14 @@ EllipsoidRhumbLine.prototype.findIntersectionWithLongitude = function ( CesiumMath.equalsEpsilon( Math.abs(CesiumMath.PI_OVER_TWO - absHeading), CesiumMath.PI_OVER_TWO, - CesiumMath.EPSILON8 + CesiumMath.EPSILON8, ) ) { if ( CesiumMath.equalsEpsilon( intersectionLongitude, start.longitude, - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ) ) { return undefined; @@ -683,7 +684,7 @@ EllipsoidRhumbLine.prototype.findIntersectionWithLongitude = function ( newPhi = 2 * Math.atan( - leftComponent * Math.pow(numerator / denominator, ellipticity / 2) + leftComponent * Math.pow(numerator / denominator, ellipticity / 2), ) - CesiumMath.PI_OVER_TWO; } while (!CesiumMath.equalsEpsilon(newPhi, phi, CesiumMath.EPSILON12)); @@ -706,13 +707,13 @@ EllipsoidRhumbLine.prototype.findIntersectionWithLongitude = function ( */ EllipsoidRhumbLine.prototype.findIntersectionWithLatitude = function ( intersectionLatitude, - result + result, ) { //>>includeStart('debug', pragmas.debug); Check.typeOf.number("intersectionLatitude", intersectionLatitude); if (!defined(this._distance) || this._distance === 0.0) { throw new DeveloperError( - "EllipsoidRhumbLine must have distinct start and end set." + "EllipsoidRhumbLine must have distinct start and end set.", ); } //>>includeEnd('debug'); @@ -726,7 +727,7 @@ EllipsoidRhumbLine.prototype.findIntersectionWithLatitude = function ( CesiumMath.equalsEpsilon( Math.abs(heading), CesiumMath.PI_OVER_TWO, - CesiumMath.EPSILON8 + CesiumMath.EPSILON8, ) ) { return; diff --git a/packages/engine/Source/Core/EllipsoidTangentPlane.js b/packages/engine/Source/Core/EllipsoidTangentPlane.js index f351b97537b1..c7b73ca4888f 100644 --- a/packages/engine/Source/Core/EllipsoidTangentPlane.js +++ b/packages/engine/Source/Core/EllipsoidTangentPlane.js @@ -37,7 +37,7 @@ function EllipsoidTangentPlane(origin, ellipsoid) { //>>includeStart('debug', pragmas.debug); if (!defined(origin)) { throw new DeveloperError( - "origin must not be at the center of the ellipsoid." + "origin must not be at the center of the ellipsoid.", ); } //>>includeEnd('debug'); @@ -46,14 +46,14 @@ function EllipsoidTangentPlane(origin, ellipsoid) { this._ellipsoid = ellipsoid; this._origin = origin; this._xAxis = Cartesian3.fromCartesian4( - Matrix4.getColumn(eastNorthUp, 0, scratchCart4) + Matrix4.getColumn(eastNorthUp, 0, scratchCart4), ); this._yAxis = Cartesian3.fromCartesian4( - Matrix4.getColumn(eastNorthUp, 1, scratchCart4) + Matrix4.getColumn(eastNorthUp, 1, scratchCart4), ); const normal = Cartesian3.fromCartesian4( - Matrix4.getColumn(eastNorthUp, 2, scratchCart4) + Matrix4.getColumn(eastNorthUp, 2, scratchCart4), ); this._plane = Plane.fromPointNormal(origin, normal); } @@ -160,7 +160,7 @@ const scratchProjectPointOntoPlaneCartesian3 = new Cartesian3(); */ EllipsoidTangentPlane.prototype.projectPointOntoPlane = function ( cartesian, - result + result, ) { //>>includeStart('debug', pragmas.debug); Check.defined("cartesian", cartesian); @@ -173,14 +173,14 @@ EllipsoidTangentPlane.prototype.projectPointOntoPlane = function ( let intersectionPoint = IntersectionTests.rayPlane( ray, this._plane, - scratchProjectPointOntoPlaneCartesian3 + scratchProjectPointOntoPlaneCartesian3, ); if (!defined(intersectionPoint)) { Cartesian3.negate(ray.direction, ray.direction); intersectionPoint = IntersectionTests.rayPlane( ray, this._plane, - scratchProjectPointOntoPlaneCartesian3 + scratchProjectPointOntoPlaneCartesian3, ); } @@ -188,7 +188,7 @@ EllipsoidTangentPlane.prototype.projectPointOntoPlane = function ( const v = Cartesian3.subtract( intersectionPoint, this._origin, - intersectionPoint + intersectionPoint, ); const x = Cartesian3.dot(this._xAxis, v); const y = Cartesian3.dot(this._yAxis, v); @@ -215,7 +215,7 @@ EllipsoidTangentPlane.prototype.projectPointOntoPlane = function ( */ EllipsoidTangentPlane.prototype.projectPointsOntoPlane = function ( cartesians, - result + result, ) { //>>includeStart('debug', pragmas.debug); Check.defined("cartesians", cartesians); @@ -247,7 +247,7 @@ EllipsoidTangentPlane.prototype.projectPointsOntoPlane = function ( */ EllipsoidTangentPlane.prototype.projectPointToNearestOnPlane = function ( cartesian, - result + result, ) { //>>includeStart('debug', pragmas.debug); Check.defined("cartesian", cartesian); @@ -264,21 +264,21 @@ EllipsoidTangentPlane.prototype.projectPointToNearestOnPlane = function ( let intersectionPoint = IntersectionTests.rayPlane( ray, this._plane, - scratchProjectPointOntoPlaneCartesian3 + scratchProjectPointOntoPlaneCartesian3, ); if (!defined(intersectionPoint)) { Cartesian3.negate(ray.direction, ray.direction); intersectionPoint = IntersectionTests.rayPlane( ray, this._plane, - scratchProjectPointOntoPlaneCartesian3 + scratchProjectPointOntoPlaneCartesian3, ); } const v = Cartesian3.subtract( intersectionPoint, this._origin, - intersectionPoint + intersectionPoint, ); const x = Cartesian3.dot(this._xAxis, v); const y = Cartesian3.dot(this._yAxis, v); @@ -299,7 +299,7 @@ EllipsoidTangentPlane.prototype.projectPointToNearestOnPlane = function ( */ EllipsoidTangentPlane.prototype.projectPointsToNearestOnPlane = function ( cartesians, - result + result, ) { //>>includeStart('debug', pragmas.debug); Check.defined("cartesians", cartesians); @@ -327,7 +327,7 @@ const projectPointsOntoEllipsoidScratch = new Cartesian3(); */ EllipsoidTangentPlane.prototype.projectPointOntoEllipsoid = function ( cartesian, - result + result, ) { //>>includeStart('debug', pragmas.debug); Check.defined("cartesian", cartesian); @@ -361,7 +361,7 @@ EllipsoidTangentPlane.prototype.projectPointOntoEllipsoid = function ( */ EllipsoidTangentPlane.prototype.projectPointsOntoEllipsoid = function ( cartesians, - result + result, ) { //>>includeStart('debug', pragmas.debug); Check.defined("cartesians", cartesians); diff --git a/packages/engine/Source/Core/EllipsoidTerrainProvider.js b/packages/engine/Source/Core/EllipsoidTerrainProvider.js index 00ae7885588d..ad08037ccf4b 100644 --- a/packages/engine/Source/Core/EllipsoidTerrainProvider.js +++ b/packages/engine/Source/Core/EllipsoidTerrainProvider.js @@ -35,11 +35,12 @@ function EllipsoidTerrainProvider(options) { // Note: the 64 below does NOT need to match the actual vertex dimensions, because // the ellipsoid is significantly smoother than actual terrain. - this._levelZeroMaximumGeometricError = TerrainProvider.getEstimatedLevelZeroGeometricErrorForAHeightmap( - this._tilingScheme.ellipsoid, - 64, - this._tilingScheme.getNumberOfXTilesAtLevel(0) - ); + this._levelZeroMaximumGeometricError = + TerrainProvider.getEstimatedLevelZeroGeometricErrorForAHeightmap( + this._tilingScheme.ellipsoid, + 64, + this._tilingScheme.getNumberOfXTilesAtLevel(0), + ); this._errorEvent = new Event(); } @@ -141,7 +142,7 @@ EllipsoidTerrainProvider.prototype.requestTileGeometry = function ( x, y, level, - request + request, ) { const width = 16; const height = 16; @@ -150,7 +151,7 @@ EllipsoidTerrainProvider.prototype.requestTileGeometry = function ( buffer: new Uint8Array(width * height), width: width, height: height, - }) + }), ); }; @@ -161,7 +162,7 @@ EllipsoidTerrainProvider.prototype.requestTileGeometry = function ( * @returns {number} The maximum geometric error. */ EllipsoidTerrainProvider.prototype.getLevelMaximumGeometricError = function ( - level + level, ) { return this._levelZeroMaximumGeometricError / (1 << level); }; @@ -177,7 +178,7 @@ EllipsoidTerrainProvider.prototype.getLevelMaximumGeometricError = function ( EllipsoidTerrainProvider.prototype.getTileDataAvailable = function ( x, y, - level + level, ) { return undefined; }; @@ -193,7 +194,7 @@ EllipsoidTerrainProvider.prototype.getTileDataAvailable = function ( EllipsoidTerrainProvider.prototype.loadTileDataAvailability = function ( x, y, - level + level, ) { return undefined; }; diff --git a/packages/engine/Source/Core/EllipsoidalOccluder.js b/packages/engine/Source/Core/EllipsoidalOccluder.js index e94d8bbcbf3d..6f8fee3143f9 100644 --- a/packages/engine/Source/Core/EllipsoidalOccluder.js +++ b/packages/engine/Source/Core/EllipsoidalOccluder.js @@ -70,7 +70,7 @@ Object.defineProperties(EllipsoidalOccluder.prototype, { const ellipsoid = this._ellipsoid; const cv = ellipsoid.transformPositionToScaledSpace( cameraPosition, - this._cameraPositionInScaledSpace + this._cameraPositionInScaledSpace, ); const vhMagnitudeSquared = Cartesian3.magnitudeSquared(cv) - 1.0; @@ -100,12 +100,12 @@ EllipsoidalOccluder.prototype.isPointVisible = function (occludee) { const ellipsoid = this._ellipsoid; const occludeeScaledSpacePosition = ellipsoid.transformPositionToScaledSpace( occludee, - scratchCartesian + scratchCartesian, ); return isScaledSpacePointVisible( occludeeScaledSpacePosition, this._cameraPositionInScaledSpace, - this._distanceToLimbInScaledSpaceSquared + this._distanceToLimbInScaledSpaceSquared, ); }; @@ -126,12 +126,12 @@ EllipsoidalOccluder.prototype.isPointVisible = function (occludee) { * occluder.isScaledSpacePointVisible(scaledSpacePoint); //returns true */ EllipsoidalOccluder.prototype.isScaledSpacePointVisible = function ( - occludeeScaledSpacePosition + occludeeScaledSpacePosition, ) { return isScaledSpacePointVisible( occludeeScaledSpacePosition, this._cameraPositionInScaledSpace, - this._distanceToLimbInScaledSpaceSquared + this._distanceToLimbInScaledSpaceSquared, ); }; @@ -147,36 +147,34 @@ const scratchCameraPositionInScaledSpaceShrunk = new Cartesian3(); * @param {Cartesian3} occludeeScaledSpacePosition The point to test for visibility, represented in the scaled space of the possibly-shrunk ellipsoid. * @returns {boolean} true if the occludee is visible; otherwise false. */ -EllipsoidalOccluder.prototype.isScaledSpacePointVisiblePossiblyUnderEllipsoid = function ( - occludeeScaledSpacePosition, - minimumHeight -) { - const ellipsoid = this._ellipsoid; - let vhMagnitudeSquared; - let cv; - - if ( - defined(minimumHeight) && - minimumHeight < 0.0 && - ellipsoid.minimumRadius > -minimumHeight - ) { - // This code is similar to the cameraPosition setter, but unrolled for performance because it will be called a lot. - cv = scratchCameraPositionInScaledSpaceShrunk; - cv.x = this._cameraPosition.x / (ellipsoid.radii.x + minimumHeight); - cv.y = this._cameraPosition.y / (ellipsoid.radii.y + minimumHeight); - cv.z = this._cameraPosition.z / (ellipsoid.radii.z + minimumHeight); - vhMagnitudeSquared = cv.x * cv.x + cv.y * cv.y + cv.z * cv.z - 1.0; - } else { - cv = this._cameraPositionInScaledSpace; - vhMagnitudeSquared = this._distanceToLimbInScaledSpaceSquared; - } +EllipsoidalOccluder.prototype.isScaledSpacePointVisiblePossiblyUnderEllipsoid = + function (occludeeScaledSpacePosition, minimumHeight) { + const ellipsoid = this._ellipsoid; + let vhMagnitudeSquared; + let cv; + + if ( + defined(minimumHeight) && + minimumHeight < 0.0 && + ellipsoid.minimumRadius > -minimumHeight + ) { + // This code is similar to the cameraPosition setter, but unrolled for performance because it will be called a lot. + cv = scratchCameraPositionInScaledSpaceShrunk; + cv.x = this._cameraPosition.x / (ellipsoid.radii.x + minimumHeight); + cv.y = this._cameraPosition.y / (ellipsoid.radii.y + minimumHeight); + cv.z = this._cameraPosition.z / (ellipsoid.radii.z + minimumHeight); + vhMagnitudeSquared = cv.x * cv.x + cv.y * cv.y + cv.z * cv.z - 1.0; + } else { + cv = this._cameraPositionInScaledSpace; + vhMagnitudeSquared = this._distanceToLimbInScaledSpaceSquared; + } - return isScaledSpacePointVisible( - occludeeScaledSpacePosition, - cv, - vhMagnitudeSquared - ); -}; + return isScaledSpacePointVisible( + occludeeScaledSpacePosition, + cv, + vhMagnitudeSquared, + ); + }; /** * Computes a point that can be used for horizon culling from a list of positions. If the point is below @@ -197,13 +195,13 @@ EllipsoidalOccluder.prototype.isScaledSpacePointVisiblePossiblyUnderEllipsoid = EllipsoidalOccluder.prototype.computeHorizonCullingPoint = function ( directionToPoint, positions, - result + result, ) { return computeHorizonCullingPointFromPositions( this._ellipsoid, directionToPoint, positions, - result + result, ); }; @@ -226,24 +224,20 @@ const scratchEllipsoidShrunk = Ellipsoid.clone(Ellipsoid.UNIT_SPHERE); * @param {Cartesian3} [result] The instance on which to store the result instead of allocating a new instance. * @returns {Cartesian3} The computed horizon culling point, expressed in the possibly-shrunk ellipsoid-scaled space. */ -EllipsoidalOccluder.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid = function ( - directionToPoint, - positions, - minimumHeight, - result -) { - const possiblyShrunkEllipsoid = getPossiblyShrunkEllipsoid( - this._ellipsoid, - minimumHeight, - scratchEllipsoidShrunk - ); - return computeHorizonCullingPointFromPositions( - possiblyShrunkEllipsoid, - directionToPoint, - positions, - result - ); -}; +EllipsoidalOccluder.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid = + function (directionToPoint, positions, minimumHeight, result) { + const possiblyShrunkEllipsoid = getPossiblyShrunkEllipsoid( + this._ellipsoid, + minimumHeight, + scratchEllipsoidShrunk, + ); + return computeHorizonCullingPointFromPositions( + possiblyShrunkEllipsoid, + directionToPoint, + positions, + result, + ); + }; /** * Computes a point that can be used for horizon culling from a list of positions. If the point is below * the horizon, all of the positions are guaranteed to be below the horizon as well. The returned point @@ -262,22 +256,17 @@ EllipsoidalOccluder.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid = * @param {Cartesian3} [result] The instance on which to store the result instead of allocating a new instance. * @returns {Cartesian3} The computed horizon culling point, expressed in the ellipsoid-scaled space. */ -EllipsoidalOccluder.prototype.computeHorizonCullingPointFromVertices = function ( - directionToPoint, - vertices, - stride, - center, - result -) { - return computeHorizonCullingPointFromVertices( - this._ellipsoid, - directionToPoint, - vertices, - stride, - center, - result - ); -}; +EllipsoidalOccluder.prototype.computeHorizonCullingPointFromVertices = + function (directionToPoint, vertices, stride, center, result) { + return computeHorizonCullingPointFromVertices( + this._ellipsoid, + directionToPoint, + vertices, + stride, + center, + result, + ); + }; /** * Similar to {@link EllipsoidalOccluder#computeHorizonCullingPointFromVertices} except computes the culling @@ -298,28 +287,22 @@ EllipsoidalOccluder.prototype.computeHorizonCullingPointFromVertices = function * @param {Cartesian3} [result] The instance on which to store the result instead of allocating a new instance. * @returns {Cartesian3} The computed horizon culling point, expressed in the possibly-shrunk ellipsoid-scaled space. */ -EllipsoidalOccluder.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid = function ( - directionToPoint, - vertices, - stride, - center, - minimumHeight, - result -) { - const possiblyShrunkEllipsoid = getPossiblyShrunkEllipsoid( - this._ellipsoid, - minimumHeight, - scratchEllipsoidShrunk - ); - return computeHorizonCullingPointFromVertices( - possiblyShrunkEllipsoid, - directionToPoint, - vertices, - stride, - center, - result - ); -}; +EllipsoidalOccluder.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid = + function (directionToPoint, vertices, stride, center, minimumHeight, result) { + const possiblyShrunkEllipsoid = getPossiblyShrunkEllipsoid( + this._ellipsoid, + minimumHeight, + scratchEllipsoidShrunk, + ); + return computeHorizonCullingPointFromVertices( + possiblyShrunkEllipsoid, + directionToPoint, + vertices, + stride, + center, + result, + ); + }; const subsampleScratch = []; @@ -335,31 +318,28 @@ const subsampleScratch = []; * @param {Cartesian3} [result] The instance on which to store the result instead of allocating a new instance. * @returns {Cartesian3} The computed horizon culling point, expressed in the ellipsoid-scaled space. */ -EllipsoidalOccluder.prototype.computeHorizonCullingPointFromRectangle = function ( - rectangle, - ellipsoid, - result -) { - //>>includeStart('debug', pragmas.debug); - Check.typeOf.object("rectangle", rectangle); - //>>includeEnd('debug'); - - const positions = Rectangle.subsample( - rectangle, - ellipsoid, - 0.0, - subsampleScratch - ); - const bs = BoundingSphere.fromPoints(positions); +EllipsoidalOccluder.prototype.computeHorizonCullingPointFromRectangle = + function (rectangle, ellipsoid, result) { + //>>includeStart('debug', pragmas.debug); + Check.typeOf.object("rectangle", rectangle); + //>>includeEnd('debug'); + + const positions = Rectangle.subsample( + rectangle, + ellipsoid, + 0.0, + subsampleScratch, + ); + const bs = BoundingSphere.fromPoints(positions); - // If the bounding sphere center is too close to the center of the occluder, it doesn't make - // sense to try to horizon cull it. - if (Cartesian3.magnitude(bs.center) < 0.1 * ellipsoid.minimumRadius) { - return undefined; - } + // If the bounding sphere center is too close to the center of the occluder, it doesn't make + // sense to try to horizon cull it. + if (Cartesian3.magnitude(bs.center) < 0.1 * ellipsoid.minimumRadius) { + return undefined; + } - return this.computeHorizonCullingPoint(bs.center, positions, result); -}; + return this.computeHorizonCullingPoint(bs.center, positions, result); + }; const scratchEllipsoidShrunkRadii = new Cartesian3(); @@ -373,7 +353,7 @@ function getPossiblyShrunkEllipsoid(ellipsoid, minimumHeight, result) { ellipsoid.radii.x + minimumHeight, ellipsoid.radii.y + minimumHeight, ellipsoid.radii.z + minimumHeight, - scratchEllipsoidShrunkRadii + scratchEllipsoidShrunkRadii, ); ellipsoid = Ellipsoid.fromCartesian3(ellipsoidShrunkRadii, result); } @@ -384,7 +364,7 @@ function computeHorizonCullingPointFromPositions( ellipsoid, directionToPoint, positions, - result + result, ) { //>>includeStart('debug', pragmas.debug); Check.typeOf.object("directionToPoint", directionToPoint); @@ -397,7 +377,7 @@ function computeHorizonCullingPointFromPositions( const scaledSpaceDirectionToPoint = computeScaledSpaceDirectionToPoint( ellipsoid, - directionToPoint + directionToPoint, ); let resultMagnitude = 0.0; @@ -406,7 +386,7 @@ function computeHorizonCullingPointFromPositions( const candidateMagnitude = computeMagnitude( ellipsoid, position, - scaledSpaceDirectionToPoint + scaledSpaceDirectionToPoint, ); if (candidateMagnitude < 0.0) { // all points should face the same direction, but this one doesn't, so return undefined @@ -426,7 +406,7 @@ function computeHorizonCullingPointFromVertices( vertices, stride, center, - result + result, ) { //>>includeStart('debug', pragmas.debug); Check.typeOf.object("directionToPoint", directionToPoint); @@ -442,7 +422,7 @@ function computeHorizonCullingPointFromVertices( center = defaultValue(center, Cartesian3.ZERO); const scaledSpaceDirectionToPoint = computeScaledSpaceDirectionToPoint( ellipsoid, - directionToPoint + directionToPoint, ); let resultMagnitude = 0.0; @@ -454,7 +434,7 @@ function computeHorizonCullingPointFromVertices( const candidateMagnitude = computeMagnitude( ellipsoid, positionScratch, - scaledSpaceDirectionToPoint + scaledSpaceDirectionToPoint, ); if (candidateMagnitude < 0.0) { // all points should face the same direction, but this one doesn't, so return undefined @@ -469,7 +449,7 @@ function computeHorizonCullingPointFromVertices( function isScaledSpacePointVisible( occludeeScaledSpacePosition, cameraPositionInScaledSpace, - distanceToLimbInScaledSpaceSquared + distanceToLimbInScaledSpaceSquared, ) { // See https://cesium.com/blog/2013/04/25/Horizon-culling/ const cv = cameraPositionInScaledSpace; @@ -477,7 +457,7 @@ function isScaledSpacePointVisible( const vt = Cartesian3.subtract( occludeeScaledSpacePosition, cv, - scratchCartesian + scratchCartesian, ); const vtDotVc = -Cartesian3.dot(vt, cv); // If vhMagnitudeSquared < 0 then we are below the surface of the ellipsoid and @@ -497,14 +477,14 @@ const directionScratch = new Cartesian3(); function computeMagnitude(ellipsoid, position, scaledSpaceDirectionToPoint) { const scaledSpacePosition = ellipsoid.transformPositionToScaledSpace( position, - scaledSpaceScratch + scaledSpaceScratch, ); let magnitudeSquared = Cartesian3.magnitudeSquared(scaledSpacePosition); let magnitude = Math.sqrt(magnitudeSquared); const direction = Cartesian3.divideByScalar( scaledSpacePosition, magnitude, - directionScratch + directionScratch, ); // For the purpose of this computation, points below the ellipsoid are consider to be on it instead. @@ -513,7 +493,7 @@ function computeMagnitude(ellipsoid, position, scaledSpaceDirectionToPoint) { const cosAlpha = Cartesian3.dot(direction, scaledSpaceDirectionToPoint); const sinAlpha = Cartesian3.magnitude( - Cartesian3.cross(direction, scaledSpaceDirectionToPoint, direction) + Cartesian3.cross(direction, scaledSpaceDirectionToPoint, direction), ); const cosBeta = 1.0 / magnitude; const sinBeta = Math.sqrt(magnitudeSquared - 1.0) * cosBeta; @@ -524,7 +504,7 @@ function computeMagnitude(ellipsoid, position, scaledSpaceDirectionToPoint) { function magnitudeToPoint( scaledSpaceDirectionToPoint, resultMagnitude, - result + result, ) { // The horizon culling point is undefined if there were no positions from which to compute it, // the directionToPoint is pointing opposite all of the positions, or if we computed NaN or infinity. @@ -539,7 +519,7 @@ function magnitudeToPoint( return Cartesian3.multiplyByScalar( scaledSpaceDirectionToPoint, resultMagnitude, - result + result, ); } @@ -552,7 +532,7 @@ function computeScaledSpaceDirectionToPoint(ellipsoid, directionToPoint) { ellipsoid.transformPositionToScaledSpace( directionToPoint, - directionToPointScratch + directionToPointScratch, ); return Cartesian3.normalize(directionToPointScratch, directionToPointScratch); } diff --git a/packages/engine/Source/Core/FeatureDetection.js b/packages/engine/Source/Core/FeatureDetection.js index 795f79e34e4b..425b247ecb95 100644 --- a/packages/engine/Source/Core/FeatureDetection.js +++ b/packages/engine/Source/Core/FeatureDetection.js @@ -104,7 +104,7 @@ function isInternetExplorer() { } } else if (theNavigator.appName === "Netscape") { fields = /Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec( - theNavigator.userAgent + theNavigator.userAgent, ); if (fields !== null) { isInternetExplorerResult = true; @@ -200,7 +200,7 @@ function supportsImageRenderingPixelated() { const canvas = document.createElement("canvas"); canvas.setAttribute( "style", - "image-rendering: -moz-crisp-edges;" + "image-rendering: pixelated;" + "image-rendering: -moz-crisp-edges;" + "image-rendering: pixelated;", ); //canvas.style.imageRendering will be undefined, null or an empty string on unsupported browsers. const tmp = canvas.style.imageRendering; @@ -222,7 +222,7 @@ function supportsWebP() { //>>includeStart('debug', pragmas.debug); if (!supportsWebP.initialized) { throw new DeveloperError( - "You must call FeatureDetection.supportsWebP.initialize and wait for the promise to resolve before calling FeatureDetection.supportsWebP" + "You must call FeatureDetection.supportsWebP.initialize and wait for the promise to resolve before calling FeatureDetection.supportsWebP", ); } //>>includeEnd('debug'); @@ -271,7 +271,7 @@ if (typeof ArrayBuffer !== "undefined") { Int32Array, Uint32Array, Float32Array, - Float64Array + Float64Array, ); if (typeof Uint8ClampedArray !== "undefined") { diff --git a/packages/engine/Source/Core/FrustumGeometry.js b/packages/engine/Source/Core/FrustumGeometry.js index 46fcb8cfb785..ab6896739f8e 100644 --- a/packages/engine/Source/Core/FrustumGeometry.js +++ b/packages/engine/Source/Core/FrustumGeometry.js @@ -147,14 +147,14 @@ FrustumGeometry.unpack = function (array, startingIndex, result) { frustum = PerspectiveFrustum.unpack( array, startingIndex, - scratchPackPerspective + scratchPackPerspective, ); startingIndex += PerspectiveFrustum.packedLength; } else { frustum = OrthographicFrustum.unpack( array, startingIndex, - scratchPackOrthographic + scratchPackOrthographic, ); startingIndex += OrthographicFrustum.packedLength; } @@ -164,13 +164,13 @@ FrustumGeometry.unpack = function (array, startingIndex, result) { const orientation = Quaternion.unpack( array, startingIndex, - scratchPackQuaternion + scratchPackQuaternion, ); startingIndex += Quaternion.packedLength; const vertexFormat = VertexFormat.unpack( array, startingIndex, - scratchVertexFormat + scratchVertexFormat, ); startingIndex += VertexFormat.packedLength; const drawNearPlane = array[startingIndex] === 1.0; @@ -206,7 +206,7 @@ function getAttributes( st, normal, tangent, - bitangent + bitangent, ) { const stOffset = (offset / 3) * 2; @@ -271,11 +271,11 @@ FrustumGeometry._computeNearFarPlanes = function ( positions, xDirection, yDirection, - zDirection + zDirection, ) { const rotationMatrix = Matrix3.fromQuaternion( orientation, - scratchRotationMatrix + scratchRotationMatrix, ); let x = defaultValue(xDirection, scratchXDirection); let y = defaultValue(yDirection, scratchYDirection); @@ -300,11 +300,11 @@ FrustumGeometry._computeNearFarPlanes = function ( const viewProjection = Matrix4.multiply( projection, view, - scratchInverseMatrix + scratchInverseMatrix, ); inverseViewProjection = Matrix4.inverse( viewProjection, - scratchInverseMatrix + scratchInverseMatrix, ); } else { inverseView = Matrix4.inverseTransformation(view, scratchInverseMatrix); @@ -323,7 +323,7 @@ FrustumGeometry._computeNearFarPlanes = function ( for (let j = 0; j < 4; ++j) { let corner = Cartesian4.clone( frustumCornersNDC[j], - scratchFrustumCorners[j] + scratchFrustumCorners[j], ); if (!defined(inverseViewProjection)) { @@ -353,7 +353,7 @@ FrustumGeometry._computeNearFarPlanes = function ( corner = Matrix4.multiplyByVector( inverseViewProjection, corner, - corner + corner, ); // Reverse perspective divide @@ -396,7 +396,7 @@ FrustumGeometry.createGeometry = function (frustumGeometry) { orientation, frustumType, frustum, - positions + positions, ); // -x plane @@ -513,7 +513,7 @@ FrustumGeometry.createGeometry = function (frustumGeometry) { st, negativeX, negativeZ, - y + y, ); // -x offset += 3 * 4; getAttributes( @@ -524,7 +524,7 @@ FrustumGeometry.createGeometry = function (frustumGeometry) { st, negativeY, negativeZ, - negativeX + negativeX, ); // -y offset += 3 * 4; getAttributes(offset, normals, tangents, bitangents, st, x, z, y); // +x diff --git a/packages/engine/Source/Core/FrustumOutlineGeometry.js b/packages/engine/Source/Core/FrustumOutlineGeometry.js index e49aea1bd141..f77783980bd0 100644 --- a/packages/engine/Source/Core/FrustumOutlineGeometry.js +++ b/packages/engine/Source/Core/FrustumOutlineGeometry.js @@ -134,14 +134,14 @@ FrustumOutlineGeometry.unpack = function (array, startingIndex, result) { frustum = PerspectiveFrustum.unpack( array, startingIndex, - scratchPackPerspective + scratchPackPerspective, ); startingIndex += PerspectiveFrustum.packedLength; } else { frustum = OrthographicFrustum.unpack( array, startingIndex, - scratchPackOrthographic + scratchPackOrthographic, ); startingIndex += OrthographicFrustum.packedLength; } @@ -151,7 +151,7 @@ FrustumOutlineGeometry.unpack = function (array, startingIndex, result) { const orientation = Quaternion.unpack( array, startingIndex, - scratchPackQuaternion + scratchPackQuaternion, ); startingIndex += Quaternion.packedLength; const drawNearPlane = array[startingIndex] === 1.0; @@ -196,7 +196,7 @@ FrustumOutlineGeometry.createGeometry = function (frustumGeometry) { orientation, frustumType, frustum, - positions + positions, ); const attributes = new GeometryAttributes({ diff --git a/packages/engine/Source/Core/GeographicTilingScheme.js b/packages/engine/Source/Core/GeographicTilingScheme.js index ca2449b6b015..f23d5d4c98ab 100644 --- a/packages/engine/Source/Core/GeographicTilingScheme.js +++ b/packages/engine/Source/Core/GeographicTilingScheme.js @@ -32,11 +32,11 @@ function GeographicTilingScheme(options) { this._projection = new GeographicProjection(this._ellipsoid); this._numberOfLevelZeroTilesX = defaultValue( options.numberOfLevelZeroTilesX, - 2 + 2, ); this._numberOfLevelZeroTilesY = defaultValue( options.numberOfLevelZeroTilesY, - 1 + 1, ); } @@ -107,7 +107,7 @@ GeographicTilingScheme.prototype.getNumberOfYTilesAtLevel = function (level) { */ GeographicTilingScheme.prototype.rectangleToNativeRectangle = function ( rectangle, - result + result, ) { //>>includeStart('debug', pragmas.debug); Check.defined("rectangle", rectangle); @@ -145,7 +145,7 @@ GeographicTilingScheme.prototype.tileXYToNativeRectangle = function ( x, y, level, - result + result, ) { const rectangleRadians = this.tileXYToRectangle(x, y, level, result); rectangleRadians.west = CesiumMath.toDegrees(rectangleRadians.west); @@ -170,7 +170,7 @@ GeographicTilingScheme.prototype.tileXYToRectangle = function ( x, y, level, - result + result, ) { const rectangle = this._rectangle; @@ -210,7 +210,7 @@ GeographicTilingScheme.prototype.tileXYToRectangle = function ( GeographicTilingScheme.prototype.positionToTileXY = function ( position, level, - result + result, ) { const rectangle = this._rectangle; if (!Rectangle.contains(rectangle, position)) { diff --git a/packages/engine/Source/Core/Geometry.js b/packages/engine/Source/Core/Geometry.js index bbde3c60b1d0..6c134fd02d6d 100644 --- a/packages/engine/Source/Core/Geometry.js +++ b/packages/engine/Source/Core/Geometry.js @@ -137,7 +137,7 @@ function Geometry(options) { */ this.primitiveType = defaultValue( options.primitiveType, - PrimitiveType.TRIANGLES + PrimitiveType.TRIANGLES, ); /** @@ -194,7 +194,7 @@ Geometry.computeNumberOfVertices = function (geometry) { //>>includeStart('debug', pragmas.debug); if (numberOfVertices !== num && numberOfVertices !== -1) { throw new DeveloperError( - "All attribute lists must have the same number of attributes." + "All attribute lists must have the same number of attributes.", ); } //>>includeEnd('debug'); @@ -252,7 +252,7 @@ Geometry._textureCoordinateRotationPoints = function ( positions, stRotation, ellipsoid, - boundingRectangle + boundingRectangle, ) { let i; @@ -262,21 +262,21 @@ Geometry._textureCoordinateRotationPoints = function ( // aka "ENU texture space." const rectangleCenter = Rectangle.center( boundingRectangle, - rectangleCenterScratch + rectangleCenterScratch, ); const enuCenter = Cartographic.toCartesian( rectangleCenter, ellipsoid, - enuCenterScratch + enuCenterScratch, ); const enuToFixedFrame = Transforms.eastNorthUpToFixedFrame( enuCenter, ellipsoid, - fixedFrameToEnuScratch + fixedFrameToEnuScratch, ); const fixedFrameToEnu = Matrix4.inverse( enuToFixedFrame, - fixedFrameToEnuScratch + fixedFrameToEnuScratch, ); const boundingPointsEnu = boundingRectanglePointsEnuScratch; @@ -306,11 +306,11 @@ Geometry._textureCoordinateRotationPoints = function ( const rotation = Quaternion.fromAxisAngle( Cartesian3.UNIT_Z, -stRotation, - enuRotationScratch + enuRotationScratch, ); const textureMatrix = Matrix3.fromQuaternion( rotation, - enuRotationMatrixScratch + enuRotationMatrixScratch, ); const positionsLength = positions.length; @@ -322,7 +322,7 @@ Geometry._textureCoordinateRotationPoints = function ( posEnu = Matrix4.multiplyByPointAsVector( fixedFrameToEnu, positions[i], - posEnu + posEnu, ); posEnu = Matrix3.multiplyByVector(textureMatrix, posEnu, posEnu); @@ -334,7 +334,7 @@ Geometry._textureCoordinateRotationPoints = function ( const toDesiredInComputed = Matrix2.fromRotation( stRotation, - rotation2DScratch + rotation2DScratch, ); const points2D = points2DScratch; diff --git a/packages/engine/Source/Core/GeometryAttribute.js b/packages/engine/Source/Core/GeometryAttribute.js index 91713c415120..9f4d442c0a7a 100644 --- a/packages/engine/Source/Core/GeometryAttribute.js +++ b/packages/engine/Source/Core/GeometryAttribute.js @@ -52,7 +52,7 @@ function GeometryAttribute(options) { options.componentsPerAttribute > 4 ) { throw new DeveloperError( - "options.componentsPerAttribute must be between 1 and 4." + "options.componentsPerAttribute must be between 1 and 4.", ); } if (!defined(options.values)) { diff --git a/packages/engine/Source/Core/GeometryInstance.js b/packages/engine/Source/Core/GeometryInstance.js index da62fe0f302f..18ad60900919 100644 --- a/packages/engine/Source/Core/GeometryInstance.js +++ b/packages/engine/Source/Core/GeometryInstance.js @@ -76,7 +76,7 @@ function GeometryInstance(options) { * @default Matrix4.IDENTITY */ this.modelMatrix = Matrix4.clone( - defaultValue(options.modelMatrix, Matrix4.IDENTITY) + defaultValue(options.modelMatrix, Matrix4.IDENTITY), ); /** diff --git a/packages/engine/Source/Core/GeometryInstanceAttribute.js b/packages/engine/Source/Core/GeometryInstanceAttribute.js index 240ced324bd4..d00730c92778 100644 --- a/packages/engine/Source/Core/GeometryInstanceAttribute.js +++ b/packages/engine/Source/Core/GeometryInstanceAttribute.js @@ -54,7 +54,7 @@ function GeometryInstanceAttribute(options) { options.componentsPerAttribute > 4 ) { throw new DeveloperError( - "options.componentsPerAttribute must be between 1 and 4." + "options.componentsPerAttribute must be between 1 and 4.", ); } if (!defined(options.value)) { diff --git a/packages/engine/Source/Core/GeometryPipeline.js b/packages/engine/Source/Core/GeometryPipeline.js index 9bb1a5c79086..7b7dd96b12d4 100644 --- a/packages/engine/Source/Core/GeometryPipeline.js +++ b/packages/engine/Source/Core/GeometryPipeline.js @@ -72,7 +72,7 @@ function triangleStripToLines(triangles) { index, triangles[i - 1], triangles[i], - triangles[i - 2] + triangles[i - 2], ); } @@ -138,7 +138,7 @@ GeometryPipeline.toWireframe = function (geometry) { //>>includeStart('debug', pragmas.debug); default: throw new DeveloperError( - "geometry.primitiveType must be TRIANGLES, TRIANGLE_STRIP, or TRIANGLE_FAN." + "geometry.primitiveType must be TRIANGLES, TRIANGLE_STRIP, or TRIANGLE_FAN.", ); //>>includeEnd('debug'); } @@ -167,7 +167,7 @@ GeometryPipeline.toWireframe = function (geometry) { GeometryPipeline.createLineSegmentsForVectors = function ( geometry, attributeName, - length + length, ) { attributeName = defaultValue(attributeName, "normal"); @@ -180,7 +180,7 @@ GeometryPipeline.createLineSegmentsForVectors = function ( } if (!defined(geometry.attributes[attributeName])) { throw new DeveloperError( - `geometry.attributes must have an attribute with the same name as the attributeName parameter, ${attributeName}.` + `geometry.attributes must have an attribute with the same name as the attributeName parameter, ${attributeName}.`, ); } //>>includeEnd('debug'); @@ -368,7 +368,7 @@ GeometryPipeline.reorderForPreVertexCache = function (geometry) { const numComponents = attribute.componentsPerAttribute; const elementsOut = ComponentDatatype.createTypedArray( attribute.componentDatatype, - nextIndex * numComponents + nextIndex * numComponents, ); while (intoElementsIn < numVertices) { const temp = indexCrossReferenceOldToNew[intoElementsIn]; @@ -409,7 +409,7 @@ GeometryPipeline.reorderForPreVertexCache = function (geometry) { */ GeometryPipeline.reorderForPostVertexCache = function ( geometry, - cacheCapacity + cacheCapacity, ) { //>>includeStart('debug', pragmas.debug); if (!defined(geometry)) { @@ -469,7 +469,7 @@ function copyVertex(destinationAttributes, sourceAttributes, index) { for (let k = 0; k < attr.componentsPerAttribute; ++k) { destinationAttributes[attribute].values.push( - attr.values[index * attr.componentsPerAttribute + k] + attr.values[index * attr.componentsPerAttribute + k], ); } } @@ -505,7 +505,7 @@ GeometryPipeline.fitToUnsignedShortIndices = function (geometry) { geometry.primitiveType !== PrimitiveType.POINTS ) { throw new DeveloperError( - "geometry.primitiveType must equal to PrimitiveType.TRIANGLES, PrimitiveType.LINES, or PrimitiveType.POINTS." + "geometry.primitiveType must equal to PrimitiveType.TRIANGLES, PrimitiveType.LINES, or PrimitiveType.POINTS.", ); } //>>includeEnd('debug'); @@ -560,7 +560,7 @@ GeometryPipeline.fitToUnsignedShortIndices = function (geometry) { primitiveType: geometry.primitiveType, boundingSphere: geometry.boundingSphere, boundingSphereCV: geometry.boundingSphereCV, - }) + }), ); // Reset for next vertex-array @@ -579,7 +579,7 @@ GeometryPipeline.fitToUnsignedShortIndices = function (geometry) { primitiveType: geometry.primitiveType, boundingSphere: geometry.boundingSphere, boundingSphereCV: geometry.boundingSphereCV, - }) + }), ); } } else { @@ -619,7 +619,7 @@ GeometryPipeline.projectTo2D = function ( attributeName, attributeName3D, attributeName2D, - projection + projection, ) { //>>includeStart('debug', pragmas.debug); if (!defined(geometry)) { @@ -636,7 +636,7 @@ GeometryPipeline.projectTo2D = function ( } if (!defined(geometry.attributes[attributeName])) { throw new DeveloperError( - `geometry must have attribute matching the attributeName argument: ${attributeName}.` + `geometry must have attribute matching the attributeName argument: ${attributeName}.`, ); } if ( @@ -644,7 +644,7 @@ GeometryPipeline.projectTo2D = function ( ComponentDatatype.DOUBLE ) { throw new DeveloperError( - "The attribute componentDatatype must be ComponentDatatype.DOUBLE." + "The attribute componentDatatype must be ComponentDatatype.DOUBLE.", ); } //>>includeEnd('debug'); @@ -662,24 +662,24 @@ GeometryPipeline.projectTo2D = function ( const value = Cartesian3.fromArray( values3D, i, - scratchProjectTo2DCartesian3 + scratchProjectTo2DCartesian3, ); const lonLat = ellipsoid.cartesianToCartographic( value, - scratchProjectTo2DCartographic + scratchProjectTo2DCartographic, ); //>>includeStart('debug', pragmas.debug); if (!defined(lonLat)) { throw new DeveloperError( - `Could not project point (${value.x}, ${value.y}, ${value.z}) to 2D.` + `Could not project point (${value.x}, ${value.y}, ${value.z}) to 2D.`, ); } //>>includeEnd('debug'); const projectedLonLat = projection.project( lonLat, - scratchProjectTo2DCartesian3 + scratchProjectTo2DCartesian3, ); projectedValues[index++] = projectedLonLat.x; @@ -729,7 +729,7 @@ GeometryPipeline.encodeAttribute = function ( geometry, attributeName, attributeHighName, - attributeLowName + attributeLowName, ) { //>>includeStart('debug', pragmas.debug); if (!defined(geometry)) { @@ -746,7 +746,7 @@ GeometryPipeline.encodeAttribute = function ( } if (!defined(geometry.attributes[attributeName])) { throw new DeveloperError( - `geometry must have attribute matching the attributeName argument: ${attributeName}.` + `geometry must have attribute matching the attributeName argument: ${attributeName}.`, ); } if ( @@ -754,7 +754,7 @@ GeometryPipeline.encodeAttribute = function ( ComponentDatatype.DOUBLE ) { throw new DeveloperError( - "The attribute componentDatatype must be ComponentDatatype.DOUBLE." + "The attribute componentDatatype must be ComponentDatatype.DOUBLE.", ); } //>>includeEnd('debug'); @@ -811,7 +811,7 @@ function transformVector(matrix, attribute) { Matrix3.multiplyByVector(matrix, scratchCartesian3, scratchCartesian3); scratchCartesian3 = Cartesian3.normalize( scratchCartesian3, - scratchCartesian3 + scratchCartesian3, ); Cartesian3.pack(scratchCartesian3, values, i); } @@ -873,7 +873,7 @@ GeometryPipeline.transformToWorldCoordinates = function (instance) { instance.geometry.boundingSphere = BoundingSphere.transform( boundingSphere, modelMatrix, - boundingSphere + boundingSphere, ); } @@ -925,7 +925,7 @@ function findAttributesInAllGeometries(instances, propertyName) { normalize: attribute.normalize, values: ComponentDatatype.createTypedArray( attribute.componentDatatype, - numberOfComponents + numberOfComponents, ), }); } @@ -956,12 +956,12 @@ function combineGeometries(instances, propertyName) { } if (defined(instances[i][propertyName].indices) !== haveIndices) { throw new DeveloperError( - "All instance geometries must have an indices or not have one." + "All instance geometries must have an indices or not have one.", ); } if (instances[i][propertyName].primitiveType !== primitiveType) { throw new DeveloperError( - "All instance geometries must have the same primitiveType." + "All instance geometries must have the same primitiveType.", ); } } @@ -1003,11 +1003,11 @@ function combineGeometries(instances, propertyName) { new Geometry({ attributes: attributes, primitiveType: PrimitiveType.POINTS, - }) + }), ); const destIndices = IndexDatatype.createTypedArray( numberOfVertices, - numberOfIndices + numberOfIndices, ); let destOffset = 0; @@ -1050,7 +1050,7 @@ function combineGeometries(instances, propertyName) { bs = instances[i][propertyName].boundingSphere; const tempRadius = Cartesian3.magnitude( - Cartesian3.subtract(bs.center, center, tempScratch) + Cartesian3.subtract(bs.center, center, tempScratch), ) + bs.radius; if (tempRadius > radius) { @@ -1103,7 +1103,7 @@ GeometryPipeline.combineInstances = function (instances) { //>>includeStart('debug', pragmas.debug); if (!defined(instances) || instances.length < 1) { throw new DeveloperError( - "instances is required and must have length greater than zero." + "instances is required and must have length greater than zero.", ); } //>>includeEnd('debug'); @@ -1131,10 +1131,10 @@ GeometryPipeline.combineInstances = function (instances) { if (instanceSplitGeometry.length > 0) { geometries.push( - combineGeometries(instanceSplitGeometry, "westHemisphereGeometry") + combineGeometries(instanceSplitGeometry, "westHemisphereGeometry"), ); geometries.push( - combineGeometries(instanceSplitGeometry, "eastHemisphereGeometry") + combineGeometries(instanceSplitGeometry, "eastHemisphereGeometry"), ); } @@ -1170,7 +1170,7 @@ GeometryPipeline.computeNormal = function (geometry) { !defined(geometry.attributes.position.values) ) { throw new DeveloperError( - "geometry.attributes.position.values is required." + "geometry.attributes.position.values is required.", ); } if (!defined(geometry.indices)) { @@ -1178,12 +1178,12 @@ GeometryPipeline.computeNormal = function (geometry) { } if (geometry.indices.length < 2 || geometry.indices.length % 3 !== 0) { throw new DeveloperError( - "geometry.indices length must be greater than 0 and be a multiple of 3." + "geometry.indices length must be greater than 0 and be a multiple of 3.", ); } if (geometry.primitiveType !== PrimitiveType.TRIANGLES) { throw new DeveloperError( - "geometry.primitiveType must be PrimitiveType.TRIANGLES." + "geometry.primitiveType must be PrimitiveType.TRIANGLES.", ); } //>>includeEnd('debug'); @@ -1271,7 +1271,7 @@ GeometryPipeline.computeNormal = function (geometry) { Cartesian3.add( normal, normalsPerTriangle[normalIndices[vertexNormalData.indexOffset + j]], - normal + normal, ); } @@ -1281,7 +1281,7 @@ GeometryPipeline.computeNormal = function (geometry) { ) { Cartesian3.clone( normalsPerTriangle[normalIndices[vertexNormalData.indexOffset]], - normal + normal, ); } } @@ -1344,7 +1344,7 @@ GeometryPipeline.computeTangentAndBitangent = function (geometry) { //>>includeStart('debug', pragmas.debug); if (!defined(attributes.position) || !defined(attributes.position.values)) { throw new DeveloperError( - "geometry.attributes.position.values is required." + "geometry.attributes.position.values is required.", ); } if (!defined(attributes.normal) || !defined(attributes.normal.values)) { @@ -1358,12 +1358,12 @@ GeometryPipeline.computeTangentAndBitangent = function (geometry) { } if (indices.length < 2 || indices.length % 3 !== 0) { throw new DeveloperError( - "geometry.indices length must be greater than 0 and be a multiple of 3." + "geometry.indices length must be greater than 0 and be a multiple of 3.", ); } if (geometry.primitiveType !== PrimitiveType.TRIANGLES) { throw new DeveloperError( - "geometry.primitiveType must be PrimitiveType.TRIANGLES." + "geometry.primitiveType must be PrimitiveType.TRIANGLES.", ); } //>>includeEnd('debug'); @@ -1504,7 +1504,7 @@ GeometryPipeline.compressVertices = function (geometry) { encodeResult2 = AttributeCompression.octEncodeInRange( toEncode1, 65535, - encodeResult2 + encodeResult2, ); compressedDirections[i2++] = encodeResult2.x; compressedDirections[i2++] = encodeResult2.y; @@ -1567,9 +1567,8 @@ GeometryPipeline.compressVertices = function (geometry) { for (i = 0; i < numVertices; ++i) { if (hasSt) { Cartesian2.fromArray(st, i * 2.0, scratchCartesian2); - compressedAttributes[ - normalIndex++ - ] = AttributeCompression.compressTextureCoordinates(scratchCartesian2); + compressedAttributes[normalIndex++] = + AttributeCompression.compressTextureCoordinates(scratchCartesian2); } const index = i * 3.0; @@ -1582,30 +1581,27 @@ GeometryPipeline.compressVertices = function (geometry) { toEncode1, toEncode2, toEncode3, - scratchCartesian2 + scratchCartesian2, ); compressedAttributes[normalIndex++] = scratchCartesian2.x; compressedAttributes[normalIndex++] = scratchCartesian2.y; } else { if (hasNormal) { Cartesian3.fromArray(normals, index, toEncode1); - compressedAttributes[ - normalIndex++ - ] = AttributeCompression.octEncodeFloat(toEncode1); + compressedAttributes[normalIndex++] = + AttributeCompression.octEncodeFloat(toEncode1); } if (hasTangent) { Cartesian3.fromArray(tangents, index, toEncode1); - compressedAttributes[ - normalIndex++ - ] = AttributeCompression.octEncodeFloat(toEncode1); + compressedAttributes[normalIndex++] = + AttributeCompression.octEncodeFloat(toEncode1); } if (hasBitangent) { Cartesian3.fromArray(bitangents, index, toEncode1); - compressedAttributes[ - normalIndex++ - ] = AttributeCompression.octEncodeFloat(toEncode1); + compressedAttributes[normalIndex++] = + AttributeCompression.octEncodeFloat(toEncode1); } } } @@ -1644,14 +1640,14 @@ function indexTriangles(geometry) { } if (numberOfVertices % 3 !== 0) { throw new DeveloperError( - "The number of vertices must be a multiple of three." + "The number of vertices must be a multiple of three.", ); } //>>includeEnd('debug'); const indices = IndexDatatype.createTypedArray( numberOfVertices, - numberOfVertices + numberOfVertices, ); for (let i = 0; i < numberOfVertices; ++i) { indices[i] = i; @@ -1672,7 +1668,7 @@ function indexTriangleFan(geometry) { const indices = IndexDatatype.createTypedArray( numberOfVertices, - (numberOfVertices - 2) * 3 + (numberOfVertices - 2) * 3, ); indices[0] = 1; indices[1] = 0; @@ -1701,7 +1697,7 @@ function indexTriangleStrip(geometry) { const indices = IndexDatatype.createTypedArray( numberOfVertices, - (numberOfVertices - 2) * 3 + (numberOfVertices - 2) * 3, ); indices[0] = 0; indices[1] = 1; @@ -1748,7 +1744,7 @@ function indexLines(geometry) { const indices = IndexDatatype.createTypedArray( numberOfVertices, - numberOfVertices + numberOfVertices, ); for (let i = 0; i < numberOfVertices; ++i) { indices[i] = i; @@ -1769,7 +1765,7 @@ function indexLineStrip(geometry) { const indices = IndexDatatype.createTypedArray( numberOfVertices, - (numberOfVertices - 1) * 2 + (numberOfVertices - 1) * 2, ); indices[0] = 0; indices[1] = 1; @@ -1795,7 +1791,7 @@ function indexLineLoop(geometry) { const indices = IndexDatatype.createTypedArray( numberOfVertices, - numberOfVertices * 2 + numberOfVertices * 2, ); indices[0] = 0; @@ -1882,9 +1878,9 @@ function getXZIntersectionOffsetPoints(p, p1, u1, v1) { Cartesian3.multiplyByScalar( Cartesian3.subtract(p1, p, c3), p.y / (p.y - p1.y), - c3 + c3, ), - u1 + u1, ); Cartesian3.clone(u1, v1); offsetPointFromXZPlane(u1, true); @@ -2021,7 +2017,7 @@ function updateGeometryAfterSplit(geometry, computeBoundingSphere) { const attribute = attributes[property]; attribute.values = ComponentDatatype.createTypedArray( attribute.componentDatatype, - attribute.values + attribute.values, ); } } @@ -2029,12 +2025,12 @@ function updateGeometryAfterSplit(geometry, computeBoundingSphere) { const numberOfVertices = Geometry.computeNumberOfVertices(geometry); geometry.indices = IndexDatatype.createTypedArray( numberOfVertices, - geometry.indices + geometry.indices, ); if (computeBoundingSphere) { geometry.boundingSphere = BoundingSphere.fromVertices( - attributes.position.values + attributes.position.values, ); } @@ -2087,7 +2083,7 @@ function updateInstanceAfterSplit(instance, westGeometry, eastGeometry) { function generateBarycentricInterpolateFunction( CartesianType, - numberOfComponents + numberOfComponents, ) { const v0Scratch = new CartesianType(); const v1Scratch = new CartesianType(); @@ -2101,22 +2097,22 @@ function generateBarycentricInterpolateFunction( sourceValues, currentValues, insertedIndex, - normalize + normalize, ) { const v0 = CartesianType.fromArray( sourceValues, i0 * numberOfComponents, - v0Scratch + v0Scratch, ); const v1 = CartesianType.fromArray( sourceValues, i1 * numberOfComponents, - v1Scratch + v1Scratch, ); const v2 = CartesianType.fromArray( sourceValues, i2 * numberOfComponents, - v2Scratch + v2Scratch, ); CartesianType.multiplyByScalar(v0, coords.x, v0); @@ -2133,22 +2129,22 @@ function generateBarycentricInterpolateFunction( CartesianType.pack( value, currentValues, - insertedIndex * numberOfComponents + insertedIndex * numberOfComponents, ); }; } const interpolateAndPackCartesian4 = generateBarycentricInterpolateFunction( Cartesian4, - 4 + 4, ); const interpolateAndPackCartesian3 = generateBarycentricInterpolateFunction( Cartesian3, - 3 + 3, ); const interpolateAndPackCartesian2 = generateBarycentricInterpolateFunction( Cartesian2, - 2 + 2, ); const interpolateAndPackBoolean = function ( i0, @@ -2157,7 +2153,7 @@ const interpolateAndPackBoolean = function ( coords, sourceValues, currentValues, - insertedIndex + insertedIndex, ) { const v1 = sourceValues[i0] * coords.x; const v2 = sourceValues[i1] * coords.y; @@ -2186,7 +2182,7 @@ function computeTriangleAttributes( customAttributeNames, customAttributesLength, allAttributes, - insertedIndex + insertedIndex, ) { if ( !defined(normals) && @@ -2216,7 +2212,7 @@ function computeTriangleAttributes( normals, currentAttributes.normal.values, insertedIndex, - true + true, ); } @@ -2247,7 +2243,7 @@ function computeTriangleAttributes( Cartesian3.pack( direction, currentAttributes.extrudeDirection.values, - insertedIndex * 3 + insertedIndex * 3, ); } @@ -2259,7 +2255,7 @@ function computeTriangleAttributes( coords, applyOffset, currentAttributes.applyOffset.values, - insertedIndex + insertedIndex, ); } @@ -2272,7 +2268,7 @@ function computeTriangleAttributes( tangents, currentAttributes.tangent.values, insertedIndex, - true + true, ); } @@ -2285,7 +2281,7 @@ function computeTriangleAttributes( bitangents, currentAttributes.bitangent.values, insertedIndex, - true + true, ); } @@ -2297,7 +2293,7 @@ function computeTriangleAttributes( coords, texCoords, currentAttributes.st.values, - insertedIndex + insertedIndex, ); } @@ -2311,7 +2307,7 @@ function computeTriangleAttributes( coords, insertedIndex, allAttributes[attributeName], - currentAttributes[attributeName] + currentAttributes[attributeName], ); } } @@ -2324,7 +2320,7 @@ function genericInterpolate( coords, insertedIndex, sourceAttribute, - currentAttribute + currentAttribute, ) { const componentsPerAttribute = sourceAttribute.componentsPerAttribute; const sourceValues = sourceAttribute.values; @@ -2339,7 +2335,7 @@ function genericInterpolate( sourceValues, currentValues, insertedIndex, - false + false, ); break; case 3: @@ -2351,7 +2347,7 @@ function genericInterpolate( sourceValues, currentValues, insertedIndex, - false + false, ); break; case 2: @@ -2363,7 +2359,7 @@ function genericInterpolate( sourceValues, currentValues, insertedIndex, - false + false, ); break; default: @@ -2380,7 +2376,7 @@ function insertSplitPoint( currentIndexMap, indices, currentIndex, - point + point, ) { const insertIndex = currentAttributes.position.values.length / 3; @@ -2503,7 +2499,7 @@ function splitLongitudeTriangles(instance) { currentIndexMap, indices, resultIndex < 3 ? i + resultIndex : -1, - point + point, ); computeTriangleAttributes( i0, @@ -2521,7 +2517,7 @@ function splitLongitudeTriangles(instance) { customAttributeNames, customAttributesLength, attributes, - insertedIndex + insertedIndex, ); } } else { @@ -2547,7 +2543,7 @@ function splitLongitudeTriangles(instance) { currentIndexMap, indices, i, - p0 + p0, ); computeTriangleAttributes( i0, @@ -2565,7 +2561,7 @@ function splitLongitudeTriangles(instance) { customAttributeNames, customAttributesLength, attributes, - insertedIndex + insertedIndex, ); insertedIndex = insertSplitPoint( @@ -2574,7 +2570,7 @@ function splitLongitudeTriangles(instance) { currentIndexMap, indices, i + 1, - p1 + p1, ); computeTriangleAttributes( i0, @@ -2592,7 +2588,7 @@ function splitLongitudeTriangles(instance) { customAttributeNames, customAttributesLength, attributes, - insertedIndex + insertedIndex, ); insertedIndex = insertSplitPoint( @@ -2601,7 +2597,7 @@ function splitLongitudeTriangles(instance) { currentIndexMap, indices, i + 2, - p2 + p2, ); computeTriangleAttributes( i0, @@ -2619,7 +2615,7 @@ function splitLongitudeTriangles(instance) { customAttributeNames, customAttributesLength, attributes, - insertedIndex + insertedIndex, ); } } @@ -2639,7 +2635,7 @@ function computeLineAttributes( positions, insertIndex, currentAttributes, - applyOffset + applyOffset, ) { if (!defined(applyOffset)) { return; @@ -2714,14 +2710,14 @@ function splitLongitudeLines(instance) { p0, p1, xzPlane, - p2Scratch + p2Scratch, ); if (defined(intersection)) { // move point on the xz-plane slightly away from the plane const offset = Cartesian3.multiplyByScalar( Cartesian3.UNIT_Y, 5.0 * CesiumMath.EPSILON9, - offsetScratch + offsetScratch, ); if (p0.y < 0.0) { Cartesian3.negate(offset, offset); @@ -2737,7 +2733,7 @@ function splitLongitudeLines(instance) { const offsetPoint = Cartesian3.add( intersection, offset, - offsetPointScratch + offsetPointScratch, ); insertIndex = insertSplitPoint( @@ -2746,7 +2742,7 @@ function splitLongitudeLines(instance) { p0IndexMap, indices, i, - p0 + p0, ); computeLineAttributes( i0, @@ -2755,7 +2751,7 @@ function splitLongitudeLines(instance) { positions, insertIndex, p0Attributes, - applyOffset + applyOffset, ); insertIndex = insertSplitPoint( @@ -2764,7 +2760,7 @@ function splitLongitudeLines(instance) { p0IndexMap, indices, -1, - offsetPoint + offsetPoint, ); computeLineAttributes( i0, @@ -2773,7 +2769,7 @@ function splitLongitudeLines(instance) { positions, insertIndex, p0Attributes, - applyOffset + applyOffset, ); Cartesian3.negate(offset, offset); @@ -2784,7 +2780,7 @@ function splitLongitudeLines(instance) { p1IndexMap, indices, -1, - offsetPoint + offsetPoint, ); computeLineAttributes( i0, @@ -2793,7 +2789,7 @@ function splitLongitudeLines(instance) { positions, insertIndex, p1Attributes, - applyOffset + applyOffset, ); insertIndex = insertSplitPoint( @@ -2802,7 +2798,7 @@ function splitLongitudeLines(instance) { p1IndexMap, indices, i + 1, - p1 + p1, ); computeLineAttributes( i0, @@ -2811,7 +2807,7 @@ function splitLongitudeLines(instance) { positions, insertIndex, p1Attributes, - applyOffset + applyOffset, ); } else { let currentAttributes; @@ -2834,7 +2830,7 @@ function splitLongitudeLines(instance) { currentIndexMap, indices, i, - p0 + p0, ); computeLineAttributes( i0, @@ -2843,7 +2839,7 @@ function splitLongitudeLines(instance) { positions, insertIndex, currentAttributes, - applyOffset + applyOffset, ); insertIndex = insertSplitPoint( @@ -2852,7 +2848,7 @@ function splitLongitudeLines(instance) { currentIndexMap, indices, i + 1, - p1 + p1, ); computeLineAttributes( i0, @@ -2861,7 +2857,7 @@ function splitLongitudeLines(instance) { positions, insertIndex, currentAttributes, - applyOffset + applyOffset, ); } } @@ -2897,7 +2893,7 @@ function updateAdjacencyAfterSplit(geometry) { const prevPosition = Cartesian3.unpack( prevPositions, j, - cartesian3Scratch2 + cartesian3Scratch2, ); if ( (position.y < 0.0 && prevPosition.y > 0.0) || @@ -2915,7 +2911,7 @@ function updateAdjacencyAfterSplit(geometry) { const nextPosition = Cartesian3.unpack( nextPositions, j, - cartesian3Scratch3 + cartesian3Scratch3, ); if ( (position.y < 0.0 && nextPosition.y > 0.0) || @@ -3002,7 +2998,7 @@ function splitLongitudePolyline(instance) { p0, p2, xzPlane, - cartesian3Scratch4 + cartesian3Scratch4, ); if (defined(intersection)) { intersectionFound = true; @@ -3011,7 +3007,7 @@ function splitLongitudePolyline(instance) { const offset = Cartesian3.multiplyByScalar( Cartesian3.UNIT_Y, offsetScalar, - cartesian3Scratch5 + cartesian3Scratch5, ); if (p0.y < 0.0) { Cartesian3.negate(offset, offset); @@ -3024,51 +3020,51 @@ function splitLongitudePolyline(instance) { const offsetPoint = Cartesian3.add( intersection, offset, - cartesian3Scratch6 + cartesian3Scratch6, ); p0Attributes.position.values.push(p0.x, p0.y, p0.z, p0.x, p0.y, p0.z); p0Attributes.position.values.push( offsetPoint.x, offsetPoint.y, - offsetPoint.z + offsetPoint.z, ); p0Attributes.position.values.push( offsetPoint.x, offsetPoint.y, - offsetPoint.z + offsetPoint.z, ); p0Attributes.prevPosition.values.push( prevPositions[i0 * 3], prevPositions[i0 * 3 + 1], - prevPositions[i0 * 3 + 2] + prevPositions[i0 * 3 + 2], ); p0Attributes.prevPosition.values.push( prevPositions[i0 * 3 + 3], prevPositions[i0 * 3 + 4], - prevPositions[i0 * 3 + 5] + prevPositions[i0 * 3 + 5], ); p0Attributes.prevPosition.values.push(p0.x, p0.y, p0.z, p0.x, p0.y, p0.z); p0Attributes.nextPosition.values.push( offsetPoint.x, offsetPoint.y, - offsetPoint.z + offsetPoint.z, ); p0Attributes.nextPosition.values.push( offsetPoint.x, offsetPoint.y, - offsetPoint.z + offsetPoint.z, ); p0Attributes.nextPosition.values.push( offsetPoint.x, offsetPoint.y, - offsetPoint.z + offsetPoint.z, ); p0Attributes.nextPosition.values.push( offsetPoint.x, offsetPoint.y, - offsetPoint.z + offsetPoint.z, ); Cartesian3.negate(offset, offset); @@ -3076,52 +3072,52 @@ function splitLongitudePolyline(instance) { p2Attributes.position.values.push( offsetPoint.x, offsetPoint.y, - offsetPoint.z + offsetPoint.z, ); p2Attributes.position.values.push( offsetPoint.x, offsetPoint.y, - offsetPoint.z + offsetPoint.z, ); p2Attributes.position.values.push(p2.x, p2.y, p2.z, p2.x, p2.y, p2.z); p2Attributes.prevPosition.values.push( offsetPoint.x, offsetPoint.y, - offsetPoint.z + offsetPoint.z, ); p2Attributes.prevPosition.values.push( offsetPoint.x, offsetPoint.y, - offsetPoint.z + offsetPoint.z, ); p2Attributes.prevPosition.values.push( offsetPoint.x, offsetPoint.y, - offsetPoint.z + offsetPoint.z, ); p2Attributes.prevPosition.values.push( offsetPoint.x, offsetPoint.y, - offsetPoint.z + offsetPoint.z, ); p2Attributes.nextPosition.values.push(p2.x, p2.y, p2.z, p2.x, p2.y, p2.z); p2Attributes.nextPosition.values.push( nextPositions[i2 * 3], nextPositions[i2 * 3 + 1], - nextPositions[i2 * 3 + 2] + nextPositions[i2 * 3 + 2], ); p2Attributes.nextPosition.values.push( nextPositions[i2 * 3 + 3], nextPositions[i2 * 3 + 4], - nextPositions[i2 * 3 + 5] + nextPositions[i2 * 3 + 5], ); const ew0 = Cartesian2.fromArray( expandAndWidths, i0 * 2, - cartesian2Scratch0 + cartesian2Scratch0, ); const width = Math.abs(ew0.y); @@ -3131,10 +3127,10 @@ function splitLongitudePolyline(instance) { p2Attributes.expandAndWidth.values.push(-1, -width, 1, -width); let t = Cartesian3.magnitudeSquared( - Cartesian3.subtract(intersection, p0, cartesian3Scratch3) + Cartesian3.subtract(intersection, p0, cartesian3Scratch3), ); t /= Cartesian3.magnitudeSquared( - Cartesian3.subtract(p2, p0, cartesian3Scratch3) + Cartesian3.subtract(p2, p0, cartesian3Scratch3), ); if (defined(colors)) { @@ -3163,7 +3159,7 @@ function splitLongitudePolyline(instance) { const s3 = Cartesian2.fromArray( texCoords, (i + 3) * 2, - cartesian2Scratch1 + cartesian2Scratch1, ); const sx = CesiumMath.lerp(s0.x, s3.x, t); diff --git a/packages/engine/Source/Core/GoogleEarthEnterpriseMetadata.js b/packages/engine/Source/Core/GoogleEarthEnterpriseMetadata.js index 50dc850c7e2c..bc485be490aa 100644 --- a/packages/engine/Source/Core/GoogleEarthEnterpriseMetadata.js +++ b/packages/engine/Source/Core/GoogleEarthEnterpriseMetadata.js @@ -26,7 +26,7 @@ function stringToBuffer(str) { // Decodes packet with a key that has been around since the beginning of Google Earth Enterprise const defaultKey = stringToBuffer( - "\x45\xf4\xbd\x0b\x79\xe2\x6a\x45\x22\x05\x92\x2c\x17\xcd\x06\x71\xf8\x49\x10\x46\x67\x51\x00\x42\x25\xc6\xe8\x61\x2c\x66\x29\x08\xc6\x34\xdc\x6a\x62\x25\x79\x0a\x77\x1d\x6d\x69\xd6\xf0\x9c\x6b\x93\xa1\xbd\x4e\x75\xe0\x41\x04\x5b\xdf\x40\x56\x0c\xd9\xbb\x72\x9b\x81\x7c\x10\x33\x53\xee\x4f\x6c\xd4\x71\x05\xb0\x7b\xc0\x7f\x45\x03\x56\x5a\xad\x77\x55\x65\x0b\x33\x92\x2a\xac\x19\x6c\x35\x14\xc5\x1d\x30\x73\xf8\x33\x3e\x6d\x46\x38\x4a\xb4\xdd\xf0\x2e\xdd\x17\x75\x16\xda\x8c\x44\x74\x22\x06\xfa\x61\x22\x0c\x33\x22\x53\x6f\xaf\x39\x44\x0b\x8c\x0e\x39\xd9\x39\x13\x4c\xb9\xbf\x7f\xab\x5c\x8c\x50\x5f\x9f\x22\x75\x78\x1f\xe9\x07\x71\x91\x68\x3b\xc1\xc4\x9b\x7f\xf0\x3c\x56\x71\x48\x82\x05\x27\x55\x66\x59\x4e\x65\x1d\x98\x75\xa3\x61\x46\x7d\x61\x3f\x15\x41\x00\x9f\x14\x06\xd7\xb4\x34\x4d\xce\x13\x87\x46\xb0\x1a\xd5\x05\x1c\xb8\x8a\x27\x7b\x8b\xdc\x2b\xbb\x4d\x67\x30\xc8\xd1\xf6\x5c\x8f\x50\xfa\x5b\x2f\x46\x9b\x6e\x35\x18\x2f\x27\x43\x2e\xeb\x0a\x0c\x5e\x10\x05\x10\xa5\x73\x1b\x65\x34\xe5\x6c\x2e\x6a\x43\x27\x63\x14\x23\x55\xa9\x3f\x71\x7b\x67\x43\x7d\x3a\xaf\xcd\xe2\x54\x55\x9c\xfd\x4b\xc6\xe2\x9f\x2f\x28\xed\xcb\x5c\xc6\x2d\x66\x07\x88\xa7\x3b\x2f\x18\x2a\x22\x4e\x0e\xb0\x6b\x2e\xdd\x0d\x95\x7d\x7d\x47\xba\x43\xb2\x11\xb2\x2b\x3e\x4d\xaa\x3e\x7d\xe6\xce\x49\x89\xc6\xe6\x78\x0c\x61\x31\x05\x2d\x01\xa4\x4f\xa5\x7e\x71\x20\x88\xec\x0d\x31\xe8\x4e\x0b\x00\x6e\x50\x68\x7d\x17\x3d\x08\x0d\x17\x95\xa6\x6e\xa3\x68\x97\x24\x5b\x6b\xf3\x17\x23\xf3\xb6\x73\xb3\x0d\x0b\x40\xc0\x9f\xd8\x04\x51\x5d\xfa\x1a\x17\x22\x2e\x15\x6a\xdf\x49\x00\xb9\xa0\x77\x55\xc6\xef\x10\x6a\xbf\x7b\x47\x4c\x7f\x83\x17\x05\xee\xdc\xdc\x46\x85\xa9\xad\x53\x07\x2b\x53\x34\x06\x07\xff\x14\x94\x59\x19\x02\xe4\x38\xe8\x31\x83\x4e\xb9\x58\x46\x6b\xcb\x2d\x23\x86\x92\x70\x00\x35\x88\x22\xcf\x31\xb2\x26\x2f\xe7\xc3\x75\x2d\x36\x2c\x72\x74\xb0\x23\x47\xb7\xd3\xd1\x26\x16\x85\x37\x72\xe2\x00\x8c\x44\xcf\x10\xda\x33\x2d\x1a\xde\x60\x86\x69\x23\x69\x2a\x7c\xcd\x4b\x51\x0d\x95\x54\x39\x77\x2e\x29\xea\x1b\xa6\x50\xa2\x6a\x8f\x6f\x50\x99\x5c\x3e\x54\xfb\xef\x50\x5b\x0b\x07\x45\x17\x89\x6d\x28\x13\x77\x37\x1d\xdb\x8e\x1e\x4a\x05\x66\x4a\x6f\x99\x20\xe5\x70\xe2\xb9\x71\x7e\x0c\x6d\x49\x04\x2d\x7a\xfe\x72\xc7\xf2\x59\x30\x8f\xbb\x02\x5d\x73\xe5\xc9\x20\xea\x78\xec\x20\x90\xf0\x8a\x7f\x42\x17\x7c\x47\x19\x60\xb0\x16\xbd\x26\xb7\x71\xb6\xc7\x9f\x0e\xd1\x33\x82\x3d\xd3\xab\xee\x63\x99\xc8\x2b\x53\xa0\x44\x5c\x71\x01\xc6\xcc\x44\x1f\x32\x4f\x3c\xca\xc0\x29\x3d\x52\xd3\x61\x19\x58\xa9\x7d\x65\xb4\xdc\xcf\x0d\xf4\x3d\xf1\x08\xa9\x42\xda\x23\x09\xd8\xbf\x5e\x50\x49\xf8\x4d\xc0\xcb\x47\x4c\x1c\x4f\xf7\x7b\x2b\xd8\x16\x18\xc5\x31\x92\x3b\xb5\x6f\xdc\x6c\x0d\x92\x88\x16\xd1\x9e\xdb\x3f\xe2\xe9\xda\x5f\xd4\x84\xe2\x46\x61\x5a\xde\x1c\x55\xcf\xa4\x00\xbe\xfd\xce\x67\xf1\x4a\x69\x1c\x97\xe6\x20\x48\xd8\x5d\x7f\x7e\xae\x71\x20\x0e\x4e\xae\xc0\x56\xa9\x91\x01\x3c\x82\x1d\x0f\x72\xe7\x76\xec\x29\x49\xd6\x5d\x2d\x83\xe3\xdb\x36\x06\xa9\x3b\x66\x13\x97\x87\x6a\xd5\xb6\x3d\x50\x5e\x52\xb9\x4b\xc7\x73\x57\x78\xc9\xf4\x2e\x59\x07\x95\x93\x6f\xd0\x4b\x17\x57\x19\x3e\x27\x27\xc7\x60\xdb\x3b\xed\x9a\x0e\x53\x44\x16\x3e\x3f\x8d\x92\x6d\x77\xa2\x0a\xeb\x3f\x52\xa8\xc6\x55\x5e\x31\x49\x37\x85\xf4\xc5\x1f\x26\x2d\xa9\x1c\xbf\x8b\x27\x54\xda\xc3\x6a\x20\xe5\x2a\x78\x04\xb0\xd6\x90\x70\x72\xaa\x8b\x68\xbd\x88\xf7\x02\x5f\x48\xb1\x7e\xc0\x58\x4c\x3f\x66\x1a\xf9\x3e\xe1\x65\xc0\x70\xa7\xcf\x38\x69\xaf\xf0\x56\x6c\x64\x49\x9c\x27\xad\x78\x74\x4f\xc2\x87\xde\x56\x39\x00\xda\x77\x0b\xcb\x2d\x1b\x89\xfb\x35\x4f\x02\xf5\x08\x51\x13\x60\xc1\x0a\x5a\x47\x4d\x26\x1c\x33\x30\x78\xda\xc0\x9c\x46\x47\xe2\x5b\x79\x60\x49\x6e\x37\x67\x53\x0a\x3e\xe9\xec\x46\x39\xb2\xf1\x34\x0d\xc6\x84\x53\x75\x6e\xe1\x0c\x59\xd9\x1e\xde\x29\x85\x10\x7b\x49\x49\xa5\x77\x79\xbe\x49\x56\x2e\x36\xe7\x0b\x3a\xbb\x4f\x03\x62\x7b\xd2\x4d\x31\x95\x2f\xbd\x38\x7b\xa8\x4f\x21\xe1\xec\x46\x70\x76\x95\x7d\x29\x22\x78\x88\x0a\x90\xdd\x9d\x5c\xda\xde\x19\x51\xcf\xf0\xfc\x59\x52\x65\x7c\x33\x13\xdf\xf3\x48\xda\xbb\x2a\x75\xdb\x60\xb2\x02\x15\xd4\xfc\x19\xed\x1b\xec\x7f\x35\xa8\xff\x28\x31\x07\x2d\x12\xc8\xdc\x88\x46\x7c\x8a\x5b\x22" + "\x45\xf4\xbd\x0b\x79\xe2\x6a\x45\x22\x05\x92\x2c\x17\xcd\x06\x71\xf8\x49\x10\x46\x67\x51\x00\x42\x25\xc6\xe8\x61\x2c\x66\x29\x08\xc6\x34\xdc\x6a\x62\x25\x79\x0a\x77\x1d\x6d\x69\xd6\xf0\x9c\x6b\x93\xa1\xbd\x4e\x75\xe0\x41\x04\x5b\xdf\x40\x56\x0c\xd9\xbb\x72\x9b\x81\x7c\x10\x33\x53\xee\x4f\x6c\xd4\x71\x05\xb0\x7b\xc0\x7f\x45\x03\x56\x5a\xad\x77\x55\x65\x0b\x33\x92\x2a\xac\x19\x6c\x35\x14\xc5\x1d\x30\x73\xf8\x33\x3e\x6d\x46\x38\x4a\xb4\xdd\xf0\x2e\xdd\x17\x75\x16\xda\x8c\x44\x74\x22\x06\xfa\x61\x22\x0c\x33\x22\x53\x6f\xaf\x39\x44\x0b\x8c\x0e\x39\xd9\x39\x13\x4c\xb9\xbf\x7f\xab\x5c\x8c\x50\x5f\x9f\x22\x75\x78\x1f\xe9\x07\x71\x91\x68\x3b\xc1\xc4\x9b\x7f\xf0\x3c\x56\x71\x48\x82\x05\x27\x55\x66\x59\x4e\x65\x1d\x98\x75\xa3\x61\x46\x7d\x61\x3f\x15\x41\x00\x9f\x14\x06\xd7\xb4\x34\x4d\xce\x13\x87\x46\xb0\x1a\xd5\x05\x1c\xb8\x8a\x27\x7b\x8b\xdc\x2b\xbb\x4d\x67\x30\xc8\xd1\xf6\x5c\x8f\x50\xfa\x5b\x2f\x46\x9b\x6e\x35\x18\x2f\x27\x43\x2e\xeb\x0a\x0c\x5e\x10\x05\x10\xa5\x73\x1b\x65\x34\xe5\x6c\x2e\x6a\x43\x27\x63\x14\x23\x55\xa9\x3f\x71\x7b\x67\x43\x7d\x3a\xaf\xcd\xe2\x54\x55\x9c\xfd\x4b\xc6\xe2\x9f\x2f\x28\xed\xcb\x5c\xc6\x2d\x66\x07\x88\xa7\x3b\x2f\x18\x2a\x22\x4e\x0e\xb0\x6b\x2e\xdd\x0d\x95\x7d\x7d\x47\xba\x43\xb2\x11\xb2\x2b\x3e\x4d\xaa\x3e\x7d\xe6\xce\x49\x89\xc6\xe6\x78\x0c\x61\x31\x05\x2d\x01\xa4\x4f\xa5\x7e\x71\x20\x88\xec\x0d\x31\xe8\x4e\x0b\x00\x6e\x50\x68\x7d\x17\x3d\x08\x0d\x17\x95\xa6\x6e\xa3\x68\x97\x24\x5b\x6b\xf3\x17\x23\xf3\xb6\x73\xb3\x0d\x0b\x40\xc0\x9f\xd8\x04\x51\x5d\xfa\x1a\x17\x22\x2e\x15\x6a\xdf\x49\x00\xb9\xa0\x77\x55\xc6\xef\x10\x6a\xbf\x7b\x47\x4c\x7f\x83\x17\x05\xee\xdc\xdc\x46\x85\xa9\xad\x53\x07\x2b\x53\x34\x06\x07\xff\x14\x94\x59\x19\x02\xe4\x38\xe8\x31\x83\x4e\xb9\x58\x46\x6b\xcb\x2d\x23\x86\x92\x70\x00\x35\x88\x22\xcf\x31\xb2\x26\x2f\xe7\xc3\x75\x2d\x36\x2c\x72\x74\xb0\x23\x47\xb7\xd3\xd1\x26\x16\x85\x37\x72\xe2\x00\x8c\x44\xcf\x10\xda\x33\x2d\x1a\xde\x60\x86\x69\x23\x69\x2a\x7c\xcd\x4b\x51\x0d\x95\x54\x39\x77\x2e\x29\xea\x1b\xa6\x50\xa2\x6a\x8f\x6f\x50\x99\x5c\x3e\x54\xfb\xef\x50\x5b\x0b\x07\x45\x17\x89\x6d\x28\x13\x77\x37\x1d\xdb\x8e\x1e\x4a\x05\x66\x4a\x6f\x99\x20\xe5\x70\xe2\xb9\x71\x7e\x0c\x6d\x49\x04\x2d\x7a\xfe\x72\xc7\xf2\x59\x30\x8f\xbb\x02\x5d\x73\xe5\xc9\x20\xea\x78\xec\x20\x90\xf0\x8a\x7f\x42\x17\x7c\x47\x19\x60\xb0\x16\xbd\x26\xb7\x71\xb6\xc7\x9f\x0e\xd1\x33\x82\x3d\xd3\xab\xee\x63\x99\xc8\x2b\x53\xa0\x44\x5c\x71\x01\xc6\xcc\x44\x1f\x32\x4f\x3c\xca\xc0\x29\x3d\x52\xd3\x61\x19\x58\xa9\x7d\x65\xb4\xdc\xcf\x0d\xf4\x3d\xf1\x08\xa9\x42\xda\x23\x09\xd8\xbf\x5e\x50\x49\xf8\x4d\xc0\xcb\x47\x4c\x1c\x4f\xf7\x7b\x2b\xd8\x16\x18\xc5\x31\x92\x3b\xb5\x6f\xdc\x6c\x0d\x92\x88\x16\xd1\x9e\xdb\x3f\xe2\xe9\xda\x5f\xd4\x84\xe2\x46\x61\x5a\xde\x1c\x55\xcf\xa4\x00\xbe\xfd\xce\x67\xf1\x4a\x69\x1c\x97\xe6\x20\x48\xd8\x5d\x7f\x7e\xae\x71\x20\x0e\x4e\xae\xc0\x56\xa9\x91\x01\x3c\x82\x1d\x0f\x72\xe7\x76\xec\x29\x49\xd6\x5d\x2d\x83\xe3\xdb\x36\x06\xa9\x3b\x66\x13\x97\x87\x6a\xd5\xb6\x3d\x50\x5e\x52\xb9\x4b\xc7\x73\x57\x78\xc9\xf4\x2e\x59\x07\x95\x93\x6f\xd0\x4b\x17\x57\x19\x3e\x27\x27\xc7\x60\xdb\x3b\xed\x9a\x0e\x53\x44\x16\x3e\x3f\x8d\x92\x6d\x77\xa2\x0a\xeb\x3f\x52\xa8\xc6\x55\x5e\x31\x49\x37\x85\xf4\xc5\x1f\x26\x2d\xa9\x1c\xbf\x8b\x27\x54\xda\xc3\x6a\x20\xe5\x2a\x78\x04\xb0\xd6\x90\x70\x72\xaa\x8b\x68\xbd\x88\xf7\x02\x5f\x48\xb1\x7e\xc0\x58\x4c\x3f\x66\x1a\xf9\x3e\xe1\x65\xc0\x70\xa7\xcf\x38\x69\xaf\xf0\x56\x6c\x64\x49\x9c\x27\xad\x78\x74\x4f\xc2\x87\xde\x56\x39\x00\xda\x77\x0b\xcb\x2d\x1b\x89\xfb\x35\x4f\x02\xf5\x08\x51\x13\x60\xc1\x0a\x5a\x47\x4d\x26\x1c\x33\x30\x78\xda\xc0\x9c\x46\x47\xe2\x5b\x79\x60\x49\x6e\x37\x67\x53\x0a\x3e\xe9\xec\x46\x39\xb2\xf1\x34\x0d\xc6\x84\x53\x75\x6e\xe1\x0c\x59\xd9\x1e\xde\x29\x85\x10\x7b\x49\x49\xa5\x77\x79\xbe\x49\x56\x2e\x36\xe7\x0b\x3a\xbb\x4f\x03\x62\x7b\xd2\x4d\x31\x95\x2f\xbd\x38\x7b\xa8\x4f\x21\xe1\xec\x46\x70\x76\x95\x7d\x29\x22\x78\x88\x0a\x90\xdd\x9d\x5c\xda\xde\x19\x51\xcf\xf0\xfc\x59\x52\x65\x7c\x33\x13\xdf\xf3\x48\xda\xbb\x2a\x75\xdb\x60\xb2\x02\x15\xd4\xfc\x19\xed\x1b\xec\x7f\x35\xa8\xff\x28\x31\x07\x2d\x12\xc8\xdc\x88\x46\x7c\x8a\x5b\x22", ); /** @@ -302,7 +302,7 @@ const taskProcessor = new TaskProcessor("decodeGoogleEarthEnterprisePacket"); GoogleEarthEnterpriseMetadata.prototype.getQuadTreePacket = function ( quadKey, version, - request + request, ) { version = defaultValue(version, 1); quadKey = defaultValue(quadKey, ""); @@ -324,7 +324,7 @@ GoogleEarthEnterpriseMetadata.prototype.getQuadTreePacket = function ( type: "Metadata", key: key, }, - [metadata] + [metadata], ); return decodePromise.then(function (result) { @@ -385,7 +385,7 @@ GoogleEarthEnterpriseMetadata.prototype.populateSubtree = function ( x, y, level, - request + request, ) { const quadkey = GoogleEarthEnterpriseMetadata.tileXYToQuadKey(x, y, level); return populateSubtree(this, quadkey, request); @@ -427,7 +427,7 @@ function populateSubtree(that, quadKey, request) { // undefined so no parent exists - this shouldn't ever happen once the provider is ready if (!defined(t) || !t.hasSubtree()) { return Promise.reject( - new RuntimeError(`Couldn't load metadata for tile ${quadKey}`) + new RuntimeError(`Couldn't load metadata for tile ${quadKey}`), ); } @@ -469,7 +469,7 @@ function populateSubtree(that, quadKey, request) { GoogleEarthEnterpriseMetadata.prototype.getTileInformation = function ( x, y, - level + level, ) { const quadkey = GoogleEarthEnterpriseMetadata.tileXYToQuadKey(x, y, level); return this._tileInfo[quadkey]; @@ -483,11 +483,10 @@ GoogleEarthEnterpriseMetadata.prototype.getTileInformation = function ( * * @private */ -GoogleEarthEnterpriseMetadata.prototype.getTileInformationFromQuadKey = function ( - quadkey -) { - return this._tileInfo[quadkey]; -}; +GoogleEarthEnterpriseMetadata.prototype.getTileInformationFromQuadKey = + function (quadkey) { + return this._tileInfo[quadkey]; + }; function getMetadataResource(that, quadKey, version, request) { return that._resource.getDerivedResource({ @@ -525,7 +524,7 @@ function requestDbRoot(that) { }) .then(function (buf) { const encryptedDbRootProto = dbrootParser.EncryptedDbRootProto.decode( - new Uint8Array(buf) + new Uint8Array(buf), ); let byteArray = encryptedDbRootProto.encryptionData; @@ -543,37 +542,37 @@ function requestDbRoot(that) { type: "DbRoot", key: key, }, - [dbRootCompressed] + [dbRootCompressed], ); }) .then(function (result) { const dbRoot = dbrootParser.DbRootProto.decode( - new Uint8Array(result.buffer) + new Uint8Array(result.buffer), ); that.imageryPresent = defaultValue( dbRoot.imageryPresent, - that.imageryPresent + that.imageryPresent, ); that.protoImagery = dbRoot.protoImagery; that.terrainPresent = defaultValue( dbRoot.terrainPresent, - that.terrainPresent + that.terrainPresent, ); if (defined(dbRoot.endSnippet) && defined(dbRoot.endSnippet.model)) { const model = dbRoot.endSnippet.model; that.negativeAltitudeExponentBias = defaultValue( model.negativeAltitudeExponentBias, - that.negativeAltitudeExponentBias + that.negativeAltitudeExponentBias, ); that.negativeAltitudeThreshold = defaultValue( model.compressedNegativeAltitudeThreshold, - that.negativeAltitudeThreshold + that.negativeAltitudeThreshold, ); } if (defined(dbRoot.databaseVersion)) { that._quadPacketVersion = defaultValue( dbRoot.databaseVersion.quadtreeVersion, - that._quadPacketVersion + that._quadPacketVersion, ); } const providers = that.providers; diff --git a/packages/engine/Source/Core/GoogleEarthEnterpriseTerrainData.js b/packages/engine/Source/Core/GoogleEarthEnterpriseTerrainData.js index f343aff99575..e3c4b68bf208 100644 --- a/packages/engine/Source/Core/GoogleEarthEnterpriseTerrainData.js +++ b/packages/engine/Source/Core/GoogleEarthEnterpriseTerrainData.js @@ -60,11 +60,11 @@ function GoogleEarthEnterpriseTerrainData(options) { Check.typeOf.object("options.buffer", options.buffer); Check.typeOf.number( "options.negativeAltitudeExponentBias", - options.negativeAltitudeExponentBias + options.negativeAltitudeExponentBias, ); Check.typeOf.number( "options.negativeElevationThreshold", - options.negativeElevationThreshold + options.negativeElevationThreshold, ); //>>includeEnd('debug'); @@ -121,7 +121,7 @@ const createMeshTaskName = "createVerticesFromGoogleEarthEnterpriseBuffer"; const createMeshTaskProcessorNoThrottle = new TaskProcessor(createMeshTaskName); const createMeshTaskProcessorThrottle = new TaskProcessor( createMeshTaskName, - TerrainData.maximumAsynchronousTasks + TerrainData.maximumAsynchronousTasks, ); const nativeRectangleScratch = new Rectangle(); @@ -161,7 +161,7 @@ GoogleEarthEnterpriseTerrainData.prototype.createMesh = function (options) { const exaggeration = defaultValue(options.exaggeration, 1.0); const exaggerationRelativeHeight = defaultValue( options.exaggerationRelativeHeight, - 0.0 + 0.0, ); const throttle = defaultValue(options.throttle, true); @@ -171,7 +171,7 @@ GoogleEarthEnterpriseTerrainData.prototype.createMesh = function (options) { // Compute the center of the tile for RTC rendering. const center = ellipsoid.cartographicToCartesian( - Rectangle.center(rectangleScratch) + Rectangle.center(rectangleScratch), ); const levelZeroMaxError = 40075.16; // From Google's Doc @@ -221,7 +221,7 @@ GoogleEarthEnterpriseTerrainData.prototype.createMesh = function (options) { result.westIndicesSouthToNorth, result.southIndicesEastToWest, result.eastIndicesNorthToSouth, - result.northIndicesWestToEast + result.northIndicesWestToEast, ); that._minimumHeight = result.minimumHeight; @@ -246,17 +246,17 @@ GoogleEarthEnterpriseTerrainData.prototype.createMesh = function (options) { GoogleEarthEnterpriseTerrainData.prototype.interpolateHeight = function ( rectangle, longitude, - latitude + latitude, ) { const u = CesiumMath.clamp( (longitude - rectangle.west) / rectangle.width, 0.0, - 1.0 + 1.0, ); const v = CesiumMath.clamp( (latitude - rectangle.south) / rectangle.height, 0.0, - 1.0 + 1.0, ); if (!defined(this._mesh)) { @@ -268,7 +268,7 @@ GoogleEarthEnterpriseTerrainData.prototype.interpolateHeight = function ( const upsampleTaskProcessor = new TaskProcessor( "upsampleQuantizedTerrainMesh", - TerrainData.maximumAsynchronousTasks + TerrainData.maximumAsynchronousTasks, ); /** @@ -293,7 +293,7 @@ GoogleEarthEnterpriseTerrainData.prototype.upsample = function ( thisLevel, descendantX, descendantY, - descendantLevel + descendantLevel, ) { //>>includeStart('debug', pragmas.debug); Check.typeOf.object("tilingScheme", tilingScheme); @@ -306,7 +306,7 @@ GoogleEarthEnterpriseTerrainData.prototype.upsample = function ( const levelDifference = descendantLevel - thisLevel; if (levelDifference > 1) { throw new DeveloperError( - "Upsampling through more than one level at a time is not currently supported." + "Upsampling through more than one level at a time is not currently supported.", ); } //>>includeEnd('debug'); @@ -323,7 +323,7 @@ GoogleEarthEnterpriseTerrainData.prototype.upsample = function ( const childRectangle = tilingScheme.tileXYToRectangle( descendantX, descendantY, - descendantLevel + descendantLevel, ); const upsamplePromise = upsampleTaskProcessor.scheduleTask({ @@ -350,7 +350,7 @@ GoogleEarthEnterpriseTerrainData.prototype.upsample = function ( const quantizedVertices = new Uint16Array(result.vertices); const indicesTypedArray = IndexDatatype.createTypedArray( quantizedVertices.length / 3, - result.indices + result.indices, ); const skirtHeight = that._skirtHeight; @@ -363,7 +363,7 @@ GoogleEarthEnterpriseTerrainData.prototype.upsample = function ( maximumHeight: result.maximumHeight, boundingSphere: BoundingSphere.clone(result.boundingSphere), orientedBoundingBox: OrientedBoundingBox.clone( - result.orientedBoundingBox + result.orientedBoundingBox, ), horizonOcclusionPoint: Cartesian3.clone(result.horizonOcclusionPoint), westIndices: result.westIndices, @@ -397,7 +397,7 @@ GoogleEarthEnterpriseTerrainData.prototype.isChildAvailable = function ( thisX, thisY, childX, - childY + childY, ) { //>>includeStart('debug', pragmas.debug); Check.typeOf.number("thisX", thisX); @@ -425,9 +425,10 @@ GoogleEarthEnterpriseTerrainData.prototype.isChildAvailable = function ( * * @returns {boolean} True if this instance was created by upsampling; otherwise, false. */ -GoogleEarthEnterpriseTerrainData.prototype.wasCreatedByUpsampling = function () { - return this._createdByUpsampling; -}; +GoogleEarthEnterpriseTerrainData.prototype.wasCreatedByUpsampling = + function () { + return this._createdByUpsampling; + }; const texCoordScratch0 = new Cartesian2(); const texCoordScratch1 = new Cartesian2(); @@ -448,17 +449,17 @@ function interpolateMeshHeight(terrainData, u, v) { const uv0 = encoding.decodeTextureCoordinates( vertices, i0, - texCoordScratch0 + texCoordScratch0, ); const uv1 = encoding.decodeTextureCoordinates( vertices, i1, - texCoordScratch1 + texCoordScratch1, ); const uv2 = encoding.decodeTextureCoordinates( vertices, i2, - texCoordScratch2 + texCoordScratch2, ); const barycentric = Intersections2D.computeBarycentricCoordinates( @@ -470,7 +471,7 @@ function interpolateMeshHeight(terrainData, u, v) { uv1.y, uv2.x, uv2.y, - barycentricCoordinateScratch + barycentricCoordinateScratch, ); if ( barycentric.x >= -1e-15 && @@ -586,7 +587,7 @@ function interpolateHeight(terrainData, u, v, rectangle) { v1, u2, v2, - barycentricCoordinateScratch + barycentricCoordinateScratch, ); if ( barycentric.x >= -1e-15 && diff --git a/packages/engine/Source/Core/GoogleEarthEnterpriseTerrainProvider.js b/packages/engine/Source/Core/GoogleEarthEnterpriseTerrainProvider.js index 05e348e000ff..d13e05ac1d71 100644 --- a/packages/engine/Source/Core/GoogleEarthEnterpriseTerrainProvider.js +++ b/packages/engine/Source/Core/GoogleEarthEnterpriseTerrainProvider.js @@ -106,7 +106,7 @@ function GoogleEarthEnterpriseTerrainProvider(options) { -CesiumMath.PI, -CesiumMath.PI, CesiumMath.PI, - CesiumMath.PI + CesiumMath.PI, ), ellipsoid: options.ellipsoid, }); @@ -249,7 +249,7 @@ Object.defineProperties(GoogleEarthEnterpriseTerrainProvider.prototype, { */ GoogleEarthEnterpriseTerrainProvider.fromMetadata = function ( metadata, - options + options, ) { //>>includeStart('debug', pragmas.debug); Check.defined("metadata", metadata); @@ -275,7 +275,7 @@ function computeChildMask(quadKey, info, metadata) { childMask = 0; for (let i = 0; i < 4; ++i) { const child = metadata.getTileInformationFromQuadKey( - quadKey + i.toString() + quadKey + i.toString(), ); if (defined(child) && child.hasTerrain()) { childMask |= 1 << i; @@ -302,7 +302,7 @@ GoogleEarthEnterpriseTerrainProvider.prototype.requestTileGeometry = function ( x, y, level, - request + request, ) { const quadKey = GoogleEarthEnterpriseMetadata.tileXYToQuadKey(x, y, level); const terrainCache = this._terrainCache; @@ -331,7 +331,7 @@ GoogleEarthEnterpriseTerrainProvider.prototype.requestTileGeometry = function ( credits: defined(credit) ? [credit] : undefined, negativeAltitudeExponentBias: metadata.negativeAltitudeExponentBias, negativeElevationThreshold: metadata.negativeAltitudeThreshold, - }) + }), ); } @@ -346,7 +346,7 @@ GoogleEarthEnterpriseTerrainProvider.prototype.requestTileGeometry = function ( buffer: new Uint8Array(16 * 16), width: 16, height: 16, - }) + }), ); } else if (terrainState === TerrainState.NONE) { // Already have info and there isn't any terrain here @@ -400,7 +400,7 @@ GoogleEarthEnterpriseTerrainProvider.prototype.requestTileGeometry = function ( this, q, terrainVersion, - sharedRequest + sharedRequest, ).fetchArrayBuffer(); if (!defined(requestPromise)) { @@ -416,7 +416,7 @@ GoogleEarthEnterpriseTerrainProvider.prototype.requestTileGeometry = function ( type: "Terrain", key: metadata.key, }, - [terrain] + [terrain], ) .then(function (terrainTiles) { // Add requested tile and mark it as SELF @@ -486,11 +486,10 @@ GoogleEarthEnterpriseTerrainProvider.prototype.requestTileGeometry = function ( * @param {number} level The tile level for which to get the maximum geometric error. * @returns {number} The maximum geometric error. */ -GoogleEarthEnterpriseTerrainProvider.prototype.getLevelMaximumGeometricError = function ( - level -) { - return this._levelZeroMaximumGeometricError / (1 << level); -}; +GoogleEarthEnterpriseTerrainProvider.prototype.getLevelMaximumGeometricError = + function (level) { + return this._levelZeroMaximumGeometricError / (1 << level); + }; /** * Determines whether data for a tile is available to be loaded. @@ -503,7 +502,7 @@ GoogleEarthEnterpriseTerrainProvider.prototype.getLevelMaximumGeometricError = f GoogleEarthEnterpriseTerrainProvider.prototype.getTileDataAvailable = function ( x, y, - level + level, ) { const metadata = this._metadata; let quadKey = GoogleEarthEnterpriseMetadata.tileXYToQuadKey(x, y, level); @@ -557,13 +556,10 @@ GoogleEarthEnterpriseTerrainProvider.prototype.getTileDataAvailable = function ( * @param {number} level The level of the tile for which to request geometry. * @returns {undefined} */ -GoogleEarthEnterpriseTerrainProvider.prototype.loadTileDataAvailability = function ( - x, - y, - level -) { - return undefined; -}; +GoogleEarthEnterpriseTerrainProvider.prototype.loadTileDataAvailability = + function (x, y, level) { + return undefined; + }; // // Functions to handle imagery packets diff --git a/packages/engine/Source/Core/GoogleEarthEnterpriseTileInformation.js b/packages/engine/Source/Core/GoogleEarthEnterpriseTileInformation.js index e1caecb56ae5..72eeb54b2953 100644 --- a/packages/engine/Source/Core/GoogleEarthEnterpriseTileInformation.js +++ b/packages/engine/Source/Core/GoogleEarthEnterpriseTileInformation.js @@ -26,7 +26,7 @@ function GoogleEarthEnterpriseTileInformation( imageryVersion, terrainVersion, imageryProvider, - terrainProvider + terrainProvider, ) { this._bits = bits; this.cnodeVersion = cnodeVersion; @@ -53,7 +53,7 @@ GoogleEarthEnterpriseTileInformation.clone = function (info, result) { info.imageryVersion, info.terrainVersion, info.imageryProvider, - info.terrainProvider + info.terrainProvider, ); } else { result._bits = info._bits; diff --git a/packages/engine/Source/Core/GoogleMaps.js b/packages/engine/Source/Core/GoogleMaps.js index 15d1a1251cc0..7ec935068796 100644 --- a/packages/engine/Source/Core/GoogleMaps.js +++ b/packages/engine/Source/Core/GoogleMaps.js @@ -34,7 +34,7 @@ GoogleMaps.mapTilesApiEndpoint = new Resource({ GoogleMaps.getDefaultCredit = function () { return new Credit( `Google`, - true + true, ); }; export default GoogleMaps; diff --git a/packages/engine/Source/Core/GregorianDate.js b/packages/engine/Source/Core/GregorianDate.js index 4fb7446d61db..c5291ca31ab1 100644 --- a/packages/engine/Source/Core/GregorianDate.js +++ b/packages/engine/Source/Core/GregorianDate.js @@ -30,7 +30,7 @@ function GregorianDate( minute, second, millisecond, - isLeapSecond + isLeapSecond, ) { const minimumYear = 1; const minimumMonth = 1; @@ -124,18 +124,18 @@ function GregorianDate( Check.typeOf.number.lessThanOrEquals( "Second", second, - isLeapSecond ? maximumSecond + 1 : maximumSecond + isLeapSecond ? maximumSecond + 1 : maximumSecond, ); Check.typeOf.number.greaterThanOrEquals( "Millisecond", millisecond, - minimumMillisecond + minimumMillisecond, ); Check.typeOf.number.lessThan( "Millisecond", millisecond, - excludedMaximumMilisecond + excludedMaximumMilisecond, ); } diff --git a/packages/engine/Source/Core/GroundPolylineGeometry.js b/packages/engine/Source/Core/GroundPolylineGeometry.js index 2d3a1375346a..56f207eb9c6f 100644 --- a/packages/engine/Source/Core/GroundPolylineGeometry.js +++ b/packages/engine/Source/Core/GroundPolylineGeometry.js @@ -85,7 +85,7 @@ function GroundPolylineGeometry(options) { options.arcType !== ArcType.RHUMB ) { throw new DeveloperError( - "Valid options for arcType are ArcType.GEODESIC and ArcType.RHUMB." + "Valid options for arcType are ArcType.GEODESIC and ArcType.RHUMB.", ); } //>>includeEnd('debug'); @@ -165,7 +165,7 @@ Object.defineProperties(GroundPolylineGeometry.prototype, { */ GroundPolylineGeometry.setProjectionAndEllipsoid = function ( groundPolylineGeometry, - mapProjection + mapProjection, ) { let projectionIndex = 0; for (let i = 0; i < PROJECTION_COUNT; i++) { @@ -209,7 +209,7 @@ function interpolateSegment( normalsArray, bottomPositionsArray, topPositionsArray, - cartographicsArray + cartographicsArray, ) { if (granularity === 0.0) { return; @@ -233,7 +233,7 @@ function interpolateSegment( end, maxHeight, ellipsoid, - interpolatedNormalScratch + interpolatedNormalScratch, ); const segments = Math.ceil(surfaceDistance / granularity); @@ -242,21 +242,22 @@ function interpolateSegment( const pointsToAdd = segments - 1; let packIndex = normalsArray.length; for (let i = 0; i < pointsToAdd; i++) { - const interpolatedCartographic = ellipsoidLine.interpolateUsingSurfaceDistance( - distanceFromStart, - interpolatedCartographicScratch - ); + const interpolatedCartographic = + ellipsoidLine.interpolateUsingSurfaceDistance( + distanceFromStart, + interpolatedCartographicScratch, + ); const interpolatedBottom = getPosition( ellipsoid, interpolatedCartographic, minHeight, - interpolatedBottomScratch + interpolatedBottomScratch, ); const interpolatedTop = getPosition( ellipsoid, interpolatedCartographic, maxHeight, - interpolatedTopScratch + interpolatedTopScratch, ); Cartesian3.pack(interpolatedNormal, normalsArray, packIndex); @@ -277,7 +278,7 @@ function getPosition(ellipsoid, cartographic, height, result) { return Cartographic.toCartesian( heightlessCartographicScratch, ellipsoid, - result + result, ); } @@ -397,7 +398,7 @@ function computeVertexMiterNormal( vertexBottom, vertexTop, nextBottom, - result + result, ) { const up = direction(vertexTop, vertexBottom, vertexUpScratch); @@ -406,7 +407,7 @@ function computeVertexMiterNormal( previousBottom, vertexBottom, up, - toPreviousScratch + toPreviousScratch, ); const toNext = tangentDirection(nextBottom, vertexBottom, up, toNextScratch); @@ -415,7 +416,7 @@ function computeVertexMiterNormal( CesiumMath.equalsEpsilon( Cartesian3.dot(toPrevious, toNext), cosine180, - CesiumMath.EPSILON5 + CesiumMath.EPSILON5, ) ) { result = Cartesian3.cross(up, toPrevious, result); @@ -462,7 +463,7 @@ GroundPolylineGeometry.createGeometry = function (groundPolylineGeometry) { const granularity = groundPolylineGeometry.granularity; const arcType = groundPolylineGeometry.arcType; const projection = new PROJECTIONS[groundPolylineGeometry._projectionIndex]( - ellipsoid + ellipsoid, ); const minHeight = WALL_INITIAL_MIN_HEIGHT; @@ -497,7 +498,7 @@ GroundPolylineGeometry.createGeometry = function (groundPolylineGeometry) { p0, p1, XZ_PLANE, - intersectionScratch + intersectionScratch, ); if ( defined(intersection) && @@ -509,18 +510,18 @@ GroundPolylineGeometry.createGeometry = function (groundPolylineGeometry) { } else if (groundPolylineGeometry.arcType === ArcType.RHUMB) { intersectionLongitude = ellipsoid.cartesianToCartographic( intersection, - cartographicScratch0 + cartographicScratch0, ).longitude; c0 = ellipsoid.cartesianToCartographic(p0, cartographicScratch0); c1 = ellipsoid.cartesianToCartographic(p1, cartographicScratch1); rhumbLine.setEndPoints(c0, c1); intersectionCartographic = rhumbLine.findIntersectionWithLongitude( intersectionLongitude, - cartographicIntersectionScratch + cartographicIntersectionScratch, ); intersection = ellipsoid.cartographicToCartesian( intersectionCartographic, - intersectionScratch + intersectionScratch, ); if ( defined(intersection) && @@ -541,7 +542,7 @@ GroundPolylineGeometry.createGeometry = function (groundPolylineGeometry) { p0, p1, XZ_PLANE, - intersectionScratch + intersectionScratch, ); if ( defined(intersection) && @@ -553,18 +554,18 @@ GroundPolylineGeometry.createGeometry = function (groundPolylineGeometry) { } else if (groundPolylineGeometry.arcType === ArcType.RHUMB) { intersectionLongitude = ellipsoid.cartesianToCartographic( intersection, - cartographicScratch0 + cartographicScratch0, ).longitude; c0 = ellipsoid.cartesianToCartographic(p0, cartographicScratch0); c1 = ellipsoid.cartesianToCartographic(p1, cartographicScratch1); rhumbLine.setEndPoints(c0, c1); intersectionCartographic = rhumbLine.findIntersectionWithLongitude( intersectionLongitude, - cartographicIntersectionScratch + cartographicIntersectionScratch, ); intersection = ellipsoid.cartographicToCartesian( intersectionCartographic, - intersectionScratch + intersectionScratch, ); if ( defined(intersection) && @@ -582,7 +583,7 @@ GroundPolylineGeometry.createGeometry = function (groundPolylineGeometry) { for (i = 0; i < cartographicsLength; i++) { const cartographic = Cartographic.fromCartesian( splitPositions[i], - ellipsoid + ellipsoid, ); cartographic.height = 0.0; cartographics[i] = cartographic; @@ -590,7 +591,7 @@ GroundPolylineGeometry.createGeometry = function (groundPolylineGeometry) { cartographics = arrayRemoveDuplicates( cartographics, - Cartographic.equalsEpsilon + Cartographic.equalsEpsilon, ); cartographicsLength = cartographics.length; @@ -623,14 +624,14 @@ GroundPolylineGeometry.createGeometry = function (groundPolylineGeometry) { ellipsoid, prestartCartographic, minHeight, - previousBottom + previousBottom, ); nextBottom = getPosition(ellipsoid, nextCartographic, minHeight, nextBottom); vertexBottom = getPosition( ellipsoid, startCartographic, minHeight, - vertexBottom + vertexBottom, ); vertexTop = getPosition(ellipsoid, startCartographic, maxHeight, vertexTop); @@ -640,7 +641,7 @@ GroundPolylineGeometry.createGeometry = function (groundPolylineGeometry) { vertexBottom, vertexTop, nextBottom, - vertexNormal + vertexNormal, ); } else { vertexNormal = computeRightNormal( @@ -648,7 +649,7 @@ GroundPolylineGeometry.createGeometry = function (groundPolylineGeometry) { nextCartographic, maxHeight, ellipsoid, - vertexNormal + vertexNormal, ); } @@ -669,7 +670,7 @@ GroundPolylineGeometry.createGeometry = function (groundPolylineGeometry) { normalsArray, bottomPositionsArray, topPositionsArray, - cartographicsArray + cartographicsArray, ); // All inbetween points @@ -685,7 +686,7 @@ GroundPolylineGeometry.createGeometry = function (groundPolylineGeometry) { vertexBottom, vertexTop, nextBottom, - vertexNormal + vertexNormal, ); index = normalsArray.length; @@ -706,7 +707,7 @@ GroundPolylineGeometry.createGeometry = function (groundPolylineGeometry) { normalsArray, bottomPositionsArray, topPositionsArray, - cartographicsArray + cartographicsArray, ); } @@ -718,7 +719,7 @@ GroundPolylineGeometry.createGeometry = function (groundPolylineGeometry) { ellipsoid, endCartographic, minHeight, - vertexBottom + vertexBottom, ); vertexTop = getPosition(ellipsoid, endCartographic, maxHeight, vertexTop); @@ -728,13 +729,13 @@ GroundPolylineGeometry.createGeometry = function (groundPolylineGeometry) { ellipsoid, preEndCartographic, minHeight, - previousBottom + previousBottom, ); nextBottom = getPosition( ellipsoid, postEndCartographic, minHeight, - nextBottom + nextBottom, ); vertexNormal = computeVertexMiterNormal( @@ -742,7 +743,7 @@ GroundPolylineGeometry.createGeometry = function (groundPolylineGeometry) { vertexBottom, vertexTop, nextBottom, - vertexNormal + vertexNormal, ); } else { vertexNormal = computeRightNormal( @@ -750,7 +751,7 @@ GroundPolylineGeometry.createGeometry = function (groundPolylineGeometry) { endCartographic, maxHeight, ellipsoid, - vertexNormal + vertexNormal, ); } @@ -773,7 +774,7 @@ GroundPolylineGeometry.createGeometry = function (groundPolylineGeometry) { normalsArray, bottomPositionsArray, topPositionsArray, - cartographicsArray + cartographicsArray, ); index = normalsArray.length; for (i = 0; i < 3; ++i) { @@ -792,7 +793,7 @@ GroundPolylineGeometry.createGeometry = function (groundPolylineGeometry) { topPositionsArray, normalsArray, cartographicsArray, - compute2dAttributes + compute2dAttributes, ); }; @@ -815,13 +816,13 @@ function breakMiter(endGeometryNormal, startBottom, endBottom, endTop) { const quaternion = Quaternion.fromAxisAngle( vertexUp, angle, - quaternionScratch + quaternionScratch, ); const rotationMatrix = Matrix3.fromQuaternion(quaternion, matrix3Scratch); Matrix3.multiplyByVector( rotationMatrix, endGeometryNormal, - endGeometryNormal + endGeometryNormal, ); return true; } @@ -836,12 +837,12 @@ function projectNormal( cartographic, normal, projectedPosition, - result + result, ) { const position = Cartographic.toCartesian( cartographic, projection._ellipsoid, - normalStartpointScratch + normalStartpointScratch, ); let normalEndpoint = Cartesian3.add(position, normal, normalEndpointScratch); let flipNormal = false; @@ -849,7 +850,7 @@ function projectNormal( const ellipsoid = projection._ellipsoid; let normalEndpointCartographic = ellipsoid.cartesianToCartographic( normalEndpoint, - endPosCartographicScratch + endPosCartographicScratch, ); // If normal crosses the IDL, go the other way and flip the result. // In practice this almost never happens because the cartographic start @@ -863,23 +864,23 @@ function projectNormal( normalEndpoint = Cartesian3.subtract( position, normal, - normalEndpointScratch + normalEndpointScratch, ); normalEndpointCartographic = ellipsoid.cartesianToCartographic( normalEndpoint, - endPosCartographicScratch + endPosCartographicScratch, ); } normalEndpointCartographic.height = 0.0; const normalEndpointProjected = projection.project( normalEndpointCartographic, - result + result, ); result = Cartesian3.subtract( normalEndpointProjected, projectedPosition, - result + result, ); result.z = 0.0; result = Cartesian3.normalize(result, result); @@ -897,13 +898,13 @@ function adjustHeights( minHeight, maxHeight, adjustHeightBottom, - adjustHeightTop + adjustHeightTop, ) { // bottom and top should be at WALL_INITIAL_MIN_HEIGHT and WALL_INITIAL_MAX_HEIGHT, respectively const adjustHeightNormal = Cartesian3.subtract( top, bottom, - adjustHeightNormalScratch + adjustHeightNormalScratch, ); Cartesian3.normalize(adjustHeightNormal, adjustHeightNormal); @@ -911,7 +912,7 @@ function adjustHeights( let adjustHeightOffset = Cartesian3.multiplyByScalar( adjustHeightNormal, distanceForBottom, - adjustHeightOffsetScratch + adjustHeightOffsetScratch, ); Cartesian3.add(bottom, adjustHeightOffset, adjustHeightBottom); @@ -919,7 +920,7 @@ function adjustHeights( adjustHeightOffset = Cartesian3.multiplyByScalar( adjustHeightNormal, distanceForTop, - adjustHeightOffsetScratch + adjustHeightOffsetScratch, ); Cartesian3.add(top, adjustHeightOffset, adjustHeightTop); } @@ -1059,7 +1060,7 @@ function generateGeometryAttributes( topPositionsArray, normalsArray, cartographicsArray, - compute2dAttributes + compute2dAttributes, ) { let i; let index; @@ -1081,10 +1082,10 @@ function generateGeometryAttributes( const startLoAndForwardOffsetY = new Float32Array(arraySizeVec4); const startNormalAndForwardOffsetZ = new Float32Array(arraySizeVec4); const endNormalAndTextureCoordinateNormalizationX = new Float32Array( - arraySizeVec4 + arraySizeVec4, ); const rightNormalAndTextureCoordinateNormalizationY = new Float32Array( - arraySizeVec4 + arraySizeVec4, ); let startHiLo2D; @@ -1123,15 +1124,15 @@ function generateGeometryAttributes( segmentStartCartesian = projection.project( startCartographic, - segmentStartCartesian + segmentStartCartesian, ); segmentEndCartesian = projection.project( endCartographic, - segmentEndCartesian + segmentEndCartesian, ); length2D += Cartesian3.distance( segmentStartCartesian, - segmentEndCartesian + segmentEndCartesian, ); index += 2; } @@ -1142,7 +1143,7 @@ function generateGeometryAttributes( segmentEndCartesian = Cartesian3.unpack( topPositionsArray, 0, - segmentEndCartesian + segmentEndCartesian, ); let length3D = 0.0; @@ -1150,12 +1151,12 @@ function generateGeometryAttributes( for (i = 1; i < positionsLength; i++) { segmentStartCartesian = Cartesian3.clone( segmentEndCartesian, - segmentStartCartesian + segmentStartCartesian, ); segmentEndCartesian = Cartesian3.unpack( topPositionsArray, index, - segmentEndCartesian + segmentEndCartesian, ); length3D += Cartesian3.distance(segmentStartCartesian, segmentEndCartesian); index += 3; @@ -1173,26 +1174,26 @@ function generateGeometryAttributes( let endBottom = Cartesian3.unpack( bottomPositionsArray, 0, - segmentEndBottomScratch + segmentEndBottomScratch, ); let endTop = Cartesian3.unpack(topPositionsArray, 0, segmentEndTopScratch); let endGeometryNormal = Cartesian3.unpack( normalsArray, 0, - segmentEndNormalScratch + segmentEndNormalScratch, ); if (loop) { const preEndBottom = Cartesian3.unpack( bottomPositionsArray, bottomPositionsArray.length - 6, - segmentStartBottomScratch + segmentStartBottomScratch, ); if (breakMiter(endGeometryNormal, preEndBottom, endBottom, endTop)) { // Miter broken as if for the last point in the loop, needs to be inverted for first point (clone of endBottom) endGeometryNormal = Cartesian3.negate( endGeometryNormal, - endGeometryNormal + endGeometryNormal, ); } } @@ -1208,26 +1209,26 @@ function generateGeometryAttributes( const startTop = Cartesian3.clone(endTop, segmentStartTopScratch); let startGeometryNormal = Cartesian3.clone( endGeometryNormal, - segmentStartNormalScratch + segmentStartNormalScratch, ); if (miterBroken) { startGeometryNormal = Cartesian3.negate( startGeometryNormal, - startGeometryNormal + startGeometryNormal, ); } endBottom = Cartesian3.unpack( bottomPositionsArray, index, - segmentEndBottomScratch + segmentEndBottomScratch, ); endTop = Cartesian3.unpack(topPositionsArray, index, segmentEndTopScratch); endGeometryNormal = Cartesian3.unpack( normalsArray, index, - segmentEndNormalScratch + segmentEndNormalScratch, ); miterBroken = breakMiter(endGeometryNormal, startBottom, endBottom, endTop); @@ -1263,14 +1264,14 @@ function generateGeometryAttributes( startCartographic, startGeometryNormal, start2D, - segmentStartNormal2DScratch + segmentStartNormal2DScratch, ); endGeometryNormal2D = projectNormal( projection, endCartographic, endGeometryNormal, end2D, - segmentEndNormal2DScratch + segmentEndNormal2DScratch, ); } else if (nudgeResult === 1) { // Start is close to IDL - snap start normal to align with IDL @@ -1279,13 +1280,13 @@ function generateGeometryAttributes( endCartographic, endGeometryNormal, end2D, - segmentEndNormal2DScratch + segmentEndNormal2DScratch, ); startGeometryNormal2D.x = 0.0; // If start longitude is negative and end longitude is less negative, relative right is unit -Y // If start longitude is positive and end longitude is less positive, relative right is unit +Y startGeometryNormal2D.y = CesiumMath.sign( - startCartographic.longitude - Math.abs(endCartographic.longitude) + startCartographic.longitude - Math.abs(endCartographic.longitude), ); startGeometryNormal2D.z = 0.0; } else { @@ -1295,13 +1296,13 @@ function generateGeometryAttributes( startCartographic, startGeometryNormal, start2D, - segmentStartNormal2DScratch + segmentStartNormal2DScratch, ); endGeometryNormal2D.x = 0.0; // If end longitude is negative and start longitude is less negative, relative right is unit Y // If end longitude is positive and start longitude is less positive, relative right is unit -Y endGeometryNormal2D.y = CesiumMath.sign( - startCartographic.longitude - endCartographic.longitude + startCartographic.longitude - endCartographic.longitude, ); endGeometryNormal2D.z = 0.0; } @@ -1321,12 +1322,12 @@ function generateGeometryAttributes( const encodedStart = EncodedCartesian3.fromCartesian( startBottom, - encodeScratch + encodeScratch, ); const forwardOffset = Cartesian3.subtract( endBottom, startBottom, - offsetScratch + offsetScratch, ); const forward = Cartesian3.normalize(forwardOffset, rightScratch); @@ -1338,7 +1339,7 @@ function generateGeometryAttributes( let startPlaneNormal = Cartesian3.cross( startUp, startGeometryNormal, - startPlaneNormalScratch + startPlaneNormalScratch, ); startPlaneNormal = Cartesian3.normalize(startPlaneNormal, startPlaneNormal); @@ -1347,7 +1348,7 @@ function generateGeometryAttributes( let endPlaneNormal = Cartesian3.cross( endGeometryNormal, endUp, - endPlaneNormalScratch + endPlaneNormalScratch, ); endPlaneNormal = Cartesian3.normalize(endPlaneNormal, endPlaneNormal); @@ -1366,12 +1367,12 @@ function generateGeometryAttributes( encodedStart2D = EncodedCartesian3.fromCartesian( start2D, - encodeScratch2D + encodeScratch2D, ); forwardOffset2D = Cartesian3.subtract( end2D, start2D, - forwardOffset2DScratch + forwardOffset2DScratch, ); // Right direction is just forward direction rotated by -90 degrees around Z @@ -1406,14 +1407,14 @@ function generateGeometryAttributes( Cartesian3.pack( startPlaneNormal, startNormalAndForwardOffsetZ, - vec4Index + vec4Index, ); startNormalAndForwardOffsetZ[wIndex] = forwardOffset.z; Cartesian3.pack( endPlaneNormal, endNormalAndTextureCoordinateNormalizationX, - vec4Index + vec4Index, ); endNormalAndTextureCoordinateNormalizationX[wIndex] = texcoordNormalization3DX * rightPlaneSide; @@ -1421,16 +1422,15 @@ function generateGeometryAttributes( Cartesian3.pack( rightNormal, rightNormalAndTextureCoordinateNormalizationY, - vec4Index + vec4Index, ); let texcoordNormalization = texcoordNormalization3DY * topBottomSide; if (texcoordNormalization === 0.0 && topBottomSide < 0.0) { texcoordNormalization = 9.0; // some value greater than 1.0 } - rightNormalAndTextureCoordinateNormalizationY[ - wIndex - ] = texcoordNormalization; + rightNormalAndTextureCoordinateNormalizationY[wIndex] = + texcoordNormalization; // 2D if (compute2dAttributes) { @@ -1468,11 +1468,11 @@ function generateGeometryAttributes( const getHeightsRectangle = Rectangle.fromCartographicArray( getHeightCartographics, - getHeightRectangleScratch + getHeightRectangleScratch, ); const minMaxHeights = ApproximateTerrainHeights.getMinimumMaximumHeights( getHeightsRectangle, - ellipsoid + ellipsoid, ); const minHeight = minMaxHeights.minimumTerrainHeight; const maxHeight = minMaxHeights.maximumTerrainHeight; @@ -1487,7 +1487,7 @@ function generateGeometryAttributes( minHeight, maxHeight, adjustHeightStartBottom, - adjustHeightStartTop + adjustHeightStartTop, ); adjustHeights( endBottom, @@ -1495,19 +1495,19 @@ function generateGeometryAttributes( minHeight, maxHeight, adjustHeightEndBottom, - adjustHeightEndTop + adjustHeightEndTop, ); // Nudge the positions away from the "polyline" a little bit to prevent errors in GeometryPipeline let normalNudge = Cartesian3.multiplyByScalar( rightNormal, CesiumMath.EPSILON5, - normalNudgeScratch + normalNudgeScratch, ); Cartesian3.add( adjustHeightStartBottom, normalNudge, - adjustHeightStartBottom + adjustHeightStartBottom, ); Cartesian3.add(adjustHeightEndBottom, normalNudge, adjustHeightEndBottom); Cartesian3.add(adjustHeightStartTop, normalNudge, adjustHeightStartTop); @@ -1525,12 +1525,12 @@ function generateGeometryAttributes( normalNudge = Cartesian3.multiplyByScalar( rightNormal, -2.0 * CesiumMath.EPSILON5, - normalNudgeScratch + normalNudgeScratch, ); Cartesian3.add( adjustHeightStartBottom, normalNudge, - adjustHeightStartBottom + adjustHeightStartBottom, ); Cartesian3.add(adjustHeightEndBottom, normalNudge, adjustHeightEndBottom); Cartesian3.add(adjustHeightStartTop, normalNudge, adjustHeightStartTop); @@ -1542,12 +1542,12 @@ function generateGeometryAttributes( Cartesian3.pack( adjustHeightStartBottom, positionsArray, - vec3sWriteIndex + 12 + vec3sWriteIndex + 12, ); Cartesian3.pack( adjustHeightEndBottom, positionsArray, - vec3sWriteIndex + 15 + vec3sWriteIndex + 15, ); Cartesian3.pack(adjustHeightEndTop, positionsArray, vec3sWriteIndex + 18); Cartesian3.pack(adjustHeightStartTop, positionsArray, vec3sWriteIndex + 21); @@ -1578,13 +1578,13 @@ function generateGeometryAttributes( bottomPositionsArray, Cartesian3.ZERO, 3, - boundingSpheres[0] + boundingSpheres[0], ); BoundingSphere.fromVertices( topPositionsArray, Cartesian3.ZERO, 3, - boundingSpheres[1] + boundingSpheres[1], ); const boundingSphere = BoundingSphere.fromBoundingSpheres(boundingSpheres); @@ -1599,19 +1599,19 @@ function generateGeometryAttributes( values: positionsArray, }), startHiAndForwardOffsetX: getVec4GeometryAttribute( - startHiAndForwardOffsetX + startHiAndForwardOffsetX, ), startLoAndForwardOffsetY: getVec4GeometryAttribute( - startLoAndForwardOffsetY + startLoAndForwardOffsetY, ), startNormalAndForwardOffsetZ: getVec4GeometryAttribute( - startNormalAndForwardOffsetZ + startNormalAndForwardOffsetZ, ), endNormalAndTextureCoordinateNormalizationX: getVec4GeometryAttribute( - endNormalAndTextureCoordinateNormalizationX + endNormalAndTextureCoordinateNormalizationX, ), rightNormalAndTextureCoordinateNormalizationY: getVec4GeometryAttribute( - rightNormalAndTextureCoordinateNormalizationY + rightNormalAndTextureCoordinateNormalizationY, ), }; diff --git a/packages/engine/Source/Core/HeadingPitchRoll.js b/packages/engine/Source/Core/HeadingPitchRoll.js index 92a3dadfefc2..2fe724cc998b 100644 --- a/packages/engine/Source/Core/HeadingPitchRoll.js +++ b/packages/engine/Source/Core/HeadingPitchRoll.js @@ -111,7 +111,7 @@ HeadingPitchRoll.clone = function (headingPitchRoll, result) { return new HeadingPitchRoll( headingPitchRoll.heading, headingPitchRoll.pitch, - headingPitchRoll.roll + headingPitchRoll.roll, ); } result.heading = headingPitchRoll.heading; @@ -154,7 +154,7 @@ HeadingPitchRoll.equalsEpsilon = function ( left, right, relativeEpsilon, - absoluteEpsilon + absoluteEpsilon, ) { return ( left === right || @@ -164,19 +164,19 @@ HeadingPitchRoll.equalsEpsilon = function ( left.heading, right.heading, relativeEpsilon, - absoluteEpsilon + absoluteEpsilon, ) && CesiumMath.equalsEpsilon( left.pitch, right.pitch, relativeEpsilon, - absoluteEpsilon + absoluteEpsilon, ) && CesiumMath.equalsEpsilon( left.roll, right.roll, relativeEpsilon, - absoluteEpsilon + absoluteEpsilon, )) ); }; @@ -215,13 +215,13 @@ HeadingPitchRoll.prototype.equals = function (right) { HeadingPitchRoll.prototype.equalsEpsilon = function ( right, relativeEpsilon, - absoluteEpsilon + absoluteEpsilon, ) { return HeadingPitchRoll.equalsEpsilon( this, right, relativeEpsilon, - absoluteEpsilon + absoluteEpsilon, ); }; diff --git a/packages/engine/Source/Core/HeightmapTerrainData.js b/packages/engine/Source/Core/HeightmapTerrainData.js index fab32e682b89..1b8b47d3be61 100644 --- a/packages/engine/Source/Core/HeightmapTerrainData.js +++ b/packages/engine/Source/Core/HeightmapTerrainData.js @@ -119,24 +119,24 @@ function HeightmapTerrainData(options) { } else if (structure !== defaultStructure) { structure.heightScale = defaultValue( structure.heightScale, - defaultStructure.heightScale + defaultStructure.heightScale, ); structure.heightOffset = defaultValue( structure.heightOffset, - defaultStructure.heightOffset + defaultStructure.heightOffset, ); structure.elementsPerHeight = defaultValue( structure.elementsPerHeight, - defaultStructure.elementsPerHeight + defaultStructure.elementsPerHeight, ); structure.stride = defaultValue(structure.stride, defaultStructure.stride); structure.elementMultiplier = defaultValue( structure.elementMultiplier, - defaultStructure.elementMultiplier + defaultStructure.elementMultiplier, ); structure.isBigEndian = defaultValue( structure.isBigEndian, - defaultStructure.isBigEndian + defaultStructure.isBigEndian, ); } @@ -187,7 +187,7 @@ const createMeshTaskName = "createVerticesFromHeightmap"; const createMeshTaskProcessorNoThrottle = new TaskProcessor(createMeshTaskName); const createMeshTaskProcessorThrottle = new TaskProcessor( createMeshTaskName, - TerrainData.maximumAsynchronousTasks + TerrainData.maximumAsynchronousTasks, ); /** @@ -224,7 +224,7 @@ HeightmapTerrainData.prototype.createMesh = function (options) { const exaggeration = defaultValue(options.exaggeration, 1.0); const exaggerationRelativeHeight = defaultValue( options.exaggerationRelativeHeight, - 0.0 + 0.0, ); const throttle = defaultValue(options.throttle, true); @@ -237,11 +237,12 @@ HeightmapTerrainData.prototype.createMesh = function (options) { const structure = this._structure; - const levelZeroMaxError = TerrainProvider.getEstimatedLevelZeroGeometricErrorForAHeightmap( - ellipsoid, - this._width, - tilingScheme.getNumberOfXTilesAtLevel(0) - ); + const levelZeroMaxError = + TerrainProvider.getEstimatedLevelZeroGeometricErrorForAHeightmap( + ellipsoid, + this._width, + tilingScheme.getNumberOfXTilesAtLevel(0), + ); const thisLevelMaxError = levelZeroMaxError / (1 << level); this._skirtHeight = Math.min(thisLevelMaxError * 4.0, 1000.0); @@ -275,14 +276,15 @@ HeightmapTerrainData.prototype.createMesh = function (options) { return Promise.resolve(verticesPromise).then(function (result) { let indicesAndEdges; if (that._skirtHeight > 0.0) { - indicesAndEdges = TerrainProvider.getRegularGridAndSkirtIndicesAndEdgeIndices( - result.gridWidth, - result.gridHeight - ); + indicesAndEdges = + TerrainProvider.getRegularGridAndSkirtIndicesAndEdgeIndices( + result.gridWidth, + result.gridHeight, + ); } else { indicesAndEdges = TerrainProvider.getRegularGridIndicesAndEdgeIndices( result.gridWidth, - result.gridHeight + result.gridHeight, ); } @@ -306,7 +308,7 @@ HeightmapTerrainData.prototype.createMesh = function (options) { indicesAndEdges.westIndicesSouthToNorth, indicesAndEdges.southIndicesEastToWest, indicesAndEdges.eastIndicesNorthToSouth, - indicesAndEdges.northIndicesWestToEast + indicesAndEdges.northIndicesWestToEast, ); // Free memory received from server after mesh is created. @@ -341,7 +343,7 @@ HeightmapTerrainData.prototype._createMeshSync = function (options) { const exaggeration = defaultValue(options.exaggeration, 1.0); const exaggerationRelativeHeight = defaultValue( options.exaggerationRelativeHeight, - 0.0 + 0.0, ); const ellipsoid = tilingScheme.ellipsoid; @@ -353,11 +355,12 @@ HeightmapTerrainData.prototype._createMeshSync = function (options) { const structure = this._structure; - const levelZeroMaxError = TerrainProvider.getEstimatedLevelZeroGeometricErrorForAHeightmap( - ellipsoid, - this._width, - tilingScheme.getNumberOfXTilesAtLevel(0) - ); + const levelZeroMaxError = + TerrainProvider.getEstimatedLevelZeroGeometricErrorForAHeightmap( + ellipsoid, + this._width, + tilingScheme.getNumberOfXTilesAtLevel(0), + ); const thisLevelMaxError = levelZeroMaxError / (1 << level); this._skirtHeight = Math.min(thisLevelMaxError * 4.0, 1000.0); @@ -382,14 +385,15 @@ HeightmapTerrainData.prototype._createMeshSync = function (options) { let indicesAndEdges; if (this._skirtHeight > 0.0) { - indicesAndEdges = TerrainProvider.getRegularGridAndSkirtIndicesAndEdgeIndices( - this._width, - this._height - ); + indicesAndEdges = + TerrainProvider.getRegularGridAndSkirtIndicesAndEdgeIndices( + this._width, + this._height, + ); } else { indicesAndEdges = TerrainProvider.getRegularGridIndicesAndEdgeIndices( this._width, - this._height + this._height, ); } @@ -413,7 +417,7 @@ HeightmapTerrainData.prototype._createMeshSync = function (options) { indicesAndEdges.westIndicesSouthToNorth, indicesAndEdges.southIndicesEastToWest, indicesAndEdges.eastIndicesNorthToSouth, - indicesAndEdges.northIndicesWestToEast + indicesAndEdges.northIndicesWestToEast, ); return this._mesh; @@ -432,7 +436,7 @@ HeightmapTerrainData.prototype._createMeshSync = function (options) { HeightmapTerrainData.prototype.interpolateHeight = function ( rectangle, longitude, - latitude + latitude, ) { const width = this._width; const height = this._height; @@ -468,7 +472,7 @@ HeightmapTerrainData.prototype.interpolateHeight = function ( width, height, longitude, - latitude + latitude, ); } else { heightSample = interpolateHeight( @@ -481,7 +485,7 @@ HeightmapTerrainData.prototype.interpolateHeight = function ( width, height, longitude, - latitude + latitude, ); heightSample = heightSample * heightScale + heightOffset; } @@ -510,7 +514,7 @@ HeightmapTerrainData.prototype.upsample = function ( thisLevel, descendantX, descendantY, - descendantLevel + descendantLevel, ) { //>>includeStart('debug', pragmas.debug); if (!defined(tilingScheme)) { @@ -537,7 +541,7 @@ HeightmapTerrainData.prototype.upsample = function ( const levelDifference = descendantLevel - thisLevel; if (levelDifference > 1) { throw new DeveloperError( - "Upsampling through more than one level at a time is not currently supported." + "Upsampling through more than one level at a time is not currently supported.", ); } //>>includeEnd('debug'); @@ -561,12 +565,12 @@ HeightmapTerrainData.prototype.upsample = function ( const sourceRectangle = tilingScheme.tileXYToRectangle( thisX, thisY, - thisLevel + thisLevel, ); const destinationRectangle = tilingScheme.tileXYToRectangle( descendantX, descendantY, - descendantLevel + descendantLevel, ); const heightOffset = structure.heightOffset; @@ -582,13 +586,13 @@ HeightmapTerrainData.prototype.upsample = function ( const latitude = CesiumMath.lerp( destinationRectangle.north, destinationRectangle.south, - j / (height - 1) + j / (height - 1), ); for (let i = 0; i < width; ++i) { const longitude = CesiumMath.lerp( destinationRectangle.west, destinationRectangle.east, - i / (width - 1) + i / (width - 1), ); let heightSample = interpolateMeshHeight( buffer, @@ -599,7 +603,7 @@ HeightmapTerrainData.prototype.upsample = function ( width, height, longitude, - latitude + latitude, ); // Use conditionals here instead of Math.min and Math.max so that an undefined @@ -621,7 +625,7 @@ HeightmapTerrainData.prototype.upsample = function ( stride, isBigEndian, j * width + i, - heightSample + heightSample, ); } } @@ -634,7 +638,7 @@ HeightmapTerrainData.prototype.upsample = function ( childTileMask: 0, structure: this._structure, createdByUpsampling: true, - }) + }), ); }; @@ -654,7 +658,7 @@ HeightmapTerrainData.prototype.isChildAvailable = function ( thisX, thisY, childX, - childY + childY, ) { //>>includeStart('debug', pragmas.debug); if (!defined(thisX)) { @@ -704,7 +708,7 @@ function interpolateHeight( width, height, longitude, - latitude + latitude, ) { const fromWest = ((longitude - sourceRectangle.west) * (width - 1)) / @@ -739,7 +743,7 @@ function interpolateHeight( elementMultiplier, stride, isBigEndian, - southInteger * width + westInteger + southInteger * width + westInteger, ); const southeastHeight = getHeight( sourceHeights, @@ -747,7 +751,7 @@ function interpolateHeight( elementMultiplier, stride, isBigEndian, - southInteger * width + eastInteger + southInteger * width + eastInteger, ); const northwestHeight = getHeight( sourceHeights, @@ -755,7 +759,7 @@ function interpolateHeight( elementMultiplier, stride, isBigEndian, - northInteger * width + westInteger + northInteger * width + westInteger, ); const northeastHeight = getHeight( sourceHeights, @@ -763,7 +767,7 @@ function interpolateHeight( elementMultiplier, stride, isBigEndian, - northInteger * width + eastInteger + northInteger * width + eastInteger, ); return triangleInterpolateHeight( @@ -772,7 +776,7 @@ function interpolateHeight( southwestHeight, southeastHeight, northwestHeight, - northeastHeight + northeastHeight, ); } @@ -785,7 +789,7 @@ function interpolateMeshHeight( width, height, longitude, - latitude + latitude, ) { // returns a height encoded according to the structure's heightScale and heightOffset. const fromWest = @@ -838,7 +842,7 @@ function interpolateMeshHeight( southwestHeight, southeastHeight, northwestHeight, - northeastHeight + northeastHeight, ); } @@ -848,7 +852,7 @@ function triangleInterpolateHeight( southwestHeight, southeastHeight, northwestHeight, - northeastHeight + northeastHeight, ) { // The HeightmapTessellator bisects the quad from southwest to northeast. if (dY < dX) { @@ -874,7 +878,7 @@ function getHeight( elementMultiplier, stride, isBigEndian, - index + index, ) { index *= stride; @@ -902,7 +906,7 @@ function setHeight( stride, isBigEndian, index, - height + height, ) { index *= stride; diff --git a/packages/engine/Source/Core/HeightmapTessellator.js b/packages/engine/Source/Core/HeightmapTessellator.js index 73c23b5e8e98..b49e1a695e05 100644 --- a/packages/engine/Source/Core/HeightmapTessellator.js +++ b/packages/engine/Source/Core/HeightmapTessellator.js @@ -192,38 +192,38 @@ HeightmapTessellator.computeVertices = function (options) { const exaggeration = defaultValue(options.exaggeration, 1.0); const exaggerationRelativeHeight = defaultValue( options.exaggerationRelativeHeight, - 0.0 + 0.0, ); const hasExaggeration = exaggeration !== 1.0; const includeGeodeticSurfaceNormals = hasExaggeration; const structure = defaultValue( options.structure, - HeightmapTessellator.DEFAULT_STRUCTURE + HeightmapTessellator.DEFAULT_STRUCTURE, ); const heightScale = defaultValue( structure.heightScale, - HeightmapTessellator.DEFAULT_STRUCTURE.heightScale + HeightmapTessellator.DEFAULT_STRUCTURE.heightScale, ); const heightOffset = defaultValue( structure.heightOffset, - HeightmapTessellator.DEFAULT_STRUCTURE.heightOffset + HeightmapTessellator.DEFAULT_STRUCTURE.heightOffset, ); const elementsPerHeight = defaultValue( structure.elementsPerHeight, - HeightmapTessellator.DEFAULT_STRUCTURE.elementsPerHeight + HeightmapTessellator.DEFAULT_STRUCTURE.elementsPerHeight, ); const stride = defaultValue( structure.stride, - HeightmapTessellator.DEFAULT_STRUCTURE.stride + HeightmapTessellator.DEFAULT_STRUCTURE.stride, ); const elementMultiplier = defaultValue( structure.elementMultiplier, - HeightmapTessellator.DEFAULT_STRUCTURE.elementMultiplier + HeightmapTessellator.DEFAULT_STRUCTURE.elementMultiplier, ); const isBigEndian = defaultValue( structure.isBigEndian, - HeightmapTessellator.DEFAULT_STRUCTURE.isBigEndian + HeightmapTessellator.DEFAULT_STRUCTURE.isBigEndian, ); let rectangleWidth = Rectangle.computeWidth(nativeRectangle); @@ -247,16 +247,15 @@ HeightmapTessellator.computeVertices = function (options) { const fromENU = Transforms.eastNorthUpToFixedFrame( relativeToCenter, - ellipsoid + ellipsoid, ); const toENU = Matrix4.inverseTransformation(fromENU, matrix4Scratch); let southMercatorY; let oneOverMercatorHeight; if (includeWebMercatorT) { - southMercatorY = WebMercatorProjection.geodeticLatitudeToMercatorAngle( - geographicSouth - ); + southMercatorY = + WebMercatorProjection.geodeticLatitudeToMercatorAngle(geographicSouth); oneOverMercatorHeight = 1.0 / (WebMercatorProjection.geodeticLatitudeToMercatorAngle(geographicNorth) - @@ -465,9 +464,8 @@ HeightmapTessellator.computeVertices = function (options) { } if (includeGeodeticSurfaceNormals) { - geodeticSurfaceNormals[index] = ellipsoid.geodeticSurfaceNormal( - position - ); + geodeticSurfaceNormals[index] = + ellipsoid.geodeticSurfaceNormal(position); } } } @@ -479,18 +477,19 @@ HeightmapTessellator.computeVertices = function (options) { rectangle, minimumHeight, maximumHeight, - ellipsoid + ellipsoid, ); } let occludeePointInScaledSpace; if (hasRelativeToCenter) { const occluder = new EllipsoidalOccluder(ellipsoid); - occludeePointInScaledSpace = occluder.computeHorizonCullingPointPossiblyUnderEllipsoid( - relativeToCenter, - positions, - minimumHeight - ); + occludeePointInScaledSpace = + occluder.computeHorizonCullingPointPossiblyUnderEllipsoid( + relativeToCenter, + positions, + minimumHeight, + ); } const aaBox = new AxisAlignedBoundingBox(minimum, maximum, relativeToCenter); @@ -504,7 +503,7 @@ HeightmapTessellator.computeVertices = function (options) { includeWebMercatorT, includeGeodeticSurfaceNormals, exaggeration, - exaggerationRelativeHeight + exaggerationRelativeHeight, ); const vertices = new Float32Array(vertexCount * encoding.stride); @@ -518,7 +517,7 @@ HeightmapTessellator.computeVertices = function (options) { heights[j], undefined, webMercatorTs[j], - geodeticSurfaceNormals[j] + geodeticSurfaceNormals[j], ); } diff --git a/packages/engine/Source/Core/HermitePolynomialApproximation.js b/packages/engine/Source/Core/HermitePolynomialApproximation.js index c2737cd26d28..e8cab0d6fa28 100644 --- a/packages/engine/Source/Core/HermitePolynomialApproximation.js +++ b/packages/engine/Source/Core/HermitePolynomialApproximation.js @@ -11,7 +11,7 @@ function calculateCoefficientTerm( xTable, derivOrder, termOrder, - reservedIndices + reservedIndices, ) { let result = 0; let reserved; @@ -35,7 +35,7 @@ function calculateCoefficientTerm( xTable, derivOrder - 1, termOrder, - reservedIndices + reservedIndices, ); reservedIndices.splice(reservedIndices.length - 1, 1); } @@ -81,7 +81,7 @@ const HermitePolynomialApproximation = { */ HermitePolynomialApproximation.getRequiredDataPoints = function ( degree, - inputOrder + inputOrder, ) { inputOrder = defaultValue(inputOrder, 0); @@ -118,7 +118,7 @@ HermitePolynomialApproximation.interpolateOrderZero = function ( xTable, yTable, yStride, - result + result, ) { if (!defined(result)) { result = new Array(yStride); @@ -219,7 +219,7 @@ HermitePolynomialApproximation.interpolate = function ( yStride, inputOrder, outputOrder, - result + result, ) { const resultLength = yStride * (outputOrder + 1); if (!defined(result)) { @@ -249,7 +249,7 @@ HermitePolynomialApproximation.interpolate = function ( xTable, yTable, yStride, - inputOrder + inputOrder, ); const reservedIndices = []; @@ -264,7 +264,7 @@ HermitePolynomialApproximation.interpolate = function ( xTable, d, i, - reservedIndices + reservedIndices, ); const dimTwo = Math.floor((i * (1 - i)) / 2) + zIndiceslength * i; @@ -285,7 +285,7 @@ function fillCoefficientList( xTable, yTable, yStride, - inputOrder + inputOrder, ) { let j; let index; diff --git a/packages/engine/Source/Core/HermiteSpline.js b/packages/engine/Source/Core/HermiteSpline.js index 629e81e7687a..bad84e49c200 100644 --- a/packages/engine/Source/Core/HermiteSpline.js +++ b/packages/engine/Source/Core/HermiteSpline.js @@ -182,12 +182,12 @@ function HermiteSpline(options) { !defined(outTangents) ) { throw new DeveloperError( - "times, points, inTangents, and outTangents are required." + "times, points, inTangents, and outTangents are required.", ); } if (points.length < 2) { throw new DeveloperError( - "points.length must be greater than or equal to 2." + "points.length must be greater than or equal to 2.", ); } if (times.length !== points.length) { @@ -198,7 +198,7 @@ function HermiteSpline(options) { inTangents.length !== points.length - 1 ) { throw new DeveloperError( - "inTangents and outTangents must have a length equal to points.length - 1." + "inTangents and outTangents must have a length equal to points.length - 1.", ); } //>>includeEnd('debug'); @@ -212,7 +212,7 @@ function HermiteSpline(options) { this._pointType !== Spline.getPointType(outTangents[0]) ) { throw new DeveloperError( - "inTangents and outTangents must be of the same type as points." + "inTangents and outTangents must be of the same type as points.", ); } //>>includeEnd('debug'); @@ -332,12 +332,12 @@ HermiteSpline.createC1 = function (options) { } if (points.length < 2) { throw new DeveloperError( - "points.length must be greater than or equal to 2." + "points.length must be greater than or equal to 2.", ); } if (times.length !== points.length || times.length !== tangents.length) { throw new DeveloperError( - "times, points and tangents must have the same length." + "times, points and tangents must have the same length.", ); } //>>includeEnd('debug'); @@ -391,7 +391,7 @@ HermiteSpline.createNaturalCubic = function (options) { } if (points.length < 2) { throw new DeveloperError( - "points.length must be greater than or equal to 2." + "points.length must be greater than or equal to 2.", ); } if (times.length !== points.length) { @@ -465,12 +465,12 @@ HermiteSpline.createClampedCubic = function (options) { !defined(lastTangent) ) { throw new DeveloperError( - "points, times, firstTangent and lastTangent are required." + "points, times, firstTangent and lastTangent are required.", ); } if (points.length < 2) { throw new DeveloperError( - "points.length must be greater than or equal to 2." + "points.length must be greater than or equal to 2.", ); } if (times.length !== points.length) { @@ -486,7 +486,7 @@ HermiteSpline.createClampedCubic = function (options) { PointType !== Spline.getPointType(lastTangent) ) { throw new DeveloperError( - "firstTangent and lastTangent must be of the same type as points." + "firstTangent and lastTangent must be of the same type as points.", ); } //>>includeEnd('debug'); @@ -587,7 +587,7 @@ HermiteSpline.prototype.evaluate = function (time, result) { const coefs = Matrix4.multiplyByVector( HermiteSpline.hermiteCoefficientMatrix, timeVec, - timeVec + timeVec, ); // Multiply the out-tangent and in-tangent values by the time delta. diff --git a/packages/engine/Source/Core/HilbertOrder.js b/packages/engine/Source/Core/HilbertOrder.js index 540a1ea493b4..768ad47e23d0 100644 --- a/packages/engine/Source/Core/HilbertOrder.js +++ b/packages/engine/Source/Core/HilbertOrder.js @@ -70,7 +70,7 @@ HilbertOrder.decode2D = function (level, index) { // eslint-disable-next-line no-undef if (index < BigInt(0) || index >= BigInt(Math.pow(4, level))) { throw new DeveloperError( - "Hilbert index exceeds valid maximum for given level." + "Hilbert index exceeds valid maximum for given level.", ); } //>>includeEnd('debug'); diff --git a/packages/engine/Source/Core/Iau2006XysData.js b/packages/engine/Source/Core/Iau2006XysData.js index c09aec64a55c..86849d1756d6 100644 --- a/packages/engine/Source/Core/Iau2006XysData.js +++ b/packages/engine/Source/Core/Iau2006XysData.js @@ -29,17 +29,17 @@ function Iau2006XysData(options) { options = defaultValue(options, defaultValue.EMPTY_OBJECT); this._xysFileUrlTemplate = Resource.createIfNeeded( - options.xysFileUrlTemplate + options.xysFileUrlTemplate, ); this._interpolationOrder = defaultValue(options.interpolationOrder, 9); this._sampleZeroJulianEphemerisDate = defaultValue( options.sampleZeroJulianEphemerisDate, - 2442396.5 + 2442396.5, ); this._sampleZeroDateTT = new JulianDate( this._sampleZeroJulianEphemerisDate, 0.0, - TimeStandard.TAI + TimeStandard.TAI, ); this._stepSizeDays = defaultValue(options.stepSizeDays, 1.0); this._samplesPerXysFile = defaultValue(options.samplesPerXysFile, 1000); @@ -100,12 +100,12 @@ Iau2006XysData.prototype.preload = function ( startDayTT, startSecondTT, stopDayTT, - stopSecondTT + stopSecondTT, ) { const startDaysSinceEpoch = getDaysSinceEpoch( this, startDayTT, - startSecondTT + startSecondTT, ); const stopDaysSinceEpoch = getDaysSinceEpoch(this, stopDayTT, stopSecondTT); @@ -152,7 +152,7 @@ Iau2006XysData.prototype.preload = function ( Iau2006XysData.prototype.computeXysRadians = function ( dayTT, secondTT, - result + result, ) { const daysSinceEpoch = getDaysSinceEpoch(this, dayTT, secondTT); if (daysSinceEpoch < 0.0) { diff --git a/packages/engine/Source/Core/IauOrientationAxes.js b/packages/engine/Source/Core/IauOrientationAxes.js index 098867325578..7c590f89b10e 100644 --- a/packages/engine/Source/Core/IauOrientationAxes.js +++ b/packages/engine/Source/Core/IauOrientationAxes.js @@ -81,14 +81,14 @@ IauOrientationAxes.prototype.evaluate = function (date, result) { const precMtx = computeRotationMatrix( alphaDeltaW.rightAscension, alphaDeltaW.declination, - result + result, ); const rot = CesiumMath.zeroToTwoPi(alphaDeltaW.rotation); const quat = Quaternion.fromAxisAngle(Cartesian3.UNIT_Z, rot, quatScratch); const rotMtx = Matrix3.fromQuaternion( Quaternion.conjugate(quat, quat), - rotMtxScratch + rotMtxScratch, ); const cbi2cbf = Matrix3.multiply(rotMtx, precMtx, precMtx); diff --git a/packages/engine/Source/Core/IauOrientationParameters.js b/packages/engine/Source/Core/IauOrientationParameters.js index ba72c47384e6..5531e1af0f1d 100644 --- a/packages/engine/Source/Core/IauOrientationParameters.js +++ b/packages/engine/Source/Core/IauOrientationParameters.js @@ -14,7 +14,7 @@ function IauOrientationParameters( rightAscension, declination, rotation, - rotationRate + rotationRate, ) { /** * The right ascension of the north pole of the body with respect to diff --git a/packages/engine/Source/Core/IndexDatatype.js b/packages/engine/Source/Core/IndexDatatype.js index 6a31e2ce9426..ccd8373f9033 100644 --- a/packages/engine/Source/Core/IndexDatatype.js +++ b/packages/engine/Source/Core/IndexDatatype.js @@ -60,7 +60,7 @@ IndexDatatype.getSizeInBytes = function (indexDatatype) { //>>includeStart('debug', pragmas.debug); throw new DeveloperError( - "indexDatatype is required and must be a valid IndexDatatype constant." + "indexDatatype is required and must be a valid IndexDatatype constant.", ); //>>includeEnd('debug'); }; @@ -82,7 +82,7 @@ IndexDatatype.fromSizeInBytes = function (sizeInBytes) { //>>includeStart('debug', pragmas.debug); default: throw new DeveloperError( - "Size in bytes cannot be mapped to an IndexDatatype" + "Size in bytes cannot be mapped to an IndexDatatype", ); //>>includeEnd('debug'); } @@ -121,7 +121,7 @@ IndexDatatype.validate = function (indexDatatype) { */ IndexDatatype.createTypedArray = function ( numberOfVertices, - indicesLengthOrArray + indicesLengthOrArray, ) { //>>includeStart('debug', pragmas.debug); if (!defined(numberOfVertices)) { @@ -151,7 +151,7 @@ IndexDatatype.createTypedArrayFromArrayBuffer = function ( numberOfVertices, sourceArray, byteOffset, - length + length, ) { //>>includeStart('debug', pragmas.debug); if (!defined(numberOfVertices)) { @@ -191,7 +191,7 @@ IndexDatatype.fromTypedArray = function (array) { //>>includeStart('debug', pragmas.debug); throw new DeveloperError( - "array must be a Uint8Array, Uint16Array, or Uint32Array." + "array must be a Uint8Array, Uint16Array, or Uint32Array.", ); //>>includeEnd('debug'); }; diff --git a/packages/engine/Source/Core/IntersectionTests.js b/packages/engine/Source/Core/IntersectionTests.js index 295b467bdb45..4ba53f228c12 100644 --- a/packages/engine/Source/Core/IntersectionTests.js +++ b/packages/engine/Source/Core/IntersectionTests.js @@ -86,7 +86,7 @@ IntersectionTests.rayTriangleParametric = function ( p0, p1, p2, - cullBackFaces + cullBackFaces, ) { //>>includeStart('debug', pragmas.debug); if (!defined(ray)) { @@ -188,14 +188,14 @@ IntersectionTests.rayTriangle = function ( p1, p2, cullBackFaces, - result + result, ) { const t = IntersectionTests.rayTriangleParametric( ray, p0, p1, p2, - cullBackFaces + cullBackFaces, ); if (!defined(t) || t < 0.0) { return undefined; @@ -232,7 +232,7 @@ IntersectionTests.lineSegmentTriangle = function ( p1, p2, cullBackFaces, - result + result, ) { //>>includeStart('debug', pragmas.debug); if (!defined(v0)) { @@ -262,7 +262,7 @@ IntersectionTests.lineSegmentTriangle = function ( p0, p1, p2, - cullBackFaces + cullBackFaces, ); if (!defined(t) || t < 0.0 || t > Cartesian3.distance(v0, v1)) { return undefined; @@ -433,7 +433,7 @@ IntersectionTests.rayEllipsoid = function (ray, ellipsoid) { const w = Cartesian3.multiplyComponents( inverseRadii, ray.direction, - scratchW + scratchW, ); const q2 = Cartesian3.magnitudeSquared(q); @@ -522,7 +522,7 @@ IntersectionTests.quadraticVectorExpression = function (A, b, c, x, w) { addWithCancellationCheck( A[Matrix3.COLUMN1ROW0], A[Matrix3.COLUMN0ROW1], - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ) + b.y); const l0 = @@ -536,7 +536,7 @@ IntersectionTests.quadraticVectorExpression = function (A, b, c, x, w) { addWithCancellationCheck( A[Matrix3.COLUMN2ROW1], A[Matrix3.COLUMN1ROW2], - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); const r0 = w * @@ -600,26 +600,26 @@ IntersectionTests.quadraticVectorExpression = function (A, b, c, x, w) { left = addWithCancellationCheck( l2 * cosineSquared + l0, l1 * cosine, - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); } else if (CesiumMath.sign(l0) === CesiumMath.sign(l1 * cosine)) { left = addWithCancellationCheck( l2 * cosineSquared, l1 * cosine + l0, - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); } else { left = addWithCancellationCheck( l2 * cosineSquared + l1 * cosine, l0, - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); } const right = addWithCancellationCheck( r1 * cosine, r0, - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); const product = left * right; @@ -688,7 +688,7 @@ IntersectionTests.grazingAltitudeLocation = function (ray, ellipsoid) { // Compute the scaled direction vector. const f = ellipsoid.transformPositionToScaledSpace( direction, - firstAxisScratch + firstAxisScratch, ); // Constructs a basis from the unit scaled direction vector. Construct its rotation and transpose. @@ -696,11 +696,11 @@ IntersectionTests.grazingAltitudeLocation = function (ray, ellipsoid) { const reference = Cartesian3.mostOrthogonalAxis(f, referenceScratch); const secondAxis = Cartesian3.normalize( Cartesian3.cross(reference, firstAxis, secondAxisScratch), - secondAxisScratch + secondAxisScratch, ); const thirdAxis = Cartesian3.normalize( Cartesian3.cross(firstAxis, secondAxis, thirdAxisScratch), - thirdAxisScratch + thirdAxisScratch, ); const B = bScratch; B[0] = firstAxis.x; @@ -733,12 +733,12 @@ IntersectionTests.grazingAltitudeLocation = function (ray, ellipsoid) { const temp = Matrix3.multiply( Matrix3.multiply(B_T, D, tempMatrix), C, - tempMatrix + tempMatrix, ); const A = Matrix3.multiply( Matrix3.multiply(temp, D_I, aScratch), B, - aScratch + aScratch, ); const b = Matrix3.multiplyByVector(temp, position, bCart); @@ -748,7 +748,7 @@ IntersectionTests.grazingAltitudeLocation = function (ray, ellipsoid) { Cartesian3.negate(b, firstAxisScratch), 0.0, 0.0, - 1.0 + 1.0, ); let s; @@ -762,11 +762,11 @@ IntersectionTests.grazingAltitudeLocation = function (ray, ellipsoid) { s = Matrix3.multiplyByVector( D_I, Matrix3.multiplyByVector(B, solutions[i], sScratch), - sScratch + sScratch, ); const v = Cartesian3.normalize( Cartesian3.subtract(s, position, referenceScratch), - referenceScratch + referenceScratch, ); const dotProduct = Cartesian3.dot(v, direction); @@ -778,12 +778,12 @@ IntersectionTests.grazingAltitudeLocation = function (ray, ellipsoid) { const surfacePoint = ellipsoid.cartesianToCartographic( closest, - surfPointScratch + surfPointScratch, ); maximumValue = CesiumMath.clamp(maximumValue, 0.0, 1.0); altitude = Cartesian3.magnitude( - Cartesian3.subtract(closest, position, referenceScratch) + Cartesian3.subtract(closest, position, referenceScratch), ) * Math.sqrt(1.0 - maximumValue * maximumValue); altitude = intersects ? -altitude : altitude; surfacePoint.height = altitude; @@ -819,7 +819,7 @@ IntersectionTests.lineSegmentPlane = function ( endPoint0, endPoint1, plane, - result + result, ) { //>>includeStart('debug', pragmas.debug); if (!defined(endPoint0)) { @@ -840,7 +840,7 @@ IntersectionTests.lineSegmentPlane = function ( const difference = Cartesian3.subtract( endPoint1, endPoint0, - lineSegmentPlaneDifference + lineSegmentPlaneDifference, ); const normal = plane.normal; const nDotDiff = Cartesian3.dot(normal, difference); @@ -920,17 +920,10 @@ IntersectionTests.trianglePlaneIntersection = function (p0, p1, p2, plane) { positions: [p0, p1, p2, u1, u2], indices: [ // Behind - 0, - 3, - 4, + 0, 3, 4, // In front - 1, - 2, - 4, - 1, - 4, - 3, + 1, 2, 4, 1, 4, 3, ], }; } else if (p1Behind) { @@ -941,17 +934,10 @@ IntersectionTests.trianglePlaneIntersection = function (p0, p1, p2, plane) { positions: [p0, p1, p2, u1, u2], indices: [ // Behind - 1, - 3, - 4, + 1, 3, 4, // In front - 2, - 0, - 4, - 2, - 4, - 3, + 2, 0, 4, 2, 4, 3, ], }; } else if (p2Behind) { @@ -962,17 +948,10 @@ IntersectionTests.trianglePlaneIntersection = function (p0, p1, p2, plane) { positions: [p0, p1, p2, u1, u2], indices: [ // Behind - 2, - 3, - 4, + 2, 3, 4, // In front - 0, - 1, - 4, - 0, - 4, - 3, + 0, 1, 4, 0, 4, 3, ], }; } @@ -985,17 +964,10 @@ IntersectionTests.trianglePlaneIntersection = function (p0, p1, p2, plane) { positions: [p0, p1, p2, u1, u2], indices: [ // Behind - 1, - 2, - 4, - 1, - 4, - 3, + 1, 2, 4, 1, 4, 3, // In front - 0, - 3, - 4, + 0, 3, 4, ], }; } else if (!p1Behind) { @@ -1006,17 +978,10 @@ IntersectionTests.trianglePlaneIntersection = function (p0, p1, p2, plane) { positions: [p0, p1, p2, u1, u2], indices: [ // Behind - 2, - 0, - 4, - 2, - 4, - 3, + 2, 0, 4, 2, 4, 3, // In front - 1, - 3, - 4, + 1, 3, 4, ], }; } else if (!p2Behind) { @@ -1027,17 +992,10 @@ IntersectionTests.trianglePlaneIntersection = function (p0, p1, p2, plane) { positions: [p0, p1, p2, u1, u2], indices: [ // Behind - 0, - 1, - 4, - 0, - 4, - 3, + 0, 1, 4, 0, 4, 3, // In front - 2, - 3, - 4, + 2, 3, 4, ], }; } diff --git a/packages/engine/Source/Core/Intersections2D.js b/packages/engine/Source/Core/Intersections2D.js index df98e06093db..aabc0cd5561d 100644 --- a/packages/engine/Source/Core/Intersections2D.js +++ b/packages/engine/Source/Core/Intersections2D.js @@ -43,7 +43,7 @@ Intersections2D.clipTriangleAtAxisAlignedThreshold = function ( u0, u1, u2, - result + result, ) { //>>includeStart('debug', pragmas.debug); if (!defined(threshold)) { @@ -242,7 +242,7 @@ Intersections2D.computeBarycentricCoordinates = function ( y2, x3, y3, - result + result, ) { //>>includeStart('debug', pragmas.debug); if (!defined(x)) { @@ -319,7 +319,7 @@ Intersections2D.computeLineSegmentLineSegmentIntersection = function ( y10, x11, y11, - result + result, ) { //>>includeStart('debug', pragmas.debug); Check.typeOf.number("x00", x00); diff --git a/packages/engine/Source/Core/IonGeocoderService.js b/packages/engine/Source/Core/IonGeocoderService.js index 7ff6f6260d2d..81da96b7dbba 100644 --- a/packages/engine/Source/Core/IonGeocoderService.js +++ b/packages/engine/Source/Core/IonGeocoderService.js @@ -27,14 +27,14 @@ function IonGeocoderService(options) { const accessToken = defaultValue(options.accessToken, Ion.defaultAccessToken); const server = Resource.createIfNeeded( - defaultValue(options.server, Ion.defaultServer) + defaultValue(options.server, Ion.defaultServer), ); server.appendForwardSlash(); const defaultTokenCredit = Ion.getDefaultTokenCredit(accessToken); if (defined(defaultTokenCredit)) { options.scene.frameState.creditDisplay.addStaticCredit( - Credit.clone(defaultTokenCredit) + Credit.clone(defaultTokenCredit), ); } diff --git a/packages/engine/Source/Core/IonResource.js b/packages/engine/Source/Core/IonResource.js index b0dfe6bd43ff..c9cc74bca53e 100644 --- a/packages/engine/Source/Core/IonResource.js +++ b/packages/engine/Source/Core/IonResource.js @@ -48,7 +48,7 @@ function IonResource(endpoint, endpointResource) { } else { //External imagery assets have additional configuration that can't be represented as a Resource throw new RuntimeError( - "Ion.createResource does not support external imagery assets; use IonImageryProvider instead." + "Ion.createResource does not support external imagery assets; use IonImageryProvider instead.", ); } @@ -106,7 +106,7 @@ if (defined(Object.create)) { IonResource.fromAssetId = function (assetId, options) { const endpointResource = IonResource._createEndpointResource( assetId, - options + options, ); return endpointResource.fetchJson().then(function (endpoint) { @@ -136,7 +136,7 @@ Object.defineProperties(IonResource.prototype, { this._credits = IonResource.getCreditsFromEndpoint( this._ionEndpoint, - this._ionEndpointResource + this._ionEndpointResource, ); return this._credits; @@ -148,7 +148,7 @@ Object.defineProperties(IonResource.prototype, { IonResource.getCreditsFromEndpoint = function (endpoint, endpointResource) { const credits = endpoint.attributions.map(Credit.getIonCredit); const defaultTokenCredit = Ion.getDefaultTokenCredit( - endpointResource.queryParameters.access_token + endpointResource.queryParameters.access_token, ); if (defined(defaultTokenCredit)) { credits.push(Credit.clone(defaultTokenCredit)); @@ -164,7 +164,7 @@ IonResource.prototype.clone = function (result) { if (!defined(result)) { result = new IonResource( ionRoot._ionEndpoint, - ionRoot._ionEndpointResource + ionRoot._ionEndpointResource, ); } diff --git a/packages/engine/Source/Core/Iso8601.js b/packages/engine/Source/Core/Iso8601.js index 3b491f54c380..e1b2664e13d6 100644 --- a/packages/engine/Source/Core/Iso8601.js +++ b/packages/engine/Source/Core/Iso8601.js @@ -2,16 +2,16 @@ import JulianDate from "./JulianDate.js"; import TimeInterval from "./TimeInterval.js"; const MINIMUM_VALUE = Object.freeze( - JulianDate.fromIso8601("0000-01-01T00:00:00Z") + JulianDate.fromIso8601("0000-01-01T00:00:00Z"), ); const MAXIMUM_VALUE = Object.freeze( - JulianDate.fromIso8601("9999-12-31T24:00:00Z") + JulianDate.fromIso8601("9999-12-31T24:00:00Z"), ); const MAXIMUM_INTERVAL = Object.freeze( new TimeInterval({ start: MINIMUM_VALUE, stop: MAXIMUM_VALUE, - }) + }), ); /** diff --git a/packages/engine/Source/Core/JulianDate.js b/packages/engine/Source/Core/JulianDate.js index 3e8a6ec24d5e..092e4683e5a8 100644 --- a/packages/engine/Source/Core/JulianDate.js +++ b/packages/engine/Source/Core/JulianDate.js @@ -27,7 +27,7 @@ function convertUtcToTai(julianDate) { let index = binarySearch( leapSeconds, binarySearchScratchLeapSecond, - compareLeapSecondDates + compareLeapSecondDates, ); if (index < 0) { @@ -46,7 +46,7 @@ function convertUtcToTai(julianDate) { //the previous leap second. const difference = JulianDate.secondsDifference( leapSeconds[index].julianDate, - julianDate + julianDate, ); if (difference > offset) { index--; @@ -63,7 +63,7 @@ function convertTaiToUtc(julianDate, result) { let index = binarySearch( leapSeconds, binarySearchScratchLeapSecond, - compareLeapSecondDates + compareLeapSecondDates, ); if (index < 0) { index = ~index; @@ -79,14 +79,14 @@ function convertTaiToUtc(julianDate, result) { return JulianDate.addSeconds( julianDate, -leapSeconds[index - 1].offset, - result + result, ); } //Compute the difference between the found leap second and the time we are converting. const difference = JulianDate.secondsDifference( leapSeconds[index].julianDate, - julianDate + julianDate, ); if (difference === 0) { @@ -94,7 +94,7 @@ function convertTaiToUtc(julianDate, result) { return JulianDate.addSeconds( julianDate, -leapSeconds[index].offset, - result + result, ); } @@ -108,7 +108,7 @@ function convertTaiToUtc(julianDate, result) { return JulianDate.addSeconds( julianDate, -leapSeconds[--index].offset, - result + result, ); } @@ -134,7 +134,7 @@ function computeJulianDateComponents( hour, minute, second, - millisecond + millisecond, ) { // Algorithm from page 604 of the Explanatory Supplement to the // Astronomical Almanac (Seidelmann 1992). @@ -256,7 +256,7 @@ JulianDate.fromGregorianDate = function (date, result) { date.hour, date.minute, date.second, - date.millisecond + date.millisecond, ); if (!defined(result)) { return new JulianDate(components[0], components[1], TimeStandard.UTC); @@ -289,7 +289,7 @@ JulianDate.fromDate = function (date, result) { date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds(), - date.getUTCMilliseconds() + date.getUTCMilliseconds(), ); if (!defined(result)) { return new JulianDate(components[0], components[1], TimeStandard.UTC); @@ -514,7 +514,7 @@ JulianDate.fromIso8601 = function (iso8601String, result) { minute = minute + new Date( - Date.UTC(year, month - 1, day, hour, minute) + Date.UTC(year, month - 1, day, hour, minute), ).getTimezoneOffset(); break; } @@ -587,7 +587,7 @@ JulianDate.fromIso8601 = function (iso8601String, result) { hour, minute, second, - millisecond + millisecond, ); if (!defined(result)) { @@ -692,7 +692,7 @@ JulianDate.toGregorianDate = function (julianDate, result) { minute, second, millisecond, - isLeapSecond + isLeapSecond, ); } @@ -736,8 +736,8 @@ JulianDate.toDate = function (julianDate) { gDate.hour, gDate.minute, second, - gDate.millisecond - ) + gDate.millisecond, + ), ); }; @@ -788,13 +788,9 @@ JulianDate.toIso8601 = function (julianDate, precision) { millisecondStr = (millisecond * 0.01).toString().replace(".", ""); return `${year.toString().padStart(4, "0")}-${month .toString() - .padStart(2, "0")}-${day - .toString() - .padStart(2, "0")}T${hour - .toString() - .padStart(2, "0")}:${minute + .padStart(2, "0")}-${day.toString().padStart(2, "0")}T${hour .toString() - .padStart(2, "0")}:${second + .padStart(2, "0")}:${minute.toString().padStart(2, "0")}:${second .toString() .padStart(2, "0")}.${millisecondStr}Z`; } @@ -803,9 +799,7 @@ JulianDate.toIso8601 = function (julianDate, precision) { if (!defined(precision) || precision === 0) { return `${year.toString().padStart(4, "0")}-${month .toString() - .padStart(2, "0")}-${day - .toString() - .padStart(2, "0")}T${hour + .padStart(2, "0")}-${day.toString().padStart(2, "0")}T${hour .toString() .padStart(2, "0")}:${minute .toString() @@ -819,13 +813,9 @@ JulianDate.toIso8601 = function (julianDate, precision) { .slice(0, precision); return `${year.toString().padStart(4, "0")}-${month .toString() - .padStart(2, "0")}-${day - .toString() - .padStart(2, "0")}T${hour - .toString() - .padStart(2, "0")}:${minute + .padStart(2, "0")}-${day.toString().padStart(2, "0")}T${hour .toString() - .padStart(2, "0")}:${second + .padStart(2, "0")}:${minute.toString().padStart(2, "0")}:${second .toString() .padStart(2, "0")}.${millisecondStr}Z`; }; @@ -845,7 +835,7 @@ JulianDate.clone = function (julianDate, result) { return new JulianDate( julianDate.dayNumber, julianDate.secondsOfDay, - TimeStandard.TAI + TimeStandard.TAI, ); } result.dayNumber = julianDate.dayNumber; @@ -991,7 +981,7 @@ JulianDate.computeTaiMinusUtc = function (julianDate) { let index = binarySearch( leapSeconds, binarySearchScratchLeapSecond, - compareLeapSecondDates + compareLeapSecondDates, ); if (index < 0) { index = ~index; @@ -1027,7 +1017,7 @@ JulianDate.addSeconds = function (julianDate, seconds, result) { return setComponents( julianDate.dayNumber, julianDate.secondsOfDay + seconds, - result + result, ); }; diff --git a/packages/engine/Source/Core/KTX2Transcoder.js b/packages/engine/Source/Core/KTX2Transcoder.js index f09aca0f2e99..4e4aff9465df 100644 --- a/packages/engine/Source/Core/KTX2Transcoder.js +++ b/packages/engine/Source/Core/KTX2Transcoder.js @@ -13,7 +13,7 @@ function KTX2Transcoder() {} KTX2Transcoder._transcodeTaskProcessor = new TaskProcessor( "transcodeKTX2", - Number.POSITIVE_INFINITY // KTX2 transcoding is used in place of Resource.fetchImage, so it can't reject as "just soooo busy right now" + Number.POSITIVE_INFINITY, // KTX2 transcoding is used in place of Resource.fetchImage, so it can't reject as "just soooo busy right now" ); KTX2Transcoder._readyPromise = undefined; @@ -67,7 +67,7 @@ KTX2Transcoder.transcode = function (ktx2Buffer, supportedTargetFormats) { face.datatype, face.width, face.height, - face.levelBuffer + face.levelBuffer, ); } } diff --git a/packages/engine/Source/Core/LagrangePolynomialApproximation.js b/packages/engine/Source/Core/LagrangePolynomialApproximation.js index 67c15aa28fb1..7863ae49b2a5 100644 --- a/packages/engine/Source/Core/LagrangePolynomialApproximation.js +++ b/packages/engine/Source/Core/LagrangePolynomialApproximation.js @@ -37,7 +37,7 @@ LagrangePolynomialApproximation.interpolateOrderZero = function ( xTable, yTable, yStride, - result + result, ) { if (!defined(result)) { result = new Array(yStride); diff --git a/packages/engine/Source/Core/LinearApproximation.js b/packages/engine/Source/Core/LinearApproximation.js index c605a7f4fb39..0e46bdbca726 100644 --- a/packages/engine/Source/Core/LinearApproximation.js +++ b/packages/engine/Source/Core/LinearApproximation.js @@ -40,16 +40,16 @@ LinearApproximation.interpolateOrderZero = function ( xTable, yTable, yStride, - result + result, ) { //>>includeStart('debug', pragmas.debug); if (xTable.length !== 2) { throw new DeveloperError( - "The xTable provided to the linear interpolator must have exactly two elements." + "The xTable provided to the linear interpolator must have exactly two elements.", ); } else if (yStride <= 0) { throw new DeveloperError( - "There must be at least 1 dependent variable for each independent variable." + "There must be at least 1 dependent variable for each independent variable.", ); } //>>includeEnd('debug'); @@ -67,7 +67,7 @@ LinearApproximation.interpolateOrderZero = function ( //>>includeStart('debug', pragmas.debug); if (x0 === x1) { throw new DeveloperError( - "Divide by zero error: xTable[0] and xTable[1] are equal" + "Divide by zero error: xTable[0] and xTable[1] are equal", ); } //>>includeEnd('debug'); diff --git a/packages/engine/Source/Core/LinearSpline.js b/packages/engine/Source/Core/LinearSpline.js index d067d318cc26..3c025670b704 100644 --- a/packages/engine/Source/Core/LinearSpline.js +++ b/packages/engine/Source/Core/LinearSpline.js @@ -53,7 +53,7 @@ function LinearSpline(options) { } if (points.length < 2) { throw new DeveloperError( - "points.length must be greater than or equal to 2." + "points.length must be greater than or equal to 2.", ); } if (times.length !== points.length) { @@ -147,7 +147,7 @@ LinearSpline.prototype.evaluate = function (time, result) { const i = (this._lastTimeIndex = this.findTimeInterval( time, - this._lastTimeIndex + this._lastTimeIndex, )); const u = (time - times[i]) / (times[i + 1] - times[i]); diff --git a/packages/engine/Source/Core/Math.js b/packages/engine/Source/Core/Math.js index 59ae199d8dc0..150cd9aa30aa 100644 --- a/packages/engine/Source/Core/Math.js +++ b/packages/engine/Source/Core/Math.js @@ -236,7 +236,7 @@ CesiumMath.signNotZero = function (value) { CesiumMath.toSNorm = function (value, rangeMaximum) { rangeMaximum = defaultValue(rangeMaximum, 255); return Math.round( - (CesiumMath.clamp(value, -1.0, 1.0) * 0.5 + 0.5) * rangeMaximum + (CesiumMath.clamp(value, -1.0, 1.0) * 0.5 + 0.5) * rangeMaximum, ); }; @@ -509,7 +509,7 @@ CesiumMath.clampToLatitudeRange = function (angle) { return CesiumMath.clamp( angle, -1 * CesiumMath.PI_OVER_TWO, - CesiumMath.PI_OVER_TWO + CesiumMath.PI_OVER_TWO, ); }; @@ -610,7 +610,7 @@ CesiumMath.equalsEpsilon = function ( left, right, relativeEpsilon, - absoluteEpsilon + absoluteEpsilon, ) { //>>includeStart('debug', pragmas.debug); if (!defined(left)) { @@ -753,7 +753,7 @@ CesiumMath.factorial = function (n) { //>>includeStart('debug', pragmas.debug); if (typeof n !== "number" || n < 0) { throw new DeveloperError( - "A number greater than or equal to 0 is required." + "A number greater than or equal to 0 is required.", ); } //>>includeEnd('debug'); diff --git a/packages/engine/Source/Core/Matrix2.js b/packages/engine/Source/Core/Matrix2.js index 7f0cba621c0d..479489d6cd93 100644 --- a/packages/engine/Source/Core/Matrix2.js +++ b/packages/engine/Source/Core/Matrix2.js @@ -109,7 +109,7 @@ Matrix2.packArray = function (array, result) { } else if (!Array.isArray(result) && result.length !== resultLength) { //>>includeStart('debug', pragmas.debug); throw new DeveloperError( - "If result is a typed array, it must have exactly array.length * 4 elements" + "If result is a typed array, it must have exactly array.length * 4 elements", ); //>>includeEnd('debug'); } else if (result.length !== resultLength) { @@ -584,10 +584,10 @@ Matrix2.getScale = function (matrix, result) { //>>includeEnd('debug'); result.x = Cartesian2.magnitude( - Cartesian2.fromElements(matrix[0], matrix[1], scratchColumn) + Cartesian2.fromElements(matrix[0], matrix[1], scratchColumn), ); result.y = Cartesian2.magnitude( - Cartesian2.fromElements(matrix[2], matrix[3], scratchColumn) + Cartesian2.fromElements(matrix[2], matrix[3], scratchColumn), ); return result; }; diff --git a/packages/engine/Source/Core/Matrix3.js b/packages/engine/Source/Core/Matrix3.js index 80b4a5185c24..9174f3c37096 100644 --- a/packages/engine/Source/Core/Matrix3.js +++ b/packages/engine/Source/Core/Matrix3.js @@ -45,7 +45,7 @@ function Matrix3( column2Row1, column0Row2, column1Row2, - column2Row2 + column2Row2, ) { this[0] = defaultValue(column0Row0, 0.0); this[1] = defaultValue(column0Row1, 0.0); @@ -145,7 +145,7 @@ Matrix3.packArray = function (array, result) { } else if (!Array.isArray(result) && result.length !== resultLength) { //>>includeStart('debug', pragmas.debug); throw new DeveloperError( - "If result is a typed array, it must have exactly array.length * 9 elements" + "If result is a typed array, it must have exactly array.length * 9 elements", ); //>>includeEnd('debug'); } else if (result.length !== resultLength) { @@ -209,7 +209,7 @@ Matrix3.clone = function (matrix, result) { matrix[7], matrix[2], matrix[5], - matrix[8] + matrix[8], ); } result[0] = matrix[0]; @@ -286,7 +286,7 @@ Matrix3.fromRowMajorArray = function (values, result) { values[5], values[6], values[7], - values[8] + values[8], ); } result[0] = values[0]; @@ -496,7 +496,7 @@ Matrix3.fromCrossProduct = function (vector, result) { -vector.x, -vector.y, vector.x, - 0.0 + 0.0, ); } @@ -543,7 +543,7 @@ Matrix3.fromRotationX = function (angle, result) { -sinAngle, 0.0, sinAngle, - cosAngle + cosAngle, ); } @@ -591,7 +591,7 @@ Matrix3.fromRotationY = function (angle, result) { 0.0, -sinAngle, 0.0, - cosAngle + cosAngle, ); } @@ -639,7 +639,7 @@ Matrix3.fromRotationZ = function (angle, result) { 0.0, 0.0, 0.0, - 1.0 + 1.0, ); } @@ -942,13 +942,13 @@ Matrix3.getScale = function (matrix, result) { //>>includeEnd('debug'); result.x = Cartesian3.magnitude( - Cartesian3.fromElements(matrix[0], matrix[1], matrix[2], scratchColumn) + Cartesian3.fromElements(matrix[0], matrix[1], matrix[2], scratchColumn), ); result.y = Cartesian3.magnitude( - Cartesian3.fromElements(matrix[3], matrix[4], matrix[5], scratchColumn) + Cartesian3.fromElements(matrix[3], matrix[4], matrix[5], scratchColumn), ); result.z = Cartesian3.magnitude( - Cartesian3.fromElements(matrix[6], matrix[7], matrix[8], scratchColumn) + Cartesian3.fromElements(matrix[6], matrix[7], matrix[8], scratchColumn), ); return result; }; @@ -1371,7 +1371,7 @@ function shurDecomposition(matrix, result) { // find pivot (rotAxis) based on max diagonal of matrix for (let i = 0; i < 3; ++i) { const temp = Math.abs( - matrix[Matrix3.getElementIndex(colVal[i], rowVal[i])] + matrix[Matrix3.getElementIndex(colVal[i], rowVal[i])], ); if (temp > maxDiagonal) { rotAxis = i; @@ -1468,7 +1468,7 @@ Matrix3.computeEigenDecomposition = function (matrix, result) { const unitaryMatrix = (result.unitary = Matrix3.clone( Matrix3.IDENTITY, - result.unitary + result.unitary, )); const diagMatrix = (result.diagonal = Matrix3.clone(matrix, result.diagonal)); @@ -1608,7 +1608,7 @@ Matrix3.inverseTranspose = function (matrix, result) { return Matrix3.inverse( Matrix3.transpose(matrix, scratchTransposeMatrix), - result + result, ); }; @@ -1673,7 +1673,7 @@ Matrix3.equalsEpsilon = function (left, right, epsilon) { * @constant */ Matrix3.IDENTITY = Object.freeze( - new Matrix3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) + new Matrix3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0), ); /** @@ -1683,7 +1683,7 @@ Matrix3.IDENTITY = Object.freeze( * @constant */ Matrix3.ZERO = Object.freeze( - new Matrix3(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) + new Matrix3(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0), ); /** diff --git a/packages/engine/Source/Core/Matrix4.js b/packages/engine/Source/Core/Matrix4.js index ecdaa3c0d001..df4d5dfc76d6 100644 --- a/packages/engine/Source/Core/Matrix4.js +++ b/packages/engine/Source/Core/Matrix4.js @@ -69,7 +69,7 @@ function Matrix4( column0Row3, column1Row3, column2Row3, - column3Row3 + column3Row3, ) { this[0] = defaultValue(column0Row0, 0.0); this[1] = defaultValue(column0Row1, 0.0); @@ -190,7 +190,7 @@ Matrix4.packArray = function (array, result) { } else if (!Array.isArray(result) && result.length !== resultLength) { //>>includeStart('debug', pragmas.debug); throw new DeveloperError( - "If result is a typed array, it must have exactly array.length * 16 elements" + "If result is a typed array, it must have exactly array.length * 16 elements", ); //>>includeEnd('debug'); } else if (result.length !== resultLength) { @@ -261,7 +261,7 @@ Matrix4.clone = function (matrix, result) { matrix[3], matrix[7], matrix[11], - matrix[15] + matrix[15], ); } result[0] = matrix[0]; @@ -353,7 +353,7 @@ Matrix4.fromRowMajorArray = function (values, result) { values[12], values[13], values[14], - values[15] + values[15], ); } result[0] = values[0]; @@ -408,7 +408,7 @@ Matrix4.fromRotationTranslation = function (rotation, translation, result) { 0.0, 0.0, 0.0, - 1.0 + 1.0, ); } @@ -452,7 +452,7 @@ Matrix4.fromTranslationQuaternionRotationScale = function ( translation, rotation, scale, - result + result, ) { //>>includeStart('debug', pragmas.debug); Check.typeOf.object("translation", translation); @@ -520,7 +520,7 @@ Matrix4.fromTranslationQuaternionRotationScale = function ( */ Matrix4.fromTranslationRotationScale = function ( translationRotationScale, - result + result, ) { //>>includeStart('debug', pragmas.debug); Check.typeOf.object("translationRotationScale", translationRotationScale); @@ -530,7 +530,7 @@ Matrix4.fromTranslationRotationScale = function ( translationRotationScale.translation, translationRotationScale.rotation, translationRotationScale.scale, - result + result, ); }; @@ -588,7 +588,7 @@ Matrix4.fromScale = function (scale, result) { 0.0, 0.0, 0.0, - 1.0 + 1.0, ); } @@ -648,7 +648,7 @@ Matrix4.fromUniformScale = function (scale, result) { 0.0, 0.0, 0.0, - 1.0 + 1.0, ); } @@ -738,11 +738,11 @@ Matrix4.fromCamera = function (camera, result) { Cartesian3.normalize(direction, fromCameraF); Cartesian3.normalize( Cartesian3.cross(fromCameraF, up, fromCameraR), - fromCameraR + fromCameraR, ); Cartesian3.normalize( Cartesian3.cross(fromCameraR, fromCameraF, fromCameraU), - fromCameraU + fromCameraU, ); const sX = fromCameraR.x; @@ -793,7 +793,7 @@ Matrix4.fromCamera = function (camera, result) { 0.0, 0.0, 0.0, - 1.0 + 1.0, ); } result[0] = sX; @@ -835,7 +835,7 @@ Matrix4.computePerspectiveFieldOfView = function ( aspectRatio, near, far, - result + result, ) { //>>includeStart('debug', pragmas.debug); Check.typeOf.number.greaterThan("fovY", fovY, 0.0); @@ -890,7 +890,7 @@ Matrix4.computeOrthographicOffCenter = function ( top, near, far, - result + result, ) { //>>includeStart('debug', pragmas.debug); Check.typeOf.number("left", left); @@ -951,7 +951,7 @@ Matrix4.computePerspectiveOffCenter = function ( top, near, far, - result + result, ) { //>>includeStart('debug', pragmas.debug); Check.typeOf.number("left", left); @@ -1007,7 +1007,7 @@ Matrix4.computeInfinitePerspectiveOffCenter = function ( bottom, top, near, - result + result, ) { //>>includeStart('debug', pragmas.debug); Check.typeOf.number("left", left); @@ -1067,7 +1067,7 @@ Matrix4.computeViewportTransformation = function ( viewport, nearDepthRange, farDepthRange, - result + result, ) { if (!defined(result)) { result = new Matrix4(); @@ -1600,13 +1600,13 @@ Matrix4.getScale = function (matrix, result) { //>>includeEnd('debug'); result.x = Cartesian3.magnitude( - Cartesian3.fromElements(matrix[0], matrix[1], matrix[2], scratchColumn) + Cartesian3.fromElements(matrix[0], matrix[1], matrix[2], scratchColumn), ); result.y = Cartesian3.magnitude( - Cartesian3.fromElements(matrix[4], matrix[5], matrix[6], scratchColumn) + Cartesian3.fromElements(matrix[4], matrix[5], matrix[6], scratchColumn), ); result.z = Cartesian3.magnitude( - Cartesian3.fromElements(matrix[8], matrix[9], matrix[10], scratchColumn) + Cartesian3.fromElements(matrix[8], matrix[9], matrix[10], scratchColumn), ); return result; }; @@ -2826,11 +2826,11 @@ Matrix4.inverse = function (matrix, result) { Matrix3.equalsEpsilon( Matrix4.getMatrix3(matrix, scratchInverseRotation), scratchMatrix3Zero, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ) && Cartesian4.equals( Matrix4.getRow(matrix, 3, scratchBottomRow), - scratchExpectedBottomRow + scratchExpectedBottomRow, ) ) { result[0] = 0.0; @@ -2853,7 +2853,7 @@ Matrix4.inverse = function (matrix, result) { } throw new RuntimeError( - "matrix is not invertible because its determinate is zero." + "matrix is not invertible because its determinate is zero.", ); } @@ -2958,7 +2958,7 @@ Matrix4.inverseTranspose = function (matrix, result) { return Matrix4.inverse( Matrix4.transpose(matrix, scratchTransposeMatrix), - result + result, ); }; @@ -2985,8 +2985,8 @@ Matrix4.IDENTITY = Object.freeze( 0.0, 0.0, 0.0, - 1.0 - ) + 1.0, + ), ); /** @@ -3012,8 +3012,8 @@ Matrix4.ZERO = Object.freeze( 0.0, 0.0, 0.0, - 0.0 - ) + 0.0, + ), ); /** diff --git a/packages/engine/Source/Core/MorphWeightSpline.js b/packages/engine/Source/Core/MorphWeightSpline.js index d566c1e604f7..a3ff99b7555b 100644 --- a/packages/engine/Source/Core/MorphWeightSpline.js +++ b/packages/engine/Source/Core/MorphWeightSpline.js @@ -51,7 +51,7 @@ function MorphWeightSpline(options) { Check.typeOf.number.greaterThanOrEquals("weights.length", weights.length, 3); if (weights.length % times.length !== 0) { throw new DeveloperError( - "times.length must be a factor of weights.length." + "times.length must be a factor of weights.length.", ); } //>>includeEnd('debug'); @@ -143,7 +143,7 @@ MorphWeightSpline.prototype.evaluate = function (time, result) { const i = (this._lastTimeIndex = this.findTimeInterval( time, - this._lastTimeIndex + this._lastTimeIndex, )); const u = (time - times[i]) / (times[i + 1] - times[i]); diff --git a/packages/engine/Source/Core/NearFarScalar.js b/packages/engine/Source/Core/NearFarScalar.js index 9b693fcc6387..bddaf7912839 100644 --- a/packages/engine/Source/Core/NearFarScalar.js +++ b/packages/engine/Source/Core/NearFarScalar.js @@ -58,7 +58,7 @@ NearFarScalar.clone = function (nearFarScalar, result) { nearFarScalar.near, nearFarScalar.nearValue, nearFarScalar.far, - nearFarScalar.farValue + nearFarScalar.farValue, ); } diff --git a/packages/engine/Source/Core/Occluder.js b/packages/engine/Source/Core/Occluder.js index 991502086533..da62d2d44f59 100644 --- a/packages/engine/Source/Core/Occluder.js +++ b/packages/engine/Source/Core/Occluder.js @@ -91,11 +91,10 @@ Object.defineProperties(Occluder.prototype, { const cameraToOccluderVec = Cartesian3.subtract( this._occluderPosition, cameraPosition, - scratchCartesian3 - ); - let invCameraToOccluderDistance = Cartesian3.magnitudeSquared( - cameraToOccluderVec + scratchCartesian3, ); + let invCameraToOccluderDistance = + Cartesian3.magnitudeSquared(cameraToOccluderVec); const occluderRadiusSqrd = this._occluderRadius * this._occluderRadius; let horizonDistance; @@ -103,14 +102,14 @@ Object.defineProperties(Occluder.prototype, { let horizonPlanePosition; if (invCameraToOccluderDistance > occluderRadiusSqrd) { horizonDistance = Math.sqrt( - invCameraToOccluderDistance - occluderRadiusSqrd + invCameraToOccluderDistance - occluderRadiusSqrd, ); invCameraToOccluderDistance = 1.0 / Math.sqrt(invCameraToOccluderDistance); horizonPlaneNormal = Cartesian3.multiplyByScalar( cameraToOccluderVec, invCameraToOccluderDistance, - scratchCartesian3 + scratchCartesian3, ); const nearPlaneDistance = horizonDistance * horizonDistance * invCameraToOccluderDistance; @@ -119,9 +118,9 @@ Object.defineProperties(Occluder.prototype, { Cartesian3.multiplyByScalar( horizonPlaneNormal, nearPlaneDistance, - scratchCartesian3 + scratchCartesian3, ), - scratchCartesian3 + scratchCartesian3, ); } else { horizonDistance = Number.MAX_VALUE; @@ -146,7 +145,7 @@ Object.defineProperties(Occluder.prototype, { Occluder.fromBoundingSphere = function ( occluderBoundingSphere, cameraPosition, - result + result, ) { //>>includeStart('debug', pragmas.debug); if (!defined(occluderBoundingSphere)) { @@ -192,7 +191,7 @@ Occluder.prototype.isPointVisible = function (occludee) { let tempVec = Cartesian3.subtract( occludee, this._occluderPosition, - tempVecScratch + tempVecScratch, ); let temp = this._occluderRadius; temp = Cartesian3.magnitudeSquared(tempVec) - temp * temp; @@ -226,7 +225,7 @@ const occludeePositionScratch = new Cartesian3(); Occluder.prototype.isBoundingSphereVisible = function (occludee) { const occludeePosition = Cartesian3.clone( occludee.center, - occludeePositionScratch + occludeePositionScratch, ); const occludeeRadius = occludee.radius; @@ -234,7 +233,7 @@ Occluder.prototype.isBoundingSphereVisible = function (occludee) { let tempVec = Cartesian3.subtract( occludeePosition, this._occluderPosition, - tempVecScratch + tempVecScratch, ); let temp = this._occluderRadius - occludeeRadius; temp = Cartesian3.magnitudeSquared(tempVec) - temp * temp; @@ -244,7 +243,7 @@ Occluder.prototype.isBoundingSphereVisible = function (occludee) { tempVec = Cartesian3.subtract( occludeePosition, this._cameraPosition, - tempVec + tempVec, ); return ( temp * temp + occludeeRadius * occludeeRadius > @@ -260,7 +259,7 @@ Occluder.prototype.isBoundingSphereVisible = function (occludee) { tempVec = Cartesian3.subtract( occludeePosition, this._cameraPosition, - tempVec + tempVec, ); const tempVecMagnitudeSquared = Cartesian3.magnitudeSquared(tempVec); const occluderRadiusSquared = this._occluderRadius * this._occluderRadius; @@ -326,7 +325,7 @@ Occluder.prototype.computeVisibility = function (occludeeBS) { let tempVec = Cartesian3.subtract( occludeePosition, this._occluderPosition, - tempScratch + tempScratch, ); let temp = this._occluderRadius - occludeeRadius; const occluderToOccludeeDistSqrd = Cartesian3.magnitudeSquared(tempVec); @@ -338,7 +337,7 @@ Occluder.prototype.computeVisibility = function (occludeeBS) { tempVec = Cartesian3.subtract( occludeePosition, this._cameraPosition, - tempVec + tempVec, ); const cameraToOccludeeDistSqrd = Cartesian3.magnitudeSquared(tempVec); if ( @@ -366,7 +365,7 @@ Occluder.prototype.computeVisibility = function (occludeeBS) { tempVec = Cartesian3.subtract( occludeePosition, this._horizonPlanePosition, - tempVec + tempVec, ); return Cartesian3.dot(tempVec, this._horizonPlaneNormal) > -occludeeRadius ? Visibility.PARTIAL @@ -407,7 +406,7 @@ const occludeePointScratch = new Cartesian3(); Occluder.computeOccludeePoint = function ( occluderBoundingSphere, occludeePosition, - positions + positions, ) { //>>includeStart('debug', pragmas.debug); if (!defined(occluderBoundingSphere)) { @@ -429,7 +428,7 @@ Occluder.computeOccludeePoint = function ( //>>includeStart('debug', pragmas.debug); if (Cartesian3.equals(occluderPosition, occludeePosition)) { throw new DeveloperError( - "occludeePosition must be different than occluderBoundingSphere.center" + "occludeePosition must be different than occluderBoundingSphere.center", ); } //>>includeEnd('debug'); @@ -437,7 +436,7 @@ Occluder.computeOccludeePoint = function ( // Compute a plane with a normal from the occluder to the occludee position. const occluderPlaneNormal = Cartesian3.normalize( Cartesian3.subtract(occludeePos, occluderPosition, occludeePointScratch), - occludeePointScratch + occludeePointScratch, ); const occluderPlaneD = -Cartesian3.dot(occluderPlaneNormal, occluderPosition); @@ -446,14 +445,14 @@ Occluder.computeOccludeePoint = function ( const aRotationVector = Occluder._anyRotationVector( occluderPosition, occluderPlaneNormal, - occluderPlaneD + occluderPlaneD, ); let dot = Occluder._horizonToPlaneNormalDotProduct( occluderBoundingSphere, occluderPlaneNormal, occluderPlaneD, aRotationVector, - positions[0] + positions[0], ); if (!dot) { //The position is inside the mimimum radius, which is invalid @@ -466,7 +465,7 @@ Occluder.computeOccludeePoint = function ( occluderPlaneNormal, occluderPlaneD, aRotationVector, - positions[i] + positions[i], ); if (!tempDot) { //The position is inside the minimum radius, which is invalid @@ -488,9 +487,9 @@ Occluder.computeOccludeePoint = function ( Cartesian3.multiplyByScalar( occluderPlaneNormal, distance, - occludeePointScratch + occludeePointScratch, ), - occludeePointScratch + occludeePointScratch, ); }; @@ -515,7 +514,7 @@ Occluder.computeOccludeePointFromRectangle = function (rectangle, ellipsoid) { rectangle, ellipsoid, 0.0, - computeOccludeePointFromRectangleScratch + computeOccludeePointFromRectangleScratch, ); const bs = BoundingSphere.fromPoints(positions); @@ -525,7 +524,7 @@ Occluder.computeOccludeePointFromRectangle = function (rectangle, ellipsoid) { return Occluder.computeOccludeePoint( new BoundingSphere(ellipsoidCenter, ellipsoid.minimumRadius), bs.center, - positions + positions, ); } @@ -536,7 +535,7 @@ const tempVec0Scratch = new Cartesian3(); Occluder._anyRotationVector = function ( occluderPosition, occluderPlaneNormal, - occluderPlaneD + occluderPlaneD, ) { const tempVec0 = Cartesian3.abs(occluderPlaneNormal, tempVec0Scratch); let majorAxis = tempVec0.x > tempVec0.y ? 0 : 1; @@ -572,12 +571,12 @@ Occluder._anyRotationVector = function ( Cartesian3.add( tempVec0, Cartesian3.multiplyByScalar(tempVec1, u, tempVec), - tempVec0 + tempVec0, ), occluderPosition, - tempVec0 + tempVec0, ), - tempVec0 + tempVec0, ); }; @@ -587,17 +586,17 @@ Occluder._rotationVector = function ( occluderPlaneNormal, occluderPlaneD, position, - anyRotationVector + anyRotationVector, ) { //Determine the angle between the occluder plane normal and the position direction let positionDirection = Cartesian3.subtract( position, occluderPosition, - posDirectionScratch + posDirectionScratch, ); positionDirection = Cartesian3.normalize( positionDirection, - positionDirection + positionDirection, ); if ( Cartesian3.dot(occluderPlaneNormal, positionDirection) < @@ -607,7 +606,7 @@ Occluder._rotationVector = function ( const crossProduct = Cartesian3.cross( occluderPlaneNormal, positionDirection, - positionDirection + positionDirection, ); const length = Cartesian3.magnitude(crossProduct); if (length > CesiumMath.EPSILON13) { @@ -628,12 +627,12 @@ Occluder._horizonToPlaneNormalDotProduct = function ( occluderPlaneNormal, occluderPlaneD, anyRotationVector, - position + position, ) { const pos = Cartesian3.clone(position, posScratch1); const occluderPosition = Cartesian3.clone( occluderBS.center, - occluerPosScratch + occluerPosScratch, ); const occluderRadius = occluderBS.radius; @@ -641,11 +640,10 @@ Occluder._horizonToPlaneNormalDotProduct = function ( let positionToOccluder = Cartesian3.subtract( occluderPosition, pos, - posScratch2 - ); - const occluderToPositionDistanceSquared = Cartesian3.magnitudeSquared( - positionToOccluder + posScratch2, ); + const occluderToPositionDistanceSquared = + Cartesian3.magnitudeSquared(positionToOccluder); const occluderRadiusSquared = occluderRadius * occluderRadius; if (occluderToPositionDistanceSquared < occluderRadiusSquared) { return false; @@ -656,26 +654,26 @@ Occluder._horizonToPlaneNormalDotProduct = function ( occluderToPositionDistanceSquared - occluderRadiusSquared; const horizonDistance = Math.sqrt(horizonDistanceSquared); const occluderToPositionDistance = Math.sqrt( - occluderToPositionDistanceSquared + occluderToPositionDistanceSquared, ); const invOccluderToPositionDistance = 1.0 / occluderToPositionDistance; const cosTheta = horizonDistance * invOccluderToPositionDistance; const horizonPlaneDistance = cosTheta * horizonDistance; positionToOccluder = Cartesian3.normalize( positionToOccluder, - positionToOccluder + positionToOccluder, ); const horizonPlanePosition = Cartesian3.add( pos, Cartesian3.multiplyByScalar( positionToOccluder, horizonPlaneDistance, - horizonPlanePosScratch + horizonPlanePosScratch, ), - horizonPlanePosScratch + horizonPlanePosScratch, ); const horizonCrossDistance = Math.sqrt( - horizonDistanceSquared - horizonPlaneDistance * horizonPlaneDistance + horizonDistanceSquared - horizonPlaneDistance * horizonPlaneDistance, ); //Rotate the position to occluder vector 90 degrees @@ -684,7 +682,7 @@ Occluder._horizonToPlaneNormalDotProduct = function ( occluderPlaneNormal, occluderPlaneD, pos, - anyRotationVector + anyRotationVector, ); let horizonCrossDirection = Cartesian3.fromElements( tempVec.x * tempVec.x * positionToOccluder.x + @@ -696,35 +694,35 @@ Occluder._horizonToPlaneNormalDotProduct = function ( (tempVec.x * tempVec.z - tempVec.y) * positionToOccluder.x + (tempVec.y * tempVec.z + tempVec.x) * positionToOccluder.y + tempVec.z * tempVec.z * positionToOccluder.z, - posScratch1 + posScratch1, ); horizonCrossDirection = Cartesian3.normalize( horizonCrossDirection, - horizonCrossDirection + horizonCrossDirection, ); //Horizon positions const offset = Cartesian3.multiplyByScalar( horizonCrossDirection, horizonCrossDistance, - posScratch1 + posScratch1, ); tempVec = Cartesian3.normalize( Cartesian3.subtract( Cartesian3.add(horizonPlanePosition, offset, posScratch2), occluderPosition, - posScratch2 + posScratch2, ), - posScratch2 + posScratch2, ); const dot0 = Cartesian3.dot(occluderPlaneNormal, tempVec); tempVec = Cartesian3.normalize( Cartesian3.subtract( Cartesian3.subtract(horizonPlanePosition, offset, tempVec), occluderPosition, - tempVec + tempVec, ), - tempVec + tempVec, ); const dot1 = Cartesian3.dot(occluderPlaneNormal, tempVec); return dot0 < dot1 ? dot0 : dot1; diff --git a/packages/engine/Source/Core/OpenCageGeocoderService.js b/packages/engine/Source/Core/OpenCageGeocoderService.js index 139a7f194f2d..0ff5c2e62c76 100644 --- a/packages/engine/Source/Core/OpenCageGeocoderService.js +++ b/packages/engine/Source/Core/OpenCageGeocoderService.js @@ -51,7 +51,7 @@ function OpenCageGeocoderService(url, apiKey, params) { this._params = defaultValue(params, {}); this._credit = new Credit( `Geodata copyright OpenStreetMap contributors`, - false + false, ); } @@ -117,7 +117,7 @@ OpenCageGeocoderService.prototype.geocode = async function (query) { bounds.southwest.lng, bounds.southwest.lat, bounds.northeast.lng, - bounds.northeast.lat + bounds.northeast.lat, ); } else { const lon = resultObject.geometry.lat; diff --git a/packages/engine/Source/Core/OrientedBoundingBox.js b/packages/engine/Source/Core/OrientedBoundingBox.js index c94354adfc3d..cf4a6d392b47 100644 --- a/packages/engine/Source/Core/OrientedBoundingBox.js +++ b/packages/engine/Source/Core/OrientedBoundingBox.js @@ -108,7 +108,7 @@ OrientedBoundingBox.unpack = function (array, startingIndex, result) { Matrix3.unpack( array, startingIndex + Cartesian3.packedLength, - result.halfAxes + result.halfAxes, ); return result; }; @@ -197,7 +197,7 @@ OrientedBoundingBox.fromPoints = function (positions, result) { const eigenDecomposition = Matrix3.computeEigenDecomposition( covarianceMatrix, - scratchEigenResult + scratchEigenResult, ); const rotation = Matrix3.clone(eigenDecomposition.unitary, result.halfAxes); @@ -253,7 +253,7 @@ function fromPlaneExtents( maximumY, minimumZ, maximumZ, - result + result, ) { //>>includeStart('debug', pragmas.debug); if ( @@ -265,7 +265,7 @@ function fromPlaneExtents( !defined(maximumZ) ) { throw new DeveloperError( - "all extents (minimum/maximum X/Y/Z) are required." + "all extents (minimum/maximum X/Y/Z) are required.", ); } //>>includeEnd('debug'); @@ -345,7 +345,7 @@ OrientedBoundingBox.fromRectangle = function ( minimumHeight, maximumHeight, ellipsoid, - result + result, ) { //>>includeStart('debug', pragmas.debug); if (!defined(rectangle)) { @@ -362,11 +362,11 @@ OrientedBoundingBox.fromRectangle = function ( !CesiumMath.equalsEpsilon( ellipsoid.radii.x, ellipsoid.radii.y, - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ) ) { throw new DeveloperError( - "Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y)" + "Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y)", ); } //>>includeEnd('debug'); @@ -381,11 +381,11 @@ OrientedBoundingBox.fromRectangle = function ( // The bounding box will be aligned with the tangent plane at the center of the rectangle. const tangentPointCartographic = Rectangle.center( rectangle, - scratchRectangleCenterCartographic + scratchRectangleCenterCartographic, ); const tangentPoint = ellipsoid.cartographicToCartesian( tangentPointCartographic, - scratchRectangleCenter + scratchRectangleCenter, ); const tangentPlane = new EllipsoidTangentPlane(tangentPoint, ellipsoid); plane = tangentPlane.plane; @@ -402,79 +402,79 @@ OrientedBoundingBox.fromRectangle = function ( lonCenter, rectangle.north, maximumHeight, - scratchPerimeterCartographicNC + scratchPerimeterCartographicNC, ); const perimeterCartographicNW = Cartographic.fromRadians( rectangle.west, rectangle.north, maximumHeight, - scratchPerimeterCartographicNW + scratchPerimeterCartographicNW, ); const perimeterCartographicCW = Cartographic.fromRadians( rectangle.west, latCenter, maximumHeight, - scratchPerimeterCartographicCW + scratchPerimeterCartographicCW, ); const perimeterCartographicSW = Cartographic.fromRadians( rectangle.west, rectangle.south, maximumHeight, - scratchPerimeterCartographicSW + scratchPerimeterCartographicSW, ); const perimeterCartographicSC = Cartographic.fromRadians( lonCenter, rectangle.south, maximumHeight, - scratchPerimeterCartographicSC + scratchPerimeterCartographicSC, ); const perimeterCartesianNC = ellipsoid.cartographicToCartesian( perimeterCartographicNC, - scratchPerimeterCartesianNC + scratchPerimeterCartesianNC, ); let perimeterCartesianNW = ellipsoid.cartographicToCartesian( perimeterCartographicNW, - scratchPerimeterCartesianNW + scratchPerimeterCartesianNW, ); const perimeterCartesianCW = ellipsoid.cartographicToCartesian( perimeterCartographicCW, - scratchPerimeterCartesianCW + scratchPerimeterCartesianCW, ); let perimeterCartesianSW = ellipsoid.cartographicToCartesian( perimeterCartographicSW, - scratchPerimeterCartesianSW + scratchPerimeterCartesianSW, ); const perimeterCartesianSC = ellipsoid.cartographicToCartesian( perimeterCartographicSC, - scratchPerimeterCartesianSC + scratchPerimeterCartesianSC, ); const perimeterProjectedNC = tangentPlane.projectPointToNearestOnPlane( perimeterCartesianNC, - scratchPerimeterProjectedNC + scratchPerimeterProjectedNC, ); const perimeterProjectedNW = tangentPlane.projectPointToNearestOnPlane( perimeterCartesianNW, - scratchPerimeterProjectedNW + scratchPerimeterProjectedNW, ); const perimeterProjectedCW = tangentPlane.projectPointToNearestOnPlane( perimeterCartesianCW, - scratchPerimeterProjectedCW + scratchPerimeterProjectedCW, ); const perimeterProjectedSW = tangentPlane.projectPointToNearestOnPlane( perimeterCartesianSW, - scratchPerimeterProjectedSW + scratchPerimeterProjectedSW, ); const perimeterProjectedSC = tangentPlane.projectPointToNearestOnPlane( perimeterCartesianSC, - scratchPerimeterProjectedSC + scratchPerimeterProjectedSC, ); minX = Math.min( perimeterProjectedNW.x, perimeterProjectedCW.x, - perimeterProjectedSW.x + perimeterProjectedSW.x, ); maxX = -minX; // symmetrical @@ -482,19 +482,20 @@ OrientedBoundingBox.fromRectangle = function ( minY = Math.min(perimeterProjectedSW.y, perimeterProjectedSC.y); // Compute minimum Z using the rectangle at minimum height, since it will be deeper than the maximum height - perimeterCartographicNW.height = perimeterCartographicSW.height = minimumHeight; + perimeterCartographicNW.height = perimeterCartographicSW.height = + minimumHeight; perimeterCartesianNW = ellipsoid.cartographicToCartesian( perimeterCartographicNW, - scratchPerimeterCartesianNW + scratchPerimeterCartesianNW, ); perimeterCartesianSW = ellipsoid.cartographicToCartesian( perimeterCartographicSW, - scratchPerimeterCartesianSW + scratchPerimeterCartesianSW, ); minZ = Math.min( Plane.getPointDistance(plane, perimeterCartesianNW), - Plane.getPointDistance(plane, perimeterCartesianSW) + Plane.getPointDistance(plane, perimeterCartesianSW), ); maxZ = maximumHeight; // Since the tangent plane touches the surface at height = 0, this is okay @@ -509,7 +510,7 @@ OrientedBoundingBox.fromRectangle = function ( maxY, minZ, maxZ, - result + result, ); } @@ -519,11 +520,11 @@ OrientedBoundingBox.fromRectangle = function ( const latitudeNearestToEquator = fullyAboveEquator ? rectangle.south : fullyBelowEquator - ? rectangle.north - : 0.0; + ? rectangle.north + : 0.0; const centerLongitude = Rectangle.center( rectangle, - scratchRectangleCenterCartographic + scratchRectangleCenterCartographic, ).longitude; // Plane is located at the rectangle's center longitude and the rectangle's latitude that is closest to the equator. It rotates around the Z axis. @@ -533,7 +534,7 @@ OrientedBoundingBox.fromRectangle = function ( latitudeNearestToEquator, maximumHeight, ellipsoid, - scratchPlaneOrigin + scratchPlaneOrigin, ); planeOrigin.z = 0.0; // center the plane on the equator to simpify plane normal calculation const isPole = @@ -546,7 +547,7 @@ OrientedBoundingBox.fromRectangle = function ( const planeXAxis = Cartesian3.cross( planeNormal, planeYAxis, - scratchPlaneXAxis + scratchPlaneXAxis, ); plane = Plane.fromPointNormal(planeOrigin, planeNormal, scratchPlane); @@ -556,15 +557,15 @@ OrientedBoundingBox.fromRectangle = function ( latitudeNearestToEquator, maximumHeight, ellipsoid, - scratchHorizonCartesian + scratchHorizonCartesian, ); maxX = Cartesian3.dot( Plane.projectPointOntoPlane( plane, horizonCartesian, - scratchHorizonProjected + scratchHorizonProjected, ), - planeXAxis + planeXAxis, ); minX = -maxX; // symmetrical @@ -574,14 +575,14 @@ OrientedBoundingBox.fromRectangle = function ( rectangle.north, fullyBelowEquator ? minimumHeight : maximumHeight, ellipsoid, - scratchMaxY + scratchMaxY, ).z; minY = Cartesian3.fromRadians( 0.0, rectangle.south, fullyAboveEquator ? minimumHeight : maximumHeight, ellipsoid, - scratchMinY + scratchMinY, ).z; const farZ = Cartesian3.fromRadians( @@ -589,7 +590,7 @@ OrientedBoundingBox.fromRectangle = function ( latitudeNearestToEquator, maximumHeight, ellipsoid, - scratchZ + scratchZ, ); minZ = Plane.getPointDistance(plane, farZ); maxZ = 0.0; // plane origin starts at maxZ already @@ -606,7 +607,7 @@ OrientedBoundingBox.fromRectangle = function ( maxY, minZ, maxZ, - result + result, ); }; @@ -631,7 +632,7 @@ OrientedBoundingBox.fromTransformation = function (transformation, result) { result.halfAxes = Matrix3.multiplyByScalar( result.halfAxes, 0.5, - result.halfAxes + result.halfAxes, ); return result; }; @@ -690,17 +691,17 @@ OrientedBoundingBox.intersectPlane = function (box, plane) { Math.abs( normalX * halfAxes[Matrix3.COLUMN0ROW0] + normalY * halfAxes[Matrix3.COLUMN0ROW1] + - normalZ * halfAxes[Matrix3.COLUMN0ROW2] + normalZ * halfAxes[Matrix3.COLUMN0ROW2], ) + Math.abs( normalX * halfAxes[Matrix3.COLUMN1ROW0] + normalY * halfAxes[Matrix3.COLUMN1ROW1] + - normalZ * halfAxes[Matrix3.COLUMN1ROW2] + normalZ * halfAxes[Matrix3.COLUMN1ROW2], ) + Math.abs( normalX * halfAxes[Matrix3.COLUMN2ROW0] + normalY * halfAxes[Matrix3.COLUMN2ROW1] + - normalZ * halfAxes[Matrix3.COLUMN2ROW2] + normalZ * halfAxes[Matrix3.COLUMN2ROW2], ); const distanceToPlane = Cartesian3.dot(normal, center) + plane.distance; @@ -893,7 +894,7 @@ OrientedBoundingBox.computePlaneDistances = function ( box, position, direction, - result + result, ) { //>>includeStart('debug', pragmas.debug); if (!defined(box)) { @@ -1116,7 +1117,7 @@ OrientedBoundingBox.computeTransformation = function (box, result) { const rotationScale = Matrix3.multiplyByUniformScale( box.halfAxes, 2.0, - scratchRotationScale + scratchRotationScale, ); return Matrix4.fromRotationTranslation(rotationScale, translation, result); }; @@ -1142,7 +1143,7 @@ OrientedBoundingBox.isOccluded = function (box, occluder) { const sphere = BoundingSphere.fromOrientedBoundingBox( box, - scratchBoundingSphere + scratchBoundingSphere, ); return !occluder.isBoundingSphereVisible(sphere); @@ -1191,13 +1192,13 @@ OrientedBoundingBox.prototype.distanceSquaredTo = function (cartesian) { OrientedBoundingBox.prototype.computePlaneDistances = function ( position, direction, - result + result, ) { return OrientedBoundingBox.computePlaneDistances( this, position, direction, - result + result, ); }; diff --git a/packages/engine/Source/Core/OrthographicFrustum.js b/packages/engine/Source/Core/OrthographicFrustum.js index 2153564288b1..5d3d60245128 100644 --- a/packages/engine/Source/Core/OrthographicFrustum.js +++ b/packages/engine/Source/Core/OrthographicFrustum.js @@ -132,7 +132,7 @@ function update(frustum) { !defined(frustum.far) ) { throw new DeveloperError( - "width, aspectRatio, near, or far parameters are not set." + "width, aspectRatio, near, or far parameters are not set.", ); } //>>includeEnd('debug'); @@ -151,7 +151,7 @@ function update(frustum) { } if (frustum.near < 0 || frustum.near > frustum.far) { throw new DeveloperError( - "near must be greater than zero and less than far." + "near must be greater than zero and less than far.", ); } //>>includeEnd('debug'); @@ -215,7 +215,7 @@ Object.defineProperties(OrthographicFrustum.prototype, { OrthographicFrustum.prototype.computeCullingVolume = function ( position, direction, - up + up, ) { update(this); return this._offCenterFrustum.computeCullingVolume(position, direction, up); @@ -245,7 +245,7 @@ OrthographicFrustum.prototype.getPixelDimensions = function ( drawingBufferHeight, distance, pixelRatio, - result + result, ) { update(this); return this._offCenterFrustum.getPixelDimensions( @@ -253,7 +253,7 @@ OrthographicFrustum.prototype.getPixelDimensions = function ( drawingBufferHeight, distance, pixelRatio, - result + result, ); }; @@ -319,7 +319,7 @@ OrthographicFrustum.prototype.equals = function (other) { OrthographicFrustum.prototype.equalsEpsilon = function ( other, relativeEpsilon, - absoluteEpsilon + absoluteEpsilon, ) { if (!defined(other) || !(other instanceof OrthographicFrustum)) { return false; @@ -333,18 +333,18 @@ OrthographicFrustum.prototype.equalsEpsilon = function ( this.width, other.width, relativeEpsilon, - absoluteEpsilon + absoluteEpsilon, ) && CesiumMath.equalsEpsilon( this.aspectRatio, other.aspectRatio, relativeEpsilon, - absoluteEpsilon + absoluteEpsilon, ) && this._offCenterFrustum.equalsEpsilon( other._offCenterFrustum, relativeEpsilon, - absoluteEpsilon + absoluteEpsilon, ) ); }; diff --git a/packages/engine/Source/Core/OrthographicOffCenterFrustum.js b/packages/engine/Source/Core/OrthographicOffCenterFrustum.js index ad203f1570ca..a28790bc965b 100644 --- a/packages/engine/Source/Core/OrthographicOffCenterFrustum.js +++ b/packages/engine/Source/Core/OrthographicOffCenterFrustum.js @@ -101,7 +101,7 @@ function update(frustum) { !defined(frustum.far) ) { throw new DeveloperError( - "right, left, top, bottom, near, or far parameters are not set." + "right, left, top, bottom, near, or far parameters are not set.", ); } //>>includeEnd('debug'); @@ -123,7 +123,7 @@ function update(frustum) { } if (frustum.near <= 0 || frustum.near > frustum.far) { throw new DeveloperError( - "near must be greater than zero and less than far." + "near must be greater than zero and less than far.", ); } //>>includeEnd('debug'); @@ -141,7 +141,7 @@ function update(frustum) { frustum.top, frustum.near, frustum.far, - frustum._orthographicMatrix + frustum._orthographicMatrix, ); } } @@ -182,7 +182,7 @@ const negateScratch = new Cartesian3(); OrthographicOffCenterFrustum.prototype.computeCullingVolume = function ( position, direction, - up + up, ) { //>>includeStart('debug', pragmas.debug); if (!defined(position)) { @@ -314,14 +314,14 @@ OrthographicOffCenterFrustum.prototype.getPixelDimensions = function ( drawingBufferHeight, distance, pixelRatio, - result + result, ) { update(this); //>>includeStart('debug', pragmas.debug); if (!defined(drawingBufferWidth) || !defined(drawingBufferHeight)) { throw new DeveloperError( - "Both drawingBufferWidth and drawingBufferHeight are required." + "Both drawingBufferWidth and drawingBufferHeight are required.", ); } if (drawingBufferWidth <= 0) { @@ -416,7 +416,7 @@ OrthographicOffCenterFrustum.prototype.equals = function (other) { OrthographicOffCenterFrustum.prototype.equalsEpsilon = function ( other, relativeEpsilon, - absoluteEpsilon + absoluteEpsilon, ) { return ( other === this || @@ -426,37 +426,37 @@ OrthographicOffCenterFrustum.prototype.equalsEpsilon = function ( this.right, other.right, relativeEpsilon, - absoluteEpsilon + absoluteEpsilon, ) && CesiumMath.equalsEpsilon( this.left, other.left, relativeEpsilon, - absoluteEpsilon + absoluteEpsilon, ) && CesiumMath.equalsEpsilon( this.top, other.top, relativeEpsilon, - absoluteEpsilon + absoluteEpsilon, ) && CesiumMath.equalsEpsilon( this.bottom, other.bottom, relativeEpsilon, - absoluteEpsilon + absoluteEpsilon, ) && CesiumMath.equalsEpsilon( this.near, other.near, relativeEpsilon, - absoluteEpsilon + absoluteEpsilon, ) && CesiumMath.equalsEpsilon( this.far, other.far, relativeEpsilon, - absoluteEpsilon + absoluteEpsilon, )) ); }; diff --git a/packages/engine/Source/Core/PeliasGeocoderService.js b/packages/engine/Source/Core/PeliasGeocoderService.js index 30da8c2c43c1..2df428627bc0 100644 --- a/packages/engine/Source/Core/PeliasGeocoderService.js +++ b/packages/engine/Source/Core/PeliasGeocoderService.js @@ -87,7 +87,7 @@ PeliasGeocoderService.prototype.geocode = async function (query, type) { bboxDegrees[0], bboxDegrees[1], bboxDegrees[2], - bboxDegrees[3] + bboxDegrees[3], ); } else { const lon = resultObject.geometry.coordinates[0]; diff --git a/packages/engine/Source/Core/PerspectiveFrustum.js b/packages/engine/Source/Core/PerspectiveFrustum.js index 451f4c9f0a49..60b5e93d69d8 100644 --- a/packages/engine/Source/Core/PerspectiveFrustum.js +++ b/packages/engine/Source/Core/PerspectiveFrustum.js @@ -162,7 +162,7 @@ function update(frustum) { !defined(frustum.far) ) { throw new DeveloperError( - "fov, aspectRatio, near, or far parameters are not set." + "fov, aspectRatio, near, or far parameters are not set.", ); } //>>includeEnd('debug'); @@ -188,7 +188,7 @@ function update(frustum) { if (frustum.near < 0 || frustum.near > frustum.far) { throw new DeveloperError( - "near must be greater than zero and less than far." + "near must be greater than zero and less than far.", ); } //>>includeEnd('debug'); @@ -306,7 +306,7 @@ Object.defineProperties(PerspectiveFrustum.prototype, { PerspectiveFrustum.prototype.computeCullingVolume = function ( position, direction, - up + up, ) { update(this); return this._offCenterFrustum.computeCullingVolume(position, direction, up); @@ -347,7 +347,7 @@ PerspectiveFrustum.prototype.getPixelDimensions = function ( drawingBufferHeight, distance, pixelRatio, - result + result, ) { update(this); return this._offCenterFrustum.getPixelDimensions( @@ -355,7 +355,7 @@ PerspectiveFrustum.prototype.getPixelDimensions = function ( drawingBufferHeight, distance, pixelRatio, - result + result, ); }; @@ -421,7 +421,7 @@ PerspectiveFrustum.prototype.equals = function (other) { PerspectiveFrustum.prototype.equalsEpsilon = function ( other, relativeEpsilon, - absoluteEpsilon + absoluteEpsilon, ) { if (!defined(other) || !(other instanceof PerspectiveFrustum)) { return false; @@ -435,18 +435,18 @@ PerspectiveFrustum.prototype.equalsEpsilon = function ( this.fov, other.fov, relativeEpsilon, - absoluteEpsilon + absoluteEpsilon, ) && CesiumMath.equalsEpsilon( this.aspectRatio, other.aspectRatio, relativeEpsilon, - absoluteEpsilon + absoluteEpsilon, ) && this._offCenterFrustum.equalsEpsilon( other._offCenterFrustum, relativeEpsilon, - absoluteEpsilon + absoluteEpsilon, ) ); }; diff --git a/packages/engine/Source/Core/PerspectiveOffCenterFrustum.js b/packages/engine/Source/Core/PerspectiveOffCenterFrustum.js index 9535202049e0..d5b716e191d6 100644 --- a/packages/engine/Source/Core/PerspectiveOffCenterFrustum.js +++ b/packages/engine/Source/Core/PerspectiveOffCenterFrustum.js @@ -103,7 +103,7 @@ function update(frustum) { !defined(frustum.far) ) { throw new DeveloperError( - "right, left, top, bottom, near, or far parameters are not set." + "right, left, top, bottom, near, or far parameters are not set.", ); } //>>includeEnd('debug'); @@ -126,7 +126,7 @@ function update(frustum) { //>>includeStart('debug', pragmas.debug); if (frustum.near <= 0 || frustum.near > frustum.far) { throw new DeveloperError( - "near must be greater than zero and less than far." + "near must be greater than zero and less than far.", ); } //>>includeEnd('debug'); @@ -144,7 +144,7 @@ function update(frustum) { t, n, f, - frustum._perspectiveMatrix + frustum._perspectiveMatrix, ); frustum._infinitePerspective = Matrix4.computeInfinitePerspectiveOffCenter( l, @@ -152,7 +152,7 @@ function update(frustum) { b, t, n, - frustum._infinitePerspective + frustum._infinitePerspective, ); } } @@ -209,7 +209,7 @@ const getPlanesNormal = new Cartesian3(); PerspectiveOffCenterFrustum.prototype.computeCullingVolume = function ( position, direction, - up + up, ) { //>>includeStart('debug', pragmas.debug); if (!defined(position)) { @@ -371,14 +371,14 @@ PerspectiveOffCenterFrustum.prototype.getPixelDimensions = function ( drawingBufferHeight, distance, pixelRatio, - result + result, ) { update(this); //>>includeStart('debug', pragmas.debug); if (!defined(drawingBufferWidth) || !defined(drawingBufferHeight)) { throw new DeveloperError( - "Both drawingBufferWidth and drawingBufferHeight are required." + "Both drawingBufferWidth and drawingBufferHeight are required.", ); } if (drawingBufferWidth <= 0) { @@ -476,7 +476,7 @@ PerspectiveOffCenterFrustum.prototype.equals = function (other) { PerspectiveOffCenterFrustum.prototype.equalsEpsilon = function ( other, relativeEpsilon, - absoluteEpsilon + absoluteEpsilon, ) { return ( other === this || @@ -486,37 +486,37 @@ PerspectiveOffCenterFrustum.prototype.equalsEpsilon = function ( this.right, other.right, relativeEpsilon, - absoluteEpsilon + absoluteEpsilon, ) && CesiumMath.equalsEpsilon( this.left, other.left, relativeEpsilon, - absoluteEpsilon + absoluteEpsilon, ) && CesiumMath.equalsEpsilon( this.top, other.top, relativeEpsilon, - absoluteEpsilon + absoluteEpsilon, ) && CesiumMath.equalsEpsilon( this.bottom, other.bottom, relativeEpsilon, - absoluteEpsilon + absoluteEpsilon, ) && CesiumMath.equalsEpsilon( this.near, other.near, relativeEpsilon, - absoluteEpsilon + absoluteEpsilon, ) && CesiumMath.equalsEpsilon( this.far, other.far, relativeEpsilon, - absoluteEpsilon + absoluteEpsilon, )) ); }; diff --git a/packages/engine/Source/Core/PinBuilder.js b/packages/engine/Source/Core/PinBuilder.js index 143477b41c9d..85671c2771e8 100644 --- a/packages/engine/Source/Core/PinBuilder.js +++ b/packages/engine/Source/Core/PinBuilder.js @@ -89,7 +89,7 @@ PinBuilder.prototype.fromMakiIconId = function (id, color, size) { undefined, color, size, - this._cache + this._cache, ); }; diff --git a/packages/engine/Source/Core/PixelFormat.js b/packages/engine/Source/Core/PixelFormat.js index df70873cc7fe..890e1fe027a7 100644 --- a/packages/engine/Source/Core/PixelFormat.js +++ b/packages/engine/Source/Core/PixelFormat.js @@ -341,7 +341,7 @@ PixelFormat.isBC7Format = function (pixelFormat) { PixelFormat.compressedTextureSizeInBytes = function ( pixelFormat, width, - height + height, ) { switch (pixelFormat) { case PixelFormat.RGB_DXT1: @@ -363,7 +363,7 @@ PixelFormat.compressedTextureSizeInBytes = function ( case PixelFormat.RGB_PVRTC_2BPPV1: case PixelFormat.RGBA_PVRTC_2BPPV1: return Math.floor( - (Math.max(width, 16) * Math.max(height, 8) * 2 + 7) / 8 + (Math.max(width, 16) * Math.max(height, 8) * 2 + 7) / 8, ); case PixelFormat.RGBA_BC7: @@ -381,7 +381,7 @@ PixelFormat.textureSizeInBytes = function ( pixelFormat, pixelDatatype, width, - height + height, ) { let componentsLength = PixelFormat.componentsLength(pixelFormat); if (PixelDatatype.isPacked(pixelDatatype)) { @@ -413,7 +413,7 @@ PixelFormat.createTypedArray = function ( pixelFormat, pixelDatatype, width, - height + height, ) { const constructor = PixelDatatype.getTypedArrayConstructor(pixelDatatype); const size = PixelFormat.componentsLength(pixelFormat) * width * height; @@ -428,7 +428,7 @@ PixelFormat.flipY = function ( pixelFormat, pixelDatatype, width, - height + height, ) { if (height === 1) { return bufferView; @@ -437,7 +437,7 @@ PixelFormat.flipY = function ( pixelFormat, pixelDatatype, width, - height + height, ); const numberOfComponents = PixelFormat.componentsLength(pixelFormat); const textureWidth = width * numberOfComponents; diff --git a/packages/engine/Source/Core/Plane.js b/packages/engine/Source/Core/Plane.js index ab9ee77567c9..9344486e9d2c 100644 --- a/packages/engine/Source/Core/Plane.js +++ b/packages/engine/Source/Core/Plane.js @@ -38,7 +38,7 @@ function Plane(normal, distance) { !CesiumMath.equalsEpsilon( Cartesian3.magnitude(normal), 1.0, - CesiumMath.EPSILON6 + CesiumMath.EPSILON6, ) ) { throw new DeveloperError("normal must be normalized."); @@ -88,7 +88,7 @@ Plane.fromPointNormal = function (point, normal, result) { !CesiumMath.equalsEpsilon( Cartesian3.magnitude(normal), 1.0, - CesiumMath.EPSILON6 + CesiumMath.EPSILON6, ) ) { throw new DeveloperError("normal must be normalized."); @@ -129,7 +129,7 @@ Plane.fromCartesian4 = function (coefficients, result) { !CesiumMath.equalsEpsilon( Cartesian3.magnitude(normal), 1.0, - CesiumMath.EPSILON6 + CesiumMath.EPSILON6, ) ) { throw new DeveloperError("normal must be normalized."); @@ -187,7 +187,7 @@ Plane.projectPointOntoPlane = function (plane, point, result) { const scaledNormal = Cartesian3.multiplyByScalar( plane.normal, pointDistance, - scratchCartesian + scratchCartesian, ); return Cartesian3.subtract(point, scaledNormal, result); @@ -214,31 +214,31 @@ Plane.transform = function (plane, transform, result) { const distance = plane.distance; const inverseTranspose = Matrix4.inverseTranspose( transform, - scratchInverseTranspose + scratchInverseTranspose, ); let planeAsCartesian4 = Cartesian4.fromElements( normal.x, normal.y, normal.z, distance, - scratchPlaneCartesian4 + scratchPlaneCartesian4, ); planeAsCartesian4 = Matrix4.multiplyByVector( inverseTranspose, planeAsCartesian4, - planeAsCartesian4 + planeAsCartesian4, ); // Convert the transformed plane to Hessian Normal Form const transformedNormal = Cartesian3.fromCartesian4( planeAsCartesian4, - scratchTransformNormal + scratchTransformNormal, ); planeAsCartesian4 = Cartesian4.divideByScalar( planeAsCartesian4, Cartesian3.magnitude(transformedNormal), - planeAsCartesian4 + planeAsCartesian4, ); return Plane.fromCartesian4(planeAsCartesian4, result); diff --git a/packages/engine/Source/Core/PlaneGeometry.js b/packages/engine/Source/Core/PlaneGeometry.js index 8bc861fd149f..cfc96a536ae7 100644 --- a/packages/engine/Source/Core/PlaneGeometry.js +++ b/packages/engine/Source/Core/PlaneGeometry.js @@ -84,7 +84,7 @@ PlaneGeometry.unpack = function (array, startingIndex, result) { const vertexFormat = VertexFormat.unpack( array, startingIndex, - scratchVertexFormat + scratchVertexFormat, ); if (!defined(result)) { diff --git a/packages/engine/Source/Core/PolygonGeometry.js b/packages/engine/Source/Core/PolygonGeometry.js index bdc605861b8d..de5ab60ecf30 100644 --- a/packages/engine/Source/Core/PolygonGeometry.js +++ b/packages/engine/Source/Core/PolygonGeometry.js @@ -125,24 +125,24 @@ function computeAttributes(options) { let rotation = Quaternion.fromAxisAngle( rotationAxis, stRotation, - appendTextureCoordinatesQuaternion + appendTextureCoordinatesQuaternion, ); textureMatrix = Matrix3.fromQuaternion(rotation, textureMatrix); rotation = Quaternion.fromAxisAngle( rotationAxis, -stRotation, - appendTextureCoordinatesQuaternion + appendTextureCoordinatesQuaternion, ); tangentRotationMatrix = Matrix3.fromQuaternion( rotation, - tangentRotationMatrix + tangentRotationMatrix, ); } else { textureMatrix = Matrix3.clone(Matrix3.IDENTITY, textureMatrix); tangentRotationMatrix = Matrix3.clone( Matrix3.IDENTITY, - tangentRotationMatrix + tangentRotationMatrix, ); } @@ -160,7 +160,7 @@ function computeAttributes(options) { const position = Cartesian3.fromArray( flatPositions, i, - appendTextureCoordinatesCartesian3 + appendTextureCoordinatesCartesian3, ); if (vertexFormat.st) { @@ -168,7 +168,7 @@ function computeAttributes(options) { let p = Matrix3.multiplyByVector( textureMatrix, position, - scratchPosition + scratchPosition, ); p = ellipsoid.scaleToGeodeticSurface(p, p); const st = projectTo2d([p], appendTextureCoordinatesCartesian2)[0]; @@ -206,7 +206,7 @@ function computeAttributes(options) { const p2 = Cartesian3.fromArray( flatPositions, i + length, - p2Scratch + p2Scratch, ); if (perPositionHeight) { adjustPosHeightsForNormal(position, p1, p2, ellipsoid); @@ -215,7 +215,7 @@ function computeAttributes(options) { Cartesian3.subtract(p2, position, p2); normal = Cartesian3.normalize( Cartesian3.cross(p2, p1, normal), - normal + normal, ); recomputeNormal = false; } @@ -231,7 +231,7 @@ function computeAttributes(options) { if (vertexFormat.tangent) { tangent = Cartesian3.normalize( Cartesian3.cross(bitangent, normal, tangent), - tangent + tangent, ); } } @@ -242,29 +242,29 @@ function computeAttributes(options) { scratchPerPosNormal = Cartesian3.fromArray( normals, attrIndex, - scratchPerPosNormal + scratchPerPosNormal, ); scratchPerPosTangent = Cartesian3.cross( Cartesian3.UNIT_Z, scratchPerPosNormal, - scratchPerPosTangent + scratchPerPosTangent, ); scratchPerPosTangent = Cartesian3.normalize( Matrix3.multiplyByVector( tangentRotationMatrix, scratchPerPosTangent, - scratchPerPosTangent + scratchPerPosTangent, ), - scratchPerPosTangent + scratchPerPosTangent, ); if (vertexFormat.bitangent) { scratchPerPosBitangent = Cartesian3.normalize( Cartesian3.cross( scratchPerPosNormal, scratchPerPosTangent, - scratchPerPosBitangent + scratchPerPosBitangent, ), - scratchPerPosBitangent + scratchPerPosBitangent, ); } } @@ -272,12 +272,12 @@ function computeAttributes(options) { tangent = Cartesian3.cross(Cartesian3.UNIT_Z, normal, tangent); tangent = Cartesian3.normalize( Matrix3.multiplyByVector(tangentRotationMatrix, tangent, tangent), - tangent + tangent, ); if (vertexFormat.bitangent) { bitangent = Cartesian3.normalize( Cartesian3.cross(normal, tangent, bitangent), - bitangent + bitangent, ); } } @@ -435,7 +435,7 @@ function createGeometryFromPositionsExtruded( closeTop, closeBottom, vertexFormat, - arcType + arcType, ) { const geos = { walls: [], @@ -450,7 +450,7 @@ function createGeometryFromPositionsExtruded( granularity, perPositionHeight, vertexFormat, - arcType + arcType, ); const edgePoints = topGeo.attributes.position.values; @@ -465,7 +465,7 @@ function createGeometryFromPositionsExtruded( newIndices = IndexDatatype.createTypedArray( numPositions, - indices.length * 2 + indices.length * 2, ); newIndices.set(indices); const ilength = indices.length; @@ -486,7 +486,7 @@ function createGeometryFromPositionsExtruded( if (perPositionHeight && vertexFormat.normal) { const normals = topGeo.attributes.normal.values; topGeo.attributes.normal.values = new Float32Array( - topBottomPositions.length + topBottomPositions.length, ); topGeo.attributes.normal.values.set(normals); } @@ -520,7 +520,7 @@ function createGeometryFromPositionsExtruded( const tangentPlane = EllipsoidTangentPlane.fromPoints(outerRing, ellipsoid); let positions2D = tangentPlane.projectPointsOntoPlane( outerRing, - createGeometryFromPositionsExtrudedPositions + createGeometryFromPositionsExtrudedPositions, ); let windingOrder = PolygonPipeline.computeWindingOrder2D(positions2D); @@ -534,12 +534,12 @@ function createGeometryFromPositionsExtruded( ellipsoid, granularity, perPositionHeight, - arcType + arcType, ); geos.walls.push( new GeometryInstance({ geometry: wallGeo, - }) + }), ); const holes = hierarchy.holes; @@ -547,7 +547,7 @@ function createGeometryFromPositionsExtruded( let hole = holes[i]; positions2D = tangentPlane.projectPointsOntoPlane( hole, - createGeometryFromPositionsExtrudedPositions + createGeometryFromPositionsExtrudedPositions, ); windingOrder = PolygonPipeline.computeWindingOrder2D(positions2D); @@ -561,12 +561,12 @@ function createGeometryFromPositionsExtruded( ellipsoid, granularity, perPositionHeight, - arcType + arcType, ); geos.walls.push( new GeometryInstance({ geometry: wallGeo, - }) + }), ); } @@ -675,7 +675,7 @@ function PolygonGeometry(options) { defined(options.height) ) { throw new DeveloperError( - "Cannot use both options.perPositionHeight and options.height" + "Cannot use both options.perPositionHeight and options.height", ); } if ( @@ -684,7 +684,7 @@ function PolygonGeometry(options) { options.arcType !== ArcType.RHUMB ) { throw new DeveloperError( - "Invalid arcType. Valid options are ArcType.GEODESIC and ArcType.RHUMB." + "Invalid arcType. Valid options are ArcType.GEODESIC and ArcType.RHUMB.", ); } //>>includeEnd('debug'); @@ -694,7 +694,7 @@ function PolygonGeometry(options) { const ellipsoid = defaultValue(options.ellipsoid, Ellipsoid.default); const granularity = defaultValue( options.granularity, - CesiumMath.RADIANS_PER_DEGREE + CesiumMath.RADIANS_PER_DEGREE, ); const stRotation = defaultValue(options.stRotation, 0.0); const textureCoordinates = options.textureCoordinates; @@ -737,14 +737,14 @@ function PolygonGeometry(options) { this.packedLength = PolygonGeometryLibrary.computeHierarchyPackedLength( polygonHierarchy, - Cartesian3 + Cartesian3, ) + Ellipsoid.packedLength + VertexFormat.packedLength + (textureCoordinates ? PolygonGeometryLibrary.computeHierarchyPackedLength( textureCoordinates, - Cartesian2 + Cartesian2, ) : 1) + 12; @@ -831,7 +831,7 @@ PolygonGeometry.pack = function (value, array, startingIndex) { value._polygonHierarchy, array, startingIndex, - Cartesian3 + Cartesian3, ); Ellipsoid.pack(value._ellipsoid, array, startingIndex); @@ -856,7 +856,7 @@ PolygonGeometry.pack = function (value, array, startingIndex) { value._textureCoordinates, array, startingIndex, - Cartesian2 + Cartesian2, ); } else { array[startingIndex++] = -1.0; @@ -890,7 +890,7 @@ PolygonGeometry.unpack = function (array, startingIndex, result) { const polygonHierarchy = PolygonGeometryLibrary.unpackPolygonHierarchy( array, startingIndex, - Cartesian3 + Cartesian3, ); startingIndex = polygonHierarchy.startingIndex; delete polygonHierarchy.startingIndex; @@ -901,7 +901,7 @@ PolygonGeometry.unpack = function (array, startingIndex, result) { const vertexFormat = VertexFormat.unpack( array, startingIndex, - scratchVertexFormat + scratchVertexFormat, ); startingIndex += VertexFormat.packedLength; @@ -922,7 +922,7 @@ PolygonGeometry.unpack = function (array, startingIndex, result) { : PolygonGeometryLibrary.unpackPolygonHierarchy( array, startingIndex, - Cartesian2 + Cartesian2, ); if (defined(textureCoordinates)) { startingIndex = textureCoordinates.startingIndex; @@ -966,7 +966,7 @@ function expandRectangle( ellipsoid, arcType, polygon, - result + result, ) { const longitude = polar.longitude; const lonAdjusted = @@ -988,7 +988,7 @@ function expandRectangle( const segment = Cartesian2.subtract( lastPolar.position, polar.position, - scratchCartesian0 + scratchCartesian0, ); const t = Cartesian2.dot(lastPolar.position, segment) / @@ -997,7 +997,7 @@ function expandRectangle( const projected = Cartesian2.add( lastPolar.position, Cartesian2.multiplyByScalar(segment, -t, segment), - scratchCartesian1 + scratchCartesian1, ); const closestPolar = Stereographic.clone(lastPolar, scratchPolarClosest); closestPolar.position = projected; @@ -1050,7 +1050,7 @@ PolygonGeometry.computeRectangleFromPositions = function ( positions, ellipsoid, arcType, - result + result, ) { //>>includeStart('debug', pragmas.debug); Check.defined("positions", positions); @@ -1077,12 +1077,12 @@ PolygonGeometry.computeRectangleFromPositions = function ( const positionsLength = positions.length; let lastPolarPosition = Stereographic.fromCartesian( positions[0], - scratchPolarPrevious + scratchPolarPrevious, ); for (let i = 1; i < positionsLength; i++) { const polarPosition = Stereographic.fromCartesian( positions[i], - scratchPolar + scratchPolar, ); expandRectangle( polarPosition, @@ -1090,7 +1090,7 @@ PolygonGeometry.computeRectangleFromPositions = function ( ellipsoid, arcType, polygon, - result + result, ); lastPolarPosition = Stereographic.clone(polarPosition, lastPolarPosition); @@ -1102,7 +1102,7 @@ PolygonGeometry.computeRectangleFromPositions = function ( ellipsoid, arcType, polygon, - result + result, ); if (result.east - result.west > polygon.eastOverIdl - polygon.westOverIdl) { @@ -1122,7 +1122,7 @@ PolygonGeometry.computeRectangleFromPositions = function ( CesiumMath.equalsEpsilon( Math.abs(polygon.northAngle), CesiumMath.TWO_PI, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ) ) { result.north = CesiumMath.PI_OVER_TWO; @@ -1134,7 +1134,7 @@ PolygonGeometry.computeRectangleFromPositions = function ( CesiumMath.equalsEpsilon( Math.abs(polygon.southAngle), CesiumMath.TWO_PI, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ) ) { result.south = -CesiumMath.PI_OVER_TWO; @@ -1150,7 +1150,7 @@ function getTangentPlane(rectangle, positions, ellipsoid) { if (rectangle.height >= CesiumMath.PI || rectangle.width >= CesiumMath.PI) { const polar = Stereographic.fromCartesian( positions[0], - scratchPolarForPlane + scratchPolarForPlane, ); return polar.tangentPlane; } @@ -1173,11 +1173,11 @@ function createProjectTo2d(rectangle, outerPositions, ellipsoid) { for (let i = 0; i < positions.length; ++i) { const cartographic = ellipsoid.cartesianToCartographic( positions[i], - scratchCartographicCyllindrical + scratchCartographicCyllindrical, ); results[i] = new Cartesian2( cartographic.longitude / CesiumMath.PI, - cartographic.latitude / CesiumMath.PI_OVER_TWO + cartographic.latitude / CesiumMath.PI_OVER_TWO, ); } @@ -1191,7 +1191,7 @@ function createProjectTo2d(rectangle, outerPositions, ellipsoid) { // Use a local tangent plane for smaller extents const tangentPlane = EllipsoidTangentPlane.fromPoints( outerPositions, - ellipsoid + ellipsoid, ); return tangentPlane.projectPointsOntoPlane(positions, results); }; @@ -1205,7 +1205,7 @@ function createProjectPositionTo2d(rectangle, outerRing, ellipsoid) { if (rectangle.south < 0 && rectangle.north > 0) { const cartographic = ellipsoid.cartesianToCartographic( position, - scratchCartographicCyllindrical + scratchCartographicCyllindrical, ); if (!defined(result)) { result = new Cartesian2(); @@ -1238,7 +1238,7 @@ function createSplitPolygons(rectangle, ellipsoid, arcType, perPositionHeight) { polygons, ellipsoid, arcType, - results + results, ); } @@ -1251,21 +1251,21 @@ function computeBoundingRectangle(outerRing, rectangle, ellipsoid, stRotation) { return BoundingRectangle.fromRectangle( rectangle, undefined, - scratchBoundingRectangle + scratchBoundingRectangle, ); } const outerPositions = outerRing; const tangentPlane = EllipsoidTangentPlane.fromPoints( outerPositions, - ellipsoid + ellipsoid, ); return PolygonGeometryLibrary.computeBoundingRectangle( tangentPlane.plane.normal, tangentPlane.projectPointOntoPlane.bind(tangentPlane), outerPositions, stRotation, - scratchBoundingRectangle + scratchBoundingRectangle, ); } @@ -1301,7 +1301,7 @@ PolygonGeometry.createGeometry = function (polygonGeometry) { createProjectTo2d(rectangle, outerPositions, ellipsoid), !perPositionHeight, ellipsoid, - createSplitPolygons(rectangle, ellipsoid, arcType, perPositionHeight) + createSplitPolygons(rectangle, ellipsoid, arcType, perPositionHeight), ); const hierarchy = results.hierarchy; @@ -1317,7 +1317,7 @@ PolygonGeometry.createGeometry = function (polygonGeometry) { true, dummyFunction, false, - ellipsoid + ellipsoid, ).polygons : undefined; @@ -1330,7 +1330,7 @@ PolygonGeometry.createGeometry = function (polygonGeometry) { outerRing, rectangle, ellipsoid, - stRotation + stRotation, ); const geometries = []; @@ -1377,7 +1377,7 @@ PolygonGeometry.createGeometry = function (polygonGeometry) { closeTop, closeBottom, vertexFormat, - arcType + arcType, ); let topAndBottom; @@ -1388,25 +1388,27 @@ PolygonGeometry.createGeometry = function (polygonGeometry) { height, extrudedHeight, ellipsoid, - perPositionHeight + perPositionHeight, ); } else if (closeTop) { topAndBottom = splitGeometry.topAndBottom; - topAndBottom.geometry.attributes.position.values = PolygonPipeline.scaleToGeodeticHeight( - topAndBottom.geometry.attributes.position.values, - height, - ellipsoid, - !perPositionHeight - ); + topAndBottom.geometry.attributes.position.values = + PolygonPipeline.scaleToGeodeticHeight( + topAndBottom.geometry.attributes.position.values, + height, + ellipsoid, + !perPositionHeight, + ); options.geometry = topAndBottom.geometry; } else if (closeBottom) { topAndBottom = splitGeometry.topAndBottom; - topAndBottom.geometry.attributes.position.values = PolygonPipeline.scaleToGeodeticHeight( - topAndBottom.geometry.attributes.position.values, - extrudedHeight, - ellipsoid, - true - ); + topAndBottom.geometry.attributes.position.values = + PolygonPipeline.scaleToGeodeticHeight( + topAndBottom.geometry.attributes.position.values, + extrudedHeight, + ellipsoid, + true, + ); options.geometry = topAndBottom.geometry; } if (closeTop || closeBottom) { @@ -1424,7 +1426,7 @@ PolygonGeometry.createGeometry = function (polygonGeometry) { height, extrudedHeight, ellipsoid, - perPositionHeight + perPositionHeight, ); wall.geometry = computeAttributes(options); geometries.push(wall); @@ -1440,15 +1442,16 @@ PolygonGeometry.createGeometry = function (polygonGeometry) { granularity, perPositionHeight, vertexFormat, - arcType + arcType, ), }); - geometryInstance.geometry.attributes.position.values = PolygonPipeline.scaleToGeodeticHeight( - geometryInstance.geometry.attributes.position.values, - height, - ellipsoid, - !perPositionHeight - ); + geometryInstance.geometry.attributes.position.values = + PolygonPipeline.scaleToGeodeticHeight( + geometryInstance.geometry.attributes.position.values, + height, + ellipsoid, + !perPositionHeight, + ); options.geometry = geometryInstance.geometry; geometryInstance.geometry = computeAttributes(options); @@ -1461,13 +1464,12 @@ PolygonGeometry.createGeometry = function (polygonGeometry) { ? 0 : 1; const applyOffset = new Uint8Array(length / 3).fill(offsetValue); - geometryInstance.geometry.attributes.applyOffset = new GeometryAttribute( - { + geometryInstance.geometry.attributes.applyOffset = + new GeometryAttribute({ componentDatatype: ComponentDatatype.UNSIGNED_BYTE, componentsPerAttribute: 1, values: applyOffset, - } - ); + }); } geometries.push(geometryInstance); @@ -1476,16 +1478,16 @@ PolygonGeometry.createGeometry = function (polygonGeometry) { const geometry = GeometryPipeline.combineInstances(geometries)[0]; geometry.attributes.position.values = new Float64Array( - geometry.attributes.position.values + geometry.attributes.position.values, ); geometry.indices = IndexDatatype.createTypedArray( geometry.attributes.position.values.length / 3, - geometry.indices + geometry.indices, ); const attributes = geometry.attributes; const boundingSphere = BoundingSphere.fromVertices( - attributes.position.values + attributes.position.values, ); if (!vertexFormat.position) { @@ -1507,7 +1509,7 @@ PolygonGeometry.createGeometry = function (polygonGeometry) { PolygonGeometry.createShadowVolume = function ( polygonGeometry, minHeightFunc, - maxHeightFunc + maxHeightFunc, ) { const granularity = polygonGeometry._granularity; const ellipsoid = polygonGeometry._ellipsoid; @@ -1541,7 +1543,7 @@ function textureCoordinateRotationPoints(polygonGeometry) { positions, stRotation, ellipsoid, - boundingRectangle + boundingRectangle, ); } @@ -1556,7 +1558,7 @@ Object.defineProperties(PolygonGeometry.prototype, { this._rectangle = PolygonGeometry.computeRectangleFromPositions( positions, this._ellipsoid, - this._arcType + this._arcType, ); } @@ -1570,9 +1572,8 @@ Object.defineProperties(PolygonGeometry.prototype, { textureCoordinateRotationPoints: { get: function () { if (!defined(this._textureCoordinateRotationPoints)) { - this._textureCoordinateRotationPoints = textureCoordinateRotationPoints( - this - ); + this._textureCoordinateRotationPoints = + textureCoordinateRotationPoints(this); } return this._textureCoordinateRotationPoints; }, diff --git a/packages/engine/Source/Core/PolygonGeometryLibrary.js b/packages/engine/Source/Core/PolygonGeometryLibrary.js index 432bb3f3bdc0..ef288ae330df 100644 --- a/packages/engine/Source/Core/PolygonGeometryLibrary.js +++ b/packages/engine/Source/Core/PolygonGeometryLibrary.js @@ -31,7 +31,7 @@ const PolygonGeometryLibrary = {}; PolygonGeometryLibrary.computeHierarchyPackedLength = function ( polygonHierarchy, - CartesianX + CartesianX, ) { let numComponents = 0; const stack = [polygonHierarchy]; @@ -65,7 +65,7 @@ PolygonGeometryLibrary.packPolygonHierarchy = function ( polygonHierarchy, array, startingIndex, - CartesianX + CartesianX, ) { const stack = [polygonHierarchy]; while (stack.length > 0) { @@ -105,7 +105,7 @@ PolygonGeometryLibrary.packPolygonHierarchy = function ( PolygonGeometryLibrary.unpackPolygonHierarchy = function ( array, startingIndex, - CartesianX + CartesianX, ) { const positionsLength = array[startingIndex++]; const holesLength = array[startingIndex++]; @@ -125,7 +125,7 @@ PolygonGeometryLibrary.unpackPolygonHierarchy = function ( holes[j] = PolygonGeometryLibrary.unpackPolygonHierarchy( array, startingIndex, - CartesianX + CartesianX, ); startingIndex = holes[j].startingIndex; delete holes[j].startingIndex; @@ -144,7 +144,7 @@ function getPointAtDistance2D(p0, p1, distance, length) { Cartesian2.multiplyByScalar( distance2DScratch, distance / length, - distance2DScratch + distance2DScratch, ); Cartesian2.add(p0, distance2DScratch, distance2DScratch); return [distance2DScratch.x, distance2DScratch.y]; @@ -156,7 +156,7 @@ function getPointAtDistance(p0, p1, distance, length) { Cartesian3.multiplyByScalar( distanceScratch, distance / length, - distanceScratch + distanceScratch, ); Cartesian3.add(p0, distanceScratch, distanceScratch); return [distanceScratch.x, distanceScratch.y, distanceScratch.z]; @@ -178,7 +178,7 @@ PolygonGeometryLibrary.subdivideRhumbLineCount = function ( ellipsoid, p0, p1, - minDistance + minDistance, ) { const c0 = ellipsoid.cartesianToCartographic(p0, scratchCartographic0); const c1 = ellipsoid.cartesianToCartographic(p1, scratchCartographic1); @@ -206,13 +206,13 @@ PolygonGeometryLibrary.subdivideTexcoordLine = function ( p0, p1, minDistance, - result + result, ) { // Compute the number of subdivisions. const subdivisions = PolygonGeometryLibrary.subdivideLineCount( p0, p1, - minDistance + minDistance, ); // Compute the distance between each subdivided point. @@ -238,7 +238,7 @@ PolygonGeometryLibrary.subdivideLine = function (p0, p1, minDistance, result) { const numVertices = PolygonGeometryLibrary.subdivideLineCount( p0, p1, - minDistance + minDistance, ); const length = Cartesian3.distance(p0, p1); const distanceBetweenVertices = length / numVertices; @@ -281,7 +281,7 @@ PolygonGeometryLibrary.subdivideTexcoordRhumbLine = function ( p0, p1, minDistance, - result + result, ) { // Compute the surface distance. const c0 = ellipsoid.cartesianToCartographic(p0, scratchCartographic0); @@ -317,7 +317,7 @@ PolygonGeometryLibrary.subdivideRhumbLine = function ( p0, p1, minDistance, - result + result, ) { const c0 = ellipsoid.cartesianToCartographic(p0, scratchCartographic0); const c1 = ellipsoid.cartesianToCartographic(p1, scratchCartographic1); @@ -339,7 +339,7 @@ PolygonGeometryLibrary.subdivideRhumbLine = function ( for (let i = 0; i < numVertices; i++) { const c = rhumb.interpolateUsingSurfaceDistance( i * distanceBetweenVertices, - scratchCartographic2 + scratchCartographic2, ); const p = ellipsoid.cartographicToCartesian(c, scratchCartesian0); positions[index++] = p.x; @@ -360,7 +360,7 @@ PolygonGeometryLibrary.scaleToGeodeticHeightExtruded = function ( maxHeight, minHeight, ellipsoid, - perPositionHeight + perPositionHeight, ) { ellipsoid = defaultValue(ellipsoid, Ellipsoid.default); @@ -404,7 +404,7 @@ PolygonGeometryLibrary.scaleToGeodeticHeightExtruded = function ( PolygonGeometryLibrary.polygonOutlinesFromHierarchy = function ( polygonHierarchy, scaleToEllipsoidSurface, - ellipsoid + ellipsoid, ) { // create from a polygon hierarchy // Algorithm adapted from http://www.geometrictools.com/Documentation/TriangulationByEarClipping.pdf @@ -426,7 +426,7 @@ PolygonGeometryLibrary.polygonOutlinesFromHierarchy = function ( outerRing = arrayRemoveDuplicates( outerRing, Cartesian3.equalsEpsilon, - true + true, ); if (outerRing.length < 3) { continue; @@ -446,7 +446,7 @@ PolygonGeometryLibrary.polygonOutlinesFromHierarchy = function ( holePositions = arrayRemoveDuplicates( holePositions, Cartesian3.equalsEpsilon, - true + true, ); if (holePositions.length < 3) { continue; @@ -482,7 +482,7 @@ function computeEquatorIntersectionRhumb(start, end, ellipsoid) { const intersection = scratchRhumbLine.findIntersectionWithLatitude( 0, - scratchRhumbIntersection + scratchRhumbIntersection, ); if (!defined(intersection)) { @@ -517,7 +517,7 @@ function computeEquatorIntersection(start, end, ellipsoid, arcType) { const intersection = IntersectionTests.lineSegmentPlane( start, end, - Plane.ORIGIN_XY_PLANE + Plane.ORIGIN_XY_PLANE, ); if (!defined(intersection)) { @@ -546,7 +546,7 @@ function computeEdgesOnPlane(positions, ellipsoid, arcType) { const getLongitude = (position) => { const cartographic = ellipsoid.cartesianToCartographic( position, - scratchCartographic + scratchCartographic, ); return cartographic.longitude; }; @@ -565,7 +565,7 @@ function computeEdgesOnPlane(positions, ellipsoid, arcType) { startPoint, endPoint, ellipsoid, - arcType + arcType, ); ++i; @@ -598,7 +598,7 @@ function wirePolygon( edgesOnPlane, toDelete, startIndex, - abovePlane + abovePlane, ) { const polygon = []; let i = startIndex; @@ -678,7 +678,7 @@ function wirePolygon( edgesOnPlane, 0, index, - !abovePlane + !abovePlane, ); } @@ -699,7 +699,7 @@ PolygonGeometryLibrary.splitPolygonsOnEquator = function ( outerRings, ellipsoid, arcType, - result + result, ) { if (!defined(result)) { result = []; @@ -743,7 +743,7 @@ PolygonGeometryLibrary.splitPolygonsOnEquator = function ( edgesOnPlane, 1, 0, - north + north, ); } @@ -756,7 +756,7 @@ PolygonGeometryLibrary.polygonsFromHierarchy = function ( projectPointsTo2D, scaleToEllipsoidSurface, ellipsoid, - splitPolygons + splitPolygons, ) { // create from a polygon hierarchy // Algorithm adapted from http://www.geometrictools.com/Documentation/TriangulationByEarClipping.pdf @@ -786,7 +786,7 @@ PolygonGeometryLibrary.polygonsFromHierarchy = function ( outerRing = arrayRemoveDuplicates( outerRing, Cartesian3.equalsEpsilon, - true + true, ); } if (outerRing.length < 3) { @@ -799,9 +799,8 @@ PolygonGeometryLibrary.polygonsFromHierarchy = function ( } const holeIndices = []; - let originalWindingOrder = PolygonPipeline.computeWindingOrder2D( - positions2D - ); + let originalWindingOrder = + PolygonPipeline.computeWindingOrder2D(positions2D); if (originalWindingOrder === WindingOrder.CLOCKWISE) { positions2D.reverse(); outerRing = outerRing.slice().reverse(); @@ -840,7 +839,7 @@ PolygonGeometryLibrary.polygonsFromHierarchy = function ( holePositions = arrayRemoveDuplicates( holePositions, Cartesian3.equalsEpsilon, - true + true, ); } if (holePositions.length < 3) { @@ -852,9 +851,8 @@ PolygonGeometryLibrary.polygonsFromHierarchy = function ( continue; } - originalWindingOrder = PolygonPipeline.computeWindingOrder2D( - holePositions2D - ); + originalWindingOrder = + PolygonPipeline.computeWindingOrder2D(holePositions2D); if (originalWindingOrder === WindingOrder.CLOCKWISE) { holePositions2D.reverse(); holePositions = holePositions.slice().reverse(); @@ -901,16 +899,16 @@ PolygonGeometryLibrary.computeBoundingRectangle = function ( projectPointTo2D, positions, angle, - result + result, ) { const rotation = Quaternion.fromAxisAngle( planeNormal, angle, - computeBoundingRectangleQuaternion + computeBoundingRectangleQuaternion, ); const textureMatrix = Matrix3.fromQuaternion( rotation, - computeBoundingRectangleMatrix3 + computeBoundingRectangleMatrix3, ); let minX = Number.POSITIVE_INFINITY; @@ -922,7 +920,7 @@ PolygonGeometryLibrary.computeBoundingRectangle = function ( for (let i = 0; i < length; ++i) { const p = Cartesian3.clone( positions[i], - computeBoundingRectangleCartesian3 + computeBoundingRectangleCartesian3, ); Matrix3.multiplyByVector(textureMatrix, p, p); const st = projectPointTo2D(p, computeBoundingRectangleCartesian2); @@ -950,7 +948,7 @@ PolygonGeometryLibrary.createGeometryFromPositions = function ( granularity, perPositionHeight, vertexFormat, - arcType + arcType, ) { let indices = PolygonPipeline.triangulate(polygon.positions2D, polygon.holes); @@ -1010,7 +1008,7 @@ PolygonGeometryLibrary.createGeometryFromPositions = function ( positions, indices, texcoords, - granularity + granularity, ); } else if (arcType === ArcType.RHUMB) { return PolygonPipeline.computeRhumbLineSubdivision( @@ -1018,7 +1016,7 @@ PolygonGeometryLibrary.createGeometryFromPositions = function ( positions, indices, texcoords, - granularity + granularity, ); } }; @@ -1034,7 +1032,7 @@ PolygonGeometryLibrary.computeWallGeometry = function ( ellipsoid, granularity, perPositionHeight, - arcType + arcType, ) { let edgePositions; let topEdgeLength; @@ -1056,7 +1054,7 @@ PolygonGeometryLibrary.computeWallGeometry = function ( if (!perPositionHeight) { const minDistance = CesiumMath.chordLength( granularity, - ellipsoid.maximumRadius + ellipsoid.maximumRadius, ); let numVertices = 0; @@ -1065,7 +1063,7 @@ PolygonGeometryLibrary.computeWallGeometry = function ( numVertices += PolygonGeometryLibrary.subdivideLineCount( positions[i], positions[(i + 1) % length], - minDistance + minDistance, ); } } else if (arcType === ArcType.RHUMB) { @@ -1074,7 +1072,7 @@ PolygonGeometryLibrary.computeWallGeometry = function ( ellipsoid, positions[i], positions[(i + 1) % length], - minDistance + minDistance, ); } } @@ -1104,7 +1102,7 @@ PolygonGeometryLibrary.computeWallGeometry = function ( p1, p2, minDistance, - computeWallIndicesSubdivided + computeWallIndicesSubdivided, ); if (hasTexcoords) { tempTexcoords = PolygonGeometryLibrary.subdivideTexcoordLine( @@ -1113,7 +1111,7 @@ PolygonGeometryLibrary.computeWallGeometry = function ( p1, p2, minDistance, - computeWallTexcoordsSubdivided + computeWallTexcoordsSubdivided, ); } } else if (arcType === ArcType.RHUMB) { @@ -1122,7 +1120,7 @@ PolygonGeometryLibrary.computeWallGeometry = function ( p1, p2, minDistance, - computeWallIndicesSubdivided + computeWallIndicesSubdivided, ); if (hasTexcoords) { tempTexcoords = PolygonGeometryLibrary.subdivideTexcoordRhumbLine( @@ -1132,7 +1130,7 @@ PolygonGeometryLibrary.computeWallGeometry = function ( p1, p2, minDistance, - computeWallTexcoordsSubdivided + computeWallTexcoordsSubdivided, ); } } @@ -1222,7 +1220,7 @@ PolygonGeometryLibrary.computeWallGeometry = function ( length = edgePositions.length; const indices = IndexDatatype.createTypedArray( length / 3, - length - positions.length * 6 + length - positions.length * 6, ); let edgeIndex = 0; length /= 6; @@ -1240,7 +1238,7 @@ PolygonGeometryLibrary.computeWallGeometry = function ( p1, p2, CesiumMath.EPSILON10, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ) ) { //skip corner diff --git a/packages/engine/Source/Core/PolygonOutlineGeometry.js b/packages/engine/Source/Core/PolygonOutlineGeometry.js index 638df675e395..f103369d1dce 100644 --- a/packages/engine/Source/Core/PolygonOutlineGeometry.js +++ b/packages/engine/Source/Core/PolygonOutlineGeometry.js @@ -28,17 +28,16 @@ function createGeometryFromPositions( positions, minDistance, perPositionHeight, - arcType + arcType, ) { const tangentPlane = EllipsoidTangentPlane.fromPoints(positions, ellipsoid); const positions2D = tangentPlane.projectPointsOntoPlane( positions, - createGeometryFromPositionsPositions + createGeometryFromPositionsPositions, ); - const originalWindingOrder = PolygonPipeline.computeWindingOrder2D( - positions2D - ); + const originalWindingOrder = + PolygonPipeline.computeWindingOrder2D(positions2D); if (originalWindingOrder === WindingOrder.CLOCKWISE) { positions2D.reverse(); positions = positions.slice().reverse(); @@ -57,7 +56,7 @@ function createGeometryFromPositions( numVertices += PolygonGeometryLibrary.subdivideLineCount( positions[i], positions[(i + 1) % length], - minDistance + minDistance, ); } } else if (arcType === ArcType.RHUMB) { @@ -66,7 +65,7 @@ function createGeometryFromPositions( ellipsoid, positions[i], positions[(i + 1) % length], - minDistance + minDistance, ); } } @@ -78,7 +77,7 @@ function createGeometryFromPositions( positions[i], positions[(i + 1) % length], minDistance, - createGeometryFromPositionsSubdivided + createGeometryFromPositionsSubdivided, ); } else if (arcType === ArcType.RHUMB) { tempPositions = PolygonGeometryLibrary.subdivideRhumbLine( @@ -86,7 +85,7 @@ function createGeometryFromPositions( positions[i], positions[(i + 1) % length], minDistance, - createGeometryFromPositionsSubdivided + createGeometryFromPositionsSubdivided, ); } const tempPositionsLength = tempPositions.length; @@ -139,17 +138,16 @@ function createGeometryFromPositionsExtruded( positions, minDistance, perPositionHeight, - arcType + arcType, ) { const tangentPlane = EllipsoidTangentPlane.fromPoints(positions, ellipsoid); const positions2D = tangentPlane.projectPointsOntoPlane( positions, - createGeometryFromPositionsPositions + createGeometryFromPositionsPositions, ); - const originalWindingOrder = PolygonPipeline.computeWindingOrder2D( - positions2D - ); + const originalWindingOrder = + PolygonPipeline.computeWindingOrder2D(positions2D); if (originalWindingOrder === WindingOrder.CLOCKWISE) { positions2D.reverse(); positions = positions.slice().reverse(); @@ -169,7 +167,7 @@ function createGeometryFromPositionsExtruded( numVertices += PolygonGeometryLibrary.subdivideLineCount( positions[i], positions[(i + 1) % length], - minDistance + minDistance, ); } } else if (arcType === ArcType.RHUMB) { @@ -178,7 +176,7 @@ function createGeometryFromPositionsExtruded( ellipsoid, positions[i], positions[(i + 1) % length], - minDistance + minDistance, ); } } @@ -192,7 +190,7 @@ function createGeometryFromPositionsExtruded( positions[i], positions[(i + 1) % length], minDistance, - createGeometryFromPositionsSubdivided + createGeometryFromPositionsSubdivided, ); } else if (arcType === ArcType.RHUMB) { tempPositions = PolygonGeometryLibrary.subdivideRhumbLine( @@ -200,7 +198,7 @@ function createGeometryFromPositionsExtruded( positions[i], positions[(i + 1) % length], minDistance, - createGeometryFromPositionsSubdivided + createGeometryFromPositionsSubdivided, ); } const tempPositionsLength = tempPositions.length; @@ -230,7 +228,7 @@ function createGeometryFromPositionsExtruded( const indicesSize = (length * 2 + cornersLength) * 2; const indices = IndexDatatype.createTypedArray( length + cornersLength, - indicesSize + indicesSize, ); index = 0; @@ -355,7 +353,7 @@ function PolygonOutlineGeometry(options) { if (options.perPositionHeight && defined(options.height)) { throw new DeveloperError( - "Cannot use both options.perPositionHeight and options.height" + "Cannot use both options.perPositionHeight and options.height", ); } if ( @@ -364,7 +362,7 @@ function PolygonOutlineGeometry(options) { options.arcType !== ArcType.RHUMB ) { throw new DeveloperError( - "Invalid arcType. Valid options are ArcType.GEODESIC and ArcType.RHUMB." + "Invalid arcType. Valid options are ArcType.GEODESIC and ArcType.RHUMB.", ); } //>>includeEnd('debug'); @@ -373,7 +371,7 @@ function PolygonOutlineGeometry(options) { const ellipsoid = defaultValue(options.ellipsoid, Ellipsoid.default); const granularity = defaultValue( options.granularity, - CesiumMath.RADIANS_PER_DEGREE + CesiumMath.RADIANS_PER_DEGREE, ); const perPositionHeight = defaultValue(options.perPositionHeight, false); const perPositionHeightExtrude = @@ -407,7 +405,7 @@ function PolygonOutlineGeometry(options) { this.packedLength = PolygonGeometryLibrary.computeHierarchyPackedLength( polygonHierarchy, - Cartesian3 + Cartesian3, ) + Ellipsoid.packedLength + 8; @@ -434,7 +432,7 @@ PolygonOutlineGeometry.pack = function (value, array, startingIndex) { value._polygonHierarchy, array, startingIndex, - Cartesian3 + Cartesian3, ); Ellipsoid.pack(value._ellipsoid, array, startingIndex); @@ -475,7 +473,7 @@ PolygonOutlineGeometry.unpack = function (array, startingIndex, result) { const polygonHierarchy = PolygonGeometryLibrary.unpackPolygonHierarchy( array, startingIndex, - Cartesian3 + Cartesian3, ); startingIndex = polygonHierarchy.startingIndex; delete polygonHierarchy.startingIndex; @@ -578,7 +576,7 @@ PolygonOutlineGeometry.createGeometry = function (polygonGeometry) { const polygons = PolygonGeometryLibrary.polygonOutlinesFromHierarchy( polygonHierarchy, !perPositionHeight, - ellipsoid + ellipsoid, ); if (polygons.length === 0) { @@ -589,7 +587,7 @@ PolygonOutlineGeometry.createGeometry = function (polygonGeometry) { const geometries = []; const minDistance = CesiumMath.chordLength( granularity, - ellipsoid.maximumRadius + ellipsoid.maximumRadius, ); const height = polygonGeometry._height; @@ -606,15 +604,16 @@ PolygonOutlineGeometry.createGeometry = function (polygonGeometry) { polygons[i], minDistance, perPositionHeight, - arcType - ); - geometryInstance.geometry = PolygonGeometryLibrary.scaleToGeodeticHeightExtruded( - geometryInstance.geometry, - height, - extrudedHeight, - ellipsoid, - perPositionHeight + arcType, ); + geometryInstance.geometry = + PolygonGeometryLibrary.scaleToGeodeticHeightExtruded( + geometryInstance.geometry, + height, + extrudedHeight, + ellipsoid, + perPositionHeight, + ); if (defined(polygonGeometry._offsetAttribute)) { const size = geometryInstance.geometry.attributes.position.values.length / 3; @@ -629,13 +628,12 @@ PolygonOutlineGeometry.createGeometry = function (polygonGeometry) { offsetAttribute = offsetAttribute.fill(offsetValue); } - geometryInstance.geometry.attributes.applyOffset = new GeometryAttribute( - { + geometryInstance.geometry.attributes.applyOffset = + new GeometryAttribute({ componentDatatype: ComponentDatatype.UNSIGNED_BYTE, componentsPerAttribute: 1, values: offsetAttribute, - } - ); + }); } geometries.push(geometryInstance); } @@ -646,14 +644,15 @@ PolygonOutlineGeometry.createGeometry = function (polygonGeometry) { polygons[i], minDistance, perPositionHeight, - arcType - ); - geometryInstance.geometry.attributes.position.values = PolygonPipeline.scaleToGeodeticHeight( - geometryInstance.geometry.attributes.position.values, - height, - ellipsoid, - !perPositionHeight + arcType, ); + geometryInstance.geometry.attributes.position.values = + PolygonPipeline.scaleToGeodeticHeight( + geometryInstance.geometry.attributes.position.values, + height, + ellipsoid, + !perPositionHeight, + ); if (defined(polygonGeometry._offsetAttribute)) { const length = @@ -663,13 +662,12 @@ PolygonOutlineGeometry.createGeometry = function (polygonGeometry) { ? 0 : 1; const applyOffset = new Uint8Array(length / 3).fill(offsetValue); - geometryInstance.geometry.attributes.applyOffset = new GeometryAttribute( - { + geometryInstance.geometry.attributes.applyOffset = + new GeometryAttribute({ componentDatatype: ComponentDatatype.UNSIGNED_BYTE, componentsPerAttribute: 1, values: applyOffset, - } - ); + }); } geometries.push(geometryInstance); @@ -678,7 +676,7 @@ PolygonOutlineGeometry.createGeometry = function (polygonGeometry) { const geometry = GeometryPipeline.combineInstances(geometries)[0]; const boundingSphere = BoundingSphere.fromVertices( - geometry.attributes.position.values + geometry.attributes.position.values, ); return new Geometry({ diff --git a/packages/engine/Source/Core/PolygonPipeline.js b/packages/engine/Source/Core/PolygonPipeline.js index 3e6bc888f2a5..328668edb7ce 100644 --- a/packages/engine/Source/Core/PolygonPipeline.js +++ b/packages/engine/Source/Core/PolygonPipeline.js @@ -31,7 +31,7 @@ PolygonPipeline.computeArea2D = function (positions) { Check.typeOf.number.greaterThanOrEquals( "positions.length", positions.length, - 3 + 3, ); //>>includeEnd('debug'); @@ -104,7 +104,7 @@ PolygonPipeline.computeSubdivision = function ( positions, indices, texcoords, - granularity + granularity, ) { granularity = defaultValue(granularity, CesiumMath.RADIANS_PER_DEGREE); @@ -159,17 +159,17 @@ PolygonPipeline.computeSubdivision = function ( const v0 = Cartesian3.fromArray( subdividedPositions, i0 * 3, - subdivisionV0Scratch + subdivisionV0Scratch, ); const v1 = Cartesian3.fromArray( subdividedPositions, i1 * 3, - subdivisionV1Scratch + subdivisionV1Scratch, ); const v2 = Cartesian3.fromArray( subdividedPositions, i2 * 3, - subdivisionV2Scratch + subdivisionV2Scratch, ); let t0, t1, t2; @@ -177,44 +177,44 @@ PolygonPipeline.computeSubdivision = function ( t0 = Cartesian2.fromArray( subdividedTexcoords, i0 * 2, - subdivisionT0Scratch + subdivisionT0Scratch, ); t1 = Cartesian2.fromArray( subdividedTexcoords, i1 * 2, - subdivisionT1Scratch + subdivisionT1Scratch, ); t2 = Cartesian2.fromArray( subdividedTexcoords, i2 * 2, - subdivisionT2Scratch + subdivisionT2Scratch, ); } const s0 = Cartesian3.multiplyByScalar( Cartesian3.normalize(v0, subdivisionS0Scratch), radius, - subdivisionS0Scratch + subdivisionS0Scratch, ); const s1 = Cartesian3.multiplyByScalar( Cartesian3.normalize(v1, subdivisionS1Scratch), radius, - subdivisionS1Scratch + subdivisionS1Scratch, ); const s2 = Cartesian3.multiplyByScalar( Cartesian3.normalize(v2, subdivisionS2Scratch), radius, - subdivisionS2Scratch + subdivisionS2Scratch, ); const g0 = Cartesian3.magnitudeSquared( - Cartesian3.subtract(s0, s1, subdivisionMidScratch) + Cartesian3.subtract(s0, s1, subdivisionMidScratch), ); const g1 = Cartesian3.magnitudeSquared( - Cartesian3.subtract(s1, s2, subdivisionMidScratch) + Cartesian3.subtract(s1, s2, subdivisionMidScratch), ); const g2 = Cartesian3.magnitudeSquared( - Cartesian3.subtract(s2, s0, subdivisionMidScratch) + Cartesian3.subtract(s2, s0, subdivisionMidScratch), ); const max = Math.max(g0, g1, g2); @@ -339,7 +339,7 @@ PolygonPipeline.computeRhumbLineSubdivision = function ( positions, indices, texcoords, - granularity + granularity, ) { granularity = defaultValue(granularity, CesiumMath.RADIANS_PER_DEGREE); @@ -397,17 +397,17 @@ PolygonPipeline.computeRhumbLineSubdivision = function ( const v0 = Cartesian3.fromArray( subdividedPositions, i0 * 3, - subdivisionV0Scratch + subdivisionV0Scratch, ); const v1 = Cartesian3.fromArray( subdividedPositions, i1 * 3, - subdivisionV1Scratch + subdivisionV1Scratch, ); const v2 = Cartesian3.fromArray( subdividedPositions, i2 * 3, - subdivisionV2Scratch + subdivisionV2Scratch, ); let t0, t1, t2; @@ -415,17 +415,17 @@ PolygonPipeline.computeRhumbLineSubdivision = function ( t0 = Cartesian2.fromArray( subdividedTexcoords, i0 * 2, - subdivisionT0Scratch + subdivisionT0Scratch, ); t1 = Cartesian2.fromArray( subdividedTexcoords, i1 * 2, - subdivisionT1Scratch + subdivisionT1Scratch, ); t2 = Cartesian2.fromArray( subdividedTexcoords, i2 * 2, - subdivisionT2Scratch + subdivisionT2Scratch, ); } @@ -456,7 +456,7 @@ PolygonPipeline.computeRhumbLineSubdivision = function ( if (!defined(i)) { mid = rhumb0.interpolateUsingFraction( 0.5, - subdivisionCartographicScratch + subdivisionCartographicScratch, ); midHeight = (c0.height + c1.height) * 0.5; midCartesian3 = Cartesian3.fromRadians( @@ -464,12 +464,12 @@ PolygonPipeline.computeRhumbLineSubdivision = function ( mid.latitude, midHeight, ellipsoid, - subdivisionMidScratch + subdivisionMidScratch, ); subdividedPositions.push( midCartesian3.x, midCartesian3.y, - midCartesian3.z + midCartesian3.z, ); i = subdividedPositions.length / 3 - 1; edges[edge] = i; @@ -490,7 +490,7 @@ PolygonPipeline.computeRhumbLineSubdivision = function ( if (!defined(i)) { mid = rhumb1.interpolateUsingFraction( 0.5, - subdivisionCartographicScratch + subdivisionCartographicScratch, ); midHeight = (c1.height + c2.height) * 0.5; midCartesian3 = Cartesian3.fromRadians( @@ -498,12 +498,12 @@ PolygonPipeline.computeRhumbLineSubdivision = function ( mid.latitude, midHeight, ellipsoid, - subdivisionMidScratch + subdivisionMidScratch, ); subdividedPositions.push( midCartesian3.x, midCartesian3.y, - midCartesian3.z + midCartesian3.z, ); i = subdividedPositions.length / 3 - 1; edges[edge] = i; @@ -524,7 +524,7 @@ PolygonPipeline.computeRhumbLineSubdivision = function ( if (!defined(i)) { mid = rhumb2.interpolateUsingFraction( 0.5, - subdivisionCartographicScratch + subdivisionCartographicScratch, ); midHeight = (c2.height + c0.height) * 0.5; midCartesian3 = Cartesian3.fromRadians( @@ -532,12 +532,12 @@ PolygonPipeline.computeRhumbLineSubdivision = function ( mid.latitude, midHeight, ellipsoid, - subdivisionMidScratch + subdivisionMidScratch, ); subdividedPositions.push( midCartesian3.x, midCartesian3.y, - midCartesian3.z + midCartesian3.z, ); i = subdividedPositions.length / 3 - 1; edges[edge] = i; @@ -595,7 +595,7 @@ PolygonPipeline.scaleToGeodeticHeight = function ( positions, height, ellipsoid, - scaleToSurface + scaleToSurface, ) { ellipsoid = defaultValue(ellipsoid, Ellipsoid.default); diff --git a/packages/engine/Source/Core/PolylineGeometry.js b/packages/engine/Source/Core/PolylineGeometry.js index 832af1c70fff..d0f9ec3dcf68 100644 --- a/packages/engine/Source/Core/PolylineGeometry.js +++ b/packages/engine/Source/Core/PolylineGeometry.js @@ -52,7 +52,7 @@ function interpolateColors(p0, p1, color0, color1, numPoints) { r0 + i * redPerVertex, g0 + i * greenPerVertex, b0 + i * bluePerVertex, - a0 + i * alphaPerVertex + a0 + i * alphaPerVertex, ); } @@ -125,16 +125,16 @@ function PolylineGeometry(options) { this._width = width; this._colorsPerVertex = colorsPerVertex; this._vertexFormat = VertexFormat.clone( - defaultValue(options.vertexFormat, VertexFormat.DEFAULT) + defaultValue(options.vertexFormat, VertexFormat.DEFAULT), ); this._arcType = defaultValue(options.arcType, ArcType.GEODESIC); this._granularity = defaultValue( options.granularity, - CesiumMath.RADIANS_PER_DEGREE + CesiumMath.RADIANS_PER_DEGREE, ); this._ellipsoid = Ellipsoid.clone( - defaultValue(options.ellipsoid, Ellipsoid.default) + defaultValue(options.ellipsoid, Ellipsoid.default), ); this._workerName = "createPolylineGeometry"; @@ -254,7 +254,7 @@ PolylineGeometry.unpack = function (array, startingIndex, result) { const vertexFormat = VertexFormat.unpack( array, startingIndex, - scratchVertexFormat + scratchVertexFormat, ); startingIndex += VertexFormat.packedLength; @@ -314,7 +314,7 @@ PolylineGeometry.createGeometry = function (polylineGeometry) { polylineGeometry._positions, Cartesian3.equalsEpsilon, false, - removedIndices + removedIndices, ); if (defined(colors) && removedIndices.length > 0) { @@ -352,7 +352,7 @@ PolylineGeometry.createGeometry = function (polylineGeometry) { if (arcType === ArcType.GEODESIC) { subdivisionSize = CesiumMath.chordLength( granularity, - ellipsoid.maximumRadius + ellipsoid.maximumRadius, ); numberOfPointsFunction = PolylinePipeline.numberOfPoints; } else { @@ -368,7 +368,7 @@ PolylineGeometry.createGeometry = function (polylineGeometry) { colorLength += numberOfPointsFunction( positions[i], positions[i + 1], - subdivisionSize + subdivisionSize, ); } @@ -388,7 +388,7 @@ PolylineGeometry.createGeometry = function (polylineGeometry) { p1, c0, c1, - numColors + numColors, ); const interpolatedColorsLength = interpolatedColors.length; for (j = 0; j < interpolatedColorsLength; ++j) { @@ -457,7 +457,7 @@ PolylineGeometry.createGeometry = function (polylineGeometry) { Cartesian3.subtract( positions[positionsLength - 1], positions[positionsLength - 2], - position + position, ); Cartesian3.add(positions[positionsLength - 1], position, position); } else { diff --git a/packages/engine/Source/Core/PolylinePipeline.js b/packages/engine/Source/Core/PolylinePipeline.js index d4f2593a584a..62227355b99c 100644 --- a/packages/engine/Source/Core/PolylinePipeline.js +++ b/packages/engine/Source/Core/PolylinePipeline.js @@ -28,7 +28,7 @@ PolylinePipeline.numberOfPointsRhumbLine = function (p0, p1, granularity) { return Math.max( 1, - Math.ceil(Math.sqrt(radiansDistanceSquared / (granularity * granularity))) + Math.ceil(Math.sqrt(radiansDistanceSquared / (granularity * granularity))), ); }; @@ -96,7 +96,7 @@ function generateCartesianArc( h0, h1, array, - offset + offset, ) { const first = ellipsoid.scaleToGeodeticSurface(p0, scaleFirst); const last = ellipsoid.scaleToGeodeticSurface(p1, scaleLast); @@ -118,7 +118,7 @@ function generateCartesianArc( for (let i = 1; i < numPoints; i++) { const carto = ellipsoidGeodesic.interpolateUsingSurfaceDistance( i * surfaceDistanceBetweenPoints, - carto2 + carto2, ); carto.height = heights[i]; cart = ellipsoid.cartographicToCartesian(carto, cartesian); @@ -140,14 +140,14 @@ function generateCartesianRhumbArc( h0, h1, array, - offset + offset, ) { const start = ellipsoid.cartesianToCartographic(p0, carto1); const end = ellipsoid.cartesianToCartographic(p1, carto2); const numPoints = PolylinePipeline.numberOfPointsRhumbLine( start, end, - granularity + granularity, ); start.height = 0.0; end.height = 0.0; @@ -169,7 +169,7 @@ function generateCartesianRhumbArc( for (let i = 1; i < numPoints; i++) { const carto = ellipsoidRhumb.interpolateUsingSurfaceDistance( i * surfaceDistanceBetweenPoints, - carto2 + carto2, ); carto.height = heights[i]; cart = ellipsoid.cartographicToCartesian(carto, cartesian); @@ -211,39 +211,39 @@ PolylinePipeline.wrapLongitude = function (positions, modelMatrix) { modelMatrix = defaultValue(modelMatrix, Matrix4.IDENTITY); const inverseModelMatrix = Matrix4.inverseTransformation( modelMatrix, - wrapLongitudeInversMatrix + wrapLongitudeInversMatrix, ); const origin = Matrix4.multiplyByPoint( inverseModelMatrix, Cartesian3.ZERO, - wrapLongitudeOrigin + wrapLongitudeOrigin, ); const xzNormal = Cartesian3.normalize( Matrix4.multiplyByPointAsVector( inverseModelMatrix, Cartesian3.UNIT_Y, - wrapLongitudeXZNormal + wrapLongitudeXZNormal, ), - wrapLongitudeXZNormal + wrapLongitudeXZNormal, ); const xzPlane = Plane.fromPointNormal( origin, xzNormal, - wrapLongitudeXZPlane + wrapLongitudeXZPlane, ); const yzNormal = Cartesian3.normalize( Matrix4.multiplyByPointAsVector( inverseModelMatrix, Cartesian3.UNIT_X, - wrapLongitudeYZNormal + wrapLongitudeYZNormal, ), - wrapLongitudeYZNormal + wrapLongitudeYZNormal, ); const yzPlane = Plane.fromPointNormal( origin, yzNormal, - wrapLongitudeYZPlane + wrapLongitudeYZPlane, ); let count = 1; @@ -264,27 +264,27 @@ PolylinePipeline.wrapLongitude = function (positions, modelMatrix) { prev, cur, xzPlane, - wrapLongitudeIntersection + wrapLongitudeIntersection, ); if (defined(intersection)) { // move point on the xz-plane slightly away from the plane const offset = Cartesian3.multiplyByScalar( xzNormal, 5.0e-9, - wrapLongitudeOffset + wrapLongitudeOffset, ); if (Plane.getPointDistance(xzPlane, prev) < 0.0) { Cartesian3.negate(offset, offset); } cartesians.push( - Cartesian3.add(intersection, offset, new Cartesian3()) + Cartesian3.add(intersection, offset, new Cartesian3()), ); segments.push(count + 1); Cartesian3.negate(offset, offset); cartesians.push( - Cartesian3.add(intersection, offset, new Cartesian3()) + Cartesian3.add(intersection, offset, new Cartesian3()), ); count = 1; } @@ -359,7 +359,7 @@ PolylinePipeline.generateArc = function (options) { if (!defined(minDistance)) { const granularity = defaultValue( options.granularity, - CesiumMath.RADIANS_PER_DEGREE + CesiumMath.RADIANS_PER_DEGREE, ); minDistance = CesiumMath.chordLength(granularity, ellipsoid.maximumRadius); } @@ -371,7 +371,7 @@ PolylinePipeline.generateArc = function (options) { numPoints += PolylinePipeline.numberOfPoints( positions[i], positions[i + 1], - minDistance + minDistance, ); } @@ -394,7 +394,7 @@ PolylinePipeline.generateArc = function (options) { h0, h1, newPositions, - offset + offset, ); } @@ -464,7 +464,7 @@ PolylinePipeline.generateRhumbArc = function (options) { const granularity = defaultValue( options.granularity, - CesiumMath.RADIANS_PER_DEGREE + CesiumMath.RADIANS_PER_DEGREE, ); let numPoints = 0; @@ -472,13 +472,13 @@ PolylinePipeline.generateRhumbArc = function (options) { let c0 = ellipsoid.cartesianToCartographic( positions[0], - scratchCartographic0 + scratchCartographic0, ); let c1; for (i = 0; i < length - 1; i++) { c1 = ellipsoid.cartesianToCartographic( positions[i + 1], - scratchCartographic1 + scratchCartographic1, ); numPoints += PolylinePipeline.numberOfPointsRhumbLine(c0, c1, granularity); c0 = Cartographic.clone(c1, scratchCartographic0); @@ -503,7 +503,7 @@ PolylinePipeline.generateRhumbArc = function (options) { h0, h1, newPositions, - offset + offset, ); } diff --git a/packages/engine/Source/Core/PolylineVolumeGeometry.js b/packages/engine/Source/Core/PolylineVolumeGeometry.js index 2281749def56..4567b67069b7 100644 --- a/packages/engine/Source/Core/PolylineVolumeGeometry.js +++ b/packages/engine/Source/Core/PolylineVolumeGeometry.js @@ -26,7 +26,7 @@ function computeAttributes( combinedPositions, shape, boundingRectangle, - vertexFormat + vertexFormat, ) { const attributes = new GeometryAttributes(); if (vertexFormat.position) { @@ -150,7 +150,7 @@ function computeAttributes( } catch (e) { oneTimeWarning( "polyline-volume-tangent-bitangent", - "Unable to compute tangents and bitangents for polyline volume geometry" + "Unable to compute tangents and bitangents for polyline volume geometry", ); //TODO https://github.com/CesiumGS/cesium/issues/3609 } @@ -223,15 +223,15 @@ function PolylineVolumeGeometry(options) { this._positions = positions; this._shape = shape; this._ellipsoid = Ellipsoid.clone( - defaultValue(options.ellipsoid, Ellipsoid.default) + defaultValue(options.ellipsoid, Ellipsoid.default), ); this._cornerType = defaultValue(options.cornerType, CornerType.ROUNDED); this._vertexFormat = VertexFormat.clone( - defaultValue(options.vertexFormat, VertexFormat.DEFAULT) + defaultValue(options.vertexFormat, VertexFormat.DEFAULT), ); this._granularity = defaultValue( options.granularity, - CesiumMath.RADIANS_PER_DEGREE + CesiumMath.RADIANS_PER_DEGREE, ); this._workerName = "createPolylineVolumeGeometry"; @@ -347,7 +347,7 @@ PolylineVolumeGeometry.unpack = function (array, startingIndex, result) { const vertexFormat = VertexFormat.unpack( array, startingIndex, - scratchVertexFormat + scratchVertexFormat, ); startingIndex += VertexFormat.packedLength; @@ -384,7 +384,7 @@ PolylineVolumeGeometry.createGeometry = function (polylineVolumeGeometry) { const positions = polylineVolumeGeometry._positions; const cleanPositions = arrayRemoveDuplicates( positions, - Cartesian3.equalsEpsilon + Cartesian3.equalsEpsilon, ); let shape2D = polylineVolumeGeometry._shape; shape2D = PolylineVolumeGeometryLibrary.removeDuplicatesFromShape(shape2D); @@ -405,13 +405,13 @@ PolylineVolumeGeometry.createGeometry = function (polylineVolumeGeometry) { shape2D, boundingRectangle, polylineVolumeGeometry, - true + true, ); return computeAttributes( computedPositions, shape2D, boundingRectangle, - polylineVolumeGeometry._vertexFormat + polylineVolumeGeometry._vertexFormat, ); }; export default PolylineVolumeGeometry; diff --git a/packages/engine/Source/Core/PolylineVolumeGeometryLibrary.js b/packages/engine/Source/Core/PolylineVolumeGeometryLibrary.js index 11bad45bf527..6937caab062b 100644 --- a/packages/engine/Source/Core/PolylineVolumeGeometryLibrary.js +++ b/packages/engine/Source/Core/PolylineVolumeGeometryLibrary.js @@ -78,11 +78,11 @@ function computeRotationAngle(start, end, position, ellipsoid) { const tangentPlane = new EllipsoidTangentPlane(position, ellipsoid); const next = tangentPlane.projectPointOntoPlane( Cartesian3.add(position, start, nextScratch), - nextScratch + nextScratch, ); const prev = tangentPlane.projectPointOntoPlane( Cartesian3.add(position, end, prevScratch), - prevScratch + prevScratch, ); const angle = Cartesian2.angleBetween(next, prev); @@ -105,7 +105,7 @@ function addPosition( ellipsoid, height, xScalar, - repeat + repeat, ) { let west = westScratch; let finalPosition = finalPosScratch; @@ -120,7 +120,7 @@ function addPosition( transform = Matrix4.multiplyTransformation( transform, Matrix4.fromRotationTranslation(rotationZ, heightCartesian, translation), - transform + transform, ); const scale = scaleMatrix; scale[0] = xScalar; @@ -131,12 +131,12 @@ function addPosition( finalPosition = Matrix3.multiplyByVector( scale, finalPosition, - finalPosition + finalPosition, ); finalPosition = Matrix4.multiplyByPoint( transform, finalPosition, - finalPosition + finalPosition, ); finalPositions.push(finalPosition.x, finalPosition.y, finalPosition.z); } @@ -153,7 +153,7 @@ function addPositions( finalPositions, ellipsoid, heights, - xScalar + xScalar, ) { for (let i = 0; i < centers.length; i += 3) { const center = Cartesian3.fromArray(centers, i, centerScratch); @@ -165,7 +165,7 @@ function addPositions( ellipsoid, heights[i / 3], xScalar, - 1 + 1, ); } return finalPositions; @@ -233,11 +233,11 @@ function computeRoundCorner( finalPositions, shape, height, - duplicatePoints + duplicatePoints, ) { const angle = Cartesian3.angleBetween( Cartesian3.subtract(startPoint, pivot, scratch1), - Cartesian3.subtract(endPoint, pivot, scratch2) + Cartesian3.subtract(endPoint, pivot, scratch2), ); const granularity = cornerType === CornerType.BEVELED @@ -250,14 +250,14 @@ function computeRoundCorner( Quaternion.fromAxisAngle( Cartesian3.negate(pivot, scratch1), angle / (granularity + 1), - quaterion + quaterion, ), - rotMatrix + rotMatrix, ); } else { m = Matrix3.fromQuaternion( Quaternion.fromAxisAngle(pivot, angle / (granularity + 1), quaterion), - rotMatrix + rotMatrix, ); } @@ -282,7 +282,7 @@ function computeRoundCorner( ellipsoid, height, 1, - repeat + repeat, ); } } else { @@ -300,7 +300,7 @@ function computeRoundCorner( ellipsoid, height, 1, - 1 + 1, ); endPoint = Cartesian3.clone(endPoint, startPointScratch); @@ -318,7 +318,7 @@ function computeRoundCorner( ellipsoid, height, 1, - 1 + 1, ); } @@ -326,7 +326,7 @@ function computeRoundCorner( } PolylineVolumeGeometryLibrary.removeDuplicatesFromShape = function ( - shapePositions + shapePositions, ) { const length = shapePositions.length; const cleanedPositions = []; @@ -346,16 +346,16 @@ PolylineVolumeGeometryLibrary.angleIsGreaterThanPi = function ( forward, backward, position, - ellipsoid + ellipsoid, ) { const tangentPlane = new EllipsoidTangentPlane(position, ellipsoid); const next = tangentPlane.projectPointOntoPlane( Cartesian3.add(position, forward, nextScratch), - nextScratch + nextScratch, ); const prev = tangentPlane.projectPointOntoPlane( Cartesian3.add(position, backward, prevScratch), - prevScratch + prevScratch, ); return prev.x * next.y - prev.y * next.x >= 0.0; @@ -369,7 +369,7 @@ PolylineVolumeGeometryLibrary.computePositions = function ( shape2D, boundingRectangle, geometry, - duplicatePoints + duplicatePoints, ) { const ellipsoid = geometry._ellipsoid; const heights = scaleToSurface(positions, ellipsoid); @@ -415,7 +415,7 @@ PolylineVolumeGeometryLibrary.computePositions = function ( ellipsoid, h0 + heightOffset, 1, - 1 + 1, ); } previousPosition = Cartesian3.clone(position, previousPosition); @@ -428,7 +428,7 @@ PolylineVolumeGeometryLibrary.computePositions = function ( nextPosition = positions[i + 1]; if (position.equals(nextPosition)) { oneTimeWarning( - "Positions are too close and are considered equivalent with rounding error." + "Positions are too close and are considered equivalent with rounding error.", ); continue; } @@ -441,7 +441,7 @@ PolylineVolumeGeometryLibrary.computePositions = function ( const forwardProjection = Cartesian3.multiplyByScalar( surfaceNormal, Cartesian3.dot(forward, surfaceNormal), - scratchForwardProjection + scratchForwardProjection, ); Cartesian3.subtract(forward, forwardProjection, forwardProjection); Cartesian3.normalize(forwardProjection, forwardProjection); @@ -449,7 +449,7 @@ PolylineVolumeGeometryLibrary.computePositions = function ( const backwardProjection = Cartesian3.multiplyByScalar( surfaceNormal, Cartesian3.dot(backward, surfaceNormal), - scratchBackwardProjection + scratchBackwardProjection, ); Cartesian3.subtract(backward, backwardProjection, backwardProjection); Cartesian3.normalize(backwardProjection, backwardProjection); @@ -457,19 +457,19 @@ PolylineVolumeGeometryLibrary.computePositions = function ( const doCorner = !CesiumMath.equalsEpsilon( Math.abs(Cartesian3.dot(forwardProjection, backwardProjection)), 1.0, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); if (doCorner) { cornerDirection = Cartesian3.cross( cornerDirection, surfaceNormal, - cornerDirection + cornerDirection, ); cornerDirection = Cartesian3.cross( surfaceNormal, cornerDirection, - cornerDirection + cornerDirection, ); cornerDirection = Cartesian3.normalize(cornerDirection, cornerDirection); const scalar = @@ -477,14 +477,14 @@ PolylineVolumeGeometryLibrary.computePositions = function ( Math.max( 0.25, Cartesian3.magnitude( - Cartesian3.cross(cornerDirection, backward, scratch1) - ) + Cartesian3.cross(cornerDirection, backward, scratch1), + ), ); const leftIsOutside = PolylineVolumeGeometryLibrary.angleIsGreaterThanPi( forward, backward, position, - ellipsoid + ellipsoid, ); if (leftIsOutside) { pivot = Cartesian3.add( @@ -492,14 +492,14 @@ PolylineVolumeGeometryLibrary.computePositions = function ( Cartesian3.multiplyByScalar( cornerDirection, scalar * width, - cornerDirection + cornerDirection, ), - pivot + pivot, ); start = Cartesian3.add( pivot, Cartesian3.multiplyByScalar(left, width, start), - start + start, ); scratch2Array[0] = Cartesian3.clone(previousPosition, scratch2Array[0]); scratch2Array[1] = Cartesian3.clone(start, scratch2Array[1]); @@ -507,7 +507,7 @@ PolylineVolumeGeometryLibrary.computePositions = function ( scratch2Array, h0 + heightOffset, h1 + heightOffset, - granularity + granularity, ); subdividedPositions = PolylinePipeline.generateArc({ positions: scratch2Array, @@ -521,14 +521,14 @@ PolylineVolumeGeometryLibrary.computePositions = function ( finalPositions, ellipsoid, subdividedHeights, - 1 + 1, ); left = Cartesian3.cross(surfaceNormal, forward, left); left = Cartesian3.normalize(left, left); end = Cartesian3.add( pivot, Cartesian3.multiplyByScalar(left, width, end), - end + end, ); if ( cornerType === CornerType.ROUNDED || @@ -544,7 +544,7 @@ PolylineVolumeGeometryLibrary.computePositions = function ( finalPositions, shapeForSides, h1 + heightOffset, - duplicatePoints + duplicatePoints, ); } else { cornerDirection = Cartesian3.negate(cornerDirection, cornerDirection); @@ -556,7 +556,7 @@ PolylineVolumeGeometryLibrary.computePositions = function ( ellipsoid, h1 + heightOffset, scalar, - repeat + repeat, ); } previousPosition = Cartesian3.clone(end, previousPosition); @@ -566,14 +566,14 @@ PolylineVolumeGeometryLibrary.computePositions = function ( Cartesian3.multiplyByScalar( cornerDirection, scalar * width, - cornerDirection + cornerDirection, ), - pivot + pivot, ); start = Cartesian3.add( pivot, Cartesian3.multiplyByScalar(left, -width, start), - start + start, ); scratch2Array[0] = Cartesian3.clone(previousPosition, scratch2Array[0]); scratch2Array[1] = Cartesian3.clone(start, scratch2Array[1]); @@ -581,7 +581,7 @@ PolylineVolumeGeometryLibrary.computePositions = function ( scratch2Array, h0 + heightOffset, h1 + heightOffset, - granularity + granularity, ); subdividedPositions = PolylinePipeline.generateArc({ positions: scratch2Array, @@ -595,14 +595,14 @@ PolylineVolumeGeometryLibrary.computePositions = function ( finalPositions, ellipsoid, subdividedHeights, - 1 + 1, ); left = Cartesian3.cross(surfaceNormal, forward, left); left = Cartesian3.normalize(left, left); end = Cartesian3.add( pivot, Cartesian3.multiplyByScalar(left, -width, end), - end + end, ); if ( cornerType === CornerType.ROUNDED || @@ -618,7 +618,7 @@ PolylineVolumeGeometryLibrary.computePositions = function ( finalPositions, shapeForSides, h1 + heightOffset, - duplicatePoints + duplicatePoints, ); } else { finalPositions = addPosition( @@ -629,7 +629,7 @@ PolylineVolumeGeometryLibrary.computePositions = function ( ellipsoid, h1 + heightOffset, scalar, - repeat + repeat, ); } previousPosition = Cartesian3.clone(end, previousPosition); @@ -644,7 +644,7 @@ PolylineVolumeGeometryLibrary.computePositions = function ( ellipsoid, h0 + heightOffset, 1, - 1 + 1, ); previousPosition = position; } @@ -659,7 +659,7 @@ PolylineVolumeGeometryLibrary.computePositions = function ( scratch2Array, h0 + heightOffset, h1 + heightOffset, - granularity + granularity, ); subdividedPositions = PolylinePipeline.generateArc({ positions: scratch2Array, @@ -673,7 +673,7 @@ PolylineVolumeGeometryLibrary.computePositions = function ( finalPositions, ellipsoid, subdividedHeights, - 1 + 1, ); if (duplicatePoints) { ends = addPosition( @@ -684,7 +684,7 @@ PolylineVolumeGeometryLibrary.computePositions = function ( ellipsoid, h1 + heightOffset, 1, - 1 + 1, ); } diff --git a/packages/engine/Source/Core/PolylineVolumeOutlineGeometry.js b/packages/engine/Source/Core/PolylineVolumeOutlineGeometry.js index 9d2b3ab1878e..6ac4232b505e 100644 --- a/packages/engine/Source/Core/PolylineVolumeOutlineGeometry.js +++ b/packages/engine/Source/Core/PolylineVolumeOutlineGeometry.js @@ -33,7 +33,7 @@ function computeAttributes(positions, shape) { const shapeCount = positionLength / shapeLength; const indices = IndexDatatype.createTypedArray( vertexCount, - 2 * shapeLength * (shapeCount + 1) + 2 * shapeLength * (shapeCount + 1), ); let i, j; let index = 0; @@ -124,12 +124,12 @@ function PolylineVolumeOutlineGeometry(options) { this._positions = positions; this._shape = shape; this._ellipsoid = Ellipsoid.clone( - defaultValue(options.ellipsoid, Ellipsoid.default) + defaultValue(options.ellipsoid, Ellipsoid.default), ); this._cornerType = defaultValue(options.cornerType, CornerType.ROUNDED); this._granularity = defaultValue( options.granularity, - CesiumMath.RADIANS_PER_DEGREE + CesiumMath.RADIANS_PER_DEGREE, ); this._workerName = "createPolylineVolumeOutlineGeometry"; @@ -266,12 +266,12 @@ const brScratch = new BoundingRectangle(); * @returns {Geometry|undefined} The computed vertices and indices. */ PolylineVolumeOutlineGeometry.createGeometry = function ( - polylineVolumeOutlineGeometry + polylineVolumeOutlineGeometry, ) { const positions = polylineVolumeOutlineGeometry._positions; const cleanPositions = arrayRemoveDuplicates( positions, - Cartesian3.equalsEpsilon + Cartesian3.equalsEpsilon, ); let shape2D = polylineVolumeOutlineGeometry._shape; shape2D = PolylineVolumeGeometryLibrary.removeDuplicatesFromShape(shape2D); @@ -292,7 +292,7 @@ PolylineVolumeOutlineGeometry.createGeometry = function ( shape2D, boundingRectangle, polylineVolumeOutlineGeometry, - false + false, ); return computeAttributes(computedPositions, shape2D); }; diff --git a/packages/engine/Source/Core/QuadraticRealPolynomial.js b/packages/engine/Source/Core/QuadraticRealPolynomial.js index 17a0fe1031f8..799ce4637a1d 100644 --- a/packages/engine/Source/Core/QuadraticRealPolynomial.js +++ b/packages/engine/Source/Core/QuadraticRealPolynomial.js @@ -136,7 +136,7 @@ QuadraticRealPolynomial.computeRealRoots = function (a, b, c) { addWithCancellationCheck( b, CesiumMath.sign(b) * Math.sqrt(radicand), - CesiumMath.EPSILON14 + CesiumMath.EPSILON14, ); if (b > 0.0) { return [q / a, c / q]; diff --git a/packages/engine/Source/Core/QuantizedMeshTerrainData.js b/packages/engine/Source/Core/QuantizedMeshTerrainData.js index f3c8d45d7cad..5f2e17d49051 100644 --- a/packages/engine/Source/Core/QuantizedMeshTerrainData.js +++ b/packages/engine/Source/Core/QuantizedMeshTerrainData.js @@ -153,15 +153,15 @@ function QuantizedMeshTerrainData(options) { const vertexCount = this._quantizedVertices.length / 3; const uValues = (this._uValues = this._quantizedVertices.subarray( 0, - vertexCount + vertexCount, )); const vValues = (this._vValues = this._quantizedVertices.subarray( vertexCount, - 2 * vertexCount + 2 * vertexCount, )); this._heightValues = this._quantizedVertices.subarray( 2 * vertexCount, - 3 * vertexCount + 3 * vertexCount, ); // We don't assume that we can count on the edge vertices being sorted by u or v. @@ -176,22 +176,22 @@ function QuantizedMeshTerrainData(options) { this._westIndices = sortIndicesIfNecessary( options.westIndices, sortByV, - vertexCount + vertexCount, ); this._southIndices = sortIndicesIfNecessary( options.southIndices, sortByU, - vertexCount + vertexCount, ); this._eastIndices = sortIndicesIfNecessary( options.eastIndices, sortByV, - vertexCount + vertexCount, ); this._northIndices = sortIndicesIfNecessary( options.northIndices, sortByU, - vertexCount + vertexCount, ); this._westSkirtHeight = options.westSkirtHeight; @@ -267,7 +267,7 @@ const createMeshTaskName = "createVerticesFromQuantizedTerrainMesh"; const createMeshTaskProcessorNoThrottle = new TaskProcessor(createMeshTaskName); const createMeshTaskProcessorThrottle = new TaskProcessor( createMeshTaskName, - TerrainData.maximumAsynchronousTasks + TerrainData.maximumAsynchronousTasks, ); /** @@ -304,7 +304,7 @@ QuantizedMeshTerrainData.prototype.createMesh = function (options) { const exaggeration = defaultValue(options.exaggeration, 1.0); const exaggerationRelativeHeight = defaultValue( options.exaggerationRelativeHeight, - 0.0 + 0.0, ); const throttle = defaultValue(options.throttle, true); @@ -353,7 +353,7 @@ QuantizedMeshTerrainData.prototype.createMesh = function (options) { that._northIndices.length; const indicesTypedArray = IndexDatatype.createTypedArray( vertexCount, - result.indices + result.indices, ); const vertices = new Float32Array(result.vertices); @@ -364,7 +364,7 @@ QuantizedMeshTerrainData.prototype.createMesh = function (options) { const obb = that._orientedBoundingBox; const occludeePointInScaledSpace = defaultValue( Cartesian3.clone(result.occludeePointInScaledSpace), - that._horizonOcclusionPoint + that._horizonOcclusionPoint, ); const stride = result.vertexStride; const terrainEncoding = TerrainEncoding.clone(result.encoding); @@ -387,7 +387,7 @@ QuantizedMeshTerrainData.prototype.createMesh = function (options) { result.westIndicesSouthToNorth, result.southIndicesEastToWest, result.eastIndicesNorthToSouth, - result.northIndicesWestToEast + result.northIndicesWestToEast, ); // Free memory received from server after mesh is created. @@ -410,7 +410,7 @@ QuantizedMeshTerrainData.prototype.createMesh = function (options) { const upsampleTaskProcessor = new TaskProcessor( "upsampleQuantizedTerrainMesh", - TerrainData.maximumAsynchronousTasks + TerrainData.maximumAsynchronousTasks, ); /** @@ -435,7 +435,7 @@ QuantizedMeshTerrainData.prototype.upsample = function ( thisLevel, descendantX, descendantY, - descendantLevel + descendantLevel, ) { //>>includeStart('debug', pragmas.debug); if (!defined(tilingScheme)) { @@ -462,7 +462,7 @@ QuantizedMeshTerrainData.prototype.upsample = function ( const levelDifference = descendantLevel - thisLevel; if (levelDifference > 1) { throw new DeveloperError( - "Upsampling through more than one level at a time is not currently supported." + "Upsampling through more than one level at a time is not currently supported.", ); } //>>includeEnd('debug'); @@ -479,7 +479,7 @@ QuantizedMeshTerrainData.prototype.upsample = function ( const childRectangle = tilingScheme.tileXYToRectangle( descendantX, descendantY, - descendantLevel + descendantLevel, ); const upsamplePromise = upsampleTaskProcessor.scheduleTask({ @@ -523,7 +523,7 @@ QuantizedMeshTerrainData.prototype.upsample = function ( const quantizedVertices = new Uint16Array(result.vertices); const indicesTypedArray = IndexDatatype.createTypedArray( quantizedVertices.length / 3, - result.indices + result.indices, ); let encodedNormals; if (defined(result.encodedNormals)) { @@ -538,7 +538,7 @@ QuantizedMeshTerrainData.prototype.upsample = function ( maximumHeight: result.maximumHeight, boundingSphere: BoundingSphere.clone(result.boundingSphere), orientedBoundingBox: OrientedBoundingBox.clone( - result.orientedBoundingBox + result.orientedBoundingBox, ), horizonOcclusionPoint: Cartesian3.clone(result.horizonOcclusionPoint), westIndices: result.westIndices, @@ -571,18 +571,18 @@ const barycentricCoordinateScratch = new Cartesian3(); QuantizedMeshTerrainData.prototype.interpolateHeight = function ( rectangle, longitude, - latitude + latitude, ) { let u = CesiumMath.clamp( (longitude - rectangle.west) / rectangle.width, 0.0, - 1.0 + 1.0, ); u *= maxShort; let v = CesiumMath.clamp( (latitude - rectangle.south) / rectangle.height, 0.0, - 1.0 + 1.0, ); v *= maxShort; @@ -619,17 +619,17 @@ function interpolateMeshHeight(terrainData, u, v) { const uv0 = encoding.decodeTextureCoordinates( vertices, i0, - texCoordScratch0 + texCoordScratch0, ); const uv1 = encoding.decodeTextureCoordinates( vertices, i1, - texCoordScratch1 + texCoordScratch1, ); const uv2 = encoding.decodeTextureCoordinates( vertices, i2, - texCoordScratch2 + texCoordScratch2, ); if (pointInBoundingBox(u, v, uv0.x, uv0.y, uv1.x, uv1.y, uv2.x, uv2.y)) { @@ -642,7 +642,7 @@ function interpolateMeshHeight(terrainData, u, v) { uv1.y, uv2.x, uv2.y, - barycentricCoordinateScratch + barycentricCoordinateScratch, ); if ( barycentric.x >= -1e-15 && @@ -690,7 +690,7 @@ function interpolateHeight(terrainData, u, v) { v1, u2, v2, - barycentricCoordinateScratch + barycentricCoordinateScratch, ); if ( barycentric.x >= -1e-15 && @@ -704,7 +704,7 @@ function interpolateHeight(terrainData, u, v) { return CesiumMath.lerp( terrainData._minimumHeight, terrainData._maximumHeight, - quantizedHeight / maxShort + quantizedHeight / maxShort, ); } } @@ -730,7 +730,7 @@ QuantizedMeshTerrainData.prototype.isChildAvailable = function ( thisX, thisY, childX, - childY + childY, ) { //>>includeStart('debug', pragmas.debug); if (!defined(thisX)) { diff --git a/packages/engine/Source/Core/QuarticRealPolynomial.js b/packages/engine/Source/Core/QuarticRealPolynomial.js index c71888ad4fae..487caa48e5e8 100644 --- a/packages/engine/Source/Core/QuarticRealPolynomial.js +++ b/packages/engine/Source/Core/QuarticRealPolynomial.js @@ -88,7 +88,7 @@ function original(a3, a2, a1, a0) { 1.0, 2.0 * p, p * p - 4.0 * r, - -q * q + -q * q, ); if (cubicRoots.length > 0) { diff --git a/packages/engine/Source/Core/Quaternion.js b/packages/engine/Source/Core/Quaternion.js index 333e353b7816..b91289d9662d 100644 --- a/packages/engine/Source/Core/Quaternion.js +++ b/packages/engine/Source/Core/Quaternion.js @@ -136,7 +136,7 @@ Quaternion.fromRotationMatrix = function (matrix, result) { matrix[Matrix3.getElementIndex(i, i)] - matrix[Matrix3.getElementIndex(j, j)] - matrix[Matrix3.getElementIndex(k, k)] + - 1.0 + 1.0, ); const quat = fromRotationMatrixQuat; @@ -192,22 +192,22 @@ Quaternion.fromHeadingPitchRoll = function (headingPitchRoll, result) { scratchRollQuaternion = Quaternion.fromAxisAngle( Cartesian3.UNIT_X, headingPitchRoll.roll, - scratchHPRQuaternion + scratchHPRQuaternion, ); scratchPitchQuaternion = Quaternion.fromAxisAngle( Cartesian3.UNIT_Y, -headingPitchRoll.pitch, - result + result, ); result = Quaternion.multiply( scratchPitchQuaternion, scratchRollQuaternion, - scratchPitchQuaternion + scratchPitchQuaternion, ); scratchHeadingQuaternion = Quaternion.fromAxisAngle( Cartesian3.UNIT_Z, -headingPitchRoll.heading, - scratchHPRQuaternion + scratchHPRQuaternion, ); return Quaternion.multiply(scratchHeadingQuaternion, result, result); }; @@ -292,16 +292,16 @@ Quaternion.convertPackedArrayForInterpolation = function ( packedArray, startingIndex, lastIndex, - result + result, ) { Quaternion.unpack( packedArray, lastIndex * 4, - sampledQuaternionQuaternion0Conjugate + sampledQuaternionQuaternion0Conjugate, ); Quaternion.conjugate( sampledQuaternionQuaternion0Conjugate, - sampledQuaternionQuaternion0Conjugate + sampledQuaternionQuaternion0Conjugate, ); for (let i = 0, len = lastIndex - startingIndex + 1; i < len; i++) { @@ -309,25 +309,25 @@ Quaternion.convertPackedArrayForInterpolation = function ( Quaternion.unpack( packedArray, (startingIndex + i) * 4, - sampledQuaternionTempQuaternion + sampledQuaternionTempQuaternion, ); Quaternion.multiply( sampledQuaternionTempQuaternion, sampledQuaternionQuaternion0Conjugate, - sampledQuaternionTempQuaternion + sampledQuaternionTempQuaternion, ); if (sampledQuaternionTempQuaternion.w < 0) { Quaternion.negate( sampledQuaternionTempQuaternion, - sampledQuaternionTempQuaternion + sampledQuaternionTempQuaternion, ); } Quaternion.computeAxis( sampledQuaternionTempQuaternion, - sampledQuaternionAxis + sampledQuaternionAxis, ); const angle = Quaternion.computeAngle(sampledQuaternionTempQuaternion); if (!defined(result)) { @@ -354,7 +354,7 @@ Quaternion.unpackInterpolationResult = function ( sourceArray, firstIndex, lastIndex, - result + result, ) { if (!defined(result)) { result = new Quaternion(); @@ -370,14 +370,14 @@ Quaternion.unpackInterpolationResult = function ( Quaternion.fromAxisAngle( sampledQuaternionRotation, magnitude, - sampledQuaternionTempQuaternion + sampledQuaternionTempQuaternion, ); } return Quaternion.multiply( sampledQuaternionTempQuaternion, sampledQuaternionQuaternion0, - result + result, ); }; @@ -398,7 +398,7 @@ Quaternion.clone = function (quaternion, result) { quaternion.x, quaternion.y, quaternion.z, - quaternion.w + quaternion.w, ); } @@ -776,12 +776,12 @@ Quaternion.slerp = function (start, end, t, result) { slerpScaledP = Quaternion.multiplyByScalar( start, Math.sin((1 - t) * theta), - slerpScaledP + slerpScaledP, ); slerpScaledR = Quaternion.multiplyByScalar( r, Math.sin(t * theta), - slerpScaledR + slerpScaledR, ); result = Quaternion.add(slerpScaledP, slerpScaledR, result); return Quaternion.multiplyByScalar(result, 1.0 / Math.sin(theta), result); @@ -1006,7 +1006,7 @@ Quaternion.fastSlerp = function (start, end, t, result) { const temp = Quaternion.multiplyByScalar( start, cD, - fastSlerpScratchQuaternion + fastSlerpScratchQuaternion, ); Quaternion.multiplyByScalar(end, cT, result); return Quaternion.add(temp, result, result); diff --git a/packages/engine/Source/Core/QuaternionSpline.js b/packages/engine/Source/Core/QuaternionSpline.js index a469c068c92f..bf7bd05e5bd6 100644 --- a/packages/engine/Source/Core/QuaternionSpline.js +++ b/packages/engine/Source/Core/QuaternionSpline.js @@ -15,7 +15,7 @@ function createEvaluateFunction(spline) { } const i = (spline._lastTimeIndex = spline.findTimeInterval( time, - spline._lastTimeIndex + spline._lastTimeIndex, )); const u = (time - times[i]) / (times[i + 1] - times[i]); @@ -61,7 +61,7 @@ function QuaternionSpline(options) { } if (points.length < 2) { throw new DeveloperError( - "points.length must be greater than or equal to 2." + "points.length must be greater than or equal to 2.", ); } if (times.length !== points.length) { diff --git a/packages/engine/Source/Core/Rectangle.js b/packages/engine/Source/Core/Rectangle.js index 42cd7e017eff..463fbec74438 100644 --- a/packages/engine/Source/Core/Rectangle.js +++ b/packages/engine/Source/Core/Rectangle.js @@ -382,18 +382,18 @@ Rectangle.fromBoundingSphere = function (boundingSphere, ellipsoid, result) { const fromENU = Transforms.eastNorthUpToFixedFrame( center, ellipsoid, - fromBoundingSphereMatrixScratch + fromBoundingSphereMatrixScratch, ); const east = Matrix4.multiplyByPointAsVector( fromENU, Cartesian3.UNIT_X, - fromBoundingSphereEastScratch + fromBoundingSphereEastScratch, ); Cartesian3.normalize(east, east); const north = Matrix4.multiplyByPointAsVector( fromENU, Cartesian3.UNIT_Y, - fromBoundingSphereNorthScratch + fromBoundingSphereNorthScratch, ); Cartesian3.normalize(north, north); @@ -443,7 +443,7 @@ Rectangle.clone = function (rectangle, result) { rectangle.west, rectangle.south, rectangle.east, - rectangle.north + rectangle.north, ); } @@ -550,7 +550,7 @@ Rectangle.validate = function (rectangle) { Check.typeOf.number.greaterThanOrEquals( "north", north, - -CesiumMath.PI_OVER_TWO + -CesiumMath.PI_OVER_TWO, ); Check.typeOf.number.lessThanOrEquals("north", north, CesiumMath.PI_OVER_TWO); @@ -558,7 +558,7 @@ Rectangle.validate = function (rectangle) { Check.typeOf.number.greaterThanOrEquals( "south", south, - -CesiumMath.PI_OVER_TWO + -CesiumMath.PI_OVER_TWO, ); Check.typeOf.number.lessThanOrEquals("south", south, CesiumMath.PI_OVER_TWO); @@ -725,10 +725,10 @@ Rectangle.intersection = function (rectangle, otherRectangle, result) { } const west = CesiumMath.negativePiToPi( - Math.max(rectangleWest, otherRectangleWest) + Math.max(rectangleWest, otherRectangleWest), ); const east = CesiumMath.negativePiToPi( - Math.min(rectangleEast, otherRectangleEast) + Math.min(rectangleEast, otherRectangleEast), ); if ( @@ -830,10 +830,10 @@ Rectangle.union = function (rectangle, otherRectangle, result) { } const west = CesiumMath.negativePiToPi( - Math.min(rectangleWest, otherRectangleWest) + Math.min(rectangleWest, otherRectangleWest), ); const east = CesiumMath.negativePiToPi( - Math.max(rectangleEast, otherRectangleEast) + Math.max(rectangleEast, otherRectangleEast), ); result.west = west; @@ -1000,7 +1000,7 @@ Rectangle.subsection = function ( southLerp, eastLerp, northLerp, - result + result, ) { //>>includeStart('debug', pragmas.debug); Check.typeOf.object("rectangle", rectangle); @@ -1065,7 +1065,7 @@ Rectangle.MAX_VALUE = Object.freeze( -Math.PI, -CesiumMath.PI_OVER_TWO, Math.PI, - CesiumMath.PI_OVER_TWO - ) + CesiumMath.PI_OVER_TWO, + ), ); export default Rectangle; diff --git a/packages/engine/Source/Core/RectangleCollisionChecker.js b/packages/engine/Source/Core/RectangleCollisionChecker.js index bb8cdb516840..2c7d5720e7eb 100644 --- a/packages/engine/Source/Core/RectangleCollisionChecker.js +++ b/packages/engine/Source/Core/RectangleCollisionChecker.js @@ -42,7 +42,7 @@ RectangleCollisionChecker.prototype.insert = function (id, rectangle) { const withId = RectangleWithId.fromRectangleAndId( id, rectangle, - new RectangleWithId() + new RectangleWithId(), ); this._tree.insert(withId); }; @@ -68,7 +68,7 @@ RectangleCollisionChecker.prototype.remove = function (id, rectangle) { const withId = RectangleWithId.fromRectangleAndId( id, rectangle, - removalScratch + removalScratch, ); this._tree.remove(withId, idCompare); }; @@ -88,7 +88,7 @@ RectangleCollisionChecker.prototype.collides = function (rectangle) { const withId = RectangleWithId.fromRectangleAndId( "", rectangle, - collisionScratch + collisionScratch, ); return this._tree.collides(withId); }; diff --git a/packages/engine/Source/Core/RectangleGeometry.js b/packages/engine/Source/Core/RectangleGeometry.js index 824a0aed613a..449fd1af8a48 100644 --- a/packages/engine/Source/Core/RectangleGeometry.js +++ b/packages/engine/Source/Core/RectangleGeometry.js @@ -73,7 +73,7 @@ function calculateAttributes( positions, vertexFormat, ellipsoid, - tangentRotationMatrix + tangentRotationMatrix, ) { const length = positions.length; @@ -102,7 +102,7 @@ function calculateAttributes( if (vertexFormat.bitangent) { Cartesian3.normalize( Cartesian3.cross(normal, tangent, bitangent), - bitangent + bitangent, ); } } @@ -175,7 +175,7 @@ function calculateAttributesWall(positions, vertexFormat, ellipsoid) { if (vertexFormat.tangent) { tangent = Cartesian3.normalize( Cartesian3.cross(bitangent, normal, tangent), - tangent + tangent, ); } } @@ -268,7 +268,7 @@ function constructRectangle(rectangleGeometry, computedOptions) { row, col, position, - st + st, ); positions[posIndex++] = position.x; @@ -294,7 +294,7 @@ function constructRectangle(rectangleGeometry, computedOptions) { 0, 0, position, - st + st, ); positions[posIndex++] = position.x; @@ -319,7 +319,7 @@ function constructRectangle(rectangleGeometry, computedOptions) { height - 1, 0, position, - st + st, ); positions[posIndex++] = position.x; @@ -352,7 +352,7 @@ function constructRectangle(rectangleGeometry, computedOptions) { positions, vertexFormat, ellipsoid, - computedOptions.tangentRotationMatrix + computedOptions.tangentRotationMatrix, ); let indicesSize = 6 * (width - 1) * (rowHeight - 1); @@ -433,7 +433,7 @@ function addWallPositions( posIndex, i, topPositions, - bottomPositions + bottomPositions, ) { wallPositions[posIndex++] = topPositions[i]; wallPositions[posIndex++] = topPositions[i + 1]; @@ -470,7 +470,7 @@ function constructExtrudedRectangle(rectangleGeometry, computedOptions) { if (shadowVolume) { const newVertexFormat = VertexFormat.clone( vertexFormat, - scratchVertexFormat + scratchVertexFormat, ); newVertexFormat.normal = true; rectangleGeometry._vertexFormat = newVertexFormat; @@ -486,7 +486,7 @@ function constructExtrudedRectangle(rectangleGeometry, computedOptions) { topBottomGeo.attributes.position.values, maxHeight, ellipsoid, - false + false, ); topPositions = new Float64Array(topPositions); let length = topPositions.length; @@ -496,7 +496,7 @@ function constructExtrudedRectangle(rectangleGeometry, computedOptions) { const bottomPositions = PolygonPipeline.scaleToGeodeticHeight( topBottomGeo.attributes.position.values, minHeight, - ellipsoid + ellipsoid, ); positions.set(bottomPositions, length); topBottomGeo.attributes.position.values = positions; @@ -586,7 +586,7 @@ function constructExtrudedRectangle(rectangleGeometry, computedOptions) { const posLength = length / 3; const newIndices = IndexDatatype.createTypedArray( newLength / 3, - indicesLength * 2 + indicesLength * 2, ); newIndices.set(indices); for (i = 0; i < indicesLength; i += 3) { @@ -651,7 +651,7 @@ function constructExtrudedRectangle(rectangleGeometry, computedOptions) { posIndex, threeI, topPositions, - bottomPositions + bottomPositions, ); posIndex += 6; if (vertexFormat.st) { @@ -659,7 +659,7 @@ function constructExtrudedRectangle(rectangleGeometry, computedOptions) { wallTextures, stIndex, i * 2, - topSt + topSt, ); stIndex += 4; } @@ -683,7 +683,7 @@ function constructExtrudedRectangle(rectangleGeometry, computedOptions) { posIndex, threeI, topPositions, - bottomPositions + bottomPositions, ); posIndex += 6; if (vertexFormat.st) { @@ -691,7 +691,7 @@ function constructExtrudedRectangle(rectangleGeometry, computedOptions) { wallTextures, stIndex, i * 2, - topSt + topSt, ); stIndex += 4; } @@ -717,7 +717,7 @@ function constructExtrudedRectangle(rectangleGeometry, computedOptions) { posIndex, threeI, topPositions, - bottomPositions + bottomPositions, ); posIndex += 6; if (vertexFormat.st) { @@ -725,7 +725,7 @@ function constructExtrudedRectangle(rectangleGeometry, computedOptions) { wallTextures, stIndex, southIndex * 2, - topSt + topSt, ); stIndex += 4; } @@ -749,7 +749,7 @@ function constructExtrudedRectangle(rectangleGeometry, computedOptions) { posIndex, threeI, topPositions, - bottomPositions + bottomPositions, ); posIndex += 6; if (vertexFormat.st) { @@ -757,7 +757,7 @@ function constructExtrudedRectangle(rectangleGeometry, computedOptions) { wallTextures, stIndex, i * 2, - topSt + topSt, ); stIndex += 4; } @@ -781,7 +781,7 @@ function constructExtrudedRectangle(rectangleGeometry, computedOptions) { posIndex, threeI, topPositions, - bottomPositions + bottomPositions, ); posIndex += 6; if (vertexFormat.st) { @@ -789,7 +789,7 @@ function constructExtrudedRectangle(rectangleGeometry, computedOptions) { wallTextures, stIndex, i * 2, - topSt + topSt, ); stIndex += 4; } @@ -815,7 +815,7 @@ function constructExtrudedRectangle(rectangleGeometry, computedOptions) { posIndex, threeI, topPositions, - bottomPositions + bottomPositions, ); posIndex += 6; if (vertexFormat.st) { @@ -823,7 +823,7 @@ function constructExtrudedRectangle(rectangleGeometry, computedOptions) { wallTextures, stIndex, northIndex * 2, - topSt + topSt, ); stIndex += 4; } @@ -866,7 +866,7 @@ function constructExtrudedRectangle(rectangleGeometry, computedOptions) { const wallIndices = IndexDatatype.createTypedArray( wallCount, - perimeterPositions * 6 + perimeterPositions * 6, ); let upperLeft; @@ -926,7 +926,7 @@ function computeRectangle(rectangle, granularity, rotation, ellipsoid, result) { rotation, 0, rectangleScratch, - nwScratch + nwScratch, ); const height = computedOptions.height; @@ -939,7 +939,7 @@ function computeRectangle(rectangle, granularity, rotation, ellipsoid, result) { false, 0, 0, - positions[0] + positions[0], ); RectangleGeometryLibrary.computePosition( computedOptions, @@ -947,7 +947,7 @@ function computeRectangle(rectangle, granularity, rotation, ellipsoid, result) { false, 0, width - 1, - positions[1] + positions[1], ); RectangleGeometryLibrary.computePosition( computedOptions, @@ -955,7 +955,7 @@ function computeRectangle(rectangle, granularity, rotation, ellipsoid, result) { false, height - 1, 0, - positions[2] + positions[2], ); RectangleGeometryLibrary.computePosition( computedOptions, @@ -963,7 +963,7 @@ function computeRectangle(rectangle, granularity, rotation, ellipsoid, result) { false, height - 1, width - 1, - positions[3] + positions[3], ); return Rectangle.fromCartesianArray(positions, ellipsoid, result); @@ -1023,7 +1023,7 @@ function RectangleGeometry(options) { Rectangle.validate(rectangle); if (rectangle.north < rectangle.south) { throw new DeveloperError( - "options.rectangle.north must be greater than or equal to options.rectangle.south" + "options.rectangle.north must be greater than or equal to options.rectangle.south", ); } //>>includeEnd('debug'); @@ -1034,16 +1034,16 @@ function RectangleGeometry(options) { this._rectangle = Rectangle.clone(rectangle); this._granularity = defaultValue( options.granularity, - CesiumMath.RADIANS_PER_DEGREE + CesiumMath.RADIANS_PER_DEGREE, ); this._ellipsoid = Ellipsoid.clone( - defaultValue(options.ellipsoid, Ellipsoid.default) + defaultValue(options.ellipsoid, Ellipsoid.default), ); this._surfaceHeight = Math.max(height, extrudedHeight); this._rotation = defaultValue(options.rotation, 0.0); this._stRotation = defaultValue(options.stRotation, 0.0); this._vertexFormat = VertexFormat.clone( - defaultValue(options.vertexFormat, VertexFormat.DEFAULT) + defaultValue(options.vertexFormat, VertexFormat.DEFAULT), ); this._extrudedHeight = Math.min(height, extrudedHeight); this._shadowVolume = defaultValue(options.shadowVolume, false); @@ -1140,7 +1140,7 @@ RectangleGeometry.unpack = function (array, startingIndex, result) { const vertexFormat = VertexFormat.unpack( array, startingIndex, - scratchVertexFormat + scratchVertexFormat, ); startingIndex += VertexFormat.packedLength; @@ -1202,14 +1202,14 @@ RectangleGeometry.computeRectangle = function (options, result) { Rectangle.validate(rectangle); if (rectangle.north < rectangle.south) { throw new DeveloperError( - "options.rectangle.north must be greater than or equal to options.rectangle.south" + "options.rectangle.north must be greater than or equal to options.rectangle.south", ); } //>>includeEnd('debug'); const granularity = defaultValue( options.granularity, - CesiumMath.RADIANS_PER_DEGREE + CesiumMath.RADIANS_PER_DEGREE, ); const ellipsoid = defaultValue(options.ellipsoid, Ellipsoid.default); const rotation = defaultValue(options.rotation, 0.0); @@ -1233,12 +1233,12 @@ RectangleGeometry.createGeometry = function (rectangleGeometry) { CesiumMath.equalsEpsilon( rectangleGeometry._rectangle.north, rectangleGeometry._rectangle.south, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ) || CesiumMath.equalsEpsilon( rectangleGeometry._rectangle.east, rectangleGeometry._rectangle.west, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ) ) { return undefined; @@ -1257,7 +1257,7 @@ RectangleGeometry.createGeometry = function (rectangleGeometry) { stRotation, rectangleScratch, nwScratch, - stNwScratch + stNwScratch, ); const tangentRotationMatrix = tangentRotationMatrixScratch; @@ -1276,7 +1276,7 @@ RectangleGeometry.createGeometry = function (rectangleGeometry) { surfaceHeight, extrudedHeight, 0, - CesiumMath.EPSILON2 + CesiumMath.EPSILON2, ); computedOptions.lonScalar = 1.0 / rectangleGeometry._rectangle.width; @@ -1292,13 +1292,13 @@ RectangleGeometry.createGeometry = function (rectangleGeometry) { rectangle, ellipsoid, surfaceHeight, - topBoundingSphere + topBoundingSphere, ); const bottomBS = BoundingSphere.fromRectangle3D( rectangle, ellipsoid, extrudedHeight, - bottomBoundingSphere + bottomBoundingSphere, ); boundingSphere = BoundingSphere.union(topBS, bottomBS); } else { @@ -1307,7 +1307,7 @@ RectangleGeometry.createGeometry = function (rectangleGeometry) { geometry.attributes.position.values, surfaceHeight, ellipsoid, - false + false, ); if (defined(rectangleGeometry._offsetAttribute)) { @@ -1327,7 +1327,7 @@ RectangleGeometry.createGeometry = function (rectangleGeometry) { boundingSphere = BoundingSphere.fromRectangle3D( rectangle, ellipsoid, - surfaceHeight + surfaceHeight, ); } @@ -1350,7 +1350,7 @@ RectangleGeometry.createGeometry = function (rectangleGeometry) { RectangleGeometry.createShadowVolume = function ( rectangleGeometry, minHeightFunc, - maxHeightFunc + maxHeightFunc, ) { const granularity = rectangleGeometry._granularity; const ellipsoid = rectangleGeometry._ellipsoid; @@ -1383,7 +1383,7 @@ function textureCoordinateRotationPoints(rectangleGeometry) { const rectangle = Rectangle.clone( rectangleGeometry._rectangle, - unrotatedTextureRectangleScratch + unrotatedTextureRectangleScratch, ); const granularity = rectangleGeometry._granularity; const ellipsoid = rectangleGeometry._ellipsoid; @@ -1396,7 +1396,7 @@ function textureCoordinateRotationPoints(rectangleGeometry) { granularity, rotation, ellipsoid, - unrotatedTextureRectangleScratch + unrotatedTextureRectangleScratch, ); // Assume a computed "east-north" texture coordinate system based on spherical or planar tricks, bounded by `boundingRectangle`. @@ -1420,11 +1420,11 @@ function textureCoordinateRotationPoints(rectangleGeometry) { const boundingRectangle = rectangleGeometry.rectangle; const toDesiredInComputed = Matrix2.fromRotation( rectangleGeometry._stRotation, - rotation2DScratch + rotation2DScratch, ); const boundingRectangleCenter = Rectangle.center( boundingRectangle, - rectangleCenterScratch + rectangleCenterScratch, ); for (let i = 0; i < 3; ++i) { @@ -1462,7 +1462,7 @@ Object.defineProperties(RectangleGeometry.prototype, { this._rectangle, this._granularity, this._rotation, - this._ellipsoid + this._ellipsoid, ); } return this._rotatedRectangle; @@ -1478,9 +1478,8 @@ Object.defineProperties(RectangleGeometry.prototype, { textureCoordinateRotationPoints: { get: function () { if (!defined(this._textureCoordinateRotationPoints)) { - this._textureCoordinateRotationPoints = textureCoordinateRotationPoints( - this - ); + this._textureCoordinateRotationPoints = + textureCoordinateRotationPoints(this); } return this._textureCoordinateRotationPoints; }, diff --git a/packages/engine/Source/Core/RectangleGeometryLibrary.js b/packages/engine/Source/Core/RectangleGeometryLibrary.js index 4f4d4fd13e05..d374d5f8ce95 100644 --- a/packages/engine/Source/Core/RectangleGeometryLibrary.js +++ b/packages/engine/Source/Core/RectangleGeometryLibrary.js @@ -27,7 +27,7 @@ RectangleGeometryLibrary.computePosition = function ( row, col, position, - st + st, ) { const radiiSquared = ellipsoid.radiiSquared; const nwCorner = computedOptions.nwCorner; @@ -91,7 +91,7 @@ function getRotationOptions( granularityY, center, width, - height + height, ) { const cosRotation = Math.cos(rotation); const granYCos = granularityY * cosRotation; @@ -109,7 +109,7 @@ function getRotationOptions( nwCartesian = Matrix2.multiplyByVector( rotationMatrix, nwCartesian, - nwCartesian + nwCartesian, ); nwCartesian = Cartesian3.add(nwCartesian, centerCartesian, nwCartesian); nwCorner = proj.unproject(nwCartesian, nwCorner); @@ -156,7 +156,7 @@ RectangleGeometryLibrary.computeOptions = function ( stRotation, boundingRectangleScratch, nwCornerResult, - stNwCornerResult + stNwCornerResult, ) { let east = rectangle.east; let west = rectangle.west; @@ -203,7 +203,7 @@ RectangleGeometryLibrary.computeOptions = function ( const boundingRectangle = Rectangle.clone( rectangle, - boundingRectangleScratch + boundingRectangleScratch, ); const computedOptions = { @@ -227,7 +227,7 @@ RectangleGeometryLibrary.computeOptions = function ( granularityY, center, width, - height + height, ); north = rotationOptions.north; south = rotationOptions.south; @@ -242,7 +242,7 @@ RectangleGeometryLibrary.computeOptions = function ( south > CesiumMath.PI_OVER_TWO ) { throw new DeveloperError( - "Rotated rectangle is invalid. It crosses over either the north or south pole." + "Rotated rectangle is invalid. It crosses over either the north or south pole.", ); } //>>includeEnd('debug') @@ -269,7 +269,7 @@ RectangleGeometryLibrary.computeOptions = function ( granularityY, center, width, - height + height, ); computedOptions.stGranYCos = stRotationOptions.granYCos; diff --git a/packages/engine/Source/Core/RectangleOutlineGeometry.js b/packages/engine/Source/Core/RectangleOutlineGeometry.js index 42cfe81d3adb..da6685e6388c 100644 --- a/packages/engine/Source/Core/RectangleOutlineGeometry.js +++ b/packages/engine/Source/Core/RectangleOutlineGeometry.js @@ -60,7 +60,7 @@ function constructRectangle(geometry, computedOptions) { false, row, 0, - position + position, ); positions[posIndex++] = position.x; positions[posIndex++] = position.y; @@ -73,7 +73,7 @@ function constructRectangle(geometry, computedOptions) { false, row, col, - position + position, ); positions[posIndex++] = position.x; positions[posIndex++] = position.y; @@ -89,7 +89,7 @@ function constructRectangle(geometry, computedOptions) { false, row, col, - position + position, ); positions[posIndex++] = position.x; positions[posIndex++] = position.y; @@ -106,7 +106,7 @@ function constructRectangle(geometry, computedOptions) { false, row, col, - position + position, ); positions[posIndex++] = position.x; positions[posIndex++] = position.y; @@ -122,7 +122,7 @@ function constructRectangle(geometry, computedOptions) { false, row, col, - position + position, ); positions[posIndex++] = position.x; positions[posIndex++] = position.y; @@ -132,7 +132,7 @@ function constructRectangle(geometry, computedOptions) { const indicesSize = (positions.length / 3) * 2; const indices = IndexDatatype.createTypedArray( positions.length / 3, - indicesSize + indicesSize, ); let index = 0; @@ -171,7 +171,7 @@ function constructExtrudedRectangle(rectangleGeometry, computedOptions) { geo.attributes.position.values, maxHeight, ellipsoid, - false + false, ); let length = topPositions.length; const positions = new Float64Array(length * 2); @@ -179,7 +179,7 @@ function constructExtrudedRectangle(rectangleGeometry, computedOptions) { const bottomPositions = PolygonPipeline.scaleToGeodeticHeight( geo.attributes.position.values, minHeight, - ellipsoid + ellipsoid, ); positions.set(bottomPositions, length); geo.attributes.position.values = positions; @@ -197,7 +197,7 @@ function constructExtrudedRectangle(rectangleGeometry, computedOptions) { const indicesSize = (positions.length / 3 + corners) * 2; const indices = IndexDatatype.createTypedArray( positions.length / 3, - indicesSize + indicesSize, ); length = positions.length / 6; let index = 0; @@ -275,7 +275,7 @@ function RectangleOutlineGeometry(options) { const rectangle = options.rectangle; const granularity = defaultValue( options.granularity, - CesiumMath.RADIANS_PER_DEGREE + CesiumMath.RADIANS_PER_DEGREE, ); const ellipsoid = defaultValue(options.ellipsoid, Ellipsoid.default); const rotation = defaultValue(options.rotation, 0.0); @@ -287,7 +287,7 @@ function RectangleOutlineGeometry(options) { Rectangle.validate(rectangle); if (rectangle.north < rectangle.south) { throw new DeveloperError( - "options.rectangle.north must be greater than options.rectangle.south" + "options.rectangle.north must be greater than options.rectangle.south", ); } //>>includeEnd('debug'); @@ -430,7 +430,7 @@ RectangleOutlineGeometry.createGeometry = function (rectangleGeometry) { rectangleGeometry._rotation, 0, rectangleScratch, - nwScratch + nwScratch, ); let geometry; @@ -440,12 +440,12 @@ RectangleOutlineGeometry.createGeometry = function (rectangleGeometry) { CesiumMath.equalsEpsilon( rectangle.north, rectangle.south, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ) || CesiumMath.equalsEpsilon( rectangle.east, rectangle.west, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ) ) { return undefined; @@ -457,7 +457,7 @@ RectangleOutlineGeometry.createGeometry = function (rectangleGeometry) { surfaceHeight, extrudedHeight, 0, - CesiumMath.EPSILON2 + CesiumMath.EPSILON2, ); let offsetValue; if (extrude) { @@ -485,13 +485,13 @@ RectangleOutlineGeometry.createGeometry = function (rectangleGeometry) { rectangle, ellipsoid, surfaceHeight, - topBoundingSphere + topBoundingSphere, ); const bottomBS = BoundingSphere.fromRectangle3D( rectangle, ellipsoid, extrudedHeight, - bottomBoundingSphere + bottomBoundingSphere, ); boundingSphere = BoundingSphere.union(topBS, bottomBS); } else { @@ -500,7 +500,7 @@ RectangleOutlineGeometry.createGeometry = function (rectangleGeometry) { geometry.attributes.position.values, surfaceHeight, ellipsoid, - false + false, ); if (defined(rectangleGeometry._offsetAttribute)) { @@ -520,7 +520,7 @@ RectangleOutlineGeometry.createGeometry = function (rectangleGeometry) { boundingSphere = BoundingSphere.fromRectangle3D( rectangle, ellipsoid, - surfaceHeight + surfaceHeight, ); } diff --git a/packages/engine/Source/Core/RequestScheduler.js b/packages/engine/Source/Core/RequestScheduler.js index 2caded8f67b9..e07970bbd619 100644 --- a/packages/engine/Source/Core/RequestScheduler.js +++ b/packages/engine/Source/Core/RequestScheduler.js @@ -168,7 +168,7 @@ RequestScheduler.serverHasOpenSlots = function (serverKey, desiredRequests) { const maxRequests = defaultValue( RequestScheduler.requestsByServer[serverKey], - RequestScheduler.maximumRequestsPerServer + RequestScheduler.maximumRequestsPerServer, ); const hasOpenSlotsServer = numberOfActiveRequestsByServer[serverKey] + desiredRequests <= maxRequests; @@ -311,7 +311,7 @@ RequestScheduler.update = function () { // Un-throttled requests are automatically added to activeRequests, so activeRequests.length may exceed maximumRequests const openSlots = Math.max( RequestScheduler.maximumRequests - activeRequests.length, - 0 + 0, ); let filledSlots = 0; while (filledSlots < openSlots && requestHeap.length > 0) { @@ -446,28 +446,28 @@ function updateStatistics() { ) { if (statistics.numberOfAttemptedRequests > 0) { console.log( - `Number of attempted requests: ${statistics.numberOfAttemptedRequests}` + `Number of attempted requests: ${statistics.numberOfAttemptedRequests}`, ); statistics.numberOfAttemptedRequests = 0; } if (statistics.numberOfCancelledRequests > 0) { console.log( - `Number of cancelled requests: ${statistics.numberOfCancelledRequests}` + `Number of cancelled requests: ${statistics.numberOfCancelledRequests}`, ); statistics.numberOfCancelledRequests = 0; } if (statistics.numberOfCancelledActiveRequests > 0) { console.log( - `Number of cancelled active requests: ${statistics.numberOfCancelledActiveRequests}` + `Number of cancelled active requests: ${statistics.numberOfCancelledActiveRequests}`, ); statistics.numberOfCancelledActiveRequests = 0; } if (statistics.numberOfFailedRequests > 0) { console.log( - `Number of failed requests: ${statistics.numberOfFailedRequests}` + `Number of failed requests: ${statistics.numberOfFailedRequests}`, ); statistics.numberOfFailedRequests = 0; } diff --git a/packages/engine/Source/Core/Resource.js b/packages/engine/Source/Core/Resource.js index cec46808118d..6c5c6566450f 100644 --- a/packages/engine/Source/Core/Resource.js +++ b/packages/engine/Source/Core/Resource.js @@ -603,13 +603,13 @@ Resource.prototype.setQueryParameters = function (params, useAsDefault) { this._queryParameters = combineQueryParameters( this._queryParameters, params, - false + false, ); } else { this._queryParameters = combineQueryParameters( params, this._queryParameters, - false + false, ); } }; @@ -624,7 +624,7 @@ Resource.prototype.appendQueryParameters = function (params) { this._queryParameters = combineQueryParameters( params, this._queryParameters, - true + true, ); }; @@ -671,13 +671,13 @@ Resource.prototype.getDerivedResource = function (options) { if (defined(options.queryParameters)) { resource._queryParameters = combine( options.queryParameters, - resource.queryParameters + resource.queryParameters, ); } if (defined(options.templateValues)) { resource._templateValues = combine( options.templateValues, - resource.templateValues + resource.templateValues, ); } if (defined(options.headers)) { @@ -903,7 +903,7 @@ Resource.prototype.fetchImage = function (options) { const flipY = defaultValue(options.flipY, false); const skipColorSpaceConversion = defaultValue( options.skipColorSpaceConversion, - false + false, ); checkAndResetRequest(this.request); @@ -1029,7 +1029,7 @@ function fetchImage(options) { deferred, flipY, skipColorSpaceConversion, - preferImageBitmap + preferImageBitmap, ); return deferred.promise; @@ -1380,7 +1380,7 @@ Resource.prototype._makeRequest = function (options) { data, headers, deferred, - overrideMimeType + overrideMimeType, ); if (defined(xhr) && defined(xhr.abort)) { request.cancelFunction = function () { @@ -1483,7 +1483,7 @@ function decodeDataUri(dataUriRegexResult, responseType) { parser = new DOMParser(); return parser.parseFromString( decodeDataUriText(isBase64, data), - mimeType + mimeType, ); case "json": return JSON.parse(decodeDataUriText(isBase64, data)); @@ -1915,7 +1915,7 @@ Resource._Implementations = {}; Resource._Implementations.loadImageElement = function ( url, crossOrigin, - deferred + deferred, ) { const image = new Image(); @@ -1962,7 +1962,7 @@ Resource._Implementations.createImage = function ( deferred, flipY, skipColorSpaceConversion, - preferImageBitmap + preferImageBitmap, ) { const url = request.url; // Passing an Image to createImageBitmap will force it to run on the main thread @@ -1990,7 +1990,7 @@ Resource._Implementations.createImage = function ( xhrDeferred, undefined, undefined, - undefined + undefined, ); if (defined(xhr) && defined(xhr.abort)) { @@ -2003,8 +2003,8 @@ Resource._Implementations.createImage = function ( if (!defined(blob)) { deferred.reject( new RuntimeError( - `Successfully retrieved ${url} but it contained no content.` - ) + `Successfully retrieved ${url} but it contained no content.`, + ), ); return; } @@ -2035,7 +2035,7 @@ Resource.createImageBitmapFromBlob = function (blob, options) { Check.typeOf.bool("options.premultiplyAlpha", options.premultiplyAlpha); Check.typeOf.bool( "options.skipColorSpaceConversion", - options.skipColorSpaceConversion + options.skipColorSpaceConversion, ); return createImageBitmap(blob, { @@ -2052,7 +2052,7 @@ function loadWithHttpRequest( data, headers, deferred, - overrideMimeType + overrideMimeType, ) { // Note: only the 'json' and 'text' responseTypes transforms the loaded buffer fetch(url, { @@ -2066,7 +2066,7 @@ function loadWithHttpRequest( responseHeaders[key] = value; }); deferred.reject( - new RequestErrorEvent(response.status, response, responseHeaders) + new RequestErrorEvent(response.status, response, responseHeaders), ); return; } @@ -2096,7 +2096,7 @@ Resource._Implementations.loadWithXhr = function ( data, headers, deferred, - overrideMimeType + overrideMimeType, ) { const dataUriRegexResult = dataUriRegex.exec(url); if (dataUriRegexResult !== null) { @@ -2112,7 +2112,7 @@ Resource._Implementations.loadWithXhr = function ( data, headers, deferred, - overrideMimeType + overrideMimeType, ); return; } @@ -2158,8 +2158,8 @@ Resource._Implementations.loadWithXhr = function ( new RequestErrorEvent( xhr.status, xhr.response, - xhr.getAllResponseHeaders() - ) + xhr.getAllResponseHeaders(), + ), ); return; } @@ -2212,7 +2212,7 @@ Resource._Implementations.loadWithXhr = function ( deferred.resolve(xhr.responseText); } else { deferred.reject( - new RuntimeError("Invalid XMLHttpRequest response type.") + new RuntimeError("Invalid XMLHttpRequest response type."), ); } }; @@ -2229,7 +2229,7 @@ Resource._Implementations.loadWithXhr = function ( Resource._Implementations.loadAndExecuteScript = function ( url, functionName, - deferred + deferred, ) { return loadAndExecuteScript(url, functionName).catch(function (e) { deferred.reject(e); @@ -2261,7 +2261,7 @@ Resource.DEFAULT = Object.freeze( typeof document === "undefined" ? "" : document.location.href.split("?")[0], - }) + }), ); /** diff --git a/packages/engine/Source/Core/S2Cell.js b/packages/engine/Source/Core/S2Cell.js index 67a05266fce4..5b3a0dc31fd9 100644 --- a/packages/engine/Source/Core/S2Cell.js +++ b/packages/engine/Source/Core/S2Cell.js @@ -276,7 +276,7 @@ S2Cell.getTokenFromId = function (cellId) { const hexString = cellId.toString(16).replace(/0*$/, ""); const zeroString = Array(17 - trailingZeroHexChars - hexString.length).join( - "0" + "0", ); return zeroString + hexString; }; @@ -389,7 +389,7 @@ S2Cell.prototype.getCenter = function (ellipsoid) { center = Cartesian3.normalize(center, center); const cartographic = new Cartographic.fromCartesian( center, - Ellipsoid.UNIT_SPHERE + Ellipsoid.UNIT_SPHERE, ); // Interpret as geodetic coordinates on the ellipsoid. return Cartographic.toCartesian(cartographic, ellipsoid, new Cartesian3()); @@ -418,7 +418,7 @@ S2Cell.prototype.getVertex = function (index, ellipsoid) { vertex = Cartesian3.normalize(vertex, vertex); const cartographic = new Cartographic.fromCartesian( vertex, - Ellipsoid.UNIT_SPHERE + Ellipsoid.UNIT_SPHERE, ); // Interpret as geodetic coordinates on the ellipsoid. return Cartographic.toCartesian(cartographic, ellipsoid, new Cartesian3()); @@ -452,7 +452,7 @@ S2Cell.fromFacePositionLevel = function (face, position, level) { (face < 4 ? "0" : "") + (face < 2 ? "0" : "") + face.toString(2); const positionBitString = position.toString(2); const positionPrefixPadding = Array( - 2 * level - positionBitString.length + 1 + 2 * level - positionBitString.length + 1, ).join("0"); const positionSuffixPadding = Array(S2_POSITION_BITS - 2 * level).join("0"); @@ -461,7 +461,7 @@ S2Cell.fromFacePositionLevel = function (face, position, level) { `0b${faceBitString}${positionPrefixPadding}${positionBitString}1${ // Adding the sentinel bit that always follows the position bits. positionSuffixPadding - }` + }`, ); return new S2Cell(cellId); }; @@ -530,7 +530,7 @@ function convertCellIdToFaceIJ(cellId) { const extractMask = (1 << (2 * numberOfBits)) - 1; bits += Number( - (cellId >> BigInt(k * 2 * S2_LOOKUP_BITS + 1)) & BigInt(extractMask) // eslint-disable-line + (cellId >> BigInt(k * 2 * S2_LOOKUP_BITS + 1)) & BigInt(extractMask), // eslint-disable-line ) << 2; bits = S2_LOOKUP_IJ[bits]; @@ -645,7 +645,7 @@ function generateLookupCell( j, originalOrientation, position, - orientation + orientation, ) { if (level === S2_LOOKUP_BITS) { const ij = (i << S2_LOOKUP_BITS) + j; @@ -665,7 +665,7 @@ function generateLookupCell( j + (r[0] & 1), originalOrientation, position, - orientation ^ S2_POSITION_TO_ORIENTATION_MASK[0] + orientation ^ S2_POSITION_TO_ORIENTATION_MASK[0], ); generateLookupCell( level, @@ -673,7 +673,7 @@ function generateLookupCell( j + (r[1] & 1), originalOrientation, position + 1, - orientation ^ S2_POSITION_TO_ORIENTATION_MASK[1] + orientation ^ S2_POSITION_TO_ORIENTATION_MASK[1], ); generateLookupCell( level, @@ -681,7 +681,7 @@ function generateLookupCell( j + (r[2] & 1), originalOrientation, position + 2, - orientation ^ S2_POSITION_TO_ORIENTATION_MASK[2] + orientation ^ S2_POSITION_TO_ORIENTATION_MASK[2], ); generateLookupCell( level, @@ -689,7 +689,7 @@ function generateLookupCell( j + (r[3] & 1), originalOrientation, position + 3, - orientation ^ S2_POSITION_TO_ORIENTATION_MASK[3] + orientation ^ S2_POSITION_TO_ORIENTATION_MASK[3], ); } } @@ -707,7 +707,7 @@ function generateLookupTable() { 0, S2_SWAP_MASK | S2_INVERT_MASK, 0, - S2_SWAP_MASK | S2_INVERT_MASK + S2_SWAP_MASK | S2_INVERT_MASK, ); } @@ -730,74 +730,10 @@ function lsbForLevel(level) { // Lookup table for getting trailing zero bits. // https://graphics.stanford.edu/~seander/bithacks.html const Mod67BitPosition = [ - 64, - 0, - 1, - 39, - 2, - 15, - 40, - 23, - 3, - 12, - 16, - 59, - 41, - 19, - 24, - 54, - 4, - 64, - 13, - 10, - 17, - 62, - 60, - 28, - 42, - 30, - 20, - 51, - 25, - 44, - 55, - 47, - 5, - 32, - 65, - 38, - 14, - 22, - 11, - 58, - 18, - 53, - 63, - 9, - 61, - 27, - 29, - 50, - 43, - 46, - 31, - 37, - 21, - 57, - 52, - 8, - 26, - 49, - 45, - 36, - 56, - 7, - 48, - 35, - 6, - 34, - 33, - 0, + 64, 0, 1, 39, 2, 15, 40, 23, 3, 12, 16, 59, 41, 19, 24, 54, 4, 64, 13, 10, 17, + 62, 60, 28, 42, 30, 20, 51, 25, 44, 55, 47, 5, 32, 65, 38, 14, 22, 11, 58, 18, + 53, 63, 9, 61, 27, 29, 50, 43, 46, 31, 37, 21, 57, 52, 8, 26, 49, 45, 36, 56, + 7, 48, 35, 6, 34, 33, 0, ]; /** diff --git a/packages/engine/Source/Core/ScreenSpaceEventHandler.js b/packages/engine/Source/Core/ScreenSpaceEventHandler.js index 0c2fb86c6079..23d7a837ff8e 100644 --- a/packages/engine/Source/Core/ScreenSpaceEventHandler.js +++ b/packages/engine/Source/Core/ScreenSpaceEventHandler.js @@ -83,68 +83,68 @@ function registerListeners(screenSpaceEventHandler) { screenSpaceEventHandler, "pointerdown", element, - handlePointerDown + handlePointerDown, ); registerListener( screenSpaceEventHandler, "pointerup", element, - handlePointerUp + handlePointerUp, ); registerListener( screenSpaceEventHandler, "pointermove", element, - handlePointerMove + handlePointerMove, ); registerListener( screenSpaceEventHandler, "pointercancel", element, - handlePointerUp + handlePointerUp, ); } else { registerListener( screenSpaceEventHandler, "mousedown", element, - handleMouseDown + handleMouseDown, ); registerListener( screenSpaceEventHandler, "mouseup", alternateElement, - handleMouseUp + handleMouseUp, ); registerListener( screenSpaceEventHandler, "mousemove", alternateElement, - handleMouseMove + handleMouseMove, ); registerListener( screenSpaceEventHandler, "touchstart", element, - handleTouchStart + handleTouchStart, ); registerListener( screenSpaceEventHandler, "touchend", alternateElement, - handleTouchEnd + handleTouchEnd, ); registerListener( screenSpaceEventHandler, "touchmove", alternateElement, - handleTouchMove + handleTouchMove, ); registerListener( screenSpaceEventHandler, "touchcancel", alternateElement, - handleTouchEnd + handleTouchEnd, ); } @@ -152,7 +152,7 @@ function registerListeners(screenSpaceEventHandler) { screenSpaceEventHandler, "dblclick", element, - handleDblClick + handleDblClick, ); // detect available wheel event @@ -223,7 +223,7 @@ function handleMouseDown(screenSpaceEventHandler, event) { const position = getPosition( screenSpaceEventHandler, event, - screenSpaceEventHandler._primaryPosition + screenSpaceEventHandler._primaryPosition, ); Cartesian2.clone(position, screenSpaceEventHandler._primaryStartPosition); Cartesian2.clone(position, screenSpaceEventHandler._primaryPreviousPosition); @@ -232,7 +232,7 @@ function handleMouseDown(screenSpaceEventHandler, event) { const action = screenSpaceEventHandler.getInputAction( screenSpaceEventType, - modifier + modifier, ); if (defined(action)) { @@ -255,24 +255,24 @@ function cancelMouseEvent( screenSpaceEventHandler, screenSpaceEventType, clickScreenSpaceEventType, - event + event, ) { const modifier = getModifier(event); const action = screenSpaceEventHandler.getInputAction( screenSpaceEventType, - modifier + modifier, ); const clickAction = screenSpaceEventHandler.getInputAction( clickScreenSpaceEventType, - modifier + modifier, ); if (defined(action) || defined(clickAction)) { const position = getPosition( screenSpaceEventHandler, event, - screenSpaceEventHandler._primaryPosition + screenSpaceEventHandler._primaryPosition, ); if (defined(action)) { @@ -287,7 +287,7 @@ function cancelMouseEvent( checkPixelTolerance( startPosition, position, - screenSpaceEventHandler._clickPixelTolerance + screenSpaceEventHandler._clickPixelTolerance, ) ) { Cartesian2.clone(position, mouseClickEvent.position); @@ -318,7 +318,7 @@ function handleMouseUp(screenSpaceEventHandler, event) { screenSpaceEventHandler, ScreenSpaceEventType.LEFT_UP, ScreenSpaceEventType.LEFT_CLICK, - event + event, ); screenSpaceEventHandler._buttonDown[MouseButton.LEFT] = false; } @@ -327,7 +327,7 @@ function handleMouseUp(screenSpaceEventHandler, event) { screenSpaceEventHandler, ScreenSpaceEventType.MIDDLE_UP, ScreenSpaceEventType.MIDDLE_CLICK, - event + event, ); screenSpaceEventHandler._buttonDown[MouseButton.MIDDLE] = false; } @@ -336,7 +336,7 @@ function handleMouseUp(screenSpaceEventHandler, event) { screenSpaceEventHandler, ScreenSpaceEventType.RIGHT_UP, ScreenSpaceEventType.RIGHT_CLICK, - event + event, ); screenSpaceEventHandler._buttonDown[MouseButton.RIGHT] = false; } @@ -357,13 +357,13 @@ function handleMouseMove(screenSpaceEventHandler, event) { const position = getPosition( screenSpaceEventHandler, event, - screenSpaceEventHandler._primaryPosition + screenSpaceEventHandler._primaryPosition, ); const previousPosition = screenSpaceEventHandler._primaryPreviousPosition; const action = screenSpaceEventHandler.getInputAction( ScreenSpaceEventType.MOUSE_MOVE, - modifier + modifier, ); if (defined(action)) { @@ -402,7 +402,7 @@ function handleDblClick(screenSpaceEventHandler, event) { const action = screenSpaceEventHandler.getInputAction( screenSpaceEventType, - modifier + modifier, ); if (defined(action)) { @@ -445,7 +445,7 @@ function handleWheel(screenSpaceEventHandler, event) { const modifier = getModifier(event); const action = screenSpaceEventHandler.getInputAction( ScreenSpaceEventType.WHEEL, - modifier + modifier, ); if (defined(action)) { @@ -471,7 +471,7 @@ function handleTouchStart(screenSpaceEventHandler, event) { identifier = touch.identifier; positions.set( identifier, - getPosition(screenSpaceEventHandler, touch, new Cartesian2()) + getPosition(screenSpaceEventHandler, touch, new Cartesian2()), ); } @@ -484,7 +484,7 @@ function handleTouchStart(screenSpaceEventHandler, event) { identifier = touch.identifier; previousPositions.set( identifier, - Cartesian2.clone(positions.get(identifier)) + Cartesian2.clone(positions.get(identifier)), ); } } @@ -556,13 +556,13 @@ function fireTouchEvents(screenSpaceEventHandler, event) { action = screenSpaceEventHandler.getInputAction( ScreenSpaceEventType.LEFT_UP, - modifier + modifier, ); if (defined(action)) { Cartesian2.clone( screenSpaceEventHandler._primaryPosition, - touchEndEvent.position + touchEndEvent.position, ); action(touchEndEvent); @@ -572,7 +572,7 @@ function fireTouchEvents(screenSpaceEventHandler, event) { // releasing single touch, check for CLICK clickAction = screenSpaceEventHandler.getInputAction( ScreenSpaceEventType.LEFT_CLICK, - modifier + modifier, ); if (defined(clickAction)) { @@ -583,12 +583,12 @@ function fireTouchEvents(screenSpaceEventHandler, event) { checkPixelTolerance( startPosition, endPosition, - screenSpaceEventHandler._clickPixelTolerance + screenSpaceEventHandler._clickPixelTolerance, ) ) { Cartesian2.clone( screenSpaceEventHandler._primaryPosition, - touchClickEvent.position + touchClickEvent.position, ); clickAction(touchClickEvent); @@ -607,7 +607,7 @@ function fireTouchEvents(screenSpaceEventHandler, event) { action = screenSpaceEventHandler.getInputAction( ScreenSpaceEventType.PINCH_END, - modifier + modifier, ); if (defined(action)) { @@ -622,14 +622,14 @@ function fireTouchEvents(screenSpaceEventHandler, event) { Cartesian2.clone(position, screenSpaceEventHandler._primaryStartPosition); Cartesian2.clone( position, - screenSpaceEventHandler._primaryPreviousPosition + screenSpaceEventHandler._primaryPreviousPosition, ); screenSpaceEventHandler._buttonDown[MouseButton.LEFT] = true; action = screenSpaceEventHandler.getInputAction( ScreenSpaceEventType.LEFT_DOWN, - modifier + modifier, ); if (defined(action)) { @@ -645,7 +645,7 @@ function fireTouchEvents(screenSpaceEventHandler, event) { clickAction = screenSpaceEventHandler.getInputAction( ScreenSpaceEventType.RIGHT_CLICK, - modifier + modifier, ); if (defined(clickAction)) { @@ -656,12 +656,12 @@ function fireTouchEvents(screenSpaceEventHandler, event) { checkPixelTolerance( startPosition, endPosition, - screenSpaceEventHandler._holdPixelTolerance + screenSpaceEventHandler._holdPixelTolerance, ) ) { Cartesian2.clone( screenSpaceEventHandler._primaryPosition, - touchHoldEvent.position + touchHoldEvent.position, ); clickAction(touchHoldEvent); @@ -679,7 +679,7 @@ function fireTouchEvents(screenSpaceEventHandler, event) { action = screenSpaceEventHandler.getInputAction( ScreenSpaceEventType.PINCH_START, - modifier + modifier, ); if (defined(action)) { @@ -724,7 +724,7 @@ function handleTouchMove(screenSpaceEventHandler, event) { identifier = touch.identifier; Cartesian2.clone( positions.get(identifier), - previousPositions.get(identifier) + previousPositions.get(identifier), ); } } @@ -763,7 +763,7 @@ function fireTouchMoveEvents(screenSpaceEventHandler, event) { action = screenSpaceEventHandler.getInputAction( ScreenSpaceEventType.MOUSE_MOVE, - modifier + modifier, ); if (defined(action)) { @@ -781,7 +781,7 @@ function fireTouchMoveEvents(screenSpaceEventHandler, event) { action = screenSpaceEventHandler.getInputAction( ScreenSpaceEventType.PINCH_MOVE, - modifier + modifier, ); if (defined(action)) { const position1 = positions.values[0]; @@ -805,23 +805,23 @@ function fireTouchMoveEvents(screenSpaceEventHandler, event) { Cartesian2.fromElements( 0.0, prevDist, - touchPinchMovementEvent.distance.startPosition + touchPinchMovementEvent.distance.startPosition, ); Cartesian2.fromElements( 0.0, dist, - touchPinchMovementEvent.distance.endPosition + touchPinchMovementEvent.distance.endPosition, ); Cartesian2.fromElements( prevAngle, prevCY, - touchPinchMovementEvent.angleAndHeight.startPosition + touchPinchMovementEvent.angleAndHeight.startPosition, ); Cartesian2.fromElements( angle, cY, - touchPinchMovementEvent.angleAndHeight.endPosition + touchPinchMovementEvent.angleAndHeight.endPosition, ); action(touchPinchMovementEvent); @@ -838,7 +838,7 @@ function handlePointerDown(screenSpaceEventHandler, event) { const identifier = event.pointerId; positions.set( identifier, - getPosition(screenSpaceEventHandler, event, new Cartesian2()) + getPosition(screenSpaceEventHandler, event, new Cartesian2()), ); fireTouchEvents(screenSpaceEventHandler, event); @@ -846,7 +846,7 @@ function handlePointerDown(screenSpaceEventHandler, event) { const previousPositions = screenSpaceEventHandler._previousPositions; previousPositions.set( identifier, - Cartesian2.clone(positions.get(identifier)) + Cartesian2.clone(positions.get(identifier)), ); } else { handleMouseDown(screenSpaceEventHandler, event); @@ -885,7 +885,7 @@ function handlePointerMove(screenSpaceEventHandler, event) { const previousPositions = screenSpaceEventHandler._previousPositions; Cartesian2.clone( positions.get(identifier), - previousPositions.get(identifier) + previousPositions.get(identifier), ); } else { handleMouseMove(screenSpaceEventHandler, event); @@ -988,7 +988,8 @@ function ScreenSpaceEventHandler(element) { }; this._isPinching = false; this._isTouchHolding = false; - this._lastSeenTouchEvent = -ScreenSpaceEventHandler.mouseEmulationIgnoreMilliseconds; + this._lastSeenTouchEvent = + -ScreenSpaceEventHandler.mouseEmulationIgnoreMilliseconds; this._primaryStartPosition = new Cartesian2(); this._primaryPosition = new Cartesian2(); @@ -1025,7 +1026,7 @@ function ScreenSpaceEventHandler(element) { ScreenSpaceEventHandler.prototype.setInputAction = function ( action, type, - modifier + modifier, ) { //>>includeStart('debug', pragmas.debug); if (!defined(action)) { @@ -1075,7 +1076,7 @@ ScreenSpaceEventHandler.prototype.getInputAction = function (type, modifier) { */ ScreenSpaceEventHandler.prototype.removeInputAction = function ( type, - modifier + modifier, ) { //>>includeStart('debug', pragmas.debug); if (!defined(type)) { diff --git a/packages/engine/Source/Core/Simon1994PlanetaryPositions.js b/packages/engine/Source/Core/Simon1994PlanetaryPositions.js index 8aa55b72c2bc..b8f6a19bb3da 100644 --- a/packages/engine/Source/Core/Simon1994PlanetaryPositions.js +++ b/packages/engine/Source/Core/Simon1994PlanetaryPositions.js @@ -68,7 +68,7 @@ function elementsToCartesian( longitudeOfPerigee, longitudeOfNode, meanLongitude, - result + result, ) { if (inclination < 0.0) { inclination = -inclination; @@ -78,7 +78,7 @@ function elementsToCartesian( //>>includeStart('debug', pragmas.debug); if (inclination < 0 || inclination > CesiumMath.PI) { throw new DeveloperError( - "The inclination is out of range. Inclination must be greater than or equal to zero and less than or equal to Pi radians." + "The inclination is out of range. Inclination must be greater than or equal to zero and less than or equal to Pi radians.", ); } //>>includeEnd('debug') @@ -88,7 +88,7 @@ function elementsToCartesian( const rightAscensionOfAscendingNode = longitudeOfNode; const trueAnomaly = meanAnomalyToTrueAnomaly( meanLongitude - longitudeOfPerigee, - eccentricity + eccentricity, ); const type = chooseOrbit(eccentricity, 0.0); @@ -99,7 +99,7 @@ function elementsToCartesian( Math.acos(-1.0 / eccentricity) ) { throw new DeveloperError( - "The true anomaly of the hyperbolic orbit lies outside of the bounds of the hyperbola." + "The true anomaly of the hyperbolic orbit lies outside of the bounds of the hyperbola.", ); } //>>includeEnd('debug') @@ -108,7 +108,7 @@ function elementsToCartesian( argumentOfPeriapsis, inclination, rightAscensionOfAscendingNode, - perifocalToEquatorial + perifocalToEquatorial, ); const semilatus = radiusOfPeriapsis * (1.0 + eccentricity); const costheta = Math.cos(trueAnomaly); @@ -161,7 +161,7 @@ function meanAnomalyToTrueAnomaly(meanAnomaly, eccentricity) { const eccentricAnomaly = meanAnomalyToEccentricAnomaly( meanAnomaly, - eccentricity + eccentricity, ); return eccentricAnomalyToTrueAnomaly(eccentricAnomaly, eccentricity); } @@ -257,7 +257,7 @@ function perifocalToCartesianMatrix( argumentOfPeriapsis, inclination, rightAscension, - result + result, ) { //>>includeStart('debug', pragmas.debug); if (inclination < 0 || inclination > CesiumMath.PI) { @@ -285,7 +285,7 @@ function perifocalToCartesianMatrix( sinap * sini, cosap * sini, - cosi + cosi, ); } else { result[0] = cosraan * cosap - sinraan * sinap * cosi; @@ -427,7 +427,7 @@ function computeSimonEarthMoonBarycenter(date, result) { longitudeOfPerigee, longitudeOfNode, meanLongitude, - result + result, ); } @@ -598,7 +598,7 @@ function computeSimonMoon(date, result) { longitudeOfPerigee, longitudeOfNode, meanLongitude, - result + result, ); } @@ -624,7 +624,7 @@ const axesTransformation = new Matrix3( -0.39777715593191376, -2.23970096136568e-16, 0.39777715593191376, - 0.9174820620691819 + 0.9174820620691819, ); let translation = new Cartesian3(); @@ -637,7 +637,7 @@ let translation = new Cartesian3(); */ Simon1994PlanetaryPositions.computeSunPositionInEarthInertialFrame = function ( julianDate, - result + result, ) { if (!defined(julianDate)) { julianDate = JulianDate.now(); @@ -669,7 +669,7 @@ Simon1994PlanetaryPositions.computeSunPositionInEarthInertialFrame = function ( */ Simon1994PlanetaryPositions.computeMoonPositionInEarthInertialFrame = function ( julianDate, - result + result, ) { if (!defined(julianDate)) { julianDate = JulianDate.now(); diff --git a/packages/engine/Source/Core/SimplePolylineGeometry.js b/packages/engine/Source/Core/SimplePolylineGeometry.js index a5035cbd63de..355b4ef8f7ea 100644 --- a/packages/engine/Source/Core/SimplePolylineGeometry.js +++ b/packages/engine/Source/Core/SimplePolylineGeometry.js @@ -112,7 +112,7 @@ function SimplePolylineGeometry(options) { this._arcType = defaultValue(options.arcType, ArcType.GEODESIC); this._granularity = defaultValue( options.granularity, - CesiumMath.RADIANS_PER_DEGREE + CesiumMath.RADIANS_PER_DEGREE, ); this._ellipsoid = defaultValue(options.ellipsoid, Ellipsoid.default); this._workerName = "createSimplePolylineGeometry"; @@ -263,7 +263,7 @@ SimplePolylineGeometry.createGeometry = function (simplePolylineGeometry) { const minDistance = CesiumMath.chordLength( granularity, - ellipsoid.maximumRadius + ellipsoid.maximumRadius, ); const perSegmentColors = defined(colors) && !colorsPerVertex; @@ -283,7 +283,7 @@ SimplePolylineGeometry.createGeometry = function (simplePolylineGeometry) { if (arcType === ArcType.GEODESIC) { subdivisionSize = CesiumMath.chordLength( granularity, - ellipsoid.maximumRadius + ellipsoid.maximumRadius, ); numberOfPointsFunction = PolylinePipeline.numberOfPoints; generateArcFunction = PolylinePipeline.generateArc; @@ -310,7 +310,7 @@ SimplePolylineGeometry.createGeometry = function (simplePolylineGeometry) { numberOfPointsFunction( positions[i], positions[i + 1], - subdivisionSize + subdivisionSize, ) + 1; } @@ -348,7 +348,7 @@ SimplePolylineGeometry.createGeometry = function (simplePolylineGeometry) { generateArcOptions.positions = positions; generateArcOptions.height = heights; positionValues = new Float64Array( - generateArcFunction(generateArcOptions) + generateArcFunction(generateArcOptions), ); if (defined(colors)) { @@ -366,7 +366,7 @@ SimplePolylineGeometry.createGeometry = function (simplePolylineGeometry) { c1, minDistance, colorValues, - offset + offset, ); } @@ -438,7 +438,7 @@ SimplePolylineGeometry.createGeometry = function (simplePolylineGeometry) { const numberOfIndices = (numberOfPositions - 1) * 2; const indices = IndexDatatype.createTypedArray( numberOfPositions, - numberOfIndices + numberOfIndices, ); let index = 0; diff --git a/packages/engine/Source/Core/SphereGeometry.js b/packages/engine/Source/Core/SphereGeometry.js index 14246063e2f2..c01eff6abc76 100644 --- a/packages/engine/Source/Core/SphereGeometry.js +++ b/packages/engine/Source/Core/SphereGeometry.js @@ -87,11 +87,11 @@ SphereGeometry.unpack = function (array, startingIndex, result) { const ellipsoidGeometry = EllipsoidGeometry.unpack( array, startingIndex, - scratchEllipsoidGeometry + scratchEllipsoidGeometry, ); scratchOptions.vertexFormat = VertexFormat.clone( ellipsoidGeometry._vertexFormat, - scratchOptions.vertexFormat + scratchOptions.vertexFormat, ); scratchOptions.stackPartitions = ellipsoidGeometry._stackPartitions; scratchOptions.slicePartitions = ellipsoidGeometry._slicePartitions; diff --git a/packages/engine/Source/Core/SphereOutlineGeometry.js b/packages/engine/Source/Core/SphereOutlineGeometry.js index f8a182129a04..62e4374acef7 100644 --- a/packages/engine/Source/Core/SphereOutlineGeometry.js +++ b/packages/engine/Source/Core/SphereOutlineGeometry.js @@ -65,7 +65,7 @@ SphereOutlineGeometry.pack = function (value, array, startingIndex) { return EllipsoidOutlineGeometry.pack( value._ellipsoidGeometry, array, - startingIndex + startingIndex, ); }; @@ -90,7 +90,7 @@ SphereOutlineGeometry.unpack = function (array, startingIndex, result) { const ellipsoidGeometry = EllipsoidOutlineGeometry.unpack( array, startingIndex, - scratchEllipsoidGeometry + scratchEllipsoidGeometry, ); scratchOptions.stackPartitions = ellipsoidGeometry._stackPartitions; scratchOptions.slicePartitions = ellipsoidGeometry._slicePartitions; @@ -114,7 +114,7 @@ SphereOutlineGeometry.unpack = function (array, startingIndex, result) { */ SphereOutlineGeometry.createGeometry = function (sphereGeometry) { return EllipsoidOutlineGeometry.createGeometry( - sphereGeometry._ellipsoidGeometry + sphereGeometry._ellipsoidGeometry, ); }; export default SphereOutlineGeometry; diff --git a/packages/engine/Source/Core/Spline.js b/packages/engine/Source/Core/Spline.js index 5dba9c6d77e6..b268ac0076e8 100644 --- a/packages/engine/Source/Core/Spline.js +++ b/packages/engine/Source/Core/Spline.js @@ -60,7 +60,7 @@ Spline.getPointType = function (point) { //>>includeStart('debug', pragmas.debug); throw new DeveloperError( - "point must be a Cartesian3, Quaternion, or number." + "point must be a Cartesian3, Quaternion, or number.", ); //>>includeEnd('debug'); }; diff --git a/packages/engine/Source/Core/SteppedSpline.js b/packages/engine/Source/Core/SteppedSpline.js index 4f3242a2f0db..cbcfcc72c4e5 100644 --- a/packages/engine/Source/Core/SteppedSpline.js +++ b/packages/engine/Source/Core/SteppedSpline.js @@ -50,7 +50,7 @@ function SteppedSpline(options) { } if (points.length < 2) { throw new DeveloperError( - "points.length must be greater than or equal to 2." + "points.length must be greater than or equal to 2.", ); } if (times.length !== points.length) { diff --git a/packages/engine/Source/Core/Stereographic.js b/packages/engine/Source/Core/Stereographic.js index 5592dcafa83e..a130630f6083 100644 --- a/packages/engine/Source/Core/Stereographic.js +++ b/packages/engine/Source/Core/Stereographic.js @@ -112,7 +112,7 @@ Stereographic.prototype.getLatitude = function (ellipsoid) { scratchCartographic.height = 0.0; const cartesian = this.ellipsoid.cartographicToCartesian( scratchCartographic, - scratchCartesian + scratchCartesian, ); ellipsoid.cartesianToCartographic(cartesian, scratchCartographic); return scratchCartographic.latitude; @@ -145,19 +145,19 @@ Stereographic.fromCartesian = function (cartesian, result) { const ray = scratchProjectPointOntoPlaneRay; ray.origin = tangentPlane.ellipsoid.scaleToGeocentricSurface( cartesian, - ray.origin + ray.origin, ); ray.direction = Cartesian3.subtract( ray.origin, origin, - scratchProjectPointOntoPlaneRayDirection + scratchProjectPointOntoPlaneRayDirection, ); Cartesian3.normalize(ray.direction, ray.direction); const intersectionPoint = IntersectionTests.rayPlane( ray, tangentPlane.plane, - scratchProjectPointOntoPlaneCartesian3 + scratchProjectPointOntoPlaneCartesian3, ); const v = Cartesian3.subtract(intersectionPoint, origin, intersectionPoint); const x = Cartesian3.dot(tangentPlane.xAxis, v); @@ -210,7 +210,7 @@ Stereographic.clone = function (stereographic, result) { if (!defined(result)) { return new Stereographic( stereographic.position, - stereographic.tangentPlane + stereographic.tangentPlane, ); } @@ -234,14 +234,14 @@ Stereographic.SOUTH_POLE = Object.freeze(new Cartesian3(0.0, 0.0, -0.5)); Stereographic.NORTH_POLE_TANGENT_PLANE = Object.freeze( new EllipsoidTangentPlane( Stereographic.NORTH_POLE, - Stereographic.HALF_UNIT_SPHERE - ) + Stereographic.HALF_UNIT_SPHERE, + ), ); Stereographic.SOUTH_POLE_TANGENT_PLANE = Object.freeze( new EllipsoidTangentPlane( Stereographic.SOUTH_POLE, - Stereographic.HALF_UNIT_SPHERE - ) + Stereographic.HALF_UNIT_SPHERE, + ), ); export default Stereographic; diff --git a/packages/engine/Source/Core/TaskProcessor.js b/packages/engine/Source/Core/TaskProcessor.js index 9eca8d863e1b..760a6921b03a 100644 --- a/packages/engine/Source/Core/TaskProcessor.js +++ b/packages/engine/Source/Core/TaskProcessor.js @@ -15,7 +15,7 @@ function canTransferArrayBuffer() { const worker = createWorker("transferTypedArrayTest"); worker.postMessage = defaultValue( worker.webkitPostMessage, - worker.postMessage + worker.postMessage, ); const value = 99; @@ -28,7 +28,7 @@ function canTransferArrayBuffer() { { array: array, }, - [array.buffer] + [array.buffer], ); } catch (e) { TaskProcessor._canTransferArrayBuffer = false; @@ -93,7 +93,7 @@ function createWorker(url) { crossOriginUrl = url; } else if (!isUri) { const moduleAbsoluteUrl = buildModuleUrl( - `${TaskProcessor._workerModulePrefix}/${moduleID}.js` + `${TaskProcessor._workerModulePrefix}/${moduleID}.js`, ); if (isCrossOriginUrl(moduleAbsoluteUrl)) { @@ -124,13 +124,13 @@ function createWorker(url) { if (!isUri) { workerPath = buildModuleUrl( - `${TaskProcessor._workerModulePrefix + moduleID}.js` + `${TaskProcessor._workerModulePrefix + moduleID}.js`, ); } if (!FeatureDetection.supportsEsmWebWorkers()) { throw new RuntimeError( - "This browser is not supported. Please update your browser to continue." + "This browser is not supported. Please update your browser to continue.", ); } @@ -150,7 +150,7 @@ async function getWebAssemblyLoaderConfig(processor, wasmOptions) { if (!FeatureDetection.supportsWebAssembly()) { if (!defined(wasmOptions.fallbackModulePath)) { throw new RuntimeError( - `This browser does not support Web Assembly, and no backup module was provided for ${processor._workerPath}` + `This browser does not support Web Assembly, and no backup module was provided for ${processor._workerPath}`, ); } @@ -186,7 +186,7 @@ function TaskProcessor(workerPath, maximumActiveTasks) { this._workerPath = workerPath; this._maximumActiveTasks = defaultValue( maximumActiveTasks, - Number.POSITIVE_INFINITY + Number.POSITIVE_INFINITY, ); this._activeTasks = 0; this._nextID = 0; @@ -237,7 +237,7 @@ async function runTask(processor, parameters, transferableObjects) { const promise = new Promise((resolve, reject) => { processor._worker.addEventListener( "message", - createOnmessageHandler(processor._worker, id, resolve, reject) + createOnmessageHandler(processor._worker, id, resolve, reject), ); }); @@ -248,7 +248,7 @@ async function runTask(processor, parameters, transferableObjects) { parameters: parameters, canTransferArrayBuffer: canTransfer, }, - transferableObjects + transferableObjects, ); return promise; @@ -295,7 +295,7 @@ async function scheduleTask(processor, parameters, transferableObjects) { */ TaskProcessor.prototype.scheduleTask = function ( parameters, - transferableObjects + transferableObjects, ) { if (!defined(this._worker)) { this._worker = createWorker(this._workerPath); @@ -322,7 +322,7 @@ TaskProcessor.prototype.scheduleTask = function ( * @exception {RuntimeError} This browser does not support Web Assembly, and no backup module was provided */ TaskProcessor.prototype.initWebAssemblyModule = async function ( - webAssemblyOptions + webAssemblyOptions, ) { if (defined(this._webAssemblyPromise)) { return this._webAssemblyPromise; @@ -332,7 +332,7 @@ TaskProcessor.prototype.initWebAssemblyModule = async function ( const worker = (this._worker = createWorker(this._workerPath)); const wasmConfig = await getWebAssemblyLoaderConfig( this, - webAssemblyOptions + webAssemblyOptions, ); const canTransfer = await Promise.resolve(canTransferArrayBuffer()); let transferableObjects; @@ -356,7 +356,7 @@ TaskProcessor.prototype.initWebAssemblyModule = async function ( canTransferArrayBuffer: canTransfer, parameters: { webAssemblyConfig: wasmConfig }, }, - transferableObjects + transferableObjects, ); return promise; diff --git a/packages/engine/Source/Core/TerrainEncoding.js b/packages/engine/Source/Core/TerrainEncoding.js index d688341f25b9..f24e08b018e6 100644 --- a/packages/engine/Source/Core/TerrainEncoding.js +++ b/packages/engine/Source/Core/TerrainEncoding.js @@ -47,7 +47,7 @@ function TerrainEncoding( hasWebMercatorT, hasGeodeticSurfaceNormals, exaggeration, - exaggerationRelativeHeight + exaggerationRelativeHeight, ) { let quantization = TerrainQuantization.NONE; let toENU; @@ -65,7 +65,7 @@ function TerrainEncoding( const dimensions = Cartesian3.subtract( maximum, minimum, - cartesian3DimScratch + cartesian3DimScratch, ); const hDim = maximumHeight - minimumHeight; const maxDim = Math.max(Cartesian3.maximumComponent(dimensions), hDim); @@ -82,7 +82,7 @@ function TerrainEncoding( Matrix4.multiply( Matrix4.fromTranslation(translation, matrix4Scratch), toENU, - toENU + toENU, ); const scale = cartesian3Scratch; @@ -165,7 +165,7 @@ function TerrainEncoding( */ this.hasGeodeticSurfaceNormals = defaultValue( hasGeodeticSurfaceNormals, - false + false, ); /** @@ -179,7 +179,7 @@ function TerrainEncoding( */ this.exaggerationRelativeHeight = defaultValue( exaggerationRelativeHeight, - 0.0 + 0.0, ); /** @@ -203,7 +203,7 @@ TerrainEncoding.prototype.encode = function ( height, normalToPack, webMercatorT, - geodeticSurfaceNormal + geodeticSurfaceNormal, ) { const u = uv.x; const v = uv.y; @@ -212,7 +212,7 @@ TerrainEncoding.prototype.encode = function ( position = Matrix4.multiplyByPoint( this.toScaledENU, position, - cartesian3Scratch + cartesian3Scratch, ); position.x = CesiumMath.clamp(position.x, 0.0, 1.0); @@ -223,19 +223,16 @@ TerrainEncoding.prototype.encode = function ( const h = CesiumMath.clamp((height - this.minimumHeight) / hDim, 0.0, 1.0); Cartesian2.fromElements(position.x, position.y, cartesian2Scratch); - const compressed0 = AttributeCompression.compressTextureCoordinates( - cartesian2Scratch - ); + const compressed0 = + AttributeCompression.compressTextureCoordinates(cartesian2Scratch); Cartesian2.fromElements(position.z, h, cartesian2Scratch); - const compressed1 = AttributeCompression.compressTextureCoordinates( - cartesian2Scratch - ); + const compressed1 = + AttributeCompression.compressTextureCoordinates(cartesian2Scratch); Cartesian2.fromElements(u, v, cartesian2Scratch); - const compressed2 = AttributeCompression.compressTextureCoordinates( - cartesian2Scratch - ); + const compressed2 = + AttributeCompression.compressTextureCoordinates(cartesian2Scratch); vertexBuffer[bufferIndex++] = compressed0; vertexBuffer[bufferIndex++] = compressed1; @@ -243,9 +240,8 @@ TerrainEncoding.prototype.encode = function ( if (this.hasWebMercatorT) { Cartesian2.fromElements(webMercatorT, 0.0, cartesian2Scratch); - const compressed3 = AttributeCompression.compressTextureCoordinates( - cartesian2Scratch - ); + const compressed3 = + AttributeCompression.compressTextureCoordinates(cartesian2Scratch); vertexBuffer[bufferIndex++] = compressed3; } } else { @@ -264,9 +260,8 @@ TerrainEncoding.prototype.encode = function ( } if (this.hasVertexNormals) { - vertexBuffer[bufferIndex++] = AttributeCompression.octPackFloat( - normalToPack - ); + vertexBuffer[bufferIndex++] = + AttributeCompression.octPackFloat(normalToPack); } if (this.hasGeodeticSurfaceNormals) { @@ -284,7 +279,7 @@ const scratchGeodeticSurfaceNormal = new Cartesian3(); TerrainEncoding.prototype.addGeodeticSurfaceNormals = function ( oldBuffer, newBuffer, - ellipsoid + ellipsoid, ) { if (this.hasGeodeticSurfaceNormals) { return; @@ -305,7 +300,7 @@ TerrainEncoding.prototype.addGeodeticSurfaceNormals = function ( const position = this.decodePosition(newBuffer, index, scratchPosition); const geodeticSurfaceNormal = ellipsoid.geodeticSurfaceNormal( position, - scratchGeodeticSurfaceNormal + scratchGeodeticSurfaceNormal, ); const bufferIndex = index * newStride + this._offsetGeodeticSurfaceNormal; @@ -317,7 +312,7 @@ TerrainEncoding.prototype.addGeodeticSurfaceNormals = function ( TerrainEncoding.prototype.removeGeodeticSurfaceNormals = function ( oldBuffer, - newBuffer + newBuffer, ) { if (!this.hasGeodeticSurfaceNormals) { return; @@ -348,14 +343,14 @@ TerrainEncoding.prototype.decodePosition = function (buffer, index, result) { if (this.quantization === TerrainQuantization.BITS12) { const xy = AttributeCompression.decompressTextureCoordinates( buffer[index], - cartesian2Scratch + cartesian2Scratch, ); result.x = xy.x; result.y = xy.y; const zh = AttributeCompression.decompressTextureCoordinates( buffer[index + 1], - cartesian2Scratch + cartesian2Scratch, ); result.z = zh.x; @@ -371,7 +366,7 @@ TerrainEncoding.prototype.decodePosition = function (buffer, index, result) { TerrainEncoding.prototype.getExaggeratedPosition = function ( buffer, index, - result + result, ) { result = this.decodePosition(buffer, index, result); @@ -382,14 +377,14 @@ TerrainEncoding.prototype.getExaggeratedPosition = function ( const geodeticSurfaceNormal = this.decodeGeodeticSurfaceNormal( buffer, index, - scratchGeodeticSurfaceNormal + scratchGeodeticSurfaceNormal, ); const rawHeight = this.decodeHeight(buffer, index); const heightDifference = VerticalExaggeration.getHeight( rawHeight, exaggeration, - exaggerationRelativeHeight + exaggerationRelativeHeight, ) - rawHeight; // some math is unrolled for better performance @@ -404,7 +399,7 @@ TerrainEncoding.prototype.getExaggeratedPosition = function ( TerrainEncoding.prototype.decodeTextureCoordinates = function ( buffer, index, - result + result, ) { if (!defined(result)) { result = new Cartesian2(); @@ -415,7 +410,7 @@ TerrainEncoding.prototype.decodeTextureCoordinates = function ( if (this.quantization === TerrainQuantization.BITS12) { return AttributeCompression.decompressTextureCoordinates( buffer[index + 2], - result + result, ); } @@ -428,7 +423,7 @@ TerrainEncoding.prototype.decodeHeight = function (buffer, index) { if (this.quantization === TerrainQuantization.BITS12) { const zh = AttributeCompression.decompressTextureCoordinates( buffer[index + 1], - cartesian2Scratch + cartesian2Scratch, ); return ( zh.y * (this.maximumHeight - this.minimumHeight) + this.minimumHeight @@ -444,7 +439,7 @@ TerrainEncoding.prototype.decodeWebMercatorT = function (buffer, index) { if (this.quantization === TerrainQuantization.BITS12) { return AttributeCompression.decompressTextureCoordinates( buffer[index + 3], - cartesian2Scratch + cartesian2Scratch, ).x; } @@ -454,7 +449,7 @@ TerrainEncoding.prototype.decodeWebMercatorT = function (buffer, index) { TerrainEncoding.prototype.getOctEncodedNormal = function ( buffer, index, - result + result, ) { index = index * this.stride + this._offsetVertexNormal; @@ -468,7 +463,7 @@ TerrainEncoding.prototype.getOctEncodedNormal = function ( TerrainEncoding.prototype.decodeGeodeticSurfaceNormal = function ( buffer, index, - result + result, ) { index = index * this.stride + this._offsetGeodeticSurfaceNormal; @@ -541,7 +536,7 @@ TerrainEncoding.prototype.getAttributes = function (buffer) { componentsTexCoordAndNormals += this.hasVertexNormals ? 1 : 0; addAttribute( attributesIndicesNone.textureCoordAndEncodedNormals, - componentsTexCoordAndNormals + componentsTexCoordAndNormals, ); if (this.hasGeodeticSurfaceNormals) { @@ -557,7 +552,7 @@ TerrainEncoding.prototype.getAttributes = function (buffer) { this.hasWebMercatorT && this.hasVertexNormals; addAttribute( attributesIndicesBits12.compressed0, - usingAttribute0Component4 ? 4 : 3 + usingAttribute0Component4 ? 4 : 3, ); if (usingAttribute1Component1) { diff --git a/packages/engine/Source/Core/TerrainMesh.js b/packages/engine/Source/Core/TerrainMesh.js index 60a939b5404b..462947d42822 100644 --- a/packages/engine/Source/Core/TerrainMesh.js +++ b/packages/engine/Source/Core/TerrainMesh.js @@ -47,7 +47,7 @@ function TerrainMesh( westIndicesSouthToNorth, southIndicesEastToWest, eastIndicesNorthToSouth, - northIndicesWestToEast + northIndicesWestToEast, ) { /** * The center of the tile. Vertex positions are specified relative to this center. diff --git a/packages/engine/Source/Core/TerrainProvider.js b/packages/engine/Source/Core/TerrainProvider.js index 6478b2eeb3a4..3098fee8b9a6 100644 --- a/packages/engine/Source/Core/TerrainProvider.js +++ b/packages/engine/Source/Core/TerrainProvider.js @@ -105,7 +105,7 @@ TerrainProvider.getRegularGridIndices = function (width, height) { //>>includeStart('debug', pragmas.debug); if (width * height >= CesiumMath.FOUR_GIGABYTES) { throw new DeveloperError( - "The total number of vertices (width * height) must be less than 4,294,967,296." + "The total number of vertices (width * height) must be less than 4,294,967,296.", ); } //>>includeEnd('debug'); @@ -119,11 +119,11 @@ TerrainProvider.getRegularGridIndices = function (width, height) { if (!defined(indices)) { if (width * height < CesiumMath.SIXTY_FOUR_KILOBYTES) { indices = byWidth[height] = new Uint16Array( - (width - 1) * (height - 1) * 6 + (width - 1) * (height - 1) * 6, ); } else { indices = byWidth[height] = new Uint32Array( - (width - 1) * (height - 1) * 6 + (width - 1) * (height - 1) * 6, ); } addRegularGridIndices(width, height, indices, 0); @@ -141,7 +141,7 @@ TerrainProvider.getRegularGridIndicesAndEdgeIndices = function (width, height) { //>>includeStart('debug', pragmas.debug); if (width * height >= CesiumMath.FOUR_GIGABYTES) { throw new DeveloperError( - "The total number of vertices (width * height) must be less than 4,294,967,296." + "The total number of vertices (width * height) must be less than 4,294,967,296.", ); } //>>includeEnd('debug'); @@ -180,12 +180,12 @@ const regularGridAndSkirtAndEdgeIndicesCache = []; */ TerrainProvider.getRegularGridAndSkirtIndicesAndEdgeIndices = function ( width, - height + height, ) { //>>includeStart('debug', pragmas.debug); if (width * height >= CesiumMath.FOUR_GIGABYTES) { throw new DeveloperError( - "The total number of vertices (width * height) must be less than 4,294,967,296." + "The total number of vertices (width * height) must be less than 4,294,967,296.", ); } //>>includeEnd('debug'); @@ -219,7 +219,7 @@ TerrainProvider.getRegularGridAndSkirtIndicesAndEdgeIndices = function ( northIndicesWestToEast, gridVertexCount, indices, - gridIndexCount + gridIndexCount, ); indicesAndEdges = byWidth[height] = { @@ -245,28 +245,28 @@ TerrainProvider.addSkirtIndices = function ( northIndicesWestToEast, vertexCount, indices, - offset + offset, ) { let vertexIndex = vertexCount; offset = addSkirtIndices( westIndicesSouthToNorth, vertexIndex, indices, - offset + offset, ); vertexIndex += westIndicesSouthToNorth.length; offset = addSkirtIndices( southIndicesEastToWest, vertexIndex, indices, - offset + offset, ); vertexIndex += southIndicesEastToWest.length; offset = addSkirtIndices( eastIndicesNorthToSouth, vertexIndex, indices, - offset + offset, ); vertexIndex += eastIndicesNorthToSouth.length; addSkirtIndices(northIndicesWestToEast, vertexIndex, indices, offset); @@ -362,7 +362,7 @@ TerrainProvider.heightmapTerrainQuality = 0.25; TerrainProvider.getEstimatedLevelZeroGeometricErrorForAHeightmap = function ( ellipsoid, tileImageWidth, - numberOfTilesAtLevelZero + numberOfTilesAtLevelZero, ) { return ( (ellipsoid.maximumRadius * diff --git a/packages/engine/Source/Core/TileAvailability.js b/packages/engine/Source/Core/TileAvailability.js index 0a6a74a3eed7..09c58979775c 100644 --- a/packages/engine/Source/Core/TileAvailability.js +++ b/packages/engine/Source/Core/TileAvailability.js @@ -48,7 +48,7 @@ TileAvailability.prototype.addAvailableTileRange = function ( startX, startY, endX, - endY + endY, ) { const tilingScheme = this._tilingScheme; @@ -76,7 +76,7 @@ TileAvailability.prototype.addAvailableTileRange = function ( west, south, east, - north + north, ); for (let i = 0; i < rootNodes.length; ++i) { @@ -130,7 +130,7 @@ const eastScratch = new Rectangle(); * @return {number} The best available level for the entire rectangle. */ TileAvailability.prototype.computeBestAvailableLevelOverRectangle = function ( - rectangle + rectangle, ) { const rectangles = rectanglesScratch; rectangles.length = 0; @@ -143,8 +143,8 @@ TileAvailability.prototype.computeBestAvailableLevelOverRectangle = function ( rectangle.south, rectangle.east, rectangle.north, - westScratch - ) + westScratch, + ), ); rectangles.push( Rectangle.fromRadians( @@ -152,8 +152,8 @@ TileAvailability.prototype.computeBestAvailableLevelOverRectangle = function ( rectangle.south, Math.PI, rectangle.north, - eastScratch - ) + eastScratch, + ), ); } else { rectangles.push(rectangle); @@ -167,7 +167,7 @@ TileAvailability.prototype.computeBestAvailableLevelOverRectangle = function ( updateCoverageWithNode( remainingToCoverByLevel, this._rootNodes[i], - rectangles + rectangles, ); } @@ -202,7 +202,7 @@ TileAvailability.prototype.isTileAvailable = function (level, x, y) { x, y, level, - rectangleScratch + rectangleScratch, ); Rectangle.center(rectangle, cartographicScratch); return this.computeMaximumLevelAtPosition(cartographicScratch) >= level; @@ -265,7 +265,7 @@ Object.defineProperties(QuadtreeNode.prototype, { this, this.level + 1, this.x * 2, - this.y * 2 + this.y * 2, ); } return this._nw; @@ -280,7 +280,7 @@ Object.defineProperties(QuadtreeNode.prototype, { this, this.level + 1, this.x * 2 + 1, - this.y * 2 + this.y * 2, ); } return this._ne; @@ -295,7 +295,7 @@ Object.defineProperties(QuadtreeNode.prototype, { this, this.level + 1, this.x * 2, - this.y * 2 + 1 + this.y * 2 + 1, ); } return this._sw; @@ -310,7 +310,7 @@ Object.defineProperties(QuadtreeNode.prototype, { this, this.level + 1, this.x * 2 + 1, - this.y * 2 + 1 + this.y * 2 + 1, ); } return this._se; @@ -359,7 +359,7 @@ function putRectangleInQuadtree(maxDepth, node, rectangle) { let index = binarySearch( node.rectangles, rectangle.level, - rectangleLevelComparator + rectangleLevelComparator, ); if (index < 0) { index = ~index; @@ -408,25 +408,25 @@ function findMaxLevelFromNode(stopNode, node, position) { if (nw) { maxLevel = Math.max( maxLevel, - findMaxLevelFromNode(node, node._nw, position) + findMaxLevelFromNode(node, node._nw, position), ); } if (ne) { maxLevel = Math.max( maxLevel, - findMaxLevelFromNode(node, node._ne, position) + findMaxLevelFromNode(node, node._ne, position), ); } if (sw) { maxLevel = Math.max( maxLevel, - findMaxLevelFromNode(node, node._sw, position) + findMaxLevelFromNode(node, node._sw, position), ); } if (se) { maxLevel = Math.max( maxLevel, - findMaxLevelFromNode(node, node._se, position) + findMaxLevelFromNode(node, node._se, position), ); } break; @@ -468,7 +468,7 @@ function findMaxLevelFromNode(stopNode, node, position) { function updateCoverageWithNode( remainingToCoverByLevel, node, - rectanglesToCover + rectanglesToCover, ) { if (!node) { return; @@ -496,7 +496,7 @@ function updateCoverageWithNode( remainingToCoverByLevel[rectangle.level] = subtractRectangle( remainingToCoverByLevel[rectangle.level], - rectangle + rectangle, ); } @@ -522,8 +522,8 @@ function subtractRectangle(rectangleList, rectangleToSubtract) { rectangle.west, rectangle.south, rectangleToSubtract.west, - rectangle.north - ) + rectangle.north, + ), ); } if (rectangle.east > rectangleToSubtract.east) { @@ -532,8 +532,8 @@ function subtractRectangle(rectangleList, rectangleToSubtract) { rectangleToSubtract.east, rectangle.south, rectangle.east, - rectangle.north - ) + rectangle.north, + ), ); } if (rectangle.south < rectangleToSubtract.south) { @@ -542,8 +542,8 @@ function subtractRectangle(rectangleList, rectangleToSubtract) { Math.max(rectangleToSubtract.west, rectangle.west), rectangle.south, Math.min(rectangleToSubtract.east, rectangle.east), - rectangleToSubtract.south - ) + rectangleToSubtract.south, + ), ); } if (rectangle.north > rectangleToSubtract.north) { @@ -552,8 +552,8 @@ function subtractRectangle(rectangleList, rectangleToSubtract) { Math.max(rectangleToSubtract.west, rectangle.west), rectangleToSubtract.north, Math.min(rectangleToSubtract.east, rectangle.east), - rectangle.north - ) + rectangle.north, + ), ); } } diff --git a/packages/engine/Source/Core/TileProviderError.js b/packages/engine/Source/Core/TileProviderError.js index 97fd0320dcb3..f549689e47c9 100644 --- a/packages/engine/Source/Core/TileProviderError.js +++ b/packages/engine/Source/Core/TileProviderError.js @@ -26,7 +26,7 @@ function TileProviderError( y, level, timesRetried, - error + error, ) { /** * The {@link ImageryProvider} or {@link TerrainProvider} that experienced the error. @@ -114,7 +114,7 @@ TileProviderError.reportError = function ( x, y, level, - errorDetails + errorDetails, ) { let error = previousError; if (!defined(previousError)) { @@ -125,7 +125,7 @@ TileProviderError.reportError = function ( y, level, 0, - errorDetails + errorDetails, ); } else { error.provider = provider; @@ -143,8 +143,8 @@ TileProviderError.reportError = function ( } else if (defined(provider)) { console.log( `An error occurred in "${provider.constructor.name}": ${formatError( - message - )}` + message, + )}`, ); } diff --git a/packages/engine/Source/Core/TilingScheme.js b/packages/engine/Source/Core/TilingScheme.js index 7429de380a95..f9bc9fb07f04 100644 --- a/packages/engine/Source/Core/TilingScheme.js +++ b/packages/engine/Source/Core/TilingScheme.js @@ -16,7 +16,7 @@ import DeveloperError from "./DeveloperError.js"; function TilingScheme(options) { //>>includeStart('debug', pragmas.debug); throw new DeveloperError( - "This type should not be instantiated directly. Instead, use WebMercatorTilingScheme or GeographicTilingScheme." + "This type should not be instantiated directly. Instead, use WebMercatorTilingScheme or GeographicTilingScheme.", ); //>>includeEnd('debug'); } diff --git a/packages/engine/Source/Core/TimeInterval.js b/packages/engine/Source/Core/TimeInterval.js index 6350ce23ca35..03b0a19f0840 100644 --- a/packages/engine/Source/Core/TimeInterval.js +++ b/packages/engine/Source/Core/TimeInterval.js @@ -145,7 +145,7 @@ TimeInterval.fromIso8601 = function (options, result) { const dates = options.iso8601.split("/"); if (dates.length !== 2) { throw new DeveloperError( - "options.iso8601 is an invalid ISO 8601 interval." + "options.iso8601 is an invalid ISO 8601 interval.", ); } const start = JulianDate.fromIso8601(dates[0]); @@ -185,7 +185,7 @@ TimeInterval.toIso8601 = function (timeInterval, precision) { return `${JulianDate.toIso8601( timeInterval.start, - precision + precision, )}/${JulianDate.toIso8601(timeInterval.stop, precision)}`; }; @@ -345,7 +345,7 @@ TimeInterval.contains = function (timeInterval, julianDate) { const startComparedToDate = JulianDate.compare( timeInterval.start, - julianDate + julianDate, ); if (startComparedToDate === 0) { return timeInterval.isStartIncluded; @@ -416,7 +416,7 @@ TimeInterval.EMPTY = Object.freeze( stop: new JulianDate(), isStartIncluded: false, isStopIncluded: false, - }) + }), ); /** diff --git a/packages/engine/Source/Core/TimeIntervalCollection.js b/packages/engine/Source/Core/TimeIntervalCollection.js index 0d17ace07214..36af68c8dec9 100644 --- a/packages/engine/Source/Core/TimeIntervalCollection.js +++ b/packages/engine/Source/Core/TimeIntervalCollection.js @@ -197,7 +197,7 @@ TimeIntervalCollection.prototype.findIntervalContainingDate = function (date) { * @returns {object} The data for the interval containing the specified date, or undefined if no such interval exists. */ TimeIntervalCollection.prototype.findDataForIntervalContainingDate = function ( - date + date, ) { const index = this.indexOf(date); return index >= 0 ? this._intervals[index].data : undefined; @@ -237,7 +237,7 @@ TimeIntervalCollection.prototype.indexOf = function (date) { let index = binarySearch( intervals, indexOfScratch, - compareIntervalStartTimes + compareIntervalStartTimes, ); if (index >= 0) { if (intervals[index].isStartIncluded) { @@ -309,7 +309,7 @@ TimeIntervalCollection.prototype.findInterval = function (options) { */ TimeIntervalCollection.prototype.addInterval = function ( interval, - dataComparer + dataComparer, ) { //>>includeStart('debug', pragmas.debug); if (!defined(interval)) { @@ -409,7 +409,7 @@ TimeIntervalCollection.prototype.addInterval = function ( // split the existing interval into two intervals. comparison = JulianDate.compare( intervals[index - 1].stop, - interval.stop + interval.stop, ); if ( comparison > 0 || @@ -426,7 +426,7 @@ TimeIntervalCollection.prototype.addInterval = function ( isStartIncluded: !interval.isStopIncluded, isStopIncluded: intervals[index - 1].isStopIncluded, data: intervals[index - 1].data, - }) + }), ); } intervals[index - 1] = new TimeInterval({ @@ -463,7 +463,7 @@ TimeIntervalCollection.prototype.addInterval = function ( isStartIncluded: interval.isStartIncluded, isStopIncluded: JulianDate.greaterThan( intervals[index].stop, - interval.stop + interval.stop, ) ? intervals[index].isStopIncluded : interval.isStopIncluded, @@ -553,7 +553,7 @@ TimeIntervalCollection.prototype.removeInterval = function (interval) { isStartIncluded: !interval.isStopIncluded, isStopIncluded: intervals[index - 1].isStopIncluded, data: intervals[index - 1].data, - }) + }), ); } intervals[index - 1] = new TimeInterval({ @@ -584,7 +584,7 @@ TimeIntervalCollection.prototype.removeInterval = function (interval) { isStartIncluded: true, isStopIncluded: true, data: intervals[index].data, - }) + }), ); ++index; } @@ -671,7 +671,7 @@ TimeIntervalCollection.prototype.removeInterval = function (interval) { TimeIntervalCollection.prototype.intersect = function ( other, dataComparer, - mergeCallback + mergeCallback, ) { //>>includeStart('debug', pragmas.debug); if (!defined(other)) { @@ -704,7 +704,7 @@ TimeIntervalCollection.prototype.intersect = function ( leftInterval, rightInterval, new TimeInterval(), - mergeCallback + mergeCallback, ); if (!intersection.isEmpty) { // Since we start with an empty collection for 'result', and there are no overlapping intervals in 'this' (as a rule), @@ -893,7 +893,8 @@ function addToDate(julianDate, duration, result) { } const scratchJulianDate = new JulianDate(); -const durationRegex = /P(?:([\d.,]+)Y)?(?:([\d.,]+)M)?(?:([\d.,]+)W)?(?:([\d.,]+)D)?(?:T(?:([\d.,]+)H)?(?:([\d.,]+)M)?(?:([\d.,]+)S)?)?/; +const durationRegex = + /P(?:([\d.,]+)Y)?(?:([\d.,]+)M)?(?:([\d.,]+)W)?(?:([\d.,]+)D)?(?:T(?:([\d.,]+)H)?(?:([\d.,]+)M)?(?:([\d.,]+)S)?)?/; /** * Parses ISO8601 duration string @@ -961,7 +962,7 @@ function parseDuration(iso8601, result) { } JulianDate.toGregorianDate( JulianDate.fromIso8601(iso8601, scratchJulianDate), - result + result, ); } @@ -1031,7 +1032,7 @@ TimeIntervalCollection.fromIso8601 = function (options, result) { trailingInterval: options.trailingInterval, dataCallback: options.dataCallback, }, - result + result, ); }; @@ -1069,7 +1070,7 @@ TimeIntervalCollection.fromIso8601DateArray = function (options, result) { trailingInterval: options.trailingInterval, dataCallback: options.dataCallback, }, - result + result, ); }; @@ -1130,7 +1131,7 @@ TimeIntervalCollection.fromIso8601DurationArray = function (options, result) { trailingInterval: options.trailingInterval, dataCallback: options.dataCallback, }, - result + result, ); }; export default TimeIntervalCollection; diff --git a/packages/engine/Source/Core/Tipsify.js b/packages/engine/Source/Core/Tipsify.js index d40e9ac5cfa7..43c0a831dbf6 100644 --- a/packages/engine/Source/Core/Tipsify.js +++ b/packages/engine/Source/Core/Tipsify.js @@ -152,7 +152,7 @@ Tipsify.tipsify = function (options) { vertices, s, deadEnd, - maximumIndexPlusOne + maximumIndexPlusOne, ) { let n = -1; let p; @@ -305,7 +305,7 @@ Tipsify.tipsify = function (options) { vertices, s, deadEnd, - maximumIndexPlusOne + maximumIndexPlusOne, ); } diff --git a/packages/engine/Source/Core/Transforms.js b/packages/engine/Source/Core/Transforms.js index faae113b1d2d..9aad9ff17ef1 100644 --- a/packages/engine/Source/Core/Transforms.js +++ b/packages/engine/Source/Core/Transforms.js @@ -103,7 +103,7 @@ Transforms.localFrameToFixedFrameGenerator = function (firstAxis, secondAxis) { !vectorProductLocalFrame[firstAxis].hasOwnProperty(secondAxis) ) { throw new DeveloperError( - "firstAxis and secondAxis must be east, north, up, west, south or down." + "firstAxis and secondAxis must be east, north, up, west, south or down.", ); } const thirdAxis = vectorProductLocalFrame[firstAxis][secondAxis]; @@ -141,17 +141,17 @@ Transforms.localFrameToFixedFrameGenerator = function (firstAxis, secondAxis) { Cartesian3.unpack( degeneratePositionLocalFrame[firstAxis], 0, - scratchFirstCartesian + scratchFirstCartesian, ); Cartesian3.unpack( degeneratePositionLocalFrame[secondAxis], 0, - scratchSecondCartesian + scratchSecondCartesian, ); Cartesian3.unpack( degeneratePositionLocalFrame[thirdAxis], 0, - scratchThirdCartesian + scratchThirdCartesian, ); } else if ( CesiumMath.equalsEpsilon(origin.x, 0.0, CesiumMath.EPSILON14) && @@ -163,39 +163,39 @@ Transforms.localFrameToFixedFrameGenerator = function (firstAxis, secondAxis) { Cartesian3.unpack( degeneratePositionLocalFrame[firstAxis], 0, - scratchFirstCartesian + scratchFirstCartesian, ); if (firstAxis !== "east" && firstAxis !== "west") { Cartesian3.multiplyByScalar( scratchFirstCartesian, sign, - scratchFirstCartesian + scratchFirstCartesian, ); } Cartesian3.unpack( degeneratePositionLocalFrame[secondAxis], 0, - scratchSecondCartesian + scratchSecondCartesian, ); if (secondAxis !== "east" && secondAxis !== "west") { Cartesian3.multiplyByScalar( scratchSecondCartesian, sign, - scratchSecondCartesian + scratchSecondCartesian, ); } Cartesian3.unpack( degeneratePositionLocalFrame[thirdAxis], 0, - scratchThirdCartesian + scratchThirdCartesian, ); if (thirdAxis !== "east" && thirdAxis !== "west") { Cartesian3.multiplyByScalar( scratchThirdCartesian, sign, - scratchThirdCartesian + scratchThirdCartesian, ); } } else { @@ -213,17 +213,17 @@ Transforms.localFrameToFixedFrameGenerator = function (firstAxis, secondAxis) { Cartesian3.multiplyByScalar( scratchCalculateCartesian.up, -1, - scratchCalculateCartesian.down + scratchCalculateCartesian.down, ); Cartesian3.multiplyByScalar( scratchCalculateCartesian.east, -1, - scratchCalculateCartesian.west + scratchCalculateCartesian.west, ); Cartesian3.multiplyByScalar( scratchCalculateCartesian.north, -1, - scratchCalculateCartesian.south + scratchCalculateCartesian.south, ); scratchFirstCartesian = scratchCalculateCartesian[firstAxis]; @@ -276,7 +276,7 @@ Transforms.localFrameToFixedFrameGenerator = function (firstAxis, secondAxis) { */ Transforms.eastNorthUpToFixedFrame = Transforms.localFrameToFixedFrameGenerator( "east", - "north" + "north", ); /** @@ -300,10 +300,8 @@ Transforms.eastNorthUpToFixedFrame = Transforms.localFrameToFixedFrameGenerator( * const center = Cesium.Cartesian3.fromDegrees(0.0, 0.0); * const transform = Cesium.Transforms.northEastDownToFixedFrame(center); */ -Transforms.northEastDownToFixedFrame = Transforms.localFrameToFixedFrameGenerator( - "north", - "east" -); +Transforms.northEastDownToFixedFrame = + Transforms.localFrameToFixedFrameGenerator("north", "east"); /** * Computes a 4x4 transformation matrix from a reference frame with an north-up-east axes @@ -328,7 +326,7 @@ Transforms.northEastDownToFixedFrame = Transforms.localFrameToFixedFrameGenerato */ Transforms.northUpEastToFixedFrame = Transforms.localFrameToFixedFrameGenerator( "north", - "up" + "up", ); /** @@ -354,7 +352,7 @@ Transforms.northUpEastToFixedFrame = Transforms.localFrameToFixedFrameGenerator( */ Transforms.northWestUpToFixedFrame = Transforms.localFrameToFixedFrameGenerator( "north", - "west" + "west", ); const scratchHPRQuaternion = new Quaternion(); @@ -389,7 +387,7 @@ Transforms.headingPitchRollToFixedFrame = function ( headingPitchRoll, ellipsoid, fixedFrameTransform, - result + result, ) { //>>includeStart('debug', pragmas.debug); Check.typeOf.object("HeadingPitchRoll", headingPitchRoll); @@ -397,17 +395,17 @@ Transforms.headingPitchRollToFixedFrame = function ( fixedFrameTransform = defaultValue( fixedFrameTransform, - Transforms.eastNorthUpToFixedFrame + Transforms.eastNorthUpToFixedFrame, ); const hprQuaternion = Quaternion.fromHeadingPitchRoll( headingPitchRoll, - scratchHPRQuaternion + scratchHPRQuaternion, ); const hprMatrix = Matrix4.fromTranslationQuaternionRotationScale( Cartesian3.ZERO, hprQuaternion, scratchScale, - scratchHPRMatrix4 + scratchHPRMatrix4, ); result = fixedFrameTransform(origin, ellipsoid, result); return Matrix4.multiply(result, hprMatrix, result); @@ -444,7 +442,7 @@ Transforms.headingPitchRollQuaternion = function ( headingPitchRoll, ellipsoid, fixedFrameTransform, - result + result, ) { //>>includeStart('debug', pragmas.debug); Check.typeOf.object("HeadingPitchRoll", headingPitchRoll); @@ -455,7 +453,7 @@ Transforms.headingPitchRollQuaternion = function ( headingPitchRoll, ellipsoid, fixedFrameTransform, - scratchENUMatrix4 + scratchENUMatrix4, ); const rotation = Matrix4.getMatrix3(transform, scratchHPRMatrix3); return Quaternion.fromRotationMatrix(rotation, result); @@ -483,7 +481,7 @@ Transforms.fixedFrameToHeadingPitchRoll = function ( transform, ellipsoid, fixedFrameTransform, - result + result, ) { //>>includeStart('debug', pragmas.debug); Check.defined("transform", transform); @@ -492,7 +490,7 @@ Transforms.fixedFrameToHeadingPitchRoll = function ( ellipsoid = defaultValue(ellipsoid, Ellipsoid.default); fixedFrameTransform = defaultValue( fixedFrameTransform, - Transforms.eastNorthUpToFixedFrame + Transforms.eastNorthUpToFixedFrame, ); if (!defined(result)) { result = new HeadingPitchRoll(); @@ -507,23 +505,23 @@ Transforms.fixedFrameToHeadingPitchRoll = function ( } let toFixedFrame = Matrix4.inverseTransformation( fixedFrameTransform(center, ellipsoid, ffScratch), - ffScratch + ffScratch, ); let transformCopy = Matrix4.setScale(transform, noScale, hprTransformScratch); transformCopy = Matrix4.setTranslation( transformCopy, Cartesian3.ZERO, - transformCopy + transformCopy, ); toFixedFrame = Matrix4.multiply(toFixedFrame, transformCopy, toFixedFrame); let quaternionRotation = Quaternion.fromRotationMatrix( Matrix4.getMatrix3(toFixedFrame, hprRotationScratch), - hprQuaternionScratch + hprQuaternionScratch, ); quaternionRotation = Quaternion.normalize( quaternionRotation, - quaternionRotation + quaternionRotation, ); return HeadingPitchRoll.fromQuaternion(quaternionRotation, result); @@ -600,7 +598,7 @@ Transforms.computeTemeToPseudoFixedMatrix = function (date, result) { dateInUtc = JulianDate.addSeconds( date, -JulianDate.computeTaiMinusUtc(date), - dateInUtc + dateInUtc, ); const utcDayNumber = dateInUtc.dayNumber; const utcSecondsIntoDay = dateInUtc.secondsOfDay; @@ -635,7 +633,7 @@ Transforms.computeTemeToPseudoFixedMatrix = function (date, result) { 0.0, 0.0, 0.0, - 1.0 + 1.0, ); } result[0] = cosGha; @@ -707,7 +705,7 @@ Transforms.preloadIcrfFixed = function (timeInterval) { startDayTT, startSecondTT, stopDayTT, - stopSecondTT + stopSecondTT, ); }; @@ -868,7 +866,7 @@ const eopScratch = new EarthOrientationParametersSample( 0.0, 0.0, 0.0, - 0.0 + 0.0, ); const rotation1Scratch = new Matrix3(); const rotation2Scratch = new Matrix3(); @@ -926,7 +924,7 @@ Transforms.computeFixedToIcrfMatrix = function (date, result) { const xys = Transforms.iau2006XysData.computeXysRadians( dayTT, secondTT, - xysScratch + xysScratch, ); if (!defined(xys)) { return undefined; @@ -1025,13 +1023,13 @@ Transforms.pointToWindowCoordinates = function ( modelViewProjectionMatrix, viewportTransformation, point, - result + result, ) { result = Transforms.pointToGLWindowCoordinates( modelViewProjectionMatrix, viewportTransformation, point, - result + result, ); result.y = 2.0 * viewportTransformation[5] - result.y; return result; @@ -1044,7 +1042,7 @@ Transforms.pointToGLWindowCoordinates = function ( modelViewProjectionMatrix, viewportTransformation, point, - result + result, ) { //>>includeStart('debug', pragmas.debug); if (!defined(modelViewProjectionMatrix)) { @@ -1069,7 +1067,7 @@ Transforms.pointToGLWindowCoordinates = function ( Matrix4.multiplyByVector( modelViewProjectionMatrix, Cartesian4.fromElements(point.x, point.y, point.z, 1, tmp), - tmp + tmp, ); Cartesian4.multiplyByScalar(tmp, 1.0 / tmp.w, tmp); Matrix4.multiplyByVector(viewportTransformation, tmp, tmp); @@ -1093,7 +1091,7 @@ Transforms.rotationMatrixFromPositionVelocity = function ( position, velocity, ellipsoid, - result + result, ) { //>>includeStart('debug', pragmas.debug); if (!defined(position)) { @@ -1107,7 +1105,7 @@ Transforms.rotationMatrixFromPositionVelocity = function ( const normal = defaultValue( ellipsoid, - Ellipsoid.default + Ellipsoid.default, ).geodeticSurfaceNormal(position, normalScratch); let right = Cartesian3.cross(velocity, normal, rightScratch); @@ -1154,7 +1152,7 @@ const swizzleMatrix = new Matrix4( 0.0, 0.0, 0.0, - 1.0 + 1.0, ); const scratchCartographic = new Cartographic(); @@ -1187,24 +1185,24 @@ Transforms.basisTo2D = function (projection, matrix, result) { if (Cartesian3.equals(rtcCenter, Cartesian3.ZERO)) { projectedPosition = Cartesian3.clone( Cartesian3.ZERO, - scratchCartesian3Projection + scratchCartesian3Projection, ); } else { // Get the 2D Center const cartographic = ellipsoid.cartesianToCartographic( rtcCenter, - scratchCartographic + scratchCartographic, ); projectedPosition = projection.project( cartographic, - scratchCartesian3Projection + scratchCartesian3Projection, ); Cartesian3.fromElements( projectedPosition.z, projectedPosition.x, projectedPosition.y, - projectedPosition + projectedPosition, ); } @@ -1212,7 +1210,7 @@ Transforms.basisTo2D = function (projection, matrix, result) { const fromENU = Transforms.eastNorthUpToFixedFrame( rtcCenter, ellipsoid, - scratchFromENU + scratchFromENU, ); const toENU = Matrix4.inverseTransformation(fromENU, scratchToENU); const rotation = Matrix4.getMatrix3(matrix, scratchRotation); @@ -1244,28 +1242,28 @@ Transforms.ellipsoidTo2DModelMatrix = function (projection, center, result) { const fromENU = Transforms.eastNorthUpToFixedFrame( center, ellipsoid, - scratchFromENU + scratchFromENU, ); const toENU = Matrix4.inverseTransformation(fromENU, scratchToENU); const cartographic = ellipsoid.cartesianToCartographic( center, - scratchCartographic + scratchCartographic, ); const projectedPosition = projection.project( cartographic, - scratchCartesian3Projection + scratchCartesian3Projection, ); Cartesian3.fromElements( projectedPosition.z, projectedPosition.x, projectedPosition.y, - projectedPosition + projectedPosition, ); const translation = Matrix4.fromTranslation( projectedPosition, - scratchFromENU + scratchFromENU, ); Matrix4.multiply(swizzleMatrix, toENU, result); Matrix4.multiply(translation, result, result); diff --git a/packages/engine/Source/Core/TranslationRotationScale.js b/packages/engine/Source/Core/TranslationRotationScale.js index f3ce144596a3..16047008bc6f 100644 --- a/packages/engine/Source/Core/TranslationRotationScale.js +++ b/packages/engine/Source/Core/TranslationRotationScale.js @@ -23,7 +23,7 @@ function TranslationRotationScale(translation, rotation, scale) { * @default Cartesian3.ZERO */ this.translation = Cartesian3.clone( - defaultValue(translation, defaultTranslation) + defaultValue(translation, defaultTranslation), ); /** diff --git a/packages/engine/Source/Core/TridiagonalSystemSolver.js b/packages/engine/Source/Core/TridiagonalSystemSolver.js index b53dabc7e3e4..9291b96c0e8b 100644 --- a/packages/engine/Source/Core/TridiagonalSystemSolver.js +++ b/packages/engine/Source/Core/TridiagonalSystemSolver.js @@ -61,7 +61,7 @@ TridiagonalSystemSolver.solve = function (lower, diagonal, upper, right) { throw new DeveloperError("lower and upper must have the same lengths."); } else if (lower.length !== diagonal.length - 1) { throw new DeveloperError( - "lower and upper must be one less than the length of diagonal." + "lower and upper must be one less than the length of diagonal.", ); } //>>includeEnd('debug'); @@ -86,7 +86,7 @@ TridiagonalSystemSolver.solve = function (lower, diagonal, upper, right) { d[i] = Cartesian3.subtract( right[i], Cartesian3.multiplyByScalar(d[i - 1], lower[i - 1], d[i]), - d[i] + d[i], ); d[i] = Cartesian3.multiplyByScalar(d[i], scalar, d[i]); } @@ -95,7 +95,7 @@ TridiagonalSystemSolver.solve = function (lower, diagonal, upper, right) { d[i] = Cartesian3.subtract( right[i], Cartesian3.multiplyByScalar(d[i - 1], lower[i - 1], d[i]), - d[i] + d[i], ); d[i] = Cartesian3.multiplyByScalar(d[i], scalar, d[i]); @@ -104,7 +104,7 @@ TridiagonalSystemSolver.solve = function (lower, diagonal, upper, right) { x[i] = Cartesian3.subtract( d[i], Cartesian3.multiplyByScalar(x[i + 1], c[i], x[i]), - x[i] + x[i], ); } diff --git a/packages/engine/Source/Core/VRTheWorldTerrainProvider.js b/packages/engine/Source/Core/VRTheWorldTerrainProvider.js index 8c38ee906e8c..c25b7312202a 100644 --- a/packages/engine/Source/Core/VRTheWorldTerrainProvider.js +++ b/packages/engine/Source/Core/VRTheWorldTerrainProvider.js @@ -49,7 +49,8 @@ TerrainProviderBuilder.prototype.build = function (provider) { provider._tilingScheme = this.tilingScheme; provider._heightmapWidth = this.heightmapWidth; provider._heightmapHeight = this.heightmapHeight; - provider._levelZeroMaximumGeometricError = this.levelZeroMaximumGeometricError; + provider._levelZeroMaximumGeometricError = + this.levelZeroMaximumGeometricError; provider._rectangles = this.rectangles; }; @@ -66,20 +67,21 @@ function metadataSuccess(terrainProviderBuilder, xml) { const tileFormat = xml.getElementsByTagName("TileFormat")[0]; terrainProviderBuilder.heightmapWidth = parseInt( tileFormat.getAttribute("width"), - 10 + 10, ); terrainProviderBuilder.heightmapHeight = parseInt( tileFormat.getAttribute("height"), - 10 - ); - terrainProviderBuilder.levelZeroMaximumGeometricError = TerrainProvider.getEstimatedLevelZeroGeometricErrorForAHeightmap( - terrainProviderBuilder.ellipsoid, - Math.min( - terrainProviderBuilder.heightmapWidth, - terrainProviderBuilder.heightmapHeight - ), - terrainProviderBuilder.tilingScheme.getNumberOfXTilesAtLevel(0) + 10, ); + terrainProviderBuilder.levelZeroMaximumGeometricError = + TerrainProvider.getEstimatedLevelZeroGeometricErrorForAHeightmap( + terrainProviderBuilder.ellipsoid, + Math.min( + terrainProviderBuilder.heightmapWidth, + terrainProviderBuilder.heightmapHeight, + ), + terrainProviderBuilder.tilingScheme.getNumberOfXTilesAtLevel(0), + ); const dataRectangles = xml.getElementsByTagName("DataExtent"); @@ -87,21 +89,21 @@ function metadataSuccess(terrainProviderBuilder, xml) { const dataRectangle = dataRectangles[i]; const west = CesiumMath.toRadians( - parseFloat(dataRectangle.getAttribute("minx")) + parseFloat(dataRectangle.getAttribute("minx")), ); const south = CesiumMath.toRadians( - parseFloat(dataRectangle.getAttribute("miny")) + parseFloat(dataRectangle.getAttribute("miny")), ); const east = CesiumMath.toRadians( - parseFloat(dataRectangle.getAttribute("maxx")) + parseFloat(dataRectangle.getAttribute("maxx")), ); const north = CesiumMath.toRadians( - parseFloat(dataRectangle.getAttribute("maxy")) + parseFloat(dataRectangle.getAttribute("maxy")), ); const maxLevel = parseInt(dataRectangle.getAttribute("maxlevel"), 10); terrainProviderBuilder.rectangles.push( - new DataRectangle(new Rectangle(west, south, east, north), maxLevel) + new DataRectangle(new Rectangle(west, south, east, north), maxLevel), ); } } @@ -117,7 +119,7 @@ function metadataFailure(resource, error, provider) { undefined, provider, defined(provider) ? provider._errorEvent : undefined, - message + message, ); throw new RuntimeError(message); @@ -310,7 +312,7 @@ VRTheWorldTerrainProvider.prototype.requestTileGeometry = function ( x, y, level, - request + request, ) { const yTiles = this._tilingScheme.getNumberOfYTilesAtLevel(level); const resource = this._resource.getDerivedResource({ @@ -346,7 +348,7 @@ VRTheWorldTerrainProvider.prototype.requestTileGeometry = function ( * @returns {number} The maximum geometric error. */ VRTheWorldTerrainProvider.prototype.getLevelMaximumGeometricError = function ( - level + level, ) { return this._levelZeroMaximumGeometricError / (1 << level); }; @@ -371,7 +373,7 @@ function getChildMask(provider, x, y, level) { const intersection = Rectangle.intersection( testRectangle, parentRectangle, - rectangleScratch + rectangleScratch, ); if (defined(intersection)) { // Parent tile is inside this rectangle, so at least one child is, too. @@ -386,7 +388,7 @@ function getChildMask(provider, x, y, level) { testRectangle, x * 2 + 1, y * 2, - level + 1 + level + 1, ) ) { childMask |= 8; // northeast @@ -397,7 +399,7 @@ function getChildMask(provider, x, y, level) { testRectangle, x * 2, y * 2 + 1, - level + 1 + level + 1, ) ) { childMask |= 1; // southwest @@ -408,7 +410,7 @@ function getChildMask(provider, x, y, level) { testRectangle, x * 2 + 1, y * 2 + 1, - level + 1 + level + 1, ) ) { childMask |= 2; // southeast @@ -422,7 +424,7 @@ function getChildMask(provider, x, y, level) { function isTileInRectangle(tilingScheme, rectangle, x, y, level) { const tileRectangle = tilingScheme.tileXYToRectangle(x, y, level); return defined( - Rectangle.intersection(tileRectangle, rectangle, rectangleScratch) + Rectangle.intersection(tileRectangle, rectangle, rectangleScratch), ); } @@ -437,7 +439,7 @@ function isTileInRectangle(tilingScheme, rectangle, x, y, level) { VRTheWorldTerrainProvider.prototype.getTileDataAvailable = function ( x, y, - level + level, ) { return undefined; }; @@ -453,7 +455,7 @@ VRTheWorldTerrainProvider.prototype.getTileDataAvailable = function ( VRTheWorldTerrainProvider.prototype.loadTileDataAvailability = function ( x, y, - level + level, ) { return undefined; }; diff --git a/packages/engine/Source/Core/VertexFormat.js b/packages/engine/Source/Core/VertexFormat.js index 9754d06ba676..b1fd436fb0d3 100644 --- a/packages/engine/Source/Core/VertexFormat.js +++ b/packages/engine/Source/Core/VertexFormat.js @@ -109,7 +109,7 @@ function VertexFormat(options) { VertexFormat.POSITION_ONLY = Object.freeze( new VertexFormat({ position: true, - }) + }), ); /** @@ -126,7 +126,7 @@ VertexFormat.POSITION_AND_NORMAL = Object.freeze( new VertexFormat({ position: true, normal: true, - }) + }), ); /** @@ -146,7 +146,7 @@ VertexFormat.POSITION_NORMAL_AND_ST = Object.freeze( position: true, normal: true, st: true, - }) + }), ); /** @@ -163,7 +163,7 @@ VertexFormat.POSITION_AND_ST = Object.freeze( new VertexFormat({ position: true, st: true, - }) + }), ); /** @@ -179,7 +179,7 @@ VertexFormat.POSITION_AND_COLOR = Object.freeze( new VertexFormat({ position: true, color: true, - }) + }), ); /** @@ -201,7 +201,7 @@ VertexFormat.ALL = Object.freeze( st: true, tangent: true, bitangent: true, - }) + }), ); /** diff --git a/packages/engine/Source/Core/VerticalExaggeration.js b/packages/engine/Source/Core/VerticalExaggeration.js index 5a9744691e29..1ffcf9d37b1a 100644 --- a/packages/engine/Source/Core/VerticalExaggeration.js +++ b/packages/engine/Source/Core/VerticalExaggeration.js @@ -43,11 +43,11 @@ VerticalExaggeration.getPosition = function ( ellipsoid, verticalExaggeration, verticalExaggerationRelativeHeight, - result + result, ) { const cartographic = ellipsoid.cartesianToCartographic( position, - scratchCartographic + scratchCartographic, ); // If the position is too near the center of the ellipsoid, exaggeration is undefined. if (!defined(cartographic)) { @@ -56,14 +56,14 @@ VerticalExaggeration.getPosition = function ( const newHeight = VerticalExaggeration.getHeight( cartographic.height, verticalExaggeration, - verticalExaggerationRelativeHeight + verticalExaggerationRelativeHeight, ); return Cartesian3.fromRadians( cartographic.longitude, cartographic.latitude, newHeight, ellipsoid, - result + result, ); }; diff --git a/packages/engine/Source/Core/VideoSynchronizer.js b/packages/engine/Source/Core/VideoSynchronizer.js index 5599dcae75cf..eb2e165cef17 100644 --- a/packages/engine/Source/Core/VideoSynchronizer.js +++ b/packages/engine/Source/Core/VideoSynchronizer.js @@ -79,7 +79,7 @@ Object.defineProperties(VideoSynchronizer.prototype, { if (defined(value)) { this._clockSubscription = value.onTick.addEventListener( VideoSynchronizer.prototype._onTick, - this + this, ); } diff --git a/packages/engine/Source/Core/WallGeometry.js b/packages/engine/Source/Core/WallGeometry.js index 0c9fc2d43013..2f713ed2c3cc 100644 --- a/packages/engine/Source/Core/WallGeometry.js +++ b/packages/engine/Source/Core/WallGeometry.js @@ -77,7 +77,7 @@ function WallGeometry(options) { maximumHeights.length !== wallPositions.length ) { throw new DeveloperError( - "options.positions and options.maximumHeights must have the same length." + "options.positions and options.maximumHeights must have the same length.", ); } if ( @@ -85,7 +85,7 @@ function WallGeometry(options) { minimumHeights.length !== wallPositions.length ) { throw new DeveloperError( - "options.positions and options.minimumHeights must have the same length." + "options.positions and options.minimumHeights must have the same length.", ); } //>>includeEnd('debug'); @@ -93,7 +93,7 @@ function WallGeometry(options) { const vertexFormat = defaultValue(options.vertexFormat, VertexFormat.DEFAULT); const granularity = defaultValue( options.granularity, - CesiumMath.RADIANS_PER_DEGREE + CesiumMath.RADIANS_PER_DEGREE, ); const ellipsoid = defaultValue(options.ellipsoid, Ellipsoid.default); @@ -246,7 +246,7 @@ WallGeometry.unpack = function (array, startingIndex, result) { const vertexFormat = VertexFormat.unpack( array, startingIndex, - scratchVertexFormat + scratchVertexFormat, ); startingIndex += VertexFormat.packedLength; @@ -366,7 +366,7 @@ WallGeometry.createGeometry = function (wallGeometry) { maximumHeights, minimumHeights, granularity, - true + true, ); if (!defined(pos)) { return; @@ -410,12 +410,12 @@ WallGeometry.createGeometry = function (wallGeometry) { const topPosition = Cartesian3.fromArray( topPositions, i3, - scratchCartesian3Position1 + scratchCartesian3Position1, ); const bottomPosition = Cartesian3.fromArray( bottomPositions, i3, - scratchCartesian3Position2 + scratchCartesian3Position2, ); if (vertexFormat.position) { // insert the lower point @@ -440,21 +440,21 @@ WallGeometry.createGeometry = function (wallGeometry) { if (vertexFormat.normal || vertexFormat.tangent || vertexFormat.bitangent) { let nextTop = Cartesian3.clone( Cartesian3.ZERO, - scratchCartesian3Position5 + scratchCartesian3Position5, ); const groundPosition = Cartesian3.subtract( topPosition, ellipsoid.geodeticSurfaceNormal( topPosition, - scratchCartesian3Position2 + scratchCartesian3Position2, ), - scratchCartesian3Position2 + scratchCartesian3Position2, ); if (i + 1 < length) { nextTop = Cartesian3.fromArray( topPositions, i3 + 3, - scratchCartesian3Position5 + scratchCartesian3Position5, ); } @@ -462,16 +462,16 @@ WallGeometry.createGeometry = function (wallGeometry) { const scalednextPosition = Cartesian3.subtract( nextTop, topPosition, - scratchCartesian3Position4 + scratchCartesian3Position4, ); const scaledGroundPosition = Cartesian3.subtract( groundPosition, topPosition, - scratchCartesian3Position1 + scratchCartesian3Position1, ); normal = Cartesian3.normalize( Cartesian3.cross(scaledGroundPosition, scalednextPosition, normal), - normal + normal, ); recomputeNormal = false; } @@ -485,13 +485,13 @@ WallGeometry.createGeometry = function (wallGeometry) { if (vertexFormat.tangent) { tangent = Cartesian3.normalize( Cartesian3.subtract(nextTop, topPosition, tangent), - tangent + tangent, ); } if (vertexFormat.bitangent) { bitangent = Cartesian3.normalize( Cartesian3.cross(normal, tangent, bitangent), - bitangent + bitangent, ); } } @@ -595,12 +595,12 @@ WallGeometry.createGeometry = function (wallGeometry) { const pl = Cartesian3.fromArray( positions, LL * 3, - scratchCartesian3Position1 + scratchCartesian3Position1, ); const pr = Cartesian3.fromArray( positions, LR * 3, - scratchCartesian3Position2 + scratchCartesian3Position2, ); if (Cartesian3.equalsEpsilon(pl, pr, CesiumMath.EPSILON10)) { continue; diff --git a/packages/engine/Source/Core/WallGeometryLibrary.js b/packages/engine/Source/Core/WallGeometryLibrary.js index 679cf4114e4b..cc64fe836d74 100644 --- a/packages/engine/Source/Core/WallGeometryLibrary.js +++ b/packages/engine/Source/Core/WallGeometryLibrary.js @@ -117,13 +117,13 @@ WallGeometryLibrary.computePositions = function ( maximumHeights, minimumHeights, granularity, - duplicateCorners + duplicateCorners, ) { const o = removeDuplicates( ellipsoid, wallPositions, maximumHeights, - minimumHeights + minimumHeights, ); if (!defined(o)) { @@ -141,7 +141,7 @@ WallGeometryLibrary.computePositions = function ( const minDistance = CesiumMath.chordLength( granularity, - ellipsoid.maximumRadius + ellipsoid.maximumRadius, ); const generateArcOptions = generateArcOptionsScratch; @@ -157,7 +157,7 @@ WallGeometryLibrary.computePositions = function ( PolylinePipeline.numberOfPoints( wallPositions[i], wallPositions[i + 1], - minDistance + minDistance, ) + 1; } @@ -185,7 +185,7 @@ WallGeometryLibrary.computePositions = function ( bottomPositions.set( PolylinePipeline.generateArc(generateArcOptions), - offset + offset, ); offset += pos.length; @@ -194,12 +194,12 @@ WallGeometryLibrary.computePositions = function ( generateArcOptions.positions = wallPositions; generateArcOptions.height = maximumHeights; topPositions = new Float64Array( - PolylinePipeline.generateArc(generateArcOptions) + PolylinePipeline.generateArc(generateArcOptions), ); generateArcOptions.height = minimumHeights; bottomPositions = new Float64Array( - PolylinePipeline.generateArc(generateArcOptions) + PolylinePipeline.generateArc(generateArcOptions), ); } diff --git a/packages/engine/Source/Core/WallOutlineGeometry.js b/packages/engine/Source/Core/WallOutlineGeometry.js index c934ff18e182..e3a3ff850c1a 100644 --- a/packages/engine/Source/Core/WallOutlineGeometry.js +++ b/packages/engine/Source/Core/WallOutlineGeometry.js @@ -68,7 +68,7 @@ function WallOutlineGeometry(options) { maximumHeights.length !== wallPositions.length ) { throw new DeveloperError( - "options.positions and options.maximumHeights must have the same length." + "options.positions and options.maximumHeights must have the same length.", ); } if ( @@ -76,14 +76,14 @@ function WallOutlineGeometry(options) { minimumHeights.length !== wallPositions.length ) { throw new DeveloperError( - "options.positions and options.minimumHeights must have the same length." + "options.positions and options.minimumHeights must have the same length.", ); } //>>includeEnd('debug'); const granularity = defaultValue( options.granularity, - CesiumMath.RADIANS_PER_DEGREE + CesiumMath.RADIANS_PER_DEGREE, ); const ellipsoid = defaultValue(options.ellipsoid, Ellipsoid.default); @@ -338,7 +338,7 @@ WallOutlineGeometry.createGeometry = function (wallGeometry) { maximumHeights, minimumHeights, granularity, - false + false, ); if (!defined(pos)) { return; @@ -362,12 +362,12 @@ WallOutlineGeometry.createGeometry = function (wallGeometry) { const topPosition = Cartesian3.fromArray( topPositions, i3, - scratchCartesian3Position1 + scratchCartesian3Position1, ); const bottomPosition = Cartesian3.fromArray( bottomPositions, i3, - scratchCartesian3Position2 + scratchCartesian3Position2, ); // insert the lower point @@ -400,12 +400,12 @@ WallOutlineGeometry.createGeometry = function (wallGeometry) { const pl = Cartesian3.fromArray( positions, LL * 3, - scratchCartesian3Position1 + scratchCartesian3Position1, ); const pr = Cartesian3.fromArray( positions, LR * 3, - scratchCartesian3Position2 + scratchCartesian3Position2, ); if (Cartesian3.equalsEpsilon(pl, pr, CesiumMath.EPSILON10)) { continue; diff --git a/packages/engine/Source/Core/WebMercatorProjection.js b/packages/engine/Source/Core/WebMercatorProjection.js index 79a7cb309ec2..335eaa54697a 100644 --- a/packages/engine/Source/Core/WebMercatorProjection.js +++ b/packages/engine/Source/Core/WebMercatorProjection.js @@ -48,7 +48,7 @@ Object.defineProperties(WebMercatorProjection.prototype, { * @returns {number} The geodetic latitude in radians. */ WebMercatorProjection.mercatorAngleToGeodeticLatitude = function ( - mercatorAngle + mercatorAngle, ) { return CesiumMath.PI_OVER_TWO - 2.0 * Math.atan(Math.exp(-mercatorAngle)); }; @@ -85,9 +85,8 @@ WebMercatorProjection.geodeticLatitudeToMercatorAngle = function (latitude) { * * @type {number} */ -WebMercatorProjection.MaximumLatitude = WebMercatorProjection.mercatorAngleToGeodeticLatitude( - Math.PI -); +WebMercatorProjection.MaximumLatitude = + WebMercatorProjection.mercatorAngleToGeodeticLatitude(Math.PI); /** * Converts geodetic ellipsoid coordinates, in radians, to the equivalent Web Mercator @@ -104,7 +103,7 @@ WebMercatorProjection.prototype.project = function (cartographic, result) { const x = cartographic.longitude * semimajorAxis; const y = WebMercatorProjection.geodeticLatitudeToMercatorAngle( - cartographic.latitude + cartographic.latitude, ) * semimajorAxis; const z = cartographic.height; @@ -138,7 +137,7 @@ WebMercatorProjection.prototype.unproject = function (cartesian, result) { const oneOverEarthSemimajorAxis = this._oneOverSemimajorAxis; const longitude = cartesian.x * oneOverEarthSemimajorAxis; const latitude = WebMercatorProjection.mercatorAngleToGeodeticLatitude( - cartesian.y * oneOverEarthSemimajorAxis + cartesian.y * oneOverEarthSemimajorAxis, ); const height = cartesian.z; diff --git a/packages/engine/Source/Core/WebMercatorTilingScheme.js b/packages/engine/Source/Core/WebMercatorTilingScheme.js index 79229fda0dec..f7a81610d418 100644 --- a/packages/engine/Source/Core/WebMercatorTilingScheme.js +++ b/packages/engine/Source/Core/WebMercatorTilingScheme.js @@ -34,11 +34,11 @@ function WebMercatorTilingScheme(options) { this._ellipsoid = defaultValue(options.ellipsoid, Ellipsoid.default); this._numberOfLevelZeroTilesX = defaultValue( options.numberOfLevelZeroTilesX, - 1 + 1, ); this._numberOfLevelZeroTilesY = defaultValue( options.numberOfLevelZeroTilesY, - 1 + 1, ); this._projection = new WebMercatorProjection(this._ellipsoid); @@ -53,25 +53,25 @@ function WebMercatorTilingScheme(options) { const semimajorAxisTimesPi = this._ellipsoid.maximumRadius * Math.PI; this._rectangleSouthwestInMeters = new Cartesian2( -semimajorAxisTimesPi, - -semimajorAxisTimesPi + -semimajorAxisTimesPi, ); this._rectangleNortheastInMeters = new Cartesian2( semimajorAxisTimesPi, - semimajorAxisTimesPi + semimajorAxisTimesPi, ); } const southwest = this._projection.unproject( - this._rectangleSouthwestInMeters + this._rectangleSouthwestInMeters, ); const northeast = this._projection.unproject( - this._rectangleNortheastInMeters + this._rectangleNortheastInMeters, ); this._rectangle = new Rectangle( southwest.longitude, southwest.latitude, northeast.longitude, - northeast.latitude + northeast.latitude, ); } @@ -142,7 +142,7 @@ WebMercatorTilingScheme.prototype.getNumberOfYTilesAtLevel = function (level) { */ WebMercatorTilingScheme.prototype.rectangleToNativeRectangle = function ( rectangle, - result + result, ) { const projection = this._projection; const southwest = projection.project(Rectangle.southwest(rectangle)); @@ -175,7 +175,7 @@ WebMercatorTilingScheme.prototype.tileXYToNativeRectangle = function ( x, y, level, - result + result, ) { const xTiles = this.getNumberOfXTilesAtLevel(level); const yTiles = this.getNumberOfYTilesAtLevel(level); @@ -218,16 +218,16 @@ WebMercatorTilingScheme.prototype.tileXYToRectangle = function ( x, y, level, - result + result, ) { const nativeRectangle = this.tileXYToNativeRectangle(x, y, level, result); const projection = this._projection; const southwest = projection.unproject( - new Cartesian2(nativeRectangle.west, nativeRectangle.south) + new Cartesian2(nativeRectangle.west, nativeRectangle.south), ); const northeast = projection.unproject( - new Cartesian2(nativeRectangle.east, nativeRectangle.north) + new Cartesian2(nativeRectangle.east, nativeRectangle.north), ); nativeRectangle.west = southwest.longitude; @@ -251,7 +251,7 @@ WebMercatorTilingScheme.prototype.tileXYToRectangle = function ( WebMercatorTilingScheme.prototype.positionToTileXY = function ( position, level, - result + result, ) { const rectangle = this._rectangle; if (!Rectangle.contains(rectangle, position)) { diff --git a/packages/engine/Source/Core/WireframeIndexGenerator.js b/packages/engine/Source/Core/WireframeIndexGenerator.js index 6100dad6effd..2ad790353286 100644 --- a/packages/engine/Source/Core/WireframeIndexGenerator.js +++ b/packages/engine/Source/Core/WireframeIndexGenerator.js @@ -14,7 +14,7 @@ const WireframeIndexGenerator = {}; function createWireframeFromTriangles(vertexCount) { const wireframeIndices = IndexDatatype.createTypedArray( vertexCount, - vertexCount * 2 + vertexCount * 2, ); const length = vertexCount; let index = 0; @@ -34,7 +34,7 @@ function createWireframeFromTriangleIndices(vertexCount, originalIndices) { const originalIndicesCount = originalIndices.length; const wireframeIndices = IndexDatatype.createTypedArray( vertexCount, - originalIndicesCount * 2 + originalIndicesCount * 2, ); let index = 0; for (let i = 0; i < originalIndicesCount; i += 3) { @@ -58,7 +58,7 @@ function createWireframeFromTriangleStrip(vertexCount) { const wireframeIndicesCount = 2 + numberOfTriangles * 4; const wireframeIndices = IndexDatatype.createTypedArray( vertexCount, - wireframeIndicesCount + wireframeIndicesCount, ); let index = 0; @@ -83,7 +83,7 @@ function createWireframeFromTriangleStripIndices(vertexCount, originalIndices) { const wireframeIndicesCount = 2 + numberOfTriangles * 4; const wireframeIndices = IndexDatatype.createTypedArray( vertexCount, - wireframeIndicesCount + wireframeIndicesCount, ); let index = 0; @@ -111,7 +111,7 @@ function createWireframeFromTriangleFan(vertexCount) { const wireframeIndicesCount = 2 + numberOfTriangles * 4; const wireframeIndices = IndexDatatype.createTypedArray( vertexCount, - wireframeIndicesCount + wireframeIndicesCount, ); let index = 0; @@ -136,7 +136,7 @@ function createWireframeFromTriangleFanIndices(vertexCount, originalIndices) { const wireframeIndicesCount = 2 + numberOfTriangles * 4; const wireframeIndices = IndexDatatype.createTypedArray( vertexCount, - wireframeIndicesCount + wireframeIndicesCount, ); let index = 0; @@ -174,7 +174,7 @@ function createWireframeFromTriangleFanIndices(vertexCount, originalIndices) { WireframeIndexGenerator.createWireframeIndices = function ( primitiveType, vertexCount, - originalIndices + originalIndices, ) { const hasOriginalIndices = defined(originalIndices); if (primitiveType === PrimitiveType.TRIANGLES) { @@ -209,7 +209,7 @@ WireframeIndexGenerator.createWireframeIndices = function ( */ WireframeIndexGenerator.getWireframeIndicesCount = function ( primitiveType, - originalCount + originalCount, ) { // For TRIANGLES, the wireframe takes every triangle (i.e. three of the original // indices) and turns it into lines. Each triangle has three lines, and each line diff --git a/packages/engine/Source/Core/arrayRemoveDuplicates.js b/packages/engine/Source/Core/arrayRemoveDuplicates.js index c001def63001..e77b3aa871be 100644 --- a/packages/engine/Source/Core/arrayRemoveDuplicates.js +++ b/packages/engine/Source/Core/arrayRemoveDuplicates.js @@ -51,7 +51,7 @@ function arrayRemoveDuplicates( values, equalsEpsilon, wrapAround, - removedIndices + removedIndices, ) { //>>includeStart('debug', pragmas.debug); Check.defined("equalsEpsilon", equalsEpsilon); diff --git a/packages/engine/Source/Core/buildModuleUrl.js b/packages/engine/Source/Core/buildModuleUrl.js index 88a1982fbb7f..c992d6115ab1 100644 --- a/packages/engine/Source/Core/buildModuleUrl.js +++ b/packages/engine/Source/Core/buildModuleUrl.js @@ -53,7 +53,7 @@ function getCesiumBaseUrl() { // RequireJS baseUrlString = getAbsoluteUri( "..", - buildModuleUrl("Core/buildModuleUrl.js") + buildModuleUrl("Core/buildModuleUrl.js"), ); } else { // IIFE @@ -63,7 +63,7 @@ function getCesiumBaseUrl() { //>>includeStart('debug', pragmas.debug); if (!defined(baseUrlString)) { throw new DeveloperError( - "Unable to determine Cesium base URL automatically, try defining a global variable called CESIUM_BASE_URL." + "Unable to determine Cesium base URL automatically, try defining a global variable called CESIUM_BASE_URL.", ); } //>>includeEnd('debug'); diff --git a/packages/engine/Source/Core/decodeGoogleEarthEnterpriseData.js b/packages/engine/Source/Core/decodeGoogleEarthEnterpriseData.js index 46d76894f5b9..d7286835e82c 100644 --- a/packages/engine/Source/Core/decodeGoogleEarthEnterpriseData.js +++ b/packages/engine/Source/Core/decodeGoogleEarthEnterpriseData.js @@ -25,7 +25,7 @@ function decodeGoogleEarthEnterpriseData(key, data) { const keyLength = key.byteLength; if (keyLength === 0 || keyLength % 4 !== 0) { throw new RuntimeError( - "The length of key must be greater than 0 and a multiple of 4." + "The length of key must be greater than 0 and a multiple of 4.", ); } @@ -61,12 +61,12 @@ function decodeGoogleEarthEnterpriseData(key, data) { dataView.setUint32( dp, dataView.getUint32(dp, true) ^ keyView.getUint32(kp, true), - true + true, ); dataView.setUint32( dp + 4, dataView.getUint32(dp + 4, true) ^ keyView.getUint32(kp + 4, true), - true + true, ); dp += 8; kp += 24; diff --git a/packages/engine/Source/Core/decodeVectorPolylinePositions.js b/packages/engine/Source/Core/decodeVectorPolylinePositions.js index 723a34424717..87d794fe72fd 100644 --- a/packages/engine/Source/Core/decodeVectorPolylinePositions.js +++ b/packages/engine/Source/Core/decodeVectorPolylinePositions.js @@ -13,14 +13,14 @@ function decodeVectorPolylinePositions( rectangle, minimumHeight, maximumHeight, - ellipsoid + ellipsoid, ) { const positionsLength = positions.length / 3; const uBuffer = positions.subarray(0, positionsLength); const vBuffer = positions.subarray(positionsLength, 2 * positionsLength); const heightBuffer = positions.subarray( 2 * positionsLength, - 3 * positionsLength + 3 * positionsLength, ); AttributeCompression.zigZagDeltaDecode(uBuffer, vBuffer, heightBuffer); @@ -38,11 +38,11 @@ function decodeVectorPolylinePositions( lon, lat, alt, - scratchBVCartographic + scratchBVCartographic, ); const decodedPosition = ellipsoid.cartographicToCartesian( cartographic, - scratchEncodedPosition + scratchEncodedPosition, ); Cartesian3.pack(decodedPosition, decoded, i * 3); } diff --git a/packages/engine/Source/Core/destroyObject.js b/packages/engine/Source/Core/destroyObject.js index 40093a8ba362..f51c63030298 100644 --- a/packages/engine/Source/Core/destroyObject.js +++ b/packages/engine/Source/Core/destroyObject.js @@ -35,7 +35,7 @@ function returnTrue() { function destroyObject(object, message) { message = defaultValue( message, - "This object was destroyed, i.e., destroy() was called." + "This object was destroyed, i.e., destroy() was called.", ); function throwOnDestroyed() { diff --git a/packages/engine/Source/Core/getJsonFromTypedArray.js b/packages/engine/Source/Core/getJsonFromTypedArray.js index ff5e2f4c51f9..30f4aef87f40 100644 --- a/packages/engine/Source/Core/getJsonFromTypedArray.js +++ b/packages/engine/Source/Core/getJsonFromTypedArray.js @@ -14,7 +14,7 @@ import getStringFromTypedArray from "./getStringFromTypedArray.js"; */ function getJsonFromTypedArray(uint8Array, byteOffset, byteLength) { return JSON.parse( - getStringFromTypedArray(uint8Array, byteOffset, byteLength) + getStringFromTypedArray(uint8Array, byteOffset, byteLength), ); } diff --git a/packages/engine/Source/Core/getMagic.js b/packages/engine/Source/Core/getMagic.js index ffad591f4477..a6eeff08fe21 100644 --- a/packages/engine/Source/Core/getMagic.js +++ b/packages/engine/Source/Core/getMagic.js @@ -9,7 +9,7 @@ function getMagic(uint8Array, byteOffset) { return getStringFromTypedArray( uint8Array, byteOffset, - Math.min(4, uint8Array.length) + Math.min(4, uint8Array.length), ); } export default getMagic; diff --git a/packages/engine/Source/Core/loadImageFromTypedArray.js b/packages/engine/Source/Core/loadImageFromTypedArray.js index 3c0bd64cc9d4..9907028e06e6 100644 --- a/packages/engine/Source/Core/loadImageFromTypedArray.js +++ b/packages/engine/Source/Core/loadImageFromTypedArray.js @@ -13,7 +13,7 @@ function loadImageFromTypedArray(options) { const flipY = defaultValue(options.flipY, false); const skipColorSpaceConversion = defaultValue( options.skipColorSpaceConversion, - false + false, ); //>>includeStart('debug', pragmas.debug); Check.typeOf.object("uint8Array", uint8Array); @@ -33,7 +33,7 @@ function loadImageFromTypedArray(options) { flipY: flipY, premultiplyAlpha: false, skipColorSpaceConversion: skipColorSpaceConversion, - }) + }), ); } diff --git a/packages/engine/Source/Core/loadKTX2.js b/packages/engine/Source/Core/loadKTX2.js index 8359640fc854..a4cee9d0f9bd 100644 --- a/packages/engine/Source/Core/loadKTX2.js +++ b/packages/engine/Source/Core/loadKTX2.js @@ -21,7 +21,7 @@ loadKTX2.setKTX2SupportedFormats = function ( astc, etc, etc1, - bc7 + bc7, ) { supportedTranscoderFormats = { s3tc: s3tc, diff --git a/packages/engine/Source/Core/pointInsideTriangle.js b/packages/engine/Source/Core/pointInsideTriangle.js index c6f2c0b07e32..1ebaa09d7dee 100644 --- a/packages/engine/Source/Core/pointInsideTriangle.js +++ b/packages/engine/Source/Core/pointInsideTriangle.js @@ -29,7 +29,7 @@ function pointInsideTriangle(point, p0, p1, p2) { p0, p1, p2, - scratchBarycentricCoords + scratchBarycentricCoords, ); if (!defined(coords)) { return false; diff --git a/packages/engine/Source/Core/resizeImageToNextPowerOfTwo.js b/packages/engine/Source/Core/resizeImageToNextPowerOfTwo.js index 3c213365e3f4..e96e060f8dd6 100644 --- a/packages/engine/Source/Core/resizeImageToNextPowerOfTwo.js +++ b/packages/engine/Source/Core/resizeImageToNextPowerOfTwo.js @@ -24,7 +24,7 @@ function resizeImageToNextPowerOfTwo(image) { 0, 0, canvas.width, - canvas.height + canvas.height, ); return canvas; } diff --git a/packages/engine/Source/Core/sampleTerrain.js b/packages/engine/Source/Core/sampleTerrain.js index cd2f2dee82f7..747dc4bef8a6 100644 --- a/packages/engine/Source/Core/sampleTerrain.js +++ b/packages/engine/Source/Core/sampleTerrain.js @@ -47,7 +47,7 @@ async function sampleTerrain( terrainProvider, level, positions, - rejectOnTileFail + rejectOnTileFail, ) { if (!defined(rejectOnTileFail)) { rejectOnTileFail = false; @@ -76,7 +76,7 @@ function attemptConsumeNextQueueItem(tileRequests, results, rejectOnTileFail) { const requestPromise = tileRequest.terrainProvider.requestTileGeometry( tileRequest.x, tileRequest.y, - tileRequest.level + tileRequest.level, ); if (!requestPromise) { @@ -136,7 +136,7 @@ function drainTileRequestQueue(tileRequests, results, rejectOnTileFail) { const success = attemptConsumeNextQueueItem( tileRequests, results, - rejectOnTileFail + rejectOnTileFail, ); if (success) { return drainTileRequestQueue(tileRequests, results, rejectOnTileFail); @@ -187,7 +187,7 @@ function doSampling(terrainProvider, level, positions, rejectOnTileFail) { return drainTileRequestQueue( tileRequests, tilePromises, - rejectOnTileFail + rejectOnTileFail, ).then(function () { // now all the required requests have been started // we just wait for them all to finish @@ -212,7 +212,7 @@ function interpolateAndAssignHeight(position, terrainData, rectangle) { const height = terrainData.interpolateHeight( rectangle, position.longitude, - position.latitude + position.latitude, ); if (height === undefined) { // if height comes back as undefined, it may implicitly mean the terrain data @@ -229,7 +229,7 @@ function createInterpolateFunction(tileRequest) { const rectangle = tileRequest.tilingScheme.tileXYToRectangle( tileRequest.x, tileRequest.y, - tileRequest.level + tileRequest.level, ); return function (terrainData) { let isMeshRequired = false; @@ -238,7 +238,7 @@ function createInterpolateFunction(tileRequest) { const isHeightAssigned = interpolateAndAssignHeight( position, terrainData, - rectangle + rectangle, ); // we've found a position which returned undefined - hinting to us // that we probably need to create a mesh for this terrain data. diff --git a/packages/engine/Source/Core/sampleTerrainMostDetailed.js b/packages/engine/Source/Core/sampleTerrainMostDetailed.js index 61c5e092b165..b2eec762b5a9 100644 --- a/packages/engine/Source/Core/sampleTerrainMostDetailed.js +++ b/packages/engine/Source/Core/sampleTerrainMostDetailed.js @@ -37,7 +37,7 @@ const scratchCartesian2 = new Cartesian2(); async function sampleTerrainMostDetailed( terrainProvider, positions, - rejectOnTileFail + rejectOnTileFail, ) { if (!defined(rejectOnTileFail)) { rejectOnTileFail = false; @@ -59,7 +59,7 @@ async function sampleTerrainMostDetailed( //>>includeStart('debug', pragmas.debug); if (!defined(availability)) { throw new DeveloperError( - "sampleTerrainMostDetailed requires a terrain provider that has tile availability." + "sampleTerrainMostDetailed requires a terrain provider that has tile availability.", ); } //>>includeEnd('debug'); @@ -76,12 +76,12 @@ async function sampleTerrainMostDetailed( terrainProvider.tilingScheme.positionToTileXY( position, 1, - scratchCartesian2 + scratchCartesian2, ); const promise = terrainProvider.loadTileDataAvailability( scratchCartesian2.x, scratchCartesian2.y, - 1 + 1, ); if (defined(promise)) { promises.push(promise); @@ -103,10 +103,10 @@ async function sampleTerrainMostDetailed( terrainProvider, index, positionsAtLevel, - rejectOnTileFail + rejectOnTileFail, ); } - }) + }), ); const changedPositions = []; for (let i = 0; i < positions.length; ++i) { @@ -123,7 +123,7 @@ async function sampleTerrainMostDetailed( await sampleTerrainMostDetailed( terrainProvider, changedPositions, - rejectOnTileFail + rejectOnTileFail, ); } diff --git a/packages/engine/Source/Core/scaleToGeodeticSurface.js b/packages/engine/Source/Core/scaleToGeodeticSurface.js index 99b2a8b75b60..040972d14f74 100644 --- a/packages/engine/Source/Core/scaleToGeodeticSurface.js +++ b/packages/engine/Source/Core/scaleToGeodeticSurface.js @@ -27,7 +27,7 @@ function scaleToGeodeticSurface( oneOverRadii, oneOverRadiiSquared, centerToleranceSquared, - result + result, ) { //>>includeStart('debug', pragmas.debug); if (!defined(cartesian)) { @@ -64,7 +64,7 @@ function scaleToGeodeticSurface( const intersection = Cartesian3.multiplyByScalar( cartesian, ratio, - scaleToGeodeticSurfaceIntersection + scaleToGeodeticSurfaceIntersection, ); // If the position is near the center, the iteration will not converge. @@ -136,7 +136,7 @@ function scaleToGeodeticSurface( return new Cartesian3( positionX * xMultiplier, positionY * yMultiplier, - positionZ * zMultiplier + positionZ * zMultiplier, ); } result.x = positionX * xMultiplier; diff --git a/packages/engine/Source/Core/srgbToLinear.js b/packages/engine/Source/Core/srgbToLinear.js index f3bc68f6a40b..454b2ec2ae89 100644 --- a/packages/engine/Source/Core/srgbToLinear.js +++ b/packages/engine/Source/Core/srgbToLinear.js @@ -26,7 +26,7 @@ function srgbToLinear(value) { return Math.pow( // eslint-disable-next-line no-loss-of-precision (value + 0.055) * 0.94786729857819905213270142180095, - 2.4 + 2.4, ); } export default srgbToLinear; diff --git a/packages/engine/Source/Core/writeTextToCanvas.js b/packages/engine/Source/Core/writeTextToCanvas.js index 1db8a0ba0d1f..3a23c602d7e3 100644 --- a/packages/engine/Source/Core/writeTextToCanvas.js +++ b/packages/engine/Source/Core/writeTextToCanvas.js @@ -134,7 +134,7 @@ function writeTextToCanvas(text, options) { const strokeWidth = defaultValue(options.strokeWidth, 1); const backgroundColor = defaultValue( options.backgroundColor, - Color.TRANSPARENT + Color.TRANSPARENT, ); const padding = defaultValue(options.padding, 0); const doublePadding = padding * 2.0; diff --git a/packages/engine/Source/DataSources/BillboardGraphics.js b/packages/engine/Source/DataSources/BillboardGraphics.js index bdd950736c2b..3145f6adb2a9 100644 --- a/packages/engine/Source/DataSources/BillboardGraphics.js +++ b/packages/engine/Source/DataSources/BillboardGraphics.js @@ -303,7 +303,7 @@ Object.defineProperties(BillboardGraphics.prototype, { * @type {Property|undefined} */ pixelOffsetScaleByDistance: createPropertyDescriptor( - "pixelOffsetScaleByDistance" + "pixelOffsetScaleByDistance", ), /** @@ -321,7 +321,7 @@ Object.defineProperties(BillboardGraphics.prototype, { * @type {Property|undefined} */ distanceDisplayCondition: createPropertyDescriptor( - "distanceDisplayCondition" + "distanceDisplayCondition", ), /** @@ -331,7 +331,7 @@ Object.defineProperties(BillboardGraphics.prototype, { * @type {Property|undefined} */ disableDepthTestDistance: createPropertyDescriptor( - "disableDepthTestDistance" + "disableDepthTestDistance", ), /** @@ -397,15 +397,15 @@ BillboardGraphics.prototype.merge = function (source) { this.eyeOffset = defaultValue(this._eyeOffset, source.eyeOffset); this.horizontalOrigin = defaultValue( this._horizontalOrigin, - source.horizontalOrigin + source.horizontalOrigin, ); this.verticalOrigin = defaultValue( this._verticalOrigin, - source.verticalOrigin + source.verticalOrigin, ); this.heightReference = defaultValue( this._heightReference, - source.heightReference + source.heightReference, ); this.color = defaultValue(this._color, source.color); this.rotation = defaultValue(this._rotation, source.rotation); @@ -415,31 +415,31 @@ BillboardGraphics.prototype.merge = function (source) { this.height = defaultValue(this._height, source.height); this.scaleByDistance = defaultValue( this._scaleByDistance, - source.scaleByDistance + source.scaleByDistance, ); this.translucencyByDistance = defaultValue( this._translucencyByDistance, - source.translucencyByDistance + source.translucencyByDistance, ); this.pixelOffsetScaleByDistance = defaultValue( this._pixelOffsetScaleByDistance, - source.pixelOffsetScaleByDistance + source.pixelOffsetScaleByDistance, ); this.imageSubRegion = defaultValue( this._imageSubRegion, - source.imageSubRegion + source.imageSubRegion, ); this.distanceDisplayCondition = defaultValue( this._distanceDisplayCondition, - source.distanceDisplayCondition + source.distanceDisplayCondition, ); this.disableDepthTestDistance = defaultValue( this._disableDepthTestDistance, - source.disableDepthTestDistance + source.disableDepthTestDistance, ); this.splitDirection = defaultValue( this.splitDirection, - source.splitDirection + source.splitDirection, ); }; export default BillboardGraphics; diff --git a/packages/engine/Source/DataSources/BillboardVisualizer.js b/packages/engine/Source/DataSources/BillboardVisualizer.js index a8cff2aa4053..baff7d8466d9 100644 --- a/packages/engine/Source/DataSources/BillboardVisualizer.js +++ b/packages/engine/Source/DataSources/BillboardVisualizer.js @@ -63,7 +63,7 @@ function BillboardVisualizer(entityCluster, entityCollection) { entityCollection.collectionChanged.addEventListener( BillboardVisualizer.prototype._onCollectionChanged, - this + this, ); this._cluster = entityCluster; @@ -104,11 +104,11 @@ BillboardVisualizer.prototype.update = function (time) { position = Property.getValueOrUndefined( entity._position, time, - positionScratch + positionScratch, ); textureValue = Property.getValueOrUndefined( billboardGraphics._image, - time + time, ); show = defined(position) && defined(textureValue); } @@ -140,97 +140,97 @@ BillboardVisualizer.prototype.update = function (time) { billboardGraphics._color, time, defaultColor, - colorScratch + colorScratch, ); billboard.eyeOffset = Property.getValueOrDefault( billboardGraphics._eyeOffset, time, defaultEyeOffset, - eyeOffsetScratch + eyeOffsetScratch, ); billboard.heightReference = Property.getValueOrDefault( billboardGraphics._heightReference, time, - defaultHeightReference + defaultHeightReference, ); billboard.pixelOffset = Property.getValueOrDefault( billboardGraphics._pixelOffset, time, defaultPixelOffset, - pixelOffsetScratch + pixelOffsetScratch, ); billboard.scale = Property.getValueOrDefault( billboardGraphics._scale, time, - defaultScale + defaultScale, ); billboard.rotation = Property.getValueOrDefault( billboardGraphics._rotation, time, - defaultRotation + defaultRotation, ); billboard.alignedAxis = Property.getValueOrDefault( billboardGraphics._alignedAxis, time, - defaultAlignedAxis + defaultAlignedAxis, ); billboard.horizontalOrigin = Property.getValueOrDefault( billboardGraphics._horizontalOrigin, time, - defaultHorizontalOrigin + defaultHorizontalOrigin, ); billboard.verticalOrigin = Property.getValueOrDefault( billboardGraphics._verticalOrigin, time, - defaultVerticalOrigin + defaultVerticalOrigin, ); billboard.width = Property.getValueOrUndefined( billboardGraphics._width, - time + time, ); billboard.height = Property.getValueOrUndefined( billboardGraphics._height, - time + time, ); billboard.scaleByDistance = Property.getValueOrUndefined( billboardGraphics._scaleByDistance, time, - scaleByDistanceScratch + scaleByDistanceScratch, ); billboard.translucencyByDistance = Property.getValueOrUndefined( billboardGraphics._translucencyByDistance, time, - translucencyByDistanceScratch + translucencyByDistanceScratch, ); billboard.pixelOffsetScaleByDistance = Property.getValueOrUndefined( billboardGraphics._pixelOffsetScaleByDistance, time, - pixelOffsetScaleByDistanceScratch + pixelOffsetScaleByDistanceScratch, ); billboard.sizeInMeters = Property.getValueOrDefault( billboardGraphics._sizeInMeters, time, - defaultSizeInMeters + defaultSizeInMeters, ); billboard.distanceDisplayCondition = Property.getValueOrUndefined( billboardGraphics._distanceDisplayCondition, time, - distanceDisplayConditionScratch + distanceDisplayConditionScratch, ); billboard.disableDepthTestDistance = Property.getValueOrUndefined( billboardGraphics._disableDepthTestDistance, - time + time, ); billboard.splitDirection = Property.getValueOrDefault( billboardGraphics._splitDirection, time, - defaultSplitDirection + defaultSplitDirection, ); const subRegion = Property.getValueOrUndefined( billboardGraphics._imageSubRegion, time, - boundingRectangleScratch + boundingRectangleScratch, ); if (defined(subRegion)) { billboard.setImageSubRegion(billboard._imageId, subRegion); @@ -293,7 +293,7 @@ BillboardVisualizer.prototype.isDestroyed = function () { BillboardVisualizer.prototype.destroy = function () { this._entityCollection.collectionChanged.removeEventListener( BillboardVisualizer.prototype._onCollectionChanged, - this + this, ); const entities = this._entityCollection.values; for (let i = 0; i < entities.length; i++) { @@ -306,7 +306,7 @@ BillboardVisualizer.prototype._onCollectionChanged = function ( entityCollection, added, removed, - changed + changed, ) { let i; let entity; diff --git a/packages/engine/Source/DataSources/BoxGeometryUpdater.js b/packages/engine/Source/DataSources/BoxGeometryUpdater.js index cf3f5ff7b92b..f534f841d03f 100644 --- a/packages/engine/Source/DataSources/BoxGeometryUpdater.js +++ b/packages/engine/Source/DataSources/BoxGeometryUpdater.js @@ -89,7 +89,7 @@ BoxGeometryUpdater.prototype.createFillGeometryInstance = function (time) { if (!this._fillEnabled) { throw new DeveloperError( - "This instance does not represent a filled geometry." + "This instance does not represent a filled geometry.", ); } //>>includeEnd('debug'); @@ -101,14 +101,14 @@ BoxGeometryUpdater.prototype.createFillGeometryInstance = function (time) { isAvailable && entity.isShowing && this._showProperty.getValue(time) && - this._fillProperty.getValue(time) - ); - const distanceDisplayCondition = this._distanceDisplayConditionProperty.getValue( - time - ); - const distanceDisplayConditionAttribute = DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition( - distanceDisplayCondition + this._fillProperty.getValue(time), ); + const distanceDisplayCondition = + this._distanceDisplayConditionProperty.getValue(time); + const distanceDisplayConditionAttribute = + DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition( + distanceDisplayCondition, + ); const attributes = { show: show, @@ -135,8 +135,8 @@ BoxGeometryUpdater.prototype.createFillGeometryInstance = function (time) { this._terrainOffsetProperty, time, defaultOffset, - offsetScratch - ) + offsetScratch, + ), ); } @@ -147,7 +147,7 @@ BoxGeometryUpdater.prototype.createFillGeometryInstance = function (time) { time, entity.box.heightReference, this._options.dimensions.z * 0.5, - this._scene.ellipsoid + this._scene.ellipsoid, ), attributes: attributes, }); @@ -167,7 +167,7 @@ BoxGeometryUpdater.prototype.createOutlineGeometryInstance = function (time) { if (!this._outlineEnabled) { throw new DeveloperError( - "This instance does not represent an outlined geometry." + "This instance does not represent an outlined geometry.", ); } //>>includeEnd('debug'); @@ -178,23 +178,23 @@ BoxGeometryUpdater.prototype.createOutlineGeometryInstance = function (time) { this._outlineColorProperty, time, Color.BLACK, - scratchColor - ); - const distanceDisplayCondition = this._distanceDisplayConditionProperty.getValue( - time + scratchColor, ); + const distanceDisplayCondition = + this._distanceDisplayConditionProperty.getValue(time); const attributes = { show: new ShowGeometryInstanceAttribute( isAvailable && entity.isShowing && this._showProperty.getValue(time) && - this._showOutlineProperty.getValue(time) + this._showOutlineProperty.getValue(time), ), color: ColorGeometryInstanceAttribute.fromColor(outlineColor), - distanceDisplayCondition: DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition( - distanceDisplayCondition - ), + distanceDisplayCondition: + DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition( + distanceDisplayCondition, + ), offset: undefined, }; if (defined(this._options.offsetAttribute)) { @@ -203,8 +203,8 @@ BoxGeometryUpdater.prototype.createOutlineGeometryInstance = function (time) { this._terrainOffsetProperty, time, defaultOffset, - offsetScratch - ) + offsetScratch, + ), ); } @@ -215,7 +215,7 @@ BoxGeometryUpdater.prototype.createOutlineGeometryInstance = function (time) { time, entity.box.heightReference, this._options.dimensions.z * 0.5, - this._scene.ellipsoid + this._scene.ellipsoid, ), attributes: attributes, }); @@ -246,7 +246,7 @@ BoxGeometryUpdater.prototype._setStaticOptions = function (entity, box) { const heightReference = Property.getValueOrDefault( box.heightReference, Iso8601.MINIMUM_VALUE, - HeightReference.NONE + HeightReference.NONE, ); const options = this._options; @@ -256,7 +256,7 @@ BoxGeometryUpdater.prototype._setStaticOptions = function (entity, box) { : MaterialAppearance.MaterialSupport.TEXTURED.vertexFormat; options.dimensions = box.dimensions.getValue( Iso8601.MINIMUM_VALUE, - options.dimensions + options.dimensions, ); options.offsetAttribute = heightReference !== HeightReference.NONE @@ -264,7 +264,8 @@ BoxGeometryUpdater.prototype._setStaticOptions = function (entity, box) { : undefined; }; -BoxGeometryUpdater.prototype._onEntityPropertyChanged = heightReferenceOnEntityPropertyChanged; +BoxGeometryUpdater.prototype._onEntityPropertyChanged = + heightReferenceOnEntityPropertyChanged; BoxGeometryUpdater.DynamicGeometryUpdater = DynamicBoxGeometryUpdater; @@ -274,19 +275,19 @@ BoxGeometryUpdater.DynamicGeometryUpdater = DynamicBoxGeometryUpdater; function DynamicBoxGeometryUpdater( geometryUpdater, primitives, - groundPrimitives + groundPrimitives, ) { DynamicGeometryUpdater.call( this, geometryUpdater, primitives, - groundPrimitives + groundPrimitives, ); } if (defined(Object.create)) { DynamicBoxGeometryUpdater.prototype = Object.create( - DynamicGeometryUpdater.prototype + DynamicGeometryUpdater.prototype, ); DynamicBoxGeometryUpdater.prototype.constructor = DynamicBoxGeometryUpdater; } @@ -295,7 +296,7 @@ DynamicBoxGeometryUpdater.prototype._isHidden = function (entity, box, time) { const position = Property.getValueOrUndefined( entity.position, time, - positionScratch + positionScratch, ); const dimensions = this._options.dimensions; return ( @@ -309,13 +310,13 @@ DynamicBoxGeometryUpdater.prototype._setOptions = function (entity, box, time) { const heightReference = Property.getValueOrDefault( box.heightReference, time, - HeightReference.NONE + HeightReference.NONE, ); const options = this._options; options.dimensions = Property.getValueOrUndefined( box.dimensions, time, - options.dimensions + options.dimensions, ); options.offsetAttribute = heightReference !== HeightReference.NONE diff --git a/packages/engine/Source/DataSources/BoxGraphics.js b/packages/engine/Source/DataSources/BoxGraphics.js index d922d1022850..05c4893a1b1c 100644 --- a/packages/engine/Source/DataSources/BoxGraphics.js +++ b/packages/engine/Source/DataSources/BoxGraphics.js @@ -153,7 +153,7 @@ Object.defineProperties(BoxGraphics.prototype, { * @type {Property|undefined} */ distanceDisplayCondition: createPropertyDescriptor( - "distanceDisplayCondition" + "distanceDisplayCondition", ), }); @@ -197,7 +197,7 @@ BoxGraphics.prototype.merge = function (source) { this.dimensions = defaultValue(this.dimensions, source.dimensions); this.heightReference = defaultValue( this.heightReference, - source.heightReference + source.heightReference, ); this.fill = defaultValue(this.fill, source.fill); this.material = defaultValue(this.material, source.material); @@ -207,7 +207,7 @@ BoxGraphics.prototype.merge = function (source) { this.shadows = defaultValue(this.shadows, source.shadows); this.distanceDisplayCondition = defaultValue( this.distanceDisplayCondition, - source.distanceDisplayCondition + source.distanceDisplayCondition, ); }; export default BoxGraphics; diff --git a/packages/engine/Source/DataSources/CallbackPositionProperty.js b/packages/engine/Source/DataSources/CallbackPositionProperty.js index 61909f995668..7c56bd377559 100644 --- a/packages/engine/Source/DataSources/CallbackPositionProperty.js +++ b/packages/engine/Source/DataSources/CallbackPositionProperty.js @@ -90,7 +90,7 @@ CallbackPositionProperty.prototype.getValue = function (time, result) { */ CallbackPositionProperty.prototype.setCallback = function ( callback, - isConstant + isConstant, ) { //>>includeStart('debug', pragmas.debug); if (!defined(callback)) { @@ -123,7 +123,7 @@ CallbackPositionProperty.prototype.setCallback = function ( CallbackPositionProperty.prototype.getValueInReferenceFrame = function ( time, referenceFrame, - result + result, ) { //>>includeStart('debug', pragmas.debug); if (!defined(time)) { @@ -141,7 +141,7 @@ CallbackPositionProperty.prototype.getValueInReferenceFrame = function ( value, this._referenceFrame, referenceFrame, - result + result, ); }; diff --git a/packages/engine/Source/DataSources/Cesium3DTilesetGraphics.js b/packages/engine/Source/DataSources/Cesium3DTilesetGraphics.js index 6eb239dd7e6b..7535fc8518ab 100644 --- a/packages/engine/Source/DataSources/Cesium3DTilesetGraphics.js +++ b/packages/engine/Source/DataSources/Cesium3DTilesetGraphics.js @@ -106,7 +106,7 @@ Cesium3DTilesetGraphics.prototype.merge = function (source) { this.uri = defaultValue(this.uri, source.uri); this.maximumScreenSpaceError = defaultValue( this.maximumScreenSpaceError, - source.maximumScreenSpaceError + source.maximumScreenSpaceError, ); }; diff --git a/packages/engine/Source/DataSources/Cesium3DTilesetVisualizer.js b/packages/engine/Source/DataSources/Cesium3DTilesetVisualizer.js index 2578ba67ade5..314edf37e1c1 100644 --- a/packages/engine/Source/DataSources/Cesium3DTilesetVisualizer.js +++ b/packages/engine/Source/DataSources/Cesium3DTilesetVisualizer.js @@ -31,7 +31,7 @@ function Cesium3DTilesetVisualizer(scene, entityCollection) { entityCollection.collectionChanged.addEventListener( Cesium3DTilesetVisualizer.prototype._onCollectionChanged, - this + this, ); this._scene = scene; @@ -75,7 +75,7 @@ Cesium3DTilesetVisualizer.prototype.update = function (time) { if (show) { modelMatrix = entity.computeModelMatrix(time, modelMatrixScratch); resource = Resource.createIfNeeded( - Property.getValueOrUndefined(tilesetGraphics._uri, time) + Property.getValueOrUndefined(tilesetGraphics._uri, time), ); } @@ -111,7 +111,7 @@ Cesium3DTilesetVisualizer.prototype.update = function (time) { tileset.maximumScreenSpaceError = Property.getValueOrDefault( tilesetGraphics.maximumScreenSpaceError, time, - tileset.maximumScreenSpaceError + tileset.maximumScreenSpaceError, ); } @@ -133,7 +133,7 @@ Cesium3DTilesetVisualizer.prototype.isDestroyed = function () { Cesium3DTilesetVisualizer.prototype.destroy = function () { this._entityCollection.collectionChanged.removeEventListener( Cesium3DTilesetVisualizer.prototype._onCollectionChanged, - this + this, ); const entities = this._entitiesToVisualize.values; const tilesetHash = this._tilesetHash; @@ -157,7 +157,7 @@ Cesium3DTilesetVisualizer.prototype.destroy = function () { */ Cesium3DTilesetVisualizer.prototype.getBoundingSphere = function ( entity, - result + result, ) { //>>includeStart('debug', pragmas.debug); if (!defined(entity)) { @@ -194,7 +194,7 @@ Cesium3DTilesetVisualizer.prototype._onCollectionChanged = function ( entityCollection, added, removed, - changed + changed, ) { let i; let entity; diff --git a/packages/engine/Source/DataSources/CheckerboardMaterialProperty.js b/packages/engine/Source/DataSources/CheckerboardMaterialProperty.js index 4dfc5c297e18..0745fbb506c1 100644 --- a/packages/engine/Source/DataSources/CheckerboardMaterialProperty.js +++ b/packages/engine/Source/DataSources/CheckerboardMaterialProperty.js @@ -126,13 +126,13 @@ CheckerboardMaterialProperty.prototype.getValue = function (time, result) { this._evenColor, time, defaultEvenColor, - result.lightColor + result.lightColor, ); result.darkColor = Property.getValueOrClonedDefault( this._oddColor, time, defaultOddColor, - result.darkColor + result.darkColor, ); result.repeat = Property.getValueOrDefault(this._repeat, time, defaultRepeat); return result; diff --git a/packages/engine/Source/DataSources/ColorMaterialProperty.js b/packages/engine/Source/DataSources/ColorMaterialProperty.js index 26928fad14c4..6ed511ca4ace 100644 --- a/packages/engine/Source/DataSources/ColorMaterialProperty.js +++ b/packages/engine/Source/DataSources/ColorMaterialProperty.js @@ -90,7 +90,7 @@ ColorMaterialProperty.prototype.getValue = function (time, result) { this._color, time, Color.WHITE, - result.color + result.color, ); return result; }; diff --git a/packages/engine/Source/DataSources/CompositeEntityCollection.js b/packages/engine/Source/DataSources/CompositeEntityCollection.js index 56dcf75fc3cd..aca6e2e61b82 100644 --- a/packages/engine/Source/DataSources/CompositeEntityCollection.js +++ b/packages/engine/Source/DataSources/CompositeEntityCollection.js @@ -23,12 +23,11 @@ function clean(entity) { function subscribeToEntity(that, eventHash, collectionId, entity) { entityIdScratch[0] = collectionId; entityIdScratch[1] = entity.id; - eventHash[ - JSON.stringify(entityIdScratch) - ] = entity.definitionChanged.addEventListener( - CompositeEntityCollection.prototype._onDefinitionChanged, - that - ); + eventHash[JSON.stringify(entityIdScratch)] = + entity.definitionChanged.addEventListener( + CompositeEntityCollection.prototype._onDefinitionChanged, + that, + ); } function unsubscribeFromEntity(that, eventHash, collectionId, entity) { @@ -65,7 +64,7 @@ function recomposite(that) { collection = collectionsCopy[i]; collection.collectionChanged.removeEventListener( CompositeEntityCollection.prototype._onCollectionChanged, - that + that, ); entities = collection.values; collectionId = collection.id; @@ -79,7 +78,7 @@ function recomposite(that) { collection = collections[i]; collection.collectionChanged.addEventListener( CompositeEntityCollection.prototype._onCollectionChanged, - that + that, ); //Merge all of the existing entities. @@ -200,7 +199,7 @@ Object.defineProperties(CompositeEntityCollection.prototype, { */ CompositeEntityCollection.prototype.addCollection = function ( collection, - index + index, ) { const hasIndex = defined(index); //>>includeStart('debug', pragmas.debug); @@ -212,7 +211,7 @@ CompositeEntityCollection.prototype.addCollection = function ( throw new DeveloperError("index must be greater than or equal to zero."); } else if (index > this._collections.length) { throw new DeveloperError( - "index must be less than or equal to the number of collections." + "index must be less than or equal to the number of collections.", ); } } @@ -371,7 +370,7 @@ CompositeEntityCollection.prototype.lowerCollection = function (collection) { * @exception {DeveloperError} collection is not in this composite. */ CompositeEntityCollection.prototype.raiseCollectionToTop = function ( - collection + collection, ) { const index = getCollectionIndex(this._collections, collection); if (index === this._collections.length - 1) { @@ -391,7 +390,7 @@ CompositeEntityCollection.prototype.raiseCollectionToTop = function ( * @exception {DeveloperError} collection is not in this composite. */ CompositeEntityCollection.prototype.lowerCollectionToBottom = function ( - collection + collection, ) { const index = getCollectionIndex(this._collections, collection); if (index === 0) { @@ -432,7 +431,7 @@ CompositeEntityCollection.prototype.resumeEvents = function () { //>>includeStart('debug', pragmas.debug); if (this._suspendCount === 0) { throw new DeveloperError( - "resumeEvents can not be called before suspendEvents." + "resumeEvents can not be called before suspendEvents.", ); } //>>includeEnd('debug'); @@ -472,7 +471,7 @@ CompositeEntityCollection.prototype.getById = function (id) { CompositeEntityCollection.prototype._onCollectionChanged = function ( collection, added, - removed + removed, ) { const collections = this._collectionsCopy; const collectionsLength = collections.length; @@ -546,7 +545,7 @@ CompositeEntityCollection.prototype._onDefinitionChanged = function ( entity, propertyName, newValue, - oldValue + oldValue, ) { const collections = this._collections; const composite = this._composite; diff --git a/packages/engine/Source/DataSources/CompositeMaterialProperty.js b/packages/engine/Source/DataSources/CompositeMaterialProperty.js index 303d90c90c46..93b16ab7aecf 100644 --- a/packages/engine/Source/DataSources/CompositeMaterialProperty.js +++ b/packages/engine/Source/DataSources/CompositeMaterialProperty.js @@ -16,7 +16,7 @@ function CompositeMaterialProperty() { this._composite = new CompositeProperty(); this._composite.definitionChanged.addEventListener( CompositeMaterialProperty.prototype._raiseDefinitionChanged, - this + this, ); } @@ -74,9 +74,8 @@ CompositeMaterialProperty.prototype.getType = function (time) { } //>>includeEnd('debug'); - const innerProperty = this._composite._intervals.findDataForIntervalContainingDate( - time - ); + const innerProperty = + this._composite._intervals.findDataForIntervalContainingDate(time); if (defined(innerProperty)) { return innerProperty.getType(time); } @@ -97,9 +96,8 @@ CompositeMaterialProperty.prototype.getValue = function (time, result) { time = JulianDate.now(timeScratch); } - const innerProperty = this._composite._intervals.findDataForIntervalContainingDate( - time - ); + const innerProperty = + this._composite._intervals.findDataForIntervalContainingDate(time); if (defined(innerProperty)) { return innerProperty.getValue(time, result); } diff --git a/packages/engine/Source/DataSources/CompositePositionProperty.js b/packages/engine/Source/DataSources/CompositePositionProperty.js index 202b6fe43026..ff50c9e169a5 100644 --- a/packages/engine/Source/DataSources/CompositePositionProperty.js +++ b/packages/engine/Source/DataSources/CompositePositionProperty.js @@ -21,7 +21,7 @@ function CompositePositionProperty(referenceFrame) { this._composite = new CompositeProperty(); this._composite.definitionChanged.addEventListener( CompositePositionProperty.prototype._raiseDefinitionChanged, - this + this, ); } @@ -110,7 +110,7 @@ CompositePositionProperty.prototype.getValue = function (time, result) { CompositePositionProperty.prototype.getValueInReferenceFrame = function ( time, referenceFrame, - result + result, ) { //>>includeStart('debug', pragmas.debug); if (!defined(time)) { @@ -121,9 +121,8 @@ CompositePositionProperty.prototype.getValueInReferenceFrame = function ( } //>>includeEnd('debug'); - const innerProperty = this._composite._intervals.findDataForIntervalContainingDate( - time - ); + const innerProperty = + this._composite._intervals.findDataForIntervalContainingDate(time); if (defined(innerProperty)) { return innerProperty.getValueInReferenceFrame(time, referenceFrame, result); } diff --git a/packages/engine/Source/DataSources/CompositeProperty.js b/packages/engine/Source/DataSources/CompositeProperty.js index 4af69c9f0eed..fa90f54ffa6e 100644 --- a/packages/engine/Source/DataSources/CompositeProperty.js +++ b/packages/engine/Source/DataSources/CompositeProperty.js @@ -58,7 +58,7 @@ function CompositeProperty() { this._intervals = new TimeIntervalCollection(); this._intervals.changedEvent.addEventListener( CompositeProperty.prototype._intervalsChanged, - this + this, ); } @@ -147,7 +147,7 @@ CompositeProperty.prototype._intervalsChanged = function () { this, this._eventHelper, this._definitionChanged, - this._intervals + this._intervals, ); this._definitionChanged.raiseEvent(this); }; diff --git a/packages/engine/Source/DataSources/ConstantPositionProperty.js b/packages/engine/Source/DataSources/ConstantPositionProperty.js index b2a436383bf5..946704d563b3 100644 --- a/packages/engine/Source/DataSources/ConstantPositionProperty.js +++ b/packages/engine/Source/DataSources/ConstantPositionProperty.js @@ -114,7 +114,7 @@ ConstantPositionProperty.prototype.setValue = function (value, referenceFrame) { ConstantPositionProperty.prototype.getValueInReferenceFrame = function ( time, referenceFrame, - result + result, ) { //>>includeStart('debug', pragmas.debug); if (!defined(time)) { @@ -130,7 +130,7 @@ ConstantPositionProperty.prototype.getValueInReferenceFrame = function ( this._value, this._referenceFrame, referenceFrame, - result + result, ); }; diff --git a/packages/engine/Source/DataSources/CorridorGeometryUpdater.js b/packages/engine/Source/DataSources/CorridorGeometryUpdater.js index 74cb9d3aeaf6..b0ae56966580 100644 --- a/packages/engine/Source/DataSources/CorridorGeometryUpdater.js +++ b/packages/engine/Source/DataSources/CorridorGeometryUpdater.js @@ -62,7 +62,7 @@ function CorridorGeometryUpdater(entity, scene) { if (defined(Object.create)) { CorridorGeometryUpdater.prototype = Object.create( - GroundGeometryUpdater.prototype + GroundGeometryUpdater.prototype, ); CorridorGeometryUpdater.prototype.constructor = CorridorGeometryUpdater; } @@ -81,7 +81,7 @@ CorridorGeometryUpdater.prototype.createFillGeometryInstance = function (time) { if (!this._fillEnabled) { throw new DeveloperError( - "This instance does not represent a filled geometry." + "This instance does not represent a filled geometry.", ); } //>>includeEnd('debug'); @@ -94,11 +94,12 @@ CorridorGeometryUpdater.prototype.createFillGeometryInstance = function (time) { isAvailable && entity.isShowing && this._showProperty.getValue(time) && - this._fillProperty.getValue(time) - ), - distanceDisplayCondition: DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition( - this._distanceDisplayConditionProperty.getValue(time) + this._fillProperty.getValue(time), ), + distanceDisplayCondition: + DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition( + this._distanceDisplayConditionProperty.getValue(time), + ), offset: undefined, color: undefined, }; @@ -123,8 +124,8 @@ CorridorGeometryUpdater.prototype.createFillGeometryInstance = function (time) { this._terrainOffsetProperty, time, defaultOffset, - offsetScratch - ) + offsetScratch, + ), ); } @@ -144,14 +145,14 @@ CorridorGeometryUpdater.prototype.createFillGeometryInstance = function (time) { * @exception {DeveloperError} This instance does not represent an outlined geometry. */ CorridorGeometryUpdater.prototype.createOutlineGeometryInstance = function ( - time + time, ) { //>>includeStart('debug', pragmas.debug); Check.defined("time", time); if (!this._outlineEnabled) { throw new DeveloperError( - "This instance does not represent an outlined geometry." + "This instance does not represent an outlined geometry.", ); } //>>includeEnd('debug'); @@ -162,7 +163,7 @@ CorridorGeometryUpdater.prototype.createOutlineGeometryInstance = function ( this._outlineColorProperty, time, Color.BLACK, - scratchColor + scratchColor, ); const attributes = { @@ -170,12 +171,13 @@ CorridorGeometryUpdater.prototype.createOutlineGeometryInstance = function ( isAvailable && entity.isShowing && this._showProperty.getValue(time) && - this._showOutlineProperty.getValue(time) + this._showOutlineProperty.getValue(time), ), color: ColorGeometryInstanceAttribute.fromColor(outlineColor), - distanceDisplayCondition: DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition( - this._distanceDisplayConditionProperty.getValue(time) - ), + distanceDisplayCondition: + DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition( + this._distanceDisplayConditionProperty.getValue(time), + ), offset: undefined, }; @@ -185,8 +187,8 @@ CorridorGeometryUpdater.prototype.createOutlineGeometryInstance = function ( this._terrainOffsetProperty, time, defaultOffset, - offsetScratch - ) + offsetScratch, + ), ); } @@ -200,14 +202,14 @@ CorridorGeometryUpdater.prototype.createOutlineGeometryInstance = function ( CorridorGeometryUpdater.prototype._computeCenter = function (time, result) { const positions = Property.getValueOrUndefined( this._entity.corridor.positions, - time + time, ); if (!defined(positions) || positions.length === 0) { return; } return Cartesian3.clone( positions[Math.floor(positions.length / 2.0)], - result + result, ); }; @@ -237,25 +239,25 @@ CorridorGeometryUpdater.prototype._isDynamic = function (entity, corridor) { CorridorGeometryUpdater.prototype._setStaticOptions = function ( entity, - corridor + corridor, ) { let heightValue = Property.getValueOrUndefined( corridor.height, - Iso8601.MINIMUM_VALUE + Iso8601.MINIMUM_VALUE, ); const heightReferenceValue = Property.getValueOrDefault( corridor.heightReference, Iso8601.MINIMUM_VALUE, - HeightReference.NONE + HeightReference.NONE, ); let extrudedHeightValue = Property.getValueOrUndefined( corridor.extrudedHeight, - Iso8601.MINIMUM_VALUE + Iso8601.MINIMUM_VALUE, ); const extrudedHeightReferenceValue = Property.getValueOrDefault( corridor.extrudedHeightReference, Iso8601.MINIMUM_VALUE, - HeightReference.NONE + HeightReference.NONE, ); if (defined(extrudedHeightValue) && !defined(heightValue)) { heightValue = 0; @@ -268,35 +270,36 @@ CorridorGeometryUpdater.prototype._setStaticOptions = function ( : MaterialAppearance.MaterialSupport.TEXTURED.vertexFormat; options.positions = corridor.positions.getValue( Iso8601.MINIMUM_VALUE, - options.positions + options.positions, ); options.width = corridor.width.getValue(Iso8601.MINIMUM_VALUE); options.granularity = Property.getValueOrUndefined( corridor.granularity, - Iso8601.MINIMUM_VALUE + Iso8601.MINIMUM_VALUE, ); options.cornerType = Property.getValueOrUndefined( corridor.cornerType, - Iso8601.MINIMUM_VALUE - ); - options.offsetAttribute = GroundGeometryUpdater.computeGeometryOffsetAttribute( - heightValue, - heightReferenceValue, - extrudedHeightValue, - extrudedHeightReferenceValue + Iso8601.MINIMUM_VALUE, ); + options.offsetAttribute = + GroundGeometryUpdater.computeGeometryOffsetAttribute( + heightValue, + heightReferenceValue, + extrudedHeightValue, + extrudedHeightReferenceValue, + ); options.height = GroundGeometryUpdater.getGeometryHeight( heightValue, - heightReferenceValue + heightReferenceValue, ); extrudedHeightValue = GroundGeometryUpdater.getGeometryExtrudedHeight( extrudedHeightValue, - extrudedHeightReferenceValue + extrudedHeightReferenceValue, ); if (extrudedHeightValue === GroundGeometryUpdater.CLAMP_TO_GROUND) { extrudedHeightValue = ApproximateTerrainHeights.getMinimumMaximumHeights( - CorridorGeometry.computeRectangle(options, scratchRectangle) + CorridorGeometry.computeRectangle(options, scratchRectangle), ).minimumTerrainHeight; } @@ -311,27 +314,28 @@ CorridorGeometryUpdater.DynamicGeometryUpdater = DynamicCorridorGeometryUpdater; function DynamicCorridorGeometryUpdater( geometryUpdater, primitives, - groundPrimitives + groundPrimitives, ) { DynamicGeometryUpdater.call( this, geometryUpdater, primitives, - groundPrimitives + groundPrimitives, ); } if (defined(Object.create)) { DynamicCorridorGeometryUpdater.prototype = Object.create( - DynamicGeometryUpdater.prototype + DynamicGeometryUpdater.prototype, ); - DynamicCorridorGeometryUpdater.prototype.constructor = DynamicCorridorGeometryUpdater; + DynamicCorridorGeometryUpdater.prototype.constructor = + DynamicCorridorGeometryUpdater; } DynamicCorridorGeometryUpdater.prototype._isHidden = function ( entity, corridor, - time + time, ) { const options = this._options; return ( @@ -341,7 +345,7 @@ DynamicCorridorGeometryUpdater.prototype._isHidden = function ( this, entity, corridor, - time + time, ) ); }; @@ -349,23 +353,23 @@ DynamicCorridorGeometryUpdater.prototype._isHidden = function ( DynamicCorridorGeometryUpdater.prototype._setOptions = function ( entity, corridor, - time + time, ) { const options = this._options; let heightValue = Property.getValueOrUndefined(corridor.height, time); const heightReferenceValue = Property.getValueOrDefault( corridor.heightReference, time, - HeightReference.NONE + HeightReference.NONE, ); let extrudedHeightValue = Property.getValueOrUndefined( corridor.extrudedHeight, - time + time, ); const extrudedHeightReferenceValue = Property.getValueOrDefault( corridor.extrudedHeightReference, time, - HeightReference.NONE + HeightReference.NONE, ); if (defined(extrudedHeightValue) && !defined(heightValue)) { heightValue = 0; @@ -375,27 +379,28 @@ DynamicCorridorGeometryUpdater.prototype._setOptions = function ( options.width = Property.getValueOrUndefined(corridor.width, time); options.granularity = Property.getValueOrUndefined( corridor.granularity, - time + time, ); options.cornerType = Property.getValueOrUndefined(corridor.cornerType, time); - options.offsetAttribute = GroundGeometryUpdater.computeGeometryOffsetAttribute( - heightValue, - heightReferenceValue, - extrudedHeightValue, - extrudedHeightReferenceValue - ); + options.offsetAttribute = + GroundGeometryUpdater.computeGeometryOffsetAttribute( + heightValue, + heightReferenceValue, + extrudedHeightValue, + extrudedHeightReferenceValue, + ); options.height = GroundGeometryUpdater.getGeometryHeight( heightValue, - heightReferenceValue + heightReferenceValue, ); extrudedHeightValue = GroundGeometryUpdater.getGeometryExtrudedHeight( extrudedHeightValue, - extrudedHeightReferenceValue + extrudedHeightReferenceValue, ); if (extrudedHeightValue === GroundGeometryUpdater.CLAMP_TO_GROUND) { extrudedHeightValue = ApproximateTerrainHeights.getMinimumMaximumHeights( - CorridorGeometry.computeRectangle(options, scratchRectangle) + CorridorGeometry.computeRectangle(options, scratchRectangle), ).minimumTerrainHeight; } diff --git a/packages/engine/Source/DataSources/CorridorGraphics.js b/packages/engine/Source/DataSources/CorridorGraphics.js index b33c6ee21cd0..eefe7567d8ff 100644 --- a/packages/engine/Source/DataSources/CorridorGraphics.js +++ b/packages/engine/Source/DataSources/CorridorGraphics.js @@ -227,7 +227,7 @@ Object.defineProperties(CorridorGraphics.prototype, { * @type {Property|undefined} */ distanceDisplayCondition: createPropertyDescriptor( - "distanceDisplayCondition" + "distanceDisplayCondition", ), /** @@ -297,15 +297,15 @@ CorridorGraphics.prototype.merge = function (source) { this.height = defaultValue(this.height, source.height); this.heightReference = defaultValue( this.heightReference, - source.heightReference + source.heightReference, ); this.extrudedHeight = defaultValue( this.extrudedHeight, - source.extrudedHeight + source.extrudedHeight, ); this.extrudedHeightReference = defaultValue( this.extrudedHeightReference, - source.extrudedHeightReference + source.extrudedHeightReference, ); this.cornerType = defaultValue(this.cornerType, source.cornerType); this.granularity = defaultValue(this.granularity, source.granularity); @@ -317,11 +317,11 @@ CorridorGraphics.prototype.merge = function (source) { this.shadows = defaultValue(this.shadows, source.shadows); this.distanceDisplayCondition = defaultValue( this.distanceDisplayCondition, - source.distanceDisplayCondition + source.distanceDisplayCondition, ); this.classificationType = defaultValue( this.classificationType, - source.classificationType + source.classificationType, ); this.zIndex = defaultValue(this.zIndex, source.zIndex); }; diff --git a/packages/engine/Source/DataSources/CylinderGeometryUpdater.js b/packages/engine/Source/DataSources/CylinderGeometryUpdater.js index 885ce2d1afb7..086d74834dd5 100644 --- a/packages/engine/Source/DataSources/CylinderGeometryUpdater.js +++ b/packages/engine/Source/DataSources/CylinderGeometryUpdater.js @@ -98,7 +98,7 @@ CylinderGeometryUpdater.prototype.createFillGeometryInstance = function (time) { if (!this._fillEnabled) { throw new DeveloperError( - "This instance does not represent a filled geometry." + "This instance does not represent a filled geometry.", ); } //>>includeEnd('debug'); @@ -110,14 +110,14 @@ CylinderGeometryUpdater.prototype.createFillGeometryInstance = function (time) { isAvailable && entity.isShowing && this._showProperty.getValue(time) && - this._fillProperty.getValue(time) - ); - const distanceDisplayCondition = this._distanceDisplayConditionProperty.getValue( - time - ); - const distanceDisplayConditionAttribute = DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition( - distanceDisplayCondition + this._fillProperty.getValue(time), ); + const distanceDisplayCondition = + this._distanceDisplayConditionProperty.getValue(time); + const distanceDisplayConditionAttribute = + DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition( + distanceDisplayCondition, + ); const attributes = { show: show, @@ -145,8 +145,8 @@ CylinderGeometryUpdater.prototype.createFillGeometryInstance = function (time) { this._terrainOffsetProperty, time, defaultOffset, - offsetScratch - ) + offsetScratch, + ), ); } @@ -157,7 +157,7 @@ CylinderGeometryUpdater.prototype.createFillGeometryInstance = function (time) { time, entity.cylinder.heightReference, this._options.length * 0.5, - this._scene.ellipsoid + this._scene.ellipsoid, ), attributes: attributes, }); @@ -172,14 +172,14 @@ CylinderGeometryUpdater.prototype.createFillGeometryInstance = function (time) { * @exception {DeveloperError} This instance does not represent an outlined geometry. */ CylinderGeometryUpdater.prototype.createOutlineGeometryInstance = function ( - time + time, ) { //>>includeStart('debug', pragmas.debug); Check.defined("time", time); if (!this._outlineEnabled) { throw new DeveloperError( - "This instance does not represent an outlined geometry." + "This instance does not represent an outlined geometry.", ); } //>>includeEnd('debug'); @@ -190,23 +190,23 @@ CylinderGeometryUpdater.prototype.createOutlineGeometryInstance = function ( this._outlineColorProperty, time, Color.BLACK, - scratchColor - ); - const distanceDisplayCondition = this._distanceDisplayConditionProperty.getValue( - time + scratchColor, ); + const distanceDisplayCondition = + this._distanceDisplayConditionProperty.getValue(time); const attributes = { show: new ShowGeometryInstanceAttribute( isAvailable && entity.isShowing && this._showProperty.getValue(time) && - this._showOutlineProperty.getValue(time) + this._showOutlineProperty.getValue(time), ), color: ColorGeometryInstanceAttribute.fromColor(outlineColor), - distanceDisplayCondition: DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition( - distanceDisplayCondition - ), + distanceDisplayCondition: + DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition( + distanceDisplayCondition, + ), offset: undefined, }; if (defined(this._options.offsetAttribute)) { @@ -215,8 +215,8 @@ CylinderGeometryUpdater.prototype.createOutlineGeometryInstance = function ( this._terrainOffsetProperty, time, defaultOffset, - offsetScratch - ) + offsetScratch, + ), ); } @@ -227,7 +227,7 @@ CylinderGeometryUpdater.prototype.createOutlineGeometryInstance = function ( time, entity.cylinder.heightReference, this._options.length * 0.5, - this._scene.ellipsoid + this._scene.ellipsoid, ), attributes: attributes, }); @@ -262,12 +262,12 @@ CylinderGeometryUpdater.prototype._isDynamic = function (entity, cylinder) { CylinderGeometryUpdater.prototype._setStaticOptions = function ( entity, - cylinder + cylinder, ) { const heightReference = Property.getValueOrDefault( cylinder.heightReference, Iso8601.MINIMUM_VALUE, - HeightReference.NONE + HeightReference.NONE, ); const options = this._options; options.vertexFormat = @@ -279,11 +279,11 @@ CylinderGeometryUpdater.prototype._setStaticOptions = function ( options.bottomRadius = cylinder.bottomRadius.getValue(Iso8601.MINIMUM_VALUE); options.slices = Property.getValueOrUndefined( cylinder.slices, - Iso8601.MINIMUM_VALUE + Iso8601.MINIMUM_VALUE, ); options.numberOfVerticalLines = Property.getValueOrUndefined( cylinder.numberOfVerticalLines, - Iso8601.MINIMUM_VALUE + Iso8601.MINIMUM_VALUE, ); options.offsetAttribute = heightReference !== HeightReference.NONE @@ -291,7 +291,8 @@ CylinderGeometryUpdater.prototype._setStaticOptions = function ( : undefined; }; -CylinderGeometryUpdater.prototype._onEntityPropertyChanged = heightReferenceOnEntityPropertyChanged; +CylinderGeometryUpdater.prototype._onEntityPropertyChanged = + heightReferenceOnEntityPropertyChanged; CylinderGeometryUpdater.DynamicGeometryUpdater = DynamicCylinderGeometryUpdater; @@ -301,33 +302,34 @@ CylinderGeometryUpdater.DynamicGeometryUpdater = DynamicCylinderGeometryUpdater; function DynamicCylinderGeometryUpdater( geometryUpdater, primitives, - groundPrimitives + groundPrimitives, ) { DynamicGeometryUpdater.call( this, geometryUpdater, primitives, - groundPrimitives + groundPrimitives, ); } if (defined(Object.create)) { DynamicCylinderGeometryUpdater.prototype = Object.create( - DynamicGeometryUpdater.prototype + DynamicGeometryUpdater.prototype, ); - DynamicCylinderGeometryUpdater.prototype.constructor = DynamicCylinderGeometryUpdater; + DynamicCylinderGeometryUpdater.prototype.constructor = + DynamicCylinderGeometryUpdater; } DynamicCylinderGeometryUpdater.prototype._isHidden = function ( entity, cylinder, - time + time, ) { const options = this._options; const position = Property.getValueOrUndefined( entity.position, time, - positionScratch + positionScratch, ); return ( !defined(position) || @@ -338,7 +340,7 @@ DynamicCylinderGeometryUpdater.prototype._isHidden = function ( this, entity, cylinder, - time + time, ) ); }; @@ -346,24 +348,24 @@ DynamicCylinderGeometryUpdater.prototype._isHidden = function ( DynamicCylinderGeometryUpdater.prototype._setOptions = function ( entity, cylinder, - time + time, ) { const heightReference = Property.getValueOrDefault( cylinder.heightReference, time, - HeightReference.NONE + HeightReference.NONE, ); const options = this._options; options.length = Property.getValueOrUndefined(cylinder.length, time); options.topRadius = Property.getValueOrUndefined(cylinder.topRadius, time); options.bottomRadius = Property.getValueOrUndefined( cylinder.bottomRadius, - time + time, ); options.slices = Property.getValueOrUndefined(cylinder.slices, time); options.numberOfVerticalLines = Property.getValueOrUndefined( cylinder.numberOfVerticalLines, - time + time, ); options.offsetAttribute = heightReference !== HeightReference.NONE diff --git a/packages/engine/Source/DataSources/CylinderGraphics.js b/packages/engine/Source/DataSources/CylinderGraphics.js index 9f25286c042f..370e778a4e5d 100644 --- a/packages/engine/Source/DataSources/CylinderGraphics.js +++ b/packages/engine/Source/DataSources/CylinderGraphics.js @@ -194,7 +194,7 @@ Object.defineProperties(CylinderGraphics.prototype, { * @type {Property|undefined} */ distanceDisplayCondition: createPropertyDescriptor( - "distanceDisplayCondition" + "distanceDisplayCondition", ), }); @@ -244,7 +244,7 @@ CylinderGraphics.prototype.merge = function (source) { this.bottomRadius = defaultValue(this.bottomRadius, source.bottomRadius); this.heightReference = defaultValue( this.heightReference, - source.heightReference + source.heightReference, ); this.fill = defaultValue(this.fill, source.fill); this.material = defaultValue(this.material, source.material); @@ -253,13 +253,13 @@ CylinderGraphics.prototype.merge = function (source) { this.outlineWidth = defaultValue(this.outlineWidth, source.outlineWidth); this.numberOfVerticalLines = defaultValue( this.numberOfVerticalLines, - source.numberOfVerticalLines + source.numberOfVerticalLines, ); this.slices = defaultValue(this.slices, source.slices); this.shadows = defaultValue(this.shadows, source.shadows); this.distanceDisplayCondition = defaultValue( this.distanceDisplayCondition, - source.distanceDisplayCondition + source.distanceDisplayCondition, ); }; export default CylinderGraphics; diff --git a/packages/engine/Source/DataSources/CzmlDataSource.js b/packages/engine/Source/DataSources/CzmlDataSource.js index b0921c3c1fa1..ef48b6c9016f 100644 --- a/packages/engine/Source/DataSources/CzmlDataSource.js +++ b/packages/engine/Source/DataSources/CzmlDataSource.js @@ -118,14 +118,14 @@ function createSpecializedProperty(type, entityCollection, packetData) { if (defined(packetData.velocityReference)) { const referenceProperty = createReferenceProperty( entityCollection, - packetData.velocityReference + packetData.velocityReference, ); switch (type) { case Cartesian3: case UnitCartesian3: return new VelocityVectorProperty( referenceProperty, - type === UnitCartesian3 + type === UnitCartesian3, ); case Quaternion: return new VelocityOrientationProperty(referenceProperty); @@ -281,7 +281,7 @@ function convertCartographicRadiansToCartesian(cartographicRadians) { scratchCartographic.height = cartographicRadians[2]; Ellipsoid.default.cartographicToCartesian( scratchCartographic, - scratchCartesian + scratchCartesian, ); return [scratchCartesian.x, scratchCartesian.y, scratchCartesian.z]; } @@ -295,7 +295,7 @@ function convertCartographicRadiansToCartesian(cartographicRadians) { scratchCartographic.height = cartographicRadians[i + 3]; Ellipsoid.default.cartographicToCartesian( scratchCartographic, - scratchCartesian + scratchCartesian, ); result[i + 1] = scratchCartesian.x; @@ -309,13 +309,13 @@ function convertCartographicDegreesToCartesian(cartographicDegrees) { const length = cartographicDegrees.length; if (length === 3) { scratchCartographic.longitude = CesiumMath.toRadians( - cartographicDegrees[0] + cartographicDegrees[0], ); scratchCartographic.latitude = CesiumMath.toRadians(cartographicDegrees[1]); scratchCartographic.height = cartographicDegrees[2]; Ellipsoid.default.cartographicToCartesian( scratchCartographic, - scratchCartesian + scratchCartesian, ); return [scratchCartesian.x, scratchCartesian.y, scratchCartesian.z]; } @@ -325,15 +325,15 @@ function convertCartographicDegreesToCartesian(cartographicDegrees) { result[i] = cartographicDegrees[i]; scratchCartographic.longitude = CesiumMath.toRadians( - cartographicDegrees[i + 1] + cartographicDegrees[i + 1], ); scratchCartographic.latitude = CesiumMath.toRadians( - cartographicDegrees[i + 2] + cartographicDegrees[i + 2], ); scratchCartographic.height = cartographicDegrees[i + 3]; Ellipsoid.default.cartographicToCartesian( scratchCartographic, - scratchCartesian + scratchCartesian, ); result[i + 1] = scratchCartesian.x; @@ -380,7 +380,7 @@ function unwrapCartesianInterval(czmlInterval) { } throw new RuntimeError( - `${JSON.stringify(czmlInterval)} is not a valid CZML interval.` + `${JSON.stringify(czmlInterval)} is not a valid CZML interval.`, ); } @@ -558,7 +558,7 @@ function unwrapInterval(type, czmlInterval, sourceUri) { return unwrapUriInterval(czmlInterval, sourceUri); case JulianDate: return JulianDate.fromIso8601( - defaultValue(czmlInterval.date, czmlInterval) + defaultValue(czmlInterval.date, czmlInterval), ); case LabelStyle: return LabelStyle[defaultValue(czmlInterval.labelStyle, czmlInterval)]; @@ -571,7 +571,7 @@ function unwrapInterval(type, czmlInterval, sourceUri) { case Object: return defaultValue( defaultValue(czmlInterval.object, czmlInterval.value), - czmlInterval + czmlInterval, ); case Quaternion: return unwrapQuaternionInterval(czmlInterval); @@ -585,7 +585,7 @@ function unwrapInterval(type, czmlInterval, sourceUri) { return ShadowMode[ defaultValue( defaultValue(czmlInterval.shadowMode, czmlInterval.shadows), - czmlInterval + czmlInterval, ) ]; case String: @@ -686,7 +686,7 @@ function processProperty( packetData, constrainedInterval, sourceUri, - entityCollection + entityCollection, ) { let combinedInterval = intervalFromString(packetData.interval); if (defined(constrainedInterval)) { @@ -694,7 +694,7 @@ function processProperty( combinedInterval = TimeInterval.intersect( combinedInterval, constrainedInterval, - scratchTimeInterval + scratchTimeInterval, ); } else { combinedInterval = constrainedInterval; @@ -753,13 +753,13 @@ function processProperty( if (!isSampled && !hasInterval) { if (isValue) { object[propertyName] = new ConstantProperty( - needsUnpacking ? type.unpack(unwrappedInterval, 0) : unwrappedInterval + needsUnpacking ? type.unpack(unwrappedInterval, 0) : unwrappedInterval, ); } else { object[propertyName] = createSpecializedProperty( type, entityCollection, - packetData + packetData, ); } return; @@ -800,7 +800,7 @@ function processProperty( combinedInterval.data = createSpecializedProperty( type, entityCollection, - packetData + packetData, ); } @@ -870,7 +870,7 @@ function removePropertyData(property, interval) { const intersection = TimeInterval.intersect( intervals.get(i), interval, - scratchTimeInterval + scratchTimeInterval, ); if (!intersection.isEmpty) { // remove data from the contained properties @@ -890,7 +890,7 @@ function processPacketData( packetData, interval, sourceUri, - entityCollection + entityCollection, ) { if (!defined(packetData)) { return; @@ -905,7 +905,7 @@ function processPacketData( packetData[i], interval, sourceUri, - entityCollection + entityCollection, ); } } else { @@ -916,7 +916,7 @@ function processPacketData( packetData, interval, sourceUri, - entityCollection + entityCollection, ); } } @@ -927,7 +927,7 @@ function processPositionProperty( packetData, constrainedInterval, sourceUri, - entityCollection + entityCollection, ) { let combinedInterval = intervalFromString(packetData.interval); if (defined(constrainedInterval)) { @@ -935,7 +935,7 @@ function processPositionProperty( combinedInterval = TimeInterval.intersect( combinedInterval, constrainedInterval, - scratchTimeInterval + scratchTimeInterval, ); } else { combinedInterval = constrainedInterval; @@ -980,12 +980,12 @@ function processPositionProperty( if (isValue) { object[propertyName] = new ConstantPositionProperty( Cartesian3.unpack(unwrappedInterval), - referenceFrame + referenceFrame, ); } else { object[propertyName] = createReferenceProperty( entityCollection, - packetData.reference + packetData.reference, ); } return; @@ -1008,7 +1008,7 @@ function processPositionProperty( ) { object[propertyName] = property = new SampledPositionProperty( referenceFrame, - numberOfDerivatives + numberOfDerivatives, ); } property.addSamplesPackedArray(unwrappedInterval, epoch); @@ -1029,7 +1029,7 @@ function processPositionProperty( } else { combinedInterval.data = createReferenceProperty( entityCollection, - packetData.reference + packetData.reference, ); } @@ -1056,21 +1056,20 @@ function processPositionProperty( if (isValue) { combinedInterval.data = new ConstantPositionProperty( combinedInterval.data, - referenceFrame + referenceFrame, ); } property.intervals.addInterval(combinedInterval); } else { // Otherwise, create a CompositePositionProperty but preserve the existing data. - object[propertyName] = property = convertPositionPropertyToComposite( - property - ); + object[propertyName] = property = + convertPositionPropertyToComposite(property); // Change the new data to a ConstantPositionProperty and add it. if (isValue) { combinedInterval.data = new ConstantPositionProperty( combinedInterval.data, - referenceFrame + referenceFrame, ); } property.intervals.addInterval(combinedInterval); @@ -1082,13 +1081,12 @@ function processPositionProperty( // isSampled && hasInterval if (!defined(property)) { object[propertyName] = property = new CompositePositionProperty( - referenceFrame + referenceFrame, ); } else if (!(property instanceof CompositePositionProperty)) { // Create a CompositeProperty but preserve the existing data. - object[propertyName] = property = convertPositionPropertyToComposite( - property - ); + object[propertyName] = property = + convertPositionPropertyToComposite(property); } // Check if the interval already exists in the composite. @@ -1103,7 +1101,7 @@ function processPositionProperty( interval = combinedInterval.clone(); interval.data = new SampledPositionProperty( referenceFrame, - numberOfDerivatives + numberOfDerivatives, ); intervals.addInterval(interval); } @@ -1124,7 +1122,7 @@ function removePositionPropertyData(property, interval) { const intersection = TimeInterval.intersect( intervals.get(i), interval, - scratchTimeInterval + scratchTimeInterval, ); if (!intersection.isEmpty) { // remove data from the contained properties @@ -1143,7 +1141,7 @@ function processPositionPacketData( packetData, interval, sourceUri, - entityCollection + entityCollection, ) { if (!defined(packetData)) { return; @@ -1157,7 +1155,7 @@ function processPositionPacketData( packetData[i], interval, sourceUri, - entityCollection + entityCollection, ); } } else { @@ -1167,7 +1165,7 @@ function processPositionPacketData( packetData, interval, sourceUri, - entityCollection + entityCollection, ); } } @@ -1176,7 +1174,7 @@ function processShapePacketData( object, propertyName, packetData, - entityCollection + entityCollection, ) { if (defined(packetData.references)) { processReferencesArrayPacketData( @@ -1186,7 +1184,7 @@ function processShapePacketData( packetData.interval, entityCollection, PropertyArray, - CompositeProperty + CompositeProperty, ); } else { if (defined(packetData.cartesian2)) { @@ -1204,7 +1202,7 @@ function processShapePacketData( packetData, undefined, undefined, - entityCollection + entityCollection, ); } } @@ -1216,7 +1214,7 @@ function processMaterialProperty( packetData, constrainedInterval, sourceUri, - entityCollection + entityCollection, ) { let combinedInterval = intervalFromString(packetData.interval); if (defined(constrainedInterval)) { @@ -1224,7 +1222,7 @@ function processMaterialProperty( combinedInterval = TimeInterval.intersect( combinedInterval, constrainedInterval, - scratchTimeInterval + scratchTimeInterval, ); } else { combinedInterval = constrainedInterval; @@ -1272,7 +1270,7 @@ function processMaterialProperty( materialData.color, undefined, undefined, - entityCollection + entityCollection, ); } else if (defined(packetData.grid)) { if (!(existingMaterial instanceof GridMaterialProperty)) { @@ -1286,7 +1284,7 @@ function processMaterialProperty( materialData.color, undefined, sourceUri, - entityCollection + entityCollection, ); processPacketData( Number, @@ -1295,7 +1293,7 @@ function processMaterialProperty( materialData.cellAlpha, undefined, sourceUri, - entityCollection + entityCollection, ); processPacketData( Cartesian2, @@ -1304,7 +1302,7 @@ function processMaterialProperty( materialData.lineCount, undefined, sourceUri, - entityCollection + entityCollection, ); processPacketData( Cartesian2, @@ -1313,7 +1311,7 @@ function processMaterialProperty( materialData.lineThickness, undefined, sourceUri, - entityCollection + entityCollection, ); processPacketData( Cartesian2, @@ -1322,7 +1320,7 @@ function processMaterialProperty( materialData.lineOffset, undefined, sourceUri, - entityCollection + entityCollection, ); } else if (defined(packetData.image)) { if (!(existingMaterial instanceof ImageMaterialProperty)) { @@ -1336,7 +1334,7 @@ function processMaterialProperty( materialData.image, undefined, sourceUri, - entityCollection + entityCollection, ); processPacketData( Cartesian2, @@ -1345,7 +1343,7 @@ function processMaterialProperty( materialData.repeat, undefined, sourceUri, - entityCollection + entityCollection, ); processPacketData( Color, @@ -1354,7 +1352,7 @@ function processMaterialProperty( materialData.color, undefined, sourceUri, - entityCollection + entityCollection, ); processPacketData( Boolean, @@ -1363,7 +1361,7 @@ function processMaterialProperty( materialData.transparent, undefined, sourceUri, - entityCollection + entityCollection, ); } else if (defined(packetData.stripe)) { if (!(existingMaterial instanceof StripeMaterialProperty)) { @@ -1377,7 +1375,7 @@ function processMaterialProperty( materialData.orientation, undefined, sourceUri, - entityCollection + entityCollection, ); processPacketData( Color, @@ -1386,7 +1384,7 @@ function processMaterialProperty( materialData.evenColor, undefined, sourceUri, - entityCollection + entityCollection, ); processPacketData( Color, @@ -1395,7 +1393,7 @@ function processMaterialProperty( materialData.oddColor, undefined, sourceUri, - entityCollection + entityCollection, ); processPacketData( Number, @@ -1404,7 +1402,7 @@ function processMaterialProperty( materialData.offset, undefined, sourceUri, - entityCollection + entityCollection, ); processPacketData( Number, @@ -1413,7 +1411,7 @@ function processMaterialProperty( materialData.repeat, undefined, sourceUri, - entityCollection + entityCollection, ); } else if (defined(packetData.polylineOutline)) { if (!(existingMaterial instanceof PolylineOutlineMaterialProperty)) { @@ -1427,7 +1425,7 @@ function processMaterialProperty( materialData.color, undefined, sourceUri, - entityCollection + entityCollection, ); processPacketData( Color, @@ -1436,7 +1434,7 @@ function processMaterialProperty( materialData.outlineColor, undefined, sourceUri, - entityCollection + entityCollection, ); processPacketData( Number, @@ -1445,7 +1443,7 @@ function processMaterialProperty( materialData.outlineWidth, undefined, sourceUri, - entityCollection + entityCollection, ); } else if (defined(packetData.polylineGlow)) { if (!(existingMaterial instanceof PolylineGlowMaterialProperty)) { @@ -1459,7 +1457,7 @@ function processMaterialProperty( materialData.color, undefined, sourceUri, - entityCollection + entityCollection, ); processPacketData( Number, @@ -1468,7 +1466,7 @@ function processMaterialProperty( materialData.glowPower, undefined, sourceUri, - entityCollection + entityCollection, ); processPacketData( Number, @@ -1477,7 +1475,7 @@ function processMaterialProperty( materialData.taperPower, undefined, sourceUri, - entityCollection + entityCollection, ); } else if (defined(packetData.polylineArrow)) { if (!(existingMaterial instanceof PolylineArrowMaterialProperty)) { @@ -1491,7 +1489,7 @@ function processMaterialProperty( materialData.color, undefined, undefined, - entityCollection + entityCollection, ); } else if (defined(packetData.polylineDash)) { if (!(existingMaterial instanceof PolylineDashMaterialProperty)) { @@ -1505,7 +1503,7 @@ function processMaterialProperty( materialData.color, undefined, undefined, - entityCollection + entityCollection, ); processPacketData( Color, @@ -1514,7 +1512,7 @@ function processMaterialProperty( materialData.gapColor, undefined, undefined, - entityCollection + entityCollection, ); processPacketData( Number, @@ -1523,7 +1521,7 @@ function processMaterialProperty( materialData.dashLength, undefined, sourceUri, - entityCollection + entityCollection, ); processPacketData( Number, @@ -1532,7 +1530,7 @@ function processMaterialProperty( materialData.dashPattern, undefined, sourceUri, - entityCollection + entityCollection, ); } else if (defined(packetData.checkerboard)) { if (!(existingMaterial instanceof CheckerboardMaterialProperty)) { @@ -1546,7 +1544,7 @@ function processMaterialProperty( materialData.evenColor, undefined, sourceUri, - entityCollection + entityCollection, ); processPacketData( Color, @@ -1555,7 +1553,7 @@ function processMaterialProperty( materialData.oddColor, undefined, sourceUri, - entityCollection + entityCollection, ); processPacketData( Cartesian2, @@ -1564,7 +1562,7 @@ function processMaterialProperty( materialData.repeat, undefined, sourceUri, - entityCollection + entityCollection, ); } @@ -1581,7 +1579,7 @@ function processMaterialPacketData( packetData, interval, sourceUri, - entityCollection + entityCollection, ) { if (!defined(packetData)) { return; @@ -1595,7 +1593,7 @@ function processMaterialPacketData( packetData[i], interval, sourceUri, - entityCollection + entityCollection, ); } } else { @@ -1605,7 +1603,7 @@ function processMaterialPacketData( packetData, interval, sourceUri, - entityCollection + entityCollection, ); } } @@ -1627,7 +1625,7 @@ function processDescription(entity, packet, entityCollection, sourceUri) { descriptionData, undefined, sourceUri, - entityCollection + entityCollection, ); } } @@ -1641,7 +1639,7 @@ function processPosition(entity, packet, entityCollection, sourceUri) { positionData, undefined, sourceUri, - entityCollection + entityCollection, ); } } @@ -1656,7 +1654,7 @@ function processViewFrom(entity, packet, entityCollection, sourceUri) { viewFromData, undefined, sourceUri, - entityCollection + entityCollection, ); } } @@ -1671,7 +1669,7 @@ function processOrientation(entity, packet, entityCollection, sourceUri) { orientationData, undefined, sourceUri, - entityCollection + entityCollection, ); } } @@ -1703,7 +1701,7 @@ function processProperties(entity, packet, entityCollection, sourceUri) { propertyData[i], undefined, sourceUri, - entityCollection + entityCollection, ); } } else { @@ -1714,7 +1712,7 @@ function processProperties(entity, packet, entityCollection, sourceUri) { propertyData, undefined, sourceUri, - entityCollection + entityCollection, ); } } @@ -1729,7 +1727,7 @@ function processReferencesArrayPacketData( interval, entityCollection, PropertyArrayType, - CompositePropertyArrayType + CompositePropertyArrayType, ) { const properties = references.map(function (reference) { return createReferenceProperty(entityCollection, reference); @@ -1760,7 +1758,7 @@ function processArrayPacketData( object, propertyName, packetData, - entityCollection + entityCollection, ) { const references = packetData.references; if (defined(references)) { @@ -1771,7 +1769,7 @@ function processArrayPacketData( packetData.interval, entityCollection, PropertyArray, - CompositeProperty + CompositeProperty, ); } else { processPacketData( @@ -1781,7 +1779,7 @@ function processArrayPacketData( packetData, undefined, undefined, - entityCollection + entityCollection, ); } } @@ -1797,7 +1795,7 @@ function processArray(object, propertyName, packetData, entityCollection) { object, propertyName, packetData[i], - entityCollection + entityCollection, ); } } else { @@ -1809,7 +1807,7 @@ function processPositionArrayPacketData( object, propertyName, packetData, - entityCollection + entityCollection, ) { const references = packetData.references; if (defined(references)) { @@ -1820,7 +1818,7 @@ function processPositionArrayPacketData( packetData.interval, entityCollection, PositionPropertyArray, - CompositePositionProperty + CompositePositionProperty, ); } else { if (defined(packetData.cartesian)) { @@ -1828,12 +1826,12 @@ function processPositionArrayPacketData( } else if (defined(packetData.cartographicRadians)) { packetData.array = Cartesian3.fromRadiansArrayHeights( packetData.cartographicRadians, - Ellipsoid.default + Ellipsoid.default, ); } else if (defined(packetData.cartographicDegrees)) { packetData.array = Cartesian3.fromDegreesArrayHeights( packetData.cartographicDegrees, - Ellipsoid.default + Ellipsoid.default, ); } @@ -1845,7 +1843,7 @@ function processPositionArrayPacketData( packetData, undefined, undefined, - entityCollection + entityCollection, ); } } @@ -1855,7 +1853,7 @@ function processPositionArray( object, propertyName, packetData, - entityCollection + entityCollection, ) { if (!defined(packetData)) { return; @@ -1867,7 +1865,7 @@ function processPositionArray( object, propertyName, packetData[i], - entityCollection + entityCollection, ); } } else { @@ -1875,7 +1873,7 @@ function processPositionArray( object, propertyName, packetData, - entityCollection + entityCollection, ); } } @@ -1896,7 +1894,7 @@ function processPositionArrayOfArraysPacketData( object, propertyName, packetData, - entityCollection + entityCollection, ) { const references = packetData.references; if (defined(references)) { @@ -1909,7 +1907,7 @@ function processPositionArrayOfArraysPacketData( packetData.interval, entityCollection, PositionPropertyArray, - CompositePositionProperty + CompositePositionProperty, ); return tempObj.positions; }); @@ -1919,11 +1917,11 @@ function processPositionArrayOfArraysPacketData( packetData.array = packetData.cartesian.map(unpackCartesianArray); } else if (defined(packetData.cartographicRadians)) { packetData.array = packetData.cartographicRadians.map( - unpackCartographicRadiansArray + unpackCartographicRadiansArray, ); } else if (defined(packetData.cartographicDegrees)) { packetData.array = packetData.cartographicDegrees.map( - unpackCartographicDegreesArray + unpackCartographicDegreesArray, ); } @@ -1935,7 +1933,7 @@ function processPositionArrayOfArraysPacketData( packetData, undefined, undefined, - entityCollection + entityCollection, ); } } @@ -1945,7 +1943,7 @@ function processPositionArrayOfArrays( object, propertyName, packetData, - entityCollection + entityCollection, ) { if (!defined(packetData)) { return; @@ -1957,7 +1955,7 @@ function processPositionArrayOfArrays( object, propertyName, packetData[i], - entityCollection + entityCollection, ); } } else { @@ -1965,7 +1963,7 @@ function processPositionArrayOfArrays( object, propertyName, packetData, - entityCollection + entityCollection, ); } } @@ -1981,7 +1979,7 @@ function processShape(object, propertyName, packetData, entityCollection) { object, propertyName, packetData[i], - entityCollection + entityCollection, ); } } else { @@ -2015,7 +2013,7 @@ function processAlignedAxis( packetData, interval, sourceUri, - entityCollection + entityCollection, ) { if (!defined(packetData)) { return; @@ -2028,7 +2026,7 @@ function processAlignedAxis( packetData, interval, sourceUri, - entityCollection + entityCollection, ); } @@ -2051,7 +2049,7 @@ function processBillboard(entity, packet, entityCollection, sourceUri) { billboardData.show, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Image, @@ -2060,7 +2058,7 @@ function processBillboard(entity, packet, entityCollection, sourceUri) { billboardData.image, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Number, @@ -2069,7 +2067,7 @@ function processBillboard(entity, packet, entityCollection, sourceUri) { billboardData.scale, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Cartesian2, @@ -2078,7 +2076,7 @@ function processBillboard(entity, packet, entityCollection, sourceUri) { billboardData.pixelOffset, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Cartesian3, @@ -2087,7 +2085,7 @@ function processBillboard(entity, packet, entityCollection, sourceUri) { billboardData.eyeOffset, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( HorizontalOrigin, @@ -2096,7 +2094,7 @@ function processBillboard(entity, packet, entityCollection, sourceUri) { billboardData.horizontalOrigin, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( VerticalOrigin, @@ -2105,7 +2103,7 @@ function processBillboard(entity, packet, entityCollection, sourceUri) { billboardData.verticalOrigin, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( HeightReference, @@ -2114,7 +2112,7 @@ function processBillboard(entity, packet, entityCollection, sourceUri) { billboardData.heightReference, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Color, @@ -2123,7 +2121,7 @@ function processBillboard(entity, packet, entityCollection, sourceUri) { billboardData.color, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Rotation, @@ -2132,14 +2130,14 @@ function processBillboard(entity, packet, entityCollection, sourceUri) { billboardData.rotation, interval, sourceUri, - entityCollection + entityCollection, ); processAlignedAxis( billboard, billboardData.alignedAxis, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Boolean, @@ -2148,7 +2146,7 @@ function processBillboard(entity, packet, entityCollection, sourceUri) { billboardData.sizeInMeters, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Number, @@ -2157,7 +2155,7 @@ function processBillboard(entity, packet, entityCollection, sourceUri) { billboardData.width, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Number, @@ -2166,7 +2164,7 @@ function processBillboard(entity, packet, entityCollection, sourceUri) { billboardData.height, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( NearFarScalar, @@ -2175,7 +2173,7 @@ function processBillboard(entity, packet, entityCollection, sourceUri) { billboardData.scaleByDistance, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( NearFarScalar, @@ -2184,7 +2182,7 @@ function processBillboard(entity, packet, entityCollection, sourceUri) { billboardData.translucencyByDistance, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( NearFarScalar, @@ -2193,7 +2191,7 @@ function processBillboard(entity, packet, entityCollection, sourceUri) { billboardData.pixelOffsetScaleByDistance, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( BoundingRectangle, @@ -2202,7 +2200,7 @@ function processBillboard(entity, packet, entityCollection, sourceUri) { billboardData.imageSubRegion, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( DistanceDisplayCondition, @@ -2211,7 +2209,7 @@ function processBillboard(entity, packet, entityCollection, sourceUri) { billboardData.distanceDisplayCondition, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Number, @@ -2220,7 +2218,7 @@ function processBillboard(entity, packet, entityCollection, sourceUri) { billboardData.disableDepthTestDistance, interval, sourceUri, - entityCollection + entityCollection, ); } @@ -2243,7 +2241,7 @@ function processBox(entity, packet, entityCollection, sourceUri) { boxData.show, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Cartesian3, @@ -2252,7 +2250,7 @@ function processBox(entity, packet, entityCollection, sourceUri) { boxData.dimensions, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( HeightReference, @@ -2261,7 +2259,7 @@ function processBox(entity, packet, entityCollection, sourceUri) { boxData.heightReference, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Boolean, @@ -2270,7 +2268,7 @@ function processBox(entity, packet, entityCollection, sourceUri) { boxData.fill, interval, sourceUri, - entityCollection + entityCollection, ); processMaterialPacketData( box, @@ -2278,7 +2276,7 @@ function processBox(entity, packet, entityCollection, sourceUri) { boxData.material, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Boolean, @@ -2287,7 +2285,7 @@ function processBox(entity, packet, entityCollection, sourceUri) { boxData.outline, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Color, @@ -2296,7 +2294,7 @@ function processBox(entity, packet, entityCollection, sourceUri) { boxData.outlineColor, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Number, @@ -2305,7 +2303,7 @@ function processBox(entity, packet, entityCollection, sourceUri) { boxData.outlineWidth, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( ShadowMode, @@ -2314,7 +2312,7 @@ function processBox(entity, packet, entityCollection, sourceUri) { boxData.shadows, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( DistanceDisplayCondition, @@ -2323,7 +2321,7 @@ function processBox(entity, packet, entityCollection, sourceUri) { boxData.distanceDisplayCondition, interval, sourceUri, - entityCollection + entityCollection, ); } @@ -2346,13 +2344,13 @@ function processCorridor(entity, packet, entityCollection, sourceUri) { corridorData.show, interval, sourceUri, - entityCollection + entityCollection, ); processPositionArray( corridor, "positions", corridorData.positions, - entityCollection + entityCollection, ); processPacketData( Number, @@ -2361,7 +2359,7 @@ function processCorridor(entity, packet, entityCollection, sourceUri) { corridorData.width, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Number, @@ -2370,7 +2368,7 @@ function processCorridor(entity, packet, entityCollection, sourceUri) { corridorData.height, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( HeightReference, @@ -2379,7 +2377,7 @@ function processCorridor(entity, packet, entityCollection, sourceUri) { corridorData.heightReference, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Number, @@ -2388,7 +2386,7 @@ function processCorridor(entity, packet, entityCollection, sourceUri) { corridorData.extrudedHeight, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( HeightReference, @@ -2397,7 +2395,7 @@ function processCorridor(entity, packet, entityCollection, sourceUri) { corridorData.extrudedHeightReference, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( CornerType, @@ -2406,7 +2404,7 @@ function processCorridor(entity, packet, entityCollection, sourceUri) { corridorData.cornerType, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Number, @@ -2415,7 +2413,7 @@ function processCorridor(entity, packet, entityCollection, sourceUri) { corridorData.granularity, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Boolean, @@ -2424,7 +2422,7 @@ function processCorridor(entity, packet, entityCollection, sourceUri) { corridorData.fill, interval, sourceUri, - entityCollection + entityCollection, ); processMaterialPacketData( corridor, @@ -2432,7 +2430,7 @@ function processCorridor(entity, packet, entityCollection, sourceUri) { corridorData.material, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Boolean, @@ -2441,7 +2439,7 @@ function processCorridor(entity, packet, entityCollection, sourceUri) { corridorData.outline, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Color, @@ -2450,7 +2448,7 @@ function processCorridor(entity, packet, entityCollection, sourceUri) { corridorData.outlineColor, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Number, @@ -2459,7 +2457,7 @@ function processCorridor(entity, packet, entityCollection, sourceUri) { corridorData.outlineWidth, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( ShadowMode, @@ -2468,7 +2466,7 @@ function processCorridor(entity, packet, entityCollection, sourceUri) { corridorData.shadows, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( DistanceDisplayCondition, @@ -2477,7 +2475,7 @@ function processCorridor(entity, packet, entityCollection, sourceUri) { corridorData.distanceDisplayCondition, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( ClassificationType, @@ -2486,7 +2484,7 @@ function processCorridor(entity, packet, entityCollection, sourceUri) { corridorData.classificationType, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Number, @@ -2495,7 +2493,7 @@ function processCorridor(entity, packet, entityCollection, sourceUri) { corridorData.zIndex, interval, sourceUri, - entityCollection + entityCollection, ); } @@ -2518,7 +2516,7 @@ function processCylinder(entity, packet, entityCollection, sourceUri) { cylinderData.show, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Number, @@ -2527,7 +2525,7 @@ function processCylinder(entity, packet, entityCollection, sourceUri) { cylinderData.length, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Number, @@ -2536,7 +2534,7 @@ function processCylinder(entity, packet, entityCollection, sourceUri) { cylinderData.topRadius, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Number, @@ -2545,7 +2543,7 @@ function processCylinder(entity, packet, entityCollection, sourceUri) { cylinderData.bottomRadius, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( HeightReference, @@ -2554,7 +2552,7 @@ function processCylinder(entity, packet, entityCollection, sourceUri) { cylinderData.heightReference, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Boolean, @@ -2563,7 +2561,7 @@ function processCylinder(entity, packet, entityCollection, sourceUri) { cylinderData.fill, interval, sourceUri, - entityCollection + entityCollection, ); processMaterialPacketData( cylinder, @@ -2571,7 +2569,7 @@ function processCylinder(entity, packet, entityCollection, sourceUri) { cylinderData.material, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Boolean, @@ -2580,7 +2578,7 @@ function processCylinder(entity, packet, entityCollection, sourceUri) { cylinderData.outline, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Color, @@ -2589,7 +2587,7 @@ function processCylinder(entity, packet, entityCollection, sourceUri) { cylinderData.outlineColor, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Number, @@ -2598,7 +2596,7 @@ function processCylinder(entity, packet, entityCollection, sourceUri) { cylinderData.outlineWidth, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Number, @@ -2607,7 +2605,7 @@ function processCylinder(entity, packet, entityCollection, sourceUri) { cylinderData.numberOfVerticalLines, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Number, @@ -2616,7 +2614,7 @@ function processCylinder(entity, packet, entityCollection, sourceUri) { cylinderData.slices, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( ShadowMode, @@ -2625,7 +2623,7 @@ function processCylinder(entity, packet, entityCollection, sourceUri) { cylinderData.shadows, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( DistanceDisplayCondition, @@ -2634,7 +2632,7 @@ function processCylinder(entity, packet, entityCollection, sourceUri) { cylinderData.distanceDisplayCondition, interval, sourceUri, - entityCollection + entityCollection, ); } @@ -2654,7 +2652,7 @@ function processDocument(packet, dataSource) { if (!defined(dataSource._version)) { throw new RuntimeError( - "CZML version information invalid. It is expected to be a property on the document object in the . version format." + "CZML version information invalid. It is expected to be a property on the document object in the . version format.", ); } @@ -2679,7 +2677,7 @@ function processDocument(packet, dataSource) { clock.interval = defaultValue(clockPacket.interval, clock.interval); clock.currentTime = defaultValue( clockPacket.currentTime, - clock.currentTime + clock.currentTime, ); clock.range = defaultValue(clockPacket.range, clock.range); clock.step = defaultValue(clockPacket.step, clock.step); @@ -2707,7 +2705,7 @@ function processEllipse(entity, packet, entityCollection, sourceUri) { ellipseData.show, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Number, @@ -2716,7 +2714,7 @@ function processEllipse(entity, packet, entityCollection, sourceUri) { ellipseData.semiMajorAxis, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Number, @@ -2725,7 +2723,7 @@ function processEllipse(entity, packet, entityCollection, sourceUri) { ellipseData.semiMinorAxis, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Number, @@ -2734,7 +2732,7 @@ function processEllipse(entity, packet, entityCollection, sourceUri) { ellipseData.height, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( HeightReference, @@ -2743,7 +2741,7 @@ function processEllipse(entity, packet, entityCollection, sourceUri) { ellipseData.heightReference, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Number, @@ -2752,7 +2750,7 @@ function processEllipse(entity, packet, entityCollection, sourceUri) { ellipseData.extrudedHeight, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( HeightReference, @@ -2761,7 +2759,7 @@ function processEllipse(entity, packet, entityCollection, sourceUri) { ellipseData.extrudedHeightReference, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Rotation, @@ -2770,7 +2768,7 @@ function processEllipse(entity, packet, entityCollection, sourceUri) { ellipseData.rotation, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Rotation, @@ -2779,7 +2777,7 @@ function processEllipse(entity, packet, entityCollection, sourceUri) { ellipseData.stRotation, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Number, @@ -2788,7 +2786,7 @@ function processEllipse(entity, packet, entityCollection, sourceUri) { ellipseData.granularity, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Boolean, @@ -2797,7 +2795,7 @@ function processEllipse(entity, packet, entityCollection, sourceUri) { ellipseData.fill, interval, sourceUri, - entityCollection + entityCollection, ); processMaterialPacketData( ellipse, @@ -2805,7 +2803,7 @@ function processEllipse(entity, packet, entityCollection, sourceUri) { ellipseData.material, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Boolean, @@ -2814,7 +2812,7 @@ function processEllipse(entity, packet, entityCollection, sourceUri) { ellipseData.outline, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Color, @@ -2823,7 +2821,7 @@ function processEllipse(entity, packet, entityCollection, sourceUri) { ellipseData.outlineColor, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Number, @@ -2832,7 +2830,7 @@ function processEllipse(entity, packet, entityCollection, sourceUri) { ellipseData.outlineWidth, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Number, @@ -2841,7 +2839,7 @@ function processEllipse(entity, packet, entityCollection, sourceUri) { ellipseData.numberOfVerticalLines, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( ShadowMode, @@ -2850,7 +2848,7 @@ function processEllipse(entity, packet, entityCollection, sourceUri) { ellipseData.shadows, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( DistanceDisplayCondition, @@ -2859,7 +2857,7 @@ function processEllipse(entity, packet, entityCollection, sourceUri) { ellipseData.distanceDisplayCondition, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( ClassificationType, @@ -2868,7 +2866,7 @@ function processEllipse(entity, packet, entityCollection, sourceUri) { ellipseData.classificationType, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Number, @@ -2877,7 +2875,7 @@ function processEllipse(entity, packet, entityCollection, sourceUri) { ellipseData.zIndex, interval, sourceUri, - entityCollection + entityCollection, ); } @@ -2900,7 +2898,7 @@ function processEllipsoid(entity, packet, entityCollection, sourceUri) { ellipsoidData.show, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Cartesian3, @@ -2909,7 +2907,7 @@ function processEllipsoid(entity, packet, entityCollection, sourceUri) { ellipsoidData.radii, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Cartesian3, @@ -2918,7 +2916,7 @@ function processEllipsoid(entity, packet, entityCollection, sourceUri) { ellipsoidData.innerRadii, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Number, @@ -2927,7 +2925,7 @@ function processEllipsoid(entity, packet, entityCollection, sourceUri) { ellipsoidData.minimumClock, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Number, @@ -2936,7 +2934,7 @@ function processEllipsoid(entity, packet, entityCollection, sourceUri) { ellipsoidData.maximumClock, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Number, @@ -2945,7 +2943,7 @@ function processEllipsoid(entity, packet, entityCollection, sourceUri) { ellipsoidData.minimumCone, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Number, @@ -2954,7 +2952,7 @@ function processEllipsoid(entity, packet, entityCollection, sourceUri) { ellipsoidData.maximumCone, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( HeightReference, @@ -2963,7 +2961,7 @@ function processEllipsoid(entity, packet, entityCollection, sourceUri) { ellipsoidData.heightReference, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Boolean, @@ -2972,7 +2970,7 @@ function processEllipsoid(entity, packet, entityCollection, sourceUri) { ellipsoidData.fill, interval, sourceUri, - entityCollection + entityCollection, ); processMaterialPacketData( ellipsoid, @@ -2980,7 +2978,7 @@ function processEllipsoid(entity, packet, entityCollection, sourceUri) { ellipsoidData.material, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Boolean, @@ -2989,7 +2987,7 @@ function processEllipsoid(entity, packet, entityCollection, sourceUri) { ellipsoidData.outline, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Color, @@ -2998,7 +2996,7 @@ function processEllipsoid(entity, packet, entityCollection, sourceUri) { ellipsoidData.outlineColor, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Number, @@ -3007,7 +3005,7 @@ function processEllipsoid(entity, packet, entityCollection, sourceUri) { ellipsoidData.outlineWidth, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Number, @@ -3016,7 +3014,7 @@ function processEllipsoid(entity, packet, entityCollection, sourceUri) { ellipsoidData.stackPartitions, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Number, @@ -3025,7 +3023,7 @@ function processEllipsoid(entity, packet, entityCollection, sourceUri) { ellipsoidData.slicePartitions, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Number, @@ -3034,7 +3032,7 @@ function processEllipsoid(entity, packet, entityCollection, sourceUri) { ellipsoidData.subdivisions, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( ShadowMode, @@ -3043,7 +3041,7 @@ function processEllipsoid(entity, packet, entityCollection, sourceUri) { ellipsoidData.shadows, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( DistanceDisplayCondition, @@ -3052,7 +3050,7 @@ function processEllipsoid(entity, packet, entityCollection, sourceUri) { ellipsoidData.distanceDisplayCondition, interval, sourceUri, - entityCollection + entityCollection, ); } @@ -3075,7 +3073,7 @@ function processLabel(entity, packet, entityCollection, sourceUri) { labelData.show, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( String, @@ -3084,7 +3082,7 @@ function processLabel(entity, packet, entityCollection, sourceUri) { labelData.text, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( String, @@ -3093,7 +3091,7 @@ function processLabel(entity, packet, entityCollection, sourceUri) { labelData.font, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( LabelStyle, @@ -3102,7 +3100,7 @@ function processLabel(entity, packet, entityCollection, sourceUri) { labelData.style, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Number, @@ -3111,7 +3109,7 @@ function processLabel(entity, packet, entityCollection, sourceUri) { labelData.scale, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Boolean, @@ -3120,7 +3118,7 @@ function processLabel(entity, packet, entityCollection, sourceUri) { labelData.showBackground, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Color, @@ -3129,7 +3127,7 @@ function processLabel(entity, packet, entityCollection, sourceUri) { labelData.backgroundColor, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Cartesian2, @@ -3138,7 +3136,7 @@ function processLabel(entity, packet, entityCollection, sourceUri) { labelData.backgroundPadding, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Cartesian2, @@ -3147,7 +3145,7 @@ function processLabel(entity, packet, entityCollection, sourceUri) { labelData.pixelOffset, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Cartesian3, @@ -3156,7 +3154,7 @@ function processLabel(entity, packet, entityCollection, sourceUri) { labelData.eyeOffset, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( HorizontalOrigin, @@ -3165,7 +3163,7 @@ function processLabel(entity, packet, entityCollection, sourceUri) { labelData.horizontalOrigin, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( VerticalOrigin, @@ -3174,7 +3172,7 @@ function processLabel(entity, packet, entityCollection, sourceUri) { labelData.verticalOrigin, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( HeightReference, @@ -3183,7 +3181,7 @@ function processLabel(entity, packet, entityCollection, sourceUri) { labelData.heightReference, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Color, @@ -3192,7 +3190,7 @@ function processLabel(entity, packet, entityCollection, sourceUri) { labelData.fillColor, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Color, @@ -3201,7 +3199,7 @@ function processLabel(entity, packet, entityCollection, sourceUri) { labelData.outlineColor, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Number, @@ -3210,7 +3208,7 @@ function processLabel(entity, packet, entityCollection, sourceUri) { labelData.outlineWidth, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( NearFarScalar, @@ -3219,7 +3217,7 @@ function processLabel(entity, packet, entityCollection, sourceUri) { labelData.translucencyByDistance, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( NearFarScalar, @@ -3228,7 +3226,7 @@ function processLabel(entity, packet, entityCollection, sourceUri) { labelData.pixelOffsetScaleByDistance, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( NearFarScalar, @@ -3237,7 +3235,7 @@ function processLabel(entity, packet, entityCollection, sourceUri) { labelData.scaleByDistance, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( DistanceDisplayCondition, @@ -3246,7 +3244,7 @@ function processLabel(entity, packet, entityCollection, sourceUri) { labelData.distanceDisplayCondition, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Number, @@ -3255,7 +3253,7 @@ function processLabel(entity, packet, entityCollection, sourceUri) { labelData.disableDepthTestDistance, interval, sourceUri, - entityCollection + entityCollection, ); } @@ -3278,7 +3276,7 @@ function processModel(entity, packet, entityCollection, sourceUri) { modelData.show, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Uri, @@ -3287,7 +3285,7 @@ function processModel(entity, packet, entityCollection, sourceUri) { modelData.gltf, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Number, @@ -3296,7 +3294,7 @@ function processModel(entity, packet, entityCollection, sourceUri) { modelData.scale, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Number, @@ -3305,7 +3303,7 @@ function processModel(entity, packet, entityCollection, sourceUri) { modelData.minimumPixelSize, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Number, @@ -3314,7 +3312,7 @@ function processModel(entity, packet, entityCollection, sourceUri) { modelData.maximumScale, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Boolean, @@ -3323,7 +3321,7 @@ function processModel(entity, packet, entityCollection, sourceUri) { modelData.incrementallyLoadTextures, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Boolean, @@ -3332,7 +3330,7 @@ function processModel(entity, packet, entityCollection, sourceUri) { modelData.runAnimations, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Boolean, @@ -3341,7 +3339,7 @@ function processModel(entity, packet, entityCollection, sourceUri) { modelData.clampAnimations, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( ShadowMode, @@ -3350,7 +3348,7 @@ function processModel(entity, packet, entityCollection, sourceUri) { modelData.shadows, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( HeightReference, @@ -3359,7 +3357,7 @@ function processModel(entity, packet, entityCollection, sourceUri) { modelData.heightReference, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Color, @@ -3368,7 +3366,7 @@ function processModel(entity, packet, entityCollection, sourceUri) { modelData.silhouetteColor, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Number, @@ -3377,7 +3375,7 @@ function processModel(entity, packet, entityCollection, sourceUri) { modelData.silhouetteSize, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Color, @@ -3386,7 +3384,7 @@ function processModel(entity, packet, entityCollection, sourceUri) { modelData.color, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( ColorBlendMode, @@ -3395,7 +3393,7 @@ function processModel(entity, packet, entityCollection, sourceUri) { modelData.colorBlendMode, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Number, @@ -3404,7 +3402,7 @@ function processModel(entity, packet, entityCollection, sourceUri) { modelData.colorBlendAmount, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( DistanceDisplayCondition, @@ -3413,7 +3411,7 @@ function processModel(entity, packet, entityCollection, sourceUri) { modelData.distanceDisplayCondition, interval, sourceUri, - entityCollection + entityCollection, ); let i, len; @@ -3426,7 +3424,7 @@ function processModel(entity, packet, entityCollection, sourceUri) { nodeTransformationsData[i], interval, sourceUri, - entityCollection + entityCollection, ); } } else { @@ -3435,7 +3433,7 @@ function processModel(entity, packet, entityCollection, sourceUri) { nodeTransformationsData, interval, sourceUri, - entityCollection + entityCollection, ); } } @@ -3449,7 +3447,7 @@ function processModel(entity, packet, entityCollection, sourceUri) { articulationsData[i], interval, sourceUri, - entityCollection + entityCollection, ); } } else { @@ -3458,7 +3456,7 @@ function processModel(entity, packet, entityCollection, sourceUri) { articulationsData, interval, sourceUri, - entityCollection + entityCollection, ); } } @@ -3469,7 +3467,7 @@ function processNodeTransformations( nodeTransformationsData, constrainedInterval, sourceUri, - entityCollection + entityCollection, ) { let combinedInterval = intervalFromString(nodeTransformationsData.interval); if (defined(constrainedInterval)) { @@ -3477,7 +3475,7 @@ function processNodeTransformations( combinedInterval = TimeInterval.intersect( combinedInterval, constrainedInterval, - scratchTimeInterval + scratchTimeInterval, ); } else { combinedInterval = constrainedInterval; @@ -3507,9 +3505,8 @@ function processNodeTransformations( let nodeTransformation = nodeTransformations[nodeName]; if (!defined(nodeTransformation)) { - nodeTransformations[ - nodeName - ] = nodeTransformation = new NodeTransformationProperty(); + nodeTransformations[nodeName] = nodeTransformation = + new NodeTransformationProperty(); } processPacketData( @@ -3519,7 +3516,7 @@ function processNodeTransformations( nodeTransformationData.translation, combinedInterval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Quaternion, @@ -3528,7 +3525,7 @@ function processNodeTransformations( nodeTransformationData.rotation, combinedInterval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Cartesian3, @@ -3537,7 +3534,7 @@ function processNodeTransformations( nodeTransformationData.scale, combinedInterval, sourceUri, - entityCollection + entityCollection, ); } } @@ -3547,7 +3544,7 @@ function processArticulations( articulationsData, constrainedInterval, sourceUri, - entityCollection + entityCollection, ) { let combinedInterval = intervalFromString(articulationsData.interval); if (defined(constrainedInterval)) { @@ -3555,7 +3552,7 @@ function processArticulations( combinedInterval = TimeInterval.intersect( combinedInterval, constrainedInterval, - scratchTimeInterval + scratchTimeInterval, ); } else { combinedInterval = constrainedInterval; @@ -3590,7 +3587,7 @@ function processArticulations( articulationStageData, combinedInterval, sourceUri, - entityCollection + entityCollection, ); } } @@ -3614,7 +3611,7 @@ function processPath(entity, packet, entityCollection, sourceUri) { pathData.show, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Number, @@ -3623,7 +3620,7 @@ function processPath(entity, packet, entityCollection, sourceUri) { pathData.leadTime, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Number, @@ -3632,7 +3629,7 @@ function processPath(entity, packet, entityCollection, sourceUri) { pathData.trailTime, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Number, @@ -3641,7 +3638,7 @@ function processPath(entity, packet, entityCollection, sourceUri) { pathData.width, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Number, @@ -3650,7 +3647,7 @@ function processPath(entity, packet, entityCollection, sourceUri) { pathData.resolution, interval, sourceUri, - entityCollection + entityCollection, ); processMaterialPacketData( path, @@ -3658,7 +3655,7 @@ function processPath(entity, packet, entityCollection, sourceUri) { pathData.material, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( DistanceDisplayCondition, @@ -3667,7 +3664,7 @@ function processPath(entity, packet, entityCollection, sourceUri) { pathData.distanceDisplayCondition, interval, sourceUri, - entityCollection + entityCollection, ); } @@ -3690,7 +3687,7 @@ function processPoint(entity, packet, entityCollection, sourceUri) { pointData.show, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Number, @@ -3699,7 +3696,7 @@ function processPoint(entity, packet, entityCollection, sourceUri) { pointData.pixelSize, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( HeightReference, @@ -3708,7 +3705,7 @@ function processPoint(entity, packet, entityCollection, sourceUri) { pointData.heightReference, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Color, @@ -3717,7 +3714,7 @@ function processPoint(entity, packet, entityCollection, sourceUri) { pointData.color, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Color, @@ -3726,7 +3723,7 @@ function processPoint(entity, packet, entityCollection, sourceUri) { pointData.outlineColor, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Number, @@ -3735,7 +3732,7 @@ function processPoint(entity, packet, entityCollection, sourceUri) { pointData.outlineWidth, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( NearFarScalar, @@ -3744,7 +3741,7 @@ function processPoint(entity, packet, entityCollection, sourceUri) { pointData.scaleByDistance, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( NearFarScalar, @@ -3753,7 +3750,7 @@ function processPoint(entity, packet, entityCollection, sourceUri) { pointData.translucencyByDistance, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( DistanceDisplayCondition, @@ -3762,7 +3759,7 @@ function processPoint(entity, packet, entityCollection, sourceUri) { pointData.distanceDisplayCondition, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Number, @@ -3771,7 +3768,7 @@ function processPoint(entity, packet, entityCollection, sourceUri) { pointData.disableDepthTestDistance, interval, sourceUri, - entityCollection + entityCollection, ); } @@ -3851,7 +3848,7 @@ function processPolygon(entity, packet, entityCollection, sourceUri) { polygonData.show, interval, sourceUri, - entityCollection + entityCollection, ); // adapt 'position' property producing Cartesian[] @@ -3861,13 +3858,13 @@ function processPolygon(entity, packet, entityCollection, sourceUri) { polygon, "_positions", polygonData.positions, - entityCollection + entityCollection, ); processPositionArrayOfArrays( polygon, "_holes", polygonData.holes, - entityCollection + entityCollection, ); if (defined(polygon._positions) || defined(polygon._holes)) { polygon.hierarchy = new PolygonHierarchyProperty(polygon); @@ -3880,7 +3877,7 @@ function processPolygon(entity, packet, entityCollection, sourceUri) { polygonData.height, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( HeightReference, @@ -3889,7 +3886,7 @@ function processPolygon(entity, packet, entityCollection, sourceUri) { polygonData.heightReference, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Number, @@ -3898,7 +3895,7 @@ function processPolygon(entity, packet, entityCollection, sourceUri) { polygonData.extrudedHeight, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( HeightReference, @@ -3907,7 +3904,7 @@ function processPolygon(entity, packet, entityCollection, sourceUri) { polygonData.extrudedHeightReference, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Rotation, @@ -3916,7 +3913,7 @@ function processPolygon(entity, packet, entityCollection, sourceUri) { polygonData.stRotation, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Number, @@ -3925,7 +3922,7 @@ function processPolygon(entity, packet, entityCollection, sourceUri) { polygonData.granularity, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Boolean, @@ -3934,7 +3931,7 @@ function processPolygon(entity, packet, entityCollection, sourceUri) { polygonData.fill, interval, sourceUri, - entityCollection + entityCollection, ); processMaterialPacketData( polygon, @@ -3942,7 +3939,7 @@ function processPolygon(entity, packet, entityCollection, sourceUri) { polygonData.material, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Boolean, @@ -3951,7 +3948,7 @@ function processPolygon(entity, packet, entityCollection, sourceUri) { polygonData.outline, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Color, @@ -3960,7 +3957,7 @@ function processPolygon(entity, packet, entityCollection, sourceUri) { polygonData.outlineColor, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Number, @@ -3969,7 +3966,7 @@ function processPolygon(entity, packet, entityCollection, sourceUri) { polygonData.outlineWidth, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Boolean, @@ -3978,7 +3975,7 @@ function processPolygon(entity, packet, entityCollection, sourceUri) { polygonData.perPositionHeight, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Boolean, @@ -3987,7 +3984,7 @@ function processPolygon(entity, packet, entityCollection, sourceUri) { polygonData.closeTop, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Boolean, @@ -3996,7 +3993,7 @@ function processPolygon(entity, packet, entityCollection, sourceUri) { polygonData.closeBottom, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( ArcType, @@ -4005,7 +4002,7 @@ function processPolygon(entity, packet, entityCollection, sourceUri) { polygonData.arcType, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( ShadowMode, @@ -4014,7 +4011,7 @@ function processPolygon(entity, packet, entityCollection, sourceUri) { polygonData.shadows, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( DistanceDisplayCondition, @@ -4023,7 +4020,7 @@ function processPolygon(entity, packet, entityCollection, sourceUri) { polygonData.distanceDisplayCondition, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( ClassificationType, @@ -4032,7 +4029,7 @@ function processPolygon(entity, packet, entityCollection, sourceUri) { polygonData.classificationType, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Number, @@ -4041,7 +4038,7 @@ function processPolygon(entity, packet, entityCollection, sourceUri) { polygonData.zIndex, interval, sourceUri, - entityCollection + entityCollection, ); } @@ -4068,13 +4065,13 @@ function processPolyline(entity, packet, entityCollection, sourceUri) { polylineData.show, interval, sourceUri, - entityCollection + entityCollection, ); processPositionArray( polyline, "positions", polylineData.positions, - entityCollection + entityCollection, ); processPacketData( Number, @@ -4083,7 +4080,7 @@ function processPolyline(entity, packet, entityCollection, sourceUri) { polylineData.width, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Number, @@ -4092,7 +4089,7 @@ function processPolyline(entity, packet, entityCollection, sourceUri) { polylineData.granularity, interval, sourceUri, - entityCollection + entityCollection, ); processMaterialPacketData( polyline, @@ -4100,7 +4097,7 @@ function processPolyline(entity, packet, entityCollection, sourceUri) { polylineData.material, interval, sourceUri, - entityCollection + entityCollection, ); processMaterialPacketData( polyline, @@ -4108,7 +4105,7 @@ function processPolyline(entity, packet, entityCollection, sourceUri) { polylineData.depthFailMaterial, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( ArcType, @@ -4117,7 +4114,7 @@ function processPolyline(entity, packet, entityCollection, sourceUri) { polylineData.arcType, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Boolean, @@ -4126,7 +4123,7 @@ function processPolyline(entity, packet, entityCollection, sourceUri) { polylineData.clampToGround, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( ShadowMode, @@ -4135,7 +4132,7 @@ function processPolyline(entity, packet, entityCollection, sourceUri) { polylineData.shadows, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( DistanceDisplayCondition, @@ -4144,7 +4141,7 @@ function processPolyline(entity, packet, entityCollection, sourceUri) { polylineData.distanceDisplayCondition, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( ClassificationType, @@ -4153,7 +4150,7 @@ function processPolyline(entity, packet, entityCollection, sourceUri) { polylineData.classificationType, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Number, @@ -4162,7 +4159,7 @@ function processPolyline(entity, packet, entityCollection, sourceUri) { polylineData.zIndex, interval, sourceUri, - entityCollection + entityCollection, ); // for backwards compatibility, adapt CZML followSurface to arcType. @@ -4175,11 +4172,11 @@ function processPolyline(entity, packet, entityCollection, sourceUri) { polylineData.followSurface, interval, sourceUri, - entityCollection + entityCollection, ); polyline.arcType = createAdapterProperty( tempObj.followSurface, - adaptFollowSurfaceToArcType + adaptFollowSurfaceToArcType, ); } } @@ -4200,13 +4197,13 @@ function processPolylineVolume(entity, packet, entityCollection, sourceUri) { polylineVolume, "positions", polylineVolumeData.positions, - entityCollection + entityCollection, ); processShape( polylineVolume, "shape", polylineVolumeData.shape, - entityCollection + entityCollection, ); processPacketData( Boolean, @@ -4215,7 +4212,7 @@ function processPolylineVolume(entity, packet, entityCollection, sourceUri) { polylineVolumeData.show, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( CornerType, @@ -4224,7 +4221,7 @@ function processPolylineVolume(entity, packet, entityCollection, sourceUri) { polylineVolumeData.cornerType, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Boolean, @@ -4233,7 +4230,7 @@ function processPolylineVolume(entity, packet, entityCollection, sourceUri) { polylineVolumeData.fill, interval, sourceUri, - entityCollection + entityCollection, ); processMaterialPacketData( polylineVolume, @@ -4241,7 +4238,7 @@ function processPolylineVolume(entity, packet, entityCollection, sourceUri) { polylineVolumeData.material, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Boolean, @@ -4250,7 +4247,7 @@ function processPolylineVolume(entity, packet, entityCollection, sourceUri) { polylineVolumeData.outline, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Color, @@ -4259,7 +4256,7 @@ function processPolylineVolume(entity, packet, entityCollection, sourceUri) { polylineVolumeData.outlineColor, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Number, @@ -4268,7 +4265,7 @@ function processPolylineVolume(entity, packet, entityCollection, sourceUri) { polylineVolumeData.outlineWidth, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Number, @@ -4277,7 +4274,7 @@ function processPolylineVolume(entity, packet, entityCollection, sourceUri) { polylineVolumeData.granularity, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( ShadowMode, @@ -4286,7 +4283,7 @@ function processPolylineVolume(entity, packet, entityCollection, sourceUri) { polylineVolumeData.shadows, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( DistanceDisplayCondition, @@ -4295,7 +4292,7 @@ function processPolylineVolume(entity, packet, entityCollection, sourceUri) { polylineVolumeData.distanceDisplayCondition, interval, sourceUri, - entityCollection + entityCollection, ); } @@ -4318,7 +4315,7 @@ function processRectangle(entity, packet, entityCollection, sourceUri) { rectangleData.show, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Rectangle, @@ -4327,7 +4324,7 @@ function processRectangle(entity, packet, entityCollection, sourceUri) { rectangleData.coordinates, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Number, @@ -4336,7 +4333,7 @@ function processRectangle(entity, packet, entityCollection, sourceUri) { rectangleData.height, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( HeightReference, @@ -4345,7 +4342,7 @@ function processRectangle(entity, packet, entityCollection, sourceUri) { rectangleData.heightReference, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Number, @@ -4354,7 +4351,7 @@ function processRectangle(entity, packet, entityCollection, sourceUri) { rectangleData.extrudedHeight, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( HeightReference, @@ -4363,7 +4360,7 @@ function processRectangle(entity, packet, entityCollection, sourceUri) { rectangleData.extrudedHeightReference, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Rotation, @@ -4372,7 +4369,7 @@ function processRectangle(entity, packet, entityCollection, sourceUri) { rectangleData.rotation, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Rotation, @@ -4381,7 +4378,7 @@ function processRectangle(entity, packet, entityCollection, sourceUri) { rectangleData.stRotation, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Number, @@ -4390,7 +4387,7 @@ function processRectangle(entity, packet, entityCollection, sourceUri) { rectangleData.granularity, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Boolean, @@ -4399,7 +4396,7 @@ function processRectangle(entity, packet, entityCollection, sourceUri) { rectangleData.fill, interval, sourceUri, - entityCollection + entityCollection, ); processMaterialPacketData( rectangle, @@ -4407,7 +4404,7 @@ function processRectangle(entity, packet, entityCollection, sourceUri) { rectangleData.material, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Boolean, @@ -4416,7 +4413,7 @@ function processRectangle(entity, packet, entityCollection, sourceUri) { rectangleData.outline, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Color, @@ -4425,7 +4422,7 @@ function processRectangle(entity, packet, entityCollection, sourceUri) { rectangleData.outlineColor, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Number, @@ -4434,7 +4431,7 @@ function processRectangle(entity, packet, entityCollection, sourceUri) { rectangleData.outlineWidth, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( ShadowMode, @@ -4443,7 +4440,7 @@ function processRectangle(entity, packet, entityCollection, sourceUri) { rectangleData.shadows, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( DistanceDisplayCondition, @@ -4452,7 +4449,7 @@ function processRectangle(entity, packet, entityCollection, sourceUri) { rectangleData.distanceDisplayCondition, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( ClassificationType, @@ -4461,7 +4458,7 @@ function processRectangle(entity, packet, entityCollection, sourceUri) { rectangleData.classificationType, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Number, @@ -4470,7 +4467,7 @@ function processRectangle(entity, packet, entityCollection, sourceUri) { rectangleData.zIndex, interval, sourceUri, - entityCollection + entityCollection, ); } @@ -4493,7 +4490,7 @@ function processTileset(entity, packet, entityCollection, sourceUri) { tilesetData.show, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Uri, @@ -4502,7 +4499,7 @@ function processTileset(entity, packet, entityCollection, sourceUri) { tilesetData.uri, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Number, @@ -4511,7 +4508,7 @@ function processTileset(entity, packet, entityCollection, sourceUri) { tilesetData.maximumScreenSpaceError, interval, sourceUri, - entityCollection + entityCollection, ); } @@ -4534,20 +4531,20 @@ function processWall(entity, packet, entityCollection, sourceUri) { wallData.show, interval, sourceUri, - entityCollection + entityCollection, ); processPositionArray(wall, "positions", wallData.positions, entityCollection); processArray( wall, "minimumHeights", wallData.minimumHeights, - entityCollection + entityCollection, ); processArray( wall, "maximumHeights", wallData.maximumHeights, - entityCollection + entityCollection, ); processPacketData( Number, @@ -4556,7 +4553,7 @@ function processWall(entity, packet, entityCollection, sourceUri) { wallData.granularity, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Boolean, @@ -4565,7 +4562,7 @@ function processWall(entity, packet, entityCollection, sourceUri) { wallData.fill, interval, sourceUri, - entityCollection + entityCollection, ); processMaterialPacketData( wall, @@ -4573,7 +4570,7 @@ function processWall(entity, packet, entityCollection, sourceUri) { wallData.material, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Boolean, @@ -4582,7 +4579,7 @@ function processWall(entity, packet, entityCollection, sourceUri) { wallData.outline, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Color, @@ -4591,7 +4588,7 @@ function processWall(entity, packet, entityCollection, sourceUri) { wallData.outlineColor, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( Number, @@ -4600,7 +4597,7 @@ function processWall(entity, packet, entityCollection, sourceUri) { wallData.outlineWidth, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( ShadowMode, @@ -4609,7 +4606,7 @@ function processWall(entity, packet, entityCollection, sourceUri) { wallData.shadows, interval, sourceUri, - entityCollection + entityCollection, ); processPacketData( DistanceDisplayCondition, @@ -4618,7 +4615,7 @@ function processWall(entity, packet, entityCollection, sourceUri) { wallData.distanceDisplayCondition, interval, sourceUri, - entityCollection + entityCollection, ); } @@ -4627,7 +4624,7 @@ function processCzmlPacket( entityCollection, updaterFunctions, sourceUri, - dataSource + dataSource, ) { let objectId = packet.id; if (!defined(objectId)) { @@ -4638,7 +4635,7 @@ function processCzmlPacket( if (!defined(dataSource._version) && objectId !== "document") { throw new RuntimeError( - "The first CZML packet is required to be the document object." + "The first CZML packet is required to be the document object.", ); } @@ -4712,13 +4709,13 @@ function updateClock(dataSource) { if (defined(clockPacket.range)) { clock.clockRange = defaultValue( ClockRange[clockPacket.range], - ClockRange.LOOP_STOP + ClockRange.LOOP_STOP, ); } if (defined(clockPacket.step)) { clock.clockStep = defaultValue( ClockStep[clockPacket.step], - ClockStep.SYSTEM_CLOCK_MULTIPLIER + ClockStep.SYSTEM_CLOCK_MULTIPLIER, ); } if (defined(clockPacket.multiplier)) { @@ -4800,7 +4797,7 @@ function loadCzml(dataSource, czml, sourceUri, clear) { entityCollection, sourceUri, undefined, - dataSource + dataSource, ); let raiseChangedEvent = updateClock(dataSource); @@ -5144,7 +5141,7 @@ CzmlDataSource._processCzml = function ( entityCollection, sourceUri, updaterFunctions, - dataSource + dataSource, ) { updaterFunctions = defaultValue(updaterFunctions, CzmlDataSource.updaters); @@ -5155,7 +5152,7 @@ CzmlDataSource._processCzml = function ( entityCollection, updaterFunctions, sourceUri, - dataSource + dataSource, ); } } else { @@ -5164,7 +5161,7 @@ CzmlDataSource._processCzml = function ( entityCollection, updaterFunctions, sourceUri, - dataSource + dataSource, ); } }; diff --git a/packages/engine/Source/DataSources/DataSourceCollection.js b/packages/engine/Source/DataSources/DataSourceCollection.js index 17e33f50b45a..c01bc6d7d7af 100644 --- a/packages/engine/Source/DataSources/DataSourceCollection.js +++ b/packages/engine/Source/DataSources/DataSourceCollection.js @@ -278,7 +278,7 @@ DataSourceCollection.prototype.raiseToTop = function (dataSource) { this.dataSourceMoved.raiseEvent( dataSource, this._dataSources.length - 1, - index + index, ); }; diff --git a/packages/engine/Source/DataSources/DataSourceDisplay.js b/packages/engine/Source/DataSources/DataSourceDisplay.js index be83ae2685ea..c3f552a66405 100644 --- a/packages/engine/Source/DataSources/DataSourceDisplay.js +++ b/packages/engine/Source/DataSources/DataSourceDisplay.js @@ -38,7 +38,7 @@ function DataSourceDisplay(options) { Check.typeOf.object("options.scene", options.scene); Check.typeOf.object( "options.dataSourceCollection", - options.dataSourceCollection + options.dataSourceCollection, ); //>>includeEnd('debug'); @@ -52,17 +52,17 @@ function DataSourceDisplay(options) { this._eventHelper.add( dataSourceCollection.dataSourceAdded, this._onDataSourceAdded, - this + this, ); this._eventHelper.add( dataSourceCollection.dataSourceRemoved, this._onDataSourceRemoved, - this + this, ); this._eventHelper.add( dataSourceCollection.dataSourceMoved, this._onDataSourceMoved, - this + this, ); this._eventHelper.add(scene.postRender, this._postRender, this); @@ -70,7 +70,7 @@ function DataSourceDisplay(options) { this._scene = scene; this._visualizersCallback = defaultValue( options.visualizersCallback, - DataSourceDisplay.defaultVisualizersCallback + DataSourceDisplay.defaultVisualizersCallback, ); let primitivesAdded = false; @@ -106,12 +106,12 @@ function DataSourceDisplay(options) { that._removeDefaultDataSourceListener = undefined; that._removeDataSourceCollectionListener = undefined; }; - removeDefaultDataSourceListener = defaultDataSource.entities.collectionChanged.addEventListener( - addPrimitives - ); - removeDataSourceCollectionListener = dataSourceCollection.dataSourceAdded.addEventListener( - addPrimitives - ); + removeDefaultDataSourceListener = + defaultDataSource.entities.collectionChanged.addEventListener( + addPrimitives, + ); + removeDataSourceCollectionListener = + dataSourceCollection.dataSourceAdded.addEventListener(addPrimitives); } this._removeDefaultDataSourceListener = removeDefaultDataSourceListener; @@ -153,7 +153,7 @@ DataSourceDisplay.unregisterVisualizer = function (visualizer) { DataSourceDisplay.defaultVisualizersCallback = function ( scene, entityCluster, - dataSource + dataSource, ) { const entities = dataSource.entities; return [ @@ -162,7 +162,7 @@ DataSourceDisplay.defaultVisualizersCallback = function ( scene, entities, dataSource._primitives, - dataSource._groundPrimitives + dataSource._groundPrimitives, ), new LabelVisualizer(entityCluster, entities), new ModelVisualizer(scene, entities), @@ -173,10 +173,10 @@ DataSourceDisplay.defaultVisualizersCallback = function ( scene, entities, dataSource._primitives, - dataSource._groundPrimitives + dataSource._groundPrimitives, ), ...ExtraVisualizers.map( - (VisualizerClass) => new VisualizerClass(scene, entities) + (VisualizerClass) => new VisualizerClass(scene, entities), ), ]; }; @@ -266,7 +266,7 @@ DataSourceDisplay.prototype.destroy = function () { for (let i = 0, length = dataSourceCollection.length; i < length; ++i) { this._onDataSourceRemoved( this._dataSourceCollection, - dataSourceCollection.get(i) + dataSourceCollection.get(i), ); } this._onDataSourceRemoved(undefined, this._defaultDataSource); @@ -378,7 +378,7 @@ const getBoundingSphereBoundingSphereScratch = new BoundingSphere(); DataSourceDisplay.prototype.getBoundingSphere = function ( entity, allowPartial, - result + result, ) { //>>includeStart('debug', pragmas.debug); Check.defined("entity", entity); @@ -428,7 +428,7 @@ DataSourceDisplay.prototype.getBoundingSphere = function ( } else if (state === BoundingSphereState.DONE) { boundingSpheres[count] = BoundingSphere.clone( tmp, - boundingSpheres[count] + boundingSpheres[count], ); count++; } @@ -446,7 +446,7 @@ DataSourceDisplay.prototype.getBoundingSphere = function ( DataSourceDisplay.prototype._onDataSourceAdded = function ( dataSourceCollection, - dataSource + dataSource, ) { const scene = this._scene; @@ -455,7 +455,7 @@ DataSourceDisplay.prototype._onDataSourceAdded = function ( const primitives = displayPrimitives.add(new PrimitiveCollection()); const groundPrimitives = displayGroundPrimitives.add( - new OrderedGroundPrimitiveCollection() + new OrderedGroundPrimitiveCollection(), ); dataSource._primitives = primitives; @@ -469,13 +469,13 @@ DataSourceDisplay.prototype._onDataSourceAdded = function ( dataSource._visualizers = this._visualizersCallback( scene, entityCluster, - dataSource + dataSource, ); }; DataSourceDisplay.prototype._onDataSourceRemoved = function ( dataSourceCollection, - dataSource + dataSource, ) { const displayPrimitives = this._primitives; const displayGroundPrimitives = this._groundPrimitives; @@ -501,7 +501,7 @@ DataSourceDisplay.prototype._onDataSourceRemoved = function ( DataSourceDisplay.prototype._onDataSourceMoved = function ( dataSource, newIndex, - oldIndex + oldIndex, ) { const displayPrimitives = this._primitives; const displayGroundPrimitives = this._groundPrimitives; diff --git a/packages/engine/Source/DataSources/DynamicGeometryBatch.js b/packages/engine/Source/DataSources/DynamicGeometryBatch.js index 38c36bcd3d85..4540cf5a58a5 100644 --- a/packages/engine/Source/DataSources/DynamicGeometryBatch.js +++ b/packages/engine/Source/DataSources/DynamicGeometryBatch.js @@ -16,8 +16,8 @@ DynamicGeometryBatch.prototype.add = function (time, updater) { updater.id, updater.createDynamicUpdater( this._primitives, - this._orderedGroundPrimitives - ) + this._orderedGroundPrimitives, + ), ); }; diff --git a/packages/engine/Source/DataSources/DynamicGeometryUpdater.js b/packages/engine/Source/DataSources/DynamicGeometryUpdater.js index 23963ef14faf..e8f8af767684 100644 --- a/packages/engine/Source/DataSources/DynamicGeometryUpdater.js +++ b/packages/engine/Source/DataSources/DynamicGeometryUpdater.js @@ -29,7 +29,7 @@ import Property from "./Property.js"; function DynamicGeometryUpdater( geometryUpdater, primitives, - orderedGroundPrimitives + orderedGroundPrimitives, ) { //>>includeStart('debug', pragmas.debug); Check.defined("geometryUpdater", geometryUpdater); @@ -109,7 +109,7 @@ DynamicGeometryUpdater.prototype.update = function (time) { const material = MaterialProperty.getValue( time, fillMaterialProperty, - this._material + this._material, ); this._material = material; appearance = new MaterialAppearance({ @@ -123,24 +123,21 @@ DynamicGeometryUpdater.prototype.update = function (time) { options.vertexFormat = PerInstanceColorAppearance.VERTEX_FORMAT; this._primitive = orderedGroundPrimitives.add( new GroundPrimitive({ - geometryInstances: this._geometryUpdater.createFillGeometryInstance( - time - ), + geometryInstances: + this._geometryUpdater.createFillGeometryInstance(time), appearance: appearance, asynchronous: false, shadows: shadows, - classificationType: this._geometryUpdater.classificationTypeProperty.getValue( - time - ), + classificationType: + this._geometryUpdater.classificationTypeProperty.getValue(time), }), - Property.getValueOrUndefined(this._geometryUpdater.zIndex, time) + Property.getValueOrUndefined(this._geometryUpdater.zIndex, time), ); } else { options.vertexFormat = appearance.vertexFormat; - const fillInstance = this._geometryUpdater.createFillGeometryInstance( - time - ); + const fillInstance = + this._geometryUpdater.createFillGeometryInstance(time); if (isColorAppearance) { appearance.translucent = fillInstance.attributes.color.value[3] !== 255; @@ -152,7 +149,7 @@ DynamicGeometryUpdater.prototype.update = function (time) { appearance: appearance, asynchronous: false, shadows: shadows, - }) + }), ); } } @@ -162,13 +159,12 @@ DynamicGeometryUpdater.prototype.update = function (time) { defined(geometry.outline) && geometry.outline.getValue(time) ) { - const outlineInstance = this._geometryUpdater.createOutlineGeometryInstance( - time - ); + const outlineInstance = + this._geometryUpdater.createOutlineGeometryInstance(time); const outlineWidth = Property.getValueOrDefault( geometry.outlineWidth, time, - 1.0 + 1.0, ); this._outlinePrimitive = primitives.add( @@ -183,7 +179,7 @@ DynamicGeometryUpdater.prototype.update = function (time) { }), asynchronous: false, shadows: shadows, - }) + }), ); } }; diff --git a/packages/engine/Source/DataSources/EllipseGeometryUpdater.js b/packages/engine/Source/DataSources/EllipseGeometryUpdater.js index 15e65434f462..b266277298c6 100644 --- a/packages/engine/Source/DataSources/EllipseGeometryUpdater.js +++ b/packages/engine/Source/DataSources/EllipseGeometryUpdater.js @@ -65,7 +65,7 @@ function EllipseGeometryUpdater(entity, scene) { if (defined(Object.create)) { EllipseGeometryUpdater.prototype = Object.create( - GroundGeometryUpdater.prototype + GroundGeometryUpdater.prototype, ); EllipseGeometryUpdater.prototype.constructor = EllipseGeometryUpdater; } @@ -84,7 +84,7 @@ EllipseGeometryUpdater.prototype.createFillGeometryInstance = function (time) { if (!this._fillEnabled) { throw new DeveloperError( - "This instance does not represent a filled geometry." + "This instance does not represent a filled geometry.", ); } //>>includeEnd('debug'); @@ -97,11 +97,12 @@ EllipseGeometryUpdater.prototype.createFillGeometryInstance = function (time) { isAvailable && entity.isShowing && this._showProperty.getValue(time) && - this._fillProperty.getValue(time) - ), - distanceDisplayCondition: DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition( - this._distanceDisplayConditionProperty.getValue(time) + this._fillProperty.getValue(time), ), + distanceDisplayCondition: + DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition( + this._distanceDisplayConditionProperty.getValue(time), + ), offset: undefined, color: undefined, }; @@ -126,8 +127,8 @@ EllipseGeometryUpdater.prototype.createFillGeometryInstance = function (time) { this._terrainOffsetProperty, time, defaultOffset, - offsetScratch - ) + offsetScratch, + ), ); } @@ -147,14 +148,14 @@ EllipseGeometryUpdater.prototype.createFillGeometryInstance = function (time) { * @exception {DeveloperError} This instance does not represent an outlined geometry. */ EllipseGeometryUpdater.prototype.createOutlineGeometryInstance = function ( - time + time, ) { //>>includeStart('debug', pragmas.debug); Check.defined("time", time); if (!this._outlineEnabled) { throw new DeveloperError( - "This instance does not represent an outlined geometry." + "This instance does not represent an outlined geometry.", ); } //>>includeEnd('debug'); @@ -165,23 +166,23 @@ EllipseGeometryUpdater.prototype.createOutlineGeometryInstance = function ( this._outlineColorProperty, time, Color.BLACK, - scratchColor - ); - const distanceDisplayCondition = this._distanceDisplayConditionProperty.getValue( - time + scratchColor, ); + const distanceDisplayCondition = + this._distanceDisplayConditionProperty.getValue(time); const attributes = { show: new ShowGeometryInstanceAttribute( isAvailable && entity.isShowing && this._showProperty.getValue(time) && - this._showOutlineProperty.getValue(time) + this._showOutlineProperty.getValue(time), ), color: ColorGeometryInstanceAttribute.fromColor(outlineColor), - distanceDisplayCondition: DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition( - distanceDisplayCondition - ), + distanceDisplayCondition: + DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition( + distanceDisplayCondition, + ), offset: undefined, }; @@ -191,8 +192,8 @@ EllipseGeometryUpdater.prototype.createOutlineGeometryInstance = function ( this._terrainOffsetProperty, time, defaultOffset, - offsetScratch - ) + offsetScratch, + ), ); } @@ -239,25 +240,25 @@ EllipseGeometryUpdater.prototype._isDynamic = function (entity, ellipse) { EllipseGeometryUpdater.prototype._setStaticOptions = function ( entity, - ellipse + ellipse, ) { let heightValue = Property.getValueOrUndefined( ellipse.height, - Iso8601.MINIMUM_VALUE + Iso8601.MINIMUM_VALUE, ); const heightReferenceValue = Property.getValueOrDefault( ellipse.heightReference, Iso8601.MINIMUM_VALUE, - HeightReference.NONE + HeightReference.NONE, ); let extrudedHeightValue = Property.getValueOrUndefined( ellipse.extrudedHeight, - Iso8601.MINIMUM_VALUE + Iso8601.MINIMUM_VALUE, ); const extrudedHeightReferenceValue = Property.getValueOrDefault( ellipse.extrudedHeightReference, Iso8601.MINIMUM_VALUE, - HeightReference.NONE + HeightReference.NONE, ); if (defined(extrudedHeightValue) && !defined(heightValue)) { heightValue = 0; @@ -270,50 +271,51 @@ EllipseGeometryUpdater.prototype._setStaticOptions = function ( : MaterialAppearance.MaterialSupport.TEXTURED.vertexFormat; options.center = entity.position.getValue( Iso8601.MINIMUM_VALUE, - options.center + options.center, ); options.semiMajorAxis = ellipse.semiMajorAxis.getValue( Iso8601.MINIMUM_VALUE, - options.semiMajorAxis + options.semiMajorAxis, ); options.semiMinorAxis = ellipse.semiMinorAxis.getValue( Iso8601.MINIMUM_VALUE, - options.semiMinorAxis + options.semiMinorAxis, ); options.rotation = Property.getValueOrUndefined( ellipse.rotation, - Iso8601.MINIMUM_VALUE + Iso8601.MINIMUM_VALUE, ); options.granularity = Property.getValueOrUndefined( ellipse.granularity, - Iso8601.MINIMUM_VALUE + Iso8601.MINIMUM_VALUE, ); options.stRotation = Property.getValueOrUndefined( ellipse.stRotation, - Iso8601.MINIMUM_VALUE + Iso8601.MINIMUM_VALUE, ); options.numberOfVerticalLines = Property.getValueOrUndefined( ellipse.numberOfVerticalLines, - Iso8601.MINIMUM_VALUE - ); - options.offsetAttribute = GroundGeometryUpdater.computeGeometryOffsetAttribute( - heightValue, - heightReferenceValue, - extrudedHeightValue, - extrudedHeightReferenceValue + Iso8601.MINIMUM_VALUE, ); + options.offsetAttribute = + GroundGeometryUpdater.computeGeometryOffsetAttribute( + heightValue, + heightReferenceValue, + extrudedHeightValue, + extrudedHeightReferenceValue, + ); options.height = GroundGeometryUpdater.getGeometryHeight( heightValue, - heightReferenceValue + heightReferenceValue, ); extrudedHeightValue = GroundGeometryUpdater.getGeometryExtrudedHeight( extrudedHeightValue, - extrudedHeightReferenceValue + extrudedHeightReferenceValue, ); if (extrudedHeightValue === GroundGeometryUpdater.CLAMP_TO_GROUND) { extrudedHeightValue = ApproximateTerrainHeights.getMinimumMaximumHeights( - EllipseGeometry.computeRectangle(options, scratchRectangle) + EllipseGeometry.computeRectangle(options, scratchRectangle), ).minimumTerrainHeight; } @@ -328,27 +330,28 @@ EllipseGeometryUpdater.DynamicGeometryUpdater = DynamicEllipseGeometryUpdater; function DynamicEllipseGeometryUpdater( geometryUpdater, primitives, - groundPrimitives + groundPrimitives, ) { DynamicGeometryUpdater.call( this, geometryUpdater, primitives, - groundPrimitives + groundPrimitives, ); } if (defined(Object.create)) { DynamicEllipseGeometryUpdater.prototype = Object.create( - DynamicGeometryUpdater.prototype + DynamicGeometryUpdater.prototype, ); - DynamicEllipseGeometryUpdater.prototype.constructor = DynamicEllipseGeometryUpdater; + DynamicEllipseGeometryUpdater.prototype.constructor = + DynamicEllipseGeometryUpdater; } DynamicEllipseGeometryUpdater.prototype._isHidden = function ( entity, ellipse, - time + time, ) { const options = this._options; return ( @@ -362,23 +365,23 @@ DynamicEllipseGeometryUpdater.prototype._isHidden = function ( DynamicEllipseGeometryUpdater.prototype._setOptions = function ( entity, ellipse, - time + time, ) { const options = this._options; let heightValue = Property.getValueOrUndefined(ellipse.height, time); const heightReferenceValue = Property.getValueOrDefault( ellipse.heightReference, time, - HeightReference.NONE + HeightReference.NONE, ); let extrudedHeightValue = Property.getValueOrUndefined( ellipse.extrudedHeight, - time + time, ); const extrudedHeightReferenceValue = Property.getValueOrDefault( ellipse.extrudedHeightReference, time, - HeightReference.NONE + HeightReference.NONE, ); if (defined(extrudedHeightValue) && !defined(heightValue)) { heightValue = 0; @@ -387,41 +390,42 @@ DynamicEllipseGeometryUpdater.prototype._setOptions = function ( options.center = Property.getValueOrUndefined( entity.position, time, - options.center + options.center, ); options.semiMajorAxis = Property.getValueOrUndefined( ellipse.semiMajorAxis, - time + time, ); options.semiMinorAxis = Property.getValueOrUndefined( ellipse.semiMinorAxis, - time + time, ); options.rotation = Property.getValueOrUndefined(ellipse.rotation, time); options.granularity = Property.getValueOrUndefined(ellipse.granularity, time); options.stRotation = Property.getValueOrUndefined(ellipse.stRotation, time); options.numberOfVerticalLines = Property.getValueOrUndefined( ellipse.numberOfVerticalLines, - time - ); - options.offsetAttribute = GroundGeometryUpdater.computeGeometryOffsetAttribute( - heightValue, - heightReferenceValue, - extrudedHeightValue, - extrudedHeightReferenceValue + time, ); + options.offsetAttribute = + GroundGeometryUpdater.computeGeometryOffsetAttribute( + heightValue, + heightReferenceValue, + extrudedHeightValue, + extrudedHeightReferenceValue, + ); options.height = GroundGeometryUpdater.getGeometryHeight( heightValue, - heightReferenceValue + heightReferenceValue, ); extrudedHeightValue = GroundGeometryUpdater.getGeometryExtrudedHeight( extrudedHeightValue, - extrudedHeightReferenceValue + extrudedHeightReferenceValue, ); if (extrudedHeightValue === GroundGeometryUpdater.CLAMP_TO_GROUND) { extrudedHeightValue = ApproximateTerrainHeights.getMinimumMaximumHeights( - EllipseGeometry.computeRectangle(options, scratchRectangle) + EllipseGeometry.computeRectangle(options, scratchRectangle), ).minimumTerrainHeight; } diff --git a/packages/engine/Source/DataSources/EllipseGraphics.js b/packages/engine/Source/DataSources/EllipseGraphics.js index 4c85aee9acf0..3229900640a3 100644 --- a/packages/engine/Source/DataSources/EllipseGraphics.js +++ b/packages/engine/Source/DataSources/EllipseGraphics.js @@ -249,7 +249,7 @@ Object.defineProperties(EllipseGraphics.prototype, { * @type {Property|undefined} */ distanceDisplayCondition: createPropertyDescriptor( - "distanceDisplayCondition" + "distanceDisplayCondition", ), /** @@ -321,15 +321,15 @@ EllipseGraphics.prototype.merge = function (source) { this.height = defaultValue(this.height, source.height); this.heightReference = defaultValue( this.heightReference, - source.heightReference + source.heightReference, ); this.extrudedHeight = defaultValue( this.extrudedHeight, - source.extrudedHeight + source.extrudedHeight, ); this.extrudedHeightReference = defaultValue( this.extrudedHeightReference, - source.extrudedHeightReference + source.extrudedHeightReference, ); this.rotation = defaultValue(this.rotation, source.rotation); this.stRotation = defaultValue(this.stRotation, source.stRotation); @@ -341,16 +341,16 @@ EllipseGraphics.prototype.merge = function (source) { this.outlineWidth = defaultValue(this.outlineWidth, source.outlineWidth); this.numberOfVerticalLines = defaultValue( this.numberOfVerticalLines, - source.numberOfVerticalLines + source.numberOfVerticalLines, ); this.shadows = defaultValue(this.shadows, source.shadows); this.distanceDisplayCondition = defaultValue( this.distanceDisplayCondition, - source.distanceDisplayCondition + source.distanceDisplayCondition, ); this.classificationType = defaultValue( this.classificationType, - source.classificationType + source.classificationType, ); this.zIndex = defaultValue(this.zIndex, source.zIndex); }; diff --git a/packages/engine/Source/DataSources/EllipsoidGeometryUpdater.js b/packages/engine/Source/DataSources/EllipsoidGeometryUpdater.js index cd4f89bec7a9..2703e2f3fb4a 100644 --- a/packages/engine/Source/DataSources/EllipsoidGeometryUpdater.js +++ b/packages/engine/Source/DataSources/EllipsoidGeometryUpdater.js @@ -77,7 +77,7 @@ function EllipsoidGeometryUpdater(entity, scene) { entity, "ellipsoid", entity.ellipsoid, - undefined + undefined, ); } @@ -114,7 +114,7 @@ Object.defineProperties(EllipsoidGeometryUpdater.prototype, { EllipsoidGeometryUpdater.prototype.createFillGeometryInstance = function ( time, skipModelMatrix, - modelMatrixResult + modelMatrixResult, ) { //>>includeStart('debug', pragmas.debug); Check.defined("time", time); @@ -128,14 +128,14 @@ EllipsoidGeometryUpdater.prototype.createFillGeometryInstance = function ( isAvailable && entity.isShowing && this._showProperty.getValue(time) && - this._fillProperty.getValue(time) - ); - const distanceDisplayCondition = this._distanceDisplayConditionProperty.getValue( - time - ); - const distanceDisplayConditionAttribute = DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition( - distanceDisplayCondition + this._fillProperty.getValue(time), ); + const distanceDisplayCondition = + this._distanceDisplayConditionProperty.getValue(time); + const distanceDisplayConditionAttribute = + DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition( + distanceDisplayCondition, + ); const attributes = { show: show, @@ -164,8 +164,8 @@ EllipsoidGeometryUpdater.prototype.createFillGeometryInstance = function ( this._terrainOffsetProperty, time, defaultOffset, - offsetScratch - ) + offsetScratch, + ), ); } @@ -179,7 +179,7 @@ EllipsoidGeometryUpdater.prototype.createFillGeometryInstance = function ( entity.ellipsoid.heightReference, this._options.radii.z * 0.5, this._scene.ellipsoid, - modelMatrixResult + modelMatrixResult, ), attributes: attributes, }); @@ -198,7 +198,7 @@ EllipsoidGeometryUpdater.prototype.createFillGeometryInstance = function ( EllipsoidGeometryUpdater.prototype.createOutlineGeometryInstance = function ( time, skipModelMatrix, - modelMatrixResult + modelMatrixResult, ) { //>>includeStart('debug', pragmas.debug); Check.defined("time", time); @@ -211,23 +211,23 @@ EllipsoidGeometryUpdater.prototype.createOutlineGeometryInstance = function ( this._outlineColorProperty, time, Color.BLACK, - scratchColor - ); - const distanceDisplayCondition = this._distanceDisplayConditionProperty.getValue( - time + scratchColor, ); + const distanceDisplayCondition = + this._distanceDisplayConditionProperty.getValue(time); const attributes = { show: new ShowGeometryInstanceAttribute( isAvailable && entity.isShowing && this._showProperty.getValue(time) && - this._showOutlineProperty.getValue(time) + this._showOutlineProperty.getValue(time), ), color: ColorGeometryInstanceAttribute.fromColor(outlineColor), - distanceDisplayCondition: DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition( - distanceDisplayCondition - ), + distanceDisplayCondition: + DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition( + distanceDisplayCondition, + ), offset: undefined, }; if (defined(this._options.offsetAttribute)) { @@ -236,8 +236,8 @@ EllipsoidGeometryUpdater.prototype.createOutlineGeometryInstance = function ( this._terrainOffsetProperty, time, defaultOffset, - offsetScratch - ) + offsetScratch, + ), ); } @@ -251,7 +251,7 @@ EllipsoidGeometryUpdater.prototype.createOutlineGeometryInstance = function ( entity.ellipsoid.heightReference, this._options.radii.z * 0.5, this._scene.ellipsoid, - modelMatrixResult + modelMatrixResult, ), attributes: attributes, }); @@ -288,12 +288,12 @@ EllipsoidGeometryUpdater.prototype._isDynamic = function (entity, ellipsoid) { EllipsoidGeometryUpdater.prototype._setStaticOptions = function ( entity, - ellipsoid + ellipsoid, ) { const heightReference = Property.getValueOrDefault( ellipsoid.heightReference, Iso8601.MINIMUM_VALUE, - HeightReference.NONE + HeightReference.NONE, ); const options = this._options; options.vertexFormat = @@ -302,39 +302,39 @@ EllipsoidGeometryUpdater.prototype._setStaticOptions = function ( : MaterialAppearance.MaterialSupport.TEXTURED.vertexFormat; options.radii = ellipsoid.radii.getValue( Iso8601.MINIMUM_VALUE, - options.radii + options.radii, ); options.innerRadii = Property.getValueOrUndefined( ellipsoid.innerRadii, - options.radii + options.radii, ); options.minimumClock = Property.getValueOrUndefined( ellipsoid.minimumClock, - Iso8601.MINIMUM_VALUE + Iso8601.MINIMUM_VALUE, ); options.maximumClock = Property.getValueOrUndefined( ellipsoid.maximumClock, - Iso8601.MINIMUM_VALUE + Iso8601.MINIMUM_VALUE, ); options.minimumCone = Property.getValueOrUndefined( ellipsoid.minimumCone, - Iso8601.MINIMUM_VALUE + Iso8601.MINIMUM_VALUE, ); options.maximumCone = Property.getValueOrUndefined( ellipsoid.maximumCone, - Iso8601.MINIMUM_VALUE + Iso8601.MINIMUM_VALUE, ); options.stackPartitions = Property.getValueOrUndefined( ellipsoid.stackPartitions, - Iso8601.MINIMUM_VALUE + Iso8601.MINIMUM_VALUE, ); options.slicePartitions = Property.getValueOrUndefined( ellipsoid.slicePartitions, - Iso8601.MINIMUM_VALUE + Iso8601.MINIMUM_VALUE, ); options.subdivisions = Property.getValueOrUndefined( ellipsoid.subdivisions, - Iso8601.MINIMUM_VALUE + Iso8601.MINIMUM_VALUE, ); options.offsetAttribute = heightReference !== HeightReference.NONE @@ -342,9 +342,11 @@ EllipsoidGeometryUpdater.prototype._setStaticOptions = function ( : undefined; }; -EllipsoidGeometryUpdater.prototype._onEntityPropertyChanged = heightReferenceOnEntityPropertyChanged; +EllipsoidGeometryUpdater.prototype._onEntityPropertyChanged = + heightReferenceOnEntityPropertyChanged; -EllipsoidGeometryUpdater.DynamicGeometryUpdater = DynamicEllipsoidGeometryUpdater; +EllipsoidGeometryUpdater.DynamicGeometryUpdater = + DynamicEllipsoidGeometryUpdater; /** * @private @@ -352,13 +354,13 @@ EllipsoidGeometryUpdater.DynamicGeometryUpdater = DynamicEllipsoidGeometryUpdate function DynamicEllipsoidGeometryUpdater( geometryUpdater, primitives, - groundPrimitives + groundPrimitives, ) { DynamicGeometryUpdater.call( this, geometryUpdater, primitives, - groundPrimitives + groundPrimitives, ); this._scene = geometryUpdater._scene; @@ -376,9 +378,10 @@ function DynamicEllipsoidGeometryUpdater( if (defined(Object.create)) { DynamicEllipsoidGeometryUpdater.prototype = Object.create( - DynamicGeometryUpdater.prototype + DynamicGeometryUpdater.prototype, ); - DynamicEllipsoidGeometryUpdater.prototype.constructor = DynamicEllipsoidGeometryUpdater; + DynamicEllipsoidGeometryUpdater.prototype.constructor = + DynamicEllipsoidGeometryUpdater; } DynamicEllipsoidGeometryUpdater.prototype.update = function (time) { @@ -406,7 +409,7 @@ DynamicEllipsoidGeometryUpdater.prototype.update = function (time) { const radii = Property.getValueOrUndefined( ellipsoid.radii, time, - radiiScratch + radiiScratch, ); let modelMatrix = defined(radii) ? entity.computeModelMatrixForHeightReference( @@ -414,7 +417,7 @@ DynamicEllipsoidGeometryUpdater.prototype.update = function (time) { ellipsoid.heightReference, radii.z * 0.5, this._scene.ellipsoid, - this._modelMatrix + this._modelMatrix, ) : undefined; if (!defined(modelMatrix) || !defined(radii)) { @@ -433,57 +436,57 @@ DynamicEllipsoidGeometryUpdater.prototype.update = function (time) { const showOutline = Property.getValueOrDefault( ellipsoid.outline, time, - false + false, ); const outlineColor = Property.getValueOrClonedDefault( ellipsoid.outlineColor, time, Color.BLACK, - scratchColor + scratchColor, ); const material = MaterialProperty.getValue( time, defaultValue(ellipsoid.material, defaultMaterial), - this._material + this._material, ); // Check properties that could trigger a primitive rebuild. const innerRadii = Property.getValueOrUndefined( ellipsoid.innerRadii, time, - innerRadiiScratch + innerRadiiScratch, ); const minimumClock = Property.getValueOrUndefined( ellipsoid.minimumClock, - time + time, ); const maximumClock = Property.getValueOrUndefined( ellipsoid.maximumClock, - time + time, ); const minimumCone = Property.getValueOrUndefined(ellipsoid.minimumCone, time); const maximumCone = Property.getValueOrUndefined(ellipsoid.maximumCone, time); const stackPartitions = Property.getValueOrUndefined( ellipsoid.stackPartitions, - time + time, ); const slicePartitions = Property.getValueOrUndefined( ellipsoid.slicePartitions, - time + time, ); const subdivisions = Property.getValueOrUndefined( ellipsoid.subdivisions, - time + time, ); const outlineWidth = Property.getValueOrDefault( ellipsoid.outlineWidth, time, - 1.0 + 1.0, ); const heightReference = Property.getValueOrDefault( ellipsoid.heightReference, time, - HeightReference.NONE + HeightReference.NONE, ); const offsetAttribute = heightReference !== HeightReference.NONE @@ -500,17 +503,16 @@ DynamicEllipsoidGeometryUpdater.prototype.update = function (time) { const shadows = this._geometryUpdater.shadowsProperty.getValue(time); - const distanceDisplayConditionProperty = this._geometryUpdater - .distanceDisplayConditionProperty; - const distanceDisplayCondition = distanceDisplayConditionProperty.getValue( - time - ); + const distanceDisplayConditionProperty = + this._geometryUpdater.distanceDisplayConditionProperty; + const distanceDisplayCondition = + distanceDisplayConditionProperty.getValue(time); const offset = Property.getValueOrDefault( this._geometryUpdater.terrainOffsetProperty, time, defaultOffset, - offsetScratch + offsetScratch, ); //We only rebuild the primitive if something other than the radii has changed @@ -551,7 +553,7 @@ DynamicEllipsoidGeometryUpdater.prototype.update = function (time) { innerRadii.x / radii.x, innerRadii.y / radii.y, innerRadii.z / radii.z, - options.innerRadii + options.innerRadii, ); } else { options.innerRadii = Cartesian3.clone(innerRadii, options.innerRadii); @@ -574,7 +576,7 @@ DynamicEllipsoidGeometryUpdater.prototype.update = function (time) { const fillInstance = this._geometryUpdater.createFillGeometryInstance( time, in3D, - this._modelMatrix + this._modelMatrix, ); this._primitive = primitives.add( @@ -583,13 +585,13 @@ DynamicEllipsoidGeometryUpdater.prototype.update = function (time) { appearance: appearance, asynchronous: false, shadows: shadows, - }) + }), ); const outlineInstance = this._geometryUpdater.createOutlineGeometryInstance( time, in3D, - this._modelMatrix + this._modelMatrix, ); this._outlinePrimitive = primitives.add( new Primitive({ @@ -598,14 +600,13 @@ DynamicEllipsoidGeometryUpdater.prototype.update = function (time) { flat: true, translucent: outlineInstance.attributes.color.value[3] !== 255, renderState: { - lineWidth: this._geometryUpdater._scene.clampLineWidth( - outlineWidth - ), + lineWidth: + this._geometryUpdater._scene.clampLineWidth(outlineWidth), }, }), asynchronous: false, shadows: shadows, - }) + }), ); this._lastShow = showFill; @@ -630,7 +631,7 @@ DynamicEllipsoidGeometryUpdater.prototype.update = function (time) { if (showFill !== this._lastShow) { attributes.show = ShowGeometryInstanceAttribute.toValue( showFill, - attributes.show + attributes.show, ); this._lastShow = showFill; } @@ -638,16 +639,15 @@ DynamicEllipsoidGeometryUpdater.prototype.update = function (time) { let outlineAttributes = this._outlineAttributes; if (!defined(outlineAttributes)) { - outlineAttributes = outlinePrimitive.getGeometryInstanceAttributes( - entity - ); + outlineAttributes = + outlinePrimitive.getGeometryInstanceAttributes(entity); this._outlineAttributes = outlineAttributes; } if (showOutline !== this._lastOutlineShow) { outlineAttributes.show = ShowGeometryInstanceAttribute.toValue( showOutline, - outlineAttributes.show + outlineAttributes.show, ); this._lastOutlineShow = showOutline; } @@ -655,7 +655,7 @@ DynamicEllipsoidGeometryUpdater.prototype.update = function (time) { if (!Color.equals(outlineColor, this._lastOutlineColor)) { outlineAttributes.color = ColorGeometryInstanceAttribute.toValue( outlineColor, - outlineAttributes.color + outlineAttributes.color, ); Color.clone(outlineColor, this._lastOutlineColor); } @@ -663,31 +663,33 @@ DynamicEllipsoidGeometryUpdater.prototype.update = function (time) { if ( !DistanceDisplayCondition.equals( distanceDisplayCondition, - this._lastDistanceDisplayCondition + this._lastDistanceDisplayCondition, ) ) { - attributes.distanceDisplayCondition = DistanceDisplayConditionGeometryInstanceAttribute.toValue( - distanceDisplayCondition, - attributes.distanceDisplayCondition - ); - outlineAttributes.distanceDisplayCondition = DistanceDisplayConditionGeometryInstanceAttribute.toValue( - distanceDisplayCondition, - outlineAttributes.distanceDisplayCondition - ); + attributes.distanceDisplayCondition = + DistanceDisplayConditionGeometryInstanceAttribute.toValue( + distanceDisplayCondition, + attributes.distanceDisplayCondition, + ); + outlineAttributes.distanceDisplayCondition = + DistanceDisplayConditionGeometryInstanceAttribute.toValue( + distanceDisplayCondition, + outlineAttributes.distanceDisplayCondition, + ); DistanceDisplayCondition.clone( distanceDisplayCondition, - this._lastDistanceDisplayCondition + this._lastDistanceDisplayCondition, ); } if (!Cartesian3.equals(offset, this._lastOffset)) { attributes.offset = OffsetGeometryInstanceAttribute.toValue( offset, - attributes.offset + attributes.offset, ); outlineAttributes.offset = OffsetGeometryInstanceAttribute.toValue( offset, - attributes.offset + attributes.offset, ); Cartesian3.clone(offset, this._lastOffset); } diff --git a/packages/engine/Source/DataSources/EllipsoidGraphics.js b/packages/engine/Source/DataSources/EllipsoidGraphics.js index ea68b330a751..1d3ed23b6a76 100644 --- a/packages/engine/Source/DataSources/EllipsoidGraphics.js +++ b/packages/engine/Source/DataSources/EllipsoidGraphics.js @@ -241,7 +241,7 @@ Object.defineProperties(EllipsoidGraphics.prototype, { * @type {Property|undefined} */ distanceDisplayCondition: createPropertyDescriptor( - "distanceDisplayCondition" + "distanceDisplayCondition", ), }); @@ -298,7 +298,7 @@ EllipsoidGraphics.prototype.merge = function (source) { this.maximumCone = defaultValue(this.maximumCone, source.maximumCone); this.heightReference = defaultValue( this.heightReference, - source.heightReference + source.heightReference, ); this.fill = defaultValue(this.fill, source.fill); this.material = defaultValue(this.material, source.material); @@ -307,17 +307,17 @@ EllipsoidGraphics.prototype.merge = function (source) { this.outlineWidth = defaultValue(this.outlineWidth, source.outlineWidth); this.stackPartitions = defaultValue( this.stackPartitions, - source.stackPartitions + source.stackPartitions, ); this.slicePartitions = defaultValue( this.slicePartitions, - source.slicePartitions + source.slicePartitions, ); this.subdivisions = defaultValue(this.subdivisions, source.subdivisions); this.shadows = defaultValue(this.shadows, source.shadows); this.distanceDisplayCondition = defaultValue( this.distanceDisplayCondition, - source.distanceDisplayCondition + source.distanceDisplayCondition, ); }; export default EllipsoidGraphics; diff --git a/packages/engine/Source/DataSources/Entity.js b/packages/engine/Source/DataSources/Entity.js index 42aad8019714..b2b7433e29ba 100644 --- a/packages/engine/Source/DataSources/Entity.js +++ b/packages/engine/Source/DataSources/Entity.js @@ -51,7 +51,7 @@ function createPositionPropertyDescriptor(name) { return createPropertyDescriptor( name, undefined, - createConstantPositionProperty + createConstantPositionProperty, ); } @@ -220,7 +220,7 @@ function updateShow(entity, children, isShowing) { entity, "isShowing", isShowing, - !isShowing + !isShowing, ); } @@ -461,7 +461,7 @@ Object.defineProperties(Entity.prototype, { */ polylineVolume: createPropertyTypeDescriptor( "polylineVolume", - PolylineVolumeGraphics + PolylineVolumeGraphics, ), /** * Gets or sets the bag of arbitrary properties associated with this entity. @@ -548,7 +548,7 @@ Entity.prototype.addProperty = function (propertyName) { } if (propertyNames.indexOf(propertyName) !== -1) { throw new DeveloperError( - `${propertyName} is already a registered property.` + `${propertyName} is already a registered property.`, ); } if (propertyName in this) { @@ -560,7 +560,7 @@ Entity.prototype.addProperty = function (propertyName) { Object.defineProperty( this, propertyName, - createRawPropertyDescriptor(propertyName, true) + createRawPropertyDescriptor(propertyName, true), ); }; @@ -672,7 +672,7 @@ Entity.prototype.computeModelMatrix = function (time, result) { const position = Property.getValueOrUndefined( this._position, time, - positionScratch + positionScratch, ); if (!defined(position)) { return undefined; @@ -681,7 +681,7 @@ Entity.prototype.computeModelMatrix = function (time, result) { const orientation = Property.getValueOrUndefined( this._orientation, time, - orientationScratch + orientationScratch, ); if (!defined(orientation)) { result = Transforms.eastNorthUpToFixedFrame(position, undefined, result); @@ -689,7 +689,7 @@ Entity.prototype.computeModelMatrix = function (time, result) { result = Matrix4.fromRotationTranslation( Matrix3.fromQuaternion(orientation, matrix3Scratch), position, - result + result, ); } return result; @@ -703,7 +703,7 @@ Entity.prototype.computeModelMatrixForHeightReference = function ( heightReferenceProperty, heightOffset, ellipsoid, - result + result, ) { //>>includeStart('debug', pragmas.debug); Check.typeOf.object("time", time); @@ -711,12 +711,12 @@ Entity.prototype.computeModelMatrixForHeightReference = function ( const heightReference = Property.getValueOrDefault( heightReferenceProperty, time, - HeightReference.NONE + HeightReference.NONE, ); let position = Property.getValueOrUndefined( this._position, time, - positionScratch + positionScratch, ); if ( heightReference === HeightReference.NONE || @@ -737,7 +737,7 @@ Entity.prototype.computeModelMatrixForHeightReference = function ( const orientation = Property.getValueOrUndefined( this._orientation, time, - orientationScratch + orientationScratch, ); if (!defined(orientation)) { result = Transforms.eastNorthUpToFixedFrame(position, undefined, result); @@ -745,7 +745,7 @@ Entity.prototype.computeModelMatrixForHeightReference = function ( result = Matrix4.fromRotationTranslation( Matrix3.fromQuaternion(orientation, matrix3Scratch), position, - result + result, ); } return result; diff --git a/packages/engine/Source/DataSources/EntityCluster.js b/packages/engine/Source/DataSources/EntityCluster.js index 9b3d59c364e0..f4106792f289 100644 --- a/packages/engine/Source/DataSources/EntityCluster.js +++ b/packages/engine/Source/DataSources/EntityCluster.js @@ -115,7 +115,7 @@ function getBoundingBox(item, coord, pixelRange, entityCluster, result) { const labelBBox = Label.getScreenSpaceBoundingBox( label, coord, - labelBoundingBoxScratch + labelBoundingBoxScratch, ); expandBoundingBox(labelBBox, pixelRange); result = BoundingRectangle.union(result, labelBBox, result); @@ -152,7 +152,10 @@ function addCluster(position, numPoints, ids, entityCluster) { cluster.label.show = true; cluster.label.text = numPoints.toLocaleString(); cluster.label.id = ids; - cluster.billboard.position = cluster.label.position = cluster.point.position = position; + cluster.billboard.position = + cluster.label.position = + cluster.point.position = + position; entityCluster._clusterEvent.raiseEvent(ids, cluster); } @@ -170,7 +173,7 @@ function getScreenSpacePositions( points, scene, occluder, - entityCluster + entityCluster, ) { if (!defined(collection)) { return; @@ -248,27 +251,26 @@ function createDeclutterCallback(entityCluster) { if (defined(clusteredLabelCollection)) { clusteredLabelCollection.removeAll(); } else { - clusteredLabelCollection = entityCluster._clusterLabelCollection = new LabelCollection( - { + clusteredLabelCollection = entityCluster._clusterLabelCollection = + new LabelCollection({ scene: scene, - } - ); + }); } if (defined(clusteredBillboardCollection)) { clusteredBillboardCollection.removeAll(); } else { - clusteredBillboardCollection = entityCluster._clusterBillboardCollection = new BillboardCollection( - { + clusteredBillboardCollection = entityCluster._clusterBillboardCollection = + new BillboardCollection({ scene: scene, - } - ); + }); } if (defined(clusteredPointCollection)) { clusteredPointCollection.removeAll(); } else { - clusteredPointCollection = entityCluster._clusterPointCollection = new PointPrimitiveCollection(); + clusteredPointCollection = entityCluster._clusterPointCollection = + new PointPrimitiveCollection(); } const pixelRange = entityCluster._pixelRange; @@ -291,7 +293,7 @@ function createDeclutterCallback(entityCluster) { points, scene, occluder, - entityCluster + entityCluster, ); } if (entityCluster._clusterBillboards) { @@ -300,7 +302,7 @@ function createDeclutterCallback(entityCluster) { points, scene, occluder, - entityCluster + entityCluster, ); } if (entityCluster._clusterPoints) { @@ -309,7 +311,7 @@ function createDeclutterCallback(entityCluster) { points, scene, occluder, - entityCluster + entityCluster, ); } @@ -348,7 +350,7 @@ function createDeclutterCallback(entityCluster) { cluster.position, Cartesian3.ZERO, Cartesian2.ZERO, - scene + scene, ); if (!defined(coord)) { continue; @@ -412,18 +414,18 @@ function createDeclutterCallback(entityCluster) { point.coord, pixelRange, entityCluster, - pointBoundinRectangleScratch + pointBoundinRectangleScratch, ); const totalBBox = BoundingRectangle.clone( bbox, - totalBoundingRectangleScratch + totalBoundingRectangleScratch, ); neighbors = index.range( bbox.x, bbox.y, bbox.x + bbox.width, - bbox.y + bbox.height + bbox.y + bbox.height, ); neighborLength = neighbors.length; @@ -436,20 +438,20 @@ function createDeclutterCallback(entityCluster) { neighborPoint = points[neighborIndex]; if (!neighborPoint.clustered) { const neighborItem = neighborPoint.collection.get( - neighborPoint.index + neighborPoint.index, ); const neighborBBox = getBoundingBox( neighborItem, neighborPoint.coord, pixelRange, entityCluster, - neighborBoundingRectangleScratch + neighborBoundingRectangleScratch, ); Cartesian3.add( neighborItem.position, clusterPosition, - clusterPosition + clusterPosition, ); BoundingRectangle.union(totalBBox, neighborBBox, totalBBox); @@ -463,7 +465,7 @@ function createDeclutterCallback(entityCluster) { const position = Cartesian3.multiplyByScalar( clusterPosition, 1.0 / numPoints, - clusterPosition + clusterPosition, ); addCluster(position, numPoints, ids, entityCluster); newClusters.push({ @@ -614,7 +616,7 @@ function createGetEntity( collectionProperty, CollectionConstructor, unusedIndicesProperty, - entityIndexProperty + entityIndexProperty, ) { return function (entity) { let collection = this[collectionProperty]; @@ -689,7 +691,7 @@ EntityCluster.prototype.getLabel = createGetEntity( "_labelCollection", LabelCollection, "_unusedLabelIndices", - "labelIndex" + "labelIndex", ); /** @@ -735,7 +737,7 @@ EntityCluster.prototype.getBillboard = createGetEntity( "_billboardCollection", BillboardCollection, "_unusedBillboardIndices", - "billboardIndex" + "billboardIndex", ); /** @@ -781,7 +783,7 @@ EntityCluster.prototype.getPoint = createGetEntity( "_pointCollection", PointPrimitiveCollection, "_unusedPointIndices", - "pointIndex" + "pointIndex", ); /** diff --git a/packages/engine/Source/DataSources/EntityCollection.js b/packages/engine/Source/DataSources/EntityCollection.js index 67c125ff9911..48fffe489df3 100644 --- a/packages/engine/Source/DataSources/EntityCollection.js +++ b/packages/engine/Source/DataSources/EntityCollection.js @@ -37,7 +37,7 @@ function fireChangedEvent(collection) { collection, addedArray, removedArray, - changedArray + changedArray, ); } while (collection._refire); collection._firing = false; @@ -91,7 +91,7 @@ EntityCollection.prototype.resumeEvents = function () { //>>includeStart('debug', pragmas.debug); if (this._suspendCount === 0) { throw new DeveloperError( - "resumeEvents can not be called before suspendEvents." + "resumeEvents can not be called before suspendEvents.", ); } //>>includeEnd('debug'); @@ -193,7 +193,7 @@ Object.defineProperties(EntityCollection.prototype, { entity, "isShowing", entity.isShowing, - oldShow + oldShow, ); } } @@ -281,7 +281,7 @@ EntityCollection.prototype.add = function (entity) { const entities = this._entities; if (entities.contains(id)) { throw new DeveloperError( - `An entity with id ${id} already exists in this collection.` + `An entity with id ${id} already exists in this collection.`, ); } @@ -293,7 +293,7 @@ EntityCollection.prototype.add = function (entity) { } entity.definitionChanged.addEventListener( EntityCollection.prototype._onEntityDefinitionChanged, - this + this, ); fireChangedEvent(this); @@ -352,7 +352,7 @@ EntityCollection.prototype.removeById = function (id) { this._entities.remove(id); entity.definitionChanged.removeEventListener( EntityCollection.prototype._onEntityDefinitionChanged, - this + this, ); fireChangedEvent(this); @@ -379,7 +379,7 @@ EntityCollection.prototype.removeAll = function () { if (!defined(addedItem)) { existingItem.definitionChanged.removeEventListener( EntityCollection.prototype._onEntityDefinitionChanged, - this + this, ); removed.set(existingItemId, existingItem); } diff --git a/packages/engine/Source/DataSources/EntityView.js b/packages/engine/Source/DataSources/EntityView.js index 886602029b8e..eb4fd4c5c207 100644 --- a/packages/engine/Source/DataSources/EntityView.js +++ b/packages/engine/Source/DataSources/EntityView.js @@ -31,7 +31,7 @@ function updateTransform( saveCamera, positionProperty, time, - ellipsoid + ellipsoid, ) { const mode = that.scene.mode; let cartesian = positionProperty.getValue(time, that._lastCartesian); @@ -48,7 +48,7 @@ function updateTransform( JulianDate.addSeconds(time, 0.001, deltaTime); let deltaCartesian = positionProperty.getValue( deltaTime, - updateTransformCartesian3Scratch1 + updateTransformCartesian3Scratch1, ); // If no valid position at (time + 0.001), sample at (time - 0.001) and invert the vector @@ -56,7 +56,7 @@ function updateTransform( JulianDate.addSeconds(time, -0.001, deltaTime); deltaCartesian = positionProperty.getValue( deltaTime, - updateTransformCartesian3Scratch1 + updateTransformCartesian3Scratch1, ); invertVelocity = true; } @@ -64,50 +64,50 @@ function updateTransform( if (defined(deltaCartesian)) { let toInertial = Transforms.computeFixedToIcrfMatrix( time, - updateTransformMatrix3Scratch1 + updateTransformMatrix3Scratch1, ); let toInertialDelta = Transforms.computeFixedToIcrfMatrix( deltaTime, - updateTransformMatrix3Scratch2 + updateTransformMatrix3Scratch2, ); let toFixed; if (!defined(toInertial) || !defined(toInertialDelta)) { toFixed = Transforms.computeTemeToPseudoFixedMatrix( time, - updateTransformMatrix3Scratch3 + updateTransformMatrix3Scratch3, ); toInertial = Matrix3.transpose( toFixed, - updateTransformMatrix3Scratch1 + updateTransformMatrix3Scratch1, ); toInertialDelta = Transforms.computeTemeToPseudoFixedMatrix( deltaTime, - updateTransformMatrix3Scratch2 + updateTransformMatrix3Scratch2, ); Matrix3.transpose(toInertialDelta, toInertialDelta); } else { toFixed = Matrix3.transpose( toInertial, - updateTransformMatrix3Scratch3 + updateTransformMatrix3Scratch3, ); } const inertialCartesian = Matrix3.multiplyByVector( toInertial, cartesian, - updateTransformCartesian3Scratch5 + updateTransformCartesian3Scratch5, ); const inertialDeltaCartesian = Matrix3.multiplyByVector( toInertialDelta, deltaCartesian, - updateTransformCartesian3Scratch6 + updateTransformCartesian3Scratch6, ); Cartesian3.subtract( inertialCartesian, inertialDeltaCartesian, - updateTransformCartesian3Scratch4 + updateTransformCartesian3Scratch4, ); const inertialVelocity = Cartesian3.magnitude(updateTransformCartesian3Scratch4) * 1000.0; // meters/sec @@ -132,14 +132,14 @@ function updateTransform( // Z is North zBasis = Cartesian3.clone( Cartesian3.UNIT_Z, - updateTransformCartesian3Scratch3 + updateTransformCartesian3Scratch3, ); // Y is along the cross of z and x (right handed basis / in the direction of motion) yBasis = Cartesian3.cross( zBasis, xBasis, - updateTransformCartesian3Scratch1 + updateTransformCartesian3Scratch1, ); if (Cartesian3.magnitude(yBasis) > CesiumMath.EPSILON7) { Cartesian3.normalize(xBasis, xBasis); @@ -148,7 +148,7 @@ function updateTransform( zBasis = Cartesian3.cross( xBasis, yBasis, - updateTransformCartesian3Scratch3 + updateTransformCartesian3Scratch3, ); Cartesian3.normalize(zBasis, zBasis); @@ -158,7 +158,7 @@ function updateTransform( !Cartesian3.equalsEpsilon( cartesian, deltaCartesian, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ) ) { // Approximation of VVLH (Vehicle Velocity Local Horizontal) with the Z-axis flipped. @@ -172,7 +172,7 @@ function updateTransform( yBasis = Cartesian3.cross( zBasis, inertialDeltaCartesian, - updateTransformCartesian3Scratch3 + updateTransformCartesian3Scratch3, ); if (invertVelocity) { @@ -183,14 +183,14 @@ function updateTransform( !Cartesian3.equalsEpsilon( yBasis, Cartesian3.ZERO, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ) ) { // X is along the cross of y and z (right handed basis / in the direction of motion) xBasis = Cartesian3.cross( yBasis, zBasis, - updateTransformCartesian3Scratch1 + updateTransformCartesian3Scratch1, ); Matrix3.multiplyByVector(toFixed, xBasis, xBasis); @@ -218,11 +218,11 @@ function updateTransform( if (saveCamera) { position = Cartesian3.clone( camera.position, - updateTransformCartesian3Scratch4 + updateTransformCartesian3Scratch4, ); direction = Cartesian3.clone( camera.direction, - updateTransformCartesian3Scratch5 + updateTransformCartesian3Scratch5, ); up = Cartesian3.clone(camera.up, updateTransformCartesian3Scratch6); } @@ -391,7 +391,7 @@ EntityView.prototype.update = function (time, boundingSphere) { 1 / Math.max( 1, - Cartesian3.magnitude(position) / ellipsoid.maximumRadius + Cartesian3.magnitude(position) / ellipsoid.maximumRadius, ); scratchHeadingPitchRange.pitch *= factor; } @@ -420,7 +420,7 @@ EntityView.prototype.update = function (time, boundingSphere) { saveCamera, positionProperty, time, - ellipsoid + ellipsoid, ); }; export default EntityView; diff --git a/packages/engine/Source/DataSources/GeoJsonDataSource.js b/packages/engine/Source/DataSources/GeoJsonDataSource.js index ce8429d476ed..ddc47f936447 100644 --- a/packages/engine/Source/DataSources/GeoJsonDataSource.js +++ b/packages/engine/Source/DataSources/GeoJsonDataSource.js @@ -103,7 +103,7 @@ function createDescriptionCallback(describe, properties, nameProperty) { function defaultDescribeProperty(properties, nameProperty) { return new CallbackProperty( createDescriptionCallback(defaultDescribe, properties, nameProperty), - true + true, ); } @@ -236,7 +236,7 @@ function processFeatureCollection( featureCollection, notUsed, crsFunction, - options + options, ) { const features = featureCollection.features; for (let i = 0, len = features.length; i < len; i++) { @@ -249,7 +249,7 @@ function processGeometryCollection( geoJson, geometryCollection, crsFunction, - options + options, ) { const geometries = geometryCollection.geometries; for (let i = 0, len = geometries.length; i < len; i++) { @@ -288,13 +288,13 @@ function createPoint(dataSource, geoJson, crsFunction, coordinates, options) { canvasOrPromise = dataSource._pinBuilder.fromText( symbol.toUpperCase(), color, - size + size, ); } else { canvasOrPromise = dataSource._pinBuilder.fromMakiIconId( symbol, color, - size + size, ); } } else { @@ -312,7 +312,7 @@ function createPoint(dataSource, geoJson, crsFunction, coordinates, options) { const entity = createObject( geoJson, dataSource._entityCollection, - options.describe + options.describe, ); entity.billboard = billboard; entity.position = new ConstantPositionProperty(crsFunction(coordinates)); @@ -323,7 +323,7 @@ function createPoint(dataSource, geoJson, crsFunction, coordinates, options) { }) .catch(function () { billboard.image = new ConstantProperty( - dataSource._pinBuilder.fromColor(color, size) + dataSource._pinBuilder.fromColor(color, size), ); }); @@ -339,7 +339,7 @@ function processMultiPoint( geoJson, geometry, crsFunction, - options + options, ) { const coordinates = geometry.coordinates; for (let i = 0; i < coordinates.length; i++) { @@ -352,7 +352,7 @@ function createLineString( geoJson, crsFunction, coordinates, - options + options, ) { let material = options.strokeMaterialProperty; let widthProperty = options.strokeWidthProperty; @@ -384,7 +384,7 @@ function createLineString( const entity = createObject( geoJson, dataSource._entityCollection, - options.describe + options.describe, ); const polylineGraphics = new PolylineGraphics(); entity.polyline = polylineGraphics; @@ -393,7 +393,7 @@ function createLineString( polylineGraphics.material = material; polylineGraphics.width = widthProperty; polylineGraphics.positions = new ConstantProperty( - coordinatesArrayToCartesianArray(coordinates, crsFunction) + coordinatesArrayToCartesianArray(coordinates, crsFunction), ); polylineGraphics.arcType = ArcType.RHUMB; } @@ -403,14 +403,14 @@ function processLineString( geoJson, geometry, crsFunction, - options + options, ) { createLineString( dataSource, geoJson, crsFunction, geometry.coordinates, - options + options, ); } @@ -419,7 +419,7 @@ function processMultiLineString( geoJson, geometry, crsFunction, - options + options, ) { const lineStrings = geometry.coordinates; for (let i = 0; i < lineStrings.length; i++) { @@ -490,8 +490,8 @@ function createPolygon(dataSource, geoJson, crsFunction, coordinates, options) { for (let i = 1, len = coordinates.length; i < len; i++) { holes.push( new PolygonHierarchy( - coordinatesArrayToCartesianArray(coordinates[i], crsFunction) - ) + coordinatesArrayToCartesianArray(coordinates[i], crsFunction), + ), ); } @@ -499,8 +499,8 @@ function createPolygon(dataSource, geoJson, crsFunction, coordinates, options) { polygon.hierarchy = new ConstantProperty( new PolygonHierarchy( coordinatesArrayToCartesianArray(positions, crsFunction), - holes - ) + holes, + ), ); if (positions[0].length > 2) { polygon.perPositionHeight = new ConstantProperty(true); @@ -511,7 +511,7 @@ function createPolygon(dataSource, geoJson, crsFunction, coordinates, options) { const entity = createObject( geoJson, dataSource._entityCollection, - options.describe + options.describe, ); entity.polygon = polygon; } @@ -522,7 +522,7 @@ function processPolygon(dataSource, geoJson, geometry, crsFunction, options) { geoJson, crsFunction, geometry.coordinates, - options + options, ); } @@ -531,7 +531,7 @@ function processMultiPolygon( geoJson, geometry, crsFunction, - options + options, ) { const polygons = geometry.coordinates; for (let i = 0; i < polygons.length; i++) { @@ -947,13 +947,13 @@ function preload(that, data, options, clear) { markerSymbol: defaultValue(options.markerSymbol, defaultMarkerSymbol), markerColor: defaultValue(options.markerColor, defaultMarkerColor), strokeWidthProperty: new ConstantProperty( - defaultValue(options.strokeWidth, defaultStrokeWidth) + defaultValue(options.strokeWidth, defaultStrokeWidth), ), strokeMaterialProperty: new ColorMaterialProperty( - defaultValue(options.stroke, defaultStroke) + defaultValue(options.stroke, defaultStroke), ), fillMaterialProperty: new ColorMaterialProperty( - defaultValue(options.fill, defaultFill) + defaultValue(options.fill, defaultFill), ), clampToGround: defaultValue(options.clampToGround, defaultClampToGround), }; @@ -1021,7 +1021,7 @@ function load(that, geoJson, options, sourceUri, clear) { if (!defined(handler)) { throw new RuntimeError( - `Unable to resolve crs link: ${JSON.stringify(properties)}` + `Unable to resolve crs link: ${JSON.stringify(properties)}`, ); } diff --git a/packages/engine/Source/DataSources/GeometryUpdater.js b/packages/engine/Source/DataSources/GeometryUpdater.js index ebfeefac0768..3361f2835380 100644 --- a/packages/engine/Source/DataSources/GeometryUpdater.js +++ b/packages/engine/Source/DataSources/GeometryUpdater.js @@ -22,7 +22,7 @@ const defaultOutline = new ConstantProperty(false); const defaultOutlineColor = new ConstantProperty(Color.BLACK); const defaultShadows = new ConstantProperty(ShadowMode.DISABLED); const defaultDistanceDisplayCondition = new ConstantProperty( - new DistanceDisplayCondition() + new DistanceDisplayCondition(), ); const defaultClassificationType = new ConstantProperty(ClassificationType.BOTH); @@ -70,9 +70,8 @@ function GeometryUpdater(options) { this._geometryPropertyName = geometryPropertyName; this._id = `${geometryPropertyName}-${entity.id}`; this._observedPropertyNames = options.observedPropertyNames; - this._supportsMaterialsforEntitiesOnTerrain = Entity.supportsMaterialsforEntitiesOnTerrain( - options.scene - ); + this._supportsMaterialsforEntitiesOnTerrain = + Entity.supportsMaterialsforEntitiesOnTerrain(options.scene); } Object.defineProperties(GeometryUpdater.prototype, { @@ -412,7 +411,7 @@ GeometryUpdater.prototype._onEntityPropertyChanged = function ( entity, propertyName, newValue, - oldValue + oldValue, ) { if (this._observedPropertyNames.indexOf(propertyName) === -1) { return; @@ -470,11 +469,11 @@ GeometryUpdater.prototype._onEntityPropertyChanged = function ( this._shadowsProperty = defaultValue(geometry.shadows, defaultShadows); this._distanceDisplayConditionProperty = defaultValue( geometry.distanceDisplayCondition, - defaultDistanceDisplayCondition + defaultDistanceDisplayCondition, ); this._classificationTypeProperty = defaultValue( geometry.classificationType, - defaultClassificationType + defaultClassificationType, ); this._fillEnabled = fillEnabled; @@ -522,7 +521,7 @@ GeometryUpdater.prototype._onEntityPropertyChanged = function ( */ GeometryUpdater.prototype.createDynamicUpdater = function ( primitives, - groundPrimitives + groundPrimitives, ) { //>>includeStart('debug', pragmas.debug); Check.defined("primitives", primitives); @@ -530,7 +529,7 @@ GeometryUpdater.prototype.createDynamicUpdater = function ( if (!this._dynamic) { throw new DeveloperError( - "This instance does not represent dynamic geometry." + "This instance does not represent dynamic geometry.", ); } //>>includeEnd('debug'); @@ -538,7 +537,7 @@ GeometryUpdater.prototype.createDynamicUpdater = function ( return new this.constructor.DynamicGeometryUpdater( this, primitives, - groundPrimitives + groundPrimitives, ); }; export default GeometryUpdater; diff --git a/packages/engine/Source/DataSources/GeometryUpdaterSet.js b/packages/engine/Source/DataSources/GeometryUpdaterSet.js index 6dd0ba4ec90e..cb36253b172b 100644 --- a/packages/engine/Source/DataSources/GeometryUpdaterSet.js +++ b/packages/engine/Source/DataSources/GeometryUpdaterSet.js @@ -52,7 +52,7 @@ function GeometryUpdaterSet(entity, scene) { this._removeEntitySubscription = entity.definitionChanged.addEventListener( GeometryUpdaterSet.prototype._onEntityPropertyChanged, - this + this, ); } @@ -60,7 +60,7 @@ GeometryUpdaterSet.prototype._onEntityPropertyChanged = function ( entity, propertyName, newValue, - oldValue + oldValue, ) { const updaters = this.updaters; for (let i = 0; i < updaters.length; i++) { @@ -68,7 +68,7 @@ GeometryUpdaterSet.prototype._onEntityPropertyChanged = function ( entity, propertyName, newValue, - oldValue + oldValue, ); } }; diff --git a/packages/engine/Source/DataSources/GeometryVisualizer.js b/packages/engine/Source/DataSources/GeometryVisualizer.js index e2d1ed306a0f..0c975a9f698e 100644 --- a/packages/engine/Source/DataSources/GeometryVisualizer.js +++ b/packages/engine/Source/DataSources/GeometryVisualizer.js @@ -35,7 +35,7 @@ function GeometryVisualizer( scene, entityCollection, primitives, - groundPrimitives + groundPrimitives, ) { //>>includeStart('debug', pragmas.debug); Check.defined("scene", scene); @@ -60,10 +60,10 @@ function GeometryVisualizer( this._openColorBatches = new Array(numberOfShadowModes * 2); this._openMaterialBatches = new Array(numberOfShadowModes * 2); - const supportsMaterialsforEntitiesOnTerrain = Entity.supportsMaterialsforEntitiesOnTerrain( - scene - ); - this._supportsMaterialsforEntitiesOnTerrain = supportsMaterialsforEntitiesOnTerrain; + const supportsMaterialsforEntitiesOnTerrain = + Entity.supportsMaterialsforEntitiesOnTerrain(scene); + this._supportsMaterialsforEntitiesOnTerrain = + supportsMaterialsforEntitiesOnTerrain; let i; for (i = 0; i < numberOfShadowModes; ++i) { @@ -71,11 +71,10 @@ function GeometryVisualizer( primitives, scene, i, - false + false, ); - this._outlineBatches[ - numberOfShadowModes + i - ] = new StaticOutlineGeometryBatch(primitives, scene, i, true); + this._outlineBatches[numberOfShadowModes + i] = + new StaticOutlineGeometryBatch(primitives, scene, i, true); this._closedColorBatches[i] = new StaticGeometryColorBatch( primitives, @@ -83,18 +82,17 @@ function GeometryVisualizer( undefined, true, i, - true - ); - this._closedColorBatches[ - numberOfShadowModes + i - ] = new StaticGeometryColorBatch( - primitives, - PerInstanceColorAppearance, - undefined, true, - i, - false ); + this._closedColorBatches[numberOfShadowModes + i] = + new StaticGeometryColorBatch( + primitives, + PerInstanceColorAppearance, + undefined, + true, + i, + false, + ); this._closedMaterialBatches[i] = new StaticGeometryPerMaterialBatch( primitives, @@ -102,18 +100,17 @@ function GeometryVisualizer( undefined, true, i, - true - ); - this._closedMaterialBatches[ - numberOfShadowModes + i - ] = new StaticGeometryPerMaterialBatch( - primitives, - MaterialAppearance, - undefined, true, - i, - false ); + this._closedMaterialBatches[numberOfShadowModes + i] = + new StaticGeometryPerMaterialBatch( + primitives, + MaterialAppearance, + undefined, + true, + i, + false, + ); this._openColorBatches[i] = new StaticGeometryColorBatch( primitives, @@ -121,18 +118,17 @@ function GeometryVisualizer( undefined, false, i, - true - ); - this._openColorBatches[ - numberOfShadowModes + i - ] = new StaticGeometryColorBatch( - primitives, - PerInstanceColorAppearance, - undefined, - false, - i, - false + true, ); + this._openColorBatches[numberOfShadowModes + i] = + new StaticGeometryColorBatch( + primitives, + PerInstanceColorAppearance, + undefined, + false, + i, + false, + ); this._openMaterialBatches[i] = new StaticGeometryPerMaterialBatch( primitives, @@ -140,18 +136,17 @@ function GeometryVisualizer( undefined, false, i, - true - ); - this._openMaterialBatches[ - numberOfShadowModes + i - ] = new StaticGeometryPerMaterialBatch( - primitives, - MaterialAppearance, - undefined, - false, - i, - false + true, ); + this._openMaterialBatches[numberOfShadowModes + i] = + new StaticGeometryPerMaterialBatch( + primitives, + MaterialAppearance, + undefined, + false, + i, + false, + ); } const numberOfClassificationTypes = @@ -164,19 +159,19 @@ function GeometryVisualizer( new StaticGroundGeometryPerMaterialBatch( groundPrimitives, i, - MaterialAppearance - ) + MaterialAppearance, + ), ); groundColorBatches[i] = new StaticGroundGeometryColorBatch( groundPrimitives, - i + i, ); } } else { for (i = 0; i < numberOfClassificationTypes; ++i) { groundColorBatches[i] = new StaticGroundGeometryColorBatch( groundPrimitives, - i + i, ); } } @@ -193,7 +188,7 @@ function GeometryVisualizer( this._openMaterialBatches, this._groundColorBatches, this._groundMaterialBatches, - this._dynamicBatch + this._dynamicBatch, ); this._subscriptions = new AssociativeArray(); @@ -202,12 +197,12 @@ function GeometryVisualizer( this._entityCollection = entityCollection; entityCollection.collectionChanged.addEventListener( GeometryVisualizer.prototype._onCollectionChanged, - this + this, ); this._onCollectionChanged( entityCollection, entityCollection.values, - emptyArray + emptyArray, ); } @@ -299,8 +294,8 @@ GeometryVisualizer.prototype.update = function (time) { id, updaterSet.geometryChanged.addEventListener( GeometryVisualizer._onGeometryChanged, - this - ) + this, + ), ); } @@ -358,7 +353,7 @@ GeometryVisualizer.prototype.getBoundingSphere = function (entity, result) { } else if (state === BoundingSphereState.DONE) { boundingSpheres[count] = BoundingSphere.clone( tmp, - boundingSpheres[count] + boundingSpheres[count], ); count++; } @@ -389,7 +384,7 @@ GeometryVisualizer.prototype.isDestroyed = function () { GeometryVisualizer.prototype.destroy = function () { this._entityCollection.collectionChanged.removeEventListener( GeometryVisualizer.prototype._onCollectionChanged, - this + this, ); this._addedObjects.removeAll(); this._removedObjects.removeAll(); @@ -434,7 +429,7 @@ GeometryVisualizer.prototype._removeUpdater = function (updater) { */ GeometryVisualizer.prototype._insertUpdaterIntoBatch = function ( time, - updater + updater, ) { if (updater.isDynamic) { this._dynamicBatch.add(time, updater); @@ -457,9 +452,8 @@ GeometryVisualizer.prototype._insertUpdaterIntoBatch = function ( if (updater.fillEnabled) { if (updater.onTerrain) { - const classificationType = updater.classificationTypeProperty.getValue( - time - ); + const classificationType = + updater.classificationTypeProperty.getValue(time); if (updater.fillMaterialProperty instanceof ColorMaterialProperty) { this._groundColorBatches[classificationType].add(time, updater); } else { @@ -471,7 +465,7 @@ GeometryVisualizer.prototype._insertUpdaterIntoBatch = function ( if (defined(updater.terrainOffsetProperty)) { this._closedColorBatches[numberOfShadowModes + shadows].add( time, - updater + updater, ); } else { this._closedColorBatches[shadows].add(time, updater); @@ -479,7 +473,7 @@ GeometryVisualizer.prototype._insertUpdaterIntoBatch = function ( } else if (defined(updater.terrainOffsetProperty)) { this._closedMaterialBatches[numberOfShadowModes + shadows].add( time, - updater + updater, ); } else { this._closedMaterialBatches[shadows].add(time, updater); @@ -488,7 +482,7 @@ GeometryVisualizer.prototype._insertUpdaterIntoBatch = function ( if (defined(updater.terrainOffsetProperty)) { this._openColorBatches[numberOfShadowModes + shadows].add( time, - updater + updater, ); } else { this._openColorBatches[shadows].add(time, updater); @@ -496,7 +490,7 @@ GeometryVisualizer.prototype._insertUpdaterIntoBatch = function ( } else if (defined(updater.terrainOffsetProperty)) { this._openMaterialBatches[numberOfShadowModes + shadows].add( time, - updater + updater, ); } else { this._openMaterialBatches[shadows].add(time, updater); @@ -525,7 +519,7 @@ GeometryVisualizer._onGeometryChanged = function (updater) { GeometryVisualizer.prototype._onCollectionChanged = function ( entityCollection, added, - removed + removed, ) { const addedObjects = this._addedObjects; const removedObjects = this._removedObjects; diff --git a/packages/engine/Source/DataSources/GpxDataSource.js b/packages/engine/Source/DataSources/GpxDataSource.js index 887af0f2c47d..8f17fb5e6a68 100644 --- a/packages/engine/Source/DataSources/GpxDataSource.js +++ b/packages/engine/Source/DataSources/GpxDataSource.js @@ -168,13 +168,13 @@ function createDefaultBillboard(image) { BILLBOARD_NEAR_DISTANCE, BILLBOARD_NEAR_RATIO, BILLBOARD_FAR_DISTANCE, - BILLBOARD_FAR_RATIO + BILLBOARD_FAR_RATIO, ); billboard.pixelOffsetScaleByDistance = new NearFarScalar( BILLBOARD_NEAR_DISTANCE, BILLBOARD_NEAR_RATIO, BILLBOARD_FAR_DISTANCE, - BILLBOARD_FAR_RATIO + BILLBOARD_FAR_RATIO, ); billboard.verticalOrigin = new ConstantProperty(VerticalOrigin.BOTTOM); billboard.image = image; @@ -248,7 +248,7 @@ function processDescription(node, entity) { const infoType = descriptiveInfoTypes[infoTypeName]; infoType.value = defaultValue( queryStringValue(node, infoType.tag, namespaces.gpx), - "" + "", ); if (defined(infoType.value) && infoType.value !== "") { text = `${text}

${infoType.text}: ${infoType.value}

`; @@ -299,7 +299,7 @@ function processWpt(dataSource, geometryNode, entityCollection, options) { : dataSource._pinBuilder.fromMakiIconId( "marker", Color.RED, - BILLBOARD_SIZE + BILLBOARD_SIZE, ); entity.billboard = createDefaultBillboard(image); @@ -364,7 +364,7 @@ function processTrk(dataSource, geometryNode, entityCollection, options) { : dataSource._pinBuilder.fromMakiIconId( "marker", Color.RED, - BILLBOARD_SIZE + BILLBOARD_SIZE, ); entity.billboard = createDefaultBillboard(image); entity.position = property; @@ -376,7 +376,7 @@ function processTrk(dataSource, geometryNode, entityCollection, options) { new TimeInterval({ start: times[0], stop: times[times.length - 1], - }) + }), ); } entity.polyline = createDefaultPolyline(options.trackColor); @@ -608,8 +608,8 @@ function loadGpx(dataSource, gpx, options) { clock.multiplier = Math.round( Math.min( Math.max(JulianDate.secondsDifference(stop, start) / 60, 1), - 3.15569e7 - ) + 3.15569e7, + ), ); } let changed = false; @@ -987,8 +987,8 @@ GpxDataSource.prototype.load = function (data, options) { clock.multiplier = Math.round( Math.min( Math.max(JulianDate.secondsDifference(stop, start) / 60, 1), - 3.15569e7 - ) + 3.15569e7, + ), ); } diff --git a/packages/engine/Source/DataSources/GridMaterialProperty.js b/packages/engine/Source/DataSources/GridMaterialProperty.js index 77ea417ec67c..46436b15a928 100644 --- a/packages/engine/Source/DataSources/GridMaterialProperty.js +++ b/packages/engine/Source/DataSources/GridMaterialProperty.js @@ -155,30 +155,30 @@ GridMaterialProperty.prototype.getValue = function (time, result) { this._color, time, defaultColor, - result.color + result.color, ); result.cellAlpha = Property.getValueOrDefault( this._cellAlpha, time, - defaultCellAlpha + defaultCellAlpha, ); result.lineCount = Property.getValueOrClonedDefault( this._lineCount, time, defaultLineCount, - result.lineCount + result.lineCount, ); result.lineThickness = Property.getValueOrClonedDefault( this._lineThickness, time, defaultLineThickness, - result.lineThickness + result.lineThickness, ); result.lineOffset = Property.getValueOrClonedDefault( this._lineOffset, time, defaultLineOffset, - result.lineOffset + result.lineOffset, ); return result; }; diff --git a/packages/engine/Source/DataSources/GroundGeometryUpdater.js b/packages/engine/Source/DataSources/GroundGeometryUpdater.js index 438b483dd0ae..1bbdc14788b2 100644 --- a/packages/engine/Source/DataSources/GroundGeometryUpdater.js +++ b/packages/engine/Source/DataSources/GroundGeometryUpdater.js @@ -87,14 +87,14 @@ GroundGeometryUpdater.prototype._onEntityPropertyChanged = function ( entity, propertyName, newValue, - oldValue + oldValue, ) { GeometryUpdater.prototype._onEntityPropertyChanged.call( this, entity, propertyName, newValue, - oldValue + oldValue, ); if (this._observedPropertyNames.indexOf(propertyName) === -1) { return; @@ -127,13 +127,13 @@ GroundGeometryUpdater.prototype._onEntityPropertyChanged = function ( ) { const centerPosition = new CallbackProperty( this._computeCenter.bind(this), - !this._dynamic + !this._dynamic, ); this._terrainOffsetProperty = new TerrainOffsetProperty( this._scene, centerPosition, heightReferenceProperty, - extrudedHeightReferenceProperty + extrudedHeightReferenceProperty, ); } }; @@ -178,7 +178,7 @@ GroundGeometryUpdater.getGeometryHeight = function (height, heightReference) { */ GroundGeometryUpdater.getGeometryExtrudedHeight = function ( extrudedHeight, - extrudedHeightReference + extrudedHeightReference, ) { //>>includeStart('debug', pragmas.debug); Check.defined("extrudedHeightReference", extrudedHeightReference); @@ -208,7 +208,7 @@ GroundGeometryUpdater.computeGeometryOffsetAttribute = function ( height, heightReference, extrudedHeight, - extrudedHeightReference + extrudedHeightReference, ) { if (!defined(height) || !defined(heightReference)) { heightReference = HeightReference.NONE; diff --git a/packages/engine/Source/DataSources/ImageMaterialProperty.js b/packages/engine/Source/DataSources/ImageMaterialProperty.js index 97f00224bc02..2e4122bc0f8f 100644 --- a/packages/engine/Source/DataSources/ImageMaterialProperty.js +++ b/packages/engine/Source/DataSources/ImageMaterialProperty.js @@ -138,13 +138,13 @@ ImageMaterialProperty.prototype.getValue = function (time, result) { this._repeat, time, defaultRepeat, - result.repeat + result.repeat, ); result.color = Property.getValueOrClonedDefault( this._color, time, defaultColor, - result.color + result.color, ); if (Property.getValueOrDefault(this._transparent, time, defaultTransparent)) { result.color.alpha = Math.min(0.99, result.color.alpha); diff --git a/packages/engine/Source/DataSources/KmlDataSource.js b/packages/engine/Source/DataSources/KmlDataSource.js index d800e7d9a64b..012387fdd356 100644 --- a/packages/engine/Source/DataSources/KmlDataSource.js +++ b/packages/engine/Source/DataSources/KmlDataSource.js @@ -319,7 +319,7 @@ function isZipFile(blob) { const reader = new FileReader(); reader.addEventListener("load", function () { deferred.resolve( - new DataView(reader.result).getUint32(0, false) === 0x504b0304 + new DataView(reader.result).getUint32(0, false) === 0x504b0304, ); }); reader.addEventListener("error", function () { @@ -391,24 +391,24 @@ function removeDuplicateNamespaces(text) { } function loadXmlFromZip(entry, uriResolver) { - return Promise.resolve(entry.getData(new zip.TextWriter())).then(function ( - text - ) { - text = insertNamespaces(text); - text = removeDuplicateNamespaces(text); - uriResolver.kml = parser.parseFromString(text, "application/xml"); - }); + return Promise.resolve(entry.getData(new zip.TextWriter())).then( + function (text) { + text = insertNamespaces(text); + text = removeDuplicateNamespaces(text); + uriResolver.kml = parser.parseFromString(text, "application/xml"); + }, + ); } function loadDataUriFromZip(entry, uriResolver) { const mimeType = defaultValue( MimeTypes.detectFromFilename(entry.filename), - "application/octet-stream" + "application/octet-stream", ); return Promise.resolve(entry.getData(new zip.Data64URIWriter(mimeType))).then( function (dataUri) { uriResolver[entry.filename] = dataUri; - } + }, ); } @@ -720,7 +720,7 @@ function queryColorValue(node, tagName, namespace) { } return parseColorString( value, - queryStringValue(node, "colorMode", namespace) === "random" + queryStringValue(node, "colorMode", namespace) === "random", ); } @@ -743,7 +743,7 @@ function processTimeStamp(featureNode) { new TimeInterval({ start: when, stop: Iso8601.MAXIMUM_VALUE, - }) + }), ); return result; } @@ -776,7 +776,7 @@ function processTimeSpan(featureNode) { new TimeInterval({ start: beginDate, stop: endDate, - }) + }), ); } else if (defined(beginDate)) { result = new TimeIntervalCollection(); @@ -784,7 +784,7 @@ function processTimeSpan(featureNode) { new TimeInterval({ start: beginDate, stop: Iso8601.MAXIMUM_VALUE, - }) + }), ); } else if (defined(endDate)) { result = new TimeIntervalCollection(); @@ -792,7 +792,7 @@ function processTimeSpan(featureNode) { new TimeInterval({ start: Iso8601.MINIMUM_VALUE, stop: endDate, - }) + }), ); } @@ -807,13 +807,13 @@ function createDefaultBillboard() { BILLBOARD_NEAR_DISTANCE, BILLBOARD_NEAR_RATIO, BILLBOARD_FAR_DISTANCE, - BILLBOARD_FAR_RATIO + BILLBOARD_FAR_RATIO, ); billboard.pixelOffsetScaleByDistance = new NearFarScalar( BILLBOARD_NEAR_DISTANCE, BILLBOARD_NEAR_RATIO, BILLBOARD_FAR_DISTANCE, - BILLBOARD_FAR_RATIO + BILLBOARD_FAR_RATIO, ); return billboard; } @@ -840,7 +840,7 @@ function getIconHref( dataSource, sourceResource, uriResolver, - canRefresh + canRefresh, ) { let href = queryStringValue(iconNode, "href", namespaces.kml); if (!defined(href) || href.length === 0) { @@ -866,28 +866,28 @@ function getIconHref( const refreshMode = queryStringValue( iconNode, "refreshMode", - namespaces.kml + namespaces.kml, ); const viewRefreshMode = queryStringValue( iconNode, "viewRefreshMode", - namespaces.kml + namespaces.kml, ); if (refreshMode === "onInterval" || refreshMode === "onExpire") { oneTimeWarning( `kml-refreshMode-${refreshMode}`, - `KML - Unsupported Icon refreshMode: ${refreshMode}` + `KML - Unsupported Icon refreshMode: ${refreshMode}`, ); } else if (viewRefreshMode === "onStop" || viewRefreshMode === "onRegion") { oneTimeWarning( `kml-refreshMode-${viewRefreshMode}`, - `KML - Unsupported Icon viewRefreshMode: ${viewRefreshMode}` + `KML - Unsupported Icon viewRefreshMode: ${viewRefreshMode}`, ); } const viewBoundScale = defaultValue( queryStringValue(iconNode, "viewBoundScale", namespaces.kml), - 1.0 + 1.0, ); const defaultViewFormat = viewRefreshMode === "onStop" @@ -895,7 +895,7 @@ function getIconHref( : ""; const viewFormat = defaultValue( queryStringValue(iconNode, "viewFormat", namespaces.kml), - defaultViewFormat + defaultViewFormat, ); const httpQuery = queryStringValue(iconNode, "httpQuery", namespaces.kml); if (defined(viewFormat)) { @@ -912,7 +912,7 @@ function getIconHref( dataSource.canvas, viewBoundScale, dataSource._lastCameraView.bbox, - ellipsoid + ellipsoid, ); return hrefResource; @@ -926,7 +926,7 @@ function processBillboardIcon( node, targetEntity, sourceResource, - uriResolver + uriResolver, ) { let scale = queryNumericValue(node, "scale", namespaces.kml); const heading = queryNumericValue(node, "heading", namespaces.kml); @@ -938,7 +938,7 @@ function processBillboardIcon( dataSource, sourceResource, uriResolver, - false + false, ); // If icon tags are present but blank, we do not want to show an icon @@ -1019,7 +1019,7 @@ function applyStyle( styleNode, targetEntity, sourceResource, - uriResolver + uriResolver, ) { for (let i = 0, len = styleNode.childNodes.length; i < len; i++) { const node = styleNode.childNodes.item(i); @@ -1029,7 +1029,7 @@ function applyStyle( node, targetEntity, sourceResource, - uriResolver + uriResolver, ); } else if (node.localName === "LabelStyle") { let label = targetEntity.label; @@ -1039,11 +1039,11 @@ function applyStyle( } label.scale = defaultValue( queryNumericValue(node, "scale", namespaces.kml), - label.scale + label.scale, ); label.fillColor = defaultValue( queryColorValue(node, "color", namespaces.kml), - label.fillColor + label.fillColor, ); label.text = targetEntity.name; } else if (node.localName === "LineStyle") { @@ -1057,25 +1057,25 @@ function applyStyle( if (defined(queryColorValue(node, "outerColor", namespaces.gx))) { oneTimeWarning( "kml-gx:outerColor", - "KML - gx:outerColor is not supported in a LineStyle" + "KML - gx:outerColor is not supported in a LineStyle", ); } if (defined(queryNumericValue(node, "outerWidth", namespaces.gx))) { oneTimeWarning( "kml-gx:outerWidth", - "KML - gx:outerWidth is not supported in a LineStyle" + "KML - gx:outerWidth is not supported in a LineStyle", ); } if (defined(queryNumericValue(node, "physicalWidth", namespaces.gx))) { oneTimeWarning( "kml-gx:physicalWidth", - "KML - gx:physicalWidth is not supported in a LineStyle" + "KML - gx:physicalWidth is not supported in a LineStyle", ); } if (defined(queryBooleanValue(node, "labelVisibility", namespaces.gx))) { oneTimeWarning( "kml-gx:labelVisibility", - "KML - gx:labelVisibility is not supported in a LineStyle" + "KML - gx:labelVisibility is not supported in a LineStyle", ); } } else if (node.localName === "PolyStyle") { @@ -1086,24 +1086,24 @@ function applyStyle( } polygon.material = defaultValue( queryColorValue(node, "color", namespaces.kml), - polygon.material + polygon.material, ); polygon.fill = defaultValue( queryBooleanValue(node, "fill", namespaces.kml), - polygon.fill + polygon.fill, ); polygon.outline = defaultValue( queryBooleanValue(node, "outline", namespaces.kml), - polygon.outline + polygon.outline, ); } else if (node.localName === "BalloonStyle") { const bgColor = defaultValue( parseColorString(queryStringValue(node, "bgColor", namespaces.kml)), - Color.WHITE + Color.WHITE, ); const textColor = defaultValue( parseColorString(queryStringValue(node, "textColor", namespaces.kml)), - Color.BLACK + Color.BLACK, ); const text = queryStringValue(node, "text", namespaces.kml); @@ -1119,12 +1119,12 @@ function applyStyle( const listItemType = queryStringValue( node, "listItemType", - namespaces.kml + namespaces.kml, ); if (listItemType === "radioFolder" || listItemType === "checkOffOnly") { oneTimeWarning( `kml-listStyle-${listItemType}`, - `KML - Unsupported ListStyle with listItemType: ${listItemType}` + `KML - Unsupported ListStyle with listItemType: ${listItemType}`, ); } } @@ -1137,7 +1137,7 @@ function computeFinalStyle( placeMark, styleCollection, sourceResource, - uriResolver + uriResolver, ) { const result = new Entity(); let styleEntity; @@ -1161,7 +1161,7 @@ function computeFinalStyle( inlineStyleNode, result, sourceResource, - uriResolver + uriResolver, ); } else { // StyleMap @@ -1186,7 +1186,7 @@ function computeFinalStyle( } else { oneTimeWarning( `kml-styleMap-${key}`, - `KML - Unsupported StyleMap key: ${key}` + `KML - Unsupported StyleMap key: ${key}`, ); } } @@ -1236,7 +1236,7 @@ function processStyles( styleCollection, sourceResource, isExternal, - uriResolver + uriResolver, ) { let i; let id; @@ -1264,7 +1264,7 @@ function processStyles( node, styleEntity, sourceResource, - uriResolver + uriResolver, ); } } @@ -1311,14 +1311,14 @@ function processStyles( node, styleEntity, sourceResource, - uriResolver + uriResolver, ); } } } else { oneTimeWarning( `kml-styleMap-${key}`, - `KML - Unsupported StyleMap key: ${key}` + `KML - Unsupported StyleMap key: ${key}`, ); } } @@ -1344,7 +1344,7 @@ function processStyles( }); promises.push( - processExternalStyles(dataSource, resource, styleCollection) + processExternalStyles(dataSource, resource, styleCollection), ); } } @@ -1386,7 +1386,7 @@ function heightReferenceFromAltitudeMode(altitudeMode, gxAltitudeMode) { if (gxAltitudeMode === "clampToSeaFloor") { oneTimeWarning( "kml-gx:altitudeMode-clampToSeaFloor", - "KML - :clampToSeaFloor is currently not supported, using :clampToGround." + "KML - :clampToSeaFloor is currently not supported, using :clampToGround.", ); return HeightReference.CLAMP_TO_GROUND; } @@ -1394,7 +1394,7 @@ function heightReferenceFromAltitudeMode(altitudeMode, gxAltitudeMode) { if (gxAltitudeMode === "relativeToSeaFloor") { oneTimeWarning( "kml-gx:altitudeMode-relativeToSeaFloor", - "KML - :relativeToSeaFloor is currently not supported, using :relativeToGround." + "KML - :relativeToSeaFloor is currently not supported, using :relativeToGround.", ); return HeightReference.RELATIVE_TO_GROUND; } @@ -1402,12 +1402,12 @@ function heightReferenceFromAltitudeMode(altitudeMode, gxAltitudeMode) { if (defined(altitudeMode)) { oneTimeWarning( "kml-altitudeMode-unknown", - `KML - Unknown :${altitudeMode}, using :CLAMP_TO_GROUND.` + `KML - Unknown :${altitudeMode}, using :CLAMP_TO_GROUND.`, ); } else { oneTimeWarning( "kml-gx:altitudeMode-unknown", - `KML - Unknown :${gxAltitudeMode}, using :CLAMP_TO_GROUND.` + `KML - Unknown :${gxAltitudeMode}, using :CLAMP_TO_GROUND.`, ); } @@ -1418,7 +1418,7 @@ function heightReferenceFromAltitudeMode(altitudeMode, gxAltitudeMode) { function createPositionPropertyFromAltitudeMode( property, altitudeMode, - gxAltitudeMode + gxAltitudeMode, ) { if ( gxAltitudeMode === "relativeToSeaFloor" || @@ -1437,8 +1437,8 @@ function createPositionPropertyFromAltitudeMode( "kml-altitudeMode-unknown", `KML - Unknown altitudeMode: ${defaultValue( altitudeMode, - gxAltitudeMode - )}` + gxAltitudeMode, + )}`, ); } @@ -1450,7 +1450,7 @@ function createPositionPropertyArrayFromAltitudeMode( properties, altitudeMode, gxAltitudeMode, - ellipsoid + ellipsoid, ) { if (!defined(properties)) { return undefined; @@ -1473,8 +1473,8 @@ function createPositionPropertyArrayFromAltitudeMode( "kml-altitudeMode-unknown", `KML - Unknown altitudeMode: ${defaultValue( altitudeMode, - gxAltitudeMode - )}` + gxAltitudeMode, + )}`, ); } @@ -1491,7 +1491,7 @@ function processPositionGraphics( dataSource, entity, styleEntity, - heightReference + heightReference, ) { let label = entity.label; if (!defined(label)) { @@ -1558,22 +1558,22 @@ function processPoint( entityCollection, geometryNode, entity, - styleEntity + styleEntity, ) { const coordinatesString = queryStringValue( geometryNode, "coordinates", - namespaces.kml + namespaces.kml, ); const altitudeMode = queryStringValue( geometryNode, "altitudeMode", - namespaces.kml + namespaces.kml, ); const gxAltitudeMode = queryStringValue( geometryNode, "altitudeMode", - namespaces.gx + namespaces.gx, ); const extrude = queryBooleanValue(geometryNode, "extrude", namespaces.kml); const ellipsoid = dataSource._ellipsoid; @@ -1584,7 +1584,7 @@ function processPoint( dataSource, entity, styleEntity, - heightReferenceFromAltitudeMode(altitudeMode, gxAltitudeMode) + heightReferenceFromAltitudeMode(altitudeMode, gxAltitudeMode), ); if (extrude && isExtrudable(altitudeMode, gxAltitudeMode)) { @@ -1599,28 +1599,28 @@ function processLineStringOrLinearRing( entityCollection, geometryNode, entity, - styleEntity + styleEntity, ) { const coordinatesNode = queryFirstNode( geometryNode, "coordinates", - namespaces.kml + namespaces.kml, ); const altitudeMode = queryStringValue( geometryNode, "altitudeMode", - namespaces.kml + namespaces.kml, ); const gxAltitudeMode = queryStringValue( geometryNode, "altitudeMode", - namespaces.gx + namespaces.gx, ); const extrude = queryBooleanValue(geometryNode, "extrude", namespaces.kml); const tessellate = queryBooleanValue( geometryNode, "tessellate", - namespaces.kml + namespaces.kml, ); const canExtrude = isExtrudable(altitudeMode, gxAltitudeMode); const zIndex = queryNumericValue(geometryNode, "drawOrder", namespaces.gx); @@ -1670,13 +1670,13 @@ function processLineStringOrLinearRing( if (defined(zIndex)) { oneTimeWarning( "kml-gx:drawOrder", - "KML - gx:drawOrder is not supported in LineStrings when clampToGround is false" + "KML - gx:drawOrder is not supported in LineStrings when clampToGround is false", ); } if (dataSource._clampToGround && !tessellate) { oneTimeWarning( "kml-line-tesselate", - "Ignoring clampToGround for KML lines without the tessellate flag." + "Ignoring clampToGround for KML lines without the tessellate flag.", ); } @@ -1686,7 +1686,7 @@ function processLineStringOrLinearRing( coordinates, altitudeMode, gxAltitudeMode, - ellipsoid + ellipsoid, ); if (!tessellate || canExtrude) { polyline.arcType = ArcType.NONE; @@ -1701,22 +1701,22 @@ function processPolygon( entityCollection, geometryNode, entity, - styleEntity + styleEntity, ) { const outerBoundaryIsNode = queryFirstNode( geometryNode, "outerBoundaryIs", - namespaces.kml + namespaces.kml, ); let linearRingNode = queryFirstNode( outerBoundaryIsNode, "LinearRing", - namespaces.kml + namespaces.kml, ); let coordinatesNode = queryFirstNode( linearRingNode, "coordinates", - namespaces.kml + namespaces.kml, ); const ellipsoid = dataSource._ellipsoid; let coordinates = readCoordinates(coordinatesNode, ellipsoid); @@ -1724,12 +1724,12 @@ function processPolygon( const altitudeMode = queryStringValue( geometryNode, "altitudeMode", - namespaces.kml + namespaces.kml, ); const gxAltitudeMode = queryStringValue( geometryNode, "altitudeMode", - namespaces.gx + namespaces.gx, ); const canExtrude = isExtrudable(altitudeMode, gxAltitudeMode); @@ -1758,19 +1758,19 @@ function processPolygon( const innerBoundaryIsNodes = queryChildNodes( geometryNode, "innerBoundaryIs", - namespaces.kml + namespaces.kml, ); for (let j = 0; j < innerBoundaryIsNodes.length; j++) { linearRingNode = queryChildNodes( innerBoundaryIsNodes[j], "LinearRing", - namespaces.kml + namespaces.kml, ); for (let k = 0; k < linearRingNode.length; k++) { coordinatesNode = queryFirstNode( linearRingNode[k], "coordinates", - namespaces.kml + namespaces.kml, ); coordinates = readCoordinates(coordinatesNode, ellipsoid); if (defined(coordinates)) { @@ -1789,17 +1789,17 @@ function processTrack( entityCollection, geometryNode, entity, - styleEntity + styleEntity, ) { const altitudeMode = queryStringValue( geometryNode, "altitudeMode", - namespaces.kml + namespaces.kml, ); const gxAltitudeMode = queryStringValue( geometryNode, "altitudeMode", - namespaces.gx + namespaces.gx, ); const coordNodes = queryChildNodes(geometryNode, "coord", namespaces.gx); const angleNodes = queryChildNodes(geometryNode, "angles", namespaces.gx); @@ -1811,7 +1811,7 @@ function processTrack( if (angleNodes.length > 0) { oneTimeWarning( "kml-gx:angles", - "KML - gx:angles are not supported in gx:Tracks" + "KML - gx:angles are not supported in gx:Tracks", ); } @@ -1830,7 +1830,7 @@ function processTrack( dataSource, entity, styleEntity, - heightReferenceFromAltitudeMode(altitudeMode, gxAltitudeMode) + heightReferenceFromAltitudeMode(altitudeMode, gxAltitudeMode), ); processPathGraphics(entity, styleEntity); @@ -1841,7 +1841,7 @@ function processTrack( new TimeInterval({ start: times[0], stop: times[times.length - 1], - }) + }), ); } @@ -1861,7 +1861,7 @@ function addToMultiTrack( extrude, altitudeMode, gxAltitudeMode, - includeEndPoints + includeEndPoints, ) { const start = times[0]; const stop = times[times.length - 1]; @@ -1878,9 +1878,9 @@ function addToMultiTrack( data: createPositionPropertyFromAltitudeMode( data, altitudeMode, - gxAltitudeMode + gxAltitudeMode, ), - }) + }), ); availability.addInterval( new TimeInterval({ @@ -1888,7 +1888,7 @@ function addToMultiTrack( stop: stop, isStartIncluded: includeEndPoints, isStopIncluded: includeEndPoints, - }) + }), ); dropShowProperty.intervals.addInterval( new TimeInterval({ @@ -1897,7 +1897,7 @@ function addToMultiTrack( isStartIncluded: includeEndPoints, isStopIncluded: includeEndPoints, data: extrude, - }) + }), ); } @@ -1906,7 +1906,7 @@ function processMultiTrack( entityCollection, geometryNode, entity, - styleEntity + styleEntity, ) { // Multitrack options do not work in GE as detailed in the spec, // rather than altitudeMode being at the MultiTrack level, @@ -1915,7 +1915,7 @@ function processMultiTrack( const interpolate = queryBooleanValue( geometryNode, "interpolate", - namespaces.gx + namespaces.gx, ); const trackNodes = queryChildNodes(geometryNode, "Track", namespaces.gx); @@ -1934,12 +1934,12 @@ function processMultiTrack( const altitudeMode = queryStringValue( trackNode, "altitudeMode", - namespaces.kml + namespaces.kml, ); const gxAltitudeMode = queryStringValue( trackNode, "altitudeMode", - namespaces.gx + namespaces.gx, ); const canExtrude = isExtrudable(altitudeMode, gxAltitudeMode); const extrude = queryBooleanValue(trackNode, "extrude", namespaces.kml); @@ -1969,7 +1969,7 @@ function processMultiTrack( false, "absolute", undefined, - false + false, ); } lastStop = times[length - 1]; @@ -1985,7 +1985,7 @@ function processMultiTrack( canExtrude && extrude, altitudeMode, gxAltitudeMode, - true + true, ); needDropLine = needDropLine || (canExtrude && extrude); } @@ -2019,7 +2019,7 @@ function processMultiGeometry( geometryNode, entity, styleEntity, - context + context, ) { const childNodes = geometryNode.childNodes; let hasGeometry = false; @@ -2039,7 +2039,7 @@ function processMultiGeometry( entityCollection, childNode, childEntity, - styleEntity + styleEntity, ) ) { hasGeometry = true; @@ -2055,11 +2055,11 @@ function processUnsupportedGeometry( entityCollection, geometryNode, entity, - styleEntity + styleEntity, ) { oneTimeWarning( "kml-unsupportedGeometry", - `KML - Unsupported geometry: ${geometryNode.localName}` + `KML - Unsupported geometry: ${geometryNode.localName}`, ); return false; } @@ -2077,7 +2077,7 @@ function processExtendedData(node, entity) { if (defined(queryStringAttribute(extendedDataNode, "xmlns:prefix"))) { oneTimeWarning( "kml-extendedData", - "KML - ExtendedData with xmlns:prefix is unsupported" + "KML - ExtendedData with xmlns:prefix is unsupported", ); } @@ -2093,7 +2093,7 @@ function processExtendedData(node, entity) { displayName: queryStringValue( dataNode, "displayName", - namespaces.kml + namespaces.kml, ), value: queryStringValue(dataNode, "value", namespaces.kml), }; @@ -2113,7 +2113,7 @@ function processDescription( entity, styleEntity, uriResolver, - sourceResource + sourceResource, ) { let i; let key; @@ -2125,7 +2125,7 @@ function processDescription( const balloonStyle = defaultValue( entity.balloonStyle, - styleEntity.balloonStyle + styleEntity.balloonStyle, ); let background = Color.WHITE; @@ -2181,7 +2181,7 @@ function processDescription( value = extendedData[key]; text += `
${defaultValue( value.displayName, - key + key, )}${defaultValue(value.value, "")}
"; @@ -2258,7 +2258,7 @@ function processFeature(dataSource, featureNode, processingData) { const entity = createEntity( featureNode, entityCollection, - processingData.context + processingData.context, ); const kmlData = entity.kml; const styleEntity = computeFinalStyle( @@ -2266,7 +2266,7 @@ function processFeature(dataSource, featureNode, processingData) { featureNode, processingData.styleCollection, sourceResource, - uriResolver + uriResolver, ); const name = queryStringValue(featureNode, "name", namespaces.kml); @@ -2292,7 +2292,7 @@ function processFeature(dataSource, featureNode, processingData) { const visibility = queryBooleanValue( featureNode, "visibility", - namespaces.kml + namespaces.kml, ); entity.show = ancestryIsVisible(parent) && defaultValue(visibility, true); //const open = queryBooleanValue(featureNode, 'open', namespaces.kml); @@ -2316,7 +2316,7 @@ function processFeature(dataSource, featureNode, processingData) { kmlData.phoneNumber = queryStringValue( featureNode, "phoneNumber", - namespaces.kml + namespaces.kml, ); kmlData.snippet = queryStringValue(featureNode, "Snippet", namespaces.kml); @@ -2326,7 +2326,7 @@ function processFeature(dataSource, featureNode, processingData) { entity, styleEntity, uriResolver, - sourceResource + sourceResource, ); const ellipsoid = dataSource._ellipsoid; @@ -2359,7 +2359,7 @@ function processPlacemark( dataSource, placemark, processingData, - deferredLoading + deferredLoading, ) { const r = processFeature(dataSource, placemark, processingData); const entity = r.entity; @@ -2379,7 +2379,7 @@ function processPlacemark( childNode, entity, styleEntity, - entity.id + entity.id, ); hasGeometry = true; } @@ -2417,7 +2417,7 @@ function processTour(dataSource, node, processingData, deferredLoading) { playlistNodeProcessor(tour, entryNode, ellipsoid); } else { console.log( - `Unknown KML Tour playlist entry type ${entryNode.localName}` + `Unknown KML Tour playlist entry type ${entryNode.localName}`, ); } } @@ -2456,28 +2456,28 @@ function processCamera(featureNode, entity, ellipsoid) { if (defined(camera)) { const lon = defaultValue( queryNumericValue(camera, "longitude", namespaces.kml), - 0.0 + 0.0, ); const lat = defaultValue( queryNumericValue(camera, "latitude", namespaces.kml), - 0.0 + 0.0, ); const altitude = defaultValue( queryNumericValue(camera, "altitude", namespaces.kml), - 0.0 + 0.0, ); const heading = defaultValue( queryNumericValue(camera, "heading", namespaces.kml), - 0.0 + 0.0, ); const tilt = defaultValue( queryNumericValue(camera, "tilt", namespaces.kml), - 0.0 + 0.0, ); const roll = defaultValue( queryNumericValue(camera, "roll", namespaces.kml), - 0.0 + 0.0, ); const position = Cartesian3.fromDegrees(lon, lat, altitude, ellipsoid); @@ -2492,21 +2492,21 @@ function processLookAt(featureNode, entity, ellipsoid) { if (defined(lookAt)) { const lon = defaultValue( queryNumericValue(lookAt, "longitude", namespaces.kml), - 0.0 + 0.0, ); const lat = defaultValue( queryNumericValue(lookAt, "latitude", namespaces.kml), - 0.0 + 0.0, ); const altitude = defaultValue( queryNumericValue(lookAt, "altitude", namespaces.kml), - 0.0 + 0.0, ); let heading = queryNumericValue(lookAt, "heading", namespaces.kml); let tilt = queryNumericValue(lookAt, "tilt", namespaces.kml); const range = defaultValue( queryNumericValue(lookAt, "range", namespaces.kml), - 0.0 + 0.0, ); tilt = CesiumMath.toRadians(defaultValue(tilt, 0.0)); @@ -2515,7 +2515,7 @@ function processLookAt(featureNode, entity, ellipsoid) { const hpr = new HeadingPitchRange( heading, tilt - CesiumMath.PI_OVER_TWO, - range + range, ); const viewPoint = Cartesian3.fromDegrees(lon, lat, altitude, ellipsoid); @@ -2527,7 +2527,7 @@ function processScreenOverlay( dataSource, screenOverlayNode, processingData, - deferredLoading + deferredLoading, ) { const screenOverlay = processingData.screenOverlayContainer; if (!defined(screenOverlay)) { @@ -2543,7 +2543,7 @@ function processScreenOverlay( dataSource, sourceResource, uriResolver, - false + false, ); if (!defined(icon)) { @@ -2560,12 +2560,12 @@ function processScreenOverlay( const screenXY = queryFirstNode( screenOverlayNode, "screenXY", - namespaces.kml + namespaces.kml, ); const overlayXY = queryFirstNode( screenOverlayNode, "overlayXY", - namespaces.kml + namespaces.kml, ); const size = queryFirstNode(screenOverlayNode, "size", namespaces.kml); @@ -2642,7 +2642,7 @@ function processScreenOverlay( if (defined(x)) { if (xUnit === "fraction") { xStyle = `${"left: " + "calc("}${Math.floor( - x * 100 + x * 100, )}% - ${xOrigin}px)`; } else if (xUnit === "pixels") { xStyle = `left: ${x - xOrigin}px`; @@ -2656,7 +2656,7 @@ function processScreenOverlay( if (defined(y)) { if (yUnit === "fraction") { yStyle = `${"bottom: " + "calc("}${Math.floor( - y * 100 + y * 100, )}% - ${yOrigin}px)`; } else if (yUnit === "pixels") { yStyle = `bottom: ${y - yOrigin}px`; @@ -2678,7 +2678,7 @@ function processGroundOverlay( dataSource, groundOverlay, processingData, - deferredLoading + deferredLoading, ) { const r = processFeature(dataSource, groundOverlay, processingData); const entity = r.entity; @@ -2689,7 +2689,7 @@ function processGroundOverlay( const ellipsoid = dataSource._ellipsoid; const positions = readCoordinates( queryFirstNode(groundOverlay, "LatLonQuad", namespaces.gx), - ellipsoid + ellipsoid, ); const zIndex = queryNumericValue(groundOverlay, "drawOrder", namespaces.kml); if (defined(positions)) { @@ -2706,7 +2706,7 @@ function processGroundOverlay( const latLonBox = queryFirstNode( groundOverlay, "LatLonBox", - namespaces.kml + namespaces.kml, ); if (defined(latLonBox)) { let west = queryNumericValue(latLonBox, "west", namespaces.kml); @@ -2743,13 +2743,13 @@ function processGroundOverlay( dataSource, processingData.sourceResource, processingData.uriResolver, - true + true, ); if (defined(href)) { if (isLatLonQuad) { oneTimeWarning( "kml-gx:LatLonQuad", - "KML - gx:LatLonQuad Icon does not support texture projection." + "KML - gx:LatLonQuad Icon does not support texture projection.", ); } const x = queryNumericValue(iconNode, "x", namespaces.gx); @@ -2760,7 +2760,7 @@ function processGroundOverlay( if (defined(x) || defined(y) || defined(w) || defined(h)) { oneTimeWarning( "kml-groundOverlay-xywh", - "KML - gx:x, gx:y, gx:w, gx:h aren't supported for GroundOverlays" + "KML - gx:x, gx:y, gx:w, gx:h aren't supported for GroundOverlays", ); } @@ -2768,7 +2768,7 @@ function processGroundOverlay( geometry.material.color = queryColorValue( groundOverlay, "color", - namespaces.kml + namespaces.kml, ); geometry.material.transparent = true; } else { @@ -2778,7 +2778,7 @@ function processGroundOverlay( let altitudeMode = queryStringValue( groundOverlay, "altitudeMode", - namespaces.kml + namespaces.kml, ); if (defined(altitudeMode)) { @@ -2787,13 +2787,13 @@ function processGroundOverlay( geometry.height = queryNumericValue( groundOverlay, "altitude", - namespaces.kml + namespaces.kml, ); geometry.zIndex = undefined; } else if (altitudeMode !== "clampToGround") { oneTimeWarning( "kml-altitudeMode-unknown", - `KML - Unknown altitudeMode: ${altitudeMode}` + `KML - Unknown altitudeMode: ${altitudeMode}`, ); } // else just use the default of 0 until we support 'clampToGround' @@ -2801,28 +2801,28 @@ function processGroundOverlay( altitudeMode = queryStringValue( groundOverlay, "altitudeMode", - namespaces.gx + namespaces.gx, ); if (altitudeMode === "relativeToSeaFloor") { oneTimeWarning( "kml-altitudeMode-relativeToSeaFloor", - "KML - altitudeMode relativeToSeaFloor is currently not supported, treating as absolute." + "KML - altitudeMode relativeToSeaFloor is currently not supported, treating as absolute.", ); geometry.height = queryNumericValue( groundOverlay, "altitude", - namespaces.kml + namespaces.kml, ); geometry.zIndex = undefined; } else if (altitudeMode === "clampToSeaFloor") { oneTimeWarning( "kml-altitudeMode-clampToSeaFloor", - "KML - altitudeMode clampToSeaFloor is currently not supported, treating as clampToGround." + "KML - altitudeMode clampToSeaFloor is currently not supported, treating as clampToGround.", ); } else if (defined(altitudeMode)) { oneTimeWarning( "kml-altitudeMode-unknown", - `KML - Unknown altitudeMode: ${altitudeMode}` + `KML - Unknown altitudeMode: ${altitudeMode}`, ); } } @@ -2832,7 +2832,7 @@ function processUnsupportedFeature( dataSource, node, processingData, - deferredLoading + deferredLoading, ) { dataSource._unsupportedNode.raiseEvent( dataSource, @@ -2841,11 +2841,11 @@ function processUnsupportedFeature( processingData.entityCollection, processingData.styleCollection, processingData.sourceResource, - processingData.uriResolver + processingData.uriResolver, ); oneTimeWarning( `kml-unsupportedFeature-${node.nodeName}`, - `KML - Unsupported feature: ${node.nodeName}` + `KML - Unsupported feature: ${node.nodeName}`, ); } @@ -2879,7 +2879,7 @@ function processNetworkLinkQueryString( canvas, viewBoundScale, bbox, - ellipsoid + ellipsoid, ) { function fixLatitude(value) { if (value < -CesiumMath.PI_OVER_TWO) { @@ -2916,14 +2916,14 @@ function processNetworkLinkQueryString( centerCartesian = camera.pickEllipsoid( scratchCartesian2, ellipsoid, - scratchCartesian3 + scratchCartesian3, ); } if (defined(centerCartesian)) { centerCartographic = ellipsoid.cartesianToCartographic( centerCartesian, - scratchCartographic + scratchCartographic, ); } else { centerCartographic = Rectangle.center(bbox, scratchCartographic); @@ -2940,25 +2940,25 @@ function processNetworkLinkQueryString( fixLongitude(centerCartographic.longitude - newHalfWidth), fixLatitude(centerCartographic.latitude - newHalfHeight), fixLongitude(centerCartographic.longitude + newHalfWidth), - fixLatitude(centerCartographic.latitude + newHalfHeight) + fixLatitude(centerCartographic.latitude + newHalfHeight), ); } queryString = queryString.replace( "[bboxWest]", - CesiumMath.toDegrees(bbox.west).toString() + CesiumMath.toDegrees(bbox.west).toString(), ); queryString = queryString.replace( "[bboxSouth]", - CesiumMath.toDegrees(bbox.south).toString() + CesiumMath.toDegrees(bbox.south).toString(), ); queryString = queryString.replace( "[bboxEast]", - CesiumMath.toDegrees(bbox.east).toString() + CesiumMath.toDegrees(bbox.east).toString(), ); queryString = queryString.replace( "[bboxNorth]", - CesiumMath.toDegrees(bbox.north).toString() + CesiumMath.toDegrees(bbox.north).toString(), ); const lon = CesiumMath.toDegrees(centerCartographic.longitude).toString(); @@ -2967,35 +2967,35 @@ function processNetworkLinkQueryString( queryString = queryString.replace("[lookatLat]", lat); queryString = queryString.replace( "[lookatTilt]", - CesiumMath.toDegrees(camera.pitch).toString() + CesiumMath.toDegrees(camera.pitch).toString(), ); queryString = queryString.replace( "[lookatHeading]", - CesiumMath.toDegrees(camera.heading).toString() + CesiumMath.toDegrees(camera.heading).toString(), ); queryString = queryString.replace( "[lookatRange]", - Cartesian3.distance(camera.positionWC, centerCartesian) + Cartesian3.distance(camera.positionWC, centerCartesian), ); queryString = queryString.replace("[lookatTerrainLon]", lon); queryString = queryString.replace("[lookatTerrainLat]", lat); queryString = queryString.replace( "[lookatTerrainAlt]", - centerCartographic.height.toString() + centerCartographic.height.toString(), ); ellipsoid.cartesianToCartographic(camera.positionWC, scratchCartographic); queryString = queryString.replace( "[cameraLon]", - CesiumMath.toDegrees(scratchCartographic.longitude).toString() + CesiumMath.toDegrees(scratchCartographic.longitude).toString(), ); queryString = queryString.replace( "[cameraLat]", - CesiumMath.toDegrees(scratchCartographic.latitude).toString() + CesiumMath.toDegrees(scratchCartographic.latitude).toString(), ); queryString = queryString.replace( "[cameraAlt]", - CesiumMath.toDegrees(scratchCartographic.height).toString() + CesiumMath.toDegrees(scratchCartographic.height).toString(), ); const frustum = camera.frustum; @@ -3087,18 +3087,18 @@ function processNetworkLink(dataSource, node, processingData, deferredLoading) { viewRefreshMode = queryStringValue( link, "viewRefreshMode", - namespaces.kml + namespaces.kml, ); if (viewRefreshMode === "onRegion") { oneTimeWarning( "kml-refrehMode-onRegion", - "KML - Unsupported viewRefreshMode: onRegion" + "KML - Unsupported viewRefreshMode: onRegion", ); return; } viewBoundScale = defaultValue( queryStringValue(link, "viewBoundScale", namespaces.kml), - 1.0 + 1.0, ); const defaultViewFormat = viewRefreshMode === "onStop" @@ -3106,7 +3106,7 @@ function processNetworkLink(dataSource, node, processingData, deferredLoading) { : ""; const viewFormat = defaultValue( queryStringValue(link, "viewFormat", namespaces.kml), - defaultViewFormat + defaultViewFormat, ); const httpQuery = queryStringValue(link, "httpQuery", namespaces.kml); if (defined(viewFormat)) { @@ -3123,7 +3123,7 @@ function processNetworkLink(dataSource, node, processingData, deferredLoading) { dataSource.canvas, viewBoundScale, dataSource._lastCameraView.bbox, - ellipsoid + ellipsoid, ); } @@ -3154,11 +3154,11 @@ function processNetworkLink(dataSource, node, processingData, deferredLoading) { const refreshMode = queryStringValue( link, "refreshMode", - namespaces.kml + namespaces.kml, ); let refreshInterval = defaultValue( queryNumericValue(link, "refreshInterval", namespaces.kml), - 0 + 0, ); if ( (refreshMode === "onInterval" && refreshInterval > 0) || @@ -3168,7 +3168,7 @@ function processNetworkLink(dataSource, node, processingData, deferredLoading) { const networkLinkControl = queryFirstNode( rootElement, "NetworkLinkControl", - namespaces.kml + namespaces.kml, ); const hasNetworkLinkControl = defined(networkLinkControl); @@ -3192,18 +3192,18 @@ function processNetworkLink(dataSource, node, processingData, deferredLoading) { queryStringValue( networkLinkControl, "cookie", - namespaces.kml + namespaces.kml, ), - "" - ) + "", + ), ); minRefreshPeriod = defaultValue( queryNumericValue( networkLinkControl, "minRefreshPeriod", - namespaces.kml + namespaces.kml, ), - 0 + 0, ); } @@ -3219,7 +3219,7 @@ function processNetworkLink(dataSource, node, processingData, deferredLoading) { expires = queryStringValue( networkLinkControl, "expires", - namespaces.kml + namespaces.kml, ); } if (defined(expires)) { @@ -3234,13 +3234,13 @@ function processNetworkLink(dataSource, node, processingData, deferredLoading) { } catch (e) { oneTimeWarning( "kml-refreshMode-onInterval-onExpire", - "KML - NetworkLinkControl expires is not a valid date" + "KML - NetworkLinkControl expires is not a valid date", ); } } else { oneTimeWarning( "kml-refreshMode-onExpire", - "KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element" + "KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element", ); } } else if (defined(dataSource.camera)) { @@ -3248,12 +3248,12 @@ function processNetworkLink(dataSource, node, processingData, deferredLoading) { networkLinkInfo.refreshMode = RefreshMode.STOP; networkLinkInfo.time = defaultValue( queryNumericValue(link, "viewRefreshTime", namespaces.kml), - 0 + 0, ); } else { oneTimeWarning( "kml-refrehMode-onStop-noCamera", - "A NetworkLink with viewRefreshMode=onStop requires the `camera` property to be defined." + "A NetworkLink with viewRefreshMode=onStop requires the `camera` property to be defined.", ); } @@ -3282,7 +3282,7 @@ function processFeatureNode(dataSource, node, processingData, deferredLoading) { dataSource, node, processingData, - deferredLoading + deferredLoading, ); } @@ -3293,7 +3293,7 @@ function loadKml( sourceResource, uriResolver, screenOverlayContainer, - context + context, ) { entityCollection.removeAll(); @@ -3321,8 +3321,8 @@ function loadKml( styleCollection, sourceResource, false, - uriResolver - ) + uriResolver, + ), ).then(function () { let element = kml.documentElement; if (element.localName === "kml") { @@ -3361,7 +3361,7 @@ function loadKmz( entityCollection, blob, sourceResource, - screenOverlayContainer + screenOverlayContainer, ) { const zWorkerUrl = buildModuleUrl("ThirdParty/Workers/z-worker-pako.js"); zip.configure({ @@ -3415,7 +3415,7 @@ function loadKmz( uriResolver.kml, sourceResource, uriResolver, - screenOverlayContainer + screenOverlayContainer, ); }); }); @@ -3463,7 +3463,7 @@ function load(dataSource, entityCollection, data, options) { entityCollection, dataToLoad, sourceUri, - screenOverlayContainer + screenOverlayContainer, ); } return readBlobAsText(dataToLoad).then(function (text) { @@ -3512,7 +3512,7 @@ function load(dataSource, entityCollection, data, options) { sourceUri, uriResolver, screenOverlayContainer, - context + context, ); }); }); @@ -3524,7 +3524,7 @@ function load(dataSource, entityCollection, data, options) { sourceUri, uriResolver, screenOverlayContainer, - context + context, ); }) .catch(function (error) { @@ -3892,8 +3892,8 @@ KmlDataSource.prototype.load = function (data, options) { clock.multiplier = Math.round( Math.min( Math.max(JulianDate.secondsDifference(stop, start) / 60, 1), - 3.15569e7 - ) + 3.15569e7, + ), ); } @@ -3953,7 +3953,7 @@ function getNetworkLinkUpdateCallback( networkLink, newEntityCollection, networkLinks, - processedHref + processedHref, ) { return function (rootElement) { if (!networkLinks.contains(networkLink.id)) { @@ -3965,7 +3965,7 @@ function getNetworkLinkUpdateCallback( const networkLinkControl = queryFirstNode( rootElement, "NetworkLinkControl", - namespaces.kml + namespaces.kml, ); const hasNetworkLinkControl = defined(networkLinkControl); @@ -3976,7 +3976,7 @@ function getNetworkLinkUpdateCallback( ) { oneTimeWarning( "kml-networkLinkControl-update", - "KML - NetworkLinkControl updates aren't supported." + "KML - NetworkLinkControl updates aren't supported.", ); networkLink.updating = false; networkLinks.remove(networkLink.id); @@ -3985,16 +3985,16 @@ function getNetworkLinkUpdateCallback( networkLink.cookie = queryToObject( defaultValue( queryStringValue(networkLinkControl, "cookie", namespaces.kml), - "" - ) + "", + ), ); minRefreshPeriod = defaultValue( queryNumericValue( networkLinkControl, "minRefreshPeriod", - namespaces.kml + namespaces.kml, ), - 0 + 0, ); } @@ -4010,7 +4010,7 @@ function getNetworkLinkUpdateCallback( expires = queryStringValue( networkLinkControl, "expires", - namespaces.kml + namespaces.kml, ); } if (defined(expires)) { @@ -4024,14 +4024,14 @@ function getNetworkLinkUpdateCallback( } catch (e) { oneTimeWarning( "kml-networkLinkControl-expires", - "KML - NetworkLinkControl expires is not a valid date" + "KML - NetworkLinkControl expires is not a valid date", ); remove = true; } } else { oneTimeWarning( "kml-refreshMode-onExpire", - "KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element" + "KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element", ); remove = true; } @@ -4102,7 +4102,7 @@ function getNetworkLinkUpdateCallback( networkLink.needsUpdate = false; dataSource._refresh.raiseEvent( dataSource, - processedHref.getUrlComponent(true) + processedHref.getUrlComponent(true), ); }; } @@ -4144,11 +4144,11 @@ KmlDataSource.prototype.update = function (time) { !( camera.positionWC.equalsEpsilon( lastCameraView.position, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ) && camera.directionWC.equalsEpsilon( lastCameraView.direction, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ) && camera.upWC.equalsEpsilon(lastCameraView.up, CesiumMath.EPSILON7) ) @@ -4211,7 +4211,7 @@ KmlDataSource.prototype.update = function (time) { that.canvas, networkLink.viewBoundScale, lastCameraView.bbox, - ellipsoid + ellipsoid, ); load(that, newEntityCollection, href, { @@ -4223,8 +4223,8 @@ KmlDataSource.prototype.update = function (time) { networkLink, newEntityCollection, newNetworkLinks, - href - ) + href, + ), ) .catch(function (error) { const msg = `NetworkLink ${networkLink.href} refresh failed: ${error}`; diff --git a/packages/engine/Source/DataSources/LabelGraphics.js b/packages/engine/Source/DataSources/LabelGraphics.js index 0622b72bb66c..3067bb8934ad 100644 --- a/packages/engine/Source/DataSources/LabelGraphics.js +++ b/packages/engine/Source/DataSources/LabelGraphics.js @@ -290,7 +290,7 @@ Object.defineProperties(LabelGraphics.prototype, { * @type {Property|undefined} */ pixelOffsetScaleByDistance: createPropertyDescriptor( - "pixelOffsetScaleByDistance" + "pixelOffsetScaleByDistance", ), /** @@ -311,7 +311,7 @@ Object.defineProperties(LabelGraphics.prototype, { * @type {Property|undefined} */ distanceDisplayCondition: createPropertyDescriptor( - "distanceDisplayCondition" + "distanceDisplayCondition", ), /** @@ -321,7 +321,7 @@ Object.defineProperties(LabelGraphics.prototype, { * @type {Property|undefined} */ disableDepthTestDistance: createPropertyDescriptor( - "disableDepthTestDistance" + "disableDepthTestDistance", ), }); @@ -379,52 +379,52 @@ LabelGraphics.prototype.merge = function (source) { this.scale = defaultValue(this.scale, source.scale); this.showBackground = defaultValue( this.showBackground, - source.showBackground + source.showBackground, ); this.backgroundColor = defaultValue( this.backgroundColor, - source.backgroundColor + source.backgroundColor, ); this.backgroundPadding = defaultValue( this.backgroundPadding, - source.backgroundPadding + source.backgroundPadding, ); this.pixelOffset = defaultValue(this.pixelOffset, source.pixelOffset); this.eyeOffset = defaultValue(this.eyeOffset, source.eyeOffset); this.horizontalOrigin = defaultValue( this.horizontalOrigin, - source.horizontalOrigin + source.horizontalOrigin, ); this.verticalOrigin = defaultValue( this.verticalOrigin, - source.verticalOrigin + source.verticalOrigin, ); this.heightReference = defaultValue( this.heightReference, - source.heightReference + source.heightReference, ); this.fillColor = defaultValue(this.fillColor, source.fillColor); this.outlineColor = defaultValue(this.outlineColor, source.outlineColor); this.outlineWidth = defaultValue(this.outlineWidth, source.outlineWidth); this.translucencyByDistance = defaultValue( this.translucencyByDistance, - source.translucencyByDistance + source.translucencyByDistance, ); this.pixelOffsetScaleByDistance = defaultValue( this.pixelOffsetScaleByDistance, - source.pixelOffsetScaleByDistance + source.pixelOffsetScaleByDistance, ); this.scaleByDistance = defaultValue( this.scaleByDistance, - source.scaleByDistance + source.scaleByDistance, ); this.distanceDisplayCondition = defaultValue( this.distanceDisplayCondition, - source.distanceDisplayCondition + source.distanceDisplayCondition, ); this.disableDepthTestDistance = defaultValue( this.disableDepthTestDistance, - source.disableDepthTestDistance + source.disableDepthTestDistance, ); }; export default LabelGraphics; diff --git a/packages/engine/Source/DataSources/LabelVisualizer.js b/packages/engine/Source/DataSources/LabelVisualizer.js index e88281164f29..ebd4daa3cf5a 100644 --- a/packages/engine/Source/DataSources/LabelVisualizer.js +++ b/packages/engine/Source/DataSources/LabelVisualizer.js @@ -69,7 +69,7 @@ function LabelVisualizer(entityCluster, entityCollection) { entityCollection.collectionChanged.addEventListener( LabelVisualizer.prototype._onCollectionChanged, - this + this, ); this._cluster = entityCluster; @@ -111,7 +111,7 @@ LabelVisualizer.prototype.update = function (time) { position = Property.getValueOrUndefined( entity._position, time, - positionScratch + positionScratch, ); text = Property.getValueOrUndefined(labelGraphics._text, time); show = defined(position) && defined(text); @@ -131,7 +131,7 @@ LabelVisualizer.prototype.update = function (time) { const heightReference = Property.getValueOrDefault( labelGraphics._heightReference, time, - defaultHeightReference + defaultHeightReference, ); if (!defined(label)) { @@ -154,98 +154,98 @@ LabelVisualizer.prototype.update = function (time) { label.scale = Property.getValueOrDefault( labelGraphics._scale, time, - defaultScale + defaultScale, ); label.font = Property.getValueOrDefault( labelGraphics._font, time, - defaultFont + defaultFont, ); label.style = Property.getValueOrDefault( labelGraphics._style, time, - defaultStyle + defaultStyle, ); label.fillColor = Property.getValueOrDefault( labelGraphics._fillColor, time, defaultFillColor, - fillColorScratch + fillColorScratch, ); label.outlineColor = Property.getValueOrDefault( labelGraphics._outlineColor, time, defaultOutlineColor, - outlineColorScratch + outlineColorScratch, ); label.outlineWidth = Property.getValueOrDefault( labelGraphics._outlineWidth, time, - defaultOutlineWidth + defaultOutlineWidth, ); label.showBackground = Property.getValueOrDefault( labelGraphics._showBackground, time, - defaultShowBackground + defaultShowBackground, ); label.backgroundColor = Property.getValueOrDefault( labelGraphics._backgroundColor, time, defaultBackgroundColor, - backgroundColorScratch + backgroundColorScratch, ); label.backgroundPadding = Property.getValueOrDefault( labelGraphics._backgroundPadding, time, defaultBackgroundPadding, - backgroundPaddingScratch + backgroundPaddingScratch, ); label.pixelOffset = Property.getValueOrDefault( labelGraphics._pixelOffset, time, defaultPixelOffset, - pixelOffsetScratch + pixelOffsetScratch, ); label.eyeOffset = Property.getValueOrDefault( labelGraphics._eyeOffset, time, defaultEyeOffset, - eyeOffsetScratch + eyeOffsetScratch, ); label.heightReference = heightReference; label.horizontalOrigin = Property.getValueOrDefault( labelGraphics._horizontalOrigin, time, - defaultHorizontalOrigin + defaultHorizontalOrigin, ); label.verticalOrigin = Property.getValueOrDefault( labelGraphics._verticalOrigin, time, - defaultVerticalOrigin + defaultVerticalOrigin, ); label.translucencyByDistance = Property.getValueOrUndefined( labelGraphics._translucencyByDistance, time, - translucencyByDistanceScratch + translucencyByDistanceScratch, ); label.pixelOffsetScaleByDistance = Property.getValueOrUndefined( labelGraphics._pixelOffsetScaleByDistance, time, - pixelOffsetScaleByDistanceScratch + pixelOffsetScaleByDistanceScratch, ); label.scaleByDistance = Property.getValueOrUndefined( labelGraphics._scaleByDistance, time, - scaleByDistanceScratch + scaleByDistanceScratch, ); label.distanceDisplayCondition = Property.getValueOrUndefined( labelGraphics._distanceDisplayCondition, time, - distanceDisplayConditionScratch + distanceDisplayConditionScratch, ); label.disableDepthTestDistance = Property.getValueOrUndefined( labelGraphics._disableDepthTestDistance, - time + time, ); if (updateClamping) { @@ -284,7 +284,7 @@ LabelVisualizer.prototype.getBoundingSphere = function (entity, result) { const label = item.label; result.center = Cartesian3.clone( defaultValue(label._clampedPosition, label.position), - result.center + result.center, ); result.radius = 0; return BoundingSphereState.DONE; @@ -305,7 +305,7 @@ LabelVisualizer.prototype.isDestroyed = function () { LabelVisualizer.prototype.destroy = function () { this._entityCollection.collectionChanged.removeEventListener( LabelVisualizer.prototype._onCollectionChanged, - this + this, ); const entities = this._entityCollection.values; for (let i = 0; i < entities.length; i++) { @@ -318,7 +318,7 @@ LabelVisualizer.prototype._onCollectionChanged = function ( entityCollection, added, removed, - changed + changed, ) { let i; let entity; diff --git a/packages/engine/Source/DataSources/ModelGraphics.js b/packages/engine/Source/DataSources/ModelGraphics.js index 1814566bad1c..58f6d142694a 100644 --- a/packages/engine/Source/DataSources/ModelGraphics.js +++ b/packages/engine/Source/DataSources/ModelGraphics.js @@ -162,7 +162,7 @@ Object.defineProperties(ModelGraphics.prototype, { * @default true */ enableVerticalExaggeration: createPropertyDescriptor( - "enableVerticalExaggeration" + "enableVerticalExaggeration", ), /** @@ -192,7 +192,7 @@ Object.defineProperties(ModelGraphics.prototype, { * @type {Property|undefined} */ incrementallyLoadTextures: createPropertyDescriptor( - "incrementallyLoadTextures" + "incrementallyLoadTextures", ), /** @@ -276,7 +276,7 @@ Object.defineProperties(ModelGraphics.prototype, { * @type {Property|undefined} */ imageBasedLightingFactor: createPropertyDescriptor( - "imageBasedLightingFactor" + "imageBasedLightingFactor", ), /** @@ -292,7 +292,7 @@ Object.defineProperties(ModelGraphics.prototype, { * @type {Property|undefined} */ distanceDisplayCondition: createPropertyDescriptor( - "distanceDisplayCondition" + "distanceDisplayCondition", ), /** @@ -305,7 +305,7 @@ Object.defineProperties(ModelGraphics.prototype, { nodeTransformations: createPropertyDescriptor( "nodeTransformations", undefined, - createNodeTransformationPropertyBag + createNodeTransformationPropertyBag, ), /** @@ -317,7 +317,7 @@ Object.defineProperties(ModelGraphics.prototype, { articulations: createPropertyDescriptor( "articulations", undefined, - createArticulationStagePropertyBag + createArticulationStagePropertyBag, ), /** @@ -388,56 +388,56 @@ ModelGraphics.prototype.merge = function (source) { this.scale = defaultValue(this.scale, source.scale); this.enableVerticalExaggeration = defaultValue( this.enableVerticalExaggeration, - source.enableVerticalExaggeration + source.enableVerticalExaggeration, ); this.minimumPixelSize = defaultValue( this.minimumPixelSize, - source.minimumPixelSize + source.minimumPixelSize, ); this.maximumScale = defaultValue(this.maximumScale, source.maximumScale); this.incrementallyLoadTextures = defaultValue( this.incrementallyLoadTextures, - source.incrementallyLoadTextures + source.incrementallyLoadTextures, ); this.runAnimations = defaultValue(this.runAnimations, source.runAnimations); this.clampAnimations = defaultValue( this.clampAnimations, - source.clampAnimations + source.clampAnimations, ); this.shadows = defaultValue(this.shadows, source.shadows); this.heightReference = defaultValue( this.heightReference, - source.heightReference + source.heightReference, ); this.silhouetteColor = defaultValue( this.silhouetteColor, - source.silhouetteColor + source.silhouetteColor, ); this.silhouetteSize = defaultValue( this.silhouetteSize, - source.silhouetteSize + source.silhouetteSize, ); this.color = defaultValue(this.color, source.color); this.colorBlendMode = defaultValue( this.colorBlendMode, - source.colorBlendMode + source.colorBlendMode, ); this.colorBlendAmount = defaultValue( this.colorBlendAmount, - source.colorBlendAmount + source.colorBlendAmount, ); this.imageBasedLightingFactor = defaultValue( this.imageBasedLightingFactor, - source.imageBasedLightingFactor + source.imageBasedLightingFactor, ); this.lightColor = defaultValue(this.lightColor, source.lightColor); this.distanceDisplayCondition = defaultValue( this.distanceDisplayCondition, - source.distanceDisplayCondition + source.distanceDisplayCondition, ); this.clippingPlanes = defaultValue( this.clippingPlanes, - source.clippingPlanes + source.clippingPlanes, ); this.customShader = defaultValue(this.customShader, source.customShader); @@ -449,7 +449,7 @@ ModelGraphics.prototype.merge = function (source) { } else { this.nodeTransformations = new PropertyBag( sourceNodeTransformations, - createNodeTransformationProperty + createNodeTransformationProperty, ); } } diff --git a/packages/engine/Source/DataSources/ModelVisualizer.js b/packages/engine/Source/DataSources/ModelVisualizer.js index ab326dbc44c3..42d1bd177592 100644 --- a/packages/engine/Source/DataSources/ModelVisualizer.js +++ b/packages/engine/Source/DataSources/ModelVisualizer.js @@ -59,7 +59,7 @@ function ModelVisualizer(scene, entityCollection) { entityCollection.collectionChanged.addEventListener( ModelVisualizer.prototype._onCollectionChanged, - this + this, ); this._scene = scene; @@ -75,7 +75,7 @@ async function createModelPrimitive( visualizer, entity, resource, - incrementallyLoadTextures + incrementallyLoadTextures, ) { const primitives = visualizer._primitives; const modelHash = visualizer._modelHash; @@ -150,7 +150,7 @@ ModelVisualizer.prototype.update = function (time) { if (show) { modelMatrix = entity.computeModelMatrix(time, modelMatrixScratch); resource = Resource.createIfNeeded( - Property.getValueOrUndefined(modelGraphics._uri, time) + Property.getValueOrUndefined(modelGraphics._uri, time), ); show = defined(modelMatrix) && defined(resource); } @@ -182,7 +182,7 @@ ModelVisualizer.prototype.update = function (time) { const incrementallyLoadTextures = Property.getValueOrDefault( modelGraphics._incrementallyLoadTextures, time, - defaultIncrementallyLoadTextures + defaultIncrementallyLoadTextures, ); createModelPrimitive(this, entity, resource, incrementallyLoadTextures); @@ -197,83 +197,84 @@ ModelVisualizer.prototype.update = function (time) { model.scale = Property.getValueOrDefault( modelGraphics._scale, time, - defaultScale + defaultScale, ); model.enableVerticalExaggeration = Property.getValueOrDefault( modelGraphics._enableVerticalExaggeration, time, - defaultEnableVerticalExaggeration + defaultEnableVerticalExaggeration, ); model.minimumPixelSize = Property.getValueOrDefault( modelGraphics._minimumPixelSize, time, - defaultMinimumPixelSize + defaultMinimumPixelSize, ); model.maximumScale = Property.getValueOrUndefined( modelGraphics._maximumScale, - time + time, ); model.modelMatrix = Matrix4.clone(modelMatrix, model.modelMatrix); model.shadows = Property.getValueOrDefault( modelGraphics._shadows, time, - defaultShadows + defaultShadows, ); model.heightReference = Property.getValueOrDefault( modelGraphics._heightReference, time, - defaultHeightReference + defaultHeightReference, ); model.distanceDisplayCondition = Property.getValueOrUndefined( modelGraphics._distanceDisplayCondition, - time + time, ); model.silhouetteColor = Property.getValueOrDefault( modelGraphics._silhouetteColor, time, defaultSilhouetteColor, - scratchColor + scratchColor, ); model.silhouetteSize = Property.getValueOrDefault( modelGraphics._silhouetteSize, time, - defaultSilhouetteSize + defaultSilhouetteSize, ); model.color = Property.getValueOrDefault( modelGraphics._color, time, defaultColor, - scratchColor + scratchColor, ); model.colorBlendMode = Property.getValueOrDefault( modelGraphics._colorBlendMode, time, - defaultColorBlendMode + defaultColorBlendMode, ); model.colorBlendAmount = Property.getValueOrDefault( modelGraphics._colorBlendAmount, time, - defaultColorBlendAmount + defaultColorBlendAmount, ); model.clippingPlanes = Property.getValueOrUndefined( modelGraphics._clippingPlanes, - time + time, ); model.clampAnimations = Property.getValueOrDefault( modelGraphics._clampAnimations, time, - defaultClampAnimations - ); - model.imageBasedLighting.imageBasedLightingFactor = Property.getValueOrDefault( - modelGraphics._imageBasedLightingFactor, - time, - defaultImageBasedLightingFactor + defaultClampAnimations, ); + model.imageBasedLighting.imageBasedLightingFactor = + Property.getValueOrDefault( + modelGraphics._imageBasedLightingFactor, + time, + defaultImageBasedLightingFactor, + ); let lightColor = Property.getValueOrUndefined( modelGraphics._lightColor, - time + time, ); // Convert from Color to Cartesian3 @@ -285,7 +286,7 @@ ModelVisualizer.prototype.update = function (time) { model.lightColor = lightColor; model.customShader = Property.getValueOrUndefined( modelGraphics._customShader, - time + time, ); // It's possible for getBoundingSphere to run before @@ -296,7 +297,7 @@ ModelVisualizer.prototype.update = function (time) { const runAnimations = Property.getValueOrDefault( modelGraphics._runAnimations, time, - true + true, ); if (modelData.animationsRunning !== runAnimations) { if (runAnimations) { @@ -313,7 +314,7 @@ ModelVisualizer.prototype.update = function (time) { const nodeTransformations = Property.getValueOrUndefined( modelGraphics._nodeTransformations, time, - modelData.nodeTransformationsScratch + modelData.nodeTransformationsScratch, ); if (defined(nodeTransformations)) { const nodeNames = Object.keys(nodeTransformations); @@ -336,12 +337,12 @@ ModelVisualizer.prototype.update = function (time) { const transformationMatrix = Matrix4.fromTranslationRotationScale( nodeTransformation, - nodeMatrixScratch + nodeMatrixScratch, ); modelNode.matrix = Matrix4.multiply( modelNode.originalMatrix, transformationMatrix, - transformationMatrix + transformationMatrix, ); } } @@ -351,7 +352,7 @@ ModelVisualizer.prototype.update = function (time) { const articulations = Property.getValueOrUndefined( modelGraphics._articulations, time, - modelData.articulationsScratch + modelData.articulationsScratch, ); if (defined(articulations)) { const articulationStageKeys = Object.keys(articulations); @@ -396,7 +397,7 @@ ModelVisualizer.prototype.isDestroyed = function () { ModelVisualizer.prototype.destroy = function () { this._entityCollection.collectionChanged.removeEventListener( ModelVisualizer.prototype._onCollectionChanged, - this + this, ); const entities = this._entitiesToVisualize.values; const modelHash = this._modelHash; @@ -459,7 +460,7 @@ ModelVisualizer.prototype.getBoundingSphere = function (entity, result) { scratchPosition.z = modelMatrix[14]; const cartoPosition = ellipsoid.cartesianToCartographic( scratchPosition, - scratchCartographic + scratchCartographic, ); const height = scene.getHeight(cartoPosition, model.heightReference); @@ -487,7 +488,7 @@ ModelVisualizer.prototype._onCollectionChanged = function ( entityCollection, added, removed, - changed + changed, ) { let i; let entity; diff --git a/packages/engine/Source/DataSources/NodeTransformationProperty.js b/packages/engine/Source/DataSources/NodeTransformationProperty.js index b71017dc363a..8d0f121fb957 100644 --- a/packages/engine/Source/DataSources/NodeTransformationProperty.js +++ b/packages/engine/Source/DataSources/NodeTransformationProperty.js @@ -114,19 +114,19 @@ NodeTransformationProperty.prototype.getValue = function (time, result) { this._translation, time, defaultNodeTransformation.translation, - result.translation + result.translation, ); result.rotation = Property.getValueOrClonedDefault( this._rotation, time, defaultNodeTransformation.rotation, - result.rotation + result.rotation, ); result.scale = Property.getValueOrClonedDefault( this._scale, time, defaultNodeTransformation.scale, - result.scale + result.scale, ); return result; }; diff --git a/packages/engine/Source/DataSources/PathGraphics.js b/packages/engine/Source/DataSources/PathGraphics.js index d914bb4424e6..8cc59662726a 100644 --- a/packages/engine/Source/DataSources/PathGraphics.js +++ b/packages/engine/Source/DataSources/PathGraphics.js @@ -112,7 +112,7 @@ Object.defineProperties(PathGraphics.prototype, { * @type {Property|undefined} */ distanceDisplayCondition: createPropertyDescriptor( - "distanceDisplayCondition" + "distanceDisplayCondition", ), }); @@ -157,7 +157,7 @@ PathGraphics.prototype.merge = function (source) { this.material = defaultValue(this.material, source.material); this.distanceDisplayCondition = defaultValue( this.distanceDisplayCondition, - source.distanceDisplayCondition + source.distanceDisplayCondition, ); }; export default PathGraphics; diff --git a/packages/engine/Source/DataSources/PathVisualizer.js b/packages/engine/Source/DataSources/PathVisualizer.js index 6c99fc36815a..fd5f63d6947f 100644 --- a/packages/engine/Source/DataSources/PathVisualizer.js +++ b/packages/engine/Source/DataSources/PathVisualizer.js @@ -44,7 +44,7 @@ function subSampleSampledProperty( referenceFrame, maximumStep, startingIndex, - result + result, ) { let r = startingIndex; //Always step exactly on start (but only use it if it exists.) @@ -76,7 +76,7 @@ function subSampleSampledProperty( tmp = property.getValueInReferenceFrame( updateTime, referenceFrame, - result[r] + result[r], ); if (defined(tmp)) { result[r++] = tmp; @@ -91,7 +91,7 @@ function subSampleSampledProperty( tmp = property.getValueInReferenceFrame( current, referenceFrame, - result[r] + result[r], ); if (defined(tmp)) { result[r++] = tmp; @@ -116,7 +116,7 @@ function subSampleSampledProperty( current = JulianDate.addSeconds( current, sampleStepSize, - new JulianDate() + new JulianDate(), ); sampleStepsTaken++; continue; @@ -144,7 +144,7 @@ function subSampleCallbackPositionProperty( referenceFrame, maximumStep, startingIndex, - result + result, ) { let tmp; let i = 0; @@ -160,7 +160,7 @@ function subSampleCallbackPositionProperty( tmp = property.getValueInReferenceFrame( updateTime, referenceFrame, - result[index] + result[index], ); if (defined(tmp)) { result[index] = tmp; @@ -170,7 +170,7 @@ function subSampleCallbackPositionProperty( tmp = property.getValueInReferenceFrame( time, referenceFrame, - result[index] + result[index], ); if (defined(tmp)) { result[index] = tmp; @@ -196,7 +196,7 @@ function subSampleGenericProperty( referenceFrame, maximumStep, startingIndex, - result + result, ) { let tmp; let i = 0; @@ -213,7 +213,7 @@ function subSampleGenericProperty( tmp = property.getValueInReferenceFrame( updateTime, referenceFrame, - result[index] + result[index], ); if (defined(tmp)) { result[index] = tmp; @@ -223,7 +223,7 @@ function subSampleGenericProperty( tmp = property.getValueInReferenceFrame( time, referenceFrame, - result[index] + result[index], ); if (defined(tmp)) { result[index] = tmp; @@ -249,7 +249,7 @@ function subSampleIntervalProperty( referenceFrame, maximumStep, startingIndex, - result + result, ) { subSampleIntervalPropertyScratch.start = start; subSampleIntervalPropertyScratch.stop = stop; @@ -262,7 +262,7 @@ function subSampleIntervalProperty( !TimeInterval.intersect( interval, subSampleIntervalPropertyScratch, - scratchTimeInterval + scratchTimeInterval, ).isEmpty ) { let time = interval.start; @@ -273,14 +273,14 @@ function subSampleIntervalProperty( time = JulianDate.addSeconds( interval.start, JulianDate.secondsDifference(interval.stop, interval.start) / 2, - new JulianDate() + new JulianDate(), ); } } const tmp = property.getValueInReferenceFrame( time, referenceFrame, - result[index] + result[index], ); if (defined(tmp)) { result[index] = tmp; @@ -299,12 +299,12 @@ function subSampleConstantProperty( referenceFrame, maximumStep, startingIndex, - result + result, ) { const tmp = property.getValueInReferenceFrame( start, referenceFrame, - result[startingIndex] + result[startingIndex], ); if (defined(tmp)) { result[startingIndex++] = tmp; @@ -320,7 +320,7 @@ function subSampleCompositeProperty( referenceFrame, maximumStep, startingIndex, - result + result, ) { subSampleCompositePropertyScratch.start = start; subSampleCompositePropertyScratch.stop = stop; @@ -333,7 +333,7 @@ function subSampleCompositeProperty( !TimeInterval.intersect( interval, subSampleCompositePropertyScratch, - scratchTimeInterval + scratchTimeInterval, ).isEmpty ) { const intervalStart = interval.start; @@ -357,7 +357,7 @@ function subSampleCompositeProperty( referenceFrame, maximumStep, index, - result + result, ); } } @@ -372,7 +372,7 @@ function reallySubSample( referenceFrame, maximumStep, index, - result + result, ) { //Unwrap any references until we have the actual property. while (property instanceof ReferenceProperty) { @@ -390,7 +390,7 @@ function reallySubSample( referenceFrame, maximumStep, index, - result + result, ); } else if (property instanceof CallbackPositionProperty) { index = subSampleCallbackPositionProperty( @@ -401,7 +401,7 @@ function reallySubSample( referenceFrame, maximumStep, index, - result + result, ); } else if (property instanceof CompositePositionProperty) { index = subSampleCompositeProperty( @@ -412,7 +412,7 @@ function reallySubSample( referenceFrame, maximumStep, index, - result + result, ); } else if (property instanceof TimeIntervalCollectionPositionProperty) { index = subSampleIntervalProperty( @@ -423,7 +423,7 @@ function reallySubSample( referenceFrame, maximumStep, index, - result + result, ); } else if ( property instanceof ConstantPositionProperty || @@ -438,7 +438,7 @@ function reallySubSample( referenceFrame, maximumStep, index, - result + result, ); } else { //Fallback to generic sampling. @@ -450,7 +450,7 @@ function reallySubSample( referenceFrame, maximumStep, index, - result + result, ); } return index; @@ -463,7 +463,7 @@ function subSample( updateTime, referenceFrame, maximumStep, - result + result, ) { if (!defined(result)) { result = []; @@ -477,7 +477,7 @@ function subSample( referenceFrame, maximumStep, 0, - result + result, ); result.length = length; return result; @@ -496,12 +496,12 @@ PolylineUpdater.prototype.update = function (time) { if (this._referenceFrame === ReferenceFrame.INERTIAL) { const toFixed = Transforms.computeIcrfToCentralBodyFixedMatrix( time, - toFixedScratch + toFixedScratch, ); Matrix4.fromRotationTranslation( toFixed, Cartesian3.ZERO, - this._polylineCollection.modelMatrix + this._polylineCollection.modelMatrix, ); } }; @@ -527,7 +527,7 @@ PolylineUpdater.prototype.updateObject = function (time, item) { const leadTime = Property.getValueOrUndefined(pathGraphics._leadTime, time); const trailTime = Property.getValueOrUndefined( pathGraphics._trailTime, - time + time, ); const availability = entity._availability; const hasAvailability = defined(availability); @@ -594,7 +594,7 @@ PolylineUpdater.prototype.updateObject = function (time, item) { const resolution = Property.getValueOrDefault( pathGraphics._resolution, time, - defaultResolution + defaultResolution, ); polyline.show = true; @@ -605,22 +605,22 @@ PolylineUpdater.prototype.updateObject = function (time, item) { time, this._referenceFrame, resolution, - polyline.positions.slice() + polyline.positions.slice(), ); polyline.material = MaterialProperty.getValue( time, pathGraphics._material, - polyline.material + polyline.material, ); polyline.width = Property.getValueOrDefault( pathGraphics._width, time, - defaultWidth + defaultWidth, ); polyline.distanceDisplayCondition = Property.getValueOrUndefined( pathGraphics._distanceDisplayCondition, time, - polyline.distanceDisplayCondition + polyline.distanceDisplayCondition, ); }; @@ -660,7 +660,7 @@ function PathVisualizer(scene, entityCollection) { entityCollection.collectionChanged.addEventListener( PathVisualizer.prototype._onCollectionChanged, - this + this, ); this._scene = scene; @@ -758,7 +758,7 @@ PathVisualizer.prototype.isDestroyed = function () { PathVisualizer.prototype.destroy = function () { this._entityCollection.collectionChanged.removeEventListener( PathVisualizer.prototype._onCollectionChanged, - this + this, ); const updaters = this._updaters; @@ -775,7 +775,7 @@ PathVisualizer.prototype._onCollectionChanged = function ( entityCollection, added, removed, - changed + changed, ) { let i; let entity; diff --git a/packages/engine/Source/DataSources/PlaneGeometryUpdater.js b/packages/engine/Source/DataSources/PlaneGeometryUpdater.js index b700e57663ab..204face996e1 100644 --- a/packages/engine/Source/DataSources/PlaneGeometryUpdater.js +++ b/packages/engine/Source/DataSources/PlaneGeometryUpdater.js @@ -70,7 +70,7 @@ PlaneGeometryUpdater.prototype.createFillGeometryInstance = function (time) { if (!this._fillEnabled) { throw new DeveloperError( - "This instance does not represent a filled geometry." + "This instance does not represent a filled geometry.", ); } //>>includeEnd('debug'); @@ -85,14 +85,14 @@ PlaneGeometryUpdater.prototype.createFillGeometryInstance = function (time) { isAvailable && entity.isShowing && this._showProperty.getValue(time) && - this._fillProperty.getValue(time) - ); - const distanceDisplayCondition = this._distanceDisplayConditionProperty.getValue( - time - ); - const distanceDisplayConditionAttribute = DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition( - distanceDisplayCondition + this._fillProperty.getValue(time), ); + const distanceDisplayCondition = + this._distanceDisplayConditionProperty.getValue(time); + const distanceDisplayConditionAttribute = + DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition( + distanceDisplayCondition, + ); if (this._materialProperty instanceof ColorMaterialProperty) { let currentColor; if ( @@ -123,12 +123,12 @@ PlaneGeometryUpdater.prototype.createFillGeometryInstance = function (time) { const plane = Property.getValueOrDefault( planeGraphics.plane, time, - options.plane + options.plane, ); const dimensions = Property.getValueOrUndefined( planeGraphics.dimensions, time, - options.dimensions + options.dimensions, ); options.plane = plane; @@ -138,7 +138,7 @@ PlaneGeometryUpdater.prototype.createFillGeometryInstance = function (time) { plane, dimensions, modelMatrix, - modelMatrix + modelMatrix, ); return new GeometryInstance({ @@ -163,7 +163,7 @@ PlaneGeometryUpdater.prototype.createOutlineGeometryInstance = function (time) { if (!this._outlineEnabled) { throw new DeveloperError( - "This instance does not represent an outlined geometry." + "This instance does not represent an outlined geometry.", ); } //>>includeEnd('debug'); @@ -174,11 +174,10 @@ PlaneGeometryUpdater.prototype.createOutlineGeometryInstance = function (time) { this._outlineColorProperty, time, Color.BLACK, - scratchColor - ); - const distanceDisplayCondition = this._distanceDisplayConditionProperty.getValue( - time + scratchColor, ); + const distanceDisplayCondition = + this._distanceDisplayConditionProperty.getValue(time); const planeGraphics = entity.plane; const options = this._options; @@ -186,12 +185,12 @@ PlaneGeometryUpdater.prototype.createOutlineGeometryInstance = function (time) { const plane = Property.getValueOrDefault( planeGraphics.plane, time, - options.plane + options.plane, ); const dimensions = Property.getValueOrUndefined( planeGraphics.dimensions, time, - options.dimensions + options.dimensions, ); options.plane = plane; @@ -201,7 +200,7 @@ PlaneGeometryUpdater.prototype.createOutlineGeometryInstance = function (time) { plane, dimensions, modelMatrix, - modelMatrix + modelMatrix, ); return new GeometryInstance({ @@ -213,12 +212,13 @@ PlaneGeometryUpdater.prototype.createOutlineGeometryInstance = function (time) { isAvailable && entity.isShowing && this._showProperty.getValue(time) && - this._showOutlineProperty.getValue(time) + this._showOutlineProperty.getValue(time), ), color: ColorGeometryInstanceAttribute.fromColor(outlineColor), - distanceDisplayCondition: DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition( - distanceDisplayCondition - ), + distanceDisplayCondition: + DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition( + distanceDisplayCondition, + ), }, }); }; @@ -257,7 +257,7 @@ PlaneGeometryUpdater.prototype._setStaticOptions = function (entity, plane) { options.plane = plane.plane.getValue(Iso8601.MINIMUM_VALUE, options.plane); options.dimensions = plane.dimensions.getValue( Iso8601.MINIMUM_VALUE, - options.dimensions + options.dimensions, ); }; @@ -269,33 +269,34 @@ PlaneGeometryUpdater.DynamicGeometryUpdater = DynamicPlaneGeometryUpdater; function DynamicPlaneGeometryUpdater( geometryUpdater, primitives, - groundPrimitives + groundPrimitives, ) { DynamicGeometryUpdater.call( this, geometryUpdater, primitives, - groundPrimitives + groundPrimitives, ); } if (defined(Object.create)) { DynamicPlaneGeometryUpdater.prototype = Object.create( - DynamicGeometryUpdater.prototype + DynamicGeometryUpdater.prototype, ); - DynamicPlaneGeometryUpdater.prototype.constructor = DynamicPlaneGeometryUpdater; + DynamicPlaneGeometryUpdater.prototype.constructor = + DynamicPlaneGeometryUpdater; } DynamicPlaneGeometryUpdater.prototype._isHidden = function ( entity, plane, - time + time, ) { const options = this._options; const position = Property.getValueOrUndefined( entity.position, time, - positionScratch + positionScratch, ); return ( !defined(position) || @@ -308,14 +309,14 @@ DynamicPlaneGeometryUpdater.prototype._isHidden = function ( DynamicPlaneGeometryUpdater.prototype._setOptions = function ( entity, plane, - time + time, ) { const options = this._options; options.plane = Property.getValueOrDefault(plane.plane, time, options.plane); options.dimensions = Property.getValueOrUndefined( plane.dimensions, time, - options.dimensions + options.dimensions, ); }; @@ -333,7 +334,7 @@ function createPrimitiveMatrix(plane, dimensions, transform, result) { const translation = Cartesian3.multiplyByScalar( normal, -distance, - scratchTranslation + scratchTranslation, ); let up = Cartesian3.clone(Cartesian3.UNIT_Z, scratchUp); @@ -341,7 +342,7 @@ function createPrimitiveMatrix(plane, dimensions, transform, result) { CesiumMath.equalsEpsilon( Math.abs(Cartesian3.dot(up, normal)), 1.0, - CesiumMath.EPSILON8 + CesiumMath.EPSILON8, ) ) { up = Cartesian3.clone(Cartesian3.UNIT_Y, up); @@ -361,18 +362,18 @@ function createPrimitiveMatrix(plane, dimensions, transform, result) { dimensions.x, dimensions.y, 1.0, - scratchScale + scratchScale, ); const rotationScaleMatrix = Matrix3.multiplyByScale( rotationMatrix, scale, - scratchRotationScale + scratchRotationScale, ); const localTransform = Matrix4.fromRotationTranslation( rotationScaleMatrix, translation, - scratchLocalTransform + scratchLocalTransform, ); return Matrix4.multiplyTransformation(transform, localTransform, result); } diff --git a/packages/engine/Source/DataSources/PlaneGraphics.js b/packages/engine/Source/DataSources/PlaneGraphics.js index 519ff7d449f1..bf938525c17e 100644 --- a/packages/engine/Source/DataSources/PlaneGraphics.js +++ b/packages/engine/Source/DataSources/PlaneGraphics.js @@ -153,7 +153,7 @@ Object.defineProperties(PlaneGraphics.prototype, { * @type {Property|undefined} */ distanceDisplayCondition: createPropertyDescriptor( - "distanceDisplayCondition" + "distanceDisplayCondition", ), }); @@ -204,7 +204,7 @@ PlaneGraphics.prototype.merge = function (source) { this.shadows = defaultValue(this.shadows, source.shadows); this.distanceDisplayCondition = defaultValue( this.distanceDisplayCondition, - source.distanceDisplayCondition + source.distanceDisplayCondition, ); }; export default PlaneGraphics; diff --git a/packages/engine/Source/DataSources/PointGraphics.js b/packages/engine/Source/DataSources/PointGraphics.js index 87cacbeb827f..1a38dabfac98 100644 --- a/packages/engine/Source/DataSources/PointGraphics.js +++ b/packages/engine/Source/DataSources/PointGraphics.js @@ -145,7 +145,7 @@ Object.defineProperties(PointGraphics.prototype, { * @type {Property|undefined} */ distanceDisplayCondition: createPropertyDescriptor( - "distanceDisplayCondition" + "distanceDisplayCondition", ), /** @@ -155,7 +155,7 @@ Object.defineProperties(PointGraphics.prototype, { * @type {Property|undefined} */ disableDepthTestDistance: createPropertyDescriptor( - "disableDepthTestDistance" + "disableDepthTestDistance", ), /** @@ -208,31 +208,31 @@ PointGraphics.prototype.merge = function (source) { this.pixelSize = defaultValue(this.pixelSize, source.pixelSize); this.heightReference = defaultValue( this.heightReference, - source.heightReference + source.heightReference, ); this.color = defaultValue(this.color, source.color); this.outlineColor = defaultValue(this.outlineColor, source.outlineColor); this.outlineWidth = defaultValue(this.outlineWidth, source.outlineWidth); this.scaleByDistance = defaultValue( this.scaleByDistance, - source.scaleByDistance + source.scaleByDistance, ); this.translucencyByDistance = defaultValue( this._translucencyByDistance, - source.translucencyByDistance + source.translucencyByDistance, ); this.distanceDisplayCondition = defaultValue( this.distanceDisplayCondition, - source.distanceDisplayCondition + source.distanceDisplayCondition, ); this.disableDepthTestDistance = defaultValue( this.disableDepthTestDistance, - source.disableDepthTestDistance + source.disableDepthTestDistance, ); this.splitDirection = defaultValue( this.splitDirection, - source.splitDirection + source.splitDirection, ); }; export default PointGraphics; diff --git a/packages/engine/Source/DataSources/PointVisualizer.js b/packages/engine/Source/DataSources/PointVisualizer.js index 0fe2f9f00c81..26b5404fca8e 100644 --- a/packages/engine/Source/DataSources/PointVisualizer.js +++ b/packages/engine/Source/DataSources/PointVisualizer.js @@ -56,7 +56,7 @@ function PointVisualizer(entityCluster, entityCollection) { entityCollection.collectionChanged.addEventListener( PointVisualizer.prototype._onCollectionChanged, - this + this, ); this._cluster = entityCluster; @@ -90,7 +90,7 @@ PointVisualizer.prototype.update = function (time) { const heightReference = Property.getValueOrDefault( pointGraphics._heightReference, time, - HeightReference.NONE + HeightReference.NONE, ); let show = entity.isShowing && @@ -101,7 +101,7 @@ PointVisualizer.prototype.update = function (time) { position = Property.getValueOrUndefined( entity._position, time, - positionScratch + positionScratch, ); show = defined(position); } @@ -155,49 +155,49 @@ PointVisualizer.prototype.update = function (time) { pointPrimitive.scaleByDistance = Property.getValueOrUndefined( pointGraphics._scaleByDistance, time, - scaleByDistanceScratch + scaleByDistanceScratch, ); pointPrimitive.translucencyByDistance = Property.getValueOrUndefined( pointGraphics._translucencyByDistance, time, - translucencyByDistanceScratch + translucencyByDistanceScratch, ); pointPrimitive.color = Property.getValueOrDefault( pointGraphics._color, time, defaultColor, - colorScratch + colorScratch, ); pointPrimitive.outlineColor = Property.getValueOrDefault( pointGraphics._outlineColor, time, defaultOutlineColor, - outlineColorScratch + outlineColorScratch, ); pointPrimitive.outlineWidth = Property.getValueOrDefault( pointGraphics._outlineWidth, time, - defaultOutlineWidth + defaultOutlineWidth, ); pointPrimitive.pixelSize = Property.getValueOrDefault( pointGraphics._pixelSize, time, - defaultPixelSize + defaultPixelSize, ); pointPrimitive.distanceDisplayCondition = Property.getValueOrUndefined( pointGraphics._distanceDisplayCondition, time, - distanceDisplayConditionScratch + distanceDisplayConditionScratch, ); pointPrimitive.disableDepthTestDistance = Property.getValueOrDefault( pointGraphics._disableDepthTestDistance, time, - defaultDisableDepthTestDistance + defaultDisableDepthTestDistance, ); pointPrimitive.splitDirection = Property.getValueOrDefault( pointGraphics._splitDirection, time, - defaultSplitDirection + defaultSplitDirection, ); } else if (defined(billboard)) { billboard.show = true; @@ -205,27 +205,27 @@ PointVisualizer.prototype.update = function (time) { billboard.scaleByDistance = Property.getValueOrUndefined( pointGraphics._scaleByDistance, time, - scaleByDistanceScratch + scaleByDistanceScratch, ); billboard.translucencyByDistance = Property.getValueOrUndefined( pointGraphics._translucencyByDistance, time, - translucencyByDistanceScratch + translucencyByDistanceScratch, ); billboard.distanceDisplayCondition = Property.getValueOrUndefined( pointGraphics._distanceDisplayCondition, time, - distanceDisplayConditionScratch + distanceDisplayConditionScratch, ); billboard.disableDepthTestDistance = Property.getValueOrDefault( pointGraphics._disableDepthTestDistance, time, - defaultDisableDepthTestDistance + defaultDisableDepthTestDistance, ); billboard.splitDirection = Property.getValueOrDefault( pointGraphics._splitDirection, time, - defaultSplitDirection + defaultSplitDirection, ); billboard.heightReference = heightReference; @@ -233,20 +233,20 @@ PointVisualizer.prototype.update = function (time) { pointGraphics._color, time, defaultColor, - colorScratch + colorScratch, ); const newOutlineColor = Property.getValueOrDefault( pointGraphics._outlineColor, time, defaultOutlineColor, - outlineColorScratch + outlineColorScratch, ); const newOutlineWidth = Math.round( Property.getValueOrDefault( pointGraphics._outlineWidth, time, - defaultOutlineWidth - ) + defaultOutlineWidth, + ), ); let newPixelSize = Math.max( 1, @@ -254,9 +254,9 @@ PointVisualizer.prototype.update = function (time) { Property.getValueOrDefault( pointGraphics._pixelSize, time, - defaultPixelSize - ) - ) + defaultPixelSize, + ), + ), ); if (newOutlineWidth > 0) { @@ -300,8 +300,8 @@ PointVisualizer.prototype.update = function (time) { cssColor, cssOutlineColor, newOutlineWidth, - newPixelSize - ) + newPixelSize, + ), ); } @@ -345,7 +345,7 @@ PointVisualizer.prototype.getBoundingSphere = function (entity, result) { if (defined(item.pointPrimitive)) { result.center = Cartesian3.clone( item.pointPrimitive.position, - result.center + result.center, ); } else { const billboard = item.billboard; @@ -374,7 +374,7 @@ PointVisualizer.prototype.isDestroyed = function () { PointVisualizer.prototype.destroy = function () { this._entityCollection.collectionChanged.removeEventListener( PointVisualizer.prototype._onCollectionChanged, - this + this, ); const entities = this._entityCollection.values; for (let i = 0; i < entities.length; i++) { @@ -387,7 +387,7 @@ PointVisualizer.prototype._onCollectionChanged = function ( entityCollection, added, removed, - changed + changed, ) { let i; let entity; diff --git a/packages/engine/Source/DataSources/PolygonGeometryUpdater.js b/packages/engine/Source/DataSources/PolygonGeometryUpdater.js index 117c662f6577..72899f1672ac 100644 --- a/packages/engine/Source/DataSources/PolygonGeometryUpdater.js +++ b/packages/engine/Source/DataSources/PolygonGeometryUpdater.js @@ -79,7 +79,7 @@ function PolygonGeometryUpdater(entity, scene) { if (defined(Object.create)) { PolygonGeometryUpdater.prototype = Object.create( - GroundGeometryUpdater.prototype + GroundGeometryUpdater.prototype, ); PolygonGeometryUpdater.prototype.constructor = PolygonGeometryUpdater; } @@ -98,7 +98,7 @@ PolygonGeometryUpdater.prototype.createFillGeometryInstance = function (time) { if (!this._fillEnabled) { throw new DeveloperError( - "This instance does not represent a filled geometry." + "This instance does not represent a filled geometry.", ); } //>>includeEnd('debug'); @@ -112,11 +112,12 @@ PolygonGeometryUpdater.prototype.createFillGeometryInstance = function (time) { isAvailable && entity.isShowing && this._showProperty.getValue(time) && - this._fillProperty.getValue(time) - ), - distanceDisplayCondition: DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition( - this._distanceDisplayConditionProperty.getValue(time) + this._fillProperty.getValue(time), ), + distanceDisplayCondition: + DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition( + this._distanceDisplayConditionProperty.getValue(time), + ), offset: undefined, color: undefined, }; @@ -140,8 +141,8 @@ PolygonGeometryUpdater.prototype.createFillGeometryInstance = function (time) { this._terrainOffsetProperty, time, defaultOffset, - offsetScratch - ) + offsetScratch, + ), ); } @@ -168,14 +169,14 @@ PolygonGeometryUpdater.prototype.createFillGeometryInstance = function (time) { * @exception {DeveloperError} This instance does not represent an outlined geometry. */ PolygonGeometryUpdater.prototype.createOutlineGeometryInstance = function ( - time + time, ) { //>>includeStart('debug', pragmas.debug); Check.defined("time", time); if (!this._outlineEnabled) { throw new DeveloperError( - "This instance does not represent an outlined geometry." + "This instance does not represent an outlined geometry.", ); } //>>includeEnd('debug'); @@ -187,23 +188,23 @@ PolygonGeometryUpdater.prototype.createOutlineGeometryInstance = function ( this._outlineColorProperty, time, Color.BLACK, - scratchColor - ); - const distanceDisplayCondition = this._distanceDisplayConditionProperty.getValue( - time + scratchColor, ); + const distanceDisplayCondition = + this._distanceDisplayConditionProperty.getValue(time); const attributes = { show: new ShowGeometryInstanceAttribute( isAvailable && entity.isShowing && this._showProperty.getValue(time) && - this._showOutlineProperty.getValue(time) + this._showOutlineProperty.getValue(time), ), color: ColorGeometryInstanceAttribute.fromColor(outlineColor), - distanceDisplayCondition: DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition( - distanceDisplayCondition - ), + distanceDisplayCondition: + DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition( + distanceDisplayCondition, + ), offset: undefined, }; @@ -213,8 +214,8 @@ PolygonGeometryUpdater.prototype.createOutlineGeometryInstance = function ( this._terrainOffsetProperty, time, defaultOffset, - offsetScratch - ) + offsetScratch, + ), ); } @@ -234,7 +235,7 @@ PolygonGeometryUpdater.prototype.createOutlineGeometryInstance = function ( PolygonGeometryUpdater.prototype._computeCenter = function (time, result) { const hierarchy = Property.getValueOrUndefined( this._entity.polygon.hierarchy, - time + time, ); if (!defined(hierarchy)) { return; @@ -248,7 +249,7 @@ PolygonGeometryUpdater.prototype._computeCenter = function (time, result) { const tangentPlane = EllipsoidTangentPlane.fromPoints(positions, ellipsoid); const positions2D = tangentPlane.projectPointsOntoPlane( positions, - scratch2DPositions + scratch2DPositions, ); const length = positions2D.length; @@ -283,7 +284,7 @@ PolygonGeometryUpdater.prototype._isOnTerrain = function (entity, polygon) { const onTerrain = GroundGeometryUpdater.prototype._isOnTerrain.call( this, entity, - polygon + polygon, ); const perPositionHeightProperty = polygon.perPositionHeight; const perPositionHeightEnabled = @@ -316,7 +317,7 @@ PolygonGeometryUpdater.prototype._isDynamic = function (entity, polygon) { PolygonGeometryUpdater.prototype._setStaticOptions = function ( entity, - polygon + polygon, ) { const isColorMaterial = this._materialProperty instanceof ColorMaterialProperty; @@ -329,31 +330,31 @@ PolygonGeometryUpdater.prototype._setStaticOptions = function ( const hierarchyValue = polygon.hierarchy.getValue(Iso8601.MINIMUM_VALUE); let heightValue = Property.getValueOrUndefined( polygon.height, - Iso8601.MINIMUM_VALUE + Iso8601.MINIMUM_VALUE, ); const heightReferenceValue = Property.getValueOrDefault( polygon.heightReference, Iso8601.MINIMUM_VALUE, - HeightReference.NONE + HeightReference.NONE, ); let extrudedHeightValue = Property.getValueOrUndefined( polygon.extrudedHeight, - Iso8601.MINIMUM_VALUE + Iso8601.MINIMUM_VALUE, ); const extrudedHeightReferenceValue = Property.getValueOrDefault( polygon.extrudedHeightReference, Iso8601.MINIMUM_VALUE, - HeightReference.NONE + HeightReference.NONE, ); const perPositionHeightValue = Property.getValueOrDefault( polygon.perPositionHeight, Iso8601.MINIMUM_VALUE, - false + false, ); heightValue = GroundGeometryUpdater.getGeometryHeight( heightValue, - heightReferenceValue + heightReferenceValue, ); let offsetAttribute; @@ -377,56 +378,57 @@ PolygonGeometryUpdater.prototype._setStaticOptions = function ( heightValue, heightReferenceValue, extrudedHeightValue, - extrudedHeightReferenceValue + extrudedHeightReferenceValue, ); } options.polygonHierarchy = hierarchyValue; options.granularity = Property.getValueOrUndefined( polygon.granularity, - Iso8601.MINIMUM_VALUE + Iso8601.MINIMUM_VALUE, ); options.stRotation = Property.getValueOrUndefined( polygon.stRotation, - Iso8601.MINIMUM_VALUE + Iso8601.MINIMUM_VALUE, ); options.perPositionHeight = perPositionHeightValue; options.closeTop = Property.getValueOrDefault( polygon.closeTop, Iso8601.MINIMUM_VALUE, - true + true, ); options.closeBottom = Property.getValueOrDefault( polygon.closeBottom, Iso8601.MINIMUM_VALUE, - true + true, ); options.offsetAttribute = offsetAttribute; options.height = heightValue; options.arcType = Property.getValueOrDefault( polygon.arcType, Iso8601.MINIMUM_VALUE, - ArcType.GEODESIC + ArcType.GEODESIC, ); options.textureCoordinates = Property.getValueOrUndefined( polygon.textureCoordinates, - Iso8601.MINIMUM_VALUE + Iso8601.MINIMUM_VALUE, ); extrudedHeightValue = GroundGeometryUpdater.getGeometryExtrudedHeight( extrudedHeightValue, - extrudedHeightReferenceValue + extrudedHeightReferenceValue, ); if (extrudedHeightValue === GroundGeometryUpdater.CLAMP_TO_GROUND) { const rectangle = PolygonGeometry.computeRectangleFromPositions( options.polygonHierarchy.positions, options.ellipsoid, options.arcType, - scratchRectangle + scratchRectangle, ); - extrudedHeightValue = ApproximateTerrainHeights.getMinimumMaximumHeights( - rectangle - ).minimumTerrainHeight; + extrudedHeightValue = + ApproximateTerrainHeights.getMinimumMaximumHeights( + rectangle, + ).minimumTerrainHeight; } options.extrudedHeight = extrudedHeightValue; @@ -451,27 +453,28 @@ PolygonGeometryUpdater.DynamicGeometryUpdater = DyanmicPolygonGeometryUpdater; function DyanmicPolygonGeometryUpdater( geometryUpdater, primitives, - groundPrimitives + groundPrimitives, ) { DynamicGeometryUpdater.call( this, geometryUpdater, primitives, - groundPrimitives + groundPrimitives, ); } if (defined(Object.create)) { DyanmicPolygonGeometryUpdater.prototype = Object.create( - DynamicGeometryUpdater.prototype + DynamicGeometryUpdater.prototype, ); - DyanmicPolygonGeometryUpdater.prototype.constructor = DyanmicPolygonGeometryUpdater; + DyanmicPolygonGeometryUpdater.prototype.constructor = + DyanmicPolygonGeometryUpdater; } DyanmicPolygonGeometryUpdater.prototype._isHidden = function ( entity, polygon, - time + time, ) { return ( !defined(this._options.polygonHierarchy) || @@ -482,38 +485,38 @@ DyanmicPolygonGeometryUpdater.prototype._isHidden = function ( DyanmicPolygonGeometryUpdater.prototype._setOptions = function ( entity, polygon, - time + time, ) { const options = this._options; options.polygonHierarchy = Property.getValueOrUndefined( polygon.hierarchy, - time + time, ); let heightValue = Property.getValueOrUndefined(polygon.height, time); const heightReferenceValue = Property.getValueOrDefault( polygon.heightReference, time, - HeightReference.NONE + HeightReference.NONE, ); const extrudedHeightReferenceValue = Property.getValueOrDefault( polygon.extrudedHeightReference, time, - HeightReference.NONE + HeightReference.NONE, ); let extrudedHeightValue = Property.getValueOrUndefined( polygon.extrudedHeight, - time + time, ); const perPositionHeightValue = Property.getValueOrUndefined( polygon.perPositionHeight, - time + time, ); heightValue = GroundGeometryUpdater.getGeometryHeight( heightValue, - extrudedHeightReferenceValue + extrudedHeightReferenceValue, ); let offsetAttribute; @@ -538,7 +541,7 @@ DyanmicPolygonGeometryUpdater.prototype._setOptions = function ( heightValue, heightReferenceValue, extrudedHeightValue, - extrudedHeightReferenceValue + extrudedHeightReferenceValue, ); } @@ -546,40 +549,41 @@ DyanmicPolygonGeometryUpdater.prototype._setOptions = function ( options.stRotation = Property.getValueOrUndefined(polygon.stRotation, time); options.textureCoordinates = Property.getValueOrUndefined( polygon.textureCoordinates, - time + time, ); options.perPositionHeight = Property.getValueOrUndefined( polygon.perPositionHeight, - time + time, ); options.closeTop = Property.getValueOrDefault(polygon.closeTop, time, true); options.closeBottom = Property.getValueOrDefault( polygon.closeBottom, time, - true + true, ); options.offsetAttribute = offsetAttribute; options.height = heightValue; options.arcType = Property.getValueOrDefault( polygon.arcType, time, - ArcType.GEODESIC + ArcType.GEODESIC, ); extrudedHeightValue = GroundGeometryUpdater.getGeometryExtrudedHeight( extrudedHeightValue, - extrudedHeightReferenceValue + extrudedHeightReferenceValue, ); if (extrudedHeightValue === GroundGeometryUpdater.CLAMP_TO_GROUND) { const rectangle = PolygonGeometry.computeRectangleFromPositions( options.polygonHierarchy.positions, options.ellipsoid, options.arcType, - scratchRectangle + scratchRectangle, ); - extrudedHeightValue = ApproximateTerrainHeights.getMinimumMaximumHeights( - rectangle - ).minimumTerrainHeight; + extrudedHeightValue = + ApproximateTerrainHeights.getMinimumMaximumHeights( + rectangle, + ).minimumTerrainHeight; } options.extrudedHeight = extrudedHeightValue; diff --git a/packages/engine/Source/DataSources/PolygonGraphics.js b/packages/engine/Source/DataSources/PolygonGraphics.js index 8e45da5edd5c..d6897a82810a 100644 --- a/packages/engine/Source/DataSources/PolygonGraphics.js +++ b/packages/engine/Source/DataSources/PolygonGraphics.js @@ -137,7 +137,7 @@ Object.defineProperties(PolygonGraphics.prototype, { hierarchy: createPropertyDescriptor( "hierarchy", undefined, - createPolygonHierarchyProperty + createPolygonHierarchyProperty, ), /** @@ -278,7 +278,7 @@ Object.defineProperties(PolygonGraphics.prototype, { * @type {Property|undefined} */ distanceDisplayCondition: createPropertyDescriptor( - "distanceDisplayCondition" + "distanceDisplayCondition", ), /** @@ -358,15 +358,15 @@ PolygonGraphics.prototype.merge = function (source) { this.height = defaultValue(this.height, source.height); this.heightReference = defaultValue( this.heightReference, - source.heightReference + source.heightReference, ); this.extrudedHeight = defaultValue( this.extrudedHeight, - source.extrudedHeight + source.extrudedHeight, ); this.extrudedHeightReference = defaultValue( this.extrudedHeightReference, - source.extrudedHeightReference + source.extrudedHeightReference, ); this.stRotation = defaultValue(this.stRotation, source.stRotation); this.granularity = defaultValue(this.granularity, source.granularity); @@ -377,7 +377,7 @@ PolygonGraphics.prototype.merge = function (source) { this.outlineWidth = defaultValue(this.outlineWidth, source.outlineWidth); this.perPositionHeight = defaultValue( this.perPositionHeight, - source.perPositionHeight + source.perPositionHeight, ); this.closeTop = defaultValue(this.closeTop, source.closeTop); this.closeBottom = defaultValue(this.closeBottom, source.closeBottom); @@ -385,16 +385,16 @@ PolygonGraphics.prototype.merge = function (source) { this.shadows = defaultValue(this.shadows, source.shadows); this.distanceDisplayCondition = defaultValue( this.distanceDisplayCondition, - source.distanceDisplayCondition + source.distanceDisplayCondition, ); this.classificationType = defaultValue( this.classificationType, - source.classificationType + source.classificationType, ); this.zIndex = defaultValue(this.zIndex, source.zIndex); this.textureCoordinates = defaultValue( this.textureCoordinates, - source.textureCoordinates + source.textureCoordinates, ); }; export default PolygonGraphics; diff --git a/packages/engine/Source/DataSources/PolylineArrowMaterialProperty.js b/packages/engine/Source/DataSources/PolylineArrowMaterialProperty.js index 0550b9f46992..9f203546db9a 100644 --- a/packages/engine/Source/DataSources/PolylineArrowMaterialProperty.js +++ b/packages/engine/Source/DataSources/PolylineArrowMaterialProperty.js @@ -88,7 +88,7 @@ PolylineArrowMaterialProperty.prototype.getValue = function (time, result) { this._color, time, Color.WHITE, - result.color + result.color, ); return result; }; diff --git a/packages/engine/Source/DataSources/PolylineDashMaterialProperty.js b/packages/engine/Source/DataSources/PolylineDashMaterialProperty.js index 3335017ba128..f724520f22fc 100644 --- a/packages/engine/Source/DataSources/PolylineDashMaterialProperty.js +++ b/packages/engine/Source/DataSources/PolylineDashMaterialProperty.js @@ -131,25 +131,25 @@ PolylineDashMaterialProperty.prototype.getValue = function (time, result) { this._color, time, defaultColor, - result.color + result.color, ); result.gapColor = Property.getValueOrClonedDefault( this._gapColor, time, defaultGapColor, - result.gapColor + result.gapColor, ); result.dashLength = Property.getValueOrDefault( this._dashLength, time, defaultDashLength, - result.dashLength + result.dashLength, ); result.dashPattern = Property.getValueOrDefault( this._dashPattern, time, defaultDashPattern, - result.dashPattern + result.dashPattern, ); return result; }; diff --git a/packages/engine/Source/DataSources/PolylineGeometryUpdater.js b/packages/engine/Source/DataSources/PolylineGeometryUpdater.js index e70b4583e483..8776e44ada01 100644 --- a/packages/engine/Source/DataSources/PolylineGeometryUpdater.js +++ b/packages/engine/Source/DataSources/PolylineGeometryUpdater.js @@ -40,7 +40,7 @@ const defaultMaterial = new ColorMaterialProperty(Color.WHITE); const defaultShow = new ConstantProperty(true); const defaultShadows = new ConstantProperty(ShadowMode.DISABLED); const defaultDistanceDisplayCondition = new ConstantProperty( - new DistanceDisplayCondition() + new DistanceDisplayCondition(), ); const defaultClassificationType = new ConstantProperty(ClassificationType.BOTH); @@ -82,7 +82,7 @@ function PolylineGeometryUpdater(entity, scene) { this._scene = scene; this._entitySubscription = entity.definitionChanged.addEventListener( PolylineGeometryUpdater.prototype._onEntityPropertyChanged, - this + this, ); this._fillEnabled = false; this._dynamic = false; @@ -366,7 +366,7 @@ PolylineGeometryUpdater.prototype.createFillGeometryInstance = function (time) { if (!this._fillEnabled) { throw new DeveloperError( - "This instance does not represent a filled geometry." + "This instance does not represent a filled geometry.", ); } //>>includeEnd('debug'); @@ -374,14 +374,14 @@ PolylineGeometryUpdater.prototype.createFillGeometryInstance = function (time) { const entity = this._entity; const isAvailable = entity.isAvailable(time); const show = new ShowGeometryInstanceAttribute( - isAvailable && entity.isShowing && this._showProperty.getValue(time) - ); - const distanceDisplayCondition = this._distanceDisplayConditionProperty.getValue( - time - ); - const distanceDisplayConditionAttribute = DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition( - distanceDisplayCondition + isAvailable && entity.isShowing && this._showProperty.getValue(time), ); + const distanceDisplayCondition = + this._distanceDisplayConditionProperty.getValue(time); + const distanceDisplayConditionAttribute = + DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition( + distanceDisplayCondition, + ); const attributes = { show: show, @@ -420,15 +420,14 @@ PolylineGeometryUpdater.prototype.createFillGeometryInstance = function (time) { ) { currentColor = this._depthFailMaterialProperty.color.getValue( time, - scratchColor + scratchColor, ); } if (!defined(currentColor)) { currentColor = Color.WHITE; } - attributes.depthFailColor = ColorGeometryInstanceAttribute.fromColor( - currentColor - ); + attributes.depthFailColor = + ColorGeometryInstanceAttribute.fromColor(currentColor); } return new GeometryInstance({ @@ -447,11 +446,11 @@ PolylineGeometryUpdater.prototype.createFillGeometryInstance = function (time) { * @exception {DeveloperError} This instance does not represent an outlined geometry. */ PolylineGeometryUpdater.prototype.createOutlineGeometryInstance = function ( - time + time, ) { //>>includeStart('debug', pragmas.debug); throw new DeveloperError( - "This instance does not represent an outlined geometry." + "This instance does not represent an outlined geometry.", ); //>>includeEnd('debug'); }; @@ -479,7 +478,7 @@ PolylineGeometryUpdater.prototype._onEntityPropertyChanged = function ( entity, propertyName, newValue, - oldValue + oldValue, ) { if (!(propertyName === "availability" || propertyName === "polyline")) { return; @@ -520,11 +519,11 @@ PolylineGeometryUpdater.prototype._onEntityPropertyChanged = function ( this._shadowsProperty = defaultValue(polyline.shadows, defaultShadows); this._distanceDisplayConditionProperty = defaultValue( polyline.distanceDisplayCondition, - defaultDistanceDisplayCondition + defaultDistanceDisplayCondition, ); this._classificationTypeProperty = defaultValue( polyline.classificationType, - defaultClassificationType + defaultClassificationType, ); this._fillEnabled = true; this._zIndex = defaultValue(zIndex, defaultZIndex); @@ -550,7 +549,7 @@ PolylineGeometryUpdater.prototype._onEntityPropertyChanged = function ( const geometryOptions = this._geometryOptions; const positions = positionsProperty.getValue( Iso8601.MINIMUM_VALUE, - geometryOptions.positions + geometryOptions.positions, ); //Because of the way we currently handle reference properties, @@ -598,7 +597,7 @@ PolylineGeometryUpdater.prototype._onEntityPropertyChanged = function ( if (!this._clampToGround && defined(zIndex)) { oneTimeWarning( - "Entity polylines must have clampToGround: true when using zIndex. zIndex will be ignored." + "Entity polylines must have clampToGround: true when using zIndex. zIndex will be ignored.", ); } @@ -619,7 +618,7 @@ PolylineGeometryUpdater.prototype._onEntityPropertyChanged = function ( */ PolylineGeometryUpdater.prototype.createDynamicUpdater = function ( primitives, - groundPrimitives + groundPrimitives, ) { //>>includeStart('debug', pragmas.debug); Check.defined("primitives", primitives); @@ -627,7 +626,7 @@ PolylineGeometryUpdater.prototype.createDynamicUpdater = function ( if (!this._dynamic) { throw new DeveloperError( - "This instance does not represent dynamic geometry." + "This instance does not represent dynamic geometry.", ); } //>>includeEnd('debug'); @@ -687,31 +686,28 @@ DynamicGeometryUpdater.prototype.update = function (time) { let positions = Property.getValueOrUndefined( positionsProperty, time, - this._positions + this._positions, ); // Synchronize with geometryUpdater for GroundPolylinePrimitive geometryUpdater._clampToGround = Property.getValueOrDefault( polyline._clampToGround, time, - false + false, ); geometryUpdater._groundGeometryOptions.positions = positions; geometryUpdater._groundGeometryOptions.width = Property.getValueOrDefault( polyline._width, time, - 1 + 1, ); geometryUpdater._groundGeometryOptions.arcType = Property.getValueOrDefault( polyline._arcType, time, - ArcType.GEODESIC - ); - geometryUpdater._groundGeometryOptions.granularity = Property.getValueOrDefault( - polyline._granularity, - time, - 9999 + ArcType.GEODESIC, ); + geometryUpdater._groundGeometryOptions.granularity = + Property.getValueOrDefault(polyline._granularity, time, 9999); const groundPrimitives = this._groundPrimitives; @@ -741,7 +737,7 @@ DynamicGeometryUpdater.prototype.update = function (time) { const material = MaterialProperty.getValue( time, fillMaterialProperty, - this._material + this._material, ); appearance = new PolylineMaterialAppearance({ material: material, @@ -754,12 +750,11 @@ DynamicGeometryUpdater.prototype.update = function (time) { new GroundPolylinePrimitive({ geometryInstances: geometryUpdater.createFillGeometryInstance(time), appearance: appearance, - classificationType: geometryUpdater.classificationTypeProperty.getValue( - time - ), + classificationType: + geometryUpdater.classificationTypeProperty.getValue(time), asynchronous: false, }), - Property.getValueOrUndefined(geometryUpdater.zIndex, time) + Property.getValueOrUndefined(geometryUpdater.zIndex, time), ); // Hide the polyline in the collection, if any @@ -795,19 +790,19 @@ DynamicGeometryUpdater.prototype.update = function (time) { generateCartesianArcOptions.positions = positions; generateCartesianArcOptions.granularity = Property.getValueOrUndefined( polyline._granularity, - time + time, ); generateCartesianArcOptions.height = PolylinePipeline.extractHeights( positions, - ellipsoid + ellipsoid, ); if (arcType === ArcType.GEODESIC) { positions = PolylinePipeline.generateCartesianArc( - generateCartesianArcOptions + generateCartesianArcOptions, ); } else { positions = PolylinePipeline.generateCartesianRhumbArc( - generateCartesianArcOptions + generateCartesianArcOptions, ); } } @@ -817,13 +812,13 @@ DynamicGeometryUpdater.prototype.update = function (time) { line.material = MaterialProperty.getValue( time, geometryUpdater.fillMaterialProperty, - line.material + line.material, ); line.width = Property.getValueOrDefault(polyline._width, time, 1); line.distanceDisplayCondition = Property.getValueOrUndefined( polyline._distanceDisplayCondition, time, - line.distanceDisplayCondition + line.distanceDisplayCondition, ); }; @@ -846,7 +841,7 @@ DynamicGeometryUpdater.prototype.getBoundingSphere = function (result) { groundPolylinePrimitive.ready ) { const attributes = groundPolylinePrimitive.getGeometryInstanceAttributes( - this._geometryUpdater._entity + this._geometryUpdater._entity, ); if (defined(attributes) && defined(attributes.boundingSphere)) { BoundingSphere.clone(attributes.boundingSphere, result); diff --git a/packages/engine/Source/DataSources/PolylineGlowMaterialProperty.js b/packages/engine/Source/DataSources/PolylineGlowMaterialProperty.js index 50b5c2db007a..7cdb799d6f23 100644 --- a/packages/engine/Source/DataSources/PolylineGlowMaterialProperty.js +++ b/packages/engine/Source/DataSources/PolylineGlowMaterialProperty.js @@ -116,19 +116,19 @@ PolylineGlowMaterialProperty.prototype.getValue = function (time, result) { this._color, time, defaultColor, - result.color + result.color, ); result.glowPower = Property.getValueOrDefault( this._glowPower, time, defaultGlowPower, - result.glowPower + result.glowPower, ); result.taperPower = Property.getValueOrDefault( this._taperPower, time, defaultTaperPower, - result.taperPower + result.taperPower, ); return result; }; diff --git a/packages/engine/Source/DataSources/PolylineGraphics.js b/packages/engine/Source/DataSources/PolylineGraphics.js index 68c00789e036..dccb69badc04 100644 --- a/packages/engine/Source/DataSources/PolylineGraphics.js +++ b/packages/engine/Source/DataSources/PolylineGraphics.js @@ -165,7 +165,7 @@ Object.defineProperties(PolylineGraphics.prototype, { * @type {Property|undefined} */ distanceDisplayCondition: createPropertyDescriptor( - "distanceDisplayCondition" + "distanceDisplayCondition", ), /** @@ -230,18 +230,18 @@ PolylineGraphics.prototype.merge = function (source) { this.material = defaultValue(this.material, source.material); this.depthFailMaterial = defaultValue( this.depthFailMaterial, - source.depthFailMaterial + source.depthFailMaterial, ); this.arcType = defaultValue(this.arcType, source.arcType); this.clampToGround = defaultValue(this.clampToGround, source.clampToGround); this.shadows = defaultValue(this.shadows, source.shadows); this.distanceDisplayCondition = defaultValue( this.distanceDisplayCondition, - source.distanceDisplayCondition + source.distanceDisplayCondition, ); this.classificationType = defaultValue( this.classificationType, - source.classificationType + source.classificationType, ); this.zIndex = defaultValue(this.zIndex, source.zIndex); }; diff --git a/packages/engine/Source/DataSources/PolylineOutlineMaterialProperty.js b/packages/engine/Source/DataSources/PolylineOutlineMaterialProperty.js index bb13942d3736..8ca6563a6049 100644 --- a/packages/engine/Source/DataSources/PolylineOutlineMaterialProperty.js +++ b/packages/engine/Source/DataSources/PolylineOutlineMaterialProperty.js @@ -123,18 +123,18 @@ PolylineOutlineMaterialProperty.prototype.getValue = function (time, result) { this._color, time, defaultColor, - result.color + result.color, ); result.outlineColor = Property.getValueOrClonedDefault( this._outlineColor, time, defaultOutlineColor, - result.outlineColor + result.outlineColor, ); result.outlineWidth = Property.getValueOrDefault( this._outlineWidth, time, - defaultOutlineWidth + defaultOutlineWidth, ); return result; }; diff --git a/packages/engine/Source/DataSources/PolylineVisualizer.js b/packages/engine/Source/DataSources/PolylineVisualizer.js index a30fb2fad7be..8cf4745b0f73 100644 --- a/packages/engine/Source/DataSources/PolylineVisualizer.js +++ b/packages/engine/Source/DataSources/PolylineVisualizer.js @@ -35,9 +35,8 @@ function insertUpdaterIntoBatch(that, time, updater) { if (updater.clampToGround && updater.fillEnabled) { // Also checks for support - const classificationType = updater.classificationTypeProperty.getValue( - time - ); + const classificationType = + updater.classificationTypeProperty.getValue(time); that._groundBatches[classificationType].add(time, updater); return; } @@ -83,7 +82,7 @@ function PolylineVisualizer( scene, entityCollection, primitives, - groundPrimitives + groundPrimitives, ) { //>>includeStart('debug', pragmas.debug); Check.defined("scene", scene); @@ -111,14 +110,14 @@ function PolylineVisualizer( PolylineColorAppearance, undefined, false, - i + i, ); // no depth fail appearance this._materialBatches[i] = new StaticGeometryPerMaterialBatch( primitives, PolylineMaterialAppearance, undefined, false, - i + i, ); this._colorBatches[i + numberOfShadowModes] = new StaticGeometryColorBatch( @@ -126,36 +125,33 @@ function PolylineVisualizer( PolylineColorAppearance, PolylineColorAppearance, false, - i + i, ); //depth fail appearance variations - this._materialBatches[ - i + numberOfShadowModes - ] = new StaticGeometryPerMaterialBatch( - primitives, - PolylineMaterialAppearance, - PolylineColorAppearance, - false, - i - ); + this._materialBatches[i + numberOfShadowModes] = + new StaticGeometryPerMaterialBatch( + primitives, + PolylineMaterialAppearance, + PolylineColorAppearance, + false, + i, + ); - this._colorBatches[ - i + numberOfShadowModes * 2 - ] = new StaticGeometryColorBatch( - primitives, - PolylineColorAppearance, - PolylineMaterialAppearance, - false, - i - ); - this._materialBatches[ - i + numberOfShadowModes * 2 - ] = new StaticGeometryPerMaterialBatch( - primitives, - PolylineMaterialAppearance, - PolylineMaterialAppearance, - false, - i - ); + this._colorBatches[i + numberOfShadowModes * 2] = + new StaticGeometryColorBatch( + primitives, + PolylineColorAppearance, + PolylineMaterialAppearance, + false, + i, + ); + this._materialBatches[i + numberOfShadowModes * 2] = + new StaticGeometryPerMaterialBatch( + primitives, + PolylineMaterialAppearance, + PolylineMaterialAppearance, + false, + i, + ); } this._dynamicBatch = new DynamicGeometryBatch(primitives, groundPrimitives); @@ -167,14 +163,14 @@ function PolylineVisualizer( for (i = 0; i < numberOfClassificationTypes; ++i) { this._groundBatches[i] = new StaticGroundPolylinePerMaterialBatch( groundPrimitives, - i + i, ); } this._batches = this._colorBatches.concat( this._materialBatches, this._dynamicBatch, - this._groundBatches + this._groundBatches, ); this._subscriptions = new AssociativeArray(); @@ -183,12 +179,12 @@ function PolylineVisualizer( this._entityCollection = entityCollection; entityCollection.collectionChanged.addEventListener( PolylineVisualizer.prototype._onCollectionChanged, - this + this, ); this._onCollectionChanged( entityCollection, entityCollection.values, - emptyArray + emptyArray, ); } @@ -257,8 +253,8 @@ PolylineVisualizer.prototype.update = function (time) { id, updater.geometryChanged.addEventListener( PolylineVisualizer._onGeometryChanged, - this - ) + this, + ), ); } @@ -311,7 +307,7 @@ PolylineVisualizer.prototype.getBoundingSphere = function (entity, result) { } else if (state === BoundingSphereState.DONE) { boundingSpheres[count] = BoundingSphere.clone( tmp, - boundingSpheres[count] + boundingSpheres[count], ); count++; } @@ -341,7 +337,7 @@ PolylineVisualizer.prototype.isDestroyed = function () { PolylineVisualizer.prototype.destroy = function () { this._entityCollection.collectionChanged.removeEventListener( PolylineVisualizer.prototype._onCollectionChanged, - this + this, ); this._addedObjects.removeAll(); this._removedObjects.removeAll(); @@ -383,7 +379,7 @@ PolylineVisualizer._onGeometryChanged = function (updater) { PolylineVisualizer.prototype._onCollectionChanged = function ( entityCollection, added, - removed + removed, ) { const addedObjects = this._addedObjects; const removedObjects = this._removedObjects; diff --git a/packages/engine/Source/DataSources/PolylineVolumeGeometryUpdater.js b/packages/engine/Source/DataSources/PolylineVolumeGeometryUpdater.js index 1d8aca1a3d94..a9ed1192c34a 100644 --- a/packages/engine/Source/DataSources/PolylineVolumeGeometryUpdater.js +++ b/packages/engine/Source/DataSources/PolylineVolumeGeometryUpdater.js @@ -49,15 +49,16 @@ function PolylineVolumeGeometryUpdater(entity, scene) { entity, "polylineVolume", entity.polylineVolume, - undefined + undefined, ); } if (defined(Object.create)) { PolylineVolumeGeometryUpdater.prototype = Object.create( - GeometryUpdater.prototype + GeometryUpdater.prototype, ); - PolylineVolumeGeometryUpdater.prototype.constructor = PolylineVolumeGeometryUpdater; + PolylineVolumeGeometryUpdater.prototype.constructor = + PolylineVolumeGeometryUpdater; } /** @@ -69,14 +70,14 @@ if (defined(Object.create)) { * @exception {DeveloperError} This instance does not represent a filled geometry. */ PolylineVolumeGeometryUpdater.prototype.createFillGeometryInstance = function ( - time + time, ) { //>>includeStart('debug', pragmas.debug); Check.defined("time", time); if (!this._fillEnabled) { throw new DeveloperError( - "This instance does not represent a filled geometry." + "This instance does not represent a filled geometry.", ); } //>>includeEnd('debug'); @@ -91,14 +92,14 @@ PolylineVolumeGeometryUpdater.prototype.createFillGeometryInstance = function ( isAvailable && entity.isShowing && this._showProperty.getValue(time) && - this._fillProperty.getValue(time) - ); - const distanceDisplayCondition = this._distanceDisplayConditionProperty.getValue( - time - ); - const distanceDisplayConditionAttribute = DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition( - distanceDisplayCondition + this._fillProperty.getValue(time), ); + const distanceDisplayCondition = + this._distanceDisplayConditionProperty.getValue(time); + const distanceDisplayConditionAttribute = + DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition( + distanceDisplayCondition, + ); if (this._materialProperty instanceof ColorMaterialProperty) { let currentColor; if ( @@ -138,52 +139,51 @@ PolylineVolumeGeometryUpdater.prototype.createFillGeometryInstance = function ( * * @exception {DeveloperError} This instance does not represent an outlined geometry. */ -PolylineVolumeGeometryUpdater.prototype.createOutlineGeometryInstance = function ( - time -) { - //>>includeStart('debug', pragmas.debug); - Check.defined("time", time); +PolylineVolumeGeometryUpdater.prototype.createOutlineGeometryInstance = + function (time) { + //>>includeStart('debug', pragmas.debug); + Check.defined("time", time); - if (!this._outlineEnabled) { - throw new DeveloperError( - "This instance does not represent an outlined geometry." - ); - } - //>>includeEnd('debug'); + if (!this._outlineEnabled) { + throw new DeveloperError( + "This instance does not represent an outlined geometry.", + ); + } + //>>includeEnd('debug'); - const entity = this._entity; - const isAvailable = entity.isAvailable(time); - const outlineColor = Property.getValueOrDefault( - this._outlineColorProperty, - time, - Color.BLACK, - scratchColor - ); - const distanceDisplayCondition = this._distanceDisplayConditionProperty.getValue( - time - ); + const entity = this._entity; + const isAvailable = entity.isAvailable(time); + const outlineColor = Property.getValueOrDefault( + this._outlineColorProperty, + time, + Color.BLACK, + scratchColor, + ); + const distanceDisplayCondition = + this._distanceDisplayConditionProperty.getValue(time); - return new GeometryInstance({ - id: entity, - geometry: new PolylineVolumeOutlineGeometry(this._options), - attributes: { - show: new ShowGeometryInstanceAttribute( - isAvailable && - entity.isShowing && - this._showProperty.getValue(time) && - this._showOutlineProperty.getValue(time) - ), - color: ColorGeometryInstanceAttribute.fromColor(outlineColor), - distanceDisplayCondition: DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition( - distanceDisplayCondition - ), - }, - }); -}; + return new GeometryInstance({ + id: entity, + geometry: new PolylineVolumeOutlineGeometry(this._options), + attributes: { + show: new ShowGeometryInstanceAttribute( + isAvailable && + entity.isShowing && + this._showProperty.getValue(time) && + this._showOutlineProperty.getValue(time), + ), + color: ColorGeometryInstanceAttribute.fromColor(outlineColor), + distanceDisplayCondition: + DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition( + distanceDisplayCondition, + ), + }, + }); + }; PolylineVolumeGeometryUpdater.prototype._isHidden = function ( entity, - polylineVolume + polylineVolume, ) { return ( !defined(polylineVolume.positions) || @@ -194,7 +194,7 @@ PolylineVolumeGeometryUpdater.prototype._isHidden = function ( PolylineVolumeGeometryUpdater.prototype._isDynamic = function ( entity, - polylineVolume + polylineVolume, ) { return ( !polylineVolume.positions.isConstant || // @@ -207,7 +207,7 @@ PolylineVolumeGeometryUpdater.prototype._isDynamic = function ( PolylineVolumeGeometryUpdater.prototype._setStaticOptions = function ( entity, - polylineVolume + polylineVolume, ) { const granularity = polylineVolume.granularity; const cornerType = polylineVolume.cornerType; @@ -220,11 +220,11 @@ PolylineVolumeGeometryUpdater.prototype._setStaticOptions = function ( : MaterialAppearance.MaterialSupport.TEXTURED.vertexFormat; options.polylinePositions = polylineVolume.positions.getValue( Iso8601.MINIMUM_VALUE, - options.polylinePositions + options.polylinePositions, ); options.shapePositions = polylineVolume.shape.getValue( Iso8601.MINIMUM_VALUE, - options.shape + options.shape, ); options.granularity = defined(granularity) ? granularity.getValue(Iso8601.MINIMUM_VALUE) @@ -234,7 +234,8 @@ PolylineVolumeGeometryUpdater.prototype._setStaticOptions = function ( : undefined; }; -PolylineVolumeGeometryUpdater.DynamicGeometryUpdater = DynamicPolylineVolumeGeometryUpdater; +PolylineVolumeGeometryUpdater.DynamicGeometryUpdater = + DynamicPolylineVolumeGeometryUpdater; /** * @private @@ -242,27 +243,28 @@ PolylineVolumeGeometryUpdater.DynamicGeometryUpdater = DynamicPolylineVolumeGeom function DynamicPolylineVolumeGeometryUpdater( geometryUpdater, primitives, - groundPrimitives + groundPrimitives, ) { DynamicGeometryUpdater.call( this, geometryUpdater, primitives, - groundPrimitives + groundPrimitives, ); } if (defined(Object.create)) { DynamicPolylineVolumeGeometryUpdater.prototype = Object.create( - DynamicGeometryUpdater.prototype + DynamicGeometryUpdater.prototype, ); - DynamicPolylineVolumeGeometryUpdater.prototype.constructor = DynamicPolylineVolumeGeometryUpdater; + DynamicPolylineVolumeGeometryUpdater.prototype.constructor = + DynamicPolylineVolumeGeometryUpdater; } DynamicPolylineVolumeGeometryUpdater.prototype._isHidden = function ( entity, polylineVolume, - time + time, ) { const options = this._options; return ( @@ -272,7 +274,7 @@ DynamicPolylineVolumeGeometryUpdater.prototype._isHidden = function ( this, entity, polylineVolume, - time + time, ) ); }; @@ -280,25 +282,25 @@ DynamicPolylineVolumeGeometryUpdater.prototype._isHidden = function ( DynamicPolylineVolumeGeometryUpdater.prototype._setOptions = function ( entity, polylineVolume, - time + time, ) { const options = this._options; options.polylinePositions = Property.getValueOrUndefined( polylineVolume.positions, time, - options.polylinePositions + options.polylinePositions, ); options.shapePositions = Property.getValueOrUndefined( polylineVolume.shape, - time + time, ); options.granularity = Property.getValueOrUndefined( polylineVolume.granularity, - time + time, ); options.cornerType = Property.getValueOrUndefined( polylineVolume.cornerType, - time + time, ); }; export default PolylineVolumeGeometryUpdater; diff --git a/packages/engine/Source/DataSources/PolylineVolumeGraphics.js b/packages/engine/Source/DataSources/PolylineVolumeGraphics.js index 19ff7e271c99..dc4abc23d478 100644 --- a/packages/engine/Source/DataSources/PolylineVolumeGraphics.js +++ b/packages/engine/Source/DataSources/PolylineVolumeGraphics.js @@ -176,7 +176,7 @@ Object.defineProperties(PolylineVolumeGraphics.prototype, { * @type {Property|undefined} */ distanceDisplayCondition: createPropertyDescriptor( - "distanceDisplayCondition" + "distanceDisplayCondition", ), }); @@ -231,7 +231,7 @@ PolylineVolumeGraphics.prototype.merge = function (source) { this.shadows = defaultValue(this.shadows, source.shadows); this.distanceDisplayCondition = defaultValue( this.distanceDisplayCondition, - source.distanceDisplayCondition + source.distanceDisplayCondition, ); }; export default PolylineVolumeGraphics; diff --git a/packages/engine/Source/DataSources/PositionProperty.js b/packages/engine/Source/DataSources/PositionProperty.js index 17bce66ed195..d49308ca6a0e 100644 --- a/packages/engine/Source/DataSources/PositionProperty.js +++ b/packages/engine/Source/DataSources/PositionProperty.js @@ -100,7 +100,7 @@ PositionProperty.convertToReferenceFrame = function ( value, inputFrame, outputFrame, - result + result, ) { if (!defined(value)) { return value; @@ -115,7 +115,7 @@ PositionProperty.convertToReferenceFrame = function ( const icrfToFixed = Transforms.computeIcrfToCentralBodyFixedMatrix( time, - scratchMatrix3 + scratchMatrix3, ); if (inputFrame === ReferenceFrame.INERTIAL) { return Matrix3.multiplyByVector(icrfToFixed, value, result); @@ -124,7 +124,7 @@ PositionProperty.convertToReferenceFrame = function ( return Matrix3.multiplyByVector( Matrix3.transpose(icrfToFixed, scratchMatrix3), value, - result + result, ); } }; diff --git a/packages/engine/Source/DataSources/PositionPropertyArray.js b/packages/engine/Source/DataSources/PositionPropertyArray.js index fc8c3f4e54b5..b8bdc8394731 100644 --- a/packages/engine/Source/DataSources/PositionPropertyArray.js +++ b/packages/engine/Source/DataSources/PositionPropertyArray.js @@ -104,7 +104,7 @@ PositionPropertyArray.prototype.getValue = function (time, result) { PositionPropertyArray.prototype.getValueInReferenceFrame = function ( time, referenceFrame, - result + result, ) { //>>includeStart('debug', pragmas.debug); if (!defined(time)) { @@ -131,7 +131,7 @@ PositionPropertyArray.prototype.getValueInReferenceFrame = function ( const itemValue = property.getValueInReferenceFrame( time, referenceFrame, - result[i] + result[i], ); if (defined(itemValue)) { result[x] = itemValue; @@ -161,7 +161,7 @@ PositionPropertyArray.prototype.setValue = function (value) { eventHelper.add( property.definitionChanged, PositionPropertyArray.prototype._raiseDefinitionChanged, - this + this, ); } } diff --git a/packages/engine/Source/DataSources/Property.js b/packages/engine/Source/DataSources/Property.js index 49092eb3ebff..2833df6cef06 100644 --- a/packages/engine/Source/DataSources/Property.js +++ b/packages/engine/Source/DataSources/Property.js @@ -124,7 +124,7 @@ Property.getValueOrClonedDefault = function ( property, time, valueDefault, - result + result, ) { let value; if (defined(property)) { diff --git a/packages/engine/Source/DataSources/PropertyArray.js b/packages/engine/Source/DataSources/PropertyArray.js index b0a1322d865c..2dbbad4c9494 100644 --- a/packages/engine/Source/DataSources/PropertyArray.js +++ b/packages/engine/Source/DataSources/PropertyArray.js @@ -116,7 +116,7 @@ PropertyArray.prototype.setValue = function (value) { eventHelper.add( property.definitionChanged, PropertyArray.prototype._raiseDefinitionChanged, - this + this, ); } } diff --git a/packages/engine/Source/DataSources/PropertyBag.js b/packages/engine/Source/DataSources/PropertyBag.js index f98a3305aab8..01f2e34efae0 100644 --- a/packages/engine/Source/DataSources/PropertyBag.js +++ b/packages/engine/Source/DataSources/PropertyBag.js @@ -99,7 +99,7 @@ function createConstantProperty(value) { PropertyBag.prototype.addProperty = function ( propertyName, value, - createPropertyCallback + createPropertyCallback, ) { const propertyNames = this._propertyNames; @@ -109,7 +109,7 @@ PropertyBag.prototype.addProperty = function ( } if (propertyNames.indexOf(propertyName) !== -1) { throw new DeveloperError( - `${propertyName} is already a registered property.` + `${propertyName} is already a registered property.`, ); } //>>includeEnd('debug'); @@ -121,8 +121,8 @@ PropertyBag.prototype.addProperty = function ( createPropertyDescriptor( propertyName, true, - defaultValue(createPropertyCallback, createConstantProperty) - ) + defaultValue(createPropertyCallback, createConstantProperty), + ), ); if (defined(value)) { @@ -184,7 +184,7 @@ PropertyBag.prototype.getValue = function (time, result) { result[propertyName] = Property.getValueOrUndefined( this[propertyName], time, - result[propertyName] + result[propertyName], ); } return result; diff --git a/packages/engine/Source/DataSources/RectangleGeometryUpdater.js b/packages/engine/Source/DataSources/RectangleGeometryUpdater.js index 1633ad3ab709..e9821d061702 100644 --- a/packages/engine/Source/DataSources/RectangleGeometryUpdater.js +++ b/packages/engine/Source/DataSources/RectangleGeometryUpdater.js @@ -65,13 +65,13 @@ function RectangleGeometryUpdater(entity, scene) { entity, "rectangle", entity.rectangle, - undefined + undefined, ); } if (defined(Object.create)) { RectangleGeometryUpdater.prototype = Object.create( - GroundGeometryUpdater.prototype + GroundGeometryUpdater.prototype, ); RectangleGeometryUpdater.prototype.constructor = RectangleGeometryUpdater; } @@ -85,14 +85,14 @@ if (defined(Object.create)) { * @exception {DeveloperError} This instance does not represent a filled geometry. */ RectangleGeometryUpdater.prototype.createFillGeometryInstance = function ( - time + time, ) { //>>includeStart('debug', pragmas.debug); Check.defined("time", time); if (!this._fillEnabled) { throw new DeveloperError( - "This instance does not represent a filled geometry." + "This instance does not represent a filled geometry.", ); } //>>includeEnd('debug'); @@ -105,11 +105,12 @@ RectangleGeometryUpdater.prototype.createFillGeometryInstance = function ( isAvailable && entity.isShowing && this._showProperty.getValue(time) && - this._fillProperty.getValue(time) - ), - distanceDisplayCondition: DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition( - this._distanceDisplayConditionProperty.getValue(time) + this._fillProperty.getValue(time), ), + distanceDisplayCondition: + DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition( + this._distanceDisplayConditionProperty.getValue(time), + ), offset: undefined, color: undefined, }; @@ -133,8 +134,8 @@ RectangleGeometryUpdater.prototype.createFillGeometryInstance = function ( this._terrainOffsetProperty, time, defaultOffset, - offsetScratch - ) + offsetScratch, + ), ); } @@ -154,14 +155,14 @@ RectangleGeometryUpdater.prototype.createFillGeometryInstance = function ( * @exception {DeveloperError} This instance does not represent an outlined geometry. */ RectangleGeometryUpdater.prototype.createOutlineGeometryInstance = function ( - time + time, ) { //>>includeStart('debug', pragmas.debug); Check.defined("time", time); if (!this._outlineEnabled) { throw new DeveloperError( - "This instance does not represent an outlined geometry." + "This instance does not represent an outlined geometry.", ); } //>>includeEnd('debug'); @@ -172,23 +173,23 @@ RectangleGeometryUpdater.prototype.createOutlineGeometryInstance = function ( this._outlineColorProperty, time, Color.BLACK, - scratchColor - ); - const distanceDisplayCondition = this._distanceDisplayConditionProperty.getValue( - time + scratchColor, ); + const distanceDisplayCondition = + this._distanceDisplayConditionProperty.getValue(time); const attributes = { show: new ShowGeometryInstanceAttribute( isAvailable && entity.isShowing && this._showProperty.getValue(time) && - this._showOutlineProperty.getValue(time) + this._showOutlineProperty.getValue(time), ), color: ColorGeometryInstanceAttribute.fromColor(outlineColor), - distanceDisplayCondition: DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition( - distanceDisplayCondition - ), + distanceDisplayCondition: + DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition( + distanceDisplayCondition, + ), offset: undefined, }; @@ -198,8 +199,8 @@ RectangleGeometryUpdater.prototype.createOutlineGeometryInstance = function ( this._terrainOffsetProperty, time, defaultOffset, - offsetScratch - ) + offsetScratch, + ), ); } @@ -214,7 +215,7 @@ RectangleGeometryUpdater.prototype._computeCenter = function (time, result) { const rect = Property.getValueOrUndefined( this._entity.rectangle.coordinates, time, - scratchCenterRect + scratchCenterRect, ); if (!defined(rect)) { return; @@ -248,28 +249,28 @@ RectangleGeometryUpdater.prototype._isDynamic = function (entity, rectangle) { RectangleGeometryUpdater.prototype._setStaticOptions = function ( entity, - rectangle + rectangle, ) { const isColorMaterial = this._materialProperty instanceof ColorMaterialProperty; let heightValue = Property.getValueOrUndefined( rectangle.height, - Iso8601.MINIMUM_VALUE + Iso8601.MINIMUM_VALUE, ); const heightReferenceValue = Property.getValueOrDefault( rectangle.heightReference, Iso8601.MINIMUM_VALUE, - HeightReference.NONE + HeightReference.NONE, ); let extrudedHeightValue = Property.getValueOrUndefined( rectangle.extrudedHeight, - Iso8601.MINIMUM_VALUE + Iso8601.MINIMUM_VALUE, ); const extrudedHeightReferenceValue = Property.getValueOrDefault( rectangle.extrudedHeightReference, Iso8601.MINIMUM_VALUE, - HeightReference.NONE + HeightReference.NONE, ); if (defined(extrudedHeightValue) && !defined(heightValue)) { heightValue = 0; @@ -281,45 +282,47 @@ RectangleGeometryUpdater.prototype._setStaticOptions = function ( : MaterialAppearance.MaterialSupport.TEXTURED.vertexFormat; options.rectangle = rectangle.coordinates.getValue( Iso8601.MINIMUM_VALUE, - options.rectangle + options.rectangle, ); options.granularity = Property.getValueOrUndefined( rectangle.granularity, - Iso8601.MINIMUM_VALUE + Iso8601.MINIMUM_VALUE, ); options.stRotation = Property.getValueOrUndefined( rectangle.stRotation, - Iso8601.MINIMUM_VALUE + Iso8601.MINIMUM_VALUE, ); options.rotation = Property.getValueOrUndefined( rectangle.rotation, - Iso8601.MINIMUM_VALUE - ); - options.offsetAttribute = GroundGeometryUpdater.computeGeometryOffsetAttribute( - heightValue, - heightReferenceValue, - extrudedHeightValue, - extrudedHeightReferenceValue + Iso8601.MINIMUM_VALUE, ); + options.offsetAttribute = + GroundGeometryUpdater.computeGeometryOffsetAttribute( + heightValue, + heightReferenceValue, + extrudedHeightValue, + extrudedHeightReferenceValue, + ); options.height = GroundGeometryUpdater.getGeometryHeight( heightValue, - heightReferenceValue + heightReferenceValue, ); extrudedHeightValue = GroundGeometryUpdater.getGeometryExtrudedHeight( extrudedHeightValue, - extrudedHeightReferenceValue + extrudedHeightReferenceValue, ); if (extrudedHeightValue === GroundGeometryUpdater.CLAMP_TO_GROUND) { extrudedHeightValue = ApproximateTerrainHeights.getMinimumMaximumHeights( - RectangleGeometry.computeRectangle(options, scratchRectangle) + RectangleGeometry.computeRectangle(options, scratchRectangle), ).minimumTerrainHeight; } options.extrudedHeight = extrudedHeightValue; }; -RectangleGeometryUpdater.DynamicGeometryUpdater = DynamicRectangleGeometryUpdater; +RectangleGeometryUpdater.DynamicGeometryUpdater = + DynamicRectangleGeometryUpdater; /** * @private @@ -327,27 +330,28 @@ RectangleGeometryUpdater.DynamicGeometryUpdater = DynamicRectangleGeometryUpdate function DynamicRectangleGeometryUpdater( geometryUpdater, primitives, - groundPrimitives + groundPrimitives, ) { DynamicGeometryUpdater.call( this, geometryUpdater, primitives, - groundPrimitives + groundPrimitives, ); } if (defined(Object.create)) { DynamicRectangleGeometryUpdater.prototype = Object.create( - DynamicGeometryUpdater.prototype + DynamicGeometryUpdater.prototype, ); - DynamicRectangleGeometryUpdater.prototype.constructor = DynamicRectangleGeometryUpdater; + DynamicRectangleGeometryUpdater.prototype.constructor = + DynamicRectangleGeometryUpdater; } DynamicRectangleGeometryUpdater.prototype._isHidden = function ( entity, rectangle, - time + time, ) { return ( !defined(this._options.rectangle) || @@ -355,7 +359,7 @@ DynamicRectangleGeometryUpdater.prototype._isHidden = function ( this, entity, rectangle, - time + time, ) ); }; @@ -363,23 +367,23 @@ DynamicRectangleGeometryUpdater.prototype._isHidden = function ( DynamicRectangleGeometryUpdater.prototype._setOptions = function ( entity, rectangle, - time + time, ) { const options = this._options; let heightValue = Property.getValueOrUndefined(rectangle.height, time); const heightReferenceValue = Property.getValueOrDefault( rectangle.heightReference, time, - HeightReference.NONE + HeightReference.NONE, ); let extrudedHeightValue = Property.getValueOrUndefined( rectangle.extrudedHeight, - time + time, ); const extrudedHeightReferenceValue = Property.getValueOrDefault( rectangle.extrudedHeightReference, time, - HeightReference.NONE + HeightReference.NONE, ); if (defined(extrudedHeightValue) && !defined(heightValue)) { heightValue = 0; @@ -388,32 +392,33 @@ DynamicRectangleGeometryUpdater.prototype._setOptions = function ( options.rectangle = Property.getValueOrUndefined( rectangle.coordinates, time, - options.rectangle + options.rectangle, ); options.granularity = Property.getValueOrUndefined( rectangle.granularity, - time + time, ); options.stRotation = Property.getValueOrUndefined(rectangle.stRotation, time); options.rotation = Property.getValueOrUndefined(rectangle.rotation, time); - options.offsetAttribute = GroundGeometryUpdater.computeGeometryOffsetAttribute( - heightValue, - heightReferenceValue, - extrudedHeightValue, - extrudedHeightReferenceValue - ); + options.offsetAttribute = + GroundGeometryUpdater.computeGeometryOffsetAttribute( + heightValue, + heightReferenceValue, + extrudedHeightValue, + extrudedHeightReferenceValue, + ); options.height = GroundGeometryUpdater.getGeometryHeight( heightValue, - heightReferenceValue + heightReferenceValue, ); extrudedHeightValue = GroundGeometryUpdater.getGeometryExtrudedHeight( extrudedHeightValue, - extrudedHeightReferenceValue + extrudedHeightReferenceValue, ); if (extrudedHeightValue === GroundGeometryUpdater.CLAMP_TO_GROUND) { extrudedHeightValue = ApproximateTerrainHeights.getMinimumMaximumHeights( - RectangleGeometry.computeRectangle(options, scratchRectangle) + RectangleGeometry.computeRectangle(options, scratchRectangle), ).minimumTerrainHeight; } diff --git a/packages/engine/Source/DataSources/RectangleGraphics.js b/packages/engine/Source/DataSources/RectangleGraphics.js index 020f96e56d14..b2cedf2fd4b9 100644 --- a/packages/engine/Source/DataSources/RectangleGraphics.js +++ b/packages/engine/Source/DataSources/RectangleGraphics.js @@ -228,7 +228,7 @@ Object.defineProperties(RectangleGraphics.prototype, { * @type {Property|undefined} */ distanceDisplayCondition: createPropertyDescriptor( - "distanceDisplayCondition" + "distanceDisplayCondition", ), /** @@ -297,15 +297,15 @@ RectangleGraphics.prototype.merge = function (source) { this.height = defaultValue(this.height, source.height); this.heightReference = defaultValue( this.heightReference, - source.heightReference + source.heightReference, ); this.extrudedHeight = defaultValue( this.extrudedHeight, - source.extrudedHeight + source.extrudedHeight, ); this.extrudedHeightReference = defaultValue( this.extrudedHeightReference, - source.extrudedHeightReference + source.extrudedHeightReference, ); this.rotation = defaultValue(this.rotation, source.rotation); this.stRotation = defaultValue(this.stRotation, source.stRotation); @@ -318,11 +318,11 @@ RectangleGraphics.prototype.merge = function (source) { this.shadows = defaultValue(this.shadows, source.shadows); this.distanceDisplayCondition = defaultValue( this.distanceDisplayCondition, - source.distanceDisplayCondition + source.distanceDisplayCondition, ); this.classificationType = defaultValue( this.classificationType, - source.classificationType + source.classificationType, ); this.zIndex = defaultValue(this.zIndex, source.zIndex); }; diff --git a/packages/engine/Source/DataSources/ReferenceProperty.js b/packages/engine/Source/DataSources/ReferenceProperty.js index 175c3e41705f..9e9f3dd73712 100644 --- a/packages/engine/Source/DataSources/ReferenceProperty.js +++ b/packages/engine/Source/DataSources/ReferenceProperty.js @@ -22,7 +22,7 @@ function resolve(that) { // target entity was found. listen for changes to entity definition targetEntity.definitionChanged.addEventListener( ReferenceProperty.prototype._onTargetEntityDefinitionChanged, - that + that, ); that._targetEntity = targetEntity; } @@ -115,7 +115,7 @@ function ReferenceProperty(targetCollection, targetId, targetPropertyNames) { targetCollection.collectionChanged.addEventListener( ReferenceProperty.prototype._onCollectionChanged, - this + this, ); } @@ -284,7 +284,7 @@ ReferenceProperty.prototype.getValue = function (time, result) { ReferenceProperty.prototype.getValueInReferenceFrame = function ( time, referenceFrame, - result + result, ) { const target = resolve(this); return defined(target) @@ -341,7 +341,7 @@ ReferenceProperty.prototype._onTargetEntityDefinitionChanged = function ( targetEntity, name, value, - oldValue + oldValue, ) { if (defined(this._targetProperty) && this._targetPropertyNames[0] === name) { this._targetProperty = undefined; @@ -352,13 +352,13 @@ ReferenceProperty.prototype._onTargetEntityDefinitionChanged = function ( ReferenceProperty.prototype._onCollectionChanged = function ( collection, added, - removed + removed, ) { let targetEntity = this._targetEntity; if (defined(targetEntity) && removed.indexOf(targetEntity) !== -1) { targetEntity.definitionChanged.removeEventListener( ReferenceProperty.prototype._onTargetEntityDefinitionChanged, - this + this, ); this._targetEntity = this._targetProperty = undefined; } else if (!defined(targetEntity)) { diff --git a/packages/engine/Source/DataSources/Rotation.js b/packages/engine/Source/DataSources/Rotation.js index 5f60a4a92fe8..9e337dd463fb 100644 --- a/packages/engine/Source/DataSources/Rotation.js +++ b/packages/engine/Source/DataSources/Rotation.js @@ -93,7 +93,7 @@ const Rotation = { packedArray, startingIndex, lastIndex, - result + result, ) { //>>includeStart('debug', pragmas.debug); if (!defined(packedArray)) { @@ -135,7 +135,7 @@ const Rotation = { sourceArray, firstIndex, lastIndex, - result + result, ) { //>>includeStart('debug', pragmas.debug); if (!defined(array)) { diff --git a/packages/engine/Source/DataSources/SampledPositionProperty.js b/packages/engine/Source/DataSources/SampledPositionProperty.js index fb72ce8aae8f..c8cc2c53a7d6 100644 --- a/packages/engine/Source/DataSources/SampledPositionProperty.js +++ b/packages/engine/Source/DataSources/SampledPositionProperty.js @@ -206,7 +206,7 @@ SampledPositionProperty.prototype.getValue = function (time, result) { SampledPositionProperty.prototype.getValueInReferenceFrame = function ( time, referenceFrame, - result + result, ) { //>>includeStart('debug', pragmas.debug); Check.defined("time", time); @@ -220,7 +220,7 @@ SampledPositionProperty.prototype.getValueInReferenceFrame = function ( result, this._referenceFrame, referenceFrame, - result + result, ); } return undefined; @@ -247,7 +247,7 @@ SampledPositionProperty.prototype.setInterpolationOptions = function (options) { SampledPositionProperty.prototype.addSample = function ( time, position, - derivatives + derivatives, ) { const numberOfDerivatives = this._numberOfDerivatives; //>>includeStart('debug', pragmas.debug); @@ -256,7 +256,7 @@ SampledPositionProperty.prototype.addSample = function ( (!defined(derivatives) || derivatives.length !== numberOfDerivatives) ) { throw new DeveloperError( - "derivatives length must be equal to the number of derivatives." + "derivatives length must be equal to the number of derivatives.", ); } //>>includeEnd('debug'); @@ -275,7 +275,7 @@ SampledPositionProperty.prototype.addSample = function ( SampledPositionProperty.prototype.addSamples = function ( times, positions, - derivatives + derivatives, ) { this._property.addSamples(times, positions, derivatives); }; @@ -289,7 +289,7 @@ SampledPositionProperty.prototype.addSamples = function ( */ SampledPositionProperty.prototype.addSamplesPackedArray = function ( packedSamples, - epoch + epoch, ) { this._property.addSamplesPackedArray(packedSamples, epoch); }; diff --git a/packages/engine/Source/DataSources/SampledProperty.js b/packages/engine/Source/DataSources/SampledProperty.js index 2c015283c4f9..803555188725 100644 --- a/packages/engine/Source/DataSources/SampledProperty.js +++ b/packages/engine/Source/DataSources/SampledProperty.js @@ -168,7 +168,7 @@ function SampledProperty(type, derivativeTypes) { let packedLength = innerType.packedLength; let packedInterpolationLength = defaultValue( innerType.packedInterpolationLength, - packedLength + packedLength, ); let inputOrder = 0; @@ -185,7 +185,7 @@ function SampledProperty(type, derivativeTypes) { packedLength += derivativePackedLength; packedInterpolationLength += defaultValue( derivativeType.packedInterpolationLength, - derivativePackedLength + derivativePackedLength, ); innerDerivativeTypes[i] = derivativeType; } @@ -429,9 +429,9 @@ SampledProperty.prototype.getValue = function (time, result) { const numberOfPoints = Math.min( interpolationAlgorithm.getRequiredDataPoints( this._interpolationDegree, - inputOrder + inputOrder, ), - timesLength + timesLength, ); if (numberOfPoints !== this._numberOfPoints) { this._numberOfPoints = numberOfPoints; @@ -472,7 +472,7 @@ SampledProperty.prototype.getValue = function (time, result) { for (let i = 0; i < length; ++i) { xTable[i] = JulianDate.secondsDifference( times[firstIndex + i], - times[lastIndex] + times[lastIndex], ); } @@ -492,7 +492,7 @@ SampledProperty.prototype.getValue = function (time, result) { values, firstIndex, lastIndex, - yTable + yTable, ); } @@ -505,7 +505,7 @@ SampledProperty.prototype.getValue = function (time, result) { xTable, yTable, packedInterpolationLength, - this._interpolationResult + this._interpolationResult, ); } else { const yStride = Math.floor(packedInterpolationLength / (inputOrder + 1)); @@ -516,7 +516,7 @@ SampledProperty.prototype.getValue = function (time, result) { yStride, inputOrder, inputOrder, - this._interpolationResult + this._interpolationResult, ); } @@ -528,7 +528,7 @@ SampledProperty.prototype.getValue = function (time, result) { values, firstIndex, lastIndex, - result + result, ); } return innerType.unpack(values, index * this._packedLength, result); @@ -608,7 +608,7 @@ SampledProperty.prototype.addSample = function (time, value, derivatives) { this._times, this._values, data, - this._packedLength + this._packedLength, ); this._updateTableLength = true; this._definitionChanged.raiseEvent(this); @@ -627,7 +627,7 @@ SampledProperty.prototype.addSample = function (time, value, derivatives) { SampledProperty.prototype.addSamples = function ( times, values, - derivativeValues + derivativeValues, ) { const innerDerivativeTypes = this._innerDerivativeTypes; const hasDerivatives = defined(innerDerivativeTypes); @@ -643,7 +643,7 @@ SampledProperty.prototype.addSamples = function ( (!defined(derivativeValues) || derivativeValues.length !== times.length) ) { throw new DeveloperError( - "times and derivativeValues must be the same length." + "times and derivativeValues must be the same length.", ); } //>>includeEnd('debug'); @@ -668,7 +668,7 @@ SampledProperty.prototype.addSamples = function ( this._times, this._values, data, - this._packedLength + this._packedLength, ); this._updateTableLength = true; this._definitionChanged.raiseEvent(this); @@ -683,7 +683,7 @@ SampledProperty.prototype.addSamples = function ( */ SampledProperty.prototype.addSamplesPackedArray = function ( packedSamples, - epoch + epoch, ) { //>>includeStart('debug', pragmas.debug); Check.defined("packedSamples", packedSamples); @@ -694,7 +694,7 @@ SampledProperty.prototype.addSamplesPackedArray = function ( this._times, this._values, packedSamples, - this._packedLength + this._packedLength, ); this._updateTableLength = true; this._definitionChanged.raiseEvent(this); @@ -724,7 +724,7 @@ function removeSamples(property, startIndex, numberToRemove) { property._times.splice(startIndex, numberToRemove); property._values.splice( startIndex * packedLength, - numberToRemove * packedLength + numberToRemove * packedLength, ); property._updateTableLength = true; property._definitionChanged.raiseEvent(property); diff --git a/packages/engine/Source/DataSources/ScaledPositionProperty.js b/packages/engine/Source/DataSources/ScaledPositionProperty.js index ec89e9386674..3fd1926d931d 100644 --- a/packages/engine/Source/DataSources/ScaledPositionProperty.js +++ b/packages/engine/Source/DataSources/ScaledPositionProperty.js @@ -59,7 +59,7 @@ ScaledPositionProperty.prototype.setValue = function (value) { if (defined(value)) { this._removeSubscription = value.definitionChanged.addEventListener( this._raiseDefinitionChanged, - this + this, ); } this._definitionChanged.raiseEvent(this); @@ -69,7 +69,7 @@ ScaledPositionProperty.prototype.setValue = function (value) { ScaledPositionProperty.prototype.getValueInReferenceFrame = function ( time, referenceFrame, - result + result, ) { //>>includeStart('debug', pragmas.debug); if (!defined(time)) { diff --git a/packages/engine/Source/DataSources/StaticGeometryColorBatch.js b/packages/engine/Source/DataSources/StaticGeometryColorBatch.js index fde70acb1b51..4d65ea05dd8a 100644 --- a/packages/engine/Source/DataSources/StaticGeometryColorBatch.js +++ b/packages/engine/Source/DataSources/StaticGeometryColorBatch.js @@ -26,7 +26,7 @@ function Batch( depthFailAppearanceType, depthFailMaterialProperty, closed, - shadows + shadows, ) { this.translucent = translucent; this.appearanceType = appearanceType; @@ -51,10 +51,11 @@ function Batch( let removeMaterialSubscription; if (defined(depthFailMaterialProperty)) { - removeMaterialSubscription = depthFailMaterialProperty.definitionChanged.addEventListener( - Batch.prototype.onMaterialChanged, - this - ); + removeMaterialSubscription = + depthFailMaterialProperty.definitionChanged.addEventListener( + Batch.prototype.onMaterialChanged, + this, + ); } this.removeMaterialSubscription = removeMaterialSubscription; } @@ -91,16 +92,13 @@ Batch.prototype.add = function (updater, instance) { const that = this; this.subscriptions.set( id, - updater.entity.definitionChanged.addEventListener(function ( - entity, - propertyName, - newValue, - oldValue - ) { - if (propertyName === "isShowing") { - that.showsUpdated.set(updater.id, updater); - } - }) + updater.entity.definitionChanged.addEventListener( + function (entity, propertyName, newValue, oldValue) { + if (propertyName === "isShowing") { + that.showsUpdated.set(updater.id, updater); + } + }, + ), ); } }; @@ -146,7 +144,7 @@ Batch.prototype.update = function (time) { this.depthFailMaterial = MaterialProperty.getValue( time, this.depthFailMaterialProperty, - this.depthFailMaterial + this.depthFailMaterial, ); } depthFailAppearance = new this.depthFailAppearanceType({ @@ -199,7 +197,7 @@ Batch.prototype.update = function (time) { this.depthFailMaterial = MaterialProperty.getValue( time, this.depthFailMaterialProperty, - this.depthFailMaterial + this.depthFailMaterial, ); this.primitive.depthFailAppearance.material = this.depthFailMaterial; } @@ -223,16 +221,16 @@ Batch.prototype.update = function (time) { colorProperty, time, Color.WHITE, - colorScratch + colorScratch, ); if (!Color.equals(attributes._lastColor, resultColor)) { attributes._lastColor = Color.clone( resultColor, - attributes._lastColor + attributes._lastColor, ); attributes.color = ColorGeometryInstanceAttribute.toValue( resultColor, - attributes.color + attributes.color, ); if ( (this.translucent && attributes.color[3] === 255) || @@ -253,16 +251,16 @@ Batch.prototype.update = function (time) { depthFailColorProperty, time, Color.WHITE, - colorScratch + colorScratch, ); if (!Color.equals(attributes._lastDepthFailColor, depthColor)) { attributes._lastDepthFailColor = Color.clone( depthColor, - attributes._lastDepthFailColor + attributes._lastDepthFailColor, ); attributes.depthFailColor = ColorGeometryInstanceAttribute.toValue( depthColor, - attributes.depthFailColor + attributes.depthFailColor, ); } } @@ -274,7 +272,7 @@ Batch.prototype.update = function (time) { if (show !== currentShow) { attributes.show = ShowGeometryInstanceAttribute.toValue( show, - attributes.show + attributes.show, ); } @@ -285,22 +283,24 @@ Batch.prototype.update = function (time) { distanceDisplayConditionProperty, time, defaultDistanceDisplayCondition, - distanceDisplayConditionScratch + distanceDisplayConditionScratch, ); if ( !DistanceDisplayCondition.equals( distanceDisplayCondition, - attributes._lastDistanceDisplayCondition + attributes._lastDistanceDisplayCondition, ) ) { - attributes._lastDistanceDisplayCondition = DistanceDisplayCondition.clone( - distanceDisplayCondition, - attributes._lastDistanceDisplayCondition - ); - attributes.distanceDisplayCondition = DistanceDisplayConditionGeometryInstanceAttribute.toValue( - distanceDisplayCondition, - attributes.distanceDisplayCondition - ); + attributes._lastDistanceDisplayCondition = + DistanceDisplayCondition.clone( + distanceDisplayCondition, + attributes._lastDistanceDisplayCondition, + ); + attributes.distanceDisplayCondition = + DistanceDisplayConditionGeometryInstanceAttribute.toValue( + distanceDisplayCondition, + attributes.distanceDisplayCondition, + ); } } @@ -310,16 +310,16 @@ Batch.prototype.update = function (time) { offsetProperty, time, defaultOffset, - offsetScratch + offsetScratch, ); if (!Cartesian3.equals(offset, attributes._lastOffset)) { attributes._lastOffset = Cartesian3.clone( offset, - attributes._lastOffset + attributes._lastOffset, ); attributes.offset = OffsetGeometryInstanceAttribute.toValue( offset, - attributes.offset + attributes.offset, ); } } @@ -352,7 +352,7 @@ Batch.prototype.updateShows = function (primitive) { if (show !== currentShow) { attributes.show = ShowGeometryInstanceAttribute.toValue( show, - attributes.show + attributes.show, ); instance.attributes.show.value[0] = attributes.show[0]; } @@ -404,7 +404,7 @@ function StaticGeometryColorBatch( appearanceType, depthFailAppearanceType, closed, - shadows + shadows, ) { this._solidItems = []; this._translucentItems = []; @@ -442,7 +442,7 @@ StaticGeometryColorBatch.prototype.add = function (time, updater) { this._depthFailAppearanceType, updater.depthFailMaterialProperty, this._closed, - this._shadows + this._shadows, ); batch.add(updater, instance); items.push(batch); @@ -546,7 +546,7 @@ function getBoundingSphere(items, updater, result) { StaticGeometryColorBatch.prototype.getBoundingSphere = function ( updater, - result + result, ) { const boundingSphere = getBoundingSphere(this._solidItems, updater, result); if (boundingSphere === BoundingSphereState.FAILED) { diff --git a/packages/engine/Source/DataSources/StaticGeometryPerMaterialBatch.js b/packages/engine/Source/DataSources/StaticGeometryPerMaterialBatch.js index 0efdf9ac7aae..32c078c123fc 100644 --- a/packages/engine/Source/DataSources/StaticGeometryPerMaterialBatch.js +++ b/packages/engine/Source/DataSources/StaticGeometryPerMaterialBatch.js @@ -25,7 +25,7 @@ function Batch( depthFailAppearanceType, depthFailMaterialProperty, closed, - shadows + shadows, ) { this.primitives = primitives; this.appearanceType = appearanceType; @@ -44,10 +44,11 @@ function Batch( this.updatersWithAttributes = new AssociativeArray(); this.attributes = new AssociativeArray(); this.invalidated = false; - this.removeMaterialSubscription = materialProperty.definitionChanged.addEventListener( - Batch.prototype.onMaterialChanged, - this - ); + this.removeMaterialSubscription = + materialProperty.definitionChanged.addEventListener( + Batch.prototype.onMaterialChanged, + this, + ); this.subscriptions = new AssociativeArray(); this.showsUpdated = new AssociativeArray(); } @@ -92,16 +93,13 @@ Batch.prototype.add = function (time, updater) { const that = this; this.subscriptions.set( id, - updater.entity.definitionChanged.addEventListener(function ( - entity, - propertyName, - newValue, - oldValue - ) { - if (propertyName === "isShowing") { - that.showsUpdated.set(updater.id, updater); - } - }) + updater.entity.definitionChanged.addEventListener( + function (entity, propertyName, newValue, oldValue) { + if (propertyName === "isShowing") { + that.showsUpdated.set(updater.id, updater); + } + }, + ), ); } this.createPrimitive = true; @@ -146,7 +144,7 @@ Batch.prototype.update = function (time) { this.material = MaterialProperty.getValue( time, this.materialProperty, - this.material + this.material, ); let depthFailAppearance; @@ -154,7 +152,7 @@ Batch.prototype.update = function (time) { this.depthFailMaterial = MaterialProperty.getValue( time, this.depthFailMaterialProperty, - this.depthFailMaterial + this.depthFailMaterial, ); depthFailAppearance = new this.depthFailAppearanceType({ material: this.depthFailMaterial, @@ -203,7 +201,7 @@ Batch.prototype.update = function (time) { this.material = MaterialProperty.getValue( time, this.materialProperty, - this.material + this.material, ); this.primitive.appearance.material = this.material; @@ -214,7 +212,7 @@ Batch.prototype.update = function (time) { this.depthFailMaterial = MaterialProperty.getValue( time, this.depthFailMaterialProperty, - this.depthFailMaterial + this.depthFailMaterial, ); this.primitive.depthFailAppearance.material = this.depthFailMaterial; } @@ -242,16 +240,16 @@ Batch.prototype.update = function (time) { depthFailColorProperty, time, Color.WHITE, - colorScratch + colorScratch, ); if (!Color.equals(attributes._lastDepthFailColor, depthFailColor)) { attributes._lastDepthFailColor = Color.clone( depthFailColor, - attributes._lastDepthFailColor + attributes._lastDepthFailColor, ); attributes.depthFailColor = ColorGeometryInstanceAttribute.toValue( depthFailColor, - attributes.depthFailColor + attributes.depthFailColor, ); } } @@ -262,7 +260,7 @@ Batch.prototype.update = function (time) { if (show !== currentShow) { attributes.show = ShowGeometryInstanceAttribute.toValue( show, - attributes.show + attributes.show, ); } @@ -273,22 +271,24 @@ Batch.prototype.update = function (time) { distanceDisplayConditionProperty, time, defaultDistanceDisplayCondition, - distanceDisplayConditionScratch + distanceDisplayConditionScratch, ); if ( !DistanceDisplayCondition.equals( distanceDisplayCondition, - attributes._lastDistanceDisplayCondition + attributes._lastDistanceDisplayCondition, ) ) { - attributes._lastDistanceDisplayCondition = DistanceDisplayCondition.clone( - distanceDisplayCondition, - attributes._lastDistanceDisplayCondition - ); - attributes.distanceDisplayCondition = DistanceDisplayConditionGeometryInstanceAttribute.toValue( - distanceDisplayCondition, - attributes.distanceDisplayCondition - ); + attributes._lastDistanceDisplayCondition = + DistanceDisplayCondition.clone( + distanceDisplayCondition, + attributes._lastDistanceDisplayCondition, + ); + attributes.distanceDisplayCondition = + DistanceDisplayConditionGeometryInstanceAttribute.toValue( + distanceDisplayCondition, + attributes.distanceDisplayCondition, + ); } } @@ -298,16 +298,16 @@ Batch.prototype.update = function (time) { offsetProperty, time, defaultOffset, - offsetScratch + offsetScratch, ); if (!Cartesian3.equals(offset, attributes._lastOffset)) { attributes._lastOffset = Cartesian3.clone( offset, - attributes._lastOffset + attributes._lastOffset, ); attributes.offset = OffsetGeometryInstanceAttribute.toValue( offset, - attributes.offset + attributes.offset, ); } } @@ -339,7 +339,7 @@ Batch.prototype.updateShows = function (primitive) { if (show !== currentShow) { attributes.show = ShowGeometryInstanceAttribute.toValue( show, - attributes.show + attributes.show, ); instance.attributes.show.value[0] = attributes.show[0]; } @@ -389,7 +389,7 @@ function StaticGeometryPerMaterialBatch( appearanceType, depthFailAppearanceType, closed, - shadows + shadows, ) { this._items = []; this._primitives = primitives; @@ -416,7 +416,7 @@ StaticGeometryPerMaterialBatch.prototype.add = function (time, updater) { this._depthFailAppearanceType, updater.depthFailMaterialProperty, this._closed, - this._shadows + this._shadows, ); batch.add(time, updater); items.push(batch); @@ -464,7 +464,7 @@ StaticGeometryPerMaterialBatch.prototype.update = function (time) { StaticGeometryPerMaterialBatch.prototype.getBoundingSphere = function ( updater, - result + result, ) { const items = this._items; const length = items.length; diff --git a/packages/engine/Source/DataSources/StaticGroundGeometryColorBatch.js b/packages/engine/Source/DataSources/StaticGroundGeometryColorBatch.js index 54c5a9ee95a9..4bde462f4505 100644 --- a/packages/engine/Source/DataSources/StaticGroundGeometryColorBatch.js +++ b/packages/engine/Source/DataSources/StaticGroundGeometryColorBatch.js @@ -54,16 +54,13 @@ Batch.prototype.add = function (updater, instance) { const that = this; this.subscriptions.set( id, - updater.entity.definitionChanged.addEventListener(function ( - entity, - propertyName, - newValue, - oldValue - ) { - if (propertyName === "isShowing") { - that.showsUpdated.set(updater.id, updater); - } - }) + updater.entity.definitionChanged.addEventListener( + function (entity, propertyName, newValue, oldValue) { + if (propertyName === "isShowing") { + that.showsUpdated.set(updater.id, updater); + } + }, + ), ); } }; @@ -75,7 +72,7 @@ Batch.prototype.remove = function (updater) { if (this.updaters.remove(id)) { this.rectangleCollisionCheck.remove( id, - geometryInstance.geometry.rectangle + geometryInstance.geometry.rectangle, ); this.updatersWithAttributes.remove(id); const unsubscribe = this.subscriptions.get(id); @@ -157,14 +154,14 @@ Batch.prototype.update = function (time) { colorProperty, time, Color.WHITE, - colorScratch + colorScratch, ); if (!Color.equals(attributes._lastColor, fillColor)) { attributes._lastColor = Color.clone(fillColor, attributes._lastColor); attributes.color = ColorGeometryInstanceAttribute.toValue( fillColor, - attributes.color + attributes.color, ); } } @@ -176,7 +173,7 @@ Batch.prototype.update = function (time) { if (show !== currentShow) { attributes.show = ShowGeometryInstanceAttribute.toValue( show, - attributes.show + attributes.show, ); } @@ -187,22 +184,24 @@ Batch.prototype.update = function (time) { distanceDisplayConditionProperty, time, defaultDistanceDisplayCondition, - distanceDisplayConditionScratch + distanceDisplayConditionScratch, ); if ( !DistanceDisplayCondition.equals( distanceDisplayCondition, - attributes._lastDistanceDisplayCondition + attributes._lastDistanceDisplayCondition, ) ) { - attributes._lastDistanceDisplayCondition = DistanceDisplayCondition.clone( - distanceDisplayCondition, - attributes._lastDistanceDisplayCondition - ); - attributes.distanceDisplayCondition = DistanceDisplayConditionGeometryInstanceAttribute.toValue( - distanceDisplayCondition, - attributes.distanceDisplayCondition - ); + attributes._lastDistanceDisplayCondition = + DistanceDisplayCondition.clone( + distanceDisplayCondition, + attributes._lastDistanceDisplayCondition, + ); + attributes.distanceDisplayCondition = + DistanceDisplayConditionGeometryInstanceAttribute.toValue( + distanceDisplayCondition, + attributes.distanceDisplayCondition, + ); } } } @@ -234,7 +233,7 @@ Batch.prototype.updateShows = function (primitive) { if (show !== currentShow) { attributes.show = ShowGeometryInstanceAttribute.toValue( show, - attributes.show + attributes.show, ); instance.attributes.show.value[0] = attributes.show[0]; } @@ -310,7 +309,7 @@ StaticGroundGeometryColorBatch.prototype.add = function (time, updater) { this._primitives, this._classificationType, instance.attributes.color.value, - zIndex + zIndex, ); batches.push(batch); } @@ -371,7 +370,7 @@ StaticGroundGeometryColorBatch.prototype.update = function (time) { StaticGroundGeometryColorBatch.prototype.getBoundingSphere = function ( updater, - result + result, ) { const batches = this._batches; const batchCount = batches.length; diff --git a/packages/engine/Source/DataSources/StaticGroundGeometryPerMaterialBatch.js b/packages/engine/Source/DataSources/StaticGroundGeometryPerMaterialBatch.js index c162597ec714..2d2757fc3b77 100644 --- a/packages/engine/Source/DataSources/StaticGroundGeometryPerMaterialBatch.js +++ b/packages/engine/Source/DataSources/StaticGroundGeometryPerMaterialBatch.js @@ -21,7 +21,7 @@ function Batch( appearanceType, materialProperty, usingSphericalTextureCoordinates, - zIndex + zIndex, ) { this.primitives = primitives; // scene level primitive collection this.classificationType = classificationType; @@ -36,10 +36,11 @@ function Batch( this.updatersWithAttributes = new AssociativeArray(); this.attributes = new AssociativeArray(); this.invalidated = false; - this.removeMaterialSubscription = materialProperty.definitionChanged.addEventListener( - Batch.prototype.onMaterialChanged, - this - ); + this.removeMaterialSubscription = + materialProperty.definitionChanged.addEventListener( + Batch.prototype.onMaterialChanged, + this, + ); this.subscriptions = new AssociativeArray(); this.showsUpdated = new AssociativeArray(); this.usingSphericalTextureCoordinates = usingSphericalTextureCoordinates; @@ -87,16 +88,13 @@ Batch.prototype.add = function (time, updater, geometryInstance) { // Listen for show changes. These will be synchronized in updateShows. this.subscriptions.set( id, - updater.entity.definitionChanged.addEventListener(function ( - entity, - propertyName, - newValue, - oldValue - ) { - if (propertyName === "isShowing") { - that.showsUpdated.set(updater.id, updater); - } - }) + updater.entity.definitionChanged.addEventListener( + function (entity, propertyName, newValue, oldValue) { + if (propertyName === "isShowing") { + that.showsUpdated.set(updater.id, updater); + } + }, + ), ); } this.createPrimitive = true; @@ -109,7 +107,7 @@ Batch.prototype.remove = function (updater) { if (this.updaters.remove(id)) { this.rectangleCollisionCheck.remove( id, - geometryInstance.geometry.rectangle + geometryInstance.geometry.rectangle, ); this.updatersWithAttributes.remove(id); const unsubscribe = this.subscriptions.get(id); @@ -145,7 +143,7 @@ Batch.prototype.update = function (time) { this.material = MaterialProperty.getValue( time, this.materialProperty, - this.material + this.material, ); primitive = new GroundPrimitive({ @@ -186,7 +184,7 @@ Batch.prototype.update = function (time) { this.material = MaterialProperty.getValue( time, this.materialProperty, - this.material + this.material, ); this.primitive.appearance.material = this.material; @@ -209,7 +207,7 @@ Batch.prototype.update = function (time) { if (show !== currentShow) { attributes.show = ShowGeometryInstanceAttribute.toValue( show, - attributes.show + attributes.show, ); } @@ -220,22 +218,24 @@ Batch.prototype.update = function (time) { distanceDisplayConditionProperty, time, defaultDistanceDisplayCondition, - distanceDisplayConditionScratch + distanceDisplayConditionScratch, ); if ( !DistanceDisplayCondition.equals( distanceDisplayCondition, - attributes._lastDistanceDisplayCondition + attributes._lastDistanceDisplayCondition, ) ) { - attributes._lastDistanceDisplayCondition = DistanceDisplayCondition.clone( - distanceDisplayCondition, - attributes._lastDistanceDisplayCondition - ); - attributes.distanceDisplayCondition = DistanceDisplayConditionGeometryInstanceAttribute.toValue( - distanceDisplayCondition, - attributes.distanceDisplayCondition - ); + attributes._lastDistanceDisplayCondition = + DistanceDisplayCondition.clone( + distanceDisplayCondition, + attributes._lastDistanceDisplayCondition, + ); + attributes.distanceDisplayCondition = + DistanceDisplayConditionGeometryInstanceAttribute.toValue( + distanceDisplayCondition, + attributes.distanceDisplayCondition, + ); } } } @@ -266,7 +266,7 @@ Batch.prototype.updateShows = function (primitive) { if (show !== currentShow) { attributes.show = ShowGeometryInstanceAttribute.toValue( show, - attributes.show + attributes.show, ); instance.attributes.show.value[0] = attributes.show[0]; } @@ -314,7 +314,7 @@ Batch.prototype.destroy = function () { function StaticGroundGeometryPerMaterialBatch( primitives, classificationType, - appearanceType + appearanceType, ) { this._items = []; this._primitives = primitives; @@ -326,9 +326,10 @@ StaticGroundGeometryPerMaterialBatch.prototype.add = function (time, updater) { const items = this._items; const length = items.length; const geometryInstance = updater.createFillGeometryInstance(time); - const usingSphericalTextureCoordinates = ShadowVolumeAppearance.shouldUseSphericalCoordinates( - geometryInstance.geometry.rectangle - ); + const usingSphericalTextureCoordinates = + ShadowVolumeAppearance.shouldUseSphericalCoordinates( + geometryInstance.geometry.rectangle, + ); const zIndex = Property.getValueOrDefault(updater.zIndex, 0); // Check if the Entity represented by the updater can be placed in an existing batch. Requirements: // * compatible material (same material or same color) @@ -354,7 +355,7 @@ StaticGroundGeometryPerMaterialBatch.prototype.add = function (time, updater) { this._appearanceType, updater.fillMaterialProperty, usingSphericalTextureCoordinates, - zIndex + zIndex, ); batch.add(time, updater, geometryInstance); items.push(batch); @@ -402,7 +403,7 @@ StaticGroundGeometryPerMaterialBatch.prototype.update = function (time) { StaticGroundGeometryPerMaterialBatch.prototype.getBoundingSphere = function ( updater, - result + result, ) { const items = this._items; const length = items.length; @@ -415,12 +416,13 @@ StaticGroundGeometryPerMaterialBatch.prototype.getBoundingSphere = function ( return BoundingSphereState.FAILED; }; -StaticGroundGeometryPerMaterialBatch.prototype.removeAllPrimitives = function () { - const items = this._items; - const length = items.length; - for (let i = 0; i < length; i++) { - items[i].destroy(); - } - this._items.length = 0; -}; +StaticGroundGeometryPerMaterialBatch.prototype.removeAllPrimitives = + function () { + const items = this._items; + const length = items.length; + for (let i = 0; i < length; i++) { + items[i].destroy(); + } + this._items.length = 0; + }; export default StaticGroundGeometryPerMaterialBatch; diff --git a/packages/engine/Source/DataSources/StaticGroundPolylinePerMaterialBatch.js b/packages/engine/Source/DataSources/StaticGroundPolylinePerMaterialBatch.js index c1284c71d9ed..10cf346cf058 100644 --- a/packages/engine/Source/DataSources/StaticGroundPolylinePerMaterialBatch.js +++ b/packages/engine/Source/DataSources/StaticGroundPolylinePerMaterialBatch.js @@ -24,7 +24,7 @@ function Batch( classificationType, materialProperty, zIndex, - asynchronous + asynchronous, ) { let appearanceType; if (materialProperty instanceof ColorMaterialProperty) { @@ -46,10 +46,11 @@ function Batch( this.updatersWithAttributes = new AssociativeArray(); this.attributes = new AssociativeArray(); this.invalidated = false; - this.removeMaterialSubscription = materialProperty.definitionChanged.addEventListener( - Batch.prototype.onMaterialChanged, - this - ); + this.removeMaterialSubscription = + materialProperty.definitionChanged.addEventListener( + Batch.prototype.onMaterialChanged, + this, + ); this.subscriptions = new AssociativeArray(); this.showsUpdated = new AssociativeArray(); this.zIndex = zIndex; @@ -92,16 +93,13 @@ Batch.prototype.add = function (time, updater, geometryInstance) { // Listen for show changes. These will be synchronized in updateShows. this.subscriptions.set( id, - updater.entity.definitionChanged.addEventListener(function ( - entity, - propertyName, - newValue, - oldValue - ) { - if (propertyName === "isShowing") { - that.showsUpdated.set(updater.id, updater); - } - }) + updater.entity.definitionChanged.addEventListener( + function (entity, propertyName, newValue, oldValue) { + if (propertyName === "isShowing") { + that.showsUpdated.set(updater.id, updater); + } + }, + ), ); } this.createPrimitive = true; @@ -154,7 +152,7 @@ Batch.prototype.update = function (time) { this.material = MaterialProperty.getValue( time, this.materialProperty, - this.material + this.material, ); primitive.appearance.material = this.material; } @@ -187,7 +185,7 @@ Batch.prototype.update = function (time) { this.material = MaterialProperty.getValue( time, this.materialProperty, - this.material + this.material, ); this.primitive.appearance.material = this.material; } @@ -210,16 +208,16 @@ Batch.prototype.update = function (time) { colorProperty, time, Color.WHITE, - scratchColor + scratchColor, ); if (!Color.equals(attributes._lastColor, resultColor)) { attributes._lastColor = Color.clone( resultColor, - attributes._lastColor + attributes._lastColor, ); attributes.color = ColorGeometryInstanceAttribute.toValue( resultColor, - attributes.color + attributes.color, ); } } @@ -230,7 +228,7 @@ Batch.prototype.update = function (time) { if (show !== currentShow) { attributes.show = ShowGeometryInstanceAttribute.toValue( show, - attributes.show + attributes.show, ); } @@ -241,22 +239,24 @@ Batch.prototype.update = function (time) { distanceDisplayConditionProperty, time, defaultDistanceDisplayCondition, - distanceDisplayConditionScratch + distanceDisplayConditionScratch, ); if ( !DistanceDisplayCondition.equals( distanceDisplayCondition, - attributes._lastDistanceDisplayCondition + attributes._lastDistanceDisplayCondition, ) ) { - attributes._lastDistanceDisplayCondition = DistanceDisplayCondition.clone( - distanceDisplayCondition, - attributes._lastDistanceDisplayCondition - ); - attributes.distanceDisplayCondition = DistanceDisplayConditionGeometryInstanceAttribute.toValue( - distanceDisplayCondition, - attributes.distanceDisplayCondition - ); + attributes._lastDistanceDisplayCondition = + DistanceDisplayCondition.clone( + distanceDisplayCondition, + attributes._lastDistanceDisplayCondition, + ); + attributes.distanceDisplayCondition = + DistanceDisplayConditionGeometryInstanceAttribute.toValue( + distanceDisplayCondition, + attributes.distanceDisplayCondition, + ); } } } @@ -287,7 +287,7 @@ Batch.prototype.updateShows = function (primitive) { if (show !== currentShow) { attributes.show = ShowGeometryInstanceAttribute.toValue( show, - attributes.show + attributes.show, ); instance.attributes.show.value[0] = attributes.show[0]; } @@ -335,7 +335,7 @@ Batch.prototype.destroy = function () { function StaticGroundPolylinePerMaterialBatch( orderedGroundPrimitives, classificationType, - asynchronous + asynchronous, ) { this._items = []; this._orderedGroundPrimitives = orderedGroundPrimitives; @@ -362,7 +362,7 @@ StaticGroundPolylinePerMaterialBatch.prototype.add = function (time, updater) { this._classificationType, updater.fillMaterialProperty, zIndex, - this._asynchronous + this._asynchronous, ); batch.add(time, updater, geometryInstance); items.push(batch); @@ -410,7 +410,7 @@ StaticGroundPolylinePerMaterialBatch.prototype.update = function (time) { StaticGroundPolylinePerMaterialBatch.prototype.getBoundingSphere = function ( updater, - result + result, ) { const items = this._items; const length = items.length; @@ -423,12 +423,13 @@ StaticGroundPolylinePerMaterialBatch.prototype.getBoundingSphere = function ( return BoundingSphereState.FAILED; }; -StaticGroundPolylinePerMaterialBatch.prototype.removeAllPrimitives = function () { - const items = this._items; - const length = items.length; - for (let i = 0; i < length; i++) { - items[i].destroy(); - } - this._items.length = 0; -}; +StaticGroundPolylinePerMaterialBatch.prototype.removeAllPrimitives = + function () { + const items = this._items; + const length = items.length; + for (let i = 0; i < length; i++) { + items[i].destroy(); + } + this._items.length = 0; + }; export default StaticGroundPolylinePerMaterialBatch; diff --git a/packages/engine/Source/DataSources/StaticOutlineGeometryBatch.js b/packages/engine/Source/DataSources/StaticOutlineGeometryBatch.js index 5464a56a7886..17132917ba5d 100644 --- a/packages/engine/Source/DataSources/StaticOutlineGeometryBatch.js +++ b/packages/engine/Source/DataSources/StaticOutlineGeometryBatch.js @@ -51,16 +51,13 @@ Batch.prototype.add = function (updater, instance) { const that = this; this.subscriptions.set( id, - updater.entity.definitionChanged.addEventListener(function ( - entity, - propertyName, - newValue, - oldValue - ) { - if (propertyName === "isShowing") { - that.showsUpdated.set(updater.id, updater); - } - }) + updater.entity.definitionChanged.addEventListener( + function (entity, propertyName, newValue, oldValue) { + if (propertyName === "isShowing") { + that.showsUpdated.set(updater.id, updater); + } + }, + ), ); } }; @@ -158,16 +155,16 @@ Batch.prototype.update = function (time) { outlineColorProperty, time, Color.WHITE, - colorScratch + colorScratch, ); if (!Color.equals(attributes._lastColor, outlineColor)) { attributes._lastColor = Color.clone( outlineColor, - attributes._lastColor + attributes._lastColor, ); attributes.color = ColorGeometryInstanceAttribute.toValue( outlineColor, - attributes.color + attributes.color, ); if ( (this.translucent && attributes.color[3] === 255) || @@ -185,7 +182,7 @@ Batch.prototype.update = function (time) { if (show !== currentShow) { attributes.show = ShowGeometryInstanceAttribute.toValue( show, - attributes.show + attributes.show, ); } @@ -196,22 +193,24 @@ Batch.prototype.update = function (time) { distanceDisplayConditionProperty, time, defaultDistanceDisplayCondition, - distanceDisplayConditionScratch + distanceDisplayConditionScratch, ); if ( !DistanceDisplayCondition.equals( distanceDisplayCondition, - attributes._lastDistanceDisplayCondition + attributes._lastDistanceDisplayCondition, ) ) { - attributes._lastDistanceDisplayCondition = DistanceDisplayCondition.clone( - distanceDisplayCondition, - attributes._lastDistanceDisplayCondition - ); - attributes.distanceDisplayCondition = DistanceDisplayConditionGeometryInstanceAttribute.toValue( - distanceDisplayCondition, - attributes.distanceDisplayCondition - ); + attributes._lastDistanceDisplayCondition = + DistanceDisplayCondition.clone( + distanceDisplayCondition, + attributes._lastDistanceDisplayCondition, + ); + attributes.distanceDisplayCondition = + DistanceDisplayConditionGeometryInstanceAttribute.toValue( + distanceDisplayCondition, + attributes.distanceDisplayCondition, + ); } } @@ -221,16 +220,16 @@ Batch.prototype.update = function (time) { offsetProperty, time, defaultOffset, - offsetScratch + offsetScratch, ); if (!Cartesian3.equals(offset, attributes._lastOffset)) { attributes._lastOffset = Cartesian3.clone( offset, - attributes._lastOffset + attributes._lastOffset, ); attributes.offset = OffsetGeometryInstanceAttribute.toValue( offset, - attributes.offset + attributes.offset, ); } } @@ -264,7 +263,7 @@ Batch.prototype.updateShows = function (primitive) { if (show !== currentShow) { attributes.show = ShowGeometryInstanceAttribute.toValue( show, - attributes.show + attributes.show, ); instance.attributes.show.value[0] = attributes.show[0]; } @@ -423,7 +422,7 @@ StaticOutlineGeometryBatch.prototype.update = function (time) { StaticOutlineGeometryBatch.prototype.getBoundingSphere = function ( updater, - result + result, ) { let i; diff --git a/packages/engine/Source/DataSources/StripeMaterialProperty.js b/packages/engine/Source/DataSources/StripeMaterialProperty.js index 8fb83fe4f720..e071a4c571e4 100644 --- a/packages/engine/Source/DataSources/StripeMaterialProperty.js +++ b/packages/engine/Source/DataSources/StripeMaterialProperty.js @@ -159,13 +159,13 @@ StripeMaterialProperty.prototype.getValue = function (time, result) { this._evenColor, time, defaultEvenColor, - result.evenColor + result.evenColor, ); result.oddColor = Property.getValueOrClonedDefault( this._oddColor, time, defaultOddColor, - result.oddColor + result.oddColor, ); result.offset = Property.getValueOrDefault(this._offset, time, defaultOffset); result.repeat = Property.getValueOrDefault(this._repeat, time, defaultRepeat); diff --git a/packages/engine/Source/DataSources/TerrainOffsetProperty.js b/packages/engine/Source/DataSources/TerrainOffsetProperty.js index 329d1b136a2f..d4012b1d34f5 100644 --- a/packages/engine/Source/DataSources/TerrainOffsetProperty.js +++ b/packages/engine/Source/DataSources/TerrainOffsetProperty.js @@ -21,7 +21,7 @@ function TerrainOffsetProperty( scene, positionProperty, heightReferenceProperty, - extrudedHeightReferenceProperty + extrudedHeightReferenceProperty, ) { //>>includeStart('debug', pragmas.debug); Check.defined("scene", scene); @@ -48,19 +48,19 @@ function TerrainOffsetProperty( this._removeEventListener = scene.terrainProviderChanged.addEventListener( function () { that._updateClamping(); - } + }, ); this._removeModeListener = scene.morphComplete.addEventListener( function () { that._updateClamping(); - } + }, ); } if (positionProperty.isConstant) { const position = positionProperty.getValue( Iso8601.MINIMUM_VALUE, - scratchPosition + scratchPosition, ); if ( !defined(position) || @@ -75,7 +75,7 @@ function TerrainOffsetProperty( this._normal = scene.ellipsoid.geodeticSurfaceNormal( position, - this._normal + this._normal, ); } } @@ -125,7 +125,7 @@ TerrainOffsetProperty.prototype._updateClamping = function () { const ellipsoid = scene.ellipsoid; const cartographicPosition = ellipsoid.cartesianToCartographic( position, - this._cartographicPosition + this._cartographicPosition, ); const height = scene.getHeight(cartographicPosition, this._heightReference); @@ -143,7 +143,7 @@ TerrainOffsetProperty.prototype._updateClamping = function () { this._removeCallbackFunc = scene.updateHeight( cartographicPosition, updateFunction, - this._heightReference + this._heightReference, ); }; @@ -164,12 +164,12 @@ TerrainOffsetProperty.prototype.getValue = function (time, result) { const heightReference = Property.getValueOrDefault( this._heightReference, time, - HeightReference.NONE + HeightReference.NONE, ); const extrudedHeightReference = Property.getValueOrDefault( this._extrudedHeightReference, time, - HeightReference.NONE + HeightReference.NONE, ); if ( @@ -184,7 +184,7 @@ TerrainOffsetProperty.prototype.getValue = function (time, result) { return Cartesian3.multiplyByScalar( this._normal, this._terrainHeight, - result + result, ); } @@ -204,7 +204,7 @@ TerrainOffsetProperty.prototype.getValue = function (time, result) { return Cartesian3.multiplyByScalar( this._normal, this._terrainHeight, - result + result, ); } diff --git a/packages/engine/Source/DataSources/TimeIntervalCollectionPositionProperty.js b/packages/engine/Source/DataSources/TimeIntervalCollectionPositionProperty.js index 7813010f98c4..80e81e17f5e7 100644 --- a/packages/engine/Source/DataSources/TimeIntervalCollectionPositionProperty.js +++ b/packages/engine/Source/DataSources/TimeIntervalCollectionPositionProperty.js @@ -21,7 +21,7 @@ function TimeIntervalCollectionPositionProperty(referenceFrame) { this._intervals = new TimeIntervalCollection(); this._intervals.changedEvent.addEventListener( TimeIntervalCollectionPositionProperty.prototype._intervalsChanged, - this + this, ); this._referenceFrame = defaultValue(referenceFrame, ReferenceFrame.FIXED); } @@ -90,7 +90,7 @@ const timeScratch = new JulianDate(); */ TimeIntervalCollectionPositionProperty.prototype.getValue = function ( time, - result + result, ) { if (!defined(time)) { time = JulianDate.now(timeScratch); @@ -106,32 +106,29 @@ TimeIntervalCollectionPositionProperty.prototype.getValue = function ( * @param {Cartesian3} [result] The object to store the value into, if omitted, a new instance is created and returned. * @returns {Cartesian3 | undefined} The modified result parameter or a new instance if the result parameter was not supplied. */ -TimeIntervalCollectionPositionProperty.prototype.getValueInReferenceFrame = function ( - time, - referenceFrame, - result -) { - //>>includeStart('debug', pragmas.debug); - if (!defined(time)) { - throw new DeveloperError("time is required."); - } - if (!defined(referenceFrame)) { - throw new DeveloperError("referenceFrame is required."); - } - //>>includeEnd('debug'); +TimeIntervalCollectionPositionProperty.prototype.getValueInReferenceFrame = + function (time, referenceFrame, result) { + //>>includeStart('debug', pragmas.debug); + if (!defined(time)) { + throw new DeveloperError("time is required."); + } + if (!defined(referenceFrame)) { + throw new DeveloperError("referenceFrame is required."); + } + //>>includeEnd('debug'); - const position = this._intervals.findDataForIntervalContainingDate(time); - if (defined(position)) { - return PositionProperty.convertToReferenceFrame( - time, - position, - this._referenceFrame, - referenceFrame, - result - ); - } - return undefined; -}; + const position = this._intervals.findDataForIntervalContainingDate(time); + if (defined(position)) { + return PositionProperty.convertToReferenceFrame( + time, + position, + this._referenceFrame, + referenceFrame, + result, + ); + } + return undefined; + }; /** * Compares this property to the provided property and returns @@ -152,7 +149,8 @@ TimeIntervalCollectionPositionProperty.prototype.equals = function (other) { /** * @private */ -TimeIntervalCollectionPositionProperty.prototype._intervalsChanged = function () { - this._definitionChanged.raiseEvent(this); -}; +TimeIntervalCollectionPositionProperty.prototype._intervalsChanged = + function () { + this._definitionChanged.raiseEvent(this); + }; export default TimeIntervalCollectionPositionProperty; diff --git a/packages/engine/Source/DataSources/TimeIntervalCollectionProperty.js b/packages/engine/Source/DataSources/TimeIntervalCollectionProperty.js index f6325bc8a148..925d95376251 100644 --- a/packages/engine/Source/DataSources/TimeIntervalCollectionProperty.js +++ b/packages/engine/Source/DataSources/TimeIntervalCollectionProperty.js @@ -45,7 +45,7 @@ function TimeIntervalCollectionProperty() { this._intervals = new TimeIntervalCollection(); this._intervals.changedEvent.addEventListener( TimeIntervalCollectionProperty.prototype._intervalsChanged, - this + this, ); } diff --git a/packages/engine/Source/DataSources/VelocityOrientationProperty.js b/packages/engine/Source/DataSources/VelocityOrientationProperty.js index a4ab53537a23..0a0ef6d2527d 100644 --- a/packages/engine/Source/DataSources/VelocityOrientationProperty.js +++ b/packages/engine/Source/DataSources/VelocityOrientationProperty.js @@ -121,7 +121,7 @@ VelocityOrientationProperty.prototype.getValue = function (time, result) { const velocity = this._velocityVectorProperty._getValue( time, velocityScratch, - positionScratch + positionScratch, ); if (!defined(velocity)) { @@ -132,7 +132,7 @@ VelocityOrientationProperty.prototype.getValue = function (time, result) { positionScratch, velocity, this._ellipsoid, - rotationScratch + rotationScratch, ); return Quaternion.fromRotationMatrix(rotationScratch, result); }; @@ -150,7 +150,7 @@ VelocityOrientationProperty.prototype.equals = function (other) { (other instanceof VelocityOrientationProperty && Property.equals( this._velocityVectorProperty, - other._velocityVectorProperty + other._velocityVectorProperty, ) && (this._ellipsoid === other._ellipsoid || this._ellipsoid.equals(other._ellipsoid))) diff --git a/packages/engine/Source/DataSources/VelocityVectorProperty.js b/packages/engine/Source/DataSources/VelocityVectorProperty.js index 3d0b9d900c83..a700d1e01f34 100644 --- a/packages/engine/Source/DataSources/VelocityVectorProperty.js +++ b/packages/engine/Source/DataSources/VelocityVectorProperty.js @@ -85,7 +85,7 @@ Object.defineProperties(VelocityVectorProperty.prototype, { function () { this._definitionChanged.raiseEvent(this); }, - this + this, ); } @@ -138,7 +138,7 @@ VelocityVectorProperty.prototype.getValue = function (time, result) { VelocityVectorProperty.prototype._getValue = function ( time, velocityResult, - positionResult + positionResult, ) { if (!defined(time)) { time = JulianDate.now(timeNowScratch); @@ -158,7 +158,7 @@ VelocityVectorProperty.prototype._getValue = function ( let position1 = property.getValue(time, position1Scratch); let position2 = property.getValue( JulianDate.addSeconds(time, step, timeScratch), - position2Scratch + position2Scratch, ); //If we don't have a position for now, return undefined. @@ -171,7 +171,7 @@ VelocityVectorProperty.prototype._getValue = function ( position2 = position1; position1 = property.getValue( JulianDate.addSeconds(time, -step, timeScratch), - position2Scratch + position2Scratch, ); if (!defined(position1)) { diff --git a/packages/engine/Source/DataSources/WallGeometryUpdater.js b/packages/engine/Source/DataSources/WallGeometryUpdater.js index 45c01e0cd742..a205426a14c6 100644 --- a/packages/engine/Source/DataSources/WallGeometryUpdater.js +++ b/packages/engine/Source/DataSources/WallGeometryUpdater.js @@ -67,7 +67,7 @@ WallGeometryUpdater.prototype.createFillGeometryInstance = function (time) { if (!this._fillEnabled) { throw new DeveloperError( - "This instance does not represent a filled geometry." + "This instance does not represent a filled geometry.", ); } //>>includeEnd('debug'); @@ -82,14 +82,14 @@ WallGeometryUpdater.prototype.createFillGeometryInstance = function (time) { isAvailable && entity.isShowing && this._showProperty.getValue(time) && - this._fillProperty.getValue(time) - ); - const distanceDisplayCondition = this._distanceDisplayConditionProperty.getValue( - time - ); - const distanceDisplayConditionAttribute = DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition( - distanceDisplayCondition + this._fillProperty.getValue(time), ); + const distanceDisplayCondition = + this._distanceDisplayConditionProperty.getValue(time); + const distanceDisplayConditionAttribute = + DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition( + distanceDisplayCondition, + ); if (this._materialProperty instanceof ColorMaterialProperty) { let currentColor; if ( @@ -135,7 +135,7 @@ WallGeometryUpdater.prototype.createOutlineGeometryInstance = function (time) { if (!this._outlineEnabled) { throw new DeveloperError( - "This instance does not represent an outlined geometry." + "This instance does not represent an outlined geometry.", ); } //>>includeEnd('debug'); @@ -146,11 +146,10 @@ WallGeometryUpdater.prototype.createOutlineGeometryInstance = function (time) { this._outlineColorProperty, time, Color.BLACK, - scratchColor - ); - const distanceDisplayCondition = this._distanceDisplayConditionProperty.getValue( - time + scratchColor, ); + const distanceDisplayCondition = + this._distanceDisplayConditionProperty.getValue(time); return new GeometryInstance({ id: entity, @@ -160,12 +159,13 @@ WallGeometryUpdater.prototype.createOutlineGeometryInstance = function (time) { isAvailable && entity.isShowing && this._showProperty.getValue(time) && - this._showOutlineProperty.getValue(time) + this._showOutlineProperty.getValue(time), ), color: ColorGeometryInstanceAttribute.fromColor(outlineColor), - distanceDisplayCondition: DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition( - distanceDisplayCondition - ), + distanceDisplayCondition: + DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition( + distanceDisplayCondition, + ), }, }); }; @@ -204,7 +204,7 @@ WallGeometryUpdater.prototype._setStaticOptions = function (entity, wall) { : MaterialAppearance.MaterialSupport.TEXTURED.vertexFormat; options.positions = wall.positions.getValue( Iso8601.MINIMUM_VALUE, - options.positions + options.positions, ); options.minimumHeights = defined(minimumHeights) ? minimumHeights.getValue(Iso8601.MINIMUM_VALUE, options.minimumHeights) @@ -225,19 +225,19 @@ WallGeometryUpdater.DynamicGeometryUpdater = DynamicWallGeometryUpdater; function DynamicWallGeometryUpdater( geometryUpdater, primitives, - groundPrimitives + groundPrimitives, ) { DynamicGeometryUpdater.call( this, geometryUpdater, primitives, - groundPrimitives + groundPrimitives, ); } if (defined(Object.create)) { DynamicWallGeometryUpdater.prototype = Object.create( - DynamicGeometryUpdater.prototype + DynamicGeometryUpdater.prototype, ); DynamicWallGeometryUpdater.prototype.constructor = DynamicWallGeometryUpdater; } @@ -252,23 +252,23 @@ DynamicWallGeometryUpdater.prototype._isHidden = function (entity, wall, time) { DynamicWallGeometryUpdater.prototype._setOptions = function ( entity, wall, - time + time, ) { const options = this._options; options.positions = Property.getValueOrUndefined( wall.positions, time, - options.positions + options.positions, ); options.minimumHeights = Property.getValueOrUndefined( wall.minimumHeights, time, - options.minimumHeights + options.minimumHeights, ); options.maximumHeights = Property.getValueOrUndefined( wall.maximumHeights, time, - options.maximumHeights + options.maximumHeights, ); options.granularity = Property.getValueOrUndefined(wall.granularity, time); }; diff --git a/packages/engine/Source/DataSources/WallGraphics.js b/packages/engine/Source/DataSources/WallGraphics.js index 05653c9225bf..247669354a38 100644 --- a/packages/engine/Source/DataSources/WallGraphics.js +++ b/packages/engine/Source/DataSources/WallGraphics.js @@ -177,7 +177,7 @@ Object.defineProperties(WallGraphics.prototype, { * @type {Property|undefined} */ distanceDisplayCondition: createPropertyDescriptor( - "distanceDisplayCondition" + "distanceDisplayCondition", ), }); @@ -223,11 +223,11 @@ WallGraphics.prototype.merge = function (source) { this.positions = defaultValue(this.positions, source.positions); this.minimumHeights = defaultValue( this.minimumHeights, - source.minimumHeights + source.minimumHeights, ); this.maximumHeights = defaultValue( this.maximumHeights, - source.maximumHeights + source.maximumHeights, ); this.granularity = defaultValue(this.granularity, source.granularity); this.fill = defaultValue(this.fill, source.fill); @@ -238,7 +238,7 @@ WallGraphics.prototype.merge = function (source) { this.shadows = defaultValue(this.shadows, source.shadows); this.distanceDisplayCondition = defaultValue( this.distanceDisplayCondition, - source.distanceDisplayCondition + source.distanceDisplayCondition, ); }; export default WallGraphics; diff --git a/packages/engine/Source/DataSources/createPropertyDescriptor.js b/packages/engine/Source/DataSources/createPropertyDescriptor.js index 689757dba97b..82b45b5d95b4 100644 --- a/packages/engine/Source/DataSources/createPropertyDescriptor.js +++ b/packages/engine/Source/DataSources/createPropertyDescriptor.js @@ -7,7 +7,7 @@ function createProperty( privateName, subscriptionName, configurable, - createPropertyCallback + createPropertyCallback, ) { return { configurable: configurable, @@ -41,7 +41,7 @@ function createProperty( function () { this._definitionChanged.raiseEvent(this, name, value, value); }, - this + this, ); } }, @@ -66,7 +66,7 @@ function createPropertyDescriptor(name, configurable, createPropertyCallback) { `_${name.toString()}`, `_${name.toString()}Subscription`, defaultValue(configurable, false), - defaultValue(createPropertyCallback, createConstantProperty) + defaultValue(createPropertyCallback, createConstantProperty), ); } export default createPropertyDescriptor; diff --git a/packages/engine/Source/DataSources/exportKml.js b/packages/engine/Source/DataSources/exportKml.js index 64b85afee4bc..3a0eff321c2b 100644 --- a/packages/engine/Source/DataSources/exportKml.js +++ b/packages/engine/Source/DataSources/exportKml.js @@ -97,7 +97,7 @@ ExternalFileHandler.prototype.model = function (model, time) { const modelCallback = this._modelCallback; if (!defined(modelCallback)) { throw new RuntimeError( - "Encountered a model entity while exporting to KML, but no model callback was supplied." + "Encountered a model entity while exporting to KML, but no model callback was supplied.", ); } @@ -374,7 +374,7 @@ exportKml._createState = function (options) { // Figure out how we will sample dynamic position properties let defaultAvailability = defaultValue( options.defaultAvailability, - entityAvailability + entityAvailability, ); const sampleDuration = defaultValue(options.sampleDuration, 60); @@ -388,7 +388,7 @@ exportKml._createState = function (options) { JulianDate.addSeconds( defaultAvailability.stop, -10 * sampleDuration, - defaultAvailability.start + defaultAvailability.start, ); } } else if (defaultAvailability.stop === Iso8601.MAXIMUM_VALUE) { @@ -396,7 +396,7 @@ exportKml._createState = function (options) { JulianDate.addSeconds( defaultAvailability.start, 10 * sampleDuration, - defaultAvailability.stop + defaultAvailability.stop, ); } @@ -449,8 +449,8 @@ function recurseEntities(state, parentNode, entities) { createBasicElementWithText( kmlDoc, "begin", - JulianDate.toIso8601(availability.start) - ) + JulianDate.toIso8601(availability.start), + ), ); } @@ -459,8 +459,8 @@ function recurseEntities(state, parentNode, entities) { createBasicElementWithText( kmlDoc, "end", - JulianDate.toIso8601(availability.stop) - ) + JulianDate.toIso8601(availability.stop), + ), ); } } @@ -470,13 +470,13 @@ function recurseEntities(state, parentNode, entities) { overlay.setAttribute("id", idManager.get(entity.id)); overlay.appendChild( - createBasicElementWithText(kmlDoc, "name", entity.name) + createBasicElementWithText(kmlDoc, "name", entity.name), ); overlay.appendChild( - createBasicElementWithText(kmlDoc, "visibility", entity.show) + createBasicElementWithText(kmlDoc, "visibility", entity.show), ); overlay.appendChild( - createBasicElementWithText(kmlDoc, "description", entity.description) + createBasicElementWithText(kmlDoc, "description", entity.description), ); if (defined(timeSpan)) { @@ -503,17 +503,17 @@ function recurseEntities(state, parentNode, entities) { const color = valueGetter.getColor(labelGraphics.fillColor); if (defined(color)) { labelStyle.appendChild( - createBasicElementWithText(kmlDoc, "color", color) + createBasicElementWithText(kmlDoc, "color", color), ); labelStyle.appendChild( - createBasicElementWithText(kmlDoc, "colorMode", "normal") + createBasicElementWithText(kmlDoc, "colorMode", "normal"), ); } const scale = valueGetter.get(labelGraphics.scale); if (defined(scale)) { labelStyle.appendChild( - createBasicElementWithText(kmlDoc, "scale", scale) + createBasicElementWithText(kmlDoc, "scale", scale), ); } @@ -522,10 +522,10 @@ function recurseEntities(state, parentNode, entities) { placemark.appendChild(createBasicElementWithText(kmlDoc, "name", name)); placemark.appendChild( - createBasicElementWithText(kmlDoc, "visibility", entity.show) + createBasicElementWithText(kmlDoc, "visibility", entity.show), ); placemark.appendChild( - createBasicElementWithText(kmlDoc, "description", entity.description) + createBasicElementWithText(kmlDoc, "description", entity.description), ); if (defined(timeSpan)) { @@ -542,7 +542,7 @@ function recurseEntities(state, parentNode, entities) { } placemark.appendChild( - createBasicElementWithText(kmlDoc, "styleUrl", styleCache.get(style)) + createBasicElementWithText(kmlDoc, "styleUrl", styleCache.get(style)), ); } @@ -566,13 +566,13 @@ function recurseEntities(state, parentNode, entities) { const folderNode = kmlDoc.createElement("Folder"); folderNode.setAttribute("id", idManager.get(entity.id)); folderNode.appendChild( - createBasicElementWithText(kmlDoc, "name", entity.name) + createBasicElementWithText(kmlDoc, "name", entity.name), ); folderNode.appendChild( - createBasicElementWithText(kmlDoc, "visibility", entity.show) + createBasicElementWithText(kmlDoc, "visibility", entity.show), ); folderNode.appendChild( - createBasicElementWithText(kmlDoc, "description", entity.description) + createBasicElementWithText(kmlDoc, "description", entity.description), ); parentNode.appendChild(folderNode); @@ -607,7 +607,7 @@ function createPoint(state, entity, geometries, styles) { const coordinates = createBasicElementWithText( kmlDoc, "coordinates", - getCoordinates(scratchCartesian3, ellipsoid) + getCoordinates(scratchCartesian3, ellipsoid), ); const pointGeometry = kmlDoc.createElement("Point"); @@ -615,7 +615,7 @@ function createPoint(state, entity, geometries, styles) { // Set altitude mode const altitudeMode = kmlDoc.createElement("altitudeMode"); altitudeMode.appendChild( - getAltitudeMode(state, pointGraphics.heightReference) + getAltitudeMode(state, pointGraphics.heightReference), ); pointGeometry.appendChild(altitudeMode); @@ -661,16 +661,16 @@ function createTracks(state, entity, pointGraphics, geometries, styles) { if (positionProperty instanceof ScaledPositionProperty) { positionProperty = positionProperty._value; trackAltitudeMode.appendChild( - getAltitudeMode(state, HeightReference.CLAMP_TO_GROUND) + getAltitudeMode(state, HeightReference.CLAMP_TO_GROUND), ); } else if (defined(pointGraphics)) { trackAltitudeMode.appendChild( - getAltitudeMode(state, pointGraphics.heightReference) + getAltitudeMode(state, pointGraphics.heightReference), ); } else { // Path graphics only, which has no height reference trackAltitudeMode.appendChild( - getAltitudeMode(state, HeightReference.NONE) + getAltitudeMode(state, HeightReference.NONE), ); } @@ -682,7 +682,7 @@ function createTracks(state, entity, pointGraphics, geometries, styles) { const constCoordinates = createBasicElementWithText( kmlDoc, "coordinates", - getCoordinates(scratchCartesian3, ellipsoid) + getCoordinates(scratchCartesian3, ellipsoid), ); // This interval is constant so add a track with the same position @@ -698,7 +698,7 @@ function createTracks(state, entity, pointGraphics, geometries, styles) { positionProperty.getValueInReferenceFrame( times[j], ReferenceFrame.FIXED, - scratchCartesian3 + scratchCartesian3, ); positionValues.push(getCoordinates(scratchCartesian3, ellipsoid)); } @@ -748,7 +748,7 @@ function createTracks(state, entity, pointGraphics, geometries, styles) { kmlDoc, "coord", positionValues[k], - gxNamespace + gxNamespace, ); trackGeometry.appendChild(when); @@ -768,7 +768,7 @@ function createTracks(state, entity, pointGraphics, geometries, styles) { } else if (tracks.length > 1) { const multiTrackGeometry = kmlDoc.createElementNS( gxNamespace, - "MultiTrack" + "MultiTrack", ); for (i = 0; i < tracks.length; ++i) { @@ -796,7 +796,7 @@ function createTracks(state, entity, pointGraphics, geometries, styles) { const lineStyle = kmlDoc.createElement("LineStyle"); if (defined(width)) { lineStyle.appendChild( - createBasicElementWithText(kmlDoc, "width", width) + createBasicElementWithText(kmlDoc, "width", width), ); } @@ -816,14 +816,14 @@ function createIconStyleFromPoint(state, pointGraphics) { if (defined(color)) { iconStyle.appendChild(createBasicElementWithText(kmlDoc, "color", color)); iconStyle.appendChild( - createBasicElementWithText(kmlDoc, "colorMode", "normal") + createBasicElementWithText(kmlDoc, "colorMode", "normal"), ); } const pixelSize = valueGetter.get(pointGraphics.pixelSize); if (defined(pixelSize)) { iconStyle.appendChild( - createBasicElementWithText(kmlDoc, "scale", pixelSize / BILLBOARD_SIZE) + createBasicElementWithText(kmlDoc, "scale", pixelSize / BILLBOARD_SIZE), ); } @@ -847,26 +847,26 @@ function createIconStyleFromBillboard(state, billboardGraphics) { const imageSubRegion = valueGetter.get(billboardGraphics.imageSubRegion); if (defined(imageSubRegion)) { icon.appendChild( - createBasicElementWithText(kmlDoc, "x", imageSubRegion.x, gxNamespace) + createBasicElementWithText(kmlDoc, "x", imageSubRegion.x, gxNamespace), ); icon.appendChild( - createBasicElementWithText(kmlDoc, "y", imageSubRegion.y, gxNamespace) + createBasicElementWithText(kmlDoc, "y", imageSubRegion.y, gxNamespace), ); icon.appendChild( createBasicElementWithText( kmlDoc, "w", imageSubRegion.width, - gxNamespace - ) + gxNamespace, + ), ); icon.appendChild( createBasicElementWithText( kmlDoc, "h", imageSubRegion.height, - gxNamespace - ) + gxNamespace, + ), ); } @@ -877,7 +877,7 @@ function createIconStyleFromBillboard(state, billboardGraphics) { if (defined(color)) { iconStyle.appendChild(createBasicElementWithText(kmlDoc, "color", color)); iconStyle.appendChild( - createBasicElementWithText(kmlDoc, "colorMode", "normal") + createBasicElementWithText(kmlDoc, "colorMode", "normal"), ); } @@ -900,7 +900,7 @@ function createIconStyleFromBillboard(state, billboardGraphics) { // Move to left const horizontalOrigin = valueGetter.get( billboardGraphics.horizontalOrigin, - HorizontalOrigin.CENTER + HorizontalOrigin.CENTER, ); if (horizontalOrigin === HorizontalOrigin.CENTER) { pixelOffset.x -= width * 0.5; @@ -911,7 +911,7 @@ function createIconStyleFromBillboard(state, billboardGraphics) { // Move to bottom const verticalOrigin = valueGetter.get( billboardGraphics.verticalOrigin, - VerticalOrigin.CENTER + VerticalOrigin.CENTER, ); if (verticalOrigin === VerticalOrigin.TOP) { pixelOffset.y += height; @@ -939,7 +939,7 @@ function createIconStyleFromBillboard(state, billboardGraphics) { } iconStyle.appendChild( - createBasicElementWithText(kmlDoc, "heading", rotation) + createBasicElementWithText(kmlDoc, "heading", rotation), ); } @@ -963,7 +963,7 @@ function createLineString(state, polylineGraphics, geometries, styles) { let altitudeModeText; if (clampToGround) { lineStringGeometry.appendChild( - createBasicElementWithText(kmlDoc, "tessellate", true) + createBasicElementWithText(kmlDoc, "tessellate", true), ); altitudeModeText = kmlDoc.createTextNode("clampToGround"); } else { @@ -978,7 +978,7 @@ function createLineString(state, polylineGraphics, geometries, styles) { const coordinates = createBasicElementWithText( kmlDoc, "coordinates", - getCoordinates(cartesians, ellipsoid) + getCoordinates(cartesians, ellipsoid), ); lineStringGeometry.appendChild(coordinates); @@ -986,7 +986,7 @@ function createLineString(state, polylineGraphics, geometries, styles) { const zIndex = valueGetter.get(polylineGraphics.zIndex); if (clampToGround && defined(zIndex)) { lineStringGeometry.appendChild( - createBasicElementWithText(kmlDoc, "drawOrder", zIndex, gxNamespace) + createBasicElementWithText(kmlDoc, "drawOrder", zIndex, gxNamespace), ); } @@ -1032,15 +1032,15 @@ function getRectangleBoundaries(state, rectangleGraphics, extrudedHeight) { cornerFunction[i](rectangle, scratchCartographic); coordinateStrings.push( `${CesiumMath.toDegrees( - scratchCartographic.longitude - )},${CesiumMath.toDegrees(scratchCartographic.latitude)},${height}` + scratchCartographic.longitude, + )},${CesiumMath.toDegrees(scratchCartographic.latitude)},${height}`, ); } const coordinates = createBasicElementWithText( kmlDoc, "coordinates", - coordinateStrings.join(" ") + coordinateStrings.join(" "), ); const outerBoundaryIs = kmlDoc.createElement("outerBoundaryIs"); @@ -1061,17 +1061,17 @@ function getLinearRing(state, positions, height, perPositionHeight) { Cartographic.fromCartesian(positions[i], ellipsoid, scratchCartographic); coordinateStrings.push( `${CesiumMath.toDegrees( - scratchCartographic.longitude + scratchCartographic.longitude, )},${CesiumMath.toDegrees(scratchCartographic.latitude)},${ perPositionHeight ? scratchCartographic.height : height - }` + }`, ); } const coordinates = createBasicElementWithText( kmlDoc, "coordinates", - coordinateStrings.join(" ") + coordinateStrings.join(" "), ); const linearRing = kmlDoc.createElement("LinearRing"); linearRing.appendChild(coordinates); @@ -1086,7 +1086,7 @@ function getPolygonBoundaries(state, polygonGraphics, extrudedHeight) { let height = valueGetter.get(polygonGraphics.height, 0.0); const perPositionHeight = valueGetter.get( polygonGraphics.perPositionHeight, - false + false, ); if (!perPositionHeight && extrudedHeight > 0) { @@ -1105,7 +1105,7 @@ function getPolygonBoundaries(state, polygonGraphics, extrudedHeight) { // Polygon boundaries const outerBoundaryIs = kmlDoc.createElement("outerBoundaryIs"); outerBoundaryIs.appendChild( - getLinearRing(state, positions, height, perPositionHeight) + getLinearRing(state, positions, height, perPositionHeight), ); boundaries.push(outerBoundaryIs); @@ -1116,7 +1116,7 @@ function getPolygonBoundaries(state, polygonGraphics, extrudedHeight) { for (let i = 0; i < holeCount; ++i) { const innerBoundaryIs = kmlDoc.createElement("innerBoundaryIs"); innerBoundaryIs.appendChild( - getLinearRing(state, holes[i].positions, height, perPositionHeight) + getLinearRing(state, holes[i].positions, height, perPositionHeight), ); boundaries.push(innerBoundaryIs); } @@ -1148,7 +1148,7 @@ function createPolygon(state, geometry, geometries, styles, overlays) { const extrudedHeight = valueGetter.get(geometry.extrudedHeight, 0.0); if (extrudedHeight > 0) { polygonGeometry.appendChild( - createBasicElementWithText(kmlDoc, "extrude", true) + createBasicElementWithText(kmlDoc, "extrude", true), ); } @@ -1182,7 +1182,7 @@ function createPolygon(state, geometry, geometries, styles, overlays) { const outline = valueGetter.get(geometry.outline, false); if (outline) { polyStyle.appendChild( - createBasicElementWithText(kmlDoc, "outline", outline) + createBasicElementWithText(kmlDoc, "outline", outline), ); // Outline uses LineStyle @@ -1190,18 +1190,18 @@ function createPolygon(state, geometry, geometries, styles, overlays) { const outlineWidth = valueGetter.get(geometry.outlineWidth, 1.0); lineStyle.appendChild( - createBasicElementWithText(kmlDoc, "width", outlineWidth) + createBasicElementWithText(kmlDoc, "width", outlineWidth), ); const outlineColor = valueGetter.getColor( geometry.outlineColor, - Color.BLACK + Color.BLACK, ); lineStyle.appendChild( - createBasicElementWithText(kmlDoc, "color", outlineColor) + createBasicElementWithText(kmlDoc, "color", outlineColor), ); lineStyle.appendChild( - createBasicElementWithText(kmlDoc, "colorMode", "normal") + createBasicElementWithText(kmlDoc, "colorMode", "normal"), ); styles.push(lineStyle); @@ -1220,14 +1220,14 @@ function createGroundOverlay(state, rectangleGraphics, overlays) { // Set altitude mode const altitudeMode = kmlDoc.createElement("altitudeMode"); altitudeMode.appendChild( - getAltitudeMode(state, rectangleGraphics.heightReference) + getAltitudeMode(state, rectangleGraphics.heightReference), ); groundOverlay.appendChild(altitudeMode); const height = valueGetter.get(rectangleGraphics.height); if (defined(height)) { groundOverlay.appendChild( - createBasicElementWithText(kmlDoc, "altitude", height) + createBasicElementWithText(kmlDoc, "altitude", height), ); } @@ -1237,29 +1237,29 @@ function createGroundOverlay(state, rectangleGraphics, overlays) { createBasicElementWithText( kmlDoc, "north", - CesiumMath.toDegrees(rectangle.north) - ) + CesiumMath.toDegrees(rectangle.north), + ), ); latLonBox.appendChild( createBasicElementWithText( kmlDoc, "south", - CesiumMath.toDegrees(rectangle.south) - ) + CesiumMath.toDegrees(rectangle.south), + ), ); latLonBox.appendChild( createBasicElementWithText( kmlDoc, "east", - CesiumMath.toDegrees(rectangle.east) - ) + CesiumMath.toDegrees(rectangle.east), + ), ); latLonBox.appendChild( createBasicElementWithText( kmlDoc, "west", - CesiumMath.toDegrees(rectangle.west) - ) + CesiumMath.toDegrees(rectangle.west), + ), ); groundOverlay.appendChild(latLonBox); @@ -1273,7 +1273,11 @@ function createGroundOverlay(state, rectangleGraphics, overlays) { const color = material.color; if (defined(color)) { groundOverlay.appendChild( - createBasicElementWithText(kmlDoc, "color", colorToString(material.color)) + createBasicElementWithText( + kmlDoc, + "color", + colorToString(material.color), + ), ); } @@ -1326,7 +1330,7 @@ function createModel(state, entity, modelGraphics, geometries, styles) { // Set altitude mode const altitudeMode = kmlDoc.createElement("altitudeMode"); altitudeMode.appendChild( - getAltitudeMode(state, modelGraphics.heightReference) + getAltitudeMode(state, modelGraphics.heightReference), ); modelGeometry.appendChild(altitudeMode); @@ -1337,18 +1341,18 @@ function createModel(state, entity, modelGraphics, geometries, styles) { createBasicElementWithText( kmlDoc, "longitude", - CesiumMath.toDegrees(scratchCartographic.longitude) - ) + CesiumMath.toDegrees(scratchCartographic.longitude), + ), ); location.appendChild( createBasicElementWithText( kmlDoc, "latitude", - CesiumMath.toDegrees(scratchCartographic.latitude) - ) + CesiumMath.toDegrees(scratchCartographic.latitude), + ), ); location.appendChild( - createBasicElementWithText(kmlDoc, "altitude", scratchCartographic.height) + createBasicElementWithText(kmlDoc, "altitude", scratchCartographic.height), ); modelGeometry.appendChild(location); @@ -1395,16 +1399,16 @@ function processMaterial(state, materialProperty, style) { kmlDoc, "outerColor", outlineColor, - gxNamespace - ) + gxNamespace, + ), ); style.appendChild( createBasicElementWithText( kmlDoc, "outerWidth", outlineWidth, - gxNamespace - ) + gxNamespace, + ), ); break; case "Stripe": @@ -1415,7 +1419,7 @@ function processMaterial(state, materialProperty, style) { if (defined(color)) { style.appendChild(createBasicElementWithText(kmlDoc, "color", color)); style.appendChild( - createBasicElementWithText(kmlDoc, "colorMode", "normal") + createBasicElementWithText(kmlDoc, "colorMode", "normal"), ); } } @@ -1426,7 +1430,7 @@ function getAltitudeMode(state, heightReferenceProperty) { const heightReference = valueGetter.get( heightReferenceProperty, - HeightReference.NONE + HeightReference.NONE, ); let altitudeModeText; switch (heightReference) { @@ -1455,10 +1459,10 @@ function getCoordinates(coordinates, ellipsoid) { Cartographic.fromCartesian(coordinates[i], ellipsoid, scratchCartographic); coordinateStrings.push( `${CesiumMath.toDegrees( - scratchCartographic.longitude + scratchCartographic.longitude, )},${CesiumMath.toDegrees(scratchCartographic.latitude)},${ scratchCartographic.height - }` + }`, ); } @@ -1469,7 +1473,7 @@ function createBasicElementWithText( kmlDoc, elementName, elementValue, - namespace + namespace, ) { elementValue = defaultValue(elementValue, ""); diff --git a/packages/engine/Source/DataSources/getElement.js b/packages/engine/Source/DataSources/getElement.js index 987275ff8e59..fdfaf462b70f 100644 --- a/packages/engine/Source/DataSources/getElement.js +++ b/packages/engine/Source/DataSources/getElement.js @@ -14,7 +14,7 @@ function getElement(element) { //>>includeStart('debug', pragmas.debug); if (foundElement === null) { throw new DeveloperError( - `Element with id "${element}" does not exist in the document.` + `Element with id "${element}" does not exist in the document.`, ); } //>>includeEnd('debug'); diff --git a/packages/engine/Source/DataSources/heightReferenceOnEntityPropertyChanged.js b/packages/engine/Source/DataSources/heightReferenceOnEntityPropertyChanged.js index 14ce1744eb8f..73e1ab26b623 100644 --- a/packages/engine/Source/DataSources/heightReferenceOnEntityPropertyChanged.js +++ b/packages/engine/Source/DataSources/heightReferenceOnEntityPropertyChanged.js @@ -7,14 +7,14 @@ function heightReferenceOnEntityPropertyChanged( entity, propertyName, newValue, - oldValue + oldValue, ) { GeometryUpdater.prototype._onEntityPropertyChanged.call( this, entity, propertyName, newValue, - oldValue + oldValue, ); if (this._observedPropertyNames.indexOf(propertyName) === -1) { return; @@ -35,12 +35,12 @@ function heightReferenceOnEntityPropertyChanged( if (defined(heightReferenceProperty)) { const centerPosition = new CallbackProperty( this._computeCenter.bind(this), - !this._dynamic + !this._dynamic, ); this._terrainOffsetProperty = new TerrainOffsetProperty( this._scene, centerPosition, - heightReferenceProperty + heightReferenceProperty, ); } } diff --git a/packages/engine/Source/Renderer/AutomaticUniforms.js b/packages/engine/Source/Renderer/AutomaticUniforms.js index 41628876c8b7..53e028aca287 100644 --- a/packages/engine/Source/Renderer/AutomaticUniforms.js +++ b/packages/engine/Source/Renderer/AutomaticUniforms.js @@ -1330,7 +1330,7 @@ const AutomaticUniforms = { getValue: function (uniformState) { return Matrix4.getTranslation( uniformState.inverseView, - viewerPositionWCScratch + viewerPositionWCScratch, ); }, }), diff --git a/packages/engine/Source/Renderer/Buffer.js b/packages/engine/Source/Renderer/Buffer.js index 641e8cc5c967..27c1be7a8aa6 100644 --- a/packages/engine/Source/Renderer/Buffer.js +++ b/packages/engine/Source/Renderer/Buffer.js @@ -19,13 +19,13 @@ function Buffer(options) { if (!defined(options.typedArray) && !defined(options.sizeInBytes)) { throw new DeveloperError( - "Either options.sizeInBytes or options.typedArray is required." + "Either options.sizeInBytes or options.typedArray is required.", ); } if (defined(options.typedArray) && defined(options.sizeInBytes)) { throw new DeveloperError( - "Cannot pass in both options.sizeInBytes and options.typedArray." + "Cannot pass in both options.sizeInBytes and options.typedArray.", ); } @@ -33,7 +33,7 @@ function Buffer(options) { Check.typeOf.object("options.typedArray", options.typedArray); Check.typeOf.number( "options.typedArray.byteLength", - options.typedArray.byteLength + options.typedArray.byteLength, ); } @@ -184,7 +184,7 @@ Buffer.createIndexBuffer = function (options) { !options.context.elementIndexUint ) { throw new DeveloperError( - "IndexDatatype.UNSIGNED_INT requires OES_element_index_uint, which is not supported on this system. Check context.elementIndexUint." + "IndexDatatype.UNSIGNED_INT requires OES_element_index_uint, which is not supported on this system. Check context.elementIndexUint.", ); } //>>includeEnd('debug'); @@ -250,7 +250,7 @@ Buffer.prototype.copyFromArrayView = function (arrayView, offsetInBytes) { Check.typeOf.number.lessThanOrEquals( "offsetInBytes + arrayView.byteLength", offsetInBytes + arrayView.byteLength, - this._sizeInBytes + this._sizeInBytes, ); //>>includeEnd('debug'); @@ -265,7 +265,7 @@ Buffer.prototype.copyFromBuffer = function ( readBuffer, readOffset, writeOffset, - sizeInBytes + sizeInBytes, ) { //>>includeStart('debug', pragmas.debug); if (!this._webgl2) { @@ -276,7 +276,7 @@ Buffer.prototype.copyFromBuffer = function ( } if (!defined(sizeInBytes) || sizeInBytes <= 0) { throw new DeveloperError( - "sizeInBytes must be defined and be greater than zero." + "sizeInBytes must be defined and be greater than zero.", ); } if ( @@ -285,7 +285,7 @@ Buffer.prototype.copyFromBuffer = function ( readOffset + sizeInBytes > readBuffer._sizeInBytes ) { throw new DeveloperError( - "readOffset must be greater than or equal to zero and readOffset + sizeInBytes must be less than of equal to readBuffer.sizeInBytes." + "readOffset must be greater than or equal to zero and readOffset + sizeInBytes must be less than of equal to readBuffer.sizeInBytes.", ); } if ( @@ -294,7 +294,7 @@ Buffer.prototype.copyFromBuffer = function ( writeOffset + sizeInBytes > this._sizeInBytes ) { throw new DeveloperError( - "writeOffset must be greater than or equal to zero and writeOffset + sizeInBytes must be less than of equal to this.sizeInBytes." + "writeOffset must be greater than or equal to zero and writeOffset + sizeInBytes must be less than of equal to this.sizeInBytes.", ); } if ( @@ -303,7 +303,7 @@ Buffer.prototype.copyFromBuffer = function ( (readOffset > writeOffset && readOffset < writeOffset + sizeInBytes)) ) { throw new DeveloperError( - "When readBuffer is equal to this, the ranges [readOffset + sizeInBytes) and [writeOffset, writeOffset + sizeInBytes) must not overlap." + "When readBuffer is equal to this, the ranges [readOffset + sizeInBytes) and [writeOffset, writeOffset + sizeInBytes) must not overlap.", ); } if ( @@ -313,7 +313,7 @@ Buffer.prototype.copyFromBuffer = function ( readBuffer._bufferTarget === WebGLConstants.ELEMENT_ARRAY_BUFFER) ) { throw new DeveloperError( - "Can not copy an index buffer into another buffer type." + "Can not copy an index buffer into another buffer type.", ); } //>>includeEnd('debug'); @@ -329,7 +329,7 @@ Buffer.prototype.copyFromBuffer = function ( writeTarget, readOffset, writeOffset, - sizeInBytes + sizeInBytes, ); gl.bindBuffer(writeTarget, null); gl.bindBuffer(readTarget, null); @@ -339,7 +339,7 @@ Buffer.prototype.getBufferData = function ( arrayView, sourceOffset, destinationOffset, - length + length, ) { sourceOffset = defaultValue(sourceOffset, 0); destinationOffset = defaultValue(destinationOffset, 0); @@ -376,22 +376,22 @@ Buffer.prototype.getBufferData = function ( if (destinationOffset < 0 || destinationOffset > arrayLength) { throw new DeveloperError( - "destinationOffset must be greater than zero and less than the arrayView length." + "destinationOffset must be greater than zero and less than the arrayView length.", ); } if (destinationOffset + copyLength > arrayLength) { throw new DeveloperError( - "destinationOffset + length must be less than or equal to the arrayViewLength." + "destinationOffset + length must be less than or equal to the arrayViewLength.", ); } if (sourceOffset < 0 || sourceOffset > this._sizeInBytes) { throw new DeveloperError( - "sourceOffset must be greater than zero and less than the buffers size." + "sourceOffset must be greater than zero and less than the buffers size.", ); } if (sourceOffset + copyLength * elementSize > this._sizeInBytes) { throw new DeveloperError( - "sourceOffset + length must be less than the buffers size." + "sourceOffset + length must be less than the buffers size.", ); } //>>includeEnd('debug'); @@ -404,7 +404,7 @@ Buffer.prototype.getBufferData = function ( sourceOffset, arrayView, destinationOffset, - length + length, ); gl.bindBuffer(target, null); }; diff --git a/packages/engine/Source/Renderer/ClearCommand.js b/packages/engine/Source/Renderer/ClearCommand.js index 696db4f2934f..2bd832ddea92 100644 --- a/packages/engine/Source/Renderer/ClearCommand.js +++ b/packages/engine/Source/Renderer/ClearCommand.js @@ -93,7 +93,7 @@ ClearCommand.ALL = Object.freeze( color: new Color(0.0, 0.0, 0.0, 0.0), depth: 1.0, stencil: 0.0, - }) + }), ); ClearCommand.prototype.execute = function (context, passState) { diff --git a/packages/engine/Source/Renderer/ComputeEngine.js b/packages/engine/Source/Renderer/ComputeEngine.js index 1459080510a5..8bb6d0da2ace 100644 --- a/packages/engine/Source/Renderer/ComputeEngine.js +++ b/packages/engine/Source/Renderer/ComputeEngine.js @@ -76,7 +76,7 @@ ComputeEngine.prototype.execute = function (computeCommand) { !defined(computeCommand.shaderProgram) ) { throw new DeveloperError( - "computeCommand.fragmentShaderSource or computeCommand.shaderProgram is required." + "computeCommand.fragmentShaderSource or computeCommand.shaderProgram is required.", ); } diff --git a/packages/engine/Source/Renderer/Context.js b/packages/engine/Source/Renderer/Context.js index 97bc02b60868..b8e1aa42c76a 100644 --- a/packages/engine/Source/Renderer/Context.js +++ b/packages/engine/Source/Renderer/Context.js @@ -55,7 +55,7 @@ function Context(canvas, options) { webglOptions.stencil = defaultValue(webglOptions.stencil, true); // WebGL default is false webglOptions.powerPreference = defaultValue( webglOptions.powerPreference, - "high-performance" + "high-performance", ); // WebGL default is "default" const glContext = defined(getWebGLStub) @@ -87,32 +87,32 @@ function Context(canvas, options) { this._stencilBits = gl.getParameter(gl.STENCIL_BITS); ContextLimits._maximumCombinedTextureImageUnits = gl.getParameter( - gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS + gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS, ); // min: 8 ContextLimits._maximumCubeMapSize = gl.getParameter( - gl.MAX_CUBE_MAP_TEXTURE_SIZE + gl.MAX_CUBE_MAP_TEXTURE_SIZE, ); // min: 16 ContextLimits._maximumFragmentUniformVectors = gl.getParameter( - gl.MAX_FRAGMENT_UNIFORM_VECTORS + gl.MAX_FRAGMENT_UNIFORM_VECTORS, ); // min: 16 ContextLimits._maximumTextureImageUnits = gl.getParameter( - gl.MAX_TEXTURE_IMAGE_UNITS + gl.MAX_TEXTURE_IMAGE_UNITS, ); // min: 8 ContextLimits._maximumRenderbufferSize = gl.getParameter( - gl.MAX_RENDERBUFFER_SIZE + gl.MAX_RENDERBUFFER_SIZE, ); // min: 1 ContextLimits._maximumTextureSize = gl.getParameter(gl.MAX_TEXTURE_SIZE); // min: 64 ContextLimits._maximumVaryingVectors = gl.getParameter( - gl.MAX_VARYING_VECTORS + gl.MAX_VARYING_VECTORS, ); // min: 8 ContextLimits._maximumVertexAttributes = gl.getParameter( - gl.MAX_VERTEX_ATTRIBS + gl.MAX_VERTEX_ATTRIBS, ); // min: 8 ContextLimits._maximumVertexTextureImageUnits = gl.getParameter( - gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS + gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS, ); // min: 0 ContextLimits._maximumVertexUniformVectors = gl.getParameter( - gl.MAX_VERTEX_UNIFORM_VECTORS + gl.MAX_VERTEX_UNIFORM_VECTORS, ); // min: 128 ContextLimits._maximumSamples = this._webgl2 @@ -133,7 +133,7 @@ function Context(canvas, options) { const highpFloat = gl.getShaderPrecisionFormat( gl.FRAGMENT_SHADER, - gl.HIGH_FLOAT + gl.HIGH_FLOAT, ); ContextLimits._highpFloatSupported = highpFloat.precision !== 0; const highpInt = gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.HIGH_INT); @@ -193,7 +193,7 @@ function Context(canvas, options) { this._astc, this._etc, this._etc1, - this._bc7 + this._bc7, ); const textureFilterAnisotropic = allowTextureFilterAnisotropic @@ -204,7 +204,7 @@ function Context(canvas, options) { : undefined; this._textureFilterAnisotropic = textureFilterAnisotropic; ContextLimits._maximumTextureFilterAnisotropy = defined( - textureFilterAnisotropic + textureFilterAnisotropic, ) ? gl.getParameter(textureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT) : 1.0; @@ -241,7 +241,7 @@ function Context(canvas, options) { count, type, offset, - instanceCount + instanceCount, ) { gl.drawElementsInstanced(mode, count, type, offset, instanceCount); }; @@ -276,14 +276,14 @@ function Context(canvas, options) { count, type, offset, - instanceCount + instanceCount, ) { instancedArrays.drawElementsInstancedANGLE( mode, count, type, offset, - instanceCount + instanceCount, ); }; glDrawArraysInstanced = function (mode, first, count, instanceCount) { @@ -291,7 +291,7 @@ function Context(canvas, options) { mode, first, count, - instanceCount + instanceCount, ); }; glVertexAttribDivisor = function (index, divisor) { @@ -415,7 +415,7 @@ function Context(canvas, options) { function getWebGLContext(canvas, webglOptions, requestWebgl1) { if (typeof WebGLRenderingContext === "undefined") { throw new RuntimeError( - "The browser does not support WebGL. Visit http://get.webgl.org." + "The browser does not support WebGL. Visit http://get.webgl.org.", ); } @@ -430,7 +430,7 @@ function getWebGLContext(canvas, webglOptions, requestWebgl1) { if (!defined(glContext)) { throw new RuntimeError( - "The browser supports WebGL, but initialization failed." + "The browser supports WebGL, but initialization failed.", ); } @@ -504,7 +504,7 @@ function throwOnError(gl, glFunc, glFuncArguments) { const error = gl.getError(); if (error !== gl.NO_ERROR) { throw new RuntimeError( - createErrorMessage(gl, glFunc, glFuncArguments, error) + createErrorMessage(gl, glFunc, glFuncArguments, error), ); } } @@ -552,7 +552,7 @@ function wrapGL(gl, logFunction) { Object.defineProperty( glWrapper, propertyName, - makeGetterSetter(gl, propertyName, logFunction) + makeGetterSetter(gl, propertyName, logFunction), ); } } @@ -1004,7 +1004,7 @@ Object.defineProperties(Context.prototype, { this._throwOnWebGLError = value; this._gl = wrapGL( this._originalGLContext, - value ? throwOnError : undefined + value ? throwOnError : undefined, ); }, }, @@ -1206,7 +1206,7 @@ function applyRenderState(context, renderState, passState, clear) { renderState, previousPassState, passState, - clear + clear, ); } @@ -1281,7 +1281,7 @@ Context.prototype.clear = function (clearCommand, passState) { // The command's framebuffer takes presidence over the pass' framebuffer, e.g., for off-screen rendering. const framebuffer = defaultValue( clearCommand.framebuffer, - passState.framebuffer + passState.framebuffer, ); bindFramebuffer(this, framebuffer); @@ -1293,13 +1293,13 @@ function beginDraw( framebuffer, passState, shaderProgram, - renderState + renderState, ) { //>>includeStart('debug', pragmas.debug); if (defined(framebuffer) && renderState.depthTest) { if (renderState.depthTest.enabled && !framebuffer.hasDepthAttachment) { throw new DeveloperError( - "The depth test can not be enabled (drawCommand.renderState.depthTest.enabled) because the framebuffer (drawCommand.framebuffer) does not have a depth or depth-stencil renderbuffer." + "The depth test can not be enabled (drawCommand.renderState.depthTest.enabled) because the framebuffer (drawCommand.framebuffer) does not have a depth or depth-stencil renderbuffer.", ); } } @@ -1310,7 +1310,7 @@ function beginDraw( shaderProgram._bind(); context._maxFrameTextureUnitIndex = Math.max( context._maxFrameTextureUnitIndex, - shaderProgram.maximumTextureUnitIndex + shaderProgram.maximumTextureUnitIndex, ); } @@ -1324,7 +1324,7 @@ function continueDraw(context, drawCommand, shaderProgram, uniformMap) { //>>includeStart('debug', pragmas.debug); if (!PrimitiveType.validate(primitiveType)) { throw new DeveloperError( - "drawCommand.primitiveType is required and must be valid." + "drawCommand.primitiveType is required and must be valid.", ); } @@ -1336,7 +1336,7 @@ function continueDraw(context, drawCommand, shaderProgram, uniformMap) { Check.typeOf.number.greaterThanOrEquals( "drawCommand.instanceCount", instanceCount, - 0 + 0, ); if (instanceCount > 0 && !context.instancedArrays) { throw new DeveloperError("Instanced arrays extension is not supported"); @@ -1347,7 +1347,7 @@ function continueDraw(context, drawCommand, shaderProgram, uniformMap) { shaderProgram._setUniforms( uniformMap, context._us, - context.validateShaderProgram + context.validateShaderProgram, ); va._bind(); @@ -1365,7 +1365,7 @@ function continueDraw(context, drawCommand, shaderProgram, uniformMap) { primitiveType, count, indexBuffer.indexDatatype, - offset + offset, ); } else { context.glDrawElementsInstanced( @@ -1373,7 +1373,7 @@ function continueDraw(context, drawCommand, shaderProgram, uniformMap) { count, indexBuffer.indexDatatype, offset, - instanceCount + instanceCount, ); } } else { @@ -1389,7 +1389,7 @@ function continueDraw(context, drawCommand, shaderProgram, uniformMap) { primitiveType, offset, count, - instanceCount + instanceCount, ); } } @@ -1401,7 +1401,7 @@ Context.prototype.draw = function ( drawCommand, passState, shaderProgram, - uniformMap + uniformMap, ) { //>>includeStart('debug', pragmas.debug); Check.defined("drawCommand", drawCommand); @@ -1412,11 +1412,11 @@ Context.prototype.draw = function ( // The command's framebuffer takes presidence over the pass' framebuffer, e.g., for off-screen rendering. const framebuffer = defaultValue( drawCommand._framebuffer, - passState.framebuffer + passState.framebuffer, ); const renderState = defaultValue( drawCommand._renderState, - this._defaultRenderState + this._defaultRenderState, ); shaderProgram = defaultValue(shaderProgram, drawCommand._shaderProgram); uniformMap = defaultValue(uniformMap, drawCommand._uniformMap); @@ -1481,7 +1481,7 @@ Context.prototype.readPixels = function (readState) { PixelFormat.RGBA, pixelDatatype, width, - height + height, ); bindFramebuffer(this, framebuffer); @@ -1493,7 +1493,7 @@ Context.prototype.readPixels = function (readState) { height, PixelFormat.RGBA, PixelDatatype.toWebGLConstant(pixelDatatype, this), - pixels + pixels, ); return pixels; @@ -1544,7 +1544,7 @@ Context.prototype.getViewportQuadVertexArray = function () { Context.prototype.createViewportQuadCommand = function ( fragmentShaderSource, - overrides + overrides, ) { overrides = defaultValue(overrides, defaultValue.EMPTY_OBJECT); diff --git a/packages/engine/Source/Renderer/CubeMap.js b/packages/engine/Source/Renderer/CubeMap.js index ccd7879ad7d9..89400a607846 100644 --- a/packages/engine/Source/Renderer/CubeMap.js +++ b/packages/engine/Source/Renderer/CubeMap.js @@ -91,13 +91,13 @@ function CubeMap(options) { //>>includeStart('debug', pragmas.debug); if ( !Object.values(CubeMap.FaceName).every((faceName) => - defined(source[faceName]) + defined(source[faceName]), ) ) { throw new DeveloperError( `options.source requires faces ${Object.values(CubeMap.FaceName).join( - ", " - )}.` + ", ", + )}.`, ); } //>>includeEnd('debug'); @@ -109,7 +109,7 @@ function CubeMap(options) { const face = source[faceName]; if (Number(face.width) !== width || Number(face.height) !== height) { throw new DeveloperError( - "Each face in options.source must have the same width and height." + "Each face in options.source must have the same width and height.", ); } } @@ -121,7 +121,7 @@ function CubeMap(options) { //>>includeStart('debug', pragmas.debug); if (!defined(width) || !defined(height)) { throw new DeveloperError( - "options requires a source field to create an initialized cube map or width and height fields to create a blank cube map." + "options requires a source field to create an initialized cube map or width and height fields to create a blank cube map.", ); } @@ -135,7 +135,7 @@ function CubeMap(options) { if (size > ContextLimits.maximumCubeMapSize) { throw new DeveloperError( - `Width and height must be less than or equal to the maximum cube map size (${ContextLimits.maximumCubeMapSize}). Check maximumCubeMapSize.` + `Width and height must be less than or equal to the maximum cube map size (${ContextLimits.maximumCubeMapSize}). Check maximumCubeMapSize.`, ); } @@ -145,7 +145,7 @@ function CubeMap(options) { if (PixelFormat.isDepthFormat(pixelFormat)) { throw new DeveloperError( - "options.pixelFormat cannot be DEPTH_COMPONENT or DEPTH_STENCIL." + "options.pixelFormat cannot be DEPTH_COMPONENT or DEPTH_STENCIL.", ); } @@ -155,7 +155,7 @@ function CubeMap(options) { if (pixelDatatype === PixelDatatype.FLOAT && !context.floatingPointTexture) { throw new DeveloperError( - "When options.pixelDatatype is FLOAT, this WebGL implementation must support the OES_texture_float extension." + "When options.pixelDatatype is FLOAT, this WebGL implementation must support the OES_texture_float extension.", ); } @@ -164,7 +164,7 @@ function CubeMap(options) { !context.halfFloatingPointTexture ) { throw new DeveloperError( - "When options.pixelDatatype is HALF_FLOAT, this WebGL implementation must support the OES_texture_half_float extension." + "When options.pixelDatatype is HALF_FLOAT, this WebGL implementation must support the OES_texture_half_float extension.", ); } //>>includeEnd('debug'); @@ -174,7 +174,7 @@ function CubeMap(options) { const internalFormat = PixelFormat.toInternalFormat( pixelFormat, pixelDatatype, - context + context, ); const gl = context._gl; @@ -206,7 +206,7 @@ function CubeMap(options) { size, preMultiplyAlpha, flipY, - initialized + initialized, ); } this._positiveX = constructFace(gl.TEXTURE_CUBE_MAP_POSITIVE_X); @@ -227,7 +227,7 @@ function CubeMap(options) { } else { gl.pixelStorei( gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, - gl.BROWSER_DEFAULT_WEBGL + gl.BROWSER_DEFAULT_WEBGL, ); } @@ -306,7 +306,7 @@ function loadFace(cubeMapFace, source, mipLevel) { 0, pixelFormat, PixelDatatype.toWebGLConstant(pixelDatatype, context), - null + null, ); return; } @@ -318,7 +318,7 @@ function loadFace(cubeMapFace, source, mipLevel) { unpackAlignment = PixelFormat.alignmentInBytes( pixelFormat, pixelDatatype, - size + size, ); } gl.pixelStorei(gl.UNPACK_ALIGNMENT, unpackAlignment); @@ -332,7 +332,7 @@ function loadFace(cubeMapFace, source, mipLevel) { pixelFormat, pixelDatatype, size, - size + size, ); } gl.texImage2D( @@ -344,7 +344,7 @@ function loadFace(cubeMapFace, source, mipLevel) { 0, pixelFormat, PixelDatatype.toWebGLConstant(pixelDatatype, context), - arrayBufferView + arrayBufferView, ); } else { // Only valid for DOM-Element uploads @@ -356,7 +356,7 @@ function loadFace(cubeMapFace, source, mipLevel) { internalFormat, pixelFormat, PixelDatatype.toWebGLConstant(pixelDatatype, context), - source + source, ); } } @@ -492,7 +492,7 @@ function setupSampler(cubeMap, sampler) { gl.texParameteri( target, cubeMap._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT, - sampler.maximumAnisotropy + sampler.maximumAnisotropy, ); } gl.bindTexture(target, null); @@ -531,7 +531,7 @@ CubeMap.prototype.loadMipmaps = function (source, skipColorSpaceConversion) { } else { gl.pixelStorei( gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, - gl.BROWSER_DEFAULT_WEBGL + gl.BROWSER_DEFAULT_WEBGL, ); } @@ -573,7 +573,7 @@ CubeMap.prototype.generateMipmap = function (hint) { //>>includeStart('debug', pragmas.debug); if (this._size > 1 && !CesiumMath.isPowerOfTwo(this._size)) { throw new DeveloperError( - "width and height must be a power of two to call generateMipmap()." + "width and height must be a power of two to call generateMipmap().", ); } if (!MipmapHint.validate(hint)) { diff --git a/packages/engine/Source/Renderer/CubeMapFace.js b/packages/engine/Source/Renderer/CubeMapFace.js index 75cc8c710f41..9fc7daf2533e 100644 --- a/packages/engine/Source/Renderer/CubeMapFace.js +++ b/packages/engine/Source/Renderer/CubeMapFace.js @@ -19,7 +19,7 @@ function CubeMapFace( size, preMultiplyAlpha, flipY, - initialized + initialized, ) { this._context = context; this._texture = texture; @@ -99,12 +99,12 @@ CubeMapFace.prototype.copyFrom = function (options) { Check.typeOf.number.greaterThanOrEquals("yOffset", yOffset, 0); if (xOffset + source.width > this._size) { throw new DeveloperError( - "xOffset + options.source.width must be less than or equal to width." + "xOffset + options.source.width must be less than or equal to width.", ); } if (yOffset + source.height > this._size) { throw new DeveloperError( - "yOffset + options.source.height must be less than or equal to height." + "yOffset + options.source.height must be less than or equal to height.", ); } //>>includeEnd('debug'); @@ -133,7 +133,7 @@ CubeMapFace.prototype.copyFrom = function (options) { unpackAlignment = PixelFormat.alignmentInBytes( pixelFormat, pixelDatatype, - width + width, ); } gl.pixelStorei(gl.UNPACK_ALIGNMENT, unpackAlignment); @@ -143,7 +143,7 @@ CubeMapFace.prototype.copyFrom = function (options) { } else { gl.pixelStorei( gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, - gl.BROWSER_DEFAULT_WEBGL + gl.BROWSER_DEFAULT_WEBGL, ); } @@ -161,7 +161,7 @@ CubeMapFace.prototype.copyFrom = function (options) { pixelFormat, pixelDatatype, size, - size + size, ); } pixels = arrayBufferView; @@ -180,7 +180,7 @@ CubeMapFace.prototype.copyFrom = function (options) { pixelFormat, pixelDatatype, size, - size + size, ); } gl.texImage2D( @@ -192,7 +192,7 @@ CubeMapFace.prototype.copyFrom = function (options) { 0, pixelFormat, PixelDatatype.toWebGLConstant(pixelDatatype, this._context), - pixels + pixels, ); this._initialized = true; } @@ -208,7 +208,7 @@ CubeMapFace.prototype.copyFrom = function (options) { pixelFormat, pixelDatatype, width, - height + height, ); } gl.texSubImage2D( @@ -220,7 +220,7 @@ CubeMapFace.prototype.copyFrom = function (options) { height, pixelFormat, PixelDatatype.toWebGLConstant(pixelDatatype, this._context), - arrayBufferView + arrayBufferView, ); } else { // Only valid for DOM-Element uploads @@ -235,7 +235,7 @@ CubeMapFace.prototype.copyFrom = function (options) { yOffset, pixelFormat, PixelDatatype.toWebGLConstant(pixelDatatype, this._context), - source + source, ); } } @@ -274,7 +274,7 @@ CubeMapFace.prototype.copyFromFramebuffer = function ( framebufferXOffset, framebufferYOffset, width, - height + height, ) { xOffset = defaultValue(xOffset, 0); yOffset = defaultValue(yOffset, 0); @@ -289,31 +289,31 @@ CubeMapFace.prototype.copyFromFramebuffer = function ( Check.typeOf.number.greaterThanOrEquals( "framebufferXOffset", framebufferXOffset, - 0 + 0, ); Check.typeOf.number.greaterThanOrEquals( "framebufferYOffset", framebufferYOffset, - 0 + 0, ); if (xOffset + width > this._size) { throw new DeveloperError( - "xOffset + source.width must be less than or equal to width." + "xOffset + source.width must be less than or equal to width.", ); } if (yOffset + height > this._size) { throw new DeveloperError( - "yOffset + source.height must be less than or equal to height." + "yOffset + source.height must be less than or equal to height.", ); } if (this._pixelDatatype === PixelDatatype.FLOAT) { throw new DeveloperError( - "Cannot call copyFromFramebuffer when the texture pixel data type is FLOAT." + "Cannot call copyFromFramebuffer when the texture pixel data type is FLOAT.", ); } if (this._pixelDatatype === PixelDatatype.HALF_FLOAT) { throw new DeveloperError( - "Cannot call copyFromFramebuffer when the texture pixel data type is HALF_FLOAT." + "Cannot call copyFromFramebuffer when the texture pixel data type is HALF_FLOAT.", ); } //>>includeEnd('debug'); @@ -331,7 +331,7 @@ CubeMapFace.prototype.copyFromFramebuffer = function ( framebufferXOffset, framebufferYOffset, width, - height + height, ); gl.bindTexture(target, null); this._initialized = true; diff --git a/packages/engine/Source/Renderer/DrawCommand.js b/packages/engine/Source/Renderer/DrawCommand.js index 14d75d5c7ee5..e4388bdeed54 100644 --- a/packages/engine/Source/Renderer/DrawCommand.js +++ b/packages/engine/Source/Renderer/DrawCommand.js @@ -26,7 +26,7 @@ function DrawCommand(options) { this._modelMatrix = options.modelMatrix; this._primitiveType = defaultValue( options.primitiveType, - PrimitiveType.TRIANGLES + PrimitiveType.TRIANGLES, ); this._vertexArray = options.vertexArray; this._count = options.count; @@ -47,18 +47,18 @@ function DrawCommand(options) { this.occlude = defaultValue(options.occlude, true); this.executeInClosestFrustum = defaultValue( options.executeInClosestFrustum, - false + false, ); this.debugShowBoundingVolume = defaultValue( options.debugShowBoundingVolume, - false + false, ); this.castShadows = defaultValue(options.castShadows, false); this.receiveShadows = defaultValue(options.receiveShadows, false); this.pickOnly = defaultValue(options.pickOnly, false); this.depthForTranslucentClassification = defaultValue( options.depthForTranslucentClassification, - false + false, ); this.dirty = true; diff --git a/packages/engine/Source/Renderer/Framebuffer.js b/packages/engine/Source/Renderer/Framebuffer.js index ad0caf4688b0..66b4c47eea44 100644 --- a/packages/engine/Source/Renderer/Framebuffer.js +++ b/packages/engine/Source/Renderer/Framebuffer.js @@ -14,7 +14,7 @@ function attachTexture(framebuffer, attachment, texture) { attachment, texture._target, texture._texture, - 0 + 0, ); } @@ -24,7 +24,7 @@ function attachRenderbuffer(framebuffer, attachment, renderbuffer) { gl.FRAMEBUFFER, attachment, gl.RENDERBUFFER, - renderbuffer._getRenderbuffer() + renderbuffer._getRenderbuffer(), ); } @@ -114,12 +114,12 @@ function Framebuffer(options) { //>>includeStart('debug', pragmas.debug); if (defined(options.colorTextures) && defined(options.colorRenderbuffers)) { throw new DeveloperError( - "Cannot have both color texture and color renderbuffer attachments." + "Cannot have both color texture and color renderbuffer attachments.", ); } if (defined(options.depthTexture) && defined(options.depthRenderbuffer)) { throw new DeveloperError( - "Cannot have both a depth texture and depth renderbuffer attachment." + "Cannot have both a depth texture and depth renderbuffer attachment.", ); } if ( @@ -127,7 +127,7 @@ function Framebuffer(options) { defined(options.depthStencilRenderbuffer) ) { throw new DeveloperError( - "Cannot have both a depth-stencil texture and depth-stencil renderbuffer attachment." + "Cannot have both a depth-stencil texture and depth-stencil renderbuffer attachment.", ); } //>>includeEnd('debug'); @@ -142,17 +142,17 @@ function Framebuffer(options) { //>>includeStart('debug', pragmas.debug); if (depthAttachment && depthStencilAttachment) { throw new DeveloperError( - "Cannot have both a depth and depth-stencil attachment." + "Cannot have both a depth and depth-stencil attachment.", ); } if (defined(options.stencilRenderbuffer) && depthStencilAttachment) { throw new DeveloperError( - "Cannot have both a stencil and depth-stencil attachment." + "Cannot have both a stencil and depth-stencil attachment.", ); } if (depthAttachment && defined(options.stencilRenderbuffer)) { throw new DeveloperError( - "Cannot have both a depth and stencil attachment." + "Cannot have both a depth and stencil attachment.", ); } //>>includeEnd('debug'); @@ -169,13 +169,15 @@ function Framebuffer(options) { if (defined(options.colorTextures)) { const textures = options.colorTextures; - length = this._colorTextures.length = this._activeColorAttachments.length = - textures.length; + length = + this._colorTextures.length = + this._activeColorAttachments.length = + textures.length; //>>includeStart('debug', pragmas.debug); if (length > maximumColorAttachments) { throw new DeveloperError( - "The number of color attachments exceeds the number supported." + "The number of color attachments exceeds the number supported.", ); } //>>includeEnd('debug'); @@ -186,7 +188,7 @@ function Framebuffer(options) { //>>includeStart('debug', pragmas.debug); if (!PixelFormat.isColorFormat(texture.pixelFormat)) { throw new DeveloperError( - "The color-texture pixel-format must be a color format." + "The color-texture pixel-format must be a color format.", ); } if ( @@ -194,7 +196,7 @@ function Framebuffer(options) { !context.colorBufferFloat ) { throw new DeveloperError( - "The color texture pixel datatype is FLOAT and the WebGL implementation does not support the EXT_color_buffer_float or WEBGL_color_buffer_float extensions. See Context.colorBufferFloat." + "The color texture pixel datatype is FLOAT and the WebGL implementation does not support the EXT_color_buffer_float or WEBGL_color_buffer_float extensions. See Context.colorBufferFloat.", ); } if ( @@ -202,7 +204,7 @@ function Framebuffer(options) { !context.colorBufferHalfFloat ) { throw new DeveloperError( - "The color texture pixel datatype is HALF_FLOAT and the WebGL implementation does not support the EXT_color_buffer_half_float extension. See Context.colorBufferHalfFloat." + "The color texture pixel datatype is HALF_FLOAT and the WebGL implementation does not support the EXT_color_buffer_half_float extension. See Context.colorBufferHalfFloat.", ); } //>>includeEnd('debug'); @@ -216,13 +218,15 @@ function Framebuffer(options) { if (defined(options.colorRenderbuffers)) { const renderbuffers = options.colorRenderbuffers; - length = this._colorRenderbuffers.length = this._activeColorAttachments.length = - renderbuffers.length; + length = + this._colorRenderbuffers.length = + this._activeColorAttachments.length = + renderbuffers.length; //>>includeStart('debug', pragmas.debug); if (length > maximumColorAttachments) { throw new DeveloperError( - "The number of color attachments exceeds the number supported." + "The number of color attachments exceeds the number supported.", ); } //>>includeEnd('debug'); @@ -242,7 +246,7 @@ function Framebuffer(options) { //>>includeStart('debug', pragmas.debug); if (texture.pixelFormat !== PixelFormat.DEPTH_COMPONENT) { throw new DeveloperError( - "The depth-texture pixel-format must be DEPTH_COMPONENT." + "The depth-texture pixel-format must be DEPTH_COMPONENT.", ); } //>>includeEnd('debug'); @@ -269,7 +273,7 @@ function Framebuffer(options) { //>>includeStart('debug', pragmas.debug); if (texture.pixelFormat !== PixelFormat.DEPTH_STENCIL) { throw new DeveloperError( - "The depth-stencil pixel-format must be DEPTH_STENCIL." + "The depth-stencil pixel-format must be DEPTH_STENCIL.", ); } //>>includeEnd('debug'); @@ -380,7 +384,7 @@ Framebuffer.prototype.getColorTexture = function (index) { //>>includeStart('debug', pragmas.debug); if (!defined(index) || index < 0 || index >= this._colorTextures.length) { throw new DeveloperError( - "index is required, must be greater than or equal to zero and must be less than the number of color attachments." + "index is required, must be greater than or equal to zero and must be less than the number of color attachments.", ); } //>>includeEnd('debug'); @@ -396,7 +400,7 @@ Framebuffer.prototype.getColorRenderbuffer = function (index) { index >= this._colorRenderbuffers.length ) { throw new DeveloperError( - "index is required, must be greater than or equal to zero and must be less than the number of color attachments." + "index is required, must be greater than or equal to zero and must be less than the number of color attachments.", ); } //>>includeEnd('debug'); diff --git a/packages/engine/Source/Renderer/FramebufferManager.js b/packages/engine/Source/Renderer/FramebufferManager.js index 5594895fa3db..8b8324f9d82f 100644 --- a/packages/engine/Source/Renderer/FramebufferManager.js +++ b/packages/engine/Source/Renderer/FramebufferManager.js @@ -36,7 +36,7 @@ function FramebufferManager(options) { this._numSamples = defaultValue(options.numSamples, 1); this._colorAttachmentsLength = defaultValue( options.colorAttachmentsLength, - 1 + 1, ); this._color = defaultValue(options.color, true); @@ -44,28 +44,28 @@ function FramebufferManager(options) { this._depthStencil = defaultValue(options.depthStencil, false); this._supportsDepthTexture = defaultValue( options.supportsDepthTexture, - false + false, ); //>>includeStart('debug', pragmas.debug); if (!this._color && !this._depth && !this._depthStencil) { throw new DeveloperError( - "Must enable at least one type of framebuffer attachment." + "Must enable at least one type of framebuffer attachment.", ); } if (this._depth && this._depthStencil) { throw new DeveloperError( - "Cannot have both a depth and depth-stencil attachment." + "Cannot have both a depth and depth-stencil attachment.", ); } //>>includeEnd('debug'); this._createColorAttachments = defaultValue( options.createColorAttachments, - true + true, ); this._createDepthAttachments = defaultValue( options.createDepthAttachments, - true + true, ); this._pixelDatatype = options.pixelDatatype; @@ -116,7 +116,7 @@ FramebufferManager.prototype.isDirty = function ( height, numSamples, pixelDatatype, - pixelFormat + pixelFormat, ) { numSamples = defaultValue(numSamples, 1); const dimensionChanged = this._width !== width || this._height !== height; @@ -145,7 +145,7 @@ FramebufferManager.prototype.update = function ( height, numSamples, pixelDatatype, - pixelFormat + pixelFormat, ) { //>>includeStart('debug', pragmas.debug); if (!defined(width) || !defined(height)) { @@ -157,11 +157,11 @@ FramebufferManager.prototype.update = function ( pixelDatatype, this._color ? defaultValue(this._pixelDatatype, PixelDatatype.UNSIGNED_BYTE) - : undefined + : undefined, ); pixelFormat = defaultValue( pixelFormat, - this._color ? defaultValue(this._pixelFormat, PixelFormat.RGBA) : undefined + this._color ? defaultValue(this._pixelFormat, PixelFormat.RGBA) : undefined, ); if (this.isDirty(width, height, numSamples, pixelDatatype, pixelFormat)) { @@ -278,7 +278,7 @@ FramebufferManager.prototype.getColorTexture = function (index) { //>>includeStart('debug', pragmas.debug); if (index >= this._colorAttachmentsLength) { throw new DeveloperError( - "index must be smaller than total number of color attachments." + "index must be smaller than total number of color attachments.", ); } //>>includeEnd('debug'); @@ -290,12 +290,12 @@ FramebufferManager.prototype.setColorTexture = function (texture, index) { //>>includeStart('debug', pragmas.debug); if (this._createColorAttachments) { throw new DeveloperError( - "createColorAttachments must be false if setColorTexture is called." + "createColorAttachments must be false if setColorTexture is called.", ); } if (index >= this._colorAttachmentsLength) { throw new DeveloperError( - "index must be smaller than total number of color attachments." + "index must be smaller than total number of color attachments.", ); } //>>includeEnd('debug'); @@ -308,7 +308,7 @@ FramebufferManager.prototype.getColorRenderbuffer = function (index) { //>>includeStart('debug', pragmas.debug); if (index >= this._colorAttachmentsLength) { throw new DeveloperError( - "index must be smaller than total number of color attachments." + "index must be smaller than total number of color attachments.", ); } //>>includeEnd('debug'); @@ -317,18 +317,18 @@ FramebufferManager.prototype.getColorRenderbuffer = function (index) { FramebufferManager.prototype.setColorRenderbuffer = function ( renderbuffer, - index + index, ) { index = defaultValue(index, 0); //>>includeStart('debug', pragmas.debug); if (this._createColorAttachments) { throw new DeveloperError( - "createColorAttachments must be false if setColorRenderbuffer is called." + "createColorAttachments must be false if setColorRenderbuffer is called.", ); } if (index >= this._colorAttachmentsLength) { throw new DeveloperError( - "index must be smaller than total number of color attachments." + "index must be smaller than total number of color attachments.", ); } //>>includeEnd('debug'); @@ -344,7 +344,7 @@ FramebufferManager.prototype.setDepthRenderbuffer = function (renderbuffer) { //>>includeStart('debug', pragmas.debug); if (this._createDepthAttachments) { throw new DeveloperError( - "createDepthAttachments must be false if setDepthRenderbuffer is called." + "createDepthAttachments must be false if setDepthRenderbuffer is called.", ); } //>>includeEnd('debug'); @@ -360,7 +360,7 @@ FramebufferManager.prototype.setDepthTexture = function (texture) { //>>includeStart('debug', pragmas.debug); if (this._createDepthAttachments) { throw new DeveloperError( - "createDepthAttachments must be false if setDepthTexture is called." + "createDepthAttachments must be false if setDepthTexture is called.", ); } //>>includeEnd('debug'); @@ -373,12 +373,12 @@ FramebufferManager.prototype.getDepthStencilRenderbuffer = function () { }; FramebufferManager.prototype.setDepthStencilRenderbuffer = function ( - renderbuffer + renderbuffer, ) { //>>includeStart('debug', pragmas.debug); if (this._createDepthAttachments) { throw new DeveloperError( - "createDepthAttachments must be false if setDepthStencilRenderbuffer is called." + "createDepthAttachments must be false if setDepthStencilRenderbuffer is called.", ); } //>>includeEnd('debug'); @@ -394,7 +394,7 @@ FramebufferManager.prototype.setDepthStencilTexture = function (texture) { //>>includeStart('debug', pragmas.debug); if (this._createDepthAttachments) { throw new DeveloperError( - "createDepthAttachments must be false if setDepthStencilTexture is called." + "createDepthAttachments must be false if setDepthStencilTexture is called.", ); } //>>includeEnd('debug'); @@ -411,7 +411,7 @@ FramebufferManager.prototype.prepareTextures = function (context, blitStencil) { FramebufferManager.prototype.clear = function ( context, clearCommand, - passState + passState, ) { const framebuffer = clearCommand.framebuffer; clearCommand.framebuffer = this.framebuffer; diff --git a/packages/engine/Source/Renderer/MultisampleFramebuffer.js b/packages/engine/Source/Renderer/MultisampleFramebuffer.js index 183e1bf20a74..395f5a96c0b1 100644 --- a/packages/engine/Source/Renderer/MultisampleFramebuffer.js +++ b/packages/engine/Source/Renderer/MultisampleFramebuffer.js @@ -38,7 +38,7 @@ function MultisampleFramebuffer(options) { const colorTextures = options.colorTextures; if (defined(colorRenderbuffers) !== defined(colorTextures)) { throw new DeveloperError( - "Both color renderbuffer and texture attachments must be provided." + "Both color renderbuffer and texture attachments must be provided.", ); } @@ -46,7 +46,7 @@ function MultisampleFramebuffer(options) { const depthStencilTexture = options.depthStencilTexture; if (defined(depthStencilRenderbuffer) !== defined(depthStencilTexture)) { throw new DeveloperError( - "Both depth-stencil renderbuffer and texture attachments must be provided." + "Both depth-stencil renderbuffer and texture attachments must be provided.", ); } @@ -74,7 +74,7 @@ MultisampleFramebuffer.prototype.getColorFramebuffer = function () { MultisampleFramebuffer.prototype.blitFramebuffers = function ( context, - blitStencil + blitStencil, ) { this._renderFramebuffer.bindRead(); this._colorFramebuffer.bindDraw(); @@ -96,7 +96,7 @@ MultisampleFramebuffer.prototype.blitFramebuffers = function ( this._width, this._height, mask, - gl.NEAREST + gl.NEAREST, ); gl.bindFramebuffer(gl.READ_FRAMEBUFFER, null); gl.bindFramebuffer(gl.DRAW_FRAMEBUFFER, null); diff --git a/packages/engine/Source/Renderer/RenderState.js b/packages/engine/Source/Renderer/RenderState.js index e83838745c35..a4a7d8f863d3 100644 --- a/packages/engine/Source/Renderer/RenderState.js +++ b/packages/engine/Source/Renderer/RenderState.js @@ -93,12 +93,12 @@ function RenderState(renderState) { const cull = defaultValue(rs.cull, defaultValue.EMPTY_OBJECT); const polygonOffset = defaultValue( rs.polygonOffset, - defaultValue.EMPTY_OBJECT + defaultValue.EMPTY_OBJECT, ); const scissorTest = defaultValue(rs.scissorTest, defaultValue.EMPTY_OBJECT); const scissorTestRectangle = defaultValue( scissorTest.rectangle, - defaultValue.EMPTY_OBJECT + defaultValue.EMPTY_OBJECT, ); const depthRange = defaultValue(rs.depthRange, defaultValue.EMPTY_OBJECT); const depthTest = defaultValue(rs.depthTest, defaultValue.EMPTY_OBJECT); @@ -108,15 +108,15 @@ function RenderState(renderState) { const stencilTest = defaultValue(rs.stencilTest, defaultValue.EMPTY_OBJECT); const stencilTestFrontOperation = defaultValue( stencilTest.frontOperation, - defaultValue.EMPTY_OBJECT + defaultValue.EMPTY_OBJECT, ); const stencilTestBackOperation = defaultValue( stencilTest.backOperation, - defaultValue.EMPTY_OBJECT + defaultValue.EMPTY_OBJECT, ); const sampleCoverage = defaultValue( rs.sampleCoverage, - defaultValue.EMPTY_OBJECT + defaultValue.EMPTY_OBJECT, ); const viewport = rs.viewport; @@ -157,35 +157,35 @@ function RenderState(renderState) { defaultValue(blendingColor.red, 0.0), defaultValue(blendingColor.green, 0.0), defaultValue(blendingColor.blue, 0.0), - defaultValue(blendingColor.alpha, 0.0) + defaultValue(blendingColor.alpha, 0.0), ), equationRgb: defaultValue(blending.equationRgb, WebGLConstants.FUNC_ADD), equationAlpha: defaultValue( blending.equationAlpha, - WebGLConstants.FUNC_ADD + WebGLConstants.FUNC_ADD, ), functionSourceRgb: defaultValue( blending.functionSourceRgb, - WebGLConstants.ONE + WebGLConstants.ONE, ), functionSourceAlpha: defaultValue( blending.functionSourceAlpha, - WebGLConstants.ONE + WebGLConstants.ONE, ), functionDestinationRgb: defaultValue( blending.functionDestinationRgb, - WebGLConstants.ZERO + WebGLConstants.ZERO, ), functionDestinationAlpha: defaultValue( blending.functionDestinationAlpha, - WebGLConstants.ZERO + WebGLConstants.ZERO, ), }; this.stencilTest = { enabled: defaultValue(stencilTest.enabled, false), frontFunction: defaultValue( stencilTest.frontFunction, - WebGLConstants.ALWAYS + WebGLConstants.ALWAYS, ), backFunction: defaultValue(stencilTest.backFunction, WebGLConstants.ALWAYS), reference: defaultValue(stencilTest.reference, 0), @@ -211,7 +211,7 @@ function RenderState(renderState) { viewport.x, viewport.y, viewport.width, - viewport.height + viewport.height, ) : undefined; @@ -221,7 +221,7 @@ function RenderState(renderState) { this.lineWidth > ContextLimits.maximumAliasedLineWidth ) { throw new DeveloperError( - "renderState.lineWidth is out of range. Check minimumAliasedLineWidth and maximumAliasedLineWidth." + "renderState.lineWidth is out of range. Check minimumAliasedLineWidth and maximumAliasedLineWidth.", ); } if (!WindingOrder.validate(this.frontFace)) { @@ -235,25 +235,25 @@ function RenderState(renderState) { this.scissorTest.rectangle.height < 0 ) { throw new DeveloperError( - "renderState.scissorTest.rectangle.width and renderState.scissorTest.rectangle.height must be greater than or equal to zero." + "renderState.scissorTest.rectangle.width and renderState.scissorTest.rectangle.height must be greater than or equal to zero.", ); } if (this.depthRange.near > this.depthRange.far) { // WebGL specific - not an error in GL ES throw new DeveloperError( - "renderState.depthRange.near can not be greater than renderState.depthRange.far." + "renderState.depthRange.near can not be greater than renderState.depthRange.far.", ); } if (this.depthRange.near < 0) { // Would be clamped by GL throw new DeveloperError( - "renderState.depthRange.near must be greater than or equal to zero." + "renderState.depthRange.near must be greater than or equal to zero.", ); } if (this.depthRange.far > 1) { // Would be clamped by GL throw new DeveloperError( - "renderState.depthRange.far must be less than or equal to one." + "renderState.depthRange.far must be less than or equal to one.", ); } if (!validateDepthFunction(this.depthTest.func)) { @@ -271,7 +271,7 @@ function RenderState(renderState) { ) { // Would be clamped by GL throw new DeveloperError( - "renderState.blending.color components must be greater than or equal to zero and less than or equal to one." + "renderState.blending.color components must be greater than or equal to zero and less than or equal to one.", ); } if (!validateBlendEquation(this.blending.equationRgb)) { @@ -285,17 +285,17 @@ function RenderState(renderState) { } if (!validateBlendFunction(this.blending.functionSourceAlpha)) { throw new DeveloperError( - "Invalid renderState.blending.functionSourceAlpha." + "Invalid renderState.blending.functionSourceAlpha.", ); } if (!validateBlendFunction(this.blending.functionDestinationRgb)) { throw new DeveloperError( - "Invalid renderState.blending.functionDestinationRgb." + "Invalid renderState.blending.functionDestinationRgb.", ); } if (!validateBlendFunction(this.blending.functionDestinationAlpha)) { throw new DeveloperError( - "Invalid renderState.blending.functionDestinationAlpha." + "Invalid renderState.blending.functionDestinationAlpha.", ); } if (!validateStencilFunction(this.stencilTest.frontFunction)) { @@ -306,55 +306,55 @@ function RenderState(renderState) { } if (!validateStencilOperation(this.stencilTest.frontOperation.fail)) { throw new DeveloperError( - "Invalid renderState.stencilTest.frontOperation.fail." + "Invalid renderState.stencilTest.frontOperation.fail.", ); } if (!validateStencilOperation(this.stencilTest.frontOperation.zFail)) { throw new DeveloperError( - "Invalid renderState.stencilTest.frontOperation.zFail." + "Invalid renderState.stencilTest.frontOperation.zFail.", ); } if (!validateStencilOperation(this.stencilTest.frontOperation.zPass)) { throw new DeveloperError( - "Invalid renderState.stencilTest.frontOperation.zPass." + "Invalid renderState.stencilTest.frontOperation.zPass.", ); } if (!validateStencilOperation(this.stencilTest.backOperation.fail)) { throw new DeveloperError( - "Invalid renderState.stencilTest.backOperation.fail." + "Invalid renderState.stencilTest.backOperation.fail.", ); } if (!validateStencilOperation(this.stencilTest.backOperation.zFail)) { throw new DeveloperError( - "Invalid renderState.stencilTest.backOperation.zFail." + "Invalid renderState.stencilTest.backOperation.zFail.", ); } if (!validateStencilOperation(this.stencilTest.backOperation.zPass)) { throw new DeveloperError( - "Invalid renderState.stencilTest.backOperation.zPass." + "Invalid renderState.stencilTest.backOperation.zPass.", ); } if (defined(this.viewport)) { if (this.viewport.width < 0) { throw new DeveloperError( - "renderState.viewport.width must be greater than or equal to zero." + "renderState.viewport.width must be greater than or equal to zero.", ); } if (this.viewport.height < 0) { throw new DeveloperError( - "renderState.viewport.height must be greater than or equal to zero." + "renderState.viewport.height must be greater than or equal to zero.", ); } if (this.viewport.width > ContextLimits.maximumViewportWidth) { throw new DeveloperError( - `renderState.viewport.width must be less than or equal to the maximum viewport width (${ContextLimits.maximumViewportWidth.toString()}). Check maximumViewportWidth.` + `renderState.viewport.width must be less than or equal to the maximum viewport width (${ContextLimits.maximumViewportWidth.toString()}). Check maximumViewportWidth.`, ); } if (this.viewport.height > ContextLimits.maximumViewportHeight) { throw new DeveloperError( - `renderState.viewport.height must be less than or equal to the maximum viewport height (${ContextLimits.maximumViewportHeight.toString()}). Check maximumViewportHeight.` + `renderState.viewport.height must be less than or equal to the maximum viewport height (${ContextLimits.maximumViewportHeight.toString()}). Check maximumViewportHeight.`, ); } } @@ -673,7 +673,7 @@ function applyBlending(gl, renderState, passState) { blending.functionSourceRgb, blending.functionDestinationRgb, blending.functionSourceAlpha, - blending.functionDestinationAlpha + blending.functionDestinationAlpha, ); } } @@ -706,7 +706,7 @@ function applyStencilTest(gl, renderState) { gl.FRONT, frontOperationFail, frontOperationZFail, - frontOperationZPass + frontOperationZPass, ); const backOperation = stencilTest.backOperation; @@ -718,7 +718,7 @@ function applyStencilTest(gl, renderState) { gl.BACK, backOperationFail, backOperationZFail, - backOperationZPass + backOperationZPass, ); } } @@ -861,7 +861,7 @@ RenderState.partialApply = function ( renderState, previousPassState, passState, - clear + clear, ) { if (previousRenderState !== renderState) { // When a new render state is applied, instead of making WebGL calls for all the states or first diff --git a/packages/engine/Source/Renderer/Renderbuffer.js b/packages/engine/Source/Renderer/Renderbuffer.js index ab875c2878db..74f672159e20 100644 --- a/packages/engine/Source/Renderer/Renderbuffer.js +++ b/packages/engine/Source/Renderer/Renderbuffer.js @@ -36,7 +36,7 @@ function Renderbuffer(options) { if (width > maximumRenderbufferSize) { throw new DeveloperError( - `Width must be less than or equal to the maximum renderbuffer size (${maximumRenderbufferSize}). Check maximumRenderbufferSize.` + `Width must be less than or equal to the maximum renderbuffer size (${maximumRenderbufferSize}). Check maximumRenderbufferSize.`, ); } @@ -44,7 +44,7 @@ function Renderbuffer(options) { if (height > maximumRenderbufferSize) { throw new DeveloperError( - `Height must be less than or equal to the maximum renderbuffer size (${maximumRenderbufferSize}). Check maximumRenderbufferSize.` + `Height must be less than or equal to the maximum renderbuffer size (${maximumRenderbufferSize}). Check maximumRenderbufferSize.`, ); } //>>includeEnd('debug'); @@ -62,7 +62,7 @@ function Renderbuffer(options) { numSamples, format, width, - height + height, ); } else { gl.renderbufferStorage(gl.RENDERBUFFER, format, width, height); diff --git a/packages/engine/Source/Renderer/Sampler.js b/packages/engine/Source/Renderer/Sampler.js index a25e30fd2803..0fc66755101e 100644 --- a/packages/engine/Source/Renderer/Sampler.js +++ b/packages/engine/Source/Renderer/Sampler.js @@ -40,7 +40,7 @@ function Sampler(options) { Check.typeOf.number.greaterThanOrEquals( "maximumAnisotropy", maximumAnisotropy, - 1.0 + 1.0, ); //>>includeEnd('debug'); @@ -98,6 +98,6 @@ Sampler.NEAREST = Object.freeze( wrapT: TextureWrap.CLAMP_TO_EDGE, minificationFilter: TextureMinificationFilter.NEAREST, magnificationFilter: TextureMagnificationFilter.NEAREST, - }) + }), ); export default Sampler; diff --git a/packages/engine/Source/Renderer/ShaderBuilder.js b/packages/engine/Source/Renderer/ShaderBuilder.js index 6fd79ab0098e..95fd920d5769 100644 --- a/packages/engine/Source/Renderer/ShaderBuilder.js +++ b/packages/engine/Source/Renderer/ShaderBuilder.js @@ -155,7 +155,7 @@ ShaderBuilder.prototype.addDefine = function (identifier, value, destination) { ShaderBuilder.prototype.addStruct = function ( structId, structName, - destination + destination, ) { //>>includeStart('debug', pragmas.debug); Check.typeOf.string("structId", structId); @@ -213,7 +213,7 @@ ShaderBuilder.prototype.addStructField = function (structId, type, identifier) { ShaderBuilder.prototype.addFunction = function ( functionName, signature, - destination + destination, ) { //>>includeStart('debug', pragmas.debug); Check.typeOf.string("functionName", functionName); @@ -254,7 +254,7 @@ ShaderBuilder.prototype.addFunctionLines = function (functionName, lines) { Check.typeOf.string("functionName", functionName); if (typeof lines !== "string" && !Array.isArray(lines)) { throw new DeveloperError( - `Expected lines to be a string or an array of strings, actual value was ${lines}` + `Expected lines to be a string or an array of strings, actual value was ${lines}`, ); } //>>includeEnd('debug'); @@ -317,7 +317,7 @@ ShaderBuilder.prototype.setPositionAttribute = function (type, identifier) { if (defined(this._positionAttributeLine)) { throw new DeveloperError( - "setPositionAttribute() must be called exactly once for the attribute used for gl_Position. For other attributes, use addAttribute()" + "setPositionAttribute() must be called exactly once for the attribute used for gl_Position. For other attributes, use addAttribute()", ); } //>>includeEnd('debug'); @@ -407,7 +407,7 @@ ShaderBuilder.prototype.addVertexLines = function (lines) { //>>includeStart('debug', pragmas.debug); if (typeof lines !== "string" && !Array.isArray(lines)) { throw new DeveloperError( - `Expected lines to be a string or an array of strings, actual value was ${lines}` + `Expected lines to be a string or an array of strings, actual value was ${lines}`, ); } //>>includeEnd('debug'); @@ -442,7 +442,7 @@ ShaderBuilder.prototype.addFragmentLines = function (lines) { //>>includeStart('debug', pragmas.debug); if (typeof lines !== "string" && !Array.isArray(lines)) { throw new DeveloperError( - `Expected lines to be a string or an array of strings, actual value was ${lines}` + `Expected lines to be a string or an array of strings, actual value was ${lines}`, ); } //>>includeEnd('debug'); @@ -488,7 +488,7 @@ ShaderBuilder.prototype.buildShaderProgram = function (context) { this._vertexShaderParts.varyingLines, structLines.vertexLines, functionLines.vertexLines, - this._vertexShaderParts.shaderLines + this._vertexShaderParts.shaderLines, ) .join("\n"); const vertexShaderSource = new ShaderSource({ @@ -501,7 +501,7 @@ ShaderBuilder.prototype.buildShaderProgram = function (context) { this._fragmentShaderParts.varyingLines, structLines.fragmentLines, functionLines.fragmentLines, - this._fragmentShaderParts.shaderLines + this._fragmentShaderParts.shaderLines, ) .join("\n"); const fragmentShaderSource = new ShaderSource({ diff --git a/packages/engine/Source/Renderer/ShaderCache.js b/packages/engine/Source/Renderer/ShaderCache.js index 95268dd6b8b3..dc297dd86f44 100644 --- a/packages/engine/Source/Renderer/ShaderCache.js +++ b/packages/engine/Source/Renderer/ShaderCache.js @@ -112,12 +112,10 @@ ShaderCache.prototype.getShaderProgram = function (options) { } else { const context = this._context; - const vertexShaderText = vertexShaderSource.createCombinedVertexShader( - context - ); - const fragmentShaderText = fragmentShaderSource.createCombinedFragmentShader( - context - ); + const vertexShaderText = + vertexShaderSource.createCombinedVertexShader(context); + const fragmentShaderText = + fragmentShaderSource.createCombinedFragmentShader(context); const shaderProgram = new ShaderProgram({ gl: context._gl, @@ -151,7 +149,7 @@ ShaderCache.prototype.getShaderProgram = function (options) { ShaderCache.prototype.replaceDerivedShaderProgram = function ( shaderProgram, keyword, - options + options, ) { const cachedShader = shaderProgram._cachedShader; const derivedKeyword = keyword + cachedShader.keyword; @@ -169,7 +167,7 @@ ShaderCache.prototype.replaceDerivedShaderProgram = function ( ShaderCache.prototype.getDerivedShaderProgram = function ( shaderProgram, - keyword + keyword, ) { const cachedShader = shaderProgram._cachedShader; const derivedKeyword = keyword + cachedShader.keyword; @@ -184,7 +182,7 @@ ShaderCache.prototype.getDerivedShaderProgram = function ( ShaderCache.prototype.createDerivedShaderProgram = function ( shaderProgram, keyword, - options + options, ) { const cachedShader = shaderProgram._cachedShader; const derivedKeyword = keyword + cachedShader.keyword; @@ -207,12 +205,10 @@ ShaderCache.prototype.createDerivedShaderProgram = function ( const context = this._context; - const vertexShaderText = vertexShaderSource.createCombinedVertexShader( - context - ); - const fragmentShaderText = fragmentShaderSource.createCombinedFragmentShader( - context - ); + const vertexShaderText = + vertexShaderSource.createCombinedVertexShader(context); + const fragmentShaderText = + fragmentShaderSource.createCombinedFragmentShader(context); const derivedShaderProgram = new ShaderProgram({ gl: context._gl, diff --git a/packages/engine/Source/Renderer/ShaderFunction.js b/packages/engine/Source/Renderer/ShaderFunction.js index 3da6656486ee..00d1ca4ea39b 100644 --- a/packages/engine/Source/Renderer/ShaderFunction.js +++ b/packages/engine/Source/Renderer/ShaderFunction.js @@ -37,7 +37,7 @@ ShaderFunction.prototype.addLines = function (lines) { //>>includeStart('debug', pragmas.debug); if (typeof lines !== "string" && !Array.isArray(lines)) { throw new DeveloperError( - `Expected lines to be a string or an array of strings, actual value was ${lines}` + `Expected lines to be a string or an array of strings, actual value was ${lines}`, ); } //>>includeEnd('debug'); diff --git a/packages/engine/Source/Renderer/ShaderProgram.js b/packages/engine/Source/Renderer/ShaderProgram.js index d9df800dc518..e8e180328599 100644 --- a/packages/engine/Source/Renderer/ShaderProgram.js +++ b/packages/engine/Source/Renderer/ShaderProgram.js @@ -28,7 +28,7 @@ function ShaderProgram(options) { const modifiedFS = handleUniformPrecisionMismatches( vertexShaderText, - fragmentShaderText + fragmentShaderText, ); this._gl = options.gl; @@ -143,7 +143,7 @@ function extractUniforms(shaderText) { function handleUniformPrecisionMismatches( vertexShaderText, - fragmentShaderText + fragmentShaderText, ) { // If a uniform exists in both the vertex and fragment shader but with different precision qualifiers, // give the fragment shader uniform a different name. This fixes shader compilation errors on devices @@ -204,7 +204,7 @@ function createAndLinkProgram(gl, shader) { gl.bindAttribLocation( program, attributeLocations[attribute], - attribute + attribute, ); } } @@ -275,7 +275,7 @@ function createAndLinkProgram(gl, shader) { return; } console.error( - `${consolePrefix}Translated ${name} shaderSource:\n${translation}` + `${consolePrefix}Translated ${name} shaderSource:\n${translation}`, ); } } @@ -309,7 +309,7 @@ function findUniforms(gl, program) { const uniformName = activeUniform.name.indexOf( suffix, - activeUniform.name.length - suffix.length + activeUniform.name.length - suffix.length, ) !== -1 ? activeUniform.name.slice(0, activeUniform.name.length - 3) : activeUniform.name; @@ -328,7 +328,7 @@ function findUniforms(gl, program) { gl, activeUniform, uniformName, - location + location, ); uniformsByName[uniformName] = uniform; @@ -388,7 +388,7 @@ function findUniforms(gl, program) { gl, activeUniform, uniformName, - locations + locations, ); uniformsByName[uniformName] = uniformArray; @@ -470,12 +470,12 @@ function reinitialize(shader) { const program = createAndLinkProgram(gl, shader, shader._debugShaders); const numberOfVertexAttributes = gl.getProgramParameter( program, - gl.ACTIVE_ATTRIBUTES + gl.ACTIVE_ATTRIBUTES, ); const uniforms = findUniforms(gl, program); const partitionedUniforms = partitionUniforms( shader, - uniforms.uniformsByName + uniforms.uniformsByName, ); shader._program = program; @@ -483,7 +483,7 @@ function reinitialize(shader) { shader._vertexAttributes = findVertexAttributes( gl, program, - numberOfVertexAttributes + numberOfVertexAttributes, ); shader._uniformsByName = uniforms.uniformsByName; shader._uniforms = uniforms.uniforms; @@ -493,7 +493,7 @@ function reinitialize(shader) { shader.maximumTextureUnitIndex = setSamplerUniforms( gl, program, - uniforms.samplerUniforms + uniforms.samplerUniforms, ); if (oldProgram) { @@ -507,7 +507,7 @@ function reinitialize(shader) { vertexSourceCode, // The new vertex shader source fragmentSourceCode, // The new fragment shader source onCompiled, // Callback triggered by your engine when the compilation is successful. It needs to send back the new linked program. - onError // Callback triggered by your engine in case of error. It needs to send the WebGL error to allow the editor to display the error in the gutter. + onError, // Callback triggered by your engine in case of error. It needs to send the WebGL error to allow the editor to display the error in the gutter. ) { const originalVS = shader._vertexShaderText; const originalFS = shader._fragmentShaderText; @@ -546,7 +546,7 @@ ShaderProgram.prototype._bind = function () { ShaderProgram.prototype._setUniforms = function ( uniformMap, uniformState, - validate + validate, ) { let len; let i; @@ -595,8 +595,8 @@ ShaderProgram.prototype._setUniforms = function ( if (!gl.getProgramParameter(program, gl.VALIDATE_STATUS)) { throw new DeveloperError( `Program validation failed. Program info log: ${gl.getProgramInfoLog( - program - )}` + program, + )}`, ); } //>>includeEnd('debug'); diff --git a/packages/engine/Source/Renderer/ShaderSource.js b/packages/engine/Source/Renderer/ShaderSource.js index 66d253e19ef5..7f72eac0afd5 100644 --- a/packages/engine/Source/Renderer/ShaderSource.js +++ b/packages/engine/Source/Renderer/ShaderSource.js @@ -72,7 +72,7 @@ function generateDependencies(currentNode, dependencyNodes) { const referencedNode = getDependencyNode( element, ShaderSource._czmBuiltinsAndUniforms[element], - dependencyNodes + dependencyNodes, ); currentNode.dependsOn.push(referencedNode); referencedNode.requiredBy.push(currentNode); @@ -170,45 +170,46 @@ function combineShader(shaderSource, isFragmentShader, context) { // Extract existing shader version from sources let version; - combinedSources = combinedSources.replace(/#version\s+(.*?)\n/gm, function ( - match, - group1 - ) { - //>>includeStart('debug', pragmas.debug); - if (defined(version) && version !== group1) { - throw new DeveloperError( - `inconsistent versions found: ${version} and ${group1}` - ); - } - //>>includeEnd('debug'); + combinedSources = combinedSources.replace( + /#version\s+(.*?)\n/gm, + function (match, group1) { + //>>includeStart('debug', pragmas.debug); + if (defined(version) && version !== group1) { + throw new DeveloperError( + `inconsistent versions found: ${version} and ${group1}`, + ); + } + //>>includeEnd('debug'); - // Extract #version to put at the top - version = group1; + // Extract #version to put at the top + version = group1; - // Replace original #version directive with a new line so the line numbers - // are not off by one. There can be only one #version directive - // and it must appear at the top of the source, only preceded by - // whitespace and comments. - return "\n"; - }); + // Replace original #version directive with a new line so the line numbers + // are not off by one. There can be only one #version directive + // and it must appear at the top of the source, only preceded by + // whitespace and comments. + return "\n"; + }, + ); // Extract shader extensions from sources const extensions = []; - combinedSources = combinedSources.replace(/#extension.*\n/gm, function ( - match - ) { - // Extract extension to put at the top - extensions.push(match); - - // Replace original #extension directive with a new line so the line numbers - // are not off by one. - return "\n"; - }); + combinedSources = combinedSources.replace( + /#extension.*\n/gm, + function (match) { + // Extract extension to put at the top + extensions.push(match); + + // Replace original #extension directive with a new line so the line numbers + // are not off by one. + return "\n"; + }, + ); // Remove precision qualifier combinedSources = combinedSources.replace( /precision\s(lowp|mediump|highp)\s(float|int);/, - "" + "", ); // Replace main() for picked if desired. @@ -216,7 +217,7 @@ function combineShader(shaderSource, isFragmentShader, context) { if (defined(pickColorQualifier)) { combinedSources = ShaderSource.createPickFragmentShaderSource( combinedSources, - pickColorQualifier + pickColorQualifier, ); } @@ -280,7 +281,7 @@ function combineShader(shaderSource, isFragmentShader, context) { context.webgl2 && isFragmentShader && !/layout\s*\(location\s*=\s*0\)\s*out\s+vec4\s+out_FragColor;/g.test( - combinedShader + combinedShader, ) && !/czm_out_FragColor/g.test(combinedShader) && /out_FragColor/g.test(combinedShader) @@ -338,7 +339,7 @@ function ShaderSource(options) { pickColorQualifier !== "in" ) { throw new DeveloperError( - "options.pickColorQualifier must be 'uniform' or 'in'." + "options.pickColorQualifier must be 'uniform' or 'in'.", ); } //>>includeEnd('debug'); @@ -422,9 +423,8 @@ for (const uniformName in AutomaticUniforms) { if (AutomaticUniforms.hasOwnProperty(uniformName)) { const uniform = AutomaticUniforms[uniformName]; if (typeof uniform.getDeclaration === "function") { - ShaderSource._czmBuiltinsAndUniforms[ - uniformName - ] = uniform.getDeclaration(uniformName); + ShaderSource._czmBuiltinsAndUniforms[uniformName] = + uniform.getDeclaration(uniformName); } } } @@ -432,7 +432,7 @@ for (const uniformName in AutomaticUniforms) { ShaderSource.createPickVertexShaderSource = function (vertexShaderSource) { const renamedVS = ShaderSource.replaceMain( vertexShaderSource, - "czm_old_main" + "czm_old_main", ); const pickMain = "in vec4 pickColor; \n" + @@ -448,11 +448,11 @@ ShaderSource.createPickVertexShaderSource = function (vertexShaderSource) { ShaderSource.createPickFragmentShaderSource = function ( fragmentShaderSource, - pickColorQualifier + pickColorQualifier, ) { const renamedFS = ShaderSource.replaceMain( fragmentShaderSource, - "czm_old_main" + "czm_old_main", ); const pickMain = `${pickColorQualifier} vec4 czm_pickColor; \n` + diff --git a/packages/engine/Source/Renderer/Texture.js b/packages/engine/Source/Renderer/Texture.js index 861966d50232..0c9071c30323 100644 --- a/packages/engine/Source/Renderer/Texture.js +++ b/packages/engine/Source/Renderer/Texture.js @@ -78,7 +78,7 @@ function Texture(options) { const internalFormat = PixelFormat.toInternalFormat( pixelFormat, pixelDatatype, - context + context, ); const isCompressed = PixelFormat.isCompressedFormat(internalFormat); @@ -86,7 +86,7 @@ function Texture(options) { //>>includeStart('debug', pragmas.debug); if (!defined(width) || !defined(height)) { throw new DeveloperError( - "options requires a source field to create an initialized texture or width and height fields to create a blank texture." + "options requires a source field to create an initialized texture or width and height fields to create a blank texture.", ); } @@ -94,7 +94,7 @@ function Texture(options) { if (width > ContextLimits.maximumTextureSize) { throw new DeveloperError( - `Width must be less than or equal to the maximum texture size (${ContextLimits.maximumTextureSize}). Check maximumTextureSize.` + `Width must be less than or equal to the maximum texture size (${ContextLimits.maximumTextureSize}). Check maximumTextureSize.`, ); } @@ -102,7 +102,7 @@ function Texture(options) { if (height > ContextLimits.maximumTextureSize) { throw new DeveloperError( - `Height must be less than or equal to the maximum texture size (${ContextLimits.maximumTextureSize}). Check maximumTextureSize.` + `Height must be less than or equal to the maximum texture size (${ContextLimits.maximumTextureSize}). Check maximumTextureSize.`, ); } @@ -120,7 +120,7 @@ function Texture(options) { pixelDatatype !== PixelDatatype.UNSIGNED_INT ) { throw new DeveloperError( - "When options.pixelFormat is DEPTH_COMPONENT, options.pixelDatatype must be UNSIGNED_SHORT or UNSIGNED_INT." + "When options.pixelFormat is DEPTH_COMPONENT, options.pixelDatatype must be UNSIGNED_SHORT or UNSIGNED_INT.", ); } @@ -129,13 +129,13 @@ function Texture(options) { pixelDatatype !== PixelDatatype.UNSIGNED_INT_24_8 ) { throw new DeveloperError( - "When options.pixelFormat is DEPTH_STENCIL, options.pixelDatatype must be UNSIGNED_INT_24_8." + "When options.pixelFormat is DEPTH_STENCIL, options.pixelDatatype must be UNSIGNED_INT_24_8.", ); } if (pixelDatatype === PixelDatatype.FLOAT && !context.floatingPointTexture) { throw new DeveloperError( - "When options.pixelDatatype is FLOAT, this WebGL implementation must support the OES_texture_float extension. Check context.floatingPointTexture." + "When options.pixelDatatype is FLOAT, this WebGL implementation must support the OES_texture_float extension. Check context.floatingPointTexture.", ); } @@ -144,20 +144,20 @@ function Texture(options) { !context.halfFloatingPointTexture ) { throw new DeveloperError( - "When options.pixelDatatype is HALF_FLOAT, this WebGL implementation must support the OES_texture_half_float extension. Check context.halfFloatingPointTexture." + "When options.pixelDatatype is HALF_FLOAT, this WebGL implementation must support the OES_texture_half_float extension. Check context.halfFloatingPointTexture.", ); } if (PixelFormat.isDepthFormat(pixelFormat)) { if (defined(source)) { throw new DeveloperError( - "When options.pixelFormat is DEPTH_COMPONENT or DEPTH_STENCIL, source cannot be provided." + "When options.pixelFormat is DEPTH_COMPONENT or DEPTH_STENCIL, source cannot be provided.", ); } if (!context.depthTexture) { throw new DeveloperError( - "When options.pixelFormat is DEPTH_COMPONENT or DEPTH_STENCIL, this WebGL implementation must support WEBGL_depth_texture. Check context.depthTexture." + "When options.pixelFormat is DEPTH_COMPONENT or DEPTH_STENCIL, this WebGL implementation must support WEBGL_depth_texture. Check context.depthTexture.", ); } } @@ -165,33 +165,33 @@ function Texture(options) { if (isCompressed) { if (!defined(source) || !defined(source.arrayBufferView)) { throw new DeveloperError( - "When options.pixelFormat is compressed, options.source.arrayBufferView must be defined." + "When options.pixelFormat is compressed, options.source.arrayBufferView must be defined.", ); } if (PixelFormat.isDXTFormat(internalFormat) && !context.s3tc) { throw new DeveloperError( - "When options.pixelFormat is S3TC compressed, this WebGL implementation must support the WEBGL_compressed_texture_s3tc extension. Check context.s3tc." + "When options.pixelFormat is S3TC compressed, this WebGL implementation must support the WEBGL_compressed_texture_s3tc extension. Check context.s3tc.", ); } else if (PixelFormat.isPVRTCFormat(internalFormat) && !context.pvrtc) { throw new DeveloperError( - "When options.pixelFormat is PVRTC compressed, this WebGL implementation must support the WEBGL_compressed_texture_pvrtc extension. Check context.pvrtc." + "When options.pixelFormat is PVRTC compressed, this WebGL implementation must support the WEBGL_compressed_texture_pvrtc extension. Check context.pvrtc.", ); } else if (PixelFormat.isASTCFormat(internalFormat) && !context.astc) { throw new DeveloperError( - "When options.pixelFormat is ASTC compressed, this WebGL implementation must support the WEBGL_compressed_texture_astc extension. Check context.astc." + "When options.pixelFormat is ASTC compressed, this WebGL implementation must support the WEBGL_compressed_texture_astc extension. Check context.astc.", ); } else if (PixelFormat.isETC2Format(internalFormat) && !context.etc) { throw new DeveloperError( - "When options.pixelFormat is ETC2 compressed, this WebGL implementation must support the WEBGL_compressed_texture_etc extension. Check context.etc." + "When options.pixelFormat is ETC2 compressed, this WebGL implementation must support the WEBGL_compressed_texture_etc extension. Check context.etc.", ); } else if (PixelFormat.isETC1Format(internalFormat) && !context.etc1) { throw new DeveloperError( - "When options.pixelFormat is ETC1 compressed, this WebGL implementation must support the WEBGL_compressed_texture_etc1 extension. Check context.etc1." + "When options.pixelFormat is ETC1 compressed, this WebGL implementation must support the WEBGL_compressed_texture_etc1 extension. Check context.etc1.", ); } else if (PixelFormat.isBC7Format(internalFormat) && !context.bc7) { throw new DeveloperError( - "When options.pixelFormat is BC7 compressed, this WebGL implementation must support the EXT_texture_compression_bptc extension. Check context.bc7." + "When options.pixelFormat is BC7 compressed, this WebGL implementation must support the EXT_texture_compression_bptc extension. Check context.bc7.", ); } @@ -199,11 +199,11 @@ function Texture(options) { PixelFormat.compressedTextureSizeInBytes( internalFormat, width, - height + height, ) !== source.arrayBufferView.byteLength ) { throw new DeveloperError( - "The byte length of the array buffer is invalid for the compressed texture with the given width and height." + "The byte length of the array buffer is invalid for the compressed texture with the given width and height.", ); } } @@ -245,7 +245,7 @@ function Texture(options) { } else { gl.pixelStorei( gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, - gl.BROWSER_DEFAULT_WEBGL + gl.BROWSER_DEFAULT_WEBGL, ); } if (defined(source.arrayBufferView)) { @@ -295,7 +295,7 @@ function loadCompressedBufferSource(texture, source) { width, height, 0, - source.arrayBufferView + source.arrayBufferView, ); if (defined(source.mipLevels)) { @@ -311,7 +311,7 @@ function loadCompressedBufferSource(texture, source) { mipWidth, mipHeight, 0, - source.mipLevels[i] + source.mipLevels[i], ); } } @@ -336,7 +336,7 @@ function loadBufferSource(texture, source) { const unpackAlignment = PixelFormat.alignmentInBytes( pixelFormat, pixelDatatype, - width + width, ); gl.pixelStorei(gl.UNPACK_ALIGNMENT, unpackAlignment); gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false); @@ -349,7 +349,7 @@ function loadBufferSource(texture, source) { pixelFormat, pixelDatatype, width, - height + height, ); } gl.texImage2D( @@ -361,7 +361,7 @@ function loadBufferSource(texture, source) { 0, pixelFormat, PixelDatatype.toWebGLConstant(pixelDatatype, context), - arrayBufferView + arrayBufferView, ); if (defined(source.mipLevels)) { @@ -379,7 +379,7 @@ function loadBufferSource(texture, source) { 0, pixelFormat, PixelDatatype.toWebGLConstant(pixelDatatype, context), - source.mipLevels[i] + source.mipLevels[i], ); } } @@ -413,7 +413,7 @@ function loadFramebufferSource(texture, source) { source.yOffset, texture.width, texture.height, - 0 + 0, ); if (source.framebuffer !== context.defaultFramebuffer) { @@ -443,7 +443,7 @@ function loadImageSource(texture, source) { texture._internalFormat, texture.pixelFormat, PixelDatatype.toWebGLConstant(texture.pixelDatatype, context), - source + source, ); } @@ -479,7 +479,7 @@ function loadNull(texture) { 0, texture._pixelFormat, PixelDatatype.toWebGLConstant(texture._pixelDatatype, context), - null + null, ); } @@ -552,28 +552,28 @@ Texture.fromFramebuffer = function (options) { PixelFormat.isCompressedFormat(pixelFormat) ) { throw new DeveloperError( - "pixelFormat cannot be DEPTH_COMPONENT, DEPTH_STENCIL or a compressed format." + "pixelFormat cannot be DEPTH_COMPONENT, DEPTH_STENCIL or a compressed format.", ); } Check.defined("options.context", context); Check.typeOf.number.greaterThanOrEquals( "framebufferXOffset", framebufferXOffset, - 0 + 0, ); Check.typeOf.number.greaterThanOrEquals( "framebufferYOffset", framebufferYOffset, - 0 + 0, ); if (framebufferXOffset + width > gl.drawingBufferWidth) { throw new DeveloperError( - "framebufferXOffset + width must be less than or equal to drawingBufferWidth" + "framebufferXOffset + width must be less than or equal to drawingBufferWidth", ); } if (framebufferYOffset + height > gl.drawingBufferHeight) { throw new DeveloperError( - "framebufferYOffset + height must be less than or equal to drawingBufferHeight." + "framebufferYOffset + height must be less than or equal to drawingBufferHeight.", ); } //>>includeEnd('debug'); @@ -732,7 +732,7 @@ function setupSampler(texture, sampler) { gl.texParameteri( target, texture._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT, - sampler.maximumAnisotropy + sampler.maximumAnisotropy, ); } gl.bindTexture(target, null); @@ -781,12 +781,12 @@ Texture.prototype.copyFrom = function (options) { Check.defined("options.source", source); if (PixelFormat.isDepthFormat(this._pixelFormat)) { throw new DeveloperError( - "Cannot call copyFrom when the texture pixel format is DEPTH_COMPONENT or DEPTH_STENCIL." + "Cannot call copyFrom when the texture pixel format is DEPTH_COMPONENT or DEPTH_STENCIL.", ); } if (PixelFormat.isCompressedFormat(this._pixelFormat)) { throw new DeveloperError( - "Cannot call copyFrom with a compressed texture pixel format." + "Cannot call copyFrom with a compressed texture pixel format.", ); } Check.typeOf.number.greaterThanOrEquals("xOffset", xOffset, 0); @@ -794,12 +794,12 @@ Texture.prototype.copyFrom = function (options) { Check.typeOf.number.lessThanOrEquals( "xOffset + options.source.width", xOffset + source.width, - this._width + this._width, ); Check.typeOf.number.lessThanOrEquals( "yOffset + options.source.height", yOffset + source.height, - this._height + this._height, ); //>>includeEnd('debug'); @@ -826,7 +826,7 @@ Texture.prototype.copyFrom = function (options) { unpackAlignment = PixelFormat.alignmentInBytes( pixelFormat, pixelDatatype, - width + width, ); } gl.pixelStorei(gl.UNPACK_ALIGNMENT, unpackAlignment); @@ -836,7 +836,7 @@ Texture.prototype.copyFrom = function (options) { } else { gl.pixelStorei( gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, - gl.BROWSER_DEFAULT_WEBGL + gl.BROWSER_DEFAULT_WEBGL, ); } @@ -859,7 +859,7 @@ Texture.prototype.copyFrom = function (options) { pixelFormat, pixelDatatype, textureWidth, - textureHeight + textureHeight, ); } else { pixels = arrayBufferView; @@ -879,7 +879,7 @@ Texture.prototype.copyFrom = function (options) { pixelFormat, pixelDatatype, textureWidth, - textureHeight + textureHeight, ); } gl.texImage2D( @@ -891,7 +891,7 @@ Texture.prototype.copyFrom = function (options) { 0, pixelFormat, PixelDatatype.toWebGLConstant(pixelDatatype, context), - pixels + pixels, ); this._initialized = true; } @@ -908,7 +908,7 @@ Texture.prototype.copyFrom = function (options) { pixelFormat, pixelDatatype, width, - height + height, ); } else { pixels = arrayBufferView; @@ -928,7 +928,7 @@ Texture.prototype.copyFrom = function (options) { height, pixelFormat, PixelDatatype.toWebGLConstant(pixelDatatype, context), - pixels + pixels, ); } @@ -961,7 +961,7 @@ Texture.prototype.copyFromFramebuffer = function ( framebufferXOffset, framebufferYOffset, width, - height + height, ) { xOffset = defaultValue(xOffset, 0); yOffset = defaultValue(yOffset, 0); @@ -973,22 +973,22 @@ Texture.prototype.copyFromFramebuffer = function ( //>>includeStart('debug', pragmas.debug); if (PixelFormat.isDepthFormat(this._pixelFormat)) { throw new DeveloperError( - "Cannot call copyFromFramebuffer when the texture pixel format is DEPTH_COMPONENT or DEPTH_STENCIL." + "Cannot call copyFromFramebuffer when the texture pixel format is DEPTH_COMPONENT or DEPTH_STENCIL.", ); } if (this._pixelDatatype === PixelDatatype.FLOAT) { throw new DeveloperError( - "Cannot call copyFromFramebuffer when the texture pixel data type is FLOAT." + "Cannot call copyFromFramebuffer when the texture pixel data type is FLOAT.", ); } if (this._pixelDatatype === PixelDatatype.HALF_FLOAT) { throw new DeveloperError( - "Cannot call copyFromFramebuffer when the texture pixel data type is HALF_FLOAT." + "Cannot call copyFromFramebuffer when the texture pixel data type is HALF_FLOAT.", ); } if (PixelFormat.isCompressedFormat(this._pixelFormat)) { throw new DeveloperError( - "Cannot call copyFrom with a compressed texture pixel format." + "Cannot call copyFrom with a compressed texture pixel format.", ); } @@ -997,22 +997,22 @@ Texture.prototype.copyFromFramebuffer = function ( Check.typeOf.number.greaterThanOrEquals( "framebufferXOffset", framebufferXOffset, - 0 + 0, ); Check.typeOf.number.greaterThanOrEquals( "framebufferYOffset", framebufferYOffset, - 0 + 0, ); Check.typeOf.number.lessThanOrEquals( "xOffset + width", xOffset + width, - this._width + this._width, ); Check.typeOf.number.lessThanOrEquals( "yOffset + height", yOffset + height, - this._height + this._height, ); //>>includeEnd('debug'); @@ -1029,7 +1029,7 @@ Texture.prototype.copyFromFramebuffer = function ( framebufferXOffset, framebufferYOffset, width, - height + height, ); gl.bindTexture(target, null); this._initialized = true; @@ -1051,23 +1051,23 @@ Texture.prototype.generateMipmap = function (hint) { //>>includeStart('debug', pragmas.debug); if (PixelFormat.isDepthFormat(this._pixelFormat)) { throw new DeveloperError( - "Cannot call generateMipmap when the texture pixel format is DEPTH_COMPONENT or DEPTH_STENCIL." + "Cannot call generateMipmap when the texture pixel format is DEPTH_COMPONENT or DEPTH_STENCIL.", ); } if (PixelFormat.isCompressedFormat(this._pixelFormat)) { throw new DeveloperError( - "Cannot call generateMipmap with a compressed pixel format." + "Cannot call generateMipmap with a compressed pixel format.", ); } if (!this._context.webgl2) { if (this._width > 1 && !CesiumMath.isPowerOfTwo(this._width)) { throw new DeveloperError( - "width must be a power of two to call generateMipmap() in a WebGL1 context." + "width must be a power of two to call generateMipmap() in a WebGL1 context.", ); } if (this._height > 1 && !CesiumMath.isPowerOfTwo(this._height)) { throw new DeveloperError( - "height must be a power of two to call generateMipmap() in a WebGL1 context." + "height must be a power of two to call generateMipmap() in a WebGL1 context.", ); } } diff --git a/packages/engine/Source/Renderer/UniformState.js b/packages/engine/Source/Renderer/UniformState.js index eee7abd96771..2e28f0585217 100644 --- a/packages/engine/Source/Renderer/UniformState.js +++ b/packages/engine/Source/Renderer/UniformState.js @@ -1227,25 +1227,26 @@ function setCamera(uniformState, camera) { if (Cartesian3.magnitude(camera.positionWC) > 0.0) { uniformState._eyeEllipsoidNormalEC = Cartesian3.normalize( camera.positionWC, - uniformState._eyeEllipsoidNormalEC + uniformState._eyeEllipsoidNormalEC, ); } surfacePosition = ellipsoid.scaleToGeodeticSurface( camera.positionWC, - surfacePositionScratch + surfacePositionScratch, ); } else { uniformState._eyeHeight = positionCartographic.height; - uniformState._eyeEllipsoidNormalEC = ellipsoid.geodeticSurfaceNormalCartographic( - positionCartographic, - uniformState._eyeEllipsoidNormalEC - ); + uniformState._eyeEllipsoidNormalEC = + ellipsoid.geodeticSurfaceNormalCartographic( + positionCartographic, + uniformState._eyeEllipsoidNormalEC, + ); surfacePosition = Cartesian3.fromRadians( positionCartographic.longitude, positionCartographic.latitude, 0.0, ellipsoid, - surfacePositionScratch + surfacePositionScratch, ); } @@ -1258,29 +1259,29 @@ function setCamera(uniformState, camera) { uniformState._eyeEllipsoidNormalEC = Matrix3.multiplyByVector( uniformState._viewRotation, uniformState._eyeEllipsoidNormalEC, - uniformState._eyeEllipsoidNormalEC + uniformState._eyeEllipsoidNormalEC, ); const enuToWorld = Transforms.eastNorthUpToFixedFrame( surfacePosition, ellipsoid, - enuTransformScratch + enuTransformScratch, ); uniformState._enuToModel = Matrix4.multiplyTransformation( uniformState.inverseModel, enuToWorld, - uniformState._enuToModel + uniformState._enuToModel, ); uniformState._modelToEnu = Matrix4.inverseTransformation( uniformState._enuToModel, - uniformState._modelToEnu + uniformState._modelToEnu, ); if ( !CesiumMath.equalsEpsilon( ellipsoid._radii.x, ellipsoid._radii.y, - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ) ) { // Ellipsoid curvature calculations assume radii.x === radii.y as is true for WGS84 @@ -1289,7 +1290,7 @@ function setCamera(uniformState, camera) { uniformState._eyeEllipsoidCurvature = ellipsoid.getLocalCurvature( surfacePosition, - uniformState._eyeEllipsoidCurvature + uniformState._eyeEllipsoidCurvature, ); } @@ -1298,13 +1299,14 @@ const sunCartographicScratch = new Cartographic(); function setSunAndMoonDirections(uniformState, frameState) { Transforms.computeIcrfToCentralBodyFixedMatrix( frameState.time, - transformMatrix + transformMatrix, ); - let position = Simon1994PlanetaryPositions.computeSunPositionInEarthInertialFrame( - frameState.time, - uniformState._sunPositionWC - ); + let position = + Simon1994PlanetaryPositions.computeSunPositionInEarthInertialFrame( + frameState.time, + uniformState._sunPositionWC, + ); Matrix3.multiplyByVector(transformMatrix, position, position); Cartesian3.normalize(position, uniformState._sunDirectionWC); @@ -1312,14 +1314,15 @@ function setSunAndMoonDirections(uniformState, frameState) { position = Matrix3.multiplyByVector( uniformState.viewRotation3D, position, - uniformState._sunDirectionEC + uniformState._sunDirectionEC, ); Cartesian3.normalize(position, position); - position = Simon1994PlanetaryPositions.computeMoonPositionInEarthInertialFrame( - frameState.time, - uniformState._moonDirectionEC - ); + position = + Simon1994PlanetaryPositions.computeMoonPositionInEarthInertialFrame( + frameState.time, + uniformState._moonDirectionEC, + ); Matrix3.multiplyByVector(transformMatrix, position, position); Matrix3.multiplyByVector(uniformState.viewRotation3D, position, position); Cartesian3.normalize(position, position); @@ -1328,7 +1331,7 @@ function setSunAndMoonDirections(uniformState, frameState) { const ellipsoid = projection.ellipsoid; const sunCartographic = ellipsoid.cartesianToCartographic( uniformState._sunPositionWC, - sunCartographicScratch + sunCartographicScratch, ); projection.project(sunCartographic, uniformState._sunPositionColumbusView); } @@ -1371,7 +1374,7 @@ UniformState.prototype.updateFrustum = function (frustum) { this._farDepthFromNearPlusOne = frustum.far - frustum.near + 1.0; this._log2FarDepthFromNearPlusOne = CesiumMath.log2( - this._farDepthFromNearPlusOne + this._farDepthFromNearPlusOne, ); this._oneOverLog2FarDepthFromNearPlusOne = 1.0 / this._log2FarDepthFromNearPlusOne; @@ -1426,21 +1429,21 @@ UniformState.prototype.update = function (frameState) { if (light instanceof SunLight) { this._lightDirectionWC = Cartesian3.clone( this._sunDirectionWC, - this._lightDirectionWC + this._lightDirectionWC, ); this._lightDirectionEC = Cartesian3.clone( this._sunDirectionEC, - this._lightDirectionEC + this._lightDirectionEC, ); } else { this._lightDirectionWC = Cartesian3.normalize( Cartesian3.negate(light.direction, this._lightDirectionWC), - this._lightDirectionWC + this._lightDirectionWC, ); this._lightDirectionEC = Matrix3.multiplyByVector( this.viewRotation3D, this._lightDirectionWC, - this._lightDirectionEC + this._lightDirectionEC, ); } @@ -1449,19 +1452,19 @@ UniformState.prototype.update = function (frameState) { lightColor.red, lightColor.green, lightColor.blue, - this._lightColorHdr + this._lightColorHdr, ); lightColorHdr = Cartesian3.multiplyByScalar( lightColorHdr, light.intensity, - lightColorHdr + lightColorHdr, ); const maximumComponent = Cartesian3.maximumComponent(lightColorHdr); if (maximumComponent > 1.0) { Cartesian3.divideByScalar( lightColorHdr, maximumComponent, - this._lightColor + this._lightColor, ); } else { Cartesian3.clone(lightColorHdr, this._lightColor); @@ -1475,14 +1478,14 @@ UniformState.prototype.update = function (frameState) { this._environmentMap = defaultValue( frameState.environmentMap, - frameState.context.defaultCubeMap + frameState.context.defaultCubeMap, ); // IE 11 doesn't optimize out uniforms that are #ifdef'd out. So undefined values for the spherical harmonic // coefficients cause a crash. this._sphericalHarmonicCoefficients = defaultValue( frameState.sphericalHarmonicCoefficients, - EMPTY_ARRAY + EMPTY_ARRAY, ); this._specularEnvironmentMaps = frameState.specularEnvironmentMaps; this._specularEnvironmentMapsMaximumLOD = @@ -1497,17 +1500,17 @@ UniformState.prototype.update = function (frameState) { atmosphere.hueShift, atmosphere.saturationShift, atmosphere.brightnessShift, - this._atmosphereHsbShift + this._atmosphereHsbShift, ); this._atmosphereLightIntensity = atmosphere.lightIntensity; this._atmosphereRayleighCoefficient = Cartesian3.clone( atmosphere.rayleighCoefficient, - this._atmosphereRayleighCoefficient + this._atmosphereRayleighCoefficient, ); this._atmosphereRayleighScaleHeight = atmosphere.rayleighScaleHeight; this._atmosphereMieCoefficient = Cartesian3.clone( atmosphere.mieCoefficient, - this._atmosphereMieCoefficient + this._atmosphereMieCoefficient, ); this._atmosphereMieScaleHeight = atmosphere.mieScaleHeight; this._atmosphereMieAnisotropy = atmosphere.mieAnisotropy; @@ -1519,7 +1522,7 @@ UniformState.prototype.update = function (frameState) { this._frameState = frameState; this._temeToPseudoFixed = Transforms.computeTemeToPseudoFixedMatrix( frameState.time, - this._temeToPseudoFixed + this._temeToPseudoFixed, ); // Convert the relative splitPosition to absolute pixel coordinates @@ -1544,7 +1547,8 @@ UniformState.prototype.update = function (frameState) { this._minimumDisableDepthTestDistance = frameState.minimumDisableDepthTestDistance; - this._minimumDisableDepthTestDistance *= this._minimumDisableDepthTestDistance; + this._minimumDisableDepthTestDistance *= + this._minimumDisableDepthTestDistance; if (this._minimumDisableDepthTestDistance === Number.POSITIVE_INFINITY) { this._minimumDisableDepthTestDistance = -1.0; } @@ -1560,13 +1564,13 @@ function cleanViewport(uniformState) { v.y + v.height, 0.0, 1.0, - uniformState._viewportOrthographicMatrix + uniformState._viewportOrthographicMatrix, ); Matrix4.computeViewportTransformation( v, 0.0, 1.0, - uniformState._viewportTransformation + uniformState._viewportTransformation, ); uniformState._viewportDirty = false; } @@ -1583,7 +1587,7 @@ function cleanInverseProjection(uniformState) { ) { Matrix4.inverse( uniformState._projection, - uniformState._inverseProjection + uniformState._inverseProjection, ); } else { Matrix4.clone(Matrix4.ZERO, uniformState._inverseProjection); @@ -1599,7 +1603,7 @@ function cleanModelView(uniformState) { Matrix4.multiplyTransformation( uniformState._view, uniformState._model, - uniformState._modelView + uniformState._modelView, ); } } @@ -1611,7 +1615,7 @@ function cleanModelView3D(uniformState) { Matrix4.multiplyTransformation( uniformState.view3D, uniformState._model, - uniformState._modelView3D + uniformState._modelView3D, ); } } @@ -1639,7 +1643,7 @@ function cleanViewProjection(uniformState) { Matrix4.multiply( uniformState._projection, uniformState._view, - uniformState._viewProjection + uniformState._viewProjection, ); } } @@ -1650,7 +1654,7 @@ function cleanInverseViewProjection(uniformState) { Matrix4.inverse( uniformState.viewProjection, - uniformState._inverseViewProjection + uniformState._inverseViewProjection, ); } } @@ -1662,7 +1666,7 @@ function cleanModelViewProjection(uniformState) { Matrix4.multiply( uniformState._projection, uniformState.modelView, - uniformState._modelViewProjection + uniformState._modelViewProjection, ); } } @@ -1698,7 +1702,7 @@ function cleanInverseModelViewProjection(uniformState) { Matrix4.inverse( uniformState.modelViewProjection, - uniformState._inverseModelViewProjection + uniformState._inverseModelViewProjection, ); } } @@ -1710,7 +1714,7 @@ function cleanModelViewProjectionRelativeToEye(uniformState) { Matrix4.multiply( uniformState._projection, uniformState.modelViewRelativeToEye, - uniformState._modelViewProjectionRelativeToEye + uniformState._modelViewProjectionRelativeToEye, ); } } @@ -1722,7 +1726,7 @@ function cleanModelViewInfiniteProjection(uniformState) { Matrix4.multiply( uniformState._infiniteProjection, uniformState.modelView, - uniformState._modelViewInfiniteProjection + uniformState._modelViewInfiniteProjection, ); } } @@ -1776,11 +1780,11 @@ function cleanEncodedCameraPositionMC(uniformState) { Matrix4.multiplyByPoint( uniformState.inverseModel, uniformState._cameraPosition, - cameraPositionMC + cameraPositionMC, ); EncodedCartesian3.fromCartesian( cameraPositionMC, - uniformState._encodedCameraPositionMC + uniformState._encodedCameraPositionMC, ); } } @@ -1801,7 +1805,7 @@ function view2Dto3D( frustum2DWidth, mode, projection, - result + result, ) { // The camera position and directions are expressed in the 2D coordinate system where the Y axis is to the East, // the Z axis is to the North, and the X axis is out of the map. Express them instead in the ENU axes where @@ -1840,24 +1844,24 @@ function view2Dto3D( cartographic.longitude = CesiumMath.clamp( cartographic.longitude, -Math.PI, - Math.PI + Math.PI, ); cartographic.latitude = CesiumMath.clamp( cartographic.latitude, -CesiumMath.PI_OVER_TWO, - CesiumMath.PI_OVER_TWO + CesiumMath.PI_OVER_TWO, ); const ellipsoid = projection.ellipsoid; const position3D = ellipsoid.cartographicToCartesian( cartographic, - view2Dto3DCartesian3Scratch + view2Dto3DCartesian3Scratch, ); // Compute the rotation from the local ENU at the real world camera position to the fixed axes. const enuToFixed = Transforms.eastNorthUpToFixedFrame( position3D, ellipsoid, - view2Dto3DMatrix4Scratch + view2Dto3DMatrix4Scratch, ); // Transform each camera direction to the fixed axes. @@ -1903,7 +1907,7 @@ function updateView3D(that) { that._frustum2DWidth, that._mode, that._mapProjection, - that._view3D + that._view3D, ); } Matrix4.getMatrix3(that._view3D, that._viewRotation3D); diff --git a/packages/engine/Source/Renderer/VertexArray.js b/packages/engine/Source/Renderer/VertexArray.js index ed35bd1b76c2..a33cafc1068c 100644 --- a/packages/engine/Source/Renderer/VertexArray.js +++ b/packages/engine/Source/Renderer/VertexArray.js @@ -25,7 +25,7 @@ function addAttribute(attributes, attribute, index, context) { } if (hasVertexBuffer && hasValue) { throw new DeveloperError( - "attribute cannot have both a vertexBuffer and a value. It must have either a vertexBuffer property defining per-vertex data or a value property defining data for all vertices." + "attribute cannot have both a vertexBuffer and a value. It must have either a vertexBuffer property defining per-vertex data or a value property defining data for all vertices.", ); } if ( @@ -36,12 +36,12 @@ function addAttribute(attributes, attribute, index, context) { ) { if (hasValue) { throw new DeveloperError( - "attribute.value.length must be in the range [1, 4]." + "attribute.value.length must be in the range [1, 4].", ); } throw new DeveloperError( - "attribute.componentsPerAttribute must be in the range [1, 4]." + "attribute.componentsPerAttribute must be in the range [1, 4].", ); } if ( @@ -49,13 +49,13 @@ function addAttribute(attributes, attribute, index, context) { !ComponentDatatype.validate(attribute.componentDatatype) ) { throw new DeveloperError( - "attribute must have a valid componentDatatype or not specify it." + "attribute must have a valid componentDatatype or not specify it.", ); } if (defined(attribute.strideInBytes) && attribute.strideInBytes > 255) { // WebGL limit. Not in GL ES. throw new DeveloperError( - "attribute must have a strideInBytes less than or equal to 255 or not specify it." + "attribute must have a strideInBytes less than or equal to 255 or not specify it.", ); } if ( @@ -67,12 +67,12 @@ function addAttribute(attributes, attribute, index, context) { } if (defined(attribute.instanceDivisor) && attribute.instanceDivisor < 0) { throw new DeveloperError( - "attribute must have an instanceDivisor greater than or equal to zero" + "attribute must have an instanceDivisor greater than or equal to zero", ); } if (defined(attribute.instanceDivisor) && hasValue) { throw new DeveloperError( - "attribute cannot have have an instanceDivisor if it is not backed by a buffer" + "attribute cannot have have an instanceDivisor if it is not backed by a buffer", ); } if ( @@ -81,7 +81,7 @@ function addAttribute(attributes, attribute, index, context) { attribute.index === 0 ) { throw new DeveloperError( - "attribute zero cannot have an instanceDivisor greater than 0" + "attribute zero cannot have an instanceDivisor greater than 0", ); } //>>includeEnd('debug'); @@ -95,7 +95,7 @@ function addAttribute(attributes, attribute, index, context) { componentsPerAttribute: componentsPerAttribute, componentDatatype: defaultValue( attribute.componentDatatype, - ComponentDatatype.FLOAT + ComponentDatatype.FLOAT, ), normalize: defaultValue(attribute.normalize, false), offsetInBytes: defaultValue(attribute.offsetInBytes, 0), @@ -114,7 +114,7 @@ function addAttribute(attributes, attribute, index, context) { this.componentDatatype, this.normalize, this.strideInBytes, - this.offsetInBytes + this.offsetInBytes, ); gl.enableVertexAttribArray(index); if (this.instanceDivisor > 0) { @@ -341,7 +341,7 @@ function VertexArray(options) { const index = vaAttributes[i].index; if (uniqueIndices[index]) { throw new DeveloperError( - `Index ${index} is used by more than one attribute.` + `Index ${index} is used by more than one attribute.`, ); } uniqueIndices[index] = true; @@ -399,7 +399,7 @@ function interleaveAttributes(attributes) { attributes[name].componentDatatype = ComponentDatatype.FLOAT; attributes[name].values = ComponentDatatype.createTypedArray( ComponentDatatype.FLOAT, - attributes[name].values + attributes[name].values, ); } } @@ -414,7 +414,7 @@ function interleaveAttributes(attributes) { for (j = 1; j < namesLength; ++j) { const currentNumberOfVertices = computeNumberOfVertices( - attributes[names[j]] + attributes[names[j]], ); if (currentNumberOfVertices !== numberOfVertices) { @@ -424,7 +424,7 @@ function interleaveAttributes(attributes) { "Attribute " }${names[j]} has a different number of vertices ` + `(${currentNumberOfVertices.toString()})` + - ` than attribute ${names[0]} (${numberOfVertices.toString()}).` + ` than attribute ${names[0]} (${numberOfVertices.toString()}).`, ); } } @@ -454,7 +454,7 @@ function interleaveAttributes(attributes) { // Pad each vertex to be a multiple of the largest component datatype so each // attribute can be addressed using typed arrays. const maxComponentSizeInBytes = ComponentDatatype.getSizeInBytes( - attributes[names[0]].componentDatatype + attributes[names[0]].componentDatatype, ); // Sorted large to small const remainder = vertexSizeInBytes % maxComponentSizeInBytes; if (remainder !== 0) { @@ -471,13 +471,13 @@ function interleaveAttributes(attributes) { for (j = 0; j < namesLength; ++j) { name = names[j]; const sizeInBytes = ComponentDatatype.getSizeInBytes( - attributes[name].componentDatatype + attributes[name].componentDatatype, ); views[name] = { pointer: ComponentDatatype.createTypedArray( attributes[name].componentDatatype, - buffer + buffer, ), index: offsetsInBytes[name] / sizeInBytes, // Offset in ComponentType strideInComponentType: vertexSizeInBytes / sizeInBytes, @@ -582,12 +582,12 @@ VertexArray.fromGeometry = function (options) { const bufferUsage = defaultValue( options.bufferUsage, - BufferUsage.DYNAMIC_DRAW + BufferUsage.DYNAMIC_DRAW, ); const attributeLocations = defaultValue( options.attributeLocations, - defaultValue.EMPTY_OBJECT + defaultValue.EMPTY_OBJECT, ); const interleave = defaultValue(options.interleave, false); const createdVAAttributes = options.vertexArrayAttributes; @@ -654,7 +654,7 @@ VertexArray.fromGeometry = function (options) { context: context, typedArray: ComponentDatatype.createTypedArray( componentDatatype, - attribute.values + attribute.values, ), usage: bufferUsage, }); diff --git a/packages/engine/Source/Renderer/VertexArrayFacade.js b/packages/engine/Source/Renderer/VertexArrayFacade.js index 752269a0262c..4779a69c140d 100644 --- a/packages/engine/Source/Renderer/VertexArrayFacade.js +++ b/packages/engine/Source/Renderer/VertexArrayFacade.js @@ -64,9 +64,8 @@ function VertexArrayFacade(context, attributes, sizeInVertices, instanced) { attributesForUsage = attributesByUsage[usage]; attributesForUsage.sort(compare); - const vertexSizeInBytes = VertexArrayFacade._vertexSizeInBytes( - attributesForUsage - ); + const vertexSizeInBytes = + VertexArrayFacade._vertexSizeInBytes(attributesForUsage); const bufferUsage = attributesForUsage[0].usage; @@ -78,7 +77,7 @@ function VertexArrayFacade(context, attributes, sizeInVertices, instanced) { arrayBuffer: undefined, arrayViews: VertexArrayFacade._createArrayViews( attributesForUsage, - vertexSizeInBytes + vertexSizeInBytes, ), }; @@ -109,7 +108,7 @@ VertexArrayFacade._verifyAttributes = function (attributes) { componentsPerAttribute: attribute.componentsPerAttribute, componentDatatype: defaultValue( attribute.componentDatatype, - ComponentDatatype.FLOAT + ComponentDatatype.FLOAT, ), normalize: defaultValue(attribute.normalize, false), @@ -127,20 +126,20 @@ VertexArrayFacade._verifyAttributes = function (attributes) { attr.componentsPerAttribute !== 4 ) { throw new DeveloperError( - "attribute.componentsPerAttribute must be in the range [1, 4]." + "attribute.componentsPerAttribute must be in the range [1, 4].", ); } const datatype = attr.componentDatatype; if (!ComponentDatatype.validate(datatype)) { throw new DeveloperError( - "Attribute must have a valid componentDatatype or not specify it." + "Attribute must have a valid componentDatatype or not specify it.", ); } if (!BufferUsage.validate(attr.usage)) { throw new DeveloperError( - "Attribute must have a valid usage or not specify it." + "Attribute must have a valid usage or not specify it.", ); } //>>includeEnd('debug'); @@ -154,7 +153,7 @@ VertexArrayFacade._verifyAttributes = function (attributes) { //>>includeStart('debug', pragmas.debug); if (uniqueIndices[index]) { throw new DeveloperError( - `Index ${index} is used by more than one attribute.` + `Index ${index} is used by more than one attribute.`, ); } //>>includeEnd('debug'); @@ -263,7 +262,7 @@ VertexArrayFacade._resize = function (buffer, size) { view.view = ComponentDatatype.createArrayBufferView( view.componentDatatype, arrayBuffer, - view.offsetInBytes + view.offsetInBytes, ); } @@ -358,7 +357,7 @@ VertexArrayFacade.prototype.commit = function (indexBuffer) { attributes, buffer, offset, - this._instanced + this._instanced, ); } @@ -414,7 +413,7 @@ VertexArrayFacade._appendAttributes = function ( attributes, buffer, vertexBufferOffset, - instanced + instanced, ) { const arrayViews = buffer.arrayViews; const length = arrayViews.length; @@ -437,17 +436,17 @@ VertexArrayFacade._appendAttributes = function ( VertexArrayFacade.prototype.subCommit = function ( offsetInVertices, - lengthInVertices + lengthInVertices, ) { //>>includeStart('debug', pragmas.debug); if (offsetInVertices < 0 || offsetInVertices >= this._size) { throw new DeveloperError( - "offsetInVertices must be greater than or equal to zero and less than the vertex array size." + "offsetInVertices must be greater than or equal to zero and less than the vertex array size.", ); } if (offsetInVertices + lengthInVertices > this._size) { throw new DeveloperError( - "offsetInVertices + lengthInVertices cannot exceed the vertex array size." + "offsetInVertices + lengthInVertices cannot exceed the vertex array size.", ); } //>>includeEnd('debug'); @@ -469,7 +468,7 @@ function subCommit(buffer, offsetInVertices, lengthInVertices) { // PERFORMANCE_IDEA: Does creating the typed view add too much GC overhead? buffer.vertexBuffer.copyFromArrayView( new Uint8Array(buffer.arrayBuffer, byteOffset, byteLength), - byteOffset + byteOffset, ); } } diff --git a/packages/engine/Source/Renderer/createUniform.js b/packages/engine/Source/Renderer/createUniform.js index ccf68c1981f1..912c11d9d2e8 100644 --- a/packages/engine/Source/Renderer/createUniform.js +++ b/packages/engine/Source/Renderer/createUniform.js @@ -46,7 +46,7 @@ function createUniform(gl, activeUniform, uniformName, location) { return new UniformMat4(gl, activeUniform, uniformName, location); default: throw new RuntimeError( - `Unrecognized uniform type: ${activeUniform.type} for uniform "${uniformName}".` + `Unrecognized uniform type: ${activeUniform.type} for uniform "${uniformName}".`, ); } } diff --git a/packages/engine/Source/Renderer/createUniformArray.js b/packages/engine/Source/Renderer/createUniformArray.js index 0c9268a1d7b5..9b38fca15b6b 100644 --- a/packages/engine/Source/Renderer/createUniformArray.js +++ b/packages/engine/Source/Renderer/createUniformArray.js @@ -22,21 +22,21 @@ function createUniformArray(gl, activeUniform, uniformName, locations) { gl, activeUniform, uniformName, - locations + locations, ); case gl.FLOAT_VEC3: return new UniformArrayFloatVec3( gl, activeUniform, uniformName, - locations + locations, ); case gl.FLOAT_VEC4: return new UniformArrayFloatVec4( gl, activeUniform, uniformName, - locations + locations, ); case gl.SAMPLER_2D: case gl.SAMPLER_CUBE: @@ -61,7 +61,7 @@ function createUniformArray(gl, activeUniform, uniformName, locations) { return new UniformArrayMat4(gl, activeUniform, uniformName, locations); default: throw new RuntimeError( - `Unrecognized uniform type: ${activeUniform.type} for uniform "${uniformName}".` + `Unrecognized uniform type: ${activeUniform.type} for uniform "${uniformName}".`, ); } } diff --git a/packages/engine/Source/Renderer/demodernizeShader.js b/packages/engine/Source/Renderer/demodernizeShader.js index e30fcab815f6..df0d795a7b84 100644 --- a/packages/engine/Source/Renderer/demodernizeShader.js +++ b/packages/engine/Source/Renderer/demodernizeShader.js @@ -21,14 +21,14 @@ function demodernizeShader(input, isFragmentShader) { // Replace all texture calls with texture2D output = output.replaceAll( /(texture\()/g, - `texture2D(` // Trailing ')' is included in the match group. + `texture2D(`, // Trailing ')' is included in the match group. ); if (isFragmentShader) { // Replace the in with varying. output = output.replaceAll( /\n\s*(in)\s+(vec\d|mat\d|float)/g, - `\nvarying $2` + `\nvarying $2`, ); if (/out_FragData_(\d+)/.test(output)) { @@ -37,7 +37,7 @@ function demodernizeShader(input, isFragmentShader) { // Remove all layout declarations for out_FragData. output = output.replaceAll( /layout\s+\(location\s*=\s*\d+\)\s*out\s+vec4\s+out_FragData_\d+;/g, - `` + ``, ); // Replace out_FragData with gl_FragData. @@ -47,7 +47,7 @@ function demodernizeShader(input, isFragmentShader) { // Remove all layout declarations for out_FragColor. output = output.replaceAll( /layout\s+\(location\s*=\s*0\)\s*out\s+vec4\s+out_FragColor;/g, - `` + ``, ); // Replace out_FragColor with gl_FragColor. @@ -71,7 +71,7 @@ function demodernizeShader(input, isFragmentShader) { // Replace the out with varying. output = output.replaceAll( /(out)\s+(vec\d|mat\d|float)\s+([\w]+);/g, - `varying $2 $3;` + `varying $2 $3;`, ); } diff --git a/packages/engine/Source/Renderer/loadCubeMap.js b/packages/engine/Source/Renderer/loadCubeMap.js index 693da0a51896..06312734bb27 100644 --- a/packages/engine/Source/Renderer/loadCubeMap.js +++ b/packages/engine/Source/Renderer/loadCubeMap.js @@ -46,7 +46,7 @@ function loadCubeMap(context, urls, skipColorSpaceConversion) { Object.values(CubeMap.FaceName).some((faceName) => !defined(urls[faceName])) ) { throw new DeveloperError( - "urls must have positiveX, negativeX, positiveY, negativeY, positiveZ, and negativeZ properties." + "urls must have positiveX, negativeX, positiveY, negativeY, positiveZ, and negativeZ properties.", ); } //>>includeEnd('debug'); diff --git a/packages/engine/Source/Scene/ArcGisMapServerImageryProvider.js b/packages/engine/Source/Scene/ArcGisMapServerImageryProvider.js index 9cb180278d74..d1b97d8f6365 100644 --- a/packages/engine/Source/Scene/ArcGisMapServerImageryProvider.js +++ b/packages/engine/Source/Scene/ArcGisMapServerImageryProvider.js @@ -75,7 +75,7 @@ function ImageryProviderBuilder(options) { const ellipsoid = options.ellipsoid; this.tilingScheme = defaultValue( options.tilingScheme, - new GeographicTilingScheme({ ellipsoid: ellipsoid }) + new GeographicTilingScheme({ ellipsoid: ellipsoid }), ); this.rectangle = defaultValue(options.rectangle, this.tilingScheme.rectangle); this.ellipsoid = ellipsoid; @@ -169,43 +169,43 @@ function metadataSuccess(data, imageryProviderBuilder) { Math.max( extent.xmin, -imageryProviderBuilder.tilingScheme.ellipsoid.maximumRadius * - Math.PI + Math.PI, ), Math.max( extent.ymin, -imageryProviderBuilder.tilingScheme.ellipsoid.maximumRadius * - Math.PI + Math.PI, ), - 0.0 - ) + 0.0, + ), ); const ne = projection.unproject( new Cartesian3( Math.min( extent.xmax, imageryProviderBuilder.tilingScheme.ellipsoid.maximumRadius * - Math.PI + Math.PI, ), Math.min( extent.ymax, imageryProviderBuilder.tilingScheme.ellipsoid.maximumRadius * - Math.PI + Math.PI, ), - 0.0 - ) + 0.0, + ), ); imageryProviderBuilder.rectangle = new Rectangle( sw.longitude, sw.latitude, ne.longitude, - ne.latitude + ne.latitude, ); } else if (data.fullExtent.spatialReference.wkid === 4326) { imageryProviderBuilder.rectangle = Rectangle.fromDegrees( data.fullExtent.xmin, data.fullExtent.ymin, data.fullExtent.xmax, - data.fullExtent.ymax + data.fullExtent.ymax, ); } else { const extentMessage = `fullExtent.spatialReference WKID ${data.fullExtent.spatialReference.wkid} is not supported.`; @@ -260,9 +260,9 @@ async function requestMetadata(resource, imageryProviderBuilder) { * * Provides tiled imagery hosted by an ArcGIS MapServer. By default, the server's pre-cached tiles are * used, if available. - * + * *
- * + * * An {@link https://developers.arcgis.com/documentation/mapping-apis-and-services/security| ArcGIS Access Token } is required to authenticate requests to an ArcGIS Image Tile service. * To access secure ArcGIS resources, it's required to create an ArcGIS developer * account or an ArcGIS online account, then implement an authentication method to obtain an access token. @@ -278,7 +278,7 @@ async function requestMetadata(resource, imageryProviderBuilder) { * @example * // Set the default access token for accessing ArcGIS Image Tile service * Cesium.ArcGisMapService.defaultAccessToken = ""; - * + * * // Add a base layer from a default ArcGIS basemap * const viewer = new Cesium.Viewer("cesiumContainer", { * baseLayer: Cesium.ImageryLayer.fromProviderAsync( @@ -319,12 +319,12 @@ function ArcGisMapServerImageryProvider(options) { this._maximumLevel = options.maximumLevel; this._tilingScheme = defaultValue( options.tilingScheme, - new GeographicTilingScheme({ ellipsoid: options.ellipsoid }) + new GeographicTilingScheme({ ellipsoid: options.ellipsoid }), ); this._useTiles = defaultValue(options.usePreCachedTilesIfAvailable, true); this._rectangle = defaultValue( options.rectangle, - this._tilingScheme.rectangle + this._tilingScheme.rectangle, ); this._layers = options.layers; this._credit = options.credit; @@ -377,7 +377,7 @@ function ArcGisMapServerImageryProvider(options) { ArcGisMapServerImageryProvider.fromBasemapType = async function ( style, - options + options, ) { //>>includeStart('debug', pragmas.debug); Check.defined("style", style); @@ -392,15 +392,14 @@ ArcGisMapServerImageryProvider.fromBasemapType = async function ( { accessToken = defaultValue( options.token, - ArcGisMapService.defaultAccessToken + ArcGisMapService.defaultAccessToken, ); server = Resource.createIfNeeded( - ArcGisMapService.defaultWorldImageryServer + ArcGisMapService.defaultWorldImageryServer, ); server.appendForwardSlash(); - const defaultTokenCredit = ArcGisMapService.getDefaultTokenCredit( - accessToken - ); + const defaultTokenCredit = + ArcGisMapService.getDefaultTokenCredit(accessToken); if (defined(defaultTokenCredit)) { warningCredit = Credit.clone(defaultTokenCredit); } @@ -410,15 +409,14 @@ ArcGisMapServerImageryProvider.fromBasemapType = async function ( { accessToken = defaultValue( options.token, - ArcGisMapService.defaultAccessToken + ArcGisMapService.defaultAccessToken, ); server = Resource.createIfNeeded( - ArcGisMapService.defaultWorldOceanServer + ArcGisMapService.defaultWorldOceanServer, ); server.appendForwardSlash(); - const defaultTokenCredit = ArcGisMapService.getDefaultTokenCredit( - accessToken - ); + const defaultTokenCredit = + ArcGisMapService.getDefaultTokenCredit(accessToken); if (defined(defaultTokenCredit)) { warningCredit = Credit.clone(defaultTokenCredit); } @@ -428,15 +426,14 @@ ArcGisMapServerImageryProvider.fromBasemapType = async function ( { accessToken = defaultValue( options.token, - ArcGisMapService.defaultAccessToken + ArcGisMapService.defaultAccessToken, ); server = Resource.createIfNeeded( - ArcGisMapService.defaultWorldHillshadeServer + ArcGisMapService.defaultWorldHillshadeServer, ); server.appendForwardSlash(); - const defaultTokenCredit = ArcGisMapService.getDefaultTokenCredit( - accessToken - ); + const defaultTokenCredit = + ArcGisMapService.getDefaultTokenCredit(accessToken); if (defined(defaultTokenCredit)) { warningCredit = Credit.clone(defaultTokenCredit); } @@ -464,11 +461,8 @@ function buildImageResource(imageryProvider, x, y, level, request) { request: request, }); } else { - const nativeRectangle = imageryProvider._tilingScheme.tileXYToNativeRectangle( - x, - y, - level - ); + const nativeRectangle = + imageryProvider._tilingScheme.tileXYToNativeRectangle(x, y, level); const bbox = `${nativeRectangle.west},${nativeRectangle.south},${nativeRectangle.east},${nativeRectangle.north}`; const query = { @@ -752,7 +746,7 @@ ArcGisMapServerImageryProvider.fromUrl = async function (url, options) { ArcGisMapServerImageryProvider.prototype.getTileCredits = function ( x, y, - level + level, ) { return this._tileCredits; }; @@ -771,11 +765,11 @@ ArcGisMapServerImageryProvider.prototype.requestImage = function ( x, y, level, - request + request, ) { return ImageryProvider.loadImage( this, - buildImageResource(this, x, y, level, request) + buildImageResource(this, x, y, level, request), ); }; @@ -798,7 +792,7 @@ ArcGisMapServerImageryProvider.prototype.pickFeatures = function ( y, level, longitude, - latitude + latitude, ) { if (!this.enablePickFeatures) { return undefined; @@ -815,7 +809,7 @@ ArcGisMapServerImageryProvider.prototype.pickFeatures = function ( sr = "4326"; } else { const projected = this._tilingScheme.projection.project( - new Cartographic(longitude, latitude, 0.0) + new Cartographic(longitude, latitude, 0.0), ); horizontal = projected.x; vertical = projected.y; @@ -871,7 +865,7 @@ ArcGisMapServerImageryProvider.prototype.pickFeatures = function ( featureInfo.position = Cartographic.fromDegrees( feature.geometry.x, feature.geometry.y, - feature.geometry.z + feature.geometry.z, ); } else if (wkid === 102100 || wkid === 900913 || wkid === 3857) { const projection = new WebMercatorProjection(); @@ -879,8 +873,8 @@ ArcGisMapServerImageryProvider.prototype.pickFeatures = function ( new Cartesian3( feature.geometry.x, feature.geometry.y, - feature.geometry.z - ) + feature.geometry.z, + ), ); } } diff --git a/packages/engine/Source/Scene/ArcGisMapService.js b/packages/engine/Source/Scene/ArcGisMapService.js index 0210f776e946..520e0ed3c502 100644 --- a/packages/engine/Source/Scene/ArcGisMapService.js +++ b/packages/engine/Source/Scene/ArcGisMapService.js @@ -32,8 +32,7 @@ ArcGisMapService.defaultAccessToken = defaultAccessToken; * @default https://ibasemaps-api.arcgis.com/arcgis/rest/services/World_Imagery/MapServer */ ArcGisMapService.defaultWorldImageryServer = new Resource({ - url: - "https://ibasemaps-api.arcgis.com/arcgis/rest/services/World_Imagery/MapServer", + url: "https://ibasemaps-api.arcgis.com/arcgis/rest/services/World_Imagery/MapServer", }); /** @@ -43,8 +42,7 @@ ArcGisMapService.defaultWorldImageryServer = new Resource({ * @default https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer */ ArcGisMapService.defaultWorldHillshadeServer = new Resource({ - url: - "https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer", + url: "https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer", }); /** @@ -54,8 +52,7 @@ ArcGisMapService.defaultWorldHillshadeServer = new Resource({ * @default https://ibasemaps-api.arcgis.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer */ ArcGisMapService.defaultWorldOceanServer = new Resource({ - url: - "https://ibasemaps-api.arcgis.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer", + url: "https://ibasemaps-api.arcgis.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer", }); /** diff --git a/packages/engine/Source/Scene/AutoExposure.js b/packages/engine/Source/Scene/AutoExposure.js index 7d7e08f3d606..9d2032cff6e1 100644 --- a/packages/engine/Source/Scene/AutoExposure.js +++ b/packages/engine/Source/Scene/AutoExposure.js @@ -149,7 +149,7 @@ function createFramebuffers(autoexposure, context) { lastTexture.width, lastTexture.height, 1, - pixelDatatype + pixelDatatype, ); autoexposure._framebuffers = framebuffers; } @@ -267,7 +267,7 @@ function createCommands(autoexposure, context) { { framebuffer: framebuffers[i].framebuffer, uniformMap: createUniformMap(autoexposure, i), - } + }, ); } autoexposure._commands = commands; @@ -325,9 +325,8 @@ AutoExposure.prototype.update = function (context) { const framebuffers = this._framebuffers; const temp = framebuffers[framebuffers.length - 1]; framebuffers[framebuffers.length - 1] = this._previousLuminance; - this._commands[ - this._commands.length - 1 - ].framebuffer = this._previousLuminance.framebuffer; + this._commands[this._commands.length - 1].framebuffer = + this._previousLuminance.framebuffer; this._previousLuminance = temp; }; diff --git a/packages/engine/Source/Scene/Axis.js b/packages/engine/Source/Scene/Axis.js index 3f5c6ab5f8d0..6ce33ac5aeb9 100644 --- a/packages/engine/Source/Scene/Axis.js +++ b/packages/engine/Source/Scene/Axis.js @@ -41,7 +41,7 @@ const Axis = { */ Axis.Y_UP_TO_Z_UP = Matrix4.fromRotationTranslation( // Rotation about PI/2 around the X-axis - Matrix3.fromArray([1, 0, 0, 0, 0, 1, 0, -1, 0]) + Matrix3.fromArray([1, 0, 0, 0, 0, 1, 0, -1, 0]), ); /** @@ -52,7 +52,7 @@ Axis.Y_UP_TO_Z_UP = Matrix4.fromRotationTranslation( */ Axis.Z_UP_TO_Y_UP = Matrix4.fromRotationTranslation( // Rotation about -PI/2 around the X-axis - Matrix3.fromArray([1, 0, 0, 0, 0, -1, 0, 1, 0]) + Matrix3.fromArray([1, 0, 0, 0, 0, -1, 0, 1, 0]), ); /** @@ -63,7 +63,7 @@ Axis.Z_UP_TO_Y_UP = Matrix4.fromRotationTranslation( */ Axis.X_UP_TO_Z_UP = Matrix4.fromRotationTranslation( // Rotation about -PI/2 around the Y-axis - Matrix3.fromArray([0, 0, 1, 0, 1, 0, -1, 0, 0]) + Matrix3.fromArray([0, 0, 1, 0, 1, 0, -1, 0, 0]), ); /** @@ -74,7 +74,7 @@ Axis.X_UP_TO_Z_UP = Matrix4.fromRotationTranslation( */ Axis.Z_UP_TO_X_UP = Matrix4.fromRotationTranslation( // Rotation about PI/2 around the Y-axis - Matrix3.fromArray([0, 0, -1, 0, 1, 0, 1, 0, 0]) + Matrix3.fromArray([0, 0, -1, 0, 1, 0, 1, 0, 0]), ); /** @@ -85,7 +85,7 @@ Axis.Z_UP_TO_X_UP = Matrix4.fromRotationTranslation( */ Axis.X_UP_TO_Y_UP = Matrix4.fromRotationTranslation( // Rotation about PI/2 around the Z-axis - Matrix3.fromArray([0, 1, 0, -1, 0, 0, 0, 0, 1]) + Matrix3.fromArray([0, 1, 0, -1, 0, 0, 0, 0, 1]), ); /** @@ -96,7 +96,7 @@ Axis.X_UP_TO_Y_UP = Matrix4.fromRotationTranslation( */ Axis.Y_UP_TO_X_UP = Matrix4.fromRotationTranslation( // Rotation about -PI/2 around the Z-axis - Matrix3.fromArray([0, -1, 0, 1, 0, 0, 0, 0, 1]) + Matrix3.fromArray([0, -1, 0, 1, 0, 0, 0, 0, 1]), ); /** diff --git a/packages/engine/Source/Scene/B3dmParser.js b/packages/engine/Source/Scene/B3dmParser.js index 6d06e6161538..c5021877894e 100644 --- a/packages/engine/Source/Scene/B3dmParser.js +++ b/packages/engine/Source/Scene/B3dmParser.js @@ -39,7 +39,7 @@ B3dmParser.parse = function (arrayBuffer, byteOffset) { const version = view.getUint32(byteOffset, true); if (version !== 1) { throw new RuntimeError( - `Only Batched 3D Model version 1 is supported. Version ${version} is not.` + `Only Batched 3D Model version 1 is supported. Version ${version} is not.`, ); } byteOffset += sizeOfUint32; @@ -77,7 +77,7 @@ B3dmParser.parse = function (arrayBuffer, byteOffset) { featureTableBinaryByteLength = 0; B3dmParser._deprecationWarning( "b3dm-legacy-header", - "This b3dm header is using the legacy format [batchLength] [batchTableByteLength]. The new format is [featureTableJsonByteLength] [featureTableBinaryByteLength] [batchTableJsonByteLength] [batchTableBinaryByteLength] from https://github.com/CesiumGS/3d-tiles/tree/main/specification/TileFormats/Batched3DModel." + "This b3dm header is using the legacy format [batchLength] [batchTableByteLength]. The new format is [featureTableJsonByteLength] [featureTableBinaryByteLength] [batchTableJsonByteLength] [batchTableBinaryByteLength] from https://github.com/CesiumGS/3d-tiles/tree/main/specification/TileFormats/Batched3DModel.", ); } else if (batchTableBinaryByteLength >= 570425344) { // Second legacy check @@ -89,7 +89,7 @@ B3dmParser.parse = function (arrayBuffer, byteOffset) { featureTableBinaryByteLength = 0; B3dmParser._deprecationWarning( "b3dm-legacy-header", - "This b3dm header is using the legacy format [batchTableJsonByteLength] [batchTableBinaryByteLength] [batchLength]. The new format is [featureTableJsonByteLength] [featureTableBinaryByteLength] [batchTableJsonByteLength] [batchTableBinaryByteLength] from https://github.com/CesiumGS/3d-tiles/tree/main/specification/TileFormats/Batched3DModel." + "This b3dm header is using the legacy format [batchTableJsonByteLength] [batchTableBinaryByteLength] [batchLength]. The new format is [featureTableJsonByteLength] [featureTableBinaryByteLength] [batchTableJsonByteLength] [batchTableBinaryByteLength] from https://github.com/CesiumGS/3d-tiles/tree/main/specification/TileFormats/Batched3DModel.", ); } @@ -102,7 +102,7 @@ B3dmParser.parse = function (arrayBuffer, byteOffset) { featureTableJson = getJsonFromTypedArray( uint8Array, byteOffset, - featureTableJsonByteLength + featureTableJsonByteLength, ); byteOffset += featureTableJsonByteLength; } @@ -110,7 +110,7 @@ B3dmParser.parse = function (arrayBuffer, byteOffset) { const featureTableBinary = new Uint8Array( arrayBuffer, byteOffset, - featureTableBinaryByteLength + featureTableBinaryByteLength, ); byteOffset += featureTableBinaryByteLength; @@ -125,7 +125,7 @@ B3dmParser.parse = function (arrayBuffer, byteOffset) { batchTableJson = getJsonFromTypedArray( uint8Array, byteOffset, - batchTableJsonByteLength + batchTableJsonByteLength, ); byteOffset += batchTableJsonByteLength; @@ -134,7 +134,7 @@ B3dmParser.parse = function (arrayBuffer, byteOffset) { batchTableBinary = new Uint8Array( arrayBuffer, byteOffset, - batchTableBinaryByteLength + batchTableBinaryByteLength, ); // Copy the batchTableBinary section and let the underlying ArrayBuffer be freed batchTableBinary = new Uint8Array(batchTableBinary); @@ -154,10 +154,10 @@ B3dmParser.parse = function (arrayBuffer, byteOffset) { // Create a copy of the glb so that it is 4-byte aligned B3dmParser._deprecationWarning( "b3dm-glb-unaligned", - "The embedded glb is not aligned to a 4-byte boundary." + "The embedded glb is not aligned to a 4-byte boundary.", ); gltfView = new Uint8Array( - uint8Array.subarray(byteOffset, byteOffset + gltfByteLength) + uint8Array.subarray(byteOffset, byteOffset + gltfByteLength), ); } diff --git a/packages/engine/Source/Scene/BatchTable.js b/packages/engine/Source/Scene/BatchTable.js index a24e541c86e8..d8d0580b6a2b 100644 --- a/packages/engine/Source/Scene/BatchTable.js +++ b/packages/engine/Source/Scene/BatchTable.js @@ -94,12 +94,12 @@ function BatchTable(context, attributes, numberOfInstances) { const stride = getStride(offsets, attributes, packFloats); const maxNumberOfInstancesPerRow = Math.floor( - ContextLimits.maximumTextureSize / stride + ContextLimits.maximumTextureSize / stride, ); const instancesPerWidth = Math.min( numberOfInstances, - maxNumberOfInstancesPerRow + maxNumberOfInstancesPerRow, ); const width = stride * instancesPerWidth; const height = Math.ceil(numberOfInstances / instancesPerWidth); @@ -258,7 +258,7 @@ const scratchGetAttributeCartesian4 = new Cartesian4(); BatchTable.prototype.getBatchedAttribute = function ( instanceIndex, attributeIndex, - result + result, ) { //>>includeStart('debug', pragmas.debug); if (instanceIndex < 0 || instanceIndex >= this._numberOfInstances) { @@ -283,13 +283,13 @@ BatchTable.prototype.getBatchedAttribute = function ( value = getPackedFloat( this._batchValues, index, - scratchGetAttributeCartesian4 + scratchGetAttributeCartesian4, ); } else { value = Cartesian4.unpack( this._batchValues, index, - scratchGetAttributeCartesian4 + scratchGetAttributeCartesian4, ); } @@ -325,7 +325,7 @@ const setAttributeScratchCartesian4 = new Cartesian4(); BatchTable.prototype.setBatchedAttribute = function ( instanceIndex, attributeIndex, - value + value, ) { //>>includeStart('debug', pragmas.debug); if (instanceIndex < 0 || instanceIndex >= this._numberOfInstances) { @@ -347,7 +347,7 @@ BatchTable.prototype.setBatchedAttribute = function ( const currentAttribute = this.getBatchedAttribute( instanceIndex, attributeIndex, - result + result, ); const attributeType = getAttributeType(this._attributes, attributeIndex); const entriesEqual = defined(attributeType.equals) diff --git a/packages/engine/Source/Scene/BatchTableHierarchy.js b/packages/engine/Source/Scene/BatchTableHierarchy.js index 4c1b2c4f1d90..49927f76aa5d 100644 --- a/packages/engine/Source/Scene/BatchTableHierarchy.js +++ b/packages/engine/Source/Scene/BatchTableHierarchy.js @@ -76,14 +76,14 @@ function initialize(hierarchy, hierarchyJson, binaryBody) { if (defined(classIds.byteOffset)) { classIds.componentType = defaultValue( classIds.componentType, - ComponentDatatype.UNSIGNED_SHORT + ComponentDatatype.UNSIGNED_SHORT, ); classIds.type = AttributeType.SCALAR; binaryAccessor = getBinaryAccessor(classIds); classIds = binaryAccessor.createArrayBufferView( binaryBody.buffer, binaryBody.byteOffset + classIds.byteOffset, - instancesLength + instancesLength, ); byteLength += classIds.byteLength; } @@ -93,14 +93,14 @@ function initialize(hierarchy, hierarchyJson, binaryBody) { if (defined(parentCounts.byteOffset)) { parentCounts.componentType = defaultValue( parentCounts.componentType, - ComponentDatatype.UNSIGNED_SHORT + ComponentDatatype.UNSIGNED_SHORT, ); parentCounts.type = AttributeType.SCALAR; binaryAccessor = getBinaryAccessor(parentCounts); parentCounts = binaryAccessor.createArrayBufferView( binaryBody.buffer, binaryBody.byteOffset + parentCounts.byteOffset, - instancesLength + instancesLength, ); byteLength += parentCounts.byteLength; } @@ -117,14 +117,14 @@ function initialize(hierarchy, hierarchyJson, binaryBody) { if (defined(parentIds) && defined(parentIds.byteOffset)) { parentIds.componentType = defaultValue( parentIds.componentType, - ComponentDatatype.UNSIGNED_SHORT + ComponentDatatype.UNSIGNED_SHORT, ); parentIds.type = AttributeType.SCALAR; binaryAccessor = getBinaryAccessor(parentIds); parentIds = binaryAccessor.createArrayBufferView( binaryBody.buffer, binaryBody.byteOffset + parentIds.byteOffset, - parentIdsLength + parentIdsLength, ); byteLength += parentIds.byteLength; @@ -137,7 +137,7 @@ function initialize(hierarchy, hierarchyJson, binaryBody) { const binaryProperties = getBinaryProperties( classInstancesLength, properties, - binaryBody + binaryBody, ); byteLength += countBinaryPropertyMemory(binaryProperties); classes[i].instances = combine(binaryProperties, properties); @@ -179,7 +179,7 @@ function getBinaryProperties(featuresLength, properties, binaryBody) { } if (!defined(binaryBody)) { throw new RuntimeError( - `Property ${name} requires a batch table binary.` + `Property ${name} requires a batch table binary.`, ); } @@ -189,7 +189,7 @@ function getBinaryProperties(featuresLength, properties, binaryBody) { const typedArray = binaryAccessor.createArrayBufferView( binaryBody.buffer, binaryBody.byteOffset + byteOffset, - featuresLength + featuresLength, ); if (!defined(binaryProperties)) { @@ -247,12 +247,12 @@ function validateInstance(hierarchy, instanceIndex, stack) { if (instanceIndex >= instancesLength) { throw new DeveloperError( - `Parent index ${instanceIndex} exceeds the total number of instances: ${instancesLength}` + `Parent index ${instanceIndex} exceeds the total number of instances: ${instancesLength}`, ); } if (stack.indexOf(instanceIndex) > -1) { throw new DeveloperError( - "Circular dependency detected in the batch table hierarchy." + "Circular dependency detected in the batch table hierarchy.", ); } @@ -279,7 +279,7 @@ let marker = 0; function traverseHierarchyMultipleParents( hierarchy, instanceIndex, - endConditionCallback + endConditionCallback, ) { const classIds = hierarchy._classIds; const parentCounts = hierarchy._parentCounts; @@ -326,7 +326,7 @@ function traverseHierarchyMultipleParents( function traverseHierarchySingleParent( hierarchy, instanceIndex, - endConditionCallback + endConditionCallback, ) { let hasParent = true; while (hasParent) { @@ -352,13 +352,13 @@ function traverseHierarchy(hierarchy, instanceIndex, endConditionCallback) { return traverseHierarchyMultipleParents( hierarchy, instanceIndex, - endConditionCallback + endConditionCallback, ); } return traverseHierarchySingleParent( hierarchy, instanceIndex, - endConditionCallback + endConditionCallback, ); } @@ -371,16 +371,17 @@ function traverseHierarchy(hierarchy, instanceIndex, endConditionCallback) { * @private */ BatchTableHierarchy.prototype.hasProperty = function (batchId, propertyId) { - const result = traverseHierarchy(this, batchId, function ( - hierarchy, - instanceIndex - ) { - const classId = hierarchy._classIds[instanceIndex]; - const instances = hierarchy._classes[classId].instances; - if (defined(instances[propertyId])) { - return true; - } - }); + const result = traverseHierarchy( + this, + batchId, + function (hierarchy, instanceIndex) { + const classId = hierarchy._classIds[instanceIndex]; + const instances = hierarchy._classes[classId].instances; + if (defined(instances[propertyId])) { + return true; + } + }, + ); return defined(result); }; @@ -478,32 +479,33 @@ function getBinaryProperty(binaryProperty, index) { BatchTableHierarchy.prototype.setProperty = function ( batchId, propertyId, - value + value, ) { - const result = traverseHierarchy(this, batchId, function ( - hierarchy, - instanceIndex - ) { - const classId = hierarchy._classIds[instanceIndex]; - const instanceClass = hierarchy._classes[classId]; - const indexInClass = hierarchy._classIndexes[instanceIndex]; - const propertyValues = instanceClass.instances[propertyId]; - if (defined(propertyValues)) { - //>>includeStart('debug', pragmas.debug); - if (instanceIndex !== batchId) { - throw new DeveloperError( - `Inherited property "${propertyId}" is read-only.` - ); - } - //>>includeEnd('debug'); - if (defined(propertyValues.typedArray)) { - setBinaryProperty(propertyValues, indexInClass, value); - } else { - propertyValues[indexInClass] = clone(value, true); + const result = traverseHierarchy( + this, + batchId, + function (hierarchy, instanceIndex) { + const classId = hierarchy._classIds[instanceIndex]; + const instanceClass = hierarchy._classes[classId]; + const indexInClass = hierarchy._classIndexes[instanceIndex]; + const propertyValues = instanceClass.instances[propertyId]; + if (defined(propertyValues)) { + //>>includeStart('debug', pragmas.debug); + if (instanceIndex !== batchId) { + throw new DeveloperError( + `Inherited property "${propertyId}" is read-only.`, + ); + } + //>>includeEnd('debug'); + if (defined(propertyValues.typedArray)) { + setBinaryProperty(propertyValues, indexInClass, value); + } else { + propertyValues[indexInClass] = clone(value, true); + } + return true; } - return true; - } - }); + }, + ); return defined(result); }; @@ -528,16 +530,17 @@ function setBinaryProperty(binaryProperty, index, value) { BatchTableHierarchy.prototype.isClass = function (batchId, className) { // PERFORMANCE_IDEA : cache results in the ancestor classes to speed up this check if this area becomes a hotspot // PERFORMANCE_IDEA : treat class names as integers for faster comparisons - const result = traverseHierarchy(this, batchId, function ( - hierarchy, - instanceIndex - ) { - const classId = hierarchy._classIds[instanceIndex]; - const instanceClass = hierarchy._classes[classId]; - if (instanceClass.name === className) { - return true; - } - }); + const result = traverseHierarchy( + this, + batchId, + function (hierarchy, instanceIndex) { + const classId = hierarchy._classIds[instanceIndex]; + const instanceClass = hierarchy._classes[classId]; + if (instanceClass.name === className) { + return true; + } + }, + ); return defined(result); }; diff --git a/packages/engine/Source/Scene/BatchTexture.js b/packages/engine/Source/Scene/BatchTexture.js index 7b43f8cee30d..8cc3484b95b8 100644 --- a/packages/engine/Source/Scene/BatchTexture.js +++ b/packages/engine/Source/Scene/BatchTexture.js @@ -220,7 +220,7 @@ function checkBatchId(batchId, featuresLength) { if (!defined(batchId) || batchId < 0 || batchId >= featuresLength) { throw new DeveloperError( `batchId is required and between zero and featuresLength - 1 (${featuresLength}` - - +")." + +").", ); } } @@ -413,7 +413,7 @@ BatchTexture.prototype.getColor = function (batchId, result) { batchValues[offset + 1], batchValues[offset + 2], showAlphaProperties[propertyOffset + 1], - result + result, ); }; diff --git a/packages/engine/Source/Scene/Billboard.js b/packages/engine/Source/Scene/Billboard.js index 13b1148cc920..d06129800960 100644 --- a/packages/engine/Source/Scene/Billboard.js +++ b/packages/engine/Source/Scene/Billboard.js @@ -101,7 +101,7 @@ function Billboard(options, billboardCollection) { options.disableDepthTestDistance < 0.0 ) { throw new DeveloperError( - "disableDepthTestDistance must be greater than or equal to 0.0." + "disableDepthTestDistance must be greater than or equal to 0.0.", ); } //>>includeEnd('debug'); @@ -114,7 +114,7 @@ function Billboard(options, billboardCollection) { //>>includeStart('debug', pragmas.debug); if (translucencyByDistance.far <= translucencyByDistance.near) { throw new DeveloperError( - "translucencyByDistance.far must be greater than translucencyByDistance.near." + "translucencyByDistance.far must be greater than translucencyByDistance.near.", ); } //>>includeEnd('debug'); @@ -124,19 +124,19 @@ function Billboard(options, billboardCollection) { //>>includeStart('debug', pragmas.debug); if (pixelOffsetScaleByDistance.far <= pixelOffsetScaleByDistance.near) { throw new DeveloperError( - "pixelOffsetScaleByDistance.far must be greater than pixelOffsetScaleByDistance.near." + "pixelOffsetScaleByDistance.far must be greater than pixelOffsetScaleByDistance.near.", ); } //>>includeEnd('debug'); pixelOffsetScaleByDistance = NearFarScalar.clone( - pixelOffsetScaleByDistance + pixelOffsetScaleByDistance, ); } if (defined(scaleByDistance)) { //>>includeStart('debug', pragmas.debug); if (scaleByDistance.far <= scaleByDistance.near) { throw new DeveloperError( - "scaleByDistance.far must be greater than scaleByDistance.near." + "scaleByDistance.far must be greater than scaleByDistance.near.", ); } //>>includeEnd('debug'); @@ -146,44 +146,44 @@ function Billboard(options, billboardCollection) { //>>includeStart('debug', pragmas.debug); if (distanceDisplayCondition.far <= distanceDisplayCondition.near) { throw new DeveloperError( - "distanceDisplayCondition.far must be greater than distanceDisplayCondition.near." + "distanceDisplayCondition.far must be greater than distanceDisplayCondition.near.", ); } //>>includeEnd('debug'); distanceDisplayCondition = DistanceDisplayCondition.clone( - distanceDisplayCondition + distanceDisplayCondition, ); } this._show = defaultValue(options.show, true); this._position = Cartesian3.clone( - defaultValue(options.position, Cartesian3.ZERO) + defaultValue(options.position, Cartesian3.ZERO), ); this._actualPosition = Cartesian3.clone(this._position); // For columbus view and 2D this._pixelOffset = Cartesian2.clone( - defaultValue(options.pixelOffset, Cartesian2.ZERO) + defaultValue(options.pixelOffset, Cartesian2.ZERO), ); this._translate = new Cartesian2(0.0, 0.0); // used by labels for glyph vertex translation this._eyeOffset = Cartesian3.clone( - defaultValue(options.eyeOffset, Cartesian3.ZERO) + defaultValue(options.eyeOffset, Cartesian3.ZERO), ); this._heightReference = defaultValue( options.heightReference, - HeightReference.NONE + HeightReference.NONE, ); this._verticalOrigin = defaultValue( options.verticalOrigin, - VerticalOrigin.CENTER + VerticalOrigin.CENTER, ); this._horizontalOrigin = defaultValue( options.horizontalOrigin, - HorizontalOrigin.CENTER + HorizontalOrigin.CENTER, ); this._scale = defaultValue(options.scale, 1.0); this._color = Color.clone(defaultValue(options.color, Color.WHITE)); this._rotation = defaultValue(options.rotation, 0.0); this._alignedAxis = Cartesian3.clone( - defaultValue(options.alignedAxis, Cartesian3.ZERO) + defaultValue(options.alignedAxis, Cartesian3.ZERO), ); this._width = options.width; this._height = options.height; @@ -247,7 +247,7 @@ function Billboard(options, billboardCollection) { this._clusterShow = true; this._outlineColor = Color.clone( - defaultValue(options.outlineColor, Color.BLACK) + defaultValue(options.outlineColor, Color.BLACK), ); this._outlineWidth = defaultValue(options.outlineWidth, 0.0); @@ -255,7 +255,7 @@ function Billboard(options, billboardCollection) { this._splitDirection = defaultValue( options.splitDirection, - SplitDirection.NONE + SplitDirection.NONE, ); } @@ -271,8 +271,10 @@ const COLOR_INDEX = (Billboard.COLOR_INDEX = 8); const ROTATION_INDEX = (Billboard.ROTATION_INDEX = 9); const ALIGNED_AXIS_INDEX = (Billboard.ALIGNED_AXIS_INDEX = 10); const SCALE_BY_DISTANCE_INDEX = (Billboard.SCALE_BY_DISTANCE_INDEX = 11); -const TRANSLUCENCY_BY_DISTANCE_INDEX = (Billboard.TRANSLUCENCY_BY_DISTANCE_INDEX = 12); -const PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX = (Billboard.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX = 13); +const TRANSLUCENCY_BY_DISTANCE_INDEX = + (Billboard.TRANSLUCENCY_BY_DISTANCE_INDEX = 12); +const PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX = + (Billboard.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX = 13); const DISTANCE_DISPLAY_CONDITION = (Billboard.DISTANCE_DISPLAY_CONDITION = 14); const DISABLE_DEPTH_DISTANCE = (Billboard.DISABLE_DEPTH_DISTANCE = 15); Billboard.TEXTURE_COORDINATE_BOUNDS = 16; @@ -425,7 +427,7 @@ Object.defineProperties(Billboard.prototype, { Check.typeOf.object("value", value); if (value.far <= value.near) { throw new DeveloperError( - "far distance must be greater than near distance." + "far distance must be greater than near distance.", ); } } @@ -471,7 +473,7 @@ Object.defineProperties(Billboard.prototype, { Check.typeOf.object("value", value); if (value.far <= value.near) { throw new DeveloperError( - "far distance must be greater than near distance." + "far distance must be greater than near distance.", ); } } @@ -481,7 +483,7 @@ Object.defineProperties(Billboard.prototype, { if (!NearFarScalar.equals(translucencyByDistance, value)) { this._translucencyByDistance = NearFarScalar.clone( value, - translucencyByDistance + translucencyByDistance, ); makeDirty(this, TRANSLUCENCY_BY_DISTANCE_INDEX); } @@ -521,7 +523,7 @@ Object.defineProperties(Billboard.prototype, { Check.typeOf.object("value", value); if (value.far <= value.near) { throw new DeveloperError( - "far distance must be greater than near distance." + "far distance must be greater than near distance.", ); } } @@ -531,7 +533,7 @@ Object.defineProperties(Billboard.prototype, { if (!NearFarScalar.equals(pixelOffsetScaleByDistance, value)) { this._pixelOffsetScaleByDistance = NearFarScalar.clone( value, - pixelOffsetScaleByDistance + pixelOffsetScaleByDistance, ); makeDirty(this, PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX); } @@ -855,14 +857,14 @@ Object.defineProperties(Billboard.prototype, { Check.typeOf.object("value", value); if (value.far <= value.near) { throw new DeveloperError( - "far distance must be greater than near distance." + "far distance must be greater than near distance.", ); } } //>>includeEnd('debug'); this._distanceDisplayCondition = DistanceDisplayCondition.clone( value, - this._distanceDisplayCondition + this._distanceDisplayCondition, ); makeDirty(this, DISTANCE_DISPLAY_CONDITION); } @@ -885,7 +887,7 @@ Object.defineProperties(Billboard.prototype, { Check.typeOf.number("value", value); if (value < 0.0) { throw new DeveloperError( - "disableDepthTestDistance must be greater than or equal to 0.0." + "disableDepthTestDistance must be greater than or equal to 0.0.", ); } } @@ -1014,7 +1016,7 @@ Object.defineProperties(Billboard.prototype, { set: function (value) { this._actualClampedPosition = Cartesian3.clone( value, - this._actualClampedPosition + this._actualClampedPosition, ); makeDirty(this, POSITION_INDEX); }, @@ -1123,7 +1125,7 @@ Billboard._updateClamping = function (collection, owner) { //>>includeStart('debug', pragmas.debug); if (owner._heightReference !== HeightReference.NONE) { throw new DeveloperError( - "Height reference is not supported without a scene." + "Height reference is not supported without a scene.", ); } //>>includeEnd('debug'); @@ -1166,7 +1168,7 @@ Billboard._updateClamping = function (collection, owner) { function updateFunction(clampedPosition) { const updatedClampedPosition = ellipsoid.cartographicToCartesian( clampedPosition, - owner._clampedPosition + owner._clampedPosition, ); if (isHeightReferenceRelative(owner._heightReference)) { @@ -1174,7 +1176,7 @@ Billboard._updateClamping = function (collection, owner) { clampedPosition.height += position.height; ellipsoid.cartographicToCartesian( clampedPosition, - updatedClampedPosition + updatedClampedPosition, ); } else { updatedClampedPosition.x += position.height; @@ -1187,7 +1189,7 @@ Billboard._updateClamping = function (collection, owner) { owner._removeCallbackFunc = scene.updateHeight( position, updateFunction, - owner._heightReference + owner._heightReference, ); Cartographic.clone(position, scratchCartographic); @@ -1388,7 +1390,7 @@ Billboard._computeActualPosition = function ( billboard, position, frameState, - modelMatrix + modelMatrix, ) { if (defined(billboard._clampedPosition)) { if (frameState.mode !== billboard._mode) { @@ -1402,7 +1404,7 @@ Billboard._computeActualPosition = function ( Matrix4.multiplyByPoint(modelMatrix, position, tempCartesian3); return SceneTransforms.computeActualEllipsoidPosition( frameState, - tempCartesian3 + tempCartesian3, ); }; @@ -1415,13 +1417,13 @@ Billboard._computeScreenSpacePosition = function ( eyeOffset, pixelOffset, scene, - result + result, ) { // Model to world coordinates const positionWorld = Matrix4.multiplyByPoint( modelMatrix, position, - scratchCartesian3 + scratchCartesian3, ); // World to window coordinates @@ -1429,7 +1431,7 @@ Billboard._computeScreenSpacePosition = function ( scene, positionWorld, eyeOffset, - result + result, ); if (!defined(positionWC)) { return undefined; @@ -1469,7 +1471,7 @@ Billboard.prototype.computeScreenSpacePosition = function (scene, result) { //>>includeStart('debug', pragmas.debug); if (!defined(billboardCollection)) { throw new DeveloperError( - "Billboard must be in a collection. Was it removed?" + "Billboard must be in a collection. Was it removed?", ); } if (!defined(scene)) { @@ -1501,7 +1503,7 @@ Billboard.prototype.computeScreenSpacePosition = function (scene, result) { this._eyeOffset, scratchPixelOffset, scene, - result + result, ); return windowCoordinates; }; @@ -1518,7 +1520,7 @@ Billboard.prototype.computeScreenSpacePosition = function (scene, result) { Billboard.getScreenSpaceBoundingBox = function ( billboard, screenSpacePosition, - result + result, ) { let width = billboard.width; let height = billboard.height; @@ -1583,15 +1585,15 @@ Billboard.prototype.equals = function (other) { NearFarScalar.equals(this._scaleByDistance, other._scaleByDistance) && NearFarScalar.equals( this._translucencyByDistance, - other._translucencyByDistance + other._translucencyByDistance, ) && NearFarScalar.equals( this._pixelOffsetScaleByDistance, - other._pixelOffsetScaleByDistance + other._pixelOffsetScaleByDistance, ) && DistanceDisplayCondition.equals( this._distanceDisplayCondition, - other._distanceDisplayCondition + other._distanceDisplayCondition, ) && this._disableDepthTestDistance === other._disableDepthTestDistance && this._splitDirection === other._splitDirection) @@ -1601,7 +1603,7 @@ Billboard.prototype.equals = function (other) { Billboard.prototype._destroy = function () { if (defined(this._customData)) { this._billboardCollection._scene.globe._surface.removeTileCustomData( - this._customData + this._customData, ); this._customData = undefined; } diff --git a/packages/engine/Source/Scene/BillboardCollection.js b/packages/engine/Source/Scene/BillboardCollection.js index b4d2ffdf7ab9..54da7f40943d 100644 --- a/packages/engine/Source/Scene/BillboardCollection.js +++ b/packages/engine/Source/Scene/BillboardCollection.js @@ -246,7 +246,7 @@ function BillboardCollection(options) { * @see Transforms.eastNorthUpToFixedFrame */ this.modelMatrix = Matrix4.clone( - defaultValue(options.modelMatrix, Matrix4.IDENTITY) + defaultValue(options.modelMatrix, Matrix4.IDENTITY), ); this._modelMatrix = Matrix4.clone(Matrix4.IDENTITY); @@ -262,7 +262,7 @@ function BillboardCollection(options) { */ this.debugShowBoundingVolume = defaultValue( options.debugShowBoundingVolume, - false + false, ); /** @@ -277,7 +277,7 @@ function BillboardCollection(options) { */ this.debugShowTextureAtlas = defaultValue( options.debugShowTextureAtlas, - false + false, ); /** @@ -290,7 +290,7 @@ function BillboardCollection(options) { */ this.blendOption = defaultValue( options.blendOption, - BlendOption.OPAQUE_AND_TRANSLUCENT + BlendOption.OPAQUE_AND_TRANSLUCENT, ); this._blendOption = undefined; @@ -341,7 +341,7 @@ function BillboardCollection(options) { } } }, - this + this, ); } } @@ -568,7 +568,7 @@ function removeBillboards(billboardCollection) { BillboardCollection.prototype._updateBillboard = function ( billboard, - propertyChanged + propertyChanged, ) { if (!billboard._dirty) { this._billboardsToUpdate[this._billboardsToUpdateIndex++] = billboard; @@ -718,7 +718,7 @@ function createVAF( buffersUsage, instanced, batchTable, - sdf + sdf, ) { const attributes = [ { @@ -838,7 +838,7 @@ function writePositionScaleAndRotation( frameState, textureAtlasCoordinates, vafWriters, - billboard + billboard, ) { let i; const positionHighWriter = @@ -851,7 +851,7 @@ function writePositionScaleAndRotation( BoundingSphere.expand( billboardCollection._baseVolume, position, - billboardCollection._baseVolume + billboardCollection._baseVolume, ); billboardCollection._boundingVolumeDirty = true; } @@ -866,7 +866,7 @@ function writePositionScaleAndRotation( billboardCollection._maxScale = Math.max( billboardCollection._maxScale, - scale + scale, ); const high = writePositionScratch.high; @@ -914,7 +914,7 @@ function writeCompressedAttrib0( frameState, textureAtlasCoordinates, vafWriters, - billboard + billboard, ) { let i; const writer = vafWriters[attributeLocations.compressedAttribute0]; @@ -929,7 +929,7 @@ function writeCompressedAttrib0( billboardCollection._maxPixelOffset = Math.max( billboardCollection._maxPixelOffset, Math.abs(pixelOffsetX + translateX), - Math.abs(-pixelOffsetY + translateY) + Math.abs(-pixelOffsetY + translateY), ); const horizontalOrigin = billboard.horizontalOrigin; @@ -978,7 +978,7 @@ function writeCompressedAttrib0( let compressed0 = Math.floor( - CesiumMath.clamp(pixelOffsetX, -UPPER_BOUND, UPPER_BOUND) + UPPER_BOUND + CesiumMath.clamp(pixelOffsetX, -UPPER_BOUND, UPPER_BOUND) + UPPER_BOUND, ) * LEFT_SHIFT7; compressed0 += (horizontalOrigin + 1.0) * LEFT_SHIFT5; compressed0 += (verticalOrigin + 1.0) * LEFT_SHIFT3; @@ -986,11 +986,11 @@ function writeCompressedAttrib0( let compressed1 = Math.floor( - CesiumMath.clamp(pixelOffsetY, -UPPER_BOUND, UPPER_BOUND) + UPPER_BOUND + CesiumMath.clamp(pixelOffsetY, -UPPER_BOUND, UPPER_BOUND) + UPPER_BOUND, ) * LEFT_SHIFT8; let compressed2 = Math.floor( - CesiumMath.clamp(translateX, -UPPER_BOUND, UPPER_BOUND) + UPPER_BOUND + CesiumMath.clamp(translateX, -UPPER_BOUND, UPPER_BOUND) + UPPER_BOUND, ) * LEFT_SHIFT8; const tempTanslateY = @@ -998,7 +998,7 @@ function writeCompressedAttrib0( RIGHT_SHIFT8; const upperTranslateY = Math.floor(tempTanslateY); const lowerTranslateY = Math.floor( - (tempTanslateY - upperTranslateY) * LEFT_SHIFT8 + (tempTanslateY - upperTranslateY) * LEFT_SHIFT8, ); compressed1 += upperTranslateY; @@ -1006,21 +1006,17 @@ function writeCompressedAttrib0( scratchCartesian2.x = bottomLeftX; scratchCartesian2.y = bottomLeftY; - const compressedTexCoordsLL = AttributeCompression.compressTextureCoordinates( - scratchCartesian2 - ); + const compressedTexCoordsLL = + AttributeCompression.compressTextureCoordinates(scratchCartesian2); scratchCartesian2.x = topRightX; - const compressedTexCoordsLR = AttributeCompression.compressTextureCoordinates( - scratchCartesian2 - ); + const compressedTexCoordsLR = + AttributeCompression.compressTextureCoordinates(scratchCartesian2); scratchCartesian2.y = topRightY; - const compressedTexCoordsUR = AttributeCompression.compressTextureCoordinates( - scratchCartesian2 - ); + const compressedTexCoordsUR = + AttributeCompression.compressTextureCoordinates(scratchCartesian2); scratchCartesian2.x = bottomLeftX; - const compressedTexCoordsUL = AttributeCompression.compressTextureCoordinates( - scratchCartesian2 - ); + const compressedTexCoordsUL = + AttributeCompression.compressTextureCoordinates(scratchCartesian2); if (billboardCollection._instanced) { i = billboard._index; @@ -1032,28 +1028,28 @@ function writeCompressedAttrib0( compressed0 + LOWER_LEFT, compressed1, compressed2, - compressedTexCoordsLL + compressedTexCoordsLL, ); writer( i + 1, compressed0 + LOWER_RIGHT, compressed1, compressed2, - compressedTexCoordsLR + compressedTexCoordsLR, ); writer( i + 2, compressed0 + UPPER_RIGHT, compressed1, compressed2, - compressedTexCoordsUR + compressedTexCoordsUR, ); writer( i + 3, compressed0 + UPPER_LEFT, compressed1, compressed2, - compressedTexCoordsUL + compressedTexCoordsUL, ); } } @@ -1063,7 +1059,7 @@ function writeCompressedAttrib1( frameState, textureAtlasCoordinates, vafWriters, - billboard + billboard, ) { let i; const writer = vafWriters[attributeLocations.compressedAttribute1]; @@ -1107,11 +1103,11 @@ function writeCompressedAttrib1( const textureWidth = billboardCollection._textureAtlas.texture.width; const imageWidth = Math.round( - defaultValue(billboard.width, textureWidth * width) + defaultValue(billboard.width, textureWidth * width), ); billboardCollection._maxSize = Math.max( billboardCollection._maxSize, - imageWidth + imageWidth, ); let compressed0 = CesiumMath.clamp(imageWidth, 0.0, LEFT_SHIFT16); @@ -1149,7 +1145,7 @@ function writeCompressedAttrib2( frameState, textureAtlasCoordinates, vafWriters, - billboard + billboard, ) { let i; const writer = vafWriters[attributeLocations.compressedAttribute2]; @@ -1183,15 +1179,15 @@ function writeCompressedAttrib2( const dimensions = billboardCollection._textureAtlas.texture.dimensions; const imageHeight = Math.round( - defaultValue(billboard.height, dimensions.y * height) + defaultValue(billboard.height, dimensions.y * height), ); billboardCollection._maxSize = Math.max( billboardCollection._maxSize, - imageHeight + imageHeight, ); let labelHorizontalOrigin = defaultValue( billboard._labelHorizontalOrigin, - -2 + -2, ); labelHorizontalOrigin += 2; const compressed3 = imageHeight * LEFT_SHIFT2 + labelHorizontalOrigin; @@ -1228,7 +1224,7 @@ function writeEyeOffset( frameState, textureAtlasCoordinates, vafWriters, - billboard + billboard, ) { let i; const writer = vafWriters[attributeLocations.eyeOffset]; @@ -1243,7 +1239,7 @@ function writeEyeOffset( billboardCollection._maxEyeOffset, Math.abs(eyeOffset.x), Math.abs(eyeOffset.y), - Math.abs(eyeOffsetZ) + Math.abs(eyeOffsetZ), ); if (billboardCollection._instanced) { @@ -1265,9 +1261,8 @@ function writeEyeOffset( scratchCartesian2.x = width; scratchCartesian2.y = height; - const compressedTexCoordsRange = AttributeCompression.compressTextureCoordinates( - scratchCartesian2 - ); + const compressedTexCoordsRange = + AttributeCompression.compressTextureCoordinates(scratchCartesian2); i = billboard._index; writer(i, eyeOffset.x, eyeOffset.y, eyeOffsetZ, compressedTexCoordsRange); @@ -1285,7 +1280,7 @@ function writeScaleByDistance( frameState, textureAtlasCoordinates, vafWriters, - billboard + billboard, ) { let i; const writer = vafWriters[attributeLocations.scaleByDistance]; @@ -1325,7 +1320,7 @@ function writePixelOffsetScaleByDistance( frameState, textureAtlasCoordinates, vafWriters, - billboard + billboard, ) { let i; const writer = vafWriters[attributeLocations.pixelOffsetScaleByDistance]; @@ -1365,7 +1360,7 @@ function writeCompressedAttribute3( frameState, textureAtlasCoordinates, vafWriters, - billboard + billboard, ) { let i; const writer = vafWriters[attributeLocations.compressedAttribute3]; @@ -1422,13 +1417,13 @@ function writeCompressedAttribute3( imageHeight = Math.round( defaultValue( billboard.height, - billboardCollection._textureAtlas.texture.dimensions.y * height - ) + billboardCollection._textureAtlas.texture.dimensions.y * height, + ), ); const textureWidth = billboardCollection._textureAtlas.texture.width; imageWidth = Math.round( - defaultValue(billboard.width, textureWidth * width) + defaultValue(billboard.width, textureWidth * width), ); } else { imageWidth = billboard._labelDimensions.x; @@ -1456,7 +1451,7 @@ function writeTextureCoordinateBoundsOrLabelTranslate( frameState, textureAtlasCoordinates, vafWriters, - billboard + billboard, ) { if (isHeightReferenceClamp(billboard.heightReference)) { const scene = billboardCollection._scene; @@ -1534,7 +1529,7 @@ function writeBatchId( frameState, textureAtlasCoordinates, vafWriters, - billboard + billboard, ) { if (!defined(billboardCollection._batchTable)) { return; @@ -1561,7 +1556,7 @@ function writeSDF( frameState, textureAtlasCoordinates, vafWriters, - billboard + billboard, ) { if (!billboardCollection._sdf) { return; @@ -1601,7 +1596,7 @@ function writeSplitDirection( frameState, textureAtlasCoordinates, vafWriters, - billboard + billboard, ) { const writer = vafWriters[attributeLocations.splitDirection]; let direction = 0.0; @@ -1629,91 +1624,91 @@ function writeBillboard( frameState, textureAtlasCoordinates, vafWriters, - billboard + billboard, ) { writePositionScaleAndRotation( billboardCollection, frameState, textureAtlasCoordinates, vafWriters, - billboard + billboard, ); writeCompressedAttrib0( billboardCollection, frameState, textureAtlasCoordinates, vafWriters, - billboard + billboard, ); writeCompressedAttrib1( billboardCollection, frameState, textureAtlasCoordinates, vafWriters, - billboard + billboard, ); writeCompressedAttrib2( billboardCollection, frameState, textureAtlasCoordinates, vafWriters, - billboard + billboard, ); writeEyeOffset( billboardCollection, frameState, textureAtlasCoordinates, vafWriters, - billboard + billboard, ); writeScaleByDistance( billboardCollection, frameState, textureAtlasCoordinates, vafWriters, - billboard + billboard, ); writePixelOffsetScaleByDistance( billboardCollection, frameState, textureAtlasCoordinates, vafWriters, - billboard + billboard, ); writeCompressedAttribute3( billboardCollection, frameState, textureAtlasCoordinates, vafWriters, - billboard + billboard, ); writeTextureCoordinateBoundsOrLabelTranslate( billboardCollection, frameState, textureAtlasCoordinates, vafWriters, - billboard + billboard, ); writeBatchId( billboardCollection, frameState, textureAtlasCoordinates, vafWriters, - billboard + billboard, ); writeSDF( billboardCollection, frameState, textureAtlasCoordinates, vafWriters, - billboard + billboard, ); writeSplitDirection( billboardCollection, frameState, textureAtlasCoordinates, vafWriters, - billboard + billboard, ); } @@ -1723,7 +1718,7 @@ function recomputeActualPositions( length, frameState, modelMatrix, - recomputeBoundingVolume + recomputeBoundingVolume, ) { let boundingVolume; if (frameState.mode === SceneMode.SCENE3D) { @@ -1741,7 +1736,7 @@ function recomputeActualPositions( billboard, position, frameState, - modelMatrix + modelMatrix, ); if (defined(actualPosition)) { billboard._setActualPosition(actualPosition); @@ -1787,7 +1782,7 @@ function updateMode(billboardCollection, frameState) { billboards.length, frameState, modelMatrix, - true + true, ); } } else if (mode === SceneMode.MORPHING) { @@ -1797,7 +1792,7 @@ function updateMode(billboardCollection, frameState) { billboards.length, frameState, modelMatrix, - true + true, ); } else if (mode === SceneMode.SCENE2D || mode === SceneMode.COLUMBUS_VIEW) { recomputeActualPositions( @@ -1806,7 +1801,7 @@ function updateMode(billboardCollection, frameState) { billboardCollection._billboardsToUpdateIndex, frameState, modelMatrix, - false + false, ); } } @@ -1817,7 +1812,7 @@ function updateBoundingVolume(collection, frameState, boundingVolume) { pixelScale = frameState.camera.getPixelSize( boundingVolume, frameState.context.drawingBufferWidth, - frameState.context.drawingBufferHeight + frameState.context.drawingBufferHeight, ); } @@ -1936,7 +1931,7 @@ BillboardCollection.prototype.update = function (frameState) { this._buffersUsage, this._instanced, this._batchTable, - this._sdf + this._sdf, ); vafWriters = this._vaf.writers; @@ -1949,7 +1944,7 @@ BillboardCollection.prototype.update = function (frameState) { frameState, textureAtlasCoordinates, vafWriters, - billboard + billboard, ); } @@ -2084,7 +2079,7 @@ BillboardCollection.prototype.update = function (frameState) { BoundingSphere.transform( this._baseVolume, this.modelMatrix, - this._baseVolumeWC + this._baseVolumeWC, ); } @@ -2094,12 +2089,12 @@ BillboardCollection.prototype.update = function (frameState) { modelMatrix = this.modelMatrix; boundingVolume = BoundingSphere.clone( this._baseVolumeWC, - this._boundingVolume + this._boundingVolume, ); } else { boundingVolume = BoundingSphere.clone( this._baseVolume2D, - this._boundingVolume + this._boundingVolume, ); } updateBoundingVolume(this, frameState, boundingVolume); @@ -2187,11 +2182,11 @@ BillboardCollection.prototype.update = function (frameState) { vsSource = this._batchTable.getVertexShaderCallback( false, "a_batchId", - undefined + undefined, )(vsSource); fsSource = this._batchTable.getFragmentShaderCallback( false, - undefined + undefined, )(fsSource); } @@ -2342,9 +2337,12 @@ BillboardCollection.prototype.update = function (frameState) { this._compiledShaderRotation = this._shaderRotation; this._compiledShaderAlignedAxis = this._shaderAlignedAxis; this._compiledShaderScaleByDistance = this._shaderScaleByDistance; - this._compiledShaderTranslucencyByDistance = this._shaderTranslucencyByDistance; - this._compiledShaderPixelOffsetScaleByDistance = this._shaderPixelOffsetScaleByDistance; - this._compiledShaderDistanceDisplayCondition = this._shaderDistanceDisplayCondition; + this._compiledShaderTranslucencyByDistance = + this._shaderTranslucencyByDistance; + this._compiledShaderPixelOffsetScaleByDistance = + this._shaderPixelOffsetScaleByDistance; + this._compiledShaderDistanceDisplayCondition = + this._shaderDistanceDisplayCondition; this._compiledShaderDisableDepthDistance = this._shaderDisableDepthDistance; this._compiledShaderClampToGround = this._shaderClampToGround; this._compiledSDF = this._sdf; diff --git a/packages/engine/Source/Scene/BingMapsImageryProvider.js b/packages/engine/Source/Scene/BingMapsImageryProvider.js index 8024cea285de..26d600e1bc1b 100644 --- a/packages/engine/Source/Scene/BingMapsImageryProvider.js +++ b/packages/engine/Source/Scene/BingMapsImageryProvider.js @@ -101,7 +101,7 @@ ImageryProviderBuilder.prototype.build = function (provider) { CesiumMath.toRadians(bbox[1]), CesiumMath.toRadians(bbox[0]), CesiumMath.toRadians(bbox[3]), - CesiumMath.toRadians(bbox[2]) + CesiumMath.toRadians(bbox[2]), ); } } @@ -110,7 +110,7 @@ ImageryProviderBuilder.prototype.build = function (provider) { function metadataSuccess(data, imageryProviderBuilder) { if (data.resourceSets.length !== 1) { throw new RuntimeError( - "metadata does not specify one resource in resourceSets" + "metadata does not specify one resource in resourceSets", ); } @@ -126,7 +126,7 @@ function metadataSuccess(data, imageryProviderBuilder) { // prevent issues with the imagery API from crashing the viewer when the expected properties are not there // See https://github.com/CesiumGS/cesium/issues/12088 validProviders = resource.imageryProviders.filter((provider) => - provider.coverageAreas?.some((area) => defined(area.bbox)) + provider.coverageAreas?.some((area) => defined(area.bbox)), ); } imageryProviderBuilder.attributionList = validProviders; @@ -146,7 +146,7 @@ function metadataFailure(metadataResource, error, provider) { undefined, undefined, undefined, - error + error, ); throw new RuntimeError(message); @@ -155,7 +155,7 @@ function metadataFailure(metadataResource, error, provider) { async function requestMetadata( metadataResource, imageryProviderBuilder, - provider + provider, ) { const cacheKey = metadataResource.url; let promise = BingMapsImageryProvider._metadataCache[cacheKey]; @@ -230,7 +230,7 @@ function BingMapsImageryProvider(options) { this._proxy = options.proxy; this._credit = new Credit( - `` + ``, ); this._tilingScheme = new WebMercatorTilingScheme({ @@ -541,12 +541,12 @@ BingMapsImageryProvider.prototype.getTileCredits = function (x, y, level) { x, y, level, - rectangleScratch + rectangleScratch, ); const result = getRectangleAttribution( this._attributionList, level, - rectangle + rectangle, ); return result; @@ -566,11 +566,11 @@ BingMapsImageryProvider.prototype.requestImage = function ( x, y, level, - request + request, ) { const promise = ImageryProvider.loadImage( this, - buildImageResource(this, x, y, level, request) + buildImageResource(this, x, y, level, request), ); if (defined(promise)) { @@ -604,7 +604,7 @@ BingMapsImageryProvider.prototype.pickFeatures = function ( y, level, longitude, - latitude + latitude, ) { return undefined; }; @@ -683,7 +683,7 @@ Object.defineProperties(BingMapsImageryProvider, { get: function () { if (!defined(BingMapsImageryProvider._logoUrl)) { BingMapsImageryProvider._logoUrl = buildModuleUrl( - "Assets/Images/bing_maps_credit.png" + "Assets/Images/bing_maps_credit.png", ); } return BingMapsImageryProvider._logoUrl; @@ -748,7 +748,7 @@ function getRectangleAttribution(attributionList, level, rectangle) { const intersection = Rectangle.intersection( rectangle, area.bbox, - intersectionScratch + intersectionScratch, ); if (defined(intersection)) { included = true; diff --git a/packages/engine/Source/Scene/BoundingVolumeSemantics.js b/packages/engine/Source/Scene/BoundingVolumeSemantics.js index a9adb87b3fd0..8bfb24ed38b6 100644 --- a/packages/engine/Source/Scene/BoundingVolumeSemantics.js +++ b/packages/engine/Source/Scene/BoundingVolumeSemantics.js @@ -29,7 +29,7 @@ const BoundingVolumeSemantics = {}; * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy. */ BoundingVolumeSemantics.parseAllBoundingVolumeSemantics = function ( - tileMetadata + tileMetadata, ) { //>>includeStart('debug', pragmas.debug); Check.typeOf.object("tileMetadata", tileMetadata); @@ -39,29 +39,29 @@ BoundingVolumeSemantics.parseAllBoundingVolumeSemantics = function ( tile: { boundingVolume: BoundingVolumeSemantics.parseBoundingVolumeSemantic( "TILE", - tileMetadata + tileMetadata, ), minimumHeight: BoundingVolumeSemantics._parseMinimumHeight( "TILE", - tileMetadata + tileMetadata, ), maximumHeight: BoundingVolumeSemantics._parseMaximumHeight( "TILE", - tileMetadata + tileMetadata, ), }, content: { boundingVolume: BoundingVolumeSemantics.parseBoundingVolumeSemantic( "CONTENT", - tileMetadata + tileMetadata, ), minimumHeight: BoundingVolumeSemantics._parseMinimumHeight( "CONTENT", - tileMetadata + tileMetadata, ), maximumHeight: BoundingVolumeSemantics._parseMaximumHeight( "CONTENT", - tileMetadata + tileMetadata, ), }, }; @@ -83,7 +83,7 @@ BoundingVolumeSemantics.parseAllBoundingVolumeSemantics = function ( */ BoundingVolumeSemantics.parseBoundingVolumeSemantic = function ( prefix, - tileMetadata + tileMetadata, ) { //>>includeStart('debug', pragmas.debug); Check.typeOf.string("prefix", prefix); @@ -104,7 +104,7 @@ BoundingVolumeSemantics.parseBoundingVolumeSemantic = function ( const boundingRegionSemantic = `${prefix}_BOUNDING_REGION`; const boundingRegion = tileMetadata.getPropertyBySemantic( - boundingRegionSemantic + boundingRegionSemantic, ); if (defined(boundingRegion)) { @@ -115,7 +115,7 @@ BoundingVolumeSemantics.parseBoundingVolumeSemantic = function ( const boundingSphereSemantic = `${prefix}_BOUNDING_SPHERE`; const boundingSphere = tileMetadata.getPropertyBySemantic( - boundingSphereSemantic + boundingSphereSemantic, ); if (defined(boundingSphere)) { diff --git a/packages/engine/Source/Scene/BoxEmitter.js b/packages/engine/Source/Scene/BoxEmitter.js index 89eb3401a5a2..15e0eaf293d4 100644 --- a/packages/engine/Source/Scene/BoxEmitter.js +++ b/packages/engine/Source/Scene/BoxEmitter.js @@ -69,7 +69,7 @@ BoxEmitter.prototype.emit = function (particle) { particle.position = Cartesian3.fromElements(x, y, z, particle.position); particle.velocity = Cartesian3.normalize( particle.position, - particle.velocity + particle.velocity, ); }; export default BoxEmitter; diff --git a/packages/engine/Source/Scene/BufferLoader.js b/packages/engine/Source/Scene/BufferLoader.js index fb5f572abb9c..bc4075c8f827 100644 --- a/packages/engine/Source/Scene/BufferLoader.js +++ b/packages/engine/Source/Scene/BufferLoader.js @@ -32,7 +32,7 @@ function BufferLoader(options) { //>>includeStart('debug', pragmas.debug); if (defined(typedArray) === defined(resource)) { throw new DeveloperError( - "One of options.typedArray and options.resource must be defined." + "One of options.typedArray and options.resource must be defined.", ); } //>>includeEnd('debug'); diff --git a/packages/engine/Source/Scene/Camera.js b/packages/engine/Source/Scene/Camera.js index eb000c7befa9..42c0f50f52cd 100644 --- a/packages/engine/Source/Scene/Camera.js +++ b/packages/engine/Source/Scene/Camera.js @@ -235,7 +235,7 @@ function Camera(scene) { const projection = scene.mapProjection; this._projection = projection; this._maxCoord = projection.project( - new Cartographic(Math.PI, CesiumMath.PI_OVER_TWO) + new Cartographic(Math.PI, CesiumMath.PI_OVER_TWO), ); this._max2Dfrustum = undefined; @@ -244,7 +244,7 @@ function Camera(scene) { this, Camera.DEFAULT_VIEW_RECTANGLE, this.position, - true + true, ); let mag = Cartesian3.magnitude(this.position); @@ -272,7 +272,7 @@ Camera.TRANSFORM_2D = new Matrix4( 0.0, 0.0, 0.0, - 1.0 + 1.0, ); /** @@ -280,7 +280,7 @@ Camera.TRANSFORM_2D = new Matrix4( */ Camera.TRANSFORM_2D_INVERSE = Matrix4.inverseTransformation( Camera.TRANSFORM_2D, - new Matrix4() + new Matrix4(), ); /** @@ -291,7 +291,7 @@ Camera.DEFAULT_VIEW_RECTANGLE = Rectangle.fromDegrees( -95.0, -20.0, -70.0, - 90.0 + 90.0, ); /** @@ -309,7 +309,7 @@ Camera.DEFAULT_VIEW_FACTOR = 0.5; Camera.DEFAULT_OFFSET = new HeadingPitchRange( 0.0, -CesiumMath.PI_OVER_FOUR, - 0.0 + 0.0, ); function updateViewMatrix(camera) { @@ -318,12 +318,12 @@ function updateViewMatrix(camera) { camera._direction, camera._up, camera._right, - camera._viewMatrix + camera._viewMatrix, ); Matrix4.multiply( camera._viewMatrix, camera._actualInvTransform, - camera._viewMatrix + camera._viewMatrix, ); Matrix4.inverseTransformation(camera._viewMatrix, camera._invViewMatrix); } @@ -332,19 +332,19 @@ function updateCameraDeltas(camera) { if (!defined(camera._oldPositionWC)) { camera._oldPositionWC = Cartesian3.clone( camera.positionWC, - camera._oldPositionWC + camera._oldPositionWC, ); } else { camera.positionWCDeltaMagnitudeLastFrame = camera.positionWCDeltaMagnitude; const delta = Cartesian3.subtract( camera.positionWC, camera._oldPositionWC, - camera._oldPositionWC + camera._oldPositionWC, ); camera.positionWCDeltaMagnitude = Cartesian3.magnitude(delta); camera._oldPositionWC = Cartesian3.clone( camera.positionWC, - camera._oldPositionWC + camera._oldPositionWC, ); // Update move timers @@ -427,14 +427,14 @@ Camera.prototype._updateCameraChanged = function () { headingChangedPercentage > percentageChanged ) { camera._changed.raiseEvent( - Math.max(rollChangedPercentage, headingChangedPercentage) + Math.max(rollChangedPercentage, headingChangedPercentage), ); } if (camera._mode === SceneMode.SCENE2D) { if (!defined(camera._changedFrustum)) { camera._changedPosition = Cartesian3.clone( camera.position, - camera._changedPosition + camera._changedPosition, ); camera._changedFrustum = camera.frustum.clone(); return; @@ -479,7 +479,7 @@ Camera.prototype._updateCameraChanged = function () { camera._changed.raiseEvent(areaPercentage); camera._changedPosition = Cartesian3.clone( camera.position, - camera._changedPosition + camera._changedPosition, ); camera._changedFrustum = camera.frustum.clone(camera._changedFrustum); } @@ -489,17 +489,17 @@ Camera.prototype._updateCameraChanged = function () { if (!defined(camera._changedDirection)) { camera._changedPosition = Cartesian3.clone( camera.positionWC, - camera._changedPosition + camera._changedPosition, ); camera._changedDirection = Cartesian3.clone( camera.directionWC, - camera._changedDirection + camera._changedDirection, ); return; } const dirAngle = CesiumMath.acosClamped( - Cartesian3.dot(camera.directionWC, camera._changedDirection) + Cartesian3.dot(camera.directionWC, camera._changedDirection), ); let dirPercentage; @@ -511,7 +511,7 @@ Camera.prototype._updateCameraChanged = function () { const distance = Cartesian3.distance( camera.positionWC, - camera._changedPosition + camera._changedPosition, ); const heightPercentage = distance / camera.positionCartographic.height; @@ -522,11 +522,11 @@ Camera.prototype._updateCameraChanged = function () { camera._changed.raiseEvent(Math.max(dirPercentage, heightPercentage)); camera._changedPosition = Cartesian3.clone( camera.positionWC, - camera._changedPosition + camera._changedPosition, ); camera._changedDirection = Cartesian3.clone( camera.directionWC, - camera._changedDirection + camera._changedDirection, ); } }; @@ -535,7 +535,7 @@ function convertTransformForColumbusView(camera) { Transforms.basisTo2D( camera._projection, camera._transform, - camera._actualTransform + camera._actualTransform, ); } @@ -555,16 +555,16 @@ function convertTransformFor2D(camera) { const origin = Matrix4.getColumn( camera._transform, 3, - scratchCartesian4Origin + scratchCartesian4Origin, ); const cartographic = ellipsoid.cartesianToCartographic( origin, - scratchCartographic + scratchCartographic, ); const projectedPosition = projection.project( cartographic, - scratchCartesian3Projection + scratchCartesian3Projection, ); const newOrigin = scratchCartesian4NewOrigin; newOrigin.x = projectedPosition.z; @@ -574,13 +574,13 @@ function convertTransformFor2D(camera) { const newZAxis = Cartesian4.clone( Cartesian4.UNIT_X, - scratchCartesian4NewZAxis + scratchCartesian4NewZAxis, ); const xAxis = Cartesian4.add( Matrix4.getColumn(camera._transform, 0, scratchCartesian3), origin, - scratchCartesian3 + scratchCartesian3, ); ellipsoid.cartesianToCartographic(xAxis, cartographic); @@ -601,7 +601,7 @@ function convertTransformFor2D(camera) { const yAxis = Cartesian4.add( Matrix4.getColumn(camera._transform, 1, scratchCartesian3), origin, - scratchCartesian3 + scratchCartesian3, ); ellipsoid.cartesianToCartographic(yAxis, cartographic); @@ -629,25 +629,25 @@ function convertTransformFor2D(camera) { camera._actualTransform, 0, newXAxis, - camera._actualTransform + camera._actualTransform, ); Matrix4.setColumn( camera._actualTransform, 1, newYAxis, - camera._actualTransform + camera._actualTransform, ); Matrix4.setColumn( camera._actualTransform, 2, newZAxis, - camera._actualTransform + camera._actualTransform, ); Matrix4.setColumn( camera._actualTransform, 3, newOrigin, - camera._actualTransform + camera._actualTransform, ); } @@ -714,7 +714,7 @@ function updateMembers(camera) { Matrix4.inverseTransformation( camera._actualTransform, - camera._actualInvTransform + camera._actualInvTransform, ); camera._modeChanged = false; @@ -726,15 +726,16 @@ function updateMembers(camera) { camera._positionWC = Matrix4.multiplyByPoint( transform, position, - camera._positionWC + camera._positionWC, ); // Compute the Cartographic position of the camera. if (mode === SceneMode.SCENE3D || mode === SceneMode.MORPHING) { - camera._positionCartographic = camera._projection.ellipsoid.cartesianToCartographic( - camera._positionWC, - camera._positionCartographic - ); + camera._positionCartographic = + camera._projection.ellipsoid.cartesianToCartographic( + camera._positionWC, + camera._positionCartographic, + ); } else { // The camera position is expressed in the 2D coordinate system where the Y axis is to the East, // the Z axis is to the North, and the X axis is out of the map. Express them instead in the ENU axes where @@ -757,7 +758,7 @@ function updateMembers(camera) { if (directionChanged || upChanged || rightChanged) { const det = Cartesian3.dot( direction, - Cartesian3.cross(up, right, scratchCartesian) + Cartesian3.cross(up, right, scratchCartesian), ); if (Math.abs(1.0 - det) > CesiumMath.EPSILON2) { //orthonormalize axes @@ -766,11 +767,11 @@ function updateMembers(camera) { const w0 = Cartesian3.multiplyByScalar( direction, scalar, - scratchCartesian + scratchCartesian, ); up = Cartesian3.normalize( Cartesian3.subtract(up, w0, camera._up), - camera._up + camera._up, ); Cartesian3.clone(up, camera.up); @@ -783,7 +784,7 @@ function updateMembers(camera) { camera._directionWC = Matrix4.multiplyByPointAsVector( transform, direction, - camera._directionWC + camera._directionWC, ); Cartesian3.normalize(camera._directionWC, camera._directionWC); } @@ -797,7 +798,7 @@ function updateMembers(camera) { camera._rightWC = Matrix4.multiplyByPointAsVector( transform, right, - camera._rightWC + camera._rightWC, ); Cartesian3.normalize(camera._rightWC, camera._rightWC); } @@ -998,7 +999,7 @@ Object.defineProperties(Camera.prototype, { const transform = Transforms.eastNorthUpToFixedFrame( this.positionWC, ellipsoid, - scratchHPRMatrix2 + scratchHPRMatrix2, ); this._setTransform(transform); @@ -1029,7 +1030,7 @@ Object.defineProperties(Camera.prototype, { const transform = Transforms.eastNorthUpToFixedFrame( this.positionWC, ellipsoid, - scratchHPRMatrix2 + scratchHPRMatrix2, ); this._setTransform(transform); @@ -1060,7 +1061,7 @@ Object.defineProperties(Camera.prototype, { const transform = Transforms.eastNorthUpToFixedFrame( this.positionWC, ellipsoid, - scratchHPRMatrix2 + scratchHPRMatrix2, ); this._setTransform(transform); @@ -1125,7 +1126,7 @@ Camera.prototype.update = function (mode) { !(this.frustum instanceof OrthographicOffCenterFrustum) ) { throw new DeveloperError( - "An OrthographicOffCenterFrustum is required in 2D." + "An OrthographicOffCenterFrustum is required in 2D.", ); } if ( @@ -1134,7 +1135,7 @@ Camera.prototype.update = function (mode) { !(this.frustum instanceof OrthographicFrustum) ) { throw new DeveloperError( - "A PerspectiveFrustum or OrthographicFrustum is required in 3D and Columbus view" + "A PerspectiveFrustum or OrthographicFrustum is required in 3D and Columbus view", ); } //>>includeEnd('debug'); @@ -1152,7 +1153,7 @@ Camera.prototype.update = function (mode) { //>>includeStart('debug', pragmas.debug); if (!(frustum instanceof OrthographicOffCenterFrustum)) { throw new DeveloperError( - "The camera frustum is expected to be orthographic for 2D camera control." + "The camera frustum is expected to be orthographic for 2D camera control.", ); } //>>includeEnd('debug'); @@ -1217,7 +1218,7 @@ function calculateOrthographicFrustumWidth(camera) { ray, scene, true, - scratchRayIntersection + scratchRayIntersection, ); } @@ -1225,7 +1226,7 @@ function calculateOrthographicFrustumWidth(camera) { if (scene.pickPositionSupported) { depthIntersection = scene.pickPositionWorldCoordinates( mousePosition, - scratchDepthIntersection + scratchDepthIntersection, ); } @@ -1271,12 +1272,12 @@ function setView3D(camera, position, hpr) { //>>includeEnd('debug'); const currentTransform = Matrix4.clone( camera.transform, - scratchSetViewTransform1 + scratchSetViewTransform1, ); const localTransform = Transforms.eastNorthUpToFixedFrame( position, camera._projection.ellipsoid, - scratchSetViewTransform2 + scratchSetViewTransform2, ); camera._setTransform(localTransform); @@ -1285,7 +1286,7 @@ function setView3D(camera, position, hpr) { const rotQuat = Quaternion.fromHeadingPitchRoll( hpr, - scratchSetViewQuaternion + scratchSetViewQuaternion, ); const rotMat = Matrix3.fromQuaternion(rotQuat, scratchSetViewMatrix3); @@ -1301,7 +1302,7 @@ function setView3D(camera, position, hpr) { function setViewCV(camera, position, hpr, convert) { const currentTransform = Matrix4.clone( camera.transform, - scratchSetViewTransform1 + scratchSetViewTransform1, ); camera._setTransform(Matrix4.IDENTITY); @@ -1310,7 +1311,7 @@ function setViewCV(camera, position, hpr, convert) { const projection = camera._projection; const cartographic = projection.ellipsoid.cartesianToCartographic( position, - scratchSetViewCartographic + scratchSetViewCartographic, ); position = projection.project(cartographic, scratchSetViewCartesian); } @@ -1320,7 +1321,7 @@ function setViewCV(camera, position, hpr, convert) { const rotQuat = Quaternion.fromHeadingPitchRoll( hpr, - scratchSetViewQuaternion + scratchSetViewQuaternion, ); const rotMat = Matrix3.fromQuaternion(rotQuat, scratchSetViewMatrix3); @@ -1336,7 +1337,7 @@ function setViewCV(camera, position, hpr, convert) { function setView2D(camera, position, hpr, convert) { const currentTransform = Matrix4.clone( camera.transform, - scratchSetViewTransform1 + scratchSetViewTransform1, ); camera._setTransform(Matrix4.IDENTITY); @@ -1345,7 +1346,7 @@ function setView2D(camera, position, hpr, convert) { const projection = camera._projection; const cartographic = projection.ellipsoid.cartesianToCartographic( position, - scratchSetViewCartographic + scratchSetViewCartographic, ); position = projection.project(cartographic, scratchSetViewCartesian); } @@ -1371,7 +1372,7 @@ function setView2D(camera, position, hpr, convert) { hpr.roll = 0.0; const rotQuat = Quaternion.fromHeadingPitchRoll( hpr, - scratchSetViewQuaternion + scratchSetViewQuaternion, ); const rotMat = Matrix3.fromQuaternion(rotQuat, scratchSetViewMatrix3); @@ -1389,7 +1390,7 @@ const scratchToHPRRight = new Cartesian3(); function directionUpToHeadingPitchRoll(camera, position, orientation, result) { const direction = Cartesian3.clone( orientation.direction, - scratchToHPRDirection + scratchToHPRDirection, ); const up = Cartesian3.clone(orientation.up, scratchToHPRUp); @@ -1398,11 +1399,11 @@ function directionUpToHeadingPitchRoll(camera, position, orientation, result) { const transform = Transforms.eastNorthUpToFixedFrame( position, ellipsoid, - scratchHPRMatrix1 + scratchHPRMatrix1, ); const invTransform = Matrix4.inverseTransformation( transform, - scratchHPRMatrix2 + scratchHPRMatrix2, ); Matrix4.multiplyByPointAsVector(invTransform, direction, direction); @@ -1487,7 +1488,7 @@ Camera.prototype.setView = function (options) { options = defaultValue(options, defaultValue.EMPTY_OBJECT); let orientation = defaultValue( options.orientation, - defaultValue.EMPTY_OBJECT + defaultValue.EMPTY_OBJECT, ); const mode = this._mode; @@ -1502,12 +1503,12 @@ Camera.prototype.setView = function (options) { let convert = defaultValue(options.convert, true); let destination = defaultValue( options.destination, - Cartesian3.clone(this.positionWC, scratchSetViewCartesian) + Cartesian3.clone(this.positionWC, scratchSetViewCartesian), ); if (defined(destination) && defined(destination.west)) { destination = this.getRectangleCameraCoordinates( destination, - scratchSetViewCartesian + scratchSetViewCartesian, ); //>>includeStart('debug', pragmas.debug); // destination.z may be null in 2D, but .x and .y should be numeric @@ -1523,7 +1524,7 @@ Camera.prototype.setView = function (options) { this, destination, orientation, - scratchSetViewOptions.orientation + scratchSetViewOptions.orientation, ); } @@ -1563,7 +1564,7 @@ Camera.prototype.flyHome = function (duration) { }); } else if (mode === SceneMode.SCENE3D) { const destination = this.getRectangleCameraCoordinates( - Camera.DEFAULT_VIEW_RECTANGLE + Camera.DEFAULT_VIEW_RECTANGLE, ); let mag = Cartesian3.magnitude(destination); @@ -1582,7 +1583,7 @@ Camera.prototype.flyHome = function (duration) { position = Cartesian3.multiplyByScalar( Cartesian3.normalize(position, position), 5.0 * maxRadii, - position + position, ); this.flyTo({ destination: position, @@ -1661,7 +1662,7 @@ Camera.prototype.worldToCameraCoordinatesVector = function (cartesian, result) { return Matrix4.multiplyByPointAsVector( this._actualInvTransform, cartesian, - result + result, ); }; @@ -1728,7 +1729,7 @@ Camera.prototype.cameraToWorldCoordinatesVector = function (cartesian, result) { return Matrix4.multiplyByPointAsVector( this._actualTransform, cartesian, - result + result, ); }; @@ -1976,7 +1977,7 @@ Camera.prototype.look = function (axis, angle) { const quaternion = Quaternion.fromAxisAngle( axis, -turnAngle, - lookScratchQuaternion + lookScratchQuaternion, ); const rotation = Matrix3.fromQuaternion(quaternion, lookScratchMatrix); @@ -2038,7 +2039,7 @@ Camera.prototype.rotate = function (axis, angle) { const quaternion = Quaternion.fromAxisAngle( axis, -turnAngle, - rotateScratchQuaternion + rotateScratchQuaternion, ); const rotation = Matrix3.fromQuaternion(quaternion, rotateScratchMatrix); Matrix3.multiplyByVector(rotation, this.position, this.position); @@ -2087,24 +2088,24 @@ function rotateVertical(camera, angle) { !Cartesian3.equalsEpsilon( camera.position, Cartesian3.ZERO, - CesiumMath.EPSILON2 + CesiumMath.EPSILON2, ) ) { const p = Cartesian3.normalize(position, rotateVertScratchP); const northParallel = Cartesian3.equalsEpsilon( p, camera.constrainedAxis, - CesiumMath.EPSILON2 + CesiumMath.EPSILON2, ); const southParallel = Cartesian3.equalsEpsilon( p, Cartesian3.negate(camera.constrainedAxis, rotateVertScratchNegate), - CesiumMath.EPSILON2 + CesiumMath.EPSILON2, ); if (!northParallel && !southParallel) { const constrainedAxis = Cartesian3.normalize( camera.constrainedAxis, - rotateVertScratchA + rotateVertScratchA, ); let dot = Cartesian3.dot(p, constrainedAxis); @@ -2115,7 +2116,7 @@ function rotateVertical(camera, angle) { dot = Cartesian3.dot( p, - Cartesian3.negate(constrainedAxis, rotateVertScratchNegate) + Cartesian3.negate(constrainedAxis, rotateVertScratchNegate), ); angleToAxis = CesiumMath.acosClamped(dot); if (angle < 0 && -angle > angleToAxis) { @@ -2125,7 +2126,7 @@ function rotateVertical(camera, angle) { const tangent = Cartesian3.cross( constrainedAxis, p, - rotateVertScratchTan + rotateVertScratchTan, ); camera.rotate(tangent, angle); } else if ((northParallel && angle < 0) || (southParallel && angle > 0)) { @@ -2182,7 +2183,7 @@ function zoom2D(camera, amount) { !defined(frustum.top) ) { throw new DeveloperError( - "The camera frustum is expected to be orthographic for 2D camera control." + "The camera frustum is expected to be orthographic for 2D camera control.", ); } //>>includeEnd('debug'); @@ -2294,7 +2295,7 @@ Camera.prototype.getMagnitude = function () { } else if (this._mode === SceneMode.SCENE2D) { return Math.max( this.frustum.right - this.frustum.left, - this.frustum.top - this.frustum.bottom + this.frustum.top - this.frustum.bottom, ); } }; @@ -2349,7 +2350,7 @@ Camera.prototype.lookAt = function (target, offset) { const transform = Transforms.eastNorthUpToFixedFrame( target, ellipsoid, - scratchLookAtMatrix4 + scratchLookAtMatrix4, ); this.lookAtTransform(transform, offset); }; @@ -2363,29 +2364,29 @@ function offsetFromHeadingPitchRange(heading, pitch, range) { pitch = CesiumMath.clamp( pitch, -CesiumMath.PI_OVER_TWO, - CesiumMath.PI_OVER_TWO + CesiumMath.PI_OVER_TWO, ); heading = CesiumMath.zeroToTwoPi(heading) - CesiumMath.PI_OVER_TWO; const pitchQuat = Quaternion.fromAxisAngle( Cartesian3.UNIT_Y, -pitch, - scratchLookAtHeadingPitchRangeQuaternion1 + scratchLookAtHeadingPitchRangeQuaternion1, ); const headingQuat = Quaternion.fromAxisAngle( Cartesian3.UNIT_Z, -heading, - scratchLookAtHeadingPitchRangeQuaternion2 + scratchLookAtHeadingPitchRangeQuaternion2, ); const rotQuat = Quaternion.multiply(headingQuat, pitchQuat, headingQuat); const rotMatrix = Matrix3.fromQuaternion( rotQuat, - scratchHeadingPitchRangeMatrix3 + scratchHeadingPitchRangeMatrix3, ); const offset = Cartesian3.clone( Cartesian3.UNIT_X, - scratchLookAtHeadingPitchRangeOffset + scratchLookAtHeadingPitchRangeOffset, ); Matrix3.multiplyByVector(rotMatrix, offset, offset); Cartesian3.negate(offset, offset); @@ -2428,7 +2429,7 @@ Camera.prototype.lookAtTransform = function (transform, offset) { } if (this._mode === SceneMode.MORPHING) { throw new DeveloperError( - "lookAtTransform is not supported while morphing." + "lookAtTransform is not supported while morphing.", ); } //>>includeEnd('debug'); @@ -2443,7 +2444,7 @@ Camera.prototype.lookAtTransform = function (transform, offset) { cartesianOffset = offsetFromHeadingPitchRange( offset.heading, offset.pitch, - offset.range + offset.range, ); } else { cartesianOffset = offset; @@ -2564,17 +2565,14 @@ function rectangleCameraPosition3D(camera, rectangle, result, updateCamera) { !defined(ellipsoidGeodesic) || ellipsoidGeodesic.ellipsoid !== ellipsoid ) { - viewRectangle3DEllipsoidGeodesic = ellipsoidGeodesic = new EllipsoidGeodesic( - undefined, - undefined, - ellipsoid - ); + viewRectangle3DEllipsoidGeodesic = ellipsoidGeodesic = + new EllipsoidGeodesic(undefined, undefined, ellipsoid); } ellipsoidGeodesic.setEndPoints(northCartographic, southCartographic); latitude = ellipsoidGeodesic.interpolateUsingFraction( 0.5, - viewRectangle3DCartographic1 + viewRectangle3DCartographic1, ).latitude; } @@ -2585,7 +2583,7 @@ function rectangleCameraPosition3D(camera, rectangle, result, updateCamera) { const center = ellipsoid.cartographicToCartesian( centerCartographic, - viewRectangle3DCenter + viewRectangle3DCenter, ); const cart = viewRectangle3DCartographic1; @@ -2593,32 +2591,32 @@ function rectangleCameraPosition3D(camera, rectangle, result, updateCamera) { cart.latitude = north; const northEast = ellipsoid.cartographicToCartesian( cart, - viewRectangle3DNorthEast + viewRectangle3DNorthEast, ); cart.longitude = west; const northWest = ellipsoid.cartographicToCartesian( cart, - viewRectangle3DNorthWest + viewRectangle3DNorthWest, ); cart.longitude = longitude; const northCenter = ellipsoid.cartographicToCartesian( cart, - viewRectangle3DNorthCenter + viewRectangle3DNorthCenter, ); cart.latitude = south; const southCenter = ellipsoid.cartographicToCartesian( cart, - viewRectangle3DSouthCenter + viewRectangle3DSouthCenter, ); cart.longitude = east; const southEast = ellipsoid.cartographicToCartesian( cart, - viewRectangle3DSouthEast + viewRectangle3DSouthEast, ); cart.longitude = west; const southWest = ellipsoid.cartographicToCartesian( cart, - viewRectangle3DSouthWest + viewRectangle3DSouthWest, ); Cartesian3.subtract(northWest, center, northWest); @@ -2638,11 +2636,11 @@ function rectangleCameraPosition3D(camera, rectangle, result, updateCamera) { if (camera.frustum instanceof OrthographicFrustum) { const width = Math.max( Cartesian3.distance(northEast, northWest), - Cartesian3.distance(southEast, southWest) + Cartesian3.distance(southEast, southWest), ); const height = Math.max( Cartesian3.distance(northEast, southEast), - Cartesian3.distance(northWest, southWest) + Cartesian3.distance(northWest, southWest), ); let rightScalar; @@ -2675,7 +2673,7 @@ function rectangleCameraPosition3D(camera, rectangle, result, updateCamera) { computeD(direction, right, northEast, tanTheta), computeD(direction, right, southWest, tanTheta), computeD(direction, right, northCenter, tanTheta), - computeD(direction, right, southCenter, tanTheta) + computeD(direction, right, southCenter, tanTheta), ); // If the rectangle crosses the equator, compute D at the equator, too, because that's the @@ -2687,25 +2685,25 @@ function rectangleCameraPosition3D(camera, rectangle, result, updateCamera) { equatorCartographic.height = 0.0; let equatorPosition = ellipsoid.cartographicToCartesian( equatorCartographic, - viewRectangle3DEquator + viewRectangle3DEquator, ); Cartesian3.subtract(equatorPosition, center, equatorPosition); d = Math.max( d, computeD(direction, up, equatorPosition, tanPhi), - computeD(direction, right, equatorPosition, tanTheta) + computeD(direction, right, equatorPosition, tanTheta), ); equatorCartographic.longitude = east; equatorPosition = ellipsoid.cartographicToCartesian( equatorCartographic, - viewRectangle3DEquator + viewRectangle3DEquator, ); Cartesian3.subtract(equatorPosition, center, equatorPosition); d = Math.max( d, computeD(direction, up, equatorPosition, tanPhi), - computeD(direction, right, equatorPosition, tanTheta) + computeD(direction, right, equatorPosition, tanTheta), ); } } @@ -2713,7 +2711,7 @@ function rectangleCameraPosition3D(camera, rectangle, result, updateCamera) { return Cartesian3.add( center, Cartesian3.multiplyByScalar(direction, -d, viewRectangle3DEquator), - result + result, ); } @@ -2750,7 +2748,7 @@ function rectangleCameraPositionColumbusView(camera, rectangle, result) { result.z = Math.max( (northEast.x - southWest.x) / tanTheta, - (northEast.y - southWest.y) / tanPhi + (northEast.y - southWest.y) / tanPhi, ) * 0.5; } else { const width = northEast.x - southWest.x; @@ -2935,7 +2933,7 @@ Camera.prototype.pickEllipsoid = function (windowPosition, ellipsoid, result) { this, windowPosition, this._projection, - result + result, ); } else { return undefined; @@ -2965,18 +2963,18 @@ function getPickRayPerspective(camera, windowPosition, result) { const nearCenter = Cartesian3.multiplyByScalar( camera.directionWC, near, - pickPerspCenter + pickPerspCenter, ); Cartesian3.add(position, nearCenter, nearCenter); const xDir = Cartesian3.multiplyByScalar( camera.rightWC, x * near * tanTheta, - pickPerspXDir + pickPerspXDir, ); const yDir = Cartesian3.multiplyByScalar( camera.upWC, y * near * tanPhi, - pickPerspYDir + pickPerspYDir, ); const direction = Cartesian3.add(nearCenter, xDir, result.direction); Cartesian3.add(direction, yDir, direction); @@ -3021,7 +3019,7 @@ function getPickRayOrthographic(camera, windowPosition, result) { result.origin.z, result.origin.x, result.origin.y, - result.origin + result.origin, ); } @@ -3083,12 +3081,12 @@ Camera.prototype.distanceToBoundingSphere = function (boundingSphere) { const toCenter = Cartesian3.subtract( this.positionWC, boundingSphere.center, - scratchToCenter + scratchToCenter, ); const proj = Cartesian3.multiplyByScalar( this.directionWC, Cartesian3.dot(toCenter, this.directionWC), - scratchProj + scratchProj, ); return Math.max(0.0, Cartesian3.magnitude(proj) - boundingSphere.radius); }; @@ -3106,7 +3104,7 @@ const scratchPixelSize = new Cartesian2(); Camera.prototype.getPixelSize = function ( boundingSphere, drawingBufferWidth, - drawingBufferHeight + drawingBufferHeight, ) { //>>includeStart('debug', pragmas.debug); if (!defined(boundingSphere)) { @@ -3126,7 +3124,7 @@ Camera.prototype.getPixelSize = function ( drawingBufferHeight, distance, this._scene.pixelRatio, - scratchPixelSize + scratchPixelSize, ); return Math.max(pixelSize.x, pixelSize.y); }; @@ -3137,7 +3135,7 @@ function createAnimationTemplateCV( center, maxX, maxY, - duration + duration, ) { const newPosition = Cartesian3.clone(position); @@ -3158,7 +3156,7 @@ function createAnimationTemplateCV( position, newPosition, value.time, - new Cartesian3() + new Cartesian3(), ); camera.worldToCameraCoordinatesPoint(interp, camera.position); } @@ -3186,14 +3184,14 @@ function createAnimationCV(camera, duration) { const normal = camera.worldToCameraCoordinatesVector( Cartesian3.UNIT_X, - normalScratch + normalScratch, ); const scalar = -Cartesian3.dot(normal, position) / Cartesian3.dot(normal, direction); const center = Cartesian3.add( position, Cartesian3.multiplyByScalar(direction, scalar, centerScratch), - centerScratch + centerScratch, ); camera.cameraToWorldCoordinatesPoint(center, center); @@ -3202,7 +3200,7 @@ function createAnimationCV(camera, duration) { const tanPhi = Math.tan(camera.frustum.fovy * 0.5); const tanTheta = camera.frustum.aspectRatio * tanPhi; const distToC = Cartesian3.magnitude( - Cartesian3.subtract(position, center, scratchCartesian3Subtract) + Cartesian3.subtract(position, center, scratchCartesian3Subtract), ); const dWidth = tanTheta * distToC; const dHeight = tanPhi * distToC; @@ -3228,7 +3226,7 @@ function createAnimationCV(camera, duration) { center, maxX, maxY, - duration + duration, ); } } @@ -3386,20 +3384,20 @@ Camera.prototype.flyTo = function (options) { if (isRectangle) { destination = this.getRectangleCameraCoordinates( destination, - scratchFlyToDestination + scratchFlyToDestination, ); } let orientation = defaultValue( options.orientation, - defaultValue.EMPTY_OBJECT + defaultValue.EMPTY_OBJECT, ); if (defined(orientation.direction)) { orientation = directionUpToHeadingPitchRoll( this, destination, orientation, - scratchSetViewOptions.orientation + scratchSetViewOptions.orientation, ); } @@ -3468,11 +3466,12 @@ Camera.prototype.flyTo = function (options) { orientation: orientation, }); - this._scene.preloadFlightCullingVolume = preloadFlightCamera.frustum.computeCullingVolume( - preloadFlightCamera.positionWC, - preloadFlightCamera.directionWC, - preloadFlightCamera.upWC - ); + this._scene.preloadFlightCullingVolume = + preloadFlightCamera.frustum.computeCullingVolume( + preloadFlightCamera.positionWC, + preloadFlightCamera.directionWC, + preloadFlightCamera.upWC, + ); } }; @@ -3508,7 +3507,7 @@ const MINIMUM_ZOOM = 100.0; function adjustBoundingSphereOffset(camera, boundingSphere, offset) { offset = HeadingPitchRange.clone( - defined(offset) ? offset : Camera.DEFAULT_OFFSET + defined(offset) ? offset : Camera.DEFAULT_OFFSET, ); const minimumZoom = @@ -3560,7 +3559,7 @@ Camera.prototype.viewBoundingSphere = function (boundingSphere, offset) { if (this._mode === SceneMode.MORPHING) { throw new DeveloperError( - "viewBoundingSphere is not supported while morphing." + "viewBoundingSphere is not supported while morphing.", ); } //>>includeEnd('debug'); @@ -3617,7 +3616,7 @@ Camera.prototype.flyToBoundingSphere = function (boundingSphere, options) { const offset = adjustBoundingSphereOffset( this, boundingSphere, - options.offset + options.offset, ); let position; @@ -3625,13 +3624,13 @@ Camera.prototype.flyToBoundingSphere = function (boundingSphere, options) { position = Cartesian3.multiplyByScalar( Cartesian3.UNIT_Z, offset.range, - scratchflyToBoundingSphereDestination + scratchflyToBoundingSphereDestination, ); } else { position = offsetFromHeadingPitchRange( offset.heading, offset.pitch, - offset.range + offset.range, ); } @@ -3641,7 +3640,7 @@ Camera.prototype.flyToBoundingSphere = function (boundingSphere, options) { const transform = Transforms.eastNorthUpToFixedFrame( boundingSphere.center, ellipsoid, - scratchflyToBoundingSphereTransform + scratchflyToBoundingSphereTransform, ); Matrix4.multiplyByPoint(transform, position, position); @@ -3652,29 +3651,29 @@ Camera.prototype.flyToBoundingSphere = function (boundingSphere, options) { direction = Cartesian3.subtract( boundingSphere.center, position, - scratchflyToBoundingSphereDirection + scratchflyToBoundingSphereDirection, ); Cartesian3.normalize(direction, direction); up = Matrix4.multiplyByPointAsVector( transform, Cartesian3.UNIT_Z, - scratchflyToBoundingSphereUp + scratchflyToBoundingSphereUp, ); if (1.0 - Math.abs(Cartesian3.dot(direction, up)) < CesiumMath.EPSILON6) { const rotateQuat = Quaternion.fromAxisAngle( direction, offset.heading, - scratchFlyToBoundingSphereQuaternion + scratchFlyToBoundingSphereQuaternion, ); const rotation = Matrix3.fromQuaternion( rotateQuat, - scratchFlyToBoundingSphereMatrix3 + scratchFlyToBoundingSphereMatrix3, ); Cartesian3.fromCartesian4( Matrix4.getColumn(transform, 1, scratchFlyToBoundingSphereCart4), - up + up, ); Matrix3.multiplyByVector(rotation, up, up); } @@ -3682,7 +3681,7 @@ Camera.prototype.flyToBoundingSphere = function (boundingSphere, options) { const right = Cartesian3.cross( direction, up, - scratchflyToBoundingSphereRight + scratchflyToBoundingSphereRight, ); Cartesian3.cross(right, direction, up); Cartesian3.normalize(up, up); @@ -3725,7 +3724,7 @@ function computeHorizonQuad(camera, ellipsoid) { const q = Cartesian3.multiplyComponents( ellipsoid.oneOverRadii, p, - scratchCartesian3_1 + scratchCartesian3_1, ); const qMagnitude = Cartesian3.magnitude(q); @@ -3742,11 +3741,11 @@ function computeHorizonQuad(camera, ellipsoid) { } else { eUnit = Cartesian3.normalize( Cartesian3.cross(Cartesian3.UNIT_Z, qUnit, scratchCartesian3_3), - scratchCartesian3_3 + scratchCartesian3_3, ); nUnit = Cartesian3.normalize( Cartesian3.cross(qUnit, eUnit, scratchCartesian3_4), - scratchCartesian3_4 + scratchCartesian3_4, ); } @@ -3757,18 +3756,18 @@ function computeHorizonQuad(camera, ellipsoid) { const center = Cartesian3.multiplyByScalar( qUnit, 1.0 / qMagnitude, - scratchCartesian3_1 + scratchCartesian3_1, ); const scalar = wMagnitude / qMagnitude; const eastOffset = Cartesian3.multiplyByScalar( eUnit, scalar, - scratchCartesian3_2 + scratchCartesian3_2, ); const northOffset = Cartesian3.multiplyByScalar( nUnit, scalar, - scratchCartesian3_3 + scratchCartesian3_3, ); // A conservative measure for the longitudes would be to use the min/max longitudes of the bounding frustum. @@ -3805,7 +3804,7 @@ function addToResult(x, y, index, camera, ellipsoid, computedHorizonQuad) { const r = camera.pickEllipsoid( scratchPickCartesian2, ellipsoid, - scratchRectCartesian + scratchRectCartesian, ); if (defined(r)) { cartoArray[index] = ellipsoid.cartesianToCartographic(r, cartoArray[index]); @@ -3813,7 +3812,7 @@ function addToResult(x, y, index, camera, ellipsoid, computedHorizonQuad) { } cartoArray[index] = ellipsoid.cartesianToCartographic( computedHorizonQuad[index], - cartoArray[index] + cartoArray[index], ); return 0; } @@ -3830,11 +3829,11 @@ Camera.prototype.computeViewRectangle = function (ellipsoid, result) { const cullingVolume = this.frustum.computeCullingVolume( this.positionWC, this.directionWC, - this.upWC + this.upWC, ); const boundingSphere = new BoundingSphere( Cartesian3.ZERO, - ellipsoid.maximumRadius + ellipsoid.maximumRadius, ); const visibility = cullingVolume.computeVisibility(boundingSphere); if (visibility === Intersect.OUTSIDE) { @@ -3855,7 +3854,7 @@ Camera.prototype.computeViewRectangle = function (ellipsoid, result) { 0, this, ellipsoid, - computedHorizonQuad + computedHorizonQuad, ); successfulPickCount += addToResult( 0, @@ -3863,7 +3862,7 @@ Camera.prototype.computeViewRectangle = function (ellipsoid, result) { 1, this, ellipsoid, - computedHorizonQuad + computedHorizonQuad, ); successfulPickCount += addToResult( width, @@ -3871,7 +3870,7 @@ Camera.prototype.computeViewRectangle = function (ellipsoid, result) { 2, this, ellipsoid, - computedHorizonQuad + computedHorizonQuad, ); successfulPickCount += addToResult( width, @@ -3879,7 +3878,7 @@ Camera.prototype.computeViewRectangle = function (ellipsoid, result) { 3, this, ellipsoid, - computedHorizonQuad + computedHorizonQuad, ); if (successfulPickCount < 2) { @@ -3910,7 +3909,7 @@ Camera.prototype.computeViewRectangle = function (ellipsoid, result) { CesiumMath.equalsEpsilon( Math.abs(distance), CesiumMath.TWO_PI, - CesiumMath.EPSILON9 + CesiumMath.EPSILON9, ) ) { result.west = -CesiumMath.PI; diff --git a/packages/engine/Source/Scene/CameraEventAggregator.js b/packages/engine/Source/Scene/CameraEventAggregator.js index 67bf50bb8fc3..24a0be753884 100644 --- a/packages/engine/Source/Scene/CameraEventAggregator.js +++ b/packages/engine/Source/Scene/CameraEventAggregator.js @@ -19,20 +19,20 @@ function getKey(type, modifier) { function clonePinchMovement(pinchMovement, result) { Cartesian2.clone( pinchMovement.distance.startPosition, - result.distance.startPosition + result.distance.startPosition, ); Cartesian2.clone( pinchMovement.distance.endPosition, - result.distance.endPosition + result.distance.endPosition, ); Cartesian2.clone( pinchMovement.angleAndHeight.startPosition, - result.angleAndHeight.startPosition + result.angleAndHeight.startPosition, ); Cartesian2.clone( pinchMovement.angleAndHeight.endPosition, - result.angleAndHeight.endPosition + result.angleAndHeight.endPosition, ); } @@ -74,11 +74,11 @@ function listenToPinch(aggregator, modifier, canvas) { event.position1, event.position2, 0.5, - eventStartPosition[key] + eventStartPosition[key], ); }, ScreenSpaceEventType.PINCH_START, - modifier + modifier, ); aggregator._eventHandler.setInputAction( @@ -88,7 +88,7 @@ function listenToPinch(aggregator, modifier, canvas) { releaseTime[key] = new Date(); }, ScreenSpaceEventType.PINCH_END, - modifier + modifier, ); aggregator._eventHandler.setInputAction( @@ -98,11 +98,11 @@ function listenToPinch(aggregator, modifier, canvas) { if (!update[key]) { Cartesian2.clone( mouseMovement.distance.endPosition, - movement.distance.endPosition + movement.distance.endPosition, ); Cartesian2.clone( mouseMovement.angleAndHeight.endPosition, - movement.angleAndHeight.endPosition + movement.angleAndHeight.endPosition, ); } else { clonePinchMovement(mouseMovement, movement); @@ -126,7 +126,7 @@ function listenToPinch(aggregator, modifier, canvas) { } }, ScreenSpaceEventType.PINCH_MOVE, - modifier + modifier, ); } @@ -168,7 +168,7 @@ function listenToWheel(aggregator, modifier) { update[key] = false; }, ScreenSpaceEventType.WHEEL, - modifier + modifier, ); } @@ -213,7 +213,7 @@ function listenMouseButtonDownUp(aggregator, modifier, type) { Cartesian2.clone(event.position, eventStartPosition[key]); }, down, - modifier + modifier, ); aggregator._eventHandler.setInputAction( @@ -225,7 +225,7 @@ function listenMouseButtonDownUp(aggregator, modifier, type) { } }, up, - modifier + modifier, ); } @@ -319,7 +319,7 @@ function listenMouseMove(aggregator, modifier) { if (!update[key]) { Cartesian2.clone( mouseMovement.endPosition, - movement[key].endPosition + movement[key].endPosition, ); } else { cloneMouseMovement(movement[key], lastMovement[key]); @@ -334,11 +334,11 @@ function listenMouseMove(aggregator, modifier) { Cartesian2.clone( mouseMovement.endPosition, - aggregator._currentMousePosition + aggregator._currentMousePosition, ); }, ScreenSpaceEventType.MOUSE_MOVE, - modifier + modifier, ); } @@ -517,7 +517,7 @@ CameraEventAggregator.prototype.isButtonDown = function (type, modifier) { */ CameraEventAggregator.prototype.getStartMousePosition = function ( type, - modifier + modifier, ) { //>>includeStart('debug', pragmas.debug); if (!defined(type)) { @@ -560,7 +560,7 @@ CameraEventAggregator.prototype.getButtonPressTime = function (type, modifier) { */ CameraEventAggregator.prototype.getButtonReleaseTime = function ( type, - modifier + modifier, ) { //>>includeStart('debug', pragmas.debug); if (!defined(type)) { diff --git a/packages/engine/Source/Scene/CameraFlightPath.js b/packages/engine/Source/Scene/CameraFlightPath.js index 6d6a1aa29a73..3490f72f497f 100644 --- a/packages/engine/Source/Scene/CameraFlightPath.js +++ b/packages/engine/Source/Scene/CameraFlightPath.js @@ -46,7 +46,7 @@ function createPitchFunction( startPitch, endPitch, heightFunction, - pitchAdjustHeight + pitchAdjustHeight, ) { if (defined(pitchAdjustHeight) && heightFunction(0.5) > pitchAdjustHeight) { const startHeight = heightFunction(0.0); @@ -77,7 +77,7 @@ function createHeightFunction( destination, startHeight, endHeight, - optionAltitude + optionAltitude, ) { let altitude = optionAltitude; const maxHeight = Math.max(startHeight, endHeight); @@ -91,19 +91,19 @@ function createHeightFunction( const diff = Cartesian3.subtract(start, end, scratchCart); const verticalDistance = Cartesian3.magnitude( - Cartesian3.multiplyByScalar(up, Cartesian3.dot(diff, up), scratchCart2) + Cartesian3.multiplyByScalar(up, Cartesian3.dot(diff, up), scratchCart2), ); const horizontalDistance = Cartesian3.magnitude( Cartesian3.multiplyByScalar( right, Cartesian3.dot(diff, right), - scratchCart2 - ) + scratchCart2, + ), ); altitude = Math.min( getAltitude(frustum, verticalDistance, horizontalDistance) * 0.2, - 1000000000.0 + 1000000000.0, ); } @@ -130,7 +130,7 @@ function adjustAngleForLERP(startAngle, endAngle) { CesiumMath.equalsEpsilon( startAngle, CesiumMath.TWO_PI, - CesiumMath.EPSILON11 + CesiumMath.EPSILON11, ) ) { startAngle = 0.0; @@ -155,7 +155,7 @@ function createUpdateCV( pitch, roll, optionAltitude, - optionPitchAdjustHeight + optionPitchAdjustHeight, ) { const camera = scene.camera; @@ -169,14 +169,14 @@ function createUpdateCV( destination, start.z, destination.z, - optionAltitude + optionAltitude, ); const pitchFunction = createPitchFunction( startPitch, pitch, heightFunction, - optionPitchAdjustHeight + optionPitchAdjustHeight, ); function update(value) { @@ -226,7 +226,7 @@ function createUpdate3D( optionAltitude, optionFlyOverLongitude, optionFlyOverLongitudeWeight, - optionPitchAdjustHeight + optionPitchAdjustHeight, ) { const camera = scene.camera; const projection = scene.mapProjection; @@ -234,7 +234,7 @@ function createUpdate3D( const startCart = Cartographic.clone( camera.positionCartographic, - scratchStartCart + scratchStartCart, ); const startPitch = camera.pitch; const startHeading = adjustAngleForLERP(camera.heading, heading); @@ -242,7 +242,7 @@ function createUpdate3D( const destCart = ellipsoid.cartesianToCartographic( destination, - scratchEndCart + scratchEndCart, ); startCart.longitude = CesiumMath.zeroToTwoPi(startCart.longitude); destCart.longitude = CesiumMath.zeroToTwoPi(destCart.longitude); @@ -288,13 +288,13 @@ function createUpdate3D( destination, startCart.height, destCart.height, - optionAltitude + optionAltitude, ); const pitchFunction = createPitchFunction( startPitch, pitch, heightFunction, - optionPitchAdjustHeight + optionPitchAdjustHeight, ); // Isolate scope for update function. @@ -315,7 +315,7 @@ function createUpdate3D( CesiumMath.lerp(startLongitude, destLongitude, time), CesiumMath.lerp(startLatitude, destLatitude, time), heightFunction(time), - ellipsoid + ellipsoid, ); camera.setView({ @@ -338,7 +338,7 @@ function createUpdate2D( heading, pitch, roll, - optionAltitude + optionAltitude, ) { const camera = scene.camera; @@ -351,7 +351,7 @@ function createUpdate2D( destination, startHeight, destination.z, - optionAltitude + optionAltitude, ); function update(value) { @@ -470,7 +470,7 @@ CameraFlightPath.createTween = function (scene, options) { CesiumMath.equalsEpsilon( Math.max(frustum.right - frustum.left, frustum.top - frustum.bottom), destination.z, - CesiumMath.EPSILON6 + CesiumMath.EPSILON6, ); empty = @@ -479,7 +479,7 @@ CameraFlightPath.createTween = function (scene, options) { Cartesian3.equalsEpsilon( destination, camera.position, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, )); empty = @@ -487,17 +487,17 @@ CameraFlightPath.createTween = function (scene, options) { CesiumMath.equalsEpsilon( CesiumMath.negativePiToPi(heading), CesiumMath.negativePiToPi(camera.heading), - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ) && CesiumMath.equalsEpsilon( CesiumMath.negativePiToPi(pitch), CesiumMath.negativePiToPi(camera.pitch), - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ) && CesiumMath.equalsEpsilon( CesiumMath.negativePiToPi(roll), CesiumMath.negativePiToPi(camera.roll), - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); if (empty) { @@ -521,7 +521,7 @@ CameraFlightPath.createTween = function (scene, options) { maximumHeight, flyOverLongitude, flyOverLongitudeWeight, - pitchAdjustHeight + pitchAdjustHeight, ); update({ time: 1.0 }); @@ -542,7 +542,7 @@ CameraFlightPath.createTween = function (scene, options) { maximumHeight, flyOverLongitude, flyOverLongitudeWeight, - pitchAdjustHeight + pitchAdjustHeight, ); if (!defined(easingFunction)) { diff --git a/packages/engine/Source/Scene/Cesium3DTile.js b/packages/engine/Source/Scene/Cesium3DTile.js index 2d6a2d80974b..53e21c781f15 100644 --- a/packages/engine/Source/Scene/Cesium3DTile.js +++ b/packages/engine/Source/Scene/Cesium3DTile.js @@ -90,7 +90,7 @@ function Cesium3DTile(tileset, baseResource, header, parent) { const computedTransform = Matrix4.multiply( parentTransform, this.transform, - new Matrix4() + new Matrix4(), ); const parentInitialTransform = defined(parent) @@ -99,7 +99,7 @@ function Cesium3DTile(tileset, baseResource, header, parent) { this._initialTransform = Matrix4.multiply( parentInitialTransform, this.transform, - new Matrix4() + new Matrix4(), ); /** @@ -128,7 +128,7 @@ function Cesium3DTile(tileset, baseResource, header, parent) { // can override header.boundingVolume (if necessary) this._boundingVolume = this.createBoundingVolume( header.boundingVolume, - computedTransform + computedTransform, ); this._boundingVolume2D = undefined; @@ -142,7 +142,7 @@ function Cesium3DTile(tileset, baseResource, header, parent) { // outside of this box. contentBoundingVolume = this.createBoundingVolume( contentHeader.boundingVolume, - computedTransform + computedTransform, ); } this._contentBoundingVolume = contentBoundingVolume; @@ -152,7 +152,7 @@ function Cesium3DTile(tileset, baseResource, header, parent) { if (defined(header.viewerRequestVolume)) { viewerRequestVolume = this.createBoundingVolume( header.viewerRequestVolume, - computedTransform + computedTransform, ); } this._viewerRequestVolume = viewerRequestVolume; @@ -173,7 +173,7 @@ function Cesium3DTile(tileset, baseResource, header, parent) { : tileset._geometricError; Cesium3DTile._deprecationWarning( "geometricErrorUndefined", - "Required property geometricError is undefined for this tile. Using parent's geometric error instead." + "Required property geometricError is undefined for this tile. Using parent's geometric error instead.", ); } @@ -186,7 +186,7 @@ function Cesium3DTile(tileset, baseResource, header, parent) { "lowercase-refine", `This tile uses a lowercase refine "${ header.refine - }". Instead use "${header.refine.toUpperCase()}".` + }". Instead use "${header.refine.toUpperCase()}".`, ); } refine = @@ -248,14 +248,14 @@ function Cesium3DTile(tileset, baseResource, header, parent) { if (defined(contentHeader.url)) { Cesium3DTile._deprecationWarning( "contentUrl", - 'This tileset JSON uses the "content.url" property which has been deprecated. Use "content.uri" instead.' + 'This tileset JSON uses the "content.url" property which has been deprecated. Use "content.uri" instead.', ); contentHeaderUri = contentHeader.url; } if (contentHeaderUri === "") { Cesium3DTile._deprecationWarning( "contentUriEmpty", - "content.uri property is an empty string, which creates a circular dependency, making this tileset invalid. Omit the content property instead" + "content.uri property is an empty string, which creates a circular dependency, making this tileset invalid. Omit the content property instead", ); content = new Empty3DTileContent(tileset, this); hasEmptyContent = true; @@ -266,7 +266,7 @@ function Cesium3DTile(tileset, baseResource, header, parent) { url: contentHeaderUri, }); serverKey = RequestScheduler.getServerKey( - contentResource.getUrlComponent() + contentResource.getUrlComponent(), ); } } else { @@ -811,18 +811,18 @@ function isPriorityDeferred(tile, frameState) { const scaledCameraDirection = Cartesian3.multiplyByScalar( camera.directionWC, tile._centerZDepth, - scratchCartesian + scratchCartesian, ); const closestPointOnLine = Cartesian3.add( camera.positionWC, scaledCameraDirection, - scratchCartesian + scratchCartesian, ); // The distance from the camera's view direction to the tile. const toLine = Cartesian3.subtract( closestPointOnLine, center, - scratchCartesian + scratchCartesian, ); const distanceToCenterLine = Cartesian3.magnitude(toLine); const notTouchingSphere = distanceToCenterLine > radius; @@ -836,21 +836,21 @@ function isPriorityDeferred(tile, frameState) { const scaledToLine = Cartesian3.multiplyByScalar( toLineNormalized, radius, - scratchCartesian + scratchCartesian, ); const closestOnSphere = Cartesian3.add( center, scaledToLine, - scratchCartesian + scratchCartesian, ); const toClosestOnSphere = Cartesian3.subtract( closestOnSphere, camera.positionWC, - scratchCartesian + scratchCartesian, ); const toClosestOnSphereNormalize = Cartesian3.normalize( toClosestOnSphere, - scratchCartesian + scratchCartesian, ); tile._foveatedFactor = 1.0 - @@ -887,12 +887,12 @@ function isPriorityDeferred(tile, frameState) { const normalizedFoveatedFactor = CesiumMath.clamp( (tile._foveatedFactor - foveatedConeFactor) / range, 0.0, - 1.0 + 1.0, ); const sseRelaxation = tileset.foveatedInterpolationCallback( tileset.foveatedMinimumScreenSpaceErrorRelaxation, tileset.memoryAdjustedScreenSpaceError, - normalizedFoveatedFactor + normalizedFoveatedFactor, ); const sse = tile._screenSpaceError === 0.0 && defined(tile.parent) @@ -915,7 +915,7 @@ const scratchJulianDate = new JulianDate(); Cesium3DTile.prototype.getScreenSpaceError = function ( frameState, useParentGeometricError, - progressiveResolutionHeightFraction + progressiveResolutionHeightFraction, ) { const tileset = this._tileset; const heightFraction = defaultValue(progressiveResolutionHeightFraction, 1.0); @@ -1042,21 +1042,21 @@ Cesium3DTile.prototype.updateVisibility = function (frameState) { this._screenSpaceErrorProgressiveResolution = this.getScreenSpaceError( frameState, false, - tileset.progressiveResolutionHeightFraction + tileset.progressiveResolutionHeightFraction, ); this._visibilityPlaneMask = this.visibility( frameState, - parentVisibilityPlaneMask + parentVisibilityPlaneMask, ); // Use parent's plane mask to speed up visibility test this._visible = this._visibilityPlaneMask !== CullingVolume.MASK_OUTSIDE; this._inRequestVolume = this.insideViewerRequestVolume(frameState); this._priorityReverseScreenSpaceError = getPriorityReverseScreenSpaceError( tileset, - this + this, ); this._priorityProgressiveResolution = isPriorityProgressiveResolution( tileset, - this + this, ); this.priorityDeferred = isPriorityDeferred(this, frameState); @@ -1095,7 +1095,7 @@ function updateExpireDate(tile) { JulianDate.addSeconds( expireDurationDate, tile.expireDuration, - expireDurationDate + expireDurationDate, ); if (defined(tile.expireDate)) { @@ -1169,7 +1169,7 @@ function requestMultipleContents(tile) { tileset, tile, tile._contentResource.clone(), - contentsJson + contentsJson, ); tile._content = multipleContents; } @@ -1213,7 +1213,7 @@ async function processArrayBuffer( tileset, request, expired, - requestPromise + requestPromise, ) { const previousState = tile._contentState; tile._contentState = Cesium3DTileContentState.LOADING; @@ -1365,8 +1365,8 @@ async function makeContent(tile, arrayBuffer) { tile, tile._contentResource, preprocessed.binaryPayload.buffer, - 0 - ) + 0, + ), ); } else { // JSON formats @@ -1375,8 +1375,8 @@ async function makeContent(tile, arrayBuffer) { tileset, tile, tile._contentResource, - preprocessed.jsonPayload - ) + preprocessed.jsonPayload, + ), ); } @@ -1461,11 +1461,11 @@ function getBoundingVolume(tile, frameState) { const sphere = BoundingSphere.projectTo2D( boundingSphere, frameState.mapProjection, - scratchProjectedBoundingSphere + scratchProjectedBoundingSphere, ); tile._boundingVolume2D = new TileBoundingSphere( sphere.center, - sphere.radius + sphere.radius, ); } @@ -1489,11 +1489,11 @@ function getContentBoundingVolume(tile, frameState) { const sphere = BoundingSphere.projectTo2D( boundingSphere, frameState.mapProjection, - scratchProjectedBoundingSphere + scratchProjectedBoundingSphere, ); tile._contentBoundingVolume2D = new TileBoundingSphere( sphere.center, - sphere.radius + sphere.radius, ); } return frameState.mode !== SceneMode.SCENE3D @@ -1512,7 +1512,7 @@ function getContentBoundingVolume(tile, frameState) { */ Cesium3DTile.prototype.visibility = function ( frameState, - parentVisibilityPlaneMask + parentVisibilityPlaneMask, ) { const cullingVolume = frameState.cullingVolume; const boundingVolume = getBoundingVolume(this, frameState); @@ -1522,7 +1522,7 @@ Cesium3DTile.prototype.visibility = function ( if (defined(clippingPlanes) && clippingPlanes.enabled) { const intersection = clippingPlanes.computeIntersectionWithBoundingVolume( boundingVolume, - tileset.clippingPlanesOriginMatrix + tileset.clippingPlanesOriginMatrix, ); this._isClipped = intersection !== Intersect.INSIDE; if (intersection === Intersect.OUTSIDE) { @@ -1532,9 +1532,8 @@ Cesium3DTile.prototype.visibility = function ( const clippingPolygons = tileset.clippingPolygons; if (defined(clippingPolygons) && clippingPolygons.enabled) { - const intersection = clippingPolygons.computeIntersectionWithBoundingVolume( - boundingVolume - ); + const intersection = + clippingPolygons.computeIntersectionWithBoundingVolume(boundingVolume); this._isClippedByPolygon = intersection !== Intersect.OUTSIDE; // Polygon clipping intersections are determined by outer rectangles, therefore we cannot @@ -1543,7 +1542,7 @@ Cesium3DTile.prototype.visibility = function ( return cullingVolume.computeVisibilityWithPlaneMask( boundingVolume, - parentVisibilityPlaneMask + parentVisibilityPlaneMask, ); }; @@ -1579,7 +1578,7 @@ Cesium3DTile.prototype.contentVisibility = function (frameState) { if (defined(clippingPlanes) && clippingPlanes.enabled) { const intersection = clippingPlanes.computeIntersectionWithBoundingVolume( boundingVolume, - tileset.clippingPlanesOriginMatrix + tileset.clippingPlanesOriginMatrix, ); this._isClipped = intersection !== Intersect.INSIDE; if (intersection === Intersect.OUTSIDE) { @@ -1589,9 +1588,8 @@ Cesium3DTile.prototype.contentVisibility = function (frameState) { const clippingPolygons = tileset.clippingPolygons; if (defined(clippingPolygons) && clippingPolygons.enabled) { - const intersection = clippingPolygons.computeIntersectionWithBoundingVolume( - boundingVolume - ); + const intersection = + clippingPolygons.computeIntersectionWithBoundingVolume(boundingVolume); this._isClippedByPolygon = intersection !== Intersect.OUTSIDE; if (intersection === Intersect.INSIDE) { return Intersect.OUTSIDE; @@ -1630,7 +1628,7 @@ Cesium3DTile.prototype.distanceToTileCenter = function (frameState) { const toCenter = Cartesian3.subtract( boundingVolume.center, frameState.camera.positionWC, - scratchToTileCenter + scratchToTileCenter, ); return Cartesian3.dot(frameState.camera.directionWC, toCenter); }; @@ -1694,7 +1692,7 @@ function createBoxFromTransformedRegion( region, transform, initialTransform, - result + result, ) { const rectangle = Rectangle.unpack(region, 0, scratchRectangle); const minimumHeight = region[4]; @@ -1705,7 +1703,7 @@ function createBoxFromTransformedRegion( minimumHeight, maximumHeight, Ellipsoid.WGS84, - scratchOrientedBoundingBox + scratchOrientedBoundingBox, ); let center = orientedBoundingBox.center; let halfAxes = orientedBoundingBox.halfAxes; @@ -1716,7 +1714,7 @@ function createBoxFromTransformedRegion( transform = Matrix4.multiplyTransformation( transform, Matrix4.inverseTransformation(initialTransform, scratchTransform), - scratchTransform + scratchTransform, ); center = Matrix4.multiplyByPoint(transform, center, center); const rotationScale = Matrix4.getMatrix3(transform, scratchMatrix); @@ -1746,7 +1744,7 @@ function createRegion(region, transform, initialTransform, result) { region, transform, initialTransform, - result + result, ); } @@ -1781,7 +1779,7 @@ function createSphere(sphere, transform, result) { sphere[0], sphere[1], sphere[2], - scratchCenter + scratchCenter, ); let radius = sphere[3]; @@ -1812,17 +1810,15 @@ function createSphere(sphere, transform, result) { Cesium3DTile.prototype.createBoundingVolume = function ( boundingVolumeHeader, transform, - result + result, ) { // if explicit tile metadata includes TILE_BOUNDING_BOX, TILE_BOUNDING_REGION, // or TILE_BOUNDING_SPHERE, override tile.boundingVolume. const tileMetadata = this.metadata; let metadataBoundingVolumeHeader; if (defined(tileMetadata)) { - metadataBoundingVolumeHeader = BoundingVolumeSemantics.parseBoundingVolumeSemantic( - "TILE", - tileMetadata - ); + metadataBoundingVolumeHeader = + BoundingVolumeSemantics.parseBoundingVolumeSemantic("TILE", tileMetadata); } if (defined(metadataBoundingVolumeHeader)) { boundingVolumeHeader = metadataBoundingVolumeHeader; @@ -1834,7 +1830,7 @@ Cesium3DTile.prototype.createBoundingVolume = function ( if (hasExtension(boundingVolumeHeader, "3DTILES_bounding_volume_S2")) { return new TileBoundingS2Cell( - boundingVolumeHeader.extensions["3DTILES_bounding_volume_S2"] + boundingVolumeHeader.extensions["3DTILES_bounding_volume_S2"], ); } @@ -1845,7 +1841,7 @@ Cesium3DTile.prototype.createBoundingVolume = function ( exaggerateBoundingBox( tileOrientedBoundingBox, this._verticalExaggeration, - this._verticalExaggerationRelativeHeight + this._verticalExaggerationRelativeHeight, ); } return tileOrientedBoundingBox; @@ -1855,7 +1851,7 @@ Cesium3DTile.prototype.createBoundingVolume = function ( region, transform, this._initialTransform, - result + result, ); if (this._verticalExaggeration === 1.0) { return tileBoundingVolume; @@ -1864,18 +1860,18 @@ Cesium3DTile.prototype.createBoundingVolume = function ( exaggerateBoundingBox( tileBoundingVolume, this._verticalExaggeration, - this._verticalExaggerationRelativeHeight + this._verticalExaggerationRelativeHeight, ); } else { tileBoundingVolume.minimumHeight = VerticalExaggeration.getHeight( tileBoundingVolume.minimumHeight, this._verticalExaggeration, - this._verticalExaggerationRelativeHeight + this._verticalExaggerationRelativeHeight, ); tileBoundingVolume.maximumHeight = VerticalExaggeration.getHeight( tileBoundingVolume.maximumHeight, this._verticalExaggeration, - this._verticalExaggerationRelativeHeight + this._verticalExaggerationRelativeHeight, ); tileBoundingVolume.computeBoundingVolumes(Ellipsoid.WGS84); } @@ -1889,7 +1885,7 @@ Cesium3DTile.prototype.createBoundingVolume = function ( Ellipsoid.WGS84, this._verticalExaggeration, this._verticalExaggerationRelativeHeight, - scratchCenter + scratchCenter, ); const exaggeratedRadius = tileBoundingSphere.radius * this._verticalExaggeration; @@ -1898,12 +1894,12 @@ Cesium3DTile.prototype.createBoundingVolume = function ( return tileBoundingSphere; } throw new RuntimeError( - "boundingVolume must contain a sphere, region, or box" + "boundingVolume must contain a sphere, region, or box", ); }; const scratchExaggeratedCorners = Cartesian3.unpackArray( - new Array(8 * 3).fill(0) + new Array(8 * 3).fill(0), ); /** @@ -1917,7 +1913,7 @@ const scratchExaggeratedCorners = Cartesian3.unpackArray( function exaggerateBoundingBox( tileOrientedBoundingBox, exaggeration, - exaggerationRelativeHeight + exaggerationRelativeHeight, ) { const exaggeratedCorners = tileOrientedBoundingBox.boundingVolume .computeCorners(scratchExaggeratedCorners) @@ -1927,16 +1923,16 @@ function exaggerateBoundingBox( Ellipsoid.WGS84, exaggeration, exaggerationRelativeHeight, - corner - ) + corner, + ), ); const exaggeratedBox = OrientedBoundingBox.fromPoints( exaggeratedCorners, - scratchOrientedBoundingBox + scratchOrientedBoundingBox, ); tileOrientedBoundingBox.update( exaggeratedBox.center, - exaggeratedBox.halfAxes + exaggeratedBox.halfAxes, ); } @@ -1949,17 +1945,17 @@ function exaggerateBoundingBox( */ Cesium3DTile.prototype.updateTransform = function ( parentTransform, - frameState + frameState, ) { parentTransform = defaultValue(parentTransform, Matrix4.IDENTITY); const computedTransform = Matrix4.multiplyTransformation( parentTransform, this.transform, - scratchTransform + scratchTransform, ); const transformChanged = !Matrix4.equals( computedTransform, - this.computedTransform + this.computedTransform, ); const exaggerationChanged = defined(frameState) && @@ -1985,20 +1981,20 @@ Cesium3DTile.prototype.updateTransform = function ( this._boundingVolume = this.createBoundingVolume( header.boundingVolume, this.computedTransform, - this._boundingVolume + this._boundingVolume, ); if (defined(this._contentBoundingVolume)) { this._contentBoundingVolume = this.createBoundingVolume( contentHeader.boundingVolume, this.computedTransform, - this._contentBoundingVolume + this._contentBoundingVolume, ); } if (defined(this._viewerRequestVolume)) { this._viewerRequestVolume = this.createBoundingVolume( header.viewerRequestVolume, this.computedTransform, - this._viewerRequestVolume + this._viewerRequestVolume, ); } @@ -2057,12 +2053,11 @@ function applyDebugSettings(tile, tileset, frameState, passOptions) { tile._debugBoundingVolume = tile._boundingVolume.createDebugVolume(color); } tile._debugBoundingVolume.update(frameState); - const attributes = tile._debugBoundingVolume.getGeometryInstanceAttributes( - "outline" - ); + const attributes = + tile._debugBoundingVolume.getGeometryInstanceAttributes("outline"); attributes.color = ColorGeometryInstanceAttribute.toValue( color, - attributes.color + attributes.color, ); } else if (!showVolume && defined(tile._debugBoundingVolume)) { tile._debugBoundingVolume = tile._debugBoundingVolume.destroy(); @@ -2070,16 +2065,16 @@ function applyDebugSettings(tile, tileset, frameState, passOptions) { if (tileset.debugShowContentBoundingVolume && hasContentBoundingVolume) { if (!defined(tile._debugContentBoundingVolume)) { - tile._debugContentBoundingVolume = tile._contentBoundingVolume.createDebugVolume( - Color.BLUE - ); + tile._debugContentBoundingVolume = + tile._contentBoundingVolume.createDebugVolume(Color.BLUE); } tile._debugContentBoundingVolume.update(frameState); } else if ( !tileset.debugShowContentBoundingVolume && defined(tile._debugContentBoundingVolume) ) { - tile._debugContentBoundingVolume = tile._debugContentBoundingVolume.destroy(); + tile._debugContentBoundingVolume = + tile._debugContentBoundingVolume.destroy(); } if ( @@ -2087,9 +2082,8 @@ function applyDebugSettings(tile, tileset, frameState, passOptions) { defined(tile._viewerRequestVolume) ) { if (!defined(tile._debugViewerRequestVolume)) { - tile._debugViewerRequestVolume = tile._viewerRequestVolume.createDebugVolume( - Color.YELLOW - ); + tile._debugViewerRequestVolume = + tile._viewerRequestVolume.createDebugVolume(Color.YELLOW); } tile._debugViewerRequestVolume.update(frameState); } else if ( @@ -2314,7 +2308,7 @@ function priorityNormalizeAndClamp(value, minimum, maximum) { // Subtract epsilon since we only want decimal digits present in the output. return Math.max( CesiumMath.normalize(value, minimum, maximum) - CesiumMath.EPSILON7, - 0.0 + 0.0, ); } @@ -2352,7 +2346,7 @@ Cesium3DTile.prototype.updatePriority = function () { const preloadProgressiveResolutionDigitsCount = digitsForABoolean; const preloadProgressiveResolutionScale = Math.pow( 10, - preloadProgressiveResolutionLeftShift + preloadProgressiveResolutionLeftShift, ); const foveatedDeferLeftShift = @@ -2369,7 +2363,7 @@ Cesium3DTile.prototype.updatePriority = function () { let depthDigits = priorityNormalizeAndClamp( this._depth, minimumPriority.depth, - maximumPriority.depth + maximumPriority.depth, ); depthDigits = preferLeaves ? 1.0 - depthDigits : depthDigits; @@ -2381,17 +2375,17 @@ Cesium3DTile.prototype.updatePriority = function () { ? priorityNormalizeAndClamp( this._priorityHolder._distanceToCamera, minimumPriority.distance, - maximumPriority.distance + maximumPriority.distance, ) : priorityNormalizeAndClamp( this._priorityReverseScreenSpaceError, minimumPriority.reverseScreenSpaceError, - maximumPriority.reverseScreenSpaceError + maximumPriority.reverseScreenSpaceError, ); const preferredSortingDigits = isolateDigits( normalizedPreferredSorting, preferredSortingDigitsCount, - preferredSortingLeftShift + preferredSortingLeftShift, ); const preloadProgressiveResolutionDigits = this._priorityProgressiveResolution @@ -2401,12 +2395,12 @@ Cesium3DTile.prototype.updatePriority = function () { const normalizedFoveatedFactor = priorityNormalizeAndClamp( this._priorityHolder._foveatedFactor, minimumPriority.foveatedFactor, - maximumPriority.foveatedFactor + maximumPriority.foveatedFactor, ); const foveatedDigits = isolateDigits( normalizedFoveatedFactor, foveatedDigitsCount, - foveatedLeftShift + foveatedLeftShift, ); const foveatedDeferDigits = this.priorityDeferred ? foveatedDeferScale : 0; diff --git a/packages/engine/Source/Scene/Cesium3DTileBatchTable.js b/packages/engine/Source/Scene/Cesium3DTileBatchTable.js index b9a678cdd8c5..5bb9f4f3ac42 100644 --- a/packages/engine/Source/Scene/Cesium3DTileBatchTable.js +++ b/packages/engine/Source/Scene/Cesium3DTileBatchTable.js @@ -37,7 +37,7 @@ function Cesium3DTileBatchTable( featuresLength, batchTableJson, batchTableBinary, - colorChangedCallback + colorChangedCallback, ) { /** * @readonly @@ -56,17 +56,16 @@ function Cesium3DTileBatchTable( this._batchTableHierarchy = initializeHierarchy( this, batchTableJson, - batchTableBinary + batchTableBinary, ); const binaryProperties = getBinaryProperties( featuresLength, properties, - batchTableBinary - ); - this._binaryPropertiesByteLength = countBinaryPropertyMemory( - binaryProperties + batchTableBinary, ); + this._binaryPropertiesByteLength = + countBinaryPropertyMemory(binaryProperties); this._batchTableBinaryProperties = binaryProperties; this._content = content; @@ -139,7 +138,7 @@ function initializeHierarchy(batchTable, jsonHeader, binaryBody) { if (defined(legacyHierarchy)) { Cesium3DTileBatchTable._deprecationWarning( "batchTableHierarchyExtension", - "The batch table HIERARCHY property has been moved to an extension. Use extensions.3DTILES_batch_table_hierarchy instead." + "The batch table HIERARCHY property has been moved to an extension. Use extensions.3DTILES_batch_table_hierarchy instead.", ); batchTable._extensions["3DTILES_batch_table_hierarchy"] = legacyHierarchy; hierarchy = legacyHierarchy; @@ -173,7 +172,7 @@ function getBinaryProperties(featuresLength, properties, binaryBody) { } if (!defined(binaryBody)) { throw new RuntimeError( - `Property ${name} requires a batch table binary.` + `Property ${name} requires a batch table binary.`, ); } @@ -183,7 +182,7 @@ function getBinaryProperties(featuresLength, properties, binaryBody) { const typedArray = binaryAccessor.createArrayBufferView( binaryBody.buffer, binaryBody.byteOffset + byteOffset, - featuresLength + featuresLength, ); if (!defined(binaryProperties)) { @@ -220,7 +219,7 @@ function countBinaryPropertyMemory(binaryProperties) { Cesium3DTileBatchTable.getBinaryProperties = function ( featuresLength, batchTableJson, - batchTableBinary + batchTableBinary, ) { return getBinaryProperties(featuresLength, batchTableJson, batchTableBinary); }; @@ -269,7 +268,7 @@ Cesium3DTileBatchTable.prototype.applyStyle = function (style) { const color = defined(style.color) ? defaultValue( style.color.evaluateColor(feature, scratchColor), - DEFAULT_COLOR_VALUE + DEFAULT_COLOR_VALUE, ) : DEFAULT_COLOR_VALUE; const show = defined(style.show) @@ -303,7 +302,7 @@ function checkBatchId(batchId, featuresLength) { if (!defined(batchId) || batchId < 0 || batchId >= featuresLength) { throw new DeveloperError( `batchId is required and must be between zero and featuresLength - 1 (${featuresLength}` - - +")." + +").", ); } } @@ -378,7 +377,7 @@ Cesium3DTileBatchTable.prototype.getPropertyIds = function (batchId, results) { if (defined(this._batchTableHierarchy)) { results.push.apply( results, - this._batchTableHierarchy.getPropertyIds(batchId, scratchPropertyIds) + this._batchTableHierarchy.getPropertyIds(batchId, scratchPropertyIds), ); } @@ -390,7 +389,7 @@ Cesium3DTileBatchTable.prototype.getPropertyIds = function (batchId, results) { */ Cesium3DTileBatchTable.prototype.getPropertyBySemantic = function ( batchId, - name + name, ) { // Cesium 3D Tiles 1.0 formats do not have semantics return undefined; @@ -417,7 +416,7 @@ Cesium3DTileBatchTable.prototype.getProperty = function (batchId, name) { if (defined(this._batchTableHierarchy)) { const hierarchyProperty = this._batchTableHierarchy.getProperty( batchId, - name + name, ); if (defined(hierarchyProperty)) { return hierarchyProperty; @@ -491,7 +490,7 @@ function getGlslComputeSt(batchTable) { Cesium3DTileBatchTable.prototype.getVertexShaderCallback = function ( handleTranslucent, batchIdAttributeName, - diffuseAttributeOrUniformName + diffuseAttributeOrUniformName, ) { if (this.featuresLength === 0) { return; @@ -504,7 +503,7 @@ Cesium3DTileBatchTable.prototype.getVertexShaderCallback = function ( const renamedSource = modifyDiffuse( source, diffuseAttributeOrUniformName, - false + false, ); let newMain; @@ -636,7 +635,7 @@ function modifyDiffuse(source, diffuseAttributeOrUniformName, applyHighlight) { // uniform vec3 u_diffuseColor; // uniform sampler2D diffuseTexture; let regex = new RegExp( - `(uniform|attribute|in)\\s+(vec[34]|sampler2D)\\s+${diffuseAttributeOrUniformName};` + `(uniform|attribute|in)\\s+(vec[34]|sampler2D)\\s+${diffuseAttributeOrUniformName};`, ); const uniformMatch = source.match(regex); @@ -716,7 +715,7 @@ function modifyDiffuse(source, diffuseAttributeOrUniformName, applyHighlight) { Cesium3DTileBatchTable.prototype.getFragmentShaderCallback = function ( handleTranslucent, diffuseAttributeOrUniformName, - hasPremultipliedAlpha + hasPremultipliedAlpha, ) { if (this.featuresLength === 0) { return; @@ -784,43 +783,44 @@ Cesium3DTileBatchTable.prototype.getFragmentShaderCallback = function ( }; }; -Cesium3DTileBatchTable.prototype.getClassificationFragmentShaderCallback = function () { - if (this.featuresLength === 0) { - return; - } - return function (source) { - source = ShaderSource.replaceMain(source, "tile_main"); - if (ContextLimits.maximumVertexTextureImageUnits > 0) { - // When VTF is supported, per-feature show/hide already happened in the fragment shader - source += - "uniform sampler2D tile_pickTexture;\n" + - "in vec2 tile_featureSt; \n" + - "in vec4 tile_featureColor; \n" + - "void main() \n" + - "{ \n" + - " tile_main(); \n" + - " out_FragColor = tile_featureColor; \n" + - " out_FragColor.rgb *= out_FragColor.a; \n" + - "}"; - } else { - source += - "uniform sampler2D tile_batchTexture; \n" + - "uniform sampler2D tile_pickTexture;\n" + - "in vec2 tile_featureSt; \n" + - "void main() \n" + - "{ \n" + - " tile_main(); \n" + - " vec4 featureProperties = texture(tile_batchTexture, tile_featureSt); \n" + - " if (featureProperties.a == 0.0) { \n" + // show: alpha == 0 - false, non-zero - true - " discard; \n" + - " } \n" + - " out_FragColor = featureProperties; \n" + - " out_FragColor.rgb *= out_FragColor.a; \n" + - "} \n"; +Cesium3DTileBatchTable.prototype.getClassificationFragmentShaderCallback = + function () { + if (this.featuresLength === 0) { + return; } - return source; + return function (source) { + source = ShaderSource.replaceMain(source, "tile_main"); + if (ContextLimits.maximumVertexTextureImageUnits > 0) { + // When VTF is supported, per-feature show/hide already happened in the fragment shader + source += + "uniform sampler2D tile_pickTexture;\n" + + "in vec2 tile_featureSt; \n" + + "in vec4 tile_featureColor; \n" + + "void main() \n" + + "{ \n" + + " tile_main(); \n" + + " out_FragColor = tile_featureColor; \n" + + " out_FragColor.rgb *= out_FragColor.a; \n" + + "}"; + } else { + source += + "uniform sampler2D tile_batchTexture; \n" + + "uniform sampler2D tile_pickTexture;\n" + + "in vec2 tile_featureSt; \n" + + "void main() \n" + + "{ \n" + + " tile_main(); \n" + + " vec4 featureProperties = texture(tile_batchTexture, tile_featureSt); \n" + + " if (featureProperties.a == 0.0) { \n" + // show: alpha == 0 - false, non-zero - true + " discard; \n" + + " } \n" + + " out_FragColor = featureProperties; \n" + + " out_FragColor.rgb *= out_FragColor.a; \n" + + "} \n"; + } + return source; + }; }; -}; function getColorBlend(batchTable) { const tileset = batchTable._content.tileset; @@ -853,7 +853,7 @@ Cesium3DTileBatchTable.prototype.getUniformMapCallback = function () { // PERFORMANCE_IDEA: we could also use a custom shader that avoids the texture read. return defaultValue( that._batchTexture.batchTexture, - that._batchTexture.defaultTexture + that._batchTexture.defaultTexture, ); }, tile_textureDimensions: function () { @@ -888,7 +888,7 @@ const StyleCommandsNeeded = { Cesium3DTileBatchTable.prototype.addDerivedCommands = function ( frameState, - commandStart + commandStart, ) { const commandList = frameState.commandList; const commandEnd = commandList.length; @@ -938,7 +938,7 @@ Cesium3DTileBatchTable.prototype.addDerivedCommands = function ( if (!defined(derivedCommands.zback)) { derivedCommands.zback = deriveZBackfaceCommand( frameState.context, - originalCommand + originalCommand, ); } tileset._backfaceCommands.push(derivedCommands.zback); @@ -951,7 +951,7 @@ Cesium3DTileBatchTable.prototype.addDerivedCommands = function ( if (command.renderState.depthMask) { derivedCommands.stencil = deriveStencilCommand( originalCommand, - tile._selectionDepth + tile._selectionDepth, ); } else { // Ignore if tile does not write depth @@ -1043,7 +1043,7 @@ function deriveOpaqueCommand(command) { function getLogDepthPolygonOffsetFragmentShaderProgram(context, shaderProgram) { let shader = context.shaderCache.getDerivedShaderProgram( shaderProgram, - "zBackfaceLogDepth" + "zBackfaceLogDepth", ); if (!defined(shader)) { const fs = shaderProgram.fragmentShaderSource.clone(); @@ -1057,7 +1057,7 @@ function getLogDepthPolygonOffsetFragmentShaderProgram(context, shaderProgram) { vertexShaderSource: shaderProgram.vertexShaderSource, fragmentShaderSource: fs, attributeLocations: shaderProgram._attributeLocations, - } + }, ); } @@ -1103,7 +1103,7 @@ function deriveZBackfaceCommand(context, command) { // tiles to disappear. derivedCommand.shaderProgram = getLogDepthPolygonOffsetFragmentShaderProgram( context, - command.shaderProgram + command.shaderProgram, ); return derivedCommand; } diff --git a/packages/engine/Source/Scene/Cesium3DTileContentFactory.js b/packages/engine/Source/Scene/Cesium3DTileContentFactory.js index 281235e37778..7c18fdb7a19f 100644 --- a/packages/engine/Source/Scene/Cesium3DTileContentFactory.js +++ b/packages/engine/Source/Scene/Cesium3DTileContentFactory.js @@ -18,7 +18,7 @@ const Cesium3DTileContentFactory = { tile, resource, arrayBuffer, - byteOffset + byteOffset, ); }, pnts: function (tileset, tile, resource, arrayBuffer, byteOffset) { @@ -27,7 +27,7 @@ const Cesium3DTileContentFactory = { tile, resource, arrayBuffer, - byteOffset + byteOffset, ); }, i3dm: function (tileset, tile, resource, arrayBuffer, byteOffset) { @@ -36,7 +36,7 @@ const Cesium3DTileContentFactory = { tile, resource, arrayBuffer, - byteOffset + byteOffset, ); }, cmpt: function (tileset, tile, resource, arrayBuffer, byteOffset) { @@ -47,7 +47,7 @@ const Cesium3DTileContentFactory = { resource, arrayBuffer, byteOffset, - Cesium3DTileContentFactory + Cesium3DTileContentFactory, ); }, externalTileset: function (tileset, tile, resource, json) { @@ -59,7 +59,7 @@ const Cesium3DTileContentFactory = { tile, resource, arrayBuffer, - byteOffset + byteOffset, ); }, vctr: function (tileset, tile, resource, arrayBuffer, byteOffset) { @@ -68,7 +68,7 @@ const Cesium3DTileContentFactory = { tile, resource, arrayBuffer, - byteOffset + byteOffset, ); }, subt: function (tileset, tile, resource, arrayBuffer, byteOffset) { @@ -78,7 +78,7 @@ const Cesium3DTileContentFactory = { resource, undefined, arrayBuffer, - byteOffset + byteOffset, ); }, subtreeJson: function (tileset, tile, resource, json) { diff --git a/packages/engine/Source/Scene/Cesium3DTileFeature.js b/packages/engine/Source/Scene/Cesium3DTileFeature.js index 49d3dd06e1c8..037de779ad92 100644 --- a/packages/engine/Source/Scene/Cesium3DTileFeature.js +++ b/packages/engine/Source/Scene/Cesium3DTileFeature.js @@ -361,7 +361,7 @@ Cesium3DTileFeature.prototype.getPropertyInherited = function (name) { return Cesium3DTileFeature.getPropertyInherited( this._content, this._batchId, - name + name, ); }; diff --git a/packages/engine/Source/Scene/Cesium3DTileFeatureTable.js b/packages/engine/Source/Scene/Cesium3DTileFeatureTable.js index a503ba18fc1c..a691d9ec1792 100644 --- a/packages/engine/Source/Scene/Cesium3DTileFeatureTable.js +++ b/packages/engine/Source/Scene/Cesium3DTileFeatureTable.js @@ -18,7 +18,7 @@ function getTypedArrayFromBinary( componentType, componentLength, count, - byteOffset + byteOffset, ) { const cachedTypedArrays = featureTable._cachedTypedArrays; let typedArray = cachedTypedArrays[semantic]; @@ -27,7 +27,7 @@ function getTypedArrayFromBinary( componentType, featureTable.buffer.buffer, featureTable.buffer.byteOffset + byteOffset, - count * componentLength + count * componentLength, ); cachedTypedArrays[semantic] = typedArray; } @@ -47,7 +47,7 @@ function getTypedArrayFromArray(featureTable, semantic, componentType, array) { Cesium3DTileFeatureTable.prototype.getGlobalProperty = function ( semantic, componentType, - componentLength + componentLength, ) { const jsonValue = this.json[semantic]; if (!defined(jsonValue)) { @@ -63,7 +63,7 @@ Cesium3DTileFeatureTable.prototype.getGlobalProperty = function ( componentType, componentLength, 1, - jsonValue.byteOffset + jsonValue.byteOffset, ); } @@ -77,7 +77,7 @@ Cesium3DTileFeatureTable.prototype.hasProperty = function (semantic) { Cesium3DTileFeatureTable.prototype.getPropertyArray = function ( semantic, componentType, - componentLength + componentLength, ) { const jsonValue = this.json[semantic]; if (!defined(jsonValue)) { @@ -94,7 +94,7 @@ Cesium3DTileFeatureTable.prototype.getPropertyArray = function ( componentType, componentLength, this.featuresLength, - jsonValue.byteOffset + jsonValue.byteOffset, ); } @@ -106,7 +106,7 @@ Cesium3DTileFeatureTable.prototype.getProperty = function ( componentType, componentLength, featureId, - result + result, ) { const jsonValue = this.json[semantic]; if (!defined(jsonValue)) { @@ -116,7 +116,7 @@ Cesium3DTileFeatureTable.prototype.getProperty = function ( const typedArray = this.getPropertyArray( semantic, componentType, - componentLength + componentLength, ); if (componentLength === 1) { diff --git a/packages/engine/Source/Scene/Cesium3DTileOptimizations.js b/packages/engine/Source/Scene/Cesium3DTileOptimizations.js index 9e836942f74c..d4a5d1c9dafd 100644 --- a/packages/engine/Source/Scene/Cesium3DTileOptimizations.js +++ b/packages/engine/Source/Scene/Cesium3DTileOptimizations.js @@ -67,7 +67,7 @@ Cesium3DTileOptimizations.checkChildrenWithinParent = function (tile) { const axis = Cartesian3.subtract( childOrientedBoundingBox.center, orientedBoundingBox.center, - scratchAxis + scratchAxis, ); const axisLength = Cartesian3.magnitude(axis); Cartesian3.divideByScalar(axis, axisLength, axis); diff --git a/packages/engine/Source/Scene/Cesium3DTilePointFeature.js b/packages/engine/Source/Scene/Cesium3DTilePointFeature.js index 01158482ac53..52ab3f469fbb 100644 --- a/packages/engine/Source/Scene/Cesium3DTilePointFeature.js +++ b/packages/engine/Source/Scene/Cesium3DTilePointFeature.js @@ -46,7 +46,7 @@ function Cesium3DTilePointFeature( batchId, billboard, label, - polyline + polyline, ) { this._content = content; this._billboard = billboard; @@ -416,7 +416,7 @@ Object.defineProperties(Cesium3DTilePointFeature.prototype, { const ellipsoid = this._content.tileset.ellipsoid; const cart = ellipsoid.cartesianToCartographic( this._billboard.position, - scratchCartographic + scratchCartographic, ); cart.height = cart.height - offset + value; const newPosition = ellipsoid.cartographicToCartesian(cart); @@ -465,7 +465,7 @@ Object.defineProperties(Cesium3DTilePointFeature.prototype, { set: function (value) { this._polyline.material.uniforms.color = Color.clone( value, - this._polyline.material.uniforms.color + this._polyline.material.uniforms.color, ); }, }, @@ -654,19 +654,19 @@ function setBillboardImage(feature) { const newColor = defaultValue( feature._color, - Cesium3DTilePointFeature.defaultColor + Cesium3DTilePointFeature.defaultColor, ); const newOutlineColor = defaultValue( feature._pointOutlineColor, - Cesium3DTilePointFeature.defaultPointOutlineColor + Cesium3DTilePointFeature.defaultPointOutlineColor, ); const newOutlineWidth = defaultValue( feature._pointOutlineWidth, - Cesium3DTilePointFeature.defaultPointOutlineWidth + Cesium3DTilePointFeature.defaultPointOutlineWidth, ); const newPointSize = defaultValue( feature._pointSize, - Cesium3DTilePointFeature.defaultPointSize + Cesium3DTilePointFeature.defaultPointSize, ); const currentColor = feature._billboardColor; @@ -686,7 +686,7 @@ function setBillboardImage(feature) { feature._billboardColor = Color.clone(newColor, feature._billboardColor); feature._billboardOutlineColor = Color.clone( newOutlineColor, - feature._billboardOutlineColor + feature._billboardOutlineColor, ); feature._billboardOutlineWidth = newOutlineWidth; feature._billboardSize = newPointSize; @@ -708,8 +708,8 @@ function setBillboardImage(feature) { cssColor, cssOutlineColor, newOutlineWidth, - newPointSize - ) + newPointSize, + ), ); } @@ -781,7 +781,7 @@ Cesium3DTilePointFeature.prototype.getPropertyInherited = function (name) { return Cesium3DTileFeature.getPropertyInherited( this._content, this._batchId, - name + name, ); }; diff --git a/packages/engine/Source/Scene/Cesium3DTileStyle.js b/packages/engine/Source/Scene/Cesium3DTileStyle.js index b5cd56c60d37..5ebe368e10a0 100644 --- a/packages/engine/Source/Scene/Cesium3DTileStyle.js +++ b/packages/engine/Source/Scene/Cesium3DTileStyle.js @@ -133,8 +133,10 @@ function setup(that, styleJson) { } function getExpression(tileStyle, value) { - const defines = defaultValue(tileStyle._style, defaultValue.EMPTY_OBJECT) - .defines; + const defines = defaultValue( + tileStyle._style, + defaultValue.EMPTY_OBJECT, + ).defines; if (!defined(value)) { return undefined; @@ -392,7 +394,7 @@ Object.defineProperties(Cesium3DTileStyle.prototype, { set: function (value) { this._pointOutlineColor = getExpression(this, value); this._style.pointOutlineColor = getJsonFromExpression( - this._pointOutlineColor + this._pointOutlineColor, ); }, }, @@ -435,7 +437,7 @@ Object.defineProperties(Cesium3DTileStyle.prototype, { set: function (value) { this._pointOutlineWidth = getExpression(this, value); this._style.pointOutlineWidth = getJsonFromExpression( - this._pointOutlineWidth + this._pointOutlineWidth, ); }, }, @@ -519,7 +521,7 @@ Object.defineProperties(Cesium3DTileStyle.prototype, { set: function (value) { this._labelOutlineColor = getExpression(this, value); this._style.labelOutlineColor = getJsonFromExpression( - this._labelOutlineColor + this._labelOutlineColor, ); }, }, @@ -562,7 +564,7 @@ Object.defineProperties(Cesium3DTileStyle.prototype, { set: function (value) { this._labelOutlineWidth = getExpression(this, value); this._style.labelOutlineWidth = getJsonFromExpression( - this._labelOutlineWidth + this._labelOutlineWidth, ); }, }, @@ -728,7 +730,7 @@ Object.defineProperties(Cesium3DTileStyle.prototype, { set: function (value) { this._backgroundColor = getExpression(this, value); this._style.backgroundColor = getJsonFromExpression( - this._backgroundColor + this._backgroundColor, ); }, }, @@ -762,7 +764,7 @@ Object.defineProperties(Cesium3DTileStyle.prototype, { set: function (value) { this._backgroundPadding = getExpression(this, value); this._style.backgroundPadding = getJsonFromExpression( - this._backgroundPadding + this._backgroundPadding, ); }, }, @@ -805,7 +807,7 @@ Object.defineProperties(Cesium3DTileStyle.prototype, { set: function (value) { this._backgroundEnabled = getExpression(this, value); this._style.backgroundEnabled = getJsonFromExpression( - this._backgroundEnabled + this._backgroundEnabled, ); }, }, @@ -839,7 +841,7 @@ Object.defineProperties(Cesium3DTileStyle.prototype, { set: function (value) { this._scaleByDistance = getExpression(this, value); this._style.scaleByDistance = getJsonFromExpression( - this._scaleByDistance + this._scaleByDistance, ); }, }, @@ -873,7 +875,7 @@ Object.defineProperties(Cesium3DTileStyle.prototype, { set: function (value) { this._translucencyByDistance = getExpression(this, value); this._style.translucencyByDistance = getJsonFromExpression( - this._translucencyByDistance + this._translucencyByDistance, ); }, }, @@ -907,7 +909,7 @@ Object.defineProperties(Cesium3DTileStyle.prototype, { set: function (value) { this._distanceDisplayCondition = getExpression(this, value); this._style.distanceDisplayCondition = getJsonFromExpression( - this._distanceDisplayCondition + this._distanceDisplayCondition, ); }, }, @@ -991,7 +993,7 @@ Object.defineProperties(Cesium3DTileStyle.prototype, { set: function (value) { this._anchorLineEnabled = getExpression(this, value); this._style.anchorLineEnabled = getJsonFromExpression( - this._anchorLineEnabled + this._anchorLineEnabled, ); }, }, @@ -1034,7 +1036,7 @@ Object.defineProperties(Cesium3DTileStyle.prototype, { set: function (value) { this._anchorLineColor = getExpression(this, value); this._style.anchorLineColor = getJsonFromExpression( - this._anchorLineColor + this._anchorLineColor, ); }, }, @@ -1109,7 +1111,7 @@ Object.defineProperties(Cesium3DTileStyle.prototype, { set: function (value) { this._disableDepthTestDistance = getExpression(this, value); this._style.disableDepthTestDistance = getJsonFromExpression( - this._disableDepthTestDistance + this._disableDepthTestDistance, ); }, }, @@ -1152,7 +1154,7 @@ Object.defineProperties(Cesium3DTileStyle.prototype, { set: function (value) { this._horizontalOrigin = getExpression(this, value); this._style.horizontalOrigin = getJsonFromExpression( - this._horizontalOrigin + this._horizontalOrigin, ); }, }, @@ -1236,7 +1238,7 @@ Object.defineProperties(Cesium3DTileStyle.prototype, { set: function (value) { this._labelHorizontalOrigin = getExpression(this, value); this._style.labelHorizontalOrigin = getJsonFromExpression( - this._labelHorizontalOrigin + this._labelHorizontalOrigin, ); }, }, @@ -1279,7 +1281,7 @@ Object.defineProperties(Cesium3DTileStyle.prototype, { set: function (value) { this._labelVerticalOrigin = getExpression(this, value); this._style.labelVerticalOrigin = getJsonFromExpression( - this._labelVerticalOrigin + this._labelVerticalOrigin, ); }, }, @@ -1346,7 +1348,7 @@ Cesium3DTileStyle.fromUrl = function (url) { Cesium3DTileStyle.prototype.getColorShaderFunction = function ( functionSignature, variableSubstitutionMap, - shaderState + shaderState, ) { if (this._colorShaderFunctionReady) { shaderState.translucent = this._colorShaderTranslucent; @@ -1360,7 +1362,7 @@ Cesium3DTileStyle.prototype.getColorShaderFunction = function ( functionSignature, variableSubstitutionMap, shaderState, - "vec4" + "vec4", ); } else { this._colorShaderFunction = undefined; @@ -1384,7 +1386,7 @@ Cesium3DTileStyle.prototype.getColorShaderFunction = function ( Cesium3DTileStyle.prototype.getShowShaderFunction = function ( functionSignature, variableSubstitutionMap, - shaderState + shaderState, ) { if (this._showShaderFunctionReady) { // Return the cached result, may be undefined @@ -1398,7 +1400,7 @@ Cesium3DTileStyle.prototype.getShowShaderFunction = function ( functionSignature, variableSubstitutionMap, shaderState, - "bool" + "bool", ); } else { this._showShaderFunction = undefined; @@ -1420,7 +1422,7 @@ Cesium3DTileStyle.prototype.getShowShaderFunction = function ( Cesium3DTileStyle.prototype.getPointSizeShaderFunction = function ( functionSignature, variableSubstitutionMap, - shaderState + shaderState, ) { if (this._pointSizeShaderFunctionReady) { // Return the cached result, may be undefined @@ -1433,7 +1435,7 @@ Cesium3DTileStyle.prototype.getPointSizeShaderFunction = function ( functionSignature, variableSubstitutionMap, shaderState, - "float" + "float", ); } else { this._pointSizeShaderFunction = undefined; diff --git a/packages/engine/Source/Scene/Cesium3DTilesVoxelProvider.js b/packages/engine/Source/Scene/Cesium3DTilesVoxelProvider.js index a04084e840ca..f473b19b96e7 100644 --- a/packages/engine/Source/Scene/Cesium3DTilesVoxelProvider.js +++ b/packages/engine/Source/Scene/Cesium3DTilesVoxelProvider.js @@ -138,13 +138,8 @@ Cesium3DTilesVoxelProvider.fromUrl = async function (url) { const implicitTileset = new ImplicitTileset(resource, root, metadataSchema); - const { - shape, - minBounds, - maxBounds, - shapeTransform, - globalTransform, - } = getShape(root); + const { shape, minBounds, maxBounds, shapeTransform, globalTransform } = + getShape(root); provider.shape = shape; provider.minBounds = minBounds; @@ -178,7 +173,7 @@ function getTileCount(metadata) { } return metadata.tileset.getPropertyBySemantic( - MetadataSemantic.TILESET_TILE_COUNT + MetadataSemantic.TILESET_TILE_COUNT, ); } @@ -191,7 +186,7 @@ function validate(tileset) { if (!hasExtension(root.content, "3DTILES_content_voxels")) { throw new RuntimeError( - "Root tile content must have 3DTILES_content_voxels extension" + "Root tile content must have 3DTILES_content_voxels extension", ); } @@ -228,12 +223,12 @@ function getShape(tile) { } else if (hasExtension(boundingVolume, "3DTILES_bounding_volume_cylinder")) { return getCylinderShape( boundingVolume.extensions["3DTILES_bounding_volume_cylinder"].cylinder, - tileTransform + tileTransform, ); } throw new RuntimeError( - "Only box, region and 3DTILES_bounding_volume_cylinder are supported in Cesium3DTilesVoxelProvider" + "Only box, region and 3DTILES_bounding_volume_cylinder are supported in Cesium3DTilesVoxelProvider", ); } @@ -263,7 +258,7 @@ function getBoxShape(box, tileTransform) { const obb = OrientedBoundingBox.unpack(box); const shapeTransform = Matrix4.fromRotationTranslation( obb.halfAxes, - obb.center + obb.center, ); return { @@ -279,7 +274,7 @@ function getCylinderShape(cylinder, tileTransform) { const obb = OrientedBoundingBox.unpack(cylinder); const shapeTransform = Matrix4.fromRotationTranslation( obb.halfAxes, - obb.center + obb.center, ); return { @@ -345,11 +340,10 @@ function copyArray(values, length) { } async function getVoxelContent(implicitTileset, tileCoordinates) { - const voxelRelative = implicitTileset.contentUriTemplates[0].getDerivedResource( - { + const voxelRelative = + implicitTileset.contentUriTemplates[0].getDerivedResource({ templateValues: tileCoordinates.getTemplateValues(), - } - ); + }); const voxelResource = implicitTileset.baseResource.getDerivedResource({ url: voxelRelative.url, }); @@ -361,7 +355,7 @@ async function getVoxelContent(implicitTileset, tileCoordinates) { voxelResource, preprocessed.jsonPayload, preprocessed.binaryPayload, - implicitTileset.metadataSchema + implicitTileset.metadataSchema, ); return voxelContent; @@ -381,7 +375,7 @@ async function getSubtreePromise(provider, subtreeCoord) { const subtreeRelative = implicitTileset.subtreeUriTemplate.getDerivedResource( { templateValues: subtreeCoord.getTemplateValues(), - } + }, ); const subtreeResource = implicitTileset.baseResource.getDerivedResource({ url: subtreeRelative.url, @@ -402,7 +396,7 @@ async function getSubtreePromise(provider, subtreeCoord) { preprocessed.jsonPayload, preprocessed.binaryPayload, implicitTileset, - subtreeCoord + subtreeCoord, ); subtreeCache.addSubtree(subtree); return subtree; diff --git a/packages/engine/Source/Scene/Cesium3DTileset.js b/packages/engine/Source/Scene/Cesium3DTileset.js index 04fc1c6834dd..f3dc6a272f1a 100644 --- a/packages/engine/Source/Scene/Cesium3DTileset.js +++ b/packages/engine/Source/Scene/Cesium3DTileset.js @@ -229,7 +229,7 @@ function Cesium3DTileset(options) { this._cullWithChildrenBounds = defaultValue( options.cullWithChildrenBounds, - true + true, ); this._allTilesAdditive = true; @@ -240,7 +240,7 @@ function Cesium3DTileset(options) { this._maximumScreenSpaceError = defaultValue( options.maximumScreenSpaceError, - 16 + 16, ); this._memoryAdjustedScreenSpaceError = this._maximumScreenSpaceError; @@ -251,13 +251,13 @@ function Cesium3DTileset(options) { const maximumCacheOverflowBytes = defaultValue( options.maximumCacheOverflowBytes, - 512 * 1024 * 1024 + 512 * 1024 * 1024, ); //>>includeStart('debug', pragmas.debug); Check.typeOf.number.greaterThanOrEquals( "maximumCacheOverflowBytes", maximumCacheOverflowBytes, - 0 + 0, ); //>>includeEnd('debug'); this._maximumCacheOverflowBytes = maximumCacheOverflowBytes; @@ -294,7 +294,7 @@ function Cesium3DTileset(options) { reverseScreenSpaceError: Number.MAX_VALUE, }; this._heatmap = new Cesium3DTilesetHeatmap( - options.debugHeatmapTilePropertyName + options.debugHeatmapTilePropertyName, ); /** @@ -305,7 +305,7 @@ function Cesium3DTileset(options) { */ this.cullRequestsWhileMoving = defaultValue( options.cullRequestsWhileMoving, - true + true, ); this._cullRequestsWhileMoving = false; @@ -317,7 +317,7 @@ function Cesium3DTileset(options) { */ this.cullRequestsWhileMovingMultiplier = defaultValue( options.cullRequestsWhileMovingMultiplier, - 60.0 + 60.0, ); /** @@ -329,7 +329,7 @@ function Cesium3DTileset(options) { this.progressiveResolutionHeightFraction = CesiumMath.clamp( defaultValue(options.progressiveResolutionHeightFraction, 0.3), 0.0, - 0.5 + 0.5, ); /** @@ -355,12 +355,12 @@ function Cesium3DTileset(options) { this._vectorClassificationOnly = defaultValue( options.vectorClassificationOnly, - false + false, ); this._vectorKeepDecodedPositions = defaultValue( options.vectorKeepDecodedPositions, - false + false, ); /** @@ -379,7 +379,7 @@ function Cesium3DTileset(options) { */ this.preloadFlightDestinations = defaultValue( options.preloadFlightDestinations, - true + true, ); this._pass = undefined; // Cesium3DTilePass @@ -395,7 +395,7 @@ function Cesium3DTileset(options) { */ this.dynamicScreenSpaceError = defaultValue( options.dynamicScreenSpaceError, - true + true, ); /** @@ -408,12 +408,12 @@ function Cesium3DTileset(options) { */ this.foveatedScreenSpaceError = defaultValue( options.foveatedScreenSpaceError, - true + true, ); this._foveatedConeSize = defaultValue(options.foveatedConeSize, 0.1); this._foveatedMinimumScreenSpaceErrorRelaxation = defaultValue( options.foveatedMinimumScreenSpaceErrorRelaxation, - 0.0 + 0.0, ); /** @@ -424,7 +424,7 @@ function Cesium3DTileset(options) { */ this.foveatedInterpolationCallback = defaultValue( options.foveatedInterpolationCallback, - CesiumMath.lerp + CesiumMath.lerp, ); /** @@ -461,7 +461,7 @@ function Cesium3DTileset(options) { */ this.dynamicScreenSpaceErrorDensity = defaultValue( options.dynamicScreenSpaceErrorDensity, - 2.0e-4 + 2.0e-4, ); /** @@ -482,7 +482,7 @@ function Cesium3DTileset(options) { */ this.dynamicScreenSpaceErrorFactor = defaultValue( options.dynamicScreenSpaceErrorFactor, - 24.0 + 24.0, ); /** @@ -496,7 +496,7 @@ function Cesium3DTileset(options) { */ this.dynamicScreenSpaceErrorHeightFalloff = defaultValue( options.dynamicScreenSpaceErrorHeightFalloff, - 0.25 + 0.25, ); // Updated based on the camera position and direction @@ -759,7 +759,7 @@ function Cesium3DTileset(options) { */ this.skipScreenSpaceErrorFactor = defaultValue( options.skipScreenSpaceErrorFactor, - 16 + 16, ); /** @@ -786,7 +786,7 @@ function Cesium3DTileset(options) { */ this.immediatelyLoadDesiredLevelOfDetail = defaultValue( options.immediatelyLoadDesiredLevelOfDetail, - false + false, ); /** @@ -806,7 +806,7 @@ function Cesium3DTileset(options) { ClippingPlaneCollection.setOwner( options.clippingPlanes, this, - "_clippingPlanes" + "_clippingPlanes", ); } @@ -815,7 +815,7 @@ function Cesium3DTileset(options) { ClippingPolygonCollection.setOwner( options.clippingPolygons, this, - "_clippingPolygons" + "_clippingPolygons", ); } @@ -877,7 +877,7 @@ function Cesium3DTileset(options) { */ this.splitDirection = defaultValue( options.splitDirection, - SplitDirection.NONE + SplitDirection.NONE, ); /** @@ -918,7 +918,7 @@ function Cesium3DTileset(options) { this._enableDebugWireframe = defaultValue( options.enableDebugWireframe, - false + false, ); /** @@ -936,7 +936,7 @@ function Cesium3DTileset(options) { if (this.debugWireframe === true && this._enableDebugWireframe === false) { oneTimeWarning( "tileset-debug-wireframe-ignored", - "enableDebugWireframe must be set to true in the Cesium3DTileset constructor, otherwise debugWireframe will be ignored." + "enableDebugWireframe must be set to true in the Cesium3DTileset constructor, otherwise debugWireframe will be ignored.", ); } @@ -953,7 +953,7 @@ function Cesium3DTileset(options) { */ this.debugShowBoundingVolume = defaultValue( options.debugShowBoundingVolume, - false + false, ); /** @@ -968,7 +968,7 @@ function Cesium3DTileset(options) { */ this.debugShowContentBoundingVolume = defaultValue( options.debugShowContentBoundingVolume, - false + false, ); /** @@ -982,7 +982,7 @@ function Cesium3DTileset(options) { */ this.debugShowViewerRequestVolume = defaultValue( options.debugShowViewerRequestVolume, - false + false, ); /** @@ -1005,7 +1005,7 @@ function Cesium3DTileset(options) { */ this.debugShowGeometricError = defaultValue( options.debugShowGeometricError, - false + false, ); /** @@ -1019,7 +1019,7 @@ function Cesium3DTileset(options) { */ this.debugShowRenderingStatistics = defaultValue( options.debugShowRenderingStatistics, - false + false, ); /** @@ -1068,7 +1068,7 @@ function Cesium3DTileset(options) { let instanceFeatureIdLabel = defaultValue( options.instanceFeatureIdLabel, - "instanceFeatureId_0" + "instanceFeatureId_0", ); if (typeof instanceFeatureIdLabel === "number") { instanceFeatureIdLabel = `instanceFeatureId_${instanceFeatureIdLabel}`; @@ -1224,7 +1224,7 @@ Object.defineProperties(Cesium3DTileset.prototype, { get: function () { deprecationWarning( "Cesium3DTileset.basePath", - "Cesium3DTileset.basePath has been deprecated. All tiles are relative to the url of the tileset JSON file that contains them. Use the url property instead." + "Cesium3DTileset.basePath has been deprecated. All tiles are relative to the url of the tileset JSON file that contains them. Use the url property instead.", ); return this._basePath; }, @@ -1440,7 +1440,7 @@ Object.defineProperties(Cesium3DTileset.prototype, { Check.typeOf.number.greaterThanOrEquals( "maximumScreenSpaceError", value, - 0 + 0, ); //>>includeEnd('debug'); @@ -1675,7 +1675,7 @@ Object.defineProperties(Cesium3DTileset.prototype, { Matrix4.multiply( this.root.computedTransform, this._initialClippingPlanesOriginMatrix, - this._clippingPlanesOriginMatrix + this._clippingPlanesOriginMatrix, ); this._clippingPlanesOriginMatrixDirty = false; } @@ -1801,12 +1801,12 @@ Object.defineProperties(Cesium3DTileset.prototype, { Check.typeOf.number.greaterThanOrEquals( "foveatedMinimumScreenSpaceErrorRelaxation", value, - 0.0 + 0.0, ); Check.typeOf.number.lessThanOrEquals( "foveatedMinimumScreenSpaceErrorRelaxation", value, - this.maximumScreenSpaceError + this.maximumScreenSpaceError, ); //>>includeEnd('debug'); @@ -2080,7 +2080,7 @@ Cesium3DTileset.fromUrl = async function (url, options) { const tilesetJson = await Cesium3DTileset.loadJson(resource); const metadataExtension = await processMetadataExtension( resource, - tilesetJson + tilesetJson, ); const tileset = new Cesium3DTileset(options); @@ -2118,27 +2118,25 @@ Cesium3DTileset.fromUrl = async function (url, options) { // the tile transform and model matrix at run time const boundingVolume = tileset._root.createBoundingVolume( tilesetJson.root.boundingVolume, - Matrix4.IDENTITY + Matrix4.IDENTITY, ); const clippingPlanesOrigin = boundingVolume.boundingSphere.center; // If this origin is above the surface of the earth // we want to apply an ENU orientation as our best guess of orientation. // Otherwise, we assume it gets its position/orientation completely from the // root tile transform and the tileset's model matrix - const originCartographic = tileset._ellipsoid.cartesianToCartographic( - clippingPlanesOrigin - ); + const originCartographic = + tileset._ellipsoid.cartesianToCartographic(clippingPlanesOrigin); if ( defined(originCartographic) && originCartographic.height > ApproximateTerrainHeights._defaultMinTerrainHeight ) { - tileset._initialClippingPlanesOriginMatrix = Transforms.eastNorthUpToFixedFrame( - clippingPlanesOrigin - ); + tileset._initialClippingPlanesOriginMatrix = + Transforms.eastNorthUpToFixedFrame(clippingPlanesOrigin); } tileset._clippingPlanesOriginMatrix = Matrix4.clone( - tileset._initialClippingPlanesOriginMatrix + tileset._initialClippingPlanesOriginMatrix, ); return tileset; @@ -2174,7 +2172,7 @@ Cesium3DTileset.prototype.makeStyleDirty = function () { Cesium3DTileset.prototype.loadTileset = function ( resource, tilesetJson, - parentTile + parentTile, ) { const asset = tilesetJson.asset; if (!defined(asset)) { @@ -2186,7 +2184,7 @@ Cesium3DTileset.prototype.loadTileset = function ( asset.version !== "1.1" ) { throw new RuntimeError( - "The tileset must be 3D Tiles version 0.0, 1.0, or 1.1" + "The tileset must be 3D Tiles version 0.0, 1.0, or 1.1", ); } @@ -2269,7 +2267,7 @@ function makeTile(tileset, baseResource, tileHeader, parentTile) { const implicitTileset = new ImplicitTileset( baseResource, tileHeader, - metadataSchema + metadataSchema, ); const rootCoordinates = new ImplicitTileCoordinates({ subdivisionScheme: implicitTileset.subdivisionScheme, @@ -2385,21 +2383,21 @@ function updateDynamicScreenSpaceError(tileset, frameState) { // Transform camera position and direction into the local coordinate system of the tileset const transformLocal = Matrix4.inverseTransformation( root.computedTransform, - scratchMatrix + scratchMatrix, ); const ellipsoid = frameState.mapProjection.ellipsoid; const boundingVolume = tileBoundingVolume.boundingVolume; const centerLocal = Matrix4.multiplyByPoint( transformLocal, boundingVolume.center, - scratchCenter + scratchCenter, ); if (Cartesian3.magnitude(centerLocal) > ellipsoid.minimumRadius) { // The tileset is defined in WGS84. Approximate the minimum and maximum height. const centerCartographic = Cartographic.fromCartesian( centerLocal, ellipsoid, - scratchCartographic + scratchCartographic, ); up = Cartesian3.normalize(camera.positionWC, scratchPositionNormal); direction = camera.directionWC; @@ -2411,13 +2409,13 @@ function updateDynamicScreenSpaceError(tileset, frameState) { const positionLocal = Matrix4.multiplyByPoint( transformLocal, camera.positionWC, - scratchPosition + scratchPosition, ); up = Cartesian3.UNIT_Z; direction = Matrix4.multiplyByPointAsVector( transformLocal, camera.directionWC, - scratchDirection + scratchDirection, ); direction = Cartesian3.normalize(direction, direction); height = positionLocal.z; @@ -2427,7 +2425,7 @@ function updateDynamicScreenSpaceError(tileset, frameState) { const halfHeightVector = Matrix3.getColumn( boundingVolume.halfAxes, 2, - scratchHalfHeight + scratchHalfHeight, ); const halfHeight = Cartesian3.magnitude(halfHeightVector); minimumHeight = centerLocal.z - halfHeight; @@ -2449,7 +2447,7 @@ function updateDynamicScreenSpaceError(tileset, frameState) { const t = CesiumMath.clamp( (height - heightClose) / (heightFar - heightClose), 0.0, - 1.0 + 1.0, ); // Increase density as the camera tilts towards the horizon @@ -2563,7 +2561,7 @@ Cesium3DTileset.prototype.prePassesUpdate = function (frameState) { } this._timeSinceLoad = Math.max( JulianDate.secondsDifference(frameState.time, this._loadTimestamp) * 1000, - 0.0 + 0.0, ); if (this.dynamicScreenSpaceError) { @@ -2693,12 +2691,12 @@ function processUpdateHeight(tileset, tile, frameState) { const ellipsoid = callbackData.ellipsoid; const positionCartographic = Cartographic.clone( callbackData.positionCartographic, - scratchUpdateHeightCartographic + scratchUpdateHeightCartographic, ); const centerCartographic = Cartographic.fromCartesian( boundingSphere.center, ellipsoid, - scratchUpdateHeightCartographic2 + scratchUpdateHeightCartographic2, ); // This can be undefined when the bounding sphere is at the origin @@ -2709,7 +2707,7 @@ function processUpdateHeight(tileset, tile, frameState) { const position = Cartographic.toCartesian( positionCartographic, ellipsoid, - scratchUpdateHeightCartesian + scratchUpdateHeightCartesian, ); if ( Cartesian3.distance(position, boundingSphere.center) <= @@ -2773,7 +2771,7 @@ function increaseScreenSpaceError(tileset) { "increase-screenSpaceError", `The tiles needed to meet maximumScreenSpaceError would use more memory than allocated for this tileset. The tileset will be rendered with a larger screen space error (see memoryAdjustedScreenSpaceError). - Consider using larger values for cacheBytes and maximumCacheOverflowBytes.` + Consider using larger values for cacheBytes and maximumCacheOverflowBytes.`, ); //>>includeEnd('debug'); @@ -2788,7 +2786,7 @@ function increaseScreenSpaceError(tileset) { function decreaseScreenSpaceError(tileset) { tileset._memoryAdjustedScreenSpaceError = Math.max( tileset.memoryAdjustedScreenSpaceError / 1.02, - tileset.maximumScreenSpaceError + tileset.maximumScreenSpaceError, ); } @@ -2829,7 +2827,7 @@ function computeTileLabelPosition(tile) { normal = Cartesian3.multiplyByScalar( normal, 0.75 * radius, - scratchCartesian + scratchCartesian, ); position = Cartesian3.add(normal, center, scratchCartesian); } @@ -2875,10 +2873,10 @@ function addTileDebugLabel(tile, tileset, position) { if (tileset.debugShowMemoryUsage) { labelString += `\nTexture Memory: ${formatMemoryString( - tile.content.texturesByteLength + tile.content.texturesByteLength, )}`; labelString += `\nGeometry Memory: ${formatMemoryString( - tile.content.geometryByteLength + tile.content.geometryByteLength, )}`; attributes += 2; } @@ -2928,7 +2926,7 @@ function updateTileDebugLabels(tileset, frameState) { const label = addTileDebugLabel( tileset.debugPickedTile, tileset, - position + position, ); label.pixelOffset = new Cartesian2(15, -15); // Offset to avoid picking the label. } @@ -3068,7 +3066,7 @@ function updateTiles(tileset, frameState, passOptions) { frameState, numberOfInitialCommands, tileset.pointCloudShading, - tileset.boundingSphere + tileset.boundingSphere, ); } @@ -3172,7 +3170,7 @@ function raiseLoadProgressEvent(tileset, frameState) { frameState.afterRender.push(function () { tileset.loadProgress.raiseEvent( numberOfPendingRequests, - numberOfTilesProcessing + numberOfTilesProcessing, ); return true; @@ -3234,12 +3232,12 @@ function detectModelMatrixChanged(tileset, frameState) { tileset._updatedModelMatrixFrame = frameState.frameNumber; tileset._modelMatrixChanged = !Matrix4.equals( tileset.modelMatrix, - tileset._previousModelMatrix + tileset._previousModelMatrix, ); if (tileset._modelMatrixChanged) { tileset._previousModelMatrix = Matrix4.clone( tileset.modelMatrix, - tileset._previousModelMatrix + tileset._previousModelMatrix, ); } } @@ -3329,7 +3327,7 @@ function createCredits(tileset) { credits.forEach( (credit) => (credit.showOnScreen = - credit.showOnScreen || tileset._showCreditsOnScreen) + credit.showOnScreen || tileset._showCreditsOnScreen), ); tileset._credits = credits; @@ -3368,7 +3366,7 @@ Cesium3DTileset.prototype.update = function (frameState) { */ Cesium3DTileset.prototype.updateForPass = function ( frameState, - tilesetPassState + tilesetPassState, ) { //>>includeStart('debug', pragmas.debug); Check.typeOf.object("frameState", frameState); @@ -3400,7 +3398,7 @@ Cesium3DTileset.prototype.updateForPass = function ( const commandList = defaultValue( tilesetPassState.commandList, - originalCommandList + originalCommandList, ); const commandStart = commandList.length; @@ -3408,7 +3406,7 @@ Cesium3DTileset.prototype.updateForPass = function ( frameState.camera = defaultValue(tilesetPassState.camera, originalCamera); frameState.cullingVolume = defaultValue( tilesetPassState.cullingVolume, - originalCullingVolume + originalCullingVolume, ); // Update clipping polygons @@ -3425,7 +3423,7 @@ Cesium3DTileset.prototype.updateForPass = function ( this, frameState, passStatistics, - passOptions + passOptions, ); } @@ -3539,7 +3537,7 @@ Cesium3DTileset.checkSupportedExtensions = function (extensionsRequired) { for (let i = 0; i < extensionsRequired.length; i++) { if (!Cesium3DTileset.supportedExtensions[extensionsRequired[i]]) { throw new RuntimeError( - `Unsupported 3D Tiles Extension: ${extensionsRequired[i]}` + `Unsupported 3D Tiles Extension: ${extensionsRequired[i]}`, ); } } @@ -3576,7 +3574,7 @@ Cesium3DTileset.prototype.getHeight = function (cartographic, scene) { const ray = scratchGetHeightRay; const position = ellipsoid.cartographicToCartesian( cartographic, - ray.direction + ray.direction, ); Cartesian3.normalize(ray.direction, ray.direction); @@ -3585,7 +3583,7 @@ Cesium3DTileset.prototype.getHeight = function (cartographic, scene) { ray.origin = Cartesian3.multiplyByScalar( ray.direction, -2 * ellipsoid.maximumRadius, - ray.origin + ray.origin, ); const intersection = this.pick(ray, scene.frameState, scratchIntersection); @@ -3595,7 +3593,7 @@ Cesium3DTileset.prototype.getHeight = function (cartographic, scene) { return ellipsoid.cartesianToCartographic( intersection, - scratchGetHeightCartographic + scratchGetHeightCartographic, )?.height; }; @@ -3614,7 +3612,7 @@ Cesium3DTileset.prototype.getHeight = function (cartographic, scene) { Cesium3DTileset.prototype.updateHeight = function ( cartographic, callback, - ellipsoid + ellipsoid, ) { ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84); @@ -3671,7 +3669,7 @@ Cesium3DTileset.prototype.pick = function (ray, frameState, result) { const boundsIntersection = IntersectionTests.raySphere( ray, tile.contentBoundingVolume.boundingSphere, - scratchSphereIntersection + scratchSphereIntersection, ); if (!defined(boundsIntersection) || !defined(tile.content)) { continue; @@ -3684,11 +3682,11 @@ Cesium3DTileset.prototype.pick = function (ray, frameState, result) { candidates.sort((a, b) => { const aDist = BoundingSphere.distanceSquaredTo( a.contentBoundingVolume.boundingSphere, - ray.origin + ray.origin, ); const bDist = BoundingSphere.distanceSquaredTo( b.contentBoundingVolume.boundingSphere, - ray.origin + ray.origin, ); return aDist - bDist; @@ -3700,7 +3698,7 @@ Cesium3DTileset.prototype.pick = function (ray, frameState, result) { const candidate = tile.content.pick( ray, frameState, - scratchPickIntersection + scratchPickIntersection, ); if (defined(candidate)) { diff --git a/packages/engine/Source/Scene/Cesium3DTilesetBaseTraversal.js b/packages/engine/Source/Scene/Cesium3DTilesetBaseTraversal.js index a3a012d04fae..bd48b939cdae 100644 --- a/packages/engine/Source/Scene/Cesium3DTilesetBaseTraversal.js +++ b/packages/engine/Source/Scene/Cesium3DTilesetBaseTraversal.js @@ -162,11 +162,11 @@ function updateAndPushChildren(tile, stack, frameState) { : tile; // This is where priority dependency chains are wired up or started anew. priorityHolder._foveatedFactor = Math.min( minPriorityChild._foveatedFactor, - priorityHolder._foveatedFactor + priorityHolder._foveatedFactor, ); priorityHolder._distanceToCamera = Math.min( minPriorityChild._distanceToCamera, - priorityHolder._distanceToCamera + priorityHolder._distanceToCamera, ); for (let i = 0; i < children.length; ++i) { @@ -189,19 +189,15 @@ function updateAndPushChildren(tile, stack, frameState) { function executeTraversal(root, frameState) { const { tileset } = root; - const { - canTraverse, - loadTile, - visitTile, - touchTile, - } = Cesium3DTilesetTraversal; + const { canTraverse, loadTile, visitTile, touchTile } = + Cesium3DTilesetTraversal; const stack = traversal.stack; stack.push(root); while (stack.length > 0) { traversal.stackMaximumLength = Math.max( traversal.stackMaximumLength, - stack.length + stack.length, ); const tile = stack.pop(); @@ -249,12 +245,8 @@ function executeTraversal(root, frameState) { * @returns {boolean} */ function executeEmptyTraversal(root, frameState) { - const { - canTraverse, - updateTile, - loadTile, - touchTile, - } = Cesium3DTilesetTraversal; + const { canTraverse, updateTile, loadTile, touchTile } = + Cesium3DTilesetTraversal; let allDescendantsLoaded = true; const stack = emptyTraversal.stack; stack.push(root); @@ -262,7 +254,7 @@ function executeEmptyTraversal(root, frameState) { while (stack.length > 0) { emptyTraversal.stackMaximumLength = Math.max( emptyTraversal.stackMaximumLength, - stack.length + stack.length, ); const tile = stack.pop(); diff --git a/packages/engine/Source/Scene/Cesium3DTilesetCache.js b/packages/engine/Source/Scene/Cesium3DTilesetCache.js index d4a8a5015159..7c09edcbfa41 100644 --- a/packages/engine/Source/Scene/Cesium3DTilesetCache.js +++ b/packages/engine/Source/Scene/Cesium3DTilesetCache.js @@ -37,7 +37,7 @@ Cesium3DTilesetCache.prototype.add = function (tile) { Cesium3DTilesetCache.prototype.unloadTile = function ( tileset, tile, - unloadCallback + unloadCallback, ) { const node = tile.cacheNode; if (!defined(node)) { @@ -51,7 +51,7 @@ Cesium3DTilesetCache.prototype.unloadTile = function ( Cesium3DTilesetCache.prototype.unloadTiles = function ( tileset, - unloadCallback + unloadCallback, ) { const trimTiles = this._trimTiles; this._trimTiles = false; diff --git a/packages/engine/Source/Scene/Cesium3DTilesetHeatmap.js b/packages/engine/Source/Scene/Cesium3DTilesetHeatmap.js index ec01db34d542..6378a5ebcf7d 100644 --- a/packages/engine/Source/Scene/Cesium3DTilesetHeatmap.js +++ b/packages/engine/Source/Scene/Cesium3DTilesetHeatmap.js @@ -57,15 +57,15 @@ function getHeatmapValue(tileValue, tilePropertyName) { Cesium3DTilesetHeatmap.prototype.setReferenceMinimumMaximum = function ( minimum, maximum, - tilePropertyName + tilePropertyName, ) { this._referenceMinimum[tilePropertyName] = getHeatmapValue( minimum, - tilePropertyName + tilePropertyName, ); this._referenceMaximum[tilePropertyName] = getHeatmapValue( maximum, - tilePropertyName + tilePropertyName, ); }; @@ -74,7 +74,7 @@ function getHeatmapValueAndUpdateMinimumMaximum(heatmap, tile) { if (defined(tilePropertyName)) { const heatmapValue = getHeatmapValue( tile[tilePropertyName], - tilePropertyName + tilePropertyName, ); if (!defined(heatmapValue)) { heatmap.tilePropertyName = undefined; @@ -123,7 +123,7 @@ Cesium3DTilesetHeatmap.prototype.colorize = function (tile, frameState) { const shiftedValue = CesiumMath.clamp( heatmapValue - minimum, 0.0, - shiftedMax + shiftedMax, ); // Get position between minimum and maximum and convert that to a position in the color array diff --git a/packages/engine/Source/Scene/Cesium3DTilesetMetadata.js b/packages/engine/Source/Scene/Cesium3DTilesetMetadata.js index 8c2df573bfb2..ec92d7a2caeb 100644 --- a/packages/engine/Source/Scene/Cesium3DTilesetMetadata.js +++ b/packages/engine/Source/Scene/Cesium3DTilesetMetadata.js @@ -58,7 +58,7 @@ function Cesium3DTilesetMetadata(options) { new GroupMetadata({ group: group, class: schema.classes[group.class], - }) + }), ); } } else if (defined(groupsJson)) { @@ -75,7 +75,7 @@ function Cesium3DTilesetMetadata(options) { id: groupId, group: groupsJson[groupId], class: schema.classes[group.class], - }) + }), ); } } diff --git a/packages/engine/Source/Scene/Cesium3DTilesetMostDetailedTraversal.js b/packages/engine/Source/Scene/Cesium3DTilesetMostDetailedTraversal.js index 8645642a852f..00130506cd9f 100644 --- a/packages/engine/Source/Scene/Cesium3DTilesetMostDetailedTraversal.js +++ b/packages/engine/Source/Scene/Cesium3DTilesetMostDetailedTraversal.js @@ -29,7 +29,7 @@ const traversal = { */ Cesium3DTilesetMostDetailedTraversal.selectTiles = function ( tileset, - frameState + frameState, ) { tileset._selectedTiles.length = 0; tileset._requestedTiles.length = 0; @@ -52,7 +52,7 @@ Cesium3DTilesetMostDetailedTraversal.selectTiles = function ( while (stack.length > 0) { traversal.stackMaximumLength = Math.max( traversal.stackMaximumLength, - stack.length + stack.length, ); const tile = stack.pop(); diff --git a/packages/engine/Source/Scene/Cesium3DTilesetSkipTraversal.js b/packages/engine/Source/Scene/Cesium3DTilesetSkipTraversal.js index 81e18c41e78c..eebcff5bc987 100644 --- a/packages/engine/Source/Scene/Cesium3DTilesetSkipTraversal.js +++ b/packages/engine/Source/Scene/Cesium3DTilesetSkipTraversal.js @@ -73,7 +73,7 @@ Cesium3DTilesetSkipTraversal.selectTiles = function (tileset, frameState) { descendantTraversal.stack.trim(descendantTraversal.stackMaximumLength); selectionTraversal.stack.trim(selectionTraversal.stackMaximumLength); selectionTraversal.ancestorStack.trim( - selectionTraversal.ancestorStackMaximumLength + selectionTraversal.ancestorStackMaximumLength, ); // Update the priority for any requests found during traversal @@ -98,7 +98,7 @@ function selectDescendants(root, frameState) { while (stack.length > 0) { descendantTraversal.stackMaximumLength = Math.max( descendantTraversal.stackMaximumLength, - stack.length + stack.length, ); const tile = stack.pop(); const children = tile.children; @@ -269,21 +269,17 @@ function executeTraversal(root, frameState) { ? Number.MAX_VALUE : Math.max( tileset.baseScreenSpaceError, - tileset.memoryAdjustedScreenSpaceError + tileset.memoryAdjustedScreenSpaceError, ); - const { - canTraverse, - loadTile, - visitTile, - touchTile, - } = Cesium3DTilesetTraversal; + const { canTraverse, loadTile, visitTile, touchTile } = + Cesium3DTilesetTraversal; const stack = traversal.stack; stack.push(root); while (stack.length > 0) { traversal.stackMaximumLength = Math.max( traversal.stackMaximumLength, - stack.length + stack.length, ); const tile = stack.pop(); @@ -364,11 +360,11 @@ function traverseAndSelect(root, frameState) { while (stack.length > 0 || ancestorStack.length > 0) { selectionTraversal.stackMaximumLength = Math.max( selectionTraversal.stackMaximumLength, - stack.length + stack.length, ); selectionTraversal.ancestorStackMaximumLength = Math.max( selectionTraversal.ancestorStackMaximumLength, - ancestorStack.length + ancestorStack.length, ); if (ancestorStack.length > 0) { diff --git a/packages/engine/Source/Scene/Cesium3DTilesetStatistics.js b/packages/engine/Source/Scene/Cesium3DTilesetStatistics.js index a75adb2100b7..ed80f3fc67fd 100644 --- a/packages/engine/Source/Scene/Cesium3DTilesetStatistics.js +++ b/packages/engine/Source/Scene/Cesium3DTilesetStatistics.js @@ -89,7 +89,7 @@ function updatePointAndFeatureCounts(statistics, content, decrement, load) { } Cesium3DTilesetStatistics.prototype.incrementSelectionCounts = function ( - content + content, ) { updatePointAndFeatureCounts(this, content, false, false); }; diff --git a/packages/engine/Source/Scene/Cesium3DTilesetTraversal.js b/packages/engine/Source/Scene/Cesium3DTilesetTraversal.js index 57dea371ce94..fd13b76d9d4a 100644 --- a/packages/engine/Source/Scene/Cesium3DTilesetTraversal.js +++ b/packages/engine/Source/Scene/Cesium3DTilesetTraversal.js @@ -165,10 +165,8 @@ function isOnScreenLongEnough(tile, frameState) { return true; } - const { - positionWCDeltaMagnitude, - positionWCDeltaMagnitudeLastFrame, - } = frameState.camera; + const { positionWCDeltaMagnitude, positionWCDeltaMagnitudeLastFrame } = + frameState.camera; const deltaMagnitude = positionWCDeltaMagnitude !== 0.0 ? positionWCDeltaMagnitude @@ -296,29 +294,29 @@ function updateMinimumMaximumPriority(tile) { maximumPriority.distance = Math.max( priorityHolder._distanceToCamera, - maximumPriority.distance + maximumPriority.distance, ); minimumPriority.distance = Math.min( priorityHolder._distanceToCamera, - minimumPriority.distance + minimumPriority.distance, ); maximumPriority.depth = Math.max(tile._depth, maximumPriority.depth); minimumPriority.depth = Math.min(tile._depth, minimumPriority.depth); maximumPriority.foveatedFactor = Math.max( priorityHolder._foveatedFactor, - maximumPriority.foveatedFactor + maximumPriority.foveatedFactor, ); minimumPriority.foveatedFactor = Math.min( priorityHolder._foveatedFactor, - minimumPriority.foveatedFactor + minimumPriority.foveatedFactor, ); maximumPriority.reverseScreenSpaceError = Math.max( tile._priorityReverseScreenSpaceError, - maximumPriority.reverseScreenSpaceError + maximumPriority.reverseScreenSpaceError, ); minimumPriority.reverseScreenSpaceError = Math.min( tile._priorityReverseScreenSpaceError, - minimumPriority.reverseScreenSpaceError + minimumPriority.reverseScreenSpaceError, ); } diff --git a/packages/engine/Source/Scene/ClassificationPrimitive.js b/packages/engine/Source/Scene/ClassificationPrimitive.js index 170b01a83a9f..e08fc9950fdd 100644 --- a/packages/engine/Source/Scene/ClassificationPrimitive.js +++ b/packages/engine/Source/Scene/ClassificationPrimitive.js @@ -110,7 +110,7 @@ function ClassificationPrimitive(options) { */ this.classificationType = defaultValue( options.classificationType, - ClassificationType.BOTH + ClassificationType.BOTH, ); /** * This property is for debugging only; it is not for production use nor is it optimized. @@ -124,7 +124,7 @@ function ClassificationPrimitive(options) { */ this.debugShowBoundingVolume = defaultValue( options.debugShowBoundingVolume, - false + false, ); /** * This property is for debugging only; it is not for production use nor is it optimized. @@ -138,7 +138,7 @@ function ClassificationPrimitive(options) { */ this.debugShowShadowVolume = defaultValue( options.debugShowShadowVolume, - false + false, ); this._debugShowShadowVolume = false; @@ -185,7 +185,7 @@ function ClassificationPrimitive(options) { interleave: defaultValue(options.interleave, false), releaseGeometryInstances: defaultValue( options.releaseGeometryInstances, - true + true, ), allowPicking: defaultValue(options.allowPicking, true), asynchronous: defaultValue(options.asynchronous, true), @@ -434,7 +434,7 @@ function createRenderStates( classificationPrimitive, context, appearance, - twoPasses + twoPasses, ) { if (defined(classificationPrimitive._rsStencilDepthPass)) { return; @@ -442,13 +442,13 @@ function createRenderStates( const stencilEnabled = !classificationPrimitive.debugShowShadowVolume; classificationPrimitive._rsStencilDepthPass = RenderState.fromCache( - getStencilDepthRenderState(stencilEnabled, false) + getStencilDepthRenderState(stencilEnabled, false), ); classificationPrimitive._rsStencilDepthPass3DTiles = RenderState.fromCache( - getStencilDepthRenderState(stencilEnabled, true) + getStencilDepthRenderState(stencilEnabled, true), ); classificationPrimitive._rsColorPass = RenderState.fromCache( - getColorRenderState(stencilEnabled, false) + getColorRenderState(stencilEnabled, false), ); classificationPrimitive._rsPickPass = RenderState.fromCache(pickRenderState); } @@ -471,7 +471,7 @@ function modifyForEncodedNormals(primitive, vertexShaderSource) { modifiedVS = modifiedVS.replace(/in\s+vec3\s+extrudeDirection;/g, ""); modifiedVS = ShaderSource.replaceMain( modifiedVS, - "czm_non_compressed_main" + "czm_non_compressed_main", ); const compressedMain = `${"void main() \n" + "{ \n"}${decode} czm_non_compressed_main(); \n` + @@ -485,14 +485,15 @@ function createShaderProgram(classificationPrimitive, frameState) { const context = frameState.context; const primitive = classificationPrimitive._primitive; let vs = ShadowVolumeAppearanceVS; - vs = classificationPrimitive._primitive._batchTable.getVertexShaderCallback()( - vs - ); + vs = + classificationPrimitive._primitive._batchTable.getVertexShaderCallback()( + vs, + ); vs = Primitive._appendDistanceDisplayConditionToShader(primitive, vs); vs = Primitive._modifyShaderPosition( classificationPrimitive, vs, - frameState.scene3DOnly + frameState.scene3DOnly, ); vs = Primitive._updateColorAttribute(primitive, vs); @@ -521,7 +522,7 @@ function createShaderProgram(classificationPrimitive, frameState) { const shadowVolumeAppearance = new ShadowVolumeAppearance( cullFragmentsUsingExtents, planarExtents, - classificationPrimitive.appearance + classificationPrimitive.appearance, ); classificationPrimitive._spStencil = ShaderProgram.replaceCache({ @@ -542,7 +543,7 @@ function createShaderProgram(classificationPrimitive, frameState) { [extrudedDefine], vsPick, false, - frameState.mapProjection + frameState.mapProjection, ); classificationPrimitive._spPick = ShaderProgram.replaceCache({ @@ -558,7 +559,7 @@ function createShaderProgram(classificationPrimitive, frameState) { if (cullFragmentsUsingExtents) { let pickProgram2D = context.shaderCache.getDerivedShaderProgram( classificationPrimitive._spPick, - "2dPick" + "2dPick", ); if (!defined(pickProgram2D)) { const pickFS2D = shadowVolumeAppearance.createPickFragmentShader(true); @@ -566,7 +567,7 @@ function createShaderProgram(classificationPrimitive, frameState) { [extrudedDefine], vsPick, true, - frameState.mapProjection + frameState.mapProjection, ); pickProgram2D = context.shaderCache.createDerivedShaderProgram( @@ -576,7 +577,7 @@ function createShaderProgram(classificationPrimitive, frameState) { vertexShaderSource: pickVS2D, fragmentShaderSource: pickFS2D, attributeLocations: attributeLocations, - } + }, ); } classificationPrimitive._spPick2D = pickProgram2D; @@ -610,7 +611,7 @@ function createShaderProgram(classificationPrimitive, frameState) { [extrudedDefine], vs, false, - frameState.mapProjection + frameState.mapProjection, ); classificationPrimitive._spColor = ShaderProgram.replaceCache({ @@ -627,7 +628,7 @@ function createShaderProgram(classificationPrimitive, frameState) { if (cullFragmentsUsingExtents) { let colorProgram2D = context.shaderCache.getDerivedShaderProgram( classificationPrimitive._spColor, - "2dColor" + "2dColor", ); if (!defined(colorProgram2D)) { const fsColorSource2D = shadowVolumeAppearance.createFragmentShader(true); @@ -635,7 +636,7 @@ function createShaderProgram(classificationPrimitive, frameState) { [extrudedDefine], vs, true, - frameState.mapProjection + frameState.mapProjection, ); colorProgram2D = context.shaderCache.createDerivedShaderProgram( @@ -645,7 +646,7 @@ function createShaderProgram(classificationPrimitive, frameState) { vertexShaderSource: vsColorSource2D, fragmentShaderSource: fsColorSource2D, attributeLocations: attributeLocations, - } + }, ); } classificationPrimitive._spColor2D = colorProgram2D; @@ -662,7 +663,7 @@ function createColorCommands(classificationPrimitive, colorCommands) { let derivedCommand; let vaIndex = 0; let uniformMap = primitive._batchTable.getUniformMapCallback()( - classificationPrimitive._uniformMap + classificationPrimitive._uniformMap, ); const needs2DShader = classificationPrimitive._needs2DShader; @@ -687,7 +688,7 @@ function createColorCommands(classificationPrimitive, colorCommands) { derivedCommand = DrawCommand.shallowClone( command, - command.derivedCommands.tileset + command.derivedCommands.tileset, ); derivedCommand.renderState = classificationPrimitive._rsStencilDepthPass3DTiles; @@ -718,7 +719,7 @@ function createColorCommands(classificationPrimitive, colorCommands) { derivedCommand = DrawCommand.shallowClone( command, - command.derivedCommands.tileset + command.derivedCommands.tileset, ); derivedCommand.pass = Pass.CESIUM_3D_TILE_CLASSIFICATION; command.derivedCommands.tileset = derivedCommand; @@ -728,7 +729,7 @@ function createColorCommands(classificationPrimitive, colorCommands) { // First derive from the terrain command let derived2DCommand = DrawCommand.shallowClone( command, - command.derivedCommands.appearance2D + command.derivedCommands.appearance2D, ); derived2DCommand.shaderProgram = classificationPrimitive._spColor2D; command.derivedCommands.appearance2D = derived2DCommand; @@ -736,7 +737,7 @@ function createColorCommands(classificationPrimitive, colorCommands) { // Then derive from the 3D Tiles command derived2DCommand = DrawCommand.shallowClone( derivedCommand, - derivedCommand.derivedCommands.appearance2D + derivedCommand.derivedCommands.appearance2D, ); derived2DCommand.shaderProgram = classificationPrimitive._spColor2D; derivedCommand.derivedCommands.appearance2D = derived2DCommand; @@ -752,7 +753,7 @@ function createColorCommands(classificationPrimitive, colorCommands) { for (let j = 0; j < length; ++j) { const commandIgnoreShow = (commandsIgnoreShow[j] = DrawCommand.shallowClone( colorCommands[commandIndex], - commandsIgnoreShow[j] + commandsIgnoreShow[j], )); commandIgnoreShow.shaderProgram = spStencil; commandIgnoreShow.pass = Pass.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW; @@ -783,7 +784,7 @@ function createPickCommands(classificationPrimitive, pickCommands) { let derivedCommand; let vaIndex = 0; const uniformMap = primitive._batchTable.getUniformMapCallback()( - classificationPrimitive._uniformMap + classificationPrimitive._uniformMap, ); const needs2DShader = classificationPrimitive._needs2DShader; @@ -818,7 +819,7 @@ function createPickCommands(classificationPrimitive, pickCommands) { // Derive for 3D Tiles classification derivedCommand = DrawCommand.shallowClone( command, - command.derivedCommands.tileset + command.derivedCommands.tileset, ); derivedCommand.renderState = classificationPrimitive._rsStencilDepthPass3DTiles; @@ -847,7 +848,7 @@ function createPickCommands(classificationPrimitive, pickCommands) { derivedCommand = DrawCommand.shallowClone( command, - command.derivedCommands.tileset + command.derivedCommands.tileset, ); derivedCommand.pass = Pass.CESIUM_3D_TILE_CLASSIFICATION; command.derivedCommands.tileset = derivedCommand; @@ -857,7 +858,7 @@ function createPickCommands(classificationPrimitive, pickCommands) { // First derive from the terrain command let derived2DCommand = DrawCommand.shallowClone( command, - command.derivedCommands.pick2D + command.derivedCommands.pick2D, ); derived2DCommand.shaderProgram = classificationPrimitive._spPick2D; command.derivedCommands.pick2D = derived2DCommand; @@ -865,7 +866,7 @@ function createPickCommands(classificationPrimitive, pickCommands) { // Then derive from the 3D Tiles command derived2DCommand = DrawCommand.shallowClone( derivedCommand, - derivedCommand.derivedCommands.pick2D + derivedCommand.derivedCommands.pick2D, ); derived2DCommand.shaderProgram = classificationPrimitive._spPick2D; derivedCommand.derivedCommands.pick2D = derived2DCommand; @@ -880,7 +881,7 @@ function createCommands( translucent, twoPasses, colorCommands, - pickCommands + pickCommands, ) { createColorCommands(classificationPrimitive, colorCommands); createPickCommands(classificationPrimitive, pickCommands); @@ -896,7 +897,7 @@ function updateAndQueueRenderCommand( modelMatrix, cull, boundingVolume, - debugShowBoundingVolume + debugShowBoundingVolume, ) { command.modelMatrix = modelMatrix; command.boundingVolume = boundingVolume; @@ -911,7 +912,7 @@ function updateAndQueuePickCommand( frameState, modelMatrix, cull, - boundingVolume + boundingVolume, ) { command.modelMatrix = modelMatrix; command.boundingVolume = boundingVolume; @@ -928,7 +929,7 @@ function updateAndQueueCommands( modelMatrix, cull, debugShowBoundingVolume, - twoPasses + twoPasses, ) { const primitive = classificationPrimitive._primitive; Primitive._updateBoundingVolumes(primitive, frameState, modelMatrix); @@ -971,7 +972,7 @@ function updateAndQueueCommands( modelMatrix, cull, boundingVolume, - debugShowBoundingVolume + debugShowBoundingVolume, ); } if (queue3DTilesCommands) { @@ -982,7 +983,7 @@ function updateAndQueueCommands( modelMatrix, cull, boundingVolume, - debugShowBoundingVolume + debugShowBoundingVolume, ); } } @@ -999,7 +1000,7 @@ function updateAndQueueCommands( modelMatrix, cull, boundingVolume, - debugShowBoundingVolume + debugShowBoundingVolume, ); } } @@ -1018,7 +1019,7 @@ function updateAndQueueCommands( frameState, modelMatrix, cull, - boundingVolume + boundingVolume, ); } if (queue3DTilesCommands) { @@ -1028,7 +1029,7 @@ function updateAndQueueCommands( frameState, modelMatrix, cull, - boundingVolume + boundingVolume, ); } } @@ -1080,12 +1081,12 @@ ClassificationPrimitive.prototype.update = function (frameState) { attributes = instances[0].attributes; // Not expecting these to be set by users, should only be set via GroundPrimitive. // So don't check for mismatch. - hasSphericalExtentsAttribute = ShadowVolumeAppearance.hasAttributesForSphericalExtents( - attributes - ); - hasPlanarExtentsAttributes = ShadowVolumeAppearance.hasAttributesForTextureCoordinatePlanes( - attributes - ); + hasSphericalExtentsAttribute = + ShadowVolumeAppearance.hasAttributesForSphericalExtents(attributes); + hasPlanarExtentsAttributes = + ShadowVolumeAppearance.hasAttributesForTextureCoordinatePlanes( + attributes, + ); firstColor = attributes.color; } @@ -1098,7 +1099,7 @@ ClassificationPrimitive.prototype.update = function (frameState) { //>>includeStart('debug', pragmas.debug); else if (hasPerColorAttribute) { throw new DeveloperError( - "All GeometryInstances must have color attributes to use per-instance color." + "All GeometryInstances must have color attributes to use per-instance color.", ); } //>>includeEnd('debug'); @@ -1117,7 +1118,7 @@ ClassificationPrimitive.prototype.update = function (frameState) { !hasPlanarExtentsAttributes ) { throw new DeveloperError( - "All GeometryInstances must have the same color attribute except via GroundPrimitives" + "All GeometryInstances must have the same color attribute except via GroundPrimitives", ); } @@ -1135,7 +1136,7 @@ ClassificationPrimitive.prototype.update = function (frameState) { appearance instanceof PerInstanceColorAppearance ) { throw new DeveloperError( - "PerInstanceColorAppearance requires color GeometryInstanceAttributes on all GeometryInstances" + "PerInstanceColorAppearance requires color GeometryInstanceAttributes on all GeometryInstances", ); } if ( @@ -1144,7 +1145,7 @@ ClassificationPrimitive.prototype.update = function (frameState) { !hasPlanarExtentsAttributes ) { throw new DeveloperError( - "Materials on ClassificationPrimitives are not supported except via GroundPrimitives" + "Materials on ClassificationPrimitives are not supported except via GroundPrimitives", ); } //>>includeEnd('debug'); @@ -1173,7 +1174,7 @@ ClassificationPrimitive.prototype.update = function (frameState) { if (defined(this._createBoundingVolumeFunction)) { primitiveOptions._createBoundingVolumeFunction = function ( frameState, - geometry + geometry, ) { that._createBoundingVolumeFunction(frameState, geometry); }; @@ -1183,14 +1184,14 @@ ClassificationPrimitive.prototype.update = function (frameState) { primitive, context, appearance, - twoPasses + twoPasses, ) { createRenderStates(that, context); }; primitiveOptions._createShaderProgramFunction = function ( primitive, frameState, - appearance + appearance, ) { createShaderProgram(that, frameState); }; @@ -1201,7 +1202,7 @@ ClassificationPrimitive.prototype.update = function (frameState) { translucent, twoPasses, colorCommands, - pickCommands + pickCommands, ) { createCommands( that, @@ -1210,7 +1211,7 @@ ClassificationPrimitive.prototype.update = function (frameState) { true, false, colorCommands, - pickCommands + pickCommands, ); }; @@ -1223,7 +1224,7 @@ ClassificationPrimitive.prototype.update = function (frameState) { modelMatrix, cull, debugShowBoundingVolume, - twoPasses + twoPasses, ) { that._updateAndQueueCommandsFunction( primitive, @@ -1233,7 +1234,7 @@ ClassificationPrimitive.prototype.update = function (frameState) { modelMatrix, cull, debugShowBoundingVolume, - twoPasses + twoPasses, ); }; } else { @@ -1245,7 +1246,7 @@ ClassificationPrimitive.prototype.update = function (frameState) { modelMatrix, cull, debugShowBoundingVolume, - twoPasses + twoPasses, ) { updateAndQueueCommands( that, @@ -1255,7 +1256,7 @@ ClassificationPrimitive.prototype.update = function (frameState) { modelMatrix, cull, debugShowBoundingVolume, - twoPasses + twoPasses, ); }; } @@ -1270,19 +1271,19 @@ ClassificationPrimitive.prototype.update = function (frameState) { ) { this._debugShowShadowVolume = true; this._rsStencilDepthPass = RenderState.fromCache( - getStencilDepthRenderState(false, false) + getStencilDepthRenderState(false, false), ); this._rsStencilDepthPass3DTiles = RenderState.fromCache( - getStencilDepthRenderState(false, true) + getStencilDepthRenderState(false, true), ); this._rsColorPass = RenderState.fromCache(getColorRenderState(false)); } else if (!this.debugShowShadowVolume && this._debugShowShadowVolume) { this._debugShowShadowVolume = false; this._rsStencilDepthPass = RenderState.fromCache( - getStencilDepthRenderState(true, false) + getStencilDepthRenderState(true, false), ); this._rsStencilDepthPass3DTiles = RenderState.fromCache( - getStencilDepthRenderState(true, true) + getStencilDepthRenderState(true, true), ); this._rsColorPass = RenderState.fromCache(getColorRenderState(true)); } @@ -1296,7 +1297,7 @@ ClassificationPrimitive.prototype.update = function (frameState) { defined(appearance.material) ) { throw new DeveloperError( - "Materials on ClassificationPrimitives are not supported except via GroundPrimitive" + "Materials on ClassificationPrimitives are not supported except via GroundPrimitive", ); } if ( @@ -1304,7 +1305,7 @@ ClassificationPrimitive.prototype.update = function (frameState) { appearance instanceof PerInstanceColorAppearance ) { throw new DeveloperError( - "PerInstanceColorAppearance requires color GeometryInstanceAttribute" + "PerInstanceColorAppearance requires color GeometryInstanceAttribute", ); } //>>includeEnd('debug'); @@ -1340,12 +1341,12 @@ ClassificationPrimitive.prototype.update = function (frameState) { * attributes.show = Cesium.ShowGeometryInstanceAttribute.toValue(true); */ ClassificationPrimitive.prototype.getGeometryInstanceAttributes = function ( - id + id, ) { //>>includeStart('debug', pragmas.debug); if (!defined(this._primitive)) { throw new DeveloperError( - "must call update before calling getGeometryInstanceAttributes" + "must call update before calling getGeometryInstanceAttributes", ); } //>>includeEnd('debug'); diff --git a/packages/engine/Source/Scene/ClippingPlaneCollection.js b/packages/engine/Source/Scene/ClippingPlaneCollection.js index c9c9d84a3cfa..d1372aafba61 100644 --- a/packages/engine/Source/Scene/ClippingPlaneCollection.js +++ b/packages/engine/Source/Scene/ClippingPlaneCollection.js @@ -85,7 +85,7 @@ function ClippingPlaneCollection(options) { * @default Matrix4.IDENTITY */ this.modelMatrix = Matrix4.clone( - defaultValue(options.modelMatrix, Matrix4.IDENTITY) + defaultValue(options.modelMatrix, Matrix4.IDENTITY), ); /** @@ -126,7 +126,7 @@ function ClippingPlaneCollection(options) { const unionClippingRegions = defaultValue( options.unionClippingRegions, - false + false, ); this._unionClippingRegions = unionClippingRegions; this._testIntersection = unionClippingRegions @@ -415,7 +415,7 @@ function packPlanesAsUint8(clippingPlaneCollection, startIndex, endIndex) { const oct32Normal = AttributeCompression.octEncodeToCartesian4( plane.normal, - oct32EncodeScratch + oct32EncodeScratch, ); uint8View[byteIndex] = oct32Normal.x; uint8View[byteIndex + 1] = oct32Normal.y; @@ -424,7 +424,7 @@ function packPlanesAsUint8(clippingPlaneCollection, startIndex, endIndex) { const encodedDistance = Cartesian4.packFloat( plane.distance, - distanceEncodeScratch + distanceEncodeScratch, ); uint8View[byteIndex + 4] = encodedDistance.x; uint8View[byteIndex + 5] = encodedDistance.y; @@ -506,7 +506,7 @@ ClippingPlaneCollection.prototype.update = function (frameState) { if (!defined(clippingPlanesTexture)) { const requiredResolution = computeTextureResolution( pixelsNeeded, - textureResolutionScratch + textureResolutionScratch, ); // Allocate twice as much space as needed to avoid frequent texture reallocation. // Allocate in the Y direction, since texture may be as wide as context texture support. @@ -523,7 +523,7 @@ ClippingPlaneCollection.prototype.update = function (frameState) { flipY: false, }); this._float32View = new Float32Array( - requiredResolution.x * requiredResolution.y * 4 + requiredResolution.x * requiredResolution.y * 4, ); } else { clippingPlanesTexture = new Texture({ @@ -536,7 +536,7 @@ ClippingPlaneCollection.prototype.update = function (frameState) { flipY: false, }); this._uint8View = new Uint8Array( - requiredResolution.x * requiredResolution.y * 4 + requiredResolution.x * requiredResolution.y * 4, ); } @@ -569,7 +569,7 @@ ClippingPlaneCollection.prototype.update = function (frameState) { } else { offsetY = Math.floor((dirtyIndex * 2) / clippingPlanesTexture.width); offsetX = Math.floor( - dirtyIndex * 2 - offsetY * clippingPlanesTexture.width + dirtyIndex * 2 - offsetY * clippingPlanesTexture.width, ); packPlanesAsUint8(this, dirtyIndex, dirtyIndex + 1); clippingPlanesTexture.copyFrom({ @@ -619,42 +619,40 @@ const scratchPlane = new Plane(Cartesian3.UNIT_X, 0.0); * if the entire volume is on the opposite side and should be clipped, and * {@link Intersect.INTERSECTING} if the volume intersects the planes. */ -ClippingPlaneCollection.prototype.computeIntersectionWithBoundingVolume = function ( - tileBoundingVolume, - transform -) { - const planes = this._planes; - const length = planes.length; - - let modelMatrix = this.modelMatrix; - if (defined(transform)) { - modelMatrix = Matrix4.multiply(transform, modelMatrix, scratchMatrix); - } +ClippingPlaneCollection.prototype.computeIntersectionWithBoundingVolume = + function (tileBoundingVolume, transform) { + const planes = this._planes; + const length = planes.length; + + let modelMatrix = this.modelMatrix; + if (defined(transform)) { + modelMatrix = Matrix4.multiply(transform, modelMatrix, scratchMatrix); + } - // If the collection is not set to union the clipping regions, the volume must be outside of all planes to be - // considered completely clipped. If the collection is set to union the clipping regions, if the volume can be - // outside any the planes, it is considered completely clipped. - // Lastly, if not completely clipped, if any plane is intersecting, more calculations must be performed. - let intersection = Intersect.INSIDE; - if (!this.unionClippingRegions && length > 0) { - intersection = Intersect.OUTSIDE; - } + // If the collection is not set to union the clipping regions, the volume must be outside of all planes to be + // considered completely clipped. If the collection is set to union the clipping regions, if the volume can be + // outside any the planes, it is considered completely clipped. + // Lastly, if not completely clipped, if any plane is intersecting, more calculations must be performed. + let intersection = Intersect.INSIDE; + if (!this.unionClippingRegions && length > 0) { + intersection = Intersect.OUTSIDE; + } - for (let i = 0; i < length; ++i) { - const plane = planes[i]; + for (let i = 0; i < length; ++i) { + const plane = planes[i]; - Plane.transform(plane, modelMatrix, scratchPlane); // ClippingPlane can be used for Plane math + Plane.transform(plane, modelMatrix, scratchPlane); // ClippingPlane can be used for Plane math - const value = tileBoundingVolume.intersectPlane(scratchPlane); - if (value === Intersect.INTERSECTING) { - intersection = value; - } else if (this._testIntersection(value)) { - return value; + const value = tileBoundingVolume.intersectPlane(scratchPlane); + if (value === Intersect.INTERSECTING) { + intersection = value; + } else if (this._testIntersection(value)) { + return value; + } } - } - return intersection; -}; + return intersection; + }; /** * Sets the owner for the input ClippingPlaneCollection if there wasn't another owner. @@ -668,7 +666,7 @@ ClippingPlaneCollection.prototype.computeIntersectionWithBoundingVolume = functi ClippingPlaneCollection.setOwner = function ( clippingPlaneCollection, owner, - key + key, ) { // Don't destroy the ClippingPlaneCollection if it is already owned by newOwner if (clippingPlaneCollection === owner[key]) { @@ -680,7 +678,7 @@ ClippingPlaneCollection.setOwner = function ( //>>includeStart('debug', pragmas.debug); if (defined(clippingPlaneCollection._owner)) { throw new DeveloperError( - "ClippingPlaneCollection should only be assigned to one object" + "ClippingPlaneCollection should only be assigned to one object", ); } //>>includeEnd('debug'); @@ -714,7 +712,7 @@ ClippingPlaneCollection.useFloatTexture = function (context) { ClippingPlaneCollection.getTextureResolution = function ( clippingPlaneCollection, context, - result + result, ) { const texture = clippingPlaneCollection.texture; if (defined(texture)) { diff --git a/packages/engine/Source/Scene/ClippingPolygon.js b/packages/engine/Source/Scene/ClippingPolygon.js index 2191a4e458ce..3b1886aa44b4 100644 --- a/packages/engine/Source/Scene/ClippingPolygon.js +++ b/packages/engine/Source/Scene/ClippingPolygon.js @@ -42,7 +42,7 @@ function ClippingPolygon(options) { Check.typeOf.number.greaterThanOrEquals( "options.positions.length", options.positions.length, - 3 + 3, ); //>>includeEnd('debug'); @@ -143,7 +143,7 @@ ClippingPolygon.prototype.computeRectangle = function (result) { this.positions, this.ellipsoid, undefined, - result + result, ); }; @@ -167,19 +167,19 @@ ClippingPolygon.prototype.computeSphericalExtents = function (result) { let spherePoint = Cartographic.toCartesian( Rectangle.southwest(rectangle), this.ellipsoid, - spherePointScratch + spherePointScratch, ); // Project into plane with vertical for latitude let magXY = Math.sqrt( - spherePoint.x * spherePoint.x + spherePoint.y * spherePoint.y + spherePoint.x * spherePoint.x + spherePoint.y * spherePoint.y, ); // Use fastApproximateAtan2 for alignment with shader let sphereLatitude = CesiumMath.fastApproximateAtan2(magXY, spherePoint.z); let sphereLongitude = CesiumMath.fastApproximateAtan2( spherePoint.x, - spherePoint.y + spherePoint.y, ); result.south = sphereLatitude; @@ -188,19 +188,19 @@ ClippingPolygon.prototype.computeSphericalExtents = function (result) { spherePoint = Cartographic.toCartesian( Rectangle.northeast(rectangle), this.ellipsoid, - spherePointScratch + spherePointScratch, ); // Project into plane with vertical for latitude magXY = Math.sqrt( - spherePoint.x * spherePoint.x + spherePoint.y * spherePoint.y + spherePoint.x * spherePoint.x + spherePoint.y * spherePoint.y, ); // Use fastApproximateAtan2 for alignment with shader sphereLatitude = CesiumMath.fastApproximateAtan2(magXY, spherePoint.z); sphereLongitude = CesiumMath.fastApproximateAtan2( spherePoint.x, - spherePoint.y + spherePoint.y, ); result.north = sphereLatitude; diff --git a/packages/engine/Source/Scene/ClippingPolygonCollection.js b/packages/engine/Source/Scene/ClippingPolygonCollection.js index dd960d690fe4..b1638373703d 100644 --- a/packages/engine/Source/Scene/ClippingPolygonCollection.js +++ b/packages/engine/Source/Scene/ClippingPolygonCollection.js @@ -407,9 +407,9 @@ function getExtents(polygons) { Rectangle.union( polygons[p].computeSphericalExtents(scratchRectangle), extents, - extents + extents, ), - extents + extents, ); extentsList[i] = undefined; @@ -442,7 +442,7 @@ function getExtents(polygons) { polygonIndicesList .filter(defined) .forEach((polygonIndices, e) => - polygonIndices.forEach((p) => extentsIndexByPolygon.set(p, e)) + polygonIndices.forEach((p) => extentsIndexByPolygon.set(p, e)), ); return { @@ -492,11 +492,11 @@ function packPolygonsAsFloats(clippingPolygonCollection) { // Use fastApproximateAtan2 for alignment with shader const latitudeApproximation = CesiumMath.fastApproximateAtan2( magXY, - spherePoint.z + spherePoint.z, ); const longitudeApproximation = CesiumMath.fastApproximateAtan2( spherePoint.x, - spherePoint.y + spherePoint.y, ); polygonsFloat32View[floatIndex++] = latitudeApproximation; @@ -534,14 +534,14 @@ ClippingPolygonCollection.prototype.update = function (frameState) { if (!ClippingPolygonCollection.isSupported(frameState)) { throw new RuntimeError( - "ClippingPolygonCollections are only supported for WebGL 2." + "ClippingPolygonCollections are only supported for WebGL 2.", ); } // It'd be expensive to validate any individual position has changed. Instead verify if the list of polygon positions has had elements added or removed, which should be good enough for most cases. const totalPositions = this._polygons.reduce( (totalPositions, polygon) => totalPositions + polygon.length, - 0 + 0, ); if (totalPositions === this.totalPositions) { @@ -584,7 +584,7 @@ ClippingPolygonCollection.prototype.update = function (frameState) { const requiredResolution = ClippingPolygonCollection.getTextureResolution( polygonsTexture, this.pixelsNeededForPolygonPositions, - textureResolutionScratch + textureResolutionScratch, ); polygonsTexture = new Texture({ @@ -597,7 +597,7 @@ ClippingPolygonCollection.prototype.update = function (frameState) { flipY: false, }); this._float32View = new Float32Array( - requiredResolution.x * requiredResolution.y * 2 + requiredResolution.x * requiredResolution.y * 2, ); this._polygonsTexture = polygonsTexture; } @@ -623,7 +623,7 @@ ClippingPolygonCollection.prototype.update = function (frameState) { const requiredResolution = ClippingPolygonCollection.getTextureResolution( extentsTexture, this.pixelsNeededForExtents, - textureResolutionScratch + textureResolutionScratch, ); extentsTexture = new Texture({ @@ -636,7 +636,7 @@ ClippingPolygonCollection.prototype.update = function (frameState) { flipY: false, }); this._extentsFloat32View = new Float32Array( - requiredResolution.x * requiredResolution.y * 4 + requiredResolution.x * requiredResolution.y * 4, ); this._extentsTexture = extentsTexture; @@ -661,10 +661,11 @@ ClippingPolygonCollection.prototype.update = function (frameState) { }); if (!defined(signedDistanceTexture)) { - const textureDimensions = ClippingPolygonCollection.getClippingDistanceTextureResolution( - this, - textureResolutionScratch - ); + const textureDimensions = + ClippingPolygonCollection.getClippingDistanceTextureResolution( + this, + textureResolutionScratch, + ); signedDistanceTexture = new Texture({ context: context, width: textureDimensions.x, @@ -741,56 +742,54 @@ const scratchRectangleIntersection = new Rectangle(); * @returns {Intersect} The intersection type: {@link Intersect.OUTSIDE} if the entire volume is not clipped, {@link Intersect.INSIDE} * if the entire volume should be clipped, and {@link Intersect.INTERSECTING} if the volume intersects the polygons and will partially clipped. */ -ClippingPolygonCollection.prototype.computeIntersectionWithBoundingVolume = function ( - tileBoundingVolume, - ellipsoid -) { - const polygons = this._polygons; - const length = polygons.length; +ClippingPolygonCollection.prototype.computeIntersectionWithBoundingVolume = + function (tileBoundingVolume, ellipsoid) { + const polygons = this._polygons; + const length = polygons.length; + + let intersection = Intersect.OUTSIDE; + if (this.inverse) { + intersection = Intersect.INSIDE; + } - let intersection = Intersect.OUTSIDE; - if (this.inverse) { - intersection = Intersect.INSIDE; - } + for (let i = 0; i < length; ++i) { + const polygon = polygons[i]; - for (let i = 0; i < length; ++i) { - const polygon = polygons[i]; + const polygonBoundingRectangle = polygon.computeRectangle(); + let tileBoundingRectangle = tileBoundingVolume.rectangle; + if ( + !defined(tileBoundingRectangle) && + defined(tileBoundingVolume.boundingVolume?.computeCorners) + ) { + const points = tileBoundingVolume.boundingVolume.computeCorners(); + tileBoundingRectangle = Rectangle.fromCartesianArray( + points, + ellipsoid, + scratchRectangleTile, + ); + } - const polygonBoundingRectangle = polygon.computeRectangle(); - let tileBoundingRectangle = tileBoundingVolume.rectangle; - if ( - !defined(tileBoundingRectangle) && - defined(tileBoundingVolume.boundingVolume?.computeCorners) - ) { - const points = tileBoundingVolume.boundingVolume.computeCorners(); - tileBoundingRectangle = Rectangle.fromCartesianArray( - points, - ellipsoid, - scratchRectangleTile - ); - } + if (!defined(tileBoundingRectangle)) { + tileBoundingRectangle = Rectangle.fromBoundingSphere( + tileBoundingVolume.boundingSphere, + ellipsoid, + scratchRectangleTile, + ); + } - if (!defined(tileBoundingRectangle)) { - tileBoundingRectangle = Rectangle.fromBoundingSphere( - tileBoundingVolume.boundingSphere, - ellipsoid, - scratchRectangleTile + const result = Rectangle.simpleIntersection( + tileBoundingRectangle, + polygonBoundingRectangle, + scratchRectangleIntersection, ); - } - const result = Rectangle.simpleIntersection( - tileBoundingRectangle, - polygonBoundingRectangle, - scratchRectangleIntersection - ); - - if (defined(result)) { - intersection = Intersect.INTERSECTING; + if (defined(result)) { + intersection = Intersect.INTERSECTING; + } } - } - return intersection; -}; + return intersection; + }; /** * Sets the owner for the input ClippingPolygonCollection if there wasn't another owner. @@ -804,7 +803,7 @@ ClippingPolygonCollection.prototype.computeIntersectionWithBoundingVolume = func ClippingPolygonCollection.setOwner = function ( clippingPolygonsCollection, owner, - key + key, ) { // Don't destroy the ClippingPolygonCollection if it is already owned by newOwner if (clippingPolygonsCollection === owner[key]) { @@ -816,7 +815,7 @@ ClippingPolygonCollection.setOwner = function ( //>>includeStart('debug', pragmas.debug); if (defined(clippingPolygonsCollection._owner)) { throw new DeveloperError( - "ClippingPolygonCollection should only be assigned to one object" + "ClippingPolygonCollection should only be assigned to one object", ); } //>>includeEnd('debug'); @@ -849,7 +848,7 @@ ClippingPolygonCollection.isSupported = function (scene) { ClippingPolygonCollection.getTextureResolution = function ( texture, pixelsNeeded, - result + result, ) { if (defined(texture)) { result.x = texture.width; @@ -879,7 +878,7 @@ ClippingPolygonCollection.getTextureResolution = function ( */ ClippingPolygonCollection.getClippingDistanceTextureResolution = function ( clippingPolygonCollection, - result + result, ) { const texture = clippingPolygonCollection.signedDistanceTexture; if (defined(texture)) { @@ -906,7 +905,7 @@ ClippingPolygonCollection.getClippingDistanceTextureResolution = function ( */ ClippingPolygonCollection.getClippingExtentsTextureResolution = function ( clippingPolygonCollection, - result + result, ) { const texture = clippingPolygonCollection.extentsTexture; if (defined(texture)) { @@ -918,7 +917,7 @@ ClippingPolygonCollection.getClippingExtentsTextureResolution = function ( return ClippingPolygonCollection.getTextureResolution( texture, clippingPolygonCollection.pixelsNeededForExtents, - result + result, ); }; diff --git a/packages/engine/Source/Scene/CloudCollection.js b/packages/engine/Source/Scene/CloudCollection.js index 43af3d6266a7..da168182e3ed 100644 --- a/packages/engine/Source/Scene/CloudCollection.js +++ b/packages/engine/Source/Scene/CloudCollection.js @@ -168,7 +168,7 @@ function CloudCollection(options) { * @default Cartesian3.ZERO */ this.noiseOffset = Cartesian3.clone( - defaultValue(options.noiseOffset, Cartesian3.ZERO) + defaultValue(options.noiseOffset, Cartesian3.ZERO), ); this._loading = false; @@ -447,14 +447,7 @@ CloudCollection.prototype.get = function (index) { }; const texturePositions = new Float32Array([ - -1.0, - -1.0, - 1.0, - -1.0, - 1.0, - 1.0, - -1.0, - 1.0, + -1.0, -1.0, 1.0, -1.0, 1.0, 1.0, -1.0, 1.0, ]); const textureIndices = new Uint16Array([0, 1, 2, 0, 2, 3]); @@ -713,7 +706,7 @@ function createNoiseTexture(cloudCollection, frameState, vsSource, fsSource) { textureSliceWidth % noiseTextureRows !== 0 ) { throw new DeveloperError( - "noiseTextureRows must evenly divide textureSliceWidth" + "noiseTextureRows must evenly divide textureSliceWidth", ); } //>>includeEnd('debug'); diff --git a/packages/engine/Source/Scene/Composite3DTileContent.js b/packages/engine/Source/Scene/Composite3DTileContent.js index 02be6c08ac6c..c9636bcda93a 100644 --- a/packages/engine/Source/Scene/Composite3DTileContent.js +++ b/packages/engine/Source/Scene/Composite3DTileContent.js @@ -222,7 +222,7 @@ Composite3DTileContent.fromTileType = async function ( resource, arrayBuffer, byteOffset, - factory + factory, ) { byteOffset = defaultValue(byteOffset, 0); @@ -233,7 +233,7 @@ Composite3DTileContent.fromTileType = async function ( const version = view.getUint32(byteOffset, true); if (version !== 1) { throw new RuntimeError( - `Only Composite Tile version 1 is supported. Version ${version} is not.` + `Only Composite Tile version 1 is supported. Version ${version} is not.`, ); } byteOffset += sizeOfUint32; @@ -278,11 +278,11 @@ Composite3DTileContent.fromTileType = async function ( if (defined(contentFactory)) { promises[i] = Promise.resolve( - contentFactory(tileset, tile, childResource, arrayBuffer, byteOffset) + contentFactory(tileset, tile, childResource, arrayBuffer, byteOffset), ); } else { throw new RuntimeError( - `Unknown tile content type, ${tileType}, inside Composite tile` + `Unknown tile content type, ${tileType}, inside Composite tile`, ); } @@ -294,7 +294,7 @@ Composite3DTileContent.fromTileType = async function ( tileset, tile, resource, - innerContents + innerContents, ); return content; }; @@ -317,7 +317,7 @@ Composite3DTileContent.prototype.getFeature = function (batchId) { Composite3DTileContent.prototype.applyDebugSettings = function ( enabled, - color + color, ) { const contents = this._contents; const length = contents.length; diff --git a/packages/engine/Source/Scene/ConditionsExpression.js b/packages/engine/Source/Scene/ConditionsExpression.js index 1bed27442ace..b88e01cc2053 100644 --- a/packages/engine/Source/Scene/ConditionsExpression.js +++ b/packages/engine/Source/Scene/ConditionsExpression.js @@ -73,8 +73,8 @@ function setRuntime(expression, defines) { runtimeConditions.push( new Statement( new Expression(cond, defines), - new Expression(condExpression, defines) - ) + new Expression(condExpression, defines), + ), ); } expression._runtimeConditions = runtimeConditions; @@ -148,7 +148,7 @@ ConditionsExpression.prototype.getShaderFunction = function ( functionSignature, variableSubstitutionMap, shaderState, - returnType + returnType, ) { const conditions = this._runtimeConditions; if (!defined(conditions) || conditions.length === 0) { @@ -162,11 +162,11 @@ ConditionsExpression.prototype.getShaderFunction = function ( const condition = statement.condition.getShaderExpression( variableSubstitutionMap, - shaderState + shaderState, ); const expression = statement.expression.getShaderExpression( variableSubstitutionMap, - shaderState + shaderState, ); // Build the if/else chain from the list of conditions diff --git a/packages/engine/Source/Scene/ContentMetadata.js b/packages/engine/Source/Scene/ContentMetadata.js index adc66fcd4ca7..b09c9077ed3c 100644 --- a/packages/engine/Source/Scene/ContentMetadata.js +++ b/packages/engine/Source/Scene/ContentMetadata.js @@ -100,7 +100,7 @@ ContentMetadata.prototype.hasPropertyBySemantic = function (semantic) { return MetadataEntity.hasPropertyBySemantic( semantic, this._properties, - this._class + this._class, ); }; @@ -145,7 +145,7 @@ ContentMetadata.prototype.setProperty = function (propertyId, value) { propertyId, value, this._properties, - this._class + this._class, ); }; @@ -160,7 +160,7 @@ ContentMetadata.prototype.getPropertyBySemantic = function (semantic) { return MetadataEntity.getPropertyBySemantic( semantic, this._properties, - this._class + this._class, ); }; @@ -177,7 +177,7 @@ ContentMetadata.prototype.setPropertyBySemantic = function (semantic, value) { semantic, value, this._properties, - this._class + this._class, ); }; diff --git a/packages/engine/Source/Scene/CreditDisplay.js b/packages/engine/Source/Scene/CreditDisplay.js index cda1a16f8fe5..c2716ce8780f 100644 --- a/packages/engine/Source/Scene/CreditDisplay.js +++ b/packages/engine/Source/Scene/CreditDisplay.js @@ -102,7 +102,7 @@ function displayCredits(container, credits, delimiter, elementWrapperTagName) { if (existingDelimiter.className !== delimiterClassName) { container.replaceChild( createDelimiterElement(delimiter), - existingDelimiter + existingDelimiter, ); } } @@ -114,7 +114,7 @@ function displayCredits(container, credits, delimiter, elementWrapperTagName) { // check to see if the correct credit is in the right place if (childNodes.length <= domIndex) { container.appendChild( - createCreditElement(element, elementWrapperTagName) + createCreditElement(element, elementWrapperTagName), ); } else { const existingElement = childNodes[domIndex]; @@ -122,7 +122,7 @@ function displayCredits(container, credits, delimiter, elementWrapperTagName) { // not the right credit, swap it in container.replaceChild( createCreditElement(element, elementWrapperTagName), - existingElement + existingElement, ); } } @@ -149,7 +149,7 @@ function styleLightboxContainer(that) { lightboxCredits.className = "cesium-credit-lightbox cesium-credit-lightbox-expanded"; lightboxCredits.style.marginTop = `${Math.floor( - (height - lightboxCredits.clientHeight) * 0.5 + (height - lightboxCredits.clientHeight) * 0.5, )}px`; } that._lastViewportWidth = width; @@ -157,7 +157,7 @@ function styleLightboxContainer(that) { if (width >= mobileWidth && height !== that._lastViewportHeight) { lightboxCredits.style.marginTop = `${Math.floor( - (height - lightboxCredits.clientHeight) * 0.5 + (height - lightboxCredits.clientHeight) * 0.5, )}px`; that._lastViewportHeight = height; } @@ -275,7 +275,7 @@ function appendCss(container) { const shadowRootOrDocumentHead = defaultValue( getShadowRoot(container), - document.head + document.head, ); const styleElem = document.createElement("style"); styleElem.innerHTML = style; @@ -562,7 +562,7 @@ CreditDisplay.prototype.endFrame = function () { this._screenContainer, screenCredits, this._delimiter, - undefined + undefined, ); const lightboxCredits = this._currentFrameCredits.lightboxCredits.values; @@ -625,7 +625,7 @@ function getDefaultCredit() { defaultCredit = new Credit( ``, - true + true, ); } diff --git a/packages/engine/Source/Scene/CumulusCloud.js b/packages/engine/Source/Scene/CumulusCloud.js index d66dd964813f..bfde2ff7e4f3 100644 --- a/packages/engine/Source/Scene/CumulusCloud.js +++ b/packages/engine/Source/Scene/CumulusCloud.js @@ -38,7 +38,7 @@ function CumulusCloud(options, cloudCollection) { this._show = defaultValue(options.show, true); this._position = Cartesian3.clone( - defaultValue(options.position, Cartesian3.ZERO) + defaultValue(options.position, Cartesian3.ZERO), ); if (!defined(options.scale) && defined(options.maximumSize)) { @@ -46,16 +46,16 @@ function CumulusCloud(options, cloudCollection) { this._scale = new Cartesian2(this._maximumSize.x, this._maximumSize.y); } else { this._scale = Cartesian2.clone( - defaultValue(options.scale, new Cartesian2(20.0, 12.0)) + defaultValue(options.scale, new Cartesian2(20.0, 12.0)), ); const defaultMaxSize = new Cartesian3( this._scale.x, this._scale.y, - Math.min(this._scale.x, this._scale.y) / 1.5 + Math.min(this._scale.x, this._scale.y) / 1.5, ); this._maximumSize = Cartesian3.clone( - defaultValue(options.maximumSize, defaultMaxSize) + defaultValue(options.maximumSize, defaultMaxSize), ); } diff --git a/packages/engine/Source/Scene/DebugAppearance.js b/packages/engine/Source/Scene/DebugAppearance.js index 098eea16a602..f0d2b0fadfeb 100644 --- a/packages/engine/Source/Scene/DebugAppearance.js +++ b/packages/engine/Source/Scene/DebugAppearance.js @@ -80,7 +80,7 @@ function DebugAppearance(options) { //>>includeStart('debug', pragmas.debug); default: throw new DeveloperError( - "options.glslDatatype must be float, vec2, vec3, or vec4." + "options.glslDatatype must be float, vec2, vec3, or vec4.", ); //>>includeEnd('debug'); } @@ -133,7 +133,7 @@ function DebugAppearance(options) { this._renderState = Appearance.getDefaultRenderState( false, false, - options.renderState + options.renderState, ); this._closed = defaultValue(options.closed, false); diff --git a/packages/engine/Source/Scene/DebugCameraPrimitive.js b/packages/engine/Source/Scene/DebugCameraPrimitive.js index 414882b124a9..d5ad4a421f8a 100644 --- a/packages/engine/Source/Scene/DebugCameraPrimitive.js +++ b/packages/engine/Source/Scene/DebugCameraPrimitive.js @@ -151,7 +151,7 @@ DebugCameraPrimitive.prototype.update = function (frameState) { const orientation = Quaternion.fromRotationMatrix( rotation, - scratchOrientation + scratchOrientation, ); planesPrimitives.length = outlinePrimitives.length = numFrustums; @@ -170,7 +170,7 @@ DebugCameraPrimitive.prototype.update = function (frameState) { }), attributes: { color: ColorGeometryInstanceAttribute.fromColor( - Color.fromAlpha(this._color, 0.1, scratchColor) + Color.fromAlpha(this._color, 0.1, scratchColor), ), }, id: this.id, diff --git a/packages/engine/Source/Scene/DebugInspector.js b/packages/engine/Source/Scene/DebugInspector.js index 899933f7c915..e95de9ccb8f6 100644 --- a/packages/engine/Source/Scene/DebugInspector.js +++ b/packages/engine/Source/Scene/DebugInspector.js @@ -126,7 +126,7 @@ const scratchShowFrustumCommand = new DrawCommand(); DebugInspector.prototype.executeDebugShowFrustumsCommand = function ( scene, command, - passState + passState, ) { // create debug command const shaderProgramId = command.shaderProgram.id; @@ -134,7 +134,7 @@ DebugInspector.prototype.executeDebugShowFrustumsCommand = function ( if (!defined(debugShaderProgram)) { debugShaderProgram = createDebugShowFrustumsShaderProgram( scene, - command.shaderProgram + command.shaderProgram, ); this._cachedShowFrustumsShaders[shaderProgramId] = debugShaderProgram; @@ -142,7 +142,7 @@ DebugInspector.prototype.executeDebugShowFrustumsCommand = function ( const debugCommand = DrawCommand.shallowClone( command, - scratchShowFrustumCommand + scratchShowFrustumCommand, ); debugCommand.shaderProgram = debugShaderProgram; debugCommand.uniformMap = createDebugShowFrustumsUniformMap(scene, command); diff --git a/packages/engine/Source/Scene/DebugModelMatrixPrimitive.js b/packages/engine/Source/Scene/DebugModelMatrixPrimitive.js index 7ab16bb7738c..61214248993c 100644 --- a/packages/engine/Source/Scene/DebugModelMatrixPrimitive.js +++ b/packages/engine/Source/Scene/DebugModelMatrixPrimitive.js @@ -74,7 +74,7 @@ function DebugModelMatrixPrimitive(options) { * @default {@link Matrix4.IDENTITY} */ this.modelMatrix = Matrix4.clone( - defaultValue(options.modelMatrix, Matrix4.IDENTITY) + defaultValue(options.modelMatrix, Matrix4.IDENTITY), ); this._modelMatrix = new Matrix4(); @@ -136,7 +136,7 @@ DebugModelMatrixPrimitive.prototype.update = function (frameState) { modelMatrix: Matrix4.multiplyByUniformScale( this.modelMatrix, this.length, - new Matrix4() + new Matrix4(), ), id: this.id, pickPrimitive: this, @@ -152,7 +152,7 @@ DebugModelMatrixPrimitive.prototype.update = function (frameState) { modelMatrix: Matrix4.multiplyByUniformScale( this.modelMatrix, this.length, - new Matrix4() + new Matrix4(), ), id: this.id, pickPrimitive: this, @@ -168,7 +168,7 @@ DebugModelMatrixPrimitive.prototype.update = function (frameState) { modelMatrix: Matrix4.multiplyByUniformScale( this.modelMatrix, this.length, - new Matrix4() + new Matrix4(), ), id: this.id, pickPrimitive: this, diff --git a/packages/engine/Source/Scene/DepthPlane.js b/packages/engine/Source/Scene/DepthPlane.js index 234ae355b313..a45fe0c68ab6 100644 --- a/packages/engine/Source/Scene/DepthPlane.js +++ b/packages/engine/Source/Scene/DepthPlane.js @@ -58,7 +58,7 @@ function computeDepthQuad(ellipsoid, frameState) { const q = Cartesian3.multiplyComponents( ellipsoid.oneOverRadii, p, - scratchCartesian1 + scratchCartesian1, ); const qUnit = Cartesian3.normalize(q, scratchCartesian2); @@ -66,11 +66,11 @@ function computeDepthQuad(ellipsoid, frameState) { // Determine the east and north directions at q. const eUnit = Cartesian3.normalize( Cartesian3.cross(Cartesian3.UNIT_Z, q, scratchCartesian3), - scratchCartesian3 + scratchCartesian3, ); const nUnit = Cartesian3.normalize( Cartesian3.cross(qUnit, eUnit, scratchCartesian4), - scratchCartesian4 + scratchCartesian4, ); const qMagnitude = Cartesian3.magnitude(q); @@ -82,7 +82,7 @@ function computeDepthQuad(ellipsoid, frameState) { center = Cartesian3.multiplyByScalar( qUnit, 1.0 / qMagnitude, - scratchCartesian1 + scratchCartesian1, ); const scalar = wMagnitude / qMagnitude; eastOffset = Cartesian3.multiplyByScalar(eUnit, scalar, scratchCartesian2); @@ -108,7 +108,7 @@ function computeDepthQuad(ellipsoid, frameState) { const lowerRight = Cartesian3.subtract( center, northOffset, - scratchCartesian5 + scratchCartesian5, ); Cartesian3.add(lowerRight, eastOffset, lowerRight); Cartesian3.multiplyComponents(radii, lowerRight, lowerRight); @@ -130,7 +130,7 @@ DepthPlane.prototype.update = function (frameState) { const ellipsoid = new Ellipsoid( radii.x + this._ellipsoidOffset, radii.y + this._ellipsoidOffset, - radii.z + this._ellipsoidOffset + radii.z + this._ellipsoidOffset, ); const useLogDepth = frameState.useLogDepth; @@ -156,7 +156,7 @@ DepthPlane.prototype.update = function (frameState) { renderState: this._rs, boundingVolume: new BoundingSphere( Cartesian3.ZERO, - ellipsoid.maximumRadius + ellipsoid.maximumRadius, ), pass: Pass.OPAQUE, owner: this, diff --git a/packages/engine/Source/Scene/DerivedCommand.js b/packages/engine/Source/Scene/DerivedCommand.js index 431de308f79b..d64958604815 100644 --- a/packages/engine/Source/Scene/DerivedCommand.js +++ b/packages/engine/Source/Scene/DerivedCommand.js @@ -14,7 +14,7 @@ const discardRegex = /\bdiscard\b/; function getDepthOnlyShaderProgram(context, shaderProgram) { let shader = context.shaderCache.getDerivedShaderProgram( shaderProgram, - "depthOnly" + "depthOnly", ); if (!defined(shader)) { const attributeLocations = shaderProgram._attributeLocations; @@ -71,7 +71,7 @@ function getDepthOnlyShaderProgram(context, shaderProgram) { vertexShaderSource: shaderProgram.vertexShaderSource, fragmentShaderSource: fs, attributeLocations: attributeLocations, - } + }, ); } @@ -102,7 +102,7 @@ DerivedCommand.createDepthOnlyDerivedCommand = function ( scene, command, context, - result + result, ) { // For a depth only pass, we bind a framebuffer with only a depth attachment (no color attachments), // do not write color, and write depth. If the fragment shader doesn't modify the fragment depth @@ -122,17 +122,17 @@ DerivedCommand.createDepthOnlyDerivedCommand = function ( result.depthOnlyCommand = DrawCommand.shallowClone( command, - result.depthOnlyCommand + result.depthOnlyCommand, ); if (!defined(shader) || result.shaderProgramId !== command.shaderProgram.id) { result.depthOnlyCommand.shaderProgram = getDepthOnlyShaderProgram( context, - command.shaderProgram + command.shaderProgram, ); result.depthOnlyCommand.renderState = getDepthOnlyRenderState( scene, - command.renderState + command.renderState, ); result.shaderProgramId = command.shaderProgram.id; } else { @@ -156,7 +156,7 @@ function getLogDepthShaderProgram(context, shaderProgram) { let shader = context.shaderCache.getDerivedShaderProgram( shaderProgram, - "logDepth" + "logDepth", ); if (!defined(shader)) { const attributeLocations = shaderProgram._attributeLocations; @@ -234,7 +234,7 @@ function getLogDepthShaderProgram(context, shaderProgram) { vertexShaderSource: vs, fragmentShaderSource: fs, attributeLocations: attributeLocations, - } + }, ); } @@ -256,7 +256,7 @@ DerivedCommand.createLogDepthCommand = function (command, context, result) { if (!defined(shader) || result.shaderProgramId !== command.shaderProgram.id) { result.command.shaderProgram = getLogDepthShaderProgram( context, - command.shaderProgram + command.shaderProgram, ); result.shaderProgramId = command.shaderProgram.id; } else { @@ -269,7 +269,7 @@ DerivedCommand.createLogDepthCommand = function (command, context, result) { function getPickShaderProgram(context, shaderProgram, pickId) { let shader = context.shaderCache.getDerivedShaderProgram( shaderProgram, - "pick" + "pick", ); if (!defined(shader)) { const attributeLocations = shaderProgram._attributeLocations; @@ -279,18 +279,18 @@ function getPickShaderProgram(context, shaderProgram, pickId) { const length = sources.length; const hasFragData = sources.some((source) => - source.includes("out_FragData") + source.includes("out_FragData"), ); const outputColorVariable = hasFragData ? "out_FragData_0" : "out_FragColor"; - const newMain = `void main () -{ - czm_non_pick_main(); - if (${outputColorVariable}.a == 0.0) { - discard; - } - ${outputColorVariable} = ${pickId}; + const newMain = `void main () +{ + czm_non_pick_main(); + if (${outputColorVariable}.a == 0.0) { + discard; + } + ${outputColorVariable} = ${pickId}; } `; const newSources = new Array(length + 1); @@ -309,7 +309,7 @@ function getPickShaderProgram(context, shaderProgram, pickId) { vertexShaderSource: shaderProgram.vertexShaderSource, fragmentShaderSource: fs, attributeLocations: attributeLocations, - } + }, ); } @@ -341,7 +341,7 @@ DerivedCommand.createPickDerivedCommand = function ( scene, command, context, - result + result, ) { if (!defined(result)) { result = {}; @@ -360,11 +360,11 @@ DerivedCommand.createPickDerivedCommand = function ( result.pickCommand.shaderProgram = getPickShaderProgram( context, command.shaderProgram, - command.pickId + command.pickId, ); result.pickCommand.renderState = getPickRenderState( scene, - command.renderState + command.renderState, ); result.shaderProgramId = command.shaderProgram.id; } else { @@ -378,7 +378,7 @@ DerivedCommand.createPickDerivedCommand = function ( function getHdrShaderProgram(context, shaderProgram) { let shader = context.shaderCache.getDerivedShaderProgram( shaderProgram, - "HDR" + "HDR", ); if (!defined(shader)) { const attributeLocations = shaderProgram._attributeLocations; @@ -397,7 +397,7 @@ function getHdrShaderProgram(context, shaderProgram) { vertexShaderSource: vs, fragmentShaderSource: fs, attributeLocations: attributeLocations, - } + }, ); } @@ -419,7 +419,7 @@ DerivedCommand.createHdrCommand = function (command, context, result) { if (!defined(shader) || result.shaderProgramId !== command.shaderProgram.id) { result.command.shaderProgram = getHdrShaderProgram( context, - command.shaderProgram + command.shaderProgram, ); result.shaderProgramId = command.shaderProgram.id; } else { diff --git a/packages/engine/Source/Scene/DiscardMissingTileImagePolicy.js b/packages/engine/Source/Scene/DiscardMissingTileImagePolicy.js index de950a3b0b1b..9cf5fc73a4e6 100644 --- a/packages/engine/Source/Scene/DiscardMissingTileImagePolicy.js +++ b/packages/engine/Source/Scene/DiscardMissingTileImagePolicy.js @@ -113,7 +113,7 @@ DiscardMissingTileImagePolicy.prototype.shouldDiscardImage = function (image) { //>>includeStart('debug', pragmas.debug); if (!this._isReady) { throw new DeveloperError( - "shouldDiscardImage must not be called before the discard policy is ready." + "shouldDiscardImage must not be called before the discard policy is ready.", ); } //>>includeEnd('debug'); diff --git a/packages/engine/Source/Scene/DracoLoader.js b/packages/engine/Source/Scene/DracoLoader.js index 56f2eaf71514..74a517504992 100644 --- a/packages/engine/Source/Scene/DracoLoader.js +++ b/packages/engine/Source/Scene/DracoLoader.js @@ -11,7 +11,7 @@ function DracoLoader() {} // Maximum concurrency to use when decoding draco models DracoLoader._maxDecodingConcurrency = Math.max( FeatureDetection.hardwareConcurrency - 1, - 1 + 1, ); // Exposed for testing purposes @@ -22,7 +22,7 @@ DracoLoader._getDecoderTaskProcessor = function () { if (!defined(DracoLoader._decoderTaskProcessor)) { const processor = new TaskProcessor( "decodeDraco", - DracoLoader._maxDecodingConcurrency + DracoLoader._maxDecodingConcurrency, ); processor .initWebAssemblyModule({ @@ -33,7 +33,7 @@ DracoLoader._getDecoderTaskProcessor = function () { DracoLoader._taskProcessorReady = true; } else { DracoLoader._error = new RuntimeError( - "Draco decoder could not be initialized." + "Draco decoder could not be initialized.", ); } }) diff --git a/packages/engine/Source/Scene/EllipsoidPrimitive.js b/packages/engine/Source/Scene/EllipsoidPrimitive.js index 82530a0463c4..ab7d70811787 100644 --- a/packages/engine/Source/Scene/EllipsoidPrimitive.js +++ b/packages/engine/Source/Scene/EllipsoidPrimitive.js @@ -100,7 +100,7 @@ function EllipsoidPrimitive(options) { * e.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(origin); */ this.modelMatrix = Matrix4.clone( - defaultValue(options.modelMatrix, Matrix4.IDENTITY) + defaultValue(options.modelMatrix, Matrix4.IDENTITY), ); this._modelMatrix = new Matrix4(); this._computedModelMatrix = new Matrix4(); @@ -135,7 +135,7 @@ function EllipsoidPrimitive(options) { */ this.material = defaultValue( options.material, - Material.fromType(Material.ColorType) + Material.fromType(Material.ColorType), ); this._material = undefined; this._translucent = undefined; @@ -164,7 +164,7 @@ function EllipsoidPrimitive(options) { */ this.debugShowBoundingVolume = defaultValue( options.debugShowBoundingVolume, - false + false, ); /** @@ -223,7 +223,7 @@ function getVertexArray(context) { BoxGeometry.fromDimensions({ dimensions: new Cartesian3(2.0, 2.0, 2.0), vertexFormat: VertexFormat.POSITION_ONLY, - }) + }), ); vertexArray = VertexArray.fromGeometry({ @@ -321,7 +321,7 @@ EllipsoidPrimitive.prototype.update = function (frameState) { Matrix4.multiplyByTranslation( this.modelMatrix, this.center, - this._computedModelMatrix + this._computedModelMatrix, ); boundingSphereDirty = true; } @@ -332,7 +332,7 @@ EllipsoidPrimitive.prototype.update = function (frameState) { BoundingSphere.transform( this._boundingSphere, this._computedModelMatrix, - this._boundingSphere + this._boundingSphere, ); } @@ -452,7 +452,7 @@ EllipsoidPrimitive.prototype.update = function (frameState) { pickCommand.shaderProgram = this._pickSP; pickCommand.uniformMap = combine( combine(this._uniforms, this._pickUniforms), - this.material._uniforms + this.material._uniforms, ); pickCommand.executeInClosestFrustum = translucent; } diff --git a/packages/engine/Source/Scene/EllipsoidSurfaceAppearance.js b/packages/engine/Source/Scene/EllipsoidSurfaceAppearance.js index 30e4aaf91e37..f51ed1d2bcda 100644 --- a/packages/engine/Source/Scene/EllipsoidSurfaceAppearance.js +++ b/packages/engine/Source/Scene/EllipsoidSurfaceAppearance.js @@ -72,16 +72,16 @@ function EllipsoidSurfaceAppearance(options) { this._vertexShaderSource = defaultValue( options.vertexShaderSource, - EllipsoidSurfaceAppearanceVS + EllipsoidSurfaceAppearanceVS, ); this._fragmentShaderSource = defaultValue( options.fragmentShaderSource, - EllipsoidSurfaceAppearanceFS + EllipsoidSurfaceAppearanceFS, ); this._renderState = Appearance.getDefaultRenderState( translucent, !aboveGround, - options.renderState + options.renderState, ); this._closed = false; diff --git a/packages/engine/Source/Scene/Empty3DTileContent.js b/packages/engine/Source/Scene/Empty3DTileContent.js index 0b5c4459da35..2479baefb211 100644 --- a/packages/engine/Source/Scene/Empty3DTileContent.js +++ b/packages/engine/Source/Scene/Empty3DTileContent.js @@ -104,7 +104,7 @@ Object.defineProperties(Empty3DTileContent.prototype, { set: function (value) { //>>includeStart('debug', pragmas.debug); throw new DeveloperError( - "Empty3DTileContent cannot have content metadata" + "Empty3DTileContent cannot have content metadata", ); //>>includeEnd('debug'); }, diff --git a/packages/engine/Source/Scene/Expression.js b/packages/engine/Source/Scene/Expression.js index 2d413de4b39c..a87be1b0940a 100644 --- a/packages/engine/Source/Scene/Expression.js +++ b/packages/engine/Source/Scene/Expression.js @@ -183,11 +183,11 @@ Expression.prototype.getShaderFunction = function ( functionSignature, variableSubstitutionMap, shaderState, - returnType + returnType, ) { let shaderExpression = this.getShaderExpression( variableSubstitutionMap, - shaderState + shaderState, ); shaderExpression = @@ -212,11 +212,11 @@ Expression.prototype.getShaderFunction = function ( */ Expression.prototype.getShaderExpression = function ( variableSubstitutionMap, - shaderState + shaderState, ) { return this._runtimeAst.getShaderExpression( variableSubstitutionMap, - shaderState + shaderState, ); }; @@ -325,14 +325,14 @@ function getEvaluateUnaryComponentwise(operation) { return Cartesian2.fromElements( operation(left.x), operation(left.y), - scratchStorage.getCartesian2() + scratchStorage.getCartesian2(), ); } else if (left instanceof Cartesian3) { return Cartesian3.fromElements( operation(left.x), operation(left.y), operation(left.z), - scratchStorage.getCartesian3() + scratchStorage.getCartesian3(), ); } else if (left instanceof Cartesian4) { return Cartesian4.fromElements( @@ -340,11 +340,11 @@ function getEvaluateUnaryComponentwise(operation) { operation(left.y), operation(left.z), operation(left.w), - scratchStorage.getCartesian4() + scratchStorage.getCartesian4(), ); } throw new RuntimeError( - `Function "${call}" requires a vector or number argument. Argument is ${left}.` + `Function "${call}" requires a vector or number argument. Argument is ${left}.`, ); }; } @@ -358,14 +358,14 @@ function getEvaluateBinaryComponentwise(operation, allowScalar) { return Cartesian2.fromElements( operation(left.x, right), operation(left.y, right), - scratchStorage.getCartesian2() + scratchStorage.getCartesian2(), ); } else if (left instanceof Cartesian3) { return Cartesian3.fromElements( operation(left.x, right), operation(left.y, right), operation(left.z, right), - scratchStorage.getCartesian3() + scratchStorage.getCartesian3(), ); } else if (left instanceof Cartesian4) { return Cartesian4.fromElements( @@ -373,7 +373,7 @@ function getEvaluateBinaryComponentwise(operation, allowScalar) { operation(left.y, right), operation(left.z, right), operation(left.w, right), - scratchStorage.getCartesian4() + scratchStorage.getCartesian4(), ); } } @@ -384,14 +384,14 @@ function getEvaluateBinaryComponentwise(operation, allowScalar) { return Cartesian2.fromElements( operation(left.x, right.x), operation(left.y, right.y), - scratchStorage.getCartesian2() + scratchStorage.getCartesian2(), ); } else if (left instanceof Cartesian3 && right instanceof Cartesian3) { return Cartesian3.fromElements( operation(left.x, right.x), operation(left.y, right.y), operation(left.z, right.z), - scratchStorage.getCartesian3() + scratchStorage.getCartesian3(), ); } else if (left instanceof Cartesian4 && right instanceof Cartesian4) { return Cartesian4.fromElements( @@ -399,12 +399,12 @@ function getEvaluateBinaryComponentwise(operation, allowScalar) { operation(left.y, right.y), operation(left.z, right.z), operation(left.w, right.w), - scratchStorage.getCartesian4() + scratchStorage.getCartesian4(), ); } throw new RuntimeError( - `Function "${call}" requires vector or number arguments of matching types. Arguments are ${left} and ${right}.` + `Function "${call}" requires vector or number arguments of matching types. Arguments are ${left} and ${right}.`, ); }; } @@ -418,14 +418,14 @@ function getEvaluateTernaryComponentwise(operation, allowScalar) { return Cartesian2.fromElements( operation(left.x, right.x, test), operation(left.y, right.y, test), - scratchStorage.getCartesian2() + scratchStorage.getCartesian2(), ); } else if (left instanceof Cartesian3 && right instanceof Cartesian3) { return Cartesian3.fromElements( operation(left.x, right.x, test), operation(left.y, right.y, test), operation(left.z, right.z, test), - scratchStorage.getCartesian3() + scratchStorage.getCartesian3(), ); } else if (left instanceof Cartesian4 && right instanceof Cartesian4) { return Cartesian4.fromElements( @@ -433,7 +433,7 @@ function getEvaluateTernaryComponentwise(operation, allowScalar) { operation(left.y, right.y, test), operation(left.z, right.z, test), operation(left.w, right.w, test), - scratchStorage.getCartesian4() + scratchStorage.getCartesian4(), ); } } @@ -452,7 +452,7 @@ function getEvaluateTernaryComponentwise(operation, allowScalar) { return Cartesian2.fromElements( operation(left.x, right.x, test.x), operation(left.y, right.y, test.y), - scratchStorage.getCartesian2() + scratchStorage.getCartesian2(), ); } else if ( left instanceof Cartesian3 && @@ -463,7 +463,7 @@ function getEvaluateTernaryComponentwise(operation, allowScalar) { operation(left.x, right.x, test.x), operation(left.y, right.y, test.y), operation(left.z, right.z, test.z), - scratchStorage.getCartesian3() + scratchStorage.getCartesian3(), ); } else if ( left instanceof Cartesian4 && @@ -475,12 +475,12 @@ function getEvaluateTernaryComponentwise(operation, allowScalar) { operation(left.y, right.y, test.y), operation(left.z, right.z, test.z), operation(left.w, right.w, test.w), - scratchStorage.getCartesian4() + scratchStorage.getCartesian4(), ); } throw new RuntimeError( - `Function "${call}" requires vector or number arguments of matching types. Arguments are ${left}, ${right}, and ${test}.` + `Function "${call}" requires vector or number arguments of matching types. Arguments are ${left}, ${right}, and ${test}.`, ); }; } @@ -497,7 +497,7 @@ function length(call, left) { } throw new RuntimeError( - `Function "${call}" requires a vector or number argument. Argument is ${left}.` + `Function "${call}" requires a vector or number argument. Argument is ${left}.`, ); } @@ -513,7 +513,7 @@ function normalize(call, left) { } throw new RuntimeError( - `Function "${call}" requires a vector or number argument. Argument is ${left}.` + `Function "${call}" requires a vector or number argument. Argument is ${left}.`, ); } @@ -529,7 +529,7 @@ function distance(call, left, right) { } throw new RuntimeError( - `Function "${call}" requires vector or number arguments of matching types. Arguments are ${left} and ${right}.` + `Function "${call}" requires vector or number arguments of matching types. Arguments are ${left} and ${right}.`, ); } @@ -545,7 +545,7 @@ function dot(call, left, right) { } throw new RuntimeError( - `Function "${call}" requires vector or number arguments of matching types. Arguments are ${left} and ${right}.` + `Function "${call}" requires vector or number arguments of matching types. Arguments are ${left} and ${right}.`, ); } @@ -555,7 +555,7 @@ function cross(call, left, right) { } throw new RuntimeError( - `Function "${call}" requires vec3 arguments. Arguments are ${left} and ${right}.` + `Function "${call}" requires vec3 arguments. Arguments are ${left} and ${right}.`, ); } @@ -642,7 +642,7 @@ function parseLiteral(ast) { } return new Node( ExpressionNodeType.LITERAL_STRING, - replaceBackslashes(ast.value) + replaceBackslashes(ast.value), ); } } @@ -802,7 +802,7 @@ function parseRegex(expression, ast) { try { exp = new RegExp( replaceBackslashes(String(pattern._value)), - flags._value + flags._value, ); } catch (e) { throw new RuntimeError(e); @@ -856,7 +856,7 @@ function parseNumberConstant(ast) { if (name === "POSITIVE_INFINITY") { return new Node( ExpressionNodeType.LITERAL_NUMBER, - Number.POSITIVE_INFINITY + Number.POSITIVE_INFINITY, ); } } @@ -1115,7 +1115,7 @@ Node.prototype._evaluateLiteralColor = function (feature) { args[1].evaluate(feature), args[2].evaluate(feature), 255, - color + color, ); } else if (this._value === "rgba") { // convert between css alpha (0 to 1) and cesium alpha (0 to 255) @@ -1125,7 +1125,7 @@ Node.prototype._evaluateLiteralColor = function (feature) { args[1].evaluate(feature), args[2].evaluate(feature), a, - color + color, ); } else if (this._value === "hsl") { Color.fromHsl( @@ -1133,7 +1133,7 @@ Node.prototype._evaluateLiteralColor = function (feature) { args[1].evaluate(feature), args[2].evaluate(feature), 1.0, - color + color, ); } else if (this._value === "hsla") { Color.fromHsl( @@ -1141,7 +1141,7 @@ Node.prototype._evaluateLiteralColor = function (feature) { args[1].evaluate(feature), args[2].evaluate(feature), args[3].evaluate(feature), - color + color, ); } return Cartesian4.fromColor(color, scratchStorage.getCartesian4()); @@ -1177,7 +1177,7 @@ Node.prototype._evaluateLiteralVector = function (feature) { components.push(value.x, value.y, value.z, value.w); } else { throw new RuntimeError( - `${call} argument must be a vector or number. Argument is ${value}.` + `${call} argument must be a vector or number. Argument is ${value}.`, ); } } @@ -1189,7 +1189,7 @@ Node.prototype._evaluateLiteralVector = function (feature) { throw new RuntimeError(`Invalid ${call} constructor. No valid arguments.`); } else if (componentsLength < vectorLength && componentsLength > 1) { throw new RuntimeError( - `Invalid ${call} constructor. Not enough arguments.` + `Invalid ${call} constructor. Not enough arguments.`, ); } else if (componentsLength > vectorLength && argsLength > 1) { throw new RuntimeError(`Invalid ${call} constructor. Too many arguments.`); @@ -1314,7 +1314,7 @@ Node.prototype._evaluateNot = function (feature) { const left = this._left.evaluate(feature); if (typeof left !== "boolean") { throw new RuntimeError( - `Operator "!" requires a boolean argument. Argument is ${left}.` + `Operator "!" requires a boolean argument. Argument is ${left}.`, ); } return !left; @@ -1333,7 +1333,7 @@ Node.prototype._evaluateNegative = function (feature) { } throw new RuntimeError( - `Operator "-" requires a vector or number argument. Argument is ${left}.` + `Operator "-" requires a vector or number argument. Argument is ${left}.`, ); }; @@ -1349,7 +1349,7 @@ Node.prototype._evaluatePositive = function (feature) { ) ) { throw new RuntimeError( - `Operator "+" requires a vector or number argument. Argument is ${left}.` + `Operator "+" requires a vector or number argument. Argument is ${left}.`, ); } @@ -1362,7 +1362,7 @@ Node.prototype._evaluateLessThan = function (feature) { if (typeof left !== "number" || typeof right !== "number") { throw new RuntimeError( - `Operator "<" requires number arguments. Arguments are ${left} and ${right}.` + `Operator "<" requires number arguments. Arguments are ${left} and ${right}.`, ); } @@ -1375,7 +1375,7 @@ Node.prototype._evaluateLessThanOrEquals = function (feature) { if (typeof left !== "number" || typeof right !== "number") { throw new RuntimeError( - `Operator "<=" requires number arguments. Arguments are ${left} and ${right}.` + `Operator "<=" requires number arguments. Arguments are ${left} and ${right}.`, ); } @@ -1388,7 +1388,7 @@ Node.prototype._evaluateGreaterThan = function (feature) { if (typeof left !== "number" || typeof right !== "number") { throw new RuntimeError( - `Operator ">" requires number arguments. Arguments are ${left} and ${right}.` + `Operator ">" requires number arguments. Arguments are ${left} and ${right}.`, ); } @@ -1401,7 +1401,7 @@ Node.prototype._evaluateGreaterThanOrEquals = function (feature) { if (typeof left !== "number" || typeof right !== "number") { throw new RuntimeError( - `Operator ">=" requires number arguments. Arguments are ${left} and ${right}.` + `Operator ">=" requires number arguments. Arguments are ${left} and ${right}.`, ); } @@ -1412,7 +1412,7 @@ Node.prototype._evaluateOr = function (feature) { const left = this._left.evaluate(feature); if (typeof left !== "boolean") { throw new RuntimeError( - `Operator "||" requires boolean arguments. First argument is ${left}.` + `Operator "||" requires boolean arguments. First argument is ${left}.`, ); } @@ -1424,7 +1424,7 @@ Node.prototype._evaluateOr = function (feature) { const right = this._right.evaluate(feature); if (typeof right !== "boolean") { throw new RuntimeError( - `Operator "||" requires boolean arguments. Second argument is ${right}.` + `Operator "||" requires boolean arguments. Second argument is ${right}.`, ); } @@ -1435,7 +1435,7 @@ Node.prototype._evaluateAnd = function (feature) { const left = this._left.evaluate(feature); if (typeof left !== "boolean") { throw new RuntimeError( - `Operator "&&" requires boolean arguments. First argument is ${left}.` + `Operator "&&" requires boolean arguments. First argument is ${left}.`, ); } @@ -1447,7 +1447,7 @@ Node.prototype._evaluateAnd = function (feature) { const right = this._right.evaluate(feature); if (typeof right !== "boolean") { throw new RuntimeError( - `Operator "&&" requires boolean arguments. Second argument is ${right}.` + `Operator "&&" requires boolean arguments. Second argument is ${right}.`, ); } @@ -1471,7 +1471,7 @@ Node.prototype._evaluatePlus = function (feature) { } throw new RuntimeError( - `Operator "+" requires vector or number arguments of matching types, or at least one string argument. Arguments are ${left} and ${right}.` + `Operator "+" requires vector or number arguments of matching types, or at least one string argument. Arguments are ${left} and ${right}.`, ); }; @@ -1489,7 +1489,7 @@ Node.prototype._evaluateMinus = function (feature) { } throw new RuntimeError( - `Operator "-" requires vector or number arguments of matching types. Arguments are ${left} and ${right}.` + `Operator "-" requires vector or number arguments of matching types. Arguments are ${left} and ${right}.`, ); }; @@ -1500,62 +1500,62 @@ Node.prototype._evaluateTimes = function (feature) { return Cartesian2.multiplyComponents( left, right, - scratchStorage.getCartesian2() + scratchStorage.getCartesian2(), ); } else if (right instanceof Cartesian2 && typeof left === "number") { return Cartesian2.multiplyByScalar( right, left, - scratchStorage.getCartesian2() + scratchStorage.getCartesian2(), ); } else if (left instanceof Cartesian2 && typeof right === "number") { return Cartesian2.multiplyByScalar( left, right, - scratchStorage.getCartesian2() + scratchStorage.getCartesian2(), ); } else if (right instanceof Cartesian3 && left instanceof Cartesian3) { return Cartesian3.multiplyComponents( left, right, - scratchStorage.getCartesian3() + scratchStorage.getCartesian3(), ); } else if (right instanceof Cartesian3 && typeof left === "number") { return Cartesian3.multiplyByScalar( right, left, - scratchStorage.getCartesian3() + scratchStorage.getCartesian3(), ); } else if (left instanceof Cartesian3 && typeof right === "number") { return Cartesian3.multiplyByScalar( left, right, - scratchStorage.getCartesian3() + scratchStorage.getCartesian3(), ); } else if (right instanceof Cartesian4 && left instanceof Cartesian4) { return Cartesian4.multiplyComponents( left, right, - scratchStorage.getCartesian4() + scratchStorage.getCartesian4(), ); } else if (right instanceof Cartesian4 && typeof left === "number") { return Cartesian4.multiplyByScalar( right, left, - scratchStorage.getCartesian4() + scratchStorage.getCartesian4(), ); } else if (left instanceof Cartesian4 && typeof right === "number") { return Cartesian4.multiplyByScalar( left, right, - scratchStorage.getCartesian4() + scratchStorage.getCartesian4(), ); } else if (typeof left === "number" && typeof right === "number") { return left * right; } throw new RuntimeError( - `Operator "*" requires vector or number arguments. If both arguments are vectors they must be matching types. Arguments are ${left} and ${right}.` + `Operator "*" requires vector or number arguments. If both arguments are vectors they must be matching types. Arguments are ${left} and ${right}.`, ); }; @@ -1566,44 +1566,44 @@ Node.prototype._evaluateDivide = function (feature) { return Cartesian2.divideComponents( left, right, - scratchStorage.getCartesian2() + scratchStorage.getCartesian2(), ); } else if (left instanceof Cartesian2 && typeof right === "number") { return Cartesian2.divideByScalar( left, right, - scratchStorage.getCartesian2() + scratchStorage.getCartesian2(), ); } else if (right instanceof Cartesian3 && left instanceof Cartesian3) { return Cartesian3.divideComponents( left, right, - scratchStorage.getCartesian3() + scratchStorage.getCartesian3(), ); } else if (left instanceof Cartesian3 && typeof right === "number") { return Cartesian3.divideByScalar( left, right, - scratchStorage.getCartesian3() + scratchStorage.getCartesian3(), ); } else if (right instanceof Cartesian4 && left instanceof Cartesian4) { return Cartesian4.divideComponents( left, right, - scratchStorage.getCartesian4() + scratchStorage.getCartesian4(), ); } else if (left instanceof Cartesian4 && typeof right === "number") { return Cartesian4.divideByScalar( left, right, - scratchStorage.getCartesian4() + scratchStorage.getCartesian4(), ); } else if (typeof left === "number" && typeof right === "number") { return left / right; } throw new RuntimeError( - `Operator "/" requires vector or number arguments of matching types, or a number as the second argument. Arguments are ${left} and ${right}.` + `Operator "/" requires vector or number arguments of matching types, or a number as the second argument. Arguments are ${left} and ${right}.`, ); }; @@ -1614,14 +1614,14 @@ Node.prototype._evaluateMod = function (feature) { return Cartesian2.fromElements( left.x % right.x, left.y % right.y, - scratchStorage.getCartesian2() + scratchStorage.getCartesian2(), ); } else if (right instanceof Cartesian3 && left instanceof Cartesian3) { return Cartesian3.fromElements( left.x % right.x, left.y % right.y, left.z % right.z, - scratchStorage.getCartesian3() + scratchStorage.getCartesian3(), ); } else if (right instanceof Cartesian4 && left instanceof Cartesian4) { return Cartesian4.fromElements( @@ -1629,14 +1629,14 @@ Node.prototype._evaluateMod = function (feature) { left.y % right.y, left.z % right.z, left.w % right.w, - scratchStorage.getCartesian4() + scratchStorage.getCartesian4(), ); } else if (typeof left === "number" && typeof right === "number") { return left % right; } throw new RuntimeError( - `Operator "%" requires vector or number arguments of matching types. Arguments are ${left} and ${right}.` + `Operator "%" requires vector or number arguments of matching types. Arguments are ${left} and ${right}.`, ); }; @@ -1671,7 +1671,7 @@ Node.prototype._evaluateConditional = function (feature) { if (typeof test !== "boolean") { throw new RuntimeError( - `Conditional argument of conditional expression must be a boolean. Argument is ${test}.` + `Conditional argument of conditional expression must be a boolean. Argument is ${test}.`, ); } @@ -1744,7 +1744,7 @@ Node.prototype._evaluateRegExpTest = function (feature) { if (!(left instanceof RegExp && typeof right === "string")) { throw new RuntimeError( - `RegExp.test requires the first argument to be a RegExp and the second argument to be a string. Arguments are ${left} and ${right}.` + `RegExp.test requires the first argument to be a RegExp and the second argument to be a string. Arguments are ${left} and ${right}.`, ); } @@ -1762,7 +1762,7 @@ Node.prototype._evaluateRegExpMatch = function (feature) { } throw new RuntimeError( - `Operator "=~" requires one RegExp argument and one string argument. Arguments are ${left} and ${right}.` + `Operator "=~" requires one RegExp argument and one string argument. Arguments are ${left} and ${right}.`, ); }; @@ -1777,7 +1777,7 @@ Node.prototype._evaluateRegExpNotMatch = function (feature) { } throw new RuntimeError( - `Operator "!~" requires one RegExp argument and one string argument. Arguments are ${left} and ${right}.` + `Operator "!~" requires one RegExp argument and one string argument. Arguments are ${left} and ${right}.`, ); }; @@ -1787,7 +1787,7 @@ Node.prototype._evaluateRegExpExec = function (feature) { if (!(left instanceof RegExp && typeof right === "string")) { throw new RuntimeError( - `RegExp.exec requires the first argument to be a RegExp and the second argument to be a string. Arguments are ${left} and ${right}.` + `RegExp.exec requires the first argument to be a RegExp and the second argument to be a string. Arguments are ${left} and ${right}.`, ); } @@ -1875,7 +1875,7 @@ function getExpressionArray( array, variableSubstitutionMap, shaderState, - parent + parent, ) { const length = array.length; const expressions = new Array(length); @@ -1883,7 +1883,7 @@ function getExpressionArray( expressions[i] = array[i].getShaderExpression( variableSubstitutionMap, shaderState, - parent + parent, ); } return expressions; @@ -1905,7 +1905,7 @@ Expression.NULL_SENTINEL = "czm_infinity"; // null just needs to be some sentine Node.prototype.getShaderExpression = function ( variableSubstitutionMap, shaderState, - parent + parent, ) { let color; let left; @@ -1922,13 +1922,13 @@ Node.prototype.getShaderExpression = function ( this._left, variableSubstitutionMap, shaderState, - this + this, ); } else { left = this._left.getShaderExpression( variableSubstitutionMap, shaderState, - this + this, ); } } @@ -1937,7 +1937,7 @@ Node.prototype.getShaderExpression = function ( right = this._right.getShaderExpression( variableSubstitutionMap, shaderState, - this + this, ); } @@ -1945,7 +1945,7 @@ Node.prototype.getShaderExpression = function ( test = this._test.getShaderExpression( variableSubstitutionMap, shaderState, - this + this, ); } @@ -1955,7 +1955,7 @@ Node.prototype.getShaderExpression = function ( this._value, variableSubstitutionMap, shaderState, - this + this, ); } @@ -1991,7 +1991,7 @@ Node.prototype.getShaderExpression = function ( value === "getExactClassName" ) { throw new RuntimeError( - `Error generating style shader: "${value}" is not supported.` + `Error generating style shader: "${value}" is not supported.`, ); } return value + left; @@ -2034,7 +2034,7 @@ Node.prototype.getShaderExpression = function ( return `${left}[int(${right})]`; case ExpressionNodeType.FUNCTION_CALL: throw new RuntimeError( - `Error generating style shader: "${value}" is not supported.` + `Error generating style shader: "${value}" is not supported.`, ); case ExpressionNodeType.ARRAY: if (value.length === 4) { @@ -2045,15 +2045,15 @@ Node.prototype.getShaderExpression = function ( return `vec2(${value[0]}, ${value[1]})`; } throw new RuntimeError( - "Error generating style shader: Invalid array length. Array length should be 2, 3, or 4." + "Error generating style shader: Invalid array length. Array length should be 2, 3, or 4.", ); case ExpressionNodeType.REGEX: throw new RuntimeError( - "Error generating style shader: Regular expressions are not supported." + "Error generating style shader: Regular expressions are not supported.", ); case ExpressionNodeType.VARIABLE_IN_STRING: throw new RuntimeError( - "Error generating style shader: Converting a variable to a string is not supported." + "Error generating style shader: Converting a variable to a string is not supported.", ); case ExpressionNodeType.LITERAL_NULL: return Expression.NULL_SENTINEL; @@ -2083,7 +2083,7 @@ Node.prototype.getShaderExpression = function ( return colorToVec3(color); } throw new RuntimeError( - "Error generating style shader: String literals are not supported." + "Error generating style shader: String literals are not supported.", ); case ExpressionNodeType.LITERAL_COLOR: args = left; @@ -2138,7 +2138,7 @@ Node.prototype.getShaderExpression = function ( //>>includeStart('debug', pragmas.debug); if (!defined(left)) { throw new DeveloperError( - "left should always be defined for type ExpressionNodeType.LITERAL_VECTOR" + "left should always be defined for type ExpressionNodeType.LITERAL_VECTOR", ); } //>>includeEnd('debug'); @@ -2154,7 +2154,7 @@ Node.prototype.getShaderExpression = function ( return vectorExpression; case ExpressionNodeType.LITERAL_REGEX: throw new RuntimeError( - "Error generating style shader: Regular expressions are not supported." + "Error generating style shader: Regular expressions are not supported.", ); case ExpressionNodeType.LITERAL_UNDEFINED: return Expression.NULL_SENTINEL; diff --git a/packages/engine/Source/Scene/Fog.js b/packages/engine/Source/Scene/Fog.js index 877d45b44f05..9dd4e4e6899a 100644 --- a/packages/engine/Source/Scene/Fog.js +++ b/packages/engine/Source/Scene/Fog.js @@ -54,48 +54,15 @@ function Fog() { // These values were found by sampling the density at certain views and finding at what point culled tiles impacted the view at the horizon. const heightsTable = [ - 359.393, - 800.749, - 1275.6501, - 2151.1192, - 3141.7763, - 4777.5198, - 6281.2493, - 12364.307, - 15900.765, - 49889.0549, - 78026.8259, - 99260.7344, - 120036.3873, - 151011.0158, - 156091.1953, - 203849.3112, - 274866.9803, - 319916.3149, - 493552.0528, + 359.393, 800.749, 1275.6501, 2151.1192, 3141.7763, 4777.5198, 6281.2493, + 12364.307, 15900.765, 49889.0549, 78026.8259, 99260.7344, 120036.3873, + 151011.0158, 156091.1953, 203849.3112, 274866.9803, 319916.3149, 493552.0528, 628733.5874, ]; const densityTable = [ - 2.0e-5, - 2.0e-4, - 1.0e-4, - 7.0e-5, - 5.0e-5, - 4.0e-5, - 3.0e-5, - 1.9e-5, - 1.0e-5, - 8.5e-6, - 6.2e-6, - 5.8e-6, - 5.3e-6, - 5.2e-6, - 5.1e-6, - 4.2e-6, - 4.0e-6, - 3.4e-6, - 2.6e-6, - 2.2e-6, + 2.0e-5, 2.0e-4, 1.0e-4, 7.0e-5, 5.0e-5, 4.0e-5, 3.0e-5, 1.9e-5, 1.0e-5, + 8.5e-6, 6.2e-6, 5.8e-6, 5.3e-6, 5.2e-6, 5.1e-6, 4.2e-6, 4.0e-6, 3.4e-6, + 2.6e-6, 2.2e-6, ]; // Scale densities by 1e6 to bring lowest value to ~1. Prevents divide by zero. @@ -182,7 +149,7 @@ Fog.prototype.update = function (frameState) { const t = CesiumMath.clamp( (height - heightsTable[i]) / (heightsTable[i + 1] - heightsTable[i]), 0.0, - 1.0 + 1.0, ); let density = CesiumMath.lerp(densityTable[i], densityTable[i + 1], t); @@ -194,7 +161,7 @@ Fog.prototype.update = function (frameState) { // Fade fog in as the camera tilts toward the horizon. const positionNormal = Cartesian3.normalize( camera.positionWC, - scratchPositionNormal + scratchPositionNormal, ); const dot = Math.abs(Cartesian3.dot(camera.directionWC, positionNormal)); density *= 1.0 - dot; diff --git a/packages/engine/Source/Scene/FrameRateMonitor.js b/packages/engine/Source/Scene/FrameRateMonitor.js index 68169a6c24f6..3e7f3ae5053a 100644 --- a/packages/engine/Source/Scene/FrameRateMonitor.js +++ b/packages/engine/Source/Scene/FrameRateMonitor.js @@ -44,7 +44,7 @@ function FrameRateMonitor(options) { */ this.samplingWindow = defaultValue( options.samplingWindow, - FrameRateMonitor.defaultSettings.samplingWindow + FrameRateMonitor.defaultSettings.samplingWindow, ); /** @@ -54,7 +54,7 @@ function FrameRateMonitor(options) { */ this.quietPeriod = defaultValue( options.quietPeriod, - FrameRateMonitor.defaultSettings.quietPeriod + FrameRateMonitor.defaultSettings.quietPeriod, ); /** @@ -64,7 +64,7 @@ function FrameRateMonitor(options) { */ this.warmupPeriod = defaultValue( options.warmupPeriod, - FrameRateMonitor.defaultSettings.warmupPeriod + FrameRateMonitor.defaultSettings.warmupPeriod, ); /** @@ -75,7 +75,7 @@ function FrameRateMonitor(options) { */ this.minimumFrameRateDuringWarmup = defaultValue( options.minimumFrameRateDuringWarmup, - FrameRateMonitor.defaultSettings.minimumFrameRateDuringWarmup + FrameRateMonitor.defaultSettings.minimumFrameRateDuringWarmup, ); /** @@ -86,7 +86,7 @@ function FrameRateMonitor(options) { */ this.minimumFrameRateAfterWarmup = defaultValue( options.minimumFrameRateAfterWarmup, - FrameRateMonitor.defaultSettings.minimumFrameRateAfterWarmup + FrameRateMonitor.defaultSettings.minimumFrameRateAfterWarmup, ); this._lowFrameRate = new Event(); @@ -104,30 +104,30 @@ function FrameRateMonitor(options) { this._preUpdateRemoveListener = this._scene.preUpdate.addEventListener( function (scene, time) { update(that, time); - } + }, ); this._hiddenPropertyName = document.hidden !== undefined ? "hidden" : document.mozHidden !== undefined - ? "mozHidden" - : document.msHidden !== undefined - ? "msHidden" - : document.webkitHidden !== undefined - ? "webkitHidden" - : undefined; + ? "mozHidden" + : document.msHidden !== undefined + ? "msHidden" + : document.webkitHidden !== undefined + ? "webkitHidden" + : undefined; const visibilityChangeEventName = document.hidden !== undefined ? "visibilitychange" : document.mozHidden !== undefined - ? "mozvisibilitychange" - : document.msHidden !== undefined - ? "msvisibilitychange" - : document.webkitHidden !== undefined - ? "webkitvisibilitychange" - : undefined; + ? "mozvisibilitychange" + : document.msHidden !== undefined + ? "msvisibilitychange" + : document.webkitHidden !== undefined + ? "webkitvisibilitychange" + : undefined; function visibilityChangeListener() { visibilityChanged(that); @@ -138,14 +138,14 @@ function FrameRateMonitor(options) { document.addEventListener( visibilityChangeEventName, visibilityChangeListener, - false + false, ); this._visibilityChangeRemoveListener = function () { document.removeEventListener( visibilityChangeEventName, visibilityChangeListener, - false + false, ); }; } @@ -359,7 +359,7 @@ function update(monitor, time) { monitor._needsQuietPeriod = true; monitor.lowFrameRate.raiseEvent( monitor.scene, - monitor._lastFramesPerSecond + monitor._lastFramesPerSecond, ); } } else if (monitor._frameRateIsLow) { @@ -367,7 +367,7 @@ function update(monitor, time) { monitor._needsQuietPeriod = true; monitor.nominalFrameRate.raiseEvent( monitor.scene, - monitor._lastFramesPerSecond + monitor._lastFramesPerSecond, ); } } diff --git a/packages/engine/Source/Scene/Geometry3DTileContent.js b/packages/engine/Source/Scene/Geometry3DTileContent.js index d89a278eb4b1..17685da7cd65 100644 --- a/packages/engine/Source/Scene/Geometry3DTileContent.js +++ b/packages/engine/Source/Scene/Geometry3DTileContent.js @@ -24,7 +24,7 @@ function Geometry3DTileContent( tile, resource, arrayBuffer, - byteOffset + byteOffset, ) { this._tileset = tileset; this._tile = tile; @@ -175,7 +175,7 @@ function getBatchIds(featureTableJson, featureTableBinary) { const numberOfCylinders = defaultValue(featureTableJson.CYLINDERS_LENGTH, 0); const numberOfEllipsoids = defaultValue( featureTableJson.ELLIPSOIDS_LENGTH, - 0 + 0, ); const numberOfSpheres = defaultValue(featureTableJson.SPHERES_LENGTH, 0); @@ -185,7 +185,7 @@ function getBatchIds(featureTableJson, featureTableBinary) { boxBatchIds = new Uint16Array( featureTableBinary.buffer, boxBatchIdsByteOffset, - numberOfBoxes + numberOfBoxes, ); } @@ -196,7 +196,7 @@ function getBatchIds(featureTableJson, featureTableBinary) { cylinderBatchIds = new Uint16Array( featureTableBinary.buffer, cylinderBatchIdsByteOffset, - numberOfCylinders + numberOfCylinders, ); } @@ -207,7 +207,7 @@ function getBatchIds(featureTableJson, featureTableBinary) { ellipsoidBatchIds = new Uint16Array( featureTableBinary.buffer, ellipsoidBatchIdsByteOffset, - numberOfEllipsoids + numberOfEllipsoids, ); } @@ -218,7 +218,7 @@ function getBatchIds(featureTableJson, featureTableBinary) { sphereBatchIds = new Uint16Array( featureTableBinary.buffer, sphereBatchIdsByteOffset, - numberOfSpheres + numberOfSpheres, ); } @@ -235,7 +235,7 @@ function getBatchIds(featureTableJson, featureTableBinary) { if (atLeastOneDefined && atLeastOneUndefined) { throw new RuntimeError( - "If one group of batch ids is defined, then all batch ids must be defined" + "If one group of batch ids is defined, then all batch ids must be defined", ); } @@ -292,7 +292,7 @@ function initialize(content, arrayBuffer, byteOffset) { const version = view.getUint32(byteOffset, true); if (version !== 1) { throw new RuntimeError( - `Only Geometry tile version 1 is supported. Version ${version} is not.` + `Only Geometry tile version 1 is supported. Version ${version} is not.`, ); } byteOffset += sizeOfUint32; @@ -310,7 +310,7 @@ function initialize(content, arrayBuffer, byteOffset) { if (featureTableJSONByteLength === 0) { throw new RuntimeError( - "Feature table must have a byte length greater than zero" + "Feature table must have a byte length greater than zero", ); } @@ -324,14 +324,14 @@ function initialize(content, arrayBuffer, byteOffset) { const featureTableJson = getJsonFromTypedArray( uint8Array, byteOffset, - featureTableJSONByteLength + featureTableJSONByteLength, ); byteOffset += featureTableJSONByteLength; const featureTableBinary = new Uint8Array( arrayBuffer, byteOffset, - featureTableBinaryByteLength + featureTableBinaryByteLength, ); byteOffset += featureTableBinaryByteLength; @@ -346,7 +346,7 @@ function initialize(content, arrayBuffer, byteOffset) { batchTableJson = getJsonFromTypedArray( uint8Array, byteOffset, - batchTableJSONByteLength + batchTableJSONByteLength, ); byteOffset += batchTableJSONByteLength; @@ -355,7 +355,7 @@ function initialize(content, arrayBuffer, byteOffset) { batchTableBinary = new Uint8Array( arrayBuffer, byteOffset, - batchTableBinaryByteLength + batchTableBinaryByteLength, ); // Copy the batchTableBinary section and let the underlying ArrayBuffer be freed batchTableBinary = new Uint8Array(batchTableBinary); @@ -366,7 +366,7 @@ function initialize(content, arrayBuffer, byteOffset) { const numberOfCylinders = defaultValue(featureTableJson.CYLINDERS_LENGTH, 0); const numberOfEllipsoids = defaultValue( featureTableJson.ELLIPSOIDS_LENGTH, - 0 + 0, ); const numberOfSpheres = defaultValue(featureTableJson.SPHERES_LENGTH, 0); @@ -378,7 +378,7 @@ function initialize(content, arrayBuffer, byteOffset) { totalPrimitives, batchTableJson, batchTableBinary, - createColorChangedCallback(content) + createColorChangedCallback(content), ); content._batchTable = batchTable; @@ -413,7 +413,7 @@ function initialize(content, arrayBuffer, byteOffset) { boxes = new Float32Array( featureTableBinary.buffer, boxesByteOffset, - Vector3DTileGeometry.packedBoxLength * numberOfBoxes + Vector3DTileGeometry.packedBoxLength * numberOfBoxes, ); } @@ -423,7 +423,7 @@ function initialize(content, arrayBuffer, byteOffset) { cylinders = new Float32Array( featureTableBinary.buffer, cylindersByteOffset, - Vector3DTileGeometry.packedCylinderLength * numberOfCylinders + Vector3DTileGeometry.packedCylinderLength * numberOfCylinders, ); } @@ -433,7 +433,7 @@ function initialize(content, arrayBuffer, byteOffset) { ellipsoids = new Float32Array( featureTableBinary.buffer, ellipsoidsByteOffset, - Vector3DTileGeometry.packedEllipsoidLength * numberOfEllipsoids + Vector3DTileGeometry.packedEllipsoidLength * numberOfEllipsoids, ); } @@ -443,7 +443,7 @@ function initialize(content, arrayBuffer, byteOffset) { spheres = new Float32Array( featureTableBinary.buffer, spheresByteOffset, - Vector3DTileGeometry.packedSphereLength * numberOfSpheres + Vector3DTileGeometry.packedSphereLength * numberOfSpheres, ); } @@ -490,7 +490,7 @@ Geometry3DTileContent.prototype.getFeature = function (batchId) { throw new DeveloperError( `batchId is required and between zero and featuresLength - 1 (${ featuresLength - 1 - }).` + }).`, ); } //>>includeEnd('debug'); diff --git a/packages/engine/Source/Scene/GetFeatureInfoFormat.js b/packages/engine/Source/Scene/GetFeatureInfoFormat.js index 6150c25d6cd3..0d9b392bae22 100644 --- a/packages/engine/Source/Scene/GetFeatureInfoFormat.js +++ b/packages/engine/Source/Scene/GetFeatureInfoFormat.js @@ -41,7 +41,7 @@ function GetFeatureInfoFormat(type, format, callback) { //>>includeStart('debug', pragmas.debug); else { throw new DeveloperError( - 'format is required when type is not "json", "xml", "html", or "text".' + 'format is required when type is not "json", "xml", "html", or "text".', ); } //>>includeEnd('debug'); @@ -62,7 +62,7 @@ function GetFeatureInfoFormat(type, format, callback) { //>>includeStart('debug', pragmas.debug); else { throw new DeveloperError( - 'callback is required when type is not "json", "xml", "html", or "text".' + 'callback is required when type is not "json", "xml", "html", or "text".', ); } //>>includeEnd('debug'); @@ -125,7 +125,7 @@ function xmlToFeatureInfo(xml) { } else if (documentElement.localName === "ServiceExceptionReport") { // This looks like a WMS server error, so no features picked. throw new RuntimeError( - new XMLSerializer().serializeToString(documentElement) + new XMLSerializer().serializeToString(documentElement), ); } else if (documentElement.localName === "msGMLOutput") { return msGmlToFeatureInfo(xml); @@ -142,7 +142,7 @@ function mapInfoXmlToFeatureInfo(xml) { const features = multiFeatureCollection.getElementsByTagNameNS( mapInfoMxpNamespace, - "Feature" + "Feature", ); for (let featureIndex = 0; featureIndex < features.length; ++featureIndex) { const feature = features[featureIndex]; @@ -151,7 +151,7 @@ function mapInfoXmlToFeatureInfo(xml) { const propertyElements = feature.getElementsByTagNameNS( mapInfoMxpNamespace, - "Val" + "Val", ); for ( let propertyIndex = 0; @@ -201,14 +201,14 @@ function esriXmlToFeatureInfo(xml) { } result.push( - imageryLayerFeatureInfoFromDataAndProperties(feature, properties) + imageryLayerFeatureInfoFromDataAndProperties(feature, properties), ); } } else { // Thredds format -- looks like esri, but instead of containing FIELDS, contains FeatureInfo element const featureInfoElements = featureInfoResponse.getElementsByTagNameNS( "*", - "FeatureInfo" + "FeatureInfo", ); for ( let featureInfoElementIndex = 0; @@ -235,8 +235,8 @@ function esriXmlToFeatureInfo(xml) { result.push( imageryLayerFeatureInfoFromDataAndProperties( featureInfoElement, - properties - ) + properties, + ), ); } } @@ -251,7 +251,7 @@ function gmlToFeatureInfo(xml) { const featureMembers = featureCollection.getElementsByTagNameNS( gmlNamespace, - "featureMember" + "featureMember", ); for ( let featureIndex = 0; @@ -263,7 +263,7 @@ function gmlToFeatureInfo(xml) { const properties = {}; getGmlPropertiesRecursively(featureMember, properties); result.push( - imageryLayerFeatureInfoFromDataAndProperties(featureMember, properties) + imageryLayerFeatureInfoFromDataAndProperties(featureMember, properties), ); } @@ -288,7 +288,7 @@ function msGmlToFeatureInfo(xml) { } if (!defined(layer)) { throw new RuntimeError( - "Unable to find first child of the feature info xml document" + "Unable to find first child of the feature info xml document", ); } const featureMembers = layer.childNodes; @@ -302,7 +302,7 @@ function msGmlToFeatureInfo(xml) { const properties = {}; getGmlPropertiesRecursively(featureMember, properties); result.push( - imageryLayerFeatureInfoFromDataAndProperties(featureMember, properties) + imageryLayerFeatureInfoFromDataAndProperties(featureMember, properties), ); } } @@ -364,7 +364,8 @@ function unknownXmlToFeatureInfo(xml) { } const emptyBodyRegex = /\s*<\/body>/im; -const wmsServiceExceptionReportRegex = //im; +const wmsServiceExceptionReportRegex = + //im; const titleRegex = /([\s\S]*)<\/title>/im; function textToFeatureInfo(text) { diff --git a/packages/engine/Source/Scene/Globe.js b/packages/engine/Source/Scene/Globe.js index db02bc0f922f..ca2c6a611be9 100644 --- a/packages/engine/Source/Scene/Globe.js +++ b/packages/engine/Source/Scene/Globe.js @@ -69,7 +69,7 @@ function Globe(ellipsoid) { ellipsoid.maximumRadius / 1000.0, 0.0, ellipsoid.maximumRadius / 5.0, - 1.0 + 1.0, ); this._translucency = new GlobeTranslucency(); @@ -612,13 +612,13 @@ Object.defineProperties(Globe.prototype, { //>>includeStart('debug', pragmas.debug); if (defined(value) && value.far < value.near) { throw new DeveloperError( - "far distance must be greater than near distance." + "far distance must be greater than near distance.", ); } //>>includeEnd('debug'); this._undergroundColorAlphaByDistance = NearFarScalar.clone( value, - this._undergroundColorAlphaByDistance + this._undergroundColorAlphaByDistance, ); }, }, @@ -673,11 +673,11 @@ function createComparePickTileFunction(rayOrigin) { return function (a, b) { const aDist = BoundingSphere.distanceSquaredTo( a.pickBoundingSphere, - rayOrigin + rayOrigin, ); const bDist = BoundingSphere.distanceSquaredTo( b.pickBoundingSphere, - rayOrigin + rayOrigin, ); return aDist - bDist; @@ -705,7 +705,7 @@ Globe.prototype.pickWorldCoordinates = function ( ray, scene, cullBackFaces, - result + result, ) { //>>includeStart('debug', pragmas.debug); if (!defined(ray)) { @@ -740,23 +740,24 @@ Globe.prototype.pickWorldCoordinates = function ( let boundingVolume = surfaceTile.pickBoundingSphere; if (mode !== SceneMode.SCENE3D) { - surfaceTile.pickBoundingSphere = boundingVolume = BoundingSphere.fromRectangleWithHeights2D( - tile.rectangle, - projection, - surfaceTile.tileBoundingRegion.minimumHeight, - surfaceTile.tileBoundingRegion.maximumHeight, - boundingVolume - ); + surfaceTile.pickBoundingSphere = boundingVolume = + BoundingSphere.fromRectangleWithHeights2D( + tile.rectangle, + projection, + surfaceTile.tileBoundingRegion.minimumHeight, + surfaceTile.tileBoundingRegion.maximumHeight, + boundingVolume, + ); Cartesian3.fromElements( boundingVolume.center.z, boundingVolume.center.x, boundingVolume.center.y, - boundingVolume.center + boundingVolume.center, ); } else if (defined(surfaceTile.renderedMesh)) { BoundingSphere.clone( surfaceTile.tileBoundingRegion.boundingSphere, - boundingVolume + boundingVolume, ); } else { // So wait how did we render this thing then? It shouldn't be possible to get here. @@ -766,7 +767,7 @@ Globe.prototype.pickWorldCoordinates = function ( const boundingSphereIntersection = IntersectionTests.raySphere( ray, boundingVolume, - scratchSphereIntersectionResult + scratchSphereIntersectionResult, ); if (defined(boundingSphereIntersection)) { sphereIntersections.push(surfaceTile); @@ -783,7 +784,7 @@ Globe.prototype.pickWorldCoordinates = function ( scene.mode, scene.mapProjection, cullBackFaces, - result + result, ); if (defined(intersection)) { break; @@ -905,13 +906,13 @@ Globe.prototype.getHeight = function (cartographic) { cartographic.latitude, 0.0, ellipsoid, - scratchGetHeightCartesian + scratchGetHeightCartesian, ); const ray = scratchGetHeightRay; const surfaceNormal = ellipsoid.geodeticSurfaceNormal( cartesian, - ray.direction + ray.direction, ); // Try to find the intersection point between the surface normal and z-axis. @@ -919,7 +920,7 @@ Globe.prototype.getHeight = function (cartographic) { const rayOrigin = ellipsoid.getSurfaceNormalIntersectionWithZAxis( cartesian, 11500.0, - ray.origin + ray.origin, ); // Theoretically, not with Earth datums, the intersection point can be outside the ellipsoid @@ -936,7 +937,7 @@ Globe.prototype.getHeight = function (cartographic) { const vectorToMinimumPoint = Cartesian3.multiplyByScalar( surfaceNormal, Math.abs(magnitude) + 1, - scratchGetHeightIntersection + scratchGetHeightIntersection, ); Cartesian3.subtract(cartesian, vectorToMinimumPoint, ray.origin); } @@ -946,7 +947,7 @@ Globe.prototype.getHeight = function (cartographic) { undefined, projection, false, - scratchGetHeightIntersection + scratchGetHeightIntersection, ); if (!defined(intersection)) { return undefined; @@ -954,7 +955,7 @@ Globe.prototype.getHeight = function (cartographic) { return ellipsoid.cartesianToCartographic( intersection, - scratchGetHeightCartographic + scratchGetHeightCartographic, ).height; }; @@ -1037,12 +1038,15 @@ Globe.prototype.beginFrame = function (frameState) { tileProvider.oceanNormalMap = this._oceanNormalMap; tileProvider.enableLighting = this.enableLighting; tileProvider.dynamicAtmosphereLighting = this.dynamicAtmosphereLighting; - tileProvider.dynamicAtmosphereLightingFromSun = this.dynamicAtmosphereLightingFromSun; + tileProvider.dynamicAtmosphereLightingFromSun = + this.dynamicAtmosphereLightingFromSun; tileProvider.showGroundAtmosphere = this.showGroundAtmosphere; tileProvider.atmosphereLightIntensity = this.atmosphereLightIntensity; - tileProvider.atmosphereRayleighCoefficient = this.atmosphereRayleighCoefficient; + tileProvider.atmosphereRayleighCoefficient = + this.atmosphereRayleighCoefficient; tileProvider.atmosphereMieCoefficient = this.atmosphereMieCoefficient; - tileProvider.atmosphereRayleighScaleHeight = this.atmosphereRayleighScaleHeight; + tileProvider.atmosphereRayleighScaleHeight = + this.atmosphereRayleighScaleHeight; tileProvider.atmosphereMieScaleHeight = this.atmosphereMieScaleHeight; tileProvider.atmosphereMieAnisotropy = this.atmosphereMieAnisotropy; tileProvider.shadows = this.shadows; @@ -1054,7 +1058,8 @@ Globe.prototype.beginFrame = function (frameState) { tileProvider.backFaceCulling = this.backFaceCulling; tileProvider.vertexShadowDarkness = this.vertexShadowDarkness; tileProvider.undergroundColor = this._undergroundColor; - tileProvider.undergroundColorAlphaByDistance = this._undergroundColorAlphaByDistance; + tileProvider.undergroundColorAlphaByDistance = + this._undergroundColorAlphaByDistance; tileProvider.lambertDiffuseMultiplier = this.lambertDiffuseMultiplier; surface.beginFrame(frameState); diff --git a/packages/engine/Source/Scene/GlobeDepth.js b/packages/engine/Source/Scene/GlobeDepth.js index 562ec8ad0ccc..7f4f7cb649ba 100644 --- a/packages/engine/Source/Scene/GlobeDepth.js +++ b/packages/engine/Source/Scene/GlobeDepth.js @@ -97,7 +97,7 @@ function updateCopyCommands(globeDepth, context, width, height, passState) { const useScissorTest = !BoundingRectangle.equals( globeDepth._viewport, - passState.viewport + passState.viewport, ); let updateScissor = useScissorTest !== globeDepth._useScissorTest; globeDepth._useScissorTest = useScissorTest; @@ -107,7 +107,7 @@ function updateCopyCommands(globeDepth, context, width, height, passState) { ) { globeDepth._scissorRectangle = BoundingRectangle.clone( passState.viewport, - globeDepth._scissorRectangle + globeDepth._scissorRectangle, ); updateScissor = true; } @@ -165,7 +165,7 @@ function updateCopyCommands(globeDepth, context, width, height, passState) { }, }, owner: globeDepth, - } + }, ); } @@ -183,7 +183,7 @@ function updateCopyCommands(globeDepth, context, width, height, passState) { }, }, owner: globeDepth, - } + }, ); } @@ -199,7 +199,7 @@ function updateCopyCommands(globeDepth, context, width, height, passState) { }, }, owner: globeDepth, - } + }, ); } @@ -217,7 +217,7 @@ function updateCopyCommands(globeDepth, context, width, height, passState) { }, }, owner: globeDepth, - } + }, ); } @@ -242,7 +242,7 @@ GlobeDepth.prototype.update = function ( viewport, numSamples, hdr, - clearGlobeDepth + clearGlobeDepth, ) { const width = viewport.width; const height = viewport.height; @@ -261,7 +261,7 @@ GlobeDepth.prototype.update = function ( width, height, numSamples, - pixelDatatype + pixelDatatype, ); } this._copyDepthFramebuffer.update(context, width, height); @@ -282,7 +282,8 @@ GlobeDepth.prototype.executeCopyDepth = function (context, passState) { if (defined(this._copyDepthCommand)) { this.prepareColorTextures(context); this._copyDepthCommand.execute(context, passState); - context.uniformState.globeDepthTexture = this._copyDepthFramebuffer.getColorTexture(); + context.uniformState.globeDepthTexture = + this._copyDepthFramebuffer.getColorTexture(); } }; @@ -290,7 +291,7 @@ GlobeDepth.prototype.executeUpdateDepth = function ( context, passState, clearGlobeDepth, - depthTexture + depthTexture, ) { const depthTextureToCopy = defined(depthTexture) ? depthTexture @@ -358,19 +359,23 @@ GlobeDepth.prototype.destroy = function () { destroyFramebuffers(this); if (defined(this._copyColorCommand)) { - this._copyColorCommand.shaderProgram = this._copyColorCommand.shaderProgram.destroy(); + this._copyColorCommand.shaderProgram = + this._copyColorCommand.shaderProgram.destroy(); } if (defined(this._copyDepthCommand)) { - this._copyDepthCommand.shaderProgram = this._copyDepthCommand.shaderProgram.destroy(); + this._copyDepthCommand.shaderProgram = + this._copyDepthCommand.shaderProgram.destroy(); } if (defined(this._tempCopyDepthCommand)) { - this._tempCopyDepthCommand.shaderProgram = this._tempCopyDepthCommand.shaderProgram.destroy(); + this._tempCopyDepthCommand.shaderProgram = + this._tempCopyDepthCommand.shaderProgram.destroy(); } if (defined(this._updateDepthCommand)) { - this._updateDepthCommand.shaderProgram = this._updateDepthCommand.shaderProgram.destroy(); + this._updateDepthCommand.shaderProgram = + this._updateDepthCommand.shaderProgram.destroy(); } return destroyObject(this); diff --git a/packages/engine/Source/Scene/GlobeSurfaceShaderSet.js b/packages/engine/Source/Scene/GlobeSurfaceShaderSet.js index b0c4b8063b4f..c89625c50ffa 100644 --- a/packages/engine/Source/Scene/GlobeSurfaceShaderSet.js +++ b/packages/engine/Source/Scene/GlobeSurfaceShaderSet.js @@ -11,7 +11,7 @@ function GlobeSurfaceShader( material, shaderProgram, clippingShaderState, - clippingPolygonShaderState + clippingPolygonShaderState, ) { this.numberOfDayTextures = numberOfDayTextures; this.flags = flags; @@ -243,7 +243,7 @@ GlobeSurfaceShaderSet.prototype.getShaderProgram = function (options) { // Need to go before GlobeFS if (currentClippingShaderState !== 0) { fs.sources.unshift( - getClippingFunction(clippingPlanes, frameState.context) + getClippingFunction(clippingPlanes, frameState.context), ); } @@ -257,7 +257,7 @@ GlobeSurfaceShaderSet.prototype.getShaderProgram = function (options) { fs.defines.push( `TEXTURE_UNITS ${numberOfDayTextures}`, cartographicLimitRectangleDefine, - imageryCutoutDefine + imageryCutoutDefine, ); if (applyBrightness) { @@ -355,10 +355,10 @@ GlobeSurfaceShaderSet.prototype.getShaderProgram = function (options) { } fs.defines.push( - `CLIPPING_POLYGON_REGIONS_LENGTH ${clippingPolygons.extentsCount}` + `CLIPPING_POLYGON_REGIONS_LENGTH ${clippingPolygons.extentsCount}`, ); vs.defines.push( - `CLIPPING_POLYGON_REGIONS_LENGTH ${clippingPolygons.extentsCount}` + `CLIPPING_POLYGON_REGIONS_LENGTH ${clippingPolygons.extentsCount}`, ); } @@ -398,7 +398,8 @@ GlobeSurfaceShaderSet.prototype.getShaderProgram = function (options) { texelUnclipped = v_textureCoordinates.x < cutoutAndColorResult.x || cutoutAndColorResult.z < v_textureCoordinates.x || v_textureCoordinates.y < cutoutAndColorResult.y || cutoutAndColorResult.w < v_textureCoordinates.y;\n\ cutoutAndColorResult = sampleAndBlend(\n`; } else { - computeDayColor += "\ + computeDayColor += + "\ color = sampleAndBlend(\n"; } computeDayColor += `\ @@ -409,8 +410,8 @@ GlobeSurfaceShaderSet.prototype.getShaderProgram = function (options) { u_dayTextureTranslationAndScale[${i}],\n\ ${applyAlpha ? `u_dayTextureAlpha[${i}]` : "1.0"},\n\ ${applyDayNightAlpha ? `u_dayTextureNightAlpha[${i}]` : "1.0"},\n${ - applyDayNightAlpha ? `u_dayTextureDayAlpha[${i}]` : "1.0" - },\n${applyBrightness ? `u_dayTextureBrightness[${i}]` : "0.0"},\n\ + applyDayNightAlpha ? `u_dayTextureDayAlpha[${i}]` : "1.0" + },\n${applyBrightness ? `u_dayTextureBrightness[${i}]` : "0.0"},\n\ ${applyContrast ? `u_dayTextureContrast[${i}]` : "0.0"},\n\ ${applyHue ? `u_dayTextureHue[${i}]` : "0.0"},\n\ ${applySaturation ? `u_dayTextureSaturation[${i}]` : "0.0"},\n\ @@ -426,7 +427,8 @@ GlobeSurfaceShaderSet.prototype.getShaderProgram = function (options) { } } - computeDayColor += "\ + computeDayColor += + "\ return color;\n\ }"; @@ -448,7 +450,7 @@ GlobeSurfaceShaderSet.prototype.getShaderProgram = function (options) { this.material, shader, currentClippingShaderState, - currentClippingPolygonsShaderState + currentClippingPolygonsShaderState, ); } diff --git a/packages/engine/Source/Scene/GlobeSurfaceTile.js b/packages/engine/Source/Scene/GlobeSurfaceTile.js index c1c7ab20dd52..0571b9e363ee 100644 --- a/packages/engine/Source/Scene/GlobeSurfaceTile.js +++ b/packages/engine/Source/Scene/GlobeSurfaceTile.js @@ -135,14 +135,14 @@ function getPosition(encoding, mode, projection, vertices, index, result) { const ellipsoid = projection.ellipsoid; const positionCartographic = ellipsoid.cartesianToCartographic( position, - scratchCartographic + scratchCartographic, ); position = projection.project(positionCartographic, result); position = Cartesian3.fromElements( position.z, position.x, position.y, - result + result, ); } @@ -158,7 +158,7 @@ GlobeSurfaceTile.prototype.pick = function ( mode, projection, cullBackFaces, - result + result, ) { const mesh = this.renderedMesh; if (!defined(mesh)) { @@ -186,7 +186,7 @@ GlobeSurfaceTile.prototype.pick = function ( v0, v1, v2, - cullBackFaces + cullBackFaces, ); if (defined(t) && t < minT && t >= 0.0) { minT = t; @@ -232,7 +232,7 @@ GlobeSurfaceTile.prototype.freeVertexArray = function () { GlobeSurfaceTile.initialize = function ( tile, terrainProvider, - imageryLayerCollection + imageryLayerCollection, ) { let surfaceTile = tile.data; if (!defined(surfaceTile)) { @@ -252,7 +252,7 @@ GlobeSurfaceTile.processStateMachine = function ( imageryLayerCollection, quadtree, vertexArraysToDestroy, - terrainOnly + terrainOnly, ) { GlobeSurfaceTile.initialize(tile, terrainProvider, imageryLayerCollection); @@ -265,7 +265,7 @@ GlobeSurfaceTile.processStateMachine = function ( terrainProvider, imageryLayerCollection, quadtree, - vertexArraysToDestroy + vertexArraysToDestroy, ); } @@ -295,7 +295,7 @@ GlobeSurfaceTile.processStateMachine = function ( const isImageryDoneLoading = surfaceTile.processImagery( tile, terrainProvider, - frameState + frameState, ); if (isTerrainDoneLoading && isImageryDoneLoading) { @@ -326,7 +326,7 @@ GlobeSurfaceTile.prototype.processImagery = function ( tile, terrainProvider, frameState, - skipLoading + skipLoading, ) { const surfaceTile = tile.data; let isUpsampledOnly = tile.upsampledFromParent; @@ -362,7 +362,7 @@ GlobeSurfaceTile.prototype.processImagery = function ( const thisTileDoneLoading = tileImagery.processStateMachine( tile, frameState, - skipLoading + skipLoading, ); isDoneLoading = isDoneLoading && thisTileDoneLoading; @@ -391,7 +391,7 @@ function toggleGeodeticSurfaceNormals( surfaceTile, enabled, ellipsoid, - frameState + frameState, ) { const renderedMesh = surfaceTile.renderedMesh; const vertexBuffer = renderedMesh.vertices; @@ -410,7 +410,7 @@ function toggleGeodeticSurfaceNormals( encoding.addGeodeticSurfaceNormals( vertexBuffer, newVertexBuffer, - ellipsoid + ellipsoid, ); } else { encoding.removeGeodeticSurfaceNormals(vertexBuffer, newVertexBuffer); @@ -425,13 +425,13 @@ function toggleGeodeticSurfaceNormals( GlobeSurfaceTile._freeVertexArray(surfaceTile.fill.vertexArray); surfaceTile.fill.vertexArray = GlobeSurfaceTile._createVertexArrayForMesh( frameState.context, - renderedMesh + renderedMesh, ); } else { GlobeSurfaceTile._freeVertexArray(surfaceTile.vertexArray); surfaceTile.vertexArray = GlobeSurfaceTile._createVertexArrayForMesh( frameState.context, - renderedMesh + renderedMesh, ); } GlobeSurfaceTile._freeVertexArray(surfaceTile.wireframeVertexArray); @@ -440,13 +440,13 @@ function toggleGeodeticSurfaceNormals( GlobeSurfaceTile.prototype.addGeodeticSurfaceNormals = function ( ellipsoid, - frameState + frameState, ) { toggleGeodeticSurfaceNormals(this, true, ellipsoid, frameState); }; GlobeSurfaceTile.prototype.removeGeodeticSurfaceNormals = function ( - frameState + frameState, ) { toggleGeodeticSurfaceNormals(this, false, undefined, frameState); }; @@ -454,7 +454,7 @@ GlobeSurfaceTile.prototype.removeGeodeticSurfaceNormals = function ( GlobeSurfaceTile.prototype.updateExaggeration = function ( tile, frameState, - quadtree + quadtree, ) { const surfaceTile = this; const mesh = surfaceTile.renderedMesh; @@ -507,7 +507,7 @@ function prepareNewTile(tile, terrainProvider, imageryLayerCollection) { let available = terrainProvider.getTileDataAvailable( tile.x, tile.y, - tile.level + tile.level, ); if (!defined(available) && defined(tile.parent)) { @@ -519,7 +519,7 @@ function prepareNewTile(tile, terrainProvider, imageryLayerCollection) { parent.x, parent.y, tile.x, - tile.y + tile.y, ); } } @@ -544,7 +544,7 @@ function processTerrainStateMachine( terrainProvider, imageryLayerCollection, quadtree, - vertexArraysToDestroy + vertexArraysToDestroy, ) { const surfaceTile = tile.data; @@ -567,7 +567,7 @@ function processTerrainStateMachine( imageryLayerCollection, quadtree, vertexArraysToDestroy, - true + true, ); } } @@ -580,7 +580,7 @@ function processTerrainStateMachine( terrainProvider, tile.x, tile.y, - tile.level + tile.level, ); } @@ -590,7 +590,7 @@ function processTerrainStateMachine( terrainProvider, tile.x, tile.y, - tile.level + tile.level, ); } @@ -601,7 +601,7 @@ function processTerrainStateMachine( terrainProvider, tile.x, tile.y, - tile.level + tile.level, ); } @@ -613,7 +613,7 @@ function processTerrainStateMachine( tile.x, tile.y, tile.level, - vertexArraysToDestroy + vertexArraysToDestroy, ); // Update the tile's exaggeration in case the globe's exaggeration changed while the tile was being processed @@ -636,7 +636,7 @@ function processTerrainStateMachine( surfaceTile._computeWaterMaskTranslationAndScale( tile, sourceTile, - surfaceTile.waterMaskTranslationAndScale + surfaceTile.waterMaskTranslationAndScale, ); } } @@ -668,7 +668,7 @@ function upsample(surfaceTile, tile, frameState, terrainProvider, x, y, level) { sourceLevel, x, y, - level + level, ); if (!defined(terrainDataPromise)) { // The upsample request has been deferred - try again later. @@ -728,7 +728,7 @@ function requestTileGeometry(surfaceTile, terrainProvider, x, y, level) { message, x, y, - level + level, ); if (terrainProvider._requestError.retry) { doRequest(); @@ -748,7 +748,7 @@ function requestTileGeometry(surfaceTile, terrainProvider, x, y, level) { x, y, level, - request + request, ); // If the request method returns undefined (instead of a promise), the request @@ -877,11 +877,11 @@ function createResources( x, y, level, - vertexArraysToDestroy + vertexArraysToDestroy, ) { surfaceTile.vertexArray = GlobeSurfaceTile._createVertexArrayForMesh( context, - surfaceTile.mesh + surfaceTile.mesh, ); surfaceTile.terrainState = TerrainState.READY; surfaceTile.fill = @@ -966,7 +966,7 @@ function createWaterMaskTextureIfNeeded(context, surfaceTile) { 0.0, 1.0, 1.0, - surfaceTile.waterMaskTranslationAndScale + surfaceTile.waterMaskTranslationAndScale, ); } @@ -988,7 +988,7 @@ GlobeSurfaceTile.prototype._findAncestorTileWithTerrainData = function (tile) { GlobeSurfaceTile.prototype._computeWaterMaskTranslationAndScale = function ( tile, sourceTile, - result + result, ) { const sourceTileRectangle = sourceTile.rectangle; const tileRectangle = tile.rectangle; diff --git a/packages/engine/Source/Scene/GlobeSurfaceTileProvider.js b/packages/engine/Source/Scene/GlobeSurfaceTileProvider.js index 385a602b7307..6aeab65e44af 100644 --- a/packages/engine/Source/Scene/GlobeSurfaceTileProvider.js +++ b/packages/engine/Source/Scene/GlobeSurfaceTileProvider.js @@ -129,22 +129,26 @@ function GlobeSurfaceTileProvider(options) { this._errorEvent = new Event(); - this._removeLayerAddedListener = this._imageryLayers.layerAdded.addEventListener( - GlobeSurfaceTileProvider.prototype._onLayerAdded, - this - ); - this._removeLayerRemovedListener = this._imageryLayers.layerRemoved.addEventListener( - GlobeSurfaceTileProvider.prototype._onLayerRemoved, - this - ); - this._removeLayerMovedListener = this._imageryLayers.layerMoved.addEventListener( - GlobeSurfaceTileProvider.prototype._onLayerMoved, - this - ); - this._removeLayerShownListener = this._imageryLayers.layerShownOrHidden.addEventListener( - GlobeSurfaceTileProvider.prototype._onLayerShownOrHidden, - this - ); + this._removeLayerAddedListener = + this._imageryLayers.layerAdded.addEventListener( + GlobeSurfaceTileProvider.prototype._onLayerAdded, + this, + ); + this._removeLayerRemovedListener = + this._imageryLayers.layerRemoved.addEventListener( + GlobeSurfaceTileProvider.prototype._onLayerRemoved, + this, + ); + this._removeLayerMovedListener = + this._imageryLayers.layerMoved.addEventListener( + GlobeSurfaceTileProvider.prototype._onLayerMoved, + this, + ); + this._removeLayerShownListener = + this._imageryLayers.layerShownOrHidden.addEventListener( + GlobeSurfaceTileProvider.prototype._onLayerShownOrHidden, + this, + ); this._imageryLayersUpdatedEvent = new Event(); this._layerOrderChanged = false; @@ -212,7 +216,7 @@ Object.defineProperties(GlobeSurfaceTileProvider.prototype, { this._baseColor = value; this._firstPassInitialColor = Cartesian4.fromColor( value, - this._firstPassInitialColor + this._firstPassInitialColor, ); }, }, @@ -477,7 +481,7 @@ GlobeSurfaceTileProvider.prototype.endUpdate = function (frameState) { this, this._quadtree._tilesToRender, frameState, - this._vertexArraysToDestroy + this._vertexArraysToDestroy, ); } @@ -534,7 +538,7 @@ GlobeSurfaceTileProvider.prototype.endUpdate = function (frameState) { addDrawCommandsForTile(this, tile, frameState); frameState.minimumTerrainHeight = Math.min( frameState.minimumTerrainHeight, - tileBoundingRegion.minimumHeight + tileBoundingRegion.minimumHeight, ); } } @@ -547,7 +551,7 @@ function pushCommand(command, frameState) { globeTranslucencyState.pushDerivedCommands( command, isBlendCommand, - frameState + frameState, ); } else { frameState.commandList.push(command); @@ -581,7 +585,7 @@ GlobeSurfaceTileProvider.prototype.cancelReprojections = function () { * @returns {number} The maximum geometric error in meters. */ GlobeSurfaceTileProvider.prototype.getLevelMaximumGeometricError = function ( - level + level, ) { if (!defined(this._terrainProvider)) { return 0; @@ -621,7 +625,7 @@ GlobeSurfaceTileProvider.prototype.loadTile = function (frameState, tile) { this._imageryLayers, this.quadtree, this._vertexArraysToDestroy, - terrainOnly + terrainOnly, ); surfaceTile = tile.data; @@ -643,7 +647,7 @@ GlobeSurfaceTileProvider.prototype.loadTile = function (frameState, tile) { this._imageryLayers, this.quadtree, this._vertexArraysToDestroy, - terrainOnly + terrainOnly, ); } } @@ -661,7 +665,7 @@ function clipRectangleAntimeridian(tileRectangle, cartographicLimitRectangle) { } const splitRectangle = Rectangle.clone( cartographicLimitRectangle, - splitCartographicLimitRectangleScratch + splitCartographicLimitRectangleScratch, ); const tileCenter = Rectangle.center(tileRectangle, rectangleCenterScratch); if (tileCenter.longitude > 0.0) { @@ -698,7 +702,7 @@ function isUndergroundVisible(tileProvider, frameState) { if ( !Rectangle.equals( tileProvider.cartographicLimitRectangle, - Rectangle.MAX_VALUE + Rectangle.MAX_VALUE, ) ) { return true; @@ -723,7 +727,7 @@ function isUndergroundVisible(tileProvider, frameState) { GlobeSurfaceTileProvider.prototype.computeTileVisibility = function ( tile, frameState, - occluders + occluders, ) { const distance = this.computeDistanceToTile(tile, frameState); tile._distance = distance; @@ -756,12 +760,12 @@ GlobeSurfaceTileProvider.prototype.computeTileVisibility = function ( surfaceTile.clippedByBoundaries = false; const clippedCartographicLimitRectangle = clipRectangleAntimeridian( tile.rectangle, - this.cartographicLimitRectangle + this.cartographicLimitRectangle, ); const areaLimitIntersection = Rectangle.simpleIntersection( clippedCartographicLimitRectangle, tile.rectangle, - rectangleIntersectionScratch + rectangleIntersectionScratch, ); if (!defined(areaLimitIntersection)) { return Visibility.NONE; @@ -777,13 +781,13 @@ GlobeSurfaceTileProvider.prototype.computeTileVisibility = function ( frameState.mapProjection, tileBoundingRegion.minimumHeight, tileBoundingRegion.maximumHeight, - boundingVolume + boundingVolume, ); Cartesian3.fromElements( boundingVolume.center.z, boundingVolume.center.x, boundingVolume.center.y, - boundingVolume.center + boundingVolume.center, ); if ( @@ -793,7 +797,7 @@ GlobeSurfaceTileProvider.prototype.computeTileVisibility = function ( boundingVolume = BoundingSphere.union( tileBoundingRegion.boundingSphere, boundingVolume, - boundingVolume + boundingVolume, ); } } @@ -804,9 +808,8 @@ GlobeSurfaceTileProvider.prototype.computeTileVisibility = function ( const clippingPlanes = this._clippingPlanes; if (defined(clippingPlanes) && clippingPlanes.enabled) { - const planeIntersection = clippingPlanes.computeIntersectionWithBoundingVolume( - boundingVolume - ); + const planeIntersection = + clippingPlanes.computeIntersectionWithBoundingVolume(boundingVolume); tile.isClipped = planeIntersection !== Intersect.INSIDE; if (planeIntersection === Intersect.OUTSIDE) { return Visibility.NONE; @@ -815,9 +818,10 @@ GlobeSurfaceTileProvider.prototype.computeTileVisibility = function ( const clippingPolygons = this._clippingPolygons; if (defined(clippingPolygons) && clippingPolygons.enabled) { - const polygonIntersection = clippingPolygons.computeIntersectionWithBoundingVolume( - tileBoundingRegion - ); + const polygonIntersection = + clippingPolygons.computeIntersectionWithBoundingVolume( + tileBoundingRegion, + ); tile.isClipped = polygonIntersection !== Intersect.OUTSIDE; // Polygon clipping intersections are determined by outer rectangles, therefore we cannot // preemptively determine if a tile is completely clipped or not here. @@ -855,7 +859,7 @@ GlobeSurfaceTileProvider.prototype.computeTileVisibility = function ( if ( occluders.ellipsoid.isScaledSpacePointVisiblePossiblyUnderEllipsoid( occludeePointInScaledSpace, - tileBoundingRegion.minimumHeight + tileBoundingRegion.minimumHeight, ) ) { return visibility; @@ -883,7 +887,7 @@ GlobeSurfaceTileProvider.prototype.canRefine = function (tile) { const childAvailable = this.terrainProvider.getTileDataAvailable( tile.x * 2, tile.y * 2, - tile.level + 1 + tile.level + 1, ); return childAvailable !== undefined; }; @@ -901,7 +905,7 @@ const canRenderTraversalStack = []; */ GlobeSurfaceTileProvider.prototype.canRenderWithoutLosingDetail = function ( tile, - frameState + frameState, ) { const surfaceTile = tile.data; @@ -957,7 +961,7 @@ GlobeSurfaceTileProvider.prototype.canRenderWithoutLosingDetail = function ( tile.southwestChild, tile.southeastChild, tile.northwestChild, - tile.northeastChild + tile.northeastChild, ); while (stack.length > 0) { @@ -1007,7 +1011,7 @@ GlobeSurfaceTileProvider.prototype.canRenderWithoutLosingDetail = function ( descendant.southwestChild, descendant.southeastChild, descendant.northwestChild, - descendant.northeastChild + descendant.northeastChild, ); } } @@ -1025,7 +1029,7 @@ const tileDirectionScratch = new Cartesian3(); */ GlobeSurfaceTileProvider.prototype.computeTileLoadPriority = function ( tile, - frameState + frameState, ) { const surfaceTile = tile.data; if (surfaceTile === undefined) { @@ -1042,7 +1046,7 @@ GlobeSurfaceTileProvider.prototype.computeTileLoadPriority = function ( const tileDirection = Cartesian3.subtract( obb.center, cameraPosition, - tileDirectionScratch + tileDirectionScratch, ); const magnitude = Cartesian3.magnitude(tileDirection); if (magnitude < CesiumMath.EPSILON5) { @@ -1074,7 +1078,7 @@ const northeastScratch = new Cartesian3(); */ GlobeSurfaceTileProvider.prototype.showTileThisFrame = function ( tile, - frameState + frameState, ) { let readyTextureCount = 0; const tileImageryCollection = tile.data.imagery; @@ -1121,7 +1125,7 @@ function computeOccludeePoint( rectangle, minimumHeight, maximumHeight, - result + result, ) { const ellipsoidalOccluder = tileProvider.quadtree._occluders.ellipsoid; const ellipsoid = ellipsoidalOccluder.ellipsoid; @@ -1132,35 +1136,35 @@ function computeOccludeePoint( rectangle.south, maximumHeight, ellipsoid, - cornerPositions[0] + cornerPositions[0], ); Cartesian3.fromRadians( rectangle.east, rectangle.south, maximumHeight, ellipsoid, - cornerPositions[1] + cornerPositions[1], ); Cartesian3.fromRadians( rectangle.west, rectangle.north, maximumHeight, ellipsoid, - cornerPositions[2] + cornerPositions[2], ); Cartesian3.fromRadians( rectangle.east, rectangle.north, maximumHeight, ellipsoid, - cornerPositions[3] + cornerPositions[3], ); return ellipsoidalOccluder.computeHorizonCullingPointPossiblyUnderEllipsoid( center, cornerPositions, minimumHeight, - result + result, ); } @@ -1174,7 +1178,7 @@ function computeOccludeePoint( */ GlobeSurfaceTileProvider.prototype.computeDistanceToTile = function ( tile, - frameState + frameState, ) { // The distance should be: // 1. the actual distance to the tight-fitting bounding volume, or @@ -1315,12 +1319,12 @@ function updateTileBoundingRegion(tile, tileProvider, frameState) { tileBoundingRegion.minimumHeight = VerticalExaggeration.getHeight( tileBoundingRegion.minimumHeight, exaggeration, - exaggerationRelativeHeight + exaggerationRelativeHeight, ); tileBoundingRegion.maximumHeight = VerticalExaggeration.getHeight( tileBoundingRegion.maximumHeight, exaggeration, - exaggerationRelativeHeight + exaggerationRelativeHeight, ); } @@ -1328,15 +1332,15 @@ function updateTileBoundingRegion(tile, tileProvider, frameState) { if (!surfaceTile.boundingVolumeIsFromMesh) { tileBoundingRegion._orientedBoundingBox = OrientedBoundingBox.clone( mesh.orientedBoundingBox, - tileBoundingRegion._orientedBoundingBox + tileBoundingRegion._orientedBoundingBox, ); tileBoundingRegion._boundingSphere = BoundingSphere.clone( mesh.boundingSphere3D, - tileBoundingRegion._boundingSphere + tileBoundingRegion._boundingSphere, ); surfaceTile.occludeePointInScaledSpace = Cartesian3.clone( mesh.occludeePointInScaledSpace, - surfaceTile.occludeePointInScaledSpace + surfaceTile.occludeePointInScaledSpace, ); // If the occludee point is not defined, fallback to calculating it from the OBB @@ -1347,7 +1351,7 @@ function updateTileBoundingRegion(tile, tileProvider, frameState) { tile.rectangle, tileBoundingRegion.minimumHeight, tileBoundingRegion.maximumHeight, - surfaceTile.occludeePointInScaledSpace + surfaceTile.occludeePointInScaledSpace, ); } } @@ -1367,7 +1371,7 @@ function updateTileBoundingRegion(tile, tileProvider, frameState) { tile.rectangle, tileBoundingRegion.minimumHeight, tileBoundingRegion.maximumHeight, - surfaceTile.occludeePointInScaledSpace + surfaceTile.occludeePointInScaledSpace, ); } } @@ -1438,7 +1442,7 @@ function getTileReadyCallback(tileImageriesToFree, layer, terrainProvider) { tileImagery = tileImageryCollection[i]; imagery = defaultValue( tileImagery.readyImagery, - tileImagery.loadingImagery + tileImagery.loadingImagery, ); if (imagery.imageryLayer === layer) { startIndex = i; @@ -1458,7 +1462,7 @@ function getTileReadyCallback(tileImageriesToFree, layer, terrainProvider) { return !layer._createTileImagerySkeletons( tile, terrainProvider, - endIndex + endIndex, ); } @@ -1504,7 +1508,7 @@ GlobeSurfaceTileProvider.prototype._onLayerAdded = function (layer, index) { const tileImagery = tileImageryCollection[i]; const imagery = defaultValue( tileImagery.readyImagery, - tileImagery.loadingImagery + tileImagery.loadingImagery, ); if (imagery.imageryLayer === layer) { if (startIndex === -1) { @@ -1530,14 +1534,14 @@ GlobeSurfaceTileProvider.prototype._onLayerAdded = function (layer, index) { layer._createTileImagerySkeletons( tile, terrainProvider, - insertionPoint + insertionPoint, ) ) { // Add callback to remove old TileImageries when the new TileImageries are ready tile._loadedCallbacks[layer._layerIndex] = getTileReadyCallback( tileImageriesToFree, layer, - terrainProvider + terrainProvider, ); tile.state = QuadtreeTileLoadState.LOADING; @@ -1614,7 +1618,7 @@ GlobeSurfaceTileProvider.prototype._onLayerRemoved = function (layer, index) { GlobeSurfaceTileProvider.prototype._onLayerMoved = function ( layer, newIndex, - oldIndex + oldIndex, ) { this._layerOrderChanged = true; this._imageryLayersUpdatedEvent.raiseEvent(); @@ -1623,7 +1627,7 @@ GlobeSurfaceTileProvider.prototype._onLayerMoved = function ( GlobeSurfaceTileProvider.prototype._onLayerShownOrHidden = function ( layer, index, - show + show, ) { if (show) { this._onLayerAdded(layer, index); @@ -1686,7 +1690,7 @@ function createTileUniformMap(frameState, globeSurfaceTileProvider) { const centerEye = Matrix4.multiplyByPoint( viewMatrix, this.properties.rtc, - centerEyeScratch + centerEyeScratch, ); Matrix4.setTranslation(viewMatrix, centerEye, modifiedModelViewScratch); return modifiedModelViewScratch; @@ -1697,17 +1701,17 @@ function createTileUniformMap(frameState, globeSurfaceTileProvider) { const centerEye = Matrix4.multiplyByPoint( viewMatrix, this.properties.rtc, - centerEyeScratch + centerEyeScratch, ); Matrix4.setTranslation( viewMatrix, centerEye, - modifiedModelViewProjectionScratch + modifiedModelViewProjectionScratch, ); Matrix4.multiply( projectionMatrix, modifiedModelViewProjectionScratch, - modifiedModelViewProjectionScratch + modifiedModelViewProjectionScratch, ); return modifiedModelViewProjectionScratch; }, @@ -1791,13 +1795,13 @@ function createTileUniformMap(frameState, globeSurfaceTileProvider) { ? Matrix4.multiply( frameState.context.uniformState.view, clippingPlanes.modelMatrix, - scratchClippingPlanesMatrix + scratchClippingPlanesMatrix, ) : Matrix4.IDENTITY; return Matrix4.inverseTranspose( transform, - scratchInverseTransposeClippingPlanesMatrix + scratchInverseTransposeClippingPlanesMatrix, ); }, u_clippingPlanesEdgeStyle: function () { @@ -1955,7 +1959,7 @@ function createWireframeVertexArrayIfNecessary(context, provider, tile) { surfaceTile.wireframeVertexArray = createWireframeVertexArray( context, vertexArray, - mesh + mesh, ); surfaceTile.wireframeVertexArray.mesh = mesh; } @@ -1987,7 +1991,7 @@ function createWireframeVertexArray(context, vertexArray, terrainMesh) { typedArray: wireframeIndices, usage: BufferUsage.STATIC_DRAW, indexDatatype: IndexDatatype.fromSizeInBytes( - wireframeIndices.BYTES_PER_ELEMENT + wireframeIndices.BYTES_PER_ELEMENT, ), }); return new VertexArray({ @@ -2035,13 +2039,12 @@ let debugDestroyPrimitive; modelMatrix = Matrix4.fromRotationTranslation( obb.halfAxes, obb.center, - modelMatrix + modelMatrix, ); instanceOBB.modelMatrix = modelMatrix; - instanceOBB.attributes.color = ColorGeometryInstanceAttribute.fromColor( - color - ); + instanceOBB.attributes.color = + ColorGeometryInstanceAttribute.fromColor(color); primitive = createDebugPrimitive(instanceOBB); return primitive; @@ -2058,13 +2061,12 @@ let debugDestroyPrimitive; modelMatrix = Matrix4.multiplyByUniformScale( modelMatrix, sphere.radius, - modelMatrix + modelMatrix, ); instanceSphere.modelMatrix = modelMatrix; - instanceSphere.attributes.color = ColorGeometryInstanceAttribute.fromColor( - color - ); + instanceSphere.attributes.color = + ColorGeometryInstanceAttribute.fromColor(color); primitive = createDebugPrimitive(instanceSphere); return primitive; @@ -2166,11 +2168,11 @@ function addDrawCommandsForTile(tileProvider, tile, frameState) { const undergroundColor = defaultValue( tileProvider.undergroundColor, - defaultUndergroundColor + defaultUndergroundColor, ); const undergroundColorAlphaByDistance = defaultValue( tileProvider.undergroundColorAlphaByDistance, - defaultUndergroundColorAlphaByDistance + defaultUndergroundColorAlphaByDistance, ); const showUndergroundColor = isUndergroundVisible(tileProvider, frameState) && @@ -2269,11 +2271,11 @@ function addDrawCommandsForTile(tileProvider, tile, frameState) { const projection = frameState.mapProjection; const southwest = projection.project( Rectangle.southwest(tile.rectangle), - southwestScratch + southwestScratch, ); const northeast = projection.project( Rectangle.northeast(tile.rectangle), - northeastScratch + northeastScratch, ); tileRectangle.x = southwest.x; @@ -2314,9 +2316,8 @@ function addDrawCommandsForTile(tileProvider, tile, frameState) { southLatitude = tile.rectangle.south; northLatitude = tile.rectangle.north; - southMercatorY = WebMercatorProjection.geodeticLatitudeToMercatorAngle( - southLatitude - ); + southMercatorY = + WebMercatorProjection.geodeticLatitudeToMercatorAngle(southLatitude); oneOverMercatorHeight = 1.0 / @@ -2351,7 +2352,8 @@ function addDrawCommandsForTile(tileProvider, tile, frameState) { tileProvider.atmosphereMieScaleHeight; surfaceShaderSetOptions.atmosphereMieAnisotropy = tileProvider.atmosphereMieAnisotropy; - surfaceShaderSetOptions.perFragmentGroundAtmosphere = perFragmentGroundAtmosphere; + surfaceShaderSetOptions.perFragmentGroundAtmosphere = + perFragmentGroundAtmosphere; surfaceShaderSetOptions.hasVertexNormals = hasVertexNormals; surfaceShaderSetOptions.useWebMercatorProjection = useWebMercatorProjection; surfaceShaderSetOptions.clippedByBoundaries = surfaceTile.clippedByBoundaries; @@ -2390,7 +2392,7 @@ function addDrawCommandsForTile(tileProvider, tile, frameState) { for (let i = 0; i < drawCommandsLength; ++i) { tileProvider._uniformMaps[i] = createTileUniformMap( frameState, - tileProvider + tileProvider, ); } } @@ -2472,14 +2474,14 @@ function addDrawCommandsForTile(tileProvider, tile, frameState) { frontFaceAlphaByDistanceFinal.nearValue, frontFaceAlphaByDistanceFinal.far, frontFaceAlphaByDistanceFinal.farValue, - uniformMapProperties.frontFaceAlphaByDistance + uniformMapProperties.frontFaceAlphaByDistance, ); Cartesian4.fromElements( backFaceAlphaByDistanceFinal.near, backFaceAlphaByDistanceFinal.nearValue, backFaceAlphaByDistanceFinal.far, backFaceAlphaByDistanceFinal.farValue, - uniformMapProperties.backFaceAlphaByDistance + uniformMapProperties.backFaceAlphaByDistance, ); } @@ -2488,7 +2490,7 @@ function addDrawCommandsForTile(tileProvider, tile, frameState) { undergroundColorAlphaByDistance.nearValue, undergroundColorAlphaByDistance.far, undergroundColorAlphaByDistance.farValue, - uniformMapProperties.undergroundColorAlphaByDistance + uniformMapProperties.undergroundColorAlphaByDistance, ); Color.clone(undergroundColor, uniformMapProperties.undergroundColor); @@ -2502,12 +2504,13 @@ function addDrawCommandsForTile(tileProvider, tile, frameState) { if (highlightFillTile) { Color.clone( tileProvider.fillHighlightColor, - uniformMapProperties.fillHighlightColor + uniformMapProperties.fillHighlightColor, ); } uniformMapProperties.verticalExaggerationAndRelativeHeight.x = exaggeration; - uniformMapProperties.verticalExaggerationAndRelativeHeight.y = exaggerationRelativeHeight; + uniformMapProperties.verticalExaggerationAndRelativeHeight.y = + exaggerationRelativeHeight; uniformMapProperties.center3D = mesh.center; Cartesian3.clone(rtc, uniformMapProperties.rtc); @@ -2516,26 +2519,29 @@ function addDrawCommandsForTile(tileProvider, tile, frameState) { uniformMapProperties.southAndNorthLatitude.x = southLatitude; uniformMapProperties.southAndNorthLatitude.y = northLatitude; uniformMapProperties.southMercatorYAndOneOverHeight.x = southMercatorY; - uniformMapProperties.southMercatorYAndOneOverHeight.y = oneOverMercatorHeight; + uniformMapProperties.southMercatorYAndOneOverHeight.y = + oneOverMercatorHeight; // Convert tile limiter rectangle from cartographic to texture space using the tileRectangle. - const localizedCartographicLimitRectangle = localizedCartographicLimitRectangleScratch; + const localizedCartographicLimitRectangle = + localizedCartographicLimitRectangleScratch; const cartographicLimitRectangle = clipRectangleAntimeridian( tile.rectangle, - tileProvider.cartographicLimitRectangle + tileProvider.cartographicLimitRectangle, ); - const localizedTranslucencyRectangle = localizedTranslucencyRectangleScratch; + const localizedTranslucencyRectangle = + localizedTranslucencyRectangleScratch; const clippedTranslucencyRectangle = clipRectangleAntimeridian( tile.rectangle, - translucencyRectangle + translucencyRectangle, ); Cartesian3.fromElements( hueShift, saturationShift, brightnessShift, - uniformMapProperties.hsbShift + uniformMapProperties.hsbShift, ); const cartographicTileRectangle = tile.rectangle; @@ -2556,7 +2562,7 @@ function addDrawCommandsForTile(tileProvider, tile, frameState) { Cartesian4.clone( localizedCartographicLimitRectangle, - uniformMapProperties.localizedCartographicLimitRectangle + uniformMapProperties.localizedCartographicLimitRectangle, ); localizedTranslucencyRectangle.x = @@ -2574,7 +2580,7 @@ function addDrawCommandsForTile(tileProvider, tile, frameState) { Cartesian4.clone( localizedTranslucencyRectangle, - uniformMapProperties.localizedTranslucencyRectangle + uniformMapProperties.localizedTranslucencyRectangle, ); // For performance, render fog only when fog is enabled and the effect of @@ -2629,10 +2635,8 @@ function addDrawCommandsForTile(tileProvider, tile, frameState) { const imageryLayer = imagery.imageryLayer; if (!defined(tileImagery.textureTranslationAndScale)) { - tileImagery.textureTranslationAndScale = imageryLayer._calculateTextureTranslationAndScale( - tile, - tileImagery - ); + tileImagery.textureTranslationAndScale = + imageryLayer._calculateTextureTranslationAndScale(tile, tileImagery); } uniformMapProperties.dayTextures[numberOfDayTextures] = texture; @@ -2706,21 +2710,21 @@ function addDrawCommandsForTile(tileProvider, tile, frameState) { let dayTextureCutoutRectangle = uniformMapProperties.dayTextureCutoutRectangles[numberOfDayTextures]; if (!defined(dayTextureCutoutRectangle)) { - dayTextureCutoutRectangle = uniformMapProperties.dayTextureCutoutRectangles[ - numberOfDayTextures - ] = new Cartesian4(); + dayTextureCutoutRectangle = + uniformMapProperties.dayTextureCutoutRectangles[numberOfDayTextures] = + new Cartesian4(); } Cartesian4.clone(Cartesian4.ZERO, dayTextureCutoutRectangle); if (defined(imageryLayer.cutoutRectangle)) { const cutoutRectangle = clipRectangleAntimeridian( cartographicTileRectangle, - imageryLayer.cutoutRectangle + imageryLayer.cutoutRectangle, ); const intersection = Rectangle.simpleIntersection( cutoutRectangle, cartographicTileRectangle, - rectangleIntersectionScratch + rectangleIntersectionScratch, ); applyCutout = defined(intersection) || applyCutout; @@ -2742,9 +2746,8 @@ function addDrawCommandsForTile(tileProvider, tile, frameState) { let colorToAlpha = uniformMapProperties.colorsToAlpha[numberOfDayTextures]; if (!defined(colorToAlpha)) { - colorToAlpha = uniformMapProperties.colorsToAlpha[ - numberOfDayTextures - ] = new Cartesian4(); + colorToAlpha = uniformMapProperties.colorsToAlpha[numberOfDayTextures] = + new Cartesian4(); } const hasColorToAlpha = @@ -2782,7 +2785,7 @@ function addDrawCommandsForTile(tileProvider, tile, frameState) { uniformMapProperties.waterMask = waterMaskTexture; Cartesian4.clone( waterMaskTranslationAndScale, - uniformMapProperties.waterMaskTranslationAndScale + uniformMapProperties.waterMaskTranslationAndScale, ); uniformMapProperties.minMaxHeight.x = encoding.minimumHeight; @@ -2796,7 +2799,7 @@ function addDrawCommandsForTile(tileProvider, tile, frameState) { if (clippingPlanesEnabled) { uniformMapProperties.clippingPlanesEdgeColor = Color.clone( clippingPlanes.edgeColor, - uniformMapProperties.clippingPlanesEdgeColor + uniformMapProperties.clippingPlanesEdgeColor, ); uniformMapProperties.clippingPlanesEdgeWidth = clippingPlanes.edgeWidth; } @@ -2833,7 +2836,7 @@ function addDrawCommandsForTile(tileProvider, tile, frameState) { } command.shaderProgram = tileProvider._surfaceShaderSet.getShaderProgram( - surfaceShaderSetOptions + surfaceShaderSetOptions, ); command.castShadows = castShadows; command.receiveShadows = receiveShadows; @@ -2863,30 +2866,30 @@ function addDrawCommandsForTile(tileProvider, tile, frameState) { frameState.mapProjection, tileBoundingRegion.minimumHeight, tileBoundingRegion.maximumHeight, - boundingVolume + boundingVolume, ); Cartesian3.fromElements( boundingVolume.center.z, boundingVolume.center.x, boundingVolume.center.y, - boundingVolume.center + boundingVolume.center, ); if (frameState.mode === SceneMode.MORPHING) { boundingVolume = BoundingSphere.union( tileBoundingRegion.boundingSphere, boundingVolume, - boundingVolume + boundingVolume, ); } } else { command.boundingVolume = BoundingSphere.clone( tileBoundingRegion.boundingSphere, - boundingVolume + boundingVolume, ); command.orientedBoundingBox = OrientedBoundingBox.clone( tileBoundingRegion.boundingVolume, - orientedBoundingBox + orientedBoundingBox, ); } diff --git a/packages/engine/Source/Scene/GlobeTranslucency.js b/packages/engine/Source/Scene/GlobeTranslucency.js index d81eca651829..1b31e1768eb4 100644 --- a/packages/engine/Source/Scene/GlobeTranslucency.js +++ b/packages/engine/Source/Scene/GlobeTranslucency.js @@ -123,13 +123,13 @@ Object.defineProperties(GlobeTranslucency.prototype, { //>>includeStart('debug', pragmas.debug); if (defined(value) && value.far < value.near) { throw new DeveloperError( - "far distance must be greater than near distance." + "far distance must be greater than near distance.", ); } //>>includeEnd('debug'); this._frontFaceAlphaByDistance = NearFarScalar.clone( value, - this._frontFaceAlphaByDistance + this._frontFaceAlphaByDistance, ); }, }, @@ -203,13 +203,13 @@ Object.defineProperties(GlobeTranslucency.prototype, { //>>includeStart('debug', pragmas.debug); if (defined(value) && value.far < value.near) { throw new DeveloperError( - "far distance must be greater than near distance." + "far distance must be greater than near distance.", ); } //>>includeEnd('debug'); this._backFaceAlphaByDistance = NearFarScalar.clone( value, - this._backFaceAlphaByDistance + this._backFaceAlphaByDistance, ); }, }, diff --git a/packages/engine/Source/Scene/GlobeTranslucencyFramebuffer.js b/packages/engine/Source/Scene/GlobeTranslucencyFramebuffer.js index 7aea7f86d402..c97297854ab7 100644 --- a/packages/engine/Source/Scene/GlobeTranslucencyFramebuffer.js +++ b/packages/engine/Source/Scene/GlobeTranslucencyFramebuffer.js @@ -81,7 +81,7 @@ function updateResources(globeTranslucency, context, width, height, hdr) { width, height, 1, - pixelDatatype + pixelDatatype, ); globeTranslucency._packedDepthFramebuffer.update(context, width, height); } @@ -92,7 +92,7 @@ function updateCommands(globeTranslucency, context, width, height, passState) { const useScissorTest = !BoundingRectangle.equals( globeTranslucency._viewport, - passState.viewport + passState.viewport, ); let updateScissor = useScissorTest !== globeTranslucency._useScissorTest; globeTranslucency._useScissorTest = useScissorTest; @@ -100,12 +100,12 @@ function updateCommands(globeTranslucency, context, width, height, passState) { if ( !BoundingRectangle.equals( globeTranslucency._scissorRectangle, - passState.viewport + passState.viewport, ) ) { globeTranslucency._scissorRectangle = BoundingRectangle.clone( passState.viewport, - globeTranslucency._scissorRectangle + globeTranslucency._scissorRectangle, ); updateScissor = true; } @@ -114,7 +114,7 @@ function updateCommands(globeTranslucency, context, width, height, passState) { !defined(globeTranslucency._renderState) || !BoundingRectangle.equals( globeTranslucency._viewport, - globeTranslucency._renderState.viewport + globeTranslucency._renderState.viewport, ) || updateScissor ) { @@ -137,7 +137,7 @@ function updateCommands(globeTranslucency, context, width, height, passState) { }, }, owner: globeTranslucency, - } + }, ); } @@ -163,7 +163,7 @@ GlobeTranslucencyFramebuffer.prototype.updateAndClear = function ( hdr, viewport, context, - passState + passState, ) { const width = viewport.width; const height = viewport.height; @@ -176,14 +176,14 @@ GlobeTranslucencyFramebuffer.prototype.updateAndClear = function ( GlobeTranslucencyFramebuffer.prototype.clearClassification = function ( context, - passState + passState, ) { this._clearCommand.execute(context, passState); }; GlobeTranslucencyFramebuffer.prototype.packDepth = function ( context, - passState + passState, ) { this._packedDepthCommand.execute(context, passState); return this.packedDepthTexture; diff --git a/packages/engine/Source/Scene/GlobeTranslucencyState.js b/packages/engine/Source/Scene/GlobeTranslucencyState.js index 8e3f13ab66e4..c1f2f693f327 100644 --- a/packages/engine/Source/Scene/GlobeTranslucencyState.js +++ b/packages/engine/Source/Scene/GlobeTranslucencyState.js @@ -133,24 +133,24 @@ GlobeTranslucencyState.prototype.update = function (scene) { globe.translucency.enabled, globe.translucency.frontFaceAlpha, globe.translucency.frontFaceAlphaByDistance, - this._frontFaceAlphaByDistance + this._frontFaceAlphaByDistance, ); this._backFaceAlphaByDistance = updateAlphaByDistance( globe.translucency.enabled, globe.translucency.backFaceAlpha, globe.translucency.backFaceAlphaByDistance, - this._backFaceAlphaByDistance + this._backFaceAlphaByDistance, ); this._frontFaceTranslucent = isFaceTranslucent( globe.translucency.enabled, this._frontFaceAlphaByDistance, - globe + globe, ); this._backFaceTranslucent = isFaceTranslucent( globe.translucency.enabled, this._backFaceAlphaByDistance, - globe + globe, ); this._requiresManualDepthTest = requiresManualDepthTest(this, scene, globe); @@ -162,7 +162,7 @@ GlobeTranslucencyState.prototype.update = function (scene) { this._rectangle = Rectangle.clone( globe.translucency.rectangle, - this._rectangle + this._rectangle, ); gatherDerivedCommandRequirements(this, scene); @@ -244,7 +244,7 @@ function gatherDerivedCommandRequirements(state, scene) { scene, false, false, - state._derivedCommandTypes + state._derivedCommandTypes, ); state._derivedBlendCommandsLength = getDerivedCommandTypes( @@ -252,7 +252,7 @@ function gatherDerivedCommandRequirements(state, scene) { scene, true, false, - state._derivedBlendCommandTypes + state._derivedBlendCommandTypes, ); state._derivedPickCommandsLength = getDerivedCommandTypes( @@ -260,7 +260,7 @@ function gatherDerivedCommandRequirements(state, scene) { scene, false, true, - state._derivedPickCommandTypes + state._derivedPickCommandTypes, ); let i; @@ -298,7 +298,7 @@ function getDerivedCommandTypes( scene, isBlendCommand, isPickCommand, - types + types, ) { let length = 0; @@ -316,14 +316,14 @@ function getDerivedCommandTypes( const translucentFrontFaceCommandType = isPickCommand ? DerivedCommandType.PICK_FRONT_FACE : requiresManualDepthTest - ? DerivedCommandType.TRANSLUCENT_FRONT_FACE_MANUAL_DEPTH_TEST - : DerivedCommandType.TRANSLUCENT_FRONT_FACE; + ? DerivedCommandType.TRANSLUCENT_FRONT_FACE_MANUAL_DEPTH_TEST + : DerivedCommandType.TRANSLUCENT_FRONT_FACE; const translucentBackFaceCommandType = isPickCommand ? DerivedCommandType.PICK_BACK_FACE : requiresManualDepthTest - ? DerivedCommandType.TRANSLUCENT_BACK_FACE_MANUAL_DEPTH_TEST - : DerivedCommandType.TRANSLUCENT_BACK_FACE; + ? DerivedCommandType.TRANSLUCENT_BACK_FACE_MANUAL_DEPTH_TEST + : DerivedCommandType.TRANSLUCENT_BACK_FACE; if (scene.mode === SceneMode.SCENE2D) { types[length++] = DerivedCommandType.DEPTH_ONLY_FRONT_FACE; @@ -412,7 +412,7 @@ function getTranslucentShaderProgram(vs, fs) { for (let i = 0; i < length; ++i) { sources[i] = ShaderSource.replaceMain( sources[i], - "czm_globe_translucency_main" + "czm_globe_translucency_main", ); } @@ -490,7 +490,7 @@ function getDerivedShaderProgram( derivedShaderProgram, shaderProgramDirty, getShaderProgramFunction, - cacheName + cacheName, ) { if (!defined(getShaderProgramFunction)) { return shaderProgram; @@ -502,7 +502,7 @@ function getDerivedShaderProgram( let shader = context.shaderCache.getDerivedShaderProgram( shaderProgram, - cacheName + cacheName, ); if (!defined(shader)) { const attributeLocations = shaderProgram._attributeLocations; @@ -520,7 +520,7 @@ function getDerivedShaderProgram( vertexShaderSource: vs, fragmentShaderSource: fs, attributeLocations: attributeLocations, - } + }, ); } @@ -600,7 +600,7 @@ function getDerivedRenderState( derivedRenderState, renderStateDirty, getRenderStateFunction, - cache + cache, ) { if (!defined(getRenderStateFunction)) { return renderState; @@ -634,7 +634,7 @@ function getDerivedUniformMap( uniformMap, derivedUniformMap, uniformMapDirty, - getDerivedUniformMapFunction + getDerivedUniformMapFunction, ) { if (!defined(getDerivedUniformMapFunction)) { return uniformMap; @@ -718,7 +718,8 @@ function createDerivedCommandPacks() { new DerivedCommandPack({ pass: Pass.TRANSLUCENT, pickOnly: false, - getShaderProgramFunction: getTranslucentFrontFaceManualDepthTestShaderProgram, + getShaderProgramFunction: + getTranslucentFrontFaceManualDepthTestShaderProgram, getRenderStateFunction: getTranslucentFrontFaceRenderState, getUniformMapFunction: getTranslucencyUniformMap, }), @@ -726,7 +727,8 @@ function createDerivedCommandPacks() { new DerivedCommandPack({ pass: Pass.TRANSLUCENT, pickOnly: false, - getShaderProgramFunction: getTranslucentBackFaceManualDepthTestShaderProgram, + getShaderProgramFunction: + getTranslucentBackFaceManualDepthTestShaderProgram, getRenderStateFunction: getTranslucentBackFaceRenderState, getUniformMapFunction: getTranslucencyUniformMap, }), @@ -754,7 +756,7 @@ const derivedCommandPacks = new Array(derivedCommandsMaximumLength); GlobeTranslucencyState.prototype.updateDerivedCommands = function ( command, - frameState + frameState, ) { const derivedCommandTypes = this._derivedCommandTypesToUpdate; const derivedCommandsLength = this._derivedCommandsToUpdateLength; @@ -775,7 +777,7 @@ GlobeTranslucencyState.prototype.updateDerivedCommands = function ( derivedCommandTypes, derivedCommandNames, derivedCommandPacks, - frameState + frameState, ); }; @@ -786,7 +788,7 @@ function updateDerivedCommands( derivedCommandTypes, derivedCommandNames, derivedCommandPacks, - frameState + frameState, ) { let derivedCommandsObject = command.derivedCommands.globeTranslucency; const derivedCommandsDirty = state._derivedCommandsDirty; @@ -807,15 +809,15 @@ function updateDerivedCommands( const uniformMapDirtyFrame = defaultValue( derivedCommandsObject.uniformMapDirtyFrame, - 0 + 0, ); const shaderProgramDirtyFrame = defaultValue( derivedCommandsObject.shaderProgramDirtyFrame, - 0 + 0, ); const renderStateDirtyFrame = defaultValue( derivedCommandsObject.renderStateDirtyFrame, - 0 + 0, ); const uniformMapDirty = @@ -866,15 +868,15 @@ function updateDerivedCommands( const derivedUniformMapDirtyFrame = defaultValue( derivedCommand.derivedCommands.uniformMapDirtyFrame, - 0 + 0, ); const derivedShaderProgramDirtyFrame = defaultValue( derivedCommand.derivedCommands.shaderProgramDirtyFrame, - 0 + 0, ); const derivedRenderStateDirtyFrame = defaultValue( derivedCommand.derivedCommands.renderStateDirtyFrame, - 0 + 0, ); const derivedUniformMapDirty = @@ -904,7 +906,7 @@ function updateDerivedCommands( command.uniformMap, derivedUniformMap, derivedUniformMapDirty, - derivedCommandPack.getUniformMapFunction + derivedCommandPack.getUniformMapFunction, ); derivedCommand.shaderProgram = getDerivedShaderProgram( frameState.context, @@ -912,14 +914,14 @@ function updateDerivedCommands( derivedShaderProgram, derivedShaderProgramDirty, derivedCommandPack.getShaderProgramFunction, - derivedCommandName + derivedCommandName, ); derivedCommand.renderState = getDerivedRenderState( command.renderState, derivedRenderState, derivedRenderStateDirty, derivedCommandPack.getRenderStateFunction, - derivedCommandPack.renderStateCache + derivedCommandPack.renderStateCache, ); } } @@ -928,7 +930,7 @@ function updateDerivedCommands( GlobeTranslucencyState.prototype.pushDerivedCommands = function ( command, isBlendCommand, - frameState + frameState, ) { const picking = frameState.passes.pick || frameState.passes.pickVoxel; if (picking && isBlendCommand) { @@ -968,7 +970,7 @@ function executeCommandsMatchingType( scene, context, passState, - types + types, ) { for (let i = 0; i < commandsLength; ++i) { const command = commands[i]; @@ -985,7 +987,7 @@ function executeCommands( executeCommandFunction, scene, context, - passState + passState, ) { for (let i = 0; i < commandsLength; ++i) { executeCommandFunction(commands[i], scene, context, passState); @@ -1007,7 +1009,7 @@ GlobeTranslucencyState.prototype.executeGlobeCommands = function ( executeCommandFunction, globeTranslucencyFramebuffer, scene, - passState + passState, ) { const context = scene.context; const globeCommands = frustumCommands.commands[Pass.GLOBE]; @@ -1028,7 +1030,7 @@ GlobeTranslucencyState.prototype.executeGlobeCommands = function ( scene, context, passState, - opaqueTypes + opaqueTypes, ); }; @@ -1037,7 +1039,7 @@ GlobeTranslucencyState.prototype.executeGlobeClassificationCommands = function ( executeCommandFunction, globeTranslucencyFramebuffer, scene, - passState + passState, ) { const context = scene.context; const globeCommands = frustumCommands.commands[Pass.GLOBE]; @@ -1062,7 +1064,7 @@ GlobeTranslucencyState.prototype.executeGlobeClassificationCommands = function ( executeCommandFunction, scene, context, - passState + passState, ); } @@ -1087,14 +1089,14 @@ GlobeTranslucencyState.prototype.executeGlobeClassificationCommands = function ( scene, context, passState, - depthOnlyTypes + depthOnlyTypes, ); if (context.depthTexture) { // Pack depth into separate texture for ground polylines and textured ground primitives const packedDepthTexture = globeTranslucencyFramebuffer.packDepth( context, - passState + passState, ); context.uniformState.globeDepthTexture = packedDepthTexture; } @@ -1106,7 +1108,7 @@ GlobeTranslucencyState.prototype.executeGlobeClassificationCommands = function ( executeCommandFunction, scene, context, - passState + passState, ); // Unset temporary state diff --git a/packages/engine/Source/Scene/GltfBufferViewLoader.js b/packages/engine/Source/Scene/GltfBufferViewLoader.js index 714d3166bae7..b53275b5e3c0 100644 --- a/packages/engine/Source/Scene/GltfBufferViewLoader.js +++ b/packages/engine/Source/Scene/GltfBufferViewLoader.js @@ -139,7 +139,7 @@ async function loadResources(loader) { const bufferViewTypedArray = new Uint8Array( bufferTypedArray.buffer, bufferTypedArray.byteOffset + loader._byteOffset, - loader._byteLength + loader._byteLength, ); // Unload the buffer @@ -156,7 +156,7 @@ async function loadResources(loader) { byteStride, loader._typedArray, loader._meshoptMode, - loader._meshoptFilter + loader._meshoptFilter, ); loader._typedArray = result; } diff --git a/packages/engine/Source/Scene/GltfIndexBufferLoader.js b/packages/engine/Source/Scene/GltfIndexBufferLoader.js index de52c8412095..5a46f8e43535 100644 --- a/packages/engine/Source/Scene/GltfIndexBufferLoader.js +++ b/packages/engine/Source/Scene/GltfIndexBufferLoader.js @@ -55,7 +55,7 @@ function GltfIndexBufferLoader(options) { Check.typeOf.object("options.baseResource", baseResource); if (!loadBuffer && !loadTypedArray) { throw new DeveloperError( - "At least one of loadBuffer and loadTypedArray must be true." + "At least one of loadBuffer and loadTypedArray must be true.", ); } //>>includeEnd('debug'); @@ -222,7 +222,7 @@ async function loadFromBufferView(indexBufferLoader) { const bufferViewTypedArray = bufferViewLoader.typedArray; indexBufferLoader._typedArray = createIndicesTypedArray( indexBufferLoader, - bufferViewTypedArray + bufferViewTypedArray, ); indexBufferLoader._state = ResourceLoaderState.PROCESSING; return indexBufferLoader; @@ -254,7 +254,7 @@ function createIndicesTypedArray(indexBufferLoader, bufferViewTypedArray) { byteOffset = 0; deprecationWarning( "index-buffer-unaligned", - `The index array is not aligned to a ${indexSize}-byte boundary.` + `The index array is not aligned to a ${indexSize}-byte boundary.`, ); } @@ -287,7 +287,7 @@ function CreateIndexBufferJob() { CreateIndexBufferJob.prototype.set = function ( typedArray, indexDatatype, - context + context, ) { this.typedArray = typedArray; this.indexDatatype = indexDatatype; @@ -298,7 +298,7 @@ CreateIndexBufferJob.prototype.execute = function () { this.buffer = createIndexBuffer( this.typedArray, this.indexDatatype, - this.context + this.context, ); }; diff --git a/packages/engine/Source/Scene/GltfJsonLoader.js b/packages/engine/Source/Scene/GltfJsonLoader.js index 97405b1dedaa..5f6b7dc3daac 100644 --- a/packages/engine/Source/Scene/GltfJsonLoader.js +++ b/packages/engine/Source/Scene/GltfJsonLoader.js @@ -187,7 +187,7 @@ async function upgradeVersion(gltfJsonLoader, gltf) { } buffer.extras._pipeline.source = bufferLoader.typedArray; - }) + }), ); } }); @@ -209,7 +209,7 @@ function decodeDataUris(gltf) { promises.push( Resource.fetchArrayBuffer(bufferUri).then(function (arrayBuffer) { buffer.extras._pipeline.source = new Uint8Array(arrayBuffer); - }) + }), ); } }); diff --git a/packages/engine/Source/Scene/GltfLoader.js b/packages/engine/Source/Scene/GltfLoader.js index 18f825a6ae4e..7fc4d01df1b6 100644 --- a/packages/engine/Source/Scene/GltfLoader.js +++ b/packages/engine/Source/Scene/GltfLoader.js @@ -665,7 +665,7 @@ function getVertexBufferLoader( draco, loadBuffer, loadTypedArray, - frameState + frameState, ) { const gltf = loader.gltfJson; const accessor = gltf.accessors[accessorId]; @@ -694,7 +694,7 @@ function getIndexBufferLoader( draco, loadBuffer, loadTypedArray, - frameState + frameState, ) { const indexBufferLoader = ResourceCache.getIndexBufferLoader({ gltf: loader.gltfJson, @@ -741,13 +741,13 @@ function getPackedTypedArray(gltf, accessor, bufferViewTypedArray) { componentType, bufferViewTypedArray.buffer, bufferViewTypedArray.byteOffset + byteOffset, - componentsLength + componentsLength, ); } const accessorTypedArray = ComponentDatatype.createTypedArray( componentType, - componentsLength + componentsLength, ); const dataView = new DataView(bufferViewTypedArray.buffer); @@ -761,7 +761,7 @@ function getPackedTypedArray(gltf, accessor, bufferViewTypedArray) { byteOffset, componentCount, componentByteLength, - components + components, ); for (let j = 0; j < componentCount; ++j) { accessorTypedArray[i * componentCount + j] = components[j]; @@ -796,9 +796,8 @@ function loadAccessorValues(accessor, typedArray, values, useQuaternion) { } } else { const MathType = AttributeType.getMathType(accessorType); - const numberOfComponents = AttributeType.getNumberOfComponents( - accessorType - ); + const numberOfComponents = + AttributeType.getNumberOfComponents(accessorType); for (let i = 0; i < accessorCount; i++) { values[i] = MathType.unpack(typedArray, i * numberOfComponents); @@ -813,7 +812,7 @@ async function loadAccessorBufferView( bufferViewLoader, accessor, useQuaternion, - values + values, ) { // Save a link to the gltfJson, which is removed after bufferViewLoader.load() const { gltfJson } = loader; @@ -826,7 +825,7 @@ async function loadAccessorBufferView( const typedArray = getPackedTypedArray( gltfJson, accessor, - bufferViewLoader.typedArray + bufferViewLoader.typedArray, ); useQuaternion = defaultValue(useQuaternion, false); @@ -844,7 +843,7 @@ function loadAccessor(loader, accessor, useQuaternion) { bufferViewLoader, accessor, useQuaternion, - values + values, ); loader._loaderPromises.push(promise); @@ -919,7 +918,7 @@ function dequantizeMinMax(attribute, VectorType) { function setQuantizationFromWeb3dQuantizedAttributes( extension, attribute, - MathType + MathType, ) { const decodeMatrix = extension.decodeMatrix; const decodedMin = fromArray(MathType, extension.decodedMin); @@ -940,35 +939,35 @@ function setQuantizationFromWeb3dQuantizedAttributes( } else if (decodeMatrix.length === 9) { quantization.quantizedVolumeOffset = new Cartesian2( decodeMatrix[6], - decodeMatrix[7] + decodeMatrix[7], ); quantization.quantizedVolumeStepSize = new Cartesian2( decodeMatrix[0], - decodeMatrix[4] + decodeMatrix[4], ); } else if (decodeMatrix.length === 16) { quantization.quantizedVolumeOffset = new Cartesian3( decodeMatrix[12], decodeMatrix[13], - decodeMatrix[14] + decodeMatrix[14], ); quantization.quantizedVolumeStepSize = new Cartesian3( decodeMatrix[0], decodeMatrix[5], - decodeMatrix[10] + decodeMatrix[10], ); } else if (decodeMatrix.length === 25) { quantization.quantizedVolumeOffset = new Cartesian4( decodeMatrix[20], decodeMatrix[21], decodeMatrix[22], - decodeMatrix[23] + decodeMatrix[23], ); quantization.quantizedVolumeStepSize = new Cartesian4( decodeMatrix[0], decodeMatrix[6], decodeMatrix[12], - decodeMatrix[18] + decodeMatrix[18], ); } @@ -998,7 +997,7 @@ function createAttribute(gltf, accessorId, name, semantic, setIndex) { setQuantizationFromWeb3dQuantizedAttributes( accessor.extensions.WEB3D_quantized_attributes, attribute, - MathType + MathType, ); } @@ -1012,7 +1011,7 @@ function createAttribute(gltf, accessorId, name, semantic, setIndex) { // However, for KHR_mesh_quantization, min and max must be dequantized for // normalized values, else the bounding sphere will be computed incorrectly. const hasKhrMeshQuantization = gltf.extensionsRequired?.includes( - "KHR_mesh_quantization" + "KHR_mesh_quantization", ); if (hasKhrMeshQuantization && normalized && isQuantizable) { @@ -1074,7 +1073,7 @@ function finalizeDracoAttribute( attribute, vertexBufferLoader, loadBuffer, - loadTypedArray + loadTypedArray, ) { // The accessor's byteOffset and byteStride should be ignored for draco. // Each attribute is tightly packed in its own buffer after decode. @@ -1093,7 +1092,7 @@ function finalizeDracoAttribute( attribute.typedArray = ComponentDatatype.createArrayBufferView( componentDatatype, - vertexBufferLoader.typedArray.buffer + vertexBufferLoader.typedArray.buffer, ); } } @@ -1104,7 +1103,7 @@ function finalizeAttribute( attribute, vertexBufferLoader, loadBuffer, - loadTypedArray + loadTypedArray, ) { if (loadBuffer) { attribute.buffer = vertexBufferLoader.buffer; @@ -1115,7 +1114,7 @@ function finalizeAttribute( attribute.typedArray = getPackedTypedArray( gltf, accessor, - bufferViewTypedArray + bufferViewTypedArray, ); if (!loadBuffer) { @@ -1135,7 +1134,7 @@ function loadAttribute( draco, loadBuffer, loadTypedArray, - frameState + frameState, ) { const gltf = loader.gltfJson; const accessor = gltf.accessors[accessorId]; @@ -1155,7 +1154,7 @@ function loadAttribute( accessorId, name, modelSemantic, - setIndex + setIndex, ); if (!defined(draco) && !defined(bufferViewId)) { @@ -1169,7 +1168,7 @@ function loadAttribute( draco, loadBuffer, loadTypedArray, - frameState + frameState, ); const index = loader._geometryLoaders.length; @@ -1189,7 +1188,7 @@ function loadAttribute( attribute, vertexBufferLoader, loadBuffer, - loadTypedArray + loadTypedArray, ); } else { finalizeAttribute( @@ -1198,7 +1197,7 @@ function loadAttribute( attribute, vertexBufferLoader, loadBuffer, - loadTypedArray + loadTypedArray, ); } }; @@ -1213,7 +1212,7 @@ function loadVertexAttribute( draco, hasInstances, needsPostProcessing, - frameState + frameState, ) { const modelSemantic = semanticInfo.modelSemantic; @@ -1259,7 +1258,7 @@ function loadVertexAttribute( draco, loadBuffer, loadTypedArray, - frameState + frameState, ); const attributePlan = new PrimitiveLoadPlan.AttributeLoadPlan(attribute); @@ -1274,7 +1273,7 @@ function loadInstancedAttribute( accessorId, attributes, gltfSemantic, - frameState + frameState, ) { const accessors = loader.gltfJson.accessors; const hasRotation = defined(attributes.ROTATION); @@ -1286,7 +1285,7 @@ function loadInstancedAttribute( const semanticInfo = getSemanticInfo( loader, InstanceAttributeSemantic, - gltfSemantic + gltfSemantic, ); const modelSemantic = semanticInfo.modelSemantic; @@ -1331,7 +1330,7 @@ function loadInstancedAttribute( undefined, loadBuffer, loadTypedArray, - frameState + frameState, ); } @@ -1341,7 +1340,7 @@ function loadIndices( draco, hasFeatureIds, needsPostProcessing, - frameState + frameState, ) { const accessor = loader.gltfJson.accessors[accessorId]; const bufferViewId = accessor.bufferView; @@ -1384,7 +1383,7 @@ function loadIndices( draco, loadBuffer, loadTypedArray, - frameState + frameState, ); const index = loader._geometryLoaders.length; @@ -1486,14 +1485,14 @@ function loadSpecularGlossiness(loader, specularGlossinessInfo, frameState) { specularGlossiness.diffuseTexture = loadTexture( loader, diffuseTexture, - frameState + frameState, ); } if (defined(specularGlossinessTexture)) { specularGlossiness.specularGlossinessTexture = loadTexture( loader, specularGlossinessTexture, - frameState + frameState, ); } specularGlossiness.diffuseFactor = fromArray(Cartesian4, diffuseFactor); @@ -1525,14 +1524,14 @@ function loadMetallicRoughness(loader, metallicRoughnessInfo, frameState) { metallicRoughness.baseColorTexture = loadTexture( loader, baseColorTexture, - frameState + frameState, ); } if (defined(metallicRoughnessTexture)) { metallicRoughness.metallicRoughnessTexture = loadTexture( loader, metallicRoughnessTexture, - frameState + frameState, ); } metallicRoughness.baseColorFactor = fromArray(Cartesian4, baseColorFactor); @@ -1558,7 +1557,7 @@ function loadSpecular(loader, specularInfo, frameState) { specular.specularColorTexture = loadTexture( loader, specularColorTexture, - frameState + frameState, ); } specular.specularFactor = specularFactor; @@ -1579,7 +1578,7 @@ function loadAnisotropy(loader, anisotropyInfo, frameState) { anisotropy.anisotropyTexture = loadTexture( loader, anisotropyTexture, - frameState + frameState, ); } anisotropy.anisotropyStrength = anisotropyStrength; @@ -1602,21 +1601,21 @@ function loadClearcoat(loader, clearcoatInfo, frameState) { clearcoat.clearcoatTexture = loadTexture( loader, clearcoatTexture, - frameState + frameState, ); } if (defined(clearcoatRoughnessTexture)) { clearcoat.clearcoatRoughnessTexture = loadTexture( loader, clearcoatRoughnessTexture, - frameState + frameState, ); } if (defined(clearcoatNormalTexture)) { clearcoat.clearcoatNormalTexture = loadTexture( loader, clearcoatNormalTexture, - frameState + frameState, ); } clearcoat.clearcoatFactor = clearcoatFactor; @@ -1639,7 +1638,7 @@ function loadMaterial(loader, gltfMaterial, frameState) { const extensions = defaultValue( gltfMaterial.extensions, - defaultValue.EMPTY_OBJECT + defaultValue.EMPTY_OBJECT, ); const pbrSpecularGlossiness = extensions.KHR_materials_pbrSpecularGlossiness; const pbrSpecular = extensions.KHR_materials_specular; @@ -1653,14 +1652,14 @@ function loadMaterial(loader, gltfMaterial, frameState) { material.specularGlossiness = loadSpecularGlossiness( loader, pbrSpecularGlossiness, - frameState + frameState, ); } else { if (defined(pbrMetallicRoughness)) { material.metallicRoughness = loadMetallicRoughness( loader, pbrMetallicRoughness, - frameState + frameState, ); } if (defined(pbrSpecular) && !material.unlit) { @@ -1679,7 +1678,7 @@ function loadMaterial(loader, gltfMaterial, frameState) { material.emissiveTexture = loadTexture( loader, gltfMaterial.emissiveTexture, - frameState + frameState, ); } // Normals aren't used for classification, so don't load the normal texture. @@ -1687,14 +1686,14 @@ function loadMaterial(loader, gltfMaterial, frameState) { material.normalTexture = loadTexture( loader, gltfMaterial.normalTexture, - frameState + frameState, ); } if (defined(gltfMaterial.occlusionTexture)) { material.occlusionTexture = loadTexture( loader, gltfMaterial.occlusionTexture, - frameState + frameState, ); } material.emissiveFactor = fromArray(Cartesian3, gltfMaterial.emissiveFactor); @@ -1722,7 +1721,7 @@ function loadFeatureIdAttributeLegacy( gltfFeatureIdAttribute, featureTableId, featureCount, - positionalLabel + positionalLabel, ) { const featureIdAttribute = new FeatureIdAttribute(); const featureIds = gltfFeatureIdAttribute.featureIds; @@ -1753,7 +1752,7 @@ function loadFeatureIdImplicitRangeLegacy( gltfFeatureIdAttribute, featureTableId, featureCount, - positionalLabel + positionalLabel, ) { const featureIdRange = new FeatureIdImplicitRange(); const featureIds = gltfFeatureIdAttribute.featureIds; @@ -1775,7 +1774,7 @@ function loadFeatureIdTexture( loader, gltfFeatureIdTexture, frameState, - positionalLabel + positionalLabel, ) { const featureIdTexture = new FeatureIdTexture(); @@ -1790,7 +1789,7 @@ function loadFeatureIdTexture( loader, textureInfo, frameState, - Sampler.NEAREST // Feature ID textures require nearest sampling + Sampler.NEAREST, // Feature ID textures require nearest sampling ); // Though the new channel index is more future-proof, this implementation @@ -1814,7 +1813,7 @@ function loadFeatureIdTextureLegacy( featureTableId, frameState, featureCount, - positionalLabel + positionalLabel, ) { const featureIdTexture = new FeatureIdTexture(); const featureIds = gltfFeatureIdTexture.featureIds; @@ -1825,7 +1824,7 @@ function loadFeatureIdTextureLegacy( loader, textureInfo, frameState, - Sampler.NEAREST // Feature ID textures require nearest sampling + Sampler.NEAREST, // Feature ID textures require nearest sampling ); featureIdTexture.textureReader.channels = featureIds.channels; @@ -1839,7 +1838,7 @@ function loadMorphTarget( target, needsPostProcessing, primitiveLoadPlan, - frameState + frameState, ) { const morphTarget = new MorphTarget(); @@ -1856,7 +1855,7 @@ function loadMorphTarget( const semanticInfo = getSemanticInfo( loader, VertexAttributeSemantic, - semantic + semantic, ); const attributePlan = loadVertexAttribute( @@ -1866,7 +1865,7 @@ function loadMorphTarget( draco, hasInstances, needsPostProcessing, - frameState + frameState, ); morphTarget.attributes.push(attributePlan.attribute); @@ -1897,13 +1896,13 @@ function loadPrimitive(loader, gltfPrimitive, hasInstances, frameState) { primitive.material = loadMaterial( loader, loader.gltfJson.materials[materialId], - frameState + frameState, ); } const extensions = defaultValue( gltfPrimitive.extensions, - defaultValue.EMPTY_OBJECT + defaultValue.EMPTY_OBJECT, ); let needsPostProcessing = false; @@ -1914,7 +1913,7 @@ function loadPrimitive(loader, gltfPrimitive, hasInstances, frameState) { primitivePlan.outlineIndices = loadPrimitiveOutline( loader, outlineExtension, - primitivePlan + primitivePlan, ); } @@ -1932,7 +1931,7 @@ function loadPrimitive(loader, gltfPrimitive, hasInstances, frameState) { const semanticInfo = getSemanticInfo( loader, VertexAttributeSemantic, - semantic + semantic, ); const modelSemantic = semanticInfo.modelSemantic; @@ -1951,7 +1950,7 @@ function loadPrimitive(loader, gltfPrimitive, hasInstances, frameState) { draco, hasInstances, needsPostProcessing, - frameState + frameState, ); primitivePlan.attributePlans.push(attributePlan); @@ -1969,8 +1968,8 @@ function loadPrimitive(loader, gltfPrimitive, hasInstances, frameState) { targets[i], needsPostProcessing, primitivePlan, - frameState - ) + frameState, + ), ); } } @@ -1983,7 +1982,7 @@ function loadPrimitive(loader, gltfPrimitive, hasInstances, frameState) { draco, hasFeatureIds, needsPostProcessing, - frameState + frameState, ); if (defined(indicesPlan)) { @@ -2009,7 +2008,7 @@ function loadPrimitive(loader, gltfPrimitive, hasInstances, frameState) { loader, primitive, featureMetadataLegacy, - frameState + frameState, ); } @@ -2023,7 +2022,7 @@ function loadPrimitive(loader, gltfPrimitive, hasInstances, frameState) { const primitiveType = gltfPrimitive.mode; if (loadForClassification && primitiveType !== PrimitiveType.TRIANGLES) { throw new RuntimeError( - "Only triangle meshes can be used for classification." + "Only triangle meshes can be used for classification.", ); } primitive.primitiveType = primitiveType; @@ -2043,7 +2042,7 @@ function loadPrimitiveFeatures( loader, primitive, meshFeaturesExtension, - frameState + frameState, ) { let featureIdsArray; if ( @@ -2065,7 +2064,7 @@ function loadPrimitiveFeatures( loader, featureIds, frameState, - label + label, ); } else if (defined(featureIds.attribute)) { featureIdComponent = loadFeatureIdAttribute(featureIds, label); @@ -2084,7 +2083,7 @@ function loadPrimitiveFeaturesLegacy( loader, primitive, metadataExtension, - frameState + frameState, ) { // For looking up the featureCount for each set of feature IDs const { featureTables } = loader.gltfJson.extensions.EXT_feature_metadata; @@ -2097,9 +2096,8 @@ function loadPrimitiveFeaturesLegacy( for (let i = 0; i < featureIdAttributes.length; ++i) { const featureIdAttribute = featureIdAttributes[i]; const featureTableId = featureIdAttribute.featureTable; - const propertyTableId = loader._sortedPropertyTableIds.indexOf( - featureTableId - ); + const propertyTableId = + loader._sortedPropertyTableIds.indexOf(featureTableId); const featureCount = featureTables[featureTableId].count; const label = `featureId_${nextFeatureIdIndex}`; nextFeatureIdIndex++; @@ -2110,14 +2108,14 @@ function loadPrimitiveFeaturesLegacy( featureIdAttribute, propertyTableId, featureCount, - label + label, ); } else { featureIdComponent = loadFeatureIdImplicitRangeLegacy( featureIdAttribute, propertyTableId, featureCount, - label + label, ); } primitive.featureIds.push(featureIdComponent); @@ -2130,9 +2128,8 @@ function loadPrimitiveFeaturesLegacy( for (let i = 0; i < featureIdTextures.length; ++i) { const featureIdTexture = featureIdTextures[i]; const featureTableId = featureIdTexture.featureTable; - const propertyTableId = loader._sortedPropertyTableIds.indexOf( - featureTableId - ); + const propertyTableId = + loader._sortedPropertyTableIds.indexOf(featureTableId); const featureCount = featureTables[featureTableId].count; const featureIdLabel = `featureId_${nextFeatureIdIndex}`; nextFeatureIdIndex++; @@ -2143,7 +2140,7 @@ function loadPrimitiveFeaturesLegacy( propertyTableId, frameState, featureCount, - featureIdLabel + featureIdLabel, ); // Feature ID textures are added after feature ID attributes in the list primitive.featureIds.push(featureIdComponent); @@ -2179,7 +2176,7 @@ function loadPrimitiveMetadataLegacy(loader, primitive, metadataExtension) { primitive.propertyTextureIds = metadataExtension.featureTextures.map( function (id) { return loader._sortedFeatureTextureIds.indexOf(id); - } + }, ); } } @@ -2201,15 +2198,15 @@ function loadInstances(loader, nodeExtensions, frameState) { accessorId, attributes, semantic, - frameState - ) + frameState, + ), ); } } const instancingExtExtensions = defaultValue( instancingExtension.extensions, - defaultValue.EMPTY_OBJECT + defaultValue.EMPTY_OBJECT, ); const instanceFeatures = nodeExtensions.EXT_instance_features; const featureMetadataLegacy = instancingExtExtensions.EXT_feature_metadata; @@ -2221,7 +2218,7 @@ function loadInstances(loader, nodeExtensions, frameState) { loader.gltfJson, instances, featureMetadataLegacy, - loader._sortedPropertyTableIds + loader._sortedPropertyTableIds, ); } @@ -2255,7 +2252,7 @@ function loadInstanceFeaturesLegacy( gltf, instances, metadataExtension, - sortedPropertyTableIds + sortedPropertyTableIds, ) { // For looking up the featureCount for each set of feature IDs const featureTables = gltf.extensions.EXT_feature_metadata.featureTables; @@ -2275,14 +2272,14 @@ function loadInstanceFeaturesLegacy( featureIdAttribute, propertyTableId, featureCount, - label + label, ); } else { featureIdComponent = loadFeatureIdImplicitRangeLegacy( featureIdAttribute, propertyTableId, featureCount, - label + label, ); } instances.featureIds.push(featureIdComponent); @@ -2310,7 +2307,7 @@ function loadNode(loader, gltfNode, frameState) { const nodeExtensions = defaultValue( gltfNode.extensions, - defaultValue.EMPTY_OBJECT + defaultValue.EMPTY_OBJECT, ); const instancingExtension = nodeExtensions.EXT_mesh_gpu_instancing; const articulationsExtension = nodeExtensions.AGI_articulations; @@ -2318,7 +2315,7 @@ function loadNode(loader, gltfNode, frameState) { if (defined(instancingExtension)) { if (loader._loadForClassification) { throw new RuntimeError( - "Models with the EXT_mesh_gpu_instancing extension cannot be used for classification." + "Models with the EXT_mesh_gpu_instancing extension cannot be used for classification.", ); } node.instances = loadInstances(loader, nodeExtensions, frameState); @@ -2338,8 +2335,8 @@ function loadNode(loader, gltfNode, frameState) { loader, primitives[i], defined(node.instances), - frameState - ) + frameState, + ), ); } @@ -2401,7 +2398,7 @@ function loadSkin(loader, gltfSkin, nodes) { skin.inverseBindMatrices = loadAccessor(loader, accessor); } else { skin.inverseBindMatrices = new Array(jointIds.length).fill( - Matrix4.IDENTITY + Matrix4.IDENTITY, ); } @@ -2437,7 +2434,7 @@ async function loadStructuralMetadata( loader, extension, extensionLegacy, - frameState + frameState, ) { const structuralMetadataLoader = new GltfStructuralMetadataLoader({ gltf: loader.gltfJson, @@ -2463,7 +2460,7 @@ function loadAnimationSampler(loader, gltfSampler) { const gltfInterpolation = gltfSampler.interpolation; animationSampler.interpolation = defaultValue( InterpolationType[gltfInterpolation], - InterpolationType.LINEAR + InterpolationType.LINEAR, ); const outputAccessor = accessors[gltfSampler.output]; @@ -2657,11 +2654,11 @@ function parse(loader, frameState) { const center = Cartesian3.fromArray( cesiumRtcExtension.center, 0, - scratchCenter + scratchCenter, ); components.transform = Matrix4.fromTranslation( center, - components.transform + components.transform, ); } @@ -2676,7 +2673,7 @@ function parse(loader, frameState) { loader, structuralMetadataExtension, featureMetadataExtensionLegacy, - frameState + frameState, ); loader._loaderPromises.push(promise); } diff --git a/packages/engine/Source/Scene/GltfStructuralMetadataLoader.js b/packages/engine/Source/Scene/GltfStructuralMetadataLoader.js index b8b2d0b0b45b..964b000760be 100644 --- a/packages/engine/Source/Scene/GltfStructuralMetadataLoader.js +++ b/packages/engine/Source/Scene/GltfStructuralMetadataLoader.js @@ -55,7 +55,7 @@ function GltfStructuralMetadataLoader(options) { if (!defined(options.extension) && !defined(options.extensionLegacy)) { throw new DeveloperError( - "One of options.extension or options.extensionLegacy must be specified" + "One of options.extension or options.extensionLegacy must be specified", ); } //>>includeEnd('debug'); @@ -81,9 +81,10 @@ function GltfStructuralMetadataLoader(options) { if (defined(Object.create)) { GltfStructuralMetadataLoader.prototype = Object.create( - ResourceLoader.prototype + ResourceLoader.prototype, ); - GltfStructuralMetadataLoader.prototype.constructor = GltfStructuralMetadataLoader; + GltfStructuralMetadataLoader.prototype.constructor = + GltfStructuralMetadataLoader; } Object.defineProperties(GltfStructuralMetadataLoader.prototype, { @@ -212,7 +213,7 @@ function gatherUsedBufferViewIds(extension) { const propertyTable = propertyTables[i]; gatherBufferViewIdsFromProperties( propertyTable.properties, - bufferViewIdSet + bufferViewIdSet, ); } } @@ -241,11 +242,11 @@ async function loadBufferViews(structuralMetadataLoader) { let bufferViewIds; if (defined(structuralMetadataLoader._extension)) { bufferViewIds = gatherUsedBufferViewIds( - structuralMetadataLoader._extension + structuralMetadataLoader._extension, ); } else { bufferViewIds = gatherUsedBufferViewIdsLegacy( - structuralMetadataLoader._extensionLegacy + structuralMetadataLoader._extensionLegacy, ); } @@ -331,7 +332,7 @@ function loadTextures(structuralMetadataLoader) { textureIds = gatherUsedTextureIds(structuralMetadataLoader._extension); } else { textureIds = gatherUsedTextureIdsLegacy( - structuralMetadataLoader._extensionLegacy + structuralMetadataLoader._extensionLegacy, ); } @@ -367,7 +368,7 @@ function loadTextures(structuralMetadataLoader) { async function loadSchema(structuralMetadataLoader) { const extension = defaultValue( structuralMetadataLoader._extension, - structuralMetadataLoader._extensionLegacy + structuralMetadataLoader._extensionLegacy, ); let schemaLoader; diff --git a/packages/engine/Source/Scene/GltfTextureLoader.js b/packages/engine/Source/Scene/GltfTextureLoader.js index ce02ace44958..4c07eef67629 100644 --- a/packages/engine/Source/Scene/GltfTextureLoader.js +++ b/packages/engine/Source/Scene/GltfTextureLoader.js @@ -180,7 +180,7 @@ CreateTextureJob.prototype.set = function ( textureInfo, image, mipLevels, - context + context, ) { this.gltf = gltf; this.textureInfo = textureInfo; @@ -195,7 +195,7 @@ CreateTextureJob.prototype.execute = function () { this.textureInfo, this.image, this.mipLevels, - this.context + this.context, ); }; @@ -256,7 +256,7 @@ function createTexture(gltf, textureInfo, image, mipLevels, context) { requiresPowerOfTwo ) { console.warn( - "Compressed texture uses REPEAT or MIRRORED_REPEAT texture wrap mode and dimensions are not powers of two. The texture may be rendered incorrectly." + "Compressed texture uses REPEAT or MIRRORED_REPEAT texture wrap mode and dimensions are not powers of two. The texture may be rendered incorrectly.", ); } @@ -334,7 +334,7 @@ GltfTextureLoader.prototype.process = function (frameState) { this._textureInfo, this._image, this._mipLevels, - frameState.context + frameState.context, ); const jobScheduler = frameState.jobScheduler; if (!jobScheduler.execute(textureJob, JobType.TEXTURE)) { @@ -348,7 +348,7 @@ GltfTextureLoader.prototype.process = function (frameState) { this._textureInfo, this._image, this._mipLevels, - frameState.context + frameState.context, ); } diff --git a/packages/engine/Source/Scene/GltfVertexBufferLoader.js b/packages/engine/Source/Scene/GltfVertexBufferLoader.js index 52cc5e5dc4a8..52f77e4505e1 100644 --- a/packages/engine/Source/Scene/GltfVertexBufferLoader.js +++ b/packages/engine/Source/Scene/GltfVertexBufferLoader.js @@ -62,7 +62,7 @@ function GltfVertexBufferLoader(options) { Check.typeOf.object("options.baseResource", baseResource); if (!loadBuffer && !loadTypedArray) { throw new DeveloperError( - "At least one of loadBuffer and loadTypedArray must be true." + "At least one of loadBuffer and loadTypedArray must be true.", ); } @@ -73,19 +73,19 @@ function GltfVertexBufferLoader(options) { if (hasBufferViewId === hasDraco) { throw new DeveloperError( - "One of options.bufferViewId and options.draco must be defined." + "One of options.bufferViewId and options.draco must be defined.", ); } if (hasDraco && !hasAttributeSemantic) { throw new DeveloperError( - "When options.draco is defined options.attributeSemantic must also be defined." + "When options.draco is defined options.attributeSemantic must also be defined.", ); } if (hasDraco && !hasAccessorId) { throw new DeveloperError( - "When options.draco is defined options.accessorId must also be defined." + "When options.draco is defined options.accessorId must also be defined.", ); } @@ -212,7 +212,7 @@ function getQuantizationInformation( dracoQuantization, componentDatatype, componentCount, - type + type, ) { const quantizationBits = dracoQuantization.quantizationBits; const normalizationRange = (1 << quantizationBits) - 1; @@ -237,17 +237,16 @@ function getQuantizationInformation( quantization.quantizedVolumeStepSize = dimensions * normalizationDivisor; } else { quantization.quantizedVolumeOffset = MathType.unpack( - dracoQuantization.minValues + dracoQuantization.minValues, ); quantization.normalizationRange = MathType.unpack( - new Array(componentCount).fill(normalizationRange) + new Array(componentCount).fill(normalizationRange), ); const packedDimensions = new Array(componentCount).fill( - dracoQuantization.range - ); - quantization.quantizedVolumeDimensions = MathType.unpack( - packedDimensions + dracoQuantization.range, ); + quantization.quantizedVolumeDimensions = + MathType.unpack(packedDimensions); // Computing the step size const packedSteps = packedDimensions.map(function (dimension) { @@ -307,14 +306,14 @@ function processDraco(vertexBufferLoader) { dracoQuantization, dracoAttribute.data.componentDatatype, dracoAttribute.data.componentsPerAttribute, - type + type, ); } vertexBufferLoader._typedArray = new Uint8Array( typedArray.buffer, typedArray.byteOffset, - typedArray.byteLength + typedArray.byteLength, ); } diff --git a/packages/engine/Source/Scene/GoogleEarthEnterpriseImageryProvider.js b/packages/engine/Source/Scene/GoogleEarthEnterpriseImageryProvider.js index 0d591ed2f649..60ee4a4d69f5 100644 --- a/packages/engine/Source/Scene/GoogleEarthEnterpriseImageryProvider.js +++ b/packages/engine/Source/Scene/GoogleEarthEnterpriseImageryProvider.js @@ -35,7 +35,7 @@ GoogleEarthEnterpriseDiscardPolicy.prototype.isReady = function () { * @returns {boolean} True if the image should be discarded; otherwise, false. */ GoogleEarthEnterpriseDiscardPolicy.prototype.shouldDiscardImage = function ( - image + image, ) { return image === this._image; }; @@ -107,7 +107,7 @@ function GoogleEarthEnterpriseImageryProvider(options) { -CesiumMath.PI, -CesiumMath.PI, CesiumMath.PI, - CesiumMath.PI + CesiumMath.PI, ), ellipsoid: options.ellipsoid, }); @@ -299,7 +299,7 @@ Object.defineProperties(GoogleEarthEnterpriseImageryProvider.prototype, { */ GoogleEarthEnterpriseImageryProvider.fromMetadata = function ( metadata, - options + options, ) { //>>includeStart('debug', pragmas.debug); Check.defined("metadata", metadata); @@ -325,7 +325,7 @@ GoogleEarthEnterpriseImageryProvider.fromMetadata = function ( GoogleEarthEnterpriseImageryProvider.prototype.getTileCredits = function ( x, y, - level + level, ) { const metadata = this._metadata; const info = metadata.getTileInformation(x, y, level); @@ -353,7 +353,7 @@ GoogleEarthEnterpriseImageryProvider.prototype.requestImage = function ( x, y, level, - request + request, ) { const invalidImage = this._tileDiscardPolicy._image; // Empty image or undefined depending on discard policy const metadata = this._metadata; @@ -383,7 +383,7 @@ GoogleEarthEnterpriseImageryProvider.prototype.requestImage = function ( x, y, level, - request + request, ).fetchArrayBuffer(); if (!defined(promise)) { return undefined; // Throttled @@ -433,7 +433,7 @@ GoogleEarthEnterpriseImageryProvider.prototype.pickFeatures = function ( y, level, longitude, - latitude + latitude, ) { return undefined; }; @@ -529,7 +529,7 @@ function decodeEarthImageryPacket(data) { break; default: throw new RuntimeError( - "GoogleEarthEnterpriseImageryProvider: Unsupported image type." + "GoogleEarthEnterpriseImageryProvider: Unsupported image type.", ); } } @@ -537,7 +537,7 @@ function decodeEarthImageryPacket(data) { const alphaType = message.alphaType; if (defined(alphaType) && alphaType !== 0) { console.log( - "GoogleEarthEnterpriseImageryProvider: External alpha not supported." + "GoogleEarthEnterpriseImageryProvider: External alpha not supported.", ); delete message.alphaType; delete message.imageAlpha; diff --git a/packages/engine/Source/Scene/GoogleEarthEnterpriseMapsProvider.js b/packages/engine/Source/Scene/GoogleEarthEnterpriseMapsProvider.js index 427b851014c6..c5d078f72421 100644 --- a/packages/engine/Source/Scene/GoogleEarthEnterpriseMapsProvider.js +++ b/packages/engine/Source/Scene/GoogleEarthEnterpriseMapsProvider.js @@ -82,7 +82,7 @@ function metadataSuccess(text, imageryProviderBuilder) { } catch (e) { // Quote object strings manually, then try parsing again data = JSON.parse( - text.replace(/([\[\{,])[\n\r ]*([A-Za-z0-9]+)[\n\r ]*:/g, '$1"$2":') + text.replace(/([\[\{,])[\n\r ]*([A-Za-z0-9]+)[\n\r ]*:/g, '$1"$2":'), ); } @@ -138,7 +138,7 @@ function metadataFailure(error, metadataResource, provider) { undefined, provider, defined(provider) ? provider._errorEvent : undefined, - message + message, ); throw new RuntimeError(message); @@ -147,7 +147,7 @@ function metadataFailure(error, metadataResource, provider) { async function requestMetadata( metadataResource, imageryProviderBuilder, - provider + provider, ) { try { const text = await metadataResource.fetchText(); @@ -218,7 +218,7 @@ function GoogleEarthEnterpriseMapsProvider(options) { this._channel = options.channel; this._requestType = "ImageryMaps"; this._credit = new Credit( - `<a href="http://www.google.com/enterprise/mapsearth/products/earthenterprise.html"><img src="${GoogleEarthEnterpriseMapsProvider.logoUrl}" title="Google Imagery"/></a>` + `<a href="http://www.google.com/enterprise/mapsearth/products/earthenterprise.html"><img src="${GoogleEarthEnterpriseMapsProvider.logoUrl}" title="Google Imagery"/></a>`, ); this._tilingScheme = undefined; @@ -451,7 +451,7 @@ Object.defineProperties(GoogleEarthEnterpriseMapsProvider.prototype, { GoogleEarthEnterpriseMapsProvider.fromUrl = async function ( url, channel, - options + options, ) { //>>includeStart('debug', pragmas.debug); Check.defined("url", url); @@ -503,7 +503,7 @@ GoogleEarthEnterpriseMapsProvider.fromUrl = async function ( GoogleEarthEnterpriseMapsProvider.prototype.getTileCredits = function ( x, y, - level + level, ) { return undefined; }; @@ -522,7 +522,7 @@ GoogleEarthEnterpriseMapsProvider.prototype.requestImage = function ( x, y, level, - request + request, ) { const resource = this._resource.getDerivedResource({ url: "query", @@ -556,7 +556,7 @@ GoogleEarthEnterpriseMapsProvider.prototype.pickFeatures = function ( y, level, longitude, - latitude + latitude, ) { return undefined; }; @@ -573,7 +573,7 @@ Object.defineProperties(GoogleEarthEnterpriseMapsProvider, { get: function () { if (!defined(GoogleEarthEnterpriseMapsProvider._logoUrl)) { GoogleEarthEnterpriseMapsProvider._logoUrl = buildModuleUrl( - "Assets/Images/google_earth_credit.png" + "Assets/Images/google_earth_credit.png", ); } return GoogleEarthEnterpriseMapsProvider._logoUrl; diff --git a/packages/engine/Source/Scene/GridImageryProvider.js b/packages/engine/Source/Scene/GridImageryProvider.js index f079d4681aae..e3f6fd4497b0 100644 --- a/packages/engine/Source/Scene/GridImageryProvider.js +++ b/packages/engine/Source/Scene/GridImageryProvider.js @@ -59,7 +59,7 @@ function GridImageryProvider(options) { this._glowWidth = defaultValue(options.glowWidth, 6); this._backgroundColor = defaultValue( options.backgroundColor, - defaultBackgroundColor + defaultBackgroundColor, ); this._errorEvent = new Event(); @@ -318,7 +318,7 @@ GridImageryProvider.prototype.pickFeatures = function ( y, level, longitude, - latitude + latitude, ) { return undefined; }; diff --git a/packages/engine/Source/Scene/GroundPolylinePrimitive.js b/packages/engine/Source/Scene/GroundPolylinePrimitive.js index 2c1515751ac4..c82b9e1dd263 100644 --- a/packages/engine/Source/Scene/GroundPolylinePrimitive.js +++ b/packages/engine/Source/Scene/GroundPolylinePrimitive.js @@ -147,7 +147,7 @@ function GroundPolylinePrimitive(options) { */ this.classificationType = defaultValue( options.classificationType, - ClassificationType.BOTH + ClassificationType.BOTH, ); /** @@ -162,13 +162,13 @@ function GroundPolylinePrimitive(options) { */ this.debugShowBoundingVolume = defaultValue( options.debugShowBoundingVolume, - false + false, ); // Shadow volume is shown by removing a discard in the shader, so this isn't toggleable. this._debugShowShadowVolume = defaultValue( options.debugShowShadowVolume, - false + false, ); this._primitiveOptions = { @@ -178,7 +178,7 @@ function GroundPolylinePrimitive(options) { interleave: defaultValue(options.interleave, false), releaseGeometryInstances: defaultValue( options.releaseGeometryInstances, - true + true, ), allowPicking: defaultValue(options.allowPicking, true), asynchronous: defaultValue(options.asynchronous, true), @@ -331,39 +331,39 @@ function createShaderProgram(groundPolylinePrimitive, frameState, appearance) { const attributeLocations = primitive._attributeLocations; let vs = primitive._batchTable.getVertexShaderCallback()( - PolylineShadowVolumeVS + PolylineShadowVolumeVS, ); vs = Primitive._appendShowToShader(primitive, vs); vs = Primitive._appendDistanceDisplayConditionToShader(primitive, vs); vs = Primitive._modifyShaderPosition( groundPolylinePrimitive, vs, - frameState.scene3DOnly + frameState.scene3DOnly, ); let vsMorph = primitive._batchTable.getVertexShaderCallback()( - PolylineShadowVolumeMorphVS + PolylineShadowVolumeMorphVS, ); vsMorph = Primitive._appendShowToShader(primitive, vsMorph); vsMorph = Primitive._appendDistanceDisplayConditionToShader( primitive, - vsMorph + vsMorph, ); vsMorph = Primitive._modifyShaderPosition( groundPolylinePrimitive, vsMorph, - frameState.scene3DOnly + frameState.scene3DOnly, ); // Access pick color from fragment shader. // Helps with varying budget. let fs = primitive._batchTable.getVertexShaderCallback()( - PolylineShadowVolumeFS + PolylineShadowVolumeFS, ); const vsDefines = [ `GLOBE_MINIMUM_ALTITUDE ${frameState.mapProjection.ellipsoid.minimumRadius.toFixed( - 1 + 1, )}`, ]; let colorDefine = ""; @@ -409,7 +409,7 @@ function createShaderProgram(groundPolylinePrimitive, frameState, appearance) { // Derive 2D/CV let colorProgram2D = context.shaderCache.getDerivedShaderProgram( groundPolylinePrimitive._sp, - "2dColor" + "2dColor", ); if (!defined(colorProgram2D)) { const vsColor2D = new ShaderSource({ @@ -425,7 +425,7 @@ function createShaderProgram(groundPolylinePrimitive, frameState, appearance) { vertexShaderSource: vsColor2D, fragmentShaderSource: fsColor3D, attributeLocations: attributeLocations, - } + }, ); } groundPolylinePrimitive._sp2D = colorProgram2D; @@ -433,20 +433,20 @@ function createShaderProgram(groundPolylinePrimitive, frameState, appearance) { // Derive Morph let colorProgramMorph = context.shaderCache.getDerivedShaderProgram( groundPolylinePrimitive._sp, - "MorphColor" + "MorphColor", ); if (!defined(colorProgramMorph)) { const vsColorMorph = new ShaderSource({ defines: vsDefines.concat([ `MAX_TERRAIN_HEIGHT ${ApproximateTerrainHeights._defaultMaxTerrainHeight.toFixed( - 1 + 1, )}`, ]), sources: [vsMorph], }); fs = primitive._batchTable.getVertexShaderCallback()( - PolylineShadowVolumeMorphFS + PolylineShadowVolumeMorphFS, ); const fsColorMorph = new ShaderSource({ defines: fsDefines, @@ -461,7 +461,7 @@ function createShaderProgram(groundPolylinePrimitive, frameState, appearance) { vertexShaderSource: vsColorMorph, fragmentShaderSource: fsColorMorph, attributeLocations: attributeLocations, - } + }, ); } groundPolylinePrimitive._spMorph = colorProgramMorph; @@ -500,7 +500,7 @@ function createCommands( material, translucent, colorCommands, - pickCommands + pickCommands, ) { const primitive = groundPolylinePrimitive._primitive; const length = primitive._va.length; @@ -511,9 +511,8 @@ function createCommands( appearance instanceof PolylineColorAppearance; const materialUniforms = isPolylineColorAppearance ? {} : material._uniforms; - const uniformMap = primitive._batchTable.getUniformMapCallback()( - materialUniforms - ); + const uniformMap = + primitive._batchTable.getUniformMapCallback()(materialUniforms); for (let i = 0; i < length; i++) { const vertexArray = primitive._va[i]; @@ -535,7 +534,7 @@ function createCommands( const derivedTilesetCommand = DrawCommand.shallowClone( command, - command.derivedCommands.tileset + command.derivedCommands.tileset, ); derivedTilesetCommand.renderState = groundPolylinePrimitive._renderState3DTiles; @@ -545,14 +544,14 @@ function createCommands( // derive for 2D const derived2DCommand = DrawCommand.shallowClone( command, - command.derivedCommands.color2D + command.derivedCommands.color2D, ); derived2DCommand.shaderProgram = groundPolylinePrimitive._sp2D; command.derivedCommands.color2D = derived2DCommand; const derived2DTilesetCommand = DrawCommand.shallowClone( derivedTilesetCommand, - derivedTilesetCommand.derivedCommands.color2D + derivedTilesetCommand.derivedCommands.color2D, ); derived2DTilesetCommand.shaderProgram = groundPolylinePrimitive._sp2D; derivedTilesetCommand.derivedCommands.color2D = derived2DTilesetCommand; @@ -560,7 +559,7 @@ function createCommands( // derive for Morph const derivedMorphCommand = DrawCommand.shallowClone( command, - command.derivedCommands.colorMorph + command.derivedCommands.colorMorph, ); derivedMorphCommand.renderState = groundPolylinePrimitive._renderStateMorph; derivedMorphCommand.shaderProgram = groundPolylinePrimitive._spMorph; @@ -576,7 +575,7 @@ function updateAndQueueCommand( modelMatrix, cull, boundingVolume, - debugShowBoundingVolume + debugShowBoundingVolume, ) { // Use derived appearance command for morph and 2D if (frameState.mode === SceneMode.MORPHING) { @@ -599,7 +598,7 @@ function updateAndQueueCommands( pickCommands, modelMatrix, cull, - debugShowBoundingVolume + debugShowBoundingVolume, ) { const primitive = groundPolylinePrimitive._primitive; @@ -641,7 +640,7 @@ function updateAndQueueCommands( modelMatrix, cull, boundingVolume, - debugShowBoundingVolume + debugShowBoundingVolume, ); } if (queue3DTilesCommands) { @@ -653,7 +652,7 @@ function updateAndQueueCommands( modelMatrix, cull, boundingVolume, - debugShowBoundingVolume + debugShowBoundingVolume, ); } } @@ -680,7 +679,7 @@ GroundPolylinePrimitive.prototype.update = function (frameState) { //>>includeStart('debug', pragmas.debug); if (!this.asynchronous) { throw new DeveloperError( - "For synchronous GroundPolylinePrimitives, you must call GroundPolylinePrimitives.initializeTerrainHeights() and wait for the returned promise to resolve." + "For synchronous GroundPolylinePrimitives, you must call GroundPolylinePrimitives.initializeTerrainHeights() and wait for the returned promise to resolve.", ); } //>>includeEnd('debug'); @@ -734,7 +733,7 @@ GroundPolylinePrimitive.prototype.update = function (frameState) { geometryInstance.geometry._scene3DOnly = frameState.scene3DOnly; GroundPolylineGeometry.setProjectionAndEllipsoid( geometryInstance.geometry, - frameState.mapProjection + frameState.mapProjection, ); groundInstances[i] = new GeometryInstance({ @@ -751,7 +750,7 @@ GroundPolylinePrimitive.prototype.update = function (frameState) { primitiveOptions._createShaderProgramFunction = function ( primitive, frameState, - appearance + appearance, ) { createShaderProgram(that, frameState, appearance); }; @@ -762,7 +761,7 @@ GroundPolylinePrimitive.prototype.update = function (frameState) { translucent, twoPasses, colorCommands, - pickCommands + pickCommands, ) { createCommands( that, @@ -770,7 +769,7 @@ GroundPolylinePrimitive.prototype.update = function (frameState) { material, translucent, colorCommands, - pickCommands + pickCommands, ); }; primitiveOptions._updateAndQueueCommandsFunction = function ( @@ -781,7 +780,7 @@ GroundPolylinePrimitive.prototype.update = function (frameState) { modelMatrix, cull, debugShowBoundingVolume, - twoPasses + twoPasses, ) { updateAndQueueCommands( that, @@ -790,7 +789,7 @@ GroundPolylinePrimitive.prototype.update = function (frameState) { pickCommands, modelMatrix, cull, - debugShowBoundingVolume + debugShowBoundingVolume, ); }; @@ -802,7 +801,7 @@ GroundPolylinePrimitive.prototype.update = function (frameState) { !this._hasPerInstanceColors ) { throw new DeveloperError( - "All GeometryInstances must have color attributes to use PolylineColorAppearance with GroundPolylinePrimitive." + "All GeometryInstances must have color attributes to use PolylineColorAppearance with GroundPolylinePrimitive.", ); } @@ -835,12 +834,12 @@ GroundPolylinePrimitive.prototype.update = function (frameState) { * attributes.show = Cesium.ShowGeometryInstanceAttribute.toValue(true); */ GroundPolylinePrimitive.prototype.getGeometryInstanceAttributes = function ( - id + id, ) { //>>includeStart('debug', pragmas.debug); if (!defined(this._primitive)) { throw new DeveloperError( - "must call update before calling getGeometryInstanceAttributes" + "must call update before calling getGeometryInstanceAttributes", ); } //>>includeEnd('debug'); diff --git a/packages/engine/Source/Scene/GroundPrimitive.js b/packages/engine/Source/Scene/GroundPrimitive.js index f67249322b8a..5a3d5ab85393 100644 --- a/packages/engine/Source/Scene/GroundPrimitive.js +++ b/packages/engine/Source/Scene/GroundPrimitive.js @@ -175,7 +175,7 @@ function GroundPrimitive(options) { */ this.classificationType = defaultValue( options.classificationType, - ClassificationType.BOTH + ClassificationType.BOTH, ); /** * This property is for debugging only; it is not for production use nor is it optimized. @@ -189,7 +189,7 @@ function GroundPrimitive(options) { */ this.debugShowBoundingVolume = defaultValue( options.debugShowBoundingVolume, - false + false, ); /** @@ -204,7 +204,7 @@ function GroundPrimitive(options) { */ this.debugShowShadowVolume = defaultValue( options.debugShowShadowVolume, - false + false, ); this._boundingVolumes = []; @@ -234,7 +234,7 @@ function GroundPrimitive(options) { interleave: defaultValue(options.interleave, false), releaseGeometryInstances: defaultValue( options.releaseGeometryInstances, - true + true, ), allowPicking: defaultValue(options.allowPicking, true), asynchronous: defaultValue(options.asynchronous, true), @@ -417,22 +417,22 @@ function getRectangle(frameState, geometry) { const highPosition = Cartesian3.unpack( highPositions, i, - scratchBVCartesianHigh + scratchBVCartesianHigh, ); const lowPosition = Cartesian3.unpack( lowPositions, i, - scratchBVCartesianLow + scratchBVCartesianLow, ); const position = Cartesian3.add( highPosition, lowPosition, - scratchBVCartesian + scratchBVCartesian, ); const cartographic = ellipsoid.cartesianToCartographic( position, - scratchBVCartographic + scratchBVCartographic, ); const latitude = cartographic.latitude; @@ -456,7 +456,7 @@ function getRectangle(frameState, geometry) { function setMinMaxTerrainHeights(primitive, rectangle, ellipsoid) { const result = ApproximateTerrainHeights.getMinimumMaximumHeights( rectangle, - ellipsoid + ellipsoid, ); primitive._minTerrainHeight = result.minimumTerrainHeight; @@ -471,7 +471,7 @@ function createBoundingVolume(groundPrimitive, frameState, geometry) { rectangle, groundPrimitive._minHeight, groundPrimitive._maxHeight, - ellipsoid + ellipsoid, ); groundPrimitive._boundingVolumes.push(obb); @@ -481,13 +481,13 @@ function createBoundingVolume(groundPrimitive, frameState, geometry) { rectangle, projection, groundPrimitive._maxHeight, - groundPrimitive._minHeight + groundPrimitive._minHeight, ); Cartesian3.fromElements( boundingVolume.center.z, boundingVolume.center.x, boundingVolume.center.y, - boundingVolume.center + boundingVolume.center, ); groundPrimitive._boundingVolumes2D.push(boundingVolume); @@ -505,7 +505,7 @@ function updateAndQueueRenderCommand( modelMatrix, cull, boundingVolume, - debugShowBoundingVolume + debugShowBoundingVolume, ) { // Use derived appearance command for 2D if needed const classificationPrimitive = groundPrimitive._primitive; @@ -532,7 +532,7 @@ function updateAndQueuePickCommand( frameState, modelMatrix, cull, - boundingVolume + boundingVolume, ) { // Use derived pick command for 2D if needed const classificationPrimitive = groundPrimitive._primitive; @@ -560,7 +560,7 @@ function updateAndQueueCommands( modelMatrix, cull, debugShowBoundingVolume, - twoPasses + twoPasses, ) { let boundingVolumes; if (frameState.mode === SceneMode.SCENE3D) { @@ -596,7 +596,7 @@ function updateAndQueueCommands( modelMatrix, cull, boundingVolume, - debugShowBoundingVolume + debugShowBoundingVolume, ); } if (queue3DTilesCommands) { @@ -608,7 +608,7 @@ function updateAndQueueCommands( modelMatrix, cull, boundingVolume, - debugShowBoundingVolume + debugShowBoundingVolume, ); } } @@ -626,7 +626,7 @@ function updateAndQueueCommands( modelMatrix, cull, boundingVolume, - debugShowBoundingVolume + debugShowBoundingVolume, ); } } @@ -654,7 +654,7 @@ function updateAndQueueCommands( frameState, modelMatrix, cull, - boundingVolume + boundingVolume, ); } if (queue3DTilesCommands) { @@ -665,7 +665,7 @@ function updateAndQueueCommands( frameState, modelMatrix, cull, - boundingVolume + boundingVolume, ); } } @@ -704,7 +704,7 @@ GroundPrimitive.prototype.update = function (frameState) { //>>includeStart('debug', pragmas.debug); if (!this.asynchronous) { throw new DeveloperError( - "For synchronous GroundPrimitives, you must call GroundPrimitive.initializeTerrainHeights() and wait for the returned promise to resolve." + "For synchronous GroundPrimitives, you must call GroundPrimitive.initializeTerrainHeights() and wait for the returned promise to resolve.", ); } //>>includeEnd('debug'); @@ -745,7 +745,7 @@ GroundPrimitive.prototype.update = function (frameState) { if (defined(id) && defined(instanceRectangle)) { const boundingSphere = ApproximateTerrainHeights.getBoundingSphere( instanceRectangle, - ellipsoid + ellipsoid, ); this._boundingSpheresKeys.push(id); this._boundingSpheres.push(boundingSphere); @@ -755,7 +755,7 @@ GroundPrimitive.prototype.update = function (frameState) { if (!defined(instanceType) || !defined(instanceType.createShadowVolume)) { //>>includeStart('debug', pragmas.debug); throw new DeveloperError( - "Not all of the geometry instances have GroundPrimitive support." + "Not all of the geometry instances have GroundPrimitive support.", ); //>>includeEnd('debug'); } @@ -769,16 +769,16 @@ GroundPrimitive.prototype.update = function (frameState) { this._minHeight = VerticalExaggeration.getHeight( this._minTerrainHeight, exaggeration, - exaggerationRelativeHeight + exaggerationRelativeHeight, ); this._maxHeight = VerticalExaggeration.getHeight( this._maxTerrainHeight, exaggeration, - exaggerationRelativeHeight + exaggerationRelativeHeight, ); const useFragmentCulling = GroundPrimitive._supportsMaterials( - frameState.context + frameState.context, ); this._useFragmentCulling = useFragmentCulling; @@ -807,20 +807,22 @@ GroundPrimitive.prototype.update = function (frameState) { geometry.textureCoordinateRotationPoints; if (usePlanarExtents) { - attributes = ShadowVolumeAppearance.getPlanarTextureCoordinateAttributes( - boundingRectangle, - textureCoordinateRotationPoints, - ellipsoid, - frameState.mapProjection, - this._maxHeight - ); + attributes = + ShadowVolumeAppearance.getPlanarTextureCoordinateAttributes( + boundingRectangle, + textureCoordinateRotationPoints, + ellipsoid, + frameState.mapProjection, + this._maxHeight, + ); } else { - attributes = ShadowVolumeAppearance.getSphericalExtentGeometryInstanceAttributes( - boundingRectangle, - textureCoordinateRotationPoints, - ellipsoid, - frameState.mapProjection - ); + attributes = + ShadowVolumeAppearance.getSphericalExtentGeometryInstanceAttributes( + boundingRectangle, + textureCoordinateRotationPoints, + ellipsoid, + frameState.mapProjection, + ); } const instanceAttributes = instance.attributes; @@ -834,7 +836,7 @@ GroundPrimitive.prototype.update = function (frameState) { geometry: instanceType.createShadowVolume( geometry, getComputeMinimumHeightFunction(this), - getComputeMaximumHeightFunction(this) + getComputeMaximumHeightFunction(this), ), attributes: attributes, id: instance.id, @@ -850,7 +852,7 @@ GroundPrimitive.prototype.update = function (frameState) { geometry: instanceType.createShadowVolume( geometry, getComputeMinimumHeightFunction(this), - getComputeMaximumHeightFunction(this) + getComputeMaximumHeightFunction(this), ), attributes: instance.attributes, id: instance.id, @@ -863,7 +865,7 @@ GroundPrimitive.prototype.update = function (frameState) { primitiveOptions._createBoundingVolumeFunction = function ( frameState, - geometry + geometry, ) { createBoundingVolume(that, frameState, geometry); }; @@ -875,7 +877,7 @@ GroundPrimitive.prototype.update = function (frameState) { modelMatrix, cull, debugShowBoundingVolume, - twoPasses + twoPasses, ) { updateAndQueueCommands( that, @@ -885,7 +887,7 @@ GroundPrimitive.prototype.update = function (frameState) { modelMatrix, cull, debugShowBoundingVolume, - twoPasses + twoPasses, ); }; @@ -938,7 +940,7 @@ GroundPrimitive.prototype.getGeometryInstanceAttributes = function (id) { //>>includeStart('debug', pragmas.debug); if (!defined(this._primitive)) { throw new DeveloperError( - "must call update before calling getGeometryInstanceAttributes" + "must call update before calling getGeometryInstanceAttributes", ); } //>>includeEnd('debug'); diff --git a/packages/engine/Source/Scene/GroupMetadata.js b/packages/engine/Source/Scene/GroupMetadata.js index 66b2e3c3d8ff..5308fdbc2435 100644 --- a/packages/engine/Source/Scene/GroupMetadata.js +++ b/packages/engine/Source/Scene/GroupMetadata.js @@ -119,7 +119,7 @@ GroupMetadata.prototype.hasPropertyBySemantic = function (semantic) { return MetadataEntity.hasPropertyBySemantic( semantic, this._properties, - this._class + this._class, ); }; @@ -164,7 +164,7 @@ GroupMetadata.prototype.setProperty = function (propertyId, value) { propertyId, value, this._properties, - this._class + this._class, ); }; @@ -179,7 +179,7 @@ GroupMetadata.prototype.getPropertyBySemantic = function (semantic) { return MetadataEntity.getPropertyBySemantic( semantic, this._properties, - this._class + this._class, ); }; @@ -196,7 +196,7 @@ GroupMetadata.prototype.setPropertyBySemantic = function (semantic, value) { semantic, value, this._properties, - this._class + this._class, ); }; diff --git a/packages/engine/Source/Scene/I3SDataProvider.js b/packages/engine/Source/Scene/I3SDataProvider.js index c4cd9cd4578e..89e87643ef26 100644 --- a/packages/engine/Source/Scene/I3SDataProvider.js +++ b/packages/engine/Source/Scene/I3SDataProvider.js @@ -149,14 +149,14 @@ function I3SDataProvider(options) { this._showFeatures = defaultValue(options.showFeatures, false); this._adjustMaterialAlphaMode = defaultValue( options.adjustMaterialAlphaMode, - false + false, ); this._applySymbology = defaultValue(options.applySymbology, false); this._calculateNormals = defaultValue(options.calculateNormals, false); this._cesium3dTilesetOptions = defaultValue( options.cesium3dTilesetOptions, - defaultValue.EMPTY_OBJECT + defaultValue.EMPTY_OBJECT, ); this._layers = []; @@ -452,7 +452,7 @@ async function addLayers(provider, data, options) { provider, buildingLayerUrl, data.sublayers[i], - provider + provider, ); promises.push(promise); } @@ -476,7 +476,7 @@ async function addLayers(provider, data, options) { data.fullExtent.xmin, data.fullExtent.ymin, data.fullExtent.xmax, - data.fullExtent.ymax + data.fullExtent.ymax, ); provider._layersExtent.push(extent); } @@ -500,7 +500,7 @@ async function addLayers(provider, data, options) { } else { // Filter other scene layer types out console.log( - `${data.layerType} layer ${data.name} is skipped as not supported.` + `${data.layerType} layer ${data.name} is skipped as not supported.`, ); } } @@ -571,7 +571,7 @@ I3SDataProvider.fromUrl = async function (url, options) { const layerPromises = []; for (let i = 0; i < provider._layers.length; i++) { layerPromises.push( - provider._layers[i].load(options.cesium3dTilesetOptions) + provider._layers[i].load(options.cesium3dTilesetOptions), ); } @@ -646,7 +646,7 @@ I3SDataProvider.prototype._binarizeGltf = function (rawGltf) { chunkData: new Uint8Array( binaryGltfData.buffer, 20, - rawGltfData.byteLength + rawGltfData.byteLength, ), }; @@ -680,7 +680,7 @@ function getCoveredTiles(terrainProvider, extent) { const minCornerXY = tilingScheme.positionToTileXY(topLeftCorner, maxLevel); const maxCornerXY = tilingScheme.positionToTileXY( bottomRightCorner, - maxLevel + maxLevel, ); // Get all the tiles in between @@ -711,7 +711,7 @@ function getCoveredTiles(terrainProvider, extent) { const requestPromise = tileRequest.terrainProvider.requestTileGeometry( tileRequest.x, tileRequest.y, - tileRequest.level + tileRequest.level, ); tilePromises.push(requestPromise); @@ -739,7 +739,7 @@ function getCoveredTiles(terrainProvider, extent) { nativeExtent: tilingScheme.tileXYToNativeRectangle( options.x, options.y, - options.level + options.level, ), height: heightMap._height, width: heightMap._width, @@ -772,12 +772,12 @@ async function loadGeoidData(provider) { try { const heightMaps = await getCoveredTiles( geoidTerrainProvider, - provider._extent + provider._extent, ); provider._geoidDataList = heightMaps; } catch (error) { console.log( - "Error retrieving Geoid Terrain tiles - no geoid conversion will be performed." + "Error retrieving Geoid Terrain tiles - no geoid conversion will be performed.", ); } } diff --git a/packages/engine/Source/Scene/I3SDecoder.js b/packages/engine/Source/Scene/I3SDecoder.js index 97cc846e792c..d72218c43a33 100644 --- a/packages/engine/Source/Scene/I3SDecoder.js +++ b/packages/engine/Source/Scene/I3SDecoder.js @@ -18,12 +18,12 @@ function I3SDecoder() {} // Maximum concurrency to use when decoding draco models I3SDecoder._maxDecodingConcurrency = Math.max( FeatureDetection.hardwareConcurrency - 1, - 1 + 1, ); I3SDecoder._decodeTaskProcessor = new TaskProcessor( "decodeI3S", - I3SDecoder._maxDecodingConcurrency + I3SDecoder._maxDecodingConcurrency, ); I3SDecoder._promise = undefined; @@ -55,7 +55,7 @@ I3SDecoder.decode = async function ( defaultGeometrySchema, geometryData, featureData, - symbologyData + symbologyData, ) { //>>includeStart('debug', pragmas.debug); Check.typeOf.string("url", url); @@ -93,18 +93,17 @@ I3SDecoder.decode = async function ( Matrix3.multiply( axisFlipRotation, parentRotationInverseMatrix, - parentRotation + parentRotation, ); const cartographicCenter = Cartographic.fromDegrees( longitude, latitude, - height + height, ); - const cartesianCenter = Ellipsoid.WGS84.cartographicToCartesian( - cartographicCenter - ); + const cartesianCenter = + Ellipsoid.WGS84.cartographicToCartesian(cartographicCenter); const payload = { binaryData: geometryData._data, diff --git a/packages/engine/Source/Scene/I3SField.js b/packages/engine/Source/Scene/I3SField.js index dc4550e333fe..33c040c23b95 100644 --- a/packages/engine/Source/Scene/I3SField.js +++ b/packages/engine/Source/Scene/I3SField.js @@ -234,7 +234,7 @@ I3SField.prototype._parseBody = function (dataView, offset) { const parsedValue = this._parseValue( dataView, desc.valueType, - offset + offset, ); this._values[item].push(parsedValue.value); offset = parsedValue.offset; @@ -245,7 +245,7 @@ I3SField.prototype._parseBody = function (dataView, offset) { const curParsedValue = this._parseValue( dataView, desc.valueType, - offset + offset, ); if (curParsedValue.value.charCodeAt(0) !== 0) { stringContent += curParsedValue.value; @@ -292,7 +292,7 @@ I3SField.prototype._validateHeader = function (dataView) { } if (dataView.byteLength < headerSize) { throw new RuntimeError( - `Invalid attribute buffer size (field: ${this.name}, header: ${headerSize}, actual: ${dataView.byteLength})` + `Invalid attribute buffer size (field: ${this.name}, header: ${headerSize}, actual: ${dataView.byteLength})`, ); } }; @@ -303,7 +303,7 @@ I3SField.prototype._validateHeader = function (dataView) { I3SField.prototype._validateBody = function (dataView, offset) { if (!defined(this._header.count)) { throw new RuntimeError( - `Invalid attribute buffer (field: ${this.name}, count is missing)` + `Invalid attribute buffer (field: ${this.name}, count is missing)`, ); } let attributeByteCountsOffset; @@ -327,7 +327,7 @@ I3SField.prototype._validateBody = function (dataView, offset) { } else { if (!defined(attributeByteCountsOffset)) { throw new RuntimeError( - `Invalid attribute buffer (field: ${this.name}, attributeByteCounts is missing)` + `Invalid attribute buffer (field: ${this.name}, attributeByteCounts is missing)`, ); } for ( @@ -338,7 +338,7 @@ I3SField.prototype._validateBody = function (dataView, offset) { const parsedValue = this._parseValue( dataView, this._storageInfo.attributeByteCounts.valueType, - attributeByteCountsOffset + attributeByteCountsOffset, ); offset += parsedValue.value; attributeByteCountsOffset = parsedValue.offset; @@ -346,13 +346,13 @@ I3SField.prototype._validateBody = function (dataView, offset) { } } else { throw new RuntimeError( - `Invalid attribute buffer (field: ${this.name}, ${item} is missing)` + `Invalid attribute buffer (field: ${this.name}, ${item} is missing)`, ); } } if (dataView.byteLength < offset) { throw new RuntimeError( - `Invalid attribute buffer size (field: ${this.name}, expected: ${offset}, actual: ${dataView.byteLength})` + `Invalid attribute buffer size (field: ${this.name}, expected: ${offset}, actual: ${dataView.byteLength})`, ); } }; diff --git a/packages/engine/Source/Scene/I3SGeometry.js b/packages/engine/Source/Scene/I3SGeometry.js index 2d6e11210f14..f68e4fc7c5b5 100644 --- a/packages/engine/Source/Scene/I3SGeometry.js +++ b/packages/engine/Source/Scene/I3SGeometry.js @@ -98,12 +98,12 @@ function sameSide(p1, p2, a, b) { const cp1 = Cartesian3.cross( ab, Cartesian3.subtract(p1, a, scratchAp1), - scratchCp1 + scratchCp1, ); const cp2 = Cartesian3.cross( ab, Cartesian3.subtract(p2, a, scratchAp2), - scratchCp2 + scratchCp2, ); return Cartesian3.dot(cp1, cp2) >= 0; } @@ -146,7 +146,7 @@ I3SGeometry.prototype.getClosestPointIndexOnTriangle = function (px, py, pz) { Matrix3.multiplyByVector( this._customAttributes.parentRotation, position, - position + position, ); let bestTriDist = Number.MAX_VALUE; @@ -183,19 +183,19 @@ I3SGeometry.prototype.getClosestPointIndexOnTriangle = function (px, py, pz) { positions[i0 * 3], positions[i0 * 3 + 1], positions[i0 * 3 + 2], - scratchV0 + scratchV0, ); const v1 = Cartesian3.fromElements( positions[i1 * 3], positions[i1 * 3 + 1], positions[i1 * 3 + 2], - scratchV1 + scratchV1, ); const v2 = new Cartesian3( positions[i2 * 3], positions[i2 * 3 + 1], positions[i2 * 3 + 2], - scratchV2 + scratchV2, ); // Check how the point is positioned relative to the triangle. @@ -226,13 +226,13 @@ I3SGeometry.prototype.getClosestPointIndexOnTriangle = function (px, py, pz) { // Found a triangle, return the index of the closest point const d0 = Cartesian3.magnitudeSquared( - Cartesian3.subtract(position, v0, v0p) + Cartesian3.subtract(position, v0, v0p), ); const d1 = Cartesian3.magnitudeSquared( - Cartesian3.subtract(position, v1, scratchV1p) + Cartesian3.subtract(position, v1, scratchV1p), ); const d2 = Cartesian3.magnitudeSquared( - Cartesian3.subtract(position, v2, scratchV2p) + Cartesian3.subtract(position, v2, scratchV2p), ); if (d0 < d1 && d0 < d2) { bestIndex = i0; @@ -293,7 +293,7 @@ I3SGeometry.prototype._generateGltf = function ( bufferViews, accessors, extensions, - extensionsUsed + extensionsUsed, ) { // Get the material definition let gltfMaterial = { @@ -336,8 +336,8 @@ I3SGeometry.prototype._generateGltf = function ( defIndex < this._layer._data.textureSetDefinitions.length; defIndex++ ) { - const textureSetDefinition = this._layer._data - .textureSetDefinitions[defIndex]; + const textureSetDefinition = + this._layer._data.textureSetDefinitions[defIndex]; for ( let formatIndex = 0; formatIndex < textureSetDefinition.formats.length; @@ -368,12 +368,12 @@ I3SGeometry.prototype._generateGltf = function ( defined(gltfMaterial.pbrMetallicRoughness.baseColorFactor) ) { gltfMaterial.pbrMetallicRoughness.baseColorFactor = convertColorFactor( - gltfMaterial.pbrMetallicRoughness.baseColorFactor + gltfMaterial.pbrMetallicRoughness.baseColorFactor, ); } if (defined(gltfMaterial.emissiveFactor)) { gltfMaterial.emissiveFactor = convertColorFactor( - gltfMaterial.emissiveFactor + gltfMaterial.emissiveFactor, ); } } diff --git a/packages/engine/Source/Scene/I3SLayer.js b/packages/engine/Source/Scene/I3SLayer.js index 59378e374db5..0ae1061ea9b5 100644 --- a/packages/engine/Source/Scene/I3SLayer.js +++ b/packages/engine/Source/Scene/I3SLayer.js @@ -48,7 +48,7 @@ function I3SLayer(dataProvider, layerData, parent) { this._resource = new Resource({ url: tilesetUrl }); this._resource.setQueryParameters( - this._dataProvider.resource.queryParameters + this._dataProvider.resource.queryParameters, ); this._resource.appendForwardSlash(); this._data = layerData; @@ -179,7 +179,7 @@ Object.defineProperties(I3SLayer.prototype, { I3SLayer.prototype.load = async function (cesium3dTilesetOptions) { if (this._data.spatialReference.wkid !== 4326) { throw new RuntimeError( - `Unsupported spatial reference: ${this._data.spatialReference.wkid}` + `Unsupported spatial reference: ${this._data.spatialReference.wkid}`, ); } @@ -214,8 +214,8 @@ I3SLayer.prototype._computeGeometryDefinitions = function (useCompression) { defIndex++ ) { const geometryBuffersInfo = []; - const geometryBuffers = this._data.geometryDefinitions[defIndex] - .geometryBuffers; + const geometryBuffers = + this._data.geometryDefinitions[defIndex].geometryBuffers; for (let bufIndex = 0; bufIndex < geometryBuffers.length; bufIndex++) { const geometryBuffer = geometryBuffers[bufIndex]; @@ -264,7 +264,7 @@ I3SLayer.prototype._computeGeometryDefinitions = function (useCompression) { */ I3SLayer.prototype._findBestGeometryBuffers = function ( definition, - attributes + attributes, ) { // find the most appropriate geometry definition // based on the required attributes, and by favouring @@ -348,16 +348,16 @@ I3SLayer.prototype._loadNodePage = function (page) { const nodePageResource = this.resource.getDerivedResource({ url: `nodepages/${page}/`, }); - const fetchPromise = I3SLayer._fetchJson(nodePageResource).then(function ( - data - ) { - if (defined(data.error) && data.error.code !== 200) { - return Promise.reject(data.error); - } + const fetchPromise = I3SLayer._fetchJson(nodePageResource).then( + function (data) { + if (defined(data.error) && data.error.code !== 200) { + return Promise.reject(data.error); + } - that._nodePages[page] = data.nodes; - return data; - }); + that._nodePages[page] = data.nodes; + return data; + }, + ); this._nodePageFetches[page] = fetchPromise; } @@ -374,14 +374,14 @@ I3SLayer.prototype._computeExtent = function () { this._data.fullExtent.xmin, this._data.fullExtent.ymin, this._data.fullExtent.xmax, - this._data.fullExtent.ymax + this._data.fullExtent.ymax, ); } else if (defined(this._data.store.extent)) { this._extent = Rectangle.fromDegrees( this._data.store.extent[0], this._data.store.extent[1], this._data.store.extent[2], - this._data.store.extent[3] + this._data.store.extent[3], ); } }; @@ -409,12 +409,12 @@ I3SLayer.prototype._create3DTileset = async function (cesium3dTilesetOptions) { ? clone(cesium3dTilesetOptions) : {}; cesium3dTilesetOptions.outlineColor = Color.fromCartesian4( - Cartesian4.fromArray(outlineColor) + Cartesian4.fromArray(outlineColor), ); } this._tileset = await Cesium3DTileset.fromUrl( tilesetUrl, - cesium3dTilesetOptions + cesium3dTilesetOptions, ); this._tileset.show = this._parent.show; this._tileset._isI3STileSet = true; diff --git a/packages/engine/Source/Scene/I3SNode.js b/packages/engine/Source/Scene/I3SNode.js index fb8c548c0fb3..d3311e42b031 100644 --- a/packages/engine/Source/Scene/I3SNode.js +++ b/packages/engine/Source/Scene/I3SNode.js @@ -195,7 +195,7 @@ I3SNode.prototype.load = async function () { that._layer._tileset, that._dataProvider.resource, tileDefinition, - that._parent._tile + that._parent._tile, ); that._tile._i3sNode = that; @@ -298,7 +298,7 @@ I3SNode.prototype.getFieldsForPickedPosition = function (pickedPosition) { const location = geometry.getClosestPointIndexOnTriangle( pickedPosition.x, pickedPosition.y, - pickedPosition.z + pickedPosition.z, ); if ( @@ -351,7 +351,7 @@ I3SNode.prototype._loadChildren = function () { const newChild = new I3SNode( that, defaultValue(child.href, child), - false + false, ); that._children.push(newChild); childPromises.push(newChild.load()); @@ -383,7 +383,7 @@ I3SNode.prototype._loadGeometryData = function () { ) { const curGeometryData = new I3SGeometry( this, - this._data.geometryData[geomIndex].href + this._data.geometryData[geomIndex].href, ); this._geometryData.push(curGeometryData); geometryPromises.push(curGeometryData.load()); @@ -391,7 +391,7 @@ I3SNode.prototype._loadGeometryData = function () { } else if (defined(this._data.mesh)) { const geometryDefinition = this._layer._findBestGeometryBuffers( this._data.mesh.geometry.definition, - ["position", "uv0"] + ["position", "uv0"], ); const geometryURI = `./geometries/${geometryDefinition.bufferIndex}/`; @@ -421,7 +421,7 @@ I3SNode.prototype._loadFeatureData = function () { ) { const newFeatureData = new I3SFeature( this, - this._data.featureData[featureIndex].href + this._data.featureData[featureIndex].href, ); this._featureData.push(newFeatureData); featurePromises.push(newFeatureData.load()); @@ -456,7 +456,7 @@ I3SNode.prototype._create3DTileDefinition = function () { geoPosition = Cartographic.fromDegrees( obb.center[0], obb.center[1], - obb.center[2] + obb.center[2], ); } else { geoPosition = Cartographic.fromDegrees(mbs[0], mbs[1], mbs[2]); @@ -501,7 +501,7 @@ I3SNode.prototype._create3DTileDefinition = function () { }; span = Math.max( Math.max(this._data.obb.halfSize[0], this._data.obb.halfSize[1]), - this._data.obb.halfSize[2] + this._data.obb.halfSize[2], ); position = Ellipsoid.WGS84.cartographicToCartesian(geoPosition); } else { @@ -522,7 +522,7 @@ I3SNode.prototype._create3DTileDefinition = function () { "maxScreenThresholdSQ" ) { const maxScreenThreshold = Math.sqrt( - this._data.lodThreshold / (Math.PI * 0.25) + this._data.lodThreshold / (Math.PI * 0.25), ); metersPerPixel = span / maxScreenThreshold; } else if ( @@ -565,7 +565,7 @@ I3SNode.prototype._create3DTileDefinition = function () { this._data.obb.quaternion[0], this._data.obb.quaternion[1], this._data.obb.quaternion[2], - this._data.obb.quaternion[3] + this._data.obb.quaternion[3], ); } @@ -588,12 +588,12 @@ I3SNode.prototype._create3DTileDefinition = function () { position.x, position.y, position.z, - 1 + 1, ); const inverseGlobalTransform = Matrix4.inverse( globalTransform, - new Matrix4() + new Matrix4(), ); const localTransform = Matrix4.clone(globalTransform); @@ -602,7 +602,7 @@ I3SNode.prototype._create3DTileDefinition = function () { Matrix4.multiply( globalTransform, this._parent._inverseGlobalTransform, - localTransform + localTransform, ); } @@ -614,7 +614,7 @@ I3SNode.prototype._create3DTileDefinition = function () { const childrenDefinition = []; for (let childIndex = 0; childIndex < this._children.length; childIndex++) { childrenDefinition.push( - this._children[childIndex]._create3DTileDefinition() + this._children[childIndex]._create3DTileDefinition(), ); } @@ -709,7 +709,7 @@ I3SNode.prototype._createContentURL = async function () { geometrySchema, geometryData, this._featureData[0], - this._symbologyData + this._symbologyData, ); if (!defined(result)) { // Postponed @@ -724,7 +724,7 @@ I3SNode.prototype._createContentURL = async function () { result.meshData.bufferViews, result.meshData.accessors, result.meshData.rootExtensions, - result.meshData.extensionsUsed + result.meshData.extensionsUsed, ); this._geometryData[0]._customAttributes = result.meshData._customAttributes; diff --git a/packages/engine/Source/Scene/I3SSublayer.js b/packages/engine/Source/Scene/I3SSublayer.js index 6d33f74514bd..129d7ee3032d 100644 --- a/packages/engine/Source/Scene/I3SSublayer.js +++ b/packages/engine/Source/Scene/I3SSublayer.js @@ -129,7 +129,7 @@ I3SSublayer._fromData = async function ( dataProvider, buildingLayerUrl, sublayerData, - parent + parent, ) { const sublayer = new I3SSublayer(dataProvider, parent, sublayerData); if (sublayer._data.layerType === "group") { @@ -141,7 +141,7 @@ I3SSublayer._fromData = async function ( dataProvider, buildingLayerUrl, sublayers[i], - sublayer + sublayer, ); promises.push(promise); } @@ -154,7 +154,7 @@ I3SSublayer._fromData = async function ( } } else if (sublayer._data.layerType === "3DObject") { const sublayerUrl = buildingLayerUrl.concat( - `/sublayers/${sublayer._data.id}` + `/sublayers/${sublayer._data.id}`, ); const resource = new Resource({ url: sublayerUrl }); resource.setQueryParameters(dataProvider.resource.queryParameters); @@ -167,7 +167,7 @@ I3SSublayer._fromData = async function ( } else { // Filter other scene layer types out console.log( - `${sublayer._data.layerType} layer ${sublayer._data.name} is skipped as not supported.` + `${sublayer._data.layerType} layer ${sublayer._data.name} is skipped as not supported.`, ); } return sublayer; diff --git a/packages/engine/Source/Scene/I3SSymbology.js b/packages/engine/Source/Scene/I3SSymbology.js index 21783b9e4afc..5b4a802dbc66 100644 --- a/packages/engine/Source/Scene/I3SSymbology.js +++ b/packages/engine/Source/Scene/I3SSymbology.js @@ -73,7 +73,7 @@ function parseSymbol(symbol, isColorCaptured) { if (defined(edges.color)) { symbology.edges.color = convertColor( edges.color, - edges.transparency + edges.transparency, ); } } else if (defined(outline)) { @@ -81,7 +81,7 @@ function parseSymbol(symbol, isColorCaptured) { if (defined(outline.color)) { symbology.edges.color = convertColor( outline.color, - outline.transparency + outline.transparency, ); } } @@ -95,7 +95,7 @@ function parseSymbol(symbol, isColorCaptured) { if (defined(material.color)) { symbology.material.color = convertColor( material.color, - material.transparency + material.transparency, ); } } @@ -120,7 +120,7 @@ function buildUniqueValueHash(renderer, isColorCaptured) { for (let classIndex = 0; classIndex < classes.length; classIndex++) { const classSymbology = parseSymbol( classes[classIndex].symbol, - isColorCaptured + isColorCaptured, ); const values = classes[classIndex].values; for (let valueIndex = 0; valueIndex < values.length; valueIndex++) { @@ -222,7 +222,7 @@ I3SSymbology.prototype._parseLayerSymbology = function () { } else if (renderer.type === "uniqueValue") { this._defaultSymbology = parseSymbol( renderer.defaultSymbol, - isColorCaptured + isColorCaptured, ); this._valueFields.push(renderer.field1); if (defined(renderer.field2)) { @@ -235,7 +235,7 @@ I3SSymbology.prototype._parseLayerSymbology = function () { } else if (renderer.type === "classBreaks") { this._defaultSymbology = parseSymbol( renderer.defaultSymbol, - isColorCaptured + isColorCaptured, ); this._valueFields.push(renderer.field); this._classBreaksHash = buildClassBreaksHash(renderer, isColorCaptured); @@ -305,14 +305,14 @@ I3SSymbology.prototype._getSymbology = async function (node) { this._uniqueValueHash, fieldsValues, 0, - featureIndex + featureIndex, ); } else if (defined(this._classBreaksHash)) { featureHashFn = (featureIndex) => findHashForClassBreaks( this._classBreaksHash, fieldsValues[0], - featureIndex + featureIndex, ); } diff --git a/packages/engine/Source/Scene/I3dmParser.js b/packages/engine/Source/Scene/I3dmParser.js index 90056bd425dd..22bb7a1cb856 100644 --- a/packages/engine/Source/Scene/I3dmParser.js +++ b/packages/engine/Source/Scene/I3dmParser.js @@ -39,7 +39,7 @@ I3dmParser.parse = function (arrayBuffer, byteOffset) { const version = view.getUint32(byteOffset, true); if (version !== 1) { throw new RuntimeError( - `Only Instanced 3D Model version 1 is supported. Version ${version} is not.` + `Only Instanced 3D Model version 1 is supported. Version ${version} is not.`, ); } byteOffset += sizeOfUint32; @@ -50,7 +50,7 @@ I3dmParser.parse = function (arrayBuffer, byteOffset) { const featureTableJsonByteLength = view.getUint32(byteOffset, true); if (featureTableJsonByteLength === 0) { throw new RuntimeError( - "featureTableJsonByteLength is zero, the feature table must be defined." + "featureTableJsonByteLength is zero, the feature table must be defined.", ); } byteOffset += sizeOfUint32; @@ -67,7 +67,7 @@ I3dmParser.parse = function (arrayBuffer, byteOffset) { const gltfFormat = view.getUint32(byteOffset, true); if (gltfFormat !== 1 && gltfFormat !== 0) { throw new RuntimeError( - `Only glTF format 0 (uri) or 1 (embedded) are supported. Format ${gltfFormat} is not.` + `Only glTF format 0 (uri) or 1 (embedded) are supported. Format ${gltfFormat} is not.`, ); } byteOffset += sizeOfUint32; @@ -75,14 +75,14 @@ I3dmParser.parse = function (arrayBuffer, byteOffset) { const featureTableJson = getJsonFromTypedArray( uint8Array, byteOffset, - featureTableJsonByteLength + featureTableJsonByteLength, ); byteOffset += featureTableJsonByteLength; const featureTableBinary = new Uint8Array( arrayBuffer, byteOffset, - featureTableBinaryByteLength + featureTableBinaryByteLength, ); byteOffset += featureTableBinaryByteLength; @@ -92,7 +92,7 @@ I3dmParser.parse = function (arrayBuffer, byteOffset) { batchTableJson = getJsonFromTypedArray( uint8Array, byteOffset, - batchTableJsonByteLength + batchTableJsonByteLength, ); byteOffset += batchTableJsonByteLength; @@ -101,7 +101,7 @@ I3dmParser.parse = function (arrayBuffer, byteOffset) { batchTableBinary = new Uint8Array( arrayBuffer, byteOffset, - batchTableBinaryByteLength + batchTableBinaryByteLength, ); // Copy the batchTableBinary section and let the underlying ArrayBuffer be freed batchTableBinary = new Uint8Array(batchTableBinary); @@ -121,10 +121,10 @@ I3dmParser.parse = function (arrayBuffer, byteOffset) { // Create a copy of the glb so that it is 4-byte aligned I3dmParser._deprecationWarning( "i3dm-glb-unaligned", - "The embedded glb is not aligned to a 4-byte boundary." + "The embedded glb is not aligned to a 4-byte boundary.", ); gltfView = new Uint8Array( - uint8Array.subarray(byteOffset, byteOffset + gltfByteLength) + uint8Array.subarray(byteOffset, byteOffset + gltfByteLength), ); } diff --git a/packages/engine/Source/Scene/ImageBasedLighting.js b/packages/engine/Source/Scene/ImageBasedLighting.js index bd0226a03429..f0b20cb95fe2 100644 --- a/packages/engine/Source/Scene/ImageBasedLighting.js +++ b/packages/engine/Source/Scene/ImageBasedLighting.js @@ -33,27 +33,27 @@ function ImageBasedLighting(options) { //>>includeStart('debug', pragmas.debug); Check.typeOf.object( "options.imageBasedLightingFactor", - imageBasedLightingFactor + imageBasedLightingFactor, ); Check.typeOf.number.greaterThanOrEquals( "options.imageBasedLightingFactor.x", imageBasedLightingFactor.x, - 0.0 + 0.0, ); Check.typeOf.number.lessThanOrEquals( "options.imageBasedLightingFactor.x", imageBasedLightingFactor.x, - 1.0 + 1.0, ); Check.typeOf.number.greaterThanOrEquals( "options.imageBasedLightingFactor.y", imageBasedLightingFactor.y, - 0.0 + 0.0, ); Check.typeOf.number.lessThanOrEquals( "options.imageBasedLightingFactor.y", imageBasedLightingFactor.y, - 1.0 + 1.0, ); //>>includeEnd('debug'); @@ -76,7 +76,7 @@ function ImageBasedLighting(options) { sphericalHarmonicCoefficients.length !== 9) ) { throw new DeveloperError( - "options.sphericalHarmonicCoefficients must be an array of 9 Cartesian3 values." + "options.sphericalHarmonicCoefficients must be an array of 9 Cartesian3 values.", ); } //>>includeEnd('debug'); @@ -98,7 +98,7 @@ function ImageBasedLighting(options) { // Keeps track of the last values for use during update logic this._previousImageBasedLightingFactor = Cartesian2.clone( - imageBasedLightingFactor + imageBasedLightingFactor, ); this._previousLuminanceAtZenith = luminanceAtZenith; this._previousSphericalHarmonicCoefficients = sphericalHarmonicCoefficients; @@ -127,31 +127,31 @@ Object.defineProperties(ImageBasedLighting.prototype, { Check.typeOf.number.greaterThanOrEquals( "imageBasedLightingFactor.x", value.x, - 0.0 + 0.0, ); Check.typeOf.number.lessThanOrEquals( "imageBasedLightingFactor.x", value.x, - 1.0 + 1.0, ); Check.typeOf.number.greaterThanOrEquals( "imageBasedLightingFactor.y", value.y, - 0.0 + 0.0, ); Check.typeOf.number.lessThanOrEquals( "imageBasedLightingFactor.y", value.y, - 1.0 + 1.0, ); //>>includeEnd('debug'); this._previousImageBasedLightingFactor = Cartesian2.clone( this._imageBasedLightingFactor, - this._previousImageBasedLightingFactor + this._previousImageBasedLightingFactor, ); this._imageBasedLightingFactor = Cartesian2.clone( value, - this._imageBasedLightingFactor + this._imageBasedLightingFactor, ); }, }, @@ -203,11 +203,12 @@ Object.defineProperties(ImageBasedLighting.prototype, { //>>includeStart('debug', pragmas.debug); if (defined(value) && (!Array.isArray(value) || value.length !== 9)) { throw new DeveloperError( - "sphericalHarmonicCoefficients must be an array of 9 Cartesian3 values." + "sphericalHarmonicCoefficients must be an array of 9 Cartesian3 values.", ); } //>>includeEnd('debug'); - this._previousSphericalHarmonicCoefficients = this._sphericalHarmonicCoefficients; + this._previousSphericalHarmonicCoefficients = + this._sphericalHarmonicCoefficients; this._sphericalHarmonicCoefficients = value; }, }, @@ -356,15 +357,14 @@ function createSpecularEnvironmentCubeMap(imageBasedLighting, context) { if (defined(imageBasedLighting._specularEnvironmentMaps)) { const cubeMap = new SpecularEnvironmentCubeMap( - imageBasedLighting._specularEnvironmentMaps + imageBasedLighting._specularEnvironmentMaps, ); imageBasedLighting._specularEnvironmentCubeMap = cubeMap; - imageBasedLighting._removeErrorListener = cubeMap.errorEvent.addEventListener( - (error) => { + imageBasedLighting._removeErrorListener = + cubeMap.errorEvent.addEventListener((error) => { console.error(`Error loading specularEnvironmentMaps: ${error}`); - } - ); + }); } // Regenerate shaders so they do not use an environment map. @@ -396,7 +396,7 @@ ImageBasedLighting.prototype.update = function (frameState) { this._previousImageBasedLightingFactor = Cartesian2.clone( this._imageBasedLightingFactor, - this._previousImageBasedLightingFactor + this._previousImageBasedLightingFactor, ); } @@ -418,7 +418,8 @@ ImageBasedLighting.prototype.update = function (frameState) { defined(this._previousSphericalHarmonicCoefficients) !== defined(this._sphericalHarmonicCoefficients); - this._previousSphericalHarmonicCoefficients = this._sphericalHarmonicCoefficients; + this._previousSphericalHarmonicCoefficients = + this._sphericalHarmonicCoefficients; } this._shouldRegenerateShaders = @@ -426,7 +427,8 @@ ImageBasedLighting.prototype.update = function (frameState) { this._previousSpecularEnvironmentMapLoaded !== this._specularEnvironmentMapLoaded; - this._previousSpecularEnvironmentMapLoaded = this._specularEnvironmentMapLoaded; + this._previousSpecularEnvironmentMapLoaded = + this._specularEnvironmentMapLoaded; if (this._specularEnvironmentCubeMapDirty) { createSpecularEnvironmentCubeMap(this, context); diff --git a/packages/engine/Source/Scene/Imagery.js b/packages/engine/Source/Scene/Imagery.js index c7ed8fb4fd0c..c71c37261072 100644 --- a/packages/engine/Source/Scene/Imagery.js +++ b/packages/engine/Source/Scene/Imagery.js @@ -22,7 +22,7 @@ function Imagery(imageryLayer, x, y, level, rectangle) { this.parent = imageryLayer.getImageryFromCache( parentX, parentY, - parentLevel + parentLevel, ); } @@ -88,7 +88,7 @@ Imagery.prototype.releaseReference = function () { Imagery.prototype.processStateMachine = function ( frameState, needGeographicProjection, - skipLoading + skipLoading, ) { if (this.state === ImageryState.UNLOADED && !skipLoading) { this.state = ImageryState.TRANSITIONING; @@ -113,7 +113,7 @@ Imagery.prototype.processStateMachine = function ( this.imageryLayer._reprojectTexture( frameState, this, - needGeographicProjection + needGeographicProjection, ); } }; diff --git a/packages/engine/Source/Scene/ImageryLayer.js b/packages/engine/Source/Scene/ImageryLayer.js index a6579f3ee4e6..897686064402 100644 --- a/packages/engine/Source/Scene/ImageryLayer.js +++ b/packages/engine/Source/Scene/ImageryLayer.js @@ -174,7 +174,7 @@ function ImageryLayer(imageryProvider, options) { */ this.alpha = defaultValue( options.alpha, - defaultValue(imageryProvider._defaultAlpha, 1.0) + defaultValue(imageryProvider._defaultAlpha, 1.0), ); /** @@ -186,7 +186,7 @@ function ImageryLayer(imageryProvider, options) { */ this.nightAlpha = defaultValue( options.nightAlpha, - defaultValue(imageryProvider._defaultNightAlpha, 1.0) + defaultValue(imageryProvider._defaultNightAlpha, 1.0), ); /** @@ -198,7 +198,7 @@ function ImageryLayer(imageryProvider, options) { */ this.dayAlpha = defaultValue( options.dayAlpha, - defaultValue(imageryProvider._defaultDayAlpha, 1.0) + defaultValue(imageryProvider._defaultDayAlpha, 1.0), ); /** @@ -212,8 +212,8 @@ function ImageryLayer(imageryProvider, options) { options.brightness, defaultValue( imageryProvider._defaultBrightness, - ImageryLayer.DEFAULT_BRIGHTNESS - ) + ImageryLayer.DEFAULT_BRIGHTNESS, + ), ); /** @@ -227,8 +227,8 @@ function ImageryLayer(imageryProvider, options) { options.contrast, defaultValue( imageryProvider._defaultContrast, - ImageryLayer.DEFAULT_CONTRAST - ) + ImageryLayer.DEFAULT_CONTRAST, + ), ); /** @@ -239,7 +239,7 @@ function ImageryLayer(imageryProvider, options) { */ this.hue = defaultValue( options.hue, - defaultValue(imageryProvider._defaultHue, ImageryLayer.DEFAULT_HUE) + defaultValue(imageryProvider._defaultHue, ImageryLayer.DEFAULT_HUE), ); /** @@ -253,8 +253,8 @@ function ImageryLayer(imageryProvider, options) { options.saturation, defaultValue( imageryProvider._defaultSaturation, - ImageryLayer.DEFAULT_SATURATION - ) + ImageryLayer.DEFAULT_SATURATION, + ), ); /** @@ -265,7 +265,7 @@ function ImageryLayer(imageryProvider, options) { */ this.gamma = defaultValue( options.gamma, - defaultValue(imageryProvider._defaultGamma, ImageryLayer.DEFAULT_GAMMA) + defaultValue(imageryProvider._defaultGamma, ImageryLayer.DEFAULT_GAMMA), ); /** @@ -276,7 +276,7 @@ function ImageryLayer(imageryProvider, options) { */ this.splitDirection = defaultValue( options.splitDirection, - ImageryLayer.DEFAULT_SPLIT + ImageryLayer.DEFAULT_SPLIT, ); /** @@ -294,8 +294,8 @@ function ImageryLayer(imageryProvider, options) { options.minificationFilter, defaultValue( imageryProvider._defaultMinificationFilter, - ImageryLayer.DEFAULT_MINIFICATION_FILTER - ) + ImageryLayer.DEFAULT_MINIFICATION_FILTER, + ), ); /** @@ -313,8 +313,8 @@ function ImageryLayer(imageryProvider, options) { options.magnificationFilter, defaultValue( imageryProvider._defaultMagnificationFilter, - ImageryLayer.DEFAULT_MAGNIFICATION_FILTER - ) + ImageryLayer.DEFAULT_MAGNIFICATION_FILTER, + ), ); /** @@ -369,7 +369,7 @@ function ImageryLayer(imageryProvider, options) { */ this.colorToAlphaThreshold = defaultValue( options.colorToAlphaThreshold, - ImageryLayer.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD + ImageryLayer.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD, ); } @@ -610,7 +610,7 @@ ImageryLayer.fromWorldImagery = function (options) { createWorldImageryAsync({ style: options.style, }), - options + options, ); }; @@ -700,7 +700,7 @@ ImageryLayer.prototype.getImageryRectangle = function () { ImageryLayer.prototype._createTileImagerySkeletons = function ( tile, terrainProvider, - insertionPoint + insertionPoint, ) { const surfaceTile = tile.data; @@ -747,12 +747,12 @@ ImageryLayer.prototype._createTileImagerySkeletons = function ( const imageryBounds = Rectangle.intersection( imageryProvider.rectangle, this._rectangle, - imageryBoundsScratch + imageryBoundsScratch, ); let rectangle = Rectangle.intersection( tile.rectangle, imageryBounds, - tileImageryBoundsScratch + tileImageryBoundsScratch, ); if (!defined(rectangle)) { @@ -774,11 +774,11 @@ ImageryLayer.prototype._createTileImagerySkeletons = function ( } else { rectangle.south = Math.max( baseTerrainRectangle.south, - baseImageryRectangle.south + baseImageryRectangle.south, ); rectangle.north = Math.min( baseTerrainRectangle.north, - baseImageryRectangle.north + baseImageryRectangle.north, ); } @@ -789,11 +789,11 @@ ImageryLayer.prototype._createTileImagerySkeletons = function ( } else { rectangle.west = Math.max( baseTerrainRectangle.west, - baseImageryRectangle.west + baseImageryRectangle.west, ); rectangle.east = Math.min( baseTerrainRectangle.east, - baseImageryRectangle.east + baseImageryRectangle.east, ); } } @@ -815,7 +815,7 @@ ImageryLayer.prototype._createTileImagerySkeletons = function ( let imageryLevel = getLevelWithMaximumTexelSpacing( this, targetGeometricError, - latitudeClosestToEquator + latitudeClosestToEquator, ); imageryLevel = Math.max(0, imageryLevel); const maximumLevel = imageryProvider.maximumLevel; @@ -833,11 +833,11 @@ ImageryLayer.prototype._createTileImagerySkeletons = function ( const imageryTilingScheme = imageryProvider.tilingScheme; const northwestTileCoordinates = imageryTilingScheme.positionToTileXY( Rectangle.northwest(rectangle), - imageryLevel + imageryLevel, ); const southeastTileCoordinates = imageryTilingScheme.positionToTileXY( Rectangle.southeast(rectangle), - imageryLevel + imageryLevel, ); // If the southeast corner of the rectangle lies very close to the north or west side @@ -853,7 +853,7 @@ ImageryLayer.prototype._createTileImagerySkeletons = function ( const northwestTileRectangle = imageryTilingScheme.tileXYToRectangle( northwestTileCoordinates.x, northwestTileCoordinates.y, - imageryLevel + imageryLevel, ); if ( Math.abs(northwestTileRectangle.south - tile.rectangle.north) < @@ -872,7 +872,7 @@ ImageryLayer.prototype._createTileImagerySkeletons = function ( const southeastTileRectangle = imageryTilingScheme.tileXYToRectangle( southeastTileCoordinates.x, southeastTileCoordinates.y, - imageryLevel + imageryLevel, ); if ( Math.abs(southeastTileRectangle.north - tile.rectangle.south) < @@ -893,46 +893,44 @@ ImageryLayer.prototype._createTileImagerySkeletons = function ( const terrainRectangle = Rectangle.clone( tile.rectangle, - terrainRectangleScratch + terrainRectangleScratch, ); let imageryRectangle = imageryTilingScheme.tileXYToRectangle( northwestTileCoordinates.x, northwestTileCoordinates.y, - imageryLevel + imageryLevel, ); let clippedImageryRectangle = Rectangle.intersection( imageryRectangle, imageryBounds, - clippedRectangleScratch + clippedRectangleScratch, ); let imageryTileXYToRectangle; if (useWebMercatorT) { imageryTilingScheme.rectangleToNativeRectangle( terrainRectangle, - terrainRectangle + terrainRectangle, ); imageryTilingScheme.rectangleToNativeRectangle( imageryRectangle, - imageryRectangle + imageryRectangle, ); imageryTilingScheme.rectangleToNativeRectangle( clippedImageryRectangle, - clippedImageryRectangle + clippedImageryRectangle, ); imageryTilingScheme.rectangleToNativeRectangle( imageryBounds, - imageryBounds - ); - imageryTileXYToRectangle = imageryTilingScheme.tileXYToNativeRectangle.bind( - imageryTilingScheme + imageryBounds, ); + imageryTileXYToRectangle = + imageryTilingScheme.tileXYToNativeRectangle.bind(imageryTilingScheme); veryCloseX = terrainRectangle.width / 512.0; veryCloseY = terrainRectangle.height / 512.0; } else { - imageryTileXYToRectangle = imageryTilingScheme.tileXYToRectangle.bind( - imageryTilingScheme - ); + imageryTileXYToRectangle = + imageryTilingScheme.tileXYToRectangle.bind(imageryTilingScheme); } let minU; @@ -951,7 +949,7 @@ ImageryLayer.prototype._createTileImagerySkeletons = function ( maxU = Math.min( 1.0, (clippedImageryRectangle.west - terrainRectangle.west) / - terrainRectangle.width + terrainRectangle.width, ); } @@ -963,7 +961,7 @@ ImageryLayer.prototype._createTileImagerySkeletons = function ( minV = Math.max( 0.0, (clippedImageryRectangle.north - terrainRectangle.south) / - terrainRectangle.height + terrainRectangle.height, ); } @@ -979,12 +977,12 @@ ImageryLayer.prototype._createTileImagerySkeletons = function ( imageryRectangle = imageryTileXYToRectangle( i, northwestTileCoordinates.y, - imageryLevel + imageryLevel, ); clippedImageryRectangle = Rectangle.simpleIntersection( imageryRectangle, imageryBounds, - clippedRectangleScratch + clippedRectangleScratch, ); if (!defined(clippedImageryRectangle)) { @@ -994,7 +992,7 @@ ImageryLayer.prototype._createTileImagerySkeletons = function ( maxU = Math.min( 1.0, (clippedImageryRectangle.east - terrainRectangle.west) / - terrainRectangle.width + terrainRectangle.width, ); // If this is the eastern-most imagery tile mapped to this terrain tile, @@ -1023,7 +1021,7 @@ ImageryLayer.prototype._createTileImagerySkeletons = function ( clippedImageryRectangle = Rectangle.simpleIntersection( imageryRectangle, imageryBounds, - clippedRectangleScratch + clippedRectangleScratch, ); if (!defined(clippedImageryRectangle)) { @@ -1033,7 +1031,7 @@ ImageryLayer.prototype._createTileImagerySkeletons = function ( minV = Math.max( 0.0, (clippedImageryRectangle.south - terrainRectangle.south) / - terrainRectangle.height + terrainRectangle.height, ); // If this is the southern-most imagery tile mapped to this terrain tile, @@ -1054,7 +1052,7 @@ ImageryLayer.prototype._createTileImagerySkeletons = function ( surfaceTile.imagery.splice( insertionPoint, 0, - new TileImagery(imagery, texCoordsRectangle, useWebMercatorT) + new TileImagery(imagery, texCoordsRectangle, useWebMercatorT), ); ++insertionPoint; } @@ -1076,7 +1074,7 @@ ImageryLayer.prototype._createTileImagerySkeletons = function ( */ ImageryLayer.prototype._calculateTextureTranslationAndScale = function ( tile, - tileImagery + tileImagery, ) { let imageryRectangle = tileImagery.readyImagery.rectangle; let terrainRectangle = tile.rectangle; @@ -1086,11 +1084,11 @@ ImageryLayer.prototype._calculateTextureTranslationAndScale = function ( tileImagery.readyImagery.imageryLayer.imageryProvider.tilingScheme; imageryRectangle = tilingScheme.rectangleToNativeRectangle( imageryRectangle, - imageryBoundsScratch + imageryBoundsScratch, ); terrainRectangle = tilingScheme.rectangleToNativeRectangle( terrainRectangle, - terrainRectangleScratch + terrainRectangleScratch, ); } @@ -1104,7 +1102,7 @@ ImageryLayer.prototype._calculateTextureTranslationAndScale = function ( (scaleY * (terrainRectangle.south - imageryRectangle.south)) / terrainHeight, scaleX, - scaleY + scaleY, ); }; @@ -1155,7 +1153,7 @@ ImageryLayer.prototype._requestImagery = function (imagery) { imagery.x, imagery.y, imagery.level, - e + e, ); if (that._requestImageError.retry) { doRequest(); @@ -1174,7 +1172,7 @@ ImageryLayer.prototype._requestImagery = function (imagery) { imagery.x, imagery.y, imagery.level, - request + request, ); if (!defined(imagePromise)) { @@ -1188,7 +1186,7 @@ ImageryLayer.prototype._requestImagery = function (imagery) { imagery.credits = imageryProvider.getTileCredits( imagery.x, imagery.y, - imagery.level + imagery.level, ); } @@ -1272,7 +1270,7 @@ ImageryLayer.prototype._createTexture = function (context, imagery) { this.minificationFilter !== TextureMinificationFilter.LINEAR ) { throw new DeveloperError( - "ImageryLayer minification filter must be NEAREST or LINEAR" + "ImageryLayer minification filter must be NEAREST or LINEAR", ); } //>>includeEnd('debug'); @@ -1294,7 +1292,7 @@ ImageryLayer.prototype._createTexture = function (context, imagery) { function getSamplerKey( minificationFilter, magnificationFilter, - maximumAnisotropy + maximumAnisotropy, ) { return `${minificationFilter}:${magnificationFilter}:${maximumAnisotropy}`; } @@ -1318,12 +1316,12 @@ ImageryLayer.prototype._finalizeReprojectTexture = function (context, texture) { ContextLimits.maximumTextureFilterAnisotropy; const maximumAnisotropy = Math.min( maximumSupportedAnisotropy, - defaultValue(this._maximumAnisotropy, maximumSupportedAnisotropy) + defaultValue(this._maximumAnisotropy, maximumSupportedAnisotropy), ); const mipmapSamplerKey = getSamplerKey( minificationFilter, magnificationFilter, - maximumAnisotropy + maximumAnisotropy, ); let mipmapSamplers = context.cache.imageryLayerMipmapSamplers; if (!defined(mipmapSamplers)) { @@ -1346,7 +1344,7 @@ ImageryLayer.prototype._finalizeReprojectTexture = function (context, texture) { const nonMipmapSamplerKey = getSamplerKey( minificationFilter, magnificationFilter, - 0 + 0, ); let nonMipmapSamplers = context.cache.imageryLayerNonMipmapSamplers; if (!defined(nonMipmapSamplers)) { @@ -1379,7 +1377,7 @@ ImageryLayer.prototype._finalizeReprojectTexture = function (context, texture) { ImageryLayer.prototype._reprojectTexture = function ( frameState, imagery, - needGeographicProjection + needGeographicProjection, ) { const texture = imagery.textureWebMercator || imagery.texture; const rectangle = imagery.rectangle; @@ -1464,7 +1462,7 @@ ImageryLayer.prototype.getImageryFromCache = function ( x, y, level, - imageryRectangle + imageryRectangle, ) { const cacheKey = getImageryCacheKey(x, y, level); let imagery = this._imageryCache[cacheKey]; @@ -1698,7 +1696,7 @@ function reprojectToGeographic(command, context, texture, rectangle) { function getLevelWithMaximumTexelSpacing( layer, texelSpacing, - latitudeClosestToEquator + latitudeClosestToEquator, ) { // PERFORMANCE_IDEA: factor out the stuff that doesn't change. const imageryProvider = layer._imageryProvider; diff --git a/packages/engine/Source/Scene/ImageryLayerCollection.js b/packages/engine/Source/Scene/ImageryLayerCollection.js index bb3604729695..3c2769810b2c 100644 --- a/packages/engine/Source/Scene/ImageryLayerCollection.js +++ b/packages/engine/Source/Scene/ImageryLayerCollection.js @@ -97,7 +97,7 @@ ImageryLayerCollection.prototype.add = function (layer, index) { throw new DeveloperError("index must be greater than or equal to zero."); } else if (index > this._layers.length) { throw new DeveloperError( - "index must be less than or equal to the number of layers." + "index must be less than or equal to the number of layers.", ); } } @@ -136,7 +136,7 @@ ImageryLayerCollection.prototype.add = function (layer, index) { */ ImageryLayerCollection.prototype.addImageryProvider = function ( imageryProvider, - index + index, ) { //>>includeStart('debug', pragmas.debug); if (!defined(imageryProvider)) { @@ -393,22 +393,22 @@ function pickImageryHelper(scene, pickedLocation, pickFeatures, callback) { applicableRectangle.west = CesiumMath.lerp( pickedTile.rectangle.west, pickedTile.rectangle.east, - terrainImagery.textureCoordinateRectangle.x - epsilon + terrainImagery.textureCoordinateRectangle.x - epsilon, ); applicableRectangle.east = CesiumMath.lerp( pickedTile.rectangle.west, pickedTile.rectangle.east, - terrainImagery.textureCoordinateRectangle.z + epsilon + terrainImagery.textureCoordinateRectangle.z + epsilon, ); applicableRectangle.south = CesiumMath.lerp( pickedTile.rectangle.south, pickedTile.rectangle.north, - terrainImagery.textureCoordinateRectangle.y - epsilon + terrainImagery.textureCoordinateRectangle.y - epsilon, ); applicableRectangle.north = CesiumMath.lerp( pickedTile.rectangle.south, pickedTile.rectangle.north, - terrainImagery.textureCoordinateRectangle.w + epsilon + terrainImagery.textureCoordinateRectangle.w + epsilon, ); if (!Rectangle.contains(applicableRectangle, pickedLocation)) { continue; @@ -436,9 +436,8 @@ ImageryLayerCollection.prototype.pickImageryLayers = function (ray, scene) { return; } - const pickedLocation = scene.ellipsoid.cartesianToCartographic( - pickedPosition - ); + const pickedLocation = + scene.ellipsoid.cartesianToCartographic(pickedPosition); const imageryLayers = []; @@ -483,7 +482,7 @@ ImageryLayerCollection.prototype.pickImageryLayers = function (ray, scene) { */ ImageryLayerCollection.prototype.pickImageryLayerFeatures = function ( ray, - scene + scene, ) { // Find the picked location on the globe. const pickedPosition = scene.globe.pick(ray, scene); @@ -491,9 +490,8 @@ ImageryLayerCollection.prototype.pickImageryLayerFeatures = function ( return; } - const pickedLocation = scene.ellipsoid.cartesianToCartographic( - pickedPosition - ); + const pickedLocation = + scene.ellipsoid.cartesianToCartographic(pickedPosition); const promises = []; const imageryLayers = []; @@ -508,7 +506,7 @@ ImageryLayerCollection.prototype.pickImageryLayerFeatures = function ( imagery.y, imagery.level, pickedLocation.longitude, - pickedLocation.latitude + pickedLocation.latitude, ); if (defined(promise)) { promises.push(promise); @@ -552,7 +550,7 @@ ImageryLayerCollection.prototype.pickImageryLayerFeatures = function ( * @param {FrameState} frameState The frameState. */ ImageryLayerCollection.prototype.queueReprojectionCommands = function ( - frameState + frameState, ) { const layers = this._layers; for (let i = 0, len = layers.length; i < len; ++i) { diff --git a/packages/engine/Source/Scene/ImageryLayerFeatureInfo.js b/packages/engine/Source/Scene/ImageryLayerFeatureInfo.js index 0ce99360f846..99980d2ab054 100644 --- a/packages/engine/Source/Scene/ImageryLayerFeatureInfo.js +++ b/packages/engine/Source/Scene/ImageryLayerFeatureInfo.js @@ -50,7 +50,7 @@ function ImageryLayerFeatureInfo() { * @param {object} properties An object literal containing the properties of the feature. */ ImageryLayerFeatureInfo.prototype.configureNameFromProperties = function ( - properties + properties, ) { let namePropertyPrecedence = 10; let nameProperty; @@ -85,28 +85,27 @@ ImageryLayerFeatureInfo.prototype.configureNameFromProperties = function ( * * @param {object} properties An object literal containing the properties of the feature. */ -ImageryLayerFeatureInfo.prototype.configureDescriptionFromProperties = function ( - properties -) { - function describe(properties) { - let html = '<table class="cesium-infoBox-defaultTable">'; - for (const key in properties) { - if (properties.hasOwnProperty(key)) { - const value = properties[key]; - if (defined(value)) { - if (typeof value === "object") { - html += `<tr><td>${key}</td><td>${describe(value)}</td></tr>`; - } else { - html += `<tr><td>${key}</td><td>${value}</td></tr>`; +ImageryLayerFeatureInfo.prototype.configureDescriptionFromProperties = + function (properties) { + function describe(properties) { + let html = '<table class="cesium-infoBox-defaultTable">'; + for (const key in properties) { + if (properties.hasOwnProperty(key)) { + const value = properties[key]; + if (defined(value)) { + if (typeof value === "object") { + html += `<tr><td>${key}</td><td>${describe(value)}</td></tr>`; + } else { + html += `<tr><td>${key}</td><td>${value}</td></tr>`; + } } } } - } - html += "</table>"; + html += "</table>"; - return html; - } + return html; + } - this.description = describe(properties); -}; + this.description = describe(properties); + }; export default ImageryLayerFeatureInfo; diff --git a/packages/engine/Source/Scene/ImageryProvider.js b/packages/engine/Source/Scene/ImageryProvider.js index 0169ffdf0d44..0a5d626732aa 100644 --- a/packages/engine/Source/Scene/ImageryProvider.js +++ b/packages/engine/Source/Scene/ImageryProvider.js @@ -220,7 +220,7 @@ ImageryProvider.prototype.pickFeatures = function ( y, level, longitude, - latitude + latitude, ) { DeveloperError.throwInstantiationError(); }; diff --git a/packages/engine/Source/Scene/Implicit3DTileContent.js b/packages/engine/Source/Scene/Implicit3DTileContent.js index 96eebae51c1d..9cd00a69a94b 100644 --- a/packages/engine/Source/Scene/Implicit3DTileContent.js +++ b/packages/engine/Source/Scene/Implicit3DTileContent.js @@ -68,7 +68,7 @@ function Implicit3DTileContent(tileset, tile, resource) { const subtreeResource = implicitTileset.subtreeUriTemplate.getDerivedResource( { templateValues: templateValues, - } + }, ); this._url = subtreeResource.getUrlComponent(true); @@ -206,7 +206,7 @@ Implicit3DTileContent.fromSubtreeJson = async function ( resource, json, arrayBuffer, - byteOffset + byteOffset, ) { //>>includeStart('debug', pragmas.debug); Check.defined("tile.implicitTileset", tile.implicitTileset); @@ -230,7 +230,7 @@ Implicit3DTileContent.fromSubtreeJson = async function ( json, uint8Array, implicitTileset, - implicitCoordinates + implicitCoordinates, ); const content = new Implicit3DTileContent(tileset, tile, resource); @@ -261,7 +261,7 @@ function expandSubtree(content, subtree) { content, subtree, placeholderTile, - childIndex + childIndex, ); const statistics = content._tileset.statistics; @@ -278,7 +278,7 @@ function expandSubtree(content, subtree) { const implicitChildTile = makePlaceholderChildSubtree( content, leafTile, - subtreeLocator.childIndex + subtreeLocator.childIndex, ); leafTile.children.push(implicitChildTile); statistics.numberOfTilesTotal++; @@ -356,7 +356,7 @@ function transcodeSubtreeTiles(content, subtree, placeholderTile, childIndex) { placeholderTile, childIndex, rootBitIndex, - rootParentIsPlaceholder + rootParentIsPlaceholder, ); const statistics = content._tileset.statistics; @@ -392,7 +392,7 @@ function transcodeSubtreeTiles(content, subtree, placeholderTile, childIndex) { subtree, parentTile, childChildIndex, - childBitIndex + childBitIndex, ); parentTile.children.push(childTile); statistics.numberOfTilesTotal++; @@ -445,16 +445,15 @@ function deriveChildTile( parentTile, childIndex, childBitIndex, - parentIsPlaceholderTile + parentIsPlaceholderTile, ) { const implicitTileset = implicitContent._implicitTileset; let implicitCoordinates; if (defaultValue(parentIsPlaceholderTile, false)) { implicitCoordinates = parentTile.implicitCoordinates; } else { - implicitCoordinates = parentTile.implicitCoordinates.getChildCoordinates( - childIndex - ); + implicitCoordinates = + parentTile.implicitCoordinates.getChildCoordinates(childIndex); } // Parse metadata and bounding volume semantics at the beginning @@ -465,9 +464,8 @@ function deriveChildTile( if (defined(subtree.tilePropertyTableJson)) { tileMetadata = subtree.getTileMetadataView(implicitCoordinates); - const boundingVolumeSemantics = BoundingVolumeSemantics.parseAllBoundingVolumeSemantics( - tileMetadata - ); + const boundingVolumeSemantics = + BoundingVolumeSemantics.parseAllBoundingVolumeSemantics(tileMetadata); tileBounds = boundingVolumeSemantics.tile; contentBounds = boundingVolumeSemantics.content; } @@ -489,7 +487,7 @@ function deriveChildTile( childIndex, parentIsPlaceholderTile, parentTile, - tileBounds + tileBounds, ); const contentJsons = []; @@ -507,7 +505,7 @@ function deriveChildTile( const contentBoundingVolume = getContentBoundingVolume( boundingVolume, - contentBounds + contentBounds, ); if (defined(contentBoundingVolume)) { @@ -522,7 +520,7 @@ function deriveChildTile( const childGeometricError = getGeometricError( tileMetadata, implicitTileset, - implicitCoordinates + implicitCoordinates, ); const tileJson = { @@ -557,7 +555,7 @@ function deriveChildTile( implicitContent, implicitTileset.baseResource, combinedTileJson, - parentTile + parentTile, ); childTile.implicitCoordinates = implicitCoordinates; @@ -613,13 +611,13 @@ function updateHeights(boundingVolume, tileBounds) { updateS2CellHeights( boundingVolume.extensions["3DTILES_bounding_volume_S2"], tileBounds.minimumHeight, - tileBounds.maximumHeight + tileBounds.maximumHeight, ); } else if (defined(boundingVolume.region)) { updateRegionHeights( boundingVolume.region, tileBounds.minimumHeight, - tileBounds.maximumHeight + tileBounds.maximumHeight, ); } } @@ -706,7 +704,7 @@ function getTileBoundingVolume( childIndex, parentIsPlaceholderTile, parentTile, - tileBounds + tileBounds, ) { let boundingVolume; @@ -721,7 +719,7 @@ function getTileBoundingVolume( implicitCoordinates, childIndex, defaultValue(parentIsPlaceholderTile, false), - parentTile + parentTile, ); } else { boundingVolume = tileBounds.boundingVolume; @@ -794,7 +792,7 @@ function deriveBoundingVolume( implicitCoordinates, childIndex, parentIsPlaceholderTile, - parentTile + parentTile, ) { const rootBoundingVolume = implicitTileset.boundingVolume; @@ -806,7 +804,7 @@ function deriveBoundingVolume( implicitCoordinates.level, implicitCoordinates.x, implicitCoordinates.y, - implicitCoordinates.z + implicitCoordinates.z, ); } @@ -816,7 +814,7 @@ function deriveBoundingVolume( implicitCoordinates.level, implicitCoordinates.x, implicitCoordinates.y, - implicitCoordinates.z + implicitCoordinates.z, ); return { @@ -829,7 +827,7 @@ function deriveBoundingVolume( implicitCoordinates.level, implicitCoordinates.x, implicitCoordinates.y, - implicitCoordinates.z + implicitCoordinates.z, ); return { @@ -865,7 +863,7 @@ function deriveBoundingVolumeS2( level, x, y, - z + z, ) { //>>includeStart('debug', pragmas.debug); Check.typeOf.bool("parentIsPlaceholderTile", parentIsPlaceholderTile); @@ -984,7 +982,7 @@ function deriveBoundingBox(rootBox, level, x, y, z) { tileScale, tileScale, 1, - scratchScaleFactors + scratchScaleFactors, ); if (defined(z)) { @@ -996,7 +994,7 @@ function deriveBoundingBox(rootBox, level, x, y, z) { modelSpaceX, modelSpaceY, modelSpaceZ, - scratchCenter + scratchCenter, ); center = Matrix3.multiplyByVector(rootHalfAxes, center, scratchCenter); center = Cartesian3.add(center, rootCenter, scratchCenter); @@ -1086,16 +1084,15 @@ function deriveBoundingRegion(rootRegion, level, x, y, z) { */ function makePlaceholderChildSubtree(content, parentTile, childIndex) { const implicitTileset = content._implicitTileset; - const implicitCoordinates = parentTile.implicitCoordinates.getChildCoordinates( - childIndex - ); + const implicitCoordinates = + parentTile.implicitCoordinates.getChildCoordinates(childIndex); const childBoundingVolume = deriveBoundingVolume( implicitTileset, implicitCoordinates, childIndex, false, - parentTile + parentTile, ); // Ignore tile metadata when computing geometric error for the placeholder tile @@ -1104,13 +1101,13 @@ function makePlaceholderChildSubtree(content, parentTile, childIndex) { const childGeometricError = getGeometricError( undefined, implicitTileset, - implicitCoordinates + implicitCoordinates, ); const childContentUri = implicitTileset.subtreeUriTemplate.getDerivedResource( { templateValues: implicitCoordinates.getTemplateValues(), - } + }, ).url; const tileJson = { boundingVolume: childBoundingVolume, @@ -1127,7 +1124,7 @@ function makePlaceholderChildSubtree(content, parentTile, childIndex) { content, implicitTileset.baseResource, tileJson, - parentTile + parentTile, ); tile.implicitTileset = implicitTileset; tile.implicitCoordinates = implicitCoordinates; @@ -1170,7 +1167,7 @@ Implicit3DTileContent.prototype.getFeature = function (batchId) { Implicit3DTileContent.prototype.applyDebugSettings = function ( enabled, - color + color, ) {}; Implicit3DTileContent.prototype.applyStyle = function (style) {}; diff --git a/packages/engine/Source/Scene/ImplicitAvailabilityBitstream.js b/packages/engine/Source/Scene/ImplicitAvailabilityBitstream.js index 9c664f9a5259..c9af8ca5c6ae 100644 --- a/packages/engine/Source/Scene/ImplicitAvailabilityBitstream.js +++ b/packages/engine/Source/Scene/ImplicitAvailabilityBitstream.js @@ -38,7 +38,7 @@ function ImplicitAvailabilityBitstream(options) { const expectedLength = Math.ceil(lengthBits / 8); if (bitstream.length !== expectedLength) { throw new RuntimeError( - `Availability bitstream must be exactly ${expectedLength} bytes long to store ${lengthBits} bits. Actual bitstream was ${bitstream.length} bytes long.` + `Availability bitstream must be exactly ${expectedLength} bytes long to store ${lengthBits} bits. Actual bitstream was ${bitstream.length} bytes long.`, ); } @@ -46,7 +46,7 @@ function ImplicitAvailabilityBitstream(options) { // over the bitstream. const computeAvailableCountEnabled = defaultValue( options.computeAvailableCountEnabled, - false + false, ); if (!defined(availableCount) && computeAvailableCountEnabled) { availableCount = count1Bits(bitstream, lengthBits); diff --git a/packages/engine/Source/Scene/ImplicitMetadataView.js b/packages/engine/Source/Scene/ImplicitMetadataView.js index d00801aee969..98e8456fab24 100644 --- a/packages/engine/Source/Scene/ImplicitMetadataView.js +++ b/packages/engine/Source/Scene/ImplicitMetadataView.js @@ -166,12 +166,12 @@ ImplicitMetadataView.prototype.getPropertyBySemantic = function (semantic) { ImplicitMetadataView.prototype.setPropertyBySemantic = function ( semantic, - value + value, ) { return this._metadataTable.setPropertyBySemantic( this._entityId, semantic, - value + value, ); }; diff --git a/packages/engine/Source/Scene/ImplicitSubtree.js b/packages/engine/Source/Scene/ImplicitSubtree.js index 97133ffa17db..d59d4516e34a 100644 --- a/packages/engine/Source/Scene/ImplicitSubtree.js +++ b/packages/engine/Source/Scene/ImplicitSubtree.js @@ -189,7 +189,7 @@ ImplicitSubtree.prototype.tileIsAvailableAtIndex = function (index) { * @private */ ImplicitSubtree.prototype.tileIsAvailableAtCoordinates = function ( - implicitCoordinates + implicitCoordinates, ) { const index = this.getTileIndex(implicitCoordinates); return this.tileIsAvailableAtIndex(index); @@ -205,7 +205,7 @@ ImplicitSubtree.prototype.tileIsAvailableAtCoordinates = function ( */ ImplicitSubtree.prototype.contentIsAvailableAtIndex = function ( index, - contentIndex + contentIndex, ) { contentIndex = defaultValue(contentIndex, 0); //>>includeStart('debug', pragmas.debug); @@ -230,7 +230,7 @@ ImplicitSubtree.prototype.contentIsAvailableAtIndex = function ( */ ImplicitSubtree.prototype.contentIsAvailableAtCoordinates = function ( implicitCoordinates, - contentIndex + contentIndex, ) { const index = this.getTileIndex(implicitCoordinates); return this.contentIsAvailableAtIndex(index, contentIndex); @@ -255,7 +255,7 @@ ImplicitSubtree.prototype.childSubtreeIsAvailableAtIndex = function (index) { * @private */ ImplicitSubtree.prototype.childSubtreeIsAvailableAtCoordinates = function ( - implicitCoordinates + implicitCoordinates, ) { const index = this.getChildSubtreeIndex(implicitCoordinates); return this.childSubtreeIsAvailableAtIndex(index); @@ -316,7 +316,7 @@ ImplicitSubtree.fromSubtreeJson = async function ( json, subtreeView, implicitTileset, - implicitCoordinates + implicitCoordinates, ) { //>>includeStart('debug', pragmas.debug); Check.typeOf.object("resource", resource); @@ -330,7 +330,7 @@ ImplicitSubtree.fromSubtreeJson = async function ( const subtree = new ImplicitSubtree( resource, implicitTileset, - implicitCoordinates + implicitCoordinates, ); let chunks; @@ -360,7 +360,7 @@ ImplicitSubtree.fromSubtreeJson = async function ( for (let i = 0; i < length; i++) { const propertyTableIndex = subtreeJson.contentMetadata[i]; contentPropertyTableJsons.push( - subtreeJson.propertyTables[propertyTableIndex] + subtreeJson.propertyTables[propertyTableIndex], ); } } @@ -401,14 +401,14 @@ ImplicitSubtree.fromSubtreeJson = async function ( subtreeJson.contentAvailabilityHeaders = subtreeJson.contentAvailability; } else { subtreeJson.contentAvailabilityHeaders.push( - defaultValue(subtreeJson.contentAvailability, defaultContentAvailability) + defaultValue(subtreeJson.contentAvailability, defaultContentAvailability), ); } const bufferHeaders = preprocessBuffers(subtreeJson.buffers); const bufferViewHeaders = preprocessBufferViews( subtreeJson.bufferViews, - bufferHeaders + bufferHeaders, ); // Buffers and buffer views are inactive until explicitly marked active. @@ -426,7 +426,7 @@ ImplicitSubtree.fromSubtreeJson = async function ( const buffersU8 = await requestActiveBuffers( subtree, bufferHeaders, - chunks.binary + chunks.binary, ); const bufferViewsU8 = parseActiveBufferViews(bufferViewHeaders, buffersU8); parseAvailability(subtree, subtreeJson, implicitTileset, bufferViewsU8); @@ -464,7 +464,7 @@ function parseSubtreeChunks(subtreeView) { const littleEndian = true; const subtreeReader = new DataView( subtreeView.buffer, - subtreeView.byteOffset + subtreeView.byteOffset, ); // Skip to the chunk lengths let byteOffset = 8; @@ -480,12 +480,12 @@ function parseSubtreeChunks(subtreeView) { const subtreeJson = getJsonFromTypedArray( subtreeView, byteOffset, - jsonByteLength + jsonByteLength, ); byteOffset += jsonByteLength; const subtreeBinary = subtreeView.subarray( byteOffset, - byteOffset + binaryByteLength + byteOffset + binaryByteLength, ); return { @@ -646,7 +646,7 @@ function markActiveMetadataBufferViews(propertyTableJson, bufferViewHeaders) { // An older spec used bufferView const valuesBufferView = defaultValue( metadataHeader.values, - metadataHeader.bufferView + metadataHeader.bufferView, ); header = bufferViewHeaders[valuesBufferView]; header.isActive = true; @@ -655,7 +655,7 @@ function markActiveMetadataBufferViews(propertyTableJson, bufferViewHeaders) { // An older spec used stringOffsetBufferView const stringOffsetBufferView = defaultValue( metadataHeader.stringOffsets, - metadataHeader.stringOffsetBufferView + metadataHeader.stringOffsetBufferView, ); if (defined(stringOffsetBufferView)) { header = bufferViewHeaders[stringOffsetBufferView]; @@ -666,7 +666,7 @@ function markActiveMetadataBufferViews(propertyTableJson, bufferViewHeaders) { // an older spec used arrayOffsetBufferView const arrayOffsetBufferView = defaultValue( metadataHeader.arrayOffsets, - metadataHeader.arrayOffsetBufferView + metadataHeader.arrayOffsetBufferView, ); if (defined(arrayOffsetBufferView)) { header = bufferViewHeaders[arrayOffsetBufferView]; @@ -785,7 +785,7 @@ function parseAvailability( subtree, subtreeJson, implicitTileset, - bufferViewsU8 + bufferViewsU8, ) { const branchingFactor = implicitTileset.branchingFactor; const subtreeLevels = implicitTileset.subtreeLevels; @@ -803,7 +803,7 @@ function parseAvailability( subtreeJson.tileAvailability, bufferViewsU8, tileAvailabilityBits, - computeAvailableCountEnabled + computeAvailableCountEnabled, ); const hasContentMetadata = subtree._contentPropertyTableJsons.length > 0; @@ -816,7 +816,7 @@ function parseAvailability( bufferViewsU8, // content availability has the same length as tile availability. tileAvailabilityBits, - computeAvailableCountEnabled + computeAvailableCountEnabled, ); subtree._contentAvailabilityBitstreams.push(bitstream); } @@ -824,7 +824,7 @@ function parseAvailability( subtree._childSubtreeAvailability = parseAvailabilityBitstream( subtreeJson.childSubtreeAvailability, bufferViewsU8, - childSubtreeBits + childSubtreeBits, ); } @@ -844,7 +844,7 @@ function parseAvailabilityBitstream( availabilityJson, bufferViewsU8, lengthBits, - computeAvailableCountEnabled + computeAvailableCountEnabled, ) { if (defined(availabilityJson.constant)) { return new ImplicitAvailabilityBitstream({ @@ -1011,9 +1011,8 @@ ImplicitSubtree.prototype.getTileIndex = function (implicitCoordinates) { } const subtreeCoordinates = implicitCoordinates.getSubtreeCoordinates(); - const offsetCoordinates = subtreeCoordinates.getOffsetCoordinates( - implicitCoordinates - ); + const offsetCoordinates = + subtreeCoordinates.getOffsetCoordinates(implicitCoordinates); const index = offsetCoordinates.tileIndex; return index; }; @@ -1026,7 +1025,7 @@ ImplicitSubtree.prototype.getTileIndex = function (implicitCoordinates) { * @private */ ImplicitSubtree.prototype.getChildSubtreeIndex = function ( - implicitCoordinates + implicitCoordinates, ) { const localLevel = implicitCoordinates.level - this._implicitCoordinates.level; @@ -1037,10 +1036,10 @@ ImplicitSubtree.prototype.getChildSubtreeIndex = function ( // Call getParentSubtreeCoordinates instead of getSubtreeCoordinates because the // child subtree is by definition the root of its own subtree, so we need to find // the parent subtree. - const parentSubtreeCoordinates = implicitCoordinates.getParentSubtreeCoordinates(); - const offsetCoordinates = parentSubtreeCoordinates.getOffsetCoordinates( - implicitCoordinates - ); + const parentSubtreeCoordinates = + implicitCoordinates.getParentSubtreeCoordinates(); + const offsetCoordinates = + parentSubtreeCoordinates.getOffsetCoordinates(implicitCoordinates); const index = offsetCoordinates.mortonIndex; return index; }; @@ -1128,7 +1127,7 @@ ImplicitSubtree.prototype.getTileMetadataView = function (implicitCoordinates) { */ ImplicitSubtree.prototype.getContentMetadataView = function ( implicitCoordinates, - contentIndex + contentIndex, ) { const entityId = getContentEntityId(this, implicitCoordinates, contentIndex); if (!defined(entityId)) { diff --git a/packages/engine/Source/Scene/ImplicitSubtreeCache.js b/packages/engine/Source/Scene/ImplicitSubtreeCache.js index 252594d37bb8..584cf6f362da 100644 --- a/packages/engine/Source/Scene/ImplicitSubtreeCache.js +++ b/packages/engine/Source/Scene/ImplicitSubtreeCache.js @@ -42,7 +42,7 @@ function ImplicitSubtreeCache(options) { ImplicitSubtreeCache.prototype.addSubtree = function (subtree) { const cacheNode = new ImplicitSubtreeCacheNode( subtree, - this._subtreeRequestCounter + this._subtreeRequestCounter, ); this._subtreeRequestCounter++; this._queue.insert(cacheNode); diff --git a/packages/engine/Source/Scene/ImplicitSubtreeMetadata.js b/packages/engine/Source/Scene/ImplicitSubtreeMetadata.js index 7814babf3cbc..887eea3d88a2 100644 --- a/packages/engine/Source/Scene/ImplicitSubtreeMetadata.js +++ b/packages/engine/Source/Scene/ImplicitSubtreeMetadata.js @@ -104,7 +104,7 @@ ImplicitSubtreeMetadata.prototype.hasPropertyBySemantic = function (semantic) { return MetadataEntity.hasPropertyBySemantic( semantic, this._properties, - this._class + this._class, ); }; @@ -149,7 +149,7 @@ ImplicitSubtreeMetadata.prototype.setProperty = function (propertyId, value) { propertyId, value, this._properties, - this._class + this._class, ); }; @@ -164,7 +164,7 @@ ImplicitSubtreeMetadata.prototype.getPropertyBySemantic = function (semantic) { return MetadataEntity.getPropertyBySemantic( semantic, this._properties, - this._class + this._class, ); }; @@ -178,13 +178,13 @@ ImplicitSubtreeMetadata.prototype.getPropertyBySemantic = function (semantic) { */ ImplicitSubtreeMetadata.prototype.setPropertyBySemantic = function ( semantic, - value + value, ) { return MetadataEntity.setPropertyBySemantic( semantic, value, this._properties, - this._class + this._class, ); }; diff --git a/packages/engine/Source/Scene/ImplicitTileCoordinates.js b/packages/engine/Source/Scene/ImplicitTileCoordinates.js index efcc652fe3d4..44376c2ab311 100644 --- a/packages/engine/Source/Scene/ImplicitTileCoordinates.js +++ b/packages/engine/Source/Scene/ImplicitTileCoordinates.js @@ -238,7 +238,7 @@ function checkMatchingSubtreeShape(a, b) { * @private */ ImplicitTileCoordinates.prototype.getDescendantCoordinates = function ( - offsetCoordinates + offsetCoordinates, ) { //>>includeStart('debug', pragmas.debug); Check.typeOf.object("offsetCoordinates", offsetCoordinates); @@ -281,7 +281,7 @@ ImplicitTileCoordinates.prototype.getDescendantCoordinates = function ( * @private */ ImplicitTileCoordinates.prototype.getAncestorCoordinates = function ( - offsetLevels + offsetLevels, ) { //>>includeStart('debug', pragmas.debug); Check.typeOf.number("offsetLevels", offsetLevels); @@ -328,7 +328,7 @@ ImplicitTileCoordinates.prototype.getAncestorCoordinates = function ( * @returns {ImplicitTileCoordinates} The offset between the ancestor and the descendant */ ImplicitTileCoordinates.prototype.getOffsetCoordinates = function ( - descendantCoordinates + descendantCoordinates, ) { //>>includeStart('debug', pragmas.debug); Check.typeOf.object("descendantCoordinates", descendantCoordinates); @@ -382,11 +382,11 @@ ImplicitTileCoordinates.prototype.getChildCoordinates = function (childIndex) { //>>includeStart('debug', pragmas.debug); Check.typeOf.number("childIndex", childIndex); const branchingFactor = ImplicitSubdivisionScheme.getBranchingFactor( - this.subdivisionScheme + this.subdivisionScheme, ); if (childIndex < 0 || branchingFactor <= childIndex) { throw new DeveloperError( - `childIndex must be at least 0 and less than ${branchingFactor}` + `childIndex must be at least 0 and less than ${branchingFactor}`, ); } //>>includeEnd('debug'); @@ -436,7 +436,7 @@ ImplicitTileCoordinates.prototype.getSubtreeCoordinates = function () { */ ImplicitTileCoordinates.prototype.getParentSubtreeCoordinates = function () { return this.getAncestorCoordinates( - (this.level % this.subtreeLevels) + this.subtreeLevels + (this.level % this.subtreeLevels) + this.subtreeLevels, ); }; @@ -448,7 +448,7 @@ ImplicitTileCoordinates.prototype.getParentSubtreeCoordinates = function () { * @private */ ImplicitTileCoordinates.prototype.isAncestor = function ( - descendantCoordinates + descendantCoordinates, ) { //>>includeStart('debug', pragmas.debug); Check.typeOf.object("descendantCoordinates", descendantCoordinates); @@ -565,13 +565,13 @@ ImplicitTileCoordinates.fromMortonIndex = function ( subdivisionScheme, subtreeLevels, level, - mortonIndex + mortonIndex, ) { let coordinatesArray; if (subdivisionScheme === ImplicitSubdivisionScheme.OCTREE) { coordinatesArray = MortonOrder.decode3D( mortonIndex, - scratchCoordinatesArray + scratchCoordinatesArray, ); return new ImplicitTileCoordinates({ subdivisionScheme: subdivisionScheme, @@ -606,7 +606,7 @@ ImplicitTileCoordinates.fromMortonIndex = function ( ImplicitTileCoordinates.fromTileIndex = function ( subdivisionScheme, subtreeLevels, - tileIndex + tileIndex, ) { let level; let levelOffset; @@ -640,7 +640,7 @@ ImplicitTileCoordinates.fromTileIndex = function ( subdivisionScheme, subtreeLevels, level, - mortonIndex + mortonIndex, ); }; diff --git a/packages/engine/Source/Scene/ImplicitTileset.js b/packages/engine/Source/Scene/ImplicitTileset.js index ce2e1fa187ef..e34f56b9c1e6 100644 --- a/packages/engine/Source/Scene/ImplicitTileset.js +++ b/packages/engine/Source/Scene/ImplicitTileset.js @@ -73,7 +73,7 @@ function ImplicitTileset(baseResource, tileJson, metadataSchema) { !hasExtension(boundingVolume, "3DTILES_bounding_volume_cylinder") ) { throw new RuntimeError( - "Only box, region, 3DTILES_bounding_volume_S2, and 3DTILES_bounding_volume_cylinder are supported for implicit tiling" + "Only box, region, 3DTILES_bounding_volume_S2, and 3DTILES_bounding_volume_cylinder are supported for implicit tiling", ); } @@ -190,7 +190,7 @@ function ImplicitTileset(baseResource, tileJson, metadataSchema) { * @private */ this.branchingFactor = ImplicitSubdivisionScheme.getBranchingFactor( - this.subdivisionScheme + this.subdivisionScheme, ); /** diff --git a/packages/engine/Source/Scene/InvertClassification.js b/packages/engine/Source/Scene/InvertClassification.js index 92922920a8ec..b8d7da84e455 100644 --- a/packages/engine/Source/Scene/InvertClassification.js +++ b/packages/engine/Source/Scene/InvertClassification.js @@ -175,7 +175,7 @@ const opaqueFS = InvertClassification.prototype.update = function ( context, numSamples, - globeFramebuffer + globeFramebuffer, ) { const texture = this._fbo.getColorTexture(); const previousFramebufferChanged = @@ -283,7 +283,7 @@ InvertClassification.prototype.update = function ( : this._rsDefault, uniformMap: this._uniformMap, owner: this, - } + }, ); this._classifiedCommand = context.createViewportQuadCommand( classifiedFSSource, @@ -293,7 +293,7 @@ InvertClassification.prototype.update = function ( : this._rsDefault, uniformMap: this._uniformMap, owner: this, - } + }, ); if (defined(this._translucentCommand)) { @@ -308,7 +308,7 @@ InvertClassification.prototype.update = function ( renderState: this._rsUnclassified, uniformMap: this._uniformMap, owner: this, - } + }, ); } } @@ -316,7 +316,7 @@ InvertClassification.prototype.update = function ( InvertClassification.prototype.prepareTextures = function ( context, - blitStencil + blitStencil, ) { if (this._fbo._numSamples > 1) { this._fbo.prepareTextures(context, blitStencil); @@ -334,7 +334,7 @@ InvertClassification.prototype.clear = function (context, passState) { InvertClassification.prototype.executeClassified = function ( context, - passState + passState, ) { if (!defined(this._previousFramebuffer)) { const framebuffer = passState.framebuffer; @@ -350,7 +350,7 @@ InvertClassification.prototype.executeClassified = function ( InvertClassification.prototype.executeUnclassified = function ( context, - passState + passState, ) { this._unclassifiedCommand.execute(context, passState); }; diff --git a/packages/engine/Source/Scene/IonImageryProvider.js b/packages/engine/Source/Scene/IonImageryProvider.js index 5b1361bb734e..730bb803839e 100644 --- a/packages/engine/Source/Scene/IonImageryProvider.js +++ b/packages/engine/Source/Scene/IonImageryProvider.js @@ -269,7 +269,7 @@ IonImageryProvider.fromAssetId = async function (assetId, options) { options = defaultValue(options, defaultValue.EMPTY_OBJECT); const endpointResource = IonResource._createEndpointResource( assetId, - options + options, ); // A simple cache to avoid making repeated requests to ion for endpoints we've @@ -286,7 +286,7 @@ IonImageryProvider.fromAssetId = async function (assetId, options) { const endpoint = await promise; if (endpoint.type !== "IMAGERY") { throw new RuntimeError( - `Cesium ion asset ${assetId} is not an imagery asset.` + `Cesium ion asset ${assetId} is not an imagery asset.`, ); } @@ -294,14 +294,14 @@ IonImageryProvider.fromAssetId = async function (assetId, options) { const externalType = endpoint.externalType; if (!defined(externalType)) { imageryProvider = await TileMapServiceImageryProvider.fromUrl( - new IonResource(endpoint, endpointResource) + new IonResource(endpoint, endpointResource), ); } else { const factory = ImageryProviderAsyncMapping[externalType]; if (!defined(factory)) { throw new RuntimeError( - `Unrecognized Cesium ion imagery type: ${externalType}` + `Unrecognized Cesium ion imagery type: ${externalType}`, ); } // Make a copy before editing since this object reference is cached; @@ -322,7 +322,7 @@ IonImageryProvider.fromAssetId = async function (assetId, options) { provider._tileCredits = IonResource.getCreditsFromEndpoint( endpoint, - endpointResource + endpointResource, ); provider._imageryProvider = imageryProvider; @@ -384,7 +384,7 @@ IonImageryProvider.prototype.pickFeatures = function ( y, level, longitude, - latitude + latitude, ) { return this._imageryProvider.pickFeatures(x, y, level, longitude, latitude); }; diff --git a/packages/engine/Source/Scene/JobScheduler.js b/packages/engine/Source/Scene/JobScheduler.js index 210b48ecbfd7..e9c03ef4b479 100644 --- a/packages/engine/Source/Scene/JobScheduler.js +++ b/packages/engine/Source/Scene/JobScheduler.js @@ -68,7 +68,7 @@ function JobScheduler(budgets) { //>>includeStart('debug', pragmas.debug); if (defined(budgets) && budgets.length !== JobType.NUMBER_OF_JOB_TYPES) { throw new DeveloperError( - "A budget must be specified for each job type; budgets.length should equal JobType.NUMBER_OF_JOB_TYPES." + "A budget must be specified for each job type; budgets.length should equal JobType.NUMBER_OF_JOB_TYPES.", ); } //>>includeEnd('debug'); @@ -76,14 +76,14 @@ function JobScheduler(budgets) { // Total for defaults is half of of one frame at 10 fps const jobBudgets = new Array(JobType.NUMBER_OF_JOB_TYPES); jobBudgets[JobType.TEXTURE] = new JobTypeBudget( - defined(budgets) ? budgets[JobType.TEXTURE] : 10.0 + defined(budgets) ? budgets[JobType.TEXTURE] : 10.0, ); // On cache miss, this most likely only allows one shader compile per frame jobBudgets[JobType.PROGRAM] = new JobTypeBudget( - defined(budgets) ? budgets[JobType.PROGRAM] : 10.0 + defined(budgets) ? budgets[JobType.PROGRAM] : 10.0, ); jobBudgets[JobType.BUFFER] = new JobTypeBudget( - defined(budgets) ? budgets[JobType.BUFFER] : 30.0 + defined(budgets) ? budgets[JobType.BUFFER] : 30.0, ); const length = jobBudgets.length; diff --git a/packages/engine/Source/Scene/Label.js b/packages/engine/Source/Scene/Label.js index 4c43e93824a4..7196877768a9 100644 --- a/packages/engine/Source/Scene/Label.js +++ b/packages/engine/Source/Scene/Label.js @@ -145,7 +145,7 @@ function Label(options, labelCollection) { options.disableDepthTestDistance < 0.0 ) { throw new DeveloperError( - "disableDepthTestDistance must be greater than 0.0." + "disableDepthTestDistance must be greater than 0.0.", ); } //>>includeEnd('debug'); @@ -158,7 +158,7 @@ function Label(options, labelCollection) { //>>includeStart('debug', pragmas.debug); if (translucencyByDistance.far <= translucencyByDistance.near) { throw new DeveloperError( - "translucencyByDistance.far must be greater than translucencyByDistance.near." + "translucencyByDistance.far must be greater than translucencyByDistance.near.", ); } //>>includeEnd('debug'); @@ -168,19 +168,19 @@ function Label(options, labelCollection) { //>>includeStart('debug', pragmas.debug); if (pixelOffsetScaleByDistance.far <= pixelOffsetScaleByDistance.near) { throw new DeveloperError( - "pixelOffsetScaleByDistance.far must be greater than pixelOffsetScaleByDistance.near." + "pixelOffsetScaleByDistance.far must be greater than pixelOffsetScaleByDistance.near.", ); } //>>includeEnd('debug'); pixelOffsetScaleByDistance = NearFarScalar.clone( - pixelOffsetScaleByDistance + pixelOffsetScaleByDistance, ); } if (defined(scaleByDistance)) { //>>includeStart('debug', pragmas.debug); if (scaleByDistance.far <= scaleByDistance.near) { throw new DeveloperError( - "scaleByDistance.far must be greater than scaleByDistance.near." + "scaleByDistance.far must be greater than scaleByDistance.near.", ); } //>>includeEnd('debug'); @@ -190,12 +190,12 @@ function Label(options, labelCollection) { //>>includeStart('debug', pragmas.debug); if (distanceDisplayCondition.far <= distanceDisplayCondition.near) { throw new DeveloperError( - "distanceDisplayCondition.far must be greater than distanceDisplayCondition.near." + "distanceDisplayCondition.far must be greater than distanceDisplayCondition.near.", ); } //>>includeEnd('debug'); distanceDisplayCondition = DistanceDisplayCondition.clone( - distanceDisplayCondition + distanceDisplayCondition, ); } @@ -205,33 +205,33 @@ function Label(options, labelCollection) { this._font = defaultValue(options.font, "30px sans-serif"); this._fillColor = Color.clone(defaultValue(options.fillColor, Color.WHITE)); this._outlineColor = Color.clone( - defaultValue(options.outlineColor, Color.BLACK) + defaultValue(options.outlineColor, Color.BLACK), ); this._outlineWidth = defaultValue(options.outlineWidth, 1.0); this._showBackground = defaultValue(options.showBackground, false); this._backgroundColor = Color.clone( - defaultValue(options.backgroundColor, defaultBackgroundColor) + defaultValue(options.backgroundColor, defaultBackgroundColor), ); this._backgroundPadding = Cartesian2.clone( - defaultValue(options.backgroundPadding, defaultBackgroundPadding) + defaultValue(options.backgroundPadding, defaultBackgroundPadding), ); this._style = defaultValue(options.style, LabelStyle.FILL); this._verticalOrigin = defaultValue( options.verticalOrigin, - VerticalOrigin.BASELINE + VerticalOrigin.BASELINE, ); this._horizontalOrigin = defaultValue( options.horizontalOrigin, - HorizontalOrigin.LEFT + HorizontalOrigin.LEFT, ); this._pixelOffset = Cartesian2.clone( - defaultValue(options.pixelOffset, Cartesian2.ZERO) + defaultValue(options.pixelOffset, Cartesian2.ZERO), ); this._eyeOffset = Cartesian3.clone( - defaultValue(options.eyeOffset, Cartesian3.ZERO) + defaultValue(options.eyeOffset, Cartesian3.ZERO), ); this._position = Cartesian3.clone( - defaultValue(options.position, Cartesian3.ZERO) + defaultValue(options.position, Cartesian3.ZERO), ); this._scale = defaultValue(options.scale, 1.0); this._id = options.id; @@ -240,7 +240,7 @@ function Label(options, labelCollection) { this._scaleByDistance = scaleByDistance; this._heightReference = defaultValue( options.heightReference, - HeightReference.NONE + HeightReference.NONE, ); this._distanceDisplayCondition = distanceDisplayCondition; this._disableDepthTestDistance = options.disableDepthTestDistance; @@ -693,7 +693,7 @@ Object.defineProperties(Label.prototype, { //>>includeStart('debug', pragmas.debug); if (defined(value) && value.far <= value.near) { throw new DeveloperError( - "far distance must be greater than near distance." + "far distance must be greater than near distance.", ); } //>>includeEnd('debug'); @@ -702,7 +702,7 @@ Object.defineProperties(Label.prototype, { if (!NearFarScalar.equals(translucencyByDistance, value)) { this._translucencyByDistance = NearFarScalar.clone( value, - translucencyByDistance + translucencyByDistance, ); const glyphs = this._glyphs; @@ -751,7 +751,7 @@ Object.defineProperties(Label.prototype, { //>>includeStart('debug', pragmas.debug); if (defined(value) && value.far <= value.near) { throw new DeveloperError( - "far distance must be greater than near distance." + "far distance must be greater than near distance.", ); } //>>includeEnd('debug'); @@ -760,7 +760,7 @@ Object.defineProperties(Label.prototype, { if (!NearFarScalar.equals(pixelOffsetScaleByDistance, value)) { this._pixelOffsetScaleByDistance = NearFarScalar.clone( value, - pixelOffsetScaleByDistance + pixelOffsetScaleByDistance, ); const glyphs = this._glyphs; @@ -808,7 +808,7 @@ Object.defineProperties(Label.prototype, { //>>includeStart('debug', pragmas.debug); if (defined(value) && value.far <= value.near) { throw new DeveloperError( - "far distance must be greater than near distance." + "far distance must be greater than near distance.", ); } //>>includeEnd('debug'); @@ -1047,7 +1047,7 @@ Object.defineProperties(Label.prototype, { ) { this._distanceDisplayCondition = DistanceDisplayCondition.clone( value, - this._distanceDisplayCondition + this._distanceDisplayCondition, ); const glyphs = this._glyphs; @@ -1080,7 +1080,7 @@ Object.defineProperties(Label.prototype, { //>>includeStart('debug', pragmas.debug); if (defined(value) && value < 0.0) { throw new DeveloperError( - "disableDepthTestDistance must be greater than 0.0." + "disableDepthTestDistance must be greater than 0.0.", ); } //>>includeEnd('debug'); @@ -1154,7 +1154,7 @@ Object.defineProperties(Label.prototype, { set: function (value) { this._actualClampedPosition = Cartesian3.clone( value, - this._actualClampedPosition + this._actualClampedPosition, ); const glyphs = this._glyphs; @@ -1247,7 +1247,7 @@ Label.prototype.computeScreenSpacePosition = function (scene, result) { this._eyeOffset, this._pixelOffset, scene, - result + result, ); return windowCoordinates; }; @@ -1264,7 +1264,7 @@ Label.prototype.computeScreenSpacePosition = function (scene, result) { Label.getScreenSpaceBoundingBox = function ( label, screenSpacePosition, - result + result, ) { let x = 0; let y = 0; @@ -1376,16 +1376,16 @@ Label.prototype.equals = function (other) { Cartesian3.equals(this._eyeOffset, other._eyeOffset) && NearFarScalar.equals( this._translucencyByDistance, - other._translucencyByDistance + other._translucencyByDistance, ) && NearFarScalar.equals( this._pixelOffsetScaleByDistance, - other._pixelOffsetScaleByDistance + other._pixelOffsetScaleByDistance, ) && NearFarScalar.equals(this._scaleByDistance, other._scaleByDistance) && DistanceDisplayCondition.equals( this._distanceDisplayCondition, - other._distanceDisplayCondition + other._distanceDisplayCondition, ) && this._disableDepthTestDistance === other._disableDepthTestDistance && this._id === other._id) diff --git a/packages/engine/Source/Scene/LabelCollection.js b/packages/engine/Source/Scene/LabelCollection.js index 1a723f3cf454..6bd01bac9ee8 100644 --- a/packages/engine/Source/Scene/LabelCollection.js +++ b/packages/engine/Source/Scene/LabelCollection.js @@ -68,7 +68,7 @@ function createGlyphCanvas( outlineColor, outlineWidth, style, - verticalOrigin + verticalOrigin, ) { writeTextToCanvasParameters.font = font; writeTextToCanvasParameters.fillColor = fillColor; @@ -211,13 +211,13 @@ function rebindAllGlyphs(labelCollection, label) { Color.WHITE, 0.0, LabelStyle.FILL, - verticalOrigin + verticalOrigin, ); glyphTextureInfo = new GlyphTextureInfo( labelCollection, -1, - canvas.dimensions + canvas.dimensions, ); glyphTextureCache[id] = glyphTextureInfo; @@ -249,7 +249,7 @@ function rebindAllGlyphs(labelCollection, label) { labelCollection._textureAtlas, id, canvas, - glyphTextureInfo + glyphTextureInfo, ); } } @@ -360,7 +360,7 @@ function repositionAllGlyphs(label) { const backgroundBillboard = label._backgroundBillboard; const backgroundPadding = Cartesian2.clone( defined(backgroundBillboard) ? label._backgroundPadding : Cartesian2.ZERO, - scratchBackgroundPadding + scratchBackgroundPadding, ); // We need to scale the background padding, which is specified in pixels by the inverse of the relative size so it is scaled properly. @@ -397,7 +397,7 @@ function repositionAllGlyphs(label) { let widthOffset = calculateWidthOffset( lineWidth, horizontalOrigin, - backgroundPadding + backgroundPadding, ); const lineSpacing = (defined(label._lineHeight) @@ -427,7 +427,7 @@ function repositionAllGlyphs(label) { widthOffset = calculateWidthOffset( lineWidth, horizontalOrigin, - backgroundPadding + backgroundPadding, ); glyphPixelOffset.x = widthOffset * scale; firstCharOfLine = true; @@ -506,7 +506,7 @@ function repositionAllGlyphs(label) { backgroundBillboard._setTranslate(glyphPixelOffset); backgroundBillboard._labelTranslate = Cartesian2.clone( glyphPixelOffset, - backgroundBillboard._labelTranslate + backgroundBillboard._labelTranslate, ); } @@ -517,7 +517,7 @@ function repositionAllGlyphs(label) { if (defined(billboard)) { billboard._labelTranslate = Cartesian2.clone( glyphPixelOffset, - billboard._labelTranslate + billboard._labelTranslate, ); } } @@ -531,7 +531,7 @@ function destroyLabel(labelCollection, label) { } if (defined(label._backgroundBillboard)) { labelCollection._backgroundBillboardCollection.remove( - label._backgroundBillboard + label._backgroundBillboard, ); label._backgroundBillboard = undefined; } @@ -659,7 +659,7 @@ function LabelCollection(options) { * }); */ this.modelMatrix = Matrix4.clone( - defaultValue(options.modelMatrix, Matrix4.IDENTITY) + defaultValue(options.modelMatrix, Matrix4.IDENTITY), ); /** @@ -674,7 +674,7 @@ function LabelCollection(options) { */ this.debugShowBoundingVolume = defaultValue( options.debugShowBoundingVolume, - false + false, ); /** @@ -687,7 +687,7 @@ function LabelCollection(options) { */ this.blendOption = defaultValue( options.blendOption, - BlendOption.OPAQUE_AND_TRANSLUCENT + BlendOption.OPAQUE_AND_TRANSLUCENT, ); } @@ -896,7 +896,8 @@ LabelCollection.prototype.update = function (frameState) { billboardCollection.modelMatrix = this.modelMatrix; billboardCollection.debugShowBoundingVolume = this.debugShowBoundingVolume; backgroundBillboardCollection.modelMatrix = this.modelMatrix; - backgroundBillboardCollection.debugShowBoundingVolume = this.debugShowBoundingVolume; + backgroundBillboardCollection.debugShowBoundingVolume = + this.debugShowBoundingVolume; const context = frameState.context; @@ -990,7 +991,8 @@ LabelCollection.prototype.destroy = function () { this.removeAll(); this._billboardCollection = this._billboardCollection.destroy(); this._textureAtlas = this._textureAtlas && this._textureAtlas.destroy(); - this._backgroundBillboardCollection = this._backgroundBillboardCollection.destroy(); + this._backgroundBillboardCollection = + this._backgroundBillboardCollection.destroy(); this._backgroundTextureAtlas = this._backgroundTextureAtlas && this._backgroundTextureAtlas.destroy(); diff --git a/packages/engine/Source/Scene/MapboxImageryProvider.js b/packages/engine/Source/Scene/MapboxImageryProvider.js index 23deb6d0880f..2a86db331cfc 100644 --- a/packages/engine/Source/Scene/MapboxImageryProvider.js +++ b/packages/engine/Source/Scene/MapboxImageryProvider.js @@ -7,7 +7,7 @@ import UrlTemplateImageryProvider from "./UrlTemplateImageryProvider.js"; const trailingSlashRegex = /\/$/; const defaultCredit = new Credit( - '© <a href="https://www.mapbox.com/about/maps/">Mapbox</a> © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> <strong><a href="https://www.mapbox.com/map-feedback/">Improve this map</a></strong>' + '© <a href="https://www.mapbox.com/about/maps/">Mapbox</a> © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> <strong><a href="https://www.mapbox.com/map-feedback/">Improve this map</a></strong>', ); /** @@ -74,7 +74,7 @@ function MapboxImageryProvider(options) { this._defaultMagnificationFilter = undefined; const resource = Resource.createIfNeeded( - defaultValue(options.url, "https://{s}.tiles.mapbox.com/v4/") + defaultValue(options.url, "https://{s}.tiles.mapbox.com/v4/"), ); this._mapId = mapId; @@ -322,7 +322,7 @@ MapboxImageryProvider.prototype.pickFeatures = function ( y, level, longitude, - latitude + latitude, ) { return this._imageryProvider.pickFeatures(x, y, level, longitude, latitude); }; diff --git a/packages/engine/Source/Scene/MapboxStyleImageryProvider.js b/packages/engine/Source/Scene/MapboxStyleImageryProvider.js index 9cc2d9d24838..6eb2d07d5f3b 100644 --- a/packages/engine/Source/Scene/MapboxStyleImageryProvider.js +++ b/packages/engine/Source/Scene/MapboxStyleImageryProvider.js @@ -7,7 +7,7 @@ import UrlTemplateImageryProvider from "./UrlTemplateImageryProvider.js"; const trailingSlashRegex = /\/$/; const defaultCredit = new Credit( - '© <a href="https://www.mapbox.com/about/maps/">Mapbox</a> © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> <strong><a href="https://www.mapbox.com/map-feedback/">Improve this map</a></strong>' + '© <a href="https://www.mapbox.com/about/maps/">Mapbox</a> © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> <strong><a href="https://www.mapbox.com/map-feedback/">Improve this map</a></strong>', ); /** @@ -76,7 +76,7 @@ function MapboxStyleImageryProvider(options) { this._defaultMagnificationFilter = undefined; const resource = Resource.createIfNeeded( - defaultValue(options.url, "https://api.mapbox.com/styles/v1/") + defaultValue(options.url, "https://api.mapbox.com/styles/v1/"), ); this._styleId = styleId; @@ -307,7 +307,7 @@ MapboxStyleImageryProvider.prototype.requestImage = function ( x, y, level, - request + request, ) { return this._imageryProvider.requestImage(x, y, level, request); }; @@ -332,7 +332,7 @@ MapboxStyleImageryProvider.prototype.pickFeatures = function ( y, level, longitude, - latitude + latitude, ) { return this._imageryProvider.pickFeatures(x, y, level, longitude, latitude); }; diff --git a/packages/engine/Source/Scene/Material.js b/packages/engine/Source/Scene/Material.js index ba0e598d3c53..8673b8a1b06f 100644 --- a/packages/engine/Source/Scene/Material.js +++ b/packages/engine/Source/Scene/Material.js @@ -310,11 +310,11 @@ function Material(options) { this._minificationFilter = defaultValue( options.minificationFilter, - TextureMinificationFilter.LINEAR + TextureMinificationFilter.LINEAR, ); this._magnificationFilter = defaultValue( options.magnificationFilter, - TextureMagnificationFilter.LINEAR + TextureMagnificationFilter.LINEAR, ); this._strict = undefined; @@ -590,13 +590,13 @@ function initializeMaterial(options, result) { result._strict = defaultValue(options.strict, false); result._count = defaultValue(options.count, 0); result._template = clone( - defaultValue(options.fabric, defaultValue.EMPTY_OBJECT) + defaultValue(options.fabric, defaultValue.EMPTY_OBJECT), ); result._template.uniforms = clone( - defaultValue(result._template.uniforms, defaultValue.EMPTY_OBJECT) + defaultValue(result._template.uniforms, defaultValue.EMPTY_OBJECT), ); result._template.materials = clone( - defaultValue(result._template.materials, defaultValue.EMPTY_OBJECT) + defaultValue(result._template.materials, defaultValue.EMPTY_OBJECT), ); result.type = defined(result._template.type) @@ -709,7 +709,7 @@ function checkForTemplateErrors(material) { //>>includeStart('debug', pragmas.debug); if (defined(components) && defined(template.source)) { throw new DeveloperError( - "fabric: cannot have source and components in the same template." + "fabric: cannot have source and components in the same template.", ); } //>>includeEnd('debug'); @@ -720,7 +720,7 @@ function checkForTemplateErrors(material) { components, componentProperties, invalidNameError, - true + true, ); // Make sure uniforms and materials do not share any of the same names. @@ -1006,7 +1006,7 @@ function createUniform(material, uniformId) { //>>includeStart('debug', pragmas.debug); if (!defined(uniformType)) { throw new DeveloperError( - `fabric: uniform '${uniformId}' has invalid type.` + `fabric: uniform '${uniformId}' has invalid type.`, ); } //>>includeEnd('debug'); @@ -1017,7 +1017,7 @@ function createUniform(material, uniformId) { //>>includeStart('debug', pragmas.debug); if (replacedTokenCount === 0 && strict) { throw new DeveloperError( - `strict: shader source does not use channels '${uniformId}'.` + `strict: shader source does not use channels '${uniformId}'.`, ); } //>>includeEnd('debug'); @@ -1038,7 +1038,7 @@ function createUniform(material, uniformId) { // Add uniform declaration to source code. const uniformDeclarationRegex = new RegExp( - `uniform\\s+${uniformType}\\s+${uniformId}\\s*;` + `uniform\\s+${uniformType}\\s+${uniformId}\\s*;`, ); if (!uniformDeclarationRegex.test(material.shaderSource)) { const uniformDeclaration = `uniform ${uniformType} ${uniformId};`; @@ -1050,7 +1050,7 @@ function createUniform(material, uniformId) { //>>includeStart('debug', pragmas.debug); if (replacedTokenCount === 1 && strict) { throw new DeveloperError( - `strict: shader source does not use uniform '${uniformId}'.` + `strict: shader source does not use uniform '${uniformId}'.`, ); } //>>includeEnd('debug'); @@ -1073,7 +1073,7 @@ function createUniform(material, uniformId) { material._uniforms[newUniformId] = function () { return matrixMap[uniformType].fromColumnMajorArray( material.uniforms[uniformId], - scratchMatrix + scratchMatrix, ); }; } else { @@ -1150,11 +1150,11 @@ function createSubMaterials(material) { material._uniforms = combine( material._uniforms, subMaterial._uniforms, - true + true, ); material.materials[subMaterialId] = subMaterial; material._translucentFunctions = material._translucentFunctions.concat( - subMaterial._translucentFunctions + subMaterial._translucentFunctions, ); // Make the material's czm_getMaterial unique by appending the sub-material type. @@ -1168,12 +1168,12 @@ function createSubMaterials(material) { const tokensReplacedCount = replaceToken( material, subMaterialId, - materialMethodCall + materialMethodCall, ); //>>includeStart('debug', pragmas.debug); if (tokensReplacedCount === 0 && strict) { throw new DeveloperError( - `strict: shader source does not use material '${subMaterialId}'.` + `strict: shader source does not use material '${subMaterialId}'.`, ); } //>>includeEnd('debug'); @@ -1190,17 +1190,16 @@ function replaceToken(material, token, newToken, excludePeriod) { const suffixChars = "([\\w])?"; const prefixChars = `([\\w${excludePeriod ? "." : ""}])?`; const regExp = new RegExp(prefixChars + token + suffixChars, "g"); - material.shaderSource = material.shaderSource.replace(regExp, function ( - $0, - $1, - $2 - ) { - if ($1 || $2) { - return $0; - } - count += 1; - return newToken; - }); + material.shaderSource = material.shaderSource.replace( + regExp, + function ($0, $1, $2) { + if ($1 || $2) { + return $0; + } + count += 1; + return newToken; + }, + ); return count; } diff --git a/packages/engine/Source/Scene/MaterialAppearance.js b/packages/engine/Source/Scene/MaterialAppearance.js index 06280407f4f7..9dba04b55122 100644 --- a/packages/engine/Source/Scene/MaterialAppearance.js +++ b/packages/engine/Source/Scene/MaterialAppearance.js @@ -53,7 +53,7 @@ function MaterialAppearance(options) { const closed = defaultValue(options.closed, false); const materialSupport = defaultValue( options.materialSupport, - MaterialAppearance.MaterialSupport.TEXTURED + MaterialAppearance.MaterialSupport.TEXTURED, ); /** @@ -81,16 +81,16 @@ function MaterialAppearance(options) { this._vertexShaderSource = defaultValue( options.vertexShaderSource, - materialSupport.vertexShaderSource + materialSupport.vertexShaderSource, ); this._fragmentShaderSource = defaultValue( options.fragmentShaderSource, - materialSupport.fragmentShaderSource + materialSupport.fragmentShaderSource, ); this._renderState = Appearance.getDefaultRenderState( translucent, closed, - options.renderState + options.renderState, ); this._closed = closed; diff --git a/packages/engine/Source/Scene/Megatexture.js b/packages/engine/Source/Scene/Megatexture.js index 5173d98b3911..f91828ef0d3f 100644 --- a/packages/engine/Source/Scene/Megatexture.js +++ b/packages/engine/Source/Scene/Megatexture.js @@ -34,7 +34,7 @@ function Megatexture( dimensions, channelCount, componentType, - textureMemoryByteLength + textureMemoryByteLength, ) { // TODO there are a lot of texture packing rules, see https://github.com/CesiumGS/cesium/issues/9572 // Unsigned short textures not allowed in webgl 1, so treat as float @@ -76,18 +76,17 @@ function Megatexture( const defaultTextureMemoryByteLength = 128 * 1024 * 1024; textureMemoryByteLength = Math.min( defaultValue(textureMemoryByteLength, defaultTextureMemoryByteLength), - maximumTextureMemoryByteLength + maximumTextureMemoryByteLength, ); const maximumTextureDimensionContext = ContextLimits.maximumTextureSize; - const componentTypeByteLength = MetadataComponentType.getSizeInBytes( - componentType - ); + const componentTypeByteLength = + MetadataComponentType.getSizeInBytes(componentType); const texelCount = Math.floor( - textureMemoryByteLength / (channelCount * componentTypeByteLength) + textureMemoryByteLength / (channelCount * componentTypeByteLength), ); const textureDimension = Math.min( maximumTextureDimensionContext, - CesiumMath.previousPowerOfTwo(Math.floor(Math.sqrt(texelCount))) + CesiumMath.previousPowerOfTwo(Math.floor(Math.sqrt(texelCount))), ); const sliceCountPerRegionX = Math.ceil(Math.sqrt(dimensions.x)); @@ -95,10 +94,10 @@ function Megatexture( const voxelCountPerRegionX = sliceCountPerRegionX * dimensions.x; const voxelCountPerRegionY = sliceCountPerRegionY * dimensions.y; const regionCountPerMegatextureX = Math.floor( - textureDimension / voxelCountPerRegionX + textureDimension / voxelCountPerRegionX, ); const regionCountPerMegatextureY = Math.floor( - textureDimension / voxelCountPerRegionY + textureDimension / voxelCountPerRegionY, ); if (regionCountPerMegatextureX === 0 || regionCountPerMegatextureY === 0) { @@ -136,7 +135,7 @@ function Megatexture( */ this.regionCountPerMegatexture = new Cartesian2( regionCountPerMegatextureX, - regionCountPerMegatextureY + regionCountPerMegatextureY, ); /** @@ -145,7 +144,7 @@ function Megatexture( */ this.voxelCountPerRegion = new Cartesian2( voxelCountPerRegionX, - voxelCountPerRegionY + voxelCountPerRegionY, ); /** @@ -154,7 +153,7 @@ function Megatexture( */ this.sliceCountPerRegion = new Cartesian2( sliceCountPerRegionX, - sliceCountPerRegionY + sliceCountPerRegionY, ); /** @@ -163,7 +162,7 @@ function Megatexture( */ this.voxelSizeUv = new Cartesian2( 1.0 / textureDimension, - 1.0 / textureDimension + 1.0 / textureDimension, ); /** @@ -172,7 +171,7 @@ function Megatexture( */ this.sliceSizeUv = new Cartesian2( dimensions.x / textureDimension, - dimensions.y / textureDimension + dimensions.y / textureDimension, ); /** @@ -181,7 +180,7 @@ function Megatexture( */ this.regionSizeUv = new Cartesian2( voxelCountPerRegionX / textureDimension, - voxelCountPerRegionY / textureDimension + voxelCountPerRegionY / textureDimension, ); /** @@ -203,16 +202,15 @@ function Megatexture( }), }); - const componentDatatype = MetadataComponentType.toComponentDatatype( - componentType - ); + const componentDatatype = + MetadataComponentType.toComponentDatatype(componentType); /** * @type {Array} */ this.tileVoxelDataTemp = ComponentDatatype.createTypedArray( componentDatatype, - voxelCountPerRegionX * voxelCountPerRegionY * channelCount + voxelCountPerRegionX * voxelCountPerRegionY * channelCount, ); /** @@ -351,7 +349,7 @@ Megatexture.getApproximateTextureMemoryByteLength = function ( tileCount, dimensions, channelCount, - componentType + componentType, ) { // TODO there's a lot of code duplicate with Megatexture constructor @@ -360,9 +358,8 @@ Megatexture.getApproximateTextureMemoryByteLength = function ( componentType = MetadataComponentType.FLOAT32; } - const datatypeSizeInBytes = MetadataComponentType.getSizeInBytes( - componentType - ); + const datatypeSizeInBytes = + MetadataComponentType.getSizeInBytes(componentType); const voxelCountTotal = tileCount * dimensions.x * dimensions.y * dimensions.z; @@ -374,7 +371,7 @@ Megatexture.getApproximateTextureMemoryByteLength = function ( // Find the power of two that can fit all tile data, accounting for slices. // There's probably a non-iterative solution for this, but this is good enough for now. let textureDimension = CesiumMath.previousPowerOfTwo( - Math.floor(Math.sqrt(voxelCountTotal)) + Math.floor(Math.sqrt(voxelCountTotal)), ); for (;;) { const regionCountX = Math.floor(textureDimension / voxelCountPerRegionX); diff --git a/packages/engine/Source/Scene/MetadataClassProperty.js b/packages/engine/Source/Scene/MetadataClassProperty.js index b21c05c06fd7..dec9b1393e3e 100644 --- a/packages/engine/Source/Scene/MetadataClassProperty.js +++ b/packages/engine/Source/Scene/MetadataClassProperty.js @@ -81,7 +81,7 @@ function MetadataClassProperty(options) { this._isArray = defaultValue(options.isArray, false); this._isVariableLengthArray = defaultValue( options.isVariableLengthArray, - false + false, ); this._arrayLength = options.arrayLength; @@ -668,7 +668,7 @@ function parseType(property, enums) { //>>includeStart('debug', pragmas.debug); throw new DeveloperError( - `unknown metadata type {type: ${type}, componentType: ${componentType})` + `unknown metadata type {type: ${type}, componentType: ${componentType})`, ); //>>includeEnd('debug'); } @@ -702,7 +702,7 @@ MetadataClassProperty.prototype.normalize = function (value) { return normalizeInPlace( value, this._valueType, - MetadataComponentType.normalize + MetadataComponentType.normalize, ); }; @@ -735,7 +735,7 @@ MetadataClassProperty.prototype.unnormalize = function (value) { return normalizeInPlace( value, this._valueType, - MetadataComponentType.unnormalize + MetadataComponentType.unnormalize, ); }; @@ -753,7 +753,7 @@ MetadataClassProperty.prototype.applyValueTransform = function (value) { value, this._offset, this._scale, - MetadataComponentType.applyValueTransform + MetadataComponentType.applyValueTransform, ); }; @@ -771,7 +771,7 @@ MetadataClassProperty.prototype.unapplyValueTransform = function (value) { value, this._offset, this._scale, - MetadataComponentType.unapplyValueTransform + MetadataComponentType.unapplyValueTransform, ); }; @@ -780,7 +780,7 @@ MetadataClassProperty.prototype.unapplyValueTransform = function (value) { */ MetadataClassProperty.prototype.expandConstant = function ( constant, - enableNestedArrays + enableNestedArrays, ) { enableNestedArrays = defaultValue(enableNestedArrays, false); const isArray = this._isArray; @@ -871,7 +871,7 @@ function arrayEquals(left, right) { */ MetadataClassProperty.prototype.unpackVectorAndMatrixTypes = function ( value, - enableNestedArrays + enableNestedArrays, ) { enableNestedArrays = defaultValue(enableNestedArrays, false); const MathType = MetadataType.getMathType(this._type); @@ -910,7 +910,7 @@ MetadataClassProperty.prototype.unpackVectorAndMatrixTypes = function ( */ MetadataClassProperty.prototype.packVectorAndMatrixTypes = function ( value, - enableNestedArrays + enableNestedArrays, ) { enableNestedArrays = defaultValue(enableNestedArrays, false); const MathType = MetadataType.getMathType(this._type); @@ -1145,7 +1145,7 @@ MetadataClassProperty.valueTransformInPlace = function ( values, offsets, scales, - transformationFunction + transformationFunction, ) { if (!Array.isArray(values)) { // transform a single value @@ -1158,7 +1158,7 @@ MetadataClassProperty.valueTransformInPlace = function ( values[i], offsets[i], scales[i], - transformationFunction + transformationFunction, ); } diff --git a/packages/engine/Source/Scene/MetadataComponentType.js b/packages/engine/Source/Scene/MetadataComponentType.js index ad7ab3afdfcd..97dfa8ab4a11 100644 --- a/packages/engine/Source/Scene/MetadataComponentType.js +++ b/packages/engine/Source/Scene/MetadataComponentType.js @@ -295,7 +295,7 @@ MetadataComponentType.normalize = function (value, type) { return Math.max( Number(value) / Number(MetadataComponentType.getMaximum(type)), - -1.0 + -1.0, ); }; diff --git a/packages/engine/Source/Scene/MetadataEntity.js b/packages/engine/Source/Scene/MetadataEntity.js index 750ab53dedb6..af5188f6955a 100644 --- a/packages/engine/Source/Scene/MetadataEntity.js +++ b/packages/engine/Source/Scene/MetadataEntity.js @@ -135,7 +135,7 @@ MetadataEntity.prototype.setPropertyBySemantic = function (semantic, value) { MetadataEntity.hasProperty = function ( propertyId, properties, - classDefinition + classDefinition, ) { //>>includeStart('debug', pragmas.debug); Check.typeOf.string("propertyId", propertyId); @@ -173,7 +173,7 @@ MetadataEntity.hasProperty = function ( MetadataEntity.hasPropertyBySemantic = function ( semantic, properties, - classDefinition + classDefinition, ) { //>>includeStart('debug', pragmas.debug); Check.typeOf.string("semantic", semantic); @@ -203,7 +203,7 @@ MetadataEntity.hasPropertyBySemantic = function ( MetadataEntity.getPropertyIds = function ( properties, classDefinition, - results + results, ) { //>>includeStart('debug', pragmas.debug); Check.typeOf.object("properties", properties); @@ -256,7 +256,7 @@ MetadataEntity.getPropertyIds = function ( MetadataEntity.getProperty = function ( propertyId, properties, - classDefinition + classDefinition, ) { //>>includeStart('debug', pragmas.debug); Check.typeOf.string("propertyId", propertyId); @@ -313,7 +313,7 @@ MetadataEntity.setProperty = function ( propertyId, value, properties, - classDefinition + classDefinition, ) { //>>includeStart('debug', pragmas.debug); Check.typeOf.string("propertyId", propertyId); @@ -361,7 +361,7 @@ MetadataEntity.setProperty = function ( MetadataEntity.getPropertyBySemantic = function ( semantic, properties, - classDefinition + classDefinition, ) { //>>includeStart('debug', pragmas.debug); Check.typeOf.string("semantic", semantic); @@ -395,7 +395,7 @@ MetadataEntity.setPropertyBySemantic = function ( semantic, value, properties, - classDefinition + classDefinition, ) { //>>includeStart('debug', pragmas.debug); Check.typeOf.string("semantic", semantic); @@ -415,7 +415,7 @@ MetadataEntity.setPropertyBySemantic = function ( property.id, value, properties, - classDefinition + classDefinition, ); } diff --git a/packages/engine/Source/Scene/MetadataEnum.js b/packages/engine/Source/Scene/MetadataEnum.js index ed23d940cd4e..d4816ad6a9d1 100644 --- a/packages/engine/Source/Scene/MetadataEnum.js +++ b/packages/engine/Source/Scene/MetadataEnum.js @@ -45,7 +45,7 @@ function MetadataEnum(options) { const valueType = defaultValue( options.valueType, - MetadataComponentType.UINT16 + MetadataComponentType.UINT16, ); this._values = values; diff --git a/packages/engine/Source/Scene/MetadataSchemaLoader.js b/packages/engine/Source/Scene/MetadataSchemaLoader.js index f4a674920336..fd09000df38b 100644 --- a/packages/engine/Source/Scene/MetadataSchemaLoader.js +++ b/packages/engine/Source/Scene/MetadataSchemaLoader.js @@ -34,7 +34,7 @@ function MetadataSchemaLoader(options) { //>>includeStart('debug', pragmas.debug); if (defined(schema) === defined(resource)) { throw new DeveloperError( - "One of options.schema and options.resource must be defined." + "One of options.schema and options.resource must be defined.", ); } //>>includeEnd('debug'); diff --git a/packages/engine/Source/Scene/MetadataTable.js b/packages/engine/Source/Scene/MetadataTable.js index 9a3857716060..b6113c96b63f 100644 --- a/packages/engine/Source/Scene/MetadataTable.js +++ b/packages/engine/Source/Scene/MetadataTable.js @@ -124,7 +124,7 @@ MetadataTable.prototype.hasPropertyBySemantic = function (semantic) { return MetadataEntity.hasPropertyBySemantic( semantic, this._properties, - this._class + this._class, ); }; @@ -270,7 +270,7 @@ MetadataTable.prototype.getPropertyBySemantic = function (index, semantic) { MetadataTable.prototype.setPropertyBySemantic = function ( index, semantic, - value + value, ) { //>>includeStart('debug', pragmas.debug); Check.typeOf.string("semantic", semantic); diff --git a/packages/engine/Source/Scene/MetadataTableProperty.js b/packages/engine/Source/Scene/MetadataTableProperty.js index 8198e0151652..3af58b4f559e 100644 --- a/packages/engine/Source/Scene/MetadataTableProperty.js +++ b/packages/engine/Source/Scene/MetadataTableProperty.js @@ -63,23 +63,23 @@ function MetadataTableProperty(options) { // EXT_feature_metadata uses offsetType for both arrays and strings let arrayOffsetType = defaultValue( property.arrayOffsetType, - property.offsetType + property.offsetType, ); arrayOffsetType = defaultValue( MetadataComponentType[arrayOffsetType], - MetadataComponentType.UINT32 + MetadataComponentType.UINT32, ); // EXT_structural_metadata uses arrayOffsets. // EXT_feature_metadata uses arrayOffsetBufferView const arrayOffsetBufferView = defaultValue( property.arrayOffsets, - property.arrayOffsetBufferView + property.arrayOffsetBufferView, ); arrayOffsets = new BufferView( bufferViews[arrayOffsetBufferView], arrayOffsetType, - count + 1 + count + 1, ); byteLength += arrayOffsets.typedArray.byteLength; @@ -103,23 +103,23 @@ function MetadataTableProperty(options) { // EXT_structural_metadata uses stringOffsetType, EXT_feature_metadata uses offsetType for both arrays and strings let stringOffsetType = defaultValue( property.stringOffsetType, - property.offsetType + property.offsetType, ); stringOffsetType = defaultValue( MetadataComponentType[stringOffsetType], - MetadataComponentType.UINT32 + MetadataComponentType.UINT32, ); // EXT_structural_metadata uses stringOffsets. // EXT_feature_metadata uses stringOffsetBufferView const stringOffsetBufferView = defaultValue( property.stringOffsets, - property.stringOffsetBufferView + property.stringOffsetBufferView, ); stringOffsets = new BufferView( bufferViews[stringOffsetBufferView], stringOffsetType, - componentCount + 1 + componentCount + 1, ); byteLength += stringOffsets.typedArray.byteLength; @@ -145,7 +145,7 @@ function MetadataTableProperty(options) { const values = new BufferView( bufferViews[valuesBufferView], valueType, - valueCount + valueCount, ); byteLength += values.typedArray.byteLength; @@ -402,7 +402,7 @@ function checkIndex(table, index) { if (!defined(index) || index < 0 || index >= count) { const maximumIndex = count - 1; throw new DeveloperError( - `index is required and between zero and count - 1. Actual value: ${maximumIndex}` + `index is required and between zero and count - 1. Actual value: ${maximumIndex}`, ); } } @@ -510,7 +510,7 @@ function getString(index, values, stringOffsets) { return getStringFromTypedArray( values.typedArray, stringByteOffset, - stringByteLength + stringByteLength, ); } @@ -734,7 +734,7 @@ function applyValueTransform(property, value) { value, property._offset, property._scale, - MetadataComponentType.applyValueTransform + MetadataComponentType.applyValueTransform, ); } @@ -749,7 +749,7 @@ function unapplyValueTransform(property, value) { value, property._offset, property._scale, - MetadataComponentType.unapplyValueTransform + MetadataComponentType.unapplyValueTransform, ); } @@ -763,12 +763,12 @@ function BufferView(bufferView, componentType, length) { if (componentType === MetadataComponentType.INT64) { if (!FeatureDetection.supportsBigInt()) { oneTimeWarning( - "INT64 type is not fully supported on this platform. Values greater than 2^53 - 1 or less than -(2^53 - 1) may lose precision when read." + "INT64 type is not fully supported on this platform. Values greater than 2^53 - 1 or less than -(2^53 - 1) may lose precision when read.", ); typedArray = new Uint8Array( bufferView.buffer, bufferView.byteOffset, - length * 8 + length * 8, ); getFunction = function (index) { return getInt64NumberFallback(index, that); @@ -777,7 +777,7 @@ function BufferView(bufferView, componentType, length) { typedArray = new Uint8Array( bufferView.buffer, bufferView.byteOffset, - length * 8 + length * 8, ); getFunction = function (index) { return getInt64BigIntFallback(index, that); @@ -787,7 +787,7 @@ function BufferView(bufferView, componentType, length) { typedArray = new BigInt64Array( bufferView.buffer, bufferView.byteOffset, - length + length, ); setFunction = function (index, value) { // Convert the number to a BigInt before setting the value in the typed array @@ -797,12 +797,12 @@ function BufferView(bufferView, componentType, length) { } else if (componentType === MetadataComponentType.UINT64) { if (!FeatureDetection.supportsBigInt()) { oneTimeWarning( - "UINT64 type is not fully supported on this platform. Values greater than 2^53 - 1 may lose precision when read." + "UINT64 type is not fully supported on this platform. Values greater than 2^53 - 1 may lose precision when read.", ); typedArray = new Uint8Array( bufferView.buffer, bufferView.byteOffset, - length * 8 + length * 8, ); getFunction = function (index) { return getUint64NumberFallback(index, that); @@ -811,7 +811,7 @@ function BufferView(bufferView, componentType, length) { typedArray = new Uint8Array( bufferView.buffer, bufferView.byteOffset, - length * 8 + length * 8, ); getFunction = function (index) { return getUint64BigIntFallback(index, that); @@ -821,7 +821,7 @@ function BufferView(bufferView, componentType, length) { typedArray = new BigUint64Array( bufferView.buffer, bufferView.byteOffset, - length + length, ); setFunction = function (index, value) { // Convert the number to a BigInt before setting the value in the typed array @@ -834,7 +834,7 @@ function BufferView(bufferView, componentType, length) { componentDatatype, bufferView.buffer, bufferView.byteOffset, - length + length, ); setFunction = function (index, value) { that.typedArray[index] = value; diff --git a/packages/engine/Source/Scene/Model/AlphaPipelineStage.js b/packages/engine/Source/Scene/Model/AlphaPipelineStage.js index 2f1d542f6d6f..c21113304ac4 100644 --- a/packages/engine/Source/Scene/Model/AlphaPipelineStage.js +++ b/packages/engine/Source/Scene/Model/AlphaPipelineStage.js @@ -36,12 +36,12 @@ AlphaPipelineStage.process = function (renderResources, primitive, frameState) { shaderBuilder.addDefine( "ALPHA_MODE_MASK", undefined, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); shaderBuilder.addUniform( "float", "u_alphaCutoff", - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); uniformMap.u_alphaCutoff = function () { return alphaOptions.alphaCutoff; diff --git a/packages/engine/Source/Scene/Model/AtmospherePipelineStage.js b/packages/engine/Source/Scene/Model/AtmospherePipelineStage.js index 46b9e97debda..11128da39bd7 100644 --- a/packages/engine/Source/Scene/Model/AtmospherePipelineStage.js +++ b/packages/engine/Source/Scene/Model/AtmospherePipelineStage.js @@ -19,7 +19,7 @@ const AtmospherePipelineStage = { AtmospherePipelineStage.process = function ( renderResources, model, - frameState + frameState, ) { const shaderBuilder = renderResources.shaderBuilder; @@ -27,7 +27,7 @@ AtmospherePipelineStage.process = function ( shaderBuilder.addDefine( "COMPUTE_POSITION_WC_ATMOSPHERE", undefined, - ShaderDestination.BOTH + ShaderDestination.BOTH, ); shaderBuilder.addVarying("vec3", "v_atmosphereRayleighColor"); @@ -47,7 +47,7 @@ AtmospherePipelineStage.process = function ( // from the camera to the bounding sphere center. const distance = Cartesian3.distance( frameState.camera.positionWC, - model.boundingSphere.center + model.boundingSphere.center, ); return ( diff --git a/packages/engine/Source/Scene/Model/B3dmLoader.js b/packages/engine/Source/Scene/Model/B3dmLoader.js index 600221ac4dde..c9bb0feff45a 100644 --- a/packages/engine/Source/Scene/Model/B3dmLoader.js +++ b/packages/engine/Source/Scene/Model/B3dmLoader.js @@ -66,24 +66,24 @@ function B3dmLoader(options) { const asynchronous = defaultValue(options.asynchronous, true); const incrementallyLoadTextures = defaultValue( options.incrementallyLoadTextures, - true + true, ); const upAxis = defaultValue(options.upAxis, Axis.Y); const forwardAxis = defaultValue(options.forwardAxis, Axis.X); const loadAttributesAsTypedArray = defaultValue( options.loadAttributesAsTypedArray, - false + false, ); const loadAttributesFor2D = defaultValue(options.loadAttributesFor2D, false); const enablePick = defaultValue(options.enablePick, false); const loadIndicesForWireframe = defaultValue( options.loadIndicesForWireframe, - false + false, ); const loadPrimitiveOutline = defaultValue(options.loadPrimitiveOutline, true); const loadForClassification = defaultValue( options.loadForClassification, - false + false, ); //>>includeStart('debug', pragmas.debug); @@ -196,7 +196,7 @@ B3dmLoader.prototype.load = function () { const featureTable = new Cesium3DTileFeatureTable( featureTableJson, - featureTableBinary + featureTableBinary, ); batchLength = featureTable.getGlobalProperty("BATCH_LENGTH"); // Set batch length. @@ -205,7 +205,7 @@ B3dmLoader.prototype.load = function () { const rtcCenter = featureTable.getGlobalProperty( "RTC_CENTER", ComponentDatatype.FLOAT, - 3 + 3, ); if (defined(rtcCenter)) { this._transform = Matrix4.fromTranslation(Cartesian3.fromArray(rtcCenter)); @@ -293,7 +293,7 @@ B3dmLoader.prototype.process = function (frameState) { components.transform = Matrix4.multiplyTransformation( this._transform, components.transform, - components.transform + components.transform, ); createStructuralMetadata(this, components); this._components = components; @@ -354,7 +354,7 @@ function processNode(node) { const primitive = node.primitives[i]; const featureIdVertexAttribute = ModelUtility.getAttributeBySemantic( primitive, - VertexAttributeSemantic.FEATURE_ID + VertexAttributeSemantic.FEATURE_ID, ); if (defined(featureIdVertexAttribute)) { featureIdVertexAttribute.setIndex = 0; diff --git a/packages/engine/Source/Scene/Model/BatchTexturePipelineStage.js b/packages/engine/Source/Scene/Model/BatchTexturePipelineStage.js index 07c0f16718de..fd9047de3473 100644 --- a/packages/engine/Source/Scene/Model/BatchTexturePipelineStage.js +++ b/packages/engine/Source/Scene/Model/BatchTexturePipelineStage.js @@ -25,7 +25,7 @@ const BatchTexturePipelineStage = { BatchTexturePipelineStage.process = function ( renderResources, primitive, - frameState + frameState, ) { const shaderBuilder = renderResources.shaderBuilder; const batchTextureUniforms = {}; @@ -65,7 +65,7 @@ BatchTexturePipelineStage.process = function ( renderResources.uniformMap = combine( batchTextureUniforms, - renderResources.uniformMap + renderResources.uniformMap, ); }; diff --git a/packages/engine/Source/Scene/Model/CPUStylingPipelineStage.js b/packages/engine/Source/Scene/Model/CPUStylingPipelineStage.js index 339f6492126c..92497c0271a7 100644 --- a/packages/engine/Source/Scene/Model/CPUStylingPipelineStage.js +++ b/packages/engine/Source/Scene/Model/CPUStylingPipelineStage.js @@ -35,7 +35,7 @@ const CPUStylingPipelineStage = { CPUStylingPipelineStage.process = function ( renderResources, primitive, - frameState + frameState, ) { const model = renderResources.model; const shaderBuilder = renderResources.shaderBuilder; @@ -50,14 +50,14 @@ CPUStylingPipelineStage.process = function ( shaderBuilder.addUniform( "float", ModelColorPipelineStage.COLOR_BLEND_UNIFORM_NAME, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); renderResources.uniformMap[ ModelColorPipelineStage.COLOR_BLEND_UNIFORM_NAME ] = function () { return ColorBlendMode.getColorBlend( model.colorBlendMode, - model.colorBlendAmount + model.colorBlendAmount, ); }; } @@ -65,7 +65,7 @@ CPUStylingPipelineStage.process = function ( shaderBuilder.addUniform( "bool", "model_commandTranslucent", - ShaderDestination.BOTH + ShaderDestination.BOTH, ); renderResources.uniformMap.model_commandTranslucent = function () { // Always check the current value, because custom shaders may diff --git a/packages/engine/Source/Scene/Model/ClassificationModelDrawCommand.js b/packages/engine/Source/Scene/Model/ClassificationModelDrawCommand.js index 4d23fa50ef79..1b8c3c91115c 100644 --- a/packages/engine/Source/Scene/Model/ClassificationModelDrawCommand.js +++ b/packages/engine/Source/Scene/Model/ClassificationModelDrawCommand.js @@ -173,7 +173,7 @@ function initialize(drawCommand) { drawCommand._commandListDebugWireframe = createBatchCommands( drawCommand, derivedCommands, - drawCommand._commandListDebugWireframe + drawCommand._commandListDebugWireframe, ); const commandList = drawCommand._commandListDebugWireframe; @@ -204,14 +204,14 @@ function initialize(drawCommand) { drawCommand._commandListTerrain = createBatchCommands( drawCommand, derivedCommands, - drawCommand._commandListTerrain + drawCommand._commandListTerrain, ); if (allowPicking) { drawCommand._commandListTerrainPicking = createPickCommands( drawCommand, derivedCommands, - drawCommand._commandListTerrainPicking + drawCommand._commandListTerrainPicking, ); } } @@ -227,14 +227,14 @@ function initialize(drawCommand) { drawCommand._commandList3DTiles = createBatchCommands( drawCommand, derivedCommands, - drawCommand._commandList3DTiles + drawCommand._commandList3DTiles, ); if (allowPicking) { drawCommand._commandList3DTilesPicking = createPickCommands( drawCommand, derivedCommands, - drawCommand._commandList3DTilesPicking + drawCommand._commandList3DTilesPicking, ); } } @@ -423,7 +423,7 @@ Object.defineProperties(ClassificationModelDrawCommand.prototype, { this._boundingVolume = BoundingSphere.transform( boundingSphere, this._modelMatrix, - this._boundingVolume + this._boundingVolume, ); }, }, @@ -477,7 +477,7 @@ Object.defineProperties(ClassificationModelDrawCommand.prototype, { */ ClassificationModelDrawCommand.prototype.pushCommands = function ( frameState, - result + result, ) { const passes = frameState.passes; if (passes.render) { @@ -509,7 +509,7 @@ ClassificationModelDrawCommand.prototype.pushCommands = function ( this._commandListIgnoreShow = createBatchCommands( this, derivedCommands, - this._commandListIgnoreShow + this._commandListIgnoreShow, ); } diff --git a/packages/engine/Source/Scene/Model/ClassificationPipelineStage.js b/packages/engine/Source/Scene/Model/ClassificationPipelineStage.js index ae0e48d03f7e..35e476baf99f 100644 --- a/packages/engine/Source/Scene/Model/ClassificationPipelineStage.js +++ b/packages/engine/Source/Scene/Model/ClassificationPipelineStage.js @@ -37,14 +37,14 @@ const ClassificationPipelineStage = { ClassificationPipelineStage.process = function ( renderResources, primitive, - frameState + frameState, ) { const shaderBuilder = renderResources.shaderBuilder; shaderBuilder.addDefine( "HAS_CLASSIFICATION", undefined, - ShaderDestination.BOTH + ShaderDestination.BOTH, ); const runtimePrimitive = renderResources.runtimePrimitive; @@ -57,12 +57,12 @@ ClassificationPipelineStage.process = function ( function createClassificationBatches(primitive, runtimePrimitive) { const positionAttribute = ModelUtility.getAttributeBySemantic( primitive, - VertexAttributeSemantic.POSITION + VertexAttributeSemantic.POSITION, ); if (!defined(positionAttribute)) { throw new RuntimeError( - "Primitives must have a position attribute to be used for classification." + "Primitives must have a position attribute to be used for classification.", ); } @@ -80,7 +80,7 @@ function createClassificationBatches(primitive, runtimePrimitive) { const featureIdAttribute = ModelUtility.getAttributeBySemantic( primitive, VertexAttributeSemantic.FEATURE_ID, - 0 + 0, ); // If there are no feature IDs, render the primitive in a single batch. diff --git a/packages/engine/Source/Scene/Model/CustomShader.js b/packages/engine/Source/Scene/Model/CustomShader.js index eef3163b7d63..d4ead8fbd3ba 100644 --- a/packages/engine/Source/Scene/Model/CustomShader.js +++ b/packages/engine/Source/Scene/Model/CustomShader.js @@ -180,7 +180,7 @@ function CustomShader(options) { */ this.translucencyMode = defaultValue( options.translucencyMode, - CustomShaderTranslucencyMode.INHERIT + CustomShaderTranslucencyMode.INHERIT, ); /** @@ -249,7 +249,7 @@ function buildUniformMap(customShader) { //>>includeStart('debug', pragmas.debug); if (type === UniformType.SAMPLER_CUBE) { throw new DeveloperError( - "CustomShader does not support samplerCube uniforms" + "CustomShader does not support samplerCube uniforms", ); } //>>includeEnd('debug'); @@ -258,12 +258,12 @@ function buildUniformMap(customShader) { customShader._textureManager.loadTexture2D(uniformName, uniform.value); uniformMap[uniformName] = createUniformTexture2DFunction( customShader, - uniformName + uniformName, ); } else { uniformMap[uniformName] = createUniformFunction( customShader, - uniformName + uniformName, ); } } @@ -275,7 +275,7 @@ function createUniformTexture2DFunction(customShader, uniformName) { return function () { return defaultValue( customShader._textureManager.getTexture(uniformName), - customShader._defaultTexture + customShader._defaultTexture, ); }; } @@ -357,13 +357,13 @@ function validateVariableUsage( variableSet, incorrectVariable, correctVariable, - vertexOrFragment + vertexOrFragment, ) { if (variableSet.hasOwnProperty(incorrectVariable)) { const message = `${expandCoordinateAbbreviations( - incorrectVariable + incorrectVariable, )} is not available in the ${vertexOrFragment} shader. Did you mean ${expandCoordinateAbbreviations( - correctVariable + correctVariable, )} instead?`; throw new DeveloperError(message); } @@ -413,7 +413,7 @@ CustomShader.prototype.setUniform = function (uniformName, value) { Check.defined("value", value); if (!defined(this.uniforms[uniformName])) { throw new DeveloperError( - `Uniform ${uniformName} must be declared in the CustomShader constructor.` + `Uniform ${uniformName} must be declared in the CustomShader constructor.`, ); } //>>includeEnd('debug'); diff --git a/packages/engine/Source/Scene/Model/CustomShaderPipelineStage.js b/packages/engine/Source/Scene/Model/CustomShaderPipelineStage.js index dc53af42acf1..400a31f4828f 100644 --- a/packages/engine/Source/Scene/Model/CustomShaderPipelineStage.js +++ b/packages/engine/Source/Scene/Model/CustomShaderPipelineStage.js @@ -69,7 +69,7 @@ const CustomShaderPipelineStage = { CustomShaderPipelineStage.process = function ( renderResources, primitive, - frameState + frameState, ) { const { shaderBuilder, model, alphaOptions } = renderResources; const { customShader } = model; @@ -109,7 +109,7 @@ CustomShaderPipelineStage.process = function ( shaderBuilder.addDefine( "COMPUTE_POSITION_WC_CUSTOM_SHADER", undefined, - ShaderDestination.BOTH + ShaderDestination.BOTH, ); } @@ -117,7 +117,7 @@ CustomShaderPipelineStage.process = function ( shaderBuilder.addDefine( "HAS_CUSTOM_VERTEX_SHADER", undefined, - ShaderDestination.VERTEX + ShaderDestination.VERTEX, ); } @@ -125,7 +125,7 @@ CustomShaderPipelineStage.process = function ( shaderBuilder.addDefine( "HAS_CUSTOM_FRAGMENT_SHADER", undefined, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); // add defines like CUSTOM_SHADER_MODIFY_MATERIAL @@ -133,7 +133,7 @@ CustomShaderPipelineStage.process = function ( shaderBuilder.addDefine( shaderModeDefine, undefined, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); } @@ -155,7 +155,7 @@ CustomShaderPipelineStage.process = function ( renderResources.uniformMap = combine( renderResources.uniformMap, - customShader.uniformMap + customShader.uniformMap, ); }; @@ -232,12 +232,12 @@ function generateVertexShaderLines(customShader, attributesByName) { const addToShader = getPrimitiveAttributesUsedInShader( attributesByName, primitiveAttributes, - false + false, ); const needsDefault = getAttributesNeedingDefaults( attributesByName, primitiveAttributes, - false + false, ); let vertexInitialization; @@ -264,7 +264,7 @@ function generateVertexShaderLines(customShader, attributesByName) { if (!defined(attributeDefaults)) { CustomShaderPipelineStage._oneTimeWarning( "CustomShaderPipelineStage.incompatiblePrimitiveVS", - `Primitive is missing attribute ${variableName}, disabling custom vertex shader` + `Primitive is missing attribute ${variableName}, disabling custom vertex shader`, ); // This primitive isn't compatible with the shader. Return early // to skip the vertex shader @@ -296,7 +296,7 @@ function generatePositionBuiltins(customShader) { if (usedVariables.hasOwnProperty("positionWC")) { attributeFields.push(["vec3", "positionWC"]); initializationLines.push( - "fsInput.attributes.positionWC = attributes.positionWC;" + "fsInput.attributes.positionWC = attributes.positionWC;", ); } @@ -304,7 +304,7 @@ function generatePositionBuiltins(customShader) { if (usedVariables.hasOwnProperty("positionEC")) { attributeFields.push(["vec3", "positionEC"]); initializationLines.push( - "fsInput.attributes.positionEC = attributes.positionEC;" + "fsInput.attributes.positionEC = attributes.positionEC;", ); } @@ -329,12 +329,12 @@ function generateFragmentShaderLines(customShader, attributesByName) { const addToShader = getPrimitiveAttributesUsedInShader( attributesByName, primitiveAttributes, - true + true, ); const needsDefault = getAttributesNeedingDefaults( attributesByName, primitiveAttributes, - true + true, ); let fragmentInitialization; @@ -362,7 +362,7 @@ function generateFragmentShaderLines(customShader, attributesByName) { if (!defined(attributeDefaults)) { CustomShaderPipelineStage._oneTimeWarning( "CustomShaderPipelineStage.incompatiblePrimitiveFS", - `Primitive is missing attribute ${variableName}, disabling custom fragment shader.` + `Primitive is missing attribute ${variableName}, disabling custom fragment shader.`, ); // This primitive isn't compatible with the shader. Return early @@ -381,9 +381,8 @@ function generateFragmentShaderLines(customShader, attributesByName) { return { enabled: true, attributeFields: attributeFields.concat(positionBuiltins.attributeFields), - initializationLines: positionBuiltins.initializationLines.concat( - initializationLines - ), + initializationLines: + positionBuiltins.initializationLines.concat(initializationLines), }; } @@ -406,7 +405,7 @@ const builtinAttributes = { function getPrimitiveAttributesUsedInShader( primitiveAttributes, shaderAttributeSet, - isFragmentShader + isFragmentShader, ) { const addToShader = {}; for (const attributeName in primitiveAttributes) { @@ -446,7 +445,7 @@ function getPrimitiveAttributesUsedInShader( function getAttributesNeedingDefaults( primitiveAttributes, shaderAttributeSet, - isFragmentShader + isFragmentShader, ) { const needDefaults = []; for (const attributeName in shaderAttributeSet) { @@ -487,7 +486,7 @@ function generateShaderLines(customShader, primitive) { const vertexLines = generateVertexShaderLines(customShader, attributesByName); const fragmentLines = generateFragmentShaderLines( customShader, - attributesByName + attributesByName, ); // positionWC must be computed in the vertex shader @@ -513,7 +512,7 @@ function addVertexLinesToShader(shaderBuilder, vertexLines) { shaderBuilder.addStruct( structId, CustomShaderPipelineStage.STRUCT_NAME_ATTRIBUTES, - ShaderDestination.VERTEX + ShaderDestination.VERTEX, ); const { attributeFields, initializationLines } = vertexLines; @@ -528,36 +527,36 @@ function addVertexLinesToShader(shaderBuilder, vertexLines) { shaderBuilder.addStruct( structId, CustomShaderPipelineStage.STRUCT_NAME_VERTEX_INPUT, - ShaderDestination.VERTEX + ShaderDestination.VERTEX, ); shaderBuilder.addStructField( structId, CustomShaderPipelineStage.STRUCT_NAME_ATTRIBUTES, - "attributes" + "attributes", ); // Add FeatureIds struct from the Feature ID stage shaderBuilder.addStructField( structId, FeatureIdPipelineStage.STRUCT_NAME_FEATURE_IDS, - "featureIds" + "featureIds", ); // Add Metadata struct from the metadata stage shaderBuilder.addStructField( structId, MetadataPipelineStage.STRUCT_NAME_METADATA, - "metadata" + "metadata", ); // Add MetadataClass struct from the metadata stage shaderBuilder.addStructField( structId, MetadataPipelineStage.STRUCT_NAME_METADATA_CLASS, - "metadataClass" + "metadataClass", ); // Add MetadataStatistics struct from the metadata stage shaderBuilder.addStructField( structId, MetadataPipelineStage.STRUCT_NAME_METADATA_STATISTICS, - "metadataStatistics" + "metadataStatistics", ); const functionId = @@ -565,7 +564,7 @@ function addVertexLinesToShader(shaderBuilder, vertexLines) { shaderBuilder.addFunction( functionId, CustomShaderPipelineStage.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_VS, - ShaderDestination.VERTEX + ShaderDestination.VERTEX, ); shaderBuilder.addFunctionLines(functionId, initializationLines); @@ -576,7 +575,7 @@ function addFragmentLinesToShader(shaderBuilder, fragmentLines) { shaderBuilder.addStruct( structId, CustomShaderPipelineStage.STRUCT_NAME_ATTRIBUTES, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); const { attributeFields, initializationLines } = fragmentLines; @@ -589,36 +588,36 @@ function addFragmentLinesToShader(shaderBuilder, fragmentLines) { shaderBuilder.addStruct( structId, CustomShaderPipelineStage.STRUCT_NAME_FRAGMENT_INPUT, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); shaderBuilder.addStructField( structId, CustomShaderPipelineStage.STRUCT_NAME_ATTRIBUTES, - "attributes" + "attributes", ); // Add FeatureIds struct from the Feature ID stage shaderBuilder.addStructField( structId, FeatureIdPipelineStage.STRUCT_NAME_FEATURE_IDS, - "featureIds" + "featureIds", ); // Add Metadata struct from the metadata stage shaderBuilder.addStructField( structId, MetadataPipelineStage.STRUCT_NAME_METADATA, - "metadata" + "metadata", ); // Add MetadataClass struct from the metadata stage shaderBuilder.addStructField( structId, MetadataPipelineStage.STRUCT_NAME_METADATA_CLASS, - "metadataClass" + "metadataClass", ); // Add MetadataStatistics struct from the metadata stage shaderBuilder.addStructField( structId, MetadataPipelineStage.STRUCT_NAME_METADATA_STATISTICS, - "metadataStatistics" + "metadataStatistics", ); const functionId = @@ -626,7 +625,7 @@ function addFragmentLinesToShader(shaderBuilder, fragmentLines) { shaderBuilder.addFunction( functionId, CustomShaderPipelineStage.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_FS, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); shaderBuilder.addFunctionLines(functionId, initializationLines); @@ -645,7 +644,7 @@ function addLinesToShader(shaderBuilder, customShader, generatedCode) { shaderLines.push( "#line 0", customShader.vertexShaderText, - CustomShaderStageVS + CustomShaderStageVS, ); shaderBuilder.addVertexLines(shaderLines); @@ -658,7 +657,7 @@ function addLinesToShader(shaderBuilder, customShader, generatedCode) { shaderLines.push( "#line 0", customShader.fragmentShaderText, - CustomShaderStageFS + CustomShaderStageFS, ); shaderBuilder.addFragmentLines(shaderLines); diff --git a/packages/engine/Source/Scene/Model/DequantizationPipelineStage.js b/packages/engine/Source/Scene/Model/DequantizationPipelineStage.js index dc5a21317b05..def5ddbbb4e9 100644 --- a/packages/engine/Source/Scene/Model/DequantizationPipelineStage.js +++ b/packages/engine/Source/Scene/Model/DequantizationPipelineStage.js @@ -37,7 +37,7 @@ const DequantizationPipelineStage = { DequantizationPipelineStage.process = function ( renderResources, primitive, - frameState + frameState, ) { const shaderBuilder = renderResources.shaderBuilder; const model = renderResources.model; @@ -46,13 +46,13 @@ DequantizationPipelineStage.process = function ( shaderBuilder.addDefine( "USE_DEQUANTIZATION", undefined, - ShaderDestination.VERTEX + ShaderDestination.VERTEX, ); shaderBuilder.addFunction( DequantizationPipelineStage.FUNCTION_ID_DEQUANTIZATION_STAGE_VS, DequantizationPipelineStage.FUNCTION_SIGNATURE_DEQUANTIZATION_STAGE_VS, - ShaderDestination.VERTEX + ShaderDestination.VERTEX, ); const attributes = primitive.attributes; @@ -90,7 +90,7 @@ function addDequantizationUniforms(renderResources, attributeInfo) { shaderBuilder.addUniform( "float", normalizationRange, - ShaderDestination.VERTEX + ShaderDestination.VERTEX, ); uniformMap[normalizationRange] = function () { return quantization.normalizationRange; @@ -145,7 +145,7 @@ function updateDequantizationFunction(shaderBuilder, attributeInfo) { shaderBuilder.addFunctionLines( DequantizationPipelineStage.FUNCTION_ID_DEQUANTIZATION_STAGE_VS, - [line] + [line], ); } diff --git a/packages/engine/Source/Scene/Model/FeatureIdPipelineStage.js b/packages/engine/Source/Scene/Model/FeatureIdPipelineStage.js index 5c3d8ef5c083..a4f25ff160f9 100644 --- a/packages/engine/Source/Scene/Model/FeatureIdPipelineStage.js +++ b/packages/engine/Source/Scene/Model/FeatureIdPipelineStage.js @@ -53,7 +53,7 @@ const FeatureIdPipelineStage = { FeatureIdPipelineStage.process = function ( renderResources, primitive, - frameState + frameState, ) { const shaderBuilder = renderResources.shaderBuilder; declareStructsAndFunctions(shaderBuilder); @@ -75,12 +75,12 @@ function declareStructsAndFunctions(shaderBuilder) { shaderBuilder.addStruct( FeatureIdPipelineStage.STRUCT_ID_FEATURE_IDS_VS, FeatureIdPipelineStage.STRUCT_NAME_FEATURE_IDS, - ShaderDestination.VERTEX + ShaderDestination.VERTEX, ); shaderBuilder.addStruct( FeatureIdPipelineStage.STRUCT_ID_FEATURE_IDS_FS, FeatureIdPipelineStage.STRUCT_NAME_FEATURE_IDS, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); // declare the initializeFeatureIds() function. The details may differ @@ -88,12 +88,12 @@ function declareStructsAndFunctions(shaderBuilder) { shaderBuilder.addFunction( FeatureIdPipelineStage.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS, FeatureIdPipelineStage.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS, - ShaderDestination.VERTEX + ShaderDestination.VERTEX, ); shaderBuilder.addFunction( FeatureIdPipelineStage.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS, FeatureIdPipelineStage.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); // declare the initializeFeatureIdAliases() function. The details may differ @@ -101,19 +101,19 @@ function declareStructsAndFunctions(shaderBuilder) { shaderBuilder.addFunction( FeatureIdPipelineStage.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS, FeatureIdPipelineStage.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES, - ShaderDestination.VERTEX + ShaderDestination.VERTEX, ); shaderBuilder.addFunction( FeatureIdPipelineStage.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS, FeatureIdPipelineStage.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); // declare the setFeatureIdVaryings() function in the vertex shader only shaderBuilder.addFunction( FeatureIdPipelineStage.FUNCTION_ID_SET_FEATURE_ID_VARYINGS, FeatureIdPipelineStage.FUNCTION_SIGNATURE_SET_FEATURE_ID_VARYINGS, - ShaderDestination.VERTEX + ShaderDestination.VERTEX, ); } @@ -135,7 +135,7 @@ function processInstanceFeatureIds(renderResources, instances, frameState) { variableName, count, instanceDivisor, - frameState + frameState, ); } @@ -150,7 +150,7 @@ function processPrimitiveFeatureIds(renderResources, primitive, frameState) { const featureIdsArray = primitive.featureIds; const positionAttribute = ModelUtility.getAttributeBySemantic( primitive, - VertexAttributeSemantic.POSITION + VertexAttributeSemantic.POSITION, ); const count = positionAttribute.count; @@ -168,7 +168,7 @@ function processPrimitiveFeatureIds(renderResources, primitive, frameState) { variableName, count, undefined, - frameState + frameState, ); } else { processTexture(renderResources, featureIds, variableName, i, frameState); @@ -185,7 +185,7 @@ function processPrimitiveFeatureIds(renderResources, primitive, frameState) { function processInstanceAttribute( renderResources, featureIdAttribute, - variableName + variableName, ) { // Add a field to the FeatureIds struct. // Example: @@ -198,12 +198,12 @@ function processInstanceAttribute( shaderBuilder.addStructField( FeatureIdPipelineStage.STRUCT_ID_FEATURE_IDS_VS, "int", - variableName + variableName, ); shaderBuilder.addStructField( FeatureIdPipelineStage.STRUCT_ID_FEATURE_IDS_FS, "int", - variableName + variableName, ); // Initialize the field from the corresponding attribute. @@ -218,11 +218,11 @@ function processInstanceAttribute( shaderBuilder.addFunctionLines( FeatureIdPipelineStage.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS, - [vertexLine] + [vertexLine], ); shaderBuilder.addFunctionLines( FeatureIdPipelineStage.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS, - [fragmentLine] + [fragmentLine], ); // Instanced attributes don't normally need varyings, so add one here @@ -233,7 +233,7 @@ function processInstanceAttribute( // v_instanceFeatureId_n = a_instanceFeatureId_n; shaderBuilder.addFunctionLines( FeatureIdPipelineStage.FUNCTION_ID_SET_FEATURE_ID_VARYINGS, - [`${varyingName} = ${attributeName};`] + [`${varyingName} = ${attributeName};`], ); } @@ -249,12 +249,12 @@ function processAttribute(renderResources, featureIdAttribute, variableName) { shaderBuilder.addStructField( FeatureIdPipelineStage.STRUCT_ID_FEATURE_IDS_VS, "int", - variableName + variableName, ); shaderBuilder.addStructField( FeatureIdPipelineStage.STRUCT_ID_FEATURE_IDS_FS, "int", - variableName + variableName, ); // Initialize the field from the corresponding attribute. @@ -269,11 +269,11 @@ function processAttribute(renderResources, featureIdAttribute, variableName) { ]; shaderBuilder.addFunctionLines( FeatureIdPipelineStage.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS, - initializationLines + initializationLines, ); shaderBuilder.addFunctionLines( FeatureIdPipelineStage.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS, - initializationLines + initializationLines, ); } @@ -283,7 +283,7 @@ function processImplicitRange( variableName, count, instanceDivisor, - frameState + frameState, ) { // Generate a vertex attribute for the implicit IDs since WebGL 1 does not // support gl_VertexID @@ -292,7 +292,7 @@ function processImplicitRange( implicitFeatureIds, count, instanceDivisor, - frameState + frameState, ); // Declare the vertex attribute in the shader @@ -316,12 +316,12 @@ function processImplicitRange( shaderBuilder.addStructField( FeatureIdPipelineStage.STRUCT_ID_FEATURE_IDS_VS, "int", - variableName + variableName, ); shaderBuilder.addStructField( FeatureIdPipelineStage.STRUCT_ID_FEATURE_IDS_FS, "int", - variableName + variableName, ); // The varying needs initialization in the vertex shader @@ -329,7 +329,7 @@ function processImplicitRange( // v_implicit_featureId_n = a_implicit_featureId_n; shaderBuilder.addFunctionLines( FeatureIdPipelineStage.FUNCTION_ID_SET_FEATURE_ID_VARYINGS, - [`${implicitVaryingName} = ${implicitAttributeName};`] + [`${implicitVaryingName} = ${implicitAttributeName};`], ); // Initialize the field from the generated attribute/varying. @@ -338,11 +338,11 @@ function processImplicitRange( // featureIds.featureId_n = v_implicit_featureId_n; (FS) shaderBuilder.addFunctionLines( FeatureIdPipelineStage.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS, - [`featureIds.${variableName} = int(czm_round(${implicitAttributeName}));`] + [`featureIds.${variableName} = int(czm_round(${implicitAttributeName}));`], ); shaderBuilder.addFunctionLines( FeatureIdPipelineStage.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS, - [`featureIds.${variableName} = int(czm_round(${implicitVaryingName}));`] + [`featureIds.${variableName} = int(czm_round(${implicitVaryingName}));`], ); } @@ -351,7 +351,7 @@ function processTexture( featureIdTexture, variableName, index, - frameState + frameState, ) { // Create the feature ID texture uniform. The index matches the index from // the featureIds array, even if this is not consecutive. @@ -361,7 +361,7 @@ function processTexture( uniformMap[uniformName] = function () { return defaultValue( textureReader.texture, - frameState.context.defaultTexture + frameState.context.defaultTexture, ); }; @@ -378,14 +378,14 @@ function processTexture( shaderBuilder.addStructField( FeatureIdPipelineStage.STRUCT_ID_FEATURE_IDS_FS, "int", - variableName + variableName, ); // Declare the uniform in the fragment shader shaderBuilder.addUniform( "sampler2D", uniformName, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); // Get a GLSL expression for the texture coordinates @@ -401,7 +401,7 @@ function processTexture( shaderBuilder.addUniform( "mat3", transformUniformName, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); uniformMap[transformUniformName] = function () { return transform; @@ -421,7 +421,7 @@ function processTexture( shaderBuilder.addFunctionLines( FeatureIdPipelineStage.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS, - [initializationLine] + [initializationLine], ); } @@ -439,13 +439,13 @@ function addAlias(renderResources, variableName, alias, shaderDestination) { shaderBuilder.addStructField( FeatureIdPipelineStage.STRUCT_ID_FEATURE_IDS_VS, "int", - alias + alias, ); } shaderBuilder.addStructField( FeatureIdPipelineStage.STRUCT_ID_FEATURE_IDS_FS, "int", - alias + alias, ); // Initialize the field from the original variable @@ -456,12 +456,12 @@ function addAlias(renderResources, variableName, alias, shaderDestination) { if (updateVS) { shaderBuilder.addFunctionLines( FeatureIdPipelineStage.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS, - initializationLines + initializationLines, ); } shaderBuilder.addFunctionLines( FeatureIdPipelineStage.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS, - initializationLines + initializationLines, ); } @@ -470,7 +470,7 @@ function generateImplicitFeatureIdAttribute( implicitFeatureIds, count, instanceDivisor, - frameState + frameState, ) { const model = renderResources.model; let vertexBuffer; @@ -478,7 +478,7 @@ function generateImplicitFeatureIdAttribute( if (defined(implicitFeatureIds.repeat)) { const typedArray = generateImplicitFeatureIdTypedArray( implicitFeatureIds, - count + count, ); vertexBuffer = Buffer.createVertexBuffer({ context: frameState.context, diff --git a/packages/engine/Source/Scene/Model/GeoJsonLoader.js b/packages/engine/Source/Scene/Model/GeoJsonLoader.js index 5bc67d5ec9ca..092962cd10f5 100644 --- a/packages/engine/Source/Scene/Model/GeoJsonLoader.js +++ b/packages/engine/Source/Scene/Model/GeoJsonLoader.js @@ -272,7 +272,7 @@ function createLinesPrimitive(features, toLocal, frameState) { const featureIdsTypedArray = new Float32Array(vertexCount); const indicesTypedArray = IndexDatatype.createTypedArray( vertexCount, - indexCount + indexCount, ); const indexDatatype = IndexDatatype.fromTypedArray(indicesTypedArray); @@ -280,13 +280,13 @@ function createLinesPrimitive(features, toLocal, frameState) { const localMin = new Cartesian3( Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY, - Number.POSITIVE_INFINITY + Number.POSITIVE_INFINITY, ); const localMax = new Cartesian3( Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY, - Number.NEGATIVE_INFINITY + Number.NEGATIVE_INFINITY, ); let vertexCounter = 0; @@ -310,12 +310,12 @@ function createLinesPrimitive(features, toLocal, frameState) { cartographic.y, cartographic.z, Ellipsoid.WGS84, - scratchCartesian + scratchCartesian, ); const localCartesian = Matrix4.multiplyByPoint( toLocal, globalCartesian, - scratchCartesian + scratchCartesian, ); Cartesian3.minimumByComponent(localMin, localCartesian, localMin); @@ -426,13 +426,13 @@ function createPointsPrimitive(features, toLocal, frameState) { const localMin = new Cartesian3( Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY, - Number.POSITIVE_INFINITY + Number.POSITIVE_INFINITY, ); const localMax = new Cartesian3( Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY, - Number.NEGATIVE_INFINITY + Number.NEGATIVE_INFINITY, ); let vertexCounter = 0; @@ -452,12 +452,12 @@ function createPointsPrimitive(features, toLocal, frameState) { cartographic.y, cartographic.z, Ellipsoid.WGS84, - scratchCartesian + scratchCartesian, ); const localCartesian = Matrix4.multiplyByPoint( toLocal, globalCartesian, - scratchCartesian + scratchCartesian, ); Cartesian3.minimumByComponent(localMin, localCartesian, localMin); @@ -548,7 +548,7 @@ function parse(geoJson, frameState) { const feature = features[i]; const featureProperties = defaultValue( feature.properties, - defaultValue.EMPTY_OBJECT + defaultValue.EMPTY_OBJECT, ); for (const propertyId in featureProperties) { if (featureProperties.hasOwnProperty(propertyId)) { @@ -593,13 +593,13 @@ function parse(geoJson, frameState) { const cartographicMin = new Cartesian3( Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY, - Number.POSITIVE_INFINITY + Number.POSITIVE_INFINITY, ); const cartographicMax = new Cartesian3( Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY, - Number.NEGATIVE_INFINITY + Number.NEGATIVE_INFINITY, ); let hasLines = false; @@ -617,12 +617,12 @@ function parse(geoJson, frameState) { Cartesian3.minimumByComponent( cartographicMin, line[k], - cartographicMin + cartographicMin, ); Cartesian3.maximumByComponent( cartographicMax, line[k], - cartographicMax + cartographicMax, ); } } @@ -643,19 +643,19 @@ function parse(geoJson, frameState) { const cartographicCenter = Cartesian3.midpoint( cartographicMin, cartographicMax, - new Cartesian3() + new Cartesian3(), ); const ecefCenter = Cartesian3.fromDegrees( cartographicCenter.x, cartographicCenter.y, cartographicCenter.z, Ellipsoid.WGS84, - new Cartesian3() + new Cartesian3(), ); const toGlobal = Transforms.eastNorthUpToFixedFrame( ecefCenter, Ellipsoid.WGS84, - new Matrix4() + new Matrix4(), ); const toLocal = Matrix4.inverseTransformation(toGlobal, new Matrix4()); diff --git a/packages/engine/Source/Scene/Model/GeometryPipelineStage.js b/packages/engine/Source/Scene/Model/GeometryPipelineStage.js index 28b769a07c96..45a8e2b42c60 100644 --- a/packages/engine/Source/Scene/Model/GeometryPipelineStage.js +++ b/packages/engine/Source/Scene/Model/GeometryPipelineStage.js @@ -61,7 +61,7 @@ const GeometryPipelineStage = { GeometryPipelineStage.process = function ( renderResources, primitive, - frameState + frameState, ) { const { shaderBuilder, model } = renderResources; @@ -70,12 +70,12 @@ GeometryPipelineStage.process = function ( shaderBuilder.addStruct( GeometryPipelineStage.STRUCT_ID_PROCESSED_ATTRIBUTES_VS, "ProcessedAttributes", - ShaderDestination.VERTEX + ShaderDestination.VERTEX, ); shaderBuilder.addStruct( GeometryPipelineStage.STRUCT_ID_PROCESSED_ATTRIBUTES_FS, "ProcessedAttributes", - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); // The Feature struct is always added since it's required for compilation. @@ -83,7 +83,7 @@ GeometryPipelineStage.process = function ( shaderBuilder.addStruct( SelectedFeatureIdPipelineStage.STRUCT_ID_SELECTED_FEATURE, SelectedFeatureIdPipelineStage.STRUCT_NAME_SELECTED_FEATURE, - ShaderDestination.BOTH + ShaderDestination.BOTH, ); // This initialization function is only needed in the vertex shader, @@ -92,7 +92,7 @@ GeometryPipelineStage.process = function ( shaderBuilder.addFunction( GeometryPipelineStage.FUNCTION_ID_INITIALIZE_ATTRIBUTES, GeometryPipelineStage.FUNCTION_SIGNATURE_INITIALIZE_ATTRIBUTES, - ShaderDestination.VERTEX + ShaderDestination.VERTEX, ); // Positions in other coordinate systems need more variables @@ -101,12 +101,12 @@ GeometryPipelineStage.process = function ( shaderBuilder.addStructField( GeometryPipelineStage.STRUCT_ID_PROCESSED_ATTRIBUTES_FS, "vec3", - "positionWC" + "positionWC", ); shaderBuilder.addStructField( GeometryPipelineStage.STRUCT_ID_PROCESSED_ATTRIBUTES_FS, "vec3", - "positionEC" + "positionEC", ); // Though they have identical signatures, the implementation is different @@ -115,12 +115,12 @@ GeometryPipelineStage.process = function ( shaderBuilder.addFunction( GeometryPipelineStage.FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS, GeometryPipelineStage.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS, - ShaderDestination.VERTEX + ShaderDestination.VERTEX, ); shaderBuilder.addFunction( GeometryPipelineStage.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS, GeometryPipelineStage.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); // .pnts point clouds store sRGB color rather than linear color @@ -128,7 +128,7 @@ GeometryPipelineStage.process = function ( shaderBuilder.addDefine( "HAS_SRGB_COLOR", undefined, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); } @@ -150,13 +150,13 @@ GeometryPipelineStage.process = function ( for (let i = 0; i < length; i++) { const attribute = primitive.attributes[i]; const attributeLocationCount = AttributeType.getAttributeLocationCount( - attribute.type + attribute.type, ); //>>includeStart('debug', pragmas.debug); if (!defined(attribute.buffer) && !defined(attribute.constant)) { throw new DeveloperError( - "Attributes must be provided as a Buffer or constant value" + "Attributes must be provided as a Buffer or constant value", ); } //>>includeEnd('debug'); @@ -180,7 +180,7 @@ GeometryPipelineStage.process = function ( index, attributeLocationCount, use2D, - instanced + instanced, ); } @@ -200,7 +200,7 @@ function processAttribute( attributeIndex, attributeLocationCount, use2D, - instanced + instanced, ) { const shaderBuilder = renderResources.shaderBuilder; const attributeInfo = ModelUtility.getAttributeInfo(attribute); @@ -215,14 +215,14 @@ function processAttribute( renderResources, attribute, attributeIndex, - attributeLocationCount + attributeLocationCount, ); } else { addAttributeToRenderResources( renderResources, attribute, attributeIndex, - modifyFor2D + modifyFor2D, ); } @@ -267,7 +267,7 @@ function addAttributeToRenderResources( renderResources, attribute, attributeIndex, - modifyFor2D + modifyFor2D, ) { const { quantization, semantic, setIndex } = attribute; const { type, componentDatatype } = defined(quantization) @@ -324,7 +324,7 @@ function addMatrixAttributeToRenderResources( renderResources, attribute, attributeIndex, - columnCount + columnCount, ) { const { quantization, normalized } = attribute; const { type, componentDatatype } = defined(quantization) @@ -336,9 +336,8 @@ function addMatrixAttributeToRenderResources( // componentsPerColumn is either 2, 3, or 4 const componentsPerColumn = componentCount / columnCount; - const componentSizeInBytes = ComponentDatatype.getSizeInBytes( - componentDatatype - ); + const componentSizeInBytes = + ComponentDatatype.getSizeInBytes(componentDatatype); const columnLengthInBytes = componentsPerColumn * componentSizeInBytes; @@ -444,7 +443,7 @@ function updateAttributesStruct(shaderBuilder, attributeInfo, use2D) { function updateInitializeAttributesFunction( shaderBuilder, attributeInfo, - use2D + use2D, ) { const functionId = GeometryPipelineStage.FUNCTION_ID_INITIALIZE_ATTRIBUTES; const variableName = attributeInfo.variableName; @@ -518,12 +517,12 @@ function handleBitangents(shaderBuilder, attributes) { shaderBuilder.addStructField( GeometryPipelineStage.STRUCT_ID_PROCESSED_ATTRIBUTES_VS, "vec3", - "bitangentMC" + "bitangentMC", ); shaderBuilder.addStructField( GeometryPipelineStage.STRUCT_ID_PROCESSED_ATTRIBUTES_FS, "vec3", - "bitangentEC" + "bitangentEC", ); } diff --git a/packages/engine/Source/Scene/Model/I3dmLoader.js b/packages/engine/Source/Scene/Model/I3dmLoader.js index 0f9457624419..8328628bd150 100644 --- a/packages/engine/Source/Scene/Model/I3dmLoader.js +++ b/packages/engine/Source/Scene/Model/I3dmLoader.js @@ -79,17 +79,17 @@ function I3dmLoader(options) { const asynchronous = defaultValue(options.asynchronous, true); const incrementallyLoadTextures = defaultValue( options.incrementallyLoadTextures, - true + true, ); const upAxis = defaultValue(options.upAxis, Axis.Y); const forwardAxis = defaultValue(options.forwardAxis, Axis.X); const loadAttributesAsTypedArray = defaultValue( options.loadAttributesAsTypedArray, - false + false, ); const loadIndicesForWireframe = defaultValue( options.loadIndicesForWireframe, - false + false, ); const loadPrimitiveOutline = defaultValue(options.loadPrimitiveOutline, true); const enablePick = defaultValue(options.enablePick, false); @@ -207,7 +207,7 @@ I3dmLoader.prototype.load = function () { // Generate the feature table. const featureTable = new Cesium3DTileFeatureTable( featureTableJson, - featureTableBinary + featureTableBinary, ); this._featureTable = featureTable; @@ -216,7 +216,7 @@ I3dmLoader.prototype.load = function () { featureTable.featuresLength = instancesLength; if (!defined(instancesLength)) { throw new RuntimeError( - "Feature table global property: INSTANCES_LENGTH must be defined" + "Feature table global property: INSTANCES_LENGTH must be defined", ); } this._instancesLength = instancesLength; @@ -225,7 +225,7 @@ I3dmLoader.prototype.load = function () { const rtcCenter = featureTable.getGlobalProperty( "RTC_CENTER", ComponentDatatype.FLOAT, - 3 + 3, ); if (defined(rtcCenter)) { this._transform = Matrix4.fromTranslation(Cartesian3.fromArray(rtcCenter)); @@ -324,7 +324,7 @@ I3dmLoader.prototype.process = function (frameState) { components.transform = Matrix4.multiplyTransformation( this._transform, components.transform, - components.transform + components.transform, ); createInstances(this, components, frameState); @@ -385,7 +385,7 @@ function createInstances(loader, components, frameState) { const rtcCenter = featureTable.getGlobalProperty( "RTC_CENTER", ComponentDatatype.FLOAT, - 3 + 3, ); const eastNorthUp = featureTable.getGlobalProperty("EAST_NORTH_UP"); @@ -438,7 +438,7 @@ function createInstances(loader, components, frameState) { Cartesian3.subtract( instancePositions[i], positionBoundingSphere.center, - positionScratch + positionScratch, ); translationTypedArray[3 * i + 0] = positionScratch.x; @@ -449,7 +449,7 @@ function createInstances(loader, components, frameState) { // Set the center of the bounding sphere as the RTC center transform. const centerTransform = Matrix4.fromTranslation( positionBoundingSphere.center, - transformScratch + transformScratch, ); // Combine the center transform and the CESIUM_RTC transform from the glTF. @@ -458,7 +458,7 @@ function createInstances(loader, components, frameState) { components.transform = Matrix4.multiplyTransformation( centerTransform, components.transform, - components.transform + components.transform, ); } @@ -470,7 +470,7 @@ function createInstances(loader, components, frameState) { Cartesian3.add( instancePosition, Cartesian3.unpack(rtcCenter), - instancePosition + instancePosition, ); } @@ -486,7 +486,7 @@ function createInstances(loader, components, frameState) { instanceNormalRight, instanceNormalForward, instanceRotation, - instanceTransform + instanceTransform, ); Quaternion.pack(instanceQuaternion, instanceQuaternionArray, 0); rotationTypedArray[4 * i + 0] = instanceQuaternionArray[0]; @@ -509,7 +509,7 @@ function createInstances(loader, components, frameState) { "BATCH_ID", ComponentDatatype.UNSIGNED_SHORT, 1, - i + i, ); if (!defined(batchId)) { // If BATCH_ID semantic is undefined, batchId is just the instance number @@ -676,35 +676,35 @@ function getPositions(featureTable, instancesLength) { return featureTable.getPropertyArray( "POSITION", ComponentDatatype.FLOAT, - 3 + 3, ); } else if (featureTable.hasProperty("POSITION_QUANTIZED")) { // Handle quantized positions. const quantizedPositions = featureTable.getPropertyArray( "POSITION_QUANTIZED", ComponentDatatype.UNSIGNED_SHORT, - 3 + 3, ); const quantizedVolumeOffset = featureTable.getGlobalProperty( "QUANTIZED_VOLUME_OFFSET", ComponentDatatype.FLOAT, - 3 + 3, ); if (!defined(quantizedVolumeOffset)) { throw new RuntimeError( - "Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions." + "Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.", ); } const quantizedVolumeScale = featureTable.getGlobalProperty( "QUANTIZED_VOLUME_SCALE", ComponentDatatype.FLOAT, - 3 + 3, ); if (!defined(quantizedVolumeScale)) { throw new RuntimeError( - "Global property: QUANTIZED_VOLUME_SCALE must be defined for quantized positions." + "Global property: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.", ); } @@ -723,7 +723,7 @@ function getPositions(featureTable, instancesLength) { // eslint-disable-next-line no-else-return } else { throw new RuntimeError( - "Either POSITION or POSITION_QUANTIZED must be defined for each instance." + "Either POSITION or POSITION_QUANTIZED must be defined for each instance.", ); } } @@ -739,7 +739,7 @@ function processRotation( instanceNormalRight, instanceNormalForward, instanceRotation, - instanceTransform + instanceTransform, ) { // Get the instance rotation const normalUp = featureTable.getProperty( @@ -747,20 +747,20 @@ function processRotation( ComponentDatatype.FLOAT, 3, i, - propertyScratch1 + propertyScratch1, ); const normalRight = featureTable.getProperty( "NORMAL_RIGHT", ComponentDatatype.FLOAT, 3, i, - propertyScratch2 + propertyScratch2, ); let hasCustomOrientation = false; if (defined(normalUp)) { if (!defined(normalRight)) { throw new RuntimeError( - "To define a custom orientation, both NORMAL_UP and NORMAL_RIGHT must be defined." + "To define a custom orientation, both NORMAL_UP and NORMAL_RIGHT must be defined.", ); } Cartesian3.unpack(normalUp, 0, instanceNormalUp); @@ -772,39 +772,39 @@ function processRotation( ComponentDatatype.UNSIGNED_SHORT, 2, i, - propertyScratch1 + propertyScratch1, ); const octNormalRight = featureTable.getProperty( "NORMAL_RIGHT_OCT32P", ComponentDatatype.UNSIGNED_SHORT, 2, i, - propertyScratch2 + propertyScratch2, ); if (defined(octNormalUp)) { if (!defined(octNormalRight)) { throw new RuntimeError( - "To define a custom orientation with oct-encoded vectors, both NORMAL_UP_OCT32P and NORMAL_RIGHT_OCT32P must be defined." + "To define a custom orientation with oct-encoded vectors, both NORMAL_UP_OCT32P and NORMAL_RIGHT_OCT32P must be defined.", ); } AttributeCompression.octDecodeInRange( octNormalUp[0], octNormalUp[1], 65535, - instanceNormalUp + instanceNormalUp, ); AttributeCompression.octDecodeInRange( octNormalRight[0], octNormalRight[1], 65535, - instanceNormalRight + instanceNormalRight, ); hasCustomOrientation = true; } else if (eastNorthUp) { Transforms.eastNorthUpToFixedFrame( instancePosition, Ellipsoid.WGS84, - instanceTransform + instanceTransform, ); Matrix4.getMatrix3(instanceTransform, instanceRotation); } else { @@ -815,21 +815,21 @@ function processRotation( Cartesian3.cross( instanceNormalRight, instanceNormalUp, - instanceNormalForward + instanceNormalForward, ); Cartesian3.normalize(instanceNormalForward, instanceNormalForward); Matrix3.setColumn( instanceRotation, 0, instanceNormalRight, - instanceRotation + instanceRotation, ); Matrix3.setColumn(instanceRotation, 1, instanceNormalUp, instanceRotation); Matrix3.setColumn( instanceRotation, 2, instanceNormalForward, - instanceRotation + instanceRotation, ); } Quaternion.fromRotationMatrix(instanceRotation, instanceQuaternion); @@ -841,7 +841,7 @@ function processScale(featureTable, i, instanceScale) { "SCALE", ComponentDatatype.FLOAT, 1, - i + i, ); if (defined(scale)) { Cartesian3.multiplyByScalar(instanceScale, scale, instanceScale); @@ -851,7 +851,7 @@ function processScale(featureTable, i, instanceScale) { ComponentDatatype.FLOAT, 3, i, - propertyScratch1 + propertyScratch1, ); if (defined(nonUniformScale)) { instanceScale.x *= nonUniformScale[0]; diff --git a/packages/engine/Source/Scene/Model/ImageBasedLightingPipelineStage.js b/packages/engine/Source/Scene/Model/ImageBasedLightingPipelineStage.js index 3b11475908d8..a1a6deb9a285 100644 --- a/packages/engine/Source/Scene/Model/ImageBasedLightingPipelineStage.js +++ b/packages/engine/Source/Scene/Model/ImageBasedLightingPipelineStage.js @@ -18,7 +18,7 @@ const ImageBasedLightingPipelineStage = { ImageBasedLightingPipelineStage.process = function ( renderResources, model, - frameState + frameState, ) { const imageBasedLighting = model.imageBasedLighting; const shaderBuilder = renderResources.shaderBuilder; @@ -26,12 +26,12 @@ ImageBasedLightingPipelineStage.process = function ( shaderBuilder.addDefine( "USE_IBL_LIGHTING", undefined, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); shaderBuilder.addUniform( "vec2", "model_iblFactor", - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); if (SpecularEnvironmentCubeMap.isSupported(frameState.context)) { @@ -43,7 +43,7 @@ ImageBasedLightingPipelineStage.process = function ( shaderBuilder.addUniform( "mat3", "model_iblReferenceFrameMatrix", - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); } @@ -51,23 +51,23 @@ ImageBasedLightingPipelineStage.process = function ( shaderBuilder.addDefine( "DIFFUSE_IBL", undefined, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); shaderBuilder.addDefine( "CUSTOM_SPHERICAL_HARMONICS", undefined, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); shaderBuilder.addUniform( "vec3", "model_sphericalHarmonicCoefficients[9]", - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); } else if (imageBasedLighting.useDefaultSphericalHarmonics) { shaderBuilder.addDefine( "DIFFUSE_IBL", undefined, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); } @@ -78,28 +78,28 @@ ImageBasedLightingPipelineStage.process = function ( shaderBuilder.addDefine( "SPECULAR_IBL", undefined, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); shaderBuilder.addDefine( "CUSTOM_SPECULAR_IBL", undefined, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); shaderBuilder.addUniform( "samplerCube", "model_specularEnvironmentMaps", - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); shaderBuilder.addUniform( "float", "model_specularEnvironmentMapsMaximumLOD", - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); } else if (model.useDefaultSpecularMaps) { shaderBuilder.addDefine( "SPECULAR_IBL", undefined, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); } } @@ -108,12 +108,12 @@ ImageBasedLightingPipelineStage.process = function ( shaderBuilder.addDefine( "USE_SUN_LUMINANCE", undefined, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); shaderBuilder.addUniform( "float", "model_luminanceAtZenith", - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); } diff --git a/packages/engine/Source/Scene/Model/InstancingPipelineStage.js b/packages/engine/Source/Scene/Model/InstancingPipelineStage.js index f1c209285b93..682d2904cd5d 100644 --- a/packages/engine/Source/Scene/Model/InstancingPipelineStage.js +++ b/packages/engine/Source/Scene/Model/InstancingPipelineStage.js @@ -83,14 +83,14 @@ InstancingPipelineStage.process = function (renderResources, node, frameState) { instances, instancingVertexAttributes, use2D, - keepTypedArray + keepTypedArray, ); processFeatureIdAttributes( renderResources, frameState, instances, - instancingVertexAttributes + instancingVertexAttributes, ); const uniformMap = {}; @@ -99,17 +99,17 @@ InstancingPipelineStage.process = function (renderResources, node, frameState) { shaderBuilder.addDefine( "USE_LEGACY_INSTANCING", undefined, - ShaderDestination.VERTEX + ShaderDestination.VERTEX, ); shaderBuilder.addUniform( "mat4", "u_instance_modifiedModelView", - ShaderDestination.VERTEX + ShaderDestination.VERTEX, ); shaderBuilder.addUniform( "mat4", "u_instance_nodeTransform", - ShaderDestination.VERTEX + ShaderDestination.VERTEX, ); // The i3dm format applies the instancing transforms in world space. @@ -132,7 +132,7 @@ InstancingPipelineStage.process = function (renderResources, node, frameState) { // For i3dm models, components.transform contains the RTC_CENTER // translation. sceneGraph.components.transform, - modelViewScratch + modelViewScratch, ); if (use2D) { @@ -144,7 +144,7 @@ InstancingPipelineStage.process = function (renderResources, node, frameState) { return Matrix4.multiplyTransformation( frameState.context.uniformState.view3D, modifiedModelMatrix, - modelViewScratch + modelViewScratch, ); } @@ -154,7 +154,7 @@ InstancingPipelineStage.process = function (renderResources, node, frameState) { modifiedModelMatrix = Transforms.basisTo2D( frameState.mapProjection, modifiedModelMatrix, - modelViewScratch + modelViewScratch, ); } @@ -162,7 +162,7 @@ InstancingPipelineStage.process = function (renderResources, node, frameState) { return Matrix4.multiplyTransformation( frameState.context.uniformState.view, modifiedModelMatrix, - modelViewScratch + modelViewScratch, ); }; @@ -174,7 +174,7 @@ InstancingPipelineStage.process = function (renderResources, node, frameState) { // This transforms from the node's coordinate system to the root // of the node hierarchy runtimeNode.computedTransform, - nodeTransformScratch + nodeTransformScratch, ); }; @@ -187,7 +187,7 @@ InstancingPipelineStage.process = function (renderResources, node, frameState) { shaderBuilder.addDefine( "USE_2D_INSTANCING", undefined, - ShaderDestination.VERTEX + ShaderDestination.VERTEX, ); shaderBuilder.addUniform("mat4", "u_modelView2D", ShaderDestination.VERTEX); @@ -195,14 +195,14 @@ InstancingPipelineStage.process = function (renderResources, node, frameState) { const context = frameState.context; const modelMatrix2D = Matrix4.fromTranslation( runtimeNode.instancingReferencePoint2D, - new Matrix4() + new Matrix4(), ); uniformMap.u_modelView2D = function () { return Matrix4.multiplyTransformation( context.uniformState.view, modelMatrix2D, - modelView2DScratch + modelView2DScratch, ); }; } @@ -212,7 +212,7 @@ InstancingPipelineStage.process = function (renderResources, node, frameState) { renderResources.instanceCount = count; renderResources.attributes.push.apply( renderResources.attributes, - instancingVertexAttributes + instancingVertexAttributes, ); }; @@ -224,24 +224,24 @@ function projectTransformTo2D( modelMatrix, nodeTransform, frameState, - result + result, ) { let projectedTransform = Matrix4.multiplyTransformation( modelMatrix, transform, - projectedTransformScratch + projectedTransformScratch, ); projectedTransform = Matrix4.multiplyTransformation( projectedTransform, nodeTransform, - projectedTransformScratch + projectedTransformScratch, ); result = Transforms.basisTo2D( frameState.mapProjection, projectedTransform, - result + result, ); return result; @@ -252,34 +252,34 @@ function projectPositionTo2D( modelMatrix, nodeTransform, frameState, - result + result, ) { const translationMatrix = Matrix4.fromTranslation( position, - projectedTransformScratch + projectedTransformScratch, ); let projectedTransform = Matrix4.multiplyTransformation( modelMatrix, translationMatrix, - projectedTransformScratch + projectedTransformScratch, ); projectedTransform = Matrix4.multiplyTransformation( projectedTransform, nodeTransform, - projectedTransformScratch + projectedTransformScratch, ); const finalPosition = Matrix4.getTranslation( projectedTransform, - projectedPositionScratch + projectedPositionScratch, ); result = SceneTransforms.computeActualEllipsoidPosition( frameState, finalPosition, - result + result, ); return result; @@ -288,7 +288,7 @@ function projectPositionTo2D( function getModelMatrixAndNodeTransform( renderResources, modelMatrix, - nodeComputedTransform + nodeComputedTransform, ) { const model = renderResources.model; const sceneGraph = model.sceneGraph; @@ -299,13 +299,13 @@ function getModelMatrixAndNodeTransform( modelMatrix = Matrix4.multiplyTransformation( model.modelMatrix, sceneGraph.components.transform, - modelMatrix + modelMatrix, ); nodeComputedTransform = Matrix4.multiplyTransformation( sceneGraph.axisCorrectionMatrix, renderResources.runtimeNode.computedTransform, - nodeComputedTransform + nodeComputedTransform, ); } else { // The node transform should be pre-multiplied with the instancing transform. @@ -313,12 +313,12 @@ function getModelMatrixAndNodeTransform( modelMatrix = Matrix4.multiplyTransformation( modelMatrix, renderResources.runtimeNode.computedTransform, - modelMatrix + modelMatrix, ); nodeComputedTransform = Matrix4.clone( Matrix4.IDENTITY, - nodeComputedTransform + nodeComputedTransform, ); } } @@ -332,7 +332,7 @@ function projectTransformsTo2D( transforms, renderResources, frameState, - result + result, ) { const modelMatrix = modelMatrixScratch; const nodeComputedTransform = nodeComputedTransformScratch; @@ -340,7 +340,7 @@ function projectTransformsTo2D( getModelMatrixAndNodeTransform( renderResources, modelMatrix, - nodeComputedTransform + nodeComputedTransform, ); const runtimeNode = renderResources.runtimeNode; @@ -355,24 +355,24 @@ function projectTransformsTo2D( modelMatrix, nodeComputedTransform, frameState, - transformScratch + transformScratch, ); const position = Matrix4.getTranslation( projectedTransform, - positionScratch + positionScratch, ); const finalTranslation = Cartesian3.subtract( position, referencePoint, - position + position, ); result[i] = Matrix4.setTranslation( projectedTransform, finalTranslation, - result[i] + result[i], ); } @@ -383,7 +383,7 @@ function projectTranslationsTo2D( translations, renderResources, frameState, - result + result, ) { const modelMatrix = modelMatrixScratch; const nodeComputedTransform = nodeComputedTransformScratch; @@ -391,7 +391,7 @@ function projectTranslationsTo2D( getModelMatrixAndNodeTransform( renderResources, modelMatrix, - nodeComputedTransform + nodeComputedTransform, ); const runtimeNode = renderResources.runtimeNode; @@ -405,13 +405,13 @@ function projectTranslationsTo2D( modelMatrix, nodeComputedTransform, frameState, - translation + translation, ); result[i] = Cartesian3.subtract( projectedPosition, referencePoint, - result[i] + result[i], ); } @@ -429,32 +429,32 @@ function computeReferencePoint2D(renderResources, frameState) { const transformedPositionMin = Matrix4.multiplyByPoint( modelMatrix, runtimeNode.instancingTranslationMin, - scratchProjectedMin + scratchProjectedMin, ); const projectedMin = SceneTransforms.computeActualEllipsoidPosition( frameState, transformedPositionMin, - transformedPositionMin + transformedPositionMin, ); const transformedPositionMax = Matrix4.multiplyByPoint( modelMatrix, runtimeNode.instancingTranslationMax, - scratchProjectedMax + scratchProjectedMax, ); const projectedMax = SceneTransforms.computeActualEllipsoidPosition( frameState, transformedPositionMax, - transformedPositionMax + transformedPositionMax, ); runtimeNode.instancingReferencePoint2D = Cartesian3.lerp( projectedMin, projectedMax, 0.5, - new Cartesian3() + new Cartesian3(), ); } @@ -510,26 +510,26 @@ function getInstanceTransformsAsMatrices(instances, count, renderResources) { const translationAttribute = ModelUtility.getAttributeBySemantic( instances, - InstanceAttributeSemantic.TRANSLATION + InstanceAttributeSemantic.TRANSLATION, ); const rotationAttribute = ModelUtility.getAttributeBySemantic( instances, - InstanceAttributeSemantic.ROTATION + InstanceAttributeSemantic.ROTATION, ); const scaleAttribute = ModelUtility.getAttributeBySemantic( instances, - InstanceAttributeSemantic.SCALE + InstanceAttributeSemantic.SCALE, ); const instancingTranslationMax = new Cartesian3( -Number.MAX_VALUE, -Number.MAX_VALUE, - -Number.MAX_VALUE + -Number.MAX_VALUE, ); const instancingTranslationMin = new Cartesian3( Number.MAX_VALUE, Number.MAX_VALUE, - Number.MAX_VALUE + Number.MAX_VALUE, ); const hasTranslation = defined(translationAttribute); @@ -553,7 +553,7 @@ function getInstanceTransformsAsMatrices(instances, count, renderResources) { rotationTypedArray, rotationAttribute.componentDatatype, rotationAttribute.type, - count + count, ); } @@ -571,18 +571,18 @@ function getInstanceTransformsAsMatrices(instances, count, renderResources) { translationTypedArray[i * 3], translationTypedArray[i * 3 + 1], translationTypedArray[i * 3 + 2], - translationScratch + translationScratch, ); Cartesian3.maximumByComponent( instancingTranslationMax, translation, - instancingTranslationMax + instancingTranslationMax, ); Cartesian3.minimumByComponent( instancingTranslationMin, translation, - instancingTranslationMin + instancingTranslationMin, ); const rotation = new Quaternion( @@ -590,21 +590,21 @@ function getInstanceTransformsAsMatrices(instances, count, renderResources) { rotationTypedArray[i * 4 + 1], rotationTypedArray[i * 4 + 2], hasRotation ? rotationTypedArray[i * 4 + 3] : 1, - rotationScratch + rotationScratch, ); const scale = new Cartesian3( scaleTypedArray[i * 3], scaleTypedArray[i * 3 + 1], scaleTypedArray[i * 3 + 2], - scaleScratch + scaleScratch, ); const transform = Matrix4.fromTranslationQuaternionRotationScale( translation, rotation, scale, - new Matrix4() + new Matrix4(), ); transforms[i] = transform; @@ -632,7 +632,7 @@ function getInstanceTransformsAsMatrices(instances, count, renderResources) { function getInstanceTranslationsAsCartesian3s( translationAttribute, count, - renderResources + renderResources, ) { const instancingTranslations = new Array(count); const translationTypedArray = translationAttribute.typedArray; @@ -640,19 +640,19 @@ function getInstanceTranslationsAsCartesian3s( const instancingTranslationMin = new Cartesian3( Number.MAX_VALUE, Number.MAX_VALUE, - Number.MAX_VALUE + Number.MAX_VALUE, ); const instancingTranslationMax = new Cartesian3( -Number.MAX_VALUE, -Number.MAX_VALUE, - -Number.MAX_VALUE + -Number.MAX_VALUE, ); for (let i = 0; i < count; i++) { const translation = new Cartesian3( translationTypedArray[i * 3], translationTypedArray[i * 3 + 1], - translationTypedArray[i * 3 + 2] + translationTypedArray[i * 3 + 2], ); instancingTranslations[i] = translation; @@ -660,12 +660,12 @@ function getInstanceTranslationsAsCartesian3s( Cartesian3.minimumByComponent( instancingTranslationMin, translation, - instancingTranslationMin + instancingTranslationMin, ); Cartesian3.maximumByComponent( instancingTranslationMax, translation, - instancingTranslationMax + instancingTranslationMax, ); } @@ -700,11 +700,11 @@ function processTransformAttributes( instances, instancingVertexAttributes, use2D, - keepTypedArray + keepTypedArray, ) { const rotationAttribute = ModelUtility.getAttributeBySemantic( instances, - InstanceAttributeSemantic.ROTATION + InstanceAttributeSemantic.ROTATION, ); // Only use matrices for the transforms if the rotation attribute is defined. @@ -715,7 +715,7 @@ function processTransformAttributes( instancingVertexAttributes, frameState, use2D, - keepTypedArray + keepTypedArray, ); } else { processTransformVec3Attributes( @@ -723,7 +723,7 @@ function processTransformAttributes( instances, instancingVertexAttributes, frameState, - use2D + use2D, ); } } @@ -734,7 +734,7 @@ function processTransformMatrixAttributes( instancingVertexAttributes, frameState, use2D, - keepTypedArray + keepTypedArray, ) { const shaderBuilder = renderResources.shaderBuilder; const count = instances.attributes[0].count; @@ -753,7 +753,7 @@ function processTransformMatrixAttributes( transforms = getInstanceTransformsAsMatrices( instances, count, - renderResources + renderResources, ); const transformsTypedArray = transformsToTypedArray(transforms); @@ -771,7 +771,7 @@ function processTransformMatrixAttributes( renderResources, buffer, instancingVertexAttributes, - attributeString + attributeString, ); if (!use2D) { @@ -795,7 +795,7 @@ function processTransformMatrixAttributes( transforms, renderResources, frameStateCV, - transforms + transforms, ); const projectedTypedArray = transformsToTypedArray(projectedTransforms); @@ -812,7 +812,7 @@ function processTransformMatrixAttributes( renderResources, buffer2D, instancingVertexAttributes, - attributeString2D + attributeString2D, ); } @@ -822,17 +822,17 @@ function processTransformVec3Attributes( instancingVertexAttributes, frameState, use2D, - keepTypedArray + keepTypedArray, ) { const shaderBuilder = renderResources.shaderBuilder; const runtimeNode = renderResources.runtimeNode; const translationAttribute = ModelUtility.getAttributeBySemantic( instances, - InstanceAttributeSemantic.TRANSLATION + InstanceAttributeSemantic.TRANSLATION, ); const scaleAttribute = ModelUtility.getAttributeBySemantic( instances, - InstanceAttributeSemantic.SCALE + InstanceAttributeSemantic.SCALE, ); if (defined(scaleAttribute)) { @@ -846,7 +846,7 @@ function processTransformVec3Attributes( scaleAttribute.byteOffset, scaleAttribute.byteStride, instancingVertexAttributes, - attributeString + attributeString, ); } @@ -863,7 +863,7 @@ function processTransformVec3Attributes( instancingTranslations = getInstanceTranslationsAsCartesian3s( translationAttribute, translationAttribute.count, - renderResources + renderResources, ); } else if (!defined(runtimeNode.instancingTranslationMin)) { runtimeNode.instancingTranslationMin = translationAttribute.min; @@ -879,7 +879,7 @@ function processTransformVec3Attributes( translationAttribute.byteOffset, translationAttribute.byteStride, instancingVertexAttributes, - attributeString + attributeString, ); if (!use2D && !keepTypedArray) { @@ -904,7 +904,7 @@ function processTransformVec3Attributes( instancingTranslations, renderResources, frameStateCV, - instancingTranslations + instancingTranslations, ); const projectedTypedArray = translationsToTypedArray(projectedTranslations); @@ -934,7 +934,7 @@ function processTransformVec3Attributes( byteOffset, byteStride, instancingVertexAttributes, - attributeString2D + attributeString2D, ); } @@ -942,11 +942,11 @@ function processMatrixAttributes( renderResources, buffer, instancingVertexAttributes, - attributeString + attributeString, ) { const vertexSizeInFloats = 12; const componentByteSize = ComponentDatatype.getSizeInBytes( - ComponentDatatype.FLOAT + ComponentDatatype.FLOAT, ); const strideInBytes = componentByteSize * vertexSizeInFloats; @@ -990,7 +990,7 @@ function processMatrixAttributes( instancingVertexAttributes.push.apply( instancingVertexAttributes, - matrixAttributes + matrixAttributes, ); } @@ -1000,7 +1000,7 @@ function processVec3Attribute( byteOffset, byteStride, instancingVertexAttributes, - attributeString + attributeString, ) { instancingVertexAttributes.push({ index: renderResources.attributeIndex++, @@ -1021,7 +1021,7 @@ function processFeatureIdAttributes( renderResources, frameState, instances, - instancingVertexAttributes + instancingVertexAttributes, ) { const attributes = instances.attributes; const shaderBuilder = renderResources.shaderBuilder; @@ -1042,7 +1042,7 @@ function processFeatureIdAttributes( index: renderResources.attributeIndex++, vertexBuffer: attribute.buffer, componentsPerAttribute: AttributeType.getNumberOfComponents( - attribute.type + attribute.type, ), componentDatatype: attribute.componentDatatype, normalize: false, @@ -1053,7 +1053,7 @@ function processFeatureIdAttributes( shaderBuilder.addAttribute( "float", - `a_instanceFeatureId_${attribute.setIndex}` + `a_instanceFeatureId_${attribute.setIndex}`, ); } } diff --git a/packages/engine/Source/Scene/Model/LightingPipelineStage.js b/packages/engine/Source/Scene/Model/LightingPipelineStage.js index a2f466484ee4..97a01eded645 100644 --- a/packages/engine/Source/Scene/Model/LightingPipelineStage.js +++ b/packages/engine/Source/Scene/Model/LightingPipelineStage.js @@ -34,13 +34,13 @@ LightingPipelineStage.process = function (renderResources, primitive) { shaderBuilder.addDefine( "USE_CUSTOM_LIGHT_COLOR", undefined, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); shaderBuilder.addUniform( "vec3", "model_lightColorHdr", - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); const uniformMap = renderResources.uniformMap; @@ -57,13 +57,13 @@ LightingPipelineStage.process = function (renderResources, primitive) { shaderBuilder.addDefine( "LIGHTING_PBR", undefined, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); } else { shaderBuilder.addDefine( "LIGHTING_UNLIT", undefined, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); } diff --git a/packages/engine/Source/Scene/Model/MaterialPipelineStage.js b/packages/engine/Source/Scene/Model/MaterialPipelineStage.js index f251f3851d4e..577741aae74b 100644 --- a/packages/engine/Source/Scene/Model/MaterialPipelineStage.js +++ b/packages/engine/Source/Scene/Model/MaterialPipelineStage.js @@ -12,13 +12,8 @@ import VertexAttributeSemantic from "../VertexAttributeSemantic.js"; import LightingModel from "./LightingModel.js"; import ModelUtility from "./ModelUtility.js"; -const { - Material, - MetallicRoughness, - SpecularGlossiness, - Specular, - Clearcoat, -} = ModelComponents; +const { Material, MetallicRoughness, SpecularGlossiness, Specular, Clearcoat } = + ModelComponents; /** * The material pipeline stage processes textures and other uniforms needed @@ -59,7 +54,7 @@ const MaterialPipelineStage = { MaterialPipelineStage.process = function ( renderResources, primitive, - frameState + frameState, ) { // gltf-pipeline automatically creates a default material so this will always // be defined. @@ -72,11 +67,8 @@ MaterialPipelineStage.process = function ( const disableTextures = hasClassification; // When textures are loaded incrementally, fall back to a default 1x1 texture - const { - defaultTexture, - defaultNormalTexture, - defaultEmissiveTexture, - } = frameState.context; + const { defaultTexture, defaultNormalTexture, defaultEmissiveTexture } = + frameState.context; processMaterialUniforms( material, @@ -85,7 +77,7 @@ MaterialPipelineStage.process = function ( defaultTexture, defaultNormalTexture, defaultEmissiveTexture, - disableTextures + disableTextures, ); if (defined(material.specularGlossiness)) { @@ -94,7 +86,7 @@ MaterialPipelineStage.process = function ( uniformMap, shaderBuilder, defaultTexture, - disableTextures + disableTextures, ); } else { if ( @@ -106,7 +98,7 @@ MaterialPipelineStage.process = function ( uniformMap, shaderBuilder, defaultTexture, - disableTextures + disableTextures, ); } if ( @@ -118,7 +110,7 @@ MaterialPipelineStage.process = function ( uniformMap, shaderBuilder, defaultTexture, - disableTextures + disableTextures, ); } if ( @@ -130,7 +122,7 @@ MaterialPipelineStage.process = function ( uniformMap, shaderBuilder, defaultTexture, - disableTextures + disableTextures, ); } processMetallicRoughnessUniforms( @@ -138,14 +130,14 @@ MaterialPipelineStage.process = function ( uniformMap, shaderBuilder, defaultTexture, - disableTextures + disableTextures, ); } // If the primitive does not have normals, fall back to unlit lighting. const hasNormals = ModelUtility.getAttributeBySemantic( primitive, - VertexAttributeSemantic.NORMAL + VertexAttributeSemantic.NORMAL, ); // Classification models will be rendered as unlit. @@ -173,7 +165,7 @@ MaterialPipelineStage.process = function ( shaderBuilder.addDefine( "HAS_DOUBLE_SIDED_MATERIAL", undefined, - ShaderDestination.BOTH + ShaderDestination.BOTH, ); } }; @@ -194,14 +186,14 @@ function processTextureTransform( uniformMap, textureReader, uniformName, - defineName + defineName, ) { // Add a define to enable the texture transformation code in the shader. const transformDefine = `HAS_${defineName}_TEXTURE_TRANSFORM`; shaderBuilder.addDefine( transformDefine, undefined, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); // Add a uniform for the transformation matrix @@ -209,7 +201,7 @@ function processTextureTransform( shaderBuilder.addUniform( "mat3", transformUniformName, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); uniformMap[transformUniformName] = function () { return textureReader.transform; @@ -232,14 +224,14 @@ function processTextureScale( uniformMap, textureReader, uniformName, - defineName + defineName, ) { // Add a define to enable the texture transformation code in the shader. const transformDefine = `HAS_${defineName}_TEXTURE_SCALE`; shaderBuilder.addDefine( transformDefine, undefined, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); // Add a uniform for the transformation matrix @@ -247,7 +239,7 @@ function processTextureScale( shaderBuilder.addUniform( "float", scaleUniformName, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); uniformMap[scaleUniformName] = function () { return textureReader.scale; @@ -271,13 +263,13 @@ function processTexture( textureReader, uniformName, defineName, - defaultTexture + defaultTexture, ) { // Add a uniform for the texture itself shaderBuilder.addUniform( "sampler2D", uniformName, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); uniformMap[uniformName] = function () { return defaultValue(textureReader.texture, defaultTexture); @@ -294,7 +286,7 @@ function processTexture( shaderBuilder.addDefine( texCoordDefine, texCoordVarying, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); // Some textures have matrix transforms (e.g. for texture atlases). Add those @@ -309,7 +301,7 @@ function processTexture( uniformMap, textureReader, uniformName, - defineName + defineName, ); } @@ -320,7 +312,7 @@ function processTexture( uniformMap, textureReader, uniformName, - defineName + defineName, ); } } @@ -332,14 +324,10 @@ function processMaterialUniforms( defaultTexture, defaultNormalTexture, defaultEmissiveTexture, - disableTextures + disableTextures, ) { - const { - emissiveFactor, - emissiveTexture, - normalTexture, - occlusionTexture, - } = material; + const { emissiveFactor, emissiveTexture, normalTexture, occlusionTexture } = + material; if ( defined(emissiveFactor) && @@ -348,7 +336,7 @@ function processMaterialUniforms( shaderBuilder.addUniform( "vec3", "u_emissiveFactor", - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); uniformMap.u_emissiveFactor = function () { return material.emissiveFactor; @@ -356,7 +344,7 @@ function processMaterialUniforms( shaderBuilder.addDefine( "HAS_EMISSIVE_FACTOR", undefined, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); if (defined(emissiveTexture) && !disableTextures) { @@ -366,7 +354,7 @@ function processMaterialUniforms( emissiveTexture, "u_emissiveTexture", "EMISSIVE", - defaultEmissiveTexture + defaultEmissiveTexture, ); } } @@ -378,7 +366,7 @@ function processMaterialUniforms( normalTexture, "u_normalTexture", "NORMAL", - defaultNormalTexture + defaultNormalTexture, ); } @@ -389,7 +377,7 @@ function processMaterialUniforms( occlusionTexture, "u_occlusionTexture", "OCCLUSION", - defaultTexture + defaultTexture, ); } } @@ -409,7 +397,7 @@ function processSpecularGlossinessUniforms( uniformMap, shaderBuilder, defaultTexture, - disableTextures + disableTextures, ) { const { diffuseTexture, @@ -422,7 +410,7 @@ function processSpecularGlossinessUniforms( shaderBuilder.addDefine( "USE_SPECULAR_GLOSSINESS", undefined, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); if (defined(diffuseTexture) && !disableTextures) { @@ -432,7 +420,7 @@ function processSpecularGlossinessUniforms( diffuseTexture, "u_diffuseTexture", "DIFFUSE", - defaultTexture + defaultTexture, ); } @@ -443,7 +431,7 @@ function processSpecularGlossinessUniforms( shaderBuilder.addUniform( "vec4", "u_diffuseFactor", - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); uniformMap.u_diffuseFactor = function () { return specularGlossiness.diffuseFactor; @@ -451,7 +439,7 @@ function processSpecularGlossinessUniforms( shaderBuilder.addDefine( "HAS_DIFFUSE_FACTOR", undefined, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); } @@ -462,7 +450,7 @@ function processSpecularGlossinessUniforms( specularGlossinessTexture, "u_specularGlossinessTexture", "SPECULAR_GLOSSINESS", - defaultTexture + defaultTexture, ); } @@ -470,13 +458,13 @@ function processSpecularGlossinessUniforms( defined(specularFactor) && !Cartesian3.equals( specularFactor, - SpecularGlossiness.DEFAULT_SPECULAR_FACTOR + SpecularGlossiness.DEFAULT_SPECULAR_FACTOR, ) ) { shaderBuilder.addUniform( "vec3", "u_legacySpecularFactor", - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); uniformMap.u_legacySpecularFactor = function () { return specularGlossiness.specularFactor; @@ -484,7 +472,7 @@ function processSpecularGlossinessUniforms( shaderBuilder.addDefine( "HAS_LEGACY_SPECULAR_FACTOR", undefined, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); } @@ -495,7 +483,7 @@ function processSpecularGlossinessUniforms( shaderBuilder.addUniform( "float", "u_glossinessFactor", - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); uniformMap.u_glossinessFactor = function () { return specularGlossiness.glossinessFactor; @@ -503,7 +491,7 @@ function processSpecularGlossinessUniforms( shaderBuilder.addDefine( "HAS_GLOSSINESS_FACTOR", undefined, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); } } @@ -523,7 +511,7 @@ function processSpecularUniforms( uniformMap, shaderBuilder, defaultTexture, - disableTextures + disableTextures, ) { const { specularTexture, @@ -535,7 +523,7 @@ function processSpecularUniforms( shaderBuilder.addDefine( "USE_SPECULAR", undefined, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); if (defined(specularTexture) && !disableTextures) { @@ -545,7 +533,7 @@ function processSpecularUniforms( specularTexture, "u_specularTexture", "SPECULAR", - defaultTexture + defaultTexture, ); } @@ -556,7 +544,7 @@ function processSpecularUniforms( shaderBuilder.addUniform( "float", "u_specularFactor", - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); uniformMap.u_specularFactor = function () { return specular.specularFactor; @@ -564,7 +552,7 @@ function processSpecularUniforms( shaderBuilder.addDefine( "HAS_SPECULAR_FACTOR", undefined, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); } @@ -575,7 +563,7 @@ function processSpecularUniforms( specularColorTexture, "u_specularColorTexture", "SPECULAR_COLOR", - defaultTexture + defaultTexture, ); } @@ -583,13 +571,13 @@ function processSpecularUniforms( defined(specularColorFactor) && !Cartesian3.equals( specularColorFactor, - Specular.DEFAULT_SPECULAR_COLOR_FACTOR + Specular.DEFAULT_SPECULAR_COLOR_FACTOR, ) ) { shaderBuilder.addUniform( "vec3", "u_specularColorFactor", - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); uniformMap.u_specularColorFactor = function () { return specular.specularColorFactor; @@ -597,7 +585,7 @@ function processSpecularUniforms( shaderBuilder.addDefine( "HAS_SPECULAR_COLOR_FACTOR", undefined, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); } } @@ -619,18 +607,15 @@ function processAnisotropyUniforms( uniformMap, shaderBuilder, defaultTexture, - disableTextures + disableTextures, ) { - const { - anisotropyStrength, - anisotropyRotation, - anisotropyTexture, - } = anisotropy; + const { anisotropyStrength, anisotropyRotation, anisotropyTexture } = + anisotropy; shaderBuilder.addDefine( "USE_ANISOTROPY", undefined, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); if (defined(anisotropyTexture) && !disableTextures) { @@ -640,7 +625,7 @@ function processAnisotropyUniforms( anisotropyTexture, "u_anisotropyTexture", "ANISOTROPY", - defaultTexture + defaultTexture, ); } @@ -654,7 +639,7 @@ function processAnisotropyUniforms( cosRotation, sinRotation, anisotropyStrength, - scratchAnisotropy + scratchAnisotropy, ); }; } @@ -674,7 +659,7 @@ function processClearcoatUniforms( uniformMap, shaderBuilder, defaultTexture, - disableTextures + disableTextures, ) { const { clearcoatFactor, @@ -687,7 +672,7 @@ function processClearcoatUniforms( shaderBuilder.addDefine( "USE_CLEARCOAT", undefined, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); if ( @@ -697,7 +682,7 @@ function processClearcoatUniforms( shaderBuilder.addUniform( "float", "u_clearcoatFactor", - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); uniformMap.u_clearcoatFactor = function () { return clearcoat.clearcoatFactor; @@ -705,7 +690,7 @@ function processClearcoatUniforms( shaderBuilder.addDefine( "HAS_CLEARCOAT_FACTOR", undefined, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); } @@ -716,7 +701,7 @@ function processClearcoatUniforms( clearcoatTexture, "u_clearcoatTexture", "CLEARCOAT", - defaultTexture + defaultTexture, ); } @@ -727,7 +712,7 @@ function processClearcoatUniforms( shaderBuilder.addUniform( "float", "u_clearcoatRoughnessFactor", - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); uniformMap.u_clearcoatRoughnessFactor = function () { return clearcoat.clearcoatRoughnessFactor; @@ -735,7 +720,7 @@ function processClearcoatUniforms( shaderBuilder.addDefine( "HAS_CLEARCOAT_ROUGHNESS_FACTOR", undefined, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); } @@ -746,7 +731,7 @@ function processClearcoatUniforms( clearcoatRoughnessTexture, "u_clearcoatRoughnessTexture", "CLEARCOAT_ROUGHNESS", - defaultTexture + defaultTexture, ); } @@ -757,7 +742,7 @@ function processClearcoatUniforms( clearcoatNormalTexture, "u_clearcoatNormalTexture", "CLEARCOAT_NORMAL", - defaultTexture + defaultTexture, ); } } @@ -777,12 +762,12 @@ function processMetallicRoughnessUniforms( uniformMap, shaderBuilder, defaultTexture, - disableTextures + disableTextures, ) { shaderBuilder.addDefine( "USE_METALLIC_ROUGHNESS", undefined, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); const baseColorTexture = metallicRoughness.baseColorTexture; @@ -793,7 +778,7 @@ function processMetallicRoughnessUniforms( baseColorTexture, "u_baseColorTexture", "BASE_COLOR", - defaultTexture + defaultTexture, ); } @@ -802,13 +787,13 @@ function processMetallicRoughnessUniforms( defined(baseColorFactor) && !Cartesian4.equals( baseColorFactor, - MetallicRoughness.DEFAULT_BASE_COLOR_FACTOR + MetallicRoughness.DEFAULT_BASE_COLOR_FACTOR, ) ) { shaderBuilder.addUniform( "vec4", "u_baseColorFactor", - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); uniformMap.u_baseColorFactor = function () { return metallicRoughness.baseColorFactor; @@ -816,7 +801,7 @@ function processMetallicRoughnessUniforms( shaderBuilder.addDefine( "HAS_BASE_COLOR_FACTOR", undefined, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); } @@ -828,7 +813,7 @@ function processMetallicRoughnessUniforms( metallicRoughnessTexture, "u_metallicRoughnessTexture", "METALLIC_ROUGHNESS", - defaultTexture + defaultTexture, ); } @@ -840,7 +825,7 @@ function processMetallicRoughnessUniforms( shaderBuilder.addUniform( "float", "u_metallicFactor", - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); uniformMap.u_metallicFactor = function () { return metallicRoughness.metallicFactor; @@ -848,7 +833,7 @@ function processMetallicRoughnessUniforms( shaderBuilder.addDefine( "HAS_METALLIC_FACTOR", undefined, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); } @@ -860,7 +845,7 @@ function processMetallicRoughnessUniforms( shaderBuilder.addUniform( "float", "u_roughnessFactor", - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); uniformMap.u_roughnessFactor = function () { return metallicRoughness.roughnessFactor; @@ -868,7 +853,7 @@ function processMetallicRoughnessUniforms( shaderBuilder.addDefine( "HAS_ROUGHNESS_FACTOR", undefined, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); } } diff --git a/packages/engine/Source/Scene/Model/MetadataPipelineStage.js b/packages/engine/Source/Scene/Model/MetadataPipelineStage.js index 01bcde68b202..e0e293c2788a 100644 --- a/packages/engine/Source/Scene/Model/MetadataPipelineStage.js +++ b/packages/engine/Source/Scene/Model/MetadataPipelineStage.js @@ -80,7 +80,7 @@ const MetadataPipelineStage = { MetadataPipelineStage.process = function ( renderResources, primitive, - frameState + frameState, ) { const { shaderBuilder, model } = renderResources; const { structuralMetadata = {}, content } = model; @@ -89,11 +89,11 @@ MetadataPipelineStage.process = function ( const propertyAttributesInfo = getPropertyAttributesInfo( structuralMetadata.propertyAttributes, primitive, - statistics + statistics, ); const propertyTexturesInfo = getPropertyTexturesInfo( structuralMetadata.propertyTextures, - statistics + statistics, ); // Declare <type>MetadataClass and <type>MetadataStatistics structs as needed @@ -130,7 +130,7 @@ function getPropertyAttributesInfo(propertyAttributes, primitive, statistics) { return []; } return propertyAttributes.flatMap((propertyAttribute) => - getPropertyAttributeInfo(propertyAttribute, primitive, statistics) + getPropertyAttributeInfo(propertyAttribute, primitive, statistics), ); } @@ -143,11 +143,8 @@ function getPropertyAttributesInfo(propertyAttributes, primitive, statistics) { * @private */ function getPropertyAttributeInfo(propertyAttribute, primitive, statistics) { - const { - getAttributeByName, - getAttributeInfo, - sanitizeGlslIdentifier, - } = ModelUtility; + const { getAttributeByName, getAttributeInfo, sanitizeGlslIdentifier } = + ModelUtility; const classId = propertyAttribute.class.id; const classStatistics = statistics?.classes[classId]; @@ -187,7 +184,7 @@ function getPropertyTexturesInfo(propertyTextures, statistics) { return []; } return propertyTextures.flatMap((propertyTexture) => - getPropertyTextureInfo(propertyTexture, statistics) + getPropertyTextureInfo(propertyTexture, statistics), ); } @@ -204,9 +201,9 @@ function getPropertyTextureInfo(propertyTexture, statistics) { const classId = propertyTexture.class.id; const classStatistics = statistics?.classes[classId]; - const propertiesArray = Object.entries( - propertyTexture.properties - ).filter(([id, property]) => property.isGpuCompatible()); + const propertiesArray = Object.entries(propertyTexture.properties).filter( + ([id, property]) => property.isGpuCompatible(), + ); const infoArray = new Array(propertiesArray.length); for (let i = 0; i < propertiesArray.length; i++) { @@ -299,36 +296,36 @@ function declareStructsAndFunctions(shaderBuilder) { shaderBuilder.addStruct( MetadataPipelineStage.STRUCT_ID_METADATA_VS, MetadataPipelineStage.STRUCT_NAME_METADATA, - ShaderDestination.VERTEX + ShaderDestination.VERTEX, ); shaderBuilder.addStruct( MetadataPipelineStage.STRUCT_ID_METADATA_FS, MetadataPipelineStage.STRUCT_NAME_METADATA, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); // Declare the MetadataClass struct shaderBuilder.addStruct( MetadataPipelineStage.STRUCT_ID_METADATA_CLASS_VS, MetadataPipelineStage.STRUCT_NAME_METADATA_CLASS, - ShaderDestination.VERTEX + ShaderDestination.VERTEX, ); shaderBuilder.addStruct( MetadataPipelineStage.STRUCT_ID_METADATA_CLASS_FS, MetadataPipelineStage.STRUCT_NAME_METADATA_CLASS, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); // Declare the MetadataStatistics struct shaderBuilder.addStruct( MetadataPipelineStage.STRUCT_ID_METADATA_STATISTICS_VS, MetadataPipelineStage.STRUCT_NAME_METADATA_STATISTICS, - ShaderDestination.VERTEX + ShaderDestination.VERTEX, ); shaderBuilder.addStruct( MetadataPipelineStage.STRUCT_ID_METADATA_STATISTICS_FS, MetadataPipelineStage.STRUCT_NAME_METADATA_STATISTICS, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); // declare the initializeMetadata() function. The details may differ @@ -336,19 +333,19 @@ function declareStructsAndFunctions(shaderBuilder) { shaderBuilder.addFunction( MetadataPipelineStage.FUNCTION_ID_INITIALIZE_METADATA_VS, MetadataPipelineStage.FUNCTION_SIGNATURE_INITIALIZE_METADATA, - ShaderDestination.VERTEX + ShaderDestination.VERTEX, ); shaderBuilder.addFunction( MetadataPipelineStage.FUNCTION_ID_INITIALIZE_METADATA_FS, MetadataPipelineStage.FUNCTION_SIGNATURE_INITIALIZE_METADATA, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); // declare the setMetadataVaryings() function in the vertex shader only. shaderBuilder.addFunction( MetadataPipelineStage.FUNCTION_ID_SET_METADATA_VARYINGS, MetadataPipelineStage.FUNCTION_SIGNATURE_SET_METADATA_VARYINGS, - ShaderDestination.VERTEX + ShaderDestination.VERTEX, ); } @@ -388,23 +385,23 @@ function addPropertyAttributePropertyMetadata(renderResources, propertyInfo) { shaderBuilder.addStructField( MetadataPipelineStage.STRUCT_ID_METADATA_VS, glslType, - metadataVariable + metadataVariable, ); shaderBuilder.addStructField( MetadataPipelineStage.STRUCT_ID_METADATA_FS, glslType, - metadataVariable + metadataVariable, ); // assign the result to the metadata struct property. const initializationLine = `metadata.${metadataVariable} = ${valueExpression};`; shaderBuilder.addFunctionLines( MetadataPipelineStage.FUNCTION_ID_INITIALIZE_METADATA_VS, - [initializationLine] + [initializationLine], ); shaderBuilder.addFunctionLines( MetadataPipelineStage.FUNCTION_ID_INITIALIZE_METADATA_FS, - [initializationLine] + [initializationLine], ); } @@ -431,13 +428,8 @@ function addPropertyTexturePropertyMetadata(renderResources, propertyInfo) { const { shaderBuilder, uniformMap } = renderResources; const { metadataVariable, glslType, property } = propertyInfo; - const { - texCoord, - channels, - index, - texture, - transform, - } = property.textureReader; + const { texCoord, channels, index, texture, transform } = + property.textureReader; const textureUniformName = `u_propertyTexture_${index}`; // Property texture properties may share the same physical texture, so only @@ -446,7 +438,7 @@ function addPropertyTexturePropertyMetadata(renderResources, propertyInfo) { shaderBuilder.addUniform( "sampler2D", textureUniformName, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); uniformMap[textureUniformName] = () => texture; } @@ -454,7 +446,7 @@ function addPropertyTexturePropertyMetadata(renderResources, propertyInfo) { shaderBuilder.addStructField( MetadataPipelineStage.STRUCT_ID_METADATA_FS, glslType, - metadataVariable + metadataVariable, ); // Get a GLSL expression for the texture coordinates of the property. @@ -469,7 +461,7 @@ function addPropertyTexturePropertyMetadata(renderResources, propertyInfo) { shaderBuilder.addUniform( "mat3", transformUniformName, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); uniformMap[transformUniformName] = function () { return transform; @@ -499,7 +491,7 @@ function addPropertyTexturePropertyMetadata(renderResources, propertyInfo) { const initializationLine = `metadata.${metadataVariable} = ${transformedValue};`; shaderBuilder.addFunctionLines( MetadataPipelineStage.FUNCTION_ID_INITIALIZE_METADATA_FS, - [initializationLine] + [initializationLine], ); } @@ -520,7 +512,7 @@ function addPropertyMetadataClass(shaderBuilder, propertyInfo) { MetadataPipelineStage.METADATA_CLASS_FIELDS, classProperty, `metadataClass.${metadataVariable}`, - glslType + glslType, ); // Struct field: Prefix to get the appropriate <type>MetadataClass struct @@ -528,11 +520,11 @@ function addPropertyMetadataClass(shaderBuilder, propertyInfo) { shaderBuilder.addStructField( MetadataPipelineStage.STRUCT_ID_METADATA_CLASS_FS, metadataType, - metadataVariable + metadataVariable, ); shaderBuilder.addFunctionLines( MetadataPipelineStage.FUNCTION_ID_INITIALIZE_METADATA_FS, - assignments + assignments, ); if (!ShaderDestination.includesVertexShader(shaderDestination)) { return; @@ -540,11 +532,11 @@ function addPropertyMetadataClass(shaderBuilder, propertyInfo) { shaderBuilder.addStructField( MetadataPipelineStage.STRUCT_ID_METADATA_CLASS_VS, metadataType, - metadataVariable + metadataVariable, ); shaderBuilder.addFunctionLines( MetadataPipelineStage.FUNCTION_ID_INITIALIZE_METADATA_VS, - assignments + assignments, ); } @@ -574,7 +566,7 @@ function addPropertyMetadataStatistics(shaderBuilder, propertyInfo) { fields, propertyStatistics, struct, - glslType + glslType, ); // Struct field: Prefix to get the appropriate <type>MetadataStatistics struct @@ -582,11 +574,11 @@ function addPropertyMetadataStatistics(shaderBuilder, propertyInfo) { shaderBuilder.addStructField( MetadataPipelineStage.STRUCT_ID_METADATA_STATISTICS_FS, statisticsType, - metadataVariable + metadataVariable, ); shaderBuilder.addFunctionLines( MetadataPipelineStage.FUNCTION_ID_INITIALIZE_METADATA_FS, - assignments + assignments, ); if (!ShaderDestination.includesVertexShader(propertyInfo.shaderDestination)) { return; @@ -594,11 +586,11 @@ function addPropertyMetadataStatistics(shaderBuilder, propertyInfo) { shaderBuilder.addStructField( MetadataPipelineStage.STRUCT_ID_METADATA_STATISTICS_VS, statisticsType, - metadataVariable + metadataVariable, ); shaderBuilder.addFunctionLines( MetadataPipelineStage.FUNCTION_ID_INITIALIZE_METADATA_VS, - assignments + assignments, ); } diff --git a/packages/engine/Source/Scene/Model/Model.js b/packages/engine/Source/Scene/Model/Model.js index e5415a11587c..e5c2027a6430 100644 --- a/packages/engine/Source/Scene/Model/Model.js +++ b/packages/engine/Source/Scene/Model/Model.js @@ -210,7 +210,7 @@ function Model(options) { * m.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(origin); */ this.modelMatrix = Matrix4.clone( - defaultValue(options.modelMatrix, Matrix4.IDENTITY) + defaultValue(options.modelMatrix, Matrix4.IDENTITY), ); this._modelMatrix = Matrix4.clone(this.modelMatrix); this._scale = defaultValue(options.scale, 1.0); @@ -276,7 +276,7 @@ function Model(options) { this._color = Color.clone(options.color); this._colorBlendMode = defaultValue( options.colorBlendMode, - ColorBlendMode.HIGHLIGHT + ColorBlendMode.HIGHLIGHT, ); this._colorBlendAmount = defaultValue(options.colorBlendAmount, 0.5); @@ -307,7 +307,7 @@ function Model(options) { let instanceFeatureIdLabel = defaultValue( options.instanceFeatureIdLabel, - "instanceFeatureId_0" + "instanceFeatureId_0", ); if (typeof instanceFeatureIdLabel === "number") { instanceFeatureIdLabel = `instanceFeatureId_${instanceFeatureIdLabel}`; @@ -336,14 +336,14 @@ function Model(options) { this._heightReference = defaultValue( options.heightReference, - HeightReference.NONE + HeightReference.NONE, ); this._heightDirty = this._heightReference !== HeightReference.NONE; this._removeUpdateHeightCallback = undefined; this._enableVerticalExaggeration = defaultValue( options.enableVerticalExaggeration, - true + true, ); this._hasVerticalExaggeration = false; @@ -351,11 +351,10 @@ function Model(options) { const scene = options.scene; if (defined(scene) && defined(scene.terrainProviderChanged)) { - this._terrainProviderChangedCallback = scene.terrainProviderChanged.addEventListener( - () => { + this._terrainProviderChangedCallback = + scene.terrainProviderChanged.addEventListener(() => { this._heightDirty = true; - } - ); + }); } this._scene = scene; @@ -384,7 +383,7 @@ function Model(options) { ClippingPolygonCollection.setOwner( clippingPolygons, this, - "_clippingPolygons" + "_clippingPolygons", ); } else { this._clippingPolygons = clippingPolygons; @@ -407,12 +406,12 @@ function Model(options) { this._debugShowBoundingVolumeDirty = false; this._debugShowBoundingVolume = defaultValue( options.debugShowBoundingVolume, - false + false, ); this._enableDebugWireframe = defaultValue( options.enableDebugWireframe, - false + false, ); this._enableShowOutline = defaultValue(options.enableShowOutline, true); this._debugWireframe = defaultValue(options.debugWireframe, false); @@ -425,7 +424,7 @@ function Model(options) { ) { oneTimeWarning( "model-debug-wireframe-ignored", - "enableDebugWireframe must be set to true in Model.fromGltf, otherwise debugWireframe will be ignored." + "enableDebugWireframe must be set to true in Model.fromGltf, otherwise debugWireframe will be ignored.", ); } @@ -449,7 +448,7 @@ function Model(options) { this._splitDirection = defaultValue( options.splitDirection, - SplitDirection.NONE + SplitDirection.NONE, ); this._enableShowOutline = defaultValue(options.enableShowOutline, true); @@ -544,7 +543,7 @@ function selectFeatureTableId(components, model) { if (defined(node.instances)) { featureIdAttribute = ModelUtility.getFeatureIdsByLabel( node.instances.featureIds, - instanceFeatureIdLabel + instanceFeatureIdLabel, ); if ( defined(featureIdAttribute) && @@ -563,7 +562,7 @@ function selectFeatureTableId(components, model) { const primitive = node.primitives[j]; const featureIds = ModelUtility.getFeatureIdsByLabel( primitive.featureIds, - featureIdLabel + featureIdLabel, ); if (defined(featureIds)) { @@ -892,7 +891,7 @@ Object.defineProperties(Model.prototype, { //>>includeEnd('debug'); this._distanceDisplayCondition = DistanceDisplayCondition.clone( value, - this._distanceDisplayCondition + this._distanceDisplayCondition, ); }, }, @@ -1132,7 +1131,7 @@ Object.defineProperties(Model.prototype, { //>>includeStart('debug', pragmas.debug); if (!this._ready) { throw new DeveloperError( - "The model is not loaded. Use Model.readyEvent or wait for Model.ready to be true." + "The model is not loaded. Use Model.readyEvent or wait for Model.ready to be true.", ); } //>>includeEnd('debug'); @@ -1200,7 +1199,7 @@ Object.defineProperties(Model.prototype, { ) { oneTimeWarning( "model-debug-wireframe-ignored", - "enableDebugWireframe must be set to true in Model.fromGltfAsync, otherwise debugWireframe will be ignored." + "enableDebugWireframe must be set to true in Model.fromGltfAsync, otherwise debugWireframe will be ignored.", ); } }, @@ -1715,7 +1714,7 @@ Model.prototype.getNode = function (name) { //>>includeStart('debug', pragmas.debug); if (!this._ready) { throw new DeveloperError( - "The model is not loaded. Use Model.readyEvent or wait for Model.ready to be true." + "The model is not loaded. Use Model.readyEvent or wait for Model.ready to be true.", ); } Check.typeOf.string("name", name); @@ -1745,7 +1744,7 @@ Model.prototype.setArticulationStage = function (articulationStageKey, value) { Check.typeOf.number("value", value); if (!this._ready) { throw new DeveloperError( - "The model is not loaded. Use Model.readyEvent or wait for Model.ready to be true." + "The model is not loaded. Use Model.readyEvent or wait for Model.ready to be true.", ); } //>>includeEnd('debug'); @@ -1764,7 +1763,7 @@ Model.prototype.applyArticulations = function () { //>>includeStart('debug', pragmas.debug); if (!this._ready) { throw new DeveloperError( - "The model is not loaded. Use Model.readyEvent or wait for Model.ready to be true." + "The model is not loaded. Use Model.readyEvent or wait for Model.ready to be true.", ); } //>>includeEnd('debug'); @@ -1820,7 +1819,7 @@ Model.prototype.update = function (frameState) { const runtimeError = ModelUtility.getError( "model", this._resource, - error + error, ); handleError(this, runtimeError); } @@ -1845,7 +1844,7 @@ Model.prototype.update = function (frameState) { const error = ModelUtility.getError( "model", this._resource, - new RuntimeError("Failed to load model.") + new RuntimeError("Failed to load model."), ); handleError(error); this._rejectLoad = this._rejectLoad && this._rejectLoad(error); @@ -2013,7 +2012,7 @@ function updateStyleCommandsNeeded(model) { const featureTable = model.featureTables[model.featureTableId]; model._styleCommandsNeeded = StyleCommandsNeeded.getStyleCommandsNeeded( featureTable.featuresLength, - featureTable.batchTexture.translucentFeaturesLength + featureTable.batchTexture.translucentFeaturesLength, ); } @@ -2133,7 +2132,7 @@ function updateModelMatrix(model, frameState) { //>>includeStart('debug', pragmas.debug); if (frameState.mode !== SceneMode.SCENE3D && model._projectTo2D) { throw new DeveloperError( - "Model.modelMatrix cannot be changed in 2D or Columbus View if projectTo2D is true." + "Model.modelMatrix cannot be changed in 2D or Columbus View if projectTo2D is true.", ); } //>>includeEnd('debug'); @@ -2164,7 +2163,7 @@ function updateClamping(model) { //>>includeStart('debug', pragmas.debug); if (model.heightReference !== HeightReference.NONE) { throw new DeveloperError( - "Height reference is not supported without a scene." + "Height reference is not supported without a scene.", ); } //>>includeEnd('debug'); @@ -2189,7 +2188,7 @@ function updateClamping(model) { model._removeUpdateHeightCallback = scene.updateHeight( cartoPosition, getUpdateHeightCallback(model, ellipsoid, cartoPosition), - model.heightReference + model.heightReference, ); // Set the correct height now @@ -2229,14 +2228,14 @@ function updateBoundingSphere(model, modelMatrix) { model._boundingSphere.center = Cartesian3.multiplyByScalar( model._sceneGraph.boundingSphere.center, model._clampedScale, - model._boundingSphere.center + model._boundingSphere.center, ); model._boundingSphere.radius = model._initialRadius * model._clampedScale; model._boundingSphere = BoundingSphere.transform( model._boundingSphere, modelMatrix, - model._boundingSphere + model._boundingSphere, ); } @@ -2248,7 +2247,7 @@ function updateComputedScale(model, modelMatrix, frameState) { const context = frameState.context; const maxPixelSize = Math.max( context.drawingBufferWidth, - context.drawingBufferHeight + context.drawingBufferHeight, ); Matrix4.getTranslation(modelMatrix, scratchPosition); @@ -2257,7 +2256,7 @@ function updateComputedScale(model, modelMatrix, frameState) { SceneTransforms.computeActualEllipsoidPosition( frameState, scratchPosition, - scratchPosition + scratchPosition, ); } @@ -2268,7 +2267,7 @@ function updateComputedScale(model, modelMatrix, frameState) { const pixelsPerMeter = 1.0 / metersPerPixel; const diameterInPixels = Math.min( pixelsPerMeter * (2.0 * radius), - maxPixelSize + maxPixelSize, ); // Maintain model's minimum pixel size @@ -2317,20 +2316,20 @@ function updateReferenceMatrices(model, frameState) { iblReferenceFrameMatrix4 = Matrix4.multiply( context.uniformState.view3D, referenceMatrix, - iblReferenceFrameMatrix4 + iblReferenceFrameMatrix4, ); iblReferenceFrameMatrix3 = Matrix4.getRotation( iblReferenceFrameMatrix4, - iblReferenceFrameMatrix3 + iblReferenceFrameMatrix3, ); iblReferenceFrameMatrix3 = Matrix3.transpose( iblReferenceFrameMatrix3, - iblReferenceFrameMatrix3 + iblReferenceFrameMatrix3, ); model._iblReferenceFrameMatrix = Matrix3.multiply( yUpToZUp, iblReferenceFrameMatrix3, - model._iblReferenceFrameMatrix + model._iblReferenceFrameMatrix, ); } @@ -2339,16 +2338,16 @@ function updateReferenceMatrices(model, frameState) { clippingPlanesMatrix = Matrix4.multiply( context.uniformState.view3D, referenceMatrix, - clippingPlanesMatrix + clippingPlanesMatrix, ); clippingPlanesMatrix = Matrix4.multiply( clippingPlanesMatrix, model._clippingPlanes.modelMatrix, - clippingPlanesMatrix + clippingPlanesMatrix, ); model._clippingPlanesMatrix = Matrix4.inverseTranspose( clippingPlanesMatrix, - model._clippingPlanesMatrix + model._clippingPlanesMatrix, ); } } @@ -2426,7 +2425,7 @@ function submitDrawCommands(model, frameState) { const displayConditionPassed = passesDistanceDisplayCondition( model, - frameState + frameState, ); const invisible = model.isInvisible(); @@ -2459,7 +2458,7 @@ function scaleInPixels(positionWC, radius, frameState) { return frameState.camera.getPixelSize( scratchBoundingSphere, frameState.context.drawingBufferWidth, - frameState.context.drawingBufferHeight + frameState.context.drawingBufferHeight, ); } @@ -2472,7 +2471,7 @@ function getUpdateHeightCallback(model, ellipsoid, originalPostition) { ellipsoid.cartographicToCartesian( clampedPosition, - scratchUpdateHeightCartesian + scratchUpdateHeightCartesian, ); const clampedModelMatrix = model._clampedModelMatrix; @@ -2508,7 +2507,7 @@ function passesDistanceDisplayCondition(model, frameState) { // Distance to center of primitive's reference frame const position = Matrix4.getTranslation( model.modelMatrix, - scratchDisplayConditionCartesian + scratchDisplayConditionCartesian, ); // This will project the position if the scene is in Columbus View, @@ -2516,12 +2515,12 @@ function passesDistanceDisplayCondition(model, frameState) { SceneTransforms.computeActualEllipsoidPosition( frameState, position, - position + position, ); distanceSquared = Cartesian3.distanceSquared( position, - frameState.camera.positionWC + frameState.camera.positionWC, ); } @@ -2637,7 +2636,7 @@ Model.prototype.pick = function ( frameState, verticalExaggeration, relativeHeight, - result + result, ) { return pickModel( this, @@ -2645,7 +2644,7 @@ Model.prototype.pick = function ( frameState, verticalExaggeration, relativeHeight, - result + result, ); }; @@ -3093,7 +3092,7 @@ Model.fromGeoJson = async function (options) { const modelOptions = makeModelOptions( loader, ModelType.TILE_GEOJSON, - options + options, ); const model = new Model(modelOptions); return model; diff --git a/packages/engine/Source/Scene/Model/Model3DTileContent.js b/packages/engine/Source/Scene/Model/Model3DTileContent.js index a32206d3dba6..9b2ab92d98af 100644 --- a/packages/engine/Source/Scene/Model/Model3DTileContent.js +++ b/packages/engine/Source/Scene/Model/Model3DTileContent.js @@ -159,7 +159,7 @@ Model3DTileContent.prototype.getFeature = function (featureId) { //>>includeStart('debug', pragmas.debug); if (!defined(featureTableId)) { throw new DeveloperError( - "No feature ID set is selected. Make sure Cesium3DTileset.featureIdLabel or Cesium3DTileset.instanceFeatureIdLabel is defined" + "No feature ID set is selected. Make sure Cesium3DTileset.featureIdLabel or Cesium3DTileset.instanceFeatureIdLabel is defined", ); } //>>includeEnd('debug'); @@ -169,7 +169,7 @@ Model3DTileContent.prototype.getFeature = function (featureId) { //>>includeStart('debug', pragmas.debug); if (!defined(featureTable)) { throw new DeveloperError( - "No feature table found for the selected feature ID set" + "No feature table found for the selected feature ID set", ); } //>>includeEnd('debug'); @@ -180,7 +180,7 @@ Model3DTileContent.prototype.getFeature = function (featureId) { throw new DeveloperError( `featureId is required and must be between 0 and featuresLength - 1 (${ featuresLength - 1 - }).` + }).`, ); } //>>includeEnd('debug'); @@ -309,7 +309,7 @@ Model3DTileContent.fromGltf = async function (tileset, tile, resource, gltf) { tileset, tile, content, - additionalOptions + additionalOptions, ); const classificationType = tileset.vectorClassificationOnly @@ -329,7 +329,7 @@ Model3DTileContent.fromB3dm = async function ( tile, resource, arrayBuffer, - byteOffset + byteOffset, ) { const content = new Model3DTileContent(tileset, tile, resource); @@ -343,7 +343,7 @@ Model3DTileContent.fromB3dm = async function ( tileset, tile, content, - additionalOptions + additionalOptions, ); const classificationType = tileset.vectorClassificationOnly @@ -363,7 +363,7 @@ Model3DTileContent.fromI3dm = async function ( tile, resource, arrayBuffer, - byteOffset + byteOffset, ) { const content = new Model3DTileContent(tileset, tile, resource); @@ -377,7 +377,7 @@ Model3DTileContent.fromI3dm = async function ( tileset, tile, content, - additionalOptions + additionalOptions, ); const model = await Model.fromI3dm(modelOptions); @@ -391,7 +391,7 @@ Model3DTileContent.fromPnts = async function ( tile, resource, arrayBuffer, - byteOffset + byteOffset, ) { const content = new Model3DTileContent(tileset, tile, resource); @@ -405,7 +405,7 @@ Model3DTileContent.fromPnts = async function ( tileset, tile, content, - additionalOptions + additionalOptions, ); const model = await Model.fromPnts(modelOptions); content._model = model; @@ -417,7 +417,7 @@ Model3DTileContent.fromGeoJson = async function ( tileset, tile, resource, - geoJson + geoJson, ) { const content = new Model3DTileContent(tileset, tile, resource); @@ -430,7 +430,7 @@ Model3DTileContent.fromGeoJson = async function ( tileset, tile, content, - additionalOptions + additionalOptions, ); const model = await Model.fromGeoJson(modelOptions); content._model = model; @@ -463,7 +463,7 @@ Model3DTileContent.prototype.pick = function (ray, frameState, result) { verticalExaggeration, relativeHeight, Ellipsoid.WGS84, - result + result, ); }; diff --git a/packages/engine/Source/Scene/Model/ModelAnimationChannel.js b/packages/engine/Source/Scene/Model/ModelAnimationChannel.js index b8f8e0ea4fca..9dbb92a00b5c 100644 --- a/packages/engine/Source/Scene/Model/ModelAnimationChannel.js +++ b/packages/engine/Source/Scene/Model/ModelAnimationChannel.js @@ -280,12 +280,12 @@ ModelAnimationChannel.prototype.animate = function (time) { ) { runtimeNode[path] = spline.evaluate( localAnimationTime, - scratchCartesian3 + scratchCartesian3, ); } else if (path === AnimatedPropertyType.ROTATION) { runtimeNode[path] = spline.evaluate( localAnimationTime, - scratchQuaternion + scratchQuaternion, ); } } diff --git a/packages/engine/Source/Scene/Model/ModelAnimationCollection.js b/packages/engine/Source/Scene/Model/ModelAnimationCollection.js index d3d18aaccf72..3c441c0aa94f 100644 --- a/packages/engine/Source/Scene/Model/ModelAnimationCollection.js +++ b/packages/engine/Source/Scene/Model/ModelAnimationCollection.js @@ -174,7 +174,7 @@ ModelAnimationCollection.prototype.add = function (options) { //>>includeStart('debug', pragmas.debug); if (!model.ready) { throw new DeveloperError( - "Animations are not loaded. Wait for Model.ready to be true." + "Animations are not loaded. Wait for Model.ready to be true.", ); } //>>includeEnd('debug'); @@ -184,7 +184,7 @@ ModelAnimationCollection.prototype.add = function (options) { //>>includeStart('debug', pragmas.debug); if (!defined(options.name) && !defined(options.index)) { throw new DeveloperError( - "Either options.name or options.index must be defined." + "Either options.name or options.index must be defined.", ); } @@ -258,7 +258,7 @@ ModelAnimationCollection.prototype.addAll = function (options) { //>>includeStart('debug', pragmas.debug); if (!model.ready) { throw new DeveloperError( - "Animations are not loaded. Wait for Model.ready to be true." + "Animations are not loaded. Wait for Model.ready to be true.", ); } @@ -371,7 +371,7 @@ ModelAnimationCollection.prototype.get = function (index) { if (index >= this._runtimeAnimations.length || index < 0) { throw new DeveloperError( - "index must be valid within the range of the collection" + "index must be valid within the range of the collection", ); } //>>includeEnd('debug'); @@ -384,7 +384,7 @@ const animationsToRemove = []; function createAnimationRemovedFunction( modelAnimationCollection, model, - animation + animation, ) { return function () { modelAnimationCollection.animationRemoved.raiseEvent(model, animation); @@ -428,7 +428,7 @@ ModelAnimationCollection.prototype.update = function (frameState) { runtimeAnimation._computedStartTime = JulianDate.addSeconds( defaultValue(runtimeAnimation.startTime, sceneTime), runtimeAnimation.delay, - new JulianDate() + new JulianDate(), ); } @@ -450,7 +450,7 @@ ModelAnimationCollection.prototype.update = function (frameState) { if (duration !== 0.0) { const seconds = JulianDate.secondsDifference( reachedStopTime ? stopTime : sceneTime, - startTime + startTime, ); delta = defined(runtimeAnimation._animationTime) ? runtimeAnimation._animationTime(duration, seconds) @@ -511,7 +511,7 @@ ModelAnimationCollection.prototype.update = function (frameState) { localAnimationTime = CesiumMath.clamp( localAnimationTime, runtimeAnimation.localStartTime, - runtimeAnimation.localStopTime + runtimeAnimation.localStopTime, ); runtimeAnimation.animate(localAnimationTime); @@ -542,7 +542,7 @@ ModelAnimationCollection.prototype.update = function (frameState) { const animationToRemove = animationsToRemove[j]; runtimeAnimations.splice(runtimeAnimations.indexOf(animationToRemove), 1); frameState.afterRender.push( - createAnimationRemovedFunction(this, model, animationToRemove) + createAnimationRemovedFunction(this, model, animationToRemove), ); } animationsToRemove.length = 0; diff --git a/packages/engine/Source/Scene/Model/ModelArticulation.js b/packages/engine/Source/Scene/Model/ModelArticulation.js index 401be000165b..bc3f745d9d6d 100644 --- a/packages/engine/Source/Scene/Model/ModelArticulation.js +++ b/packages/engine/Source/Scene/Model/ModelArticulation.js @@ -184,7 +184,7 @@ ModelArticulation.prototype.apply = function () { let articulationMatrix = Matrix4.clone( Matrix4.IDENTITY, - scratchArticulationMatrix + scratchArticulationMatrix, ); let i; @@ -205,7 +205,7 @@ ModelArticulation.prototype.apply = function () { const transform = Matrix4.multiplyTransformation( node.originalTransform, articulationMatrix, - scratchNodeMatrix + scratchNodeMatrix, ); node.transform = transform; } diff --git a/packages/engine/Source/Scene/Model/ModelArticulationStage.js b/packages/engine/Source/Scene/Model/ModelArticulationStage.js index e0805f8aa651..772c03966732 100644 --- a/packages/engine/Source/Scene/Model/ModelArticulationStage.js +++ b/packages/engine/Source/Scene/Model/ModelArticulationStage.js @@ -155,7 +155,7 @@ Object.defineProperties(ModelArticulationStage.prototype, { !CesiumMath.equalsEpsilon( this._currentValue, value, - articulationEpsilon + articulationEpsilon, ) ) { this._currentValue = value; @@ -194,21 +194,21 @@ ModelArticulationStage.prototype.applyStageToMatrix = function (result) { case ArticulationStageType.XROTATE: rotation = Matrix3.fromRotationX( CesiumMath.toRadians(value), - scratchArticulationRotation + scratchArticulationRotation, ); result = Matrix4.multiplyByMatrix3(result, rotation, result); break; case ArticulationStageType.YROTATE: rotation = Matrix3.fromRotationY( CesiumMath.toRadians(value), - scratchArticulationRotation + scratchArticulationRotation, ); result = Matrix4.multiplyByMatrix3(result, rotation, result); break; case ArticulationStageType.ZROTATE: rotation = Matrix3.fromRotationZ( CesiumMath.toRadians(value), - scratchArticulationRotation + scratchArticulationRotation, ); result = Matrix4.multiplyByMatrix3(result, rotation, result); break; diff --git a/packages/engine/Source/Scene/Model/ModelClippingPlanesPipelineStage.js b/packages/engine/Source/Scene/Model/ModelClippingPlanesPipelineStage.js index 8d9945f244d4..f9107a4a9f70 100644 --- a/packages/engine/Source/Scene/Model/ModelClippingPlanesPipelineStage.js +++ b/packages/engine/Source/Scene/Model/ModelClippingPlanesPipelineStage.js @@ -36,7 +36,7 @@ const textureResolutionScratch = new Cartesian2(); ModelClippingPlanesPipelineStage.process = function ( renderResources, model, - frameState + frameState, ) { const clippingPlanes = model.clippingPlanes; const context = frameState.context; @@ -45,20 +45,20 @@ ModelClippingPlanesPipelineStage.process = function ( shaderBuilder.addDefine( "HAS_CLIPPING_PLANES", undefined, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); shaderBuilder.addDefine( "CLIPPING_PLANES_LENGTH", clippingPlanes.length, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); if (clippingPlanes.unionClippingRegions) { shaderBuilder.addDefine( "UNION_CLIPPING_REGIONS", undefined, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); } @@ -66,42 +66,42 @@ ModelClippingPlanesPipelineStage.process = function ( shaderBuilder.addDefine( "USE_CLIPPING_PLANES_FLOAT_TEXTURE", undefined, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); } const textureResolution = ClippingPlaneCollection.getTextureResolution( clippingPlanes, context, - textureResolutionScratch + textureResolutionScratch, ); shaderBuilder.addDefine( "CLIPPING_PLANES_TEXTURE_WIDTH", textureResolution.x, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); shaderBuilder.addDefine( "CLIPPING_PLANES_TEXTURE_HEIGHT", textureResolution.y, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); shaderBuilder.addUniform( "sampler2D", "model_clippingPlanes", - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); shaderBuilder.addUniform( "vec4", "model_clippingPlanesEdgeStyle", - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); shaderBuilder.addUniform( "mat4", "model_clippingPlanesMatrix", - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); shaderBuilder.addFragmentLines(ModelClippingPlanesStageFS); diff --git a/packages/engine/Source/Scene/Model/ModelClippingPolygonsPipelineStage.js b/packages/engine/Source/Scene/Model/ModelClippingPolygonsPipelineStage.js index c9eb597140c7..56e9d25c6c8b 100644 --- a/packages/engine/Source/Scene/Model/ModelClippingPolygonsPipelineStage.js +++ b/packages/engine/Source/Scene/Model/ModelClippingPolygonsPipelineStage.js @@ -35,7 +35,7 @@ const ModelClippingPolygonsPipelineStage = { ModelClippingPolygonsPipelineStage.process = function ( renderResources, model, - frameState + frameState, ) { const clippingPolygons = model.clippingPolygons; const shaderBuilder = renderResources.shaderBuilder; @@ -43,33 +43,33 @@ ModelClippingPolygonsPipelineStage.process = function ( shaderBuilder.addDefine( "ENABLE_CLIPPING_POLYGONS", undefined, - ShaderDestination.BOTH + ShaderDestination.BOTH, ); if (clippingPolygons.inverse) { shaderBuilder.addDefine( "CLIPPING_INVERSE", undefined, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); } shaderBuilder.addDefine( "CLIPPING_POLYGON_REGIONS_LENGTH", clippingPolygons.extentsCount, - ShaderDestination.BOTH + ShaderDestination.BOTH, ); shaderBuilder.addUniform( "sampler2D", "model_clippingDistance", - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); shaderBuilder.addUniform( "sampler2D", "model_clippingExtents", - ShaderDestination.VERTEX + ShaderDestination.VERTEX, ); shaderBuilder.addVarying("vec2", "v_clippingPosition"); diff --git a/packages/engine/Source/Scene/Model/ModelColorPipelineStage.js b/packages/engine/Source/Scene/Model/ModelColorPipelineStage.js index fc9c26284962..04a026f1d140 100644 --- a/packages/engine/Source/Scene/Model/ModelColorPipelineStage.js +++ b/packages/engine/Source/Scene/Model/ModelColorPipelineStage.js @@ -37,14 +37,14 @@ const ModelColorPipelineStage = { ModelColorPipelineStage.process = function ( renderResources, model, - frameState + frameState, ) { const shaderBuilder = renderResources.shaderBuilder; shaderBuilder.addDefine( "HAS_MODEL_COLOR", undefined, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); shaderBuilder.addFragmentLines(ModelColorStageFS); @@ -69,7 +69,7 @@ ModelColorPipelineStage.process = function ( shaderBuilder.addUniform( "vec4", ModelColorPipelineStage.COLOR_UNIFORM_NAME, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); stageUniforms[ModelColorPipelineStage.COLOR_UNIFORM_NAME] = function () { return model.color; @@ -79,20 +79,19 @@ ModelColorPipelineStage.process = function ( shaderBuilder.addUniform( "float", ModelColorPipelineStage.COLOR_BLEND_UNIFORM_NAME, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); - stageUniforms[ - ModelColorPipelineStage.COLOR_BLEND_UNIFORM_NAME - ] = function () { - return ColorBlendMode.getColorBlend( - model.colorBlendMode, - model.colorBlendAmount - ); - }; + stageUniforms[ModelColorPipelineStage.COLOR_BLEND_UNIFORM_NAME] = + function () { + return ColorBlendMode.getColorBlend( + model.colorBlendMode, + model.colorBlendAmount, + ); + }; renderResources.uniformMap = combine( stageUniforms, - renderResources.uniformMap + renderResources.uniformMap, ); }; diff --git a/packages/engine/Source/Scene/Model/ModelDrawCommand.js b/packages/engine/Source/Scene/Model/ModelDrawCommand.js index 83323fc1ec7d..4bbc2a841aca 100644 --- a/packages/engine/Source/Scene/Model/ModelDrawCommand.js +++ b/packages/engine/Source/Scene/Model/ModelDrawCommand.js @@ -299,7 +299,7 @@ Object.defineProperties(ModelDrawCommand.prototype, { this._boundingVolume = BoundingSphere.transform( this.runtimePrimitive.boundingSphere, this._modelMatrix, - this._boundingVolume + this._boundingVolume, ); }, }, @@ -413,7 +413,7 @@ function updateModelMatrix2D(drawCommand, frameState) { const modelMatrix = drawCommand._modelMatrix; drawCommand._modelMatrix2D = Matrix4.clone( modelMatrix, - drawCommand._modelMatrix2D + drawCommand._modelMatrix2D, ); // Change the translation's y-component so it appears on the opposite side @@ -427,7 +427,7 @@ function updateModelMatrix2D(drawCommand, frameState) { drawCommand._boundingVolume2D = BoundingSphere.transform( drawCommand.runtimePrimitive.boundingSphere, drawCommand._modelMatrix2D, - drawCommand._boundingVolume2D + drawCommand._boundingVolume2D, ); } @@ -537,7 +537,7 @@ ModelDrawCommand.prototype.pushCommands = function (frameState, result) { pushCommand( tileset._backfaceCommands, this._skipLodBackfaceCommand, - use2D + use2D, ); } @@ -578,7 +578,7 @@ ModelDrawCommand.prototype.pushCommands = function (frameState, result) { */ ModelDrawCommand.prototype.pushSilhouetteCommands = function ( frameState, - result + result, ) { const use2D = shouldUse2DCommands(this, frameState); pushCommand(result, this._silhouetteColorCommand, use2D); diff --git a/packages/engine/Source/Scene/Model/ModelFeatureTable.js b/packages/engine/Source/Scene/Model/ModelFeatureTable.js index 1a18a39029d8..dff95e0582e8 100644 --- a/packages/engine/Source/Scene/Model/ModelFeatureTable.js +++ b/packages/engine/Source/Scene/Model/ModelFeatureTable.js @@ -167,7 +167,7 @@ ModelFeatureTable.prototype.update = function (frameState) { const currentStyleCommandsNeeded = StyleCommandsNeeded.getStyleCommandsNeeded( this._featuresLength, - this._batchTexture.translucentFeaturesLength + this._batchTexture.translucentFeaturesLength, ); if (this._styleCommandsNeeded !== currentStyleCommandsNeeded) { @@ -214,7 +214,7 @@ ModelFeatureTable.prototype.hasProperty = function (featureId, propertyName) { ModelFeatureTable.prototype.hasPropertyBySemantic = function ( featureId, - propertyName + propertyName, ) { return this._propertyTable.hasPropertyBySemantic(featureId, propertyName); }; @@ -225,7 +225,7 @@ ModelFeatureTable.prototype.getProperty = function (featureId, name) { ModelFeatureTable.prototype.getPropertyBySemantic = function ( featureId, - semantic + semantic, ) { return this._propertyTable.getPropertyBySemantic(featureId, semantic); }; @@ -266,13 +266,13 @@ ModelFeatureTable.prototype.applyStyle = function (style) { const color = defined(style.color) ? defaultValue( style.color.evaluateColor(feature, scratchColor), - BatchTexture.DEFAULT_COLOR_VALUE + BatchTexture.DEFAULT_COLOR_VALUE, ) : BatchTexture.DEFAULT_COLOR_VALUE; const show = defined(style.show) ? defaultValue( style.show.evaluate(feature), - BatchTexture.DEFAULT_SHOW_VALUE + BatchTexture.DEFAULT_SHOW_VALUE, ) : BatchTexture.DEFAULT_SHOW_VALUE; diff --git a/packages/engine/Source/Scene/Model/ModelMatrixUpdateStage.js b/packages/engine/Source/Scene/Model/ModelMatrixUpdateStage.js index c0c21674846b..4b34a2468dd7 100644 --- a/packages/engine/Source/Scene/Model/ModelMatrixUpdateStage.js +++ b/packages/engine/Source/Scene/Model/ModelMatrixUpdateStage.js @@ -42,7 +42,7 @@ ModelMatrixUpdateStage.update = function (runtimeNode, sceneGraph, frameState) { runtimeNode, sceneGraph, modelMatrix, - runtimeNode.transformToRoot + runtimeNode.transformToRoot, ); runtimeNode._transformDirty = false; } @@ -57,7 +57,7 @@ function updateRuntimeNode( runtimeNode, sceneGraph, modelMatrix, - transformToRoot + transformToRoot, ) { let i; @@ -65,7 +65,7 @@ function updateRuntimeNode( transformToRoot = Matrix4.multiplyTransformation( transformToRoot, runtimeNode.transform, - new Matrix4() + new Matrix4(), ); runtimeNode.updateComputedTransform(); @@ -77,11 +77,11 @@ function updateRuntimeNode( drawCommand.modelMatrix = Matrix4.multiplyTransformation( modelMatrix, transformToRoot, - drawCommand.modelMatrix + drawCommand.modelMatrix, ); drawCommand.cullFace = ModelUtility.getCullFace( drawCommand.modelMatrix, - drawCommand.primitiveType + drawCommand.primitiveType, ); } @@ -92,14 +92,14 @@ function updateRuntimeNode( // Update transformToRoot to accommodate changes in the transforms of this node and its ancestors childRuntimeNode._transformToRoot = Matrix4.clone( transformToRoot, - childRuntimeNode._transformToRoot + childRuntimeNode._transformToRoot, ); updateRuntimeNode( childRuntimeNode, sceneGraph, modelMatrix, - transformToRoot + transformToRoot, ); childRuntimeNode._transformDirty = false; } diff --git a/packages/engine/Source/Scene/Model/ModelRenderResources.js b/packages/engine/Source/Scene/Model/ModelRenderResources.js index e3f7610bd852..5cab3dc11504 100644 --- a/packages/engine/Source/Scene/Model/ModelRenderResources.js +++ b/packages/engine/Source/Scene/Model/ModelRenderResources.js @@ -76,7 +76,7 @@ function ModelRenderResources(model) { enabled: true, func: DepthFunction.LESS_OR_EQUAL, }, - }) + }), ); /** diff --git a/packages/engine/Source/Scene/Model/ModelRuntimeNode.js b/packages/engine/Source/Scene/Model/ModelRuntimeNode.js index ac1eba5e805f..a45a3078304e 100644 --- a/packages/engine/Source/Scene/Model/ModelRuntimeNode.js +++ b/packages/engine/Source/Scene/Model/ModelRuntimeNode.js @@ -328,7 +328,7 @@ Object.defineProperties(ModelRuntimeNode.prototype, { //>>includeStart('debug', pragmas.debug); if (!defined(transformParameters)) { throw new DeveloperError( - "The translation of a node cannot be set if it was defined using a matrix in the model." + "The translation of a node cannot be set if it was defined using a matrix in the model.", ); } //>>includeEnd('debug'); @@ -340,7 +340,7 @@ Object.defineProperties(ModelRuntimeNode.prototype, { transformParameters.translation = Cartesian3.clone( value, - transformParameters.translation + transformParameters.translation, ); updateTransformFromParameters(this, transformParameters); @@ -372,7 +372,7 @@ Object.defineProperties(ModelRuntimeNode.prototype, { //>>includeStart('debug', pragmas.debug); if (!defined(transformParameters)) { throw new DeveloperError( - "The rotation of a node cannot be set if it was defined using a matrix in the model." + "The rotation of a node cannot be set if it was defined using a matrix in the model.", ); } //>>includeEnd('debug'); @@ -384,7 +384,7 @@ Object.defineProperties(ModelRuntimeNode.prototype, { transformParameters.rotation = Quaternion.clone( value, - transformParameters.rotation + transformParameters.rotation, ); updateTransformFromParameters(this, transformParameters); @@ -415,7 +415,7 @@ Object.defineProperties(ModelRuntimeNode.prototype, { //>>includeStart('debug', pragmas.debug); if (!defined(transformParameters)) { throw new DeveloperError( - "The scale of a node cannot be set if it was defined using a matrix in the model." + "The scale of a node cannot be set if it was defined using a matrix in the model.", ); } //>>includeEnd('debug'); @@ -426,7 +426,7 @@ Object.defineProperties(ModelRuntimeNode.prototype, { transformParameters.scale = Cartesian3.clone( value, - transformParameters.scale + transformParameters.scale, ); updateTransformFromParameters(this, transformParameters); @@ -451,7 +451,7 @@ Object.defineProperties(ModelRuntimeNode.prototype, { //>>includeStart('debug', pragmas.debug); if (this._morphWeights.length !== valueLength) { throw new DeveloperError( - "value must have the same length as the original weights array." + "value must have the same length as the original weights array.", ); } //>>includeEnd('debug'); @@ -499,7 +499,7 @@ function initialize(runtimeNode) { runtimeNode._computedTransform = Matrix4.multiply( transformToRoot, transform, - computedTransform + computedTransform, ); const node = runtimeNode.node; @@ -507,7 +507,7 @@ function initialize(runtimeNode) { runtimeNode._transformParameters = new TranslationRotationScale( node.translation, node.rotation, - node.scale + node.scale, ); } @@ -534,7 +534,7 @@ function updateTransformFromParameters(runtimeNode, transformParameters) { runtimeNode._transform = Matrix4.fromTranslationRotationScale( transformParameters, - runtimeNode._transform + runtimeNode._transform, ); } @@ -559,7 +559,7 @@ ModelRuntimeNode.prototype.getChild = function (index) { Check.typeOf.number("index", index); if (index < 0 || index >= this.children.length) { throw new DeveloperError( - "index must be greater than or equal to 0 and less than the number of children." + "index must be greater than or equal to 0 and less than the number of children.", ); } //>>includeEnd('debug'); @@ -599,7 +599,7 @@ ModelRuntimeNode.prototype.updateComputedTransform = function () { this._computedTransform = Matrix4.multiply( this._transformToRoot, this._transform, - this._computedTransform + this._computedTransform, ); }; @@ -629,18 +629,18 @@ ModelRuntimeNode.prototype.updateJointMatrices = function () { const nodeWorldTransform = Matrix4.multiplyTransformation( this.transformToRoot, this.transform, - computedJointMatrices[i] + computedJointMatrices[i], ); const inverseNodeWorldTransform = Matrix4.inverseTransformation( nodeWorldTransform, - computedJointMatrices[i] + computedJointMatrices[i], ); computedJointMatrices[i] = Matrix4.multiplyTransformation( inverseNodeWorldTransform, skinJointMatrices[i], - computedJointMatrices[i] + computedJointMatrices[i], ); } }; diff --git a/packages/engine/Source/Scene/Model/ModelRuntimePrimitive.js b/packages/engine/Source/Scene/Model/ModelRuntimePrimitive.js index fb4b7b083249..e5568acb35e4 100644 --- a/packages/engine/Source/Scene/Model/ModelRuntimePrimitive.js +++ b/packages/engine/Source/Scene/Model/ModelRuntimePrimitive.js @@ -212,7 +212,7 @@ ModelRuntimePrimitive.prototype.configurePipeline = function (frameState) { !hasCustomFragmentShader || customShader.mode !== CustomShaderMode.REPLACE_MATERIAL; const hasQuantization = ModelUtility.hasQuantizedAttributes( - primitive.attributes + primitive.attributes, ); const generateWireframeIndices = model.debugWireframe && @@ -316,7 +316,7 @@ function inspectFeatureIds(model, node, primitive) { if (defined(node.instances)) { featureIds = ModelUtility.getFeatureIdsByLabel( node.instances.featureIds, - model.instanceFeatureIdLabel + model.instanceFeatureIdLabel, ); if (defined(featureIds)) { @@ -329,7 +329,7 @@ function inspectFeatureIds(model, node, primitive) { featureIds = ModelUtility.getFeatureIdsByLabel( primitive.featureIds, - model.featureIdLabel + model.featureIdLabel, ); if (defined(featureIds)) { return { diff --git a/packages/engine/Source/Scene/Model/ModelSceneGraph.js b/packages/engine/Source/Scene/Model/ModelSceneGraph.js index 954c63081acc..aac9461e7981 100644 --- a/packages/engine/Source/Scene/Model/ModelSceneGraph.js +++ b/packages/engine/Source/Scene/Model/ModelSceneGraph.js @@ -158,7 +158,7 @@ function ModelSceneGraph(options) { this._axisCorrectionMatrix = ModelUtility.getAxisCorrectionMatrix( components.upAxis, components.forwardAxis, - new Matrix4() + new Matrix4(), ); // Store articulations from the AGI_articulations extension @@ -271,7 +271,7 @@ function initialize(sceneGraph) { const rootNodeIndex = traverseAndCreateSceneGraph( sceneGraph, rootNode, - transformToRoot + transformToRoot, ); sceneGraph._rootNodes.push(rootNodeIndex); @@ -288,7 +288,7 @@ function initialize(sceneGraph) { new ModelSkin({ skin: skin, sceneGraph: sceneGraph, - }) + }), ); } @@ -318,19 +318,19 @@ function computeModelMatrix(sceneGraph, modelMatrix) { sceneGraph._computedModelMatrix = Matrix4.multiplyTransformation( modelMatrix, components.transform, - sceneGraph._computedModelMatrix + sceneGraph._computedModelMatrix, ); sceneGraph._computedModelMatrix = Matrix4.multiplyTransformation( sceneGraph._computedModelMatrix, sceneGraph._axisCorrectionMatrix, - sceneGraph._computedModelMatrix + sceneGraph._computedModelMatrix, ); sceneGraph._computedModelMatrix = Matrix4.multiplyByUniformScale( sceneGraph._computedModelMatrix, model.computedScale, - sceneGraph._computedModelMatrix + sceneGraph._computedModelMatrix, ); } @@ -340,33 +340,33 @@ function computeModelMatrix2D(sceneGraph, frameState) { const computedModelMatrix = sceneGraph._computedModelMatrix; const translation = Matrix4.getTranslation( computedModelMatrix, - scratchComputedTranslation + scratchComputedTranslation, ); if (!Cartesian3.equals(translation, Cartesian3.ZERO)) { sceneGraph._computedModelMatrix2D = Transforms.basisTo2D( frameState.mapProjection, computedModelMatrix, - sceneGraph._computedModelMatrix2D + sceneGraph._computedModelMatrix2D, ); } else { const center = sceneGraph.boundingSphere.center; const to2D = Transforms.ellipsoidTo2DModelMatrix( frameState.mapProjection, center, - sceneGraph._computedModelMatrix2D + sceneGraph._computedModelMatrix2D, ); sceneGraph._computedModelMatrix2D = Matrix4.multiply( to2D, computedModelMatrix, - sceneGraph._computedModelMatrix2D + sceneGraph._computedModelMatrix2D, ); } sceneGraph._boundingSphere2D = BoundingSphere.transform( sceneGraph._boundingSphere, sceneGraph._computedModelMatrix2D, - sceneGraph._boundingSphere2D + sceneGraph._boundingSphere2D, ); } @@ -393,13 +393,13 @@ function traverseAndCreateSceneGraph(sceneGraph, node, transformToRoot) { const childNodeTransformToRoot = Matrix4.multiplyTransformation( transformToRoot, transform, - new Matrix4() + new Matrix4(), ); const childIndex = traverseAndCreateSceneGraph( sceneGraph, childNode, - childNodeTransformToRoot + childNodeTransformToRoot, ); childrenIndices.push(childIndex); } @@ -420,7 +420,7 @@ function traverseAndCreateSceneGraph(sceneGraph, node, transformToRoot) { primitive: node.primitives[i], node: node, model: sceneGraph._model, - }) + }), ); } @@ -475,13 +475,13 @@ ModelSceneGraph.prototype.buildDrawCommands = function (frameState) { Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE, - scratchModelPositionMin + scratchModelPositionMin, ); const modelPositionMax = Cartesian3.fromElements( -Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE, - scratchModelPositionMax + scratchModelPositionMax, ); for (i = 0; i < this._runtimeNodes.length; i++) { @@ -498,7 +498,7 @@ ModelSceneGraph.prototype.buildDrawCommands = function (frameState) { const nodeRenderResources = new NodeRenderResources( modelRenderResources, - runtimeNode + runtimeNode, ); for (j = 0; j < nodePipelineStages.length; j++) { @@ -507,7 +507,7 @@ ModelSceneGraph.prototype.buildDrawCommands = function (frameState) { nodePipelineStage.process( nodeRenderResources, runtimeNode.node, - frameState + frameState, ); } @@ -520,7 +520,7 @@ ModelSceneGraph.prototype.buildDrawCommands = function (frameState) { const primitiveRenderResources = new PrimitiveRenderResources( nodeRenderResources, - runtimePrimitive + runtimePrimitive, ); for (k = 0; k < primitivePipelineStages.length; k++) { @@ -529,40 +529,40 @@ ModelSceneGraph.prototype.buildDrawCommands = function (frameState) { primitivePipelineStage.process( primitiveRenderResources, runtimePrimitive.primitive, - frameState + frameState, ); } runtimePrimitive.boundingSphere = BoundingSphere.clone( primitiveRenderResources.boundingSphere, - new BoundingSphere() + new BoundingSphere(), ); const primitivePositionMin = Matrix4.multiplyByPoint( nodeTransform, primitiveRenderResources.positionMin, - scratchPrimitivePositionMin + scratchPrimitivePositionMin, ); const primitivePositionMax = Matrix4.multiplyByPoint( nodeTransform, primitiveRenderResources.positionMax, - scratchPrimitivePositionMax + scratchPrimitivePositionMax, ); Cartesian3.minimumByComponent( modelPositionMin, primitivePositionMin, - modelPositionMin + modelPositionMin, ); Cartesian3.maximumByComponent( modelPositionMax, primitivePositionMax, - modelPositionMax + modelPositionMax, ); const drawCommand = buildDrawCommand( primitiveRenderResources, - frameState + frameState, ); runtimePrimitive.drawCommand = drawCommand; } @@ -571,25 +571,25 @@ ModelSceneGraph.prototype.buildDrawCommands = function (frameState) { this._boundingSphere = BoundingSphere.fromCornerPoints( modelPositionMin, modelPositionMax, - new BoundingSphere() + new BoundingSphere(), ); this._boundingSphere = BoundingSphere.transformWithoutScale( this._boundingSphere, this._axisCorrectionMatrix, - this._boundingSphere + this._boundingSphere, ); this._boundingSphere = BoundingSphere.transform( this._boundingSphere, this._components.transform, - this._boundingSphere + this._boundingSphere, ); model._boundingSphere = BoundingSphere.transform( this._boundingSphere, model.modelMatrix, - model._boundingSphere + model._boundingSphere, ); model._initialRadius = model._boundingSphere.radius; @@ -686,7 +686,7 @@ ModelSceneGraph.prototype.update = function (frameState, updateForAnimations) { ModelSceneGraph.prototype.updateModelMatrix = function ( modelMatrix, - frameState + frameState, ) { computeModelMatrix(this, modelMatrix); if (frameState.mode !== SceneMode.SCENE3D) { @@ -747,7 +747,7 @@ function traverseSceneGraph( runtimeNode, visibleNodesOnly, callback, - callbackOptions + callbackOptions, ) { if (visibleNodesOnly && !runtimeNode.show) { return; @@ -761,7 +761,7 @@ function traverseSceneGraph( childRuntimeNode, visibleNodesOnly, callback, - callbackOptions + callbackOptions, ); } @@ -777,7 +777,7 @@ function forEachRuntimePrimitive( sceneGraph, visibleNodesOnly, callback, - callbackOptions + callbackOptions, ) { const rootNodes = sceneGraph._rootNodes; const rootNodesLength = rootNodes.length; @@ -789,7 +789,7 @@ function forEachRuntimePrimitive( runtimeNode, visibleNodesOnly, callback, - callbackOptions + callbackOptions, ); } } @@ -812,7 +812,7 @@ ModelSceneGraph.prototype.updateBackFaceCulling = function (backFaceCulling) { this, false, updatePrimitiveBackFaceCulling, - backFaceCullingOptions + backFaceCullingOptions, ); }; @@ -857,7 +857,7 @@ const scratchShowBoundingVolumeOptions = { * @private */ ModelSceneGraph.prototype.updateShowBoundingVolume = function ( - debugShowBoundingVolume + debugShowBoundingVolume, ) { const showBoundingVolumeOptions = scratchShowBoundingVolumeOptions; showBoundingVolumeOptions.debugShowBoundingVolume = debugShowBoundingVolume; @@ -866,7 +866,7 @@ ModelSceneGraph.prototype.updateShowBoundingVolume = function ( this, false, updatePrimitiveShowBoundingVolume, - showBoundingVolumeOptions + showBoundingVolumeOptions, ); }; @@ -908,7 +908,7 @@ ModelSceneGraph.prototype.pushDrawCommands = function (frameState) { this, true, pushPrimitiveDrawCommands, - pushDrawCommandOptions + pushDrawCommandOptions, ); frameState.commandList.push.apply(frameState.commandList, silhouetteCommands); @@ -944,7 +944,7 @@ function pushPrimitiveDrawCommands(runtimePrimitive, options) { */ ModelSceneGraph.prototype.setArticulationStage = function ( articulationStageKey, - value + value, ) { const names = articulationStageKey.split(" "); if (names.length !== 2) { diff --git a/packages/engine/Source/Scene/Model/ModelSilhouettePipelineStage.js b/packages/engine/Source/Scene/Model/ModelSilhouettePipelineStage.js index abcdee908fc0..2a7a0116d9c6 100644 --- a/packages/engine/Source/Scene/Model/ModelSilhouettePipelineStage.js +++ b/packages/engine/Source/Scene/Model/ModelSilhouettePipelineStage.js @@ -51,7 +51,7 @@ ModelSilhouettePipelineStage.silhouettesLength = 0; ModelSilhouettePipelineStage.process = function ( renderResources, model, - frameState + frameState, ) { if (!defined(model._silhouetteId)) { model._silhouetteId = ++ModelSilhouettePipelineStage.silhouettesLength; @@ -66,13 +66,13 @@ ModelSilhouettePipelineStage.process = function ( shaderBuilder.addUniform( "vec4", "model_silhouetteColor", - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); shaderBuilder.addUniform( "float", "model_silhouetteSize", - ShaderDestination.VERTEX + ShaderDestination.VERTEX, ); // Rendering silhouettes requires two draw commands: @@ -86,7 +86,7 @@ ModelSilhouettePipelineStage.process = function ( shaderBuilder.addUniform( "bool", "model_silhouettePass", - ShaderDestination.BOTH + ShaderDestination.BOTH, ); const uniformMap = { diff --git a/packages/engine/Source/Scene/Model/ModelSkin.js b/packages/engine/Source/Scene/Model/ModelSkin.js index 72f7dca5549c..2a62ef61dcfb 100644 --- a/packages/engine/Source/Scene/Model/ModelSkin.js +++ b/packages/engine/Source/Scene/Model/ModelSkin.js @@ -136,7 +136,7 @@ function initialize(runtimeSkin) { const jointMatrix = computeJointMatrix( runtimeNode, inverseBindMatrix, - new Matrix4() + new Matrix4(), ); runtimeJointMatrices.push(jointMatrix); } @@ -146,13 +146,13 @@ function computeJointMatrix(joint, inverseBindMatrix, result) { const jointWorldTransform = Matrix4.multiplyTransformation( joint.transformToRoot, joint.transform, - result + result, ); result = Matrix4.multiplyTransformation( jointWorldTransform, inverseBindMatrix, - result + result, ); return result; @@ -172,7 +172,7 @@ ModelSkin.prototype.updateJointMatrices = function () { jointMatrices[i] = computeJointMatrix( joint, inverseBindMatrix, - jointMatrices[i] + jointMatrices[i], ); } }; diff --git a/packages/engine/Source/Scene/Model/ModelSplitterPipelineStage.js b/packages/engine/Source/Scene/Model/ModelSplitterPipelineStage.js index 909e9c5452d6..5d8130537807 100644 --- a/packages/engine/Source/Scene/Model/ModelSplitterPipelineStage.js +++ b/packages/engine/Source/Scene/Model/ModelSplitterPipelineStage.js @@ -33,14 +33,14 @@ const ModelSplitterPipelineStage = { ModelSplitterPipelineStage.process = function ( renderResources, model, - frameState + frameState, ) { const shaderBuilder = renderResources.shaderBuilder; shaderBuilder.addDefine( "HAS_MODEL_SPLITTER", undefined, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); shaderBuilder.addFragmentLines(ModelSplitterStageFS); @@ -49,17 +49,16 @@ ModelSplitterPipelineStage.process = function ( shaderBuilder.addUniform( "float", ModelSplitterPipelineStage.SPLIT_DIRECTION_UNIFORM_NAME, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); - stageUniforms[ - ModelSplitterPipelineStage.SPLIT_DIRECTION_UNIFORM_NAME - ] = function () { - return model.splitDirection; - }; + stageUniforms[ModelSplitterPipelineStage.SPLIT_DIRECTION_UNIFORM_NAME] = + function () { + return model.splitDirection; + }; renderResources.uniformMap = combine( stageUniforms, - renderResources.uniformMap + renderResources.uniformMap, ); }; diff --git a/packages/engine/Source/Scene/Model/ModelUtility.js b/packages/engine/Source/Scene/Model/ModelUtility.js index 3e24e068b6c6..a117a878b10f 100644 --- a/packages/engine/Source/Scene/Model/ModelUtility.js +++ b/packages/engine/Source/Scene/Model/ModelUtility.js @@ -59,7 +59,7 @@ ModelUtility.getNodeTransform = function (node) { return Matrix4.fromTranslationQuaternionRotationScale( defined(node.translation) ? node.translation : Cartesian3.ZERO, defined(node.rotation) ? node.rotation : Quaternion.IDENTITY, - defined(node.scale) ? node.scale : Cartesian3.ONE + defined(node.scale) ? node.scale : Cartesian3.ONE, ); }; @@ -220,11 +220,11 @@ const cartesianMinScratch = new Cartesian3(); ModelUtility.getPositionMinMax = function ( primitive, instancingTranslationMin, - instancingTranslationMax + instancingTranslationMax, ) { const positionGltfAttribute = ModelUtility.getAttributeBySemantic( primitive, - "POSITION" + "POSITION", ); let positionMax = positionGltfAttribute.max; @@ -234,12 +234,12 @@ ModelUtility.getPositionMinMax = function ( positionMin = Cartesian3.add( positionMin, instancingTranslationMin, - cartesianMinScratch + cartesianMinScratch, ); positionMax = Cartesian3.add( positionMax, instancingTranslationMax, - cartesianMaxScratch + cartesianMaxScratch, ); } diff --git a/packages/engine/Source/Scene/Model/MorphTargetsPipelineStage.js b/packages/engine/Source/Scene/Model/MorphTargetsPipelineStage.js index 01f13db68c0e..2e34fa1776d1 100644 --- a/packages/engine/Source/Scene/Model/MorphTargetsPipelineStage.js +++ b/packages/engine/Source/Scene/Model/MorphTargetsPipelineStage.js @@ -48,7 +48,7 @@ MorphTargetsPipelineStage.process = function (renderResources, primitive) { shaderBuilder.addDefine( "HAS_MORPH_TARGETS", undefined, - ShaderDestination.VERTEX + ShaderDestination.VERTEX, ); addGetMorphedAttributeFunctionDeclarations(shaderBuilder); @@ -75,7 +75,7 @@ MorphTargetsPipelineStage.process = function (renderResources, primitive) { renderResources, attribute, renderResources.attributeIndex, - i + i, ); renderResources.attributeIndex++; } @@ -88,7 +88,7 @@ MorphTargetsPipelineStage.process = function (renderResources, primitive) { shaderBuilder.addUniform( "float", `u_morphWeights[${weightsLength}]`, - ShaderDestination.VERTEX + ShaderDestination.VERTEX, ); shaderBuilder.addVertexLines(MorphTargetsStageVS); @@ -111,32 +111,32 @@ function processMorphTargetAttribute( renderResources, attribute, attributeIndex, - morphTargetIndex + morphTargetIndex, ) { const shaderBuilder = renderResources.shaderBuilder; addMorphTargetAttributeToRenderResources( renderResources, attribute, - attributeIndex + attributeIndex, ); const attributeInfo = getMorphTargetAttributeInfo( attribute, - scratchAttributeInfo + scratchAttributeInfo, ); addMorphTargetAttributeDeclarationAndFunctionLine( shaderBuilder, attributeInfo, - morphTargetIndex + morphTargetIndex, ); } function addMorphTargetAttributeToRenderResources( renderResources, attribute, - attributeIndex + attributeIndex, ) { const vertexAttribute = { index: attributeIndex, @@ -179,7 +179,7 @@ function getMorphTargetAttributeInfo(attribute, result) { function addMorphTargetAttributeDeclarationAndFunctionLine( shaderBuilder, attributeInfo, - morphTargetIndex + morphTargetIndex, ) { const attributeString = attributeInfo.attributeString; const attributeName = `a_target${attributeString}_${morphTargetIndex}`; @@ -192,37 +192,37 @@ function addGetMorphedAttributeFunctionDeclarations(shaderBuilder) { shaderBuilder.addFunction( MorphTargetsPipelineStage.FUNCTION_ID_GET_MORPHED_POSITION, MorphTargetsPipelineStage.FUNCTION_SIGNATURE_GET_MORPHED_POSITION, - ShaderDestination.VERTEX + ShaderDestination.VERTEX, ); const positionLine = "vec3 morphedPosition = position;"; shaderBuilder.addFunctionLines( MorphTargetsPipelineStage.FUNCTION_ID_GET_MORPHED_POSITION, - [positionLine] + [positionLine], ); shaderBuilder.addFunction( MorphTargetsPipelineStage.FUNCTION_ID_GET_MORPHED_NORMAL, MorphTargetsPipelineStage.FUNCTION_SIGNATURE_GET_MORPHED_NORMAL, - ShaderDestination.VERTEX + ShaderDestination.VERTEX, ); const normalLine = "vec3 morphedNormal = normal;"; shaderBuilder.addFunctionLines( MorphTargetsPipelineStage.FUNCTION_ID_GET_MORPHED_NORMAL, - [normalLine] + [normalLine], ); shaderBuilder.addFunction( MorphTargetsPipelineStage.FUNCTION_ID_GET_MORPHED_TANGENT, MorphTargetsPipelineStage.FUNCTION_SIGNATURE_GET_MORPHED_TANGENT, - ShaderDestination.VERTEX + ShaderDestination.VERTEX, ); const tangentLine = "vec3 morphedTangent = tangent;"; shaderBuilder.addFunctionLines( MorphTargetsPipelineStage.FUNCTION_ID_GET_MORPHED_TANGENT, - [tangentLine] + [tangentLine], ); } @@ -230,19 +230,19 @@ function addGetMorphedAttributeFunctionReturns(shaderBuilder) { const positionLine = "return morphedPosition;"; shaderBuilder.addFunctionLines( MorphTargetsPipelineStage.FUNCTION_ID_GET_MORPHED_POSITION, - [positionLine] + [positionLine], ); const normalLine = "return morphedNormal;"; shaderBuilder.addFunctionLines( MorphTargetsPipelineStage.FUNCTION_ID_GET_MORPHED_NORMAL, - [normalLine] + [normalLine], ); const tangentLine = "return morphedTangent;"; shaderBuilder.addFunctionLines( MorphTargetsPipelineStage.FUNCTION_ID_GET_MORPHED_TANGENT, - [tangentLine] + [tangentLine], ); } diff --git a/packages/engine/Source/Scene/Model/NodeRenderResources.js b/packages/engine/Source/Scene/Model/NodeRenderResources.js index aa908ffaee85..8c3d485850b7 100644 --- a/packages/engine/Source/Scene/Model/NodeRenderResources.js +++ b/packages/engine/Source/Scene/Model/NodeRenderResources.js @@ -76,7 +76,7 @@ function NodeRenderResources(modelRenderResources, runtimeNode) { */ this.renderStateOptions = clone( modelRenderResources.renderStateOptions, - true + true, ); /** diff --git a/packages/engine/Source/Scene/Model/NodeStatisticsPipelineStage.js b/packages/engine/Source/Scene/Model/NodeStatisticsPipelineStage.js index 11cef8855abf..acb633bfe64a 100644 --- a/packages/engine/Source/Scene/Model/NodeStatisticsPipelineStage.js +++ b/packages/engine/Source/Scene/Model/NodeStatisticsPipelineStage.js @@ -23,7 +23,7 @@ const NodeStatisticsPipelineStage = { NodeStatisticsPipelineStage.process = function ( renderResources, node, - frameState + frameState, ) { const statistics = renderResources.model.statistics; const instances = node.instances; diff --git a/packages/engine/Source/Scene/Model/PickingPipelineStage.js b/packages/engine/Source/Scene/Model/PickingPipelineStage.js index 166f71e814f8..76563792d191 100644 --- a/packages/engine/Source/Scene/Model/PickingPipelineStage.js +++ b/packages/engine/Source/Scene/Model/PickingPipelineStage.js @@ -33,7 +33,7 @@ const PickingPipelineStage = { PickingPipelineStage.process = function ( renderResources, primitive, - frameState + frameState, ) { const context = frameState.context; const runtimeNode = renderResources.runtimeNode; @@ -57,7 +57,7 @@ PickingPipelineStage.process = function ( shaderBuilder.addUniform( "vec4", "czm_pickColor", - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); const uniformMap = renderResources.uniformMap; @@ -129,14 +129,14 @@ function processPickTexture(renderResources, primitive, instances) { // Extract the Feature Table ID from the instanced Feature ID attributes. featureIdAttribute = ModelUtility.getFeatureIdsByLabel( instances.featureIds, - instanceFeatureIdLabel + instanceFeatureIdLabel, ); featureTableId = featureIdAttribute.propertyTableId; } else { // Extract the Feature Table ID from the primitive Feature ID attributes. featureIdAttribute = ModelUtility.getFeatureIdsByLabel( primitive.featureIds, - featureIdLabel + featureIdLabel, ); featureTableId = featureIdAttribute.propertyTableId; } @@ -147,7 +147,7 @@ function processPickTexture(renderResources, primitive, instances) { shaderBuilder.addUniform( "sampler2D", "model_pickTexture", - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); const batchTexture = featureTable.batchTexture; diff --git a/packages/engine/Source/Scene/Model/PntsLoader.js b/packages/engine/Source/Scene/Model/PntsLoader.js index 2565dd01a420..fafb851851c4 100644 --- a/packages/engine/Source/Scene/Model/PntsLoader.js +++ b/packages/engine/Source/Scene/Model/PntsLoader.js @@ -350,7 +350,7 @@ function transcodeAttributeType(componentsPerAttribute) { //>>includeStart('debug', pragmas.debug); default: throw new DeveloperError( - "componentsPerAttribute must be a number from 1-4" + "componentsPerAttribute must be a number from 1-4", ); //>>includeEnd('debug'); } @@ -404,7 +404,7 @@ function makeAttribute(loader, attributeInfo, context) { quantization.quantizedVolumeStepSize = Cartesian3.divideByScalar( quantizedVolumeDimensions, normalizationRange, - new Cartesian3() + new Cartesian3(), ); quantization.componentDatatype = attributeInfo.quantizedComponentDatatype; quantization.type = attributeInfo.quantizedType; @@ -628,7 +628,7 @@ function makeComponents(loader, context) { const customAttributeOutput = []; components.structuralMetadata = makeStructuralMetadata( parsedContent, - customAttributeOutput + customAttributeOutput, ); if (customAttributeOutput.length > 0) { @@ -636,7 +636,7 @@ function makeComponents(loader, context) { loader, primitive, customAttributeOutput, - context + context, ); } @@ -644,7 +644,7 @@ function makeComponents(loader, context) { components.transform = Matrix4.multiplyByTranslation( components.transform, parsedContent.rtcCenter, - components.transform + components.transform, ); } @@ -655,7 +655,7 @@ function makeComponents(loader, context) { components.transform = Matrix4.multiplyByTranslation( components.transform, positions.quantizedVolumeOffset, - components.transform + components.transform, ); } @@ -670,7 +670,7 @@ function addPropertyAttributesToPrimitive( loader, primitive, customAttributes, - context + context, ) { const attributes = primitive.attributes; diff --git a/packages/engine/Source/Scene/Model/PointCloudStylingPipelineStage.js b/packages/engine/Source/Scene/Model/PointCloudStylingPipelineStage.js index 9abb174126d3..967e07fcfe98 100644 --- a/packages/engine/Source/Scene/Model/PointCloudStylingPipelineStage.js +++ b/packages/engine/Source/Scene/Model/PointCloudStylingPipelineStage.js @@ -58,7 +58,7 @@ const PointCloudStylingPipelineStage = { PointCloudStylingPipelineStage.process = function ( renderResources, primitive, - frameState + frameState, ) { const shaderBuilder = renderResources.shaderBuilder; const model = renderResources.model; @@ -81,12 +81,11 @@ PointCloudStylingPipelineStage.process = function ( const hasBatchTable = !defined(propertyAttributes) && hasFeatureTable; if (defined(style) && !hasBatchTable) { - const variableSubstitutionMap = getVariableSubstitutionMap( - propertyAttributes - ); + const variableSubstitutionMap = + getVariableSubstitutionMap(propertyAttributes); const shaderFunctionInfo = getStyleShaderFunctionInfo( style, - variableSubstitutionMap + variableSubstitutionMap, ); addShaderFunctionsAndDefines(shaderBuilder, shaderFunctionInfo); @@ -95,19 +94,19 @@ PointCloudStylingPipelineStage.process = function ( const usesNormalSemantic = propertyNames.indexOf("normalMC") >= 0; const hasNormals = ModelUtility.getAttributeBySemantic( primitive, - VertexAttributeSemantic.NORMAL + VertexAttributeSemantic.NORMAL, ); if (usesNormalSemantic && !hasNormals) { throw new RuntimeError( - "Style references the NORMAL semantic but the point cloud does not have normals" + "Style references the NORMAL semantic but the point cloud does not have normals", ); } shaderBuilder.addDefine( "COMPUTE_POSITION_WC_STYLE", undefined, - ShaderDestination.VERTEX + ShaderDestination.VERTEX, ); // If the style is translucent, the alpha options must be adjusted. @@ -122,7 +121,7 @@ PointCloudStylingPipelineStage.process = function ( shaderBuilder.addDefine( "HAS_POINT_CLOUD_ATTENUATION", undefined, - ShaderDestination.VERTEX + ShaderDestination.VERTEX, ); } @@ -130,7 +129,7 @@ PointCloudStylingPipelineStage.process = function ( shaderBuilder.addDefine( "HAS_POINT_CLOUD_BACK_FACE_CULLING", undefined, - ShaderDestination.VERTEX + ShaderDestination.VERTEX, ); } @@ -147,7 +146,7 @@ PointCloudStylingPipelineStage.process = function ( shaderBuilder.addUniform( "vec4", "model_pointCloudParameters", - ShaderDestination.VERTEX + ShaderDestination.VERTEX, ); shaderBuilder.addVertexLines(PointCloudStylingStageVS); @@ -165,7 +164,7 @@ PointCloudStylingPipelineStage.process = function ( } vec4.x = defaultValue( pointCloudShading.maximumAttenuation, - defaultPointSize + defaultPointSize, ); vec4.x *= frameState.pixelRatio; @@ -174,7 +173,7 @@ PointCloudStylingPipelineStage.process = function ( renderResources, primitive, pointCloudShading, - content + content, ); vec4.y = geometricError * pointCloudShading.geometricErrorScale; @@ -210,7 +209,7 @@ function getGeometricError( renderResources, primitive, pointCloudShading, - content + content, ) { if (defined(content)) { const geometricError = content.tile.geometricError; @@ -226,7 +225,7 @@ function getGeometricError( const positionAttribute = ModelUtility.getAttributeBySemantic( primitive, - VertexAttributeSemantic.POSITION + VertexAttributeSemantic.POSITION, ); const pointsLength = positionAttribute.count; @@ -235,13 +234,13 @@ function getGeometricError( let dimensions = Cartesian3.subtract( positionAttribute.max, positionAttribute.min, - scratchDimensions + scratchDimensions, ); // dimensions is a vector, as it is a subtraction between two points dimensions = Matrix4.multiplyByPointAsVector( nodeTransform, dimensions, - scratchDimensions + scratchDimensions, ); const volume = dimensions.x * dimensions.y * dimensions.z; const geometricErrorEstimate = CesiumMath.cbrt(volume / pointsLength); @@ -296,17 +295,17 @@ function getStyleShaderFunctionInfo(style, variableSubstitutionMap) { info.colorStyleFunction = style.getColorShaderFunction( `getColorFromStyle(${parameterList})`, variableSubstitutionMap, - shaderState + shaderState, ); info.showStyleFunction = style.getShowShaderFunction( `getShowFromStyle(${parameterList})`, variableSubstitutionMap, - shaderState + shaderState, ); info.pointSizeStyleFunction = style.getPointSizeShaderFunction( `getPointSizeFromStyle(${parameterList})`, variableSubstitutionMap, - shaderState + shaderState, ); info.styleTranslucent = defined(info.colorStyleFunction) && shaderState.translucent; @@ -320,7 +319,7 @@ function addShaderFunctionsAndDefines(shaderBuilder, shaderFunctionInfo) { shaderBuilder.addDefine( "HAS_POINT_CLOUD_COLOR_STYLE", undefined, - ShaderDestination.BOTH + ShaderDestination.BOTH, ); shaderBuilder.addVertexLines(colorStyleFunction); @@ -334,7 +333,7 @@ function addShaderFunctionsAndDefines(shaderBuilder, shaderFunctionInfo) { shaderBuilder.addDefine( "HAS_POINT_CLOUD_SHOW_STYLE", undefined, - ShaderDestination.VERTEX + ShaderDestination.VERTEX, ); shaderBuilder.addVertexLines(showStyleFunction); } @@ -344,7 +343,7 @@ function addShaderFunctionsAndDefines(shaderBuilder, shaderFunctionInfo) { shaderBuilder.addDefine( "HAS_POINT_CLOUD_POINT_SIZE_STYLE", undefined, - ShaderDestination.VERTEX + ShaderDestination.VERTEX, ); shaderBuilder.addVertexLines(pointSizeStyleFunction); } diff --git a/packages/engine/Source/Scene/Model/PrimitiveOutlineGenerator.js b/packages/engine/Source/Scene/Model/PrimitiveOutlineGenerator.js index 2e6e73a2cfe6..d21e59662b7c 100644 --- a/packages/engine/Source/Scene/Model/PrimitiveOutlineGenerator.js +++ b/packages/engine/Source/Scene/Model/PrimitiveOutlineGenerator.js @@ -213,7 +213,7 @@ function initialize(outlineGenerator) { i2, hasEdge01, hasEdge12, - hasEdge20 + hasEdge20, ); while (defined(unmatchableVertexIndex)) { // Copy the unmatchable index and try again. @@ -277,7 +277,7 @@ function initialize(outlineGenerator) { i2, hasEdge01, hasEdge12, - hasEdge20 + hasEdge20, ); } } @@ -285,7 +285,7 @@ function initialize(outlineGenerator) { // Store the triangle indices in case we had to expand to 32-bit indices outlineGenerator._triangleIndices = triangleIndices; outlineGenerator._outlineCoordinatesTypedArray = new Float32Array( - outlineCoordinates + outlineCoordinates, ); } @@ -312,7 +312,7 @@ function matchAndStoreCoordinates( i2, hasEdge01, hasEdge12, - hasEdge20 + hasEdge20, ) { const a0 = hasEdge20 ? 1.0 : 0.0; const b0 = hasEdge01 ? 1.0 : 0.0; @@ -510,7 +510,7 @@ function popcount6Bit(value) { * @private */ PrimitiveOutlineGenerator.prototype.updateAttribute = function ( - attributeTypedArray + attributeTypedArray, ) { const extraVertices = this._extraVertices; @@ -525,7 +525,7 @@ PrimitiveOutlineGenerator.prototype.updateAttribute = function ( // Make a larger typed array of the same type as the input const ArrayType = attributeTypedArray.constructor; const result = new ArrayType( - attributeTypedArray.length + extraVerticesLength * stride + attributeTypedArray.length + extraVerticesLength * stride, ); // Copy original vertices diff --git a/packages/engine/Source/Scene/Model/PrimitiveOutlinePipelineStage.js b/packages/engine/Source/Scene/Model/PrimitiveOutlinePipelineStage.js index 23b9b034896f..f51803984b32 100644 --- a/packages/engine/Source/Scene/Model/PrimitiveOutlinePipelineStage.js +++ b/packages/engine/Source/Scene/Model/PrimitiveOutlinePipelineStage.js @@ -32,7 +32,7 @@ const PrimitiveOutlinePipelineStage = { PrimitiveOutlinePipelineStage.process = function ( renderResources, primitive, - frameState + frameState, ) { const shaderBuilder = renderResources.shaderBuilder; const uniformMap = renderResources.uniformMap; @@ -40,7 +40,7 @@ PrimitiveOutlinePipelineStage.process = function ( shaderBuilder.addDefine( "HAS_PRIMITIVE_OUTLINE", undefined, - ShaderDestination.BOTH + ShaderDestination.BOTH, ); shaderBuilder.addAttribute("vec3", "a_outlineCoordinates"); @@ -51,7 +51,7 @@ PrimitiveOutlinePipelineStage.process = function ( index: renderResources.attributeIndex++, vertexBuffer: outlineCoordinates.buffer, componentsPerAttribute: AttributeType.getNumberOfComponents( - outlineCoordinates.type + outlineCoordinates.type, ), componentDatatype: outlineCoordinates.componentDatatype, offsetInBytes: outlineCoordinates.byteOffset, @@ -63,12 +63,12 @@ PrimitiveOutlinePipelineStage.process = function ( shaderBuilder.addUniform( "sampler2D", "model_outlineTexture", - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); // This automatically handles caching the texture on the context const outlineTexture = PrimitiveOutlineGenerator.createTexture( - frameState.context + frameState.context, ); uniformMap.model_outlineTexture = function () { return outlineTexture; @@ -78,7 +78,7 @@ PrimitiveOutlinePipelineStage.process = function ( shaderBuilder.addUniform( "vec4", "model_outlineColor", - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); uniformMap.model_outlineColor = function () { return model.outlineColor; @@ -86,7 +86,7 @@ PrimitiveOutlinePipelineStage.process = function ( shaderBuilder.addUniform( "bool", "model_showOutline", - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); uniformMap.model_showOutline = function () { return model.showOutline; diff --git a/packages/engine/Source/Scene/Model/PrimitiveRenderResources.js b/packages/engine/Source/Scene/Model/PrimitiveRenderResources.js index ccf947bd3fd0..6d2036079814 100644 --- a/packages/engine/Source/Scene/Model/PrimitiveRenderResources.js +++ b/packages/engine/Source/Scene/Model/PrimitiveRenderResources.js @@ -235,7 +235,7 @@ function PrimitiveRenderResources(nodeRenderResources, runtimePrimitive) { const positionMinMax = ModelUtility.getPositionMinMax( primitive, this.runtimeNode.instancingTranslationMin, - this.runtimeNode.instancingTranslationMax + this.runtimeNode.instancingTranslationMax, ); /** @@ -269,7 +269,7 @@ function PrimitiveRenderResources(nodeRenderResources, runtimePrimitive) { this.boundingSphere = BoundingSphere.fromCornerPoints( this.positionMin, this.positionMax, - new BoundingSphere() + new BoundingSphere(), ); /** diff --git a/packages/engine/Source/Scene/Model/PrimitiveStatisticsPipelineStage.js b/packages/engine/Source/Scene/Model/PrimitiveStatisticsPipelineStage.js index 2b872c6fb61e..d01e85df5efd 100644 --- a/packages/engine/Source/Scene/Model/PrimitiveStatisticsPipelineStage.js +++ b/packages/engine/Source/Scene/Model/PrimitiveStatisticsPipelineStage.js @@ -30,7 +30,7 @@ const PrimitiveStatisticsPipelineStage = { PrimitiveStatisticsPipelineStage.process = function ( renderResources, primitive, - frameState + frameState, ) { const model = renderResources.model; const statistics = model.statistics; diff --git a/packages/engine/Source/Scene/Model/SceneMode2DPipelineStage.js b/packages/engine/Source/Scene/Model/SceneMode2DPipelineStage.js index 8f4856c0c719..d870ca0518d4 100644 --- a/packages/engine/Source/Scene/Model/SceneMode2DPipelineStage.js +++ b/packages/engine/Source/Scene/Model/SceneMode2DPipelineStage.js @@ -52,11 +52,11 @@ const SceneMode2DPipelineStage = { SceneMode2DPipelineStage.process = function ( renderResources, primitive, - frameState + frameState, ) { const positionAttribute = ModelUtility.getAttributeBySemantic( primitive, - VertexAttributeSemantic.POSITION + VertexAttributeSemantic.POSITION, ); const shaderBuilder = renderResources.shaderBuilder; @@ -66,13 +66,13 @@ SceneMode2DPipelineStage.process = function ( const computedModelMatrix = Matrix4.multiplyTransformation( modelMatrix, nodeComputedTransform, - scratchModelMatrix + scratchModelMatrix, ); const boundingSphere2D = computeBoundingSphere2D( renderResources, computedModelMatrix, - frameState + frameState, ); const runtimePrimitive = renderResources.runtimePrimitive; @@ -92,7 +92,7 @@ SceneMode2DPipelineStage.process = function ( positionAttribute, computedModelMatrix, boundingSphere2D, - frameState + frameState, ); // Since this buffer will persist even if the pipeline is re-run, @@ -110,14 +110,14 @@ SceneMode2DPipelineStage.process = function ( shaderBuilder.addDefine( "USE_2D_POSITIONS", undefined, - ShaderDestination.VERTEX + ShaderDestination.VERTEX, ); shaderBuilder.addUniform("mat4", "u_modelView2D", ShaderDestination.VERTEX); const modelMatrix2D = Matrix4.fromTranslation( boundingSphere2D.center, - new Matrix4() + new Matrix4(), ); const context = frameState.context; @@ -126,7 +126,7 @@ SceneMode2DPipelineStage.process = function ( return Matrix4.multiplyTransformation( context.uniformState.view, modelMatrix2D, - scratchModelView2D + scratchModelView2D, ); }, }; @@ -142,31 +142,31 @@ function computeBoundingSphere2D(renderResources, modelMatrix, frameState) { const transformedPositionMin = Matrix4.multiplyByPoint( modelMatrix, renderResources.positionMin, - scratchProjectedMin + scratchProjectedMin, ); const projectedMin = SceneTransforms.computeActualEllipsoidPosition( frameState, transformedPositionMin, - transformedPositionMin + transformedPositionMin, ); const transformedPositionMax = Matrix4.multiplyByPoint( modelMatrix, renderResources.positionMax, - scratchProjectedMax + scratchProjectedMax, ); const projectedMax = SceneTransforms.computeActualEllipsoidPosition( frameState, transformedPositionMax, - transformedPositionMax + transformedPositionMax, ); return BoundingSphere.fromCornerPoints( projectedMin, projectedMax, - new BoundingSphere() + new BoundingSphere(), ); } @@ -184,17 +184,17 @@ function dequantizePositionsTypedArray(typedArray, quantization) { const initialPosition = Cartesian3.fromArray( typedArray, i, - scratchPosition + scratchPosition, ); const scaledPosition = Cartesian3.multiplyComponents( initialPosition, quantizedVolumeStepSize, - initialPosition + initialPosition, ); const dequantizedPosition = Cartesian3.add( scaledPosition, quantizedVolumeOffset, - scaledPosition + scaledPosition, ); dequantizedArray[i] = dequantizedPosition.x; @@ -209,14 +209,14 @@ function createPositionsTypedArrayFor2D( attribute, modelMatrix, referencePoint, - frameState + frameState, ) { let result; if (defined(attribute.quantization)) { // Dequantize the positions if necessary. result = dequantizePositionsTypedArray( attribute.typedArray, - attribute.quantization + attribute.quantization, ); } else { result = attribute.typedArray.slice(); @@ -241,19 +241,19 @@ function createPositionsTypedArrayFor2D( const transformedPosition = Matrix4.multiplyByPoint( modelMatrix, initialPosition, - initialPosition + initialPosition, ); const projectedPosition = SceneTransforms.computeActualEllipsoidPosition( frameState, transformedPosition, - transformedPosition + transformedPosition, ); const relativePosition = Cartesian3.subtract( projectedPosition, referencePoint, - projectedPosition + projectedPosition, ); result[i] = relativePosition.x; @@ -268,7 +268,7 @@ function createPositionBufferFor2D( positionAttribute, modelMatrix, boundingSphere2D, - frameState + frameState, ) { // Force the scene mode to be CV. In 2D, projected positions will have // an x-coordinate of 0, which eliminates the height data that is @@ -284,7 +284,7 @@ function createPositionBufferFor2D( positionAttribute, modelMatrix, referencePoint, - frameStateCV + frameStateCV, ); // Put the resulting data in a GPU buffer. diff --git a/packages/engine/Source/Scene/Model/SelectedFeatureIdPipelineStage.js b/packages/engine/Source/Scene/Model/SelectedFeatureIdPipelineStage.js index e55a1e9ae1df..8c6144cd7c63 100644 --- a/packages/engine/Source/Scene/Model/SelectedFeatureIdPipelineStage.js +++ b/packages/engine/Source/Scene/Model/SelectedFeatureIdPipelineStage.js @@ -37,7 +37,7 @@ const SelectedFeatureIdPipelineStage = { SelectedFeatureIdPipelineStage.process = function ( renderResources, primitive, - frameState + frameState, ) { const shaderBuilder = renderResources.shaderBuilder; @@ -51,7 +51,7 @@ SelectedFeatureIdPipelineStage.process = function ( shaderBuilder.addDefine( "HAS_SELECTED_FEATURE_ID", undefined, - shaderDestination + shaderDestination, ); // Add a define to insert the variable to use. @@ -60,7 +60,7 @@ SelectedFeatureIdPipelineStage.process = function ( shaderBuilder.addDefine( "SELECTED_FEATURE_ID", selectedFeatureIds.variableName, - shaderDestination + shaderDestination, ); // Add a define to the shader to distinguish feature ID attributes from @@ -69,7 +69,7 @@ SelectedFeatureIdPipelineStage.process = function ( shaderBuilder.addDefine( selectedFeatureIds.featureIdDefine, undefined, - shaderDestination + shaderDestination, ); updateFeatureStruct(shaderBuilder); @@ -80,7 +80,7 @@ SelectedFeatureIdPipelineStage.process = function ( shaderBuilder.addDefine( "HAS_NULL_FEATURE_ID", undefined, - shaderDestination + shaderDestination, ); shaderBuilder.addUniform("int", "model_nullFeatureId", shaderDestination); uniformMap.model_nullFeatureId = function () { @@ -119,7 +119,7 @@ function getSelectedFeatureIds(model, node, primitive) { if (defined(node.instances)) { featureIds = ModelUtility.getFeatureIdsByLabel( node.instances.featureIds, - model.instanceFeatureIdLabel + model.instanceFeatureIdLabel, ); if (defined(featureIds)) { @@ -137,7 +137,7 @@ function getSelectedFeatureIds(model, node, primitive) { featureIds = ModelUtility.getFeatureIdsByLabel( primitive.featureIds, - model.featureIdLabel + model.featureIdLabel, ); // again, prefer label for being more descriptive variableName = defaultValue(featureIds.label, featureIds.positionalLabel); @@ -166,19 +166,19 @@ function updateFeatureStruct(shaderBuilder) { shaderBuilder.addStructField( SelectedFeatureIdPipelineStage.STRUCT_ID_SELECTED_FEATURE, "int", - "id" + "id", ); shaderBuilder.addStructField( SelectedFeatureIdPipelineStage.STRUCT_ID_SELECTED_FEATURE, "vec2", - "st" + "st", ); shaderBuilder.addStructField( SelectedFeatureIdPipelineStage.STRUCT_ID_SELECTED_FEATURE, "vec4", - "color" + "color", ); } diff --git a/packages/engine/Source/Scene/Model/SkinningPipelineStage.js b/packages/engine/Source/Scene/Model/SkinningPipelineStage.js index 0f7fc1b84fdc..4475a35c3e07 100644 --- a/packages/engine/Source/Scene/Model/SkinningPipelineStage.js +++ b/packages/engine/Source/Scene/Model/SkinningPipelineStage.js @@ -45,7 +45,7 @@ SkinningPipelineStage.process = function (renderResources, primitive) { shaderBuilder.addUniform( "mat4", `u_jointMatrices[${jointMatrices.length}]`, - ShaderDestination.VERTEX + ShaderDestination.VERTEX, ); shaderBuilder.addVertexLines(SkinningStageVS); @@ -83,13 +83,13 @@ function addGetSkinningMatrixFunction(shaderBuilder, primitive) { shaderBuilder.addFunction( SkinningPipelineStage.FUNCTION_ID_GET_SKINNING_MATRIX, SkinningPipelineStage.FUNCTION_SIGNATURE_GET_SKINNING_MATRIX, - ShaderDestination.VERTEX + ShaderDestination.VERTEX, ); const initialLine = "mat4 skinnedMatrix = mat4(0);"; shaderBuilder.addFunctionLines( SkinningPipelineStage.FUNCTION_ID_GET_SKINNING_MATRIX, - [initialLine] + [initialLine], ); let setIndex; @@ -103,7 +103,7 @@ function addGetSkinningMatrixFunction(shaderBuilder, primitive) { const line = `skinnedMatrix += a_weights_${setIndex}.${component} * u_jointMatrices[int(a_joints_${setIndex}.${component})];`; shaderBuilder.addFunctionLines( SkinningPipelineStage.FUNCTION_ID_GET_SKINNING_MATRIX, - [line] + [line], ); } } @@ -111,7 +111,7 @@ function addGetSkinningMatrixFunction(shaderBuilder, primitive) { const returnLine = "return skinnedMatrix;"; shaderBuilder.addFunctionLines( SkinningPipelineStage.FUNCTION_ID_GET_SKINNING_MATRIX, - [returnLine] + [returnLine], ); } diff --git a/packages/engine/Source/Scene/Model/StyleCommandsNeeded.js b/packages/engine/Source/Scene/Model/StyleCommandsNeeded.js index a673bbf3b1bc..c5e1188d1fd7 100644 --- a/packages/engine/Source/Scene/Model/StyleCommandsNeeded.js +++ b/packages/engine/Source/Scene/Model/StyleCommandsNeeded.js @@ -16,7 +16,7 @@ const StyleCommandsNeeded = { */ StyleCommandsNeeded.getStyleCommandsNeeded = function ( featuresLength, - translucentFeaturesLength + translucentFeaturesLength, ) { if (translucentFeaturesLength === 0) { return StyleCommandsNeeded.ALL_OPAQUE; diff --git a/packages/engine/Source/Scene/Model/TextureManager.js b/packages/engine/Source/Scene/Model/TextureManager.js index fb13fda62919..683ebaee443d 100644 --- a/packages/engine/Source/Scene/Model/TextureManager.js +++ b/packages/engine/Source/Scene/Model/TextureManager.js @@ -138,11 +138,11 @@ function getWebGL1Texture(textureUniform, image, context) { // typedArray is non-power-of-two but can't be resized. Warn and return raw texture (no mipmaps) if (needMipmap) { console.warn( - "Texture requires resizing for mipmaps but pixelDataType cannot be resized. The texture may be rendered incorrectly." + "Texture requires resizing for mipmaps but pixelDataType cannot be resized. The texture may be rendered incorrectly.", ); } else if (samplerRepeats) { console.warn( - "Texture requires resizing for wrapping but pixelDataType cannot be resized. The texture may be rendered incorrectly." + "Texture requires resizing for wrapping but pixelDataType cannot be resized. The texture may be rendered incorrectly.", ); } return getTextureFromTypedArray(textureUniform, context); diff --git a/packages/engine/Source/Scene/Model/TextureUniform.js b/packages/engine/Source/Scene/Model/TextureUniform.js index ef0b4b809806..a8b6db4b2483 100644 --- a/packages/engine/Source/Scene/Model/TextureUniform.js +++ b/packages/engine/Source/Scene/Model/TextureUniform.js @@ -35,12 +35,12 @@ function TextureUniform(options) { const hasUrl = defined(options.url); if (hasTypedArray === hasUrl) { throw new DeveloperError( - "exactly one of options.typedArray, options.url must be defined" + "exactly one of options.typedArray, options.url must be defined", ); } if (hasTypedArray && (!defined(options.width) || !defined(options.height))) { throw new DeveloperError( - "options.width and options.height are required when options.typedArray is defined" + "options.width and options.height are required when options.typedArray is defined", ); } //>>includeEnd('debug'); @@ -51,7 +51,7 @@ function TextureUniform(options) { this.pixelFormat = defaultValue(options.pixelFormat, PixelFormat.RGBA); this.pixelDatatype = defaultValue( options.pixelDatatype, - PixelDatatype.UNSIGNED_BYTE + PixelDatatype.UNSIGNED_BYTE, ); let resource = options.url; diff --git a/packages/engine/Source/Scene/Model/TilesetPipelineStage.js b/packages/engine/Source/Scene/Model/TilesetPipelineStage.js index 7a3257ff6869..33dd3718b2de 100644 --- a/packages/engine/Source/Scene/Model/TilesetPipelineStage.js +++ b/packages/engine/Source/Scene/Model/TilesetPipelineStage.js @@ -43,7 +43,7 @@ TilesetPipelineStage.process = function (renderResources, model, frameState) { shaderBuilder.addDefine( "POLYGON_OFFSET", undefined, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); // This value will be overriden by the depth-only back face derived command. @@ -58,7 +58,7 @@ TilesetPipelineStage.process = function (renderResources, model, frameState) { renderResources.uniformMap = combine( uniformMap, - renderResources.uniformMap + renderResources.uniformMap, ); renderResources.hasSkipLevelOfDetail = true; } diff --git a/packages/engine/Source/Scene/Model/VerticalExaggerationPipelineStage.js b/packages/engine/Source/Scene/Model/VerticalExaggerationPipelineStage.js index 19f26b1001d3..9dd8aa83a3fa 100644 --- a/packages/engine/Source/Scene/Model/VerticalExaggerationPipelineStage.js +++ b/packages/engine/Source/Scene/Model/VerticalExaggerationPipelineStage.js @@ -28,7 +28,7 @@ const scratchExaggerationUniform = new Cartesian2(); VerticalExaggerationPipelineStage.process = function ( renderResources, primitive, - frameState + frameState, ) { const { shaderBuilder, uniformMap } = renderResources; @@ -37,20 +37,20 @@ VerticalExaggerationPipelineStage.process = function ( shaderBuilder.addDefine( "HAS_VERTICAL_EXAGGERATION", undefined, - ShaderDestination.VERTEX + ShaderDestination.VERTEX, ); shaderBuilder.addUniform( "vec2", "u_verticalExaggerationAndRelativeHeight", - ShaderDestination.VERTEX + ShaderDestination.VERTEX, ); uniformMap.u_verticalExaggerationAndRelativeHeight = function () { return Cartesian2.fromElements( frameState.verticalExaggeration, frameState.verticalExaggerationRelativeHeight, - scratchExaggerationUniform + scratchExaggerationUniform, ); }; }; diff --git a/packages/engine/Source/Scene/Model/WireframePipelineStage.js b/packages/engine/Source/Scene/Model/WireframePipelineStage.js index 7aed34818ea6..0461597b12fe 100644 --- a/packages/engine/Source/Scene/Model/WireframePipelineStage.js +++ b/packages/engine/Source/Scene/Model/WireframePipelineStage.js @@ -34,7 +34,7 @@ const WireframePipelineStage = { WireframePipelineStage.process = function ( renderResources, primitive, - frameState + frameState, ) { // Applying normal mapping to the lines will result in rendering // errors on Linux. This define is added to disable normal @@ -43,14 +43,14 @@ WireframePipelineStage.process = function ( shaderBuilder.addDefine( "HAS_WIREFRAME", undefined, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); const model = renderResources.model; const wireframeIndexBuffer = createWireframeIndexBuffer( primitive, renderResources.indices, - frameState + frameState, ); model._pipelineResources.push(wireframeIndexBuffer); renderResources.wireframeIndexBuffer = wireframeIndexBuffer; @@ -69,14 +69,14 @@ WireframePipelineStage.process = function ( renderResources.primitiveType = PrimitiveType.LINES; renderResources.count = WireframeIndexGenerator.getWireframeIndicesCount( originalPrimitiveType, - originalCount + originalCount, ); }; function createWireframeIndexBuffer(primitive, indices, frameState) { const positionAttribute = ModelUtility.getAttributeBySemantic( primitive, - VertexAttributeSemantic.POSITION + VertexAttributeSemantic.POSITION, ); const vertexCount = positionAttribute.count; const webgl2 = frameState.context.webgl2; @@ -101,10 +101,10 @@ function createWireframeIndexBuffer(primitive, indices, frameState) { const wireframeIndices = WireframeIndexGenerator.createWireframeIndices( primitiveType, vertexCount, - originalIndices + originalIndices, ); const indexDatatype = IndexDatatype.fromSizeInBytes( - wireframeIndices.BYTES_PER_ELEMENT + wireframeIndices.BYTES_PER_ELEMENT, ); return Buffer.createIndexBuffer({ diff --git a/packages/engine/Source/Scene/Model/buildDrawCommand.js b/packages/engine/Source/Scene/Model/buildDrawCommand.js index f23b712f06d4..b0acbf980623 100644 --- a/packages/engine/Source/Scene/Model/buildDrawCommand.js +++ b/packages/engine/Source/Scene/Model/buildDrawCommand.js @@ -55,7 +55,7 @@ function buildDrawCommand(primitiveRenderResources, frameState) { modelMatrix = Matrix4.multiplyTransformation( sceneGraph._computedModelMatrix, primitiveRenderResources.runtimeNode.computedTransform, - new Matrix4() + new Matrix4(), ); const runtimePrimitive = primitiveRenderResources.runtimePrimitive; @@ -68,25 +68,25 @@ function buildDrawCommand(primitiveRenderResources, frameState) { modelMatrix = Matrix4.multiplyTransformation( computedModelMatrix, primitiveRenderResources.runtimeNode.computedTransform, - new Matrix4() + new Matrix4(), ); boundingSphere = BoundingSphere.transform( primitiveRenderResources.boundingSphere, modelMatrix, - primitiveRenderResources.boundingSphere + primitiveRenderResources.boundingSphere, ); } // Initialize render state with default values let renderState = clone( RenderState.fromCache(primitiveRenderResources.renderStateOptions), - true + true, ); renderState.cull.face = ModelUtility.getCullFace( modelMatrix, - primitiveRenderResources.primitiveType + primitiveRenderResources.primitiveType, ); renderState = RenderState.fromCache(renderState); diff --git a/packages/engine/Source/Scene/Model/pickModel.js b/packages/engine/Source/Scene/Model/pickModel.js index 9dc7cc768be4..244ea0e3b45f 100644 --- a/packages/engine/Source/Scene/Model/pickModel.js +++ b/packages/engine/Source/Scene/Model/pickModel.js @@ -48,7 +48,7 @@ export default function pickModel( verticalExaggeration, relativeHeight, ellipsoid, - result + result, ) { //>>includeStart('debug', pragmas.debug); Check.typeOf.object("model", model); @@ -70,11 +70,11 @@ export default function pickModel( let nodeComputedTransform = Matrix4.clone( runtimeNode.computedTransform, - scratchNodeComputedTransform + scratchNodeComputedTransform, ); let modelMatrix = Matrix4.clone( sceneGraph.computedModelMatrix, - scratchModelMatrix + scratchModelMatrix, ); const instances = node.instances; @@ -84,13 +84,13 @@ export default function pickModel( modelMatrix = Matrix4.multiplyTransformation( model.modelMatrix, sceneGraph.components.transform, - modelMatrix + modelMatrix, ); nodeComputedTransform = Matrix4.multiplyTransformation( sceneGraph.axisCorrectionMatrix, runtimeNode.computedTransform, - nodeComputedTransform + nodeComputedTransform, ); } } @@ -98,14 +98,14 @@ export default function pickModel( let computedModelMatrix = Matrix4.multiplyTransformation( modelMatrix, nodeComputedTransform, - scratchcomputedModelMatrix + scratchcomputedModelMatrix, ); if (frameState.mode !== SceneMode.SCENE3D) { computedModelMatrix = Transforms.basisTo2D( frameState.mapProjection, computedModelMatrix, - computedModelMatrix + computedModelMatrix, ); } @@ -122,7 +122,7 @@ export default function pickModel( if (defined(instanceTransformsBuffer) && frameState.context.webgl2) { transformsTypedArray = ComponentDatatype.createTypedArray( instanceComponentDatatype, - transformsCount * transformElements + transformsCount * transformElements, ); instanceTransformsBuffer.getBufferData(transformsTypedArray); } @@ -148,21 +148,21 @@ export default function pickModel( 0, 0, 0, - 1 + 1, ); if (instances.transformInWorldSpace) { Matrix4.multiplyTransformation( transform, nodeComputedTransform, - transform + transform, ); Matrix4.multiplyTransformation(modelMatrix, transform, transform); } else { Matrix4.multiplyTransformation( transform, computedModelMatrix, - transform + transform, ); } transforms.push(transform); @@ -183,11 +183,11 @@ export default function pickModel( const boundingSphere = BoundingSphere.transform( runtimePrimitive.boundingSphere, computedModelMatrix, - scratchBoundingSphere + scratchBoundingSphere, ); const boundsIntersection = IntersectionTests.raySphere( ray, - boundingSphere + boundingSphere, ); if (!defined(boundsIntersection)) { continue; @@ -196,7 +196,7 @@ export default function pickModel( const positionAttribute = ModelUtility.getAttributeBySemantic( primitive, - VertexAttributeSemantic.POSITION + VertexAttributeSemantic.POSITION, ); const byteOffset = positionAttribute.byteOffset; const byteStride = positionAttribute.byteStride; @@ -256,13 +256,13 @@ export default function pickModel( if (defined(verticesBuffer) && frameState.context.webgl2) { vertices = ComponentDatatype.createTypedArray( componentDatatype, - elementCount + elementCount, ); verticesBuffer.getBufferData( vertices, isInterleaved ? 0 : byteOffset, 0, - elementCount + elementCount, ); } @@ -271,7 +271,7 @@ export default function pickModel( vertices, componentDatatype, attributeType, - vertexCount + vertexCount, ); } } @@ -301,7 +301,7 @@ export default function pickModel( verticalExaggeration, relativeHeight, ellipsoid, - scratchV0 + scratchV0, ); const v1 = getVertexPosition( vertices, @@ -313,7 +313,7 @@ export default function pickModel( verticalExaggeration, relativeHeight, ellipsoid, - scratchV1 + scratchV1, ); const v2 = getVertexPosition( vertices, @@ -325,7 +325,7 @@ export default function pickModel( verticalExaggeration, relativeHeight, ellipsoid, - scratchV2 + scratchV2, ); const t = IntersectionTests.rayTriangleParametric( @@ -333,7 +333,7 @@ export default function pickModel( v0, v1, v2, - defaultValue(model.backFaceCulling, true) + defaultValue(model.backFaceCulling, true), ); if (defined(t)) { @@ -374,7 +374,7 @@ function getVertexPosition( verticalExaggeration, relativeHeight, ellipsoid, - result + result, ) { const i = offset + index * numElements; result.x = vertices[i]; @@ -386,7 +386,7 @@ function getVertexPosition( result = AttributeCompression.octDecodeInRange( result, quantization.normalizationRange, - result + result, ); if (quantization.octEncodedZXY) { @@ -399,13 +399,13 @@ function getVertexPosition( result = Cartesian3.multiplyComponents( result, quantization.quantizedVolumeStepSize, - result + result, ); result = Cartesian3.add( result, quantization.quantizedVolumeOffset, - result + result, ); } } @@ -418,7 +418,7 @@ function getVertexPosition( ellipsoid, verticalExaggeration, relativeHeight, - result + result, ); } diff --git a/packages/engine/Source/Scene/ModelComponents.js b/packages/engine/Source/Scene/ModelComponents.js index 42b3834c6db7..d194296a4f06 100644 --- a/packages/engine/Source/Scene/ModelComponents.js +++ b/packages/engine/Source/Scene/ModelComponents.js @@ -1237,7 +1237,7 @@ function MetallicRoughness() { * @private */ this.baseColorFactor = Cartesian4.clone( - MetallicRoughness.DEFAULT_BASE_COLOR_FACTOR + MetallicRoughness.DEFAULT_BASE_COLOR_FACTOR, ); /** @@ -1307,7 +1307,7 @@ function SpecularGlossiness() { * @private */ this.diffuseFactor = Cartesian4.clone( - SpecularGlossiness.DEFAULT_DIFFUSE_FACTOR + SpecularGlossiness.DEFAULT_DIFFUSE_FACTOR, ); /** @@ -1318,7 +1318,7 @@ function SpecularGlossiness() { * @private */ this.specularFactor = Cartesian3.clone( - SpecularGlossiness.DEFAULT_SPECULAR_FACTOR + SpecularGlossiness.DEFAULT_SPECULAR_FACTOR, ); /** @@ -1372,7 +1372,7 @@ function Specular() { * @private */ this.specularColorFactor = Cartesian3.clone( - Specular.DEFAULT_SPECULAR_COLOR_FACTOR + Specular.DEFAULT_SPECULAR_COLOR_FACTOR, ); /** diff --git a/packages/engine/Source/Scene/Moon.js b/packages/engine/Source/Scene/Moon.js index aef70fb880b3..879eed33117a 100644 --- a/packages/engine/Source/Scene/Moon.js +++ b/packages/engine/Source/Scene/Moon.js @@ -116,16 +116,17 @@ Moon.prototype.update = function (frameState) { Matrix3.transpose(rotation, rotation); Matrix3.multiply(icrfToFixed, rotation, rotation); - const translation = Simon1994PlanetaryPositions.computeMoonPositionInEarthInertialFrame( - date, - translationScratch - ); + const translation = + Simon1994PlanetaryPositions.computeMoonPositionInEarthInertialFrame( + date, + translationScratch, + ); Matrix3.multiplyByVector(icrfToFixed, translation, translation); Matrix4.fromRotationTranslation( rotation, translation, - ellipsoidPrimitive.modelMatrix + ellipsoidPrimitive.modelMatrix, ); const savedCommandList = frameState.commandList; diff --git a/packages/engine/Source/Scene/Multiple3DTileContent.js b/packages/engine/Source/Scene/Multiple3DTileContent.js index 42ede698a349..ddf096d8979f 100644 --- a/packages/engine/Source/Scene/Multiple3DTileContent.js +++ b/packages/engine/Source/Scene/Multiple3DTileContent.js @@ -66,7 +66,7 @@ function Multiple3DTileContent(tileset, tile, tilesetResource, contentsJson) { }); const serverKey = RequestScheduler.getServerKey( - contentResource.getUrlComponent() + contentResource.getUrlComponent(), ); this._innerContentResources[i] = contentResource; @@ -301,7 +301,7 @@ Object.defineProperties(Multiple3DTileContent.prototype, { set: function () { //>>includeStart('debug', pragmas.debug); throw new DeveloperError( - "Multiple3DTileContent cannot have group metadata" + "Multiple3DTileContent cannot have group metadata", ); //>>includeEnd('debug'); }, @@ -328,7 +328,8 @@ Object.defineProperties(Multiple3DTileContent.prototype, { function updatePendingRequests(multipleContents, deltaRequestCount) { multipleContents._requestsInFlight += deltaRequestCount; - multipleContents.tileset.statistics.numberOfPendingRequests += deltaRequestCount; + multipleContents.tileset.statistics.numberOfPendingRequests += + deltaRequestCount; } function cancelPendingRequests(multipleContents, originalContentState) { @@ -366,7 +367,8 @@ Multiple3DTileContent.prototype.requestInnerContents = function () { // if we can schedule all the requests at once. If not, no requests are // scheduled if (!canScheduleAllRequests(this._serverKeys)) { - this.tileset.statistics.numberOfAttemptedRequests += this._serverKeys.length; + this.tileset.statistics.numberOfAttemptedRequests += + this._serverKeys.length; return; } @@ -381,7 +383,7 @@ Multiple3DTileContent.prototype.requestInnerContents = function () { this, i, originalCancelCount, - this._tile._contentState + this._tile._contentState, ); } @@ -420,13 +422,12 @@ function requestInnerContent( multipleContents, index, originalCancelCount, - originalContentState + originalContentState, ) { // it is important to clone here. The fetchArrayBuffer() below here uses // throttling, but other uses of the resources do not. - const contentResource = multipleContents._innerContentResources[ - index - ].clone(); + const contentResource = + multipleContents._innerContentResources[index].clone(); const tile = multipleContents.tile; // Always create a new request. If the tile gets canceled, this @@ -496,7 +497,7 @@ async function createInnerContents(multipleContents) { } const promises = arrayBuffers.map((arrayBuffer, i) => - createInnerContent(multipleContents, arrayBuffer, i) + createInnerContent(multipleContents, arrayBuffer, i), ); // Even if we had a partial success (in which case the inner promise will be handled, but the content will not be returned), mark that we finished creating @@ -519,7 +520,7 @@ async function createInnerContent(multipleContents, arrayBuffer, index) { if (preprocessed.contentType === Cesium3DTileContentType.EXTERNAL_TILESET) { throw new RuntimeError( - "External tilesets are disallowed inside multiple contents" + "External tilesets are disallowed inside multiple contents", ); } @@ -541,13 +542,13 @@ async function createInnerContent(multipleContents, arrayBuffer, index) { tile, resource, preprocessed.binaryPayload.buffer, - 0 - ) + 0, + ), ); } else { // JSON formats content = await Promise.resolve( - contentFactory(tileset, tile, resource, preprocessed.jsonPayload) + contentFactory(tileset, tile, resource, preprocessed.jsonPayload), ); } diff --git a/packages/engine/Source/Scene/OIT.js b/packages/engine/Source/Scene/OIT.js index 4f479831b49e..e1e7fdda7827 100644 --- a/packages/engine/Source/Scene/OIT.js +++ b/packages/engine/Source/Scene/OIT.js @@ -244,7 +244,7 @@ OIT.prototype.update = function ( passState, framebuffer, useHDR, - numSamples + numSamples, ) { if (!this.isSupported()) { return; @@ -371,7 +371,7 @@ OIT.prototype.update = function ( const useScissorTest = !BoundingRectangle.equals( this._viewport, - passState.viewport + passState.viewport, ); let updateScissor = useScissorTest !== this._useScissorTest; this._useScissorTest = useScissorTest; @@ -379,7 +379,7 @@ OIT.prototype.update = function ( if (!BoundingRectangle.equals(this._scissorRectangle, passState.viewport)) { this._scissorRectangle = BoundingRectangle.clone( passState.viewport, - this._scissorRectangle + this._scissorRectangle, ); updateScissor = true; } @@ -448,7 +448,7 @@ function getTranslucentRenderState( context, translucentBlending, cache, - renderState + renderState, ) { let translucentState = cache[renderState.id]; if (!defined(translucentState)) { @@ -468,7 +468,7 @@ function getTranslucentMRTRenderState(oit, context, renderState) { context, translucentMRTBlend, oit._translucentRenderStateCache, - renderState + renderState, ); } @@ -477,7 +477,7 @@ function getTranslucentColorRenderState(oit, context, renderState) { context, translucentColorBlend, oit._translucentRenderStateCache, - renderState + renderState, ); } @@ -486,7 +486,7 @@ function getTranslucentAlphaRenderState(oit, context, renderState) { context, translucentAlphaBlend, oit._alphaRenderStateCache, - renderState + renderState, ); } @@ -529,7 +529,7 @@ function getTranslucentShaderProgram(context, shaderProgram, keyword, source) { .replace(/out_FragColor/g, "czm_out_FragColor") .replace( /layout\s*\(location\s*=\s*0\)\s*out\s+vec4\s+out_FragColor;/g, - "" + "", ) .replace(/\bdiscard\b/g, "czm_discard = true") .replace(/czm_phong/g, "czm_translucentPhong"); @@ -540,7 +540,7 @@ function getTranslucentShaderProgram(context, shaderProgram, keyword, source) { fs.sources.splice( 0, 0, - `vec4 czm_out_FragColor;\n` + `bool czm_discard = false;\n` + `vec4 czm_out_FragColor;\n` + `bool czm_discard = false;\n`, ); const fragDataMatches = [...source.matchAll(/out_FragData_(\d+)/g)]; @@ -560,7 +560,7 @@ function getTranslucentShaderProgram(context, shaderProgram, keyword, source) { " {\n" + " discard;\n" + " }\n" - }${source}}\n` + }${source}}\n`, ); return shaderCache.createDerivedShaderProgram(shaderProgram, keyword, { @@ -575,7 +575,7 @@ function getTranslucentMRTShaderProgram(context, shaderProgram) { context, shaderProgram, "translucentMRT", - mrtShaderSource + mrtShaderSource, ); } @@ -584,7 +584,7 @@ function getTranslucentColorShaderProgram(context, shaderProgram) { context, shaderProgram, "translucentMultipass", - colorShaderSource + colorShaderSource, ); } @@ -593,7 +593,7 @@ function getTranslucentAlphaShaderProgram(context, shaderProgram) { context, shaderProgram, "alphaMultipass", - alphaShaderSource + alphaShaderSource, ); } @@ -619,7 +619,7 @@ OIT.prototype.createDerivedCommands = function (command, context, result) { result.translucentCommand = DrawCommand.shallowClone( command, - result.translucentCommand + result.translucentCommand, ); if ( @@ -628,12 +628,12 @@ OIT.prototype.createDerivedCommands = function (command, context, result) { ) { result.translucentCommand.shaderProgram = getTranslucentMRTShaderProgram( context, - command.shaderProgram + command.shaderProgram, ); result.translucentCommand.renderState = getTranslucentMRTRenderState( this, context, - command.renderState + command.renderState, ); result.shaderProgramId = command.shaderProgram.id; } else { @@ -656,7 +656,7 @@ OIT.prototype.createDerivedCommands = function (command, context, result) { result.translucentCommand = DrawCommand.shallowClone( command, - result.translucentCommand + result.translucentCommand, ); result.alphaCommand = DrawCommand.shallowClone(command, result.alphaCommand); @@ -666,21 +666,21 @@ OIT.prototype.createDerivedCommands = function (command, context, result) { ) { result.translucentCommand.shaderProgram = getTranslucentColorShaderProgram( context, - command.shaderProgram + command.shaderProgram, ); result.translucentCommand.renderState = getTranslucentColorRenderState( this, context, - command.renderState + command.renderState, ); result.alphaCommand.shaderProgram = getTranslucentAlphaShaderProgram( context, - command.shaderProgram + command.shaderProgram, ); result.alphaCommand.renderState = getTranslucentAlphaRenderState( this, context, - command.renderState + command.renderState, ); result.shaderProgramId = command.shaderProgram.id; } else { @@ -708,7 +708,7 @@ function executeTranslucentCommandsSortedMultipass( executeFunction, passState, commands, - invertClassification + invertClassification, ) { let command; let derivedCommand; @@ -742,7 +742,7 @@ function executeTranslucentCommandsSortedMultipass( scene, context, passState, - debugFramebuffer + debugFramebuffer, ); } @@ -757,7 +757,7 @@ function executeTranslucentCommandsSortedMultipass( scene, context, passState, - debugFramebuffer + debugFramebuffer, ); } @@ -776,7 +776,7 @@ function executeTranslucentCommandsSortedMultipass( scene, context, passState, - debugFramebuffer + debugFramebuffer, ); } @@ -791,7 +791,7 @@ function executeTranslucentCommandsSortedMultipass( scene, context, passState, - debugFramebuffer + debugFramebuffer, ); } @@ -813,7 +813,7 @@ function executeTranslucentCommandsSortedMRT( executeFunction, passState, commands, - invertClassification + invertClassification, ) { const { context, frameState } = scene; const { useLogDepth, shadowState } = frameState; @@ -844,7 +844,7 @@ function executeTranslucentCommandsSortedMRT( scene, context, passState, - debugFramebuffer + debugFramebuffer, ); } @@ -859,7 +859,7 @@ function executeTranslucentCommandsSortedMRT( scene, context, passState, - debugFramebuffer + debugFramebuffer, ); } @@ -879,7 +879,7 @@ OIT.prototype.executeCommands = function ( executeFunction, passState, commands, - invertClassification + invertClassification, ) { if (this._translucentMRTSupport) { executeTranslucentCommandsSortedMRT( @@ -888,7 +888,7 @@ OIT.prototype.executeCommands = function ( executeFunction, passState, commands, - invertClassification + invertClassification, ); return; } @@ -899,7 +899,7 @@ OIT.prototype.executeCommands = function ( executeFunction, passState, commands, - invertClassification + invertClassification, ); }; diff --git a/packages/engine/Source/Scene/OpenStreetMapImageryProvider.js b/packages/engine/Source/Scene/OpenStreetMapImageryProvider.js index 1ff19fded150..a170c06aebc5 100644 --- a/packages/engine/Source/Scene/OpenStreetMapImageryProvider.js +++ b/packages/engine/Source/Scene/OpenStreetMapImageryProvider.js @@ -8,7 +8,7 @@ import WebMercatorTilingScheme from "../Core/WebMercatorTilingScheme.js"; import UrlTemplateImageryProvider from "./UrlTemplateImageryProvider.js"; const defaultCredit = new Credit( - "MapQuest, Open Street Map and contributors, CC-BY-SA" + "MapQuest, Open Street Map and contributors, CC-BY-SA", ); /** @@ -60,7 +60,7 @@ function OpenStreetMapImageryProvider(options) { options = defaultValue(options, defaultValue.EMPTY_OBJECT); const resource = Resource.createIfNeeded( - defaultValue(options.url, "https://tile.openstreetmap.org/") + defaultValue(options.url, "https://tile.openstreetmap.org/"), ); resource.appendForwardSlash(); resource.url += `{z}/{x}/{y}${ @@ -84,18 +84,18 @@ function OpenStreetMapImageryProvider(options) { // level will cause too many tiles to be downloaded and rendered. const swTile = tilingScheme.positionToTileXY( Rectangle.southwest(rectangle), - minimumLevel + minimumLevel, ); const neTile = tilingScheme.positionToTileXY( Rectangle.northeast(rectangle), - minimumLevel + minimumLevel, ); const tileCount = (Math.abs(neTile.x - swTile.x) + 1) * (Math.abs(neTile.y - swTile.y) + 1); //>>includeStart('debug', pragmas.debug); if (tileCount > 4) { throw new DeveloperError( - `The rectangle and minimumLevel indicate that there are ${tileCount} tiles at the minimum level. Imagery providers with more than four tiles at the minimum level are not supported.` + `The rectangle and minimumLevel indicate that there are ${tileCount} tiles at the minimum level. Imagery providers with more than four tiles at the minimum level are not supported.`, ); } //>>includeEnd('debug'); @@ -119,9 +119,10 @@ function OpenStreetMapImageryProvider(options) { if (defined(Object.create)) { OpenStreetMapImageryProvider.prototype = Object.create( - UrlTemplateImageryProvider.prototype + UrlTemplateImageryProvider.prototype, ); - OpenStreetMapImageryProvider.prototype.constructor = OpenStreetMapImageryProvider; + OpenStreetMapImageryProvider.prototype.constructor = + OpenStreetMapImageryProvider; } export default OpenStreetMapImageryProvider; diff --git a/packages/engine/Source/Scene/OrderedGroundPrimitiveCollection.js b/packages/engine/Source/Scene/OrderedGroundPrimitiveCollection.js index f52d0cb95301..74b5f9df50d8 100644 --- a/packages/engine/Source/Scene/OrderedGroundPrimitiveCollection.js +++ b/packages/engine/Source/Scene/OrderedGroundPrimitiveCollection.js @@ -99,7 +99,7 @@ OrderedGroundPrimitiveCollection.prototype.set = function (primitive, zIndex) { */ OrderedGroundPrimitiveCollection.prototype.remove = function ( primitive, - doNotDestroy + doNotDestroy, ) { if (this.contains(primitive)) { const index = primitive._zIndex; @@ -118,7 +118,7 @@ OrderedGroundPrimitiveCollection.prototype.remove = function ( if (collection.length === 0) { this._collectionsArray.splice( this._collectionsArray.indexOf(collection), - 1 + 1, ); this._collections[index] = undefined; collection.destroy(); diff --git a/packages/engine/Source/Scene/Particle.js b/packages/engine/Source/Scene/Particle.js index a304f03475eb..26f104eabaea 100644 --- a/packages/engine/Source/Scene/Particle.js +++ b/packages/engine/Source/Scene/Particle.js @@ -39,7 +39,7 @@ function Particle(options) { * @default Cartesian3.ZERO */ this.position = Cartesian3.clone( - defaultValue(options.position, Cartesian3.ZERO) + defaultValue(options.position, Cartesian3.ZERO), ); /** * The velocity of the particle in world coordinates. @@ -47,7 +47,7 @@ function Particle(options) { * @default Cartesian3.ZERO */ this.velocity = Cartesian3.clone( - defaultValue(options.velocity, Cartesian3.ZERO) + defaultValue(options.velocity, Cartesian3.ZERO), ); /** * The life of the particle in seconds. @@ -91,7 +91,7 @@ function Particle(options) { * @default new Cartesian(1.0, 1.0) */ this.imageSize = Cartesian2.clone( - defaultValue(options.imageSize, defaultSize) + defaultValue(options.imageSize, defaultSize), ); this._age = 0.0; diff --git a/packages/engine/Source/Scene/ParticleEmitter.js b/packages/engine/Source/Scene/ParticleEmitter.js index c8a11276b80d..ef02d378f56e 100644 --- a/packages/engine/Source/Scene/ParticleEmitter.js +++ b/packages/engine/Source/Scene/ParticleEmitter.js @@ -19,7 +19,7 @@ import DeveloperError from "../Core/DeveloperError.js"; function ParticleEmitter(options) { //>>includeStart('debug', pragmas.debug); throw new DeveloperError( - "This type should not be instantiated directly. Instead, use BoxEmitter, CircleEmitter, ConeEmitter or SphereEmitter." + "This type should not be instantiated directly. Instead, use BoxEmitter, CircleEmitter, ConeEmitter or SphereEmitter.", ); //>>includeEnd('debug'); } diff --git a/packages/engine/Source/Scene/ParticleSystem.js b/packages/engine/Source/Scene/ParticleSystem.js index 7fab2c50d985..032755713956 100644 --- a/packages/engine/Source/Scene/ParticleSystem.js +++ b/packages/engine/Source/Scene/ParticleSystem.js @@ -95,70 +95,70 @@ function ParticleSystem(options) { this._bursts = options.bursts; this._modelMatrix = Matrix4.clone( - defaultValue(options.modelMatrix, Matrix4.IDENTITY) + defaultValue(options.modelMatrix, Matrix4.IDENTITY), ); this._emitterModelMatrix = Matrix4.clone( - defaultValue(options.emitterModelMatrix, Matrix4.IDENTITY) + defaultValue(options.emitterModelMatrix, Matrix4.IDENTITY), ); this._matrixDirty = true; this._combinedMatrix = new Matrix4(); this._startColor = Color.clone( - defaultValue(options.color, defaultValue(options.startColor, Color.WHITE)) + defaultValue(options.color, defaultValue(options.startColor, Color.WHITE)), ); this._endColor = Color.clone( - defaultValue(options.color, defaultValue(options.endColor, Color.WHITE)) + defaultValue(options.color, defaultValue(options.endColor, Color.WHITE)), ); this._startScale = defaultValue( options.scale, - defaultValue(options.startScale, 1.0) + defaultValue(options.startScale, 1.0), ); this._endScale = defaultValue( options.scale, - defaultValue(options.endScale, 1.0) + defaultValue(options.endScale, 1.0), ); this._emissionRate = defaultValue(options.emissionRate, 5.0); this._minimumSpeed = defaultValue( options.speed, - defaultValue(options.minimumSpeed, 1.0) + defaultValue(options.minimumSpeed, 1.0), ); this._maximumSpeed = defaultValue( options.speed, - defaultValue(options.maximumSpeed, 1.0) + defaultValue(options.maximumSpeed, 1.0), ); this._minimumParticleLife = defaultValue( options.particleLife, - defaultValue(options.minimumParticleLife, 5.0) + defaultValue(options.minimumParticleLife, 5.0), ); this._maximumParticleLife = defaultValue( options.particleLife, - defaultValue(options.maximumParticleLife, 5.0) + defaultValue(options.maximumParticleLife, 5.0), ); this._minimumMass = defaultValue( options.mass, - defaultValue(options.minimumMass, 1.0) + defaultValue(options.minimumMass, 1.0), ); this._maximumMass = defaultValue( options.mass, - defaultValue(options.maximumMass, 1.0) + defaultValue(options.maximumMass, 1.0), ); this._minimumImageSize = Cartesian2.clone( defaultValue( options.imageSize, - defaultValue(options.minimumImageSize, defaultImageSize) - ) + defaultValue(options.minimumImageSize, defaultImageSize), + ), ); this._maximumImageSize = Cartesian2.clone( defaultValue( options.imageSize, - defaultValue(options.maximumImageSize, defaultImageSize) - ) + defaultValue(options.maximumImageSize, defaultImageSize), + ), ); this._sizeInMeters = defaultValue(options.sizeInMeters, false); @@ -557,7 +557,7 @@ function updateParticlePool(system) { const particlePool = system._particlePool; const numToAdd = Math.max( particleEstimate - particles.length - particlePool.length, - 0 + 0, ); for (let j = 0; j < numToAdd; ++j) { @@ -630,22 +630,22 @@ function updateBillboard(system, particle) { const r = CesiumMath.lerp( particle.startColor.red, particle.endColor.red, - particle.normalizedAge + particle.normalizedAge, ); const g = CesiumMath.lerp( particle.startColor.green, particle.endColor.green, - particle.normalizedAge + particle.normalizedAge, ); const b = CesiumMath.lerp( particle.startColor.blue, particle.endColor.blue, - particle.normalizedAge + particle.normalizedAge, ); const a = CesiumMath.lerp( particle.startColor.alpha, particle.endColor.alpha, - particle.normalizedAge + particle.normalizedAge, ); billboard.color = new Color(r, g, b, a); @@ -653,7 +653,7 @@ function updateBillboard(system, particle) { billboard.scale = CesiumMath.lerp( particle.startScale, particle.endScale, - particle.normalizedAge + particle.normalizedAge, ); } @@ -665,19 +665,19 @@ function addParticle(system, particle) { particle.image = system.image; particle.life = CesiumMath.randomBetween( system._minimumParticleLife, - system._maximumParticleLife + system._maximumParticleLife, ); particle.mass = CesiumMath.randomBetween( system._minimumMass, - system._maximumMass + system._maximumMass, ); particle.imageSize.x = CesiumMath.randomBetween( system._minimumImageSize.x, - system._maximumImageSize.x + system._maximumImageSize.x, ); particle.imageSize.y = CesiumMath.randomBetween( system._minimumImageSize.y, - system._maximumImageSize.y + system._maximumImageSize.y, ); // Reset the normalizedAge and age in case the particle was reused. @@ -686,7 +686,7 @@ function addParticle(system, particle) { const speed = CesiumMath.randomBetween( system._minimumSpeed, - system._maximumSpeed + system._maximumSpeed, ); Cartesian3.multiplyByScalar(particle.velocity, speed, particle.velocity); @@ -787,7 +787,7 @@ ParticleSystem.prototype.update = function (frameState) { this._combinedMatrix = Matrix4.multiply( this.modelMatrix, this.emitterModelMatrix, - this._combinedMatrix + this._combinedMatrix, ); this._matrixDirty = false; } @@ -805,26 +805,26 @@ ParticleSystem.prototype.update = function (frameState) { Cartesian3.add( particle.position, particle.velocity, - rotatedVelocityScratch + rotatedVelocityScratch, ); Matrix4.multiplyByPoint( combinedMatrix, rotatedVelocityScratch, - rotatedVelocityScratch + rotatedVelocityScratch, ); // Change the position to be in world coordinates particle.position = Matrix4.multiplyByPoint( combinedMatrix, particle.position, - particle.position + particle.position, ); // Orient the velocity in world space as well. Cartesian3.subtract( rotatedVelocityScratch, particle.position, - particle.velocity + particle.velocity, ); Cartesian3.normalize(particle.velocity, particle.velocity); diff --git a/packages/engine/Source/Scene/PerInstanceColorAppearance.js b/packages/engine/Source/Scene/PerInstanceColorAppearance.js index a2a32ec136b9..a896ddd43b12 100644 --- a/packages/engine/Source/Scene/PerInstanceColorAppearance.js +++ b/packages/engine/Source/Scene/PerInstanceColorAppearance.js @@ -108,7 +108,7 @@ function PerInstanceColorAppearance(options) { this._renderState = Appearance.getDefaultRenderState( translucent, closed, - options.renderState + options.renderState, ); this._closed = closed; diff --git a/packages/engine/Source/Scene/PickDepth.js b/packages/engine/Source/Scene/PickDepth.js index f350e0a8a76e..d687c286b883 100644 --- a/packages/engine/Source/Scene/PickDepth.js +++ b/packages/engine/Source/Scene/PickDepth.js @@ -52,7 +52,7 @@ void main() }, }, owner: pickDepth, - } + }, ); } @@ -70,7 +70,7 @@ const packedDepthScale = new Cartesian4( 1.0, 1.0 / 255.0, 1.0 / 65025.0, - 1.0 / 16581375.0 + 1.0 / 16581375.0, ); PickDepth.prototype.getDepth = function (context, x, y) { diff --git a/packages/engine/Source/Scene/PickDepthFramebuffer.js b/packages/engine/Source/Scene/PickDepthFramebuffer.js index 3e22fe1f10a9..72ece64a45d2 100644 --- a/packages/engine/Source/Scene/PickDepthFramebuffer.js +++ b/packages/engine/Source/Scene/PickDepthFramebuffer.js @@ -46,7 +46,7 @@ function createResources(pickDepth, context) { PickDepthFramebuffer.prototype.update = function ( context, drawingBufferPosition, - viewport + viewport, ) { const width = viewport.width; const height = viewport.height; diff --git a/packages/engine/Source/Scene/PickFramebuffer.js b/packages/engine/Source/Scene/PickFramebuffer.js index 84a64a5b61ee..e7f2fb08b03a 100644 --- a/packages/engine/Source/Scene/PickFramebuffer.js +++ b/packages/engine/Source/Scene/PickFramebuffer.js @@ -34,7 +34,7 @@ PickFramebuffer.prototype.begin = function (screenSpaceRectangle, viewport) { BoundingRectangle.clone( screenSpaceRectangle, - this._passState.scissorTest.rectangle + this._passState.scissorTest.rectangle, ); // Create or recreate renderbuffers and framebuffer used for picking diff --git a/packages/engine/Source/Scene/Picking.js b/packages/engine/Source/Scene/Picking.js index e248e9632c33..bc1fd926ae0b 100644 --- a/packages/engine/Source/Scene/Picking.js +++ b/packages/engine/Source/Scene/Picking.js @@ -59,7 +59,7 @@ function Picking(scene) { this._pickOffscreenView = new View( scene, pickOffscreenCamera, - pickOffscreenViewport + pickOffscreenViewport, ); } @@ -88,7 +88,7 @@ function getPickOrthographicCullingVolume( drawingBufferPosition, width, height, - viewport + viewport, ) { const camera = scene.camera; let frustum = camera.frustum; @@ -107,7 +107,7 @@ function getPickOrthographicCullingVolume( const transform = Matrix4.clone( camera.transform, - scratchOrthoPickVolumeMatrix4 + scratchOrthoPickVolumeMatrix4, ); camera._setTransform(Matrix4.IDENTITY); @@ -128,7 +128,7 @@ function getPickOrthographicCullingVolume( viewport.height, 1.0, 1.0, - scratchOrthoPixelSize + scratchOrthoPixelSize, ); const ortho = scratchOrthoPickingFrustum; @@ -150,7 +150,7 @@ function getPickPerspectiveCullingVolume( drawingBufferPosition, width, height, - viewport + viewport, ) { const camera = scene.camera; const frustum = camera.frustum; @@ -174,7 +174,7 @@ function getPickPerspectiveCullingVolume( viewport.height, 1.0, 1.0, - scratchPerspPixelSize + scratchPerspPixelSize, ); const pickWidth = pixelSize.x * width * 0.5; const pickHeight = pixelSize.y * height * 0.5; @@ -190,7 +190,7 @@ function getPickPerspectiveCullingVolume( return offCenter.computeCullingVolume( camera.positionWC, camera.directionWC, - camera.upWC + camera.upWC, ); } @@ -199,7 +199,7 @@ function getPickCullingVolume( drawingBufferPosition, width, height, - viewport + viewport, ) { const frustum = scene.camera.frustum; if ( @@ -211,7 +211,7 @@ function getPickCullingVolume( drawingBufferPosition, width, height, - viewport + viewport, ); } @@ -220,7 +220,7 @@ function getPickCullingVolume( drawingBufferPosition, width, height, - viewport + viewport, ); } @@ -231,7 +231,7 @@ let scratchRectangle = new BoundingRectangle( 0.0, 0.0, scratchRectangleWidth, - scratchRectangleHeight + scratchRectangleHeight, ); const scratchPosition = new Cartesian2(); const scratchColorZero = new Color(0.0, 0.0, 0.0, 0.0); @@ -273,7 +273,7 @@ Picking.prototype.pick = function (scene, windowPosition, width, height) { const drawingBufferPosition = SceneTransforms.transformWindowToDrawingBuffer( scene, windowPosition, - scratchPosition + scratchPosition, ); scene.jobScheduler.disableThisFrame(); @@ -284,7 +284,7 @@ Picking.prototype.pick = function (scene, windowPosition, width, height) { drawingBufferPosition, scratchRectangleWidth, scratchRectangleHeight, - viewport + viewport, ); frameState.invertClassification = false; frameState.passes.pick = true; @@ -327,7 +327,7 @@ Picking.prototype.pickVoxelCoordinate = function ( scene, windowPosition, width, - height + height, ) { //>>includeStart('debug', pragmas.debug); Check.defined("windowPosition", windowPosition); @@ -352,7 +352,7 @@ Picking.prototype.pickVoxelCoordinate = function ( const drawingBufferPosition = SceneTransforms.transformWindowToDrawingBuffer( scene, windowPosition, - scratchPosition + scratchPosition, ); scene.jobScheduler.disableThisFrame(); @@ -363,7 +363,7 @@ Picking.prototype.pickVoxelCoordinate = function ( drawingBufferPosition, scratchRectangleWidth, scratchRectangleHeight, - viewport + viewport, ); frameState.invertClassification = false; frameState.passes.pickVoxel = true; @@ -414,7 +414,7 @@ function renderTranslucentDepthForPick(scene, drawingBufferPosition) { drawingBufferPosition, 1, 1, - viewport + viewport, ); frameState.tilesetPassState = pickTilesetPassState; @@ -423,7 +423,7 @@ function renderTranslucentDepthForPick(scene, drawingBufferPosition) { passState = pickDepthFramebuffer.update( context, drawingBufferPosition, - viewport + viewport, ); scene.updateAndExecuteCommands(passState, scratchColorZero); @@ -440,7 +440,7 @@ const scratchOrthographicOffCenterFrustum = new OrthographicOffCenterFrustum(); Picking.prototype.pickPositionWorldCoordinates = function ( scene, windowPosition, - result + result, ) { if (!scene.useDepthPicking) { return undefined; @@ -450,7 +450,7 @@ Picking.prototype.pickPositionWorldCoordinates = function ( Check.defined("windowPosition", windowPosition); if (!scene.context.depthTexture) { throw new DeveloperError( - "Picking from the depth buffer is not supported. Check pickPositionSupported." + "Picking from the depth buffer is not supported. Check pickPositionSupported.", ); } //>>includeEnd('debug'); @@ -472,7 +472,7 @@ Picking.prototype.pickPositionWorldCoordinates = function ( const drawingBufferPosition = SceneTransforms.transformWindowToDrawingBuffer( scene, windowPosition, - scratchPosition + scratchPosition, ); if (scene.pickTranslucentDepth) { renderTranslucentDepthForPick(scene, drawingBufferPosition); @@ -502,7 +502,7 @@ Picking.prototype.pickPositionWorldCoordinates = function ( const depth = pickDepth.getDepth( context, drawingBufferPosition.x, - drawingBufferPosition.y + drawingBufferPosition.y, ); if (!defined(depth)) { continue; @@ -529,7 +529,7 @@ Picking.prototype.pickPositionWorldCoordinates = function ( scene, drawingBufferPosition, depth, - result + result, ); if (scene.mode === SceneMode.SCENE2D) { @@ -610,7 +610,7 @@ function drillPick(limit, pickCallback) { hasShowAttribute = true; attributes.show = ShowGeometryInstanceAttribute.toValue( false, - attributes.show + attributes.show, ); pickedAttributes.push(attributes); } @@ -641,7 +641,7 @@ function drillPick(limit, pickCallback) { attributes = pickedAttributes[i]; attributes.show = ShowGeometryInstanceAttribute.toValue( true, - attributes.show + attributes.show, ); } @@ -657,7 +657,7 @@ Picking.prototype.drillPick = function ( windowPosition, limit, width, - height + height, ) { const that = this; const pickCallback = function () { @@ -707,7 +707,7 @@ function updateOffscreenCameraFromRay(picking, ray, width, camera) { return camera.frustum.computeCullingVolume( camera.positionWC, camera.directionWC, - camera.upWC + camera.upWC, ); } @@ -721,7 +721,7 @@ function updateMostDetailedRayPick(picking, scene, rayPick) { picking, ray, width, - camera + camera, ); const tilesetPassState = mostDetailedPreloadTilesetPassState; @@ -781,7 +781,7 @@ function launchMostDetailedRayPick( ray, objectsToExclude, width, - callback + callback, ) { const tilesets = []; getTilesets(scene.primitives, objectsToExclude, tilesets); @@ -818,7 +818,7 @@ function getRayIntersection( objectsToExclude, width, requirePosition, - mostDetailed + mostDetailed, ) { const { context, frameState } = scene; const uniformState = context.uniformState; @@ -897,7 +897,7 @@ function getRayIntersections( objectsToExclude, width, requirePosition, - mostDetailed + mostDetailed, ) { const pickCallback = function () { return getRayIntersection( @@ -907,7 +907,7 @@ function getRayIntersections( objectsToExclude, width, requirePosition, - mostDetailed + mostDetailed, ); }; return drillPick(limit, pickCallback); @@ -920,7 +920,7 @@ function pickFromRay( objectsToExclude, width, requirePosition, - mostDetailed + mostDetailed, ) { const results = getRayIntersections( picking, @@ -930,7 +930,7 @@ function pickFromRay( objectsToExclude, width, requirePosition, - mostDetailed + mostDetailed, ); if (results.length > 0) { return results[0]; @@ -945,7 +945,7 @@ function drillPickFromRay( objectsToExclude, width, requirePosition, - mostDetailed + mostDetailed, ) { return getRayIntersections( picking, @@ -955,7 +955,7 @@ function drillPickFromRay( objectsToExclude, width, requirePosition, - mostDetailed + mostDetailed, ); } @@ -982,7 +982,7 @@ Picking.prototype.pickFromRay = function (scene, ray, objectsToExclude, width) { Check.defined("ray", ray); if (scene.mode !== SceneMode.SCENE3D) { throw new DeveloperError( - "Ray intersections are only supported in 3D mode." + "Ray intersections are only supported in 3D mode.", ); } //>>includeEnd('debug'); @@ -995,13 +995,13 @@ Picking.prototype.drillPickFromRay = function ( ray, limit, objectsToExclude, - width + width, ) { //>>includeStart('debug', pragmas.debug); Check.defined("ray", ray); if (scene.mode !== SceneMode.SCENE3D) { throw new DeveloperError( - "Ray intersections are only supported in 3D mode." + "Ray intersections are only supported in 3D mode.", ); } //>>includeEnd('debug'); @@ -1014,7 +1014,7 @@ Picking.prototype.drillPickFromRay = function ( objectsToExclude, width, false, - false + false, ); }; @@ -1022,13 +1022,13 @@ Picking.prototype.pickFromRayMostDetailed = function ( scene, ray, objectsToExclude, - width + width, ) { //>>includeStart('debug', pragmas.debug); Check.defined("ray", ray); if (scene.mode !== SceneMode.SCENE3D) { throw new DeveloperError( - "Ray intersections are only supported in 3D mode." + "Ray intersections are only supported in 3D mode.", ); } //>>includeEnd('debug'); @@ -1054,10 +1054,10 @@ Picking.prototype.pickFromRayMostDetailed = function ( objectsToExclude, width, false, - true + true, ); - } - ) + }, + ), ); }; @@ -1066,13 +1066,13 @@ Picking.prototype.drillPickFromRayMostDetailed = function ( ray, limit, objectsToExclude, - width + width, ) { //>>includeStart('debug', pragmas.debug); Check.defined("ray", ray); if (scene.mode !== SceneMode.SCENE3D) { throw new DeveloperError( - "Ray intersections are only supported in 3D mode." + "Ray intersections are only supported in 3D mode.", ); } //>>includeEnd('debug'); @@ -1099,10 +1099,10 @@ Picking.prototype.drillPickFromRayMostDetailed = function ( objectsToExclude, width, false, - true + true, ); - } - ) + }, + ), ); }; @@ -1116,12 +1116,12 @@ function getRayForSampleHeight(scene, cartographic) { const height = ApproximateTerrainHeights._defaultMaxTerrainHeight; const surfaceNormal = ellipsoid.geodeticSurfaceNormalCartographic( cartographic, - scratchSurfaceNormal + scratchSurfaceNormal, ); const surfacePosition = Cartographic.toCartesian( cartographic, ellipsoid, - scratchSurfacePosition + scratchSurfacePosition, ); const surfaceRay = scratchSurfaceRay; surfaceRay.origin = surfacePosition; @@ -1137,7 +1137,7 @@ function getRayForClampToHeight(scene, cartesian) { const cartographic = Cartographic.fromCartesian( cartesian, ellipsoid, - scratchCartographic + scratchCartographic, ); return getRayForSampleHeight(scene, cartographic); } @@ -1147,7 +1147,7 @@ function getHeightFromCartesian(scene, cartesian) { const cartographic = Cartographic.fromCartesian( cartesian, ellipsoid, - scratchCartographic + scratchCartographic, ); return cartographic.height; } @@ -1157,7 +1157,7 @@ function sampleHeightMostDetailed( scene, cartographic, objectsToExclude, - width + width, ) { const ray = getRayForSampleHeight(scene, cartographic); return launchMostDetailedRayPick( @@ -1174,12 +1174,12 @@ function sampleHeightMostDetailed( objectsToExclude, width, true, - true + true, ); if (defined(pickResult)) { return getHeightFromCartesian(scene, pickResult.position); } - } + }, ); } @@ -1189,7 +1189,7 @@ function clampToHeightMostDetailed( cartesian, objectsToExclude, width, - result + result, ) { const ray = getRayForClampToHeight(scene, cartesian); return launchMostDetailedRayPick( @@ -1206,12 +1206,12 @@ function clampToHeightMostDetailed( objectsToExclude, width, true, - true + true, ); if (defined(pickResult)) { return Cartesian3.clone(pickResult.position, result); } - } + }, ); } @@ -1219,7 +1219,7 @@ Picking.prototype.sampleHeight = function ( scene, position, objectsToExclude, - width + width, ) { //>>includeStart('debug', pragmas.debug); Check.defined("position", position); @@ -1228,7 +1228,7 @@ Picking.prototype.sampleHeight = function ( } if (!scene.sampleHeightSupported) { throw new DeveloperError( - "sampleHeight requires depth texture support. Check sampleHeightSupported." + "sampleHeight requires depth texture support. Check sampleHeightSupported.", ); } //>>includeEnd('debug'); @@ -1241,7 +1241,7 @@ Picking.prototype.sampleHeight = function ( objectsToExclude, width, true, - false + false, ); if (defined(pickResult)) { return getHeightFromCartesian(scene, pickResult.position); @@ -1253,7 +1253,7 @@ Picking.prototype.clampToHeight = function ( cartesian, objectsToExclude, width, - result + result, ) { //>>includeStart('debug', pragmas.debug); Check.defined("cartesian", cartesian); @@ -1262,7 +1262,7 @@ Picking.prototype.clampToHeight = function ( } if (!scene.clampToHeightSupported) { throw new DeveloperError( - "clampToHeight requires depth texture support. Check clampToHeightSupported." + "clampToHeight requires depth texture support. Check clampToHeightSupported.", ); } //>>includeEnd('debug'); @@ -1275,7 +1275,7 @@ Picking.prototype.clampToHeight = function ( objectsToExclude, width, true, - false + false, ); if (defined(pickResult)) { return Cartesian3.clone(pickResult.position, result); @@ -1286,18 +1286,18 @@ Picking.prototype.sampleHeightMostDetailed = function ( scene, positions, objectsToExclude, - width + width, ) { //>>includeStart('debug', pragmas.debug); Check.defined("positions", positions); if (scene.mode !== SceneMode.SCENE3D) { throw new DeveloperError( - "sampleHeightMostDetailed is only supported in 3D mode." + "sampleHeightMostDetailed is only supported in 3D mode.", ); } if (!scene.sampleHeightSupported) { throw new DeveloperError( - "sampleHeightMostDetailed requires depth texture support. Check sampleHeightSupported." + "sampleHeightMostDetailed requires depth texture support. Check sampleHeightSupported.", ); } //>>includeEnd('debug'); @@ -1313,7 +1313,7 @@ Picking.prototype.sampleHeightMostDetailed = function ( scene, positions[i], objectsToExclude, - width + width, ); } return deferPromiseUntilPostRender( @@ -1324,7 +1324,7 @@ Picking.prototype.sampleHeightMostDetailed = function ( positions[i].height = heights[i]; } return positions; - }) + }), ); }; @@ -1332,18 +1332,18 @@ Picking.prototype.clampToHeightMostDetailed = function ( scene, cartesians, objectsToExclude, - width + width, ) { //>>includeStart('debug', pragmas.debug); Check.defined("cartesians", cartesians); if (scene.mode !== SceneMode.SCENE3D) { throw new DeveloperError( - "clampToHeightMostDetailed is only supported in 3D mode." + "clampToHeightMostDetailed is only supported in 3D mode.", ); } if (!scene.clampToHeightSupported) { throw new DeveloperError( - "clampToHeightMostDetailed requires depth texture support. Check clampToHeightSupported." + "clampToHeightMostDetailed requires depth texture support. Check clampToHeightSupported.", ); } //>>includeEnd('debug'); @@ -1360,7 +1360,7 @@ Picking.prototype.clampToHeightMostDetailed = function ( cartesians[i], objectsToExclude, width, - cartesians[i] + cartesians[i], ); } return deferPromiseUntilPostRender( @@ -1371,7 +1371,7 @@ Picking.prototype.clampToHeightMostDetailed = function ( cartesians[i] = clampedCartesians[i]; } return cartesians; - }) + }), ); }; diff --git a/packages/engine/Source/Scene/PntsParser.js b/packages/engine/Source/Scene/PntsParser.js index eb60db304b65..e58c52317b33 100644 --- a/packages/engine/Source/Scene/PntsParser.js +++ b/packages/engine/Source/Scene/PntsParser.js @@ -43,7 +43,7 @@ PntsParser.parse = function (arrayBuffer, byteOffset) { const version = view.getUint32(byteOffset, true); if (version !== 1) { throw new RuntimeError( - `Only Point Cloud tile version 1 is supported. Version ${version} is not.` + `Only Point Cloud tile version 1 is supported. Version ${version} is not.`, ); } byteOffset += sizeOfUint32; @@ -54,7 +54,7 @@ PntsParser.parse = function (arrayBuffer, byteOffset) { const featureTableJsonByteLength = view.getUint32(byteOffset, true); if (featureTableJsonByteLength === 0) { throw new RuntimeError( - "Feature table must have a byte length greater than zero" + "Feature table must have a byte length greater than zero", ); } byteOffset += sizeOfUint32; @@ -70,14 +70,14 @@ PntsParser.parse = function (arrayBuffer, byteOffset) { const featureTableJson = getJsonFromTypedArray( uint8Array, byteOffset, - featureTableJsonByteLength + featureTableJsonByteLength, ); byteOffset += featureTableJsonByteLength; const featureTableBinary = new Uint8Array( arrayBuffer, byteOffset, - featureTableBinaryByteLength + featureTableBinaryByteLength, ); byteOffset += featureTableBinaryByteLength; @@ -89,7 +89,7 @@ PntsParser.parse = function (arrayBuffer, byteOffset) { batchTableJson = getJsonFromTypedArray( uint8Array, byteOffset, - batchTableJsonByteLength + batchTableJsonByteLength, ); byteOffset += batchTableJsonByteLength; @@ -98,7 +98,7 @@ PntsParser.parse = function (arrayBuffer, byteOffset) { batchTableBinary = new Uint8Array( arrayBuffer, byteOffset, - batchTableBinaryByteLength + batchTableBinaryByteLength, ); byteOffset += batchTableBinaryByteLength; } @@ -106,7 +106,7 @@ PntsParser.parse = function (arrayBuffer, byteOffset) { const featureTable = new Cesium3DTileFeatureTable( featureTableJson, - featureTableBinary + featureTableBinary, ); const pointsLength = featureTable.getGlobalProperty("POINTS_LENGTH"); @@ -114,14 +114,14 @@ PntsParser.parse = function (arrayBuffer, byteOffset) { if (!defined(pointsLength)) { throw new RuntimeError( - "Feature table global property: POINTS_LENGTH must be defined" + "Feature table global property: POINTS_LENGTH must be defined", ); } let rtcCenter = featureTable.getGlobalProperty( "RTC_CENTER", ComponentDatatype.FLOAT, - 3 + 3, ); if (defined(rtcCenter)) { rtcCenter = Cartesian3.unpack(rtcCenter); @@ -142,7 +142,7 @@ PntsParser.parse = function (arrayBuffer, byteOffset) { if (!parsedContent.hasPositions) { throw new RuntimeError( - "Either POSITION or POSITION_QUANTIZED must be defined." + "Either POSITION or POSITION_QUANTIZED must be defined.", ); } @@ -170,7 +170,7 @@ PntsParser.parse = function (arrayBuffer, byteOffset) { const batchLength = featureTable.getGlobalProperty("BATCH_LENGTH"); if (!defined(batchLength)) { throw new RuntimeError( - "Global property: BATCH_LENGTH must be defined when BATCH_ID is defined." + "Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.", ); } parsedContent.batchLength = batchLength; @@ -219,12 +219,12 @@ function parseDracoProperties(featureTable, batchTableJson) { !defined(dracoByteLength) ) { throw new RuntimeError( - "Draco properties, byteOffset, and byteLength must be defined" + "Draco properties, byteOffset, and byteLength must be defined", ); } dracoBuffer = featureTable.buffer.slice( dracoByteOffset, - dracoByteOffset + dracoByteLength + dracoByteOffset + dracoByteLength, ); hasPositions = defined(dracoFeatureTableProperties.POSITION); hasColors = @@ -243,7 +243,7 @@ function parseDracoProperties(featureTable, batchTableJson) { batchTableProperties: dracoBatchTableProperties, properties: combine( dracoFeatureTableProperties, - dracoBatchTableProperties + dracoBatchTableProperties, ), dequantizeInShader: true, }; @@ -267,7 +267,7 @@ function parsePositions(featureTable) { positions = featureTable.getPropertyArray( "POSITION", ComponentDatatype.FLOAT, - 3 + 3, ); return { @@ -282,17 +282,17 @@ function parsePositions(featureTable) { positions = featureTable.getPropertyArray( "POSITION_QUANTIZED", ComponentDatatype.UNSIGNED_SHORT, - 3 + 3, ); const quantizedVolumeScale = featureTable.getGlobalProperty( "QUANTIZED_VOLUME_SCALE", ComponentDatatype.FLOAT, - 3 + 3, ); if (!defined(quantizedVolumeScale)) { throw new RuntimeError( - "Global property: QUANTIZED_VOLUME_SCALE must be defined for quantized positions." + "Global property: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.", ); } const quantizedRange = (1 << 16) - 1; @@ -300,11 +300,11 @@ function parsePositions(featureTable) { const quantizedVolumeOffset = featureTable.getGlobalProperty( "QUANTIZED_VOLUME_OFFSET", ComponentDatatype.FLOAT, - 3 + 3, ); if (!defined(quantizedVolumeOffset)) { throw new RuntimeError( - "Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions." + "Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.", ); } @@ -332,7 +332,7 @@ function parseColors(featureTable) { colors = featureTable.getPropertyArray( "RGBA", ComponentDatatype.UNSIGNED_BYTE, - 4 + 4, ); return { name: VertexAttributeSemantic.COLOR, @@ -349,7 +349,7 @@ function parseColors(featureTable) { colors = featureTable.getPropertyArray( "RGB", ComponentDatatype.UNSIGNED_BYTE, - 3 + 3, ); return { name: "COLOR", @@ -366,7 +366,7 @@ function parseColors(featureTable) { colors = featureTable.getPropertyArray( "RGB565", ComponentDatatype.UNSIGNED_SHORT, - 1 + 1, ); return { name: "COLOR", @@ -387,7 +387,7 @@ function parseColors(featureTable) { const constantRGBA = featureTable.getGlobalProperty( "CONSTANT_RGBA", ComponentDatatype.UNSIGNED_BYTE, - 4 + 4, ); const alpha = constantRGBA[3]; @@ -395,7 +395,7 @@ function parseColors(featureTable) { constantRGBA[0], constantRGBA[1], constantRGBA[2], - alpha + alpha, ); const isTranslucent = alpha < 255; @@ -421,7 +421,7 @@ function parseNormals(featureTable) { normals = featureTable.getPropertyArray( "NORMAL", ComponentDatatype.FLOAT, - 3 + 3, ); return { name: VertexAttributeSemantic.NORMAL, @@ -436,7 +436,7 @@ function parseNormals(featureTable) { normals = featureTable.getPropertyArray( "NORMAL_OCT16P", ComponentDatatype.UNSIGNED_BYTE, - 2 + 2, ); const quantizationBits = 8; return { @@ -462,7 +462,7 @@ function parseBatchIds(featureTable) { const batchIds = featureTable.getPropertyArray( "BATCH_ID", ComponentDatatype.UNSIGNED_SHORT, - 1 + 1, ); return { name: VertexAttributeSemantic.FEATURE_ID, diff --git a/packages/engine/Source/Scene/PointCloud.js b/packages/engine/Source/Scene/PointCloud.js index c2a0d363cd3b..6f41c9fc7330 100644 --- a/packages/engine/Source/Scene/PointCloud.js +++ b/packages/engine/Source/Scene/PointCloud.js @@ -152,7 +152,7 @@ function PointCloud(options) { */ this.splitDirection = defaultValue( options.splitDirection, - SplitDirection.NONE + SplitDirection.NONE, ); this._splittingEnabled = false; @@ -204,7 +204,7 @@ Object.defineProperties(PointCloud.prototype, { function initialize(pointCloud, options) { const parsedContent = PntsParser.parse( options.arrayBuffer, - options.byteOffset + options.byteOffset, ); pointCloud._parsedContent = parsedContent; pointCloud._rtcCenter = parsedContent.rtcCenter; @@ -216,11 +216,12 @@ function initialize(pointCloud, options) { // If points are not batched and there are per-point properties, use the // properties as metadata for styling purposes. if (!parsedContent.hasBatchIds && defined(parsedContent.batchTableBinary)) { - parsedContent.styleableProperties = Cesium3DTileBatchTable.getBinaryProperties( - parsedContent.pointsLength, - parsedContent.batchTableJson, - parsedContent.batchTableBinary - ); + parsedContent.styleableProperties = + Cesium3DTileBatchTable.getBinaryProperties( + parsedContent.pointsLength, + parsedContent.batchTableJson, + parsedContent.batchTableBinary, + ); } if (defined(parsedContent.draco)) { @@ -247,7 +248,7 @@ function initialize(pointCloud, options) { if (defined(colors.constantColor)) { pointCloud._constantColor = Color.clone( colors.constantColor, - pointCloud._constantColor + pointCloud._constantColor, ); // Constant colors are handled as a uniform rather than a vertex @@ -271,7 +272,7 @@ function initialize(pointCloud, options) { pointCloud._batchTableLoaded( parsedContent.batchLength, parsedContent.batchTableJson, - parsedContent.batchTableBinary + parsedContent.batchTableBinary, ); } @@ -332,14 +333,15 @@ function prepareVertexAttribute(typedArray, name) { ) { oneTimeWarning( "Cast pnts property to floats", - `Point cloud property "${name}" will be cast to a float array because INT, UNSIGNED_INT, and DOUBLE are not valid WebGL vertex attribute types. Some precision may be lost.` + `Point cloud property "${name}" will be cast to a float array because INT, UNSIGNED_INT, and DOUBLE are not valid WebGL vertex attribute types. Some precision may be lost.`, ); return new Float32Array(typedArray); } return typedArray; } -const scratchPointSizeAndTimeAndGeometricErrorAndDepthMultiplier = new Cartesian4(); +const scratchPointSizeAndTimeAndGeometricErrorAndDepthMultiplier = + new Cartesian4(); const scratchQuantizedVolumeScaleAndOctEncodedRange = new Cartesian4(); const scratchColor = new Color(); @@ -450,7 +452,7 @@ function createResources(pointCloud, frameState) { if (hasBatchIds) { batchIds.typedArray = prepareVertexAttribute( batchIds.typedArray, - "batchIds" + "batchIds", ); batchIdsVertexBuffer = Buffer.createVertexBuffer({ context: context, @@ -487,12 +489,11 @@ function createResources(pointCloud, frameState) { if (isQuantized || isQuantizedDraco) { pointCloud._boundingSphere = BoundingSphere.fromCornerPoints( Cartesian3.ZERO, - pointCloud._quantizedVolumeScale + pointCloud._quantizedVolumeScale, ); } else { - pointCloud._boundingSphere = computeApproximateBoundingSphereFromPositions( - positions.typedArray - ); + pointCloud._boundingSphere = + computeApproximateBoundingSphereFromPositions(positions.typedArray); } } @@ -590,7 +591,7 @@ function createResources(pointCloud, frameState) { pointCloud._opaqueRenderState = RenderState.fromCache(opaqueRenderState); pointCloud._translucentRenderState = RenderState.fromCache( - translucentRenderState + translucentRenderState, ); pointCloud._drawCommand = new DrawCommand({ @@ -621,7 +622,8 @@ function createUniformMap(pointCloud, frameState) { let uniformMap = { u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier: function () { - const scratch = scratchPointSizeAndTimeAndGeometricErrorAndDepthMultiplier; + const scratch = + scratchPointSizeAndTimeAndGeometricErrorAndDepthMultiplier; scratch.x = pointCloud._attenuation ? pointCloud.maximumAttenuation : pointCloud._pointSize; @@ -679,22 +681,22 @@ function createUniformMap(pointCloud, frameState) { const clippingPlanesOriginMatrix = defaultValue( pointCloud.clippingPlanesOriginMatrix, - pointCloud._modelMatrix + pointCloud._modelMatrix, ); Matrix4.multiply( context.uniformState.view3D, clippingPlanesOriginMatrix, - scratchClippingPlanesMatrix + scratchClippingPlanesMatrix, ); const transform = Matrix4.multiply( scratchClippingPlanesMatrix, clippingPlanes.modelMatrix, - scratchClippingPlanesMatrix + scratchClippingPlanesMatrix, ); return Matrix4.inverseTranspose( transform, - scratchInverseTransposeClippingPlanesMatrix + scratchInverseTransposeClippingPlanesMatrix, ); }, }; @@ -708,7 +710,7 @@ function createUniformMap(pointCloud, frameState) { if (defined(pointCloud._quantizedVolumeScale)) { const scale = Cartesian3.clone( pointCloud._quantizedVolumeScale, - scratch + scratch, ); Cartesian3.divideByScalar(scale, pointCloud._quantizedRange, scratch); } @@ -802,9 +804,8 @@ function createShaders(pointCloud, frameState, style) { for (name in styleableShaderAttributes) { if (styleableShaderAttributes.hasOwnProperty(name)) { attribute = styleableShaderAttributes[name]; - variableSubstitutionMap[ - name - ] = `czm_3dtiles_property_${attribute.location}`; + variableSubstitutionMap[name] = + `czm_3dtiles_property_${attribute.location}`; propertyIdToAttributeMap[attribute.location] = attribute; } } @@ -823,17 +824,17 @@ function createShaders(pointCloud, frameState, style) { colorStyleFunction = style.getColorShaderFunction( `getColorFromStyle${parameterList}`, variableSubstitutionMap, - shaderState + shaderState, ); showStyleFunction = style.getShowShaderFunction( `getShowFromStyle${parameterList}`, variableSubstitutionMap, - shaderState + shaderState, ); pointSizeStyleFunction = style.getPointSizeShaderFunction( `getPointSizeFromStyle${parameterList}`, variableSubstitutionMap, - shaderState + shaderState, ); if (defined(colorStyleFunction) && shaderState.translucent) { styleTranslucent = true; @@ -869,7 +870,7 @@ function createShaders(pointCloud, frameState, style) { if (usesNormalSemantic && !hasNormals) { throw new RuntimeError( - "Style references the NORMAL semantic but the point cloud does not have normals" + "Style references the NORMAL semantic but the point cloud does not have normals", ); } @@ -880,7 +881,7 @@ function createShaders(pointCloud, frameState, style) { const enabled = styleablePropertyIds.indexOf(attribute.location) >= 0; const vertexAttribute = getVertexAttribute( vertexArray, - attribute.location + attribute.location, ); vertexAttribute.enabled = enabled; } @@ -899,7 +900,7 @@ function createShaders(pointCloud, frameState, style) { // Disable the normal vertex attribute if normals are not used const normalVertexAttribute = getVertexAttribute( vertexArray, - normalLocation + normalLocation, ); normalVertexAttribute.enabled = usesNormals; } @@ -1127,7 +1128,7 @@ function createShaders(pointCloud, frameState, style) { fs += getClipAndStyleCode( "u_clippingPlanes", "u_clippingPlanesMatrix", - "u_clippingPlanesEdgeStyle" + "u_clippingPlanesEdgeStyle", ); } @@ -1163,7 +1164,7 @@ function createShaders(pointCloud, frameState, style) { } catch (error) { // Rephrase the error. throw new RuntimeError( - "Error generating style shader: this may be caused by a type mismatch, index out-of-bounds, or other syntax error." + "Error generating style shader: this may be caused by a type mismatch, index out-of-bounds, or other syntax error.", ); } } @@ -1207,10 +1208,10 @@ function decodeDraco(pointCloud, context) { pointCloud._quantizedVolumeScale = Cartesian3.fromElements( range, range, - range + range, ); pointCloud._quantizedVolumeOffset = Cartesian3.unpack( - quantization.minValues + quantization.minValues, ); pointCloud._quantizedRange = (1 << quantization.quantizationBits) - 1.0; @@ -1317,7 +1318,7 @@ PointCloud.prototype.update = function (frameState) { Matrix4.multiplyByTranslation( modelMatrix, this._quantizedVolumeOffset, - modelMatrix + modelMatrix, ); } @@ -1326,7 +1327,7 @@ PointCloud.prototype.update = function (frameState) { const translation = Matrix4.getColumn( modelMatrix, 3, - scratchComputedTranslation + scratchComputedTranslation, ); if (!Cartesian4.equals(translation, Cartesian4.UNIT_W)) { Transforms.basisTo2D(projection, modelMatrix, modelMatrix); diff --git a/packages/engine/Source/Scene/PointCloudEyeDomeLighting.js b/packages/engine/Source/Scene/PointCloudEyeDomeLighting.js index a4ef56deca6f..0b51dca79435 100644 --- a/packages/engine/Source/Scene/PointCloudEyeDomeLighting.js +++ b/packages/engine/Source/Scene/PointCloudEyeDomeLighting.js @@ -129,13 +129,13 @@ function getECShaderProgram(context, shaderProgram) { fs.sources.splice( 0, 0, - `layout (location = 0) out vec4 out_FragData_0;\nlayout (location = 1) out vec4 out_FragData_1;` + `layout (location = 0) out vec4 out_FragData_0;\nlayout (location = 1) out vec4 out_FragData_1;`, ); fs.sources = fs.sources.map(function (source) { source = ShaderSource.replaceMain( source, - "czm_point_cloud_post_process_main" + "czm_point_cloud_post_process_main", ); source = source.replaceAll(/out_FragColor/g, "out_FragData_0"); return source; @@ -151,7 +151,7 @@ function getECShaderProgram(context, shaderProgram) { "#else\n" + " out_FragData_1 = czm_packDepth(gl_FragCoord.z);\n" + "#endif\n" + - "}" + "}", ); shader = context.shaderCache.createDerivedShaderProgram( @@ -161,7 +161,7 @@ function getECShaderProgram(context, shaderProgram) { vertexShaderSource: shaderProgram.vertexShaderSource, fragmentShaderSource: fs, attributeLocations: attributeLocations, - } + }, ); } @@ -172,7 +172,7 @@ PointCloudEyeDomeLighting.prototype.update = function ( frameState, commandStart, pointCloudShading, - boundingVolume + boundingVolume, ) { if (!isSupported(frameState.context)) { return; @@ -219,7 +219,7 @@ PointCloudEyeDomeLighting.prototype.update = function ( derivedCommand.framebuffer = this.framebuffer; derivedCommand.shaderProgram = getECShaderProgram( frameState.context, - command.shaderProgram + command.shaderProgram, ); derivedCommand.castShadows = false; derivedCommand.receiveShadows = false; diff --git a/packages/engine/Source/Scene/PointCloudShading.js b/packages/engine/Source/Scene/PointCloudShading.js index 2a46b8fc75c0..23a85575ee65 100644 --- a/packages/engine/Source/Scene/PointCloudShading.js +++ b/packages/engine/Source/Scene/PointCloudShading.js @@ -36,7 +36,7 @@ function PointCloudShading(options) { */ this.geometricErrorScale = defaultValue( pointCloudShading.geometricErrorScale, - 1.0 + 1.0, ); /** @@ -70,7 +70,7 @@ function PointCloudShading(options) { */ this.eyeDomeLightingStrength = defaultValue( pointCloudShading.eyeDomeLightingStrength, - 1.0 + 1.0, ); /** @@ -80,7 +80,7 @@ function PointCloudShading(options) { */ this.eyeDomeLightingRadius = defaultValue( pointCloudShading.eyeDomeLightingRadius, - 1.0 + 1.0, ); /** diff --git a/packages/engine/Source/Scene/PointPrimitive.js b/packages/engine/Source/Scene/PointPrimitive.js index dfa57c8ed830..db93554292cc 100644 --- a/packages/engine/Source/Scene/PointPrimitive.js +++ b/packages/engine/Source/Scene/PointPrimitive.js @@ -50,7 +50,7 @@ function PointPrimitive(options, pointPrimitiveCollection) { options.disableDepthTestDistance < 0.0 ) { throw new DeveloperError( - "disableDepthTestDistance must be greater than or equal to 0.0." + "disableDepthTestDistance must be greater than or equal to 0.0.", ); } //>>includeEnd('debug'); @@ -62,7 +62,7 @@ function PointPrimitive(options, pointPrimitiveCollection) { //>>includeStart('debug', pragmas.debug); if (translucencyByDistance.far <= translucencyByDistance.near) { throw new DeveloperError( - "translucencyByDistance.far must be greater than translucencyByDistance.near." + "translucencyByDistance.far must be greater than translucencyByDistance.near.", ); } //>>includeEnd('debug'); @@ -72,7 +72,7 @@ function PointPrimitive(options, pointPrimitiveCollection) { //>>includeStart('debug', pragmas.debug); if (scaleByDistance.far <= scaleByDistance.near) { throw new DeveloperError( - "scaleByDistance.far must be greater than scaleByDistance.near." + "scaleByDistance.far must be greater than scaleByDistance.near.", ); } //>>includeEnd('debug'); @@ -82,23 +82,23 @@ function PointPrimitive(options, pointPrimitiveCollection) { //>>includeStart('debug', pragmas.debug); if (distanceDisplayCondition.far <= distanceDisplayCondition.near) { throw new DeveloperError( - "distanceDisplayCondition.far must be greater than distanceDisplayCondition.near." + "distanceDisplayCondition.far must be greater than distanceDisplayCondition.near.", ); } //>>includeEnd('debug'); distanceDisplayCondition = DistanceDisplayCondition.clone( - distanceDisplayCondition + distanceDisplayCondition, ); } this._show = defaultValue(options.show, true); this._position = Cartesian3.clone( - defaultValue(options.position, Cartesian3.ZERO) + defaultValue(options.position, Cartesian3.ZERO), ); this._actualPosition = Cartesian3.clone(this._position); // For columbus view and 2D this._color = Color.clone(defaultValue(options.color, Color.WHITE)); this._outlineColor = Color.clone( - defaultValue(options.outlineColor, Color.TRANSPARENT) + defaultValue(options.outlineColor, Color.TRANSPARENT), ); this._outlineWidth = defaultValue(options.outlineWidth, 0.0); this._pixelSize = defaultValue(options.pixelSize, 10.0); @@ -107,7 +107,7 @@ function PointPrimitive(options, pointPrimitiveCollection) { this._distanceDisplayCondition = distanceDisplayCondition; this._disableDepthTestDistance = defaultValue( options.disableDepthTestDistance, - 0.0 + 0.0, ); this._id = options.id; this._collection = defaultValue(options.collection, pointPrimitiveCollection); @@ -121,7 +121,7 @@ function PointPrimitive(options, pointPrimitiveCollection) { this._splitDirection = defaultValue( options.splitDirection, - SplitDirection.NONE + SplitDirection.NONE, ); } @@ -132,9 +132,12 @@ const OUTLINE_COLOR_INDEX = (PointPrimitive.OUTLINE_COLOR_INDEX = 3); const OUTLINE_WIDTH_INDEX = (PointPrimitive.OUTLINE_WIDTH_INDEX = 4); const PIXEL_SIZE_INDEX = (PointPrimitive.PIXEL_SIZE_INDEX = 5); const SCALE_BY_DISTANCE_INDEX = (PointPrimitive.SCALE_BY_DISTANCE_INDEX = 6); -const TRANSLUCENCY_BY_DISTANCE_INDEX = (PointPrimitive.TRANSLUCENCY_BY_DISTANCE_INDEX = 7); -const DISTANCE_DISPLAY_CONDITION_INDEX = (PointPrimitive.DISTANCE_DISPLAY_CONDITION_INDEX = 8); -const DISABLE_DEPTH_DISTANCE_INDEX = (PointPrimitive.DISABLE_DEPTH_DISTANCE_INDEX = 9); +const TRANSLUCENCY_BY_DISTANCE_INDEX = + (PointPrimitive.TRANSLUCENCY_BY_DISTANCE_INDEX = 7); +const DISTANCE_DISPLAY_CONDITION_INDEX = + (PointPrimitive.DISTANCE_DISPLAY_CONDITION_INDEX = 8); +const DISABLE_DEPTH_DISTANCE_INDEX = + (PointPrimitive.DISABLE_DEPTH_DISTANCE_INDEX = 9); const SPLIT_DIRECTION_INDEX = (PointPrimitive.SPLIT_DIRECTION_INDEX = 10); PointPrimitive.NUMBER_OF_PROPERTIES = 11; @@ -143,7 +146,7 @@ function makeDirty(pointPrimitive, propertyChanged) { if (defined(pointPrimitiveCollection)) { pointPrimitiveCollection._updatePointPrimitive( pointPrimitive, - propertyChanged + propertyChanged, ); pointPrimitive._dirty = true; } @@ -231,7 +234,7 @@ Object.defineProperties(PointPrimitive.prototype, { //>>includeStart('debug', pragmas.debug); if (defined(value) && value.far <= value.near) { throw new DeveloperError( - "far distance must be greater than near distance." + "far distance must be greater than near distance.", ); } //>>includeEnd('debug'); @@ -274,7 +277,7 @@ Object.defineProperties(PointPrimitive.prototype, { //>>includeStart('debug', pragmas.debug); if (defined(value) && value.far <= value.near) { throw new DeveloperError( - "far distance must be greater than near distance." + "far distance must be greater than near distance.", ); } //>>includeEnd('debug'); @@ -283,7 +286,7 @@ Object.defineProperties(PointPrimitive.prototype, { if (!NearFarScalar.equals(translucencyByDistance, value)) { this._translucencyByDistance = NearFarScalar.clone( value, - translucencyByDistance + translucencyByDistance, ); makeDirty(this, TRANSLUCENCY_BY_DISTANCE_INDEX); } @@ -417,7 +420,7 @@ Object.defineProperties(PointPrimitive.prototype, { ) { this._distanceDisplayCondition = DistanceDisplayCondition.clone( value, - this._distanceDisplayCondition + this._distanceDisplayCondition, ); makeDirty(this, DISTANCE_DISPLAY_CONDITION_INDEX); } @@ -440,7 +443,7 @@ Object.defineProperties(PointPrimitive.prototype, { //>>includeStart('debug', pragmas.debug); if (!defined(value) || value < 0.0) { throw new DeveloperError( - "disableDepthTestDistance must be greater than or equal to 0.0." + "disableDepthTestDistance must be greater than or equal to 0.0.", ); } //>>includeEnd('debug'); @@ -538,7 +541,7 @@ const tempCartesian3 = new Cartesian4(); PointPrimitive._computeActualPosition = function ( position, frameState, - modelMatrix + modelMatrix, ) { if (frameState.mode === SceneMode.SCENE3D) { return position; @@ -547,7 +550,7 @@ PointPrimitive._computeActualPosition = function ( Matrix4.multiplyByPoint(modelMatrix, position, tempCartesian3); return SceneTransforms.computeActualEllipsoidPosition( frameState, - tempCartesian3 + tempCartesian3, ); }; @@ -558,7 +561,7 @@ PointPrimitive._computeScreenSpacePosition = function ( modelMatrix, position, scene, - result + result, ) { // Model to world coordinates const positionWorld = Matrix4.multiplyByVector( @@ -568,14 +571,14 @@ PointPrimitive._computeScreenSpacePosition = function ( position.y, position.z, 1, - scratchCartesian4 + scratchCartesian4, ), - scratchCartesian4 + scratchCartesian4, ); const positionWC = SceneTransforms.worldToWindowCoordinates( scene, positionWorld, - result + result, ); return positionWC; }; @@ -614,7 +617,7 @@ PointPrimitive.prototype.computeScreenSpacePosition = function (scene, result) { modelMatrix, this._actualPosition, scene, - result + result, ); if (!defined(windowCoordinates)) { return undefined; @@ -636,7 +639,7 @@ PointPrimitive.prototype.computeScreenSpacePosition = function (scene, result) { PointPrimitive.getScreenSpaceBoundingBox = function ( point, screenSpacePosition, - result + result, ) { const size = point.pixelSize; const halfSize = size * 0.5; @@ -679,11 +682,11 @@ PointPrimitive.prototype.equals = function (other) { NearFarScalar.equals(this._scaleByDistance, other._scaleByDistance) && NearFarScalar.equals( this._translucencyByDistance, - other._translucencyByDistance + other._translucencyByDistance, ) && DistanceDisplayCondition.equals( this._distanceDisplayCondition, - other._distanceDisplayCondition + other._distanceDisplayCondition, ) && this._disableDepthTestDistance === other._disableDepthTestDistance && this._splitDirection === other._splitDirection) diff --git a/packages/engine/Source/Scene/PointPrimitiveCollection.js b/packages/engine/Source/Scene/PointPrimitiveCollection.js index 20ab1c5d6e1d..c49029fcc16a 100644 --- a/packages/engine/Source/Scene/PointPrimitiveCollection.js +++ b/packages/engine/Source/Scene/PointPrimitiveCollection.js @@ -170,7 +170,7 @@ function PointPrimitiveCollection(options) { * @see Transforms.eastNorthUpToFixedFrame */ this.modelMatrix = Matrix4.clone( - defaultValue(options.modelMatrix, Matrix4.IDENTITY) + defaultValue(options.modelMatrix, Matrix4.IDENTITY), ); this._modelMatrix = Matrix4.clone(Matrix4.IDENTITY); @@ -186,7 +186,7 @@ function PointPrimitiveCollection(options) { */ this.debugShowBoundingVolume = defaultValue( options.debugShowBoundingVolume, - false + false, ); /** @@ -199,7 +199,7 @@ function PointPrimitiveCollection(options) { */ this.blendOption = defaultValue( options.blendOption, - BlendOption.OPAQUE_AND_TRANSLUCENT + BlendOption.OPAQUE_AND_TRANSLUCENT, ); this._blendOption = undefined; @@ -380,12 +380,11 @@ function removePointPrimitives(pointPrimitiveCollection) { PointPrimitiveCollection.prototype._updatePointPrimitive = function ( pointPrimitive, - propertyChanged + propertyChanged, ) { if (!pointPrimitive._dirty) { - this._pointPrimitivesToUpdate[ - this._pointPrimitivesToUpdateIndex++ - ] = pointPrimitive; + this._pointPrimitivesToUpdate[this._pointPrimitivesToUpdateIndex++] = + pointPrimitive; } ++this._propertiesChanged[propertyChanged]; @@ -500,7 +499,7 @@ function createVAF(context, numberOfPointPrimitives, buffersUsage) { usage: buffersUsage[DISTANCE_DISPLAY_CONDITION_INDEX], }, ], - numberOfPointPrimitives + numberOfPointPrimitives, ); // 1 vertex per pointPrimitive } @@ -515,7 +514,7 @@ function writePositionSizeAndOutline( pointPrimitiveCollection, context, vafWriters, - pointPrimitive + pointPrimitive, ) { const i = pointPrimitive._index; const position = pointPrimitive._getActualPosition(); @@ -524,7 +523,7 @@ function writePositionSizeAndOutline( BoundingSphere.expand( pointPrimitiveCollection._baseVolume, position, - pointPrimitiveCollection._baseVolume + pointPrimitiveCollection._baseVolume, ); pointPrimitiveCollection._boundingVolumeDirty = true; } @@ -535,7 +534,7 @@ function writePositionSizeAndOutline( pointPrimitiveCollection._maxPixelSize = Math.max( pointPrimitiveCollection._maxPixelSize, - pixelSize + outlineWidth + pixelSize + outlineWidth, ); const positionHighWriter = vafWriters[attributeLocations.positionHighAndSize]; @@ -555,7 +554,7 @@ function writeCompressedAttrib0( pointPrimitiveCollection, context, vafWriters, - pointPrimitive + pointPrimitive, ) { const i = pointPrimitive._index; @@ -591,7 +590,7 @@ function writeCompressedAttrib1( pointPrimitiveCollection, context, vafWriters, - pointPrimitive + pointPrimitive, ) { const i = pointPrimitive._index; @@ -641,7 +640,7 @@ function writeScaleByDistance( pointPrimitiveCollection, context, vafWriters, - pointPrimitive + pointPrimitive, ) { const i = pointPrimitive._index; const writer = vafWriters[attributeLocations.scaleByDistance]; @@ -671,7 +670,7 @@ function writeDistanceDisplayConditionAndDepthDisableAndSplitDirection( pointPrimitiveCollection, context, vafWriters, - pointPrimitive + pointPrimitive, ) { const i = pointPrimitive._index; const writer = @@ -714,37 +713,37 @@ function writePointPrimitive( pointPrimitiveCollection, context, vafWriters, - pointPrimitive + pointPrimitive, ) { writePositionSizeAndOutline( pointPrimitiveCollection, context, vafWriters, - pointPrimitive + pointPrimitive, ); writeCompressedAttrib0( pointPrimitiveCollection, context, vafWriters, - pointPrimitive + pointPrimitive, ); writeCompressedAttrib1( pointPrimitiveCollection, context, vafWriters, - pointPrimitive + pointPrimitive, ); writeScaleByDistance( pointPrimitiveCollection, context, vafWriters, - pointPrimitive + pointPrimitive, ); writeDistanceDisplayConditionAndDepthDisableAndSplitDirection( pointPrimitiveCollection, context, vafWriters, - pointPrimitive + pointPrimitive, ); } @@ -754,7 +753,7 @@ function recomputeActualPositions( length, frameState, modelMatrix, - recomputeBoundingVolume + recomputeBoundingVolume, ) { let boundingVolume; if (frameState.mode === SceneMode.SCENE3D) { @@ -771,7 +770,7 @@ function recomputeActualPositions( const actualPosition = PointPrimitive._computeActualPosition( position, frameState, - modelMatrix + modelMatrix, ); if (defined(actualPosition)) { pointPrimitive._setActualPosition(actualPosition); @@ -818,7 +817,7 @@ function updateMode(pointPrimitiveCollection, frameState) { pointPrimitives.length, frameState, modelMatrix, - true + true, ); } } else if (mode === SceneMode.MORPHING) { @@ -828,7 +827,7 @@ function updateMode(pointPrimitiveCollection, frameState) { pointPrimitives.length, frameState, modelMatrix, - true + true, ); } else if (mode === SceneMode.SCENE2D || mode === SceneMode.COLUMBUS_VIEW) { recomputeActualPositions( @@ -837,7 +836,7 @@ function updateMode(pointPrimitiveCollection, frameState) { pointPrimitiveCollection._pointPrimitivesToUpdateIndex, frameState, modelMatrix, - false + false, ); } } @@ -846,7 +845,7 @@ function updateBoundingVolume(collection, frameState, boundingVolume) { const pixelSize = frameState.camera.getPixelSize( boundingVolume, frameState.context.drawingBufferWidth, - frameState.context.drawingBufferHeight + frameState.context.drawingBufferHeight, ); const size = pixelSize * collection._maxPixelSize; boundingVolume.radius += size; @@ -939,7 +938,7 @@ PointPrimitiveCollection.prototype.update = function (frameState) { properties[SPLIT_DIRECTION_INDEX] ) { writers.push( - writeDistanceDisplayConditionAndDepthDisableAndSplitDirection + writeDistanceDisplayConditionAndDepthDisableAndSplitDirection, ); } @@ -993,7 +992,7 @@ PointPrimitiveCollection.prototype.update = function (frameState) { BoundingSphere.transform( this._baseVolume, this.modelMatrix, - this._baseVolumeWC + this._baseVolumeWC, ); } @@ -1003,12 +1002,12 @@ PointPrimitiveCollection.prototype.update = function (frameState) { modelMatrix = this.modelMatrix; boundingVolume = BoundingSphere.clone( this._baseVolumeWC, - this._boundingVolume + this._boundingVolume, ); } else { boundingVolume = BoundingSphere.clone( this._baseVolume2D, - this._boundingVolume + this._boundingVolume, ); } updateBoundingVolume(this, frameState, boundingVolume); @@ -1134,8 +1133,10 @@ PointPrimitiveCollection.prototype.update = function (frameState) { } this._compiledShaderScaleByDistance = this._shaderScaleByDistance; - this._compiledShaderTranslucencyByDistance = this._shaderTranslucencyByDistance; - this._compiledShaderDistanceDisplayCondition = this._shaderDistanceDisplayCondition; + this._compiledShaderTranslucencyByDistance = + this._shaderTranslucencyByDistance; + this._compiledShaderDistanceDisplayCondition = + this._shaderDistanceDisplayCondition; this._compiledShaderDisableDepthDistance = this._shaderDisableDepthDistance; } diff --git a/packages/engine/Source/Scene/Polyline.js b/packages/engine/Source/Scene/Polyline.js index b8eda50752e0..3a070db7fc0d 100644 --- a/packages/engine/Source/Scene/Polyline.js +++ b/packages/engine/Source/Scene/Polyline.js @@ -57,7 +57,7 @@ function Polyline(options, polylineCollection) { this._positions = positions; this._actualPositions = arrayRemoveDuplicates( positions, - Cartesian3.equalsEpsilon + Cartesian3.equalsEpsilon, ); if (this._loop && this._actualPositions.length > 2) { @@ -78,7 +78,7 @@ function Polyline(options, polylineCollection) { this._modelMatrix = modelMatrix; this._segments = PolylinePipeline.wrapLongitude( this._actualPositions, - modelMatrix + modelMatrix, ); this._actualLength = undefined; @@ -91,7 +91,7 @@ function Polyline(options, polylineCollection) { this._boundingVolume = BoundingSphere.fromPoints(this._actualPositions); this._boundingVolumeWC = BoundingSphere.transform( this._boundingVolume, - this._modelMatrix + this._modelMatrix, ); this._boundingVolume2D = new BoundingSphere(); // modified in PolylineCollection } @@ -181,12 +181,12 @@ Object.defineProperties(Polyline.prototype, { this._length = positions.length; this._boundingVolume = BoundingSphere.fromPoints( this._actualPositions, - this._boundingVolume + this._boundingVolume, ); this._boundingVolumeWC = BoundingSphere.transform( this._boundingVolume, this._modelMatrix, - this._boundingVolumeWC + this._boundingVolumeWC, ); makeDirty(this, POSITION_INDEX); @@ -340,7 +340,7 @@ Object.defineProperties(Polyline.prototype, { //>>includeStart('debug', pragmas.debug); if (defined(value) && value.far <= value.near) { throw new DeveloperError( - "far distance must be greater than near distance." + "far distance must be greater than near distance.", ); } //>>includeEnd('debug'); @@ -349,7 +349,7 @@ Object.defineProperties(Polyline.prototype, { ) { this._distanceDisplayCondition = DistanceDisplayCondition.clone( value, - this._distanceDisplayCondition + this._distanceDisplayCondition, ); makeDirty(this, DISTANCE_DISPLAY_CONDITION); } @@ -375,12 +375,12 @@ Polyline.prototype.update = function () { if (!Matrix4.equals(modelMatrix, this._modelMatrix) || positionsChanged) { this._segments = PolylinePipeline.wrapLongitude( this._actualPositions, - modelMatrix + modelMatrix, ); this._boundingVolumeWC = BoundingSphere.transform( this._boundingVolume, modelMatrix, - this._boundingVolumeWC + this._boundingVolumeWC, ); } diff --git a/packages/engine/Source/Scene/PolylineCollection.js b/packages/engine/Source/Scene/PolylineCollection.js index 81973318e16e..5805ac5a9f02 100644 --- a/packages/engine/Source/Scene/PolylineCollection.js +++ b/packages/engine/Source/Scene/PolylineCollection.js @@ -135,7 +135,7 @@ function PolylineCollection(options) { * @default {@link Matrix4.IDENTITY} */ this.modelMatrix = Matrix4.clone( - defaultValue(options.modelMatrix, Matrix4.IDENTITY) + defaultValue(options.modelMatrix, Matrix4.IDENTITY), ); this._modelMatrix = Matrix4.clone(Matrix4.IDENTITY); @@ -151,7 +151,7 @@ function PolylineCollection(options) { */ this.debugShowBoundingVolume = defaultValue( options.debugShowBoundingVolume, - false + false, ); this._opaqueRS = undefined; @@ -402,7 +402,7 @@ function createBatchTable(collection, context) { collection._batchTable = new BatchTable( context, attributes, - collection._polylines.length + collection._polylines.length, ); } @@ -437,7 +437,7 @@ PolylineCollection.prototype.update = function (frameState) { if (this._createBatchTable) { if (ContextLimits.maximumVertexTextureImageUnits === 0) { throw new RuntimeError( - "Vertex texture fetch support is required to render polylines. The maximum number of vertex texture image units must be greater than zero." + "Vertex texture fetch support is required to render polylines. The maximum number of vertex texture image units must be greater than zero.", ); } createBatchTable(this, context); @@ -477,7 +477,7 @@ PolylineCollection.prototype.update = function (frameState) { index, polyline, this._positionBuffer, - projection + projection, ); } break; @@ -490,7 +490,7 @@ PolylineCollection.prototype.update = function (frameState) { this._batchTable.setBatchedAttribute( polyline._index, 0, - new Cartesian2(polyline._width, polyline._show) + new Cartesian2(polyline._width, polyline._show), ); } @@ -502,19 +502,19 @@ PolylineCollection.prototype.update = function (frameState) { : polyline._boundingVolumeWC; const encodedCenter = EncodedCartesian3.fromCartesian( boundingSphere.center, - scratchUpdatePolylineEncodedCartesian + scratchUpdatePolylineEncodedCartesian, ); const low = Cartesian4.fromElements( encodedCenter.low.x, encodedCenter.low.y, encodedCenter.low.z, boundingSphere.radius, - scratchUpdatePolylineCartesian4 + scratchUpdatePolylineCartesian4, ); this._batchTable.setBatchedAttribute( polyline._index, 2, - encodedCenter.high + encodedCenter.high, ); this._batchTable.setBatchedAttribute(polyline._index, 3, low); } @@ -533,7 +533,7 @@ PolylineCollection.prototype.update = function (frameState) { this._batchTable.setBatchedAttribute( polyline._index, 4, - nearFarCartesian + nearFarCartesian, ); } } @@ -598,7 +598,7 @@ function createCommandLists( polylineCollection, frameState, commands, - modelMatrix + modelMatrix, ) { const context = frameState.context; const commandList = frameState.commandList; @@ -653,12 +653,12 @@ function createCommandLists( uniformMap = combine( uniformCallback(currentMaterial._uniforms), - polylineCollection._uniformMap + polylineCollection._uniformMap, ); command.boundingVolume = BoundingSphere.clone( boundingSphereScratch, - command.boundingVolume + command.boundingVolume, ); command.modelMatrix = modelMatrix; command.shaderProgram = sp; @@ -704,7 +704,7 @@ function createCommandLists( if (defined(polyline._boundingVolume2D)) { boundingVolume = BoundingSphere.clone( polyline._boundingVolume2D, - boundingSphereScratch2 + boundingSphereScratch2, ); boundingVolume.center.x = 0.0; } @@ -715,7 +715,7 @@ function createCommandLists( boundingVolume = BoundingSphere.union( polyline._boundingVolumeWC, polyline._boundingVolume2D, - boundingSphereScratch2 + boundingSphereScratch2, ); } @@ -726,7 +726,7 @@ function createCommandLists( BoundingSphere.union( boundingVolume, boundingSphereScratch, - boundingSphereScratch + boundingSphereScratch, ); } } @@ -745,12 +745,12 @@ function createCommandLists( uniformMap = combine( uniformCallback(currentMaterial._uniforms), - polylineCollection._uniformMap + polylineCollection._uniformMap, ); command.boundingVolume = BoundingSphere.clone( boundingSphereScratch, - command.boundingVolume + command.boundingVolume, ); command.modelMatrix = modelMatrix; command.shaderProgram = sp; @@ -897,7 +897,7 @@ function createVertexArrays(collection, context, projection) { texCoordExpandAndBatchIndexIndex, batchTable, context, - projection + projection, ); if (mode === SceneMode.MORPHING) { @@ -915,7 +915,7 @@ function createVertexArrays(collection, context, projection) { totalIndices, vertexBufferOffset, vertexArrayBuckets, - offset + offset, ); } } @@ -1168,7 +1168,7 @@ function sortPolylinesIntoBuckets(collection) { value = polylineBuckets[material.type] = new PolylineBucket( material, mode, - modelMatrix + modelMatrix, ); } value.addPolyline(p); @@ -1236,7 +1236,7 @@ function destroyVertexArrays(collection) { PolylineCollection.prototype._updatePolyline = function ( polyline, - propertyChanged + propertyChanged, ) { this._polylinesUpdated = true; if (!polyline._dirty) { @@ -1281,7 +1281,7 @@ PolylineBucket.prototype.addPolyline = function (p) { PolylineBucket.prototype.updateShader = function ( context, batchTable, - useHighlightColor + useHighlightColor, ) { if (defined(this.shaderProgram)) { return; @@ -1362,7 +1362,7 @@ PolylineBucket.prototype.write = function ( texCoordExpandAndBatchIndexIndex, batchTable, context, - projection + projection, ) { const mode = this.mode; const maxLon = projection.ellipsoid.maximumRadius * CesiumMath.PI; @@ -1409,7 +1409,7 @@ PolylineBucket.prototype.write = function ( Cartesian3.subtract( positions[positionsLength - 1], positions[positionsLength - 2], - position + position, ); Cartesian3.add(positions[positionsLength - 1], position, position); } @@ -1464,17 +1464,17 @@ PolylineBucket.prototype.write = function ( EncodedCartesian3.writeElements( scratchWritePosition, positionArray, - positionIndex + positionIndex, ); EncodedCartesian3.writeElements( scratchWritePrevPosition, positionArray, - positionIndex + 6 + positionIndex + 6, ); EncodedCartesian3.writeElements( scratchWriteNextPosition, positionArray, - positionIndex + 12 + positionIndex + 12, ); const direction = k - 2 < 0 ? -1.0 : 1.0; @@ -1482,12 +1482,10 @@ PolylineBucket.prototype.write = function ( j / (positionsLength - 1); // s tex coord texCoordExpandAndBatchIndexArray[texCoordExpandAndBatchIndexIndex + 1] = 2 * (k % 2) - 1; // expand direction - texCoordExpandAndBatchIndexArray[ - texCoordExpandAndBatchIndexIndex + 2 - ] = direction; - texCoordExpandAndBatchIndexArray[ - texCoordExpandAndBatchIndexIndex + 3 - ] = polylineBatchIndex; + texCoordExpandAndBatchIndexArray[texCoordExpandAndBatchIndexIndex + 2] = + direction; + texCoordExpandAndBatchIndexArray[texCoordExpandAndBatchIndexIndex + 3] = + polylineBatchIndex; positionIndex += 6 * 3; texCoordExpandAndBatchIndexIndex += 4; @@ -1510,7 +1508,7 @@ PolylineBucket.prototype.write = function ( : polyline._boundingVolumeWC; const encodedCenter = EncodedCartesian3.fromCartesian( boundingSphere.center, - scratchUpdatePolylineEncodedCartesian + scratchUpdatePolylineEncodedCartesian, ); const high = encodedCenter.high; const low = Cartesian4.fromElements( @@ -1518,7 +1516,7 @@ PolylineBucket.prototype.write = function ( encodedCenter.low.y, encodedCenter.low.z, boundingSphere.radius, - scratchUpdatePolylineCartesian4 + scratchUpdatePolylineCartesian4, ); const nearFarCartesian = scratchNearFarCartesian2; @@ -1549,7 +1547,7 @@ const morphVectorScratch = new Cartesian3(); PolylineBucket.prototype.writeForMorph = function ( positionArray, - positionIndex + positionIndex, ) { const modelMatrix = this.modelMatrix; const polylines = this.polylines; @@ -1580,13 +1578,13 @@ PolylineBucket.prototype.writeForMorph = function ( prevPosition = Matrix4.multiplyByPoint( modelMatrix, prevPosition, - morphPrevPositionScratch + morphPrevPositionScratch, ); const position = Matrix4.multiplyByPoint( modelMatrix, positions[j], - morphPositionScratch + morphPositionScratch, ); let nextPosition; @@ -1598,12 +1596,12 @@ PolylineBucket.prototype.writeForMorph = function ( Cartesian3.subtract( positions[positionsLength - 1], positions[positionsLength - 2], - nextPosition + nextPosition, ); Cartesian3.add( positions[positionsLength - 1], nextPosition, - nextPosition + nextPosition, ); } } else { @@ -1613,7 +1611,7 @@ PolylineBucket.prototype.writeForMorph = function ( nextPosition = Matrix4.multiplyByPoint( modelMatrix, nextPosition, - morphNextPositionScratch + morphNextPositionScratch, ); const segmentLength = lengths[segmentIndex]; @@ -1633,12 +1631,12 @@ PolylineBucket.prototype.writeForMorph = function ( EncodedCartesian3.writeElements( prevPosition, positionArray, - positionIndex + 6 + positionIndex + 6, ); EncodedCartesian3.writeElements( nextPosition, positionArray, - positionIndex + 12 + positionIndex + 12, ); positionIndex += 6 * 3; @@ -1653,7 +1651,7 @@ PolylineBucket.prototype.updateIndices = function ( totalIndices, vertexBufferOffset, vertexArrayBuckets, - offset + offset, ) { let vaCount = vertexArrayBuckets.length - 1; let bucketLocator = new VertexArrayBucketLocator(0, offset, this); @@ -1787,21 +1785,21 @@ PolylineBucket.prototype.getSegments = function (polyline, projection) { p = Matrix4.multiplyByPoint(modelMatrix, position, p); newPositions.push( projection.project( - ellipsoid.cartesianToCartographic(p, scratchCartographic) - ) + ellipsoid.cartesianToCartographic(p, scratchCartographic), + ), ); } if (newPositions.length > 0) { polyline._boundingVolume2D = BoundingSphere.fromPoints( newPositions, - polyline._boundingVolume2D + polyline._boundingVolume2D, ); const center2D = polyline._boundingVolume2D.center; polyline._boundingVolume2D.center = new Cartesian3( center2D.z, center2D.x, - center2D.y + center2D.y, ); } @@ -1816,7 +1814,7 @@ PolylineBucket.prototype.writeUpdate = function ( index, polyline, positionBuffer, - projection + projection, ) { const mode = this.mode; const maxLon = projection.ellipsoid.maximumRadius * CesiumMath.PI; @@ -1833,13 +1831,13 @@ PolylineBucket.prototype.writeUpdate = function ( positionArray.length < positionsArrayLength ) { positionArray = scratchPositionsArray = new Float32Array( - positionsArrayLength + positionsArrayLength, ); } else if (positionArray.length > positionsArrayLength) { positionArray = new Float32Array( positionArray.buffer, 0, - positionsArrayLength + positionsArrayLength, ); } @@ -1877,7 +1875,7 @@ PolylineBucket.prototype.writeUpdate = function ( Cartesian3.subtract( positions[positionsLength - 1], positions[positionsLength - 2], - position + position, ); Cartesian3.add(positions[positionsLength - 1], position, position); } @@ -1932,17 +1930,17 @@ PolylineBucket.prototype.writeUpdate = function ( EncodedCartesian3.writeElements( scratchWritePosition, positionArray, - positionIndex + positionIndex, ); EncodedCartesian3.writeElements( scratchWritePrevPosition, positionArray, - positionIndex + 6 + positionIndex + 6, ); EncodedCartesian3.writeElements( scratchWriteNextPosition, positionArray, - positionIndex + 12 + positionIndex + 12, ); positionIndex += 6 * 3; } @@ -1950,7 +1948,7 @@ PolylineBucket.prototype.writeUpdate = function ( positionBuffer.copyFromArrayView( positionArray, - 6 * 3 * Float32Array.BYTES_PER_ELEMENT * index + 6 * 3 * Float32Array.BYTES_PER_ELEMENT * index, ); } }; diff --git a/packages/engine/Source/Scene/PolylineColorAppearance.js b/packages/engine/Source/Scene/PolylineColorAppearance.js index 27c577fa1b7c..1bb49df68936 100644 --- a/packages/engine/Source/Scene/PolylineColorAppearance.js +++ b/packages/engine/Source/Scene/PolylineColorAppearance.js @@ -78,16 +78,16 @@ function PolylineColorAppearance(options) { this._vertexShaderSource = defaultValue( options.vertexShaderSource, - defaultVertexShaderSource + defaultVertexShaderSource, ); this._fragmentShaderSource = defaultValue( options.fragmentShaderSource, - defaultFragmentShaderSource + defaultFragmentShaderSource, ); this._renderState = Appearance.getDefaultRenderState( translucent, closed, - options.renderState + options.renderState, ); this._closed = closed; diff --git a/packages/engine/Source/Scene/PolylineMaterialAppearance.js b/packages/engine/Source/Scene/PolylineMaterialAppearance.js index 0f048aa81ea2..d47e73d2bb6c 100644 --- a/packages/engine/Source/Scene/PolylineMaterialAppearance.js +++ b/packages/engine/Source/Scene/PolylineMaterialAppearance.js @@ -80,16 +80,16 @@ function PolylineMaterialAppearance(options) { this._vertexShaderSource = defaultValue( options.vertexShaderSource, - defaultVertexShaderSource + defaultVertexShaderSource, ); this._fragmentShaderSource = defaultValue( options.fragmentShaderSource, - defaultFragmentShaderSource + defaultFragmentShaderSource, ); this._renderState = Appearance.getDefaultRenderState( translucent, closed, - options.renderState + options.renderState, ); this._closed = closed; diff --git a/packages/engine/Source/Scene/PostProcessStage.js b/packages/engine/Source/Scene/PostProcessStage.js index ab05093b5c67..925d908c731e 100644 --- a/packages/engine/Source/Scene/PostProcessStage.js +++ b/packages/engine/Source/Scene/PostProcessStage.js @@ -103,7 +103,7 @@ function PostProcessStage(options) { Check.typeOf.number.lessThanOrEquals( "options.textureScale", textureScale, - 1.0 + 1.0, ); if (!PixelFormat.isColorFormat(pixelFormat)) { throw new DeveloperError("options.pixelFormat must be a color format."); @@ -116,12 +116,12 @@ function PostProcessStage(options) { this._forcePowerOfTwo = defaultValue(options.forcePowerOfTwo, false); this._sampleMode = defaultValue( options.sampleMode, - PostProcessStageSampleMode.NEAREST + PostProcessStageSampleMode.NEAREST, ); this._pixelFormat = pixelFormat; this._pixelDatatype = defaultValue( options.pixelDatatype, - PixelDatatype.UNSIGNED_BYTE + PixelDatatype.UNSIGNED_BYTE, ); this._clearColor = defaultValue(options.clearColor, Color.BLACK); @@ -490,7 +490,7 @@ function createUniformMap(stage) { newUniforms[name] = getUniformValueGetterAndSetter( stage, uniforms, - name + name, ); } else { uniformMap[name] = uniforms[name]; @@ -509,7 +509,7 @@ function createUniformMap(stage) { ) { uniformMap[`${name}Dimensions`] = getUniformMapDimensionsFunction( uniformMap, - name + name, ); } } @@ -681,13 +681,12 @@ function updateUniformTextures(stage, context) { for (i = 0; i < length; ++i) { name = dirtyUniforms[i]; const stageNameUrlOrImage = uniforms[name]; - const stageWithName = stage._textureCache.getStageByName( - stageNameUrlOrImage - ); + const stageWithName = + stage._textureCache.getStageByName(stageNameUrlOrImage); if (defined(stageWithName)) { stage._actualUniforms[name] = createStageOutputTextureFunction( stage, - stageNameUrlOrImage + stageNameUrlOrImage, ); } else if (typeof stageNameUrlOrImage === "string") { const resource = new Resource({ @@ -695,7 +694,7 @@ function updateUniformTextures(stage, context) { }); promises.push( - resource.fetchImage().then(createLoadImageFunction(stage, name)) + resource.fetchImage().then(createLoadImageFunction(stage, name)), ); } else { stage._texturesToCreate.push({ @@ -937,7 +936,7 @@ PostProcessStage.prototype.update = function (context, useLogDepth) { 0, 0, colorTexture.width, - colorTexture.height + colorTexture.height, ), }); } @@ -958,7 +957,7 @@ PostProcessStage.prototype.execute = function ( context, colorTexture, depthTexture, - idTexture + idTexture, ) { if ( !defined(this._command) || diff --git a/packages/engine/Source/Scene/PostProcessStageCollection.js b/packages/engine/Source/Scene/PostProcessStageCollection.js index 10cfeb5be476..505213addec8 100644 --- a/packages/engine/Source/Scene/PostProcessStageCollection.js +++ b/packages/engine/Source/Scene/PostProcessStageCollection.js @@ -347,29 +347,32 @@ Object.defineProperties(PostProcessStageCollection.prototype, { switch (value) { case Tonemapper.REINHARD: - tonemapping = PostProcessStageLibrary.createReinhardTonemappingStage( - useAutoExposure - ); + tonemapping = + PostProcessStageLibrary.createReinhardTonemappingStage( + useAutoExposure, + ); break; case Tonemapper.MODIFIED_REINHARD: - tonemapping = PostProcessStageLibrary.createModifiedReinhardTonemappingStage( - useAutoExposure - ); + tonemapping = + PostProcessStageLibrary.createModifiedReinhardTonemappingStage( + useAutoExposure, + ); break; case Tonemapper.FILMIC: - tonemapping = PostProcessStageLibrary.createFilmicTonemappingStage( - useAutoExposure - ); + tonemapping = + PostProcessStageLibrary.createFilmicTonemappingStage( + useAutoExposure, + ); break; case Tonemapper.PBR_NEUTRAL: - tonemapping = PostProcessStageLibrary.createPbrNeutralTonemappingStage( - useAutoExposure - ); + tonemapping = + PostProcessStageLibrary.createPbrNeutralTonemappingStage( + useAutoExposure, + ); break; default: - tonemapping = PostProcessStageLibrary.createAcesTonemappingStage( - useAutoExposure - ); + tonemapping = + PostProcessStageLibrary.createAcesTonemappingStage(useAutoExposure); break; } @@ -457,7 +460,7 @@ PostProcessStageCollection.prototype.add = function (stage) { //>>includeStart('debug', pragmas.debug); if (defined(stageNames[currentStage.name])) { throw new DeveloperError( - `${currentStage.name} has already been added to the collection or does not have a unique name.` + `${currentStage.name} has already been added to the collection or does not have a unique name.`, ); } //>>includeEnd('debug'); @@ -582,7 +585,7 @@ PostProcessStageCollection.prototype.getStageByName = function (name) { PostProcessStageCollection.prototype.update = function ( context, useLogDepth, - useHdr + useHdr, ) { removeStages(this); @@ -763,7 +766,7 @@ function execute(stage, context, colorTexture, depthTexture, idTexture) { context, getOutputTexture(stage.get(i - 1)), depthTexture, - idTexture + idTexture, ); } } else { @@ -787,7 +790,7 @@ PostProcessStageCollection.prototype.execute = function ( context, colorTexture, depthTexture, - idTexture + idTexture, ) { const activeStages = this._activeStages; const length = activeStages.length; @@ -841,7 +844,7 @@ PostProcessStageCollection.prototype.execute = function ( context, getOutputTexture(activeStages[i - 1]), depthTexture, - idTexture + idTexture, ); } lastTexture = getOutputTexture(activeStages[length - 1]); diff --git a/packages/engine/Source/Scene/PostProcessStageComposite.js b/packages/engine/Source/Scene/PostProcessStageComposite.js index bcea9587afa0..6745ac7546d5 100644 --- a/packages/engine/Source/Scene/PostProcessStageComposite.js +++ b/packages/engine/Source/Scene/PostProcessStageComposite.js @@ -81,14 +81,14 @@ function PostProcessStageComposite(options) { Check.typeOf.number.greaterThan( "options.stages.length", options.stages.length, - 0 + 0, ); //>>includeEnd('debug'); this._stages = options.stages; this._inputPreviousStageTexture = defaultValue( options.inputPreviousStageTexture, - true + true, ); let name = options.name; diff --git a/packages/engine/Source/Scene/PostProcessStageLibrary.js b/packages/engine/Source/Scene/PostProcessStageLibrary.js index 18aaa1d974b5..f4329daee77f 100644 --- a/packages/engine/Source/Scene/PostProcessStageLibrary.js +++ b/packages/engine/Source/Scene/PostProcessStageLibrary.js @@ -661,7 +661,7 @@ PostProcessStageLibrary.createFXAAStage = function () { * @private */ PostProcessStageLibrary.createAcesTonemappingStage = function ( - useAutoExposure + useAutoExposure, ) { let fs = useAutoExposure ? "#define AUTO_EXPOSURE\n" : ""; fs += AcesTonemapping; @@ -682,7 +682,7 @@ PostProcessStageLibrary.createAcesTonemappingStage = function ( * @private */ PostProcessStageLibrary.createFilmicTonemappingStage = function ( - useAutoExposure + useAutoExposure, ) { let fs = useAutoExposure ? "#define AUTO_EXPOSURE\n" : ""; fs += FilmicTonemapping; @@ -703,7 +703,7 @@ PostProcessStageLibrary.createFilmicTonemappingStage = function ( * @private */ PostProcessStageLibrary.createPbrNeutralTonemappingStage = function ( - useAutoExposure + useAutoExposure, ) { let fs = useAutoExposure ? "#define AUTO_EXPOSURE\n" : ""; fs += PbrNeutralTonemapping; @@ -724,7 +724,7 @@ PostProcessStageLibrary.createPbrNeutralTonemappingStage = function ( * @private */ PostProcessStageLibrary.createReinhardTonemappingStage = function ( - useAutoExposure + useAutoExposure, ) { let fs = useAutoExposure ? "#define AUTO_EXPOSURE\n" : ""; fs += ReinhardTonemapping; @@ -745,7 +745,7 @@ PostProcessStageLibrary.createReinhardTonemappingStage = function ( * @private */ PostProcessStageLibrary.createModifiedReinhardTonemappingStage = function ( - useAutoExposure + useAutoExposure, ) { let fs = useAutoExposure ? "#define AUTO_EXPOSURE\n" : ""; fs += ModifiedReinhardTonemapping; diff --git a/packages/engine/Source/Scene/PostProcessStageTextureCache.js b/packages/engine/Source/Scene/PostProcessStageTextureCache.js index cdc6e21a3986..391b7dd3aff6 100644 --- a/packages/engine/Source/Scene/PostProcessStageTextureCache.js +++ b/packages/engine/Source/Scene/PostProcessStageTextureCache.js @@ -38,7 +38,7 @@ function getStageDependencies( context, dependencies, stage, - previousName + previousName, ) { if (!stage.enabled || !stage._isSupported(context)) { return previousName; @@ -72,7 +72,7 @@ function getCompositeDependencies( context, dependencies, composite, - previousName + previousName, ) { if ( (defined(composite.enabled) && !composite.enabled) || @@ -96,7 +96,7 @@ function getCompositeDependencies( context, dependencies, stage, - previousName + previousName, ); } else { currentName = getStageDependencies( @@ -104,7 +104,7 @@ function getCompositeDependencies( context, dependencies, stage, - previousName + previousName, ); } // Stages in a series only depend on the previous stage @@ -153,28 +153,28 @@ function getDependencies(collection, context) { context, dependencies, ao, - undefined + undefined, ); previousName = getCompositeDependencies( collection, context, dependencies, bloom, - previousName + previousName, ); previousName = getStageDependencies( collection, context, dependencies, tonemapping, - previousName + previousName, ); previousName = getCompositeDependencies( collection, context, dependencies, collection, - previousName + previousName, ); getStageDependencies(collection, context, dependencies, fxaa, previousName); } else { @@ -183,7 +183,7 @@ function getDependencies(collection, context) { context, dependencies, collection, - undefined + undefined, ); } @@ -262,7 +262,7 @@ function createFramebuffers(cache, context) { cache._stageNameToFramebuffer[stageName] = getFramebuffer( cache, stageName, - dependencies[stageName] + dependencies[stageName], ); } } diff --git a/packages/engine/Source/Scene/Primitive.js b/packages/engine/Source/Scene/Primitive.js index f1128facaa7a..5b9f38b70526 100644 --- a/packages/engine/Source/Scene/Primitive.js +++ b/packages/engine/Source/Scene/Primitive.js @@ -225,7 +225,7 @@ function Primitive(options) { * p.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(origin); */ this.modelMatrix = Matrix4.clone( - defaultValue(options.modelMatrix, Matrix4.IDENTITY) + defaultValue(options.modelMatrix, Matrix4.IDENTITY), ); this._modelMatrix = new Matrix4(); @@ -243,7 +243,7 @@ function Primitive(options) { this._interleave = defaultValue(options.interleave, false); this._releaseGeometryInstances = defaultValue( options.releaseGeometryInstances, - true + true, ); this._allowPicking = defaultValue(options.allowPicking, true); this._asynchronous = defaultValue(options.asynchronous, true); @@ -272,7 +272,7 @@ function Primitive(options) { */ this.debugShowBoundingVolume = defaultValue( options.debugShowBoundingVolume, - false + false, ); /** @@ -288,7 +288,7 @@ function Primitive(options) { this.geometryInstances.length !== 1)) ) { throw new DeveloperError( - "Relative-to-center rendering only supports one geometry instance." + "Relative-to-center rendering only supports one geometry instance.", ); } //>>includeEnd('debug'); @@ -607,7 +607,7 @@ function createBatchTable(primitive, context) { functionName: "czm_batchTable_boundingSphereRadius", componentDatatype: ComponentDatatype.FLOAT, componentsPerAttribute: 1, - } + }, ); boundingSphereAttributeIndices.center3DHigh = attributes.length - 5; boundingSphereAttributeIndices.center3DLow = attributes.length - 4; @@ -670,7 +670,8 @@ function createBatchTable(primitive, context) { primitive._batchTable = batchTable; primitive._batchTableAttributeIndices = attributeIndices; - primitive._batchTableBoundingSphereAttributeIndices = boundingSphereAttributeIndices; + primitive._batchTableBoundingSphereAttributeIndices = + boundingSphereAttributeIndices; primitive._batchTableOffsetAttribute2DIndex = offset2DIndex; } @@ -731,7 +732,7 @@ const positionRegex = /in\s+vec(?:3|4)\s+(.*)3DHigh;/g; Primitive._modifyShaderPosition = function ( primitive, vertexShaderSource, - scene3DOnly + scene3DOnly, ) { let match; @@ -743,7 +744,7 @@ Primitive._modifyShaderPosition = function ( const name = match[1]; const functionName = `vec4 czm_compute${name[0].toUpperCase()}${name.substr( - 1 + 1, )}()`; // Don't forward-declare czm_computePosition because computePosition.glsl already does. @@ -788,11 +789,11 @@ Primitive._modifyShaderPosition = function ( // Use RTC vertexShaderSource = vertexShaderSource.replace( /in\s+vec(?:3|4)\s+position3DHigh;/g, - "" + "", ); vertexShaderSource = vertexShaderSource.replace( /in\s+vec(?:3|4)\s+position3DLow;/g, - "" + "", ); forwardDecl += "uniform mat4 u_modifiedModelView;\n"; @@ -806,17 +807,17 @@ Primitive._modifyShaderPosition = function ( vertexShaderSource = vertexShaderSource.replace( /czm_modelViewRelativeToEye\s+\*\s+/g, - "" + "", ); vertexShaderSource = vertexShaderSource.replace( /czm_modelViewProjectionRelativeToEye/g, - "czm_projection" + "czm_projection", ); } } return [forwardDecl, attributes, vertexShaderSource, computeFunctions].join( - "\n" + "\n", ); }; @@ -827,7 +828,7 @@ Primitive._appendShowToShader = function (primitive, vertexShaderSource) { const renamedVS = ShaderSource.replaceMain( vertexShaderSource, - "czm_non_show_main" + "czm_non_show_main", ); const showMain = "void main() \n" + @@ -842,7 +843,7 @@ Primitive._appendShowToShader = function (primitive, vertexShaderSource) { Primitive._updateColorAttribute = function ( primitive, vertexShaderSource, - isDepthFail + isDepthFail, ) { // some appearances have a color attribute for per vertex color. // only remove if color is a per instance attribute. @@ -863,7 +864,7 @@ Primitive._updateColorAttribute = function ( !defined(primitive._batchTableAttributeIndices.depthFailColor) ) { throw new DeveloperError( - "A depthFailColor per-instance attribute is required when using a depth fail appearance that uses a color attribute." + "A depthFailColor per-instance attribute is required when using a depth fail appearance that uses a color attribute.", ); } //>>includeEnd('debug'); @@ -873,12 +874,12 @@ Primitive._updateColorAttribute = function ( if (!isDepthFail) { modifiedVS = modifiedVS.replace( /(\b)color(\b)/g, - "$1czm_batchTable_color(batchId)$2" + "$1czm_batchTable_color(batchId)$2", ); } else { modifiedVS = modifiedVS.replace( /(\b)color(\b)/g, - "$1czm_batchTable_depthFailColor(batchId)$2" + "$1czm_batchTable_depthFailColor(batchId)$2", ); } return modifiedVS; @@ -905,7 +906,7 @@ Primitive._updatePickColorAttribute = function (source) { let vsPick = source.replace(/in\s+vec4\s+pickColor;/g, ""); vsPick = vsPick.replace( /(\b)pickColor(\b)/g, - "$1czm_batchTable_pickColor(batchId)$2" + "$1czm_batchTable_pickColor(batchId)$2", ); return vsPick; }; @@ -919,7 +920,7 @@ Primitive._appendOffsetToShader = function (primitive, vertexShaderSource) { attr += "in float applyOffset;"; let modifiedShader = vertexShaderSource.replace( /in\s+float\s+batchId;/g, - attr + attr, ); let str = "vec4 $1 = czm_computePosition();\n"; @@ -935,7 +936,7 @@ Primitive._appendOffsetToShader = function (primitive, vertexShaderSource) { str += " }\n"; modifiedShader = modifiedShader.replace( /vec4\s+([A-Za-z0-9_]+)\s+=\s+czm_computePosition\(\);/g, - str + str, ); return modifiedShader; }; @@ -943,7 +944,7 @@ Primitive._appendOffsetToShader = function (primitive, vertexShaderSource) { Primitive._appendDistanceDisplayConditionToShader = function ( primitive, vertexShaderSource, - scene3DOnly + scene3DOnly, ) { if ( !defined(primitive._batchTableAttributeIndices.distanceDisplayCondition) @@ -953,7 +954,7 @@ Primitive._appendDistanceDisplayConditionToShader = function ( const renamedVS = ShaderSource.replaceMain( vertexShaderSource, - "czm_non_distanceDisplayCondition_main" + "czm_non_distanceDisplayCondition_main", ); let distanceDisplayConditionMain = "void main() \n" + @@ -1088,7 +1089,7 @@ function modifyForEncodedNormals(primitive, vertexShaderSource) { function depthClampVS(vertexShaderSource) { let modifiedVS = ShaderSource.replaceMain( vertexShaderSource, - "czm_non_depth_clamp_main" + "czm_non_depth_clamp_main", ); modifiedVS += "void main() {\n" + @@ -1101,7 +1102,7 @@ function depthClampVS(vertexShaderSource) { function depthClampFS(fragmentShaderSource) { let modifiedFS = ShaderSource.replaceMain( fragmentShaderSource, - "czm_non_depth_clamp_main" + "czm_non_depth_clamp_main", ); modifiedFS += "void main() {\n" + @@ -1132,7 +1133,7 @@ function validateShaderMatching(shaderProgram, attributeLocations) { if (shaderAttributes.hasOwnProperty(name)) { if (!defined(attributeLocations[name])) { throw new DeveloperError( - `Appearance/Geometry mismatch. The appearance requires vertex shader attribute input '${name}', which was not computed as part of the Geometry. Use the appearance's vertexFormat property when constructing the geometry.` + `Appearance/Geometry mismatch. The appearance requires vertex shader attribute input '${name}', which was not computed as part of the Geometry. Use the appearance's vertexFormat property when constructing the geometry.`, ); } } @@ -1148,7 +1149,7 @@ function getUniformFunction(uniforms, name) { const numberOfCreationWorkers = Math.max( FeatureDetection.hardwareConcurrency - 1, - 1 + 1, ); let createGeometryTaskProcessors; const combineGeometryTaskProcessor = new TaskProcessor("combineGeometry"); @@ -1179,7 +1180,7 @@ function loadAsynchronous(primitive, frameState) { (!defined(geometry._workerName) && !defined(geometry._workerPath)) ) { throw new DeveloperError( - "Must define either _workerName or _workerPath for asynchronous geometry." + "Must define either _workerName or _workerPath for asynchronous geometry.", ); } //>>includeEnd('debug'); @@ -1212,7 +1213,7 @@ function loadAsynchronous(primitive, frameState) { subTask.offset = packedLength; packedLength += defaultValue( geometry.constructor.packedLength, - geometry.packedLength + geometry.packedLength, ); } } @@ -1238,8 +1239,8 @@ function loadAsynchronous(primitive, frameState) { { subTasks: subTasks[i], }, - subTaskTransferableObjects - ) + subTaskTransferableObjects, + ), ); } @@ -1276,9 +1277,9 @@ function loadAsynchronous(primitive, frameState) { modelMatrix: primitive.modelMatrix, createPickOffsets: primitive._createPickOffsets, }, - transferableObjects + transferableObjects, ), - transferableObjects + transferableObjects, ); primitive._createGeometryResults = undefined; @@ -1286,14 +1287,13 @@ function loadAsynchronous(primitive, frameState) { Promise.resolve(promise) .then(function (packedResult) { - const result = PrimitivePipeline.unpackCombineGeometryResults( - packedResult - ); + const result = + PrimitivePipeline.unpackCombineGeometryResults(packedResult); primitive._geometries = result.geometries; primitive._attributeLocations = result.attributeLocations; primitive.modelMatrix = Matrix4.clone( result.modelMatrix, - primitive.modelMatrix + primitive.modelMatrix, ); primitive._pickOffsets = result.pickOffsets; primitive._offsetInstanceExtend = result.offsetInstanceExtend; @@ -1364,7 +1364,7 @@ function loadSynchronous(primitive, frameState) { primitive._attributeLocations = result.attributeLocations; primitive.modelMatrix = Matrix4.clone( result.modelMatrix, - primitive.modelMatrix + primitive.modelMatrix, ); primitive._pickOffsets = result.pickOffsets; primitive._offsetInstanceExtend = result.offsetInstanceExtend; @@ -1403,7 +1403,7 @@ function recomputeBoundingSpheres(primitive, frameState) { const offset = primitive._batchTable.getBatchedAttribute( i, offsetIndex, - new Cartesian3() + new Cartesian3(), ); newBS = boundingSpheres[i].clone(newBS); transformBoundingSphere(newBS, offset, offsetInstanceExtend[i]); @@ -1458,7 +1458,7 @@ function recomputeBoundingSpheres(primitive, frameState) { primitive._boundingSphereCV[i] = BoundingSphere.projectTo2D( boundingSphere, frameState.mapProjection, - primitive._boundingSphereCV[i] + primitive._boundingSphereCV[i], ); } @@ -1466,7 +1466,7 @@ function recomputeBoundingSpheres(primitive, frameState) { primitive, frameState, primitive.modelMatrix, - true + true, ); primitive._recomputeBoundingSpheres = false; } @@ -1478,7 +1478,7 @@ const scratchBoundingSphere = new BoundingSphere(); function updateBatchTableBoundingSpheres(primitive, frameState) { const hasDistanceDisplayCondition = defined( - primitive._batchTableAttributeIndices.distanceDisplayCondition + primitive._batchTableAttributeIndices.distanceDisplayCondition, ); if ( !hasDistanceDisplayCondition || @@ -1512,7 +1512,7 @@ function updateBatchTableBoundingSpheres(primitive, frameState) { boundingSphere = BoundingSphere.transform( boundingSphere, modelMatrix, - scratchBoundingSphere + scratchBoundingSphere, ); } @@ -1521,7 +1521,7 @@ function updateBatchTableBoundingSpheres(primitive, frameState) { let encodedCenter = EncodedCartesian3.fromCartesian( center, - scratchBoundingSphereCenterEncoded + scratchBoundingSphereCenterEncoded, ); batchTable.setBatchedAttribute(i, center3DHighIndex, encodedCenter.high); batchTable.setBatchedAttribute(i, center3DLowIndex, encodedCenter.low); @@ -1529,15 +1529,15 @@ function updateBatchTableBoundingSpheres(primitive, frameState) { if (!frameState.scene3DOnly) { const cartographic = ellipsoid.cartesianToCartographic( center, - scratchBoundingSphereCartographic + scratchBoundingSphereCartographic, ); const center2D = projection.project( cartographic, - scratchBoundingSphereCenter2D + scratchBoundingSphereCenter2D, ); encodedCenter = EncodedCartesian3.fromCartesian( center2D, - scratchBoundingSphereCenterEncoded + scratchBoundingSphereCenterEncoded, ); batchTable.setBatchedAttribute(i, center2DHighIndex, encodedCenter.high); batchTable.setBatchedAttribute(i, center2DLowIndex, encodedCenter.low); @@ -1577,7 +1577,7 @@ function updateBatchTableOffsets(primitive, frameState) { } const offset = batchTable.getBatchedAttribute( i, - primitive._batchTableAttributeIndices.offset + primitive._batchTableAttributeIndices.offset, ); if (Cartesian3.equals(offset, Cartesian3.ZERO)) { batchTable.setBatchedAttribute(i, index2D, Cartesian3.ZERO); @@ -1589,7 +1589,7 @@ function updateBatchTableOffsets(primitive, frameState) { boundingSphere = BoundingSphere.transform( boundingSphere, modelMatrix, - scratchBoundingSphere + scratchBoundingSphere, ); } @@ -1597,11 +1597,11 @@ function updateBatchTableOffsets(primitive, frameState) { center = ellipsoid.scaleToGeodeticSurface(center, offsetCenterScratch); let cartographic = ellipsoid.cartesianToCartographic( center, - scratchBoundingSphereCartographic + scratchBoundingSphereCartographic, ); const center2D = projection.project( cartographic, - scratchBoundingSphereCenter2D + scratchBoundingSphereCenter2D, ); const newPoint = Cartesian3.add(offset, center, offsetScratchCartesian); @@ -1609,13 +1609,13 @@ function updateBatchTableOffsets(primitive, frameState) { const newPointProjected = projection.project( cartographic, - offsetScratchCartesian + offsetScratchCartesian, ); const newVector = Cartesian3.subtract( newPointProjected, center2D, - offsetScratchCartesian + offsetScratchCartesian, ); const x = newVector.x; @@ -1647,14 +1647,14 @@ function createVertexArray(primitive, frameState) { attributeLocations: attributeLocations, bufferUsage: BufferUsage.STATIC_DRAW, interleave: primitive._interleave, - }) + }), ); if (defined(primitive._createBoundingVolumeFunction)) { primitive._createBoundingVolumeFunction(frameState, geometry); } else { primitive._boundingSpheres.push( - BoundingSphere.clone(geometry.boundingSphere) + BoundingSphere.clone(geometry.boundingSphere), ); primitive._boundingSphereWC.push(new BoundingSphere()); @@ -1668,7 +1668,7 @@ function createVertexArray(primitive, frameState) { center.z = y; primitive._boundingSphereCV.push( - BoundingSphere.clone(geometry.boundingSphereCV) + BoundingSphere.clone(geometry.boundingSphereCV), ); primitive._boundingSphere2D.push(new BoundingSphere()); primitive._boundingSphereMorph.push(new BoundingSphere()); @@ -1737,14 +1737,14 @@ function createShaderProgram(primitive, frameState, appearance) { const attributeLocations = primitive._attributeLocations; let vs = primitive._batchTable.getVertexShaderCallback()( - appearance.vertexShaderSource + appearance.vertexShaderSource, ); vs = Primitive._appendOffsetToShader(primitive, vs); vs = Primitive._appendShowToShader(primitive, vs); vs = Primitive._appendDistanceDisplayConditionToShader( primitive, vs, - frameState.scene3DOnly + frameState.scene3DOnly, ); vs = appendPickToVertexShader(vs); vs = Primitive._updateColorAttribute(primitive, vs, false); @@ -1764,13 +1764,13 @@ function createShaderProgram(primitive, frameState, appearance) { if (defined(primitive._depthFailAppearance)) { vs = primitive._batchTable.getVertexShaderCallback()( - primitive._depthFailAppearance.vertexShaderSource + primitive._depthFailAppearance.vertexShaderSource, ); vs = Primitive._appendShowToShader(primitive, vs); vs = Primitive._appendDistanceDisplayConditionToShader( primitive, vs, - frameState.scene3DOnly + frameState.scene3DOnly, ); vs = appendPickToVertexShader(vs); vs = Primitive._updateColorAttribute(primitive, vs, true); @@ -1809,14 +1809,14 @@ function getUniforms(primitive, appearance, material, frameState) { if (defined(materialUniformMap) && defined(materialUniformMap[name])) { // Later, we could rename uniforms behind-the-scenes if needed. throw new DeveloperError( - `Appearance and material have a uniform with the same name: ${name}` + `Appearance and material have a uniform with the same name: ${name}`, ); } //>>includeEnd('debug'); appearanceUniformMap[name] = getUniformFunction( appearanceUniforms, - name + name, ); } } @@ -1830,17 +1830,17 @@ function getUniforms(primitive, appearance, material, frameState) { Matrix4.multiply( viewMatrix, primitive._modelMatrix, - modifiedModelViewScratch + modifiedModelViewScratch, ); Matrix4.multiplyByPoint( modifiedModelViewScratch, primitive.rtcCenter, - rtcScratch + rtcScratch, ); Matrix4.setTranslation( modifiedModelViewScratch, rtcScratch, - modifiedModelViewScratch + modifiedModelViewScratch, ); return modifiedModelViewScratch; }; @@ -1857,7 +1857,7 @@ function createCommands( twoPasses, colorCommands, pickCommands, - frameState + frameState, ) { const uniforms = getUniforms(primitive, appearance, material, frameState); @@ -1867,7 +1867,7 @@ function createCommands( primitive, primitive._depthFailAppearance, primitive._depthFailAppearance.material, - frameState + frameState, ); } @@ -1954,7 +1954,7 @@ Primitive._updateBoundingVolumes = function ( primitive, frameState, modelMatrix, - forceUpdate + forceUpdate, ) { let i; let length; @@ -1969,17 +1969,17 @@ Primitive._updateBoundingVolumes = function ( primitive._boundingSphereWC[i] = BoundingSphere.transform( boundingSphere, modelMatrix, - primitive._boundingSphereWC[i] + primitive._boundingSphereWC[i], ); if (!frameState.scene3DOnly) { primitive._boundingSphere2D[i] = BoundingSphere.clone( primitive._boundingSphereCV[i], - primitive._boundingSphere2D[i] + primitive._boundingSphere2D[i], ); primitive._boundingSphere2D[i].center.x = 0.0; primitive._boundingSphereMorph[i] = BoundingSphere.union( primitive._boundingSphereWC[i], - primitive._boundingSphereCV[i] + primitive._boundingSphereCV[i], ); } } @@ -1997,7 +1997,7 @@ Primitive._updateBoundingVolumes = function ( const pixelSizeInMeters = frameState.camera.getPixelSize( boundingSphere, frameState.context.drawingBufferWidth, - frameState.context.drawingBufferHeight + frameState.context.drawingBufferHeight, ); const sizeInMeters = pixelSizeInMeters * pixelSize; boundingSphereWC.radius = boundingSphere.radius + sizeInMeters; @@ -2013,7 +2013,7 @@ function updateAndQueueCommands( modelMatrix, cull, debugShowBoundingVolume, - twoPasses + twoPasses, ) { //>>includeStart('debug', pragmas.debug); if ( @@ -2021,7 +2021,7 @@ function updateAndQueueCommands( !Matrix4.equals(modelMatrix, Matrix4.IDENTITY) ) { throw new DeveloperError( - "Primitive.modelMatrix is only supported in 3D mode." + "Primitive.modelMatrix is only supported in 3D mode.", ); } //>>includeEnd('debug'); @@ -2107,7 +2107,7 @@ Primitive.prototype.update = function (frameState) { //>>includeStart('debug', pragmas.debug); if (defined(this.rtcCenter) && !frameState.scene3DOnly) { throw new DeveloperError( - "RTC rendering is only available for 3D only scenes." + "RTC rendering is only available for 3D only scenes.", ); } //>>includeEnd('debug'); @@ -2123,7 +2123,7 @@ Primitive.prototype.update = function (frameState) { if (this._batchTable.attributes.length > 0) { if (ContextLimits.maximumVertexTextureImageUnits === 0) { throw new RuntimeError( - "Vertex texture fetch support is required to render primitives with per-instance attributes. The maximum number of vertex texture image units must be greater than zero." + "Vertex texture fetch support is required to render primitives with per-instance attributes. The maximum number of vertex texture image units must be greater than zero.", ); } this._batchTable.update(frameState); @@ -2203,7 +2203,7 @@ Primitive.prototype.update = function (frameState) { if (createRS) { const rsFunc = defaultValue( this._createRenderStatesFunction, - createRenderStates + createRenderStates, ); rsFunc(this, context, appearance, twoPasses); } @@ -2211,7 +2211,7 @@ Primitive.prototype.update = function (frameState) { if (createSP) { const spFunc = defaultValue( this._createShaderProgramFunction, - createShaderProgram + createShaderProgram, ); spFunc(this, frameState, appearance); } @@ -2219,7 +2219,7 @@ Primitive.prototype.update = function (frameState) { if (createRS || createSP) { const commandFunc = defaultValue( this._createCommandsFunction, - createCommands + createCommands, ); commandFunc( this, @@ -2229,13 +2229,13 @@ Primitive.prototype.update = function (frameState) { twoPasses, this._colorCommands, this._pickCommands, - frameState + frameState, ); } const updateAndQueueCommandsFunc = defaultValue( this._updateAndQueueCommandsFunction, - updateAndQueueCommands + updateAndQueueCommands, ); updateAndQueueCommandsFunc( this, @@ -2245,7 +2245,7 @@ Primitive.prototype.update = function (frameState) { this.modelMatrix, this.cull, this.debugShowBoundingVolume, - twoPasses + twoPasses, ); }; @@ -2255,11 +2255,11 @@ function transformBoundingSphere(boundingSphere, offset, offsetAttribute) { if (offsetAttribute === GeometryOffsetAttribute.TOP) { const origBS = BoundingSphere.clone( boundingSphere, - offsetBoundingSphereScratch1 + offsetBoundingSphereScratch1, ); const offsetBS = BoundingSphere.clone( boundingSphere, - offsetBoundingSphereScratch2 + offsetBoundingSphereScratch2, ); offsetBS.center = Cartesian3.add(offsetBS.center, offset, offsetBS.center); boundingSphere = BoundingSphere.union(origBS, offsetBS, boundingSphere); @@ -2267,7 +2267,7 @@ function transformBoundingSphere(boundingSphere, offset, offsetAttribute) { boundingSphere.center = Cartesian3.add( boundingSphere.center, offset, - boundingSphere.center + boundingSphere.center, ); } @@ -2278,13 +2278,13 @@ function createGetFunction(batchTable, instanceIndex, attributeIndex) { return function () { const attributeValue = batchTable.getBatchedAttribute( instanceIndex, - attributeIndex + attributeIndex, ); const attribute = batchTable.attributes[attributeIndex]; const componentsPerAttribute = attribute.componentsPerAttribute; const value = ComponentDatatype.createTypedArray( attribute.componentDatatype, - componentsPerAttribute + componentsPerAttribute, ); if (defined(attributeValue.constructor.pack)) { attributeValue.constructor.pack(attributeValue, value, 0); @@ -2300,7 +2300,7 @@ function createSetFunction( instanceIndex, attributeIndex, primitive, - name + name, ) { return function (value) { //>>includeStart('debug', pragmas.debug); @@ -2311,7 +2311,7 @@ function createSetFunction( value.length > 4 ) { throw new DeveloperError( - "value must be and array with length between 1 and 4." + "value must be and array with length between 1 and 4.", ); } //>>includeEnd('debug'); @@ -2319,7 +2319,7 @@ function createSetFunction( batchTable.setBatchedAttribute( instanceIndex, attributeIndex, - attributeValue + attributeValue, ); if (name === "offset") { primitive._recomputeBoundingSpheres = true; @@ -2342,13 +2342,13 @@ function createBoundingSphereProperties(primitive, properties, index) { transformBoundingSphere( boundingSphere, Cartesian3.fromArray(offset.get(), 0, offsetScratch), - primitive._offsetInstanceExtend[index] + primitive._offsetInstanceExtend[index], ); } if (defined(modelMatrix)) { boundingSphere = BoundingSphere.transform( boundingSphere, - modelMatrix + modelMatrix, ); } } @@ -2393,7 +2393,7 @@ Primitive.prototype.getGeometryInstanceAttributes = function (id) { } if (!defined(this._batchTable)) { throw new DeveloperError( - "must call update before calling getGeometryInstanceAttributes" + "must call update before calling getGeometryInstanceAttributes", ); } //>>includeEnd('debug'); diff --git a/packages/engine/Source/Scene/PrimitiveCollection.js b/packages/engine/Source/Scene/PrimitiveCollection.js index c28e0ed24c2b..4dc20383fc36 100644 --- a/packages/engine/Source/Scene/PrimitiveCollection.js +++ b/packages/engine/Source/Scene/PrimitiveCollection.js @@ -142,7 +142,7 @@ PrimitiveCollection.prototype.add = function (primitive, index) { throw new DeveloperError("index must be greater than or equal to zero."); } else if (index > this._primitives.length) { throw new DeveloperError( - "index must be less than or equal to the number of primitives." + "index must be less than or equal to the number of primitives.", ); } } diff --git a/packages/engine/Source/Scene/PrimitiveLoadPlan.js b/packages/engine/Source/Scene/PrimitiveLoadPlan.js index 31d1f5928f5f..40e7c0e7a4df 100644 --- a/packages/engine/Source/Scene/PrimitiveLoadPlan.js +++ b/packages/engine/Source/Scene/PrimitiveLoadPlan.js @@ -196,7 +196,7 @@ function generateOutlines(loadPlan) { // The outline generator creates a new attribute for the outline coordinates // that are used with a lookup texture. const outlineCoordinates = makeOutlineCoordinatesAttribute( - generator.outlineCoordinates + generator.outlineCoordinates, ); const outlineCoordinatesPlan = new AttributeLoadPlan(outlineCoordinates); outlineCoordinatesPlan.loadBuffer = true; diff --git a/packages/engine/Source/Scene/PrimitivePipeline.js b/packages/engine/Source/Scene/PrimitivePipeline.js index fa1312ee8406..f90dd5058a95 100644 --- a/packages/engine/Source/Scene/PrimitivePipeline.js +++ b/packages/engine/Source/Scene/PrimitivePipeline.js @@ -17,7 +17,7 @@ import WebMercatorProjection from "../Core/WebMercatorProjection.js"; function transformToWorldCoordinates( instances, primitiveModelMatrix, - scene3DOnly + scene3DOnly, ) { let toWorld = !scene3DOnly; const length = instances.length; @@ -45,7 +45,7 @@ function transformToWorldCoordinates( Matrix4.multiplyTransformation( primitiveModelMatrix, instances[0].modelMatrix, - primitiveModelMatrix + primitiveModelMatrix, ); } } @@ -113,7 +113,7 @@ function geometryPipeline(parameters) { instances[i].geometry.primitiveType !== primitiveType ) { throw new DeveloperError( - "All instance geometries must have the same primitiveType." + "All instance geometries must have the same primitiveType.", ); } } @@ -145,17 +145,17 @@ function geometryPipeline(parameters) { defined(instance.eastHemisphereGeometry) ) { GeometryPipeline.reorderForPostVertexCache( - instance.westHemisphereGeometry + instance.westHemisphereGeometry, ); GeometryPipeline.reorderForPreVertexCache( - instance.westHemisphereGeometry + instance.westHemisphereGeometry, ); GeometryPipeline.reorderForPostVertexCache( - instance.eastHemisphereGeometry + instance.eastHemisphereGeometry, ); GeometryPipeline.reorderForPreVertexCache( - instance.eastHemisphereGeometry + instance.eastHemisphereGeometry, ); } } @@ -185,11 +185,11 @@ function geometryPipeline(parameters) { name, name3D, name2D, - projection + projection, ); if (defined(geometry.boundingSphere) && name === "position") { geometry.boundingSphereCV = BoundingSphere.fromVertices( - geometry.attributes.position2D.values + geometry.attributes.position2D.values, ); } @@ -197,13 +197,13 @@ function geometryPipeline(parameters) { geometry, name3D, `${name3D}High`, - `${name3D}Low` + `${name3D}Low`, ); GeometryPipeline.encodeAttribute( geometry, name2D, `${name2D}High`, - `${name2D}Low` + `${name2D}Low`, ); } } @@ -217,7 +217,7 @@ function geometryPipeline(parameters) { geometry, name, `${name}3DHigh`, - `${name}3DLow` + `${name}3DLow`, ); } } @@ -236,7 +236,7 @@ function geometryPipeline(parameters) { for (i = 0; i < length; ++i) { geometry = geometries[i]; splitGeometries = splitGeometries.concat( - GeometryPipeline.fitToUnsignedShortIndices(geometry) + GeometryPipeline.fitToUnsignedShortIndices(geometry), ); } @@ -294,13 +294,13 @@ function createInstancePickOffsets(instances, geometries) { instances, "westHemisphereGeometry", geometries, - pickOffsets + pickOffsets, ); createPickOffsets( instances, "eastHemisphereGeometry", geometries, - pickOffsets + pickOffsets, ); return pickOffsets; } @@ -326,7 +326,7 @@ PrimitivePipeline.combineGeometry = function (parameters) { geometries = geometryPipeline(parameters); if (geometries.length > 0) { attributeLocations = GeometryPipeline.createAttributeLocations( - geometries[0] + geometries[0], ); if (parameters.createPickOffsets) { pickOffsets = createInstancePickOffsets(instances, geometries); @@ -363,7 +363,7 @@ PrimitivePipeline.combineGeometry = function (parameters) { ) { boundingSpheres[i] = BoundingSphere.union( eastHemisphereGeometry.boundingSphere, - westHemisphereGeometry.boundingSphere + westHemisphereGeometry.boundingSphere, ); } if ( @@ -372,7 +372,7 @@ PrimitivePipeline.combineGeometry = function (parameters) { ) { boundingSpheresCV[i] = BoundingSphere.union( eastHemisphereGeometry.boundingSphereCV, - westHemisphereGeometry.boundingSphereCV + westHemisphereGeometry.boundingSphereCV, ); } } @@ -451,7 +451,7 @@ function countCreateGeometryResults(items) { */ PrimitivePipeline.packCreateGeometryResults = function ( items, - transferableObjects + transferableObjects, ) { const packedData = new Float64Array(countCreateGeometryResults(items)); const stringTable = []; @@ -543,7 +543,7 @@ PrimitivePipeline.packCreateGeometryResults = function ( * @private */ PrimitivePipeline.unpackCreateGeometryResults = function ( - createGeometryResult + createGeometryResult, ) { const stringTable = createGeometryResult.stringTable; const packedGeometry = createGeometryResult.packedData; @@ -574,7 +574,7 @@ PrimitivePipeline.unpackCreateGeometryResults = function ( if (validBoundingSphere) { boundingSphere = BoundingSphere.unpack( packedGeometry, - packedGeometryIndex + packedGeometryIndex, ); } @@ -584,7 +584,7 @@ PrimitivePipeline.unpackCreateGeometryResults = function ( if (validBoundingSphereCV) { boundingSphereCV = BoundingSphere.unpack( packedGeometry, - packedGeometryIndex + packedGeometryIndex, ); } @@ -677,7 +677,7 @@ function unpackInstancesForCombine(data) { offset: new OffsetGeometryInstanceAttribute( packedInstances[i], packedInstances[i + 1], - packedInstances[i + 2] + packedInstances[i + 2], ), }; } @@ -697,7 +697,7 @@ function unpackInstancesForCombine(data) { */ PrimitivePipeline.packCombineGeometryParameters = function ( parameters, - transferableObjects + transferableObjects, ) { const createGeometryResults = parameters.createGeometryResults; const length = createGeometryResults.length; @@ -710,7 +710,7 @@ PrimitivePipeline.packCombineGeometryParameters = function ( createGeometryResults: parameters.createGeometryResults, packedInstances: packInstancesForCombine( parameters.instances, - transferableObjects + transferableObjects, ), ellipsoid: parameters.ellipsoid, isGeographic: parameters.projection instanceof GeographicProjection, @@ -727,7 +727,7 @@ PrimitivePipeline.packCombineGeometryParameters = function ( * @private */ PrimitivePipeline.unpackCombineGeometryParameters = function ( - packedParameters + packedParameters, ) { const instances = unpackInstancesForCombine(packedParameters.packedInstances); const createGeometryResults = packedParameters.createGeometryResults; @@ -736,7 +736,7 @@ PrimitivePipeline.unpackCombineGeometryParameters = function ( for (let resultIndex = 0; resultIndex < length; resultIndex++) { const geometries = PrimitivePipeline.unpackCreateGeometryResults( - createGeometryResults[resultIndex] + createGeometryResults[resultIndex], ); const geometriesLength = geometries.length; for ( @@ -812,7 +812,7 @@ function unpackBoundingSpheres(buffer) { */ PrimitivePipeline.packCombineGeometryResults = function ( results, - transferableObjects + transferableObjects, ) { if (defined(results.geometries)) { transferGeometries(results.geometries, transferableObjects); @@ -820,11 +820,11 @@ PrimitivePipeline.packCombineGeometryResults = function ( const packedBoundingSpheres = packBoundingSpheres(results.boundingSpheres); const packedBoundingSpheresCV = packBoundingSpheres( - results.boundingSpheresCV + results.boundingSpheresCV, ); transferableObjects.push( packedBoundingSpheres.buffer, - packedBoundingSpheresCV.buffer + packedBoundingSpheresCV.buffer, ); return { diff --git a/packages/engine/Source/Scene/PropertyTable.js b/packages/engine/Source/Scene/PropertyTable.js index 19860c82de18..cbb73b3cfd9b 100644 --- a/packages/engine/Source/Scene/PropertyTable.js +++ b/packages/engine/Source/Scene/PropertyTable.js @@ -298,21 +298,21 @@ PropertyTable.prototype.getPropertyIds = function (index, results) { // concat in place to avoid unnecessary array allocation results.push.apply( results, - this._metadataTable.getPropertyIds(scratchResults) + this._metadataTable.getPropertyIds(scratchResults), ); } if (defined(this._batchTableHierarchy)) { results.push.apply( results, - this._batchTableHierarchy.getPropertyIds(index, scratchResults) + this._batchTableHierarchy.getPropertyIds(index, scratchResults), ); } if (defined(this._jsonMetadataTable)) { results.push.apply( results, - this._jsonMetadataTable.getPropertyIds(scratchResults) + this._jsonMetadataTable.getPropertyIds(scratchResults), ); } @@ -434,7 +434,7 @@ PropertyTable.prototype.getPropertyBySemantic = function (index, semantic) { PropertyTable.prototype.setPropertyBySemantic = function ( index, semantic, - value + value, ) { if (defined(this._metadataTable)) { return this._metadataTable.setPropertyBySemantic(index, semantic, value); @@ -497,7 +497,7 @@ function checkFeatureId(featureId, featuresLength) { if (!defined(featureId) || featureId < 0 || featureId >= featuresLength) { throw new DeveloperError( `featureId is required and must be between zero and featuresLength - 1 (${featuresLength}` - - +")." + +").", ); } } diff --git a/packages/engine/Source/Scene/QuadtreePrimitive.js b/packages/engine/Source/Scene/QuadtreePrimitive.js index 66ed2109ca30..545b7ecde978 100644 --- a/packages/engine/Source/Scene/QuadtreePrimitive.js +++ b/packages/engine/Source/Scene/QuadtreePrimitive.js @@ -47,7 +47,7 @@ function QuadtreePrimitive(options) { } if (defined(options.tileProvider.quadtree)) { throw new DeveloperError( - "A QuadtreeTileProvider can only be used with a single QuadtreePrimitive" + "A QuadtreeTileProvider can only be used with a single QuadtreePrimitive", ); } //>>includeEnd('debug'); @@ -110,7 +110,7 @@ function QuadtreePrimitive(options) { */ this.maximumScreenSpaceError = defaultValue( options.maximumScreenSpaceError, - 2 + 2, ); /** @@ -395,7 +395,7 @@ function updateTileLoadProgress(primitive, frameState) { ) { const raiseEvent = Event.prototype.raiseEvent.bind( primitive._tileLoadProgressEvent, - currentLoadQueueLength + currentLoadQueueLength, ); frameState.afterRender.push(() => { raiseEvent(); @@ -420,7 +420,7 @@ function updateTileLoadProgress(primitive, frameState) { debug.maxDepthVisited !== debug.lastMaxDepthVisited ) { console.log( - `Visited ${debug.tilesVisited}, Rendered: ${debug.tilesRendered}, Culled: ${debug.tilesCulled}, Max Depth Rendered: ${debug.maxDepth}, Max Depth Visited: ${debug.maxDepthVisited}, Waiting for children: ${debug.tilesWaitingForChildren}` + `Visited ${debug.tilesVisited}, Rendered: ${debug.tilesRendered}, Culled: ${debug.tilesCulled}, Max Depth Rendered: ${debug.maxDepth}, Max Depth Visited: ${debug.maxDepthVisited}, Waiting for children: ${debug.tilesWaitingForChildren}`, ); debug.lastTilesVisited = debug.tilesVisited; @@ -523,9 +523,8 @@ function selectTilesForRendering(primitive, frameState) { const tilingScheme = tileProvider.tilingScheme; if (defined(tilingScheme)) { const tilingScheme = tileProvider.tilingScheme; - primitive._levelZeroTiles = QuadtreeTile.createLevelZeroTiles( - tilingScheme - ); + primitive._levelZeroTiles = + QuadtreeTile.createLevelZeroTiles(tilingScheme); const numberOfRootTiles = primitive._levelZeroTiles.length; if (rootTraversalDetails.length < numberOfRootTiles) { rootTraversalDetails = new Array(numberOfRootTiles); @@ -573,12 +572,13 @@ function selectTilesForRendering(primitive, frameState) { primitive._cameraPositionCartographic = camera.positionCartographic; const cameraFrameOrigin = Matrix4.getTranslation( camera.transform, - cameraOriginScratch - ); - primitive._cameraReferenceFrameOriginCartographic = primitive.tileProvider.tilingScheme.ellipsoid.cartesianToCartographic( - cameraFrameOrigin, - primitive._cameraReferenceFrameOriginCartographic + cameraOriginScratch, ); + primitive._cameraReferenceFrameOriginCartographic = + primitive.tileProvider.tilingScheme.ellipsoid.cartesianToCartographic( + cameraFrameOrigin, + primitive._cameraReferenceFrameOriginCartographic, + ); // Traverse in depth-first, near-to-far order. for (i = 0, len = levelZeroTiles.length; i < len; ++i) { @@ -595,7 +595,7 @@ function selectTilesForRendering(primitive, frameState) { frameState, occluders, false, - rootTraversalDetails[i] + rootTraversalDetails[i], ); } } @@ -611,7 +611,7 @@ function queueTileLoad(primitive, queue, tile, frameState) { if (primitive.tileProvider.computeTileLoadPriority !== undefined) { tile._loadPriority = primitive.tileProvider.computeTileLoadPriority( tile, - frameState + frameState, ); } queue.push(tile); @@ -713,7 +713,7 @@ function visitTile( frameState, tile, ancestorMeetsSse, - traversalDetails + traversalDetails, ) { const debug = primitive._debug; @@ -787,7 +787,7 @@ function visitTile( primitive, primitive._tileLoadQueueMedium, tile, - frameState + frameState, ); } addTileToRenderList(primitive, tile); @@ -838,7 +838,7 @@ function visitTile( primitive, primitive._tileLoadQueueMedium, tile, - frameState + frameState, ); // Make sure we don't unload the children and forget they're upsampled. @@ -882,7 +882,7 @@ function visitTile( northeastChild, frameState, ancestorMeetsSse, - traversalDetails + traversalDetails, ); // If no descendant tiles were added to the render list by the function above, it means they were all @@ -912,7 +912,7 @@ function visitTile( workTile !== tile ) { workTile._lastSelectionResult = TileSelectionResult.kick( - workTile._lastSelectionResult + workTile._lastSelectionResult, ); workTile = workTile.parent; } @@ -942,7 +942,7 @@ function visitTile( primitive, primitive._tileLoadQueueMedium, tile, - frameState + frameState, ); traversalDetails.notYetRenderableCount = tile.renderable ? 0 : 1; queuedForLoad = true; @@ -991,7 +991,7 @@ function visitVisibleChildrenNearToFar( northeast, frameState, ancestorMeetsSse, - traversalDetails + traversalDetails, ) { const cameraPosition = frameState.camera.positionCartographic; const tileProvider = primitive._tileProvider; @@ -1013,7 +1013,7 @@ function visitVisibleChildrenNearToFar( frameState, occluders, ancestorMeetsSse, - southwestDetails + southwestDetails, ); visitIfVisible( primitive, @@ -1022,7 +1022,7 @@ function visitVisibleChildrenNearToFar( frameState, occluders, ancestorMeetsSse, - southeastDetails + southeastDetails, ); visitIfVisible( primitive, @@ -1031,7 +1031,7 @@ function visitVisibleChildrenNearToFar( frameState, occluders, ancestorMeetsSse, - northwestDetails + northwestDetails, ); visitIfVisible( primitive, @@ -1040,7 +1040,7 @@ function visitVisibleChildrenNearToFar( frameState, occluders, ancestorMeetsSse, - northeastDetails + northeastDetails, ); } else { // Camera in northwest quadrant @@ -1051,7 +1051,7 @@ function visitVisibleChildrenNearToFar( frameState, occluders, ancestorMeetsSse, - northwestDetails + northwestDetails, ); visitIfVisible( primitive, @@ -1060,7 +1060,7 @@ function visitVisibleChildrenNearToFar( frameState, occluders, ancestorMeetsSse, - southwestDetails + southwestDetails, ); visitIfVisible( primitive, @@ -1069,7 +1069,7 @@ function visitVisibleChildrenNearToFar( frameState, occluders, ancestorMeetsSse, - northeastDetails + northeastDetails, ); visitIfVisible( primitive, @@ -1078,7 +1078,7 @@ function visitVisibleChildrenNearToFar( frameState, occluders, ancestorMeetsSse, - southeastDetails + southeastDetails, ); } } else if (cameraPosition.latitude < southwest.rectangle.north) { @@ -1090,7 +1090,7 @@ function visitVisibleChildrenNearToFar( frameState, occluders, ancestorMeetsSse, - southeastDetails + southeastDetails, ); visitIfVisible( primitive, @@ -1099,7 +1099,7 @@ function visitVisibleChildrenNearToFar( frameState, occluders, ancestorMeetsSse, - southwestDetails + southwestDetails, ); visitIfVisible( primitive, @@ -1108,7 +1108,7 @@ function visitVisibleChildrenNearToFar( frameState, occluders, ancestorMeetsSse, - northeastDetails + northeastDetails, ); visitIfVisible( primitive, @@ -1117,7 +1117,7 @@ function visitVisibleChildrenNearToFar( frameState, occluders, ancestorMeetsSse, - northwestDetails + northwestDetails, ); } else { // Camera in northeast quadrant @@ -1128,7 +1128,7 @@ function visitVisibleChildrenNearToFar( frameState, occluders, ancestorMeetsSse, - northeastDetails + northeastDetails, ); visitIfVisible( primitive, @@ -1137,7 +1137,7 @@ function visitVisibleChildrenNearToFar( frameState, occluders, ancestorMeetsSse, - northwestDetails + northwestDetails, ); visitIfVisible( primitive, @@ -1146,7 +1146,7 @@ function visitVisibleChildrenNearToFar( frameState, occluders, ancestorMeetsSse, - southeastDetails + southeastDetails, ); visitIfVisible( primitive, @@ -1155,7 +1155,7 @@ function visitVisibleChildrenNearToFar( frameState, occluders, ancestorMeetsSse, - southwestDetails + southwestDetails, ); } @@ -1170,7 +1170,7 @@ function containsNeededPosition(primitive, tile) { (defined(primitive._cameraReferenceFrameOriginCartographic) && Rectangle.contains( rectangle, - primitive._cameraReferenceFrameOriginCartographic + primitive._cameraReferenceFrameOriginCartographic, )) ); } @@ -1182,7 +1182,7 @@ function visitIfVisible( frameState, occluders, ancestorMeetsSse, - traversalDetails + traversalDetails, ) { if ( tileProvider.computeTileVisibility(tile, frameState, occluders) !== @@ -1193,7 +1193,7 @@ function visitIfVisible( frameState, tile, ancestorMeetsSse, - traversalDetails + traversalDetails, ); } @@ -1213,7 +1213,7 @@ function visitIfVisible( primitive, primitive._tileLoadQueueMedium, tile, - frameState + frameState, ); } @@ -1251,9 +1251,8 @@ function screenSpaceError(primitive, frameState, tile) { return screenSpaceError2D(primitive, frameState, tile); } - const maxGeometricError = primitive._tileProvider.getLevelMaximumGeometricError( - tile.level - ); + const maxGeometricError = + primitive._tileProvider.getLevelMaximumGeometricError(tile.level); const distance = tile._distance; const height = frameState.context.drawingBufferHeight; @@ -1283,9 +1282,8 @@ function screenSpaceError2D(primitive, frameState, tile) { const width = context.drawingBufferWidth; const height = context.drawingBufferHeight; - const maxGeometricError = primitive._tileProvider.getLevelMaximumGeometricError( - tile.level - ); + const maxGeometricError = + primitive._tileProvider.getLevelMaximumGeometricError(tile.level); const pixelSize = Math.max(frustum.top - frustum.bottom, frustum.right - frustum.left) / Math.max(width, height); @@ -1332,7 +1330,7 @@ function processTileLoadQueue(primitive, frameState) { tileProvider, endTime, tileLoadQueueHigh, - false + false, ); didSomeLoading = processSinglePriorityLoadQueue( primitive, @@ -1340,7 +1338,7 @@ function processTileLoadQueue(primitive, frameState) { tileProvider, endTime, tileLoadQueueMedium, - didSomeLoading + didSomeLoading, ); processSinglePriorityLoadQueue( primitive, @@ -1348,7 +1346,7 @@ function processTileLoadQueue(primitive, frameState) { tileProvider, endTime, tileLoadQueueLow, - didSomeLoading + didSomeLoading, ); } @@ -1362,7 +1360,7 @@ function processSinglePriorityLoadQueue( tileProvider, endTime, loadQueue, - didSomeLoading + didSomeLoading, ) { if (tileProvider.computeTileLoadPriority !== undefined) { loadQueue.sort(sortByLoadPriority); @@ -1443,14 +1441,14 @@ function updateHeights(primitive, frameState) { data.positionCartographic.longitude, data.positionCartographic.latitude, 0.0, - ellipsoid + ellipsoid, ); } if (mode === SceneMode.SCENE3D) { const surfaceNormal = ellipsoid.geodeticSurfaceNormal( data.positionOnEllipsoidSurface, - scratchRay.direction + scratchRay.direction, ); // compute origin point @@ -1460,7 +1458,7 @@ function updateHeights(primitive, frameState) { const rayOrigin = ellipsoid.getSurfaceNormalIntersectionWithZAxis( data.positionOnEllipsoidSurface, 11500.0, - scratchRay.origin + scratchRay.origin, ); // Theoretically, not with Earth datums, the intersection point can be outside the ellipsoid @@ -1477,12 +1475,12 @@ function updateHeights(primitive, frameState) { const vectorToMinimumPoint = Cartesian3.multiplyByScalar( surfaceNormal, Math.abs(magnitude) + 1, - scratchPosition + scratchPosition, ); Cartesian3.subtract( data.positionOnEllipsoidSurface, vectorToMinimumPoint, - scratchRay.origin + scratchRay.origin, ); } } else { @@ -1495,7 +1493,7 @@ function updateHeights(primitive, frameState) { scratchPosition.z, scratchPosition.x, scratchPosition.y, - scratchPosition + scratchPosition, ); Cartesian3.clone(scratchPosition, scratchRay.origin); Cartesian3.clone(Cartesian3.UNIT_X, scratchRay.direction); @@ -1506,7 +1504,7 @@ function updateHeights(primitive, frameState) { mode, projection, false, - scratchPosition + scratchPosition, ); if (defined(position)) { if (defined(data.callback)) { diff --git a/packages/engine/Source/Scene/QuadtreeTile.js b/packages/engine/Source/Scene/QuadtreeTile.js index 601458acbbf7..c0ccdde4dc97 100644 --- a/packages/engine/Source/Scene/QuadtreeTile.js +++ b/packages/engine/Source/Scene/QuadtreeTile.js @@ -28,12 +28,12 @@ function QuadtreeTile(options) { throw new DeveloperError("options.y is required."); } else if (options.x < 0 || options.y < 0) { throw new DeveloperError( - "options.x and options.y must be greater than or equal to zero." + "options.x and options.y must be greater than or equal to zero.", ); } if (!defined(options.level)) { throw new DeveloperError( - "options.level is required and must be greater than or equal to zero." + "options.level is required and must be greater than or equal to zero.", ); } if (!defined(options.tilingScheme)) { @@ -49,7 +49,7 @@ function QuadtreeTile(options) { this._rectangle = this._tilingScheme.tileXYToRectangle( this._x, this._y, - this._level + this._level, ); this._southwestChild = undefined; @@ -146,7 +146,7 @@ QuadtreeTile.createLevelZeroTiles = function (tilingScheme) { QuadtreeTile.prototype._updateCustomData = function ( frameNumber, added, - removed + removed, ) { let customData = this.customData; diff --git a/packages/engine/Source/Scene/QuadtreeTileProvider.js b/packages/engine/Source/Scene/QuadtreeTileProvider.js index 75cce94869f8..9f1bfee43906 100644 --- a/packages/engine/Source/Scene/QuadtreeTileProvider.js +++ b/packages/engine/Source/Scene/QuadtreeTileProvider.js @@ -22,7 +22,7 @@ function QuadtreeTileProvider() { * @returns {number} The maximum geometric error at level zero, in meters. */ QuadtreeTileProvider.computeDefaultLevelZeroMaximumGeometricError = function ( - tilingScheme + tilingScheme, ) { return ( (tilingScheme.ellipsoid.maximumRadius * 2 * Math.PI * 0.25) / diff --git a/packages/engine/Source/Scene/ResourceCache.js b/packages/engine/Source/Scene/ResourceCache.js index e29571cfb994..8d6c2a6afab6 100644 --- a/packages/engine/Source/Scene/ResourceCache.js +++ b/packages/engine/Source/Scene/ResourceCache.js @@ -89,7 +89,7 @@ ResourceCache.add = function (resourceLoader) { if (defined(ResourceCache.cacheEntries[cacheKey])) { throw new DeveloperError( - `Resource with this cacheKey is already in the cache: ${cacheKey}` + `Resource with this cacheKey is already in the cache: ${cacheKey}`, ); } //>>includeEnd('debug'); @@ -151,7 +151,7 @@ ResourceCache.getSchemaLoader = function (options) { //>>includeStart('debug', pragmas.debug); if (defined(schema) === defined(resource)) { throw new DeveloperError( - "One of options.schema and options.resource must be defined." + "One of options.schema and options.resource must be defined.", ); } //>>includeEnd('debug'); @@ -434,7 +434,7 @@ ResourceCache.getVertexBufferLoader = function (options) { Check.typeOf.object("options.frameState", frameState); if (!loadBuffer && !loadTypedArray) { throw new DeveloperError( - "At least one of loadBuffer and loadTypedArray must be true." + "At least one of loadBuffer and loadTypedArray must be true.", ); } @@ -445,19 +445,19 @@ ResourceCache.getVertexBufferLoader = function (options) { if (hasBufferViewId === hasDraco) { throw new DeveloperError( - "One of options.bufferViewId and options.draco must be defined." + "One of options.bufferViewId and options.draco must be defined.", ); } if (hasDraco && !hasAttributeSemantic) { throw new DeveloperError( - "When options.draco is defined options.attributeSemantic must also be defined." + "When options.draco is defined options.attributeSemantic must also be defined.", ); } if (hasDraco && !hasAccessorId) { throw new DeveloperError( - "When options.draco is defined options.haAccessorId must also be defined." + "When options.draco is defined options.haAccessorId must also be defined.", ); } @@ -551,7 +551,7 @@ ResourceCache.getIndexBufferLoader = function (options) { Check.typeOf.object("options.frameState", frameState); if (!loadBuffer && !loadTypedArray) { throw new DeveloperError( - "At least one of loadBuffer and loadTypedArray must be true." + "At least one of loadBuffer and loadTypedArray must be true.", ); } //>>includeEnd('debug'); diff --git a/packages/engine/Source/Scene/ResourceCacheKey.js b/packages/engine/Source/Scene/ResourceCacheKey.js index 6763461cebcb..085a2d3d0b70 100644 --- a/packages/engine/Source/Scene/ResourceCacheKey.js +++ b/packages/engine/Source/Scene/ResourceCacheKey.js @@ -63,7 +63,7 @@ function getDracoCacheKey(gltf, draco, gltfResource, baseResource) { buffer, bufferId, gltfResource, - baseResource + baseResource, ); const bufferViewCacheKey = getBufferViewCacheKey(bufferView); @@ -91,7 +91,7 @@ function getImageCacheKey(gltf, imageId, gltfResource, baseResource) { buffer, bufferId, gltfResource, - baseResource + baseResource, ); const bufferViewCacheKey = getBufferViewCacheKey(bufferView); @@ -126,7 +126,7 @@ ResourceCacheKey.getSchemaCacheKey = function (options) { //>>includeStart('debug', pragmas.debug); if (defined(schema) === defined(resource)) { throw new DeveloperError( - "One of options.schema and options.resource must be defined." + "One of options.schema and options.resource must be defined.", ); } //>>includeEnd('debug'); @@ -179,7 +179,7 @@ ResourceCacheKey.getEmbeddedBufferCacheKey = function (options) { return `embedded-buffer:${getEmbeddedBufferCacheKey( parentResource, - bufferId + bufferId, )}`; }; @@ -238,7 +238,7 @@ ResourceCacheKey.getBufferViewCacheKey = function (options) { buffer, bufferId, gltfResource, - baseResource + baseResource, ); const bufferViewCacheKey = getBufferViewCacheKey(bufferView); @@ -319,13 +319,13 @@ ResourceCacheKey.getVertexBufferCacheKey = function (options) { if (hasBufferViewId === hasDraco) { throw new DeveloperError( - "One of options.bufferViewId and options.draco must be defined." + "One of options.bufferViewId and options.draco must be defined.", ); } if (hasDraco && !hasAttributeSemantic) { throw new DeveloperError( - "When options.draco is defined options.attributeSemantic must also be defined." + "When options.draco is defined options.attributeSemantic must also be defined.", ); } @@ -336,7 +336,7 @@ ResourceCacheKey.getVertexBufferCacheKey = function (options) { if (!loadBuffer && !loadTypedArray) { throw new DeveloperError( - "At least one of loadBuffer and loadTypedArray must be true." + "At least one of loadBuffer and loadTypedArray must be true.", ); } //>>includeEnd('debug'); @@ -360,7 +360,7 @@ ResourceCacheKey.getVertexBufferCacheKey = function (options) { gltf, draco, gltfResource, - baseResource + baseResource, ); return `vertex-buffer:${dracoCacheKey}-draco-${attributeSemantic}${cacheKeySuffix}`; } @@ -373,7 +373,7 @@ ResourceCacheKey.getVertexBufferCacheKey = function (options) { buffer, bufferId, gltfResource, - baseResource + baseResource, ); const bufferViewCacheKey = getBufferViewCacheKey(bufferView); @@ -427,7 +427,7 @@ ResourceCacheKey.getIndexBufferCacheKey = function (options) { if (!loadBuffer && !loadTypedArray) { throw new DeveloperError( - "At least one of loadBuffer and loadTypedArray must be true." + "At least one of loadBuffer and loadTypedArray must be true.", ); } //>>includeEnd('debug'); @@ -447,7 +447,7 @@ ResourceCacheKey.getIndexBufferCacheKey = function (options) { gltf, draco, gltfResource, - baseResource + baseResource, ); return `index-buffer:${dracoCacheKey}-draco${cacheKeySuffix}`; } @@ -462,7 +462,7 @@ ResourceCacheKey.getIndexBufferCacheKey = function (options) { buffer, bufferId, gltfResource, - baseResource + baseResource, ); const accessorCacheKey = getAccessorCacheKey(accessor, bufferView); @@ -497,7 +497,7 @@ ResourceCacheKey.getImageCacheKey = function (options) { gltf, imageId, gltfResource, - baseResource + baseResource, ); return `image:${imageCacheKey}`; @@ -549,7 +549,7 @@ ResourceCacheKey.getTextureCacheKey = function (options) { gltf, imageId, gltfResource, - baseResource + baseResource, ); // Include the sampler cache key in the texture cache key since textures and diff --git a/packages/engine/Source/Scene/Scene.js b/packages/engine/Source/Scene/Scene.js index 2191d9f1ff93..b90cfd4be8a9 100644 --- a/packages/engine/Source/Scene/Scene.js +++ b/packages/engine/Source/Scene/Scene.js @@ -157,7 +157,7 @@ function Scene(options) { this._frameState = new FrameState( context, new CreditDisplay(creditContainer, "•", creditViewport), - this._jobScheduler + this._jobScheduler, ); this._frameState.scene3DOnly = defaultValue(options.scene3DOnly, false); this._removeCreditContainer = !hasCreditContainer; @@ -547,7 +547,7 @@ function Scene(options) { -45.0, -45.0, 45.0, - 45.0 + 45.0, ); } @@ -581,7 +581,7 @@ function Scene(options) { this.invertClassificationColor = Color.clone(Color.WHITE); this._actualInvertClassificationColor = Color.clone( - this._invertClassificationColor + this._invertClassificationColor, ); this._invertClassification = new InvertClassification(); @@ -677,17 +677,19 @@ function Scene(options) { */ this.maximumRenderTimeChange = defaultValue( options.maximumRenderTimeChange, - 0.0 + 0.0, ); this._lastRenderTime = undefined; this._frameRateMonitor = undefined; - this._removeRequestListenerCallback = RequestScheduler.requestCompletedEvent.addEventListener( - requestRenderAfterFrame(this) - ); - this._removeTaskProcessorListenerCallback = TaskProcessor.taskCompletedEvent.addEventListener( - requestRenderAfterFrame(this) - ); + this._removeRequestListenerCallback = + RequestScheduler.requestCompletedEvent.addEventListener( + requestRenderAfterFrame(this), + ); + this._removeTaskProcessorListenerCallback = + TaskProcessor.taskCompletedEvent.addEventListener( + requestRenderAfterFrame(this), + ); this._removeGlobeCallbacks = []; this._removeTerrainProviderReadyListener = undefined; @@ -695,7 +697,7 @@ function Scene(options) { 0, 0, context.drawingBufferWidth, - context.drawingBufferHeight + context.drawingBufferHeight, ); const camera = new Camera(this); @@ -768,13 +770,13 @@ function updateGlobeListeners(scene, globe) { if (defined(globe)) { removeGlobeCallbacks.push( globe.imageryLayersUpdatedEvent.addEventListener( - requestRenderAfterFrame(scene) - ) + requestRenderAfterFrame(scene), + ), ); removeGlobeCallbacks.push( globe.terrainProviderChanged.addEventListener( - requestRenderAfterFrame(scene) - ) + requestRenderAfterFrame(scene), + ), ); } scene._removeGlobeCallbacks = removeGlobeCallbacks; @@ -1398,7 +1400,7 @@ Object.defineProperties(Scene.prototype, { //>>includeStart('debug', pragmas.debug); if (this.scene3DOnly && value !== SceneMode.SCENE3D) { throw new DeveloperError( - "Only SceneMode.SCENE3D is valid when scene3DOnly is true." + "Only SceneMode.SCENE3D is valid when scene3DOnly is true.", ); } //>>includeEnd('debug'); @@ -1411,7 +1413,7 @@ Object.defineProperties(Scene.prototype, { //>>includeStart('debug', pragmas.debug); } else { throw new DeveloperError( - "value must be a valid SceneMode enumeration." + "value must be a valid SceneMode enumeration.", ); //>>includeEnd('debug'); } @@ -1460,7 +1462,7 @@ Object.defineProperties(Scene.prototype, { //>>includeStart('debug', pragmas.debug); if (this.camera.frustum instanceof OrthographicFrustum) { throw new DeveloperError( - "VR is unsupported with an orthographic projection." + "VR is unsupported with an orthographic projection.", ); } //>>includeEnd('debug'); @@ -1469,9 +1471,8 @@ Object.defineProperties(Scene.prototype, { this._frameState.creditDisplay.container.style.visibility = "hidden"; this._cameraVR = new Camera(this); if (!defined(this._deviceOrientationCameraController)) { - this._deviceOrientationCameraController = new DeviceOrientationCameraController( - this - ); + this._deviceOrientationCameraController = + new DeviceOrientationCameraController(this); } this._aspectRatioVR = this.camera.frustum.aspectRatio; @@ -1533,7 +1534,7 @@ Object.defineProperties(Scene.prototype, { //>>includeStart('debug', pragmas.debug); if (!defined(value) || value < 0.0) { throw new DeveloperError( - "minimumDisableDepthTestDistance must be greater than or equal to 0.0." + "minimumDisableDepthTestDistance must be greater than or equal to 0.0.", ); } //>>includeEnd('debug'); @@ -1728,7 +1729,7 @@ function updateDerivedCommands(scene, command, shadowsDirty) { scene, command, context, - derivedCommands.picking + derivedCommands.picking, ); } @@ -1737,7 +1738,7 @@ function updateDerivedCommands(scene, command, shadowsDirty) { scene, command, context, - derivedCommands.depth + derivedCommands.depth, ); } @@ -1747,7 +1748,7 @@ function updateDerivedCommands(scene, command, shadowsDirty) { derivedCommands.hdr = DerivedCommand.createHdrCommand( command, context, - derivedCommands.hdr + derivedCommands.hdr, ); command = derivedCommands.hdr.command; derivedCommands = command.derivedCommands; @@ -1759,7 +1760,7 @@ function updateDerivedCommands(scene, command, shadowsDirty) { command, shadowsDirty, context, - derivedCommands.shadows + derivedCommands.shadows, ); } @@ -1771,13 +1772,13 @@ function updateDerivedCommands(scene, command, shadowsDirty) { derivedCommands.oit.shadows = oit.createDerivedCommands( derivedCommands.shadows.receiveCommand, context, - derivedCommands.oit.shadows + derivedCommands.oit.shadows, ); } else { derivedCommands.oit = oit.createDerivedCommands( command, context, - derivedCommands.oit + derivedCommands.oit, ); } } @@ -1831,7 +1832,7 @@ Scene.prototype.updateDerivedCommands = function (command) { command, shadowsDirty, context, - derivedCommands.shadows + derivedCommands.shadows, ); } @@ -1839,12 +1840,12 @@ Scene.prototype.updateDerivedCommands = function (command) { derivedCommands.logDepth = DerivedCommand.createLogDepthCommand( command, context, - derivedCommands.logDepth + derivedCommands.logDepth, ); updateDerivedCommands( this, derivedCommands.logDepth.command, - shadowsDirty + shadowsDirty, ); } if (hasDerivedCommands || needsDerivedCommands) { @@ -1890,7 +1891,7 @@ function getOccluder(scene) { scratchOccluder = Occluder.fromBoundingSphere( scratchOccluderBoundingSphere, scene.camera.positionWC, - scratchOccluder + scratchOccluder, ); return scratchOccluder; } @@ -1935,11 +1936,12 @@ Scene.prototype.updateFrameState = function () { frameState.cullingVolume = camera.frustum.computeCullingVolume( camera.positionWC, camera.directionWC, - camera.upWC + camera.upWC, ); frameState.occluder = getOccluder(this); frameState.minimumTerrainHeight = 0.0; - frameState.minimumDisableDepthTestDistance = this._minimumDisableDepthTestDistance; + frameState.minimumDisableDepthTestDistance = + this._minimumDisableDepthTestDistance; frameState.invertClassification = this.invertClassification; frameState.useLogDepth = this._logDepthBuffer && @@ -1961,14 +1963,17 @@ Scene.prototype.updateFrameState = function () { globe._terrainExaggerationChanged = false; } frameState.verticalExaggeration = this.verticalExaggeration; - frameState.verticalExaggerationRelativeHeight = this.verticalExaggerationRelativeHeight; + frameState.verticalExaggerationRelativeHeight = + this.verticalExaggerationRelativeHeight; if ( defined(this._specularEnvironmentCubeMap) && this._specularEnvironmentCubeMap.ready ) { - frameState.specularEnvironmentMaps = this._specularEnvironmentCubeMap.texture; - frameState.specularEnvironmentMapsMaximumLOD = this._specularEnvironmentCubeMap.maximumMipmapLevel; + frameState.specularEnvironmentMaps = + this._specularEnvironmentCubeMap.texture; + frameState.specularEnvironmentMapsMaximumLOD = + this._specularEnvironmentCubeMap.maximumMipmapLevel; } else { frameState.specularEnvironmentMaps = undefined; frameState.specularEnvironmentMapsMaximumLOD = undefined; @@ -1978,7 +1983,7 @@ Scene.prototype.updateFrameState = function () { this._actualInvertClassificationColor = Color.clone( this.invertClassificationColor, - this._actualInvertClassificationColor + this._actualInvertClassificationColor, ); if (!InvertClassification.isTranslucencySupported(this._context)) { this._actualInvertClassificationColor.alpha = 1.0; @@ -2029,11 +2034,11 @@ let transformFrom2D = new Matrix4( 0.0, 0.0, 0.0, - 1.0 + 1.0, ); transformFrom2D = Matrix4.inverseTransformation( transformFrom2D, - transformFrom2D + transformFrom2D, ); function debugShowBoundingVolume(command, scene, passState, debugFramebuffer) { @@ -2065,8 +2070,8 @@ function debugShowBoundingVolume(command, scene, passState, debugFramebuffer) { new EllipsoidGeometry({ radii: new Cartesian3(radius, radius, radius), vertexFormat: PerInstanceColorAppearance.FLAT_VERTEX_FORMAT, - }) - ) + }), + ), ); scene._debugVolume = new Primitive({ @@ -2091,8 +2096,8 @@ function debugShowBoundingVolume(command, scene, passState, debugFramebuffer) { BoxGeometry.fromDimensions({ dimensions: new Cartesian3(2.0, 2.0, 2.0), vertexFormat: PerInstanceColorAppearance.FLAT_VERTEX_FORMAT, - }) - ) + }), + ), ); scene._debugVolume = new Primitive({ @@ -2101,7 +2106,7 @@ function debugShowBoundingVolume(command, scene, passState, debugFramebuffer) { modelMatrix: Matrix4.fromRotationTranslation( halfAxes, center, - new Matrix4() + new Matrix4(), ), attributes: { color: new ColorGeometryInstanceAttribute(1.0, 0.0, 0.0, 1.0), @@ -2193,7 +2198,7 @@ function executeCommand(command, scene, context, passState, debugFramebuffer) { scene._debugInspector.executeDebugShowFrustumsCommand( scene, command, - passState + passState, ); return; } @@ -2254,7 +2259,7 @@ function executeTranslucentCommandsBackToFront( executeFunction, passState, commands, - invertClassification + invertClassification, ) { const context = scene.context; @@ -2265,7 +2270,7 @@ function executeTranslucentCommandsBackToFront( invertClassification.unclassifiedCommand, scene, context, - passState + passState, ); } @@ -2280,7 +2285,7 @@ function executeTranslucentCommandsFrontToBack( executeFunction, passState, commands, - invertClassification + invertClassification, ) { const context = scene.context; @@ -2291,7 +2296,7 @@ function executeTranslucentCommandsFrontToBack( invertClassification.unclassifiedCommand, scene, context, - passState + passState, ); } @@ -2362,7 +2367,7 @@ function executeCommands(scene, passState) { environmentState.skyAtmosphereCommand, scene, context, - passState + passState, ); } @@ -2398,7 +2403,7 @@ function executeCommands(scene, passState) { executeFunction, passState, commands, - invertClassification + invertClassification, ) { view.globeDepth.prepareColorTextures(context); view.oit.executeCommands( @@ -2406,7 +2411,7 @@ function executeCommands(scene, passState) { executeFunction, passState, commands, - invertClassification + invertClassification, ); }; } @@ -2473,7 +2478,7 @@ function executeCommands(scene, passState) { executeCommand, globeTranslucencyFramebuffer, scene, - passState + passState, ); } else { for (j = 0; j < length; ++j) { @@ -2498,7 +2503,7 @@ function executeCommands(scene, passState) { executeCommand, globeTranslucencyFramebuffer, scene, - passState + passState, ); } else { for (j = 0; j < length; ++j) { @@ -2538,7 +2543,7 @@ function executeCommands(scene, passState) { context, passState, clearGlobeDepth, - globeDepth.depthStencilTexture + globeDepth.depthStencilTexture, ); } @@ -2605,7 +2610,7 @@ function executeCommands(scene, passState) { context, passState, clearGlobeDepth, - scene._invertClassification._fbo.getDepthStencilTexture() + scene._invertClassification._fbo.getDepthStencilTexture(), ); } @@ -2686,7 +2691,7 @@ function executeCommands(scene, passState) { executeCommand, passState, commands, - invertClassification + invertClassification, ); // Classification for translucent 3D Tiles @@ -2701,13 +2706,13 @@ function executeCommands(scene, passState) { executeCommand, passState, commands, - globeDepth.depthStencilTexture + globeDepth.depthStencilTexture, ); view.translucentTileClassification.executeClassificationCommands( scene, executeCommand, passState, - frustumCommands + frustumCommands, ); } @@ -2749,7 +2754,7 @@ function executeCommands(scene, passState) { executeIdCommand, globeTranslucencyFramebuffer, scene, - passState + passState, ); } else { for (j = 0; j < length; ++j) { @@ -2908,7 +2913,7 @@ function executeShadowMapCastCommands(scene) { command.derivedCommands.shadows.castCommands[i], scene, context, - pass.passState + pass.passState, ); } } @@ -2922,7 +2927,7 @@ const scratchEyeTranslation = new Cartesian3(); */ Scene.prototype.updateAndExecuteCommands = function ( passState, - backgroundColor + backgroundColor, ) { const frameState = this._frameState; const mode = frameState.mode; @@ -2976,7 +2981,7 @@ function executeWebVRCommands(scene, passState, backgroundColor) { const eyeTranslation = Cartesian3.multiplyByScalar( savedCamera.right, eyeSeparation * 0.5, - scratchEyeTranslation + scratchEyeTranslation, ); camera.frustum.aspectRatio = viewport.width / viewport.height; @@ -3000,7 +3005,7 @@ function executeWebVRCommands(scene, passState, backgroundColor) { const scratch2DViewportCartographic = new Cartographic( Math.PI, - CesiumMath.PI_OVER_TWO + CesiumMath.PI_OVER_TWO, ); const scratch2DViewportMaxCoord = new Cartesian3(); const scratch2DViewportSavedPosition = new Cartesian3(); @@ -3027,11 +3032,11 @@ function execute2DViewportCommands(scene, passState) { const position = Cartesian3.clone( camera.position, - scratch2DViewportSavedPosition + scratch2DViewportSavedPosition, ); const transform = Matrix4.clone( camera.transform, - scratch2DViewportCameraTransform + scratch2DViewportCameraTransform, ); const frustum = camera.frustum.clone(); @@ -3041,7 +3046,7 @@ function execute2DViewportCommands(scene, passState) { viewport, 0.0, 1.0, - scratch2DViewportTransform + scratch2DViewportTransform, ); const projectionMatrix = camera.frustum.projectionMatrix; @@ -3050,13 +3055,13 @@ function execute2DViewportCommands(scene, passState) { CesiumMath.sign(x) * maxCoord.x - x, 0.0, -camera.positionWC.x, - scratch2DViewportEyePoint + scratch2DViewportEyePoint, ); const windowCoordinates = Transforms.pointToGLWindowCoordinates( projectionMatrix, viewportTransformation, eyePoint, - scratch2DViewportWindowCoords + scratch2DViewportWindowCoords, ); windowCoordinates.x = Math.floor(windowCoordinates.x); @@ -3082,7 +3087,7 @@ function execute2DViewportCommands(scene, passState) { frameState.cullingVolume = camera.frustum.computeCullingVolume( camera.positionWC, camera.directionWC, - camera.upWC + camera.upWC, ); context.uniformState.update(frameState); @@ -3098,7 +3103,7 @@ function execute2DViewportCommands(scene, passState) { frameState.cullingVolume = camera.frustum.computeCullingVolume( camera.positionWC, camera.directionWC, - camera.upWC + camera.upWC, ); context.uniformState.update(frameState); @@ -3112,7 +3117,7 @@ function execute2DViewportCommands(scene, passState) { frameState.cullingVolume = camera.frustum.computeCullingVolume( camera.positionWC, camera.directionWC, - camera.upWC + camera.upWC, ); context.uniformState.update(frameState); @@ -3129,7 +3134,7 @@ function execute2DViewportCommands(scene, passState) { frameState.cullingVolume = camera.frustum.computeCullingVolume( camera.positionWC, camera.directionWC, - camera.upWC + camera.upWC, ); context.uniformState.update(frameState); @@ -3144,7 +3149,7 @@ function execute2DViewportCommands(scene, passState) { frameState.cullingVolume = camera.frustum.computeCullingVolume( camera.positionWC, camera.directionWC, - camera.upWC + camera.upWC, ); context.uniformState.update(frameState); @@ -3161,7 +3166,7 @@ function execute2DViewportCommands(scene, passState) { frameState.cullingVolume = camera.frustum.computeCullingVolume( camera.positionWC, camera.directionWC, - camera.upWC + camera.upWC, ); context.uniformState.update(frameState); @@ -3178,7 +3183,7 @@ function executeCommandsInViewport( firstViewport, scene, passState, - backgroundColor + backgroundColor, ) { const environmentState = scene._environmentState; const view = scene._view; @@ -3239,7 +3244,7 @@ Scene.prototype.updateEnvironment = function () { if (defined(skyAtmosphere)) { if (defined(globe)) { skyAtmosphere.setDynamicLighting( - DynamicAtmosphereLightingType.fromGlobeFlags(globe) + DynamicAtmosphereLightingType.fromGlobeFlags(globe), ); environmentState.isReadyForAtmosphere = environmentState.isReadyForAtmosphere || @@ -3253,7 +3258,7 @@ Scene.prototype.updateEnvironment = function () { environmentState.skyAtmosphereCommand = skyAtmosphere.update( frameState, - globe + globe, ); if (defined(environmentState.skyAtmosphereCommand)) { this.updateDerivedCommands(environmentState.skyAtmosphereCommand); @@ -3319,12 +3324,12 @@ Scene.prototype.updateEnvironment = function () { environmentState.isSunVisible = this.isVisible( environmentState.sunDrawCommand, cullingVolume, - occluder + occluder, ); environmentState.isMoonVisible = this.isVisible( environmentState.moonCommand, cullingVolume, - occluder + occluder, ); const envMaps = this.specularEnvironmentMaps; @@ -3467,9 +3472,8 @@ function updateAndClearFramebuffers(scene, passState, clearColor) { // Update globe depth rendering based on the current context and clear the globe depth framebuffer. // Globe depth is copied for the pick pass to support picking batched geometries in GroundPrimitives. - const useGlobeDepthFramebuffer = (environmentState.useGlobeDepthFramebuffer = defined( - view.globeDepth - )); + const useGlobeDepthFramebuffer = (environmentState.useGlobeDepthFramebuffer = + defined(view.globeDepth)); if (useGlobeDepthFramebuffer) { view.globeDepth.update( context, @@ -3477,7 +3481,7 @@ function updateAndClearFramebuffers(scene, passState, clearColor) { view.viewport, scene.msaaSamples, scene._hdr, - environmentState.clearGlobeDepth + environmentState.clearGlobeDepth, ); view.globeDepth.clear(context, passState, clearColor); } @@ -3492,7 +3496,7 @@ function updateAndClearFramebuffers(scene, passState, clearColor) { passState, view.globeDepth.colorFramebufferManager, scene._hdr, - scene.msaaSamples + scene.msaaSamples, ); oit.clear(context, passState, clearColor); environmentState.useOIT = oit.isSupported(); @@ -3512,7 +3516,7 @@ function updateAndClearFramebuffers(scene, passState, clearColor) { context, view.viewport, scene._hdr, - scene.msaaSamples + scene.msaaSamples, ); view.sceneFramebuffer.clear(context, passState, clearColor); @@ -3552,7 +3556,7 @@ function updateAndClearFramebuffers(scene, passState, clearColor) { scene._invertClassification.update( context, scene.msaaSamples, - view.globeDepth.colorFramebufferManager + view.globeDepth.colorFramebufferManager, ); scene._invertClassification.clear(context, passState); @@ -3562,7 +3566,7 @@ function updateAndClearFramebuffers(scene, passState, clearColor) { derivedCommands.oit = oit.createDerivedCommands( command, context, - derivedCommands.oit + derivedCommands.oit, ); } } else { @@ -3575,7 +3579,7 @@ function updateAndClearFramebuffers(scene, passState, clearColor) { scene._hdr, view.viewport, context, - passState + passState, ); } } @@ -3630,7 +3634,7 @@ Scene.prototype.resolveFramebuffers = function (passState) { const idTexture = idFramebuffer.getColorTexture(0); const depthTexture = defaultValue( globeFramebuffer, - sceneFramebuffer + sceneFramebuffer, ).getDepthStencilTexture(); postProcess.execute(context, colorTexture, depthTexture, idTexture); postProcess.copy(context, defaultFramebuffer); @@ -3740,7 +3744,7 @@ const updateHeightScratchCartographic = new Cartographic(); Scene.prototype.updateHeight = function ( cartographic, callback, - heightReference + heightReference, ) { //>>includeStart('debug', pragmas.debug); Check.typeOf.func("callback", callback); @@ -3768,7 +3772,7 @@ Scene.prototype.updateHeight = function ( if (!ignoreTerrain && defined(this.globe)) { terrainRemoveCallback = this.globe._surface.updateHeight( cartographic, - callbackWrapper + callbackWrapper, ); } @@ -3786,7 +3790,7 @@ Scene.prototype.updateHeight = function ( const tilesetRemoveCallback = primitive.updateHeight( cartographic, callbackWrapper, - ellipsoid + ellipsoid, ); tilesetRemoveCallbacks[primitive.id] = tilesetRemoveCallback; }; @@ -3800,10 +3804,10 @@ Scene.prototype.updateHeight = function ( } const removeAddedListener = this.primitives.primitiveAdded.addEventListener( - createPrimitiveEventListener + createPrimitiveEventListener, ); - const removeRemovedListener = this.primitives.primitiveRemoved.addEventListener( - (primitive) => { + const removeRemovedListener = + this.primitives.primitiveRemoved.addEventListener((primitive) => { if (primitive.isDestroyed() || !primitive.isCesium3DTileset) { return; } @@ -3811,13 +3815,12 @@ Scene.prototype.updateHeight = function ( tilesetRemoveCallbacks[primitive.id](); } delete tilesetRemoveCallbacks[primitive.id]; - } - ); + }); const removeCallback = () => { terrainRemoveCallback = terrainRemoveCallback && terrainRemoveCallback(); Object.values(tilesetRemoveCallbacks).forEach((tilesetRemoveCallback) => - tilesetRemoveCallback() + tilesetRemoveCallback(), ); tilesetRemoveCallbacks = {}; removeAddedListener(); @@ -3882,7 +3885,7 @@ Scene.prototype.initializeFrame = function () { } this._globeHeight = updatedCartographic.height; - } + }, ); } this._cameraUnderground = isCameraUnderground(this); @@ -3918,7 +3921,7 @@ function updateDebugShowFramesPerSecond(scene, renderedThisFrame) { scene._performanceDisplay = scene._performanceDisplay && scene._performanceDisplay.destroy(); scene._performanceContainer.parentNode.removeChild( - scene._performanceContainer + scene._performanceContainer, ); } } @@ -4079,7 +4082,7 @@ Scene.prototype.render = function (time) { defined(this._lastRenderTime) ) { const difference = Math.abs( - JulianDate.secondsDifference(this._lastRenderTime, time) + JulianDate.secondsDifference(this._lastRenderTime, time), ); shouldRender = shouldRender || difference > this.maximumRenderTimeChange; } @@ -4093,7 +4096,7 @@ Scene.prototype.render = function (time) { const frameNumber = CesiumMath.incrementWrap( frameState.frameNumber, 15000000.0, - 1.0 + 1.0, ); updateFrameNumber(this, frameNumber, time); frameState.newFrame = true; @@ -4169,7 +4172,7 @@ Scene.prototype.requestRender = function () { Scene.prototype.clampLineWidth = function (width) { return Math.max( ContextLimits.minimumAliasedLineWidth, - Math.min(width, ContextLimits.maximumAliasedLineWidth) + Math.min(width, ContextLimits.maximumAliasedLineWidth), ); }; @@ -4232,7 +4235,7 @@ Scene.prototype.pickVoxel = function (windowPosition, width, height) { this, windowPosition, width, - height + height, ); // Look up the keyframeNode containing this picked cell const tileIndex = 255 * voxelCoordinate[0] + voxelCoordinate[1]; @@ -4248,7 +4251,7 @@ Scene.prototype.pickVoxel = function (windowPosition, width, height) { voxelPrimitive, tileIndex, sampleIndex, - keyframeNode + keyframeNode, ); }; @@ -4271,12 +4274,12 @@ Scene.prototype.pickVoxel = function (windowPosition, width, height) { */ Scene.prototype.pickPositionWorldCoordinates = function ( windowPosition, - result + result, ) { return this._picking.pickPositionWorldCoordinates( this, windowPosition, - result + result, ); }; @@ -4353,7 +4356,7 @@ function updateRequestRenderModeDeferCheckPass(scene) { // Check if any ignored requests are ready to go (to wake rendering up again) scene.primitives.updateForPass( scene._frameState, - requestRenderModeDeferCheckPassState + requestRenderModeDeferCheckPassState, ); } @@ -4405,14 +4408,14 @@ Scene.prototype.drillPickFromRay = function ( ray, limit, objectsToExclude, - width + width, ) { return this._picking.drillPickFromRay( this, ray, limit, objectsToExclude, - width + width, ); }; @@ -4432,13 +4435,13 @@ Scene.prototype.drillPickFromRay = function ( Scene.prototype.pickFromRayMostDetailed = function ( ray, objectsToExclude, - width + width, ) { return this._picking.pickFromRayMostDetailed( this, ray, objectsToExclude, - width + width, ); }; @@ -4460,14 +4463,14 @@ Scene.prototype.drillPickFromRayMostDetailed = function ( ray, limit, objectsToExclude, - width + width, ) { return this._picking.drillPickFromRayMostDetailed( this, ray, limit, objectsToExclude, - width + width, ); }; @@ -4532,14 +4535,14 @@ Scene.prototype.clampToHeight = function ( cartesian, objectsToExclude, width, - result + result, ) { return this._picking.clampToHeight( this, cartesian, objectsToExclude, width, - result + result, ); }; @@ -4574,13 +4577,13 @@ Scene.prototype.clampToHeight = function ( Scene.prototype.sampleHeightMostDetailed = function ( positions, objectsToExclude, - width + width, ) { return this._picking.sampleHeightMostDetailed( this, positions, objectsToExclude, - width + width, ); }; @@ -4614,13 +4617,13 @@ Scene.prototype.sampleHeightMostDetailed = function ( Scene.prototype.clampToHeightMostDetailed = function ( cartesians, objectsToExclude, - width + width, ) { return this._picking.clampToHeightMostDetailed( this, cartesians, objectsToExclude, - width + width, ); }; @@ -4694,15 +4697,14 @@ function setTerrain(scene, terrain) { } // Otherwise, set a placeholder scene.globe.terrainProvider = undefined; - scene._removeTerrainProviderReadyListener = terrain.readyEvent.addEventListener( - (provider) => { + scene._removeTerrainProviderReadyListener = + terrain.readyEvent.addEventListener((provider) => { if (defined(scene) && defined(scene.globe)) { scene.globe.terrainProvider = provider; } scene._removeTerrainProviderReadyListener(); - } - ); + }); } /** @@ -4812,7 +4814,7 @@ Scene.prototype.destroy = function () { this._performanceDisplay = this._performanceDisplay && this._performanceDisplay.destroy(); this._performanceContainer.parentNode.removeChild( - this._performanceContainer + this._performanceContainer, ); } diff --git a/packages/engine/Source/Scene/SceneFramebuffer.js b/packages/engine/Source/Scene/SceneFramebuffer.js index 274c623a5e8a..72e2611d58d4 100644 --- a/packages/engine/Source/Scene/SceneFramebuffer.js +++ b/packages/engine/Source/Scene/SceneFramebuffer.js @@ -54,7 +54,7 @@ SceneFramebuffer.prototype.update = function ( context, viewport, hdr, - numSamples + numSamples, ) { const width = viewport.width; const height = viewport.height; @@ -69,7 +69,7 @@ SceneFramebuffer.prototype.update = function ( width, height, numSamples, - pixelDatatype + pixelDatatype, ); this._idFramebuffer.update(context, width, height); }; diff --git a/packages/engine/Source/Scene/SceneTransforms.js b/packages/engine/Source/Scene/SceneTransforms.js index 84ae7a032b52..d982dbd8308e 100644 --- a/packages/engine/Source/Scene/SceneTransforms.js +++ b/packages/engine/Source/Scene/SceneTransforms.js @@ -48,7 +48,7 @@ SceneTransforms.worldToWindowCoordinates = function (scene, position, result) { scene, position, Cartesian3.ZERO, - result + result, ); }; @@ -65,15 +65,15 @@ function worldToClip(position, eyeOffset, camera, result) { position.y, position.z, 1, - scratchCartesian4 + scratchCartesian4, ), - scratchCartesian4 + scratchCartesian4, ); const zEyeOffset = Cartesian3.multiplyComponents( eyeOffset, Cartesian3.normalize(positionEC, scratchEyeOffset), - scratchEyeOffset + scratchEyeOffset, ); positionEC.x += eyeOffset.x + zEyeOffset.x; positionEC.y += eyeOffset.y + zEyeOffset.y; @@ -82,13 +82,13 @@ function worldToClip(position, eyeOffset, camera, result) { return Matrix4.multiplyByVector( camera.frustum.projectionMatrix, positionEC, - result + result, ); } const scratchMaxCartographic = new Cartographic( Math.PI, - CesiumMath.PI_OVER_TWO + CesiumMath.PI_OVER_TWO, ); const scratchProjectedCartesian = new Cartesian3(); const scratchCameraPosition = new Cartesian3(); @@ -100,7 +100,7 @@ SceneTransforms.worldWithEyeOffsetToWindowCoordinates = function ( scene, position, eyeOffset, - result + result, ) { //>>includeStart('debug', pragmas.debug); if (!defined(scene)) { @@ -116,7 +116,7 @@ SceneTransforms.worldWithEyeOffsetToWindowCoordinates = function ( const actualPosition = SceneTransforms.computeActualEllipsoidPosition( frameState, position, - actualPositionScratch + actualPositionScratch, ); if (!defined(actualPosition)) { @@ -139,12 +139,12 @@ SceneTransforms.worldWithEyeOffsetToWindowCoordinates = function ( const maxCartographic = scratchMaxCartographic; const maxCoord = projection.project( maxCartographic, - scratchProjectedCartesian + scratchProjectedCartesian, ); const cameraPosition = Cartesian3.clone( camera.position, - scratchCameraPosition + scratchCameraPosition, ); const frustum = camera.frustum.clone(); @@ -152,7 +152,7 @@ SceneTransforms.worldWithEyeOffsetToWindowCoordinates = function ( viewport, 0.0, 1.0, - new Matrix4() + new Matrix4(), ); const projectionMatrix = camera.frustum.projectionMatrix; @@ -160,12 +160,12 @@ SceneTransforms.worldWithEyeOffsetToWindowCoordinates = function ( const eyePoint = Cartesian3.fromElements( CesiumMath.sign(x) * maxCoord.x - x, 0.0, - -camera.positionWC.x + -camera.positionWC.x, ); const windowCoordinates = Transforms.pointToGLWindowCoordinates( projectionMatrix, viewportTransformation, - eyePoint + eyePoint, ); if ( @@ -184,7 +184,7 @@ SceneTransforms.worldWithEyeOffsetToWindowCoordinates = function ( SceneTransforms.clipToGLWindowCoordinates( viewport, positionCC, - scratchWindowCoord0 + scratchWindowCoord0, ); viewport.x += windowCoordinates.x; @@ -199,7 +199,7 @@ SceneTransforms.worldWithEyeOffsetToWindowCoordinates = function ( SceneTransforms.clipToGLWindowCoordinates( viewport, positionCC, - scratchWindowCoord1 + scratchWindowCoord1, ); } else { viewport.x += windowCoordinates.x; @@ -211,7 +211,7 @@ SceneTransforms.worldWithEyeOffsetToWindowCoordinates = function ( SceneTransforms.clipToGLWindowCoordinates( viewport, positionCC, - scratchWindowCoord0 + scratchWindowCoord0, ); viewport.x = viewport.x - viewport.width; @@ -226,7 +226,7 @@ SceneTransforms.worldWithEyeOffsetToWindowCoordinates = function ( SceneTransforms.clipToGLWindowCoordinates( viewport, positionCC, - scratchWindowCoord1 + scratchWindowCoord1, ); } @@ -254,7 +254,7 @@ SceneTransforms.worldWithEyeOffsetToWindowCoordinates = function ( result = SceneTransforms.clipToGLWindowCoordinates( viewport, positionCC, - result + result, ); } @@ -282,7 +282,7 @@ SceneTransforms.worldWithEyeOffsetToWindowCoordinates = function ( SceneTransforms.worldToDrawingBufferCoordinates = function ( scene, position, - result + result, ) { result = SceneTransforms.worldToWindowCoordinates(scene, position, result); if (!defined(result)) { @@ -301,7 +301,7 @@ const positionInCartographic = new Cartographic(); SceneTransforms.computeActualEllipsoidPosition = function ( frameState, position, - result + result, ) { const mode = frameState.mode; @@ -312,7 +312,7 @@ SceneTransforms.computeActualEllipsoidPosition = function ( const projection = frameState.mapProjection; const cartographic = projection.ellipsoid.cartesianToCartographic( position, - positionInCartographic + positionInCartographic, ); if (!defined(cartographic)) { return undefined; @@ -325,7 +325,7 @@ SceneTransforms.computeActualEllipsoidPosition = function ( projectedPosition.z, projectedPosition.x, projectedPosition.y, - result + result, ); } @@ -334,7 +334,7 @@ SceneTransforms.computeActualEllipsoidPosition = function ( 0.0, projectedPosition.x, projectedPosition.y, - result + result, ); } @@ -344,7 +344,7 @@ SceneTransforms.computeActualEllipsoidPosition = function ( CesiumMath.lerp(projectedPosition.z, position.x, morphTime), CesiumMath.lerp(projectedPosition.x, position.y, morphTime), CesiumMath.lerp(projectedPosition.y, position.z, morphTime), - result + result, ); }; @@ -358,7 +358,7 @@ const viewportTransform = new Matrix4(); SceneTransforms.clipToGLWindowCoordinates = function ( viewport, position, - result + result, ) { // Perspective divide to transform from clip coordinates to normalized device coordinates Cartesian3.divideByScalar(position, position.w, positionNDC); @@ -376,7 +376,7 @@ SceneTransforms.clipToGLWindowCoordinates = function ( SceneTransforms.transformWindowToDrawingBuffer = function ( scene, windowPosition, - result + result, ) { const canvas = scene.canvas; const xScale = scene.drawingBufferWidth / canvas.clientWidth; @@ -384,7 +384,7 @@ SceneTransforms.transformWindowToDrawingBuffer = function ( return Cartesian2.fromElements( windowPosition.x * xScale, windowPosition.y * yScale, - result + result, ); }; @@ -398,7 +398,7 @@ SceneTransforms.drawingBufferToWorldCoordinates = function ( scene, drawingBufferPosition, depth, - result + result, ) { const context = scene.context; const uniformState = context.uniformState; @@ -445,13 +445,13 @@ SceneTransforms.drawingBufferToWorldCoordinates = function ( worldCoords = Matrix4.multiplyByVector( uniformState.inverseView, worldCoords, - worldCoords + worldCoords, ); } else { worldCoords = Matrix4.multiplyByVector( uniformState.inverseViewProjection, ndc, - scratchWorldCoords + scratchWorldCoords, ); // Reverse perspective divide diff --git a/packages/engine/Source/Scene/SceneTransitioner.js b/packages/engine/Source/Scene/SceneTransitioner.js index 4e632f36e53d..56e177cc08b1 100644 --- a/packages/engine/Source/Scene/SceneTransitioner.js +++ b/packages/engine/Source/Scene/SceneTransitioner.js @@ -58,7 +58,7 @@ SceneTransitioner.prototype.morphTo2D = function (duration, ellipsoid) { this, this._previousMode, SceneMode.SCENE2D, - true + true, ); scene._mode = SceneMode.MORPHING; @@ -98,7 +98,7 @@ const scratchToCVCamera = { SceneTransitioner.prototype.morphToColumbusView = function ( duration, - ellipsoid + ellipsoid, ) { if (defined(this._completeMorph)) { this._completeMorph(); @@ -117,7 +117,7 @@ SceneTransitioner.prototype.morphToColumbusView = function ( this, this._previousMode, SceneMode.COLUMBUS_VIEW, - true + true, ); scene.camera._setTransform(Matrix4.IDENTITY); @@ -133,7 +133,7 @@ SceneTransitioner.prototype.morphToColumbusView = function ( position = Cartesian3.multiplyByScalar( Cartesian3.normalize(position, position), 5.0 * ellipsoid.maximumRadius, - position + position, ); Cartesian3.negate(Cartesian3.normalize(position, direction), direction); @@ -152,18 +152,18 @@ SceneTransitioner.prototype.morphToColumbusView = function ( const surfacePoint = ellipsoid.scaleToGeodeticSurface( position, - scratchToCVSurfacePosition + scratchToCVSurfacePosition, ); const toENU = Transforms.eastNorthUpToFixedFrame( surfacePoint, ellipsoid, - scratchToCVToENU + scratchToCVToENU, ); Matrix4.inverseTransformation(toENU, toENU); scene.mapProjection.project( ellipsoid.cartesianToCartographic(position, scratchToCVCartographic), - position + position, ); Matrix4.multiplyByPointAsVector(toENU, direction, direction); Matrix4.multiplyByPointAsVector(toENU, up, up); @@ -196,17 +196,17 @@ SceneTransitioner.prototype.morphToColumbusView = function ( cameraCV.position2D = Matrix4.multiplyByPoint( Camera.TRANSFORM_2D, position, - scratchToCVPosition2D + scratchToCVPosition2D, ); cameraCV.direction2D = Matrix4.multiplyByPointAsVector( Camera.TRANSFORM_2D, direction, - scratchToCVDirection2D + scratchToCVDirection2D, ); cameraCV.up2D = Matrix4.multiplyByPointAsVector( Camera.TRANSFORM_2D, up, - scratchToCVUp2D + scratchToCVUp2D, ); scene._mode = SceneMode.MORPHING; @@ -244,7 +244,7 @@ SceneTransitioner.prototype.morphTo3D = function (duration, ellipsoid) { this, this._previousMode, SceneMode.SCENE3D, - true + true, ); scene._mode = SceneMode.MORPHING; @@ -261,7 +261,7 @@ SceneTransitioner.prototype.morphTo3D = function (duration, ellipsoid) { 0.0, 5.0 * ellipsoid.maximumRadius, ellipsoid, - camera3D.position + camera3D.position, ); Cartesian3.negate(camera3D.position, camera3D.direction); Cartesian3.normalize(camera3D.direction, camera3D.direction); @@ -323,7 +323,7 @@ SceneTransitioner.prototype.destroy = function () { function createMorphHandler(transitioner, completeMorphFunction) { if (transitioner._scene.completeMorphOnUserInput) { transitioner._morphHandler = new ScreenSpaceEventHandler( - transitioner._scene.canvas + transitioner._scene.canvas, ); const completeMorph = function () { @@ -334,19 +334,19 @@ function createMorphHandler(transitioner, completeMorphFunction) { transitioner._completeMorph = completeMorph; transitioner._morphHandler.setInputAction( completeMorph, - ScreenSpaceEventType.LEFT_DOWN + ScreenSpaceEventType.LEFT_DOWN, ); transitioner._morphHandler.setInputAction( completeMorph, - ScreenSpaceEventType.MIDDLE_DOWN + ScreenSpaceEventType.MIDDLE_DOWN, ); transitioner._morphHandler.setInputAction( completeMorph, - ScreenSpaceEventType.RIGHT_DOWN + ScreenSpaceEventType.RIGHT_DOWN, ); transitioner._morphHandler.setInputAction( completeMorph, - ScreenSpaceEventType.WHEEL + ScreenSpaceEventType.WHEEL, ); } } @@ -376,18 +376,18 @@ function getColumbusViewTo3DCamera(transitioner, ellipsoid) { const positionCarto = scene.mapProjection.unproject( camera.position, - scratchCVTo3DCartographic + scratchCVTo3DCartographic, ); ellipsoid.cartographicToCartesian(positionCarto, position); const surfacePoint = ellipsoid.scaleToGeodeticSurface( position, - scratchCVTo3DSurfacePoint + scratchCVTo3DSurfacePoint, ); const fromENU = Transforms.eastNorthUpToFixedFrame( surfacePoint, ellipsoid, - scratchCVTo3DFromENU + scratchCVTo3DFromENU, ); Matrix4.multiplyByPointAsVector(fromENU, camera.direction, direction); @@ -407,7 +407,7 @@ function morphFromColumbusViewTo3D( transitioner, duration, endCamera, - complete + complete, ) { duration *= 0.5; @@ -421,17 +421,17 @@ function morphFromColumbusViewTo3D( const endPos = Matrix4.multiplyByPoint( Camera.TRANSFORM_2D_INVERSE, endCamera.position, - scratchCVTo3DEndPos + scratchCVTo3DEndPos, ); const endDir = Matrix4.multiplyByPointAsVector( Camera.TRANSFORM_2D_INVERSE, endCamera.direction, - scratchCVTo3DEndDir + scratchCVTo3DEndDir, ); const endUp = Matrix4.multiplyByPointAsVector( Camera.TRANSFORM_2D_INVERSE, endCamera.up, - scratchCVTo3DEndUp + scratchCVTo3DEndUp, ); function update(value) { @@ -481,7 +481,7 @@ function morphFrom2DTo3D(transitioner, duration, ellipsoid) { 0.0, 5.0 * ellipsoid.maximumRadius, ellipsoid, - camera3D.position + camera3D.position, ); Cartesian3.negate(camera3D.position, camera3D.direction); Cartesian3.normalize(camera3D.direction, camera3D.direction); @@ -521,7 +521,7 @@ function morphFrom2DTo3D(transitioner, duration, ellipsoid) { camera3D, function () { morphFromColumbusViewTo3D(transitioner, duration, camera3D, complete); - } + }, ); }; } @@ -535,7 +535,7 @@ function morphFrom2DTo3D(transitioner, duration, ellipsoid) { 0.0, 5.0 * ellipsoid.maximumRadius, ellipsoid, - scratch3DToCVEndPos + scratch3DToCVEndPos, ), complete: function () { scene._mode = SceneMode.MORPHING; @@ -557,7 +557,7 @@ function morphPerspectiveToOrthographic( duration, endCamera, updateHeight, - complete + complete, ) { const scene = transitioner._scene; const camera = scene.camera; @@ -636,7 +636,7 @@ function morphFromColumbusViewTo2D(transitioner, duration) { Matrix4.multiplyByPointAsVector( Camera.TRANSFORM_2D, startDir, - ray.direction + ray.direction, ); const globe = scene.globe; @@ -645,7 +645,7 @@ function morphFromColumbusViewTo2D(transitioner, duration) { ray, scene, true, - scratchCVTo2DPickPos + scratchCVTo2DPickPos, ); if (defined(pickPos)) { Matrix4.multiplyByPoint(Camera.TRANSFORM_2D_INVERSE, pickPos, endPos); @@ -699,7 +699,7 @@ function morphFromColumbusViewTo2D(transitioner, duration) { duration, camera2D, updateHeight, - complete + complete, ); }, }); @@ -742,7 +742,7 @@ function morphFrom3DTo2D(transitioner, duration, ellipsoid) { } else { ellipsoid.cartesianToCartographic( camera.positionWC, - scratch3DTo2DCartographic + scratch3DTo2DCartographic, ); scene.mapProjection.project(scratch3DTo2DCartographic, camera2D.position); @@ -754,19 +754,19 @@ function morphFrom3DTo2D(transitioner, duration, ellipsoid) { const rayDirection = Cartesian3.clone(camera.directionWC, ray.direction); const surfacePoint = ellipsoid.scaleToGeodeticSurface( camera.positionWC, - scratch3DTo2DSurfacePoint + scratch3DTo2DSurfacePoint, ); const toENU = Transforms.eastNorthUpToFixedFrame( surfacePoint, ellipsoid, - scratch3DTo2DToENU + scratch3DTo2DToENU, ); Matrix4.inverseTransformation(toENU, toENU); Matrix4.multiplyByPointAsVector(toENU, rayDirection, rayDirection); Matrix4.multiplyByPointAsVector( Camera.TRANSFORM_2D, rayDirection, - rayDirection + rayDirection, ); const globe = scene.globe; @@ -775,7 +775,7 @@ function morphFrom3DTo2D(transitioner, duration, ellipsoid) { ray, scene, true, - scratch3DTo2DPickPosition + scratch3DTo2DPickPosition, ); if (defined(pickedPos)) { const height = Cartesian3.distance(camera2D.position2D, pickedPos); @@ -792,17 +792,17 @@ function morphFrom3DTo2D(transitioner, duration, ellipsoid) { Matrix4.multiplyByPoint( Camera.TRANSFORM_2D, camera2D.position, - camera2D.position2D + camera2D.position2D, ); Matrix4.multiplyByPointAsVector( Camera.TRANSFORM_2D, camera2D.direction, - camera2D.direction2D + camera2D.direction2D, ); Matrix4.multiplyByPointAsVector( Camera.TRANSFORM_2D, camera2D.up, - camera2D.up2D + camera2D.up2D, ); const frustum = camera2D.frustum; @@ -816,7 +816,7 @@ function morphFrom3DTo2D(transitioner, duration, ellipsoid) { Matrix4.multiplyByPoint( Camera.TRANSFORM_2D_INVERSE, camera2D.position2D, - endCamera.position + endCamera.position, ); Cartesian3.clone(camera2D.direction, endCamera.direction); Cartesian3.clone(camera2D.up, endCamera.up); @@ -831,7 +831,7 @@ function morphFrom3DTo2D(transitioner, duration, ellipsoid) { duration, camera2D, updateHeight, - complete + complete, ); } morphFrom3DToColumbusView(transitioner, duration, camera2D, completeCallback); @@ -841,7 +841,7 @@ function morphOrthographicToPerspective( transitioner, duration, cameraCV, - complete + complete, ) { const scene = transitioner._scene; const camera = scene.camera; @@ -931,7 +931,7 @@ function morphFrom3DToColumbusView( transitioner, duration, endCamera, - complete + complete, ) { const scene = transitioner._scene; const camera = scene.camera; @@ -975,7 +975,7 @@ function addMorphTimeAnimations( start, stop, duration, - complete + complete, ) { // Later, this will be linear and each object will adjust, if desired, in its vertex shader. const options = { @@ -1034,7 +1034,7 @@ function complete3DCallback(camera3D) { transitioner, transitioner._previousMode, SceneMode.SCENE3D, - wasMorphing + wasMorphing, ); }; } @@ -1064,7 +1064,7 @@ function complete2DCallback(camera2D) { transitioner, transitioner._previousMode, SceneMode.SCENE2D, - wasMorphing + wasMorphing, ); }; } @@ -1104,7 +1104,7 @@ function completeColumbusViewCallback(cameraCV) { transitioner, transitioner._previousMode, SceneMode.COLUMBUS_VIEW, - wasMorphing + wasMorphing, ); }; } diff --git a/packages/engine/Source/Scene/ScreenSpaceCameraController.js b/packages/engine/Source/Scene/ScreenSpaceCameraController.js index 44493e3def42..54e7aee3e113 100644 --- a/packages/engine/Source/Scene/ScreenSpaceCameraController.js +++ b/packages/engine/Source/Scene/ScreenSpaceCameraController.js @@ -242,7 +242,7 @@ function ScreenSpaceCameraController(scene) { * @default 4000.0 or scene.ellipsoid.minimumRadius * 0.00063 */ this.minimumPickingTerrainDistanceWithInertia = Ellipsoid.WGS84.equals( - ellipsoid + ellipsoid, ) ? 4000.0 : ellipsoid.minimumRadius * 0.00063; @@ -328,7 +328,7 @@ function ScreenSpaceCameraController(scene) { const projection = scene.mapProjection; this._maxCoord = projection.project( - new Cartographic(Math.PI, CesiumMath.PI_OVER_TWO) + new Cartographic(Math.PI, CesiumMath.PI_OVER_TWO), ); // Constants, Make any of these public? @@ -355,7 +355,7 @@ function sameMousePosition(movement) { return Cartesian2.equalsEpsilon( movement.startPosition, movement.endPosition, - CesiumMath.EPSILON14 + CesiumMath.EPSILON14, ); } @@ -372,7 +372,7 @@ function maintainInertia( decayCoef, action, object, - lastMovementName + lastMovementName, ) { let movementState = object[lastMovementName]; if (!defined(movementState)) { @@ -410,18 +410,18 @@ function maintainInertia( movementState.startPosition = Cartesian2.clone( lastMovement.startPosition, - movementState.startPosition + movementState.startPosition, ); movementState.endPosition = Cartesian2.multiplyByScalar( movementState.motion, d, - movementState.endPosition + movementState.endPosition, ); movementState.endPosition = Cartesian2.add( movementState.startPosition, movementState.endPosition, - movementState.endPosition + movementState.endPosition, ); // If value from the decreasing exponential function is close to zero, @@ -431,7 +431,7 @@ function maintainInertia( isNaN(movementState.endPosition.y) || Cartesian2.distance( movementState.startPosition, - movementState.endPosition + movementState.endPosition, ) < 0.5 ) { return; @@ -473,7 +473,7 @@ function reactToInput( eventTypes, action, inertiaConstant, - inertiaStateName + inertiaStateName, ) { if (!defined(eventTypes)) { return; @@ -509,7 +509,7 @@ function reactToInput( inertiaConstant, action, controller, - inertiaStateName + inertiaStateName, ); } } @@ -551,14 +551,14 @@ function handleZoom( movement, zoomFactor, distanceMeasure, - unitPositionDotDirection + unitPositionDotDirection, ) { let percentage = 1.0; if (defined(unitPositionDotDirection)) { percentage = CesiumMath.clamp( Math.abs(unitPositionDotDirection), 0.25, - 1.0 + 1.0, ); } @@ -577,7 +577,7 @@ function handleZoom( zoomRate = CesiumMath.clamp( zoomRate, object._minimumZoomRate, - object._maximumZoomRate + object._maximumZoomRate, ); let rangeWindowRatio = diff / object._scene.canvas.clientHeight; @@ -623,7 +623,7 @@ function handleZoom( const sameStartPosition = defaultValue( movement.inertiaEnabled, - Cartesian2.equals(startPosition, object._zoomMouseStart) + Cartesian2.equals(startPosition, object._zoomMouseStart), ); let zoomingOnVector = object._zoomingOnVector; let rotatingZoom = object._rotatingZoom; @@ -632,23 +632,25 @@ function handleZoom( if (!sameStartPosition) { object._zoomMouseStart = Cartesian2.clone( startPosition, - object._zoomMouseStart + object._zoomMouseStart, ); // When camera transform is set, such as tracking an entity, object._globe will be undefined, and no position should be picked if (defined(object._globe) && mode === SceneMode.SCENE2D) { - pickedPosition = camera.getPickRay(startPosition, scratchZoomPickRay) - .origin; + pickedPosition = camera.getPickRay( + startPosition, + scratchZoomPickRay, + ).origin; pickedPosition = Cartesian3.fromElements( pickedPosition.y, pickedPosition.z, - pickedPosition.x + pickedPosition.x, ); } else if (defined(object._globe)) { pickedPosition = pickPosition( object, startPosition, - scratchPickCartesian + scratchPickCartesian, ); } @@ -656,7 +658,7 @@ function handleZoom( object._useZoomWorldPosition = true; object._zoomWorldPosition = Cartesian3.clone( pickedPosition, - object._zoomWorldPosition + object._zoomWorldPosition, ); } else { object._useZoomWorldPosition = false; @@ -692,7 +694,7 @@ function handleZoom( const direction = Cartesian3.subtract( worldPosition, endPosition, - scratchZoomDirection + scratchZoomDirection, ); Cartesian3.normalize(direction, direction); @@ -705,23 +707,25 @@ function handleZoom( (camera.position.x < 0.0 && savedX > 0.0) || (camera.position.x > 0.0 && savedX < 0.0) ) { - pickedPosition = camera.getPickRay(startPosition, scratchZoomPickRay) - .origin; + pickedPosition = camera.getPickRay( + startPosition, + scratchZoomPickRay, + ).origin; pickedPosition = Cartesian3.fromElements( pickedPosition.y, pickedPosition.z, - pickedPosition.x + pickedPosition.x, ); object._zoomWorldPosition = Cartesian3.clone( pickedPosition, - object._zoomWorldPosition + object._zoomWorldPosition, ); } } } else if (mode === SceneMode.SCENE3D) { const cameraPositionNormal = Cartesian3.normalize( camera.position, - scratchCameraPositionNormal + scratchCameraPositionNormal, ); if ( object._cameraUnderground || @@ -740,7 +744,7 @@ function handleZoom( const centerPosition = pickPosition( object, centerPixel, - scratchCenterPosition + scratchCenterPosition, ); // If centerPosition is not defined, it means the globe does not cover the center position of screen @@ -772,7 +776,7 @@ function handleZoom( Cartesian3.add( cameraPosition, Cartesian3.multiplyByScalar(forward, 1000, scratchCartesian), - center + center, ); const positionToTarget = scratchPositionToTarget; @@ -783,7 +787,7 @@ function handleZoom( const alphaDot = Cartesian3.dot( cameraPositionNormal, - positionToTargetNormal + positionToTargetNormal, ); if (alphaDot >= 0.0) { // We zoomed past the target, and this zoom is not valid anymore. @@ -795,23 +799,22 @@ function handleZoom( const cameraDistance = Cartesian3.magnitude(cameraPosition); const targetDistance = Cartesian3.magnitude(target); const remainingDistance = cameraDistance - distance; - const positionToTargetDistance = Cartesian3.magnitude( - positionToTarget - ); + const positionToTargetDistance = + Cartesian3.magnitude(positionToTarget); const gamma = Math.asin( CesiumMath.clamp( (positionToTargetDistance / targetDistance) * Math.sin(alpha), -1.0, - 1.0 - ) + 1.0, + ), ); const delta = Math.asin( CesiumMath.clamp( (remainingDistance / targetDistance) * Math.sin(alpha), -1.0, - 1.0 - ) + 1.0, + ), ); const beta = gamma - delta + alpha; @@ -823,20 +826,20 @@ function handleZoom( Cartesian3.normalize( Cartesian3.cross(up, right, scratchCartesian), - forward + forward, ); // Calculate new position to move to Cartesian3.multiplyByScalar( Cartesian3.normalize(center, scratchCartesian), Cartesian3.magnitude(center) - distance, - center + center, ); Cartesian3.normalize(cameraPosition, cameraPosition); Cartesian3.multiplyByScalar( cameraPosition, remainingDistance, - cameraPosition + cameraPosition, ); // Pan @@ -846,24 +849,24 @@ function handleZoom( Cartesian3.multiplyByScalar( up, Math.cos(beta) - 1, - scratchCartesianTwo + scratchCartesianTwo, ), Cartesian3.multiplyByScalar( forward, Math.sin(beta), - scratchCartesianThree + scratchCartesianThree, ), - scratchCartesian + scratchCartesian, ), remainingDistance, - pMid + pMid, ); Cartesian3.add(cameraPosition, pMid, cameraPosition); Cartesian3.normalize(center, up); Cartesian3.normalize( Cartesian3.cross(up, right, scratchCartesian), - forward + forward, ); const cMid = scratchCenterMovement; @@ -872,17 +875,17 @@ function handleZoom( Cartesian3.multiplyByScalar( up, Math.cos(beta) - 1, - scratchCartesianTwo + scratchCartesianTwo, ), Cartesian3.multiplyByScalar( forward, Math.sin(beta), - scratchCartesianThree + scratchCartesianThree, ), - scratchCartesian + scratchCartesian, ), Cartesian3.magnitude(center), - cMid + cMid, ); Cartesian3.add(center, cMid, center); @@ -894,7 +897,7 @@ function handleZoom( // Set new direction Cartesian3.normalize( Cartesian3.subtract(center, cameraPosition, scratchCartesian), - camera.direction + camera.direction, ); Cartesian3.clone(camera.direction, camera.direction); @@ -908,11 +911,11 @@ function handleZoom( } else { const positionNormal = Cartesian3.normalize( centerPosition, - scratchPositionNormal + scratchPositionNormal, ); const pickedNormal = Cartesian3.normalize( object._zoomWorldPosition, - scratchPickNormal + scratchPickNormal, ); const dotProduct = Cartesian3.dot(pickedNormal, positionNormal); @@ -921,7 +924,7 @@ function handleZoom( const axis = Cartesian3.cross( pickedNormal, positionNormal, - scratchZoomAxis + scratchZoomAxis, ); const denom = @@ -943,7 +946,7 @@ function handleZoom( const zoomMouseStart = SceneTransforms.worldToWindowCoordinates( scene, object._zoomWorldPosition, - scratchZoomOffset + scratchZoomOffset, ); if ( mode !== SceneMode.COLUMBUS_VIEW && @@ -961,7 +964,7 @@ function handleZoom( rayDirection.y, rayDirection.z, rayDirection.x, - rayDirection + rayDirection, ); } @@ -984,8 +987,10 @@ const scratchTranslateP0 = new Cartesian3(); function translate2D(controller, startPosition, movement) { const scene = controller._scene; const camera = scene.camera; - let start = camera.getPickRay(movement.startPosition, translate2DStart) - .origin; + let start = camera.getPickRay( + movement.startPosition, + translate2DStart, + ).origin; let end = camera.getPickRay(movement.endPosition, translate2DEnd).origin; start = Cartesian3.fromElements(start.y, start.z, start.x, start); @@ -1013,7 +1018,7 @@ function zoom2D(controller, startPosition, movement) { startPosition, movement, controller.zoomFactor, - camera.getMagnitude() + camera.getMagnitude(), ); } @@ -1089,7 +1094,7 @@ function update2D(controller) { controller.zoomEventTypes, zoom2D, controller.inertiaZoom, - "_lastInertiaZoomMovement" + "_lastInertiaZoomMovement", ); if (rotatable2D) { reactToInput( @@ -1098,7 +1103,7 @@ function update2D(controller) { controller.translateEventTypes, twist2D, controller.inertiaSpin, - "_lastInertiaSpinMovement" + "_lastInertiaSpinMovement", ); } } else { @@ -1108,7 +1113,7 @@ function update2D(controller) { controller.translateEventTypes, translate2D, controller.inertiaTranslate, - "_lastInertiaTranslateMovement" + "_lastInertiaTranslateMovement", ); reactToInput( controller, @@ -1116,7 +1121,7 @@ function update2D(controller) { controller.zoomEventTypes, zoom2D, controller.inertiaZoom, - "_lastInertiaZoomMovement" + "_lastInertiaZoomMovement", ); if (rotatable2D) { reactToInput( @@ -1125,7 +1130,7 @@ function update2D(controller) { controller.tiltEventTypes, twist2D, controller.inertiaSpin, - "_lastInertiaTiltMovement" + "_lastInertiaTiltMovement", ); } } @@ -1144,7 +1149,7 @@ function pickPosition(controller, mousePosition, result) { if (scene.pickPositionSupported) { depthIntersection = scene.pickPositionWorldCoordinates( mousePosition, - scratchDepthIntersection + scratchDepthIntersection, ); } @@ -1158,7 +1163,7 @@ function pickPosition(controller, mousePosition, result) { ray, scene, cullBackFaces, - scratchRayIntersection + scratchRayIntersection, ); const pickDistance = defined(depthIntersection) @@ -1187,7 +1192,7 @@ function getDistanceFromSurface(controller) { if (mode === SceneMode.SCENE3D) { const cartographic = ellipsoid.cartesianToCartographic( camera.position, - scratchDistanceCartographic + scratchDistanceCartographic, ); if (defined(cartographic)) { height = cartographic.height; @@ -1222,7 +1227,7 @@ function getTiltCenterUnderground(controller, ray, pickedPosition, result) { const maximumDistance = CesiumMath.clamp( distanceFromSurface * 5.0, controller._minimumUndergroundPickDistance, - controller._maximumUndergroundPickDistance + controller._maximumUndergroundPickDistance, ); if (distance > maximumDistance) { @@ -1238,7 +1243,7 @@ function getStrafeStartPositionUnderground( controller, ray, pickedPosition, - result + result, ) { let distance; if (!defined(pickedPosition)) { @@ -1263,7 +1268,7 @@ function continueStrafing(controller, movement) { const inertialDelta = Cartesian2.subtract( movement.endPosition, movement.startPosition, - scratchInertialDelta + scratchInertialDelta, ); const endPosition = controller._strafeEndMousePosition; Cartesian2.add(endPosition, inertialDelta, endPosition); @@ -1306,7 +1311,7 @@ function translateCV(controller, startPosition, movement) { const cameraUnderground = controller._cameraUnderground; const startMouse = Cartesian2.clone( movement.startPosition, - translateCVStartMouse + translateCVStartMouse, ); const endMouse = Cartesian2.clone(movement.endPosition, translateCVEndMouse); let startRay = camera.getPickRay(startMouse, translateCVStartRay); @@ -1333,7 +1338,7 @@ function translateCV(controller, startPosition, movement) { controller, startRay, globePos, - translateCVStartPos + translateCVStartPos, ); } Cartesian2.clone(startPosition, controller._strafeMousePosition); @@ -1350,14 +1355,14 @@ function translateCV(controller, startPosition, movement) { const startPlanePos = IntersectionTests.rayPlane( startRay, plane, - translateCVStartPos + translateCVStartPos, ); const endRay = camera.getPickRay(endMouse, translateCVEndRay); const endPlanePos = IntersectionTests.rayPlane( endRay, plane, - translateCVEndPos + translateCVEndPos, ); if (!defined(startPlanePos) || !defined(endPlanePos)) { @@ -1370,7 +1375,7 @@ function translateCV(controller, startPosition, movement) { const diff = Cartesian3.subtract( startPlanePos, endPlanePos, - translateCVDifference + translateCVDifference, ); const temp = diff.x; diff.x = diff.y; @@ -1467,7 +1472,7 @@ function rotateCVOnPlane(controller, startPosition, movement) { const transform = Transforms.eastNorthUpToFixedFrame( center, ellipsoid, - rotateCVTransform + rotateCVTransform, ); const oldGlobe = controller._globe; @@ -1554,7 +1559,7 @@ function rotateCVOnTerrain(controller, startPosition, movement) { const verticalCenter = IntersectionTests.rayPlane( ray, plane, - rotateCVVerticalCenter + rotateCVVerticalCenter, ); const projection = camera._projection; @@ -1567,7 +1572,7 @@ function rotateCVOnTerrain(controller, startPosition, movement) { const transform = Transforms.eastNorthUpToFixedFrame( center, ellipsoid, - rotateCVTransform + rotateCVTransform, ); let verticalTransform; @@ -1576,7 +1581,7 @@ function rotateCVOnTerrain(controller, startPosition, movement) { verticalCenter.y, verticalCenter.z, verticalCenter.x, - verticalCenter + verticalCenter, ); cart = projection.unproject(verticalCenter, rotateCVCart); ellipsoid.cartographicToCartesian(cart, verticalCenter); @@ -1584,7 +1589,7 @@ function rotateCVOnTerrain(controller, startPosition, movement) { verticalTransform = Transforms.eastNorthUpToFixedFrame( verticalCenter, ellipsoid, - rotateCVVerticalTransform + rotateCVVerticalTransform, ); } else { verticalTransform = transform; @@ -1605,7 +1610,7 @@ function rotateCVOnTerrain(controller, startPosition, movement) { const tangent = Cartesian3.cross( Cartesian3.UNIT_Z, Cartesian3.normalize(camera.position, rotateCVCartesian3), - rotateCVCartesian3 + rotateCVCartesian3, ); const dot = Cartesian3.dot(camera.right, tangent); @@ -1636,7 +1641,7 @@ function rotateCVOnTerrain(controller, startPosition, movement) { const right = Cartesian3.cross( camera.direction, camera.constrainedAxis, - tilt3DCartesian3 + tilt3DCartesian3, ); if ( !Cartesian3.equalsEpsilon(right, Cartesian3.ZERO, CesiumMath.EPSILON6) @@ -1663,7 +1668,7 @@ function rotateCVOnTerrain(controller, startPosition, movement) { const originalPosition = Cartesian3.clone( camera.positionWC, - rotateCVCartesian3 + rotateCVCartesian3, ); if (controller.enableCollisionDetection) { @@ -1680,7 +1685,7 @@ function rotateCVOnTerrain(controller, startPosition, movement) { Cartesian3.multiplyByScalar( camera.position, Math.sqrt(magSqrd), - camera.position + camera.position, ); } @@ -1688,14 +1693,14 @@ function rotateCVOnTerrain(controller, startPosition, movement) { const axis = Cartesian3.cross( originalPosition, camera.position, - originalPosition + originalPosition, ); Cartesian3.normalize(axis, axis); const quaternion = Quaternion.fromAxisAngle( axis, angle, - rotateCVQuaternion + rotateCVQuaternion, ); const rotation = Matrix3.fromQuaternion(quaternion, rotateCVMatrix); Matrix3.multiplyByVector(rotation, camera.direction, camera.direction); @@ -1751,7 +1756,7 @@ function zoomCV(controller, startPosition, movement) { const distanceUnderground = getZoomDistanceUnderground( controller, ray, - height + height, ); if (defined(distance)) { distance = Math.min(distance, distanceUnderground); @@ -1771,7 +1776,7 @@ function zoomCV(controller, startPosition, movement) { startPosition, movement, controller.zoomFactor, - distance + distance, ); } @@ -1786,7 +1791,7 @@ function updateCV(controller) { controller.rotateEventTypes, rotate3D, controller.inertiaSpin, - "_lastInertiaSpinMovement" + "_lastInertiaSpinMovement", ); reactToInput( controller, @@ -1794,7 +1799,7 @@ function updateCV(controller) { controller.zoomEventTypes, zoom3D, controller.inertiaZoom, - "_lastInertiaZoomMovement" + "_lastInertiaZoomMovement", ); } else { const tweens = controller._tweens; @@ -1809,7 +1814,7 @@ function updateCV(controller) { controller.tiltEventTypes, rotateCV, controller.inertiaSpin, - "_lastInertiaTiltMovement" + "_lastInertiaTiltMovement", ); reactToInput( controller, @@ -1817,7 +1822,7 @@ function updateCV(controller) { controller.translateEventTypes, translateCV, controller.inertiaTranslate, - "_lastInertiaTranslateMovement" + "_lastInertiaTranslateMovement", ); reactToInput( controller, @@ -1825,13 +1830,13 @@ function updateCV(controller) { controller.zoomEventTypes, zoomCV, controller.inertiaZoom, - "_lastInertiaZoomMovement" + "_lastInertiaZoomMovement", ); reactToInput( controller, controller.enableLook, controller.lookEventTypes, - look3D + look3D, ); if ( @@ -1839,7 +1844,7 @@ function updateCV(controller) { !tweens.contains(controller._tween) ) { const tween = camera.createCorrectPositionTween( - controller.bounceAnimationTime + controller.bounceAnimationTime, ); if (defined(tween)) { controller._tween = tweens.add(tween); @@ -1869,12 +1874,12 @@ function strafe(controller, movement, strafeStartPosition) { const plane = Plane.fromPointNormal( strafeStartPosition, direction, - scratchStrafePlane + scratchStrafePlane, ); const intersection = IntersectionTests.rayPlane( ray, plane, - scratchStrafeIntersection + scratchStrafeIntersection, ); if (!defined(intersection)) { return; @@ -1941,7 +1946,7 @@ function spin3D(controller, startPosition, movement) { const height = ellipsoid.cartesianToCartographic( camera.positionWC, - scratchCartographic + scratchCartographic, ).height; const globe = controller._globe; @@ -1949,13 +1954,13 @@ function spin3D(controller, startPosition, movement) { const mousePos = pickPosition( controller, movement.startPosition, - scratchMousePosition + scratchMousePosition, ); if (defined(mousePos)) { let strafing = false; const ray = camera.getPickRay( movement.startPosition, - pickGlobeScratchRay + pickGlobeScratchRay, ); if (cameraUnderground) { @@ -1998,8 +2003,8 @@ function spin3D(controller, startPosition, movement) { camera.pickEllipsoid( movement.startPosition, controller._ellipsoid, - spin3DPick - ) + spin3DPick, + ), ) ) { pan3D(controller, startPosition, movement, controller._ellipsoid); @@ -2021,7 +2026,7 @@ function rotate3D( movement, constrainedAxis, rotateOnlyVertical, - rotateOnlyHorizontal + rotateOnlyHorizontal, ) { rotateOnlyVertical = defaultValue(rotateOnlyVertical, false); rotateOnlyHorizontal = defaultValue(rotateOnlyHorizontal, false); @@ -2054,7 +2059,7 @@ function rotate3D( phiWindowRatio = Math.min(phiWindowRatio, controller.maximumMovementRatio); thetaWindowRatio = Math.min( thetaWindowRatio, - controller.maximumMovementRatio + controller.maximumMovementRatio, ); const deltaPhi = rotateRate * phiWindowRatio * Math.PI * 2.0; @@ -2089,15 +2094,15 @@ function pan3D(controller, startPosition, movement, ellipsoid) { const startMousePosition = Cartesian2.clone( movement.startPosition, - pan3DStartMousePosition + pan3DStartMousePosition, ); const endMousePosition = Cartesian2.clone( movement.endPosition, - pan3DEndMousePosition + pan3DEndMousePosition, ); const height = ellipsoid.cartesianToCartographic( camera.positionWC, - scratchCartographic + scratchCartographic, ).height; let p0, p1; @@ -2113,7 +2118,7 @@ function pan3D(controller, startPosition, movement, ellipsoid) { !defined(controller._globe) && !Cartesian2.equalsEpsilon( startMousePosition, - controller._panLastMousePosition + controller._panLastMousePosition, ) ) { p0 = pickPosition(controller, startMousePosition, pan3DP0); @@ -2124,7 +2129,7 @@ function pan3D(controller, startPosition, movement, ellipsoid) { const toCenterProj = Cartesian3.multiplyByScalar( camera.directionWC, Cartesian3.dot(camera.directionWC, toCenter), - pan3DTemp1 + pan3DTemp1, ); const distanceToNearPlane = Cartesian3.magnitude(toCenterProj); const pixelDimensions = camera.frustum.getPixelDimensions( @@ -2132,33 +2137,35 @@ function pan3D(controller, startPosition, movement, ellipsoid) { scene.drawingBufferHeight, distanceToNearPlane, scene.pixelRatio, - pan3DPixelDimensions + pan3DPixelDimensions, ); const dragDelta = Cartesian2.subtract( endMousePosition, startMousePosition, - pan3DDiffMousePosition + pan3DDiffMousePosition, ); // Move the camera to the the distance the cursor moved in worldspace const right = Cartesian3.multiplyByScalar( camera.rightWC, dragDelta.x * pixelDimensions.x, - pan3DTemp1 + pan3DTemp1, ); // Move the camera towards the picked position in worldspace as the camera is pointed towards a horizon view const cameraPositionNormal = Cartesian3.normalize( camera.positionWC, - scratchCameraPositionNormal + scratchCameraPositionNormal, ); - const endPickDirection = camera.getPickRay(endMousePosition, panRay) - .direction; + const endPickDirection = camera.getPickRay( + endMousePosition, + panRay, + ).direction; const endPickProj = Cartesian3.subtract( endPickDirection, Cartesian3.projectVector(endPickDirection, camera.rightWC, pan3DTemp2), - pan3DTemp2 + pan3DTemp2, ); const angle = Cartesian3.angleBetween(endPickProj, camera.directionWC); let forward = 1.0; @@ -2166,7 +2173,7 @@ function pan3D(controller, startPosition, movement, ellipsoid) { forward = Math.max(Math.tan(angle), 0.1); // Clamp so we don't make the magnitude infinitely large when the angle is small } let dot = Math.abs( - Cartesian3.dot(camera.directionWC, cameraPositionNormal) + Cartesian3.dot(camera.directionWC, cameraPositionNormal), ); const magnitude = ((-dragDelta.y * pixelDimensions.y * 2.0) / Math.sqrt(forward)) * @@ -2174,7 +2181,7 @@ function pan3D(controller, startPosition, movement, ellipsoid) { const direction = Cartesian3.multiplyByScalar( endPickDirection, magnitude, - pan3DTemp2 + pan3DTemp2, ); // Move the camera up the distance the cursor moved in worldspace as the camera is pointed towards the center @@ -2182,7 +2189,7 @@ function pan3D(controller, startPosition, movement, ellipsoid) { const up = Cartesian3.multiplyByScalar( camera.upWC, -dragDelta.y * (1.0 - dot) * pixelDimensions.y, - pan3DTemp3 + pan3DTemp3, ); p1 = Cartesian3.add(p0, right, pan3DP1); @@ -2267,11 +2274,11 @@ function pan3D(controller, startPosition, movement, ellipsoid) { const planeNormal = Cartesian3.cross(basis0, east, pan3DTemp0); const side0 = Cartesian3.dot( planeNormal, - Cartesian3.subtract(p0, basis0, pan3DTemp1) + Cartesian3.subtract(p0, basis0, pan3DTemp1), ); const side1 = Cartesian3.dot( planeNormal, - Cartesian3.subtract(p1, basis0, pan3DTemp1) + Cartesian3.subtract(p1, basis0, pan3DTemp1), ); let deltaTheta; @@ -2325,7 +2332,7 @@ function zoom3D(controller, startPosition, movement) { let intersection; const height = ellipsoid.cartesianToCartographic( camera.position, - zoom3DCartographic + zoom3DCartographic, ).height; const approachingCollision = @@ -2349,7 +2356,7 @@ function zoom3D(controller, startPosition, movement) { const distanceUnderground = getZoomDistanceUnderground( controller, ray, - height + height, ); if (defined(distance)) { distance = Math.min(distance, distanceUnderground); @@ -2364,7 +2371,7 @@ function zoom3D(controller, startPosition, movement) { const unitPosition = Cartesian3.normalize( camera.position, - zoom3DUnitPosition + zoom3DUnitPosition, ); handleZoom( controller, @@ -2372,7 +2379,7 @@ function zoom3D(controller, startPosition, movement) { movement, controller.zoomFactor, distance, - Cartesian3.dot(unitPosition, camera.direction) + Cartesian3.dot(unitPosition, camera.direction), ); } @@ -2408,7 +2415,7 @@ function tilt3D(controller, startPosition, movement) { if (controller._looking) { const up = controller._ellipsoid.geodeticSurfaceNormal( camera.position, - tilt3DLookUp + tilt3DLookUp, ); look3D(controller, startPosition, movement, up); return; @@ -2417,7 +2424,7 @@ function tilt3D(controller, startPosition, movement) { const ellipsoid = controller._ellipsoid; const cartographic = ellipsoid.cartesianToCartographic( camera.position, - tilt3DCart + tilt3DCart, ); if ( @@ -2440,7 +2447,7 @@ function tilt3DOnEllipsoid(controller, startPosition, movement) { const minHeight = controller.minimumZoomDistance * 0.25; const height = ellipsoid.cartesianToCartographic( camera.positionWC, - tilt3DOnEllipsoidCartographic + tilt3DOnEllipsoidCartographic, ).height; if ( height - minHeight - 1.0 < CesiumMath.EPSILON3 && @@ -2463,25 +2470,25 @@ function tilt3DOnEllipsoid(controller, startPosition, movement) { } else if (height > controller._minimumTrackBallHeight) { const grazingAltitudeLocation = IntersectionTests.grazingAltitudeLocation( ray, - ellipsoid + ellipsoid, ); if (!defined(grazingAltitudeLocation)) { return; } const grazingAltitudeCart = ellipsoid.cartesianToCartographic( grazingAltitudeLocation, - tilt3DCart + tilt3DCart, ); grazingAltitudeCart.height = 0.0; center = ellipsoid.cartographicToCartesian( grazingAltitudeCart, - tilt3DCenter + tilt3DCenter, ); } else { controller._looking = true; const up = controller._ellipsoid.geodeticSurfaceNormal( camera.position, - tilt3DLookUp + tilt3DLookUp, ); look3D(controller, startPosition, movement, up); Cartesian2.clone(startPosition, controller._tiltCenterMousePosition); @@ -2491,7 +2498,7 @@ function tilt3DOnEllipsoid(controller, startPosition, movement) { const transform = Transforms.eastNorthUpToFixedFrame( center, ellipsoid, - tilt3DTransform + tilt3DTransform, ); const oldGlobe = controller._globe; @@ -2536,13 +2543,13 @@ function tilt3DOnTerrain(controller, startPosition, movement) { if (!defined(intersection)) { const cartographic = ellipsoid.cartesianToCartographic( camera.position, - tilt3DCart + tilt3DCart, ); if (cartographic.height <= controller._minimumTrackBallHeight) { controller._looking = true; const up = controller._ellipsoid.geodeticSurfaceNormal( camera.position, - tilt3DLookUp + tilt3DLookUp, ); look3D(controller, startPosition, movement, up); Cartesian2.clone(startPosition, controller._tiltCenterMousePosition); @@ -2588,12 +2595,12 @@ function tilt3DOnTerrain(controller, startPosition, movement) { const transform = Transforms.eastNorthUpToFixedFrame( center, ellipsoid, - tilt3DTransform + tilt3DTransform, ); const verticalTransform = Transforms.eastNorthUpToFixedFrame( verticalCenter, newEllipsoid, - tilt3DVerticalTransform + tilt3DVerticalTransform, ); const oldGlobe = controller._globe; @@ -2611,7 +2618,7 @@ function tilt3DOnTerrain(controller, startPosition, movement) { const tangent = Cartesian3.cross( verticalCenter, camera.positionWC, - tilt3DCartesian3 + tilt3DCartesian3, ); const dot = Cartesian3.dot(camera.rightWC, tangent); @@ -2642,7 +2649,7 @@ function tilt3DOnTerrain(controller, startPosition, movement) { const right = Cartesian3.cross( camera.direction, camera.constrainedAxis, - tilt3DCartesian3 + tilt3DCartesian3, ); if ( !Cartesian3.equalsEpsilon(right, Cartesian3.ZERO, CesiumMath.EPSILON6) @@ -2669,7 +2676,7 @@ function tilt3DOnTerrain(controller, startPosition, movement) { const originalPosition = Cartesian3.clone( camera.positionWC, - tilt3DCartesian3 + tilt3DCartesian3, ); if (controller.enableCollisionDetection) { @@ -2686,7 +2693,7 @@ function tilt3DOnTerrain(controller, startPosition, movement) { Cartesian3.multiplyByScalar( camera.position, Math.sqrt(magSqrd), - camera.position + camera.position, ); } @@ -2694,7 +2701,7 @@ function tilt3DOnTerrain(controller, startPosition, movement) { const axis = Cartesian3.cross( originalPosition, camera.position, - originalPosition + originalPosition, ); Cartesian3.normalize(axis, axis); @@ -2805,17 +2812,17 @@ function look3D(controller, startPosition, movement, rotationAxis) { const direction = camera.direction; const negativeRotationAxis = Cartesian3.negate( rotationAxis, - look3DNegativeRot + look3DNegativeRot, ); const northParallel = Cartesian3.equalsEpsilon( direction, rotationAxis, - CesiumMath.EPSILON2 + CesiumMath.EPSILON2, ); const southParallel = Cartesian3.equalsEpsilon( direction, negativeRotationAxis, - CesiumMath.EPSILON2 + CesiumMath.EPSILON2, ); if (!northParallel && !southParallel) { dot = Cartesian3.dot(direction, rotationAxis); @@ -2847,7 +2854,7 @@ function update3D(controller) { controller.rotateEventTypes, spin3D, controller.inertiaSpin, - "_lastInertiaSpinMovement" + "_lastInertiaSpinMovement", ); reactToInput( controller, @@ -2855,7 +2862,7 @@ function update3D(controller) { controller.zoomEventTypes, zoom3D, controller.inertiaZoom, - "_lastInertiaZoomMovement" + "_lastInertiaZoomMovement", ); reactToInput( controller, @@ -2863,13 +2870,13 @@ function update3D(controller) { controller.tiltEventTypes, tilt3D, controller.inertiaSpin, - "_lastInertiaTiltMovement" + "_lastInertiaTiltMovement", ); reactToInput( controller, controller.enableLook, controller.lookEventTypes, - look3D + look3D, ); } @@ -2944,7 +2951,7 @@ function adjustHeightForTerrain(controller, cameraChanged) { Cartesian3.multiplyByScalar( camera.position, Math.max(mag, controller.minimumZoomDistance), - camera.position + camera.position, ); Cartesian3.normalize(camera.direction, camera.direction); Cartesian3.cross(camera.direction, camera.up, camera.right); @@ -2993,17 +3000,17 @@ ScreenSpaceCameraController.prototype.update = function () { this._minimumCollisionTerrainHeight = VerticalExaggeration.getHeight( this.minimumCollisionTerrainHeight, verticalExaggeration, - verticalExaggerationRelativeHeight + verticalExaggerationRelativeHeight, ); this._minimumPickingTerrainHeight = VerticalExaggeration.getHeight( this.minimumPickingTerrainHeight, verticalExaggeration, - verticalExaggerationRelativeHeight + verticalExaggerationRelativeHeight, ); this._minimumTrackBallHeight = VerticalExaggeration.getHeight( this.minimumTrackBallHeight, verticalExaggeration, - verticalExaggerationRelativeHeight + verticalExaggerationRelativeHeight, ); this._cameraUnderground = scene.cameraUnderground && defined(this._globe); @@ -3015,11 +3022,11 @@ ScreenSpaceCameraController.prototype.update = function () { this._adjustedHeightForTerrain = false; const previousPosition = Cartesian3.clone( camera.positionWC, - scratchPreviousPosition + scratchPreviousPosition, ); const previousDirection = Cartesian3.clone( camera.directionWC, - scratchPreviousDirection + scratchPreviousDirection, ); if (mode === SceneMode.SCENE2D) { diff --git a/packages/engine/Source/Scene/SensorVolumePortionToDisplay.js b/packages/engine/Source/Scene/SensorVolumePortionToDisplay.js index 98a3389b9e0c..1a6bd126eece 100644 --- a/packages/engine/Source/Scene/SensorVolumePortionToDisplay.js +++ b/packages/engine/Source/Scene/SensorVolumePortionToDisplay.js @@ -61,7 +61,7 @@ SensorVolumePortionToDisplay.toString = function (portionToDisplay) { return "ABOVE_ELLIPSOID_HORIZON"; default: throw new DeveloperError( - "SensorVolumePortionToDisplay value is not valid and cannot be converted to a String." + "SensorVolumePortionToDisplay value is not valid and cannot be converted to a String.", ); } }; diff --git a/packages/engine/Source/Scene/ShadowMap.js b/packages/engine/Source/Scene/ShadowMap.js index 3d8aaf1bd858..448d9816bf1e 100644 --- a/packages/engine/Source/Scene/ShadowMap.js +++ b/packages/engine/Source/Scene/ShadowMap.js @@ -331,15 +331,15 @@ function createRenderStates(shadowMap) { const colorMask = !shadowMap._usesDepthTexture; shadowMap._primitiveRenderState = createRenderState( colorMask, - shadowMap._primitiveBias + shadowMap._primitiveBias, ); shadowMap._terrainRenderState = createRenderState( colorMask, - shadowMap._terrainBias + shadowMap._terrainBias, ); shadowMap._pointRenderState = createRenderState( colorMask, - shadowMap._pointBias + shadowMap._pointBias, ); } @@ -715,7 +715,7 @@ function resize(shadowMap, size) { size, size, size, - size + size, ); } @@ -724,7 +724,7 @@ function resize(shadowMap, size) { 0, 0, textureSize.x, - textureSize.y + textureSize.y, ); // Transforms shadow coordinates [0, 1] into the pass's region of the texture @@ -751,7 +751,7 @@ function resize(shadowMap, size) { 0.0, 0.0, 0.0, - 1.0 + 1.0, ); } } @@ -988,20 +988,20 @@ function applyDebugSettings(shadowMap, frameState) { uniformScale, uniformScale, uniformScale, - scratchScale + scratchScale, ); const modelMatrix = Matrix4.fromTranslationQuaternionRotationScale( translation, rotation, scale, - scratchMatrix + scratchMatrix, ); shadowMap._debugLightFrustum = shadowMap._debugLightFrustum && shadowMap._debugLightFrustum.destroy(); shadowMap._debugLightFrustum = createDebugPointLight( modelMatrix, - Color.YELLOW + Color.YELLOW, ); } shadowMap._debugLightFrustum.update(frameState); @@ -1057,7 +1057,7 @@ const scaleBiasMatrix = new Matrix4( 0.0, 0.0, 0.0, - 1.0 + 1.0, ); ShadowMapCamera.prototype.getViewProjection = function () { @@ -1067,7 +1067,7 @@ ShadowMapCamera.prototype.getViewProjection = function () { Matrix4.multiply( scaleBiasMatrix, this.viewProjectionMatrix, - this.viewProjectionMatrix + this.viewProjectionMatrix, ); return this.viewProjectionMatrix; }; @@ -1121,7 +1121,7 @@ function computeCascades(shadowMap, frameState) { for (i = 0; i < numberOfCascades; ++i) { cascadeDistances[i] = Math.min( cascadeDistances[i], - shadowMap._maximumCascadeDistances[i] + shadowMap._maximumCascadeDistances[i], ); } @@ -1159,16 +1159,16 @@ function computeCascades(shadowMap, frameState) { const viewProjection = Matrix4.multiply( cascadeSubFrustum.projectionMatrix, sceneCamera.viewMatrix, - scratchMatrix + scratchMatrix, ); const inverseViewProjection = Matrix4.inverse( viewProjection, - scratchMatrix + scratchMatrix, ); const shadowMapMatrix = Matrix4.multiply( shadowViewProjection, inverseViewProjection, - scratchMatrix + scratchMatrix, ); // Project each corner from camera NDC space to shadow map texture space. Min and max will be from 0 to 1. @@ -1176,19 +1176,19 @@ function computeCascades(shadowMap, frameState) { Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE, - scratchMin + scratchMin, ); const max = Cartesian3.fromElements( -Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE, - scratchMax + scratchMax, ); for (let k = 0; k < 8; ++k) { const corner = Cartesian4.clone( frustumCornersNDC[k], - scratchFrustumCorners[k] + scratchFrustumCorners[k], ); Matrix4.multiplyByVector(shadowMapMatrix, corner, corner); Cartesian3.divideByScalar(corner, corner.w, corner); // Handle the perspective divide @@ -1219,7 +1219,7 @@ function computeCascades(shadowMap, frameState) { pass.cullingVolume = cascadeCamera.frustum.computeCullingVolume( position, direction, - up + up, ); // Transforms from eye space to the cascade's texture space @@ -1227,7 +1227,7 @@ function computeCascades(shadowMap, frameState) { Matrix4.multiply( cascadeCamera.getViewProjection(), sceneCamera.inverseViewMatrix, - cascadeMatrix + cascadeMatrix, ); Matrix4.multiply(pass.textureOffsets, cascadeMatrix, cascadeMatrix); } @@ -1246,7 +1246,7 @@ function fitShadowMapToScene(shadowMap, frameState) { const viewProjection = Matrix4.multiply( sceneCamera.frustum.projectionMatrix, sceneCamera.viewMatrix, - scratchMatrix + scratchMatrix, ); const inverseViewProjection = Matrix4.inverse(viewProjection, scratchMatrix); @@ -1264,7 +1264,7 @@ function fitShadowMapToScene(shadowMap, frameState) { 0.0, 0.0, 0.0, - scratchTranslation + scratchTranslation, ); let lightView = Matrix4.computeView( @@ -1272,12 +1272,12 @@ function fitShadowMapToScene(shadowMap, frameState) { lightDir, lightUp, lightRight, - scratchLightView + scratchLightView, ); const cameraToLight = Matrix4.multiply( lightView, inverseViewProjection, - scratchMatrix + scratchMatrix, ); // Project each corner from NDC space to light view space, and calculate a min and max in light view space @@ -1285,19 +1285,19 @@ function fitShadowMapToScene(shadowMap, frameState) { Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE, - scratchMin + scratchMin, ); const max = Cartesian3.fromElements( -Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE, - scratchMax + scratchMax, ); for (let i = 0; i < 8; ++i) { const corner = Cartesian4.clone( frustumCornersNDC[i], - scratchFrustumCorners[i] + scratchFrustumCorners[i], ); Matrix4.multiplyByVector(cameraToLight, corner, corner); Cartesian3.divideByScalar(corner, corner.w, corner); // Handle the perspective divide @@ -1336,11 +1336,11 @@ function fitShadowMapToScene(shadowMap, frameState) { Matrix4.inverse(lightView, shadowMapCamera.inverseViewMatrix); Matrix4.getTranslation( shadowMapCamera.inverseViewMatrix, - shadowMapCamera.positionWC + shadowMapCamera.positionWC, ); frameState.mapProjection.ellipsoid.cartesianToCartographic( shadowMapCamera.positionWC, - shadowMapCamera.positionCartographic + shadowMapCamera.positionCartographic, ); Cartesian3.clone(lightDir, shadowMapCamera.directionWC); Cartesian3.clone(lightUp, shadowMapCamera.upWC); @@ -1385,10 +1385,11 @@ function computeOmnidirectional(shadowMap, frameState) { for (let i = 0; i < 6; ++i) { const camera = shadowMap._passes[i].camera; camera.positionWC = shadowMap._shadowMapCamera.positionWC; - camera.positionCartographic = frameState.mapProjection.ellipsoid.cartesianToCartographic( - camera.positionWC, - camera.positionCartographic - ); + camera.positionCartographic = + frameState.mapProjection.ellipsoid.cartesianToCartographic( + camera.positionWC, + camera.positionCartographic, + ); camera.directionWC = directions[i]; camera.upWC = ups[i]; camera.rightWC = rights[i]; @@ -1398,7 +1399,7 @@ function computeOmnidirectional(shadowMap, frameState) { camera.directionWC, camera.upWC, camera.rightWC, - camera.viewMatrix + camera.viewMatrix, ); Matrix4.inverse(camera.viewMatrix, camera.inverseViewMatrix); @@ -1427,13 +1428,14 @@ function checkVisibility(shadowMap, frameState) { } // If the light source is below the horizon then the shadow map is out of view - const surfaceNormal = frameState.mapProjection.ellipsoid.geodeticSurfaceNormal( - sceneCamera.positionWC, - scratchCartesian1 - ); + const surfaceNormal = + frameState.mapProjection.ellipsoid.geodeticSurfaceNormal( + sceneCamera.positionWC, + scratchCartesian1, + ); const lightDirection = Cartesian3.negate( shadowMapCamera.directionWC, - scratchCartesian2 + scratchCartesian2, ); const dot = Cartesian3.dot(surfaceNormal, lightDirection); if (shadowMap.fadingEnabled) { @@ -1443,7 +1445,7 @@ function checkVisibility(shadowMap, frameState) { shadowMap._darkness = CesiumMath.lerp( 1.0, shadowMap.darkness, - darknessAmount + darknessAmount, ); } else { shadowMap._darkness = shadowMap.darkness; @@ -1477,9 +1479,9 @@ function checkVisibility(shadowMap, frameState) { Cartesian3.multiplyByScalar( shadowMapCamera.directionWC, frustumRadius, - scratchCenter + scratchCenter, ), - scratchCenter + scratchCenter, ); boundingSphere.center = frustumCenter; boundingSphere.radius = frustumRadius; @@ -1513,7 +1515,7 @@ function updateCameras(shadowMap, frameState) { Matrix4.multiplyByPointAsVector( camera.viewMatrix, shadowMapCamera.directionWC, - lightDirection + lightDirection, ); Cartesian3.normalize(lightDirection, lightDirection); Cartesian3.negate(lightDirection, lightDirection); @@ -1522,7 +1524,7 @@ function updateCameras(shadowMap, frameState) { Matrix4.multiplyByPoint( camera.viewMatrix, shadowMapCamera.positionWC, - shadowMap._lightPositionEC + shadowMap._lightPositionEC, ); shadowMap._lightPositionEC.w = shadowMap._pointLightRadius; @@ -1534,7 +1536,7 @@ function updateCameras(shadowMap, frameState) { // Push the far plane slightly further than the near plane to avoid degenerate frustum near = Math.min( frameState.shadowState.nearPlane, - shadowMap.maximumDistance + shadowMap.maximumDistance, ); far = Math.min(frameState.shadowState.farPlane, shadowMap.maximumDistance); far = Math.max(far, near + 1.0); @@ -1584,11 +1586,8 @@ ShadowMap.prototype.update = function (frameState) { const position = shadowMapCamera.positionWC; const direction = shadowMapCamera.directionWC; const up = shadowMapCamera.upWC; - this._shadowMapCullingVolume = shadowMapCamera.frustum.computeCullingVolume( - position, - direction, - up - ); + this._shadowMapCullingVolume = + shadowMapCamera.frustum.computeCullingVolume(position, direction, up); if (this._passes.length === 1) { // Since there is only one pass, use the shadow map camera as the pass camera. @@ -1596,7 +1595,7 @@ ShadowMap.prototype.update = function (frameState) { } } else { this._shadowMapCullingVolume = CullingVolume.fromBoundingSphere( - this._boundingSphere + this._boundingSphere, ); } } @@ -1608,7 +1607,7 @@ ShadowMap.prototype.update = function (frameState) { Matrix4.multiply( this._shadowMapCamera.getViewProjection(), inverseView, - this._shadowMapMatrix + this._shadowMapMatrix, ); } @@ -1630,8 +1629,8 @@ function combineUniforms(shadowMap, uniforms, isTerrain) { const bias = shadowMap._isPointLight ? shadowMap._pointBias : isTerrain - ? shadowMap._terrainBias - : shadowMap._primitiveBias; + ? shadowMap._terrainBias + : shadowMap._primitiveBias; const mapUniforms = { shadowMap_texture: function () { @@ -1668,7 +1667,7 @@ function combineUniforms(shadowMap, uniforms, isTerrain) { texelStepSize.y, bias.depthBias, bias.normalShadingSmooth, - this.combinedUniforms1 + this.combinedUniforms1, ); }, shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness: function () { @@ -1677,7 +1676,7 @@ function combineUniforms(shadowMap, uniforms, isTerrain) { shadowMap._distance, shadowMap.maximumDistance, shadowMap._darkness, - this.combinedUniforms2 + this.combinedUniforms2, ); }, @@ -1694,7 +1693,7 @@ function createCastDerivedCommand( command, context, oldShaderId, - result + result, ) { let castShader; let castRenderState; @@ -1725,11 +1724,11 @@ function createCastDerivedCommand( isPointLight, isTerrain, usesDepthTexture, - isOpaque + isOpaque, ); castShader = context.shaderCache.getDerivedShaderProgram( shaderProgram, - keyword + keyword, ); if (!defined(castShader)) { const vertexShaderSource = shaderProgram.vertexShaderSource; @@ -1738,13 +1737,13 @@ function createCastDerivedCommand( const castVS = ShadowMapShader.createShadowCastVertexShader( vertexShaderSource, isPointLight, - isTerrain + isTerrain, ); const castFS = ShadowMapShader.createShadowCastFragmentShader( fragmentShaderSource, isPointLight, usesDepthTexture, - isOpaque + isOpaque, ); castShader = context.shaderCache.createDerivedShaderProgram( @@ -1754,7 +1753,7 @@ function createCastDerivedCommand( vertexShaderSource: castVS, fragmentShaderSource: castFS, attributeLocations: shaderProgram._attributeLocations, - } + }, ); } @@ -1789,7 +1788,7 @@ ShadowMap.createReceiveDerivedCommand = function ( command, shadowsDirty, context, - result + result, ) { if (!defined(result)) { result = {}; @@ -1818,7 +1817,7 @@ ShadowMap.createReceiveDerivedCommand = function ( result.receiveCommand = DrawCommand.shallowClone( command, - result.receiveCommand + result.receiveCommand, ); result.castShadows = false; result.receiveShadows = true; @@ -1840,24 +1839,24 @@ ShadowMap.createReceiveDerivedCommand = function ( lightShadowMaps[0], command.castShadows, isTerrain, - hasTerrainNormal + hasTerrainNormal, ); receiveShader = context.shaderCache.getDerivedShaderProgram( shaderProgram, - keyword + keyword, ); if (!defined(receiveShader)) { const receiveVS = ShadowMapShader.createShadowReceiveVertexShader( vertexShaderSource, isTerrain, - hasTerrainNormal + hasTerrainNormal, ); const receiveFS = ShadowMapShader.createShadowReceiveFragmentShader( fragmentShaderSource, lightShadowMaps[0], command.castShadows, isTerrain, - hasTerrainNormal + hasTerrainNormal, ); receiveShader = context.shaderCache.createDerivedShaderProgram( @@ -1867,14 +1866,14 @@ ShadowMap.createReceiveDerivedCommand = function ( vertexShaderSource: receiveVS, fragmentShaderSource: receiveFS, attributeLocations: shaderProgram._attributeLocations, - } + }, ); } receiveUniformMap = combineUniforms( lightShadowMaps[0], command.uniformMap, - isTerrain + isTerrain, ); } @@ -1892,7 +1891,7 @@ ShadowMap.createCastDerivedCommand = function ( command, shadowsDirty, context, - result + result, ) { if (!defined(result)) { result = {}; @@ -1916,7 +1915,7 @@ ShadowMap.createCastDerivedCommand = function ( command, context, oldShaderId, - castCommands[i] + castCommands[i], ); } diff --git a/packages/engine/Source/Scene/ShadowMapShader.js b/packages/engine/Source/Scene/ShadowMapShader.js index fc78fcfdd937..e7e56905787f 100644 --- a/packages/engine/Source/Scene/ShadowMapShader.js +++ b/packages/engine/Source/Scene/ShadowMapShader.js @@ -10,7 +10,7 @@ ShadowMapShader.getShadowCastShaderKeyword = function ( isPointLight, isTerrain, usesDepthTexture, - isOpaque + isOpaque, ) { return `castShadow ${isPointLight} ${isTerrain} ${usesDepthTexture} ${isOpaque}`; }; @@ -18,7 +18,7 @@ ShadowMapShader.getShadowCastShaderKeyword = function ( ShadowMapShader.createShadowCastVertexShader = function ( vs, isPointLight, - isTerrain + isTerrain, ) { const defines = vs.defines.slice(0); const sources = vs.sources.slice(0); @@ -58,7 +58,7 @@ ShadowMapShader.createShadowCastFragmentShader = function ( fs, isPointLight, usesDepthTexture, - opaque + opaque, ) { const defines = fs.defines.slice(0); const sources = fs.sources.slice(0); @@ -127,7 +127,7 @@ ShadowMapShader.getShadowReceiveShaderKeyword = function ( shadowMap, castShadows, isTerrain, - hasTerrainNormal + hasTerrainNormal, ) { const usesDepthTexture = shadowMap._usesDepthTexture; const polygonOffsetSupported = shadowMap._polygonOffsetSupported; @@ -143,7 +143,7 @@ ShadowMapShader.getShadowReceiveShaderKeyword = function ( ShadowMapShader.createShadowReceiveVertexShader = function ( vs, isTerrain, - hasTerrainNormal + hasTerrainNormal, ) { const defines = vs.defines.slice(0); const sources = vs.sources.slice(0); @@ -169,7 +169,7 @@ ShadowMapShader.createShadowReceiveFragmentShader = function ( shadowMap, castShadows, isTerrain, - hasTerrainNormal + hasTerrainNormal, ) { const normalVaryingName = ShaderSource.findNormalVarying(fs); const hasNormalVarying = @@ -189,8 +189,8 @@ ShadowMapShader.createShadowReceiveFragmentShader = function ( const bias = isPointLight ? shadowMap._pointBias : isTerrain - ? shadowMap._terrainBias - : shadowMap._primitiveBias; + ? shadowMap._terrainBias + : shadowMap._primitiveBias; const defines = fs.defines.slice(0); const sources = fs.sources.slice(0); @@ -199,7 +199,7 @@ ShadowMapShader.createShadowReceiveFragmentShader = function ( for (let i = 0; i < length; ++i) { sources[i] = ShaderSource.replaceMain( sources[i], - "czm_shadow_receive_main" + "czm_shadow_receive_main", ); } diff --git a/packages/engine/Source/Scene/ShadowVolumeAppearance.js b/packages/engine/Source/Scene/ShadowVolumeAppearance.js index 1e6f0603486f..0e16baa57971 100644 --- a/packages/engine/Source/Scene/ShadowVolumeAppearance.js +++ b/packages/engine/Source/Scene/ShadowVolumeAppearance.js @@ -77,7 +77,7 @@ function ShadowVolumeAppearance(extentsCulling, planarExtents, appearance) { * @returns {ShaderSource} Shader source for the fragment shader. */ ShadowVolumeAppearance.prototype.createFragmentShader = function ( - columbusView2D + columbusView2D, ) { //>>includeStart('debug', pragmas.debug); Check.typeOf.bool("columbusView2D", columbusView2D); @@ -141,7 +141,7 @@ ShadowVolumeAppearance.prototype.createFragmentShader = function ( }; ShadowVolumeAppearance.prototype.createPickFragmentShader = function ( - columbusView2D + columbusView2D, ) { //>>includeStart('debug', pragmas.debug); Check.typeOf.bool("columbusView2D", columbusView2D); @@ -185,7 +185,7 @@ ShadowVolumeAppearance.prototype.createVertexShader = function ( defines, vertexShaderSource, columbusView2D, - mapProjection + mapProjection, ) { //>>includeStart('debug', pragmas.debug); Check.defined("defines", defines); @@ -201,7 +201,7 @@ ShadowVolumeAppearance.prototype.createVertexShader = function ( vertexShaderSource, this._appearance, mapProjection, - this._projectionExtentDefines + this._projectionExtentDefines, ); }; @@ -218,7 +218,7 @@ ShadowVolumeAppearance.prototype.createPickVertexShader = function ( defines, vertexShaderSource, columbusView2D, - mapProjection + mapProjection, ) { //>>includeStart('debug', pragmas.debug); Check.defined("defines", defines); @@ -234,7 +234,7 @@ ShadowVolumeAppearance.prototype.createPickVertexShader = function ( vertexShaderSource, undefined, mapProjection, - this._projectionExtentDefines + this._projectionExtentDefines, ); }; @@ -252,7 +252,7 @@ function createShadowVolumeAppearanceVS( vertexShaderSource, appearance, mapProjection, - projectionExtentDefines + projectionExtentDefines, ) { const allDefines = defines.slice(); @@ -263,17 +263,17 @@ function createShadowVolumeAppearanceVS( eastMostCartographic.height = 0.0; const eastMostCartesian = mapProjection.project( eastMostCartographic, - longitudeExtentsCartesianScratch + longitudeExtentsCartesianScratch, ); let encoded = EncodedCartesian3.encode( eastMostCartesian.x, - longitudeExtentsEncodeScratch + longitudeExtentsEncodeScratch, ); projectionExtentDefines.eastMostYhighDefine = `EAST_MOST_X_HIGH ${encoded.high.toFixed( - `${encoded.high}`.length + 1 + `${encoded.high}`.length + 1, )}`; projectionExtentDefines.eastMostYlowDefine = `EAST_MOST_X_LOW ${encoded.low.toFixed( - `${encoded.low}`.length + 1 + `${encoded.low}`.length + 1, )}`; const westMostCartographic = longitudeExtentsCartographicScratch; @@ -282,17 +282,17 @@ function createShadowVolumeAppearanceVS( westMostCartographic.height = 0.0; const westMostCartesian = mapProjection.project( westMostCartographic, - longitudeExtentsCartesianScratch + longitudeExtentsCartesianScratch, ); encoded = EncodedCartesian3.encode( westMostCartesian.x, - longitudeExtentsEncodeScratch + longitudeExtentsEncodeScratch, ); projectionExtentDefines.westMostYhighDefine = `WEST_MOST_X_HIGH ${encoded.high.toFixed( - `${encoded.high}`.length + 1 + `${encoded.high}`.length + 1, )}`; projectionExtentDefines.westMostYlowDefine = `WEST_MOST_X_LOW ${encoded.low.toFixed( - `${encoded.low}`.length + 1 + `${encoded.low}`.length + 1, )}`; } @@ -422,7 +422,7 @@ function pointLineDistance(point1, point2, point) { (point2.y - point1.y) * point.x - (point2.x - point1.x) * point.y + point2.x * point1.y - - point2.y * point1.x + point2.y * point1.x, ) / Cartesian2.distance(point2, point1) ); } @@ -438,24 +438,24 @@ const points2DScratch = [ // This allows simulation of baked texture coordinates for EllipseGeometry, RectangleGeometry, and PolygonGeometry. function addTextureCoordinateRotationAttributes( attributes, - textureCoordinateRotationPoints + textureCoordinateRotationPoints, ) { const points2D = points2DScratch; const minXYCorner = Cartesian2.unpack( textureCoordinateRotationPoints, 0, - points2D[0] + points2D[0], ); const maxYCorner = Cartesian2.unpack( textureCoordinateRotationPoints, 2, - points2D[1] + points2D[1], ); const maxXCorner = Cartesian2.unpack( textureCoordinateRotationPoints, 4, - points2D[2] + points2D[2], ); attributes.uMaxVmax = new GeometryInstanceAttribute({ @@ -570,23 +570,23 @@ function computeRectangleBounds( height, southWestCornerResult, eastVectorResult, - northVectorResult + northVectorResult, ) { // Compute center of rectangle const centerCartographic = Rectangle.center( rectangle, - rectangleCenterScratch + rectangleCenterScratch, ); centerCartographic.height = height; const centerCartesian = Cartographic.toCartesian( centerCartographic, ellipsoid, - rectanglePointCartesianScratch + rectanglePointCartesianScratch, ); const enuMatrix = Transforms.eastNorthUpToFixedFrame( centerCartesian, ellipsoid, - enuMatrixScratch + enuMatrixScratch, ); const inverseEnu = Matrix4.inverse(enuMatrix, inverseEnuScratch); @@ -626,7 +626,7 @@ function computeRectangleBounds( const pointCartesian = Cartographic.toCartesian( cartographics[i], ellipsoid, - rectanglePointCartesianScratch + rectanglePointCartesianScratch, ); Matrix4.multiplyByPoint(inverseEnu, pointCartesian, pointCartesian); pointCartesian.z = 0.0; // flatten into XY plane of ENU coordinate system @@ -686,13 +686,13 @@ ShadowVolumeAppearance.getPlanarTextureCoordinateAttributes = function ( textureCoordinateRotationPoints, ellipsoid, projection, - height + height, ) { //>>includeStart('debug', pragmas.debug); Check.typeOf.object("boundingRectangle", boundingRectangle); Check.defined( "textureCoordinateRotationPoints", - textureCoordinateRotationPoints + textureCoordinateRotationPoints, ); Check.typeOf.object("ellipsoid", ellipsoid); Check.typeOf.object("projection", projection); @@ -707,13 +707,13 @@ ShadowVolumeAppearance.getPlanarTextureCoordinateAttributes = function ( defaultValue(height, 0.0), corner, eastward, - northward + northward, ); const attributes = {}; addTextureCoordinateRotationAttributes( attributes, - textureCoordinateRotationPoints + textureCoordinateRotationPoints, ); const encoded = EncodedCartesian3.fromCartesian(corner, encodeScratch); @@ -757,19 +757,19 @@ function latLongToSpherical(latitude, longitude, ellipsoid, result) { const spherePoint = Cartographic.toCartesian( cartographic, ellipsoid, - spherePointScratch + spherePointScratch, ); // Project into plane with vertical for latitude const magXY = Math.sqrt( - spherePoint.x * spherePoint.x + spherePoint.y * spherePoint.y + spherePoint.x * spherePoint.x + spherePoint.y * spherePoint.y, ); // Use fastApproximateAtan2 for alignment with shader const sphereLatitude = CesiumMath.fastApproximateAtan2(magXY, spherePoint.z); const sphereLongitude = CesiumMath.fastApproximateAtan2( spherePoint.x, - spherePoint.y + spherePoint.y, ); result.x = sphereLatitude; @@ -802,13 +802,13 @@ ShadowVolumeAppearance.getSphericalExtentGeometryInstanceAttributes = function ( boundingRectangle, textureCoordinateRotationPoints, ellipsoid, - projection + projection, ) { //>>includeStart('debug', pragmas.debug); Check.typeOf.object("boundingRectangle", boundingRectangle); Check.defined( "textureCoordinateRotationPoints", - textureCoordinateRotationPoints + textureCoordinateRotationPoints, ); Check.typeOf.object("ellipsoid", ellipsoid); Check.typeOf.object("projection", projection); @@ -819,7 +819,7 @@ ShadowVolumeAppearance.getSphericalExtentGeometryInstanceAttributes = function ( boundingRectangle.south, boundingRectangle.west, ellipsoid, - sphericalScratch + sphericalScratch, ); let south = southWestExtents.x; @@ -829,7 +829,7 @@ ShadowVolumeAppearance.getSphericalExtentGeometryInstanceAttributes = function ( boundingRectangle.north, boundingRectangle.east, ellipsoid, - sphericalScratch + sphericalScratch, ); let north = northEastExtents.x; let east = northEastExtents.y; @@ -869,14 +869,14 @@ ShadowVolumeAppearance.getSphericalExtentGeometryInstanceAttributes = function ( addTextureCoordinateRotationAttributes( attributes, - textureCoordinateRotationPoints + textureCoordinateRotationPoints, ); add2DTextureCoordinateAttributes(boundingRectangle, projection, attributes); return attributes; }; ShadowVolumeAppearance.hasAttributesForTextureCoordinatePlanes = function ( - attributes + attributes, ) { return ( defined(attributes.southWest_HIGH) && @@ -891,7 +891,7 @@ ShadowVolumeAppearance.hasAttributesForTextureCoordinatePlanes = function ( }; ShadowVolumeAppearance.hasAttributesForSphericalExtents = function ( - attributes + attributes, ) { return ( defined(attributes.sphericalExtents) && diff --git a/packages/engine/Source/Scene/SingleTileImageryProvider.js b/packages/engine/Source/Scene/SingleTileImageryProvider.js index 0487027ae47f..6e51fb8d22dc 100644 --- a/packages/engine/Source/Scene/SingleTileImageryProvider.js +++ b/packages/engine/Source/Scene/SingleTileImageryProvider.js @@ -261,7 +261,7 @@ function failure(resource, error, provider, previousError) { 0, 0, 0, - error + error, ); if (reportedError.retry) { return doRequest(resource, provider, reportedError); @@ -345,7 +345,7 @@ SingleTileImageryProvider.prototype.requestImage = async function ( x, y, level, - request + request, ) { if (!this._hasError && !defined(this._image)) { const image = await doRequest(this._resource, this); @@ -373,7 +373,7 @@ SingleTileImageryProvider.prototype.pickFeatures = function ( y, level, longitude, - latitude + latitude, ) { return undefined; }; diff --git a/packages/engine/Source/Scene/SkyAtmosphere.js b/packages/engine/Source/Scene/SkyAtmosphere.js index 628737ce5610..62bffed2f0ef 100644 --- a/packages/engine/Source/Scene/SkyAtmosphere.js +++ b/packages/engine/Source/Scene/SkyAtmosphere.js @@ -66,7 +66,7 @@ function SkyAtmosphere(ellipsoid) { const scaleVector = Cartesian3.multiplyByScalar( ellipsoid.radii, outerEllipsoidScale, - new Cartesian3() + new Cartesian3(), ); this._scaleMatrix = Matrix4.fromScale(scaleVector); this._modelMatrix = new Matrix4(); @@ -251,17 +251,17 @@ SkyAtmosphere.prototype.update = function (frameState, globe) { const rotationMatrix = Matrix4.fromRotationTranslation( frameState.context.uniformState.inverseViewRotation, Cartesian3.ZERO, - scratchModelMatrix + scratchModelMatrix, ); const rotationOffsetMatrix = Matrix4.multiplyTransformation( rotationMatrix, Axis.Y_UP_TO_Z_UP, - scratchModelMatrix + scratchModelMatrix, ); const modelMatrix = Matrix4.multiply( this._scaleMatrix, rotationOffsetMatrix, - scratchModelMatrix + scratchModelMatrix, ); Matrix4.clone(modelMatrix, this._modelMatrix); @@ -281,7 +281,7 @@ SkyAtmosphere.prototype.update = function (frameState, globe) { slicePartitions: 256, stackPartitions: 256, vertexFormat: VertexFormat.POSITION_ONLY, - }) + }), ); command.vertexArray = VertexArray.fromGeometry({ context: context, @@ -346,17 +346,17 @@ function hasColorCorrection(skyAtmosphere) { CesiumMath.equalsEpsilon( skyAtmosphere.hueShift, 0.0, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ) && CesiumMath.equalsEpsilon( skyAtmosphere.saturationShift, 0.0, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ) && CesiumMath.equalsEpsilon( skyAtmosphere.brightnessShift, 0.0, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ) ); } diff --git a/packages/engine/Source/Scene/SkyBox.js b/packages/engine/Source/Scene/SkyBox.js index 66c374c76099..aa175b9d405b 100644 --- a/packages/engine/Source/Scene/SkyBox.js +++ b/packages/engine/Source/Scene/SkyBox.js @@ -119,22 +119,22 @@ SkyBox.prototype.update = function (frameState, useHdr) { Check.defined("this.sources", sources); if ( Object.values(CubeMap.FaceName).some( - (faceName) => !defined(sources[faceName]) + (faceName) => !defined(sources[faceName]), ) ) { throw new DeveloperError( - "this.sources must have positiveX, negativeX, positiveY, negativeY, positiveZ, and negativeZ properties." + "this.sources must have positiveX, negativeX, positiveY, negativeY, positiveZ, and negativeZ properties.", ); } const sourceType = typeof sources.positiveX; if ( Object.values(CubeMap.FaceName).some( - (faceName) => typeof sources[faceName] !== sourceType + (faceName) => typeof sources[faceName] !== sourceType, ) ) { throw new DeveloperError( - "this.sources properties must all be the same type." + "this.sources properties must all be the same type.", ); } //>>includeEnd('debug'); @@ -167,11 +167,10 @@ SkyBox.prototype.update = function (frameState, useHdr) { BoxGeometry.fromDimensions({ dimensions: new Cartesian3(2.0, 2.0, 2.0), vertexFormat: VertexFormat.POSITION_ONLY, - }) + }), ); - const attributeLocations = (this._attributeLocations = GeometryPipeline.createAttributeLocations( - geometry - )); + const attributeLocations = (this._attributeLocations = + GeometryPipeline.createAttributeLocations(geometry)); command.vertexArray = VertexArray.fromGeometry({ context: context, diff --git a/packages/engine/Source/Scene/SpatialNode.js b/packages/engine/Source/Scene/SpatialNode.js index 2cd71600211c..1617bb41ab23 100644 --- a/packages/engine/Source/Scene/SpatialNode.js +++ b/packages/engine/Source/Scene/SpatialNode.js @@ -75,12 +75,12 @@ SpatialNode.prototype.computeBoundingVolumes = function (shape) { this.x, this.y, this.z, - this.orientedBoundingBox + this.orientedBoundingBox, ); const halfScale = Matrix3.getScale( this.orientedBoundingBox.halfAxes, - scratchObbHalfScale + scratchObbHalfScale, ); const maximumScale = 2.0 * Cartesian3.maximumComponent(halfScale); this.approximateVoxelSize = @@ -134,7 +134,7 @@ SpatialNode.prototype.visibility = function (frameState, visibilityPlaneMask) { */ SpatialNode.prototype.computeScreenSpaceError = function ( cameraPosition, - screenSpaceErrorMultiplier + screenSpaceErrorMultiplier, ) { const obb = this.orientedBoundingBox; @@ -164,7 +164,7 @@ function findKeyframeIndex(keyframe, keyframeNodes) { return binarySearch( keyframeNodes, scratchBinarySearchKeyframeNode, - KeyframeNode.searchComparator + KeyframeNode.searchComparator, ); } @@ -174,7 +174,7 @@ function findKeyframeIndex(keyframe, keyframeNodes) { * @param {number} keyframeLocation */ SpatialNode.prototype.computeSurroundingRenderableKeyframeNodes = function ( - keyframeLocation + keyframeLocation, ) { let spatialNode = this; const startLevel = spatialNode.level; @@ -193,7 +193,7 @@ SpatialNode.prototype.computeSurroundingRenderableKeyframeNodes = function ( if (renderableKeyframeNodes.length >= 1) { const indexPrev = getKeyframeIndexPrev( targetKeyframePrev, - renderableKeyframeNodes + renderableKeyframeNodes, ); const keyframeNodePrev = renderableKeyframeNodes[indexPrev]; @@ -207,7 +207,7 @@ SpatialNode.prototype.computeSurroundingRenderableKeyframeNodes = function ( const distancePrev = targetKeyframePrev - keyframeNodePrev.keyframe; const weightedDistancePrev = getWeightedKeyframeDistance( startLevel - spatialNode.level, - distancePrev + distancePrev, ); if (weightedDistancePrev < minimumDistancePrev) { minimumDistancePrev = weightedDistancePrev; @@ -217,7 +217,7 @@ SpatialNode.prototype.computeSurroundingRenderableKeyframeNodes = function ( const distanceNext = keyframeNodeNext.keyframe - targetKeyframeNext; const weightedDistanceNext = getWeightedKeyframeDistance( startLevel - spatialNode.level, - distanceNext + distanceNext, ); if (weightedDistanceNext < minimumDistanceNext) { minimumDistanceNext = weightedDistanceNext; @@ -249,7 +249,7 @@ SpatialNode.prototype.computeSurroundingRenderableKeyframeNodes = function ( (keyframeLocation - bestKeyframePrev) / (bestKeyframeNext - bestKeyframePrev), 0.0, - 1.0 + 1.0, ); }; @@ -294,7 +294,7 @@ SpatialNode.prototype.createKeyframeNode = function (keyframe) { */ SpatialNode.prototype.destroyKeyframeNode = function ( keyframeNode, - megatextures + megatextures, ) { const keyframe = keyframeNode.keyframe; const keyframeIndex = findKeyframeIndex(keyframe, this.keyframeNodes); @@ -311,7 +311,7 @@ SpatialNode.prototype.destroyKeyframeNode = function ( const renderableKeyframeNodeIndex = findKeyframeIndex( keyframe, - this.renderableKeyframeNodes + this.renderableKeyframeNodes, ); if (renderableKeyframeNodeIndex < 0) { throw new DeveloperError("Renderable keyframe node does not exist."); @@ -334,7 +334,7 @@ SpatialNode.prototype.destroyKeyframeNode = function ( */ SpatialNode.prototype.addKeyframeNodeToMegatextures = function ( keyframeNode, - megatextures + megatextures, ) { if ( keyframeNode.state !== KeyframeNode.LoadState.RECEIVED || @@ -354,7 +354,7 @@ SpatialNode.prototype.addKeyframeNodeToMegatextures = function ( const renderableKeyframeNodes = this.renderableKeyframeNodes; let renderableKeyframeNodeIndex = findKeyframeIndex( keyframeNode.keyframe, - renderableKeyframeNodes + renderableKeyframeNodes, ); if (renderableKeyframeNodeIndex >= 0) { throw new DeveloperError("Keyframe already renderable"); diff --git a/packages/engine/Source/Scene/SphereEmitter.js b/packages/engine/Source/Scene/SphereEmitter.js index 4925d0847225..bb58256c0168 100644 --- a/packages/engine/Source/Scene/SphereEmitter.js +++ b/packages/engine/Source/Scene/SphereEmitter.js @@ -60,7 +60,7 @@ SphereEmitter.prototype.emit = function (particle) { particle.position = Cartesian3.fromElements(x, y, z, particle.position); particle.velocity = Cartesian3.normalize( particle.position, - particle.velocity + particle.velocity, ); }; export default SphereEmitter; diff --git a/packages/engine/Source/Scene/StructuralMetadata.js b/packages/engine/Source/Scene/StructuralMetadata.js index 5d9fae62e338..f97c513041ad 100644 --- a/packages/engine/Source/Scene/StructuralMetadata.js +++ b/packages/engine/Source/Scene/StructuralMetadata.js @@ -231,7 +231,7 @@ StructuralMetadata.prototype.getPropertyTexture = function (propertyTextureId) { * @private */ StructuralMetadata.prototype.getPropertyAttribute = function ( - propertyAttributeId + propertyAttributeId, ) { //>>includeStart('debug', pragmas.debug); Check.typeOf.number("propertyAttributeId", propertyAttributeId); diff --git a/packages/engine/Source/Scene/StyleExpression.js b/packages/engine/Source/Scene/StyleExpression.js index 10e49410f645..d8ad4339084d 100644 --- a/packages/engine/Source/Scene/StyleExpression.js +++ b/packages/engine/Source/Scene/StyleExpression.js @@ -67,7 +67,7 @@ StyleExpression.prototype.getShaderFunction = function ( functionSignature, variableSubstitutionMap, shaderState, - returnType + returnType, ) { DeveloperError.throwInstantiationError(); }; diff --git a/packages/engine/Source/Scene/Sun.js b/packages/engine/Source/Scene/Sun.js index 45eeb785a7c1..5a3d9d069b51 100644 --- a/packages/engine/Source/Scene/Sun.js +++ b/packages/engine/Source/Scene/Sun.js @@ -270,11 +270,15 @@ Sun.prototype.update = function (frameState, passState, useHdr) { const position = SceneTransforms.computeActualEllipsoidPosition( frameState, sunPosition, - scratchCartesian4 + scratchCartesian4, ); const dist = Cartesian3.magnitude( - Cartesian3.subtract(position, frameState.camera.position, scratchCartesian4) + Cartesian3.subtract( + position, + frameState.camera.position, + scratchCartesian4, + ), ); const projMatrix = context.uniformState.projection; @@ -287,28 +291,28 @@ Sun.prototype.update = function (frameState, passState, useHdr) { const positionCC = Matrix4.multiplyByVector( projMatrix, positionEC, - scratchCartesian4 + scratchCartesian4, ); const positionWC = SceneTransforms.clipToGLWindowCoordinates( passState.viewport, positionCC, - scratchPositionWC + scratchPositionWC, ); positionEC.x = CesiumMath.SOLAR_RADIUS; const limbCC = Matrix4.multiplyByVector( projMatrix, positionEC, - scratchCartesian4 + scratchCartesian4, ); const limbWC = SceneTransforms.clipToGLWindowCoordinates( passState.viewport, limbCC, - scratchLimbWC + scratchLimbWC, ); this._size = Cartesian2.magnitude( - Cartesian2.subtract(limbWC, positionWC, scratchCartesian4) + Cartesian2.subtract(limbWC, positionWC, scratchCartesian4), ); this._size = 2.0 * this._size * (1.0 + 2.0 * this._glowLengthTS); this._size = Math.ceil(this._size); diff --git a/packages/engine/Source/Scene/SunPostProcess.js b/packages/engine/Source/Scene/SunPostProcess.js index 81277c2ef6ca..ab025a5d4889 100644 --- a/packages/engine/Source/Scene/SunPostProcess.js +++ b/packages/engine/Source/Scene/SunPostProcess.js @@ -154,18 +154,18 @@ function updateSunPosition(postProcess, context, viewport) { viewport, 0.0, 1.0, - postProcessMatrix4Scratch + postProcessMatrix4Scratch, ); const sunPositionEC = Matrix4.multiplyByPoint( viewMatrix, sunPosition, - sunPositionECScratch + sunPositionECScratch, ); let sunPositionWC = Transforms.pointToGLWindowCoordinates( viewProjectionMatrix, viewportTransformation, sunPosition, - sunPositionWCScratch + sunPositionWCScratch, ); sunPositionEC.x += CesiumMath.SOLAR_RADIUS; @@ -173,7 +173,7 @@ function updateSunPosition(postProcess, context, viewport) { projectionMatrix, viewportTransformation, sunPositionEC, - sunPositionEC + sunPositionEC, ); const sunSize = Cartesian2.magnitude(Cartesian2.subtract(limbWC, sunPositionWC, limbWC)) * @@ -205,13 +205,13 @@ function updateSunPosition(postProcess, context, viewport) { downSampleViewport, 0.0, 1.0, - postProcessMatrix4Scratch + postProcessMatrix4Scratch, ); sunPositionWC = Transforms.pointToGLWindowCoordinates( viewProjectionMatrix, viewportTransformation, sunPosition, - sunPositionWCScratch + sunPositionWCScratch, ); size.x *= downSampleWidth / width; diff --git a/packages/engine/Source/Scene/TerrainFillMesh.js b/packages/engine/Source/Scene/TerrainFillMesh.js index 9d1671493a63..a23c50ce30c5 100644 --- a/packages/engine/Source/Scene/TerrainFillMesh.js +++ b/packages/engine/Source/Scene/TerrainFillMesh.js @@ -50,7 +50,7 @@ function TerrainFillMesh(tile) { TerrainFillMesh.prototype.update = function ( tileProvider, frameState, - vertexArraysToDestroy + vertexArraysToDestroy, ) { if (this.changedThisFrame) { createFillMesh(tileProvider, frameState, this.tile, vertexArraysToDestroy); @@ -73,7 +73,7 @@ TerrainFillMesh.prototype.destroy = function (vertexArraysToDestroy) { }; TerrainFillMesh.prototype._destroyVertexArray = function ( - vertexArraysToDestroy + vertexArraysToDestroy, ) { if (defined(this.vertexArray)) { if (defined(vertexArraysToDestroy)) { @@ -91,7 +91,7 @@ TerrainFillMesh.updateFillTiles = function ( tileProvider, renderedTiles, frameState, - vertexArraysToDestroy + vertexArraysToDestroy, ) { // We want our fill tiles to look natural, which means they should align perfectly with // adjacent loaded tiles, and their edges that are not adjacent to loaded tiles should have @@ -136,7 +136,7 @@ TerrainFillMesh.updateFillTiles = function ( TileEdge.EAST, false, traversalQueue, - vertexArraysToDestroy + vertexArraysToDestroy, ); visitRenderedTiles( tileProvider, @@ -147,7 +147,7 @@ TerrainFillMesh.updateFillTiles = function ( TileEdge.NORTH, false, traversalQueue, - vertexArraysToDestroy + vertexArraysToDestroy, ); visitRenderedTiles( tileProvider, @@ -158,7 +158,7 @@ TerrainFillMesh.updateFillTiles = function ( TileEdge.WEST, false, traversalQueue, - vertexArraysToDestroy + vertexArraysToDestroy, ); visitRenderedTiles( tileProvider, @@ -169,7 +169,7 @@ TerrainFillMesh.updateFillTiles = function ( TileEdge.SOUTH, false, traversalQueue, - vertexArraysToDestroy + vertexArraysToDestroy, ); const tileToNorthwest = tileToWest.findTileToNorth(levelZeroTiles); @@ -185,7 +185,7 @@ TerrainFillMesh.updateFillTiles = function ( TileEdge.SOUTHEAST, false, traversalQueue, - vertexArraysToDestroy + vertexArraysToDestroy, ); visitRenderedTiles( tileProvider, @@ -196,7 +196,7 @@ TerrainFillMesh.updateFillTiles = function ( TileEdge.SOUTHWEST, false, traversalQueue, - vertexArraysToDestroy + vertexArraysToDestroy, ); visitRenderedTiles( tileProvider, @@ -207,7 +207,7 @@ TerrainFillMesh.updateFillTiles = function ( TileEdge.NORTHEAST, false, traversalQueue, - vertexArraysToDestroy + vertexArraysToDestroy, ); visitRenderedTiles( tileProvider, @@ -218,7 +218,7 @@ TerrainFillMesh.updateFillTiles = function ( TileEdge.NORTHWEST, false, traversalQueue, - vertexArraysToDestroy + vertexArraysToDestroy, ); tile = traversalQueue.dequeue(); @@ -234,7 +234,7 @@ function visitRenderedTiles( tileEdge, downOnly, traversalQueue, - vertexArraysToDestroy + vertexArraysToDestroy, ) { if (startTile === undefined) { // There are no tiles North or South of the poles. @@ -295,7 +295,7 @@ function visitRenderedTiles( tileEdge, currentFrameNumber, traversalQueue, - vertexArraysToDestroy + vertexArraysToDestroy, ); return; } @@ -320,7 +320,7 @@ function visitRenderedTiles( tileEdge, true, traversalQueue, - vertexArraysToDestroy + vertexArraysToDestroy, ); visitRenderedTiles( tileProvider, @@ -331,7 +331,7 @@ function visitRenderedTiles( tileEdge, true, traversalQueue, - vertexArraysToDestroy + vertexArraysToDestroy, ); break; case TileEdge.EAST: @@ -344,7 +344,7 @@ function visitRenderedTiles( tileEdge, true, traversalQueue, - vertexArraysToDestroy + vertexArraysToDestroy, ); visitRenderedTiles( tileProvider, @@ -355,7 +355,7 @@ function visitRenderedTiles( tileEdge, true, traversalQueue, - vertexArraysToDestroy + vertexArraysToDestroy, ); break; case TileEdge.SOUTH: @@ -368,7 +368,7 @@ function visitRenderedTiles( tileEdge, true, traversalQueue, - vertexArraysToDestroy + vertexArraysToDestroy, ); visitRenderedTiles( tileProvider, @@ -379,7 +379,7 @@ function visitRenderedTiles( tileEdge, true, traversalQueue, - vertexArraysToDestroy + vertexArraysToDestroy, ); break; case TileEdge.NORTH: @@ -392,7 +392,7 @@ function visitRenderedTiles( tileEdge, true, traversalQueue, - vertexArraysToDestroy + vertexArraysToDestroy, ); visitRenderedTiles( tileProvider, @@ -403,7 +403,7 @@ function visitRenderedTiles( tileEdge, true, traversalQueue, - vertexArraysToDestroy + vertexArraysToDestroy, ); break; case TileEdge.NORTHWEST: @@ -416,7 +416,7 @@ function visitRenderedTiles( tileEdge, true, traversalQueue, - vertexArraysToDestroy + vertexArraysToDestroy, ); break; case TileEdge.NORTHEAST: @@ -429,7 +429,7 @@ function visitRenderedTiles( tileEdge, true, traversalQueue, - vertexArraysToDestroy + vertexArraysToDestroy, ); break; case TileEdge.SOUTHWEST: @@ -442,7 +442,7 @@ function visitRenderedTiles( tileEdge, true, traversalQueue, - vertexArraysToDestroy + vertexArraysToDestroy, ); break; case TileEdge.SOUTHEAST: @@ -455,7 +455,7 @@ function visitRenderedTiles( tileEdge, true, traversalQueue, - vertexArraysToDestroy + vertexArraysToDestroy, ); break; default: @@ -471,7 +471,7 @@ function visitTile( tileEdge, frameNumber, traversalQueue, - vertexArraysToDestroy + vertexArraysToDestroy, ) { const destinationSurfaceTile = destinationTile.data; @@ -495,7 +495,7 @@ function visitTile( sourceTile, destinationTile, tileEdge, - vertexArraysToDestroy + vertexArraysToDestroy, ); } @@ -505,7 +505,7 @@ function propagateEdge( sourceTile, destinationTile, tileEdge, - vertexArraysToDestroy + vertexArraysToDestroy, ) { const destinationFill = destinationTile.data.fill; @@ -520,7 +520,7 @@ function propagateEdge( tileProvider, frameState, sourceTile, - vertexArraysToDestroy + vertexArraysToDestroy, ); sourceFill.changedThisFrame = false; } @@ -614,7 +614,7 @@ function propagateEdge( CesiumMath.greaterThan( sourceRectangle.north, existingRectangle.south, - epsilon + epsilon, ) ) { break; @@ -627,7 +627,7 @@ function propagateEdge( CesiumMath.greaterThanOrEquals( sourceRectangle.south, existingRectangle.north, - epsilon + epsilon, ) ) { break; @@ -646,7 +646,7 @@ function propagateEdge( CesiumMath.lessThan( sourceRectangle.west, existingRectangle.east, - epsilon + epsilon, ) ) { break; @@ -659,7 +659,7 @@ function propagateEdge( CesiumMath.lessThanOrEquals( sourceRectangle.east, existingRectangle.west, - epsilon + epsilon, ) ) { break; @@ -678,7 +678,7 @@ function propagateEdge( CesiumMath.lessThan( sourceRectangle.south, existingRectangle.north, - epsilon + epsilon, ) ) { break; @@ -691,7 +691,7 @@ function propagateEdge( CesiumMath.lessThanOrEquals( sourceRectangle.north, existingRectangle.south, - epsilon + epsilon, ) ) { break; @@ -710,7 +710,7 @@ function propagateEdge( CesiumMath.greaterThan( sourceRectangle.east, existingRectangle.west, - epsilon + epsilon, ) ) { break; @@ -723,7 +723,7 @@ function propagateEdge( CesiumMath.greaterThanOrEquals( sourceRectangle.west, existingRectangle.east, - epsilon + epsilon, ) ) { break; @@ -766,7 +766,7 @@ function fillMissingCorner( adjacentCorner1, adjacentCorner2, oppositeCorner, - vertex + vertex, ) { if (defined(corner)) { return corner; @@ -823,7 +823,7 @@ function createFillMesh(tileProvider, frameState, tile, vertexArraysToDestroy) { GlobeSurfaceTile.initialize( tile, tileProvider.terrainProvider, - tileProvider._imageryLayers + tileProvider._imageryLayers, ); const surfaceTile = tile.data; @@ -848,7 +848,7 @@ function createFillMesh(tileProvider, frameState, tile, vertexArraysToDestroy) { fill.northMeshes, fill.westTiles, fill.westMeshes, - nwVertexScratch + nwVertexScratch, ); let swCorner = getCorner( fill, @@ -861,7 +861,7 @@ function createFillMesh(tileProvider, frameState, tile, vertexArraysToDestroy) { fill.westMeshes, fill.southTiles, fill.southMeshes, - swVertexScratch + swVertexScratch, ); let seCorner = getCorner( fill, @@ -874,7 +874,7 @@ function createFillMesh(tileProvider, frameState, tile, vertexArraysToDestroy) { fill.southMeshes, fill.eastTiles, fill.eastMeshes, - seVertexScratch + seVertexScratch, ); let neCorner = getCorner( fill, @@ -887,7 +887,7 @@ function createFillMesh(tileProvider, frameState, tile, vertexArraysToDestroy) { fill.eastMeshes, fill.northTiles, fill.northMeshes, - neVertexScratch + neVertexScratch, ); nwCorner = fillMissingCorner( @@ -899,7 +899,7 @@ function createFillMesh(tileProvider, frameState, tile, vertexArraysToDestroy) { swCorner, neCorner, seCorner, - nwVertexScratch + nwVertexScratch, ); swCorner = fillMissingCorner( fill, @@ -910,7 +910,7 @@ function createFillMesh(tileProvider, frameState, tile, vertexArraysToDestroy) { nwCorner, seCorner, neCorner, - swVertexScratch + swVertexScratch, ); seCorner = fillMissingCorner( fill, @@ -921,7 +921,7 @@ function createFillMesh(tileProvider, frameState, tile, vertexArraysToDestroy) { swCorner, neCorner, nwCorner, - seVertexScratch + seVertexScratch, ); neCorner = fillMissingCorner( fill, @@ -932,7 +932,7 @@ function createFillMesh(tileProvider, frameState, tile, vertexArraysToDestroy) { seCorner, nwCorner, swCorner, - neVertexScratch + neVertexScratch, ); const southwestHeight = swCorner.height; @@ -944,13 +944,13 @@ function createFillMesh(tileProvider, frameState, tile, vertexArraysToDestroy) { southwestHeight, southeastHeight, northwestHeight, - northeastHeight + northeastHeight, ); let maximumHeight = Math.max( southwestHeight, southeastHeight, northwestHeight, - northeastHeight + northeastHeight, ); const middleHeight = (minimumHeight + maximumHeight) * 0.5; @@ -997,19 +997,20 @@ function createFillMesh(tileProvider, frameState, tile, vertexArraysToDestroy) { createMeshSyncOptions.y = tile.y; createMeshSyncOptions.level = tile.level; createMeshSyncOptions.exaggeration = exaggeration; - createMeshSyncOptions.exaggerationRelativeHeight = exaggerationRelativeHeight; + createMeshSyncOptions.exaggerationRelativeHeight = + exaggerationRelativeHeight; fill.mesh = terrainData._createMeshSync(createMeshSyncOptions); } else { const hasGeodeticSurfaceNormals = hasExaggeration; const centerCartographic = Rectangle.center( rectangle, - centerCartographicScratch + centerCartographicScratch, ); centerCartographic.height = middleHeight; const center = ellipsoid.cartographicToCartesian( centerCartographic, - scratchCenter + scratchCenter, ); const encoding = new TerrainEncoding( center, @@ -1021,7 +1022,7 @@ function createFillMesh(tileProvider, frameState, tile, vertexArraysToDestroy) { true, hasGeodeticSurfaceNormals, exaggeration, - exaggerationRelativeHeight + exaggerationRelativeHeight, ); // At _most_, we have vertices for the 4 corners, plus 1 center, plus every adjacent edge vertex. @@ -1071,7 +1072,7 @@ function createFillMesh(tileProvider, frameState, tile, vertexArraysToDestroy) { nwCorner.height, nwCorner.encodedNormal, 1.0, - heightRange + heightRange, ); nextIndex = addEdge( fill, @@ -1082,7 +1083,7 @@ function createFillMesh(tileProvider, frameState, tile, vertexArraysToDestroy) { fill.westTiles, fill.westMeshes, TileEdge.EAST, - heightRange + heightRange, ); const southwestIndex = nextIndex; nextIndex = addVertexWithComputedPosition( @@ -1096,7 +1097,7 @@ function createFillMesh(tileProvider, frameState, tile, vertexArraysToDestroy) { swCorner.height, swCorner.encodedNormal, 0.0, - heightRange + heightRange, ); nextIndex = addEdge( fill, @@ -1107,7 +1108,7 @@ function createFillMesh(tileProvider, frameState, tile, vertexArraysToDestroy) { fill.southTiles, fill.southMeshes, TileEdge.NORTH, - heightRange + heightRange, ); const southeastIndex = nextIndex; nextIndex = addVertexWithComputedPosition( @@ -1121,7 +1122,7 @@ function createFillMesh(tileProvider, frameState, tile, vertexArraysToDestroy) { seCorner.height, seCorner.encodedNormal, 0.0, - heightRange + heightRange, ); nextIndex = addEdge( fill, @@ -1132,7 +1133,7 @@ function createFillMesh(tileProvider, frameState, tile, vertexArraysToDestroy) { fill.eastTiles, fill.eastMeshes, TileEdge.WEST, - heightRange + heightRange, ); const northeastIndex = nextIndex; nextIndex = addVertexWithComputedPosition( @@ -1146,7 +1147,7 @@ function createFillMesh(tileProvider, frameState, tile, vertexArraysToDestroy) { neCorner.height, neCorner.encodedNormal, 1.0, - heightRange + heightRange, ); nextIndex = addEdge( fill, @@ -1157,7 +1158,7 @@ function createFillMesh(tileProvider, frameState, tile, vertexArraysToDestroy) { fill.northTiles, fill.northMeshes, TileEdge.SOUTH, - heightRange + heightRange, ); minimumHeight = heightRange.minimumHeight; @@ -1167,31 +1168,30 @@ function createFillMesh(tileProvider, frameState, tile, vertexArraysToDestroy) { rectangle, minimumHeight, maximumHeight, - tile.tilingScheme.ellipsoid + tile.tilingScheme.ellipsoid, ); // Add a single vertex at the center of the tile. - const southMercatorY = WebMercatorProjection.geodeticLatitudeToMercatorAngle( - rectangle.south - ); + const southMercatorY = + WebMercatorProjection.geodeticLatitudeToMercatorAngle(rectangle.south); const oneOverMercatorHeight = 1.0 / (WebMercatorProjection.geodeticLatitudeToMercatorAngle(rectangle.north) - southMercatorY); const centerWebMercatorT = (WebMercatorProjection.geodeticLatitudeToMercatorAngle( - centerCartographic.latitude + centerCartographic.latitude, ) - southMercatorY) * oneOverMercatorHeight; const geodeticSurfaceNormal = ellipsoid.geodeticSurfaceNormalCartographic( cartographicScratch, - normalScratch + normalScratch, ); const centerEncodedNormal = AttributeCompression.octEncode( geodeticSurfaceNormal, - octEncodedNormalScratch + octEncodedNormalScratch, ); const centerIndex = nextIndex; @@ -1203,7 +1203,7 @@ function createFillMesh(tileProvider, frameState, tile, vertexArraysToDestroy) { middleHeight, centerEncodedNormal, centerWebMercatorT, - geodeticSurfaceNormal + geodeticSurfaceNormal, ); ++nextIndex; @@ -1280,7 +1280,7 @@ function createFillMesh(tileProvider, frameState, tile, vertexArraysToDestroy) { obb.center, rectangle, minimumHeight, - maximumHeight + maximumHeight, ), encoding.stride, obb, @@ -1288,7 +1288,7 @@ function createFillMesh(tileProvider, frameState, tile, vertexArraysToDestroy) { westIndicesSouthToNorth, southIndicesEastToWest, eastIndicesNorthToSouth, - northIndicesWestToEast + northIndicesWestToEast, ); } @@ -1298,13 +1298,13 @@ function createFillMesh(tileProvider, frameState, tile, vertexArraysToDestroy) { fill.vertexArray = GlobeSurfaceTile._createVertexArrayForMesh( context, - fill.mesh + fill.mesh, ); surfaceTile.processImagery( tile, tileProvider.terrainProvider, frameState, - true + true, ); const oldTexture = fill.waterMaskTexture; @@ -1321,7 +1321,7 @@ function createFillMesh(tileProvider, frameState, tile, vertexArraysToDestroy) { surfaceTile._computeWaterMaskTranslationAndScale( tile, waterSourceTile, - fill.waterMaskTranslationAndScale + fill.waterMaskTranslationAndScale, ); } } @@ -1345,7 +1345,7 @@ function addVertexWithComputedPosition( height, encodedNormal, webMercatorT, - heightRange + heightRange, ) { const cartographic = cartographicScratch; cartographic.longitude = CesiumMath.lerp(rectangle.west, rectangle.east, u); @@ -1353,14 +1353,14 @@ function addVertexWithComputedPosition( cartographic.height = height; const position = ellipsoid.cartographicToCartesian( cartographic, - cartesianScratch + cartesianScratch, ); let geodeticSurfaceNormal; if (encoding.hasGeodeticSurfaceNormals) { geodeticSurfaceNormal = ellipsoid.geodeticSurfaceNormal( position, - normalScratch + normalScratch, ); } @@ -1376,7 +1376,7 @@ function addVertexWithComputedPosition( height, encodedNormal, webMercatorT, - geodeticSurfaceNormal + geodeticSurfaceNormal, ); heightRange.minimumHeight = Math.min(heightRange.minimumHeight, height); @@ -1391,7 +1391,7 @@ function transformTextureCoordinates( sourceTile, targetTile, coordinates, - result + result, ) { let sourceRectangle = sourceTile.rectangle; const targetRectangle = targetTile.rectangle; @@ -1405,7 +1405,7 @@ function transformTextureCoordinates( ) { sourceRectangle = Rectangle.clone( sourceTile.rectangle, - sourceRectangleScratch + sourceRectangleScratch, ); sourceRectangle.west -= CesiumMath.TWO_PI; sourceRectangle.east -= CesiumMath.TWO_PI; @@ -1417,7 +1417,7 @@ function transformTextureCoordinates( ) { sourceRectangle = Rectangle.clone( sourceTile.rectangle, - sourceRectangleScratch + sourceRectangleScratch, ); sourceRectangle.west += CesiumMath.TWO_PI; sourceRectangle.east += CesiumMath.TWO_PI; @@ -1464,7 +1464,7 @@ function getVertexFromTileAtCorner(sourceMesh, sourceIndex, u, v, vertex) { sourceEncoding.getOctEncodedNormal( sourceVertices, sourceIndex, - vertex.encodedNormal + vertex.encodedNormal, ); } else { const normal = vertex.encodedNormal; @@ -1486,7 +1486,7 @@ function getInterpolatedVertexAtCorner( u, v, interpolateU, - vertex + vertex, ) { const sourceEncoding = sourceMesh.encoding; const sourceVertices = sourceMesh.vertices; @@ -1497,9 +1497,9 @@ function getInterpolatedVertexAtCorner( sourceEncoding.decodeTextureCoordinates( sourceVertices, previousIndex, - uvScratch + uvScratch, ), - uvScratch + uvScratch, ); const nextUv = transformTextureCoordinates( sourceTile, @@ -1507,9 +1507,9 @@ function getInterpolatedVertexAtCorner( sourceEncoding.decodeTextureCoordinates( sourceVertices, nextIndex, - uvScratch2 + uvScratch2, ), - uvScratch2 + uvScratch2, ); let ratio; @@ -1526,17 +1526,17 @@ function getInterpolatedVertexAtCorner( cartographicScratch.longitude = CesiumMath.lerp( targetRectangle.west, targetRectangle.east, - u + u, ); cartographicScratch.latitude = CesiumMath.lerp( targetRectangle.south, targetRectangle.north, - v + v, ); vertex.height = cartographicScratch.height = CesiumMath.lerp( height1, height2, - ratio + ratio, ); let normal; @@ -1544,22 +1544,22 @@ function getInterpolatedVertexAtCorner( const encodedNormal1 = sourceEncoding.getOctEncodedNormal( sourceVertices, previousIndex, - encodedNormalScratch + encodedNormalScratch, ); const encodedNormal2 = sourceEncoding.getOctEncodedNormal( sourceVertices, nextIndex, - encodedNormalScratch2 + encodedNormalScratch2, ); const normal1 = AttributeCompression.octDecode( encodedNormal1.x, encodedNormal1.y, - cartesianScratch + cartesianScratch, ); const normal2 = AttributeCompression.octDecode( encodedNormal2.x, encodedNormal2.y, - cartesianScratch2 + cartesianScratch2, ); normal = Cartesian3.lerp(normal1, normal2, ratio, cartesianScratch); Cartesian3.normalize(normal, normal); @@ -1567,7 +1567,7 @@ function getInterpolatedVertexAtCorner( } else { normal = ellipsoid.geodeticSurfaceNormalCartographic( cartographicScratch, - cartesianScratch + cartesianScratch, ); AttributeCompression.octEncode(normal, vertex.encodedNormal); } @@ -1579,12 +1579,12 @@ function getVertexWithHeightAtCorner( u, v, height, - vertex + vertex, ) { vertex.height = height; const normal = ellipsoid.geodeticSurfaceNormalCartographic( cartographicScratch, - cartesianScratch + cartesianScratch, ); AttributeCompression.octEncode(normal, vertex.encodedNormal); } @@ -1600,7 +1600,7 @@ function getCorner( previousEdgeMeshes, nextEdgeTiles, nextEdgeMeshes, - vertex + vertex, ) { const gotCorner = getCornerFromEdge( @@ -1611,7 +1611,7 @@ function getCorner( false, u, v, - vertex + vertex, ) || getCornerFromEdge( terrainFillMesh, @@ -1621,7 +1621,7 @@ function getCorner( true, u, v, - vertex + vertex, ); if (gotCorner) { return vertex; @@ -1667,7 +1667,7 @@ function getCorner( terrainFillMesh.southTiles, TileEdge.NORTH, u, - v + v, ); } else { // northwest @@ -1679,7 +1679,7 @@ function getCorner( terrainFillMesh.westTiles, TileEdge.EAST, u, - v + v, ); } } else if (v === 0.0) { @@ -1692,7 +1692,7 @@ function getCorner( terrainFillMesh.eastTiles, TileEdge.WEST, u, - v + v, ); } else { // northeast @@ -1704,7 +1704,7 @@ function getCorner( terrainFillMesh.northTiles, TileEdge.SOUTH, u, - v + v, ); } @@ -1715,7 +1715,7 @@ function getCorner( u, v, height, - vertex + vertex, ); return vertex; } @@ -1732,7 +1732,7 @@ function getClosestHeightToCorner( nextTiles, nextEdge, u, - v + v, ) { const height1 = getNearestHeightOnEdge( previousMeshes, @@ -1740,7 +1740,7 @@ function getClosestHeightToCorner( false, previousEdge, u, - v + v, ); const height2 = getNearestHeightOnEdge( nextMeshes, @@ -1748,7 +1748,7 @@ function getClosestHeightToCorner( true, nextEdge, u, - v + v, ); if (defined(height1) && defined(height2)) { // It would be slightly better to do a weighted average of the two heights @@ -1769,7 +1769,7 @@ function addEdge( edgeTiles, edgeMeshes, tileEdge, - heightRange + heightRange, ) { for (let i = 0; i < edgeTiles.length; ++i) { nextIndex = addEdgeMesh( @@ -1781,7 +1781,7 @@ function addEdge( edgeTiles[i], edgeMeshes[i], tileEdge, - heightRange + heightRange, ); } return nextIndex; @@ -1796,21 +1796,21 @@ function addEdgeMesh( edgeTile, edgeMesh, tileEdge, - heightRange + heightRange, ) { // Handle copying edges across the anti-meridian. let sourceRectangle = edgeTile.rectangle; if (tileEdge === TileEdge.EAST && terrainFillMesh.tile.x === 0) { sourceRectangle = Rectangle.clone( edgeTile.rectangle, - sourceRectangleScratch + sourceRectangleScratch, ); sourceRectangle.west -= CesiumMath.TWO_PI; sourceRectangle.east -= CesiumMath.TWO_PI; } else if (tileEdge === TileEdge.WEST && edgeTile.x === 0) { sourceRectangle = Rectangle.clone( edgeTile.rectangle, - sourceRectangleScratch + sourceRectangleScratch, ); sourceRectangle.west += CesiumMath.TWO_PI; sourceRectangle.east += CesiumMath.TWO_PI; @@ -1859,12 +1859,12 @@ function addEdgeMesh( let oneOverMercatorHeight; if (sourceEncoding.hasWebMercatorT) { southMercatorY = WebMercatorProjection.geodeticLatitudeToMercatorAngle( - targetRectangle.south + targetRectangle.south, ); oneOverMercatorHeight = 1.0 / (WebMercatorProjection.geodeticLatitudeToMercatorAngle( - targetRectangle.north + targetRectangle.north, ) - southMercatorY); } @@ -1875,7 +1875,7 @@ function addEdgeMesh( const uv = sourceEncoding.decodeTextureCoordinates( sourceVertices, index, - uvScratch + uvScratch, ); transformTextureCoordinates(sourceTile, targetTile, uv, uv); const u = uv.x; @@ -1910,7 +1910,7 @@ function addEdgeMesh( const position = sourceEncoding.decodePosition( sourceVertices, index, - cartesianScratch + cartesianScratch, ); const height = sourceEncoding.decodeHeight(sourceVertices, index); @@ -1919,7 +1919,7 @@ function addEdgeMesh( normal = sourceEncoding.getOctEncodedNormal( sourceVertices, index, - octEncodedNormalScratch + octEncodedNormalScratch, ); } else { normal = octEncodedNormalScratch; @@ -1932,7 +1932,7 @@ function addEdgeMesh( const latitude = CesiumMath.lerp( targetRectangle.south, targetRectangle.north, - v + v, ); webMercatorT = (WebMercatorProjection.geodeticLatitudeToMercatorAngle(latitude) - @@ -1944,7 +1944,7 @@ function addEdgeMesh( if (encoding.hasGeodeticSurfaceNormals) { geodeticSurfaceNormal = ellipsoid.geodeticSurfaceNormal( position, - normalScratch + normalScratch, ); } @@ -1956,7 +1956,7 @@ function addEdgeMesh( height, normal, webMercatorT, - geodeticSurfaceNormal + geodeticSurfaceNormal, ); heightRange.minimumHeight = Math.min(heightRange.minimumHeight, height); @@ -2034,7 +2034,7 @@ function getCornerFromEdge( isNext, u, v, - vertex + vertex, ) { let edgeVertices; let compareU; @@ -2085,13 +2085,13 @@ function getCornerFromEdge( sourceMesh.encoding.decodeTextureCoordinates( sourceMesh.vertices, vertexIndex, - uvScratch + uvScratch, ); const targetUv = transformTextureCoordinates( sourceTile, terrainFillMesh.tile, uvScratch, - uvScratch + uvScratch, ); if (targetUv.x === u && targetUv.y === v) { // Vertex is good! @@ -2100,31 +2100,32 @@ function getCornerFromEdge( } // The last vertex is not the one we need, try binary searching for the right one. - vertexIndexIndex = binarySearch(edgeVertices, compareU ? u : v, function ( - vertexIndex, - textureCoordinate - ) { - sourceMesh.encoding.decodeTextureCoordinates( - sourceMesh.vertices, - vertexIndex, - uvScratch - ); - const targetUv = transformTextureCoordinates( - sourceTile, - terrainFillMesh.tile, - uvScratch, - uvScratch - ); - if (increasing) { - if (compareU) { - return targetUv.x - u; + vertexIndexIndex = binarySearch( + edgeVertices, + compareU ? u : v, + function (vertexIndex, textureCoordinate) { + sourceMesh.encoding.decodeTextureCoordinates( + sourceMesh.vertices, + vertexIndex, + uvScratch, + ); + const targetUv = transformTextureCoordinates( + sourceTile, + terrainFillMesh.tile, + uvScratch, + uvScratch, + ); + if (increasing) { + if (compareU) { + return targetUv.x - u; + } + return targetUv.y - v; + } else if (compareU) { + return u - targetUv.x; } - return targetUv.y - v; - } else if (compareU) { - return u - targetUv.x; - } - return v - targetUv.y; - }); + return v - targetUv.y; + }, + ); if (vertexIndexIndex < 0) { vertexIndexIndex = ~vertexIndexIndex; @@ -2141,7 +2142,7 @@ function getCornerFromEdge( u, v, compareU, - vertex + vertex, ); return true; } @@ -2152,7 +2153,7 @@ function getCornerFromEdge( edgeVertices[vertexIndexIndex], u, v, - vertex + vertex, ); return true; } @@ -2175,7 +2176,7 @@ function computeOccludeePoint( rectangle, minimumHeight, maximumHeight, - result + result, ) { const ellipsoidalOccluder = tileProvider.quadtree._occluders.ellipsoid; const ellipsoid = ellipsoidalOccluder.ellipsoid; @@ -2186,35 +2187,35 @@ function computeOccludeePoint( rectangle.south, maximumHeight, ellipsoid, - cornerPositions[0] + cornerPositions[0], ); Cartesian3.fromRadians( rectangle.east, rectangle.south, maximumHeight, ellipsoid, - cornerPositions[1] + cornerPositions[1], ); Cartesian3.fromRadians( rectangle.west, rectangle.north, maximumHeight, ellipsoid, - cornerPositions[2] + cornerPositions[2], ); Cartesian3.fromRadians( rectangle.east, rectangle.north, maximumHeight, ellipsoid, - cornerPositions[3] + cornerPositions[3], ); return ellipsoidalOccluder.computeHorizonCullingPointPossiblyUnderEllipsoid( center, cornerPositions, minimumHeight, - result + result, ); } export default TerrainFillMesh; diff --git a/packages/engine/Source/Scene/TextureAtlas.js b/packages/engine/Source/Scene/TextureAtlas.js index d53cf10b1ac9..e094cd7f3de7 100644 --- a/packages/engine/Source/Scene/TextureAtlas.js +++ b/packages/engine/Source/Scene/TextureAtlas.js @@ -17,7 +17,7 @@ function TextureAtlasNode( topRight, childNode1, childNode2, - imageIndex + imageIndex, ) { this.bottomLeft = defaultValue(bottomLeft, Cartesian2.ZERO); this.topRight = defaultValue(topRight, Cartesian2.ZERO); @@ -60,7 +60,7 @@ function TextureAtlas(options) { } if (borderWidthInPixels < 0) { throw new DeveloperError( - "borderWidthInPixels must be greater than or equal to zero." + "borderWidthInPixels must be greater than or equal to zero.", ); } if (initialSize.x < 1 || initialSize.y < 1) { @@ -172,23 +172,23 @@ function resizeAtlas(textureAtlas, image) { // Create new node structure, putting the old root node in the bottom left. const nodeBottomRight = new TextureAtlasNode( new Cartesian2(oldAtlasWidth + borderWidthInPixels, borderWidthInPixels), - new Cartesian2(atlasWidth, oldAtlasHeight) + new Cartesian2(atlasWidth, oldAtlasHeight), ); const nodeBottomHalf = new TextureAtlasNode( new Cartesian2(), new Cartesian2(atlasWidth, oldAtlasHeight), textureAtlas._root, - nodeBottomRight + nodeBottomRight, ); const nodeTopHalf = new TextureAtlasNode( new Cartesian2(borderWidthInPixels, oldAtlasHeight + borderWidthInPixels), - new Cartesian2(atlasWidth, atlasHeight) + new Cartesian2(atlasWidth, atlasHeight), ); const nodeMain = new TextureAtlasNode( new Cartesian2(), new Cartesian2(atlasWidth, atlasHeight), nodeBottomHalf, - nodeTopHalf + nodeTopHalf, ); // Resize texture coordinates. @@ -245,7 +245,7 @@ function resizeAtlas(textureAtlas, image) { }); textureAtlas._root = new TextureAtlasNode( new Cartesian2(borderWidthInPixels, borderWidthInPixels), - new Cartesian2(initialWidth, initialHeight) + new Cartesian2(initialWidth, initialHeight), ); } } @@ -284,7 +284,7 @@ function findNode(textureAtlas, node, image) { if (widthDifference > heightDifference) { node.childNode1 = new TextureAtlasNode( new Cartesian2(node.bottomLeft.x, node.bottomLeft.y), - new Cartesian2(node.bottomLeft.x + image.width, node.topRight.y) + new Cartesian2(node.bottomLeft.x + image.width, node.topRight.y), ); // Only make a second child if the border gives enough space. const childNode2BottomLeftX = @@ -292,7 +292,7 @@ function findNode(textureAtlas, node, image) { if (childNode2BottomLeftX < node.topRight.x) { node.childNode2 = new TextureAtlasNode( new Cartesian2(childNode2BottomLeftX, node.bottomLeft.y), - new Cartesian2(node.topRight.x, node.topRight.y) + new Cartesian2(node.topRight.x, node.topRight.y), ); } } @@ -300,7 +300,7 @@ function findNode(textureAtlas, node, image) { else { node.childNode1 = new TextureAtlasNode( new Cartesian2(node.bottomLeft.x, node.bottomLeft.y), - new Cartesian2(node.topRight.x, node.bottomLeft.y + image.height) + new Cartesian2(node.topRight.x, node.bottomLeft.y + image.height), ); // Only make a second child if the border gives enough space. const childNode2BottomLeftY = @@ -308,7 +308,7 @@ function findNode(textureAtlas, node, image) { if (childNode2BottomLeftY < node.topRight.y) { node.childNode2 = new TextureAtlasNode( new Cartesian2(node.bottomLeft.x, childNode2BottomLeftY), - new Cartesian2(node.topRight.x, node.topRight.y) + new Cartesian2(node.topRight.x, node.topRight.y), ); } } diff --git a/packages/engine/Source/Scene/TileBoundingRegion.js b/packages/engine/Source/Scene/TileBoundingRegion.js index 733907695de2..34fd5847aaa0 100644 --- a/packages/engine/Source/Scene/TileBoundingRegion.js +++ b/packages/engine/Source/Scene/TileBoundingRegion.js @@ -145,11 +145,11 @@ TileBoundingRegion.prototype.computeBoundingVolumes = function (ellipsoid) { this.rectangle, this.minimumHeight, this.maximumHeight, - ellipsoid + ellipsoid, ); this._boundingSphere = BoundingSphere.fromOrientedBoundingBox( - this._orientedBoundingBox + this._orientedBoundingBox, ); }; @@ -167,11 +167,11 @@ const rayScratch = new Ray(); function computeBox(tileBB, rectangle, ellipsoid) { ellipsoid.cartographicToCartesian( Rectangle.southwest(rectangle), - tileBB.southwestCornerCartesian + tileBB.southwestCornerCartesian, ); ellipsoid.cartographicToCartesian( Rectangle.northeast(rectangle), - tileBB.northeastCornerCartesian + tileBB.northeastCornerCartesian, ); // The middle latitude on the western edge. @@ -180,14 +180,14 @@ function computeBox(tileBB, rectangle, ellipsoid) { cartographicScratch.height = 0.0; const westernMidpointCartesian = ellipsoid.cartographicToCartesian( cartographicScratch, - westernMidpointScratch + westernMidpointScratch, ); // Compute the normal of the plane on the western edge of the tile. const westNormal = Cartesian3.cross( westernMidpointCartesian, Cartesian3.UNIT_Z, - westNormalScratch + westNormalScratch, ); Cartesian3.normalize(westNormal, tileBB.westNormal); @@ -195,21 +195,21 @@ function computeBox(tileBB, rectangle, ellipsoid) { cartographicScratch.longitude = rectangle.east; const easternMidpointCartesian = ellipsoid.cartographicToCartesian( cartographicScratch, - easternMidpointScratch + easternMidpointScratch, ); // Compute the normal of the plane on the eastern edge of the tile. const eastNormal = Cartesian3.cross( Cartesian3.UNIT_Z, easternMidpointCartesian, - cartesian3Scratch + cartesian3Scratch, ); Cartesian3.normalize(eastNormal, tileBB.eastNormal); let westVector = Cartesian3.subtract( westernMidpointCartesian, easternMidpointCartesian, - cartesian3Scratch + cartesian3Scratch, ); if (Cartesian3.magnitude(westVector) === 0.0) { @@ -218,7 +218,7 @@ function computeBox(tileBB, rectangle, ellipsoid) { const eastWestNormal = Cartesian3.normalize( westVector, - eastWestNormalScratch + eastWestNormalScratch, ); // Compute the normal of the plane bounding the southern edge of the tile. @@ -231,34 +231,34 @@ function computeBox(tileBB, rectangle, ellipsoid) { cartographicScratch.latitude = south; const southCenterCartesian = ellipsoid.cartographicToCartesian( cartographicScratch, - rayScratch.origin + rayScratch.origin, ); Cartesian3.clone(eastWestNormal, rayScratch.direction); const westPlane = Plane.fromPointNormal( tileBB.southwestCornerCartesian, tileBB.westNormal, - planeScratch + planeScratch, ); // Find a point that is on the west and the south planes IntersectionTests.rayPlane( rayScratch, westPlane, - tileBB.southwestCornerCartesian + tileBB.southwestCornerCartesian, ); southSurfaceNormal = ellipsoid.geodeticSurfaceNormal( southCenterCartesian, - cartesian3Scratch2 + cartesian3Scratch2, ); } else { southSurfaceNormal = ellipsoid.geodeticSurfaceNormalCartographic( Rectangle.southeast(rectangle), - cartesian3Scratch2 + cartesian3Scratch2, ); } const southNormal = Cartesian3.cross( southSurfaceNormal, westVector, - cartesian3Scratch3 + cartesian3Scratch3, ); Cartesian3.normalize(southNormal, tileBB.southNormal); @@ -272,34 +272,34 @@ function computeBox(tileBB, rectangle, ellipsoid) { cartographicScratch.latitude = north; const northCenterCartesian = ellipsoid.cartographicToCartesian( cartographicScratch, - rayScratch.origin + rayScratch.origin, ); Cartesian3.negate(eastWestNormal, rayScratch.direction); const eastPlane = Plane.fromPointNormal( tileBB.northeastCornerCartesian, tileBB.eastNormal, - planeScratch + planeScratch, ); // Find a point that is on the east and the north planes IntersectionTests.rayPlane( rayScratch, eastPlane, - tileBB.northeastCornerCartesian + tileBB.northeastCornerCartesian, ); northSurfaceNormal = ellipsoid.geodeticSurfaceNormal( northCenterCartesian, - cartesian3Scratch2 + cartesian3Scratch2, ); } else { northSurfaceNormal = ellipsoid.geodeticSurfaceNormalCartographic( Rectangle.northwest(rectangle), - cartesian3Scratch2 + cartesian3Scratch2, ); } const northNormal = Cartesian3.cross( westVector, northSurfaceNormal, - cartesian3Scratch3 + cartesian3Scratch3, ); Cartesian3.normalize(northNormal, tileBB.northNormal); } @@ -327,14 +327,14 @@ function distanceToCameraRegion(tileBB, frameState) { if (frameState.mode !== SceneMode.SCENE3D) { southwestCornerCartesian = frameState.mapProjection.project( Rectangle.southwest(tileBB.rectangle), - southwestCornerScratch + southwestCornerScratch, ); southwestCornerCartesian.z = southwestCornerCartesian.y; southwestCornerCartesian.y = southwestCornerCartesian.x; southwestCornerCartesian.x = 0.0; northeastCornerCartesian = frameState.mapProjection.project( Rectangle.northeast(tileBB.rectangle), - northeastCornerScratch + northeastCornerScratch, ); northeastCornerCartesian.z = northeastCornerCartesian.y; northeastCornerCartesian.y = northeastCornerCartesian.x; @@ -348,29 +348,29 @@ function distanceToCameraRegion(tileBB, frameState) { const vectorFromSouthwestCorner = Cartesian3.subtract( cameraCartesianPosition, southwestCornerCartesian, - vectorScratch + vectorScratch, ); const distanceToWestPlane = Cartesian3.dot( vectorFromSouthwestCorner, - westNormal + westNormal, ); const distanceToSouthPlane = Cartesian3.dot( vectorFromSouthwestCorner, - southNormal + southNormal, ); const vectorFromNortheastCorner = Cartesian3.subtract( cameraCartesianPosition, northeastCornerCartesian, - vectorScratch + vectorScratch, ); const distanceToEastPlane = Cartesian3.dot( vectorFromNortheastCorner, - eastNormal + eastNormal, ); const distanceToNorthPlane = Cartesian3.dot( vectorFromNortheastCorner, - northNormal + northNormal, ); if (distanceToWestPlane > 0.0) { @@ -427,7 +427,7 @@ TileBoundingRegion.prototype.distanceToCamera = function (frameState) { defined(this._orientedBoundingBox) ) { const obbResult = Math.sqrt( - this._orientedBoundingBox.distanceSquaredTo(frameState.camera.positionWC) + this._orientedBoundingBox.distanceSquaredTo(frameState.camera.positionWC), ); return Math.max(regionResult, obbResult); } diff --git a/packages/engine/Source/Scene/TileBoundingS2Cell.js b/packages/engine/Source/Scene/TileBoundingS2Cell.js index 307fa36c8e39..2656f5817517 100644 --- a/packages/engine/Source/Scene/TileBoundingS2Cell.js +++ b/packages/engine/Source/Scene/TileBoundingS2Cell.js @@ -53,7 +53,7 @@ function TileBoundingS2Cell(options) { s2Cell, minimumHeight, maximumHeight, - ellipsoid + ellipsoid, ); this._boundingPlanes = boundingPlanes; @@ -66,7 +66,7 @@ function TileBoundingS2Cell(options) { this._edgeNormals[0] = computeEdgeNormals( boundingPlanes[0], - vertices.slice(0, 4) + vertices.slice(0, 4), ); let i; // Based on the way the edge normals are computed, the edge normals all point away from the "face" @@ -75,13 +75,13 @@ function TileBoundingS2Cell(options) { for (i = 0; i < 4; i++) { this._edgeNormals[0][i] = Cartesian3.negate( this._edgeNormals[0][i], - this._edgeNormals[0][i] + this._edgeNormals[0][i], ); } this._edgeNormals[1] = computeEdgeNormals( boundingPlanes[1], - vertices.slice(4, 8) + vertices.slice(4, 8), ); for (i = 0; i < 4; i++) { // For each plane, iterate through the vertices in CCW order. @@ -109,12 +109,12 @@ function TileBoundingS2Cell(options) { const center = s2Cell.getCenter(); centerCartographicScratch = ellipsoid.cartesianToCartographic( center, - centerCartographicScratch + centerCartographicScratch, ); centerCartographicScratch.height = (maximumHeight + minimumHeight) / 2; this.center = ellipsoid.cartographicToCartesian( centerCartographicScratch, - center + center, ); this._boundingSphere = BoundingSphere.fromPoints(vertices); @@ -136,7 +136,7 @@ function computeBoundingPlanes( s2Cell, minimumHeight, maximumHeight, - ellipsoid + ellipsoid, ) { const planes = new Array(6); const centerPoint = s2Cell.getCenter(); @@ -147,11 +147,11 @@ function computeBoundingPlanes( // - Create top plane from surface normal and top point. const centerSurfaceNormal = ellipsoid.geodeticSurfaceNormal( centerPoint, - centerGeodeticNormalScratch + centerGeodeticNormalScratch, ); const topCartographic = ellipsoid.cartesianToCartographic( centerPoint, - topCartographicScratch + topCartographicScratch, ); topCartographic.height = maximumHeight; const top = ellipsoid.cartographicToCartesian(topCartographic, topScratch); @@ -172,12 +172,12 @@ function computeBoundingPlanes( vertices[i] = vertex; vertexCartographic = ellipsoid.cartesianToCartographic( vertex, - vertexCartographicScratch + vertexCartographicScratch, ); vertexCartographic.height = minimumHeight; const distance = Plane.getPointDistance( topPlane, - ellipsoid.cartographicToCartesian(vertexCartographic, vertexScratch) + ellipsoid.cartographicToCartesian(vertexCartographic, vertexScratch), ); if (distance < maxDistance) { maxDistance = distance; @@ -187,7 +187,7 @@ function computeBoundingPlanes( // Negate the normal of the bottom plane since we want all normals to point "outwards". bottomPlane.normal = Cartesian3.negate( bottomPlane.normal, - bottomPlane.normal + bottomPlane.normal, ); bottomPlane.distance = bottomPlane.distance * -1 + maxDistance; planes[1] = bottomPlane; @@ -203,7 +203,7 @@ function computeBoundingPlanes( const adjacentVertex = vertices[(i + 1) % 4]; const geodeticNormal = ellipsoid.geodeticSurfaceNormal( vertex, - vertexGeodeticNormalScratch + vertexGeodeticNormalScratch, ); const side = Cartesian3.subtract(adjacentVertex, vertex, sideScratch); let sideNormal = Cartesian3.cross(side, geodeticNormal, sideNormalScratch); @@ -244,17 +244,17 @@ function computeIntersection(p0, p1, p2) { f0Scratch = Cartesian3.multiplyByScalar( Cartesian3.cross(n1Scratch, n2Scratch, t0Scratch), Cartesian3.dot(x0Scratch, n0Scratch), - f0Scratch + f0Scratch, ); f1Scratch = Cartesian3.multiplyByScalar( Cartesian3.cross(n2Scratch, n0Scratch, t1Scratch), Cartesian3.dot(x1Scratch, n1Scratch), - f1Scratch + f1Scratch, ); f2Scratch = Cartesian3.multiplyByScalar( Cartesian3.cross(n0Scratch, n1Scratch, t2Scratch), Cartesian3.dot(x2Scratch, n2Scratch), - f2Scratch + f2Scratch, ); matrixScratch[0] = n0Scratch.x; @@ -272,7 +272,7 @@ function computeIntersection(p0, p1, p2) { return new Cartesian3( sScratch.x / determinant, sScratch.y / determinant, - sScratch.z / determinant + sScratch.z / determinant, ); } /** @@ -286,13 +286,13 @@ function computeVertices(boundingPlanes) { vertices[i] = computeIntersection( boundingPlanes[0], boundingPlanes[2 + ((i + 3) % 4)], - boundingPlanes[2 + (i % 4)] + boundingPlanes[2 + (i % 4)], ); // Vertices on the bottom plane. vertices[i + 4] = computeIntersection( boundingPlanes[1], boundingPlanes[2 + ((i + 3) % 4)], - boundingPlanes[2 + (i % 4)] + boundingPlanes[2 + (i % 4)], ); } return vertices; @@ -310,16 +310,16 @@ function computeEdgeNormals(plane, vertices) { edgeScratch = Cartesian3.subtract( vertices[(i + 1) % 4], vertices[i], - edgeScratch + edgeScratch, ); edgeNormalScratch = Cartesian3.cross( plane.normal, edgeScratch, - edgeNormalScratch + edgeNormalScratch, ); edgeNormalScratch = Cartesian3.normalize( edgeNormalScratch, - edgeNormalScratch + edgeNormalScratch, ); edgeNormals[i] = Cartesian3.clone(edgeNormalScratch); } @@ -438,7 +438,7 @@ TileBoundingS2Cell.prototype.distanceToCamera = function (frameState) { Plane.projectPointOntoPlane(selectedPlane, point, facePointScratch), vertices[0], selectedPlane, - edgeNormals + edgeNormals, ); return Cartesian3.distance(facePoint, point); @@ -466,7 +466,7 @@ TileBoundingS2Cell.prototype.distanceToCamera = function (frameState) { Plane.projectPointOntoPlane(selectedPlane, point, facePointScratch), vertices[i], selectedPlane, - this._edgeNormals[selectedPlaneIndices[i]] + this._edgeNormals[selectedPlaneIndices[i]], ); distance = Cartesian3.distanceSquared(facePoint, point); @@ -481,11 +481,11 @@ TileBoundingS2Cell.prototype.distanceToCamera = function (frameState) { Plane.projectPointOntoPlane( this._boundingPlanes[1], point, - facePointScratch + facePointScratch, ), this._planeVertices[1], this._boundingPlanes[1], - this._edgeNormals[1] + this._edgeNormals[1], ); return Cartesian3.distance(facePoint, point); } @@ -498,14 +498,14 @@ TileBoundingS2Cell.prototype.distanceToCamera = function (frameState) { if (selectedPlaneIndices[0] === 0) { return Cartesian3.distance( point, - this._vertices[(selectedPlaneIndices[1] - 2 + skip) % 4] + this._vertices[(selectedPlaneIndices[1] - 2 + skip) % 4], ); } // Vertex is on bottom plane. return Cartesian3.distance( point, - this._vertices[4 + ((selectedPlaneIndices[1] - 2 + skip) % 4)] + this._vertices[4 + ((selectedPlaneIndices[1] - 2 + skip) % 4)], ); }; @@ -533,7 +533,7 @@ function closestPointLineSegment(p, l0, l1) { return new Cartesian3( (1 - t) * l0.x + t * l1.x, (1 - t) * l0.y + t * l1.y, - (1 - t) * l0.z + t * l1.z + (1 - t) * l0.z + t * l1.z, ); } @@ -553,7 +553,7 @@ function closestPointPolygon(p, vertices, plane, edgeNormals) { const edgePlane = Plane.fromPointNormal( vertices[i], edgeNormals[i], - edgePlaneScratch + edgePlaneScratch, ); const edgePlaneDistance = Plane.getPointDistance(edgePlane, p); @@ -566,7 +566,7 @@ function closestPointPolygon(p, vertices, plane, edgeNormals) { closestPointOnEdge = closestPointLineSegment( p, vertices[i], - vertices[(i + 1) % 4] + vertices[(i + 1) % 4], ); distance = Cartesian3.distance(p, closestPointOnEdge); @@ -634,9 +634,8 @@ TileBoundingS2Cell.prototype.createDebugVolume = function (color) { positions: this._planeVertices[0], }, }); - const topPlaneGeometry = CoplanarPolygonOutlineGeometry.createGeometry( - topPlanePolygon - ); + const topPlaneGeometry = + CoplanarPolygonOutlineGeometry.createGeometry(topPlanePolygon); const topPlaneInstance = new GeometryInstance({ geometry: topPlaneGeometry, id: "outline", @@ -651,9 +650,8 @@ TileBoundingS2Cell.prototype.createDebugVolume = function (color) { positions: this._planeVertices[1], }, }); - const bottomPlaneGeometry = CoplanarPolygonOutlineGeometry.createGeometry( - bottomPlanePolygon - ); + const bottomPlaneGeometry = + CoplanarPolygonOutlineGeometry.createGeometry(bottomPlanePolygon); const bottomPlaneInstance = new GeometryInstance({ geometry: bottomPlaneGeometry, id: "outline", @@ -670,9 +668,8 @@ TileBoundingS2Cell.prototype.createDebugVolume = function (color) { positions: this._planeVertices[2 + i], }, }); - const sidePlaneGeometry = CoplanarPolygonOutlineGeometry.createGeometry( - sidePlanePolygon - ); + const sidePlaneGeometry = + CoplanarPolygonOutlineGeometry.createGeometry(sidePlanePolygon); sideInstances[i] = new GeometryInstance({ geometry: sidePlaneGeometry, id: "outline", diff --git a/packages/engine/Source/Scene/TileBoundingSphere.js b/packages/engine/Source/Scene/TileBoundingSphere.js index 3e517c1a1fa1..7d6136d28357 100644 --- a/packages/engine/Source/Scene/TileBoundingSphere.js +++ b/packages/engine/Source/Scene/TileBoundingSphere.js @@ -98,7 +98,7 @@ TileBoundingSphere.prototype.distanceToCamera = function (frameState) { return Math.max( 0.0, Cartesian3.distance(boundingSphere.center, frameState.camera.positionWC) - - boundingSphere.radius + boundingSphere.radius, ); }; @@ -144,7 +144,7 @@ TileBoundingSphere.prototype.createDebugVolume = function (color) { }); const modelMatrix = Matrix4.fromTranslation( this.center, - new Matrix4.clone(Matrix4.IDENTITY) + new Matrix4.clone(Matrix4.IDENTITY), ); const instance = new GeometryInstance({ geometry: geometry, diff --git a/packages/engine/Source/Scene/TileCoordinatesImageryProvider.js b/packages/engine/Source/Scene/TileCoordinatesImageryProvider.js index dccdae0df9af..5983a38e3e89 100644 --- a/packages/engine/Source/Scene/TileCoordinatesImageryProvider.js +++ b/packages/engine/Source/Scene/TileCoordinatesImageryProvider.js @@ -205,7 +205,7 @@ Object.defineProperties(TileCoordinatesImageryProvider.prototype, { TileCoordinatesImageryProvider.prototype.getTileCredits = function ( x, y, - level + level, ) { return undefined; }; @@ -223,7 +223,7 @@ TileCoordinatesImageryProvider.prototype.requestImage = function ( x, y, level, - request + request, ) { const canvas = document.createElement("canvas"); canvas.width = 256; @@ -262,7 +262,7 @@ TileCoordinatesImageryProvider.prototype.pickFeatures = function ( y, level, longitude, - latitude + latitude, ) { return undefined; }; diff --git a/packages/engine/Source/Scene/TileImagery.js b/packages/engine/Source/Scene/TileImagery.js index 5032408bdc38..08e79ac95d9e 100644 --- a/packages/engine/Source/Scene/TileImagery.js +++ b/packages/engine/Source/Scene/TileImagery.js @@ -46,7 +46,7 @@ TileImagery.prototype.freeResources = function () { TileImagery.prototype.processStateMachine = function ( tile, frameState, - skipLoading + skipLoading, ) { const loadingImagery = this.loadingImagery; const imageryLayer = loadingImagery.imageryLayer; @@ -54,7 +54,7 @@ TileImagery.prototype.processStateMachine = function ( loadingImagery.processStateMachine( frameState, !this.useWebMercatorT, - skipLoading + skipLoading, ); if (loadingImagery.state === ImageryState.READY) { @@ -63,10 +63,8 @@ TileImagery.prototype.processStateMachine = function ( } this.readyImagery = this.loadingImagery; this.loadingImagery = undefined; - this.textureTranslationAndScale = imageryLayer._calculateTextureTranslationAndScale( - tile, - this - ); + this.textureTranslationAndScale = + imageryLayer._calculateTextureTranslationAndScale(tile, this); return true; // done loading } @@ -98,10 +96,8 @@ TileImagery.prototype.processStateMachine = function ( if (defined(ancestor)) { ancestor.addReference(); - this.textureTranslationAndScale = imageryLayer._calculateTextureTranslationAndScale( - tile, - this - ); + this.textureTranslationAndScale = + imageryLayer._calculateTextureTranslationAndScale(tile, this); } } @@ -117,7 +113,7 @@ TileImagery.prototype.processStateMachine = function ( closestAncestorThatNeedsLoading.processStateMachine( frameState, !this.useWebMercatorT, - skipLoading + skipLoading, ); return false; // not done loading } diff --git a/packages/engine/Source/Scene/TileMapServiceImageryProvider.js b/packages/engine/Source/Scene/TileMapServiceImageryProvider.js index 1797c545e702..b195701fbe0f 100644 --- a/packages/engine/Source/Scene/TileMapServiceImageryProvider.js +++ b/packages/engine/Source/Scene/TileMapServiceImageryProvider.js @@ -81,7 +81,7 @@ TileMapServiceImageryProvider._requestMetadata = async function ( options, tmsResource, xmlResource, - provider + provider, ) { // Try to load remaining parameters from XML try { @@ -91,13 +91,13 @@ TileMapServiceImageryProvider._requestMetadata = async function ( options, tmsResource, xmlResource, - provider + provider, ); } catch (e) { if (e instanceof RequestErrorEvent) { return TileMapServiceImageryProvider._metadataFailure( options, - tmsResource + tmsResource, ); } @@ -143,7 +143,7 @@ TileMapServiceImageryProvider.fromUrl = async function (url, options) { const metadata = await TileMapServiceImageryProvider._requestMetadata( options, tmsResource, - xmlResource + xmlResource, ); return new TileMapServiceImageryProvider(metadata); @@ -151,9 +151,10 @@ TileMapServiceImageryProvider.fromUrl = async function (url, options) { if (defined(Object.create)) { TileMapServiceImageryProvider.prototype = Object.create( - UrlTemplateImageryProvider.prototype + UrlTemplateImageryProvider.prototype, ); - TileMapServiceImageryProvider.prototype.constructor = TileMapServiceImageryProvider; + TileMapServiceImageryProvider.prototype.constructor = + TileMapServiceImageryProvider; } /** @@ -179,18 +180,18 @@ function confineRectangleToTilingScheme(rectangle, tilingScheme) { function calculateSafeMinimumDetailLevel( tilingScheme, rectangle, - minimumLevel + minimumLevel, ) { // Check the number of tiles at the minimum level. If it's more than four, // try requesting the lower levels anyway, because starting at the higher minimum // level will cause too many tiles to be downloaded and rendered. const swTile = tilingScheme.positionToTileXY( Rectangle.southwest(rectangle), - minimumLevel + minimumLevel, ); const neTile = tilingScheme.positionToTileXY( Rectangle.northeast(rectangle), - minimumLevel + minimumLevel, ); const tileCount = (Math.abs(neTile.x - swTile.x) + 1) * (Math.abs(neTile.y - swTile.y) + 1); @@ -215,7 +216,7 @@ TileMapServiceImageryProvider._metadataSuccess = function ( options, tmsResource, xmlResource, - provider + provider, ) { const tileFormatRegex = /tileformat/i; const tileSetRegex = /tileset/i; @@ -254,7 +255,7 @@ TileMapServiceImageryProvider._metadataSuccess = function ( undefined, provider, provider.errorEvent, - message + message, ); } @@ -263,23 +264,23 @@ TileMapServiceImageryProvider._metadataSuccess = function ( const fileExtension = defaultValue( options.fileExtension, - format.getAttribute("extension") + format.getAttribute("extension"), ); const tileWidth = defaultValue( options.tileWidth, - parseInt(format.getAttribute("width"), 10) + parseInt(format.getAttribute("width"), 10), ); const tileHeight = defaultValue( options.tileHeight, - parseInt(format.getAttribute("height"), 10) + parseInt(format.getAttribute("height"), 10), ); let minimumLevel = defaultValue( options.minimumLevel, - parseInt(tilesetsList[0].getAttribute("order"), 10) + parseInt(tilesetsList[0].getAttribute("order"), 10), ); const maximumLevel = defaultValue( options.maximumLevel, - parseInt(tilesetsList[tilesetsList.length - 1].getAttribute("order"), 10) + parseInt(tilesetsList[tilesetsList.length - 1].getAttribute("order"), 10), ); const tilingSchemeName = tilesets.getAttribute("profile"); let tilingScheme = options.tilingScheme; @@ -306,7 +307,7 @@ TileMapServiceImageryProvider._metadataSuccess = function ( undefined, provider, provider.errorEvent, - message + message, ); } @@ -329,20 +330,20 @@ TileMapServiceImageryProvider._metadataSuccess = function ( if (flipXY) { swXY = new Cartesian2( parseFloat(bbox.getAttribute("miny")), - parseFloat(bbox.getAttribute("minx")) + parseFloat(bbox.getAttribute("minx")), ); neXY = new Cartesian2( parseFloat(bbox.getAttribute("maxy")), - parseFloat(bbox.getAttribute("maxx")) + parseFloat(bbox.getAttribute("maxx")), ); } else { swXY = new Cartesian2( parseFloat(bbox.getAttribute("minx")), - parseFloat(bbox.getAttribute("miny")) + parseFloat(bbox.getAttribute("miny")), ); neXY = new Cartesian2( parseFloat(bbox.getAttribute("maxx")), - parseFloat(bbox.getAttribute("maxy")) + parseFloat(bbox.getAttribute("maxy")), ); } @@ -368,7 +369,7 @@ TileMapServiceImageryProvider._metadataSuccess = function ( sw.longitude, sw.latitude, ne.longitude, - ne.latitude + ne.latitude, ); } @@ -378,7 +379,7 @@ TileMapServiceImageryProvider._metadataSuccess = function ( minimumLevel = calculateSafeMinimumDetailLevel( tilingScheme, rectangle, - minimumLevel + minimumLevel, ); const templateResource = tmsResource.getDerivedResource({ @@ -408,7 +409,7 @@ TileMapServiceImageryProvider._metadataSuccess = function ( */ TileMapServiceImageryProvider._metadataFailure = function ( options, - tmsResource + tmsResource, ) { // Can't load XML, still allow options and defaults const fileExtension = defaultValue(options.fileExtension, "png"); @@ -427,7 +428,7 @@ TileMapServiceImageryProvider._metadataFailure = function ( const minimumLevel = calculateSafeMinimumDetailLevel( tilingScheme, rectangle, - options.minimumLevel + options.minimumLevel, ); const templateResource = tmsResource.getDerivedResource({ diff --git a/packages/engine/Source/Scene/TileMetadata.js b/packages/engine/Source/Scene/TileMetadata.js index c2a62d9643d9..c93462c1a578 100644 --- a/packages/engine/Source/Scene/TileMetadata.js +++ b/packages/engine/Source/Scene/TileMetadata.js @@ -100,7 +100,7 @@ TileMetadata.prototype.hasPropertyBySemantic = function (semantic) { return MetadataEntity.hasPropertyBySemantic( semantic, this._properties, - this._class + this._class, ); }; @@ -145,7 +145,7 @@ TileMetadata.prototype.setProperty = function (propertyId, value) { propertyId, value, this._properties, - this._class + this._class, ); }; @@ -160,7 +160,7 @@ TileMetadata.prototype.getPropertyBySemantic = function (semantic) { return MetadataEntity.getPropertyBySemantic( semantic, this._properties, - this._class + this._class, ); }; @@ -177,7 +177,7 @@ TileMetadata.prototype.setPropertyBySemantic = function (semantic, value) { semantic, value, this._properties, - this._class + this._class, ); }; diff --git a/packages/engine/Source/Scene/TileOrientedBoundingBox.js b/packages/engine/Source/Scene/TileOrientedBoundingBox.js index 40d60451f51f..2fe2b925ce45 100644 --- a/packages/engine/Source/Scene/TileOrientedBoundingBox.js +++ b/packages/engine/Source/Scene/TileOrientedBoundingBox.js @@ -22,7 +22,7 @@ function computeMissingVector(a, b, result) { return Cartesian3.multiplyByScalar( result, CesiumMath.EPSILON7 / magnitude, - result + result, ); } @@ -31,7 +31,7 @@ function findOrthogonalVector(a, result) { const b = Cartesian3.equalsEpsilon( temp, Cartesian3.UNIT_X, - CesiumMath.EPSILON6 + CesiumMath.EPSILON6, ) ? Cartesian3.UNIT_Y : Cartesian3.UNIT_X; @@ -96,7 +96,7 @@ function TileOrientedBoundingBox(center, halfAxes) { halfAxes = checkHalfAxes(halfAxes); this._orientedBoundingBox = new OrientedBoundingBox(center, halfAxes); this._boundingSphere = BoundingSphere.fromOrientedBoundingBox( - this._orientedBoundingBox + this._orientedBoundingBox, ); } @@ -140,7 +140,7 @@ TileOrientedBoundingBox.prototype.distanceToCamera = function (frameState) { Check.defined("frameState", frameState); //>>includeEnd('debug'); return Math.sqrt( - this._orientedBoundingBox.distanceSquaredTo(frameState.camera.positionWC) + this._orientedBoundingBox.distanceSquaredTo(frameState.camera.positionWC), ); }; @@ -174,7 +174,7 @@ TileOrientedBoundingBox.prototype.update = function (center, halfAxes) { Matrix3.clone(halfAxes, this._orientedBoundingBox.halfAxes); BoundingSphere.fromOrientedBoundingBox( this._orientedBoundingBox, - this._boundingSphere + this._boundingSphere, ); }; @@ -196,7 +196,7 @@ TileOrientedBoundingBox.prototype.createDebugVolume = function (color) { }); const modelMatrix = Matrix4.fromRotationTranslation( this.boundingVolume.halfAxes, - this.boundingVolume.center + this.boundingVolume.center, ); const instance = new GeometryInstance({ geometry: geometry, diff --git a/packages/engine/Source/Scene/Tileset3DTileContent.js b/packages/engine/Source/Scene/Tileset3DTileContent.js index 41d1652453c1..df9102f73cfb 100644 --- a/packages/engine/Source/Scene/Tileset3DTileContent.js +++ b/packages/engine/Source/Scene/Tileset3DTileContent.js @@ -161,7 +161,7 @@ Tileset3DTileContent.prototype.getFeature = function (batchId) { Tileset3DTileContent.prototype.applyDebugSettings = function ( enabled, - color + color, ) {}; Tileset3DTileContent.prototype.applyStyle = function (style) {}; diff --git a/packages/engine/Source/Scene/TilesetMetadata.js b/packages/engine/Source/Scene/TilesetMetadata.js index ef79ef3ec369..f5f23d1d6315 100644 --- a/packages/engine/Source/Scene/TilesetMetadata.js +++ b/packages/engine/Source/Scene/TilesetMetadata.js @@ -102,7 +102,7 @@ TilesetMetadata.prototype.hasPropertyBySemantic = function (semantic) { return MetadataEntity.hasPropertyBySemantic( semantic, this._properties, - this._class + this._class, ); }; @@ -147,7 +147,7 @@ TilesetMetadata.prototype.setProperty = function (propertyId, value) { propertyId, value, this._properties, - this._class + this._class, ); }; @@ -162,7 +162,7 @@ TilesetMetadata.prototype.getPropertyBySemantic = function (semantic) { return MetadataEntity.getPropertyBySemantic( semantic, this._properties, - this._class + this._class, ); }; @@ -179,7 +179,7 @@ TilesetMetadata.prototype.setPropertyBySemantic = function (semantic, value) { semantic, value, this._properties, - this._class + this._class, ); }; diff --git a/packages/engine/Source/Scene/TimeDynamicImagery.js b/packages/engine/Source/Scene/TimeDynamicImagery.js index 8a12e8902b7c..93c31eb5eede 100644 --- a/packages/engine/Source/Scene/TimeDynamicImagery.js +++ b/packages/engine/Source/Scene/TimeDynamicImagery.js @@ -26,7 +26,7 @@ function TimeDynamicImagery(options) { Check.typeOf.object("options.times", options.times); Check.typeOf.func( "options.requestImageFunction", - options.requestImageFunction + options.requestImageFunction, ); Check.typeOf.func("options.reloadFunction", options.reloadFunction); //>>includeEnd('debug'); @@ -144,7 +144,7 @@ TimeDynamicImagery.prototype.checkApproachingInterval = function ( x, y, level, - request + request, ) { const key = getKey(x, y, level); const tilesRequestedForInterval = this._tilesRequestedForInterval; @@ -292,7 +292,7 @@ function addToCache(that, tile, interval) { keyElements.y, keyElements.level, request, - interval + interval, ); if (!defined(promise)) { return false; diff --git a/packages/engine/Source/Scene/TimeDynamicPointCloud.js b/packages/engine/Source/Scene/TimeDynamicPointCloud.js index 3bd7e3fbb94f..2d52a8ef21cd 100644 --- a/packages/engine/Source/Scene/TimeDynamicPointCloud.js +++ b/packages/engine/Source/Scene/TimeDynamicPointCloud.js @@ -61,7 +61,7 @@ function TimeDynamicPointCloud(options) { * @default Matrix4.IDENTITY */ this.modelMatrix = Matrix4.clone( - defaultValue(options.modelMatrix, Matrix4.IDENTITY) + defaultValue(options.modelMatrix, Matrix4.IDENTITY), ); /** @@ -306,7 +306,7 @@ function getNextInterval(that, currentInterval) { const time = JulianDate.addSeconds( clock.currentTime, averageLoadTime * multiplier, - scratchDate + scratchDate, ); let index = intervals.indexOf(time); @@ -404,7 +404,7 @@ function updateAverageLoadTime(that, loadTime) { that._runningSamples[that._runningIndex] = loadTime; that._runningLength = Math.min( that._runningLength + 1, - that._runningSamples.length + that._runningSamples.length, ); that._runningIndex = (that._runningIndex + 1) % that._runningSamples.length; that._runningAverage = that._runningSum / that._runningLength; @@ -449,7 +449,7 @@ function getGeometricError(that, pointCloud) { return shading.baseResolution; } else if (defined(pointCloud.boundingSphere)) { return CesiumMath.cbrt( - pointCloud.boundingSphere.volume() / pointCloud.pointsLength + pointCloud.boundingSphere.volume() / pointCloud.pointsLength, ); } return 0.0; @@ -474,7 +474,7 @@ function renderFrame(that, frame, updateState, frameState) { pointCloud.modelMatrix = Matrix4.multiplyTransformation( that.modelMatrix, transform, - scratchModelMatrix + scratchModelMatrix, ); pointCloud.style = that.style; pointCloud.time = updateState.timeSinceLoad; @@ -556,7 +556,7 @@ function getNearestReadyInterval( previousInterval, currentInterval, updateState, - frameState + frameState, ) { let i; let interval; @@ -633,7 +633,7 @@ TimeDynamicPointCloud.prototype.update = function (frameState) { // For styling const timeSinceLoad = Math.max( JulianDate.secondsDifference(frameState.time, this._loadTimestamp) * 1000, - 0.0 + 0.0, ); // Update clipping planes @@ -701,7 +701,7 @@ TimeDynamicPointCloud.prototype.update = function (frameState) { previousInterval, currentInterval, updateState, - frameState + frameState, ); let frame = getFrame(this, previousInterval); @@ -761,7 +761,7 @@ TimeDynamicPointCloud.prototype.update = function (frameState) { frameState, lengthBeforeUpdate, shading, - this.boundingSphere + this.boundingSphere, ); } }; diff --git a/packages/engine/Source/Scene/TranslucentTileClassification.js b/packages/engine/Source/Scene/TranslucentTileClassification.js index b171fe76adff..3dab18bcfc23 100644 --- a/packages/engine/Source/Scene/TranslucentTileClassification.js +++ b/packages/engine/Source/Scene/TranslucentTileClassification.js @@ -117,12 +117,12 @@ function updateTextures(transpClass, context, width, height) { function updateFramebuffers(transpClass, context, width, height) { destroyFramebuffers(transpClass); transpClass._drawClassificationFBO.setDepthStencilTexture( - transpClass._translucentDepthStencilTexture + transpClass._translucentDepthStencilTexture, ); transpClass._drawClassificationFBO.update(context, width, height); transpClass._accumulationFBO.setDepthStencilTexture( - transpClass._translucentDepthStencilTexture + transpClass._translucentDepthStencilTexture, ); transpClass._accumulationFBO.update(context, width, height); @@ -133,7 +133,7 @@ function updateResources( transpClass, context, passState, - globeDepthStencilTexture + globeDepthStencilTexture, ) { if (!transpClass.isSupported()) { return; @@ -206,7 +206,7 @@ function updateResources( defines: ["PICK"], }), attributeLocations: compositeProgram._attributeLocations, - } + }, ); const compositePickCommand = DrawCommand.shallowClone(compositeCommand); compositePickCommand.shaderProgram = compositePickProgram; @@ -252,7 +252,7 @@ function updateResources( const useScissorTest = !BoundingRectangle.equals( transpClass._viewport, - passState.viewport + passState.viewport, ); let updateScissor = useScissorTest !== transpClass._useScissorTest; transpClass._useScissorTest = useScissorTest; @@ -262,7 +262,7 @@ function updateResources( ) { transpClass._scissorRectangle = BoundingRectangle.clone( passState.viewport, - transpClass._scissorRectangle + transpClass._scissorRectangle, ); updateScissor = true; } @@ -271,7 +271,7 @@ function updateResources( !defined(transpClass._rsDepth) || !BoundingRectangle.equals( transpClass._viewport, - transpClass._rsDepth.viewport + transpClass._rsDepth.viewport, ) || updateScissor ) { @@ -292,7 +292,7 @@ function updateResources( !defined(transpClass._rsAccumulate) || !BoundingRectangle.equals( transpClass._viewport, - transpClass._rsAccumulate.viewport + transpClass._rsAccumulate.viewport, ) || updateScissor ) { @@ -318,7 +318,7 @@ function updateResources( !defined(transpClass._rsComp) || !BoundingRectangle.equals( transpClass._viewport, - transpClass._rsComp.viewport + transpClass._rsComp.viewport, ) || updateScissor ) { @@ -344,7 +344,7 @@ TranslucentTileClassification.prototype.executeTranslucentCommands = function ( executeCommand, passState, commands, - globeDepthStencilTexture + globeDepthStencilTexture, ) { // Check for translucent commands that should be classified const length = commands.length; @@ -401,52 +401,49 @@ TranslucentTileClassification.prototype.executeTranslucentCommands = function ( passState.framebuffer = framebuffer; }; -TranslucentTileClassification.prototype.executeClassificationCommands = function ( - scene, - executeCommand, - passState, - frustumCommands -) { - if (!this._hasTranslucentDepth) { - return; - } +TranslucentTileClassification.prototype.executeClassificationCommands = + function (scene, executeCommand, passState, frustumCommands) { + if (!this._hasTranslucentDepth) { + return; + } - const context = scene.context; - const us = context.uniformState; - const framebuffer = passState.framebuffer; + const context = scene.context; + const us = context.uniformState; + const framebuffer = passState.framebuffer; - if (this._frustumsDrawn === 2) { - // copy classification from first frustum - passState.framebuffer = this._accumulationFBO.framebuffer; - this._copyCommand.execute(context, passState); - } + if (this._frustumsDrawn === 2) { + // copy classification from first frustum + passState.framebuffer = this._accumulationFBO.framebuffer; + this._copyCommand.execute(context, passState); + } - passState.framebuffer = this._drawClassificationFBO.framebuffer; - if (this._frustumsDrawn > 1) { - this._clearColorCommand.execute(context, passState); - } + passState.framebuffer = this._drawClassificationFBO.framebuffer; + if (this._frustumsDrawn > 1) { + this._clearColorCommand.execute(context, passState); + } - us.updatePass(Pass.CESIUM_3D_TILE_CLASSIFICATION); - const swapGlobeDepth = us.globeDepthTexture; - us.globeDepthTexture = this._packFBO.getColorTexture(); - const commands = frustumCommands.commands[Pass.CESIUM_3D_TILE_CLASSIFICATION]; - const length = frustumCommands.indices[Pass.CESIUM_3D_TILE_CLASSIFICATION]; - for (let i = 0; i < length; ++i) { - executeCommand(commands[i], scene, context, passState); - } + us.updatePass(Pass.CESIUM_3D_TILE_CLASSIFICATION); + const swapGlobeDepth = us.globeDepthTexture; + us.globeDepthTexture = this._packFBO.getColorTexture(); + const commands = + frustumCommands.commands[Pass.CESIUM_3D_TILE_CLASSIFICATION]; + const length = frustumCommands.indices[Pass.CESIUM_3D_TILE_CLASSIFICATION]; + for (let i = 0; i < length; ++i) { + executeCommand(commands[i], scene, context, passState); + } - us.globeDepthTexture = swapGlobeDepth; - passState.framebuffer = framebuffer; + us.globeDepthTexture = swapGlobeDepth; + passState.framebuffer = framebuffer; - if (this._frustumsDrawn === 1) { - return; - } + if (this._frustumsDrawn === 1) { + return; + } - passState.framebuffer = this._accumulationFBO.framebuffer; - this._accumulateCommand.execute(context, passState); + passState.framebuffer = this._accumulationFBO.framebuffer; + this._accumulateCommand.execute(context, passState); - passState.framebuffer = framebuffer; -}; + passState.framebuffer = framebuffer; + }; TranslucentTileClassification.prototype.execute = function (scene, passState) { if (!this._hasTranslucentDepth) { @@ -477,7 +474,7 @@ function clear(translucentTileClassification, scene, passState) { translucentTileClassification._drawClassificationFBO.framebuffer; translucentTileClassification._clearColorCommand.execute( scene._context, - passState + passState, ); passState.framebuffer = framebuffer; @@ -487,7 +484,7 @@ function clear(translucentTileClassification, scene, passState) { translucentTileClassification._accumulationFBO.framebuffer; translucentTileClassification._clearColorCommand.execute( scene._context, - passState + passState, ); } diff --git a/packages/engine/Source/Scene/TweenCollection.js b/packages/engine/Source/Scene/TweenCollection.js index e49bad844f57..8ace4f73ed8f 100644 --- a/packages/engine/Source/Scene/TweenCollection.js +++ b/packages/engine/Source/Scene/TweenCollection.js @@ -26,7 +26,7 @@ function Tween( easingFunction, update, complete, - cancel + cancel, ) { this._tweens = tweens; this._tweenjs = tweenjs; @@ -217,13 +217,13 @@ TweenCollection.prototype.add = function (options) { //>>includeStart('debug', pragmas.debug); if (!defined(options.startObject) || !defined(options.stopObject)) { throw new DeveloperError( - "options.startObject and options.stopObject are required." + "options.startObject and options.stopObject are required.", ); } if (!defined(options.duration) || options.duration < 0.0) { throw new DeveloperError( - "options.duration is required and must be positive." + "options.duration is required and must be positive.", ); } //>>includeEnd('debug'); @@ -240,7 +240,7 @@ TweenCollection.prototype.add = function (options) { const delay = delayInSeconds / TimeConstants.SECONDS_PER_MILLISECOND; const easingFunction = defaultValue( options.easingFunction, - EasingFunction.LINEAR_NONE + EasingFunction.LINEAR_NONE, ); const value = options.startObject; @@ -266,7 +266,7 @@ TweenCollection.prototype.add = function (options) { easingFunction, options.update, options.complete, - options.cancel + options.cancel, ); this._tweens.push(tween); return tween; @@ -303,17 +303,17 @@ TweenCollection.prototype.addProperty = function (options) { //>>includeStart('debug', pragmas.debug); if (!defined(object) || !defined(options.property)) { throw new DeveloperError( - "options.object and options.property are required." + "options.object and options.property are required.", ); } if (!defined(object[property])) { throw new DeveloperError( - "options.object must have the specified property." + "options.object must have the specified property.", ); } if (!defined(startValue) || !defined(stopValue)) { throw new DeveloperError( - "options.startValue and options.stopValue are required." + "options.startValue and options.stopValue are required.", ); } //>>includeEnd('debug'); @@ -384,7 +384,7 @@ TweenCollection.prototype.addAlpha = function (options) { //>>includeStart('debug', pragmas.debug); if (properties.length === 0) { throw new DeveloperError( - "material has no properties with alpha components." + "material has no properties with alpha components.", ); } //>>includeEnd('debug'); diff --git a/packages/engine/Source/Scene/UrlTemplateImageryProvider.js b/packages/engine/Source/Scene/UrlTemplateImageryProvider.js index 9eee9536831b..48dcab645f46 100644 --- a/packages/engine/Source/Scene/UrlTemplateImageryProvider.js +++ b/packages/engine/Source/Scene/UrlTemplateImageryProvider.js @@ -219,16 +219,16 @@ function UrlTemplateImageryProvider(options) { this._maximumLevel = options.maximumLevel; this._tilingScheme = defaultValue( options.tilingScheme, - new WebMercatorTilingScheme({ ellipsoid: options.ellipsoid }) + new WebMercatorTilingScheme({ ellipsoid: options.ellipsoid }), ); this._rectangle = defaultValue( options.rectangle, - this._tilingScheme.rectangle + this._tilingScheme.rectangle, ); this._rectangle = Rectangle.intersection( this._rectangle, - this._tilingScheme.rectangle + this._tilingScheme.rectangle, ); this._tileDiscardPolicy = options.tileDiscardPolicy; @@ -527,11 +527,11 @@ UrlTemplateImageryProvider.prototype.requestImage = function ( x, y, level, - request + request, ) { return ImageryProvider.loadImage( this, - buildImageResource(this, x, y, level, request) + buildImageResource(this, x, y, level, request), ); }; @@ -554,7 +554,7 @@ UrlTemplateImageryProvider.prototype.pickFeatures = function ( y, level, longitude, - latitude + latitude, ) { if ( !this.enablePickFeatures || @@ -586,7 +586,7 @@ UrlTemplateImageryProvider.prototype.pickFeatures = function ( level, longitude, latitude, - format.format + format.format, ); ++formatIndex; @@ -650,7 +650,7 @@ function buildPickFeaturesResource( level, longitude, latitude, - format + format, ) { degreesScratchComputed = false; projectedScratchComputed = false; @@ -673,7 +673,7 @@ function buildPickFeaturesResource( level, longitude, latitude, - format + format, ); } }); @@ -698,7 +698,7 @@ function padWithZerosIfNecessary(imageryProvider, key, value) { value.length >= paddingTemplateWidth ? value : new Array( - paddingTemplateWidth - value.toString().length + 1 + paddingTemplateWidth - value.toString().length + 1, ).join("0") + value; } } @@ -787,7 +787,7 @@ function computeProjected(imageryProvider, x, y, level) { x, y, level, - projectedScratch + projectedScratch, ); projectedScratchComputed = true; @@ -838,7 +838,7 @@ function reverseITag( level, longitude, latitude, - format + format, ) { computeIJ(imageryProvider, x, y, level, longitude, latitude); return imageryProvider.tileWidth - ijScratch.x - 1; @@ -851,7 +851,7 @@ function reverseJTag( level, longitude, latitude, - format + format, ) { computeIJ(imageryProvider, x, y, level, longitude, latitude); return imageryProvider.tileHeight - ijScratch.y - 1; @@ -871,7 +871,7 @@ function computeIJ(imageryProvider, x, y, level, longitude, latitude, format) { y, level, longitude, - latitude + latitude, ); const projected = longitudeLatitudeProjectedScratch; @@ -879,7 +879,7 @@ function computeIJ(imageryProvider, x, y, level, longitude, latitude, format) { x, y, level, - rectangleScratch + rectangleScratch, ); ijScratch.x = ((imageryProvider.tileWidth * (projected.x - rectangle.west)) / @@ -899,7 +899,7 @@ function longitudeDegreesTag( level, longitude, latitude, - format + format, ) { return CesiumMath.toDegrees(longitude); } @@ -911,7 +911,7 @@ function latitudeDegreesTag( level, longitude, latitude, - format + format, ) { return CesiumMath.toDegrees(latitude); } @@ -923,7 +923,7 @@ function longitudeProjectedTag( level, longitude, latitude, - format + format, ) { computeLongitudeLatitudeProjected( imageryProvider, @@ -931,7 +931,7 @@ function longitudeProjectedTag( y, level, longitude, - latitude + latitude, ); return longitudeLatitudeProjectedScratch.x; } @@ -943,7 +943,7 @@ function latitudeProjectedTag( level, longitude, latitude, - format + format, ) { computeLongitudeLatitudeProjected( imageryProvider, @@ -951,7 +951,7 @@ function latitudeProjectedTag( y, level, longitude, - latitude + latitude, ); return longitudeLatitudeProjectedScratch.y; } @@ -965,7 +965,7 @@ function computeLongitudeLatitudeProjected( level, longitude, latitude, - format + format, ) { if (longitudeLatitudeProjectedScratchComputed) { return; @@ -980,7 +980,7 @@ function computeLongitudeLatitudeProjected( cartographic.latitude = latitude; imageryProvider.tilingScheme.projection.project( cartographic, - longitudeLatitudeProjectedScratch + longitudeLatitudeProjectedScratch, ); } diff --git a/packages/engine/Source/Scene/Vector3DTileClampedPolylines.js b/packages/engine/Source/Scene/Vector3DTileClampedPolylines.js index 657599492973..30a07500ce07 100644 --- a/packages/engine/Source/Scene/Vector3DTileClampedPolylines.js +++ b/packages/engine/Source/Scene/Vector3DTileClampedPolylines.js @@ -80,13 +80,13 @@ function Vector3DTileClampedPolylines(options) { this._packedBuffer = undefined; this._minimumMaximumVectorHeights = new Cartesian2( ApproximateTerrainHeights._defaultMinTerrainHeight, - ApproximateTerrainHeights._defaultMaxTerrainHeight + ApproximateTerrainHeights._defaultMaxTerrainHeight, ); this._boundingVolume = OrientedBoundingBox.fromRectangle( options.rectangle, ApproximateTerrainHeights._defaultMinTerrainHeight, ApproximateTerrainHeights._defaultMaxTerrainHeight, - this._ellipsoid + this._ellipsoid, ); this._classificationType = options.classificationType; @@ -161,7 +161,7 @@ Object.defineProperties(Vector3DTileClampedPolylines.prototype, { function updateMinimumMaximumHeights(polylines, rectangle, ellipsoid) { const result = ApproximateTerrainHeights.getMinimumMaximumHeights( rectangle, - ellipsoid + ellipsoid, ); const min = result.minimumTerrainHeight; const max = result.maximumTerrainHeight; @@ -204,7 +204,7 @@ function packBuffer(polylines) { } const createVerticesTaskProcessor = new TaskProcessor( - "createVectorTileClampedPolylines" + "createVectorTileClampedPolylines", ); const attributeLocations = { startEllipsoidNormal: 0, @@ -257,7 +257,7 @@ function createVertexArray(polylines, context) { const verticesPromise = createVerticesTaskProcessor.scheduleTask( parameters, - transferrableObjects + transferrableObjects, ); if (!defined(verticesPromise)) { // Postponed @@ -273,27 +273,27 @@ function createVertexArray(polylines, context) { if (polylines._keepDecodedPositions) { polylines._decodedPositions = new Float64Array(result.decodedPositions); polylines._decodedPositionOffsets = new Uint32Array( - result.decodedPositionOffsets + result.decodedPositionOffsets, ); } polylines._startEllipsoidNormals = new Float32Array( - result.startEllipsoidNormals + result.startEllipsoidNormals, ); polylines._endEllipsoidNormals = new Float32Array( - result.endEllipsoidNormals + result.endEllipsoidNormals, ); polylines._startPositionAndHeights = new Float32Array( - result.startPositionAndHeights + result.startPositionAndHeights, ); polylines._startFaceNormalAndVertexCornerIds = new Float32Array( - result.startFaceNormalAndVertexCornerIds + result.startFaceNormalAndVertexCornerIds, ); polylines._endPositionAndHeights = new Float32Array( - result.endPositionAndHeights + result.endPositionAndHeights, ); polylines._endFaceNormalAndHalfWidths = new Float32Array( - result.endFaceNormalAndHalfWidths + result.endFaceNormalAndHalfWidths, ); polylines._vertexBatchIds = new Uint16Array(result.vertexBatchIds); @@ -477,12 +477,12 @@ function createUniformMap(primitive, context) { Matrix4.multiplyByPoint( modifiedModelViewScratch, primitive._center, - rtcScratch + rtcScratch, ); Matrix4.setTranslation( modifiedModelViewScratch, rtcScratch, - modifiedModelViewScratch + modifiedModelViewScratch, ); return modifiedModelViewScratch; }, @@ -549,12 +549,12 @@ function createShaders(primitive, context) { const vsSource = batchTable.getVertexShaderCallback( false, "a_batchId", - undefined + undefined, )(Vector3DTileClampedPolylinesVS); const fsSource = batchTable.getFragmentShaderCallback( false, undefined, - true + true, )(Vector3DTileClampedPolylinesFS); const vs = new ShaderSource({ @@ -581,7 +581,7 @@ function queueCommands(primitive, frameState) { let command = primitive._command; if (!defined(primitive._command)) { const uniformMap = primitive._batchTable.getUniformMapCallback()( - primitive._uniformMap + primitive._uniformMap, ); command = primitive._command = new DrawCommand({ owner: primitive, @@ -596,7 +596,7 @@ function queueCommands(primitive, frameState) { const derivedTilesetCommand = DrawCommand.shallowClone( command, - command.derivedCommands.tileset + command.derivedCommands.tileset, ); derivedTilesetCommand.renderState = primitive._rs3DTiles; derivedTilesetCommand.pass = Pass.CESIUM_3D_TILE_CLASSIFICATION; @@ -635,7 +635,7 @@ Vector3DTileClampedPolylines.prototype.getPositions = function (batchId) { */ Vector3DTileClampedPolylines.prototype.createFeatures = function ( content, - features + features, ) { const batchIds = this._batchIds; const length = batchIds.length; @@ -653,7 +653,7 @@ Vector3DTileClampedPolylines.prototype.createFeatures = function ( */ Vector3DTileClampedPolylines.prototype.applyDebugSettings = function ( enabled, - color + color, ) { this._highlightColor = enabled ? color : this._constantColor; }; @@ -708,7 +708,7 @@ function initialize(polylines) { updateMinimumMaximumHeights( polylines, polylines._rectangle, - polylines._ellipsoid + polylines._ellipsoid, ); }) .catch((error) => { diff --git a/packages/engine/Source/Scene/Vector3DTileContent.js b/packages/engine/Source/Scene/Vector3DTileContent.js index 120a22db5801..1975f60b6055 100644 --- a/packages/engine/Source/Scene/Vector3DTileContent.js +++ b/packages/engine/Source/Scene/Vector3DTileContent.js @@ -204,7 +204,7 @@ function getBatchIds(featureTableJson, featureTableBinary) { polygonBatchIds = new Uint16Array( featureTableBinary.buffer, polygonBatchIdsByteOffset, - numberOfPolygons + numberOfPolygons, ); } @@ -215,7 +215,7 @@ function getBatchIds(featureTableJson, featureTableBinary) { polylineBatchIds = new Uint16Array( featureTableBinary.buffer, polylineBatchIdsByteOffset, - numberOfPolylines + numberOfPolylines, ); } @@ -226,7 +226,7 @@ function getBatchIds(featureTableJson, featureTableBinary) { pointBatchIds = new Uint16Array( featureTableBinary.buffer, pointBatchIdsByteOffset, - numberOfPoints + numberOfPoints, ); } @@ -241,7 +241,7 @@ function getBatchIds(featureTableJson, featureTableBinary) { if (atLeastOneDefined && atLeastOneUndefined) { throw new RuntimeError( - "If one group of batch ids is defined, then all batch ids must be defined" + "If one group of batch ids is defined, then all batch ids must be defined", ); } @@ -298,7 +298,7 @@ function initialize(content, arrayBuffer, byteOffset) { const version = view.getUint32(byteOffset, true); if (version !== 1) { throw new RuntimeError( - `Only Vector tile version 1 is supported. Version ${version} is not.` + `Only Vector tile version 1 is supported. Version ${version} is not.`, ); } byteOffset += sizeOfUint32; @@ -316,7 +316,7 @@ function initialize(content, arrayBuffer, byteOffset) { if (featureTableJSONByteLength === 0) { throw new RuntimeError( - "Feature table must have a byte length greater than zero" + "Feature table must have a byte length greater than zero", ); } @@ -338,14 +338,14 @@ function initialize(content, arrayBuffer, byteOffset) { const featureTableJson = getJsonFromTypedArray( uint8Array, byteOffset, - featureTableJSONByteLength + featureTableJSONByteLength, ); byteOffset += featureTableJSONByteLength; const featureTableBinary = new Uint8Array( arrayBuffer, byteOffset, - featureTableBinaryByteLength + featureTableBinaryByteLength, ); byteOffset += featureTableBinaryByteLength; @@ -360,7 +360,7 @@ function initialize(content, arrayBuffer, byteOffset) { batchTableJson = getJsonFromTypedArray( uint8Array, byteOffset, - batchTableJSONByteLength + batchTableJSONByteLength, ); byteOffset += batchTableJSONByteLength; @@ -369,7 +369,7 @@ function initialize(content, arrayBuffer, byteOffset) { batchTableBinary = new Uint8Array( arrayBuffer, byteOffset, - batchTableBinaryByteLength + batchTableBinaryByteLength, ); // Copy the batchTableBinary section and let the underlying ArrayBuffer be freed batchTableBinary = new Uint8Array(batchTableBinary); @@ -387,7 +387,7 @@ function initialize(content, arrayBuffer, byteOffset) { totalPrimitives, batchTableJson, batchTableBinary, - createColorChangedCallback(content) + createColorChangedCallback(content), ); content._batchTable = batchTable; @@ -397,12 +397,12 @@ function initialize(content, arrayBuffer, byteOffset) { const featureTable = new Cesium3DTileFeatureTable( featureTableJson, - featureTableBinary + featureTableBinary, ); const region = featureTable.getGlobalProperty("REGION"); if (!defined(region)) { throw new RuntimeError( - "Feature table global property: REGION must be defined" + "Feature table global property: REGION must be defined", ); } const rectangle = Rectangle.unpack(region); @@ -414,7 +414,7 @@ function initialize(content, arrayBuffer, byteOffset) { let center = featureTable.getGlobalProperty( "RTC_CENTER", ComponentDatatype.FLOAT, - 3 + 3, ); if (defined(center)) { center = Cartesian3.unpack(center); @@ -435,18 +435,18 @@ function initialize(content, arrayBuffer, byteOffset) { featureTable.getPropertyArray( "POLYGON_COUNTS", ComponentDatatype.UNSIGNED_INT, - 1 + 1, ), featureTable.getPropertyArray( "POLYGON_COUNT", ComponentDatatype.UNSIGNED_INT, - 1 - ) // Workaround for old vector tilesets using the non-plural name + 1, + ), // Workaround for old vector tilesets using the non-plural name ); if (!defined(polygonCounts)) { throw new RuntimeError( - "Feature table property: POLYGON_COUNTS must be defined when POLYGONS_LENGTH is greater than 0" + "Feature table property: POLYGON_COUNTS must be defined when POLYGONS_LENGTH is greater than 0", ); } @@ -454,18 +454,18 @@ function initialize(content, arrayBuffer, byteOffset) { featureTable.getPropertyArray( "POLYGON_INDEX_COUNTS", ComponentDatatype.UNSIGNED_INT, - 1 + 1, ), featureTable.getPropertyArray( "POLYGON_INDEX_COUNT", ComponentDatatype.UNSIGNED_INT, - 1 - ) // Workaround for old vector tilesets using the non-plural name + 1, + ), // Workaround for old vector tilesets using the non-plural name ); if (!defined(polygonIndexCounts)) { throw new RuntimeError( - "Feature table property: POLYGON_INDEX_COUNTS must be defined when POLYGONS_LENGTH is greater than 0" + "Feature table property: POLYGON_INDEX_COUNTS must be defined when POLYGONS_LENGTH is greater than 0", ); } @@ -477,11 +477,10 @@ function initialize(content, arrayBuffer, byteOffset) { const numPolygonIndices = polygonIndexCounts.reduce(function ( total, - count + count, ) { return total + count; - }, - 0); + }, 0); const indices = new Uint32Array(arrayBuffer, byteOffset, numPolygonIndices); byteOffset += indicesByteLength; @@ -489,7 +488,7 @@ function initialize(content, arrayBuffer, byteOffset) { const polygonPositions = new Uint16Array( arrayBuffer, byteOffset, - numPolygonPositions + numPolygonPositions, ); byteOffset += positionByteLength; @@ -502,12 +501,12 @@ function initialize(content, arrayBuffer, byteOffset) { polygonMinimumHeights = featureTable.getPropertyArray( "POLYGON_MINIMUM_HEIGHTS", ComponentDatatype.FLOAT, - 1 + 1, ); polygonMaximumHeights = featureTable.getPropertyArray( "POLYGON_MAXIMUM_HEIGHTS", ComponentDatatype.FLOAT, - 1 + 1, ); } @@ -536,25 +535,25 @@ function initialize(content, arrayBuffer, byteOffset) { featureTable.getPropertyArray( "POLYLINE_COUNTS", ComponentDatatype.UNSIGNED_INT, - 1 + 1, ), featureTable.getPropertyArray( "POLYLINE_COUNT", ComponentDatatype.UNSIGNED_INT, - 1 - ) // Workaround for old vector tilesets using the non-plural name + 1, + ), // Workaround for old vector tilesets using the non-plural name ); if (!defined(polylineCounts)) { throw new RuntimeError( - "Feature table property: POLYLINE_COUNTS must be defined when POLYLINES_LENGTH is greater than 0" + "Feature table property: POLYLINE_COUNTS must be defined when POLYLINES_LENGTH is greater than 0", ); } let widths = featureTable.getPropertyArray( "POLYLINE_WIDTHS", ComponentDatatype.UNSIGNED_SHORT, - 1 + 1, ); if (!defined(widths)) { widths = new Uint16Array(numberOfPolylines); @@ -571,7 +570,7 @@ function initialize(content, arrayBuffer, byteOffset) { const polylinePositions = new Uint16Array( arrayBuffer, byteOffset, - numPolylinePositions + numPolylinePositions, ); byteOffset += polylinePositionByteLength; @@ -583,7 +582,7 @@ function initialize(content, arrayBuffer, byteOffset) { rectangle, minHeight, maxHeight, - Ellipsoid.WGS84 + Ellipsoid.WGS84, ); examineVectorLines( decodedPositions, @@ -591,7 +590,7 @@ function initialize(content, arrayBuffer, byteOffset) { batchIds.polylines, batchTable, content.url, - examineVectorLinesFunction + examineVectorLinesFunction, ); } @@ -620,7 +619,7 @@ function initialize(content, arrayBuffer, byteOffset) { const pointPositions = new Uint16Array( arrayBuffer, byteOffset, - numberOfPoints * 3 + numberOfPoints * 3, ); byteOffset += pointsPositionByteLength; content._points = new Vector3DTilePoints({ @@ -663,7 +662,7 @@ Vector3DTileContent.prototype.getFeature = function (batchId) { throw new DeveloperError( `batchId is required and between zero and featuresLength - 1 (${ featuresLength - 1 - }).` + }).`, ); } //>>includeEnd('debug'); @@ -758,7 +757,7 @@ function examineVectorLines( batchIds, batchTable, url, - callback + callback, ) { const countsLength = counts.length; let polylineStart = 0; diff --git a/packages/engine/Source/Scene/Vector3DTileGeometry.js b/packages/engine/Source/Scene/Vector3DTileGeometry.js index c6e4c7688079..682ca7dbb5e5 100644 --- a/packages/engine/Source/Scene/Vector3DTileGeometry.js +++ b/packages/engine/Source/Scene/Vector3DTileGeometry.js @@ -160,7 +160,7 @@ Vector3DTileGeometry.packedSphereLength = Cartesian3.packedLength + 1; function packBuffer(geometries) { const packedBuffer = new Float64Array( - Matrix4.packedLength + Cartesian3.packedLength + Matrix4.packedLength + Cartesian3.packedLength, ); let offset = 0; @@ -213,7 +213,7 @@ function unpackBuffer(geometries, packedBuffer) { const createVerticesTaskProcessor = new TaskProcessor( "createVectorTileGeometries", - 5 + 5, ); const scratchColor = new Color(); @@ -245,12 +245,14 @@ function createPrimitive(geometries) { } if (defined(geometries._cylinders)) { cylinders = geometries._cylinders = cylinders.slice(); - cylinderBatchIds = geometries._cylinderBatchIds = cylinderBatchIds.slice(); + cylinderBatchIds = geometries._cylinderBatchIds = + cylinderBatchIds.slice(); length += cylinderBatchIds.length; } if (defined(geometries._ellipsoids)) { ellipsoids = geometries._ellipsoids = ellipsoids.slice(); - ellipsoidBatchIds = geometries._ellipsoidBatchIds = ellipsoidBatchIds.slice(); + ellipsoidBatchIds = geometries._ellipsoidBatchIds = + ellipsoidBatchIds.slice(); length += ellipsoidBatchIds.length; } if (defined(geometries._spheres)) { @@ -302,10 +304,11 @@ function createPrimitive(geometries) { packedBuffer: packedBuffer.buffer, }; - const verticesPromise = (geometries._verticesPromise = createVerticesTaskProcessor.scheduleTask( - parameters, - transferrableObjects - )); + const verticesPromise = (geometries._verticesPromise = + createVerticesTaskProcessor.scheduleTask( + parameters, + transferrableObjects, + )); if (!defined(verticesPromise)) { // Postponed return; diff --git a/packages/engine/Source/Scene/Vector3DTilePoints.js b/packages/engine/Source/Scene/Vector3DTilePoints.js index 7bea9c2c9022..e985e226bf20 100644 --- a/packages/engine/Source/Scene/Vector3DTilePoints.js +++ b/packages/engine/Source/Scene/Vector3DTilePoints.js @@ -101,8 +101,8 @@ Object.defineProperties(Vector3DTilePoints.prototype, { */ texturesByteLength: { get: function () { - const billboardSize = this._billboardCollection.textureAtlas.texture - .sizeInBytes; + const billboardSize = + this._billboardCollection.textureAtlas.texture.sizeInBytes; const labelSize = this._labelCollection._textureAtlas.texture.sizeInBytes; return billboardSize + labelSize; }, @@ -131,7 +131,7 @@ function packBuffer(points, ellipsoid) { const createVerticesTaskProcessor = new TaskProcessor( "createVectorTilePoints", - 5 + 5, ); const scratchPosition = new Cartesian3(); @@ -155,7 +155,7 @@ function createPoints(points, ellipsoid) { const verticesPromise = createVerticesTaskProcessor.scheduleTask( parameters, - transferrableObjects + transferrableObjects, ); if (!defined(verticesPromise)) { // Postponed @@ -233,7 +233,7 @@ Vector3DTilePoints.prototype.createFeatures = function (content, features) { batchId, billboard, label, - polyline + polyline, ); } }; @@ -337,7 +337,7 @@ Vector3DTilePoints.prototype.applyStyle = function (style, features) { if (defined(style.pointOutlineColor)) { feature.pointOutlineColor = style.pointOutlineColor.evaluateColor( feature, - scratchColor2 + scratchColor2, ); } @@ -348,14 +348,14 @@ Vector3DTilePoints.prototype.applyStyle = function (style, features) { if (defined(style.labelColor)) { feature.labelColor = style.labelColor.evaluateColor( feature, - scratchColor3 + scratchColor3, ); } if (defined(style.labelOutlineColor)) { feature.labelOutlineColor = style.labelOutlineColor.evaluateColor( feature, - scratchColor4 + scratchColor4, ); } @@ -380,7 +380,7 @@ Vector3DTilePoints.prototype.applyStyle = function (style, features) { if (defined(style.backgroundColor)) { feature.backgroundColor = style.backgroundColor.evaluateColor( feature, - scratchColor5 + scratchColor5, ); } @@ -408,9 +408,8 @@ Vector3DTilePoints.prototype.applyStyle = function (style, features) { } if (defined(style.translucencyByDistance)) { - const translucencyByDistanceCart4 = style.translucencyByDistance.evaluate( - feature - ); + const translucencyByDistanceCart4 = + style.translucencyByDistance.evaluate(feature); if (defined(translucencyByDistanceCart4)) { scratchTranslucencyByDistance.near = translucencyByDistanceCart4.x; scratchTranslucencyByDistance.nearValue = translucencyByDistanceCart4.y; @@ -425,9 +424,8 @@ Vector3DTilePoints.prototype.applyStyle = function (style, features) { } if (defined(style.distanceDisplayCondition)) { - const distanceDisplayConditionCart2 = style.distanceDisplayCondition.evaluate( - feature - ); + const distanceDisplayConditionCart2 = + style.distanceDisplayCondition.evaluate(feature); if (defined(distanceDisplayConditionCart2)) { scratchDistanceDisplayCondition.near = distanceDisplayConditionCart2.x; scratchDistanceDisplayCondition.far = distanceDisplayConditionCart2.y; @@ -450,7 +448,7 @@ Vector3DTilePoints.prototype.applyStyle = function (style, features) { if (defined(style.anchorLineColor)) { feature.anchorLineColor = style.anchorLineColor.evaluateColor( feature, - scratchColor6 + scratchColor6, ); } @@ -461,9 +459,8 @@ Vector3DTilePoints.prototype.applyStyle = function (style, features) { } if (defined(style.disableDepthTestDistance)) { - feature.disableDepthTestDistance = style.disableDepthTestDistance.evaluate( - feature - ); + feature.disableDepthTestDistance = + style.disableDepthTestDistance.evaluate(feature); } if (defined(style.horizontalOrigin)) { @@ -475,9 +472,8 @@ Vector3DTilePoints.prototype.applyStyle = function (style, features) { } if (defined(style.labelHorizontalOrigin)) { - feature.labelHorizontalOrigin = style.labelHorizontalOrigin.evaluate( - feature - ); + feature.labelHorizontalOrigin = + style.labelHorizontalOrigin.evaluate(feature); } if (defined(style.labelVerticalOrigin)) { diff --git a/packages/engine/Source/Scene/Vector3DTilePolygons.js b/packages/engine/Source/Scene/Vector3DTilePolygons.js index 06a6d3de907e..d11e4424a339 100644 --- a/packages/engine/Source/Scene/Vector3DTilePolygons.js +++ b/packages/engine/Source/Scene/Vector3DTilePolygons.js @@ -156,7 +156,7 @@ function packBuffer(polygons) { 3 + Cartesian3.packedLength + Ellipsoid.packedLength + - Rectangle.packedLength + Rectangle.packedLength, ); let offset = 0; @@ -215,7 +215,7 @@ function unpackBuffer(polygons, packedBuffer) { const createVerticesTaskProcessor = new TaskProcessor( "createVectorTilePolygons", - 5 + 5, ); const scratchColor = new Color(); @@ -242,14 +242,14 @@ function createPrimitive(polygons) { indices = polygons._indices = polygons._indices.slice(); polygons._center = polygons._ellipsoid.cartographicToCartesian( - Rectangle.center(polygons._rectangle) + Rectangle.center(polygons._rectangle), ); batchIds = polygons._transferrableBatchIds = new Uint32Array( - polygons._batchIds + polygons._batchIds, ); batchTableColors = polygons._batchTableColors = new Uint32Array( - batchIds.length + batchIds.length, ); const batchTable = polygons._batchTable; @@ -294,7 +294,7 @@ function createPrimitive(polygons) { const verticesPromise = createVerticesTaskProcessor.scheduleTask( parameters, - transferrableObjects + transferrableObjects, ); if (!defined(verticesPromise)) { // Postponed diff --git a/packages/engine/Source/Scene/Vector3DTilePolylines.js b/packages/engine/Source/Scene/Vector3DTilePolylines.js index 781f568b5118..d495a024efcd 100644 --- a/packages/engine/Source/Scene/Vector3DTilePolylines.js +++ b/packages/engine/Source/Scene/Vector3DTilePolylines.js @@ -167,7 +167,7 @@ function packBuffer(polylines) { const createVerticesTaskProcessor = new TaskProcessor( "createVectorTilePolylines", - 5 + 5, ); const attributeLocations = { previousPosition: 0, @@ -218,7 +218,7 @@ function createVertexArray(polylines, context) { const verticesPromise = createVerticesTaskProcessor.scheduleTask( parameters, - transferrableObjects + transferrableObjects, ); if (!defined(verticesPromise)) { // Postponed @@ -234,7 +234,7 @@ function createVertexArray(polylines, context) { if (polylines._keepDecodedPositions) { polylines._decodedPositions = new Float64Array(result.decodedPositions); polylines._decodedPositionOffsets = new Uint32Array( - result.decodedPositionOffsets + result.decodedPositionOffsets, ); } @@ -395,12 +395,12 @@ function createUniformMap(primitive, context) { Matrix4.multiplyByPoint( modifiedModelViewScratch, primitive._center, - rtcScratch + rtcScratch, ); Matrix4.setTranslation( modifiedModelViewScratch, rtcScratch, - modifiedModelViewScratch + modifiedModelViewScratch, ); return modifiedModelViewScratch; }, @@ -448,12 +448,12 @@ function createShaders(primitive, context) { const vsSource = batchTable.getVertexShaderCallback( false, "a_batchId", - undefined + undefined, )(Vector3DTilePolylinesVS); const fsSource = batchTable.getFragmentShaderCallback( false, undefined, - false + false, )(PolylineFS); const vs = new ShaderSource({ @@ -479,7 +479,7 @@ function createShaders(primitive, context) { function queueCommands(primitive, frameState) { if (!defined(primitive._command)) { const uniformMap = primitive._batchTable.getUniformMapCallback()( - primitive._uniformMap + primitive._uniformMap, ); primitive._command = new DrawCommand({ owner: primitive, diff --git a/packages/engine/Source/Scene/Vector3DTilePrimitive.js b/packages/engine/Source/Scene/Vector3DTilePrimitive.js index 0f16df4a98fb..bb5cb4825a57 100644 --- a/packages/engine/Source/Scene/Vector3DTilePrimitive.js +++ b/packages/engine/Source/Scene/Vector3DTilePrimitive.js @@ -129,7 +129,7 @@ function Vector3DTilePrimitive(options) { */ this.classificationType = defaultValue( options.classificationType, - ClassificationType.BOTH + ClassificationType.BOTH, ); // Hidden options @@ -221,7 +221,7 @@ function createVertexArray(primitive, context) { index: 1, vertexBuffer: idBuffer, componentDatatype: ComponentDatatype.fromTypedArray( - primitive._vertexBatchIds + primitive._vertexBatchIds, ), componentsPerAttribute: 1, }, @@ -259,7 +259,7 @@ function createShaders(primitive, context) { const batchTable = primitive._batchTable; const attributeLocations = defaultValue( primitive._attributeLocations, - defaultAttributeLocations + defaultAttributeLocations, ); let pickId = primitive._pickId; @@ -276,7 +276,7 @@ function createShaders(primitive, context) { fragmentShaderSource = ShaderSource.replaceMain( fragmentShaderSource, - "czm_non_pick_main" + "czm_non_pick_main", ); fragmentShaderSource = `${fragmentShaderSource}void main() \n` + @@ -296,12 +296,12 @@ function createShaders(primitive, context) { const vsSource = batchTable.getVertexShaderCallback( false, "a_batchId", - undefined + undefined, )(VectorTileVS); let fsSource = batchTable.getFragmentShaderCallback( false, undefined, - true + true, )(ShadowVolumeFS); pickId = batchTable.getPickId(); @@ -454,10 +454,10 @@ function createRenderStates(primitive) { } primitive._rsStencilDepthPass = RenderState.fromCache( - getStencilDepthRenderState(false) + getStencilDepthRenderState(false), ); primitive._rsStencilDepthPass3DTiles = RenderState.fromCache( - getStencilDepthRenderState(true) + getStencilDepthRenderState(true), ); primitive._rsColorPass = RenderState.fromCache(colorRenderState); primitive._rsPickPass = RenderState.fromCache(pickRenderState); @@ -479,17 +479,17 @@ function createUniformMap(primitive, context) { Matrix4.multiplyByPoint( modifiedModelViewScratch, primitive._center, - rtcScratch + rtcScratch, ); Matrix4.setTranslation( modifiedModelViewScratch, rtcScratch, - modifiedModelViewScratch + modifiedModelViewScratch, ); Matrix4.multiply( projectionMatrix, modifiedModelViewScratch, - modifiedModelViewScratch + modifiedModelViewScratch, ); return modifiedModelViewScratch; }, @@ -498,9 +498,8 @@ function createUniformMap(primitive, context) { }, }; - primitive._uniformMap = primitive._batchTable.getUniformMapCallback()( - uniformMap - ); + primitive._uniformMap = + primitive._batchTable.getUniformMapCallback()(uniformMap); } function copyIndicesCPU( @@ -510,7 +509,7 @@ function copyIndicesCPU( offsets, counts, batchIds, - batchIdLookUp + batchIdLookUp, ) { const sizeInBytes = indices.constructor.BYTES_PER_ELEMENT; @@ -524,7 +523,7 @@ function copyIndicesCPU( const subarray = new indices.constructor( indices.buffer, sizeInBytes * offset, - count + count, ); newIndices.set(subarray, currentOffset); @@ -553,7 +552,7 @@ function rebatchCPU(primitive, batchedIndices) { indexOffsets, indexCounts, current.batchIds, - batchIdLookUp + batchIdLookUp, ); current.offset = 0; @@ -569,7 +568,7 @@ function rebatchCPU(primitive, batchedIndices) { indexOffsets, indexCounts, next.batchIds, - batchIdLookUp + batchIdLookUp, ); current.batchIds = current.batchIds.concat(next.batchIds); current.count = currentOffset - current.offset; @@ -582,7 +581,7 @@ function rebatchCPU(primitive, batchedIndices) { indexOffsets, indexCounts, next.batchIds, - batchIdLookUp + batchIdLookUp, ); next.offset = offset; @@ -605,7 +604,7 @@ function copyIndicesGPU( offsets, counts, batchIds, - batchIdLookUp + batchIdLookUp, ) { const sizeInBytes = readBuffer.bytesPerIndex; @@ -620,7 +619,7 @@ function copyIndicesGPU( readBuffer, offset * sizeInBytes, currentOffset * sizeInBytes, - count * sizeInBytes + count * sizeInBytes, ); offsets[index] = currentOffset; @@ -648,7 +647,7 @@ function rebatchGPU(primitive, batchedIndices) { indexOffsets, indexCounts, current.batchIds, - batchIdLookUp + batchIdLookUp, ); current.offset = 0; @@ -664,7 +663,7 @@ function rebatchGPU(primitive, batchedIndices) { indexOffsets, indexCounts, next.batchIds, - batchIdLookUp + batchIdLookUp, ); current.batchIds = current.batchIds.concat(next.batchIds); current.count = currentOffset - current.offset; @@ -677,7 +676,7 @@ function rebatchGPU(primitive, batchedIndices) { indexOffsets, indexCounts, next.batchIds, - batchIdLookUp + batchIdLookUp, ); next.offset = offset; next.count = currentOffset - offset; @@ -798,7 +797,7 @@ function createColorCommands(primitive, context) { const stencilDepthDerivedCommand = DrawCommand.shallowClone( stencilDepthCommand, - stencilDepthCommand.derivedCommands.tileset + stencilDepthCommand.derivedCommands.tileset, ); stencilDepthDerivedCommand.renderState = primitive._rsStencilDepthPass3DTiles; @@ -825,7 +824,7 @@ function createColorCommands(primitive, context) { const colorDerivedCommand = DrawCommand.shallowClone( colorCommand, - colorCommand.derivedCommands.tileset + colorCommand.derivedCommands.tileset, ); colorDerivedCommand.pass = Pass.CESIUM_3D_TILE_CLASSIFICATION; colorCommand.derivedCommands.tileset = colorDerivedCommand; @@ -854,7 +853,7 @@ function createColorCommandsIgnoreShow(primitive, frameState) { for (let j = 0; j < length; ++j) { const commandIgnoreShow = (commandsIgnoreShow[j] = DrawCommand.shallowClone( commands[commandIndex], - commandsIgnoreShow[j] + commandsIgnoreShow[j], )); commandIgnoreShow.shaderProgram = spStencil; commandIgnoreShow.pass = Pass.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW; @@ -907,7 +906,7 @@ function createPickCommands(primitive) { const stencilDepthDerivedCommand = DrawCommand.shallowClone( stencilDepthCommand, - stencilDepthCommand.derivedCommands.tileset + stencilDepthCommand.derivedCommands.tileset, ); stencilDepthDerivedCommand.renderState = primitive._rsStencilDepthPass3DTiles; @@ -934,7 +933,7 @@ function createPickCommands(primitive) { const colorDerivedCommand = DrawCommand.shallowClone( colorCommand, - colorCommand.derivedCommands.tileset + colorCommand.derivedCommands.tileset, ); colorDerivedCommand.pass = Pass.CESIUM_3D_TILE_CLASSIFICATION; colorCommand.derivedCommands.tileset = colorDerivedCommand; @@ -1091,7 +1090,7 @@ Vector3DTilePrimitive.prototype.updateCommands = function (batchId, color) { offset: offset, count: count, batchIds: [batchId], - }) + }), ); const startIds = []; @@ -1122,7 +1121,7 @@ Vector3DTilePrimitive.prototype.updateCommands = function (batchId, color) { count: batchedIndices[i].offset + batchedIndices[i].count - (offset + count), batchIds: endIds, - }) + }), ); } diff --git a/packages/engine/Source/Scene/View.js b/packages/engine/Source/Scene/View.js index 9c167ab5bf0b..d63df7b39854 100644 --- a/packages/engine/Source/Scene/View.js +++ b/packages/engine/Source/Scene/View.js @@ -60,7 +60,7 @@ function View(scene, camera, viewport) { this.globeTranslucencyFramebuffer = new GlobeTranslucencyFramebuffer(); this.oit = oit; this.translucentTileClassification = new TranslucentTileClassification( - context + context, ); this.pickDepths = []; this.frustumCommandsList = []; @@ -146,7 +146,7 @@ function updateFrustums(view, scene, near, far) { far = Math.min(far, camera.position.z + scene.nearToFarDistance2D); near = Math.min(near, far); numFrustums = Math.ceil( - Math.max(1.0, far - near) / scene.nearToFarDistance2D + Math.max(1.0, far - near) / scene.nearToFarDistance2D, ); } else { // The multifrustum for 3D/CV is non-uniformly distributed. @@ -162,7 +162,7 @@ function updateFrustums(view, scene, near, far) { if (is2D) { curNear = Math.min( far - nearToFarDistance2D, - near + m * nearToFarDistance2D + near + m * nearToFarDistance2D, ); curFar = Math.min(far, curNear + nearToFarDistance2D); } else { @@ -173,7 +173,7 @@ function updateFrustums(view, scene, near, far) { if (!defined(frustumCommands)) { frustumCommands = frustumCommandsList[m] = new FrustumCommands( curNear, - curFar + curFar, ); } else { frustumCommands.near = curNear; @@ -219,7 +219,7 @@ function insertIntoBin(view, scene, command, commandNear, commandFar) { if (scene.debugShowFrustums) { const cf = view.debugFrustumStatistics.commandsInFrustums; cf[command.debugOverlappingFrustums] = defined( - cf[command.debugOverlappingFrustums] + cf[command.debugOverlappingFrustums], ) ? cf[command.debugOverlappingFrustums] + 1 : 1; @@ -306,7 +306,7 @@ View.prototype.createPotentiallyVisibleSet = function (scene) { const nearFarInterval = boundingVolume.computePlaneDistances( position, direction, - scratchNearFarInterval + scratchNearFarInterval, ); commandNear = nearFarInterval.start; commandFar = nearFarInterval.stop; @@ -359,7 +359,7 @@ View.prototype.createPotentiallyVisibleSet = function (scene) { if (shadowsEnabled) { shadowNear = Math.min( Math.max(shadowNear, camera.frustum.near), - camera.frustum.far + camera.frustum.far, ); shadowFar = Math.max(Math.min(shadowFar, camera.frustum.far), shadowNear); } diff --git a/packages/engine/Source/Scene/VoxelBoxShape.js b/packages/engine/Source/Scene/VoxelBoxShape.js index 6cbe40f7e026..fb17d83cc36d 100644 --- a/packages/engine/Source/Scene/VoxelBoxShape.js +++ b/packages/engine/Source/Scene/VoxelBoxShape.js @@ -59,7 +59,7 @@ function VoxelBoxShape() { */ this._minBounds = Cartesian3.clone( VoxelBoxShape.DefaultMinBounds, - new Cartesian3() + new Cartesian3(), ); /** @@ -68,7 +68,7 @@ function VoxelBoxShape() { */ this._maxBounds = Cartesian3.clone( VoxelBoxShape.DefaultMaxBounds, - new Cartesian3() + new Cartesian3(), ); /** @@ -110,7 +110,7 @@ const scratchRenderMaxBounds = new Cartesian3(); const transformLocalToUv = Matrix4.fromRotationTranslation( Matrix3.fromUniformScale(0.5, new Matrix3()), new Cartesian3(0.5, 0.5, 0.5), - new Matrix4() + new Matrix4(), ); /** @@ -128,7 +128,7 @@ VoxelBoxShape.prototype.update = function ( minBounds, maxBounds, clipMinBounds, - clipMaxBounds + clipMaxBounds, ) { clipMinBounds = defaultValue(clipMinBounds, VoxelBoxShape.DefaultMinBounds); clipMaxBounds = defaultValue(clipMaxBounds, VoxelBoxShape.DefaultMaxBounds); @@ -145,42 +145,42 @@ VoxelBoxShape.prototype.update = function ( minBounds, defaultMinBounds, defaultMaxBounds, - this._minBounds + this._minBounds, ); maxBounds = this._maxBounds = Cartesian3.clamp( maxBounds, defaultMinBounds, defaultMaxBounds, - this._maxBounds + this._maxBounds, ); clipMinBounds = Cartesian3.clamp( clipMinBounds, defaultMinBounds, defaultMaxBounds, - scratchClipMinBounds + scratchClipMinBounds, ); clipMaxBounds = Cartesian3.clamp( clipMaxBounds, defaultMinBounds, defaultMaxBounds, - scratchClipMaxBounds + scratchClipMaxBounds, ); const renderMinBounds = Cartesian3.clamp( minBounds, clipMinBounds, clipMaxBounds, - scratchRenderMinBounds + scratchRenderMinBounds, ); const renderMaxBounds = Cartesian3.clamp( maxBounds, clipMinBounds, clipMaxBounds, - scratchRenderMaxBounds + scratchRenderMaxBounds, ); const scale = Matrix4.getScale(modelMatrix, scratchScale); @@ -214,7 +214,7 @@ VoxelBoxShape.prototype.update = function ( renderMinBounds, renderMaxBounds, this.shapeTransform, - this.orientedBoundingBox + this.orientedBoundingBox, ); // All of the box bounds go from -1 to +1, so the model matrix scale can be @@ -222,12 +222,12 @@ VoxelBoxShape.prototype.update = function ( this.boundTransform = Matrix4.fromRotationTranslation( this.orientedBoundingBox.halfAxes, this.orientedBoundingBox.center, - this.boundTransform + this.boundTransform, ); this.boundingSphere = BoundingSphere.fromOrientedBoundingBox( this.orientedBoundingBox, - this.boundingSphere + this.boundingSphere, ); const { shaderUniforms, shaderDefines } = this; @@ -252,12 +252,12 @@ VoxelBoxShape.prototype.update = function ( shaderUniforms.renderMinBounds = Matrix4.multiplyByPoint( transformLocalToUv, renderMinBounds, - shaderUniforms.renderMinBounds + shaderUniforms.renderMinBounds, ); shaderUniforms.renderMaxBounds = Matrix4.multiplyByPoint( transformLocalToUv, renderMaxBounds, - shaderUniforms.renderMaxBounds + shaderUniforms.renderMaxBounds, ); if (hasShapeBounds) { @@ -280,14 +280,14 @@ VoxelBoxShape.prototype.update = function ( 2.0 / (min.x === max.x ? 1.0 : max.x - min.x), 2.0 / (min.y === max.y ? 1.0 : max.y - min.y), 2.0 / (min.z === max.z ? 1.0 : max.z - min.z), - shaderUniforms.boxUvToShapeUvScale + shaderUniforms.boxUvToShapeUvScale, ); shaderUniforms.boxUvToShapeUvTranslate = Cartesian3.fromElements( -shaderUniforms.boxUvToShapeUvScale.x * (min.x * 0.5 + 0.5), -shaderUniforms.boxUvToShapeUvScale.y * (min.y * 0.5 + 0.5), -shaderUniforms.boxUvToShapeUvScale.z * (min.z * 0.5 + 0.5), - shaderUniforms.boxUvToShapeUvTranslate + shaderUniforms.boxUvToShapeUvTranslate, ); } @@ -315,7 +315,7 @@ VoxelBoxShape.prototype.computeOrientedBoundingBoxForTile = function ( tileX, tileY, tileZ, - result + result, ) { //>>includeStart('debug', pragmas.debug); Check.typeOf.number("tileLevel", tileLevel); @@ -333,21 +333,21 @@ VoxelBoxShape.prototype.computeOrientedBoundingBoxForTile = function ( CesiumMath.lerp(minBounds.x, maxBounds.x, sizeAtLevel * tileX), CesiumMath.lerp(minBounds.y, maxBounds.y, sizeAtLevel * tileY), CesiumMath.lerp(minBounds.z, maxBounds.z, sizeAtLevel * tileZ), - scratchTileMinBounds + scratchTileMinBounds, ); const tileMaxBounds = Cartesian3.fromElements( CesiumMath.lerp(minBounds.x, maxBounds.x, sizeAtLevel * (tileX + 1)), CesiumMath.lerp(minBounds.y, maxBounds.y, sizeAtLevel * (tileY + 1)), CesiumMath.lerp(minBounds.z, maxBounds.z, sizeAtLevel * (tileZ + 1)), - scratchTileMaxBounds + scratchTileMaxBounds, ); return getBoxChunkObb( tileMinBounds, tileMaxBounds, this.shapeTransform, - result + result, ); }; @@ -367,7 +367,7 @@ VoxelBoxShape.prototype.computeOrientedBoundingBoxForSample = function ( spatialNode, tileDimensions, tileUv, - result + result, ) { //>>includeStart('debug', pragmas.debug); Check.typeOf.object("spatialNode", spatialNode); @@ -380,12 +380,12 @@ VoxelBoxShape.prototype.computeOrientedBoundingBoxForSample = function ( const sampleSize = Cartesian3.divideComponents( Cartesian3.ONE, tileDimensions, - sampleSizeScratch + sampleSizeScratch, ); const sampleSizeAtLevel = Cartesian3.multiplyByScalar( sampleSize, tileSizeAtLevel, - sampleSizeScratch + sampleSizeScratch, ); const minLerp = Cartesian3.multiplyByScalar( @@ -393,15 +393,15 @@ VoxelBoxShape.prototype.computeOrientedBoundingBoxForSample = function ( spatialNode.x + tileUv.x, spatialNode.y + tileUv.y, spatialNode.z + tileUv.z, - scratchTileMinBounds + scratchTileMinBounds, ), tileSizeAtLevel, - scratchTileMinBounds + scratchTileMinBounds, ); const maxLerp = Cartesian3.add( minLerp, sampleSizeAtLevel, - scratchTileMaxBounds + scratchTileMaxBounds, ); const minBounds = this._minBounds; @@ -410,20 +410,20 @@ VoxelBoxShape.prototype.computeOrientedBoundingBoxForSample = function ( CesiumMath.lerp(minBounds.x, maxBounds.x, minLerp.x), CesiumMath.lerp(minBounds.y, maxBounds.y, minLerp.y), CesiumMath.lerp(minBounds.z, maxBounds.z, minLerp.z), - scratchTileMinBounds + scratchTileMinBounds, ); const sampleMaxBounds = Cartesian3.fromElements( CesiumMath.lerp(minBounds.x, maxBounds.x, maxLerp.x), CesiumMath.lerp(minBounds.y, maxBounds.y, maxLerp.y), CesiumMath.lerp(minBounds.z, maxBounds.z, maxLerp.z), - scratchTileMaxBounds + scratchTileMaxBounds, ); return getBoxChunkObb( sampleMinBounds, sampleMaxBounds, this.shapeTransform, - result + result, ); }; @@ -435,7 +435,7 @@ VoxelBoxShape.prototype.computeOrientedBoundingBoxForSample = function ( * @readonly */ VoxelBoxShape.DefaultMinBounds = Object.freeze( - new Cartesian3(-1.0, -1.0, -1.0) + new Cartesian3(-1.0, -1.0, -1.0), ); /** @@ -446,7 +446,7 @@ VoxelBoxShape.DefaultMinBounds = Object.freeze( * @readonly */ VoxelBoxShape.DefaultMaxBounds = Object.freeze( - new Cartesian3(+1.0, +1.0, +1.0) + new Cartesian3(+1.0, +1.0, +1.0), ); /** @@ -478,14 +478,14 @@ function getBoxChunkObb(minimumBounds, maximumBounds, matrix, result) { const localCenter = Cartesian3.midpoint( minimumBounds, maximumBounds, - scratchCenter + scratchCenter, ); result.center = Matrix4.multiplyByPoint(matrix, localCenter, result.center); scale = Cartesian3.fromElements( scale.x * 0.5 * (maximumBounds.x - minimumBounds.x), scale.y * 0.5 * (maximumBounds.y - minimumBounds.y), scale.z * 0.5 * (maximumBounds.z - minimumBounds.z), - scratchScale + scratchScale, ); const rotation = Matrix4.getRotation(matrix, scratchRotation); result.halfAxes = Matrix3.setScale(rotation, scale, result.halfAxes); diff --git a/packages/engine/Source/Scene/VoxelCell.js b/packages/engine/Source/Scene/VoxelCell.js index 5880f71c0ac6..b87d0e235bde 100644 --- a/packages/engine/Source/Scene/VoxelCell.js +++ b/packages/engine/Source/Scene/VoxelCell.js @@ -61,7 +61,7 @@ VoxelCell.fromKeyframeNode = function ( primitive, tileIndex, sampleIndex, - keyframeNode + keyframeNode, ) { //>>includeStart('debug', pragmas.debug); Check.typeOf.object("primitive", primitive); @@ -77,7 +77,7 @@ VoxelCell.fromKeyframeNode = function ( primitive, spatialNode, sampleIndex, - voxelCell._orientedBoundingBox + voxelCell._orientedBoundingBox, ); return voxelCell; }; @@ -100,7 +100,7 @@ function getMetadataForSample(primitive, metadata, sampleIndex) { const componentCount = MetadataType.getComponentCount(types[i]); const samples = metadata[i].slice( sampleIndex * componentCount, - (sampleIndex + 1) * componentCount + (sampleIndex + 1) * componentCount, ); metadataMap[name] = samples; } @@ -130,7 +130,7 @@ function getOrientedBoundingBox(primitive, spatialNode, sampleIndex, result) { xIndex, yIndex, zIndex, - tileCoordinateScratch + tileCoordinateScratch, ); // Remove padding, and convert to a fraction in [0, 1], where the limits are @@ -139,10 +139,10 @@ function getOrientedBoundingBox(primitive, spatialNode, sampleIndex, result) { Cartesian3.subtract( tileCoordinate, primitive._paddingBefore, - tileCoordinateScratch + tileCoordinateScratch, ), primitive.dimensions, - tileUvScratch + tileUvScratch, ); const shape = primitive._shape; @@ -150,7 +150,7 @@ function getOrientedBoundingBox(primitive, spatialNode, sampleIndex, result) { spatialNode, primitive.dimensions, tileUv, - result + result, ); } diff --git a/packages/engine/Source/Scene/VoxelContent.js b/packages/engine/Source/Scene/VoxelContent.js index 4d566c89d0d0..451be03d2493 100644 --- a/packages/engine/Source/Scene/VoxelContent.js +++ b/packages/engine/Source/Scene/VoxelContent.js @@ -54,7 +54,7 @@ VoxelContent.fromJson = async function ( resource, json, binary, - metadataSchema + metadataSchema, ) { //>>includeStart('debug', pragmas.debug); Check.typeOf.object("resource", resource); diff --git a/packages/engine/Source/Scene/VoxelCylinderShape.js b/packages/engine/Source/Scene/VoxelCylinderShape.js index eb158d9ccc96..7418193bdfc9 100644 --- a/packages/engine/Source/Scene/VoxelCylinderShape.js +++ b/packages/engine/Source/Scene/VoxelCylinderShape.js @@ -155,15 +155,15 @@ VoxelCylinderShape.prototype.update = function ( minBounds, maxBounds, clipMinBounds, - clipMaxBounds + clipMaxBounds, ) { clipMinBounds = defaultValue( clipMinBounds, - VoxelCylinderShape.DefaultMinBounds + VoxelCylinderShape.DefaultMinBounds, ); clipMaxBounds = defaultValue( clipMaxBounds, - VoxelCylinderShape.DefaultMaxBounds + VoxelCylinderShape.DefaultMaxBounds, ); //>>includeStart('debug', pragmas.debug); Check.typeOf.object("modelMatrix", modelMatrix); @@ -188,22 +188,22 @@ VoxelCylinderShape.prototype.update = function ( const shapeMinRadius = CesiumMath.clamp( minBounds.x, defaultMinRadius, - defaultMaxRadius + defaultMaxRadius, ); const shapeMaxRadius = CesiumMath.clamp( maxBounds.x, defaultMinRadius, - defaultMaxRadius + defaultMaxRadius, ); const clipMinRadius = CesiumMath.clamp( clipMinBounds.x, defaultMinRadius, - defaultMaxRadius + defaultMaxRadius, ); const clipMaxRadius = CesiumMath.clamp( clipMaxBounds.x, defaultMinRadius, - defaultMaxRadius + defaultMaxRadius, ); const renderMinRadius = Math.max(shapeMinRadius, clipMinRadius); const renderMaxRadius = Math.min(shapeMaxRadius, clipMaxRadius); @@ -212,22 +212,22 @@ VoxelCylinderShape.prototype.update = function ( const shapeMinHeight = CesiumMath.clamp( minBounds.y, defaultMinHeight, - defaultMaxHeight + defaultMaxHeight, ); const shapeMaxHeight = CesiumMath.clamp( maxBounds.y, defaultMinHeight, - defaultMaxHeight + defaultMaxHeight, ); const clipMinHeight = CesiumMath.clamp( clipMinBounds.y, defaultMinHeight, - defaultMaxHeight + defaultMaxHeight, ); const clipMaxHeight = CesiumMath.clamp( clipMaxBounds.y, defaultMinHeight, - defaultMaxHeight + defaultMaxHeight, ); const renderMinHeight = Math.max(shapeMinHeight, clipMinHeight); const renderMaxHeight = Math.min(shapeMaxHeight, clipMaxHeight); @@ -278,18 +278,18 @@ VoxelCylinderShape.prototype.update = function ( renderMinAngle, renderMaxAngle, this.shapeTransform, - this.orientedBoundingBox + this.orientedBoundingBox, ); this.boundTransform = Matrix4.fromRotationTranslation( this.orientedBoundingBox.halfAxes, this.orientedBoundingBox.center, - this.boundTransform + this.boundTransform, ); this.boundingSphere = BoundingSphere.fromOrientedBoundingBox( this.orientedBoundingBox, - this.boundingSphere + this.boundingSphere, ); const shapeIsDefaultMaxRadius = shapeMaxRadius === defaultMaxRadius; @@ -315,13 +315,13 @@ VoxelCylinderShape.prototype.update = function ( shapeMinAngle, defaultMinAngle, undefined, - epsilonAngleDiscontinuity + epsilonAngleDiscontinuity, ); const shapeIsMaxAngleDiscontinuity = CesiumMath.equalsEpsilon( shapeMaxAngle, defaultMaxAngle, undefined, - epsilonAngleDiscontinuity + epsilonAngleDiscontinuity, ); const renderIsDefaultMinRadius = renderMinRadius === defaultMinRadius; @@ -361,7 +361,7 @@ VoxelCylinderShape.prototype.update = function ( shaderUniforms.cylinderRenderRadiusMinMax = Cartesian2.fromElements( renderMinRadius, renderMaxRadius, - shaderUniforms.cylinderRenderRadiusMinMax + shaderUniforms.cylinderRenderRadiusMinMax, ); if (renderMinRadius === renderMaxRadius) { @@ -386,7 +386,7 @@ VoxelCylinderShape.prototype.update = function ( shaderUniforms.cylinderUvToShapeUvRadius = Cartesian2.fromElements( scale, offset, - shaderUniforms.cylinderUvToShapeUvRadius + shaderUniforms.cylinderUvToShapeUvRadius, ); } @@ -414,13 +414,13 @@ VoxelCylinderShape.prototype.update = function ( shaderUniforms.cylinderUvToShapeUvHeight = Cartesian2.fromElements( scale, offset, - shaderUniforms.cylinderUvToShapeUvHeight + shaderUniforms.cylinderUvToShapeUvHeight, ); } shaderUniforms.cylinderRenderHeightMinMax = Cartesian2.fromElements( renderMinHeight, renderMaxHeight, - shaderUniforms.cylinderRenderHeightMinMax + shaderUniforms.cylinderRenderHeightMinMax, ); if (shapeIsAngleReversed) { @@ -445,7 +445,7 @@ VoxelCylinderShape.prototype.update = function ( shaderUniforms.cylinderRenderAngleMinMax = Cartesian2.fromElements( renderMinAngle, renderMaxAngle, - shaderUniforms.cylinderRenderAngleMinMax + shaderUniforms.cylinderRenderAngleMinMax, ); } @@ -465,7 +465,7 @@ VoxelCylinderShape.prototype.update = function ( shaderUniforms.cylinderShapeUvAngleMinMax = Cartesian2.fromElements( uvMinAngle, uvMaxAngle, - shaderUniforms.cylinderShapeUvAngleMinMax + shaderUniforms.cylinderShapeUvAngleMinMax, ); shaderUniforms.cylinderShapeUvAngleRangeZeroMid = (uvMaxAngle + 0.5 * uvAngleRangeZero) % 1.0; @@ -483,7 +483,7 @@ VoxelCylinderShape.prototype.update = function ( shaderUniforms.cylinderUvToShapeUvAngle = Cartesian2.fromElements( 0.0, 1.0, - shaderUniforms.cylinderUvToShapeUvAngle + shaderUniforms.cylinderUvToShapeUvAngle, ); } else { const scale = defaultAngleRange / shapeAngleRange; @@ -491,7 +491,7 @@ VoxelCylinderShape.prototype.update = function ( shaderUniforms.cylinderUvToShapeUvAngle = Cartesian2.fromElements( scale, offset, - shaderUniforms.cylinderUvToShapeUvAngle + shaderUniforms.cylinderUvToShapeUvAngle, ); } } @@ -517,7 +517,7 @@ VoxelCylinderShape.prototype.computeOrientedBoundingBoxForTile = function ( tileX, tileY, tileZ, - result + result, ) { //>>includeStart('debug', pragmas.debug); Check.typeOf.number("tileLevel", tileLevel); @@ -539,32 +539,32 @@ VoxelCylinderShape.prototype.computeOrientedBoundingBoxForTile = function ( const radiusStart = CesiumMath.lerp( minimumRadius, maximumRadius, - tileX * sizeAtLevel + tileX * sizeAtLevel, ); const radiusEnd = CesiumMath.lerp( minimumRadius, maximumRadius, - (tileX + 1) * sizeAtLevel + (tileX + 1) * sizeAtLevel, ); const heightStart = CesiumMath.lerp( minimumHeight, maximumHeight, - tileY * sizeAtLevel + tileY * sizeAtLevel, ); const heightEnd = CesiumMath.lerp( minimumHeight, maximumHeight, - (tileY + 1) * sizeAtLevel + (tileY + 1) * sizeAtLevel, ); const angleStart = CesiumMath.lerp( minimumAngle, maximumAngle, - tileZ * sizeAtLevel + tileZ * sizeAtLevel, ); const angleEnd = CesiumMath.lerp( minimumAngle, maximumAngle, - (tileZ + 1) * sizeAtLevel + (tileZ + 1) * sizeAtLevel, ); return getCylinderChunkObb( @@ -575,7 +575,7 @@ VoxelCylinderShape.prototype.computeOrientedBoundingBoxForTile = function ( angleStart, angleEnd, this.shapeTransform, - result + result, ); }; @@ -597,7 +597,7 @@ VoxelCylinderShape.prototype.computeOrientedBoundingBoxForSample = function ( spatialNode, tileDimensions, tileUv, - result + result, ) { //>>includeStart('debug', pragmas.debug); Check.typeOf.object("spatialNode", spatialNode); @@ -610,12 +610,12 @@ VoxelCylinderShape.prototype.computeOrientedBoundingBoxForSample = function ( const sampleSize = Cartesian3.divideComponents( Cartesian3.ONE, tileDimensions, - sampleSizeScratch + sampleSizeScratch, ); const sampleSizeAtLevel = Cartesian3.multiplyByScalar( sampleSize, tileSizeAtLevel, - sampleSizeScratch + sampleSizeScratch, ); const minLerp = Cartesian3.multiplyByScalar( @@ -623,15 +623,15 @@ VoxelCylinderShape.prototype.computeOrientedBoundingBoxForSample = function ( spatialNode.x + tileUv.x, spatialNode.y + tileUv.y, spatialNode.z + tileUv.z, - scratchTileMinBounds + scratchTileMinBounds, ), tileSizeAtLevel, - scratchTileMinBounds + scratchTileMinBounds, ); const maxLerp = Cartesian3.add( minLerp, sampleSizeAtLevel, - scratchTileMaxBounds + scratchTileMaxBounds, ); const minimumRadius = this._minimumRadius; @@ -656,7 +656,7 @@ VoxelCylinderShape.prototype.computeOrientedBoundingBoxForSample = function ( angleStart, angleEnd, this.shapeTransform, - result + result, ); }; @@ -670,7 +670,7 @@ VoxelCylinderShape.prototype.computeOrientedBoundingBoxForSample = function ( * @private */ VoxelCylinderShape.DefaultMinBounds = Object.freeze( - new Cartesian3(0.0, -1.0, -CesiumMath.PI) + new Cartesian3(0.0, -1.0, -CesiumMath.PI), ); /** @@ -683,7 +683,7 @@ VoxelCylinderShape.DefaultMinBounds = Object.freeze( * @private */ VoxelCylinderShape.DefaultMaxBounds = Object.freeze( - new Cartesian3(1.0, +1.0, +CesiumMath.PI) + new Cartesian3(1.0, +1.0, +CesiumMath.PI), ); const maxTestAngles = 5; @@ -762,7 +762,7 @@ function getCylinderChunkObb( angleStart, angleEnd, matrix, - result + result, ) { const defaultMinBounds = VoxelCylinderShape.DefaultMinBounds; const defaultMaxBounds = VoxelCylinderShape.DefaultMaxBounds; @@ -845,7 +845,7 @@ function getCylinderChunkObb( centerX, centerY, centerZ, - scratchTranslation + scratchTranslation, ); const rotation = Matrix3.fromRotationZ(angleMid, scratchRotation); @@ -854,14 +854,14 @@ function getCylinderChunkObb( extentX, extentY, extentZ, - scratchScale + scratchScale, ); const scaleMatrix = Matrix4.fromScale(scale, scratchScaleMatrix); const rotationMatrix = Matrix4.fromRotation(rotation, scratchRotationMatrix); const translationMatrix = Matrix4.fromTranslation( translation, - scratchTranslationMatrix + scratchTranslationMatrix, ); // Shape space matrix = R * T * S @@ -870,15 +870,15 @@ function getCylinderChunkObb( Matrix4.multiplyTransformation( translationMatrix, scaleMatrix, - scratchMatrix + scratchMatrix, ), - scratchMatrix + scratchMatrix, ); const globalMatrix = Matrix4.multiplyTransformation( matrix, localMatrix, - scratchMatrix + scratchMatrix, ); if (!isValidOrientedBoundingBoxTransformation(globalMatrix)) { diff --git a/packages/engine/Source/Scene/VoxelEllipsoidShape.js b/packages/engine/Source/Scene/VoxelEllipsoidShape.js index 52cc0e1523b8..efa1fac04658 100644 --- a/packages/engine/Source/Scene/VoxelEllipsoidShape.js +++ b/packages/engine/Source/Scene/VoxelEllipsoidShape.js @@ -170,7 +170,7 @@ VoxelEllipsoidShape.prototype.update = function ( minBounds, maxBounds, clipMinBounds, - clipMaxBounds + clipMaxBounds, ) { const { DefaultMinBounds, DefaultMaxBounds } = VoxelEllipsoidShape; clipMinBounds = defaultValue(clipMinBounds, DefaultMinBounds); @@ -191,7 +191,7 @@ VoxelEllipsoidShape.prototype.update = function ( const radii = Matrix4.getScale(modelMatrix, scratchScale); const actualMinBounds = Cartesian3.clone( DefaultMinBounds, - scratchActualMinBounds + scratchActualMinBounds, ); actualMinBounds.z = -Cartesian3.minimumComponent(radii); @@ -199,35 +199,35 @@ VoxelEllipsoidShape.prototype.update = function ( minBounds, actualMinBounds, DefaultMaxBounds, - scratchShapeMinBounds + scratchShapeMinBounds, ); const shapeMaxBounds = Cartesian3.clamp( maxBounds, actualMinBounds, DefaultMaxBounds, - scratchShapeMaxBounds + scratchShapeMaxBounds, ); const clampedClipMinBounds = Cartesian3.clamp( clipMinBounds, actualMinBounds, DefaultMaxBounds, - scratchClipMinBounds + scratchClipMinBounds, ); const clampedClipMaxBounds = Cartesian3.clamp( clipMaxBounds, actualMinBounds, DefaultMaxBounds, - scratchClipMaxBounds + scratchClipMaxBounds, ); const renderMinBounds = Cartesian3.maximumByComponent( shapeMinBounds, clampedClipMinBounds, - scratchRenderMinBounds + scratchRenderMinBounds, ); const renderMaxBounds = Cartesian3.minimumByComponent( shapeMaxBounds, clampedClipMaxBounds, - scratchRenderMaxBounds + scratchRenderMaxBounds, ); // Compute the farthest a point can be from the center of the ellipsoid. @@ -237,9 +237,9 @@ VoxelEllipsoidShape.prototype.update = function ( shapeMaxBounds.z, shapeMaxBounds.z, shapeMaxBounds.z, - scratchShapeOuterExtent + scratchShapeOuterExtent, ), - scratchShapeOuterExtent + scratchShapeOuterExtent, ); const shapeMaxExtent = Cartesian3.maximumComponent(shapeOuterExtent); @@ -249,9 +249,9 @@ VoxelEllipsoidShape.prototype.update = function ( renderMaxBounds.z, renderMaxBounds.z, renderMaxBounds.z, - scratchRenderOuterExtent + scratchRenderOuterExtent, ), - scratchRenderOuterExtent + scratchRenderOuterExtent, ); // Exit early if the shape is not visible. @@ -265,7 +265,7 @@ VoxelEllipsoidShape.prototype.update = function ( renderOuterExtent, Cartesian3.ZERO, undefined, - epsilonZeroScale + epsilonZeroScale, ) ) { return false; @@ -275,7 +275,7 @@ VoxelEllipsoidShape.prototype.update = function ( shapeMinBounds.x, shapeMinBounds.y, shapeMaxBounds.x, - shapeMaxBounds.y + shapeMaxBounds.y, ); this._translation = Matrix4.getTranslation(modelMatrix, this._translation); this._rotation = Matrix4.getRotation(modelMatrix, this._rotation); @@ -288,7 +288,7 @@ VoxelEllipsoidShape.prototype.update = function ( renderMinBounds.y, renderMaxBounds.x, renderMaxBounds.y, - scratchRenderRectangle + scratchRenderRectangle, ); this.orientedBoundingBox = getEllipsoidChunkObb( @@ -298,24 +298,24 @@ VoxelEllipsoidShape.prototype.update = function ( this._ellipsoid, this._translation, this._rotation, - this.orientedBoundingBox + this.orientedBoundingBox, ); this.shapeTransform = Matrix4.fromRotationTranslation( Matrix3.setScale(this._rotation, shapeOuterExtent, scratchRotationScale), this._translation, - this.shapeTransform + this.shapeTransform, ); this.boundTransform = Matrix4.fromRotationTranslation( this.orientedBoundingBox.halfAxes, this.orientedBoundingBox.center, - this.boundTransform + this.boundTransform, ); this.boundingSphere = BoundingSphere.fromOrientedBoundingBox( this.orientedBoundingBox, - this.boundingSphere + this.boundingSphere, ); // Longitude @@ -419,7 +419,7 @@ VoxelEllipsoidShape.prototype.update = function ( shaderUniforms.ellipsoidRadiiUv = Cartesian3.divideByScalar( shapeOuterExtent, shapeMaxExtent, - shaderUniforms.ellipsoidRadiiUv + shaderUniforms.ellipsoidRadiiUv, ); const { x: radiiUvX, z: radiiUvZ } = shaderUniforms.ellipsoidRadiiUv; const axisRatio = radiiUvZ / radiiUvX; @@ -427,7 +427,7 @@ VoxelEllipsoidShape.prototype.update = function ( shaderUniforms.evoluteScale = Cartesian2.fromElements( (radiiUvX * radiiUvX - radiiUvZ * radiiUvZ) / radiiUvX, (radiiUvZ * radiiUvZ - radiiUvX * radiiUvX) / radiiUvZ, - shaderUniforms.evoluteScale + shaderUniforms.evoluteScale, ); // Used to compute geodetic surface normal. @@ -436,9 +436,9 @@ VoxelEllipsoidShape.prototype.update = function ( Cartesian3.multiplyComponents( shaderUniforms.ellipsoidRadiiUv, shaderUniforms.ellipsoidRadiiUv, - shaderUniforms.ellipsoidInverseRadiiSquaredUv + shaderUniforms.ellipsoidInverseRadiiSquaredUv, ), - shaderUniforms.ellipsoidInverseRadiiSquaredUv + shaderUniforms.ellipsoidInverseRadiiSquaredUv, ); // Keep track of how many intersections there are going to be. @@ -453,7 +453,7 @@ VoxelEllipsoidShape.prototype.update = function ( shaderUniforms.clipMinMaxHeight = Cartesian2.fromElements( (renderMinBounds.z - shapeMaxBounds.z) / shapeMaxExtent, (renderMaxBounds.z - shapeMaxBounds.z) / shapeMaxExtent, - shaderUniforms.clipMinMaxHeight + shaderUniforms.clipMinMaxHeight, ); // The percent of space that is between the inner and outer ellipsoid. @@ -469,26 +469,23 @@ VoxelEllipsoidShape.prototype.update = function ( shaderDefines["ELLIPSOID_INTERSECTION_INDEX_LONGITUDE"] = intersectionCount; if (renderIsLongitudeRangeUnderHalf) { - shaderDefines[ - "ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF" - ] = true; + shaderDefines["ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF"] = + true; intersectionCount += 1; } else if (renderIsLongitudeRangeOverHalf) { - shaderDefines[ - "ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF" - ] = true; + shaderDefines["ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF"] = + true; intersectionCount += 2; } else if (renderIsLongitudeRangeZero) { - shaderDefines[ - "ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO" - ] = true; + shaderDefines["ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO"] = + true; intersectionCount += 2; } shaderUniforms.ellipsoidRenderLongitudeMinMax = Cartesian2.fromElements( renderMinBounds.x, renderMaxBounds.x, - shaderUniforms.ellipsoidRenderLongitudeMinMax + shaderUniforms.ellipsoidRenderLongitudeMinMax, ); } @@ -498,9 +495,8 @@ VoxelEllipsoidShape.prototype.update = function ( const shapeIsLongitudeReversed = shapeMaxBounds.x < shapeMinBounds.x; if (shapeIsLongitudeReversed) { - shaderDefines[ - "ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED" - ] = true; + shaderDefines["ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED"] = + true; } // delerp(longitudeUv, minLongitudeUv, maxLongitudeUv) @@ -516,7 +512,7 @@ VoxelEllipsoidShape.prototype.update = function ( shaderUniforms.ellipsoidUvToShapeUvLongitude = Cartesian2.fromElements( 0.0, 1.0, - shaderUniforms.ellipsoidUvToShapeUvLongitude + shaderUniforms.ellipsoidUvToShapeUvLongitude, ); } else { const scale = defaultLongitudeRange / shapeLongitudeRange; @@ -525,7 +521,7 @@ VoxelEllipsoidShape.prototype.update = function ( shaderUniforms.ellipsoidUvToShapeUvLongitude = Cartesian2.fromElements( scale, offset, - shaderUniforms.ellipsoidUvToShapeUvLongitude + shaderUniforms.ellipsoidUvToShapeUvLongitude, ); } } @@ -535,24 +531,22 @@ VoxelEllipsoidShape.prototype.update = function ( renderMinBounds.x, DefaultMinBounds.x, undefined, - epsilonLongitudeDiscontinuity + epsilonLongitudeDiscontinuity, ); const renderIsMaxLongitudeDiscontinuity = CesiumMath.equalsEpsilon( renderMaxBounds.x, DefaultMaxBounds.x, undefined, - epsilonLongitudeDiscontinuity + epsilonLongitudeDiscontinuity, ); if (renderIsMinLongitudeDiscontinuity) { - shaderDefines[ - "ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY" - ] = true; + shaderDefines["ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY"] = + true; } if (renderIsMaxLongitudeDiscontinuity) { - shaderDefines[ - "ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY" - ] = true; + shaderDefines["ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY"] = + true; } const uvShapeMinLongitude = (shapeMinBounds.x - DefaultMinBounds.x) / defaultLongitudeRange; @@ -570,7 +564,7 @@ VoxelEllipsoidShape.prototype.update = function ( uvShapeMinLongitude, uvShapeMaxLongitude, uvRenderLongitudeRangeZeroMid, - shaderUniforms.ellipsoidShapeUvLongitudeMinMaxMid + shaderUniforms.ellipsoidShapeUvLongitudeMinMaxMid, ); } @@ -578,24 +572,20 @@ VoxelEllipsoidShape.prototype.update = function ( // Intersects a cone for min latitude if (renderHasLatitudeMin) { shaderDefines["ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN"] = true; - shaderDefines[ - "ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN" - ] = intersectionCount; + shaderDefines["ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN"] = + intersectionCount; if (renderIsLatitudeMinUnderHalf) { - shaderDefines[ - "ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF" - ] = true; + shaderDefines["ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF"] = + true; intersectionCount += 1; } else if (renderIsLatitudeMinHalf) { - shaderDefines[ - "ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF" - ] = true; + shaderDefines["ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF"] = + true; intersectionCount += 1; } else if (renderIsLatitudeMinOverHalf) { - shaderDefines[ - "ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF" - ] = true; + shaderDefines["ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF"] = + true; intersectionCount += 2; } } @@ -603,24 +593,20 @@ VoxelEllipsoidShape.prototype.update = function ( // Intersects a cone for max latitude if (renderHasLatitudeMax) { shaderDefines["ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX"] = true; - shaderDefines[ - "ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX" - ] = intersectionCount; + shaderDefines["ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX"] = + intersectionCount; if (renderIsLatitudeMaxUnderHalf) { - shaderDefines[ - "ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF" - ] = true; + shaderDefines["ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF"] = + true; intersectionCount += 2; } else if (renderIsLatitudeMaxHalf) { - shaderDefines[ - "ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF" - ] = true; + shaderDefines["ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF"] = + true; intersectionCount += 1; } else if (renderIsLatitudeMaxOverHalf) { - shaderDefines[ - "ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF" - ] = true; + shaderDefines["ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF"] = + true; intersectionCount += 1; } } @@ -628,7 +614,7 @@ VoxelEllipsoidShape.prototype.update = function ( shaderUniforms.ellipsoidRenderLatitudeSinMinMax = Cartesian2.fromElements( Math.sin(renderMinBounds.y), Math.sin(renderMaxBounds.y), - shaderUniforms.ellipsoidRenderLatitudeSinMinMax + shaderUniforms.ellipsoidRenderLatitudeSinMinMax, ); } @@ -649,7 +635,7 @@ VoxelEllipsoidShape.prototype.update = function ( shaderUniforms.ellipsoidUvToShapeUvLatitude = Cartesian2.fromElements( 0.0, 1.0, - shaderUniforms.ellipsoidUvToShapeUvLatitude + shaderUniforms.ellipsoidUvToShapeUvLatitude, ); } else { const defaultLatitudeRange = DefaultMaxBounds.y - DefaultMinBounds.y; @@ -659,7 +645,7 @@ VoxelEllipsoidShape.prototype.update = function ( shaderUniforms.ellipsoidUvToShapeUvLatitude = Cartesian2.fromElements( scale, offset, - shaderUniforms.ellipsoidUvToShapeUvLatitude + shaderUniforms.ellipsoidUvToShapeUvLatitude, ); } } @@ -687,7 +673,7 @@ VoxelEllipsoidShape.prototype.computeOrientedBoundingBoxForTile = function ( tileX, tileY, tileZ, - result + result, ) { //>>includeStart('debug', pragmas.debug); Check.typeOf.number("tileLevel", tileLevel); @@ -711,19 +697,19 @@ VoxelEllipsoidShape.prototype.computeOrientedBoundingBoxForTile = function ( minLatitudeLerp, maxLongitudeLerp, maxLatitudeLerp, - scratchRectangle + scratchRectangle, ); const minHeight = CesiumMath.lerp( this._minimumHeight, this._maximumHeight, - minHeightLerp + minHeightLerp, ); const maxHeight = CesiumMath.lerp( this._minimumHeight, this._maximumHeight, - maxHeightLerp + maxHeightLerp, ); return getEllipsoidChunkObb( @@ -733,7 +719,7 @@ VoxelEllipsoidShape.prototype.computeOrientedBoundingBoxForTile = function ( this._ellipsoid, this._translation, this._rotation, - result + result, ); }; @@ -755,7 +741,7 @@ VoxelEllipsoidShape.prototype.computeOrientedBoundingBoxForSample = function ( spatialNode, tileDimensions, tileUv, - result + result, ) { //>>includeStart('debug', pragmas.debug); Check.typeOf.object("spatialNode", spatialNode); @@ -768,12 +754,12 @@ VoxelEllipsoidShape.prototype.computeOrientedBoundingBoxForSample = function ( const sampleSize = Cartesian3.divideComponents( Cartesian3.ONE, tileDimensions, - sampleSizeScratch + sampleSizeScratch, ); const sampleSizeAtLevel = Cartesian3.multiplyByScalar( sampleSize, tileSizeAtLevel, - sampleSizeScratch + sampleSizeScratch, ); const minLerp = Cartesian3.multiplyByScalar( @@ -781,15 +767,15 @@ VoxelEllipsoidShape.prototype.computeOrientedBoundingBoxForSample = function ( spatialNode.x + tileUv.x, spatialNode.y + tileUv.y, spatialNode.z + tileUv.z, - scratchTileMinBounds + scratchTileMinBounds, ), tileSizeAtLevel, - scratchTileMinBounds + scratchTileMinBounds, ); const maxLerp = Cartesian3.add( minLerp, sampleSizeAtLevel, - scratchTileMaxBounds + scratchTileMaxBounds, ); const rectangle = Rectangle.subsection( @@ -798,17 +784,17 @@ VoxelEllipsoidShape.prototype.computeOrientedBoundingBoxForSample = function ( minLerp.y, maxLerp.x, maxLerp.y, - scratchRectangle + scratchRectangle, ); const minHeight = CesiumMath.lerp( this._minimumHeight, this._maximumHeight, - minLerp.z + minLerp.z, ); const maxHeight = CesiumMath.lerp( this._minimumHeight, this._maximumHeight, - maxLerp.z + maxLerp.z, ); return getEllipsoidChunkObb( @@ -818,7 +804,7 @@ VoxelEllipsoidShape.prototype.computeOrientedBoundingBoxForSample = function ( this._ellipsoid, this._translation, this._rotation, - result + result, ); }; @@ -845,20 +831,20 @@ function getEllipsoidChunkObb( ellipsoid, translation, rotation, - result + result, ) { result = OrientedBoundingBox.fromRectangle( rectangle, minHeight, maxHeight, ellipsoid, - result + result, ); result.center = Cartesian3.add(result.center, translation, result.center); result.halfAxes = Matrix3.multiply( result.halfAxes, rotation, - result.halfAxes + result.halfAxes, ); return result; } @@ -874,8 +860,8 @@ VoxelEllipsoidShape.DefaultMinBounds = Object.freeze( new Cartesian3( -CesiumMath.PI, -CesiumMath.PI_OVER_TWO, - -Ellipsoid.WGS84.minimumRadius - ) + -Ellipsoid.WGS84.minimumRadius, + ), ); /** @@ -889,8 +875,8 @@ VoxelEllipsoidShape.DefaultMaxBounds = Object.freeze( new Cartesian3( CesiumMath.PI, CesiumMath.PI_OVER_TWO, - 10.0 * Ellipsoid.WGS84.maximumRadius - ) + 10.0 * Ellipsoid.WGS84.maximumRadius, + ), ); export default VoxelEllipsoidShape; diff --git a/packages/engine/Source/Scene/VoxelPrimitive.js b/packages/engine/Source/Scene/VoxelPrimitive.js index 8a83c3ea2512..0942fbb817a4 100644 --- a/packages/engine/Source/Scene/VoxelPrimitive.js +++ b/packages/engine/Source/Scene/VoxelPrimitive.js @@ -59,7 +59,7 @@ function VoxelPrimitive(options) { */ this._provider = defaultValue( options.provider, - VoxelPrimitive.DefaultProvider + VoxelPrimitive.DefaultProvider, ); /** @@ -231,7 +231,7 @@ function VoxelPrimitive(options) { * @private */ this._modelMatrix = Matrix4.clone( - defaultValue(options.modelMatrix, Matrix4.IDENTITY) + defaultValue(options.modelMatrix, Matrix4.IDENTITY), ); /** @@ -266,7 +266,7 @@ function VoxelPrimitive(options) { */ this._customShader = defaultValue( options.customShader, - VoxelPrimitive.DefaultCustomShader + VoxelPrimitive.DefaultCustomShader, ); /** @@ -471,15 +471,15 @@ function initialize(primitive, provider) { // Initialize the exaggerated versions of bounds and model matrix primitive._exaggeratedMinBounds = Cartesian3.clone( primitive._minBounds, - primitive._exaggeratedMinBounds + primitive._exaggeratedMinBounds, ); primitive._exaggeratedMaxBounds = Cartesian3.clone( primitive._maxBounds, - primitive._exaggeratedMaxBounds + primitive._exaggeratedMaxBounds, ); primitive._exaggeratedModelMatrix = Matrix4.clone( primitive._modelMatrix, - primitive._exaggeratedModelMatrix + primitive._exaggeratedModelMatrix, ); checkTransformAndBounds(primitive, provider); @@ -490,7 +490,7 @@ function initialize(primitive, provider) { primitive._shapeVisible = updateShapeAndTransforms( primitive, primitive._shape, - provider + provider, ); } @@ -843,7 +843,7 @@ Object.defineProperties(VoxelPrimitive.prototype, { this._minClippingBounds = Cartesian3.clone( minClippingBounds, - this._minClippingBounds + this._minClippingBounds, ); }, }, @@ -866,7 +866,7 @@ Object.defineProperties(VoxelPrimitive.prototype, { this._maxClippingBounds = Cartesian3.clone( maxClippingBounds, - this._maxClippingBounds + this._maxClippingBounds, ); }, }, @@ -951,12 +951,12 @@ const scratchTransformPositionLocalToProjection = new Matrix4(); const transformPositionLocalToUv = Matrix4.fromRotationTranslation( Matrix3.fromUniformScale(0.5, new Matrix3()), new Cartesian3(0.5, 0.5, 0.5), - new Matrix4() + new Matrix4(), ); const transformPositionUvToLocal = Matrix4.fromRotationTranslation( Matrix3.fromUniformScale(2.0, new Matrix3()), new Cartesian3(-1.0, -1.0, -1.0), - new Matrix4() + new Matrix4(), ); /** @@ -1006,7 +1006,7 @@ VoxelPrimitive.prototype.update = function (frameState) { // Update the traversal and prepare for rendering. const keyframeLocation = getKeyframeLocation( provider.timeIntervalCollection, - this._clock + this._clock, ); const traversal = this._traversal; @@ -1016,7 +1016,7 @@ VoxelPrimitive.prototype.update = function (frameState) { frameState, keyframeLocation, shapeDirty, // recomputeBoundingVolumes - this._disableUpdate // pauseUpdate + this._disableUpdate, // pauseUpdate ); if (sampleCountOld !== traversal._sampleCount) { @@ -1055,7 +1055,7 @@ VoxelPrimitive.prototype.update = function (frameState) { uniforms.octreeLeafNodeTexture = traversal.leafNodeTexture; uniforms.octreeLeafNodeTexelSizeUv = Cartesian2.clone( traversal.leafNodeTexelSizeUv, - uniforms.octreeLeafNodeTexelSizeUv + uniforms.octreeLeafNodeTexelSizeUv, ); uniforms.octreeLeafNodeTilesPerRow = traversal.leafNodeTilesPerRow; } @@ -1073,7 +1073,7 @@ VoxelPrimitive.prototype.update = function (frameState) { const ndcAabb = orientedBoundingBoxToNdcAabb( orientedBoundingBox, transformPositionWorldToProjection, - scratchNdcAabb + scratchNdcAabb, ); // If the object is offscreen, don't render it. @@ -1090,36 +1090,36 @@ VoxelPrimitive.prototype.update = function (frameState) { // Using a uniform instead of going through RenderState's scissor because the viewport is not accessible here, and the scissor command needs pixel coordinates. uniforms.ndcSpaceAxisAlignedBoundingBox = Cartesian4.clone( ndcAabb, - uniforms.ndcSpaceAxisAlignedBoundingBox + uniforms.ndcSpaceAxisAlignedBoundingBox, ); const transformPositionViewToWorld = context.uniformState.inverseView; uniforms.transformPositionViewToUv = Matrix4.multiplyTransformation( this._transformPositionWorldToUv, transformPositionViewToWorld, - uniforms.transformPositionViewToUv + uniforms.transformPositionViewToUv, ); const transformPositionWorldToView = context.uniformState.view; uniforms.transformPositionUvToView = Matrix4.multiplyTransformation( transformPositionWorldToView, this._transformPositionUvToWorld, - uniforms.transformPositionUvToView + uniforms.transformPositionUvToView, ); const transformDirectionViewToWorld = context.uniformState.inverseViewRotation; uniforms.transformDirectionViewToLocal = Matrix3.multiply( this._transformDirectionWorldToLocal, transformDirectionViewToWorld, - uniforms.transformDirectionViewToLocal + uniforms.transformDirectionViewToLocal, ); uniforms.transformNormalLocalToWorld = Matrix3.clone( this._transformNormalLocalToWorld, - uniforms.transformNormalLocalToWorld + uniforms.transformNormalLocalToWorld, ); const cameraPositionWorld = frameState.camera.positionWC; uniforms.cameraPositionUv = Matrix4.multiplyByPoint( this._transformPositionWorldToUv, cameraPositionWorld, - uniforms.cameraPositionUv + uniforms.cameraPositionUv, ); uniforms.stepSize = this._stepSizeMultiplier; @@ -1127,8 +1127,8 @@ VoxelPrimitive.prototype.update = function (frameState) { const command = frameState.passes.pick ? this._drawCommandPick : frameState.passes.pickVoxel - ? this._drawCommandPickVoxel - : this._drawCommand; + ? this._drawCommandPickVoxel + : this._drawCommand; command.boundingVolume = shape.boundingSphere; frameState.commandList.push(command); }; @@ -1148,11 +1148,11 @@ const scratchExaggerationTranslation = new Cartesian3(); function updateVerticalExaggeration(primitive, frameState) { primitive._exaggeratedMinBounds = Cartesian3.clone( primitive._minBounds, - primitive._exaggeratedMinBounds + primitive._exaggeratedMinBounds, ); primitive._exaggeratedMaxBounds = Cartesian3.clone( primitive._maxBounds, - primitive._exaggeratedMaxBounds + primitive._exaggeratedMaxBounds, ); if (primitive.shape === VoxelShapeType.ELLIPSOID) { @@ -1169,17 +1169,17 @@ function updateVerticalExaggeration(primitive, frameState) { 1.0, 1.0, frameState.verticalExaggeration, - scratchExaggerationScale + scratchExaggerationScale, ); primitive._exaggeratedModelMatrix = Matrix4.multiplyByScale( primitive._modelMatrix, exaggerationScale, - primitive._exaggeratedModelMatrix + primitive._exaggeratedModelMatrix, ); primitive._exaggeratedModelMatrix = Matrix4.multiplyByTranslation( primitive._exaggeratedModelMatrix, computeBoxExaggerationTranslation(primitive, frameState), - primitive._exaggeratedModelMatrix + primitive._exaggeratedModelMatrix, ); } } @@ -1194,24 +1194,24 @@ function computeBoxExaggerationTranslation(primitive, frameState) { // Find the Cartesian position of the center of the OBB const initialCenter = Matrix4.getTranslation( shapeTransform, - scratchExaggerationCenter + scratchExaggerationCenter, ); const intermediateCenter = Matrix4.multiplyByPoint( primitive._modelMatrix, initialCenter, - scratchExaggerationCenter + scratchExaggerationCenter, ); const transformedCenter = Matrix4.multiplyByPoint( globalTransform, intermediateCenter, - scratchExaggerationCenter + scratchExaggerationCenter, ); // Find the cartographic height const ellipsoid = Ellipsoid.WGS84; const centerCartographic = ellipsoid.cartesianToCartographic( transformedCenter, - scratchCartographicCenter + scratchCartographicCenter, ); let centerHeight = 0.0; @@ -1224,14 +1224,14 @@ function computeBoxExaggerationTranslation(primitive, frameState) { const exaggeratedHeight = VerticalExaggeration.getHeight( centerHeight, frameState.verticalExaggeration, - frameState.verticalExaggerationRelativeHeight + frameState.verticalExaggerationRelativeHeight, ); return Cartesian3.fromElements( 0.0, 0.0, (exaggeratedHeight - centerHeight) / frameState.verticalExaggeration, - scratchExaggerationTranslation + scratchExaggerationTranslation, ); } @@ -1260,7 +1260,7 @@ function initFromProvider(primitive, provider, context) { //>>includeStart('debug', pragmas.debug); if (defined(uniformMap[name])) { oneTimeWarning( - `VoxelPrimitive: Uniform name "${name}" is already defined` + `VoxelPrimitive: Uniform name "${name}" is already defined`, ); } //>>includeEnd('debug'); @@ -1275,23 +1275,23 @@ function initFromProvider(primitive, provider, context) { // Note that minBounds and maxBounds can be set dynamically, so their uniforms aren't set here. uniforms.dimensions = Cartesian3.clone( provider.dimensions, - uniforms.dimensions + uniforms.dimensions, ); primitive._paddingBefore = Cartesian3.clone( defaultValue(provider.paddingBefore, Cartesian3.ZERO), - primitive._paddingBefore + primitive._paddingBefore, ); uniforms.paddingBefore = Cartesian3.clone( primitive._paddingBefore, - uniforms.paddingBefore + uniforms.paddingBefore, ); primitive._paddingAfter = Cartesian3.clone( defaultValue(provider.paddingAfter, Cartesian3.ZERO), - primitive._paddingBefore + primitive._paddingBefore, ); uniforms.paddingAfter = Cartesian3.clone( primitive._paddingAfter, - uniforms.paddingAfter + uniforms.paddingAfter, ); // Create the VoxelTraversal, and set related uniforms @@ -1309,23 +1309,23 @@ function initFromProvider(primitive, provider, context) { function checkTransformAndBounds(primitive, provider) { const shapeTransform = defaultValue( provider.shapeTransform, - Matrix4.IDENTITY + Matrix4.IDENTITY, ); const globalTransform = defaultValue( provider.globalTransform, - Matrix4.IDENTITY + Matrix4.IDENTITY, ); // Compound model matrix = global transform * model matrix * shape transform Matrix4.multiplyTransformation( globalTransform, primitive._exaggeratedModelMatrix, - primitive._compoundModelMatrix + primitive._compoundModelMatrix, ); Matrix4.multiplyTransformation( primitive._compoundModelMatrix, shapeTransform, - primitive._compoundModelMatrix + primitive._compoundModelMatrix, ); const numChanges = updateBound(primitive, "_compoundModelMatrix", "_compoundModelMatrixOld") + @@ -1334,12 +1334,12 @@ function checkTransformAndBounds(primitive, provider) { updateBound( primitive, "_exaggeratedMinBounds", - "_exaggeratedMinBoundsOld" + "_exaggeratedMinBoundsOld", ) + updateBound( primitive, "_exaggeratedMaxBounds", - "_exaggeratedMaxBoundsOld" + "_exaggeratedMaxBoundsOld", ) + updateBound(primitive, "_minClippingBounds", "_minClippingBoundsOld") + updateBound(primitive, "_maxClippingBounds", "_maxClippingBoundsOld"); @@ -1380,7 +1380,7 @@ function updateShapeAndTransforms(primitive, shape, provider) { primitive._exaggeratedMinBounds, primitive._exaggeratedMaxBounds, primitive.minClippingBounds, - primitive.maxClippingBounds + primitive.maxClippingBounds, ); if (!visible) { return false; @@ -1389,11 +1389,11 @@ function updateShapeAndTransforms(primitive, shape, provider) { const transformPositionLocalToWorld = shape.shapeTransform; const transformPositionWorldToLocal = Matrix4.inverse( transformPositionLocalToWorld, - scratchTransformPositionWorldToLocal + scratchTransformPositionWorldToLocal, ); const rotation = Matrix4.getRotation( transformPositionLocalToWorld, - scratchRotation + scratchRotation, ); // Note that inverse(rotation) is the same as transpose(rotation) const scale = Matrix4.getScale(transformPositionLocalToWorld, scratchScale); @@ -1401,32 +1401,32 @@ function updateShapeAndTransforms(primitive, shape, provider) { const localScale = Cartesian3.divideByScalar( scale, maximumScaleComponent, - scratchLocalScale + scratchLocalScale, ); const rotationAndLocalScale = Matrix3.multiplyByScale( rotation, localScale, - scratchRotationAndLocalScale + scratchRotationAndLocalScale, ); // Set member variables when the shape is dirty primitive._transformPositionWorldToUv = Matrix4.multiplyTransformation( transformPositionLocalToUv, transformPositionWorldToLocal, - primitive._transformPositionWorldToUv + primitive._transformPositionWorldToUv, ); primitive._transformPositionUvToWorld = Matrix4.multiplyTransformation( transformPositionLocalToWorld, transformPositionUvToLocal, - primitive._transformPositionUvToWorld + primitive._transformPositionUvToWorld, ); primitive._transformDirectionWorldToLocal = Matrix4.getMatrix3( transformPositionWorldToLocal, - primitive._transformDirectionWorldToLocal + primitive._transformDirectionWorldToLocal, ); primitive._transformNormalLocalToWorld = Matrix3.inverseTranspose( rotationAndLocalScale, - primitive._transformNormalLocalToWorld + primitive._transformNormalLocalToWorld, ); return true; @@ -1453,7 +1453,7 @@ function setupTraversal(primitive, provider, context) { maximumTileCount, dimensions, provider.types, - provider.componentTypes + provider.componentTypes, ) : undefined; @@ -1466,7 +1466,7 @@ function setupTraversal(primitive, provider, context) { provider.types, provider.componentTypes, keyframeCount, - maximumTextureMemoryByteLength + maximumTextureMemoryByteLength, ); } @@ -1480,7 +1480,7 @@ function setTraversalUniforms(traversal, uniforms) { uniforms.octreeInternalNodeTexture = traversal.internalNodeTexture; uniforms.octreeInternalNodeTexelSizeUv = Cartesian2.clone( traversal.internalNodeTexelSizeUv, - uniforms.octreeInternalNodeTexelSizeUv + uniforms.octreeInternalNodeTexelSizeUv, ); uniforms.octreeInternalNodeTilesPerRow = traversal.internalNodeTilesPerRow; @@ -1494,23 +1494,23 @@ function setTraversalUniforms(traversal, uniforms) { uniforms.megatextureSliceDimensions = Cartesian2.clone( megatexture.sliceCountPerRegion, - uniforms.megatextureSliceDimensions + uniforms.megatextureSliceDimensions, ); uniforms.megatextureTileDimensions = Cartesian2.clone( megatexture.regionCountPerMegatexture, - uniforms.megatextureTileDimensions + uniforms.megatextureTileDimensions, ); uniforms.megatextureVoxelSizeUv = Cartesian2.clone( megatexture.voxelSizeUv, - uniforms.megatextureVoxelSizeUv + uniforms.megatextureVoxelSizeUv, ); uniforms.megatextureSliceSizeUv = Cartesian2.clone( megatexture.sliceSizeUv, - uniforms.megatextureSliceSizeUv + uniforms.megatextureSliceSizeUv, ); uniforms.megatextureTileSizeUv = Cartesian2.clone( megatexture.regionSizeUv, - uniforms.megatextureTileSizeUv + uniforms.megatextureTileSizeUv, ); } @@ -1524,7 +1524,7 @@ function setTraversalUniforms(traversal, uniforms) { function checkShapeDefines(primitive, shape) { const shapeDefines = shape.shaderDefines; const shapeDefinesChanged = Object.keys(shapeDefines).some( - (key) => shapeDefines[key] !== primitive._shapeDefinesOld[key] + (key) => shapeDefines[key] !== primitive._shapeDefinesOld[key], ); if (shapeDefinesChanged) { primitive._shapeDefinesOld = clone(shapeDefines, true); @@ -1566,11 +1566,11 @@ function getKeyframeLocation(timeIntervalCollection, clock) { // De-lerp between the start and end of the interval const totalSeconds = JulianDate.secondsDifference( timeInterval.stop, - timeInterval.start + timeInterval.start, ); const secondsDifferenceStart = JulianDate.secondsDifference( date, - timeInterval.start + timeInterval.start, ); const t = secondsDifferenceStart / totalSeconds; @@ -1610,12 +1610,12 @@ function updateClippingPlanes(primitive, frameState) { Matrix4.multiplyTransformation( Matrix4.inverse( clippingPlanes.modelMatrix, - uniforms.clippingPlanesMatrix + uniforms.clippingPlanesMatrix, ), primitive._transformPositionUvToWorld, - uniforms.clippingPlanesMatrix + uniforms.clippingPlanesMatrix, ), - uniforms.clippingPlanesMatrix + uniforms.clippingPlanesMatrix, ); } @@ -1687,7 +1687,7 @@ const corners = new Array( new Cartesian4(-1.0, -1.0, +1.0, 1.0), new Cartesian4(+1.0, -1.0, +1.0, 1.0), new Cartesian4(-1.0, +1.0, +1.0, 1.0), - new Cartesian4(+1.0, +1.0, +1.0, 1.0) + new Cartesian4(+1.0, +1.0, +1.0, 1.0), ); const vertexNeighborIndices = new Array( 1, @@ -1713,7 +1713,7 @@ const vertexNeighborIndices = new Array( 7, 3, 5, - 6 + 6, ); const scratchCornersClipSpace = new Array( @@ -1724,7 +1724,7 @@ const scratchCornersClipSpace = new Array( new Cartesian4(), new Cartesian4(), new Cartesian4(), - new Cartesian4() + new Cartesian4(), ); /** @@ -1746,17 +1746,17 @@ const scratchCornersClipSpace = new Array( function orientedBoundingBoxToNdcAabb( orientedBoundingBox, worldToProjection, - result + result, ) { const transformPositionLocalToWorld = Matrix4.fromRotationTranslation( orientedBoundingBox.halfAxes, orientedBoundingBox.center, - scratchTransformPositionLocalToWorld + scratchTransformPositionLocalToWorld, ); const transformPositionLocalToProjection = Matrix4.multiply( worldToProjection, transformPositionLocalToWorld, - scratchTransformPositionLocalToProjection + scratchTransformPositionLocalToProjection, ); let ndcMinX = +Number.MAX_VALUE; @@ -1772,7 +1772,7 @@ function orientedBoundingBoxToNdcAabb( Matrix4.multiplyByVector( transformPositionLocalToProjection, corners[cornerIndex], - cornersClipSpace[cornerIndex] + cornersClipSpace[cornerIndex], ); } @@ -1804,7 +1804,7 @@ function orientedBoundingBoxToNdcAabb( position, neighborPosition, t, - scratchIntersect + scratchIntersect, ); const intersectNdcX = intersect.x / intersect.w; const intersectNdcY = intersect.y / intersect.w; @@ -1904,19 +1904,19 @@ function debugDraw(that, frameState) { Cartesian3.ZERO, polylineXAxis, Color.RED, - axisThickness + axisThickness, ); makePolylineLineSegment( Cartesian3.ZERO, polylineYAxis, Color.LIME, - axisThickness + axisThickness, ); makePolylineLineSegment( Cartesian3.ZERO, polylineZAxis, Color.BLUE, - axisThickness + axisThickness, ); polylines.update(frameState); diff --git a/packages/engine/Source/Scene/VoxelRenderResources.js b/packages/engine/Source/Scene/VoxelRenderResources.js index c6814a95acbe..3e23d213f0c7 100644 --- a/packages/engine/Source/Scene/VoxelRenderResources.js +++ b/packages/engine/Source/Scene/VoxelRenderResources.js @@ -54,7 +54,7 @@ function VoxelRenderResources(primitive) { shaderBuilder.addUniform( uniform.type, uniformName, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); } } @@ -63,7 +63,7 @@ function VoxelRenderResources(primitive) { shaderBuilder.addUniform( "sampler2D", "u_megatextureTextures[METADATA_COUNT]", - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); /** @@ -99,18 +99,18 @@ function VoxelRenderResources(primitive) { shaderBuilder.addDefine( "CLIPPING_PLANES", undefined, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); shaderBuilder.addDefine( "CLIPPING_PLANES_COUNT", clippingPlanesLength, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); if (clippingPlanes.unionClippingRegions) { shaderBuilder.addDefine( "CLIPPING_PLANES_UNION", undefined, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); } shaderBuilder.addFragmentLines([IntersectClippingPlanes]); @@ -119,7 +119,7 @@ function VoxelRenderResources(primitive) { shaderBuilder.addDefine( "DEPTH_TEST", undefined, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); shaderBuilder.addFragmentLines([IntersectDepth]); } @@ -142,7 +142,7 @@ function VoxelRenderResources(primitive) { shaderBuilder.addDefine( "SHAPE_ELLIPSOID", undefined, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); shaderBuilder.addFragmentLines([ convertUvToEllipsoid, @@ -174,7 +174,7 @@ function VoxelRenderResources(primitive) { shaderBuilder.addDefine( "CLIPPING_PLANES_INTERSECTION_INDEX", intersectionCount, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); if (clippingPlanesLength === 1) { intersectionCount += 1; @@ -188,14 +188,14 @@ function VoxelRenderResources(primitive) { shaderBuilder.addDefine( "DEPTH_INTERSECTION_INDEX", intersectionCount, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); intersectionCount += 1; } shaderBuilder.addDefine( "INTERSECTION_COUNT", intersectionCount, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); // Additional fragment shader defines @@ -212,21 +212,21 @@ function VoxelRenderResources(primitive) { shaderBuilder.addDefine( "LOG_DEPTH_READ_ONLY", undefined, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); } if (primitive._nearestSampling) { shaderBuilder.addDefine( "NEAREST_SAMPLING", undefined, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); } const traversal = primitive._traversal; shaderBuilder.addDefine( "SAMPLE_COUNT", `${traversal._sampleCount}`, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); } diff --git a/packages/engine/Source/Scene/VoxelTraversal.js b/packages/engine/Source/Scene/VoxelTraversal.js index 0cc1db7b2d22..b7e02d06f1dd 100644 --- a/packages/engine/Source/Scene/VoxelTraversal.js +++ b/packages/engine/Source/Scene/VoxelTraversal.js @@ -40,7 +40,7 @@ function VoxelTraversal( types, componentTypes, keyframeCount, - maximumTextureMemoryByteLength + maximumTextureMemoryByteLength, ) { /** * TODO: maybe this shouldn't be stored or passed into update function? @@ -66,7 +66,7 @@ function VoxelTraversal( dimensions, componentCount, componentType, - maximumTextureMemoryByteLength + maximumTextureMemoryByteLength, ); } @@ -150,16 +150,16 @@ function VoxelTraversal( binaryTreeKeyframeWeighting, 1, keyframeCount - 2, - 0 + 0, ); const internalNodeTexelCount = 9; const internalNodeTextureDimensionX = 2048; const internalNodeTilesPerRow = Math.floor( - internalNodeTextureDimensionX / internalNodeTexelCount + internalNodeTextureDimensionX / internalNodeTexelCount, ); const internalNodeTextureDimensionY = Math.ceil( - maximumTileCount / internalNodeTilesPerRow + maximumTileCount / internalNodeTilesPerRow, ); /** @@ -191,7 +191,7 @@ function VoxelTraversal( */ this.internalNodeTexelSizeUv = new Cartesian2( 1.0 / internalNodeTextureDimensionX, - 1.0 / internalNodeTextureDimensionY + 1.0 / internalNodeTextureDimensionY, ); /** @@ -250,7 +250,7 @@ VoxelTraversal.prototype.update = function ( frameState, keyframeLocation, recomputeBoundingVolumes, - pauseUpdate + pauseUpdate, ) { const primitive = this._primitive; const context = frameState.context; @@ -268,10 +268,10 @@ VoxelTraversal.prototype.update = function ( const leafNodeTexelCount = 2; const leafNodeTextureDimensionX = 1024; const leafNodeTilesPerRow = Math.floor( - leafNodeTextureDimensionX / leafNodeTexelCount + leafNodeTextureDimensionX / leafNodeTexelCount, ); const leafNodeTextureDimensionY = Math.ceil( - maximumTileCount / leafNodeTilesPerRow + maximumTileCount / leafNodeTilesPerRow, ); this.leafNodeTexture = new Texture({ @@ -289,7 +289,7 @@ VoxelTraversal.prototype.update = function ( this.leafNodeTexelSizeUv = Cartesian2.fromElements( 1.0 / leafNodeTextureDimensionX, 1.0 / leafNodeTextureDimensionY, - this.leafNodeTexelSizeUv + this.leafNodeTexelSizeUv, ); this.leafNodeTilesPerRow = leafNodeTilesPerRow; } else if (!useLeafNodes && defined(this.leafNodeTexture)) { @@ -299,7 +299,7 @@ VoxelTraversal.prototype.update = function ( this._keyframeLocation = CesiumMath.clamp( keyframeLocation, 0.0, - keyframeCount - 1 + keyframeCount - 1, ); if (recomputeBoundingVolumes) { @@ -325,7 +325,7 @@ VoxelTraversal.prototype.update = function ( this, loadAndUnloadTimeMs, generateOctreeTimeMs, - totalTimeMs + totalTimeMs, ); } }; @@ -505,7 +505,7 @@ function loadAndUnload(that, frameState) { const previousKeyframe = CesiumMath.clamp( Math.floor(that._keyframeLocation), 0, - keyframeCount - 2 + keyframeCount - 2, ); const nextKeyframe = previousKeyframe + 1; @@ -524,7 +524,7 @@ function loadAndUnload(that, frameState) { visibilityPlaneMask = spatialNode.visibility( frameState, - visibilityPlaneMask + visibilityPlaneMask, ); if (visibilityPlaneMask === CullingVolume.MASK_OUTSIDE) { return; @@ -553,7 +553,7 @@ function loadAndUnload(that, frameState) { previousKeyframe, keyframeNode.keyframe, nextKeyframe, - that + that, ); if ( @@ -594,9 +594,8 @@ function loadAndUnload(that, frameState) { while (priorityQueue.length > 0) { highPriorityKeyframeNode = priorityQueue.removeMaximum(); highPriorityKeyframeNode.highPriorityFrameNumber = frameNumber; - highPriorityKeyframeNodes[ - highPriorityKeyframeNodeCount - ] = highPriorityKeyframeNode; + highPriorityKeyframeNodes[highPriorityKeyframeNodeCount] = + highPriorityKeyframeNode; highPriorityKeyframeNodeCount++; } @@ -648,7 +647,7 @@ function loadAndUnload(that, frameState) { const discardNode = keyframeNodesInMegatexture[addNodeIndex]; discardNode.spatialNode.destroyKeyframeNode( discardNode, - that.megatextures + that.megatextures, ); } else { addNodeIndex = keyframeNodesInMegatextureCount + addedCount; @@ -656,7 +655,7 @@ function loadAndUnload(that, frameState) { } highPriorityKeyframeNode.spatialNode.addKeyframeNodeToMegatextures( highPriorityKeyframeNode, - that.megatextures + that.megatextures, ); keyframeNodesInMegatexture[addNodeIndex] = highPriorityKeyframeNode; } @@ -676,24 +675,24 @@ function loadAndUnload(that, frameState) { function keyframePriority(previousKeyframe, keyframe, nextKeyframe, traversal) { const keyframeDifference = Math.min( Math.abs(keyframe - previousKeyframe), - Math.abs(keyframe - nextKeyframe) + Math.abs(keyframe - nextKeyframe), ); const maxKeyframeDifference = Math.max( previousKeyframe, traversal._keyframeCount - nextKeyframe - 1, - 1 + 1, ); const keyframeFactor = Math.pow( 1.0 - keyframeDifference / maxKeyframeDifference, - 4.0 + 4.0, ); const binaryTreeFactor = Math.exp( - -traversal._binaryTreeKeyframeWeighting[keyframe] + -traversal._binaryTreeKeyframeWeighting[keyframe], ); return CesiumMath.lerp( binaryTreeFactor, keyframeFactor, - 0.15 + 0.85 * keyframeFactor + 0.15 + 0.85 * keyframeFactor, ); } @@ -708,7 +707,7 @@ function printDebugInformation( that, loadAndUnloadTimeMs, generateOctreeTimeMs, - totalTimeMs + totalTimeMs, ) { const keyframeCount = that._keyframeCount; const rootNode = that.rootNode; @@ -783,7 +782,7 @@ function printDebugInformation( `ALL: ${totalTimeMsRounded}`; console.log( - `${loadedKeyframeStatistics} || ${loadStateStatistics} || ${timerStatistics}` + `${loadedKeyframeStatistics} || ${loadStateStatistics} || ${timerStatistics}`, ); } @@ -855,7 +854,7 @@ function generateOctree(that, sampleCount, levelBlendFactor) { childOctreeIndex, childEntryIndex, parentOctreeIndex, - parentEntryIndex + parentEntryIndex, ) { let hasRenderableChildren = false; if (defined(node.children)) { @@ -887,7 +886,7 @@ function generateOctree(that, sampleCount, levelBlendFactor) { childOctreeIndex, childEntryIndex, parentOctreeIndex, - parentEntryIndex + cc + parentEntryIndex + cc, ); } } else { @@ -941,14 +940,14 @@ function generateOctree(that, sampleCount, levelBlendFactor) { internalNodeOctreeData, 9, that.internalNodeTilesPerRow, - that.internalNodeTexture + that.internalNodeTexture, ); if (useLeafNodes) { copyToLeafNodeTexture( leafNodeOctreeData, 2, that.leafNodeTilesPerRow, - that.leafNodeTexture + that.leafNodeTexture, ); } } @@ -986,7 +985,7 @@ function copyToInternalNodeTexture(data, texelsPerTile, tilesPerRow, texture) { const tileCount = Math.ceil(data.length / texelsPerTile); const copyWidth = Math.max( 1, - texelsPerTile * Math.min(tileCount, tilesPerRow) + texelsPerTile * Math.min(tileCount, tilesPerRow), ); const copyHeight = Math.max(1, Math.ceil(tileCount / tilesPerRow)); @@ -1028,7 +1027,7 @@ function copyToLeafNodeTexture(data, texelsPerTile, tilesPerRow, texture) { const tileCount = Math.ceil(data.length / datasPerTile); const copyWidth = Math.max( 1, - texelsPerTile * Math.min(tileCount, tilesPerRow) + texelsPerTile * Math.min(tileCount, tilesPerRow), ); const copyHeight = Math.max(1, Math.ceil(tileCount / tilesPerRow)); @@ -1043,7 +1042,7 @@ function copyToLeafNodeTexture(data, texelsPerTile, tilesPerRow, texture) { const timeLerpCompressed = CesiumMath.clamp( Math.floor(65536 * timeLerp), 0, - 65535 + 65535, ); textureData[tileIndex * 8 + 0] = (timeLerpCompressed >>> 0) & 0xff; textureData[tileIndex * 8 + 1] = (timeLerpCompressed >>> 8) & 0xff; @@ -1084,7 +1083,7 @@ VoxelTraversal.getApproximateTextureMemoryByteLength = function ( tileCount, dimensions, types, - componentTypes + componentTypes, ) { let textureMemoryByteLength = 0; @@ -1094,12 +1093,13 @@ VoxelTraversal.getApproximateTextureMemoryByteLength = function ( const componentType = componentTypes[i]; const componentCount = MetadataType.getComponentCount(type); - textureMemoryByteLength += Megatexture.getApproximateTextureMemoryByteLength( - tileCount, - dimensions, - componentCount, - componentType - ); + textureMemoryByteLength += + Megatexture.getApproximateTextureMemoryByteLength( + tileCount, + dimensions, + componentCount, + componentType, + ); } return textureMemoryByteLength; diff --git a/packages/engine/Source/Scene/WebMapServiceImageryProvider.js b/packages/engine/Source/Scene/WebMapServiceImageryProvider.js index f5277f2eeec2..09fe189a73d8 100644 --- a/packages/engine/Source/Scene/WebMapServiceImageryProvider.js +++ b/packages/engine/Source/Scene/WebMapServiceImageryProvider.js @@ -114,7 +114,7 @@ function WebMapServiceImageryProvider(options) { if (defined(options.times) && !defined(options.clock)) { throw new DeveloperError( - "options.times was specified, so options.clock is required." + "options.times was specified, so options.clock is required.", ); } @@ -131,7 +131,7 @@ function WebMapServiceImageryProvider(options) { this._getFeatureInfoUrl = defaultValue( options.getFeatureInfoUrl, - options.url + options.url, ); const resource = Resource.createIfNeeded(options.url); @@ -139,11 +139,11 @@ function WebMapServiceImageryProvider(options) { resource.setQueryParameters( WebMapServiceImageryProvider.DefaultParameters, - true + true, ); pickFeatureResource.setQueryParameters( WebMapServiceImageryProvider.GetFeatureInfoDefaultParameters, - true + true, ); if (defined(options.parameters)) { @@ -152,7 +152,7 @@ function WebMapServiceImageryProvider(options) { if (defined(options.getFeatureInfoParameters)) { pickFeatureResource.setQueryParameters( - objectToLowercase(options.getFeatureInfoParameters) + objectToLowercase(options.getFeatureInfoParameters), ); } @@ -190,7 +190,7 @@ function WebMapServiceImageryProvider(options) { options.tilingScheme && options.tilingScheme.projection instanceof WebMercatorProjection ? "EPSG:3857" - : "CRS:84" + : "CRS:84", ); // The axis order in previous versions of the WMS specifications was to always use easting (x or lon ) and northing (y or @@ -218,7 +218,7 @@ function WebMapServiceImageryProvider(options) { options.tilingScheme && options.tilingScheme.projection instanceof WebMercatorProjection ? "EPSG:3857" - : "EPSG:4326" + : "EPSG:4326", ); } @@ -249,7 +249,7 @@ function WebMapServiceImageryProvider(options) { pickFeaturesUrl: pickFeatureResource, tilingScheme: defaultValue( options.tilingScheme, - new GeographicTilingScheme({ ellipsoid: options.ellipsoid }) + new GeographicTilingScheme({ ellipsoid: options.ellipsoid }), ), rectangle: options.rectangle, tileWidth: options.tileWidth, @@ -261,7 +261,7 @@ function WebMapServiceImageryProvider(options) { credit: options.credit, getFeatureInfoFormats: defaultValue( options.getFeatureInfoFormats, - WebMapServiceImageryProvider.DefaultGetFeatureInfoFormats + WebMapServiceImageryProvider.DefaultGetFeatureInfoFormats, ), enablePickFeatures: options.enablePickFeatures, }); @@ -285,7 +285,7 @@ function pickFeatures( level, longitude, latitude, - interval + interval, ) { const dynamicIntervalData = defined(interval) ? interval.data : undefined; const tileProvider = imageryProvider._tileProvider; @@ -550,7 +550,7 @@ WebMapServiceImageryProvider.prototype.requestImage = function ( x, y, level, - request + request, ) { let result; const timeDynamicImagery = this._timeDynamicImagery; @@ -593,7 +593,7 @@ WebMapServiceImageryProvider.prototype.pickFeatures = function ( y, level, longitude, - latitude + latitude, ) { const timeDynamicImagery = this._timeDynamicImagery; const currentInterval = defined(timeDynamicImagery) diff --git a/packages/engine/Source/Scene/WebMapTileServiceImageryProvider.js b/packages/engine/Source/Scene/WebMapTileServiceImageryProvider.js index 1ee3c2002504..690a7ea59b13 100644 --- a/packages/engine/Source/Scene/WebMapTileServiceImageryProvider.js +++ b/packages/engine/Source/Scene/WebMapTileServiceImageryProvider.js @@ -131,7 +131,7 @@ function WebMapTileServiceImageryProvider(options) { } if (defined(options.times) && !defined(options.clock)) { throw new DeveloperError( - "options.times was specified, so options.clock is required." + "options.times was specified, so options.clock is required.", ); } //>>includeEnd('debug'); @@ -190,7 +190,7 @@ function WebMapTileServiceImageryProvider(options) { this._rectangle = defaultValue( options.rectangle, - this._tilingScheme.rectangle + this._tilingScheme.rectangle, ); this._dimensions = options.dimensions; @@ -216,18 +216,18 @@ function WebMapTileServiceImageryProvider(options) { // level will cause too many tiles to be downloaded and rendered. const swTile = this._tilingScheme.positionToTileXY( Rectangle.southwest(this._rectangle), - this._minimumLevel + this._minimumLevel, ); const neTile = this._tilingScheme.positionToTileXY( Rectangle.northeast(this._rectangle), - this._minimumLevel + this._minimumLevel, ); const tileCount = (Math.abs(neTile.x - swTile.x) + 1) * (Math.abs(neTile.y - swTile.y) + 1); //>>includeStart('debug', pragmas.debug); if (tileCount > 4) { throw new DeveloperError( - `The imagery provider's rectangle and minimumLevel indicate that there are ${tileCount} tiles at the minimum level. Imagery providers with more than four tiles at the minimum level are not supported.` + `The imagery provider's rectangle and minimumLevel indicate that there are ${tileCount} tiles at the minimum level. Imagery providers with more than four tiles at the minimum level are not supported.`, ); } //>>includeEnd('debug'); @@ -533,7 +533,7 @@ Object.defineProperties(WebMapTileServiceImageryProvider.prototype, { WebMapTileServiceImageryProvider.prototype.getTileCredits = function ( x, y, - level + level, ) { return undefined; }; @@ -552,7 +552,7 @@ WebMapTileServiceImageryProvider.prototype.requestImage = function ( x, y, level, - request + request, ) { let result; const timeDynamicImagery = this._timeDynamicImagery; @@ -593,7 +593,7 @@ WebMapTileServiceImageryProvider.prototype.pickFeatures = function ( y, level, longitude, - latitude + latitude, ) { return undefined; }; diff --git a/packages/engine/Source/Scene/buildVoxelDrawCommands.js b/packages/engine/Source/Scene/buildVoxelDrawCommands.js index ba8aba81bb37..19f67111ccca 100644 --- a/packages/engine/Source/Scene/buildVoxelDrawCommands.js +++ b/packages/engine/Source/Scene/buildVoxelDrawCommands.js @@ -23,11 +23,8 @@ function buildVoxelDrawCommands(primitive, context) { processVoxelProperties(renderResources, primitive); - const { - shaderBuilder, - clippingPlanes, - clippingPlanesLength, - } = renderResources; + const { shaderBuilder, clippingPlanes, clippingPlanesLength } = + renderResources; if (clippingPlanesLength > 0) { // Extract the getClippingPlane function from the getClippingFunction string. @@ -41,16 +38,16 @@ function buildVoxelDrawCommands(primitive, context) { const functionBodyEnd = entireFunction.indexOf("}", functionBodyBegin); const functionSignature = entireFunction.slice( functionSignatureBegin, - functionSignatureEnd + functionSignatureEnd, ); const functionBody = entireFunction.slice( functionBodyBegin, - functionBodyEnd + functionBodyEnd, ); shaderBuilder.addFunction( functionId, functionSignature, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); shaderBuilder.addFunctionLines(functionId, [functionBody]); } @@ -62,13 +59,12 @@ function buildVoxelDrawCommands(primitive, context) { shaderBuilderPickVoxel.addDefine( "PICKING_VOXEL", undefined, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); const shaderProgram = shaderBuilder.buildShaderProgram(context); const shaderProgramPick = shaderBuilderPick.buildShaderProgram(context); - const shaderProgramPickVoxel = shaderBuilderPickVoxel.buildShaderProgram( - context - ); + const shaderProgramPickVoxel = + shaderBuilderPickVoxel.buildShaderProgram(context); const renderState = RenderState.fromCache({ cull: { enabled: true, @@ -102,7 +98,7 @@ function buildVoxelDrawCommands(primitive, context) { // Create the pick draw command const drawCommandPick = DrawCommand.shallowClone( drawCommand, - new DrawCommand() + new DrawCommand(), ); drawCommandPick.shaderProgram = shaderProgramPick; drawCommandPick.pickOnly = true; @@ -110,7 +106,7 @@ function buildVoxelDrawCommands(primitive, context) { // Create the pick voxels draw command const drawCommandPickVoxel = DrawCommand.shallowClone( drawCommand, - new DrawCommand() + new DrawCommand(), ); drawCommandPickVoxel.shaderProgram = shaderProgramPickVoxel; drawCommandPickVoxel.pickOnly = true; diff --git a/packages/engine/Source/Scene/computeFlyToLocationForRectangle.js b/packages/engine/Source/Scene/computeFlyToLocationForRectangle.js index 0a984cb7cb35..d77d02a10400 100644 --- a/packages/engine/Source/Scene/computeFlyToLocationForRectangle.js +++ b/packages/engine/Source/Scene/computeFlyToLocationForRectangle.js @@ -45,10 +45,11 @@ async function computeFlyToLocationForRectangle(rectangle, scene) { Rectangle.northwest(rectangle), ]; - const positionsOnTerrain = await computeFlyToLocationForRectangle._sampleTerrainMostDetailed( - terrainProvider, - cartographics - ); + const positionsOnTerrain = + await computeFlyToLocationForRectangle._sampleTerrainMostDetailed( + terrainProvider, + cartographics, + ); let heightFound = false; const maxHeight = positionsOnTerrain.reduce(function (currentMax, item) { @@ -68,5 +69,6 @@ async function computeFlyToLocationForRectangle(rectangle, scene) { } //Exposed for testing. -computeFlyToLocationForRectangle._sampleTerrainMostDetailed = sampleTerrainMostDetailed; +computeFlyToLocationForRectangle._sampleTerrainMostDetailed = + sampleTerrainMostDetailed; export default computeFlyToLocationForRectangle; diff --git a/packages/engine/Source/Scene/createBillboardPointCallback.js b/packages/engine/Source/Scene/createBillboardPointCallback.js index a9340b81d3d5..5c2bfa725486 100644 --- a/packages/engine/Source/Scene/createBillboardPointCallback.js +++ b/packages/engine/Source/Scene/createBillboardPointCallback.js @@ -15,7 +15,7 @@ function createBillboardPointCallback( cssColor, cssOutlineColor, cssOutlineWidth, - pixelSize + pixelSize, ) { return function () { const canvas = document.createElement("canvas"); @@ -43,7 +43,7 @@ function createBillboardPointCallback( pixelSize / 2, 0, 2 * Math.PI, - true + true, ); context2D.closePath(); context2D.fillStyle = "black"; diff --git a/packages/engine/Source/Scene/createElevationBandMaterial.js b/packages/engine/Source/Scene/createElevationBandMaterial.js index 544a1d67f6c7..94d0e8a39ee3 100644 --- a/packages/engine/Source/Scene/createElevationBandMaterial.js +++ b/packages/engine/Source/Scene/createElevationBandMaterial.js @@ -126,7 +126,7 @@ function preprocess(layers) { const height = CesiumMath.clamp( entryOrig.height, createElevationBandMaterial._minimumHeight, - createElevationBandMaterial._maximumHeight + createElevationBandMaterial._maximumHeight, ); // premultiplied alpha @@ -174,8 +174,8 @@ function preprocess(layers) { 0, createNewEntry( createElevationBandMaterial._minimumHeight, - entries[0].color - ) + entries[0].color, + ), ); } if (extendUpwards) { @@ -184,8 +184,8 @@ function preprocess(layers) { 0, createNewEntry( createElevationBandMaterial._maximumHeight, - entries[entries.length - 1].color - ) + entries[entries.length - 1].color, + ), ); } @@ -325,7 +325,7 @@ function createLayeredEntries(layers) { entry.height, prevEntryAccum, entryAccum, - scratchColorBelow + scratchColorBelow, ); if (!defined(prevEntry)) { @@ -349,7 +349,7 @@ function createLayeredEntries(layers) { entryAccum.height, prevEntry, entry, - scratchColorAbove + scratchColorAbove, ); if (!defined(prevEntryAccum)) { @@ -384,7 +384,7 @@ function createLayeredEntries(layers) { // Insert blank gap between last accum entry and first entry addEntry( prevEntryAccum.height, - createElevationBandMaterial._emptyColor + createElevationBandMaterial._emptyColor, ); addEntry(entry.height, createElevationBandMaterial._emptyColor); addEntry(entry.height, entry.color); diff --git a/packages/engine/Source/Scene/createGooglePhotorealistic3DTileset.js b/packages/engine/Source/Scene/createGooglePhotorealistic3DTileset.js index eee6c6abb61d..f762d748dc36 100644 --- a/packages/engine/Source/Scene/createGooglePhotorealistic3DTileset.js +++ b/packages/engine/Source/Scene/createGooglePhotorealistic3DTileset.js @@ -44,7 +44,7 @@ async function createGooglePhotorealistic3DTileset(key, options) { options.cacheBytes = defaultValue(options.cacheBytes, 1536 * 1024 * 1024); options.maximumCacheOverflowBytes = defaultValue( options.maximumCacheOverflowBytes, - 1024 * 1024 * 1024 + 1024 * 1024 * 1024, ); options.enableCollision = defaultValue(options.enableCollision, true); diff --git a/packages/engine/Source/Scene/createOsmBuildingsAsync.js b/packages/engine/Source/Scene/createOsmBuildingsAsync.js index 08b4b019c7ad..e3b2908277f3 100644 --- a/packages/engine/Source/Scene/createOsmBuildingsAsync.js +++ b/packages/engine/Source/Scene/createOsmBuildingsAsync.js @@ -67,7 +67,7 @@ async function createOsmBuildingsAsync(options) { if (!defined(style)) { const color = defaultValue( options.defaultColor, - Color.WHITE + Color.WHITE, ).toCssColorString(); style = new Cesium3DTileStyle({ color: `Boolean(\${feature['cesium#color']}) ? color(\${feature['cesium#color']}) : ${color}`, diff --git a/packages/engine/Source/Scene/createTangentSpaceDebugPrimitive.js b/packages/engine/Source/Scene/createTangentSpaceDebugPrimitive.js index 5c3086e11b33..c5d8175dd2a0 100644 --- a/packages/engine/Source/Scene/createTangentSpaceDebugPrimitive.js +++ b/packages/engine/Source/Scene/createTangentSpaceDebugPrimitive.js @@ -48,7 +48,7 @@ function createTangentSpaceDebugPrimitive(options) { const attributes = geometry.attributes; const modelMatrix = Matrix4.clone( - defaultValue(options.modelMatrix, Matrix4.IDENTITY) + defaultValue(options.modelMatrix, Matrix4.IDENTITY), ); const length = defaultValue(options.length, 10000.0); @@ -58,13 +58,13 @@ function createTangentSpaceDebugPrimitive(options) { geometry: GeometryPipeline.createLineSegmentsForVectors( geometry, "normal", - length + length, ), attributes: { color: new ColorGeometryInstanceAttribute(1.0, 0.0, 0.0, 1.0), }, modelMatrix: modelMatrix, - }) + }), ); } @@ -74,13 +74,13 @@ function createTangentSpaceDebugPrimitive(options) { geometry: GeometryPipeline.createLineSegmentsForVectors( geometry, "tangent", - length + length, ), attributes: { color: new ColorGeometryInstanceAttribute(0.0, 1.0, 0.0, 1.0), }, modelMatrix: modelMatrix, - }) + }), ); } @@ -90,13 +90,13 @@ function createTangentSpaceDebugPrimitive(options) { geometry: GeometryPipeline.createLineSegmentsForVectors( geometry, "bitangent", - length + length, ), attributes: { color: new ColorGeometryInstanceAttribute(0.0, 0.0, 1.0, 1.0), }, modelMatrix: modelMatrix, - }) + }), ); } diff --git a/packages/engine/Source/Scene/findContentMetadata.js b/packages/engine/Source/Scene/findContentMetadata.js index db20826686ba..dd8e96327d2d 100644 --- a/packages/engine/Source/Scene/findContentMetadata.js +++ b/packages/engine/Source/Scene/findContentMetadata.js @@ -29,14 +29,14 @@ function findContentMetadata(tileset, contentHeader) { if (!defined(tileset.schema)) { findContentMetadata._oneTimeWarning( "findContentMetadata-missing-root-schema", - "Could not find a metadata schema for content metadata. For tilesets that contain external tilesets, make sure the schema is added to the root tileset.json." + "Could not find a metadata schema for content metadata. For tilesets that contain external tilesets, make sure the schema is added to the root tileset.json.", ); return undefined; } const classes = defaultValue( tileset.schema.classes, - defaultValue.EMPTY_OBJECT + defaultValue.EMPTY_OBJECT, ); if (defined(metadataJson.class)) { const contentClass = classes[metadataJson.class]; diff --git a/packages/engine/Source/Scene/findTileMetadata.js b/packages/engine/Source/Scene/findTileMetadata.js index f455afdf9c94..c91a3df7ae93 100644 --- a/packages/engine/Source/Scene/findTileMetadata.js +++ b/packages/engine/Source/Scene/findTileMetadata.js @@ -31,14 +31,14 @@ function findTileMetadata(tileset, tileHeader) { if (!defined(tileset.schema)) { findTileMetadata._oneTimeWarning( "findTileMetadata-missing-root-schema", - "Could not find a metadata schema for tile metadata. For tilesets that contain external tilesets, make sure the schema is added to the root tileset.json." + "Could not find a metadata schema for tile metadata. For tilesets that contain external tilesets, make sure the schema is added to the root tileset.json.", ); return undefined; } const classes = defaultValue( tileset.schema.classes, - defaultValue.EMPTY_OBJECT + defaultValue.EMPTY_OBJECT, ); if (defined(metadataJson.class)) { const tileClass = classes[metadataJson.class]; diff --git a/packages/engine/Source/Scene/getBinaryAccessor.js b/packages/engine/Source/Scene/getBinaryAccessor.js index aad46fc83bab..36ab52e85b8f 100644 --- a/packages/engine/Source/Scene/getBinaryAccessor.js +++ b/packages/engine/Source/Scene/getBinaryAccessor.js @@ -48,7 +48,7 @@ function getBinaryAccessor(accessor) { componentDatatype, buffer, byteOffset, - componentsPerAttribute * length + componentsPerAttribute * length, ); }, }; diff --git a/packages/engine/Source/Scene/getClipAndStyleCode.js b/packages/engine/Source/Scene/getClipAndStyleCode.js index 5b3e71f61eab..2dbc355196e6 100644 --- a/packages/engine/Source/Scene/getClipAndStyleCode.js +++ b/packages/engine/Source/Scene/getClipAndStyleCode.js @@ -12,7 +12,7 @@ import Check from "../Core/Check.js"; function getClipAndStyleCode( samplerUniformName, matrixUniformName, - styleUniformName + styleUniformName, ) { //>>includeStart('debug', pragmas.debug); Check.typeOf.string("samplerUniformName", samplerUniformName); diff --git a/packages/engine/Source/Scene/getClippingFunction.js b/packages/engine/Source/Scene/getClippingFunction.js index d17d9819b598..690d542cf4f5 100644 --- a/packages/engine/Source/Scene/getClippingFunction.js +++ b/packages/engine/Source/Scene/getClippingFunction.js @@ -22,7 +22,7 @@ function getClippingFunction(clippingPlaneCollection, context) { const textureResolution = ClippingPlaneCollection.getTextureResolution( clippingPlaneCollection, context, - textureResolutionScratch + textureResolutionScratch, ); const width = textureResolution.x; const height = textureResolution.y; diff --git a/packages/engine/Source/Scene/parseBatchTable.js b/packages/engine/Source/Scene/parseBatchTable.js index 26cb21abec7f..6105f587abaf 100644 --- a/packages/engine/Source/Scene/parseBatchTable.js +++ b/packages/engine/Source/Scene/parseBatchTable.js @@ -47,14 +47,14 @@ function parseBatchTable(options) { const binaryBody = options.binaryBody; const parseAsPropertyAttributes = defaultValue( options.parseAsPropertyAttributes, - false + false, ); const customAttributeOutput = options.customAttributeOutput; //>>includeStart('debug', pragmas.debug); if (parseAsPropertyAttributes && !defined(customAttributeOutput)) { throw new DeveloperError( - "customAttributeOutput is required when parsing batch table as property attributes" + "customAttributeOutput is required when parsing batch table as property attributes", ); } //>>includeEnd('debug'); @@ -90,7 +90,7 @@ function parseBatchTable(options) { className, binaryProperties, binaryBody, - customAttributeOutput + customAttributeOutput, ); transcodedSchema = attributeResults.transcodedSchema; const propertyAttribute = new PropertyAttribute({ @@ -104,7 +104,7 @@ function parseBatchTable(options) { featureCount, className, binaryProperties, - binaryBody + binaryBody, ); transcodedSchema = binaryResults.transcodedSchema; const featureTableJson = binaryResults.featureTableJson; @@ -163,7 +163,7 @@ function partitionProperties(batchTable) { if (defined(legacyHierarchy)) { parseBatchTable._deprecationWarning( "batchTableHierarchyExtension", - "The batch table HIERARCHY property has been moved to an extension. Use extensions.3DTILES_batch_table_hierarchy instead." + "The batch table HIERARCHY property has been moved to an extension. Use extensions.3DTILES_batch_table_hierarchy instead.", ); hierarchyExtension = legacyHierarchy; } else if (defined(extensions)) { @@ -220,7 +220,7 @@ function transcodeBinaryProperties( featureCount, className, binaryProperties, - binaryBody + binaryBody, ) { const classProperties = {}; const featureTableProperties = {}; @@ -233,7 +233,7 @@ function transcodeBinaryProperties( if (!defined(binaryBody)) { throw new RuntimeError( - `Property ${propertyId} requires a batch table binary.` + `Property ${propertyId} requires a batch table binary.`, ); } @@ -246,13 +246,12 @@ function transcodeBinaryProperties( classProperties[propertyId] = transcodePropertyType(property); - bufferViewsTypedArrays[ - bufferViewCount - ] = binaryAccessor.createArrayBufferView( - binaryBody.buffer, - binaryBody.byteOffset + property.byteOffset, - featureCount - ); + bufferViewsTypedArrays[bufferViewCount] = + binaryAccessor.createArrayBufferView( + binaryBody.buffer, + binaryBody.byteOffset + property.byteOffset, + featureCount, + ); bufferViewCount++; } @@ -285,7 +284,7 @@ function transcodeBinaryPropertiesAsPropertyAttributes( className, binaryProperties, binaryBody, - customAttributeOutput + customAttributeOutput, ) { const classProperties = {}; const propertyAttributeProperties = {}; @@ -302,7 +301,7 @@ function transcodeBinaryPropertiesAsPropertyAttributes( const property = binaryProperties[propertyId]; if (!defined(binaryBody) && !defined(property.typedArray)) { throw new RuntimeError( - `Property ${propertyId} requires a batch table binary.` + `Property ${propertyId} requires a batch table binary.`, ); } @@ -346,7 +345,7 @@ function transcodeBinaryPropertiesAsPropertyAttributes( attributeTypedArray = binaryAccessor.createArrayBufferView( binaryBody.buffer, binaryBody.byteOffset + property.byteOffset, - featureCount + featureCount, ); } @@ -354,9 +353,8 @@ function transcodeBinaryPropertiesAsPropertyAttributes( attribute.name = customAttributeName; attribute.count = featureCount; attribute.type = property.type; - const componentDatatype = ComponentDatatype.fromTypedArray( - attributeTypedArray - ); + const componentDatatype = + ComponentDatatype.fromTypedArray(attributeTypedArray); if ( componentDatatype === ComponentDatatype.INT || componentDatatype === ComponentDatatype.UNSIGNED_INT || @@ -364,13 +362,12 @@ function transcodeBinaryPropertiesAsPropertyAttributes( ) { parseBatchTable._oneTimeWarning( "Cast pnts property to floats", - `Point cloud property "${customAttributeName}" will be cast to a float array because INT, UNSIGNED_INT, and DOUBLE are not valid WebGL vertex attribute types. Some precision may be lost.` + `Point cloud property "${customAttributeName}" will be cast to a float array because INT, UNSIGNED_INT, and DOUBLE are not valid WebGL vertex attribute types. Some precision may be lost.`, ); attributeTypedArray = new Float32Array(attributeTypedArray); } - attribute.componentDatatype = ComponentDatatype.fromTypedArray( - attributeTypedArray - ); + attribute.componentDatatype = + ComponentDatatype.fromTypedArray(attributeTypedArray); attribute.typedArray = attributeTypedArray; customAttributeOutput.push(attribute); diff --git a/packages/engine/Source/Scene/parseFeatureMetadataLegacy.js b/packages/engine/Source/Scene/parseFeatureMetadataLegacy.js index 481ed2b0606b..9d20d691a5d9 100644 --- a/packages/engine/Source/Scene/parseFeatureMetadataLegacy.js +++ b/packages/engine/Source/Scene/parseFeatureMetadataLegacy.js @@ -60,7 +60,7 @@ function parseFeatureMetadataLegacy(options) { metadataTable: metadataTable, extras: featureTable.extras, extensions: featureTable.extensions, - }) + }), ); } } @@ -80,7 +80,7 @@ function parseFeatureMetadataLegacy(options) { propertyTexture: transcodeToPropertyTexture(featureTexture), class: schema.classes[featureTexture.class], textures: options.textures, - }) + }), ); } } @@ -119,7 +119,7 @@ function transcodeToPropertyTexture(featureTexture) { propertyTexture.properties[propertyId] = combine( oldProperty.texture, property, - true + true, ); } } diff --git a/packages/engine/Source/Scene/parseStructuralMetadata.js b/packages/engine/Source/Scene/parseStructuralMetadata.js index 1e401fe7c277..415de8929f3a 100644 --- a/packages/engine/Source/Scene/parseStructuralMetadata.js +++ b/packages/engine/Source/Scene/parseStructuralMetadata.js @@ -52,7 +52,7 @@ function parseStructuralMetadata(options) { metadataTable: metadataTable, extras: propertyTable.extras, extensions: propertyTable.extensions, - }) + }), ); } } @@ -68,7 +68,7 @@ function parseStructuralMetadata(options) { propertyTexture: propertyTexture, class: schema.classes[propertyTexture.class], textures: options.textures, - }) + }), ); } } @@ -83,7 +83,7 @@ function parseStructuralMetadata(options) { name: propertyAttribute.name, class: schema.classes[propertyAttribute.class], propertyAttribute: propertyAttribute, - }) + }), ); } } diff --git a/packages/engine/Source/Scene/processVoxelProperties.js b/packages/engine/Source/Scene/processVoxelProperties.js index 4c91b7f120d2..cc90a6db5ead 100644 --- a/packages/engine/Source/Scene/processVoxelProperties.js +++ b/packages/engine/Source/Scene/processVoxelProperties.js @@ -15,13 +15,8 @@ import ShaderDestination from "../Renderer/ShaderDestination.js"; function processVoxelProperties(renderResources, primitive) { const { shaderBuilder } = renderResources; - const { - names, - types, - componentTypes, - minimumValues, - maximumValues, - } = primitive._provider; + const { names, types, componentTypes, minimumValues, maximumValues } = + primitive._provider; const attributeLength = types.length; const hasStatistics = defined(minimumValues) && defined(maximumValues); @@ -29,14 +24,14 @@ function processVoxelProperties(renderResources, primitive) { shaderBuilder.addDefine( "METADATA_COUNT", attributeLength, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); if (hasStatistics) { shaderBuilder.addDefine( "STATISTICS", undefined, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); } @@ -49,7 +44,7 @@ function processVoxelProperties(renderResources, primitive) { shaderBuilder.addStruct( propertyStatisticsStructId, propertyStatisticsStructName, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); const glslType = getGlslType(type); shaderBuilder.addStructField(propertyStatisticsStructId, glslType, "min"); @@ -63,7 +58,7 @@ function processVoxelProperties(renderResources, primitive) { shaderBuilder.addStruct( statisticsStructId, statisticsStructName, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); for (let i = 0; i < attributeLength; i++) { const name = names[i]; @@ -72,7 +67,7 @@ function processVoxelProperties(renderResources, primitive) { shaderBuilder.addStructField( statisticsStructId, propertyStructName, - propertyFieldName + propertyFieldName, ); } @@ -83,12 +78,12 @@ function processVoxelProperties(renderResources, primitive) { shaderBuilder.addStruct( metadataStructId, metadataStructName, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); shaderBuilder.addStructField( metadataStructId, statisticsStructName, - statisticsFieldName + statisticsFieldName, ); for (let i = 0; i < attributeLength; i++) { const name = names[i]; @@ -107,27 +102,27 @@ function processVoxelProperties(renderResources, primitive) { shaderBuilder.addStruct( voxelPropertyStructId, voxelPropertyStructName, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); shaderBuilder.addStructField( voxelPropertyStructId, glslType, - "partialDerivativeLocal" + "partialDerivativeLocal", ); shaderBuilder.addStructField( voxelPropertyStructId, glslType, - "partialDerivativeWorld" + "partialDerivativeWorld", ); shaderBuilder.addStructField( voxelPropertyStructId, glslType, - "partialDerivativeView" + "partialDerivativeView", ); shaderBuilder.addStructField( voxelPropertyStructId, glslType, - "partialDerivativeValid" + "partialDerivativeValid", ); } @@ -138,7 +133,7 @@ function processVoxelProperties(renderResources, primitive) { shaderBuilder.addStruct( voxelStructId, voxelStructName, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); for (let i = 0; i < attributeLength; i++) { const name = names[i]; @@ -163,17 +158,17 @@ function processVoxelProperties(renderResources, primitive) { shaderBuilder.addStruct( fragmentInputStructId, fragmentInputStructName, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); shaderBuilder.addStructField( fragmentInputStructId, metadataStructName, - metadataFieldName + metadataFieldName, ); shaderBuilder.addStructField( fragmentInputStructId, voxelStructName, - voxelFieldName + voxelFieldName, ); // Properties struct @@ -183,7 +178,7 @@ function processVoxelProperties(renderResources, primitive) { shaderBuilder.addStruct( propertiesStructId, propertiesStructName, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); for (let i = 0; i < attributeLength; i++) { const name = names[i]; @@ -200,7 +195,7 @@ function processVoxelProperties(renderResources, primitive) { shaderBuilder.addFunction( functionId, `${propertiesStructName} clearProperties()`, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); shaderBuilder.addFunctionLines(functionId, [ `${propertiesStructName} ${propertiesFieldName};`, @@ -225,7 +220,7 @@ function processVoxelProperties(renderResources, primitive) { shaderBuilder.addFunction( functionId, `${propertiesStructName} sumProperties(${propertiesStructName} propertiesA, ${propertiesStructName} propertiesB)`, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); shaderBuilder.addFunctionLines(functionId, [ `${propertiesStructName} ${propertiesFieldName};`, @@ -247,7 +242,7 @@ function processVoxelProperties(renderResources, primitive) { shaderBuilder.addFunction( functionId, `${propertiesStructName} scaleProperties(${propertiesStructName} ${propertiesFieldName}, float scale)`, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); shaderBuilder.addFunctionLines(functionId, [ `${propertiesStructName} scaledProperties = ${propertiesFieldName};`, @@ -267,7 +262,7 @@ function processVoxelProperties(renderResources, primitive) { shaderBuilder.addFunction( functionId, `${propertiesStructName} mixProperties(${propertiesStructName} propertiesA, ${propertiesStructName} propertiesB, float mixFactor)`, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); shaderBuilder.addFunctionLines(functionId, [ `${propertiesStructName} ${propertiesFieldName};`, @@ -289,7 +284,7 @@ function processVoxelProperties(renderResources, primitive) { shaderBuilder.addFunction( functionId, `void copyPropertiesToMetadata(in ${propertiesStructName} ${propertiesFieldName}, inout ${metadataStructName} ${metadataFieldName})`, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); for (let i = 0; i < attributeLength; i++) { const name = names[i]; @@ -305,7 +300,7 @@ function processVoxelProperties(renderResources, primitive) { shaderBuilder.addFunction( functionId, `void setStatistics(inout ${statisticsStructName} ${statisticsFieldName})`, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); for (let i = 0; i < attributeLength; i++) { const name = names[i]; @@ -317,10 +312,10 @@ function processVoxelProperties(renderResources, primitive) { const maximumValue = maximumValues[i][j]; shaderBuilder.addFunctionLines(functionId, [ `${statisticsFieldName}.${name}.min${glslField} = ${getGlslNumberAsFloat( - minimumValue + minimumValue, )};`, `${statisticsFieldName}.${name}.max${glslField} = ${getGlslNumberAsFloat( - maximumValue + maximumValue, )};`, ]); } @@ -333,7 +328,7 @@ function processVoxelProperties(renderResources, primitive) { shaderBuilder.addFunction( functionId, `${propertiesStructName} getPropertiesFromMegatextureAtUv(vec2 texcoord)`, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); shaderBuilder.addFunctionLines(functionId, [ `${propertiesStructName} ${propertiesFieldName};`, diff --git a/packages/engine/Source/Widget/CesiumWidget.js b/packages/engine/Source/Widget/CesiumWidget.js index 20b2e7172ec2..3d01ca4c3c4d 100644 --- a/packages/engine/Source/Widget/CesiumWidget.js +++ b/packages/engine/Source/Widget/CesiumWidget.js @@ -192,7 +192,8 @@ function CesiumWidget(container, options) { container.appendChild(element); const canvas = document.createElement("canvas"); - const supportsImageRenderingPixelated = FeatureDetection.supportsImageRenderingPixelated(); + const supportsImageRenderingPixelated = + FeatureDetection.supportsImageRenderingPixelated(); this._supportsImageRenderingPixelated = supportsImageRenderingPixelated; if (supportsImageRenderingPixelated) { canvas.style.imageRendering = FeatureDetection.imageRenderingValue(); @@ -221,7 +222,7 @@ function CesiumWidget(container, options) { const blurActiveElementOnCanvasFocus = defaultValue( options.blurActiveElementOnCanvasFocus, - true + true, ); if (blurActiveElementOnCanvasFocus) { @@ -247,7 +248,7 @@ function CesiumWidget(container, options) { const useBrowserRecommendedResolution = defaultValue( options.useBrowserRecommendedResolution, - true + true, ); this._element = element; @@ -303,7 +304,7 @@ function CesiumWidget(container, options) { scene.globe = globe; scene.globe.shadows = defaultValue( options.terrainShadows, - ShadowMode.RECEIVE_ONLY + ShadowMode.RECEIVE_ONLY, ); } @@ -348,7 +349,7 @@ function CesiumWidget(container, options) { //>>includeStart('debug', pragmas.debug); if (defined(options.terrainProvider)) { throw new DeveloperError( - "Specify either options.terrainProvider or options.terrain." + "Specify either options.terrainProvider or options.terrain.", ); } //>>includeEnd('debug') @@ -370,7 +371,7 @@ function CesiumWidget(container, options) { this._useDefaultRenderLoop = undefined; this.useDefaultRenderLoop = defaultValue( options.useDefaultRenderLoop, - true + true, ); this._targetFrameRate = undefined; @@ -573,7 +574,7 @@ Object.defineProperties(CesiumWidget.prototype, { //>>includeStart('debug', pragmas.debug); if (value <= 0) { throw new DeveloperError( - "targetFrameRate must be greater than 0, or undefined." + "targetFrameRate must be greater than 0, or undefined.", ); } //>>includeEnd('debug'); @@ -693,7 +694,7 @@ CesiumWidget.prototype.showErrorPanel = function (title, message, error) { function resizeCallback() { errorPanelScroller.style.maxHeight = `${Math.max( Math.round(element.clientHeight * 0.9 - 100), - 30 + 30, )}px`; } resizeCallback(); diff --git a/packages/engine/Source/Workers/combineGeometry.js b/packages/engine/Source/Workers/combineGeometry.js index 6ce02cf5c665..b2f78de13636 100644 --- a/packages/engine/Source/Workers/combineGeometry.js +++ b/packages/engine/Source/Workers/combineGeometry.js @@ -2,13 +2,12 @@ import PrimitivePipeline from "../Scene/PrimitivePipeline.js"; import createTaskProcessorWorker from "./createTaskProcessorWorker.js"; function combineGeometry(packedParameters, transferableObjects) { - const parameters = PrimitivePipeline.unpackCombineGeometryParameters( - packedParameters - ); + const parameters = + PrimitivePipeline.unpackCombineGeometryParameters(packedParameters); const results = PrimitivePipeline.combineGeometry(parameters); return PrimitivePipeline.packCombineGeometryResults( results, - transferableObjects + transferableObjects, ); } export default createTaskProcessorWorker(combineGeometry); diff --git a/packages/engine/Source/Workers/createCircleGeometry.js b/packages/engine/Source/Workers/createCircleGeometry.js index 63c6e18b8e4a..be9f4796a31e 100644 --- a/packages/engine/Source/Workers/createCircleGeometry.js +++ b/packages/engine/Source/Workers/createCircleGeometry.js @@ -8,10 +8,10 @@ function createCircleGeometry(circleGeometry, offset) { circleGeometry = CircleGeometry.unpack(circleGeometry, offset); } circleGeometry._ellipseGeometry._center = Cartesian3.clone( - circleGeometry._ellipseGeometry._center + circleGeometry._ellipseGeometry._center, ); circleGeometry._ellipseGeometry._ellipsoid = Ellipsoid.clone( - circleGeometry._ellipseGeometry._ellipsoid + circleGeometry._ellipseGeometry._ellipsoid, ); return CircleGeometry.createGeometry(circleGeometry); } diff --git a/packages/engine/Source/Workers/createCircleOutlineGeometry.js b/packages/engine/Source/Workers/createCircleOutlineGeometry.js index cb31541d49fd..e0522dd0c114 100644 --- a/packages/engine/Source/Workers/createCircleOutlineGeometry.js +++ b/packages/engine/Source/Workers/createCircleOutlineGeometry.js @@ -8,10 +8,10 @@ function createCircleOutlineGeometry(circleGeometry, offset) { circleGeometry = CircleOutlineGeometry.unpack(circleGeometry, offset); } circleGeometry._ellipseGeometry._center = Cartesian3.clone( - circleGeometry._ellipseGeometry._center + circleGeometry._ellipseGeometry._center, ); circleGeometry._ellipseGeometry._ellipsoid = Ellipsoid.clone( - circleGeometry._ellipseGeometry._ellipsoid + circleGeometry._ellipseGeometry._ellipsoid, ); return CircleOutlineGeometry.createGeometry(circleGeometry); } diff --git a/packages/engine/Source/Workers/createCoplanarPolygonOutlineGeometry.js b/packages/engine/Source/Workers/createCoplanarPolygonOutlineGeometry.js index 11c13093b367..d60c1658397f 100644 --- a/packages/engine/Source/Workers/createCoplanarPolygonOutlineGeometry.js +++ b/packages/engine/Source/Workers/createCoplanarPolygonOutlineGeometry.js @@ -6,7 +6,7 @@ function createCoplanarPolygonOutlineGeometry(polygonGeometry, offset) { if (defined(offset)) { polygonGeometry = CoplanarPolygonOutlineGeometry.unpack( polygonGeometry, - offset + offset, ); } polygonGeometry._ellipsoid = Ellipsoid.clone(polygonGeometry._ellipsoid); diff --git a/packages/engine/Source/Workers/createCorridorOutlineGeometry.js b/packages/engine/Source/Workers/createCorridorOutlineGeometry.js index d5a13d71c009..1967a82d1b7a 100644 --- a/packages/engine/Source/Workers/createCorridorOutlineGeometry.js +++ b/packages/engine/Source/Workers/createCorridorOutlineGeometry.js @@ -6,11 +6,11 @@ function createCorridorOutlineGeometry(corridorOutlineGeometry, offset) { if (defined(offset)) { corridorOutlineGeometry = CorridorOutlineGeometry.unpack( corridorOutlineGeometry, - offset + offset, ); } corridorOutlineGeometry._ellipsoid = Ellipsoid.clone( - corridorOutlineGeometry._ellipsoid + corridorOutlineGeometry._ellipsoid, ); return CorridorOutlineGeometry.createGeometry(corridorOutlineGeometry); } diff --git a/packages/engine/Source/Workers/createEllipsoidOutlineGeometry.js b/packages/engine/Source/Workers/createEllipsoidOutlineGeometry.js index f01eb9178541..d56e6c225087 100644 --- a/packages/engine/Source/Workers/createEllipsoidOutlineGeometry.js +++ b/packages/engine/Source/Workers/createEllipsoidOutlineGeometry.js @@ -5,7 +5,7 @@ function createEllipsoidOutlineGeometry(ellipsoidGeometry, offset) { if (defined(ellipsoidGeometry.buffer, offset)) { ellipsoidGeometry = EllipsoidOutlineGeometry.unpack( ellipsoidGeometry, - offset + offset, ); } return EllipsoidOutlineGeometry.createGeometry(ellipsoidGeometry); diff --git a/packages/engine/Source/Workers/createGeometry.js b/packages/engine/Source/Workers/createGeometry.js index 7e31d04505b2..e0a458a5a0cf 100644 --- a/packages/engine/Source/Workers/createGeometry.js +++ b/packages/engine/Source/Workers/createGeometry.js @@ -60,10 +60,9 @@ async function createGeometry(parameters, transferableObjects) { } if (defined(moduleName) || defined(modulePath)) { - resultsOrPromises[i] = getModule( - moduleName, - modulePath - ).then((createFunction) => createFunction(geometry, task.offset)); + resultsOrPromises[i] = getModule(moduleName, modulePath).then( + (createFunction) => createFunction(geometry, task.offset), + ); } else { // Already created geometry resultsOrPromises[i] = geometry; @@ -73,7 +72,7 @@ async function createGeometry(parameters, transferableObjects) { return Promise.all(resultsOrPromises).then(function (results) { return PrimitivePipeline.packCreateGeometryResults( results, - transferableObjects + transferableObjects, ); }); } diff --git a/packages/engine/Source/Workers/createGroundPolylineGeometry.js b/packages/engine/Source/Workers/createGroundPolylineGeometry.js index 78705ce7c8ad..3884975ce10b 100644 --- a/packages/engine/Source/Workers/createGroundPolylineGeometry.js +++ b/packages/engine/Source/Workers/createGroundPolylineGeometry.js @@ -7,7 +7,7 @@ function createGroundPolylineGeometry(groundPolylineGeometry, offset) { if (defined(offset)) { groundPolylineGeometry = GroundPolylineGeometry.unpack( groundPolylineGeometry, - offset + offset, ); } return GroundPolylineGeometry.createGeometry(groundPolylineGeometry); diff --git a/packages/engine/Source/Workers/createPolylineVolumeGeometry.js b/packages/engine/Source/Workers/createPolylineVolumeGeometry.js index e537225ca3b1..804dde7d4c30 100644 --- a/packages/engine/Source/Workers/createPolylineVolumeGeometry.js +++ b/packages/engine/Source/Workers/createPolylineVolumeGeometry.js @@ -6,11 +6,11 @@ function createPolylineVolumeGeometry(polylineVolumeGeometry, offset) { if (defined(offset)) { polylineVolumeGeometry = PolylineVolumeGeometry.unpack( polylineVolumeGeometry, - offset + offset, ); } polylineVolumeGeometry._ellipsoid = Ellipsoid.clone( - polylineVolumeGeometry._ellipsoid + polylineVolumeGeometry._ellipsoid, ); return PolylineVolumeGeometry.createGeometry(polylineVolumeGeometry); } diff --git a/packages/engine/Source/Workers/createPolylineVolumeOutlineGeometry.js b/packages/engine/Source/Workers/createPolylineVolumeOutlineGeometry.js index e701a1b397a3..f69ade704988 100644 --- a/packages/engine/Source/Workers/createPolylineVolumeOutlineGeometry.js +++ b/packages/engine/Source/Workers/createPolylineVolumeOutlineGeometry.js @@ -4,19 +4,19 @@ import PolylineVolumeOutlineGeometry from "../Core/PolylineVolumeOutlineGeometry function createPolylineVolumeOutlineGeometry( polylineVolumeOutlineGeometry, - offset + offset, ) { if (defined(offset)) { polylineVolumeOutlineGeometry = PolylineVolumeOutlineGeometry.unpack( polylineVolumeOutlineGeometry, - offset + offset, ); } polylineVolumeOutlineGeometry._ellipsoid = Ellipsoid.clone( - polylineVolumeOutlineGeometry._ellipsoid + polylineVolumeOutlineGeometry._ellipsoid, ); return PolylineVolumeOutlineGeometry.createGeometry( - polylineVolumeOutlineGeometry + polylineVolumeOutlineGeometry, ); } export default createPolylineVolumeOutlineGeometry; diff --git a/packages/engine/Source/Workers/createRectangleOutlineGeometry.js b/packages/engine/Source/Workers/createRectangleOutlineGeometry.js index 80a0ed6e6ef7..269fae5dc3af 100644 --- a/packages/engine/Source/Workers/createRectangleOutlineGeometry.js +++ b/packages/engine/Source/Workers/createRectangleOutlineGeometry.js @@ -7,7 +7,7 @@ function createRectangleOutlineGeometry(rectangleGeometry, offset) { if (defined(offset)) { rectangleGeometry = RectangleOutlineGeometry.unpack( rectangleGeometry, - offset + offset, ); } rectangleGeometry._ellipsoid = Ellipsoid.clone(rectangleGeometry._ellipsoid); diff --git a/packages/engine/Source/Workers/createSimplePolylineGeometry.js b/packages/engine/Source/Workers/createSimplePolylineGeometry.js index dabd1f3f698f..bd77fa8fac90 100644 --- a/packages/engine/Source/Workers/createSimplePolylineGeometry.js +++ b/packages/engine/Source/Workers/createSimplePolylineGeometry.js @@ -6,11 +6,11 @@ function createSimplePolylineGeometry(simplePolylineGeometry, offset) { if (defined(offset)) { simplePolylineGeometry = SimplePolylineGeometry.unpack( simplePolylineGeometry, - offset + offset, ); } simplePolylineGeometry._ellipsoid = Ellipsoid.clone( - simplePolylineGeometry._ellipsoid + simplePolylineGeometry._ellipsoid, ); return SimplePolylineGeometry.createGeometry(simplePolylineGeometry); } diff --git a/packages/engine/Source/Workers/createTaskProcessorWorker.js b/packages/engine/Source/Workers/createTaskProcessorWorker.js index deffad5ab06e..479538d69643 100644 --- a/packages/engine/Source/Workers/createTaskProcessorWorker.js +++ b/packages/engine/Source/Workers/createTaskProcessorWorker.js @@ -62,7 +62,7 @@ function createTaskProcessorWorker(workerFunction) { // error that we can be sure will be cloneable responseMessage.result = undefined; responseMessage.error = `postMessage failed with error: ${formatError( - error + error, )}\n with responseMessage: ${JSON.stringify(responseMessage)}`; postMessage(responseMessage); } diff --git a/packages/engine/Source/Workers/createVectorTileClampedPolylines.js b/packages/engine/Source/Workers/createVectorTileClampedPolylines.js index 67887ed30989..2a00b1bb71cd 100644 --- a/packages/engine/Source/Workers/createVectorTileClampedPolylines.js +++ b/packages/engine/Source/Workers/createVectorTileClampedPolylines.js @@ -21,7 +21,7 @@ function decodePositions( rectangle, minimumHeight, maximumHeight, - ellipsoid + ellipsoid, ) { const positionsLength = uBuffer.length; const decodedPositions = new Float64Array(positionsLength * 3); @@ -34,7 +34,7 @@ function decodePositions( const lat = CesiumMath.lerp( rectangle.south, rectangle.north, - v / MAX_SHORT + v / MAX_SHORT, ); const alt = CesiumMath.lerp(minimumHeight, maximumHeight, h / MAX_SHORT); @@ -42,11 +42,11 @@ function decodePositions( lon, lat, alt, - scratchBVCartographic + scratchBVCartographic, ); const decodedPosition = ellipsoid.cartographicToCartesian( cartographic, - scratchEncodedPosition + scratchEncodedPosition, ); Cartesian3.pack(decodedPosition, decodedPositions, i * 3); } @@ -134,17 +134,17 @@ function computeMiteredNormal( position, nextPosition, ellipsoidSurfaceNormal, - result + result, ) { const towardNext = Cartesian3.subtract( nextPosition, position, - towardNextScratch + towardNextScratch, ); let towardCurr = Cartesian3.subtract( position, previousPosition, - towardCurrScratch + towardCurrScratch, ); Cartesian3.normalize(towardNext, towardNext); Cartesian3.normalize(towardCurr, towardCurr); @@ -153,7 +153,7 @@ function computeMiteredNormal( towardCurr = Cartesian3.multiplyByScalar( towardCurr, -1.0, - towardCurrScratch + towardCurrScratch, ); } @@ -233,17 +233,17 @@ VertexAttributesAndIndices.prototype.addVolume = function ( halfWidth, batchId, center, - ellipsoid + ellipsoid, ) { let position = Cartesian3.add(startRTC, center, positionScratch); const startEllipsoidNormal = ellipsoid.geodeticSurfaceNormal( position, - scratchStartEllipsoidNormal + scratchStartEllipsoidNormal, ); position = Cartesian3.add(endRTC, center, positionScratch); const endEllipsoidNormal = ellipsoid.geodeticSurfaceNormal( position, - scratchEndEllipsoidNormal + scratchEndEllipsoidNormal, ); const startFaceNormal = computeMiteredNormal( @@ -251,21 +251,21 @@ VertexAttributesAndIndices.prototype.addVolume = function ( startRTC, endRTC, startEllipsoidNormal, - scratchStartFaceNormal + scratchStartFaceNormal, ); const endFaceNormal = computeMiteredNormal( postEndRTC, endRTC, startRTC, endEllipsoidNormal, - scratchEndFaceNormal + scratchEndFaceNormal, ); const startEllipsoidNormals = this.startEllipsoidNormals; const endEllipsoidNormals = this.endEllipsoidNormals; const startPositionAndHeights = this.startPositionAndHeights; - const startFaceNormalAndVertexCornerIds = this - .startFaceNormalAndVertexCornerIds; + const startFaceNormalAndVertexCornerIds = + this.startFaceNormalAndVertexCornerIds; const endPositionAndHeights = this.endPositionAndHeights; const endFaceNormalAndHalfWidths = this.endFaceNormalAndHalfWidths; const vertexBatchIds = this.vertexBatchIds; @@ -288,7 +288,7 @@ VertexAttributesAndIndices.prototype.addVolume = function ( Cartesian3.pack( startFaceNormal, startFaceNormalAndVertexCornerIds, - vec4Offset + vec4Offset, ); startFaceNormalAndVertexCornerIds[vec4Offset + 3] = i; @@ -355,11 +355,11 @@ function createVectorTileClampedPolylines(parameters, transferableObjects) { const uBuffer = encodedPositions.subarray(0, positionsLength); const vBuffer = encodedPositions.subarray( positionsLength, - 2 * positionsLength + 2 * positionsLength, ); const heightBuffer = encodedPositions.subarray( 2 * positionsLength, - 3 * positionsLength + 3 * positionsLength, ); AttributeCompression.zigZagDeltaDecode(uBuffer, vBuffer, heightBuffer); @@ -383,7 +383,7 @@ function createVectorTileClampedPolylines(parameters, transferableObjects) { minimumHeight, maximumHeight, ellipsoid, - center + center, ); positionsLength = uBuffer.length; @@ -405,12 +405,12 @@ function createVectorTileClampedPolylines(parameters, transferableObjects) { const volumeStart = Cartesian3.unpack( positionsRTC, currentPositionIndex, - scratchP0 + scratchP0, ); const volumeEnd = Cartesian3.unpack( positionsRTC, currentPositionIndex + 3, - scratchP1 + scratchP1, ); let startHeight = heightBuffer[currentHeightIndex]; @@ -418,12 +418,12 @@ function createVectorTileClampedPolylines(parameters, transferableObjects) { startHeight = CesiumMath.lerp( minimumHeight, maximumHeight, - startHeight / MAX_SHORT + startHeight / MAX_SHORT, ); endHeight = CesiumMath.lerp( minimumHeight, maximumHeight, - endHeight / MAX_SHORT + endHeight / MAX_SHORT, ); currentHeightIndex++; @@ -437,7 +437,7 @@ function createVectorTileClampedPolylines(parameters, transferableObjects) { const finalPosition = Cartesian3.unpack( positionsRTC, finalPositionIndex, - scratchPrev + scratchPrev, ); if (Cartesian3.equals(finalPosition, volumeStart)) { Cartesian3.unpack(positionsRTC, finalPositionIndex - 3, preStart); @@ -445,7 +445,7 @@ function createVectorTileClampedPolylines(parameters, transferableObjects) { const offsetPastStart = Cartesian3.subtract( volumeStart, volumeEnd, - scratchPrev + scratchPrev, ); preStart = Cartesian3.add(offsetPastStart, volumeStart, scratchPrev); } @@ -458,19 +458,19 @@ function createVectorTileClampedPolylines(parameters, transferableObjects) { const firstPosition = Cartesian3.unpack( positionsRTC, volumeFirstPositionIndex, - scratchNext + scratchNext, ); if (Cartesian3.equals(firstPosition, volumeEnd)) { Cartesian3.unpack( positionsRTC, volumeFirstPositionIndex + 3, - postEnd + postEnd, ); } else { const offsetPastEnd = Cartesian3.subtract( volumeEnd, volumeStart, - scratchNext + scratchNext, ); postEnd = Cartesian3.add(offsetPastEnd, volumeEnd, scratchNext); } @@ -488,7 +488,7 @@ function createVectorTileClampedPolylines(parameters, transferableObjects) { halfWidth, batchId, center, - ellipsoid + ellipsoid, ); currentPositionIndex += 3; @@ -503,7 +503,7 @@ function createVectorTileClampedPolylines(parameters, transferableObjects) { transferableObjects.push(attribsAndIndices.endEllipsoidNormals.buffer); transferableObjects.push(attribsAndIndices.startPositionAndHeights.buffer); transferableObjects.push( - attribsAndIndices.startFaceNormalAndVertexCornerIds.buffer + attribsAndIndices.startFaceNormalAndVertexCornerIds.buffer, ); transferableObjects.push(attribsAndIndices.endPositionAndHeights.buffer); transferableObjects.push(attribsAndIndices.endFaceNormalAndHalfWidths.buffer); diff --git a/packages/engine/Source/Workers/createVectorTileGeometries.js b/packages/engine/Source/Workers/createVectorTileGeometries.js index bdb4218c4d82..417019747147 100644 --- a/packages/engine/Source/Workers/createVectorTileGeometries.js +++ b/packages/engine/Source/Workers/createVectorTileGeometries.js @@ -31,7 +31,7 @@ function boxModelMatrixAndBoundingVolume(boxes, index) { const boxModelMatrix = Matrix4.unpack( boxes, boxIndex, - scratchModelMatrixAndBV.modelMatrix + scratchModelMatrixAndBV.modelMatrix, ); Matrix4.multiplyByScale(boxModelMatrix, dimensions, boxModelMatrix); @@ -51,13 +51,13 @@ function cylinderModelMatrixAndBoundingVolume(cylinders, index) { cylinderRadius, cylinderRadius, length, - scratchCartesian + scratchCartesian, ); const cylinderModelMatrix = Matrix4.unpack( cylinders, cylinderIndex, - scratchModelMatrixAndBV.modelMatrix + scratchModelMatrixAndBV.modelMatrix, ); Matrix4.multiplyByScale(cylinderModelMatrix, scale, cylinderModelMatrix); @@ -77,7 +77,7 @@ function ellipsoidModelMatrixAndBoundingVolume(ellipsoids, index) { const ellipsoidModelMatrix = Matrix4.unpack( ellipsoids, ellipsoidIndex, - scratchModelMatrixAndBV.modelMatrix + scratchModelMatrixAndBV.modelMatrix, ); Matrix4.multiplyByScale(ellipsoidModelMatrix, radii, ellipsoidModelMatrix); @@ -96,16 +96,16 @@ function sphereModelMatrixAndBoundingVolume(spheres, index) { const sphereTranslation = Cartesian3.unpack( spheres, sphereIndex, - scratchCartesian + scratchCartesian, ); const sphereModelMatrix = Matrix4.fromTranslation( sphereTranslation, - scratchModelMatrixAndBV.modelMatrix + scratchModelMatrixAndBV.modelMatrix, ); Matrix4.multiplyByUniformScale( sphereModelMatrix, sphereRadius, - sphereModelMatrix + sphereModelMatrix, ); const boundingVolume = scratchModelMatrixAndBV.boundingVolume; @@ -122,7 +122,7 @@ function createPrimitive( primitive, primitiveBatchIds, geometry, - getModelMatrixAndBoundingVolume + getModelMatrixAndBoundingVolume, ) { if (!defined(primitive)) { return; @@ -154,7 +154,7 @@ function createPrimitive( for (let i = 0; i < numberOfPrimitives; ++i) { const primitiveModelMatrixAndBV = getModelMatrixAndBoundingVolume( primitive, - i + i, ); const primitiveModelMatrix = primitiveModelMatrixAndBV.modelMatrix; Matrix4.multiply(modelMatrix, primitiveModelMatrix, primitiveModelMatrix); @@ -188,7 +188,7 @@ function createPrimitive( indexCounts[offset] = indicesLength; boundingVolumes[offset] = BoundingSphere.transform( primitiveModelMatrixAndBV.boundingVolume, - primitiveModelMatrix + primitiveModelMatrix, ); positionOffset += positionsLength / 3; @@ -324,7 +324,7 @@ function createVectorTileGeometries(parameters, transferableObjects) { const vertexBatchIds = new Uint16Array(numberOfPositions / 3); const indices = IndexDatatype.createTypedArray( numberOfPositions / 3, - numberOfIndices + numberOfIndices, ); const numberOfGeometries = @@ -360,44 +360,44 @@ function createVectorTileGeometries(parameters, transferableObjects) { boxes, boxBatchIds, boxGeometry, - boxModelMatrixAndBoundingVolume + boxModelMatrixAndBoundingVolume, ); createPrimitive( options, cylinders, cylinderBatchIds, cylinderGeometry, - cylinderModelMatrixAndBoundingVolume + cylinderModelMatrixAndBoundingVolume, ); createPrimitive( options, ellipsoids, ellipsoidBatchIds, ellipsoidGeometry, - ellipsoidModelMatrixAndBoundingVolume + ellipsoidModelMatrixAndBoundingVolume, ); createPrimitive( options, spheres, sphereBatchIds, ellipsoidGeometry, - sphereModelMatrixAndBoundingVolume + sphereModelMatrixAndBoundingVolume, ); const packedBuffer = packBuffer( indices.BYTES_PER_ELEMENT, batchedIndices, - boundingVolumes + boundingVolumes, ); transferableObjects.push( positions.buffer, vertexBatchIds.buffer, - indices.buffer + indices.buffer, ); transferableObjects.push( batchIds.buffer, indexOffsets.buffer, - indexCounts.buffer + indexCounts.buffer, ); transferableObjects.push(packedBuffer.buffer); diff --git a/packages/engine/Source/Workers/createVectorTilePoints.js b/packages/engine/Source/Workers/createVectorTilePoints.js index 217d979408bc..6b7289a8ee43 100644 --- a/packages/engine/Source/Workers/createVectorTilePoints.js +++ b/packages/engine/Source/Workers/createVectorTilePoints.js @@ -45,7 +45,7 @@ function createVectorTilePoints(parameters, transferableObjects) { const vBuffer = positions.subarray(positionsLength, 2 * positionsLength); const heightBuffer = positions.subarray( 2 * positionsLength, - 3 * positionsLength + 3 * positionsLength, ); AttributeCompression.zigZagDeltaDecode(uBuffer, vBuffer, heightBuffer); @@ -63,11 +63,11 @@ function createVectorTilePoints(parameters, transferableObjects) { lon, lat, alt, - scratchBVCartographic + scratchBVCartographic, ); const decodedPosition = ellipsoid.cartographicToCartesian( cartographic, - scratchEncodedPosition + scratchEncodedPosition, ); Cartesian3.pack(decodedPosition, decoded, i * 3); } diff --git a/packages/engine/Source/Workers/createVectorTilePolygons.js b/packages/engine/Source/Workers/createVectorTilePolygons.js index 3770581d3557..9c64ca79791b 100644 --- a/packages/engine/Source/Workers/createVectorTilePolygons.js +++ b/packages/engine/Source/Workers/createVectorTilePolygons.js @@ -152,7 +152,7 @@ function createVectorTilePolygons(parameters, transferableObjects) { const cart = Cartographic.fromRadians(x, y, 0.0, scratchBVCartographic); const decodedPosition = ellipsoid.cartographicToCartesian( cart, - scratchEncodedPosition + scratchEncodedPosition, ); Cartesian3.pack(decodedPosition, decodedPositions, i * 3); } @@ -257,13 +257,13 @@ function createVectorTilePolygons(parameters, transferableObjects) { const position = Cartesian3.unpack( decodedPositions, polygonOffset * 3 + j * 3, - scratchEncodedPosition + scratchEncodedPosition, ); ellipsoid.scaleToGeodeticSurface(position, position); const carto = ellipsoid.cartesianToCartographic( position, - scratchBVCartographic + scratchBVCartographic, ); const lat = carto.latitude; const lon = carto.longitude; @@ -277,23 +277,23 @@ function createVectorTilePolygons(parameters, transferableObjects) { let scaledNormal = Cartesian3.multiplyByScalar( normal, polygonMinimumHeight, - scratchScaledNormal + scratchScaledNormal, ); const minHeightPosition = Cartesian3.add( position, scaledNormal, - scratchMinHeightPosition + scratchMinHeightPosition, ); scaledNormal = Cartesian3.multiplyByScalar( normal, polygonMaximumHeight, - scaledNormal + scaledNormal, ); const maxHeightPosition = Cartesian3.add( position, scaledNormal, - scratchMaxHeightPosition + scratchMaxHeightPosition, ); Cartesian3.subtract(maxHeightPosition, center, maxHeightPosition); @@ -319,7 +319,7 @@ function createVectorTilePolygons(parameters, transferableObjects) { rectangle, minHeight, maxHeight, - ellipsoid + ellipsoid, ); let indicesIndex = buffer.indexOffset; @@ -367,7 +367,7 @@ function createVectorTilePolygons(parameters, transferableObjects) { batchedIndices = IndexDatatype.createTypedArray( batchedPositions.length / 3, - batchedIndices + batchedIndices, ); const batchedIndicesLength = batchedDrawCalls.length; @@ -388,7 +388,7 @@ function createVectorTilePolygons(parameters, transferableObjects) { const packedBuffer = packBuffer( indexDatatype, boundingVolumes, - batchedDrawCalls + batchedDrawCalls, ); transferableObjects.push( @@ -397,7 +397,7 @@ function createVectorTilePolygons(parameters, transferableObjects) { batchedIndexOffsets.buffer, batchedIndexCounts.buffer, batchedIds.buffer, - packedBuffer.buffer + packedBuffer.buffer, ); return { diff --git a/packages/engine/Source/Workers/createVectorTilePolylines.js b/packages/engine/Source/Workers/createVectorTilePolylines.js index 1002ce25a62f..967e431b9352 100644 --- a/packages/engine/Source/Workers/createVectorTilePolylines.js +++ b/packages/engine/Source/Workers/createVectorTilePolylines.js @@ -66,7 +66,7 @@ function createVectorTilePolylines(parameters, transferableObjects) { rectangle, minimumHeight, maximumHeight, - ellipsoid + ellipsoid, ); const positionsLength = positions.length / 3; @@ -103,14 +103,14 @@ function createVectorTilePolylines(parameters, transferableObjects) { previous = Cartesian3.unpack( positions, (offset + j - 1) * 3, - scratchPrev + scratchPrev, ); } const current = Cartesian3.unpack( positions, (offset + j) * 3, - scratchCur + scratchCur, ); let next; @@ -118,12 +118,12 @@ function createVectorTilePolylines(parameters, transferableObjects) { const p2 = Cartesian3.unpack( positions, (offset + count - 1) * 3, - scratchP0 + scratchP0, ); const p3 = Cartesian3.unpack( positions, (offset + count - 2) * 3, - scratchP1 + scratchP1, ); next = Cartesian3.subtract(p2, p3, scratchNext); @@ -175,12 +175,12 @@ function createVectorTilePolylines(parameters, transferableObjects) { transferableObjects.push( curPositions.buffer, prevPositions.buffer, - nextPositions.buffer + nextPositions.buffer, ); transferableObjects.push( expandAndWidth.buffer, vertexBatchIds.buffer, - indices.buffer + indices.buffer, ); let results = { diff --git a/packages/engine/Source/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js b/packages/engine/Source/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js index 7d41bcb9438c..fbffcb40ba47 100644 --- a/packages/engine/Source/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +++ b/packages/engine/Source/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js @@ -37,7 +37,7 @@ function indexOfEpsilon(arr, elem, elemType) { function createVerticesFromGoogleEarthEnterpriseBuffer( parameters, - transferableObjects + transferableObjects, ) { parameters.ellipsoid = Ellipsoid.clone(parameters.ellipsoid); parameters.rectangle = Rectangle.clone(parameters.rectangle); @@ -53,7 +53,7 @@ function createVerticesFromGoogleEarthEnterpriseBuffer( parameters.skirtHeight, parameters.includeWebMercatorT, parameters.negativeAltitudeExponentBias, - parameters.negativeElevationThreshold + parameters.negativeElevationThreshold, ); const vertices = statistics.vertices; transferableObjects.push(vertices.buffer); @@ -96,7 +96,7 @@ function processBuffer( skirtHeight, includeWebMercatorT, negativeAltitudeExponentBias, - negativeElevationThreshold + negativeElevationThreshold, ) { let geographicWest; let geographicSouth; @@ -126,16 +126,15 @@ function processBuffer( const fromENU = Transforms.eastNorthUpToFixedFrame( relativeToCenter, - ellipsoid + ellipsoid, ); const toENU = Matrix4.inverseTransformation(fromENU, matrix4Scratch); let southMercatorY; let oneOverMercatorHeight; if (includeWebMercatorT) { - southMercatorY = WebMercatorProjection.geodeticLatitudeToMercatorAngle( - geographicSouth - ); + southMercatorY = + WebMercatorProjection.geodeticLatitudeToMercatorAngle(geographicSouth); oneOverMercatorHeight = 1.0 / (WebMercatorProjection.geodeticLatitudeToMercatorAngle(geographicNorth) - @@ -279,7 +278,7 @@ function processBuffer( const index = indexOfEpsilon( quadBorderPoints, scratchCartographic, - Cartographic + Cartographic, ); if (index === -1) { quadBorderPoints.push(Cartographic.clone(scratchCartographic)); @@ -409,7 +408,7 @@ function processBuffer( westBorder, -percentage * rectangleWidth, true, - -percentage * rectangleHeight + -percentage * rectangleHeight, ); addSkirt( positions, @@ -421,7 +420,7 @@ function processBuffer( skirtOptions, southBorder, -percentage * rectangleHeight, - false + false, ); addSkirt( positions, @@ -434,7 +433,7 @@ function processBuffer( eastBorder, percentage * rectangleWidth, true, - percentage * rectangleHeight + percentage * rectangleHeight, ); addSkirt( positions, @@ -446,7 +445,7 @@ function processBuffer( skirtOptions, northBorder, percentage * rectangleHeight, - false + false, ); // Since the corner between the north and west sides is in the west array, generate the last @@ -463,7 +462,7 @@ function processBuffer( firstSkirtIndex, firstSkirtIndex, firstBorderIndex, - lastBorderIndex + lastBorderIndex, ); } @@ -476,16 +475,17 @@ function processBuffer( rectangle, minHeight, maxHeight, - ellipsoid + ellipsoid, ); } const occluder = new EllipsoidalOccluder(ellipsoid); - const occludeePointInScaledSpace = occluder.computeHorizonCullingPointPossiblyUnderEllipsoid( - relativeToCenter, - positions, - minHeight - ); + const occludeePointInScaledSpace = + occluder.computeHorizonCullingPointPossiblyUnderEllipsoid( + relativeToCenter, + positions, + minHeight, + ); const aaBox = new AxisAlignedBoundingBox(minimum, maximum, relativeToCenter); const encoding = new TerrainEncoding( @@ -498,7 +498,7 @@ function processBuffer( includeWebMercatorT, includeGeodeticSurfaceNormals, exaggeration, - exaggerationRelativeHeight + exaggerationRelativeHeight, ); const vertices = new Float32Array(size * encoding.stride); @@ -512,7 +512,7 @@ function processBuffer( heights[k], undefined, webMercatorTs[k], - geodeticSurfaceNormals[k] + geodeticSurfaceNormals[k], ); } @@ -538,12 +538,12 @@ function processBuffer( .reverse(); southIndicesEastToWest.unshift( - eastIndicesNorthToSouth[eastIndicesNorthToSouth.length - 1] + eastIndicesNorthToSouth[eastIndicesNorthToSouth.length - 1], ); southIndicesEastToWest.push(westIndicesSouthToNorth[0]); northIndicesWestToEast.unshift( - westIndicesSouthToNorth[westIndicesSouthToNorth.length - 1] + westIndicesSouthToNorth[westIndicesSouthToNorth.length - 1], ); northIndicesWestToEast.push(eastIndicesNorthToSouth[0]); @@ -576,7 +576,7 @@ function addSkirt( borderPoints, fudgeFactor, eastOrWest, - cornerFudge + cornerFudge, ) { const count = borderPoints.length; for (let j = 0; j < count; ++j) { @@ -590,7 +590,7 @@ function addSkirt( latitude = CesiumMath.clamp( latitude, -CesiumMath.PI_OVER_TWO, - CesiumMath.PI_OVER_TWO + CesiumMath.PI_OVER_TWO, ); // Don't go over the poles const height = borderCartographic.height - skirtOptions.skirtHeight; skirtOptions.hMin = Math.min(skirtOptions.hMin, height); @@ -612,9 +612,8 @@ function addSkirt( scratchCartographic.latitude -= cornerFudge; } - const pos = skirtOptions.ellipsoid.cartographicToCartesian( - scratchCartographic - ); + const pos = + skirtOptions.ellipsoid.cartographicToCartesian(scratchCartographic); positions.push(pos); heights.push(height); uvs.push(Cartesian2.clone(uvs[borderIndex])); // Copy UVs from border point @@ -641,7 +640,7 @@ function addSkirt( currentIndex, currentIndex, borderIndex, - lastBorderIndex + lastBorderIndex, ); } @@ -649,5 +648,5 @@ function addSkirt( } } export default createTaskProcessorWorker( - createVerticesFromGoogleEarthEnterpriseBuffer + createVerticesFromGoogleEarthEnterpriseBuffer, ); diff --git a/packages/engine/Source/Workers/createVerticesFromQuantizedTerrainMesh.js b/packages/engine/Source/Workers/createVerticesFromQuantizedTerrainMesh.js index 743a62361ebd..feb5eed9b78a 100644 --- a/packages/engine/Source/Workers/createVerticesFromQuantizedTerrainMesh.js +++ b/packages/engine/Source/Workers/createVerticesFromQuantizedTerrainMesh.js @@ -25,7 +25,7 @@ const toPack = new Cartesian2(); function createVerticesFromQuantizedTerrainMesh( parameters, - transferableObjects + transferableObjects, ) { const quantizedVertices = parameters.quantizedVertices; const quantizedVertexCount = quantizedVertices.length / 3; @@ -60,9 +60,8 @@ function createVerticesFromQuantizedTerrainMesh( let southMercatorY; let oneOverMercatorHeight; if (includeWebMercatorT) { - southMercatorY = WebMercatorProjection.geodeticLatitudeToMercatorAngle( - south - ); + southMercatorY = + WebMercatorProjection.geodeticLatitudeToMercatorAngle(south); oneOverMercatorHeight = 1.0 / (WebMercatorProjection.geodeticLatitudeToMercatorAngle(north) - @@ -72,11 +71,11 @@ function createVerticesFromQuantizedTerrainMesh( const uBuffer = quantizedVertices.subarray(0, quantizedVertexCount); const vBuffer = quantizedVertices.subarray( quantizedVertexCount, - 2 * quantizedVertexCount + 2 * quantizedVertexCount, ); const heightBuffer = quantizedVertices.subarray( quantizedVertexCount * 2, - 3 * quantizedVertexCount + 3 * quantizedVertexCount, ); const hasVertexNormals = defined(octEncodedNormals); @@ -114,7 +113,7 @@ function createVerticesFromQuantizedTerrainMesh( const height = CesiumMath.lerp( minimumHeight, maximumHeight, - heightBuffer[i] / maxShort + heightBuffer[i] / maxShort, ); cartographicScratch.longitude = CesiumMath.lerp(west, east, u); @@ -135,7 +134,7 @@ function createVerticesFromQuantizedTerrainMesh( if (includeWebMercatorT) { webMercatorTs[i] = (WebMercatorProjection.geodeticLatitudeToMercatorAngle( - cartographicScratch.latitude + cartographicScratch.latitude, ) - southMercatorY) * oneOverMercatorHeight; @@ -151,40 +150,41 @@ function createVerticesFromQuantizedTerrainMesh( Cartesian3.maximumByComponent(cartesian3Scratch, maximum, maximum); } - const westIndicesSouthToNorth = copyAndSort(parameters.westIndices, function ( - a, - b - ) { - return uvs[a].y - uvs[b].y; - }); - const eastIndicesNorthToSouth = copyAndSort(parameters.eastIndices, function ( - a, - b - ) { - return uvs[b].y - uvs[a].y; - }); - const southIndicesEastToWest = copyAndSort(parameters.southIndices, function ( - a, - b - ) { - return uvs[b].x - uvs[a].x; - }); - const northIndicesWestToEast = copyAndSort(parameters.northIndices, function ( - a, - b - ) { - return uvs[a].x - uvs[b].x; - }); + const westIndicesSouthToNorth = copyAndSort( + parameters.westIndices, + function (a, b) { + return uvs[a].y - uvs[b].y; + }, + ); + const eastIndicesNorthToSouth = copyAndSort( + parameters.eastIndices, + function (a, b) { + return uvs[b].y - uvs[a].y; + }, + ); + const southIndicesEastToWest = copyAndSort( + parameters.southIndices, + function (a, b) { + return uvs[b].x - uvs[a].x; + }, + ); + const northIndicesWestToEast = copyAndSort( + parameters.northIndices, + function (a, b) { + return uvs[a].x - uvs[b].x; + }, + ); let occludeePointInScaledSpace; if (minimumHeight < 0.0) { // Horizon culling point needs to be recomputed since the tile is at least partly under the ellipsoid. const occluder = new EllipsoidalOccluder(ellipsoid); - occludeePointInScaledSpace = occluder.computeHorizonCullingPointPossiblyUnderEllipsoid( - center, - positions, - minimumHeight - ); + occludeePointInScaledSpace = + occluder.computeHorizonCullingPointPossiblyUnderEllipsoid( + center, + positions, + minimumHeight, + ); } let hMin = minimumHeight; @@ -199,8 +199,8 @@ function createVerticesFromQuantizedTerrainMesh( ellipsoid, toENU, minimum, - maximum - ) + maximum, + ), ); hMin = Math.min( hMin, @@ -213,8 +213,8 @@ function createVerticesFromQuantizedTerrainMesh( ellipsoid, toENU, minimum, - maximum - ) + maximum, + ), ); hMin = Math.min( hMin, @@ -227,8 +227,8 @@ function createVerticesFromQuantizedTerrainMesh( ellipsoid, toENU, minimum, - maximum - ) + maximum, + ), ); hMin = Math.min( hMin, @@ -241,8 +241,8 @@ function createVerticesFromQuantizedTerrainMesh( ellipsoid, toENU, minimum, - maximum - ) + maximum, + ), ); const aaBox = new AxisAlignedBoundingBox(minimum, maximum, center); @@ -256,7 +256,7 @@ function createVerticesFromQuantizedTerrainMesh( includeWebMercatorT, includeGeodeticSurfaceNormals, exaggeration, - exaggerationRelativeHeight + exaggerationRelativeHeight, ); const vertexStride = encoding.stride; const size = @@ -279,7 +279,7 @@ function createVerticesFromQuantizedTerrainMesh( heights[j], toPack, webMercatorTs[j], - geodeticSurfaceNormals[j] + geodeticSurfaceNormals[j], ); } @@ -287,7 +287,7 @@ function createVerticesFromQuantizedTerrainMesh( const indexBufferLength = parameters.indices.length + edgeTriangleCount * 3; const indexBuffer = IndexDatatype.createTypedArray( quantizedVertexCount + edgeVertexCount, - indexBufferLength + indexBufferLength, ); indexBuffer.set(parameters.indices, 0); @@ -319,7 +319,7 @@ function createVerticesFromQuantizedTerrainMesh( southMercatorY, oneOverMercatorHeight, westLongitudeOffset, - westLatitudeOffset + westLatitudeOffset, ); vertexBufferIndex += parameters.westIndices.length * vertexStride; addSkirt( @@ -336,7 +336,7 @@ function createVerticesFromQuantizedTerrainMesh( southMercatorY, oneOverMercatorHeight, southLongitudeOffset, - southLatitudeOffset + southLatitudeOffset, ); vertexBufferIndex += parameters.southIndices.length * vertexStride; addSkirt( @@ -353,7 +353,7 @@ function createVerticesFromQuantizedTerrainMesh( southMercatorY, oneOverMercatorHeight, eastLongitudeOffset, - eastLatitudeOffset + eastLatitudeOffset, ); vertexBufferIndex += parameters.eastIndices.length * vertexStride; addSkirt( @@ -370,7 +370,7 @@ function createVerticesFromQuantizedTerrainMesh( southMercatorY, oneOverMercatorHeight, northLongitudeOffset, - northLatitudeOffset + northLatitudeOffset, ); TerrainProvider.addSkirtIndices( @@ -380,7 +380,7 @@ function createVerticesFromQuantizedTerrainMesh( northIndicesWestToEast, quantizedVertexCount, indexBuffer, - parameters.indices.length + parameters.indices.length, ); transferableObjects.push(vertexBuffer.buffer, indexBuffer.buffer); @@ -411,7 +411,7 @@ function findMinMaxSkirts( ellipsoid, toENU, minimum, - maximum + maximum, ) { let hMin = Number.POSITIVE_INFINITY; @@ -436,7 +436,7 @@ function findMinMaxSkirts( const position = ellipsoid.cartographicToCartesian( cartographicScratch, - cartesian3Scratch + cartesian3Scratch, ); Matrix4.multiplyByPoint(toENU, position, position); @@ -462,7 +462,7 @@ function addSkirt( southMercatorY, oneOverMercatorHeight, longitudeOffset, - latitudeOffset + latitudeOffset, ) { const hasVertexNormals = defined(octEncodedNormals); @@ -489,7 +489,7 @@ function addSkirt( const position = ellipsoid.cartographicToCartesian( cartographicScratch, - cartesian3Scratch + cartesian3Scratch, ); if (hasVertexNormals) { @@ -502,7 +502,7 @@ function addSkirt( if (encoding.hasWebMercatorT) { webMercatorT = (WebMercatorProjection.geodeticLatitudeToMercatorAngle( - cartographicScratch.latitude + cartographicScratch.latitude, ) - southMercatorY) * oneOverMercatorHeight; @@ -521,7 +521,7 @@ function addSkirt( cartographicScratch.height, toPack, webMercatorT, - geodeticSurfaceNormal + geodeticSurfaceNormal, ); } } @@ -545,5 +545,5 @@ function copyAndSort(typedArray, comparator) { return copy; } export default createTaskProcessorWorker( - createVerticesFromQuantizedTerrainMesh + createVerticesFromQuantizedTerrainMesh, ); diff --git a/packages/engine/Source/Workers/decodeDraco.js b/packages/engine/Source/Workers/decodeDraco.js index 14d5d5b268c7..7b32c1187955 100644 --- a/packages/engine/Source/Workers/decodeDraco.js +++ b/packages/engine/Source/Workers/decodeDraco.js @@ -37,7 +37,7 @@ function decodeQuantizedDracoTypedArray( dracoDecoder, dracoAttribute, quantization, - vertexArrayLength + vertexArrayLength, ) { let vertexArray; let attributeData; @@ -47,7 +47,7 @@ function decodeQuantizedDracoTypedArray( dracoDecoder.GetAttributeUInt8ForAllPoints( dracoGeometry, dracoAttribute, - attributeData + attributeData, ); } else if (quantization.quantizationBits <= 16) { attributeData = new draco.DracoUInt16Array(); @@ -55,7 +55,7 @@ function decodeQuantizedDracoTypedArray( dracoDecoder.GetAttributeUInt16ForAllPoints( dracoGeometry, dracoAttribute, - attributeData + attributeData, ); } else { attributeData = new draco.DracoFloat32Array(); @@ -63,7 +63,7 @@ function decodeQuantizedDracoTypedArray( dracoDecoder.GetAttributeFloatForAllPoints( dracoGeometry, dracoAttribute, - attributeData + attributeData, ); } @@ -79,7 +79,7 @@ function decodeDracoTypedArray( dracoGeometry, dracoDecoder, dracoAttribute, - vertexArrayLength + vertexArrayLength, ) { let vertexArray; let attributeData; @@ -93,7 +93,7 @@ function decodeDracoTypedArray( dracoDecoder.GetAttributeInt8ForAllPoints( dracoGeometry, dracoAttribute, - attributeData + attributeData, ); break; case 2: // DT_UINT8 @@ -102,7 +102,7 @@ function decodeDracoTypedArray( dracoDecoder.GetAttributeUInt8ForAllPoints( dracoGeometry, dracoAttribute, - attributeData + attributeData, ); break; case 3: // DT_INT16 @@ -111,7 +111,7 @@ function decodeDracoTypedArray( dracoDecoder.GetAttributeInt16ForAllPoints( dracoGeometry, dracoAttribute, - attributeData + attributeData, ); break; case 4: // DT_UINT16 @@ -120,7 +120,7 @@ function decodeDracoTypedArray( dracoDecoder.GetAttributeUInt16ForAllPoints( dracoGeometry, dracoAttribute, - attributeData + attributeData, ); break; case 5: @@ -130,7 +130,7 @@ function decodeDracoTypedArray( dracoDecoder.GetAttributeInt32ForAllPoints( dracoGeometry, dracoAttribute, - attributeData + attributeData, ); break; case 6: @@ -140,7 +140,7 @@ function decodeDracoTypedArray( dracoDecoder.GetAttributeUInt32ForAllPoints( dracoGeometry, dracoAttribute, - attributeData + attributeData, ); break; case 9: @@ -150,7 +150,7 @@ function decodeDracoTypedArray( dracoDecoder.GetAttributeFloatForAllPoints( dracoGeometry, dracoAttribute, - attributeData + attributeData, ); break; } @@ -200,14 +200,14 @@ function decodeAttribute(dracoGeometry, dracoDecoder, dracoAttribute) { dracoDecoder, dracoAttribute, quantization, - vertexArrayLength + vertexArrayLength, ); } else { vertexArray = decodeDracoTypedArray( dracoGeometry, dracoDecoder, dracoAttribute, - vertexArrayLength + vertexArrayLength, ); } @@ -246,11 +246,11 @@ function decodePointCloud(parameters) { const dracoPointCloud = new draco.PointCloud(); const decodingStatus = dracoDecoder.DecodeBufferToPointCloud( buffer, - dracoPointCloud + dracoPointCloud, ); if (!decodingStatus.ok() || dracoPointCloud.ptr === 0) { throw new RuntimeError( - `Error decoding draco point cloud: ${decodingStatus.error_msg()}` + `Error decoding draco point cloud: ${decodingStatus.error_msg()}`, ); } @@ -265,23 +265,23 @@ function decodePointCloud(parameters) { if (propertyName === "POSITION" || propertyName === "NORMAL") { const dracoAttributeId = dracoDecoder.GetAttributeId( dracoPointCloud, - draco[propertyName] + draco[propertyName], ); dracoAttribute = dracoDecoder.GetAttribute( dracoPointCloud, - dracoAttributeId + dracoAttributeId, ); } else { const attributeId = properties[propertyName]; dracoAttribute = dracoDecoder.GetAttributeByUniqueId( dracoPointCloud, - attributeId + attributeId, ); } result[propertyName] = decodeAttribute( dracoPointCloud, dracoDecoder, - dracoAttribute + dracoAttribute, ); } } @@ -316,7 +316,7 @@ function decodePrimitive(parameters) { const decodingStatus = dracoDecoder.DecodeBufferToMesh(buffer, dracoGeometry); if (!decodingStatus.ok() || dracoGeometry.ptr === 0) { throw new RuntimeError( - `Error decoding draco mesh geometry: ${decodingStatus.error_msg()}` + `Error decoding draco mesh geometry: ${decodingStatus.error_msg()}`, ); } @@ -330,12 +330,12 @@ function decodePrimitive(parameters) { const compressedAttribute = compressedAttributes[attributeName]; const dracoAttribute = dracoDecoder.GetAttributeByUniqueId( dracoGeometry, - compressedAttribute + compressedAttribute, ); attributeData[attributeName] = decodeAttribute( dracoGeometry, dracoDecoder, - dracoAttribute + dracoAttribute, ); } } diff --git a/packages/engine/Source/Workers/decodeGoogleEarthEnterprisePacket.js b/packages/engine/Source/Workers/decodeGoogleEarthEnterprisePacket.js index 59ad933dbc6e..dff801ef29d2 100644 --- a/packages/engine/Source/Workers/decodeGoogleEarthEnterprisePacket.js +++ b/packages/engine/Source/Workers/decodeGoogleEarthEnterprisePacket.js @@ -69,7 +69,7 @@ function processMetadata(buffer, totalSize, quadKey) { offset += sizeOfUint32; if (quadVersion !== 2) { throw new RuntimeError( - "Invalid QuadTreePacket version. Only version 2 is supported." + "Invalid QuadTreePacket version. Only version 2 is supported.", ); } @@ -143,8 +143,8 @@ function processMetadata(buffer, totalSize, quadKey) { imageVersion, terrainVersion, imageProvider, - terrainProvider - ) + terrainProvider, + ), ); } diff --git a/packages/engine/Source/Workers/decodeI3S.js b/packages/engine/Source/Workers/decodeI3S.js index d81babacbfb4..89c1b130b94d 100644 --- a/packages/engine/Source/Workers/decodeI3S.js +++ b/packages/engine/Source/Workers/decodeI3S.js @@ -62,7 +62,7 @@ function sampleGeoidFromList(lon, lat, geoidDataList) { if (geoidDataList[i].projectionType === "WebMercator") { const radii = geoidDataList[i].projection._ellipsoid._radii; const webMercatorProj = new WebMercatorProjection( - new Ellipsoid(radii.x, radii.y, radii.z) + new Ellipsoid(radii.x, radii.y, radii.z), ); localPt = webMercatorProj.project(new Cartographic(lon, lat, 0)); } else { @@ -90,7 +90,7 @@ function orthometricToEllipsoidal( scale_y, center, geoidDataList, - fast + fast, ) { if (fast) { // Geometry is already relative to the tile origin which has already been shifted to account for geoid height @@ -102,14 +102,14 @@ function orthometricToEllipsoidal( const centerHeight = sampleGeoidFromList( center.longitude, center.latitude, - geoidDataList + geoidDataList, ); for (let i = 0; i < vertexCount; ++i) { const height = sampleGeoidFromList( center.longitude + CesiumMath.toRadians(scale_x * position[i * 3]), center.latitude + CesiumMath.toRadians(scale_y * position[i * 3 + 1]), - geoidDataList + geoidDataList, ); position[i * 3 + 2] += height - centerHeight; } @@ -124,7 +124,7 @@ function transformToLocal( parentRotation, ellipsoidRadiiSquare, scale_x, - scale_y + scale_y, ) { if (vertexCount === 0 || !defined(positions) || positions.length === 0) { return; @@ -133,7 +133,7 @@ function transformToLocal( const ellipsoid = new Ellipsoid( Math.sqrt(ellipsoidRadiiSquare.x), Math.sqrt(ellipsoidRadiiSquare.y), - Math.sqrt(ellipsoidRadiiSquare.z) + Math.sqrt(ellipsoidRadiiSquare.z), ); for (let i = 0; i < vertexCount; ++i) { const indexOffset = i * 3; @@ -168,7 +168,7 @@ function transformToLocal( const normal = new Cartesian3( normals[indexOffset], normals[indexOffset1], - normals[indexOffset2] + normals[indexOffset2], ); const rotatedNormal = {}; @@ -203,7 +203,7 @@ function generateIndexArray( vertexCount, indices, colors, - splitGeometryByColorTransparency + splitGeometryByColorTransparency, ) { // Allocate array const indexArray = new Uint32Array(vertexCount); @@ -276,7 +276,7 @@ function getFeatureHash(symbologyData, outlinesHash, featureIndex) { }); const featureSymbology = defaultValue( symbologyData[featureIndex], - symbologyData.default + symbologyData.default, ); newFeatureHash.hasOutline = defined(featureSymbology?.edges); return newFeatureHash; @@ -306,7 +306,7 @@ function addEdgeToHash( vertexBIndex, vertexAIndexUnique, vertexBIndexUnique, - normalIndex + normalIndex, ) { let startVertexIndex; let endVertexIndex; @@ -342,7 +342,7 @@ function generateOutlinesHash( symbologyData, featureIndexArray, indexArray, - positions + positions, ) { const outlinesHash = []; for (let i = 0; i < indexArray.length; i += 3) { @@ -352,7 +352,7 @@ function generateOutlinesHash( const featureHash = getFeatureHash( symbologyData, outlinesHash, - featureIndex + featureIndex, ); if (!featureHash.hasOutline) { continue; @@ -377,7 +377,7 @@ function generateOutlinesHash( nextVertexIndex, uniqueVertexIndex, uniqueNextVertexIndex, - i + i, ); } } @@ -398,24 +398,24 @@ function calculateFaceNormal(normals, vertexAIndex, indexArray, positions) { Cartesian3.subtract( calculateFaceNormalB, calculateFaceNormalA, - calculateFaceNormalB + calculateFaceNormalB, ); Cartesian3.subtract( calculateFaceNormalC, calculateFaceNormalA, - calculateFaceNormalC + calculateFaceNormalC, ); Cartesian3.cross( calculateFaceNormalB, calculateFaceNormalC, - calculateFaceNormalA + calculateFaceNormalA, ); const magnitude = Cartesian3.magnitude(calculateFaceNormalA); if (magnitude !== 0) { Cartesian3.divideByScalar( calculateFaceNormalA, magnitude, - calculateFaceNormalA + calculateFaceNormalA, ); } const normalAIndex = vertexAIndex * 3; @@ -433,7 +433,7 @@ function isEdgeSmooth(normals, normalAIndex, normalBIndex) { Cartesian3.fromArray(normals, normalBIndex, isEdgeSmoothB); const cosine = Cartesian3.dot(isEdgeSmoothA, isEdgeSmoothB); const sine = Cartesian3.magnitude( - Cartesian3.cross(isEdgeSmoothA, isEdgeSmoothB, isEdgeSmoothA) + Cartesian3.cross(isEdgeSmoothA, isEdgeSmoothB, isEdgeSmoothA), ); return Math.atan2(sine, cosine) < 0.25; } @@ -443,7 +443,7 @@ function addOutlinesForEdge( edgeData, indexArray, positions, - normals + normals, ) { if (edgeData.normalsIndex.length > 1) { const normalsByIndex = positions.length === normals.length; @@ -477,7 +477,7 @@ function addOutlinesForFeature( edgeHash, indexArray, positions, - normals + normals, ) { const edgeStartKeys = Object.keys(edgeHash); for (let startIndex = 0; startIndex < edgeStartKeys.length; startIndex++) { @@ -494,7 +494,7 @@ function generateOutlinesFromHash( outlinesHash, indexArray, positions, - normals + normals, ) { const outlines = []; const features = Object.keys(outlinesHash); @@ -510,7 +510,7 @@ function generateOutlinesIndexArray( featureIndexArray, indexArray, positions, - normals + normals, ) { if (!defined(symbologyData) || Object.keys(symbologyData).length === 0) { return undefined; @@ -519,7 +519,7 @@ function generateOutlinesIndexArray( symbologyData, featureIndexArray, indexArray, - positions + positions, ); if (!defined(normals) || indexArray.length * 3 !== normals.length) { // Need to calculate flat normals per faces @@ -529,7 +529,7 @@ function generateOutlinesIndexArray( outlinesHash, indexArray, positions, - normals + normals, ); const outlinesIndexArray = outlines.length > 0 ? new Uint32Array(outlines) : undefined; @@ -556,7 +556,7 @@ function generateNormals( normals, uv0s, colors, - featureIndex + featureIndex, ) { const result = { normals: undefined, @@ -632,7 +632,7 @@ function generateGltfBuffer( uv0s, colors, featureIndex, - parameters + parameters, ) { if (vertexCount === 0 || !defined(positions) || positions.length === 0) { return { @@ -665,7 +665,7 @@ function generateGltfBuffer( vertexCount, indices, colors, - parameters.splitGeometryByColorTransparency + parameters.splitGeometryByColorTransparency, ); // Push to the buffers, bufferViews and accessors @@ -699,7 +699,7 @@ function generateGltfBuffer( featureIndex, indexArray, positions, - normals + normals, ); if (defined(outlinesIndexArray)) { const outlinesIndicesBlob = new Blob([outlinesIndexArray], { @@ -1126,7 +1126,7 @@ function decodeDracoEncodedGeometry(data) { for (let attrIndex = 0; attrIndex < attributesCount; ++attrIndex) { const dracoAttribute = dracoDecoder.GetAttribute( dracoGeometry, - attrIndex + attrIndex, ); const attributeData = decodeDracoAttribute( @@ -1134,7 +1134,7 @@ function decodeDracoEncodedGeometry(data) { dracoDecoder, dracoGeometry, dracoAttribute, - vertexCount + vertexCount, ); // initial mapping @@ -1154,7 +1154,7 @@ function decodeDracoEncodedGeometry(data) { // get the metadata const metadata = dracoDecoder.GetAttributeMetadata( dracoGeometry, - attrIndex + attrIndex, ); if (metadata.ptr !== 0) { @@ -1164,17 +1164,17 @@ function decodeDracoEncodedGeometry(data) { if (entryName === "i3s-scale_x") { decodedGeometry.scale_x = metadataQuerier.GetDoubleEntry( metadata, - "i3s-scale_x" + "i3s-scale_x", ); } else if (entryName === "i3s-scale_y") { decodedGeometry.scale_y = metadataQuerier.GetDoubleEntry( metadata, - "i3s-scale_y" + "i3s-scale_y", ); } else if (entryName === "i3s-attribute-type") { attributei3sName = metadataQuerier.GetStringEntry( metadata, - "i3s-attribute-type" + "i3s-attribute-type", ); } } @@ -1205,7 +1205,7 @@ function decodeDracoAttribute( dracoDecoder, dracoGeometry, dracoAttribute, - vertexCount + vertexCount, ) { const bufferSize = dracoAttribute.num_components() * vertexCount; let dracoAttributeData; @@ -1218,7 +1218,7 @@ function decodeDracoAttribute( const success = dracoDecoder.GetAttributeInt8ForAllPoints( dracoGeometry, dracoAttribute, - dracoAttributeData + dracoAttributeData, ); if (!success) { @@ -1236,7 +1236,7 @@ function decodeDracoAttribute( const success = dracoDecoder.GetAttributeUInt8ForAllPoints( dracoGeometry, dracoAttribute, - dracoAttributeData + dracoAttributeData, ); if (!success) { @@ -1254,7 +1254,7 @@ function decodeDracoAttribute( const success = dracoDecoder.GetAttributeInt16ForAllPoints( dracoGeometry, dracoAttribute, - dracoAttributeData + dracoAttributeData, ); if (!success) { @@ -1272,7 +1272,7 @@ function decodeDracoAttribute( const success = dracoDecoder.GetAttributeUInt16ForAllPoints( dracoGeometry, dracoAttribute, - dracoAttributeData + dracoAttributeData, ); if (!success) { @@ -1290,7 +1290,7 @@ function decodeDracoAttribute( const success = dracoDecoder.GetAttributeInt32ForAllPoints( dracoGeometry, dracoAttribute, - dracoAttributeData + dracoAttributeData, ); if (!success) { @@ -1308,7 +1308,7 @@ function decodeDracoAttribute( const success = dracoDecoder.GetAttributeUInt32ForAllPoints( dracoGeometry, dracoAttribute, - dracoAttributeData + dracoAttributeData, ); if (!success) { @@ -1332,7 +1332,7 @@ function decodeDracoAttribute( const success = dracoDecoder.GetAttributeFloatForAllPoints( dracoGeometry, dracoAttribute, - dracoAttributeData + dracoAttributeData, ); if (!success) { @@ -1353,7 +1353,7 @@ function decodeDracoAttribute( const success = dracoDecoder.GetAttributeUInt8ForAllPoints( dracoGeometry, dracoAttribute, - dracoAttributeData + dracoAttributeData, ); if (!success) { @@ -1462,12 +1462,12 @@ function decodeBinaryGeometry(data, schema, bufferInfo, featureData) { offset = binaryAttributeDecoders[bufferInfo.attributes[attrIndex]]( decodedGeometry, data, - offset + offset, ); } else { console.error( "Unknown decoder for", - bufferInfo.attributes[attrIndex] + bufferInfo.attributes[attrIndex], ); } } @@ -1482,10 +1482,10 @@ function decodeBinaryGeometry(data, schema, bufferInfo, featureData) { defined(featureData.geometryData[0].params) ) { ordering = Object.keys( - featureData.geometryData[0].params.vertexAttributes + featureData.geometryData[0].params.vertexAttributes, ); featureAttributeOrder = Object.keys( - featureData.geometryData[0].params.featureAttributes + featureData.geometryData[0].params.featureAttributes, ); } @@ -1516,7 +1516,7 @@ function decodeAndCreateGltf(parameters) { parameters.binaryData, parameters.schema, parameters.bufferInfo, - parameters.featureData + parameters.featureData, ); // Adjust height from orthometric to ellipsoidal @@ -1531,7 +1531,7 @@ function decodeAndCreateGltf(parameters) { geometryData.scale_y, parameters.cartographicCenter, parameters.geoidDataList, - false + false, ); } @@ -1545,7 +1545,7 @@ function decodeAndCreateGltf(parameters) { parameters.parentRotation, parameters.ellipsoidRadiiSquare, geometryData.scale_x, - geometryData.scale_y + geometryData.scale_y, ); // Adjust UVs if there is a UV region @@ -1553,7 +1553,7 @@ function decodeAndCreateGltf(parameters) { cropUVs( geometryData.vertexCount, geometryData.uv0s, - geometryData["uv-region"] + geometryData["uv-region"], ); } @@ -1587,7 +1587,7 @@ function decodeAndCreateGltf(parameters) { geometryData.normals, geometryData.uv0s, geometryData.colors, - featureIndex + featureIndex, ); if (defined(data.normals)) { geometryData.normals = data.normals; @@ -1611,7 +1611,7 @@ function decodeAndCreateGltf(parameters) { geometryData.uv0s, geometryData.colors, featureIndex, - parameters + parameters, ); const customAttributes = { diff --git a/packages/engine/Source/Workers/transcodeKTX2.js b/packages/engine/Source/Workers/transcodeKTX2.js index 9926d303b070..b92a5a9c240d 100644 --- a/packages/engine/Source/Workers/transcodeKTX2.js +++ b/packages/engine/Source/Workers/transcodeKTX2.js @@ -59,7 +59,7 @@ function transcode(parameters, transferableObjects) { supportedTargetFormats, transcoderModule, transferableObjects, - result + result, ); } else { transferableObjects.push(data.buffer); @@ -107,19 +107,19 @@ function parseUncompressed(header, result) { faceView = new Uint8Array( levelBuffer.buffer, faceByteOffset, - faceLength + faceLength, ); } else if (PixelDatatype.sizeInBytes(datatype) === 2) { faceView = new Uint16Array( levelBuffer.buffer, faceByteOffset, - faceLength + faceLength, ); } else { faceView = new Float32Array( levelBuffer.buffer, faceByteOffset, - faceLength + faceLength, ); } @@ -140,7 +140,7 @@ function transcodeCompressed( supportedTargetFormats, transcoderModule, transferableObjects, - result + result, ) { const ktx2File = new transcoderModule.KTX2File(data); let width = ktx2File.getWidth(); @@ -190,7 +190,7 @@ function transcodeCompressed( transcoderFormat = BasisFormat.cTFBC7_RGBA; } else { throw new RuntimeError( - "No transcoding format target available for ETC1S compressed ktx2." + "No transcoding format target available for ETC1S compressed ktx2.", ); } } else if (dfd.colorModel === colorModelUASTC) { @@ -224,7 +224,7 @@ function transcodeCompressed( : BasisFormat.cTFPVRTC1_4_RGB; } else { throw new RuntimeError( - "No transcoding format target available for UASTC compressed ktx2." + "No transcoding format target available for UASTC compressed ktx2.", ); } } @@ -248,7 +248,7 @@ function transcodeCompressed( i, // level index 0, // layer index 0, // face index - transcoderFormat.value + transcoderFormat.value, ); const dst = new Uint8Array(dstSize); @@ -260,7 +260,7 @@ function transcodeCompressed( transcoderFormat.value, 0, // get_alpha_for_opaque_formats -1, // channel0 - -1 // channel1 + -1, // channel1 ); if (!defined(transcoded)) { diff --git a/packages/engine/Source/Workers/transferTypedArrayTest.js b/packages/engine/Source/Workers/transferTypedArrayTest.js index 3cebe76ca23f..aa4eb9b1eb89 100644 --- a/packages/engine/Source/Workers/transferTypedArrayTest.js +++ b/packages/engine/Source/Workers/transferTypedArrayTest.js @@ -8,7 +8,7 @@ self.onmessage = function (event) { { array: array, }, - [array.buffer] + [array.buffer], ); } catch (e) { postMessage({}); diff --git a/packages/engine/Source/Workers/upsampleQuantizedTerrainMesh.js b/packages/engine/Source/Workers/upsampleQuantizedTerrainMesh.js index b38752da64cd..fbe235b64a28 100644 --- a/packages/engine/Source/Workers/upsampleQuantizedTerrainMesh.js +++ b/packages/engine/Source/Workers/upsampleQuantizedTerrainMesh.js @@ -86,7 +86,7 @@ function upsampleQuantizedTerrainMesh(parameters, transferableObjects) { const texCoords = encoding.decodeTextureCoordinates( parentVertices, i, - decodeTexCoordsScratch + decodeTexCoordsScratch, ); height = encoding.decodeHeight(parentVertices, i); @@ -98,7 +98,7 @@ function upsampleQuantizedTerrainMesh(parameters, transferableObjects) { maxShort) | 0, 0, - maxShort + maxShort, ); if (u < threshold) { @@ -124,7 +124,7 @@ function upsampleQuantizedTerrainMesh(parameters, transferableObjects) { const encodedNormal = encoding.getOctEncodedNormal( parentVertices, i, - octEncodedNormalScratch + octEncodedNormalScratch, ); parentNormalBuffer[n] = encodedNormal.x; parentNormalBuffer[n + 1] = encodedNormal.y; @@ -176,21 +176,21 @@ function upsampleQuantizedTerrainMesh(parameters, transferableObjects) { parentVBuffer, parentHeightBuffer, parentNormalBuffer, - i0 + i0, ); triangleVertices[1].initializeIndexed( parentUBuffer, parentVBuffer, parentHeightBuffer, parentNormalBuffer, - i1 + i1, ); triangleVertices[2].initializeIndexed( parentUBuffer, parentVBuffer, parentHeightBuffer, parentNormalBuffer, - i2 + i2, ); // Clip triangle on the east-west boundary. @@ -200,7 +200,7 @@ function upsampleQuantizedTerrainMesh(parameters, transferableObjects) { u0, u1, u2, - clipScratch + clipScratch, ); // Get the first clipped triangle, if any. @@ -212,7 +212,7 @@ function upsampleQuantizedTerrainMesh(parameters, transferableObjects) { clippedIndex = clippedTriangleVertices[0].initializeFromClipResult( clipped, clippedIndex, - triangleVertices + triangleVertices, ); if (clippedIndex >= clipped.length) { @@ -221,7 +221,7 @@ function upsampleQuantizedTerrainMesh(parameters, transferableObjects) { clippedIndex = clippedTriangleVertices[1].initializeFromClipResult( clipped, clippedIndex, - triangleVertices + triangleVertices, ); if (clippedIndex >= clipped.length) { @@ -230,7 +230,7 @@ function upsampleQuantizedTerrainMesh(parameters, transferableObjects) { clippedIndex = clippedTriangleVertices[2].initializeFromClipResult( clipped, clippedIndex, - triangleVertices + triangleVertices, ); // Clip the triangle against the North-south boundary. @@ -240,7 +240,7 @@ function upsampleQuantizedTerrainMesh(parameters, transferableObjects) { clippedTriangleVertices[0].getV(), clippedTriangleVertices[1].getV(), clippedTriangleVertices[2].getV(), - clipScratch2 + clipScratch2, ); addClippedPolygon( uBuffer, @@ -251,7 +251,7 @@ function upsampleQuantizedTerrainMesh(parameters, transferableObjects) { vertexMap, clipped2, clippedTriangleVertices, - hasVertexNormals + hasVertexNormals, ); // If there's another vertex in the original clipped result, @@ -261,7 +261,7 @@ function upsampleQuantizedTerrainMesh(parameters, transferableObjects) { clippedTriangleVertices[2].initializeFromClipResult( clipped, clippedIndex, - triangleVertices + triangleVertices, ); clipped2 = Intersections2D.clipTriangleAtAxisAlignedThreshold( @@ -270,7 +270,7 @@ function upsampleQuantizedTerrainMesh(parameters, transferableObjects) { clippedTriangleVertices[0].getV(), clippedTriangleVertices[1].getV(), clippedTriangleVertices[2].getV(), - clipScratch2 + clipScratch2, ); addClippedPolygon( uBuffer, @@ -281,7 +281,7 @@ function upsampleQuantizedTerrainMesh(parameters, transferableObjects) { vertexMap, clipped2, clippedTriangleVertices, - hasVertexNormals + hasVertexNormals, ); } } @@ -342,7 +342,7 @@ function upsampleQuantizedTerrainMesh(parameters, transferableObjects) { height = CesiumMath.lerp( parentMinimumHeight, parentMaximumHeight, - heightBuffer[i] / maxShort + heightBuffer[i] / maxShort, ); if (height < minimumHeight) { minimumHeight = height; @@ -368,30 +368,31 @@ function upsampleQuantizedTerrainMesh(parameters, transferableObjects) { cartesianVertices, Cartesian3.ZERO, 3, - boundingSphereScratch + boundingSphereScratch, ); const orientedBoundingBox = OrientedBoundingBox.fromRectangle( rectangle, minimumHeight, maximumHeight, ellipsoid, - orientedBoundingBoxScratch + orientedBoundingBoxScratch, ); const occluder = new EllipsoidalOccluder(ellipsoid); - const horizonOcclusionPoint = occluder.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid( - boundingSphere.center, - cartesianVertices, - 3, - boundingSphere.center, - minimumHeight, - horizonOcclusionPointScratch - ); + const horizonOcclusionPoint = + occluder.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid( + boundingSphere.center, + cartesianVertices, + 3, + boundingSphere.center, + minimumHeight, + horizonOcclusionPointScratch, + ); const heightRange = maximumHeight - minimumHeight; const vertices = new Uint16Array( - uBuffer.length + vBuffer.length + heightBuffer.length + uBuffer.length + vBuffer.length + heightBuffer.length, ); for (i = 0; i < uBuffer.length; ++i) { @@ -413,7 +414,7 @@ function upsampleQuantizedTerrainMesh(parameters, transferableObjects) { const indicesTypedArray = IndexDatatype.createTypedArray( uBuffer.length, - indices + indices, ); let encodedNormals; @@ -422,7 +423,7 @@ function upsampleQuantizedTerrainMesh(parameters, transferableObjects) { transferableObjects.push( vertices.buffer, indicesTypedArray.buffer, - normalArray.buffer + normalArray.buffer, ); encodedNormals = normalArray.buffer; } else { @@ -475,7 +476,7 @@ Vertex.prototype.initializeIndexed = function ( vBuffer, heightBuffer, normalBuffer, - index + index, ) { this.uBuffer = uBuffer; this.vBuffer = vBuffer; @@ -490,7 +491,7 @@ Vertex.prototype.initializeIndexed = function ( Vertex.prototype.initializeFromClipResult = function ( clipResult, index, - vertices + vertices, ) { let nextIndex = index + 1; @@ -561,18 +562,18 @@ function lerpOctEncodedNormal(vertex, result) { first = AttributeCompression.octDecode( vertex.first.getNormalX(), vertex.first.getNormalY(), - first + first, ); second = AttributeCompression.octDecode( vertex.second.getNormalX(), vertex.second.getNormalY(), - second + second, ); cartesian3Scratch = Cartesian3.lerp( first, second, vertex.ratio, - cartesian3Scratch + cartesian3Scratch, ); Cartesian3.normalize(cartesian3Scratch, cartesian3Scratch); @@ -616,7 +617,7 @@ function addClippedPolygon( vertexMap, clipped, triangleVertices, - hasVertexNormals + hasVertexNormals, ) { if (clipped.length === 0) { return; @@ -628,7 +629,7 @@ function addClippedPolygon( clippedIndex = polygonVertices[numVertices++].initializeFromClipResult( clipped, clippedIndex, - triangleVertices + triangleVertices, ); } diff --git a/packages/engine/Specs/Core/ApproximateTerrainHeightsSpec.js b/packages/engine/Specs/Core/ApproximateTerrainHeightsSpec.js index 13328b93a4d8..14665fef2327 100644 --- a/packages/engine/Specs/Core/ApproximateTerrainHeightsSpec.js +++ b/packages/engine/Specs/Core/ApproximateTerrainHeightsSpec.js @@ -23,15 +23,15 @@ describe("Core/ApproximateTerrainHeights", function () { it("getMinimumMaximumHeights computes minimum and maximum terrain heights", function () { const result = ApproximateTerrainHeights.getMinimumMaximumHeights( - Rectangle.fromDegrees(-121.0, 10.0, -120.0, 11.0) + Rectangle.fromDegrees(-121.0, 10.0, -120.0, 11.0), ); expect(result.minimumTerrainHeight).toEqualEpsilon( -5269.86, - CesiumMath.EPSILON8 + CesiumMath.EPSILON8, ); expect(result.maximumTerrainHeight).toEqualEpsilon( -28.53, - CesiumMath.EPSILON8 + CesiumMath.EPSILON8, ); }); @@ -46,7 +46,7 @@ describe("Core/ApproximateTerrainHeights", function () { ApproximateTerrainHeights._terrainHeights = undefined; expect(function () { return ApproximateTerrainHeights.getMinimumMaximumHeights( - Rectangle.fromDegrees(-121.0, 10.0, -120.0, 11.0) + Rectangle.fromDegrees(-121.0, 10.0, -120.0, 11.0), ); }); ApproximateTerrainHeights._terrainHeights = heights; @@ -54,19 +54,19 @@ describe("Core/ApproximateTerrainHeights", function () { it("getBoundingSphere computes a bounding sphere", function () { const result = ApproximateTerrainHeights.getBoundingSphere( - Rectangle.fromDegrees(-121.0, 10.0, -120.0, 11.0) + Rectangle.fromDegrees(-121.0, 10.0, -120.0, 11.0), ); expect(result.center).toEqualEpsilon( new Cartesian3( -3183013.849117281, -5403772.559109628, - 1154581.5821590829 + 1154581.5821590829, ), - CesiumMath.EPSILON8 + CesiumMath.EPSILON8, ); expect(result.radius).toEqualEpsilon( 77884.16321007285, - CesiumMath.EPSILON8 + CesiumMath.EPSILON8, ); }); @@ -81,7 +81,7 @@ describe("Core/ApproximateTerrainHeights", function () { ApproximateTerrainHeights._terrainHeights = undefined; expect(function () { return ApproximateTerrainHeights.getBoundingSphere( - Rectangle.fromDegrees(-121.0, 10.0, -120.0, 11.0) + Rectangle.fromDegrees(-121.0, 10.0, -120.0, 11.0), ); }); ApproximateTerrainHeights._terrainHeights = heights; diff --git a/packages/engine/Specs/Core/ArcGISTiledElevationTerrainProviderSpec.js b/packages/engine/Specs/Core/ArcGISTiledElevationTerrainProviderSpec.js index 970fdfd9b766..c59001bc02a8 100644 --- a/packages/engine/Specs/Core/ArcGISTiledElevationTerrainProviderSpec.js +++ b/packages/engine/Specs/Core/ArcGISTiledElevationTerrainProviderSpec.js @@ -150,7 +150,7 @@ describe("Core/ArcGISTiledElevationTerrainProvider", function () { data, headers, deferred, - overrideMimeType + overrideMimeType, ) { // Tile request if (url.indexOf("/tile/") !== -1) { @@ -161,7 +161,7 @@ describe("Core/ArcGISTiledElevationTerrainProvider", function () { data, headers, deferred, - overrideMimeType + overrideMimeType, ); return; } @@ -196,22 +196,21 @@ describe("Core/ArcGISTiledElevationTerrainProvider", function () { it("conforms to TerrainProvider interface", function () { expect(ArcGISTiledElevationTerrainProvider).toConformToInterface( - TerrainProvider + TerrainProvider, ); }); it("fromUrl throws without url", async function () { await expectAsync( - ArcGISTiledElevationTerrainProvider.fromUrl() + ArcGISTiledElevationTerrainProvider.fromUrl(), ).toBeRejectedWithDeveloperError( - "url is required, actual value was undefined" + "url is required, actual value was undefined", ); }); it("fromUrl resolves to new ArcGISTiledElevationTerrainProvider", async function () { - const provider = await ArcGISTiledElevationTerrainProvider.fromUrl( - "made/up/url" - ); + const provider = + await ArcGISTiledElevationTerrainProvider.fromUrl("made/up/url"); expect(provider).toBeInstanceOf(ArcGISTiledElevationTerrainProvider); }); @@ -220,16 +219,15 @@ describe("Core/ArcGISTiledElevationTerrainProvider", function () { const resource = new Resource({ url: "made/up/url", }); - const provider = await ArcGISTiledElevationTerrainProvider.fromUrl( - resource - ); + const provider = + await ArcGISTiledElevationTerrainProvider.fromUrl(resource); expect(provider).toBeInstanceOf(ArcGISTiledElevationTerrainProvider); }); it("fromUrl resolves with url promise", async function () { const provider = await ArcGISTiledElevationTerrainProvider.fromUrl( - Promise.resolve("made/up/url") + Promise.resolve("made/up/url"), ); expect(provider).toBeInstanceOf(ArcGISTiledElevationTerrainProvider); }); @@ -237,39 +235,36 @@ describe("Core/ArcGISTiledElevationTerrainProvider", function () { it("fromUrl rejects if url rejects", async function () { await expectAsync( ArcGISTiledElevationTerrainProvider.fromUrl( - Promise.reject(new Error("my message")) - ) + Promise.reject(new Error("my message")), + ), ).toBeRejectedWithError("my message"); }); it("has error event", async function () { - const provider = await ArcGISTiledElevationTerrainProvider.fromUrl( - "made/up/url" - ); + const provider = + await ArcGISTiledElevationTerrainProvider.fromUrl("made/up/url"); expect(provider.errorEvent).toBeDefined(); expect(provider.errorEvent).toBe(provider.errorEvent); }); it("returns reasonable geometric error for various levels", async function () { - const provider = await ArcGISTiledElevationTerrainProvider.fromUrl( - "made/up/url" - ); + const provider = + await ArcGISTiledElevationTerrainProvider.fromUrl("made/up/url"); expect(provider.getLevelMaximumGeometricError(0)).toBeGreaterThan(0.0); expect(provider.getLevelMaximumGeometricError(0)).toEqualEpsilon( provider.getLevelMaximumGeometricError(1) * 2.0, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); expect(provider.getLevelMaximumGeometricError(1)).toEqualEpsilon( provider.getLevelMaximumGeometricError(2) * 2.0, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); }); it("logo is undefined if credit is not provided", async function () { delete metadata.copyrightText; - const provider = await ArcGISTiledElevationTerrainProvider.fromUrl( - "made/up/url" - ); + const provider = + await ArcGISTiledElevationTerrainProvider.fromUrl("made/up/url"); expect(provider.credit).toBeUndefined(); }); @@ -278,27 +273,25 @@ describe("Core/ArcGISTiledElevationTerrainProvider", function () { "made/up/url", { credit: "thanks to our awesome made up contributors!", - } + }, ); expect(provider.credit).toBeDefined(); }); it("does not have a water mask", async function () { - const provider = await ArcGISTiledElevationTerrainProvider.fromUrl( - "made/up/url" - ); + const provider = + await ArcGISTiledElevationTerrainProvider.fromUrl("made/up/url"); expect(provider.hasWaterMask).toBe(false); }); it("detects WebMercator tiling scheme", async function () { const baseUrl = "made/up/url"; - const terrainProvider = await ArcGISTiledElevationTerrainProvider.fromUrl( - baseUrl - ); + const terrainProvider = + await ArcGISTiledElevationTerrainProvider.fromUrl(baseUrl); expect(terrainProvider.tilingScheme).toBeInstanceOf( - WebMercatorTilingScheme + WebMercatorTilingScheme, ); }); @@ -306,9 +299,8 @@ describe("Core/ArcGISTiledElevationTerrainProvider", function () { const baseUrl = "made/up/url"; metadata.spatialReference.latestWkid = 4326; - const terrainProvider = await ArcGISTiledElevationTerrainProvider.fromUrl( - baseUrl - ); + const terrainProvider = + await ArcGISTiledElevationTerrainProvider.fromUrl(baseUrl); expect(terrainProvider.tilingScheme).toBeInstanceOf(GeographicTilingScheme); }); @@ -318,7 +310,7 @@ describe("Core/ArcGISTiledElevationTerrainProvider", function () { metadata.spatialReference.latestWkid = 1234; await expectAsync( - ArcGISTiledElevationTerrainProvider.fromUrl(baseUrl) + ArcGISTiledElevationTerrainProvider.fromUrl(baseUrl), ).toBeRejectedWithError(RuntimeError, "Invalid spatial reference"); }); @@ -327,16 +319,15 @@ describe("Core/ArcGISTiledElevationTerrainProvider", function () { delete metadata.tileInfo; await expectAsync( - ArcGISTiledElevationTerrainProvider.fromUrl(baseUrl) + ArcGISTiledElevationTerrainProvider.fromUrl(baseUrl), ).toBeRejectedWithError(RuntimeError, "tileInfo is required"); }); it("checks availability if TileMap capability exists", async function () { const baseUrl = "made/up/url"; - const terrainProvider = await ArcGISTiledElevationTerrainProvider.fromUrl( - baseUrl - ); + const terrainProvider = + await ArcGISTiledElevationTerrainProvider.fromUrl(baseUrl); expect(terrainProvider._hasAvailability).toBe(true); expect(terrainProvider._tilesAvailable).toBeDefined(); @@ -347,9 +338,8 @@ describe("Core/ArcGISTiledElevationTerrainProvider", function () { const baseUrl = "made/up/url"; metadata.capabilities = "Image,Mensuration"; - const terrainProvider = await ArcGISTiledElevationTerrainProvider.fromUrl( - baseUrl - ); + const terrainProvider = + await ArcGISTiledElevationTerrainProvider.fromUrl(baseUrl); expect(terrainProvider._hasAvailability).toBe(false); expect(terrainProvider._tilesAvailable).toBeUndefined(); @@ -360,9 +350,8 @@ describe("Core/ArcGISTiledElevationTerrainProvider", function () { it("provides HeightmapTerrainData", async function () { const baseUrl = "made/up/url"; - const terrainProvider = await ArcGISTiledElevationTerrainProvider.fromUrl( - baseUrl - ); + const terrainProvider = + await ArcGISTiledElevationTerrainProvider.fromUrl(baseUrl); const promise = terrainProvider.requestTileGeometry(0, 0, 0); RequestScheduler.update(); @@ -377,15 +366,14 @@ describe("Core/ArcGISTiledElevationTerrainProvider", function () { Resource._Implementations.createImage = function ( request, crossOrigin, - deferred + deferred, ) { // Do nothing, so requests never complete deferreds.push(deferred); }; - const terrainProvider = await ArcGISTiledElevationTerrainProvider.fromUrl( - baseUrl - ); + const terrainProvider = + await ArcGISTiledElevationTerrainProvider.fromUrl(baseUrl); let promise; let i; @@ -410,7 +398,7 @@ describe("Core/ArcGISTiledElevationTerrainProvider", function () { await Promise.all( deferreds.map(function (deferred) { return deferred.promise; - }) + }), ); }); }); diff --git a/packages/engine/Specs/Core/AttributeCompressionSpec.js b/packages/engine/Specs/Core/AttributeCompressionSpec.js index c288d01c4d1f..1a9237e6f8b1 100644 --- a/packages/engine/Specs/Core/AttributeCompressionSpec.js +++ b/packages/engine/Specs/Core/AttributeCompressionSpec.js @@ -113,28 +113,28 @@ describe("Core/AttributeCompression", function () { expect(function () { AttributeCompression.octDecodeFromCartesian4( new Cartesian4(256, 0, 0, 0), - result + result, ); }).toThrowDeveloperError(); expect(function () { AttributeCompression.octDecodeFromCartesian4( new Cartesian4(0, 256, 0, 0), - result + result, ); }).toThrowDeveloperError(); expect(function () { AttributeCompression.octDecodeFromCartesian4( new Cartesian4(0, 0, 256, 0), - result + result, ); }).toThrowDeveloperError(); expect(function () { AttributeCompression.octDecodeFromCartesian4( new Cartesian4(0, 0, 0, 256), - result + result, ); }).toThrowDeveloperError(); }); @@ -147,93 +147,93 @@ describe("Core/AttributeCompression", function () { let normal = new Cartesian3(0.0, 0.0, 1.0); AttributeCompression.octEncode(normal, encoded); expect( - AttributeCompression.octDecode(encoded.x, encoded.y, result) + AttributeCompression.octDecode(encoded.x, encoded.y, result), ).toEqualEpsilon(normal, epsilon); normal = new Cartesian3(0.0, 0.0, -1.0); AttributeCompression.octEncode(normal, encoded); expect( - AttributeCompression.octDecode(encoded.x, encoded.y, result) + AttributeCompression.octDecode(encoded.x, encoded.y, result), ).toEqualEpsilon(normal, epsilon); normal = new Cartesian3(0.0, 1.0, 0.0); AttributeCompression.octEncode(normal, encoded); expect( - AttributeCompression.octDecode(encoded.x, encoded.y, result) + AttributeCompression.octDecode(encoded.x, encoded.y, result), ).toEqualEpsilon(normal, epsilon); normal = new Cartesian3(0.0, -1.0, 0.0); AttributeCompression.octEncode(normal, encoded); expect( - AttributeCompression.octDecode(encoded.x, encoded.y, result) + AttributeCompression.octDecode(encoded.x, encoded.y, result), ).toEqualEpsilon(normal, epsilon); normal = new Cartesian3(1.0, 0.0, 0.0); AttributeCompression.octEncode(normal, encoded); expect( - AttributeCompression.octDecode(encoded.x, encoded.y, result) + AttributeCompression.octDecode(encoded.x, encoded.y, result), ).toEqualEpsilon(normal, epsilon); normal = new Cartesian3(-1.0, 0.0, 0.0); AttributeCompression.octEncode(normal, encoded); expect( - AttributeCompression.octDecode(encoded.x, encoded.y, result) + AttributeCompression.octDecode(encoded.x, encoded.y, result), ).toEqualEpsilon(normal, epsilon); normal = new Cartesian3(1.0, 1.0, 1.0); Cartesian3.normalize(normal, normal); AttributeCompression.octEncode(normal, encoded); expect( - AttributeCompression.octDecode(encoded.x, encoded.y, result) + AttributeCompression.octDecode(encoded.x, encoded.y, result), ).toEqualEpsilon(normal, epsilon); normal = new Cartesian3(1.0, -1.0, 1.0); Cartesian3.normalize(normal, normal); AttributeCompression.octEncode(normal, encoded); expect( - AttributeCompression.octDecode(encoded.x, encoded.y, result) + AttributeCompression.octDecode(encoded.x, encoded.y, result), ).toEqualEpsilon(normal, epsilon); normal = new Cartesian3(-1.0, -1.0, 1.0); Cartesian3.normalize(normal, normal); AttributeCompression.octEncode(normal, encoded); expect( - AttributeCompression.octDecode(encoded.x, encoded.y, result) + AttributeCompression.octDecode(encoded.x, encoded.y, result), ).toEqualEpsilon(normal, epsilon); normal = new Cartesian3(-1.0, 1.0, 1.0); Cartesian3.normalize(normal, normal); AttributeCompression.octEncode(normal, encoded); expect( - AttributeCompression.octDecode(encoded.x, encoded.y, result) + AttributeCompression.octDecode(encoded.x, encoded.y, result), ).toEqualEpsilon(normal, epsilon); normal = new Cartesian3(1.0, 1.0, -1.0); Cartesian3.normalize(normal, normal); AttributeCompression.octEncode(normal, encoded); expect( - AttributeCompression.octDecode(encoded.x, encoded.y, result) + AttributeCompression.octDecode(encoded.x, encoded.y, result), ).toEqualEpsilon(normal, epsilon); normal = new Cartesian3(1.0, -1.0, -1.0); Cartesian3.normalize(normal, normal); AttributeCompression.octEncode(normal, encoded); expect( - AttributeCompression.octDecode(encoded.x, encoded.y, result) + AttributeCompression.octDecode(encoded.x, encoded.y, result), ).toEqualEpsilon(normal, epsilon); normal = new Cartesian3(-1.0, 1.0, -1.0); Cartesian3.normalize(normal, normal); AttributeCompression.octEncode(normal, encoded); expect( - AttributeCompression.octDecode(encoded.x, encoded.y, result) + AttributeCompression.octDecode(encoded.x, encoded.y, result), ).toEqualEpsilon(normal, epsilon); normal = new Cartesian3(-1.0, -1.0, -1.0); Cartesian3.normalize(normal, normal); AttributeCompression.octEncode(normal, encoded); expect( - AttributeCompression.octDecode(encoded.x, encoded.y, result) + AttributeCompression.octDecode(encoded.x, encoded.y, result), ).toEqualEpsilon(normal, epsilon); }); @@ -250,8 +250,8 @@ describe("Core/AttributeCompression", function () { encoded.x, encoded.y, rangeMax, - result - ) + result, + ), ).toEqualEpsilon(normal, epsilon); normal = new Cartesian3(0.0, 0.0, -1.0); @@ -261,8 +261,8 @@ describe("Core/AttributeCompression", function () { encoded.x, encoded.y, rangeMax, - result - ) + result, + ), ).toEqualEpsilon(normal, epsilon); normal = new Cartesian3(0.0, 1.0, 0.0); @@ -272,8 +272,8 @@ describe("Core/AttributeCompression", function () { encoded.x, encoded.y, rangeMax, - result - ) + result, + ), ).toEqualEpsilon(normal, epsilon); normal = new Cartesian3(0.0, -1.0, 0.0); @@ -283,8 +283,8 @@ describe("Core/AttributeCompression", function () { encoded.x, encoded.y, rangeMax, - result - ) + result, + ), ).toEqualEpsilon(normal, epsilon); normal = new Cartesian3(1.0, 0.0, 0.0); @@ -294,8 +294,8 @@ describe("Core/AttributeCompression", function () { encoded.x, encoded.y, rangeMax, - result - ) + result, + ), ).toEqualEpsilon(normal, epsilon); normal = new Cartesian3(-1.0, 0.0, 0.0); @@ -305,8 +305,8 @@ describe("Core/AttributeCompression", function () { encoded.x, encoded.y, rangeMax, - result - ) + result, + ), ).toEqualEpsilon(normal, epsilon); normal = new Cartesian3(1.0, 1.0, 1.0); @@ -317,8 +317,8 @@ describe("Core/AttributeCompression", function () { encoded.x, encoded.y, rangeMax, - result - ) + result, + ), ).toEqualEpsilon(normal, epsilon); normal = new Cartesian3(1.0, -1.0, 1.0); @@ -329,8 +329,8 @@ describe("Core/AttributeCompression", function () { encoded.x, encoded.y, rangeMax, - result - ) + result, + ), ).toEqualEpsilon(normal, epsilon); normal = new Cartesian3(-1.0, -1.0, 1.0); @@ -341,8 +341,8 @@ describe("Core/AttributeCompression", function () { encoded.x, encoded.y, rangeMax, - result - ) + result, + ), ).toEqualEpsilon(normal, epsilon); normal = new Cartesian3(-1.0, 1.0, 1.0); @@ -353,8 +353,8 @@ describe("Core/AttributeCompression", function () { encoded.x, encoded.y, rangeMax, - result - ) + result, + ), ).toEqualEpsilon(normal, epsilon); normal = new Cartesian3(1.0, 1.0, -1.0); @@ -365,8 +365,8 @@ describe("Core/AttributeCompression", function () { encoded.x, encoded.y, rangeMax, - result - ) + result, + ), ).toEqualEpsilon(normal, epsilon); normal = new Cartesian3(1.0, -1.0, -1.0); @@ -377,8 +377,8 @@ describe("Core/AttributeCompression", function () { encoded.x, encoded.y, rangeMax, - result - ) + result, + ), ).toEqualEpsilon(normal, epsilon); normal = new Cartesian3(-1.0, 1.0, -1.0); @@ -389,8 +389,8 @@ describe("Core/AttributeCompression", function () { encoded.x, encoded.y, rangeMax, - result - ) + result, + ), ).toEqualEpsilon(normal, epsilon); normal = new Cartesian3(-1.0, -1.0, -1.0); @@ -401,8 +401,8 @@ describe("Core/AttributeCompression", function () { encoded.x, encoded.y, rangeMax, - result - ) + result, + ), ).toEqualEpsilon(normal, epsilon); }); @@ -414,93 +414,93 @@ describe("Core/AttributeCompression", function () { let normal = new Cartesian3(0.0, 0.0, 1.0); AttributeCompression.octEncodeToCartesian4(normal, encoded); expect( - AttributeCompression.octDecodeFromCartesian4(encoded, result) + 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) + 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) + 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) + 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) + 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) + 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) + 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) + 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) + 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) + 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) + 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) + 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) + 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) + AttributeCompression.octDecodeFromCartesian4(encoded, result), ).toEqualEpsilon(normal, epsilon); }); @@ -512,48 +512,48 @@ describe("Core/AttributeCompression", function () { expect( AttributeCompression.octDecodeFloat( AttributeCompression.octEncodeFloat(normal), - result - ) + result, + ), ).toEqualEpsilon(normal, epsilon); normal = new Cartesian3(0.0, 0.0, -1.0); expect( AttributeCompression.octDecodeFloat( AttributeCompression.octEncodeFloat(normal), - result - ) + result, + ), ).toEqualEpsilon(normal, epsilon); normal = new Cartesian3(0.0, 1.0, 0.0); expect( AttributeCompression.octDecodeFloat( AttributeCompression.octEncodeFloat(normal), - result - ) + result, + ), ).toEqualEpsilon(normal, epsilon); normal = new Cartesian3(0.0, -1.0, 0.0); expect( AttributeCompression.octDecodeFloat( AttributeCompression.octEncodeFloat(normal), - result - ) + result, + ), ).toEqualEpsilon(normal, epsilon); normal = new Cartesian3(1.0, 0.0, 0.0); expect( AttributeCompression.octDecodeFloat( AttributeCompression.octEncodeFloat(normal), - result - ) + result, + ), ).toEqualEpsilon(normal, epsilon); normal = new Cartesian3(-1.0, 0.0, 0.0); expect( AttributeCompression.octDecodeFloat( AttributeCompression.octEncodeFloat(normal), - result - ) + result, + ), ).toEqualEpsilon(normal, epsilon); normal = new Cartesian3(1.0, 1.0, 1.0); @@ -561,8 +561,8 @@ describe("Core/AttributeCompression", function () { expect( AttributeCompression.octDecodeFloat( AttributeCompression.octEncodeFloat(normal), - result - ) + result, + ), ).toEqualEpsilon(normal, epsilon); normal = new Cartesian3(1.0, -1.0, 1.0); @@ -570,8 +570,8 @@ describe("Core/AttributeCompression", function () { expect( AttributeCompression.octDecodeFloat( AttributeCompression.octEncodeFloat(normal), - result - ) + result, + ), ).toEqualEpsilon(normal, epsilon); normal = new Cartesian3(-1.0, -1.0, 1.0); @@ -579,8 +579,8 @@ describe("Core/AttributeCompression", function () { expect( AttributeCompression.octDecodeFloat( AttributeCompression.octEncodeFloat(normal), - result - ) + result, + ), ).toEqualEpsilon(normal, epsilon); normal = new Cartesian3(-1.0, 1.0, 1.0); @@ -588,8 +588,8 @@ describe("Core/AttributeCompression", function () { expect( AttributeCompression.octDecodeFloat( AttributeCompression.octEncodeFloat(normal), - result - ) + result, + ), ).toEqualEpsilon(normal, epsilon); normal = new Cartesian3(1.0, 1.0, -1.0); @@ -597,8 +597,8 @@ describe("Core/AttributeCompression", function () { expect( AttributeCompression.octDecodeFloat( AttributeCompression.octEncodeFloat(normal), - result - ) + result, + ), ).toEqualEpsilon(normal, epsilon); normal = new Cartesian3(1.0, -1.0, -1.0); @@ -606,8 +606,8 @@ describe("Core/AttributeCompression", function () { expect( AttributeCompression.octDecodeFloat( AttributeCompression.octEncodeFloat(normal), - result - ) + result, + ), ).toEqualEpsilon(normal, epsilon); normal = new Cartesian3(-1.0, 1.0, -1.0); @@ -615,8 +615,8 @@ describe("Core/AttributeCompression", function () { expect( AttributeCompression.octDecodeFloat( AttributeCompression.octEncodeFloat(normal), - result - ) + result, + ), ).toEqualEpsilon(normal, epsilon); normal = new Cartesian3(-1.0, -1.0, -1.0); @@ -624,8 +624,8 @@ describe("Core/AttributeCompression", function () { expect( AttributeCompression.octDecodeFloat( AttributeCompression.octEncodeFloat(normal), - result - ) + result, + ), ).toEqualEpsilon(normal, epsilon); }); @@ -639,7 +639,7 @@ describe("Core/AttributeCompression", function () { AttributeCompression.octDecode(encoded.x, encoded.y, result1); AttributeCompression.octDecodeFloat( AttributeCompression.octEncodeFloat(normal), - result2 + result2, ); expect(result1).toEqual(result2); @@ -648,7 +648,7 @@ describe("Core/AttributeCompression", function () { AttributeCompression.octDecode(encoded.x, encoded.y, result1); AttributeCompression.octDecodeFloat( AttributeCompression.octEncodeFloat(normal), - result2 + result2, ); expect(result1).toEqual(result2); @@ -657,7 +657,7 @@ describe("Core/AttributeCompression", function () { AttributeCompression.octDecode(encoded.x, encoded.y, result1); AttributeCompression.octDecodeFloat( AttributeCompression.octEncodeFloat(normal), - result2 + result2, ); expect(result1).toEqual(result2); @@ -666,7 +666,7 @@ describe("Core/AttributeCompression", function () { AttributeCompression.octDecode(encoded.x, encoded.y, result1); AttributeCompression.octDecodeFloat( AttributeCompression.octEncodeFloat(normal), - result2 + result2, ); expect(result1).toEqual(result2); @@ -675,7 +675,7 @@ describe("Core/AttributeCompression", function () { AttributeCompression.octDecode(encoded.x, encoded.y, result1); AttributeCompression.octDecodeFloat( AttributeCompression.octEncodeFloat(normal), - result2 + result2, ); expect(result1).toEqual(result2); @@ -684,7 +684,7 @@ describe("Core/AttributeCompression", function () { AttributeCompression.octDecode(encoded.x, encoded.y, result1); AttributeCompression.octDecodeFloat( AttributeCompression.octEncodeFloat(normal), - result2 + result2, ); expect(result1).toEqual(result2); @@ -694,7 +694,7 @@ describe("Core/AttributeCompression", function () { AttributeCompression.octDecode(encoded.x, encoded.y, result1); AttributeCompression.octDecodeFloat( AttributeCompression.octEncodeFloat(normal), - result2 + result2, ); expect(result1).toEqual(result2); @@ -704,7 +704,7 @@ describe("Core/AttributeCompression", function () { AttributeCompression.octDecode(encoded.x, encoded.y, result1); AttributeCompression.octDecodeFloat( AttributeCompression.octEncodeFloat(normal), - result2 + result2, ); expect(result1).toEqual(result2); @@ -714,7 +714,7 @@ describe("Core/AttributeCompression", function () { AttributeCompression.octDecode(encoded.x, encoded.y, result1); AttributeCompression.octDecodeFloat( AttributeCompression.octEncodeFloat(normal), - result2 + result2, ); expect(result1).toEqual(result2); @@ -724,7 +724,7 @@ describe("Core/AttributeCompression", function () { AttributeCompression.octDecode(encoded.x, encoded.y, result1); AttributeCompression.octDecodeFloat( AttributeCompression.octEncodeFloat(normal), - result2 + result2, ); expect(result1).toEqual(result2); @@ -734,7 +734,7 @@ describe("Core/AttributeCompression", function () { AttributeCompression.octDecode(encoded.x, encoded.y, result1); AttributeCompression.octDecodeFloat( AttributeCompression.octEncodeFloat(normal), - result2 + result2, ); expect(result1).toEqual(result2); @@ -744,7 +744,7 @@ describe("Core/AttributeCompression", function () { AttributeCompression.octDecode(encoded.x, encoded.y, result1); AttributeCompression.octDecodeFloat( AttributeCompression.octEncodeFloat(normal), - result2 + result2, ); expect(result1).toEqual(result2); @@ -754,7 +754,7 @@ describe("Core/AttributeCompression", function () { AttributeCompression.octDecode(encoded.x, encoded.y, result1); AttributeCompression.octDecodeFloat( AttributeCompression.octEncodeFloat(normal), - result2 + result2, ); expect(result1).toEqual(result2); @@ -764,7 +764,7 @@ describe("Core/AttributeCompression", function () { AttributeCompression.octDecode(encoded.x, encoded.y, result1); AttributeCompression.octDecodeFloat( AttributeCompression.octEncodeFloat(normal), - result2 + result2, ); expect(result1).toEqual(result2); }); @@ -794,9 +794,9 @@ describe("Core/AttributeCompression", function () { const encoded = AttributeCompression.octEncode(vector, new Cartesian2()); const encodedFloat = AttributeCompression.octPackFloat(encoded); expect( - AttributeCompression.octDecodeFloat(encodedFloat, new Cartesian3()) + AttributeCompression.octDecodeFloat(encodedFloat, new Cartesian3()), ).toEqual( - AttributeCompression.octDecode(encoded.x, encoded.y, new Cartesian3()) + AttributeCompression.octDecode(encoded.x, encoded.y, new Cartesian3()), ); }); @@ -820,20 +820,20 @@ describe("Core/AttributeCompression", function () { expect(decodedX).toEqual( AttributeCompression.octDecodeFloat( AttributeCompression.octEncodeFloat(x), - new Cartesian3() - ) + new Cartesian3(), + ), ); expect(decodedY).toEqual( AttributeCompression.octDecodeFloat( AttributeCompression.octEncodeFloat(y), - new Cartesian3() - ) + new Cartesian3(), + ), ); expect(decodedZ).toEqual( AttributeCompression.octDecodeFloat( AttributeCompression.octEncodeFloat(z), - new Cartesian3() - ) + new Cartesian3(), + ), ); }); @@ -843,7 +843,7 @@ describe("Core/AttributeCompression", function () { undefined, new Cartesian3(), new Cartesian3(), - new Cartesian2() + new Cartesian2(), ); }).toThrowDeveloperError(); }); @@ -854,7 +854,7 @@ describe("Core/AttributeCompression", function () { new Cartesian3(), undefined, new Cartesian3(), - new Cartesian2() + new Cartesian2(), ); }).toThrowDeveloperError(); }); @@ -865,7 +865,7 @@ describe("Core/AttributeCompression", function () { new Cartesian3(), new Cartesian3(), undefined, - new Cartesian2() + new Cartesian2(), ); }).toThrowDeveloperError(); }); @@ -876,7 +876,7 @@ describe("Core/AttributeCompression", function () { new Cartesian3(), new Cartesian3(), new Cartesian3(), - undefined + undefined, ); }).toThrowDeveloperError(); }); @@ -887,7 +887,7 @@ describe("Core/AttributeCompression", function () { undefined, new Cartesian3(), new Cartesian3(), - new Cartesian3() + new Cartesian3(), ); }).toThrowDeveloperError(); }); @@ -898,7 +898,7 @@ describe("Core/AttributeCompression", function () { new Cartesian2(), undefined, new Cartesian3(), - new Cartesian3() + new Cartesian3(), ); }).toThrowDeveloperError(); }); @@ -909,7 +909,7 @@ describe("Core/AttributeCompression", function () { new Cartesian2(), new Cartesian3(), undefined, - new Cartesian3() + new Cartesian3(), ); }).toThrowDeveloperError(); }); @@ -920,7 +920,7 @@ describe("Core/AttributeCompression", function () { new Cartesian2(), new Cartesian3(), new Cartesian3(), - undefined + undefined, ); }).toThrowDeveloperError(); }); @@ -930,8 +930,8 @@ describe("Core/AttributeCompression", function () { expect( AttributeCompression.decompressTextureCoordinates( AttributeCompression.compressTextureCoordinates(coords), - new Cartesian2() - ) + new Cartesian2(), + ), ).toEqualEpsilon(coords, 1.0 / 4096.0); }); @@ -945,7 +945,7 @@ describe("Core/AttributeCompression", function () { expect(function () { AttributeCompression.decompressTextureCoordinates( undefined, - new Cartesian2() + new Cartesian2(), ); }).toThrowDeveloperError(); }); @@ -961,8 +961,8 @@ describe("Core/AttributeCompression", function () { expect( AttributeCompression.decompressTextureCoordinates( AttributeCompression.compressTextureCoordinates(coords), - new Cartesian2() - ) + new Cartesian2(), + ), ).toEqual(coords); }); @@ -971,8 +971,8 @@ describe("Core/AttributeCompression", function () { expect( AttributeCompression.decompressTextureCoordinates( AttributeCompression.compressTextureCoordinates(coords), - new Cartesian2() - ) + new Cartesian2(), + ), ).toEqual(coords); }); @@ -981,8 +981,8 @@ describe("Core/AttributeCompression", function () { expect( AttributeCompression.decompressTextureCoordinates( AttributeCompression.compressTextureCoordinates(coords), - new Cartesian2() - ) + new Cartesian2(), + ), ).toEqualEpsilon(coords, 1.0 / 4095.0); }); @@ -991,8 +991,8 @@ describe("Core/AttributeCompression", function () { expect( AttributeCompression.decompressTextureCoordinates( AttributeCompression.compressTextureCoordinates(coords), - new Cartesian2() - ) + new Cartesian2(), + ), ).toEqualEpsilon(coords, 1.0 / 4095.0); }); @@ -1001,8 +1001,8 @@ describe("Core/AttributeCompression", function () { expect( AttributeCompression.decompressTextureCoordinates( AttributeCompression.compressTextureCoordinates(coords), - new Cartesian2() - ) + new Cartesian2(), + ), ).toEqualEpsilon(coords, 1.0 / 4095.0); }); @@ -1056,7 +1056,7 @@ describe("Core/AttributeCompression", function () { const vBuffer = new Uint16Array( encoded.buffer, length * Uint16Array.BYTES_PER_ELEMENT, - length + length, ); AttributeCompression.zigZagDeltaDecode(uBuffer, vBuffer); @@ -1079,18 +1079,18 @@ describe("Core/AttributeCompression", function () { const encoded = deltaZigZagEncode( decodedUBuffer, decodedVBuffer, - decodedHeightBuffer + decodedHeightBuffer, ); const uBuffer = new Uint16Array(encoded.buffer, 0, length); const vBuffer = new Uint16Array( encoded.buffer, length * Uint16Array.BYTES_PER_ELEMENT, - length + length, ); const heightBuffer = new Uint16Array( encoded.buffer, 2 * length * Uint16Array.BYTES_PER_ELEMENT, - length + length, ); AttributeCompression.zigZagDeltaDecode(uBuffer, vBuffer, heightBuffer); @@ -1116,7 +1116,7 @@ describe("Core/AttributeCompression", function () { expect(function () { AttributeCompression.zigZagDeltaDecode( new Uint16Array(10), - new Uint16Array(11) + new Uint16Array(11), ); }).toThrowDeveloperError(); }); @@ -1126,7 +1126,7 @@ describe("Core/AttributeCompression", function () { AttributeCompression.zigZagDeltaDecode( new Uint16Array(10), new Uint16Array(10), - new Uint16Array(11) + new Uint16Array(11), ); }).toThrowDeveloperError(); }); @@ -1137,7 +1137,7 @@ describe("Core/AttributeCompression", function () { undefined, ComponentDatatype.UNSIGNED_BYTE, AttributeType.VEC3, - 1 + 1, ); }).toThrowDeveloperError(); }); @@ -1148,7 +1148,7 @@ describe("Core/AttributeCompression", function () { new Uint8Array([0, 0, 0, 0]), undefined, AttributeType.VEC3, - 1 + 1, ); }).toThrowDeveloperError(); }); @@ -1159,7 +1159,7 @@ describe("Core/AttributeCompression", function () { new Uint8Array([0, 0, 0, 0]), ComponentDatatype.UNSIGNED_BYTE, undefined, - 1 + 1, ); }).toThrowDeveloperError(); }); @@ -1170,7 +1170,7 @@ describe("Core/AttributeCompression", function () { new Uint8Array([0, 0, 0, 0]), ComponentDatatype.UNSIGNED_BYTE, AttributeType.VEC3, - undefined + undefined, ); }).toThrowDeveloperError(); }); @@ -1182,7 +1182,7 @@ describe("Core/AttributeCompression", function () { new Int8Array(input), ComponentDatatype.BYTE, AttributeType.VEC3, - 3 + 3, ); for (let i = 0; i < input.length; i++) { expect(result[i]).toEqualEpsilon(expected[i], CesiumMath.EPSILON2); @@ -1196,7 +1196,7 @@ describe("Core/AttributeCompression", function () { new Uint8Array(input), ComponentDatatype.UNSIGNED_BYTE, AttributeType.VEC3, - 3 + 3, ); for (let i = 0; i < input.length; i++) { expect(result[i]).toEqualEpsilon(expected[i], CesiumMath.EPSILON2); @@ -1210,7 +1210,7 @@ describe("Core/AttributeCompression", function () { new Int16Array(input), ComponentDatatype.SHORT, AttributeType.VEC3, - 3 + 3, ); for (let i = 0; i < input.length; i++) { expect(result[i]).toEqualEpsilon(expected[i], CesiumMath.EPSILON5); @@ -1224,7 +1224,7 @@ describe("Core/AttributeCompression", function () { new Uint16Array(input), ComponentDatatype.UNSIGNED_SHORT, AttributeType.VEC3, - 3 + 3, ); for (let i = 0; i < input.length; i++) { expect(result[i]).toEqualEpsilon(expected[i], CesiumMath.EPSILON5); @@ -1233,14 +1233,7 @@ describe("Core/AttributeCompression", function () { it("dequantize works with INT", function () { const input = [ - -2147483647, - -2147483647, - -2147483647, - 0, - 0, - 0, - 2147483647, - 2147483647, + -2147483647, -2147483647, -2147483647, 0, 0, 0, 2147483647, 2147483647, 2147483647, ]; const expected = [-1, -1, -1, 0, 0, 0, 1, 1, 1]; @@ -1248,7 +1241,7 @@ describe("Core/AttributeCompression", function () { new Int32Array(input), ComponentDatatype.INT, AttributeType.VEC3, - 3 + 3, ); for (let i = 0; i < input.length; i++) { expect(result[i]).toEqual(expected[i]); @@ -1257,14 +1250,7 @@ describe("Core/AttributeCompression", function () { it("dequantize works with UNSIGNED_INT", function () { const input = [ - 0, - 0, - 0, - 2147483647, - 2147483647, - 2147483647, - 4294967295, - 4294967295, + 0, 0, 0, 2147483647, 2147483647, 2147483647, 4294967295, 4294967295, 4294967295, ]; const expected = [0, 0, 0, 0.5, 0.5, 0.5, 1, 1, 1]; @@ -1272,7 +1258,7 @@ describe("Core/AttributeCompression", function () { new Uint32Array(input), ComponentDatatype.UNSIGNED_INT, AttributeType.VEC3, - 3 + 3, ); for (let i = 0; i < input.length; i++) { expect(result[i]).toEqual(expected[i]); @@ -1289,7 +1275,7 @@ describe("Core/AttributeCompression", function () { expect(function () { return AttributeCompression.decodeRGB565( new Uint16Array([0]), - new Float32Array(1) + new Float32Array(1), ); }).toThrowDeveloperError(); }); diff --git a/packages/engine/Specs/Core/AxisAlignedBoundingBoxSpec.js b/packages/engine/Specs/Core/AxisAlignedBoundingBoxSpec.js index 0a7ced5342d9..d01e1155ec3d 100644 --- a/packages/engine/Specs/Core/AxisAlignedBoundingBoxSpec.js +++ b/packages/engine/Specs/Core/AxisAlignedBoundingBoxSpec.js @@ -109,7 +109,7 @@ describe("Core/AxisAlignedBoundingBox", function () { it("clone without a result parameter", function () { const box = new AxisAlignedBoundingBox( Cartesian3.UNIT_Y, - Cartesian3.UNIT_X + Cartesian3.UNIT_X, ); const result = box.clone(); expect(box).not.toBe(result); @@ -120,7 +120,7 @@ describe("Core/AxisAlignedBoundingBox", function () { const box = new AxisAlignedBoundingBox( Cartesian3.UNIT_Y, Cartesian3.UNIT_X, - Cartesian3.UNIT_Z + Cartesian3.UNIT_Z, ); const result = box.clone(); expect(box).not.toBe(result); @@ -130,11 +130,11 @@ describe("Core/AxisAlignedBoundingBox", function () { it("clone with a result parameter", function () { const box = new AxisAlignedBoundingBox( Cartesian3.UNIT_Y, - Cartesian3.UNIT_X + Cartesian3.UNIT_X, ); const result = new AxisAlignedBoundingBox( Cartesian3.ZERO, - Cartesian3.UNIT_Z + Cartesian3.UNIT_Z, ); const returnedResult = box.clone(result); expect(result).toBe(returnedResult); @@ -145,7 +145,7 @@ describe("Core/AxisAlignedBoundingBox", function () { it('clone works with "this" result parameter', function () { const box = new AxisAlignedBoundingBox( Cartesian3.UNIT_Y, - Cartesian3.UNIT_X + Cartesian3.UNIT_X, ); const returnedResult = box.clone(box); expect(box).toBe(returnedResult); @@ -157,7 +157,7 @@ describe("Core/AxisAlignedBoundingBox", function () { const box = new AxisAlignedBoundingBox( Cartesian3.UNIT_X, Cartesian3.UNIT_Y, - Cartesian3.UNIT_Z + Cartesian3.UNIT_Z, ); const bogie = new Cartesian3(2, 3, 4); expect( @@ -165,24 +165,24 @@ describe("Core/AxisAlignedBoundingBox", function () { new AxisAlignedBoundingBox( Cartesian3.UNIT_X, Cartesian3.UNIT_Y, - Cartesian3.UNIT_Z - ) - ) + Cartesian3.UNIT_Z, + ), + ), ).toEqual(true); expect( box.equals( - new AxisAlignedBoundingBox(bogie, Cartesian3.UNIT_Y, Cartesian3.UNIT_Y) - ) + new AxisAlignedBoundingBox(bogie, Cartesian3.UNIT_Y, Cartesian3.UNIT_Y), + ), ).toEqual(false); expect( box.equals( - new AxisAlignedBoundingBox(Cartesian3.UNIT_X, bogie, Cartesian3.UNIT_Z) - ) + new AxisAlignedBoundingBox(Cartesian3.UNIT_X, bogie, Cartesian3.UNIT_Z), + ), ).toEqual(false); expect( box.equals( - new AxisAlignedBoundingBox(Cartesian3.UNIT_X, Cartesian3.UNIT_Y, bogie) - ) + new AxisAlignedBoundingBox(Cartesian3.UNIT_X, Cartesian3.UNIT_Y, bogie), + ), ).toEqual(false); expect(box.equals(undefined)).toEqual(false); }); @@ -197,7 +197,7 @@ describe("Core/AxisAlignedBoundingBox", function () { it("intersectPlane works with box on the positive side of a plane", function () { const box = new AxisAlignedBoundingBox( Cartesian3.negate(Cartesian3.UNIT_X, new Cartesian3()), - Cartesian3.ZERO + Cartesian3.ZERO, ); const normal = Cartesian3.negate(Cartesian3.UNIT_X, new Cartesian3()); const position = Cartesian3.UNIT_X; @@ -208,7 +208,7 @@ describe("Core/AxisAlignedBoundingBox", function () { it("intersectPlane works with box on the negative side of a plane", function () { const box = new AxisAlignedBoundingBox( Cartesian3.negate(Cartesian3.UNIT_X, new Cartesian3()), - Cartesian3.ZERO + Cartesian3.ZERO, ); const normal = Cartesian3.UNIT_X; const position = Cartesian3.UNIT_X; @@ -219,7 +219,7 @@ describe("Core/AxisAlignedBoundingBox", function () { it("intersectPlane works with box intersecting a plane", function () { const box = new AxisAlignedBoundingBox( Cartesian3.ZERO, - Cartesian3.multiplyByScalar(Cartesian3.UNIT_X, 2.0, new Cartesian3()) + Cartesian3.multiplyByScalar(Cartesian3.UNIT_X, 2.0, new Cartesian3()), ); const normal = Cartesian3.UNIT_X; const position = Cartesian3.UNIT_X; diff --git a/packages/engine/Specs/Core/BingMapsGeocoderServiceSpec.js b/packages/engine/Specs/Core/BingMapsGeocoderServiceSpec.js index 9d5dbccfda02..cf707183a611 100644 --- a/packages/engine/Specs/Core/BingMapsGeocoderServiceSpec.js +++ b/packages/engine/Specs/Core/BingMapsGeocoderServiceSpec.js @@ -34,7 +34,7 @@ describe("Core/BingMapsGeocoderService", function () { Resource._Implementations.loadAndExecuteScript = function ( url, functionName, - deferred + deferred, ) { const parsedUrl = new URL(url); expect(parsedUrl.searchParams.get("query")).toEqual(query); @@ -67,7 +67,7 @@ describe("Core/BingMapsGeocoderService", function () { Resource._Implementations.loadAndExecuteScript = function ( url, functionName, - deferred + deferred, ) { const parsedUrl = new URL(url); expect(parsedUrl.searchParams.get("query")).toEqual(query); @@ -90,7 +90,7 @@ describe("Core/BingMapsGeocoderService", function () { Resource._Implementations.loadAndExecuteScript = function ( url, functionName, - deferred + deferred, ) { deferred.resolve(data); }; @@ -111,7 +111,7 @@ describe("Core/BingMapsGeocoderService", function () { Resource._Implementations.loadAndExecuteScript = function ( url, functionName, - deferred + deferred, ) { deferred.resolve(data); }; @@ -125,7 +125,7 @@ describe("Core/BingMapsGeocoderService", function () { expect(service.credit).toBeInstanceOf(Credit); expect(service.credit.html).toEqual( - `<img src="http:\/\/dev.virtualearth.net\/Branding\/logo_powered_by.png"/>` + `<img src="http:\/\/dev.virtualearth.net\/Branding\/logo_powered_by.png"/>`, ); expect(service.credit.showOnScreen).toBe(false); }); diff --git a/packages/engine/Specs/Core/BoundingRectangleSpec.js b/packages/engine/Specs/Core/BoundingRectangleSpec.js index 9046e54b0523..f10b3410c341 100644 --- a/packages/engine/Specs/Core/BoundingRectangleSpec.js +++ b/packages/engine/Specs/Core/BoundingRectangleSpec.js @@ -55,19 +55,19 @@ describe("Core/BoundingRectangle", function () { it("equals", function () { const rectangle = new BoundingRectangle(1.0, 2.0, 3.0, 4.0); expect(rectangle.equals(new BoundingRectangle(1.0, 2.0, 3.0, 4.0))).toEqual( - true + true, ); expect(rectangle.equals(new BoundingRectangle(5.0, 2.0, 3.0, 4.0))).toEqual( - false + false, ); expect(rectangle.equals(new BoundingRectangle(1.0, 6.0, 3.0, 4.0))).toEqual( - false + false, ); expect(rectangle.equals(new BoundingRectangle(1.0, 2.0, 7.0, 4.0))).toEqual( - false + false, ); expect(rectangle.equals(new BoundingRectangle(1.0, 2.0, 3.0, 8.0))).toEqual( - false + false, ); expect(rectangle.equals(undefined)).toEqual(false); }); @@ -123,10 +123,10 @@ describe("Core/BoundingRectangle", function () { rectangle.west, rectangle.south, rectangle.east - rectangle.west, - rectangle.north - rectangle.south + rectangle.north - rectangle.south, ); expect(BoundingRectangle.fromRectangle(rectangle, projection)).toEqual( - expected + expected, ); }); @@ -136,7 +136,7 @@ describe("Core/BoundingRectangle", function () { rectangle.west, rectangle.south, rectangle.east - rectangle.west, - rectangle.north - rectangle.south + rectangle.north - rectangle.south, ); const projection = new GeographicProjection(Ellipsoid.UNIT_SPHERE); @@ -144,7 +144,7 @@ describe("Core/BoundingRectangle", function () { const returnedResult = BoundingRectangle.fromRectangle( rectangle, projection, - result + result, ); expect(result).toBe(returnedResult); expect(returnedResult).toEqual(expected); @@ -157,19 +157,19 @@ describe("Core/BoundingRectangle", function () { const rectangle5 = new BoundingRectangle(2, -6, 4, 4); const rectangle6 = new BoundingRectangle(2, 8, 4, 4); expect(BoundingRectangle.intersect(rectangle1, rectangle2)).toEqual( - Intersect.INTERSECTING + Intersect.INTERSECTING, ); expect(BoundingRectangle.intersect(rectangle1, rectangle3)).toEqual( - Intersect.OUTSIDE + Intersect.OUTSIDE, ); expect(BoundingRectangle.intersect(rectangle1, rectangle4)).toEqual( - Intersect.OUTSIDE + Intersect.OUTSIDE, ); expect(BoundingRectangle.intersect(rectangle1, rectangle5)).toEqual( - Intersect.OUTSIDE + Intersect.OUTSIDE, ); expect(BoundingRectangle.intersect(rectangle1, rectangle6)).toEqual( - Intersect.OUTSIDE + Intersect.OUTSIDE, ); }); @@ -189,7 +189,7 @@ describe("Core/BoundingRectangle", function () { const returnedResult = BoundingRectangle.union( rectangle1, rectangle2, - result + result, ); expect(result).toBe(returnedResult); expect(returnedResult).toEqual(expected); @@ -291,10 +291,9 @@ describe("Core/BoundingRectangle", function () { }).toThrowDeveloperError(); }); - createPackableSpecs(BoundingRectangle, new BoundingRectangle(1, 2, 3, 4), [ - 1, - 2, - 3, - 4, - ]); + createPackableSpecs( + BoundingRectangle, + new BoundingRectangle(1, 2, 3, 4), + [1, 2, 3, 4], + ); }); diff --git a/packages/engine/Specs/Core/BoundingSphereSpec.js b/packages/engine/Specs/Core/BoundingSphereSpec.js index 2ff3b3ade619..82283f4a7d60 100644 --- a/packages/engine/Specs/Core/BoundingSphereSpec.js +++ b/packages/engine/Specs/Core/BoundingSphereSpec.js @@ -125,19 +125,19 @@ describe("Core/BoundingSphere", function () { it("equals", function () { const sphere = new BoundingSphere(new Cartesian3(1.0, 2.0, 3.0), 4.0); expect( - sphere.equals(new BoundingSphere(new Cartesian3(1.0, 2.0, 3.0), 4.0)) + sphere.equals(new BoundingSphere(new Cartesian3(1.0, 2.0, 3.0), 4.0)), ).toEqual(true); expect( - sphere.equals(new BoundingSphere(new Cartesian3(5.0, 2.0, 3.0), 4.0)) + sphere.equals(new BoundingSphere(new Cartesian3(5.0, 2.0, 3.0), 4.0)), ).toEqual(false); expect( - sphere.equals(new BoundingSphere(new Cartesian3(1.0, 6.0, 3.0), 4.0)) + sphere.equals(new BoundingSphere(new Cartesian3(1.0, 6.0, 3.0), 4.0)), ).toEqual(false); expect( - sphere.equals(new BoundingSphere(new Cartesian3(1.0, 2.0, 7.0), 4.0)) + sphere.equals(new BoundingSphere(new Cartesian3(1.0, 2.0, 7.0), 4.0)), ).toEqual(false); expect( - sphere.equals(new BoundingSphere(new Cartesian3(1.0, 2.0, 3.0), 8.0)) + sphere.equals(new BoundingSphere(new Cartesian3(1.0, 2.0, 3.0), 8.0)), ).toEqual(false); expect(sphere.equals(undefined)).toEqual(false); }); @@ -185,7 +185,7 @@ describe("Core/BoundingSphere", function () { positions.push( new Cartesian3(1, 1, 1), new Cartesian3(2, 2, 2), - new Cartesian3(3, 3, 3) + new Cartesian3(3, 3, 3), ); const sphere = BoundingSphere.fromPoints(positions); const radius = sphere.radius; @@ -261,10 +261,10 @@ describe("Core/BoundingSphere", function () { for (let i = 0; i < numElements; i += 3) { expect(positions[i] <= max.x && positions[i] >= min.x).toEqual(true); expect(positions[i + 1] <= max.y && positions[i + 1] >= min.y).toEqual( - true + true, ); expect(positions[i + 2] <= max.z && positions[i + 2] >= min.z).toEqual( - true + true, ); } }); @@ -273,7 +273,7 @@ describe("Core/BoundingSphere", function () { const sphere = BoundingSphere.fromVertices( getPositionsAsFlatArrayWithStride5(), undefined, - 5 + 5, ); expect(sphere.center).toEqual(positionsCenter); expect(sphere.radius).toEqual(positionsRadius); @@ -284,10 +284,10 @@ describe("Core/BoundingSphere", function () { const sphere = BoundingSphere.fromVertices( getPositionsAsFlatArrayWithStride5(), center, - 5 + 5, ); expect(sphere.center).toEqual( - Cartesian3.add(positionsCenter, center, new Cartesian3()) + Cartesian3.add(positionsCenter, center, new Cartesian3()), ); expect(sphere.radius).toEqual(positionsRadius); }); @@ -306,11 +306,11 @@ describe("Core/BoundingSphere", function () { getPositionsAsFlatArrayWithStride5(), center, 5, - result + result, ); expect(sphere).toEqual(result); expect(result.center).toEqual( - Cartesian3.add(positionsCenter, center, new Cartesian3()) + Cartesian3.add(positionsCenter, center, new Cartesian3()), ); expect(result.radius).toEqual(positionsRadius); }); @@ -326,7 +326,7 @@ describe("Core/BoundingSphere", function () { positions.low.length = positions.low.length - 1; const sphere = BoundingSphere.fromEncodedCartesianVertices( positions.high, - positions.low + positions.low, ); expect(sphere.center).toEqual(Cartesian3.ZERO); expect(sphere.radius).toEqual(0.0); @@ -336,7 +336,7 @@ describe("Core/BoundingSphere", function () { const positions = getPositionsAsEncodedFlatArray(); const sphere = BoundingSphere.fromEncodedCartesianVertices( positions.high, - positions.low + positions.low, ); expect(sphere.center).toEqual(positionsCenter); expect(sphere.radius).toEqual(positionsRadius); @@ -346,7 +346,7 @@ describe("Core/BoundingSphere", function () { let positions = getPositionsAsEncodedFlatArray(); const sphere = BoundingSphere.fromEncodedCartesianVertices( positions.high, - positions.low + positions.low, ); const radius = sphere.radius; const center = sphere.center; @@ -374,7 +374,7 @@ describe("Core/BoundingSphere", function () { ]; for (let j = 0; j < appendedPositions.length; ++j) { const encoded = EncodedCartesian3.fromCartesian( - Cartesian3.add(appendedPositions[j], center, new Cartesian3()) + Cartesian3.add(appendedPositions[j], center, new Cartesian3()), ); positions.high.push(encoded.high.x); positions.high.push(encoded.high.y); @@ -386,7 +386,7 @@ describe("Core/BoundingSphere", function () { const sphere = BoundingSphere.fromEncodedCartesianVertices( positions.high, - positions.low + positions.low, ); const radius = sphere.radius; const sphereCenter = sphere.center; @@ -399,10 +399,10 @@ describe("Core/BoundingSphere", function () { for (let i = 0; i < numElements; i += 3) { expect(positions[i] <= max.x && positions[i] >= min.x).toEqual(true); expect(positions[i + 1] <= max.y && positions[i + 1] >= min.y).toEqual( - true + true, ); expect(positions[i + 2] <= max.z && positions[i + 2] >= min.z).toEqual( - true + true, ); } }); @@ -413,7 +413,7 @@ describe("Core/BoundingSphere", function () { const sphere = BoundingSphere.fromEncodedCartesianVertices( positions.high, positions.low, - result + result, ); expect(sphere).toEqual(result); expect(result.center).toEqual(positionsCenter); @@ -432,11 +432,11 @@ describe("Core/BoundingSphere", function () { const expected = new BoundingSphere( Cartesian3.ZERO, Math.sqrt( - rectangle.east * rectangle.east + rectangle.north * rectangle.north - ) + rectangle.east * rectangle.east + rectangle.north * rectangle.north, + ), ); expect(BoundingSphere.fromRectangle2D(rectangle, projection)).toEqual( - expected + expected, ); }); @@ -451,10 +451,10 @@ describe("Core/BoundingSphere", function () { const ellipsoid = Ellipsoid.WGS84; const expected = new BoundingSphere( Cartesian3.ZERO, - ellipsoid.maximumRadius + ellipsoid.maximumRadius, ); expect(BoundingSphere.fromRectangle3D(rectangle, ellipsoid)).toEqual( - expected + expected, ); }); @@ -465,14 +465,14 @@ describe("Core/BoundingSphere", function () { const points = Rectangle.subsample(rectangle, ellipsoid, height); const expected = BoundingSphere.fromPoints(points); expect( - BoundingSphere.fromRectangle3D(rectangle, ellipsoid, height) + BoundingSphere.fromRectangle3D(rectangle, ellipsoid, height), ).toEqual(expected); }); it("fromCornerPoints", function () { const sphere = BoundingSphere.fromCornerPoints( new Cartesian3(-1.0, -0.0, 0.0), - new Cartesian3(1.0, 0.0, 0.0) + new Cartesian3(1.0, 0.0, 0.0), ); expect(sphere).toEqual(new BoundingSphere(Cartesian3.ZERO, 1.0)); }); @@ -482,7 +482,7 @@ describe("Core/BoundingSphere", function () { const result = BoundingSphere.fromCornerPoints( new Cartesian3(0.0, -1.0, 0.0), new Cartesian3(0.0, 1.0, 0.0), - sphere + sphere, ); expect(result).toBe(sphere); expect(result).toEqual(new BoundingSphere(Cartesian3.ZERO, 1.0)); @@ -513,7 +513,7 @@ describe("Core/BoundingSphere", function () { const result = BoundingSphere.fromEllipsoid(ellipsoid, sphere); expect(result).toBe(sphere); expect(result).toEqual( - new BoundingSphere(Cartesian3.ZERO, ellipsoid.maximumRadius) + new BoundingSphere(Cartesian3.ZERO, ellipsoid.maximumRadius), ); }); @@ -548,7 +548,7 @@ describe("Core/BoundingSphere", function () { const sphere = BoundingSphere.fromBoundingSpheres([one, two]); expect(sphere).toEqual( - BoundingSphere.union(one, two, new BoundingSphere()) + BoundingSphere.union(one, two, new BoundingSphere()), ); }); @@ -593,7 +593,7 @@ describe("Core/BoundingSphere", function () { const transformation = Matrix4.fromTranslationQuaternionRotationScale( translation, rotation, - scale + scale, ); const sphere = new BoundingSphere(); @@ -612,7 +612,7 @@ describe("Core/BoundingSphere", function () { const transformation = Matrix4.fromTranslationQuaternionRotationScale( translation, rotation, - scale + scale, ); const sphere = BoundingSphere.fromTransformation(transformation); @@ -662,7 +662,7 @@ describe("Core/BoundingSphere", function () { it("expands to contain another sphere", function () { const bs1 = new BoundingSphere( Cartesian3.negate(Cartesian3.UNIT_X, new Cartesian3()), - 1.0 + 1.0, ); const bs2 = new BoundingSphere(Cartesian3.UNIT_X, 1.0); const expected = new BoundingSphere(Cartesian3.ZERO, 2.0); @@ -688,18 +688,18 @@ describe("Core/BoundingSphere", function () { Cartesian3.multiplyByScalar( Cartesian3.negate(Cartesian3.UNIT_X, new Cartesian3()), 3.0, - new Cartesian3() + new Cartesian3(), ), - 3.0 + 3.0, ); const bs2 = new BoundingSphere(Cartesian3.UNIT_X, 1.0); const expected = new BoundingSphere( Cartesian3.multiplyByScalar( Cartesian3.negate(Cartesian3.UNIT_X, new Cartesian3()), 2.0, - new Cartesian3() + new Cartesian3(), ), - 4.0 + 4.0, ); BoundingSphere.union(bs1, bs2, bs1); expect(bs1).toEqual(expected); @@ -708,12 +708,12 @@ describe("Core/BoundingSphere", function () { it("expands to contain another point", function () { const bs = new BoundingSphere( Cartesian3.negate(Cartesian3.UNIT_X, new Cartesian3()), - 1.0 + 1.0, ); const point = Cartesian3.UNIT_X; const expected = new BoundingSphere( Cartesian3.negate(Cartesian3.UNIT_X, new Cartesian3()), - 2.0 + 2.0, ); expect(BoundingSphere.expand(bs, point)).toEqual(expected); }); @@ -737,7 +737,7 @@ describe("Core/BoundingSphere", function () { const transform = Matrix4.fromTranslation(new Cartesian3(1.0, 2.0, 3.0)); const expected = new BoundingSphere(new Cartesian3(1.0, 2.0, 3.0), 1.0); expect(BoundingSphere.transformWithoutScale(bs, transform)).toEqual( - expected + expected, ); }); @@ -746,7 +746,7 @@ describe("Core/BoundingSphere", function () { const transform = Matrix4.fromScale(new Cartesian3(1.0, 2.0, 3.0)); const expected = new BoundingSphere(Cartesian3.ZERO, 1.0); expect(BoundingSphere.transformWithoutScale(bs, transform)).toEqual( - expected + expected, ); }); @@ -756,7 +756,7 @@ describe("Core/BoundingSphere", function () { const direction = Cartesian3.UNIT_X; const expected = new Interval(1.0, 3.0); expect( - BoundingSphere.computePlaneDistances(bs, position, direction) + BoundingSphere.computePlaneDistances(bs, position, direction), ).toEqual(expected); }); @@ -766,7 +766,7 @@ describe("Core/BoundingSphere", function () { const expected = 1.52786405; expect(BoundingSphere.distanceSquaredTo(bs, position)).toEqualEpsilon( expected, - CesiumMath.EPSILON6 + CesiumMath.EPSILON6, ); }); @@ -783,27 +783,26 @@ describe("Core/BoundingSphere", function () { const positions2D = []; for (let i = 0; i < positions.length; ++i) { const position = positions[i]; - const cartographic = projection.ellipsoid.cartesianToCartographic( - position - ); + const cartographic = + projection.ellipsoid.cartesianToCartographic(position); positions2D.push(projection.project(cartographic)); } const boundingSphere3D = BoundingSphere.fromPoints(positions); const boundingSphere2D = BoundingSphere.projectTo2D( boundingSphere3D, - projection + projection, ); const actualSphere = BoundingSphere.fromPoints(positions2D); actualSphere.center = new Cartesian3( actualSphere.center.z, actualSphere.center.x, - actualSphere.center.y + actualSphere.center.y, ); expect(boundingSphere2D.center).toEqualEpsilon( actualSphere.center, - CesiumMath.EPSILON6 + CesiumMath.EPSILON6, ); expect(boundingSphere2D.radius).toBeGreaterThan(actualSphere.radius); }); @@ -816,9 +815,8 @@ describe("Core/BoundingSphere", function () { const positions2D = []; for (let i = 0; i < positions.length; ++i) { const position = positions[i]; - const cartographic = projection.ellipsoid.cartesianToCartographic( - position - ); + const cartographic = + projection.ellipsoid.cartesianToCartographic(position); positions2D.push(projection.project(cartographic)); } @@ -826,19 +824,19 @@ describe("Core/BoundingSphere", function () { const boundingSphere2D = BoundingSphere.projectTo2D( boundingSphere3D, projection, - sphere + sphere, ); const actualSphere = BoundingSphere.fromPoints(positions2D); actualSphere.center = new Cartesian3( actualSphere.center.z, actualSphere.center.x, - actualSphere.center.y + actualSphere.center.y, ); expect(boundingSphere2D).toBe(sphere); expect(boundingSphere2D.center).toEqualEpsilon( actualSphere.center, - CesiumMath.EPSILON6 + CesiumMath.EPSILON6, ); expect(boundingSphere2D.radius).toBeGreaterThan(actualSphere.radius); }); @@ -995,7 +993,7 @@ describe("Core/BoundingSphere", function () { expect(function () { BoundingSphere.computePlaneDistances( new BoundingSphere(), - new Cartesian3() + new Cartesian3(), ); }).toThrowDeveloperError(); }); @@ -1015,15 +1013,15 @@ describe("Core/BoundingSphere", function () { function expectBoundingSphereToContainPoint( boundingSphere, point, - projection + projection, ) { const pointInCartesian = projection.project(point); let distanceFromCenter = Cartesian3.magnitude( Cartesian3.subtract( pointInCartesian, boundingSphere.center, - new Cartesian3() - ) + new Cartesian3(), + ), ); // The distanceFromCenter for corner points at the height extreme should equal the @@ -1044,7 +1042,7 @@ describe("Core/BoundingSphere", function () { rectangle, projection, minHeight, - maxHeight + maxHeight, ); // Test that the corners are inside the bounding sphere. @@ -1093,56 +1091,56 @@ describe("Core/BoundingSphere", function () { point = new Cartographic( Rectangle.center(rectangle).longitude, rectangle.south, - minHeight + minHeight, ); expectBoundingSphereToContainPoint(boundingSphere, point, projection); point = new Cartographic( Rectangle.center(rectangle).longitude, rectangle.south, - maxHeight + maxHeight, ); expectBoundingSphereToContainPoint(boundingSphere, point, projection); point = new Cartographic( Rectangle.center(rectangle).longitude, rectangle.north, - minHeight + minHeight, ); expectBoundingSphereToContainPoint(boundingSphere, point, projection); point = new Cartographic( Rectangle.center(rectangle).longitude, rectangle.north, - maxHeight + maxHeight, ); expectBoundingSphereToContainPoint(boundingSphere, point, projection); point = new Cartographic( rectangle.west, Rectangle.center(rectangle).latitude, - minHeight + minHeight, ); expectBoundingSphereToContainPoint(boundingSphere, point, projection); point = new Cartographic( rectangle.west, Rectangle.center(rectangle).latitude, - maxHeight + maxHeight, ); expectBoundingSphereToContainPoint(boundingSphere, point, projection); point = new Cartographic( rectangle.east, Rectangle.center(rectangle).latitude, - minHeight + minHeight, ); expectBoundingSphereToContainPoint(boundingSphere, point, projection); point = new Cartographic( rectangle.east, Rectangle.center(rectangle).latitude, - maxHeight + maxHeight, ); expectBoundingSphereToContainPoint(boundingSphere, point, projection); }); @@ -1157,6 +1155,6 @@ describe("Core/BoundingSphere", function () { createPackableSpecs( BoundingSphere, new BoundingSphere(new Cartesian3(1.0, 2.0, 3.0), 4.0), - [1.0, 2.0, 3.0, 4.0] + [1.0, 2.0, 3.0, 4.0], ); }); diff --git a/packages/engine/Specs/Core/BoxGeometrySpec.js b/packages/engine/Specs/Core/BoxGeometrySpec.js index 80ef2af551a1..68d6d490b064 100644 --- a/packages/engine/Specs/Core/BoxGeometrySpec.js +++ b/packages/engine/Specs/Core/BoxGeometrySpec.js @@ -31,7 +31,7 @@ describe("Core/BoxGeometry", function () { minimum: new Cartesian3(-1, -2, -3), maximum: new Cartesian3(1, 2, 3), vertexFormat: VertexFormat.POSITION_ONLY, - }) + }), ); expect(m.attributes.position.values.length).toEqual(8 * 3); // 8 corners @@ -46,7 +46,7 @@ describe("Core/BoxGeometry", function () { minimum: minimumCorner, maximum: maximumCorner, vertexFormat: VertexFormat.ALL, - }) + }), ); const numVertices = 24; //3 points x 8 corners @@ -61,7 +61,7 @@ describe("Core/BoxGeometry", function () { expect(m.boundingSphere.center).toEqual(Cartesian3.ZERO); expect(m.boundingSphere.radius).toEqual( - Cartesian3.magnitude(maximumCorner) * 0.5 + Cartesian3.magnitude(maximumCorner) * 0.5, ); }); @@ -72,7 +72,7 @@ describe("Core/BoxGeometry", function () { maximum: new Cartesian3(1, 2, 3), vertexFormat: VertexFormat.POSITION_ONLY, offsetAttribute: GeometryOffsetAttribute.ALL, - }) + }), ); const numVertices = 8; @@ -103,7 +103,7 @@ describe("Core/BoxGeometry", function () { BoxGeometry.fromDimensions({ dimensions: new Cartesian3(1, 2, 3), vertexFormat: VertexFormat.POSITION_ONLY, - }) + }), ); expect(m.attributes.position.values.length).toEqual(8 * 3); @@ -120,7 +120,7 @@ describe("Core/BoxGeometry", function () { const min = new Cartesian3(-1, -2, -3); const max = new Cartesian3(1, 2, 3); const m = BoxGeometry.fromAxisAlignedBoundingBox( - new AxisAlignedBoundingBox(min, max) + new AxisAlignedBoundingBox(min, max), ); expect(m._minimum).toEqual(min); expect(m._maximum).toEqual(max); @@ -145,6 +145,6 @@ describe("Core/BoxGeometry", function () { maximum: new Cartesian3(4.0, 5.0, 6.0), vertexFormat: VertexFormat.POSITION_AND_NORMAL, }), - [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, -1.0] + [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, -1.0], ); }); diff --git a/packages/engine/Specs/Core/BoxOutlineGeometrySpec.js b/packages/engine/Specs/Core/BoxOutlineGeometrySpec.js index 90a7c3a866c9..080a2ff9a3cf 100644 --- a/packages/engine/Specs/Core/BoxOutlineGeometrySpec.js +++ b/packages/engine/Specs/Core/BoxOutlineGeometrySpec.js @@ -29,7 +29,7 @@ describe("Core/BoxOutlineGeometry", function () { new BoxOutlineGeometry({ minimum: new Cartesian3(-1, -2, -3), maximum: new Cartesian3(1, 2, 3), - }) + }), ); expect(m.attributes.position.values.length).toEqual(8 * 3); @@ -42,7 +42,7 @@ describe("Core/BoxOutlineGeometry", function () { minimum: new Cartesian3(-1, -2, -3), maximum: new Cartesian3(1, 2, 3), offsetAttribute: GeometryOffsetAttribute.ALL, - }) + }), ); const numVertices = 8; @@ -72,7 +72,7 @@ describe("Core/BoxOutlineGeometry", function () { const m = BoxOutlineGeometry.createGeometry( BoxOutlineGeometry.fromDimensions({ dimensions: new Cartesian3(1, 2, 3), - }) + }), ); expect(m.attributes.position.values.length).toEqual(8 * 3); @@ -89,7 +89,7 @@ describe("Core/BoxOutlineGeometry", function () { const min = new Cartesian3(-1, -2, -3); const max = new Cartesian3(1, 2, 3); const m = BoxOutlineGeometry.fromAxisAlignedBoundingBox( - new AxisAlignedBoundingBox(min, max) + new AxisAlignedBoundingBox(min, max), ); expect(m._min).toEqual(min); expect(m._max).toEqual(max); @@ -112,6 +112,6 @@ describe("Core/BoxOutlineGeometry", function () { minimum: new Cartesian3(1.0, 2.0, 3.0), maximum: new Cartesian3(4.0, 5.0, 6.0), }), - [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, -1.0] + [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, -1.0], ); }); diff --git a/packages/engine/Specs/Core/Cartesian2Spec.js b/packages/engine/Specs/Core/Cartesian2Spec.js index d95b5e0fd096..98e27de8fc27 100644 --- a/packages/engine/Specs/Core/Cartesian2Spec.js +++ b/packages/engine/Specs/Core/Cartesian2Spec.js @@ -85,42 +85,42 @@ describe("Core/Cartesian2", function () { second = new Cartesian2(1.0, 0.0); expected = new Cartesian2(1.0, 0.0); expect(Cartesian2.minimumByComponent(first, second, result)).toEqual( - expected + expected, ); first = new Cartesian2(1.0, 0.0); second = new Cartesian2(2.0, 0.0); expected = new Cartesian2(1.0, 0.0); expect(Cartesian2.minimumByComponent(first, second, result)).toEqual( - expected + expected, ); first = new Cartesian2(2.0, -15.0); second = new Cartesian2(1.0, -20.0); expected = new Cartesian2(1.0, -20.0); expect(Cartesian2.minimumByComponent(first, second, result)).toEqual( - expected + expected, ); first = new Cartesian2(2.0, -20.0); second = new Cartesian2(1.0, -15.0); expected = new Cartesian2(1.0, -20.0); expect(Cartesian2.minimumByComponent(first, second, result)).toEqual( - expected + expected, ); first = new Cartesian2(2.0, -15.0); second = new Cartesian2(1.0, -20.0); expected = new Cartesian2(1.0, -20.0); expect(Cartesian2.minimumByComponent(first, second, result)).toEqual( - expected + expected, ); first = new Cartesian2(2.0, -15.0); second = new Cartesian2(1.0, -20.0); expected = new Cartesian2(1.0, -20.0); expect(Cartesian2.minimumByComponent(first, second, result)).toEqual( - expected + expected, ); }); @@ -139,13 +139,13 @@ describe("Core/Cartesian2", function () { const second = new Cartesian2(1.0, 0.0); const expected = new Cartesian2(1.0, 0.0); expect(Cartesian2.minimumByComponent(first, second, first)).toEqual( - expected + expected, ); first.x = 1.0; second.x = 2.0; expect(Cartesian2.minimumByComponent(first, second, second)).toEqual( - expected + expected, ); }); @@ -166,13 +166,13 @@ describe("Core/Cartesian2", function () { const second = new Cartesian2(1.0, 0.0); const expected = new Cartesian2(1.0, 0.0); expect(Cartesian2.minimumByComponent(first, second, expected)).toEqual( - expected + expected, ); second.x = 3.0; expected.x = 2.0; expect(Cartesian2.minimumByComponent(first, second, expected)).toEqual( - expected + expected, ); }); @@ -182,13 +182,13 @@ describe("Core/Cartesian2", function () { const expected = new Cartesian2(0.0, 1.0); const result = new Cartesian2(); expect(Cartesian2.minimumByComponent(first, second, result)).toEqual( - expected + expected, ); second.y = 3.0; expected.y = 2.0; expect(Cartesian2.minimumByComponent(first, second, result)).toEqual( - expected + expected, ); }); @@ -202,42 +202,42 @@ describe("Core/Cartesian2", function () { second = new Cartesian2(1.0, 0.0); expected = new Cartesian2(2.0, 0.0); expect(Cartesian2.maximumByComponent(first, second, result)).toEqual( - expected + expected, ); first = new Cartesian2(1.0, 0.0); second = new Cartesian2(2.0, 0.0); expected = new Cartesian2(2.0, 0.0); expect(Cartesian2.maximumByComponent(first, second, result)).toEqual( - expected + expected, ); first = new Cartesian2(2.0, -15.0); second = new Cartesian2(1.0, -20.0); expected = new Cartesian2(2.0, -15.0); expect(Cartesian2.maximumByComponent(first, second, result)).toEqual( - expected + expected, ); first = new Cartesian2(2.0, -20.0); second = new Cartesian2(1.0, -15.0); expected = new Cartesian2(2.0, -15.0); expect(Cartesian2.maximumByComponent(first, second, result)).toEqual( - expected + expected, ); first = new Cartesian2(2.0, -15.0); second = new Cartesian2(1.0, -20.0); expected = new Cartesian2(2.0, -15.0); expect(Cartesian2.maximumByComponent(first, second, result)).toEqual( - expected + expected, ); first = new Cartesian2(2.0, -15.0); second = new Cartesian2(1.0, -20.0); expected = new Cartesian2(2.0, -15.0); expect(Cartesian2.maximumByComponent(first, second, result)).toEqual( - expected + expected, ); }); @@ -256,13 +256,13 @@ describe("Core/Cartesian2", function () { const second = new Cartesian2(1.0, 0.0); const expected = new Cartesian2(2.0, 0.0); expect(Cartesian2.maximumByComponent(first, second, first)).toEqual( - expected + expected, ); first.x = 1.0; second.x = 2.0; expect(Cartesian2.maximumByComponent(first, second, second)).toEqual( - expected + expected, ); }); @@ -284,13 +284,13 @@ describe("Core/Cartesian2", function () { const expected = new Cartesian2(2.0, 0.0); const result = new Cartesian2(); expect(Cartesian2.maximumByComponent(first, second, result)).toEqual( - expected + expected, ); second.x = 3.0; expected.x = 3.0; expect(Cartesian2.maximumByComponent(first, second, result)).toEqual( - expected + expected, ); }); @@ -300,13 +300,13 @@ describe("Core/Cartesian2", function () { const expected = new Cartesian2(0.0, 2.0); const result = new Cartesian2(); expect(Cartesian2.maximumByComponent(first, second, result)).toEqual( - expected + expected, ); second.y = 3.0; expected.y = 3.0; expect(Cartesian2.maximumByComponent(first, second, result)).toEqual( - expected + expected, ); }); @@ -422,7 +422,7 @@ describe("Core/Cartesian2", function () { it("distance", function () { const distance = Cartesian2.distance( new Cartesian2(1.0, 0.0), - new Cartesian2(2.0, 0.0) + new Cartesian2(2.0, 0.0), ); expect(distance).toEqual(1.0); }); @@ -442,7 +442,7 @@ describe("Core/Cartesian2", function () { it("distanceSquared", function () { const distanceSquared = Cartesian2.distanceSquared( new Cartesian2(1.0, 0.0), - new Cartesian2(3.0, 0.0) + new Cartesian2(3.0, 0.0), ); expect(distanceSquared).toEqual(4.0); }); @@ -582,7 +582,7 @@ describe("Core/Cartesian2", function () { const returnedResult = Cartesian2.multiplyByScalar( cartesian, scalar, - result + result, ); expect(result).toBe(returnedResult); expect(result).toEqual(expectedResult); @@ -595,7 +595,7 @@ describe("Core/Cartesian2", function () { const returnedResult = Cartesian2.multiplyByScalar( cartesian, scalar, - cartesian + cartesian, ); expect(cartesian).toBe(returnedResult); expect(cartesian).toEqual(expectedResult); @@ -618,7 +618,7 @@ describe("Core/Cartesian2", function () { const returnedResult = Cartesian2.divideByScalar( cartesian, scalar, - cartesian + cartesian, ); expect(cartesian).toBe(returnedResult); expect(cartesian).toEqual(expectedResult); @@ -709,11 +709,11 @@ describe("Core/Cartesian2", function () { const y = new Cartesian2(1.0, 1.0); expect(Cartesian2.angleBetween(x, y)).toEqualEpsilon( CesiumMath.PI_OVER_FOUR, - CesiumMath.EPSILON14 + CesiumMath.EPSILON14, ); expect(Cartesian2.angleBetween(y, x)).toEqualEpsilon( CesiumMath.PI_OVER_FOUR, - CesiumMath.EPSILON14 + CesiumMath.EPSILON14, ); }); @@ -722,11 +722,11 @@ describe("Core/Cartesian2", function () { const y = new Cartesian2(-1.0, -1.0); expect(Cartesian2.angleBetween(x, y)).toEqualEpsilon( (CesiumMath.PI * 3.0) / 4.0, - CesiumMath.EPSILON14 + CesiumMath.EPSILON14, ); expect(Cartesian2.angleBetween(y, x)).toEqualEpsilon( (CesiumMath.PI * 3.0) / 4.0, - CesiumMath.EPSILON14 + CesiumMath.EPSILON14, ); }); @@ -738,27 +738,27 @@ describe("Core/Cartesian2", function () { it("most orthogonal angle is x", function () { const v = new Cartesian2(0.0, 1.0); expect(Cartesian2.mostOrthogonalAxis(v, new Cartesian2())).toEqual( - Cartesian2.UNIT_X + Cartesian2.UNIT_X, ); }); it("most orthogonal angle is y", function () { const v = new Cartesian2(1.0, 0.0); expect(Cartesian2.mostOrthogonalAxis(v, new Cartesian2())).toEqual( - Cartesian2.UNIT_Y + Cartesian2.UNIT_Y, ); }); it("equals", function () { const cartesian = new Cartesian2(1.0, 2.0); expect(Cartesian2.equals(cartesian, new Cartesian2(1.0, 2.0))).toEqual( - true + true, ); expect(Cartesian2.equals(cartesian, new Cartesian2(2.0, 2.0))).toEqual( - false + false, ); expect(Cartesian2.equals(cartesian, new Cartesian2(2.0, 1.0))).toEqual( - false + false, ); expect(Cartesian2.equals(cartesian, undefined)).toEqual(false); }); @@ -766,49 +766,49 @@ describe("Core/Cartesian2", function () { it("equalsEpsilon", function () { let cartesian = new Cartesian2(1.0, 2.0); expect(cartesian.equalsEpsilon(new Cartesian2(1.0, 2.0), 0.0)).toEqual( - true + true, ); expect(cartesian.equalsEpsilon(new Cartesian2(1.0, 2.0), 1.0)).toEqual( - true + true, ); expect(cartesian.equalsEpsilon(new Cartesian2(2.0, 2.0), 1.0)).toEqual( - true + true, ); expect(cartesian.equalsEpsilon(new Cartesian2(1.0, 3.0), 1.0)).toEqual( - true + true, ); expect( - cartesian.equalsEpsilon(new Cartesian2(1.0, 3.0), CesiumMath.EPSILON6) + cartesian.equalsEpsilon(new Cartesian2(1.0, 3.0), CesiumMath.EPSILON6), ).toEqual(false); expect(cartesian.equalsEpsilon(undefined, 1)).toEqual(false); cartesian = new Cartesian2(3000000.0, 4000000.0); expect( - cartesian.equalsEpsilon(new Cartesian2(3000000.0, 4000000.0), 0.0) + cartesian.equalsEpsilon(new Cartesian2(3000000.0, 4000000.0), 0.0), ).toEqual(true); expect( cartesian.equalsEpsilon( new Cartesian2(3000000.0, 4000000.2), - CesiumMath.EPSILON7 - ) + CesiumMath.EPSILON7, + ), ).toEqual(true); expect( cartesian.equalsEpsilon( new Cartesian2(3000000.2, 4000000.0), - CesiumMath.EPSILON7 - ) + CesiumMath.EPSILON7, + ), ).toEqual(true); expect( cartesian.equalsEpsilon( new Cartesian2(3000000.2, 4000000.2), - CesiumMath.EPSILON7 - ) + CesiumMath.EPSILON7, + ), ).toEqual(true); expect( cartesian.equalsEpsilon( new Cartesian2(3000000.2, 4000000.2), - CesiumMath.EPSILON9 - ) + CesiumMath.EPSILON9, + ), ).toEqual(false); expect(cartesian.equalsEpsilon(undefined, 1)).toEqual(false); @@ -1100,6 +1100,6 @@ describe("Core/Cartesian2", function () { Cartesian2, [new Cartesian2(1, 2), new Cartesian2(3, 4)], [1, 2, 3, 4], - 2 + 2, ); }); diff --git a/packages/engine/Specs/Core/Cartesian3Spec.js b/packages/engine/Specs/Core/Cartesian3Spec.js index 09d9b13ff264..d2cae1feef9d 100644 --- a/packages/engine/Specs/Core/Cartesian3Spec.js +++ b/packages/engine/Specs/Core/Cartesian3Spec.js @@ -40,7 +40,7 @@ describe("Core/Cartesian3", function () { const existing = new Cartesian3(); expect(cartesian).toEqualEpsilon( Cartesian3.fromSpherical(spherical, existing), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); expect(cartesian).toEqualEpsilon(existing, CesiumMath.EPSILON15); }); @@ -118,42 +118,42 @@ describe("Core/Cartesian3", function () { second = new Cartesian3(1.0, 0.0, 0.0); expected = new Cartesian3(1.0, 0.0, 0.0); expect(Cartesian3.minimumByComponent(first, second, result)).toEqual( - expected + expected, ); first = new Cartesian3(1.0, 0.0, 0.0); second = new Cartesian3(2.0, 0.0, 0.0); expected = new Cartesian3(1.0, 0.0, 0.0); expect(Cartesian3.minimumByComponent(first, second, result)).toEqual( - expected + expected, ); first = new Cartesian3(2.0, -15.0, 0.0); second = new Cartesian3(1.0, -20.0, 0.0); expected = new Cartesian3(1.0, -20.0, 0.0); expect(Cartesian3.minimumByComponent(first, second, result)).toEqual( - expected + expected, ); first = new Cartesian3(2.0, -20.0, 0.0); second = new Cartesian3(1.0, -15.0, 0.0); expected = new Cartesian3(1.0, -20.0, 0.0); expect(Cartesian3.minimumByComponent(first, second, result)).toEqual( - expected + expected, ); first = new Cartesian3(2.0, -15.0, 26.4); second = new Cartesian3(1.0, -20.0, 26.5); expected = new Cartesian3(1.0, -20.0, 26.4); expect(Cartesian3.minimumByComponent(first, second, result)).toEqual( - expected + expected, ); first = new Cartesian3(2.0, -15.0, 26.5); second = new Cartesian3(1.0, -20.0, 26.4); expected = new Cartesian3(1.0, -20.0, 26.4); expect(Cartesian3.minimumByComponent(first, second, result)).toEqual( - expected + expected, ); }); @@ -172,13 +172,13 @@ describe("Core/Cartesian3", function () { const second = new Cartesian3(1.0, 0.0, 0.0); const expected = new Cartesian3(1.0, 0.0, 0.0); expect(Cartesian3.minimumByComponent(first, second, first)).toEqual( - expected + expected, ); first.x = 1.0; second.x = 2.0; expect(Cartesian3.minimumByComponent(first, second, second)).toEqual( - expected + expected, ); }); @@ -200,13 +200,13 @@ describe("Core/Cartesian3", function () { const expected = new Cartesian3(1.0, 0.0, 0.0); const result = new Cartesian3(); expect(Cartesian3.minimumByComponent(first, second, result)).toEqual( - expected + expected, ); second.x = 3.0; expected.x = 2.0; expect(Cartesian3.minimumByComponent(first, second, result)).toEqual( - expected + expected, ); }); @@ -216,13 +216,13 @@ describe("Core/Cartesian3", function () { const expected = new Cartesian3(0.0, 1.0, 0.0); const result = new Cartesian3(); expect(Cartesian3.minimumByComponent(first, second, result)).toEqual( - expected + expected, ); second.y = 3.0; expected.y = 2.0; expect(Cartesian3.minimumByComponent(first, second, result)).toEqual( - expected + expected, ); }); @@ -232,13 +232,13 @@ describe("Core/Cartesian3", function () { const expected = new Cartesian3(0.0, 0.0, 1.0); const result = new Cartesian3(); expect(Cartesian3.minimumByComponent(first, second, result)).toEqual( - expected + expected, ); second.z = 3.0; expected.z = 2.0; expect(Cartesian3.minimumByComponent(first, second, result)).toEqual( - expected + expected, ); }); @@ -252,42 +252,42 @@ describe("Core/Cartesian3", function () { second = new Cartesian3(1.0, 0.0, 0.0); expected = new Cartesian3(2.0, 0.0, 0.0); expect(Cartesian3.maximumByComponent(first, second, result)).toEqual( - expected + expected, ); first = new Cartesian3(1.0, 0.0, 0.0); second = new Cartesian3(2.0, 0.0, 0.0); expected = new Cartesian3(2.0, 0.0, 0.0); expect(Cartesian3.maximumByComponent(first, second, result)).toEqual( - expected + expected, ); first = new Cartesian3(2.0, -15.0, 0.0); second = new Cartesian3(1.0, -20.0, 0.0); expected = new Cartesian3(2.0, -15.0, 0.0); expect(Cartesian3.maximumByComponent(first, second, result)).toEqual( - expected + expected, ); first = new Cartesian3(2.0, -20.0, 0.0); second = new Cartesian3(1.0, -15.0, 0.0); expected = new Cartesian3(2.0, -15.0, 0.0); expect(Cartesian3.maximumByComponent(first, second, result)).toEqual( - expected + expected, ); first = new Cartesian3(2.0, -15.0, 26.4); second = new Cartesian3(1.0, -20.0, 26.5); expected = new Cartesian3(2.0, -15.0, 26.5); expect(Cartesian3.maximumByComponent(first, second, result)).toEqual( - expected + expected, ); first = new Cartesian3(2.0, -15.0, 26.5); second = new Cartesian3(1.0, -20.0, 26.4); expected = new Cartesian3(2.0, -15.0, 26.5); expect(Cartesian3.maximumByComponent(first, second, result)).toEqual( - expected + expected, ); }); @@ -306,13 +306,13 @@ describe("Core/Cartesian3", function () { const second = new Cartesian3(1.0, 0.0, 0.0); const expected = new Cartesian3(2.0, 0.0, 0.0); expect(Cartesian3.maximumByComponent(first, second, first)).toEqual( - expected + expected, ); first.x = 1.0; second.x = 2.0; expect(Cartesian3.maximumByComponent(first, second, second)).toEqual( - expected + expected, ); }); @@ -334,13 +334,13 @@ describe("Core/Cartesian3", function () { const expected = new Cartesian3(2.0, 0.0, 0.0); const result = new Cartesian3(); expect(Cartesian3.maximumByComponent(first, second, result)).toEqual( - expected + expected, ); second.x = 3.0; expected.x = 3.0; expect(Cartesian3.maximumByComponent(first, second, result)).toEqual( - expected + expected, ); }); @@ -350,13 +350,13 @@ describe("Core/Cartesian3", function () { const expected = new Cartesian3(0.0, 2.0, 0.0); const result = new Cartesian3(); expect(Cartesian3.maximumByComponent(first, second, result)).toEqual( - expected + expected, ); second.y = 3.0; expected.y = 3.0; expect(Cartesian3.maximumByComponent(first, second, result)).toEqual( - expected + expected, ); }); @@ -366,13 +366,13 @@ describe("Core/Cartesian3", function () { const expected = new Cartesian3(0.0, 0.0, 2.0); const result = new Cartesian3(); expect(Cartesian3.maximumByComponent(first, second, result)).toEqual( - expected + expected, ); second.z = 3.0; expected.z = 3.0; expect(Cartesian3.maximumByComponent(first, second, result)).toEqual( - expected + expected, ); }); @@ -488,7 +488,7 @@ describe("Core/Cartesian3", function () { it("distance", function () { const distance = Cartesian3.distance( new Cartesian3(1.0, 0.0, 0.0), - new Cartesian3(2.0, 0.0, 0.0) + new Cartesian3(2.0, 0.0, 0.0), ); expect(distance).toEqual(1.0); }); @@ -508,7 +508,7 @@ describe("Core/Cartesian3", function () { it("distanceSquared", function () { const distanceSquared = Cartesian3.distanceSquared( new Cartesian3(1.0, 0.0, 0.0), - new Cartesian3(3.0, 0.0, 0.0) + new Cartesian3(3.0, 0.0, 0.0), ); expect(distanceSquared).toEqual(4.0); }); @@ -640,7 +640,7 @@ describe("Core/Cartesian3", function () { const returnedResult = Cartesian3.multiplyByScalar( cartesian, scalar, - result + result, ); expect(result).toBe(returnedResult); expect(result).toEqual(expectedResult); @@ -653,7 +653,7 @@ describe("Core/Cartesian3", function () { const returnedResult = Cartesian3.multiplyByScalar( cartesian, scalar, - cartesian + cartesian, ); expect(cartesian).toBe(returnedResult); expect(cartesian).toEqual(expectedResult); @@ -676,7 +676,7 @@ describe("Core/Cartesian3", function () { const returnedResult = Cartesian3.divideByScalar( cartesian, scalar, - cartesian + cartesian, ); expect(cartesian).toBe(returnedResult); expect(cartesian).toEqual(expectedResult); @@ -781,11 +781,11 @@ describe("Core/Cartesian3", function () { const y = new Cartesian3(1.0, 1.0, 0.0); expect(Cartesian3.angleBetween(x, y)).toEqualEpsilon( CesiumMath.PI_OVER_FOUR, - CesiumMath.EPSILON14 + CesiumMath.EPSILON14, ); expect(Cartesian3.angleBetween(y, x)).toEqualEpsilon( CesiumMath.PI_OVER_FOUR, - CesiumMath.EPSILON14 + CesiumMath.EPSILON14, ); }); @@ -794,11 +794,11 @@ describe("Core/Cartesian3", function () { const y = new Cartesian3(0.0, -1.0, -1.0); expect(Cartesian3.angleBetween(x, y)).toEqualEpsilon( (CesiumMath.PI * 3.0) / 4.0, - CesiumMath.EPSILON14 + CesiumMath.EPSILON14, ); expect(Cartesian3.angleBetween(y, x)).toEqualEpsilon( (CesiumMath.PI * 3.0) / 4.0, - CesiumMath.EPSILON14 + CesiumMath.EPSILON14, ); }); @@ -810,42 +810,42 @@ describe("Core/Cartesian3", function () { it("most orthogonal angle is x", function () { const v = new Cartesian3(0.0, 1.0, 2.0); expect(Cartesian3.mostOrthogonalAxis(v, new Cartesian3())).toEqual( - Cartesian3.UNIT_X + Cartesian3.UNIT_X, ); }); it("most orthogonal angle is y", function () { const v = new Cartesian3(1.0, 0.0, 2.0); expect(Cartesian3.mostOrthogonalAxis(v, new Cartesian3())).toEqual( - Cartesian3.UNIT_Y + Cartesian3.UNIT_Y, ); }); it("most orthogonal angle is z", function () { let v = new Cartesian3(1.0, 3.0, 0.0); expect(Cartesian3.mostOrthogonalAxis(v, new Cartesian3())).toEqual( - Cartesian3.UNIT_Z + Cartesian3.UNIT_Z, ); v = new Cartesian3(3.0, 1.0, 0.0); expect(Cartesian3.mostOrthogonalAxis(v, new Cartesian3())).toEqual( - Cartesian3.UNIT_Z + Cartesian3.UNIT_Z, ); }); it("equals", function () { const cartesian = new Cartesian3(1.0, 2.0, 3.0); expect(Cartesian3.equals(cartesian, new Cartesian3(1.0, 2.0, 3.0))).toEqual( - true + true, ); expect(Cartesian3.equals(cartesian, new Cartesian3(2.0, 2.0, 3.0))).toEqual( - false + false, ); expect(Cartesian3.equals(cartesian, new Cartesian3(2.0, 1.0, 3.0))).toEqual( - false + false, ); expect(Cartesian3.equals(cartesian, new Cartesian3(1.0, 2.0, 4.0))).toEqual( - false + false, ); expect(Cartesian3.equals(cartesian, undefined)).toEqual(false); }); @@ -853,37 +853,37 @@ describe("Core/Cartesian3", function () { it("equalsEpsilon", function () { let cartesian = new Cartesian3(1.0, 2.0, 3.0); expect(cartesian.equalsEpsilon(new Cartesian3(1.0, 2.0, 3.0), 0.0)).toEqual( - true + true, ); expect(cartesian.equalsEpsilon(new Cartesian3(1.0, 2.0, 3.0), 1.0)).toEqual( - true + true, ); expect(cartesian.equalsEpsilon(new Cartesian3(2.0, 2.0, 3.0), 1.0)).toEqual( - true + true, ); expect(cartesian.equalsEpsilon(new Cartesian3(1.0, 3.0, 3.0), 1.0)).toEqual( - true + true, ); expect(cartesian.equalsEpsilon(new Cartesian3(1.0, 2.0, 4.0), 1.0)).toEqual( - true + true, ); expect( cartesian.equalsEpsilon( new Cartesian3(2.0, 2.0, 3.0), - CesiumMath.EPSILON6 - ) + CesiumMath.EPSILON6, + ), ).toEqual(false); expect( cartesian.equalsEpsilon( new Cartesian3(1.0, 3.0, 3.0), - CesiumMath.EPSILON6 - ) + CesiumMath.EPSILON6, + ), ).toEqual(false); expect( cartesian.equalsEpsilon( new Cartesian3(1.0, 2.0, 4.0), - CesiumMath.EPSILON6 - ) + CesiumMath.EPSILON6, + ), ).toEqual(false); expect(cartesian.equalsEpsilon(undefined, 1)).toEqual(false); @@ -891,38 +891,38 @@ describe("Core/Cartesian3", function () { expect( cartesian.equalsEpsilon( new Cartesian3(3000000.0, 4000000.0, 5000000.0), - 0.0 - ) + 0.0, + ), ).toEqual(true); expect( cartesian.equalsEpsilon( new Cartesian3(3000000.2, 4000000.0, 5000000.0), - CesiumMath.EPSILON7 - ) + CesiumMath.EPSILON7, + ), ).toEqual(true); expect( cartesian.equalsEpsilon( new Cartesian3(3000000.0, 4000000.2, 5000000.0), - CesiumMath.EPSILON7 - ) + CesiumMath.EPSILON7, + ), ).toEqual(true); expect( cartesian.equalsEpsilon( new Cartesian3(3000000.0, 4000000.0, 5000000.2), - CesiumMath.EPSILON7 - ) + CesiumMath.EPSILON7, + ), ).toEqual(true); expect( cartesian.equalsEpsilon( new Cartesian3(3000000.2, 4000000.2, 5000000.2), - CesiumMath.EPSILON7 - ) + CesiumMath.EPSILON7, + ), ).toEqual(true); expect( cartesian.equalsEpsilon( new Cartesian3(3000000.2, 4000000.2, 5000000.2), - CesiumMath.EPSILON9 - ) + CesiumMath.EPSILON9, + ), ).toEqual(false); expect(cartesian.equalsEpsilon(undefined, 1)).toEqual(false); @@ -1208,7 +1208,7 @@ describe("Core/Cartesian3", function () { const ellipsoid = Ellipsoid.WGS84; const actual = Cartesian3.fromDegrees(lon, lat); const expected = ellipsoid.cartographicToCartesian( - Cartographic.fromDegrees(lon, lat) + Cartographic.fromDegrees(lon, lat), ); expect(actual).toEqual(expected); }); @@ -1220,7 +1220,7 @@ describe("Core/Cartesian3", function () { const ellipsoid = Ellipsoid.WGS84; const actual = Cartesian3.fromDegrees(lon, lat, height); const expected = ellipsoid.cartographicToCartesian( - Cartographic.fromDegrees(lon, lat, height) + Cartographic.fromDegrees(lon, lat, height), ); expect(actual).toEqual(expected); }); @@ -1233,7 +1233,7 @@ describe("Core/Cartesian3", function () { const result = new Cartesian3(); const actual = Cartesian3.fromDegrees(lon, lat, height, ellipsoid, result); const expected = ellipsoid.cartographicToCartesian( - Cartographic.fromDegrees(lon, lat, height) + Cartographic.fromDegrees(lon, lat, height), ); expect(actual).toEqual(expected); expect(actual).toBe(result); @@ -1257,7 +1257,7 @@ describe("Core/Cartesian3", function () { const expectedPosition = new Cartesian3( 1593514.338295244, 691991.9979835141, - 20442.318221152018 + 20442.318221152018, ); const position = Cartesian3.fromDegrees(23.47315, 0.67416); @@ -1270,7 +1270,7 @@ describe("Core/Cartesian3", function () { const ellipsoid = Ellipsoid.WGS84; const actual = Cartesian3.fromRadians(lon, lat); const expected = ellipsoid.cartographicToCartesian( - new Cartographic(lon, lat) + new Cartographic(lon, lat), ); expect(actual).toEqual(expected); }); @@ -1282,7 +1282,7 @@ describe("Core/Cartesian3", function () { const ellipsoid = Ellipsoid.WGS84; const actual = Cartesian3.fromRadians(lon, lat, height); const expected = ellipsoid.cartographicToCartesian( - new Cartographic(lon, lat, height) + new Cartographic(lon, lat, height), ); expect(actual).toEqual(expected); }); @@ -1295,7 +1295,7 @@ describe("Core/Cartesian3", function () { const result = new Cartesian3(); const actual = Cartesian3.fromRadians(lon, lat, height, ellipsoid, result); const expected = ellipsoid.cartographicToCartesian( - new Cartographic(lon, lat, height) + new Cartographic(lon, lat, height), ); expect(actual).toEqual(expected); expect(actual).toBe(result); @@ -1307,7 +1307,7 @@ describe("Core/Cartesian3", function () { const expectedPosition = new Cartesian3( 1593514.3406204558, 691991.9927155221, - 20442.315293410087 + 20442.315293410087, ); const position = Cartesian3.fromRadians(0.40968375, 0.01176631); @@ -1349,18 +1349,13 @@ describe("Core/Cartesian3", function () { new Cartesian3( 1653831.6133167143, -520773.6558050613, - -110428.9555038242 + -110428.9555038242, ), new Cartesian3(1556660.3478111108, 98714.16930719782, 765259.9782626687), ]; const positions = Cartesian3.fromDegreesArray([ - 23.47315, - 0.67416, - 342.52135, - -3.64417, - 3.6285, - 26.13341, + 23.47315, 0.67416, 342.52135, -3.64417, 3.6285, 26.13341, ]); expect(positions).toEqualEpsilon(expectedPositions, CesiumMath.EPSILON8); }); @@ -1409,7 +1404,7 @@ describe("Core/Cartesian3", function () { const actual = Cartesian3.fromRadiansArray( [lon1, lat1, lon2, lat2], ellipsoid, - result + result, ); const expected = ellipsoid.cartographicArrayToCartesianArray([ new Cartographic(lon1, lat1), @@ -1427,18 +1422,13 @@ describe("Core/Cartesian3", function () { new Cartesian3( 1653831.6107836158, -520773.6656886929, - -110428.94683022468 + -110428.94683022468, ), new Cartesian3(1556660.3474447567, 98714.16630095398, 765259.9793956806), ]; const positions = Cartesian3.fromRadiansArray([ - 0.40968375, - 0.01176631, - 5.97812531, - -0.06360276, - 0.06332927, - 0.45611405, + 0.40968375, 0.01176631, 5.97812531, -0.06360276, 0.06332927, 0.45611405, ]); expect(positions).toEqualEpsilon(expectedPositions, CesiumMath.EPSILON8); }); @@ -1493,21 +1483,13 @@ describe("Core/Cartesian3", function () { new Cartesian3( 1653926.8033485617, -520803.63011470815, - -110435.31149297487 + -110435.31149297487, ), new Cartesian3(1556749.9449302435, 98719.85102524245, 765304.0245374623), ]; const positions = Cartesian3.fromDegreesArrayHeights([ - 23.47315, - 0.67416, - 100, - 342.52135, - -3.64417, - 100, - 3.6285, - 26.13341, - 100, + 23.47315, 0.67416, 100, 342.52135, -3.64417, 100, 3.6285, 26.13341, 100, ]); expect(positions).toEqualEpsilon(expectedPositions, CesiumMath.EPSILON8); }); @@ -1567,7 +1549,7 @@ describe("Core/Cartesian3", function () { const actual = Cartesian3.fromRadiansArrayHeights( [lon1, lat1, alt1, lon2, lat2, alt2], ellipsoid, - result + result, ); const expected = ellipsoid.cartographicArrayToCartesianArray([ new Cartographic(lon1, lat1, alt1), @@ -1585,21 +1567,14 @@ describe("Core/Cartesian3", function () { new Cartesian3( 1653926.8008153175, -520803.6399989086, - -110435.30281887612 + -110435.30281887612, ), new Cartesian3(1556749.9445638682, 98719.84801882556, 765304.0256705394), ]; const positions = Cartesian3.fromRadiansArrayHeights([ - 0.40968375, - 0.01176631, - 100, - 5.97812531, - -0.06360276, - 100, - 0.06332927, - 0.45611405, - 100, + 0.40968375, 0.01176631, 100, 5.97812531, -0.06360276, 100, 0.06332927, + 0.45611405, 100, ]); expect(positions).toEqualEpsilon(expectedPositions, CesiumMath.EPSILON8); }); @@ -1729,21 +1704,21 @@ describe("Core/Cartesian3", function () { return Cartesian3.projectVector( undefined, new Cartesian3(), - new Cartesian3() + new Cartesian3(), ); }).toThrowDeveloperError(); expect(function () { return Cartesian3.projectVector( new Cartesian3(), undefined, - new Cartesian3() + new Cartesian3(), ); }).toThrowDeveloperError(); expect(function () { return Cartesian3.projectVector( new Cartesian3(), new Cartesian3(), - undefined + undefined, ); }).toThrowDeveloperError(); }); @@ -1753,6 +1728,6 @@ describe("Core/Cartesian3", function () { Cartesian3, [new Cartesian3(1, 2, 3), new Cartesian3(4, 5, 6)], [1, 2, 3, 4, 5, 6], - 3 + 3, ); }); diff --git a/packages/engine/Specs/Core/Cartesian4Spec.js b/packages/engine/Specs/Core/Cartesian4Spec.js index b9146991493a..41bea584dc9b 100644 --- a/packages/engine/Specs/Core/Cartesian4Spec.js +++ b/packages/engine/Specs/Core/Cartesian4Spec.js @@ -65,7 +65,7 @@ describe("Core/Cartesian4", function () { const cartesian4 = new Cartesian4(); const result = Cartesian4.fromColor( new Color(1.0, 2.0, 3.0, 4.0), - cartesian4 + cartesian4, ); expect(cartesian4).toBe(result); expect(cartesian4).toEqual(new Cartesian4(1.0, 2.0, 3.0, 4.0)); @@ -149,56 +149,56 @@ describe("Core/Cartesian4", function () { second = new Cartesian4(1.0, 0.0, 0.0, 0.0); expected = new Cartesian4(1.0, 0.0, 0.0, 0.0); expect(Cartesian4.minimumByComponent(first, second, result)).toEqual( - expected + expected, ); first = new Cartesian4(1.0, 0.0, 0.0, 0.0); second = new Cartesian4(2.0, 0.0, 0.0, 0.0); expected = new Cartesian4(1.0, 0.0, 0.0, 0.0); expect(Cartesian4.minimumByComponent(first, second, result)).toEqual( - expected + expected, ); first = new Cartesian4(2.0, -15.0, 0.0, 0.0); second = new Cartesian4(1.0, -20.0, 0.0, 0.0); expected = new Cartesian4(1.0, -20.0, 0.0, 0.0); expect(Cartesian4.minimumByComponent(first, second, result)).toEqual( - expected + expected, ); first = new Cartesian4(2.0, -20.0, 0.0, 0.0); second = new Cartesian4(1.0, -15.0, 0.0, 0.0); expected = new Cartesian4(1.0, -20.0, 0.0, 0.0); expect(Cartesian4.minimumByComponent(first, second, result)).toEqual( - expected + expected, ); first = new Cartesian4(2.0, -15.0, 26.4, 0.0); second = new Cartesian4(1.0, -20.0, 26.5, 0.0); expected = new Cartesian4(1.0, -20.0, 26.4, 0.0); expect(Cartesian4.minimumByComponent(first, second, result)).toEqual( - expected + expected, ); first = new Cartesian4(2.0, -15.0, 26.5, 0.0); second = new Cartesian4(1.0, -20.0, 26.4, 0.0); expected = new Cartesian4(1.0, -20.0, 26.4, 0.0); expect(Cartesian4.minimumByComponent(first, second, result)).toEqual( - expected + expected, ); first = new Cartesian4(2.0, -15.0, 26.4, -450.0); second = new Cartesian4(1.0, -20.0, 26.5, 450.0); expected = new Cartesian4(1.0, -20.0, 26.4, -450.0); expect(Cartesian4.minimumByComponent(first, second, result)).toEqual( - expected + expected, ); first = new Cartesian4(2.0, -15.0, 26.5, 450.0); second = new Cartesian4(1.0, -20.0, 26.4, -450.0); expected = new Cartesian4(1.0, -20.0, 26.4, -450.0); expect(Cartesian4.minimumByComponent(first, second, result)).toEqual( - expected + expected, ); }); @@ -217,13 +217,13 @@ describe("Core/Cartesian4", function () { const second = new Cartesian4(1.0, 0.0, 0.0, 0.0); const expected = new Cartesian4(1.0, 0.0, 0.0, 0.0); expect(Cartesian4.minimumByComponent(first, second, first)).toEqual( - expected + expected, ); first.x = 1.0; second.x = 2.0; expect(Cartesian4.minimumByComponent(first, second, second)).toEqual( - expected + expected, ); }); @@ -245,13 +245,13 @@ describe("Core/Cartesian4", function () { const expected = new Cartesian4(1.0, 0.0, 0.0, 0.0); const result = new Cartesian4(); expect(Cartesian4.minimumByComponent(first, second, result)).toEqual( - expected + expected, ); second.x = 3.0; expected.x = 2.0; expect(Cartesian4.minimumByComponent(first, second, result)).toEqual( - expected + expected, ); }); @@ -261,13 +261,13 @@ describe("Core/Cartesian4", function () { const expected = new Cartesian4(0.0, 1.0, 0.0, 0.0); const result = new Cartesian4(); expect(Cartesian4.minimumByComponent(first, second, result)).toEqual( - expected + expected, ); second.y = 3.0; expected.y = 2.0; expect(Cartesian4.minimumByComponent(first, second, result)).toEqual( - expected + expected, ); }); @@ -277,13 +277,13 @@ describe("Core/Cartesian4", function () { const expected = new Cartesian4(0.0, 0.0, 1.0, 0.0); const result = new Cartesian4(); expect(Cartesian4.minimumByComponent(first, second, result)).toEqual( - expected + expected, ); second.z = 3.0; expected.z = 2.0; expect(Cartesian4.minimumByComponent(first, second, result)).toEqual( - expected + expected, ); }); @@ -293,13 +293,13 @@ describe("Core/Cartesian4", function () { const expected = new Cartesian4(0.0, 0.0, 0.0, 1.0); const result = new Cartesian4(); expect(Cartesian4.minimumByComponent(first, second, result)).toEqual( - expected + expected, ); second.w = 3.0; expected.w = 2.0; expect(Cartesian4.minimumByComponent(first, second, result)).toEqual( - expected + expected, ); }); @@ -313,56 +313,56 @@ describe("Core/Cartesian4", function () { expected = new Cartesian4(2.0, 0.0, 0.0, 0.0); const result = new Cartesian4(); expect(Cartesian4.maximumByComponent(first, second, result)).toEqual( - expected + expected, ); first = new Cartesian4(1.0, 0.0, 0.0, 0.0); second = new Cartesian4(2.0, 0.0, 0.0, 0.0); expected = new Cartesian4(2.0, 0.0, 0.0, 0.0); expect(Cartesian4.maximumByComponent(first, second, result)).toEqual( - expected + expected, ); first = new Cartesian4(2.0, -15.0, 0.0, 0.0); second = new Cartesian4(1.0, -20.0, 0.0, 0.0); expected = new Cartesian4(2.0, -15.0, 0.0, 0.0); expect(Cartesian4.maximumByComponent(first, second, result)).toEqual( - expected + expected, ); first = new Cartesian4(2.0, -20.0, 0.0, 0.0); second = new Cartesian4(1.0, -15.0, 0.0, 0.0); expected = new Cartesian4(2.0, -15.0, 0.0, 0.0); expect(Cartesian4.maximumByComponent(first, second, result)).toEqual( - expected + expected, ); first = new Cartesian4(2.0, -15.0, 26.4, 0.0); second = new Cartesian4(1.0, -20.0, 26.5, 0.0); expected = new Cartesian4(2.0, -15.0, 26.5, 0.0); expect(Cartesian4.maximumByComponent(first, second, result)).toEqual( - expected + expected, ); first = new Cartesian4(2.0, -15.0, 26.5, 0.0); second = new Cartesian4(1.0, -20.0, 26.4, 0.0); expected = new Cartesian4(2.0, -15.0, 26.5, 0.0); expect(Cartesian4.maximumByComponent(first, second, result)).toEqual( - expected + expected, ); first = new Cartesian4(2.0, -15.0, 26.5, 450.0); second = new Cartesian4(1.0, -20.0, 26.4, -450.0); expected = new Cartesian4(2.0, -15.0, 26.5, 450.0); expect(Cartesian4.maximumByComponent(first, second, result)).toEqual( - expected + expected, ); first = new Cartesian4(2.0, -15.0, 26.5, -450.0); second = new Cartesian4(1.0, -20.0, 26.4, 450.0); expected = new Cartesian4(2.0, -15.0, 26.5, 450.0); expect(Cartesian4.maximumByComponent(first, second, result)).toEqual( - expected + expected, ); }); @@ -381,13 +381,13 @@ describe("Core/Cartesian4", function () { const second = new Cartesian4(1.0, 0.0, 0.0, 0.0); const expected = new Cartesian4(2.0, 0.0, 0.0, 0.0); expect(Cartesian4.maximumByComponent(first, second, first)).toEqual( - expected + expected, ); first.x = 1.0; second.x = 2.0; expect(Cartesian4.maximumByComponent(first, second, second)).toEqual( - expected + expected, ); }); @@ -396,13 +396,13 @@ describe("Core/Cartesian4", function () { const second = new Cartesian4(1.0, 0.0, 0.0, 0.0); const expected = new Cartesian4(2.0, 0.0, 0.0, 0.0); expect(Cartesian4.maximumByComponent(first, second, second)).toEqual( - expected + expected, ); first.x = 1.0; second.x = 2.0; expect(Cartesian4.maximumByComponent(first, second, second)).toEqual( - expected + expected, ); }); @@ -424,13 +424,13 @@ describe("Core/Cartesian4", function () { const expected = new Cartesian4(2.0, 0.0, 0.0, 0.0); const result = new Cartesian4(); expect(Cartesian4.maximumByComponent(first, second, result)).toEqual( - expected + expected, ); second.x = 3.0; expected.x = 3.0; expect(Cartesian4.maximumByComponent(first, second, result)).toEqual( - expected + expected, ); }); @@ -440,13 +440,13 @@ describe("Core/Cartesian4", function () { const expected = new Cartesian4(0.0, 2.0, 0.0, 0.0); const result = new Cartesian4(); expect(Cartesian4.maximumByComponent(first, second, result)).toEqual( - expected + expected, ); second.y = 3.0; expected.y = 3.0; expect(Cartesian4.maximumByComponent(first, second, result)).toEqual( - expected + expected, ); }); @@ -456,13 +456,13 @@ describe("Core/Cartesian4", function () { const expected = new Cartesian4(0.0, 0.0, 2.0, 0.0); const result = new Cartesian4(); expect(Cartesian4.maximumByComponent(first, second, result)).toEqual( - expected + expected, ); second.z = 3.0; expected.z = 3.0; expect(Cartesian4.maximumByComponent(first, second, result)).toEqual( - expected + expected, ); }); @@ -472,13 +472,13 @@ describe("Core/Cartesian4", function () { const expected = new Cartesian4(0.0, 0.0, 0.0, 2.0); const result = new Cartesian4(); expect(Cartesian4.maximumByComponent(first, second, result)).toEqual( - expected + expected, ); second.w = 3.0; expected.w = 3.0; expect(Cartesian4.maximumByComponent(first, second, result)).toEqual( - expected + expected, ); }); @@ -594,7 +594,7 @@ describe("Core/Cartesian4", function () { it("distance", function () { const distance = Cartesian4.distance( new Cartesian4(1.0, 0.0, 0.0, 0.0), - new Cartesian4(2.0, 0.0, 0.0, 0.0) + new Cartesian4(2.0, 0.0, 0.0, 0.0), ); expect(distance).toEqual(1.0); }); @@ -614,7 +614,7 @@ describe("Core/Cartesian4", function () { it("distanceSquared", function () { const distanceSquared = Cartesian4.distanceSquared( new Cartesian4(1.0, 0.0, 0.0, 0.0), - new Cartesian4(3.0, 0.0, 0.0, 0.0) + new Cartesian4(3.0, 0.0, 0.0, 0.0), ); expect(distanceSquared).toEqual(4.0); }); @@ -746,7 +746,7 @@ describe("Core/Cartesian4", function () { const returnedResult = Cartesian4.multiplyByScalar( cartesian, scalar, - result + result, ); expect(result).toBe(returnedResult); expect(result).toEqual(expectedResult); @@ -759,7 +759,7 @@ describe("Core/Cartesian4", function () { const returnedResult = Cartesian4.multiplyByScalar( cartesian, scalar, - cartesian + cartesian, ); expect(cartesian).toBe(returnedResult); expect(cartesian).toEqual(expectedResult); @@ -782,7 +782,7 @@ describe("Core/Cartesian4", function () { const returnedResult = Cartesian4.divideByScalar( cartesian, scalar, - cartesian + cartesian, ); expect(cartesian).toBe(returnedResult); expect(cartesian).toEqual(expectedResult); @@ -855,67 +855,67 @@ describe("Core/Cartesian4", function () { it("most orthogonal angle is x", function () { const v = new Cartesian4(0.0, 1.0, 2.0, 3.0); expect(Cartesian4.mostOrthogonalAxis(v, new Cartesian4())).toEqual( - Cartesian4.UNIT_X + Cartesian4.UNIT_X, ); }); it("most orthogonal angle is y", function () { const v = new Cartesian4(1.0, 0.0, 2.0, 3.0); expect(Cartesian4.mostOrthogonalAxis(v, new Cartesian4())).toEqual( - Cartesian4.UNIT_Y + Cartesian4.UNIT_Y, ); }); it("most orthogonal angle is z", function () { let v = new Cartesian4(2.0, 3.0, 0.0, 1.0); expect(Cartesian4.mostOrthogonalAxis(v, new Cartesian4())).toEqual( - Cartesian4.UNIT_Z + Cartesian4.UNIT_Z, ); v = new Cartesian4(3.0, 2.0, 0.0, 1.0); expect(Cartesian4.mostOrthogonalAxis(v, new Cartesian4())).toEqual( - Cartesian4.UNIT_Z + Cartesian4.UNIT_Z, ); }); it("most orthogonal angle is w", function () { let v = new Cartesian4(1.0, 2.0, 3.0, 0.0); expect(Cartesian4.mostOrthogonalAxis(v, new Cartesian4())).toEqual( - Cartesian4.UNIT_W + Cartesian4.UNIT_W, ); v = new Cartesian4(2.0, 3.0, 1.0, 0.0); expect(Cartesian4.mostOrthogonalAxis(v, new Cartesian4())).toEqual( - Cartesian4.UNIT_W + Cartesian4.UNIT_W, ); v = new Cartesian4(3.0, 1.0, 2.0, 0.0); expect(Cartesian4.mostOrthogonalAxis(v, new Cartesian4())).toEqual( - Cartesian4.UNIT_W + Cartesian4.UNIT_W, ); v = new Cartesian4(3.0, 2.0, 1.0, 0.0); expect(Cartesian4.mostOrthogonalAxis(v, new Cartesian4())).toEqual( - Cartesian4.UNIT_W + Cartesian4.UNIT_W, ); }); it("equals", function () { const cartesian = new Cartesian4(1.0, 2.0, 3.0, 4.0); expect( - Cartesian4.equals(cartesian, new Cartesian4(1.0, 2.0, 3.0, 4.0)) + Cartesian4.equals(cartesian, new Cartesian4(1.0, 2.0, 3.0, 4.0)), ).toEqual(true); expect( - Cartesian4.equals(cartesian, new Cartesian4(2.0, 2.0, 3.0, 4.0)) + Cartesian4.equals(cartesian, new Cartesian4(2.0, 2.0, 3.0, 4.0)), ).toEqual(false); expect( - Cartesian4.equals(cartesian, new Cartesian4(2.0, 1.0, 3.0, 4.0)) + Cartesian4.equals(cartesian, new Cartesian4(2.0, 1.0, 3.0, 4.0)), ).toEqual(false); expect( - Cartesian4.equals(cartesian, new Cartesian4(1.0, 2.0, 4.0, 4.0)) + Cartesian4.equals(cartesian, new Cartesian4(1.0, 2.0, 4.0, 4.0)), ).toEqual(false); expect( - Cartesian4.equals(cartesian, new Cartesian4(1.0, 2.0, 3.0, 5.0)) + Cartesian4.equals(cartesian, new Cartesian4(1.0, 2.0, 3.0, 5.0)), ).toEqual(false); expect(Cartesian4.equals(cartesian, undefined)).toEqual(false); }); @@ -923,46 +923,46 @@ describe("Core/Cartesian4", function () { it("equalsEpsilon", function () { let cartesian = new Cartesian4(1.0, 2.0, 3.0, 4.0); expect( - cartesian.equalsEpsilon(new Cartesian4(1.0, 2.0, 3.0, 4.0), 0.0) + cartesian.equalsEpsilon(new Cartesian4(1.0, 2.0, 3.0, 4.0), 0.0), ).toEqual(true); expect( - cartesian.equalsEpsilon(new Cartesian4(1.0, 2.0, 3.0, 4.0), 1.0) + cartesian.equalsEpsilon(new Cartesian4(1.0, 2.0, 3.0, 4.0), 1.0), ).toEqual(true); expect( - cartesian.equalsEpsilon(new Cartesian4(2.0, 2.0, 3.0, 4.0), 1.0) + cartesian.equalsEpsilon(new Cartesian4(2.0, 2.0, 3.0, 4.0), 1.0), ).toEqual(true); expect( - cartesian.equalsEpsilon(new Cartesian4(1.0, 3.0, 3.0, 4.0), 1.0) + cartesian.equalsEpsilon(new Cartesian4(1.0, 3.0, 3.0, 4.0), 1.0), ).toEqual(true); expect( - cartesian.equalsEpsilon(new Cartesian4(1.0, 2.0, 4.0, 4.0), 1.0) + cartesian.equalsEpsilon(new Cartesian4(1.0, 2.0, 4.0, 4.0), 1.0), ).toEqual(true); expect( - cartesian.equalsEpsilon(new Cartesian4(1.0, 2.0, 3.0, 5.0), 1.0) + cartesian.equalsEpsilon(new Cartesian4(1.0, 2.0, 3.0, 5.0), 1.0), ).toEqual(true); expect( cartesian.equalsEpsilon( new Cartesian4(2.0, 2.0, 3.0, 4.0), - CesiumMath.EPSILON6 - ) + CesiumMath.EPSILON6, + ), ).toEqual(false); expect( cartesian.equalsEpsilon( new Cartesian4(1.0, 3.0, 3.0, 4.0), - CesiumMath.EPSILON6 - ) + CesiumMath.EPSILON6, + ), ).toEqual(false); expect( cartesian.equalsEpsilon( new Cartesian4(1.0, 2.0, 4.0, 4.0), - CesiumMath.EPSILON6 - ) + CesiumMath.EPSILON6, + ), ).toEqual(false); expect( cartesian.equalsEpsilon( new Cartesian4(1.0, 2.0, 3.0, 5.0), - CesiumMath.EPSILON6 - ) + CesiumMath.EPSILON6, + ), ).toEqual(false); expect(cartesian.equalsEpsilon(undefined, 1)).toEqual(false); @@ -970,44 +970,44 @@ describe("Core/Cartesian4", function () { expect( cartesian.equalsEpsilon( new Cartesian4(3000000.0, 4000000.0, 5000000.0, 6000000.0), - 0.0 - ) + 0.0, + ), ).toEqual(true); expect( cartesian.equalsEpsilon( new Cartesian4(3000000.2, 4000000.0, 5000000.0, 6000000.0), - CesiumMath.EPSILON7 - ) + CesiumMath.EPSILON7, + ), ).toEqual(true); expect( cartesian.equalsEpsilon( new Cartesian4(3000000.0, 4000000.2, 5000000.0, 6000000.0), - CesiumMath.EPSILON7 - ) + CesiumMath.EPSILON7, + ), ).toEqual(true); expect( cartesian.equalsEpsilon( new Cartesian4(3000000.0, 4000000.0, 5000000.2, 6000000.0), - CesiumMath.EPSILON7 - ) + CesiumMath.EPSILON7, + ), ).toEqual(true); expect( cartesian.equalsEpsilon( new Cartesian4(3000000.0, 4000000.0, 5000000.0, 6000000.2), - CesiumMath.EPSILON7 - ) + CesiumMath.EPSILON7, + ), ).toEqual(true); expect( cartesian.equalsEpsilon( new Cartesian4(3000000.2, 4000000.2, 5000000.2, 6000000.2), - CesiumMath.EPSILON7 - ) + CesiumMath.EPSILON7, + ), ).toEqual(true); expect( cartesian.equalsEpsilon( new Cartesian4(3000000.2, 4000000.2, 5000000.2, 6000000.2), - CesiumMath.EPSILON9 - ) + CesiumMath.EPSILON9, + ), ).toEqual(false); expect(cartesian.equalsEpsilon(undefined, 1)).toEqual(false); @@ -1316,6 +1316,6 @@ describe("Core/Cartesian4", function () { Cartesian4, [new Cartesian4(1, 2, 3, 4), new Cartesian4(5, 6, 7, 8)], [1, 2, 3, 4, 5, 6, 7, 8], - 4 + 4, ); }); diff --git a/packages/engine/Specs/Core/CartographicGeocoderServiceSpec.js b/packages/engine/Specs/Core/CartographicGeocoderServiceSpec.js index 98fb8ae18020..1cc60b71a198 100644 --- a/packages/engine/Specs/Core/CartographicGeocoderServiceSpec.js +++ b/packages/engine/Specs/Core/CartographicGeocoderServiceSpec.js @@ -16,7 +16,7 @@ describe("Core/CartographicGeocoderService", function () { return service.geocode(query).then(function (results) { expect(results.length).toEqual(1); expect(results[0].destination).toEqual( - Cartesian3.fromDegrees(-75.0, 35.0, 300.0) + Cartesian3.fromDegrees(-75.0, 35.0, 300.0), ); }); }); @@ -26,7 +26,7 @@ describe("Core/CartographicGeocoderService", function () { return service.geocode(query).then(function (results) { expect(results.length).toEqual(1); expect(results[0].destination).toEqual( - Cartesian3.fromDegrees(-75.0, 35.0, 300.0) + Cartesian3.fromDegrees(-75.0, 35.0, 300.0), ); }); }); @@ -36,7 +36,7 @@ describe("Core/CartographicGeocoderService", function () { return service.geocode(query).then(function (results) { expect(results.length).toEqual(1); expect(results[0].destination).toEqual( - Cartesian3.fromDegrees(1.0, 2.0, 3.0) + Cartesian3.fromDegrees(1.0, 2.0, 3.0), ); }); }); @@ -47,7 +47,7 @@ describe("Core/CartographicGeocoderService", function () { return service.geocode(query).then(function (results) { expect(results.length).toEqual(1); expect(results[0].destination).toEqual( - Cartesian3.fromDegrees(1.0, 2.0, defaultHeight) + Cartesian3.fromDegrees(1.0, 2.0, defaultHeight), ); }); }); diff --git a/packages/engine/Specs/Core/CartographicSpec.js b/packages/engine/Specs/Core/CartographicSpec.js index cd281154bd8e..221282c89b43 100644 --- a/packages/engine/Specs/Core/CartographicSpec.js +++ b/packages/engine/Specs/Core/CartographicSpec.js @@ -9,12 +9,12 @@ describe("Core/Cartographic", function () { const surfaceCartesian = new Cartesian3( 4094327.7921465295, 1909216.4044747739, - 4487348.4088659193 + 4487348.4088659193, ); const surfaceCartographic = new Cartographic( CesiumMath.toRadians(25.0), CesiumMath.toRadians(45.0), - 0.0 + 0.0, ); afterEach(function () { @@ -42,7 +42,7 @@ describe("Core/Cartographic", function () { const ellipsoid = Ellipsoid.WGS84; const actual = Cartographic.toCartesian(new Cartographic(lon, lat, height)); const expected = ellipsoid.cartographicToCartesian( - new Cartographic(lon, lat, height) + new Cartographic(lon, lat, height), ); expect(actual).toEqual(expected); }); @@ -53,7 +53,7 @@ describe("Core/Cartographic", function () { const expectedPosition = new Cartesian3( 1593514.338295244, 691991.9979835141, - 20442.318221152018 + 20442.318221152018, ); const cartographic = Cartographic.fromDegrees(23.47315, 0.67416); const position = Cartographic.toCartesian(cartographic); @@ -144,14 +144,14 @@ describe("Core/Cartographic", function () { const position = new Cartesian3( 1593514.338295244, 691991.9979835141, - 20442.318221152018 + 20442.318221152018, ); const cartographic = new Cartographic.fromCartesian(position); const expectedCartographic = Cartographic.fromDegrees(23.47315, 0.67416); expect(cartographic).toEqualEpsilon( expectedCartographic, - CesiumMath.EPSILON8 + CesiumMath.EPSILON8, ); }); @@ -166,7 +166,7 @@ describe("Core/Cartographic", function () { const cartesian1 = Cartesian3.fromRadians( cartographic1.longitude, cartographic1.latitude, - cartographic1.height + cartographic1.height, ); const cartographic2 = Cartographic.fromCartesian(cartesian1); @@ -178,7 +178,7 @@ describe("Core/Cartographic", function () { const cartesian1 = Cartesian3.fromRadians( cartographic1.longitude, cartographic1.latitude, - cartographic1.height + cartographic1.height, ); const cartographic2 = Cartographic.fromCartesian(cartesian1); @@ -219,28 +219,28 @@ describe("Core/Cartographic", function () { it("equalsEpsilon", function () { const cartographic = new Cartographic(1.0, 2.0, 3.0); expect( - cartographic.equalsEpsilon(new Cartographic(1.0, 2.0, 3.0), 0.0) + cartographic.equalsEpsilon(new Cartographic(1.0, 2.0, 3.0), 0.0), ).toEqual(true); expect( - cartographic.equalsEpsilon(new Cartographic(1.0, 2.0, 3.0), 1.0) + cartographic.equalsEpsilon(new Cartographic(1.0, 2.0, 3.0), 1.0), ).toEqual(true); expect( - cartographic.equalsEpsilon(new Cartographic(2.0, 2.0, 3.0), 1.0) + cartographic.equalsEpsilon(new Cartographic(2.0, 2.0, 3.0), 1.0), ).toEqual(true); expect( - cartographic.equalsEpsilon(new Cartographic(1.0, 3.0, 3.0), 1.0) + cartographic.equalsEpsilon(new Cartographic(1.0, 3.0, 3.0), 1.0), ).toEqual(true); expect( - cartographic.equalsEpsilon(new Cartographic(1.0, 2.0, 4.0), 1.0) + cartographic.equalsEpsilon(new Cartographic(1.0, 2.0, 4.0), 1.0), ).toEqual(true); expect( - cartographic.equalsEpsilon(new Cartographic(2.0, 2.0, 3.0), 0.99999) + cartographic.equalsEpsilon(new Cartographic(2.0, 2.0, 3.0), 0.99999), ).toEqual(false); expect( - cartographic.equalsEpsilon(new Cartographic(1.0, 3.0, 3.0), 0.99999) + cartographic.equalsEpsilon(new Cartographic(1.0, 3.0, 3.0), 0.99999), ).toEqual(false); expect( - cartographic.equalsEpsilon(new Cartographic(1.0, 2.0, 4.0), 0.99999) + cartographic.equalsEpsilon(new Cartographic(1.0, 2.0, 4.0), 0.99999), ).toEqual(false); expect(cartographic.equalsEpsilon(undefined, 1)).toEqual(false); }); diff --git a/packages/engine/Specs/Core/CatmullRomSplineSpec.js b/packages/engine/Specs/Core/CatmullRomSplineSpec.js index 4dd08e164df3..3384a766e325 100644 --- a/packages/engine/Specs/Core/CatmullRomSplineSpec.js +++ b/packages/engine/Specs/Core/CatmullRomSplineSpec.js @@ -47,7 +47,7 @@ describe("Core/CatmullRomSpline", function () { const end = Cartesian3.subtract( points[points.length - 1], points[points.length - 2], - new Cartesian3() + new Cartesian3(), ); const crs = new CatmullRomSpline({ points: points, @@ -71,13 +71,13 @@ describe("Core/CatmullRomSpline", function () { Cartesian3.subtract( Cartesian3.multiplyByScalar(controlPoint1, 2.0, start), controlPoint2, - start + start, ), controlPoint0, - start + start, ), 0.5, - start + start, ); const controlPointn0 = Cartesian3.clone(points[points.length - 1]); @@ -90,13 +90,13 @@ describe("Core/CatmullRomSpline", function () { Cartesian3.subtract( controlPointn0, Cartesian3.multiplyByScalar(controlPointn1, 2.0, end), - end + end, ), controlPointn2, - end + end, ), 0.5, - end + end, ); const crs = new CatmullRomSpline({ @@ -142,8 +142,8 @@ describe("Core/CatmullRomSpline", function () { Cartesian3.multiplyByScalar( Cartesian3.subtract(points[i + 1], points[i - 1], new Cartesian3()), 0.5, - new Cartesian3() - ) + new Cartesian3(), + ), ); } tangents.push(crs.lastTangent); @@ -158,7 +158,7 @@ describe("Core/CatmullRomSpline", function () { for (let j = times[0]; j <= times[points.length - 1]; j = j + granularity) { expect(hs.evaluate(j)).toEqualEpsilon( crs.evaluate(j), - CesiumMath.EPSILON4 + CesiumMath.EPSILON4, ); } }); @@ -186,7 +186,7 @@ describe("Core/CatmullRomSpline", function () { const t = (times[0] + times[1]) * 0.5; expect(crs.evaluate(t)).toEqual( - Cartesian3.lerp(points[0], points[1], t, new Cartesian3()) + Cartesian3.lerp(points[0], points[1], t, new Cartesian3()), ); }); @@ -204,7 +204,7 @@ describe("Core/CatmullRomSpline", function () { const actual = crs.evaluate(t, result); expect(actual).toBe(result); expect(actual).toEqual( - Cartesian3.lerp(points[0], points[1], t, new Cartesian3()) + Cartesian3.lerp(points[0], points[1], t, new Cartesian3()), ); }); }); diff --git a/packages/engine/Specs/Core/CesiumTerrainProviderSpec.js b/packages/engine/Specs/Core/CesiumTerrainProviderSpec.js index c89c43b83545..9422bc626d51 100644 --- a/packages/engine/Specs/Core/CesiumTerrainProviderSpec.js +++ b/packages/engine/Specs/Core/CesiumTerrainProviderSpec.js @@ -33,7 +33,7 @@ describe("Core/CesiumTerrainProvider", function () { data, headers, deferred, - overrideMimeType + overrideMimeType, ) { if (url.indexOf("layer.json") >= 0) { Resource._DefaultImplementations.loadWithXhr( @@ -42,7 +42,7 @@ describe("Core/CesiumTerrainProvider", function () { method, data, headers, - deferred + deferred, ); } else { return oldLoad( @@ -52,7 +52,7 @@ describe("Core/CesiumTerrainProvider", function () { data, headers, deferred, - overrideMimeType + overrideMimeType, ); } }; @@ -60,7 +60,7 @@ describe("Core/CesiumTerrainProvider", function () { function returnHeightmapTileJson() { return returnTileJson( - "Data/CesiumTerrainTileJson/StandardHeightmap.tile.json" + "Data/CesiumTerrainTileJson/StandardHeightmap.tile.json", ); } @@ -74,7 +74,7 @@ describe("Core/CesiumTerrainProvider", function () { function returnOctVertexNormalTileJson() { return returnTileJson( - "Data/CesiumTerrainTileJson/OctVertexNormals.tile.json" + "Data/CesiumTerrainTileJson/OctVertexNormals.tile.json", ); } @@ -84,7 +84,7 @@ describe("Core/CesiumTerrainProvider", function () { function returnPartialAvailabilityTileJson() { return returnTileJson( - "Data/CesiumTerrainTileJson/PartialAvailability.tile.json" + "Data/CesiumTerrainTileJson/PartialAvailability.tile.json", ); } @@ -102,7 +102,7 @@ describe("Core/CesiumTerrainProvider", function () { data, headers, deferred, - overrideMimeType + overrideMimeType, ) { if (url.indexOf("layer.json") >= 0) { Resource._DefaultImplementations.loadWithXhr( @@ -111,7 +111,7 @@ describe("Core/CesiumTerrainProvider", function () { method, data, headers, - deferred + deferred, ); } else { return oldLoad( @@ -121,7 +121,7 @@ describe("Core/CesiumTerrainProvider", function () { data, headers, deferred, - overrideMimeType + overrideMimeType, ); } }; @@ -129,7 +129,7 @@ describe("Core/CesiumTerrainProvider", function () { function returnMetadataAvailabilityTileJson() { return returnTileJson( - "Data/CesiumTerrainTileJson/MetadataAvailability.tile.json" + "Data/CesiumTerrainTileJson/MetadataAvailability.tile.json", ); } @@ -147,7 +147,7 @@ describe("Core/CesiumTerrainProvider", function () { data, headers, deferred, - overrideMimeType + overrideMimeType, ) { if (url.indexOf("layer.json") >= 0) { Resource._DefaultImplementations.loadWithXhr( @@ -156,7 +156,7 @@ describe("Core/CesiumTerrainProvider", function () { method, data, headers, - deferred + deferred, ); } else { return oldLoad( @@ -166,7 +166,7 @@ describe("Core/CesiumTerrainProvider", function () { data, headers, deferred, - overrideMimeType + overrideMimeType, ); } }; @@ -193,17 +193,17 @@ describe("Core/CesiumTerrainProvider", function () { it("fromIonAssetId throws without assetId", async function () { await expectAsync( - CesiumTerrainProvider.fromIonAssetId() + CesiumTerrainProvider.fromIonAssetId(), ).toBeRejectedWithDeveloperError( - "assetId is required, actual value was undefined" + "assetId is required, actual value was undefined", ); }); it("fromUrl throws without url", async function () { await expectAsync( - CesiumTerrainProvider.fromUrl() + CesiumTerrainProvider.fromUrl(), ).toBeRejectedWithDeveloperError( - "url is required, actual value was undefined" + "url is required, actual value was undefined", ); }); @@ -214,7 +214,7 @@ describe("Core/CesiumTerrainProvider", function () { it("fromUrl resolves with url promise", async function () { const provider = await CesiumTerrainProvider.fromUrl( - Promise.resolve("made/up/url") + Promise.resolve("made/up/url"), ); expect(provider).toBeInstanceOf(CesiumTerrainProvider); }); @@ -230,7 +230,7 @@ describe("Core/CesiumTerrainProvider", function () { it("fromUrl rejects if url rejects", async function () { await expectAsync( - CesiumTerrainProvider.fromUrl(Promise.reject(new Error("my message"))) + CesiumTerrainProvider.fromUrl(Promise.reject(new Error("my message"))), ).toBeRejectedWithError("my message"); }); @@ -267,11 +267,11 @@ describe("Core/CesiumTerrainProvider", function () { expect(provider.getLevelMaximumGeometricError(0)).toBeGreaterThan(0.0); expect(provider.getLevelMaximumGeometricError(0)).toEqualEpsilon( provider.getLevelMaximumGeometricError(1) * 2.0, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); expect(provider.getLevelMaximumGeometricError(1)).toEqualEpsilon( provider.getLevelMaximumGeometricError(2) * 2.0, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); }); @@ -332,7 +332,7 @@ describe("Core/CesiumTerrainProvider", function () { }); expect(provider._tileCredits[0].html).toBe( - "This is a child tileset! This amazing data is courtesy The Amazing Data Source!" + "This is a child tileset! This amazing data is courtesy The Amazing Data Source!", ); expect(provider.requestVertexNormals).toBe(true); expect(provider.requestWaterMask).toBe(true); @@ -360,10 +360,10 @@ describe("Core/CesiumTerrainProvider", function () { returnTileJson("Data/CesiumTerrainTileJson/InvalidFormat.tile.json"); await expectAsync( - CesiumTerrainProvider.fromUrl("made/up/url") + CesiumTerrainProvider.fromUrl("made/up/url"), ).toBeRejectedWithError( RuntimeError, - 'The tile format "awesometron-9000.0" is invalid or not supported.' + 'The tile format "awesometron-9000.0" is invalid or not supported.', ); }); @@ -371,10 +371,10 @@ describe("Core/CesiumTerrainProvider", function () { returnTileJson("Data/CesiumTerrainTileJson/QuantizedMesh2.0.tile.json"); await expectAsync( - CesiumTerrainProvider.fromUrl("made/up/url") + CesiumTerrainProvider.fromUrl("made/up/url"), ).toBeRejectedWithError( RuntimeError, - 'The tile format "quantized-mesh-2.0" is invalid or not supported.' + 'The tile format "quantized-mesh-2.0" is invalid or not supported.', ); }); @@ -382,7 +382,7 @@ describe("Core/CesiumTerrainProvider", function () { returnTileJson("Data/CesiumTerrainTileJson/QuantizedMesh1.1.tile.json"); await expectAsync( - CesiumTerrainProvider.fromUrl("made/up/url") + CesiumTerrainProvider.fromUrl("made/up/url"), ).toBeResolved(); }); @@ -390,10 +390,10 @@ describe("Core/CesiumTerrainProvider", function () { returnTileJson("Data/CesiumTerrainTileJson/NoTiles.tile.json"); await expectAsync( - CesiumTerrainProvider.fromUrl("made/up/url") + CesiumTerrainProvider.fromUrl("made/up/url"), ).toBeRejectedWithError( RuntimeError, - "The layer.json file does not specify any tile URL templates." + "The layer.json file does not specify any tile URL templates.", ); }); @@ -401,10 +401,10 @@ describe("Core/CesiumTerrainProvider", function () { returnTileJson("Data/CesiumTerrainTileJson/EmptyTilesArray.tile.json"); await expectAsync( - CesiumTerrainProvider.fromUrl("made/up/url") + CesiumTerrainProvider.fromUrl("made/up/url"), ).toBeRejectedWithError( RuntimeError, - "The layer.json file does not specify any tile URL templates." + "The layer.json file does not specify any tile URL templates.", ); }); @@ -414,7 +414,7 @@ describe("Core/CesiumTerrainProvider", function () { const provider = await CesiumTerrainProvider.fromUrl("made/up/url"); expect(provider._tileCredits[0].html).toBe( - "This amazing data is courtesy The Amazing Data Source!" + "This amazing data is courtesy The Amazing Data Source!", ); }); @@ -432,10 +432,10 @@ describe("Core/CesiumTerrainProvider", function () { }; expect( - CesiumTerrainProvider._getAvailabilityTile(layer, 0, 0, 0) + CesiumTerrainProvider._getAvailabilityTile(layer, 0, 0, 0), ).toBeUndefined(); expect( - CesiumTerrainProvider._getAvailabilityTile(layer, 1, 0, 0) + CesiumTerrainProvider._getAvailabilityTile(layer, 1, 0, 0), ).toBeUndefined(); }); @@ -456,7 +456,7 @@ describe("Core/CesiumTerrainProvider", function () { }); expect( - CesiumTerrainProvider._getAvailabilityTile(layer, 80, 50, 10) + CesiumTerrainProvider._getAvailabilityTile(layer, 80, 50, 10), ).toEqual({ level: 0, x: 0, @@ -487,10 +487,10 @@ describe("Core/CesiumTerrainProvider", function () { } expect( - CesiumTerrainProvider._getAvailabilityTile(layer, xs[0], ys[0], 20) + CesiumTerrainProvider._getAvailabilityTile(layer, xs[0], ys[0], 20), ).toEqual(expected); expect( - CesiumTerrainProvider._getAvailabilityTile(layer, xs[1], ys[1], 20) + CesiumTerrainProvider._getAvailabilityTile(layer, xs[1], ys[1], 20), ).toEqual(expected); }); @@ -504,7 +504,7 @@ describe("Core/CesiumTerrainProvider", function () { await provider.requestTileGeometry(0, 0, 0); } catch (e) { expect( - Resource._Implementations.loadWithXhr.calls.mostRecent().args[0] + Resource._Implementations.loadWithXhr.calls.mostRecent().args[0], ).toContain("foo0.com"); } @@ -512,7 +512,7 @@ describe("Core/CesiumTerrainProvider", function () { await provider.requestTileGeometry(1, 0, 0); } catch (e) { expect( - Resource._Implementations.loadWithXhr.calls.mostRecent().args[0] + Resource._Implementations.loadWithXhr.calls.mostRecent().args[0], ).toContain("foo1.com"); } @@ -520,7 +520,7 @@ describe("Core/CesiumTerrainProvider", function () { await provider.requestTileGeometry(1, -1, 0); } catch (e) { expect( - Resource._Implementations.loadWithXhr.calls.mostRecent().args[0] + Resource._Implementations.loadWithXhr.calls.mostRecent().args[0], ).toContain("foo2.com"); } @@ -528,7 +528,7 @@ describe("Core/CesiumTerrainProvider", function () { await provider.requestTileGeometry(1, 0, 1); } catch (e) { expect( - Resource._Implementations.loadWithXhr.calls.mostRecent().args[0] + Resource._Implementations.loadWithXhr.calls.mostRecent().args[0], ).toContain("foo3.com"); } }); @@ -544,14 +544,14 @@ describe("Core/CesiumTerrainProvider", function () { await provider.requestTileGeometry(0, 0, 0); } catch (e) { expect( - Resource._Implementations.loadWithXhr.calls.mostRecent().args[0] + Resource._Implementations.loadWithXhr.calls.mostRecent().args[0], ).toContain("foo0.com"); } try { await provider.requestTileGeometry(1, 0, 0); } catch (e) { expect( - Resource._Implementations.loadWithXhr.calls.mostRecent().args[0] + Resource._Implementations.loadWithXhr.calls.mostRecent().args[0], ).toContain("foo1.com"); } @@ -559,14 +559,14 @@ describe("Core/CesiumTerrainProvider", function () { await provider.requestTileGeometry(1, -1, 0); } catch (e) { expect( - Resource._Implementations.loadWithXhr.calls.mostRecent().args[0] + Resource._Implementations.loadWithXhr.calls.mostRecent().args[0], ).toContain("foo2.com"); } try { await provider.requestTileGeometry(1, 0, 1); } catch (e) { expect( - Resource._Implementations.loadWithXhr.calls.mostRecent().args[0] + Resource._Implementations.loadWithXhr.calls.mostRecent().args[0], ).toContain("foo3.com"); } }); @@ -579,7 +579,7 @@ describe("Core/CesiumTerrainProvider", function () { data, headers, deferred, - overrideMimeType + overrideMimeType, ) { // Just return any old file, as long as its big enough return Resource._DefaultImplementations.loadWithXhr( @@ -588,7 +588,7 @@ describe("Core/CesiumTerrainProvider", function () { method, data, headers, - deferred + deferred, ); }; @@ -607,7 +607,7 @@ describe("Core/CesiumTerrainProvider", function () { data, headers, deferred, - overrideMimeType + overrideMimeType, ) { Resource._DefaultImplementations.loadWithXhr( "Data/CesiumTerrainTileJson/tile.terrain", @@ -615,7 +615,7 @@ describe("Core/CesiumTerrainProvider", function () { method, data, headers, - deferred + deferred, ); }; @@ -634,7 +634,7 @@ describe("Core/CesiumTerrainProvider", function () { data, headers, deferred, - overrideMimeType + overrideMimeType, ) { Resource._DefaultImplementations.loadWithXhr( "Data/CesiumTerrainTileJson/tile.32bitIndices.terrain", @@ -642,7 +642,7 @@ describe("Core/CesiumTerrainProvider", function () { method, data, headers, - deferred + deferred, ); }; @@ -662,7 +662,7 @@ describe("Core/CesiumTerrainProvider", function () { data, headers, deferred, - overrideMimeType + overrideMimeType, ) { Resource._DefaultImplementations.loadWithXhr( "Data/CesiumTerrainTileJson/tile.vertexnormals.terrain", @@ -670,7 +670,7 @@ describe("Core/CesiumTerrainProvider", function () { method, data, headers, - deferred + deferred, ); }; @@ -690,7 +690,7 @@ describe("Core/CesiumTerrainProvider", function () { data, headers, deferred, - overrideMimeType + overrideMimeType, ) { Resource._DefaultImplementations.loadWithXhr( "Data/CesiumTerrainTileJson/tile.watermask.terrain", @@ -698,7 +698,7 @@ describe("Core/CesiumTerrainProvider", function () { method, data, headers, - deferred + deferred, ); }; @@ -718,7 +718,7 @@ describe("Core/CesiumTerrainProvider", function () { data, headers, deferred, - overrideMimeType + overrideMimeType, ) { Resource._DefaultImplementations.loadWithXhr( "Data/CesiumTerrainTileJson/tile.octvertexnormals.watermask.terrain", @@ -726,7 +726,7 @@ describe("Core/CesiumTerrainProvider", function () { method, data, headers, - deferred + deferred, ); }; @@ -747,7 +747,7 @@ describe("Core/CesiumTerrainProvider", function () { data, headers, deferred, - overrideMimeType + overrideMimeType, ) { Resource._DefaultImplementations.loadWithXhr( "Data/CesiumTerrainTileJson/tile.octvertexnormals.terrain", @@ -755,7 +755,7 @@ describe("Core/CesiumTerrainProvider", function () { method, data, headers, - deferred + deferred, ); }; @@ -775,7 +775,7 @@ describe("Core/CesiumTerrainProvider", function () { data, headers, deferred, - overrideMimeType + overrideMimeType, ) { Resource._DefaultImplementations.loadWithXhr( "Data/CesiumTerrainTileJson/tile.vertexnormals.unknownext.terrain", @@ -783,7 +783,7 @@ describe("Core/CesiumTerrainProvider", function () { method, data, headers, - deferred + deferred, ); }; @@ -803,7 +803,7 @@ describe("Core/CesiumTerrainProvider", function () { data, headers, deferred, - overrideMimeType + overrideMimeType, ) { Resource._DefaultImplementations.loadWithXhr( "Data/CesiumTerrainTileJson/tile.octvertexnormals.unknownext.terrain", @@ -811,7 +811,7 @@ describe("Core/CesiumTerrainProvider", function () { method, data, headers, - deferred + deferred, ); }; @@ -831,7 +831,7 @@ describe("Core/CesiumTerrainProvider", function () { data, headers, deferred, - overrideMimeType + overrideMimeType, ) { Resource._DefaultImplementations.loadWithXhr( "Data/CesiumTerrainTileJson/tile.unknownext.terrain", @@ -839,7 +839,7 @@ describe("Core/CesiumTerrainProvider", function () { method, data, headers, - deferred + deferred, ); }; @@ -858,7 +858,7 @@ describe("Core/CesiumTerrainProvider", function () { data, headers, deferred, - overrideMimeType + overrideMimeType, ) { Resource._DefaultImplementations.loadWithXhr( "Data/CesiumTerrainTileJson/tile.metadataavailability.terrain", @@ -866,15 +866,14 @@ describe("Core/CesiumTerrainProvider", function () { method, data, headers, - deferred + deferred, ); }; returnMetadataAvailabilityTileJson(); - const terrainProvider = await CesiumTerrainProvider.fromUrl( - "made/up/url" - ); + const terrainProvider = + await CesiumTerrainProvider.fromUrl("made/up/url"); expect(terrainProvider.hasMetadata).toBe(true); expect(terrainProvider._layers[0].availabilityLevels).toBe(10); @@ -895,7 +894,7 @@ describe("Core/CesiumTerrainProvider", function () { data, headers, deferred, - overrideMimeType + overrideMimeType, ) { Resource._DefaultImplementations.loadWithXhr( "Data/CesiumTerrainTileJson/tile.metadataavailability.terrain", @@ -903,15 +902,14 @@ describe("Core/CesiumTerrainProvider", function () { method, data, headers, - deferred + deferred, ); }; returnParentUrlTileJsonWithMetadataAvailability(); - const terrainProvider = await CesiumTerrainProvider.fromUrl( - "made/up/url" - ); + const terrainProvider = + await CesiumTerrainProvider.fromUrl("made/up/url"); expect(terrainProvider.hasMetadata).toBe(true); const layers = terrainProvider._layers; @@ -936,7 +934,7 @@ describe("Core/CesiumTerrainProvider", function () { data, headers, deferred, - overrideMimeType + overrideMimeType, ) { // Do nothing, so requests never complete deferreds.push(deferred); @@ -980,7 +978,7 @@ describe("Core/CesiumTerrainProvider", function () { data, headers, deferred, - overrideMimeType + overrideMimeType, ) { Resource._DefaultImplementations.loadWithXhr( "Data/CesiumTerrainTileJson/tile.terrain", @@ -988,7 +986,7 @@ describe("Core/CesiumTerrainProvider", function () { method, data, headers, - deferred + deferred, ); }; @@ -1019,7 +1017,7 @@ describe("Core/CesiumTerrainProvider", function () { data, headers, deferred, - overrideMimeType + overrideMimeType, ) { Resource._DefaultImplementations.loadWithXhr( "Data/CesiumTerrainTileJson/tile.metadataavailability.terrain", @@ -1027,15 +1025,14 @@ describe("Core/CesiumTerrainProvider", function () { method, data, headers, - deferred + deferred, ); }; returnMetadataAvailabilityTileJson(); - const terrainProvider = await CesiumTerrainProvider.fromUrl( - "made/up/url" - ); + const terrainProvider = + await CesiumTerrainProvider.fromUrl("made/up/url"); expect(terrainProvider.getTileDataAvailable(0, 0, 0)).toBe(true); expect(terrainProvider.getTileDataAvailable(0, 0, 1)).toBeUndefined(); @@ -1052,7 +1049,7 @@ describe("Core/CesiumTerrainProvider", function () { data, headers, deferred, - overrideMimeType + overrideMimeType, ) { // Just return any old file, as long as its big enough Resource._DefaultImplementations.loadWithXhr( @@ -1061,7 +1058,7 @@ describe("Core/CesiumTerrainProvider", function () { method, data, headers, - deferred + deferred, ); }; @@ -1078,17 +1075,17 @@ describe("Core/CesiumTerrainProvider", function () { { requestVertexNormals: true, requestWaterMask: true, - } + }, ); const getDerivedResource = spyOn( IonResource.prototype, - "getDerivedResource" + "getDerivedResource", ).and.callThrough(); await terrainProvider.requestTileGeometry(0, 0, 0); const options = getDerivedResource.calls.argsFor(0)[0]; expect(options.queryParameters.extensions).toEqual( - "octvertexnormals-watermask-metadata" + "octvertexnormals-watermask-metadata", ); }); }); diff --git a/packages/engine/Specs/Core/CircleGeometrySpec.js b/packages/engine/Specs/Core/CircleGeometrySpec.js index 78cc3929c4df..d1a0c7c333ed 100644 --- a/packages/engine/Specs/Core/CircleGeometrySpec.js +++ b/packages/engine/Specs/Core/CircleGeometrySpec.js @@ -43,7 +43,7 @@ describe("Core/CircleGeometry", function () { center: Cartesian3.fromDegrees(0, 0), granularity: 0.1, radius: 1.0, - }) + }), ); const numVertices = 16; //rows of 1 + 4 + 6 + 4 + 1 @@ -61,7 +61,7 @@ describe("Core/CircleGeometry", function () { center: Cartesian3.fromDegrees(0, 0), granularity: 0.1, radius: 1.0, - }) + }), ); const numVertices = 16; @@ -83,7 +83,7 @@ describe("Core/CircleGeometry", function () { granularity: 0.1, radius: 1.0, extrudedHeight: 10000, - }) + }), ); const numVertices = 48; // 16 top circle + 16 bottom circle + 8 top edge + 8 bottom edge @@ -101,7 +101,7 @@ describe("Core/CircleGeometry", function () { granularity: 0.1, radius: 1.0, extrudedHeight: 10000, - }) + }), ); const numVertices = 48; @@ -123,7 +123,7 @@ describe("Core/CircleGeometry", function () { granularity: 0.1, radius: 1.0, stRotation: CesiumMath.PI_OVER_TWO, - }) + }), ); const positions = m.attributes.position.values; @@ -183,27 +183,27 @@ describe("Core/CircleGeometry", function () { expect(textureCoordinateRotationPoints.length).toEqual(6); expect(textureCoordinateRotationPoints[0]).toEqualEpsilon( 0, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(textureCoordinateRotationPoints[1]).toEqualEpsilon( 1, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(textureCoordinateRotationPoints[2]).toEqualEpsilon( 1, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(textureCoordinateRotationPoints[3]).toEqualEpsilon( 1, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(textureCoordinateRotationPoints[4]).toEqualEpsilon( 0, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(textureCoordinateRotationPoints[5]).toEqualEpsilon( 0, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); }); diff --git a/packages/engine/Specs/Core/CircleOutlineGeometrySpec.js b/packages/engine/Specs/Core/CircleOutlineGeometrySpec.js index 1f8a92ae0e1f..5124c2e720b5 100644 --- a/packages/engine/Specs/Core/CircleOutlineGeometrySpec.js +++ b/packages/engine/Specs/Core/CircleOutlineGeometrySpec.js @@ -36,7 +36,7 @@ describe("Core/CircleOutlineGeometry", function () { center: Cartesian3.fromDegrees(0, 0), granularity: 0.1, radius: 1.0, - }) + }), ); expect(m.attributes.position.values.length).toEqual(8 * 3); @@ -52,7 +52,7 @@ describe("Core/CircleOutlineGeometry", function () { granularity: 0.1, radius: 1.0, extrudedHeight: 5, - }) + }), ); expect(m.attributes.position.values.length).toEqual(16 * 3); //8 top circle + 8 bottom circle @@ -68,7 +68,7 @@ describe("Core/CircleOutlineGeometry", function () { radius: 1.0, extrudedHeight: 10000, numberOfVerticalLines: 0, - }) + }), ); expect(m.attributes.position.values.length).toEqual(16 * 3); @@ -123,7 +123,7 @@ describe("Core/CircleOutlineGeometry", function () { CircleOutlineGeometry, packableInstance, packedInstance, - "extruded" + "extruded", ); //Because extrudedHeight is optional and has to be taken into account when packing, we have a second test without it. @@ -155,6 +155,6 @@ describe("Core/CircleOutlineGeometry", function () { CircleOutlineGeometry, packableInstance, packedInstance, - "at height" + "at height", ); }); diff --git a/packages/engine/Specs/Core/ClockSpec.js b/packages/engine/Specs/Core/ClockSpec.js index 48a3e97c1717..be69c6277a6f 100644 --- a/packages/engine/Specs/Core/ClockSpec.js +++ b/packages/engine/Specs/Core/ClockSpec.js @@ -10,7 +10,7 @@ describe("Core/Clock", function () { it("sets default parameters when constructed", function () { const clock = new Clock(); expect(clock.stopTime).toEqual( - JulianDate.addDays(clock.startTime, 1, new JulianDate()) + JulianDate.addDays(clock.startTime, 1, new JulianDate()), ); expect(clock.startTime).toEqual(clock.currentTime); expect(clock.multiplier).toEqual(1.0); @@ -225,7 +225,7 @@ describe("Core/Clock", function () { currentTime = JulianDate.addSeconds( currentTime, multiplier, - new JulianDate() + new JulianDate(), ); expect(currentTime).toEqual(clock.tick()); expect(clock.currentTime).toEqual(currentTime); @@ -233,7 +233,7 @@ describe("Core/Clock", function () { currentTime = JulianDate.addSeconds( currentTime, multiplier, - new JulianDate() + new JulianDate(), ); expect(currentTime).toEqual(clock.tick()); expect(clock.currentTime).toEqual(currentTime); @@ -258,7 +258,7 @@ describe("Core/Clock", function () { currentTime = JulianDate.addSeconds( currentTime, multiplier, - new JulianDate() + new JulianDate(), ); expect(currentTime).toEqual(clock.tick()); expect(clock.currentTime).toEqual(currentTime); @@ -266,7 +266,7 @@ describe("Core/Clock", function () { currentTime = JulianDate.addSeconds( currentTime, multiplier, - new JulianDate() + new JulianDate(), ); expect(currentTime).toEqual(clock.tick()); expect(clock.currentTime).toEqual(currentTime); @@ -291,7 +291,7 @@ describe("Core/Clock", function () { currentTime = JulianDate.addSeconds( currentTime, multiplier, - new JulianDate() + new JulianDate(), ); expect(currentTime).toEqual(clock.tick()); expect(clock.currentTime).toEqual(currentTime); @@ -299,7 +299,7 @@ describe("Core/Clock", function () { currentTime = JulianDate.addSeconds( currentTime, multiplier, - new JulianDate() + new JulianDate(), ); expect(currentTime).toEqual(clock.tick()); expect(clock.currentTime).toEqual(currentTime); @@ -324,7 +324,7 @@ describe("Core/Clock", function () { currentTime = JulianDate.addSeconds( currentTime, multiplier, - new JulianDate() + new JulianDate(), ); expect(currentTime).toEqual(clock.tick()); expect(clock.currentTime).toEqual(currentTime); @@ -332,7 +332,7 @@ describe("Core/Clock", function () { currentTime = JulianDate.addSeconds( currentTime, multiplier, - new JulianDate() + new JulianDate(), ); expect(currentTime).toEqual(clock.tick()); expect(clock.currentTime).toEqual(currentTime); @@ -361,7 +361,7 @@ describe("Core/Clock", function () { currentTime = JulianDate.addSeconds( currentTime, multiplier, - new JulianDate() + new JulianDate(), ); expect(currentTime).toEqual(clock.tick()); expect(clock.currentTime).toEqual(currentTime); @@ -504,8 +504,8 @@ describe("Core/Clock", function () { JulianDate.addSeconds( JulianDate.fromDate(baseDate), 1.0, - new JulianDate() - ) + new JulianDate(), + ), ); }); @@ -597,8 +597,8 @@ describe("Core/Clock", function () { JulianDate.addSeconds( JulianDate.fromDate(baseDate), 2.0, - new JulianDate() - ) + new JulianDate(), + ), ); }); @@ -629,8 +629,8 @@ describe("Core/Clock", function () { JulianDate.addSeconds( JulianDate.fromDate(baseDate), 1.0, - new JulianDate() - ) + new JulianDate(), + ), ); jasmine.clock().tick(1000); @@ -641,8 +641,8 @@ describe("Core/Clock", function () { JulianDate.addSeconds( JulianDate.fromDate(baseDate), 2.0, - new JulianDate() - ) + new JulianDate(), + ), ); clock.currentTime = start; @@ -661,8 +661,8 @@ describe("Core/Clock", function () { JulianDate.addSeconds( JulianDate.fromDate(baseDate), 1.0, - new JulianDate() - ) + new JulianDate(), + ), ); }); }); diff --git a/packages/engine/Specs/Core/ColorGeometryInstanceAttributeSpec.js b/packages/engine/Specs/Core/ColorGeometryInstanceAttributeSpec.js index e2557eb6bfa9..abf3282a25aa 100644 --- a/packages/engine/Specs/Core/ColorGeometryInstanceAttributeSpec.js +++ b/packages/engine/Specs/Core/ColorGeometryInstanceAttributeSpec.js @@ -8,7 +8,7 @@ describe("Core/ColorGeometryInstanceAttribute", function () { it("constructor", function () { const attribute = new ColorGeometryInstanceAttribute(1.0, 1.0, 0.0, 0.5); expect(attribute.componentDatatype).toEqual( - ComponentDatatype.UNSIGNED_BYTE + ComponentDatatype.UNSIGNED_BYTE, ); expect(attribute.componentsPerAttribute).toEqual(4); expect(attribute.normalize).toEqual(true); @@ -21,7 +21,7 @@ describe("Core/ColorGeometryInstanceAttribute", function () { const color = Color.AQUA; const attribute = ColorGeometryInstanceAttribute.fromColor(color); expect(attribute.componentDatatype).toEqual( - ComponentDatatype.UNSIGNED_BYTE + ComponentDatatype.UNSIGNED_BYTE, ); expect(attribute.componentsPerAttribute).toEqual(4); expect(attribute.normalize).toEqual(true); @@ -40,7 +40,7 @@ describe("Core/ColorGeometryInstanceAttribute", function () { const color = Color.AQUA; const expectedResult = new Uint8Array(color.toBytes()); expect(ColorGeometryInstanceAttribute.toValue(color)).toEqual( - expectedResult + expectedResult, ); }); @@ -50,7 +50,7 @@ describe("Core/ColorGeometryInstanceAttribute", function () { const result = new Uint8Array(4); const returnedResult = ColorGeometryInstanceAttribute.toValue( color, - result + result, ); expect(returnedResult).toBe(result); expect(returnedResult).toEqual(expectedResult); @@ -68,38 +68,38 @@ describe("Core/ColorGeometryInstanceAttribute", function () { expect( ColorGeometryInstanceAttribute.equals( color, - new ColorGeometryInstanceAttribute(0.1, 0.2, 0.3, 0.4) - ) + new ColorGeometryInstanceAttribute(0.1, 0.2, 0.3, 0.4), + ), ).toEqual(true); expect( ColorGeometryInstanceAttribute.equals( color, - new ColorGeometryInstanceAttribute(0.5, 0.2, 0.3, 0.4) - ) + new ColorGeometryInstanceAttribute(0.5, 0.2, 0.3, 0.4), + ), ).toEqual(false); expect( ColorGeometryInstanceAttribute.equals( color, - new ColorGeometryInstanceAttribute(0.1, 0.5, 0.3, 0.4) - ) + new ColorGeometryInstanceAttribute(0.1, 0.5, 0.3, 0.4), + ), ).toEqual(false); expect( ColorGeometryInstanceAttribute.equals( color, - new ColorGeometryInstanceAttribute(0.1, 0.2, 0.5, 0.4) - ) + new ColorGeometryInstanceAttribute(0.1, 0.2, 0.5, 0.4), + ), ).toEqual(false); expect( ColorGeometryInstanceAttribute.equals( color, - new ColorGeometryInstanceAttribute(0.1, 0.2, 0.3, 0.5) - ) + new ColorGeometryInstanceAttribute(0.1, 0.2, 0.3, 0.5), + ), ).toEqual(false); expect(ColorGeometryInstanceAttribute.equals(color, undefined)).toEqual( - false + false, ); expect(ColorGeometryInstanceAttribute.equals(undefined, color)).toEqual( - false + false, ); }); }); diff --git a/packages/engine/Specs/Core/ColorSpec.js b/packages/engine/Specs/Core/ColorSpec.js index 96ab7d124170..157b2781e0d3 100644 --- a/packages/engine/Specs/Core/ColorSpec.js +++ b/packages/engine/Specs/Core/ColorSpec.js @@ -85,7 +85,7 @@ describe("Core/Color", function () { const color = new Color(); const result = Color.fromCartesian4( new Cartesian4(1.0, 2.0, 3.0, 4.0), - color + color, ); expect(color).toBe(result); expect(color).toEqual(new Color(1.0, 2.0, 3.0, 4.0)); @@ -152,10 +152,10 @@ describe("Core/Color", function () { expect(Color.BLUE.toCssColorString()).toEqual("rgb(0,0,255)"); expect(Color.LIME.toCssColorString()).toEqual("rgb(0,255,0)"); expect(new Color(0.0, 0.0, 0.0, 1.0).toCssColorString()).toEqual( - "rgb(0,0,0)" + "rgb(0,0,0)", ); expect(new Color(0.1, 0.2, 0.3, 0.4).toCssColorString()).toEqual( - "rgba(25,51,76,0.4)" + "rgba(25,51,76,0.4)", ); }); @@ -170,13 +170,13 @@ describe("Core/Color", function () { it("fromCssColorString supports transparent", function () { expect(Color.fromCssColorString("transparent")).toEqual( - new Color(0.0, 0.0, 0.0, 0.0) + new Color(0.0, 0.0, 0.0, 0.0), ); }); it("fromCssColorString supports the #rgb format", function () { expect(Color.fromCssColorString("#369")).toEqual( - new Color(0.2, 0.4, 0.6, 1.0) + new Color(0.2, 0.4, 0.6, 1.0), ); }); @@ -194,19 +194,19 @@ describe("Core/Color", function () { it("fromCssColorString supports the #rgba format", function () { expect(Color.fromCssColorString("#369c")).toEqual( - new Color(0.2, 0.4, 0.6, 0.8) + new Color(0.2, 0.4, 0.6, 0.8), ); }); it("fromCssColorString supports the #rgba format with uppercase", function () { expect(Color.fromCssColorString("#369C")).toEqual( - new Color(0.2, 0.4, 0.6, 0.8) + new Color(0.2, 0.4, 0.6, 0.8), ); }); it("fromCssColorString supports the #rrggbb format", function () { expect(Color.fromCssColorString("#336699")).toEqual( - new Color(0.2, 0.4, 0.6, 1.0) + new Color(0.2, 0.4, 0.6, 1.0), ); }); @@ -224,13 +224,13 @@ describe("Core/Color", function () { it("fromCssColorString supports the #rrggbbaa format", function () { expect(Color.fromCssColorString("#336699cc")).toEqual( - new Color(0.2, 0.4, 0.6, 0.8) + new Color(0.2, 0.4, 0.6, 0.8), ); }); it("fromCssColorString supports the #rrggbbaa format with uppercase", function () { expect(Color.fromCssColorString("#336699CC")).toEqual( - new Color(0.2, 0.4, 0.6, 0.8) + new Color(0.2, 0.4, 0.6, 0.8), ); }); @@ -239,7 +239,7 @@ describe("Core/Color", function () { expect(Color.fromCssColorString("rgb(0, 255, 0)")).toEqual(Color.LIME); expect(Color.fromCssColorString("rgb(0, 0, 255)")).toEqual(Color.BLUE); expect(Color.fromCssColorString("rgb(51, 102, 204)")).toEqual( - new Color(0.2, 0.4, 0.8, 1.0) + new Color(0.2, 0.4, 0.8, 1.0), ); }); @@ -248,7 +248,7 @@ describe("Core/Color", function () { expect(Color.fromCssColorString("rgb(0 255 0)")).toEqual(Color.LIME); expect(Color.fromCssColorString("rgb(0 0 255)")).toEqual(Color.BLUE); expect(Color.fromCssColorString("rgb(51 102 204)")).toEqual( - new Color(0.2, 0.4, 0.8, 1.0) + new Color(0.2, 0.4, 0.8, 1.0), ); }); @@ -257,7 +257,7 @@ describe("Core/Color", function () { expect(Color.fromCssColorString("rgb(0, 100%, 0)")).toEqual(Color.LIME); expect(Color.fromCssColorString("rgb(0, 0, 100%)")).toEqual(Color.BLUE); expect(Color.fromCssColorString("rgb(20%, 40%, 80%)")).toEqual( - new Color(0.2, 0.4, 0.8, 1.0) + new Color(0.2, 0.4, 0.8, 1.0), ); }); @@ -266,20 +266,20 @@ describe("Core/Color", function () { expect(Color.fromCssColorString("rgb(0 100% 0)")).toEqual(Color.LIME); expect(Color.fromCssColorString("rgb(0 0 100%)")).toEqual(Color.BLUE); expect(Color.fromCssColorString("rgb(20% 40% 80%)")).toEqual( - new Color(0.2, 0.4, 0.8, 1.0) + new Color(0.2, 0.4, 0.8, 1.0), ); }); it("fromCssColorString supports the rgba() format with absolute values", function () { expect(Color.fromCssColorString("rgba(255, 0, 0, 1.0)")).toEqual(Color.RED); expect(Color.fromCssColorString("rgba(0, 255, 0, 1.0)")).toEqual( - Color.LIME + Color.LIME, ); expect(Color.fromCssColorString("rgba(0, 0, 255, 1.0)")).toEqual( - Color.BLUE + Color.BLUE, ); expect(Color.fromCssColorString("rgba(51, 102, 204, 0.6)")).toEqual( - new Color(0.2, 0.4, 0.8, 0.6) + new Color(0.2, 0.4, 0.8, 0.6), ); }); @@ -288,35 +288,35 @@ describe("Core/Color", function () { expect(Color.fromCssColorString("rgba(0 255 0 / 1.0)")).toEqual(Color.LIME); expect(Color.fromCssColorString("rgba(0 0 255 / 1.0)")).toEqual(Color.BLUE); expect(Color.fromCssColorString("rgba(51 102 204 / 0.6)")).toEqual( - new Color(0.2, 0.4, 0.8, 0.6) + new Color(0.2, 0.4, 0.8, 0.6), ); }); it("fromCssColorString supports the rgba() format with percentages", function () { expect(Color.fromCssColorString("rgba(100%, 0, 0, 1.0)")).toEqual( - Color.RED + Color.RED, ); expect(Color.fromCssColorString("rgba(0, 100%, 0, 1.0)")).toEqual( - Color.LIME + Color.LIME, ); expect(Color.fromCssColorString("rgba(0, 0, 100%, 1.0)")).toEqual( - Color.BLUE + Color.BLUE, ); expect(Color.fromCssColorString("rgba(20%, 40%, 80%, 0.6)")).toEqual( - new Color(0.2, 0.4, 0.8, 0.6) + new Color(0.2, 0.4, 0.8, 0.6), ); }); it("fromCssColorString supports the rgba() format with percentages (space-separated)", function () { expect(Color.fromCssColorString("rgba(100% 0 0 / 1.0)")).toEqual(Color.RED); expect(Color.fromCssColorString("rgba(0 100% 0 / 1.0)")).toEqual( - Color.LIME + Color.LIME, ); expect(Color.fromCssColorString("rgba(0 0 100% / 1.0)")).toEqual( - Color.BLUE + Color.BLUE, ); expect(Color.fromCssColorString("rgba(20% 40% 80% / 0.6)")).toEqual( - new Color(0.2, 0.4, 0.8, 0.6) + new Color(0.2, 0.4, 0.8, 0.6), ); }); @@ -332,7 +332,7 @@ describe("Core/Color", function () { expect(Color.fromCssColorString("hsl(240, 100%, 50%)")).toEqual(Color.BLUE); expect(Color.fromCssColorString("hsl(220, 60%, 50%)")).toEqualEpsilon( new Color(0.2, 0.4, 0.8), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); }); @@ -342,46 +342,46 @@ describe("Core/Color", function () { expect(Color.fromCssColorString("hsl(240 100% 50%)")).toEqual(Color.BLUE); expect(Color.fromCssColorString("hsl(220 60% 50%)")).toEqualEpsilon( new Color(0.2, 0.4, 0.8), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); }); it("fromCssColorString supports the hsla() format", function () { expect(Color.fromCssColorString("hsla(0, 100%, 50%, 1.0)")).toEqual( - Color.RED + Color.RED, ); expect(Color.fromCssColorString("hsla(120, 100%, 50%, 1.0)")).toEqual( - Color.LIME + Color.LIME, ); expect(Color.fromCssColorString("hsla(240, 100%, 50%, 1.0)")).toEqual( - Color.BLUE + Color.BLUE, ); expect(Color.fromCssColorString("hsla(220, 60%, 50%, 0.6)")).toEqualEpsilon( new Color(0.2, 0.4, 0.8, 0.6), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); }); it("fromCssColorString supports the hsla() format (space-separated)", function () { expect(Color.fromCssColorString("hsla(0 100% 50% / 1.0)")).toEqual( - Color.RED + Color.RED, ); expect(Color.fromCssColorString("hsla(120 100% 50% / 1.0)")).toEqual( - Color.LIME + Color.LIME, ); expect(Color.fromCssColorString("hsla(240 100% 50% / 1.0)")).toEqual( - Color.BLUE + Color.BLUE, ); expect(Color.fromCssColorString("hsla(220 60% 50% / 0.6)")).toEqualEpsilon( new Color(0.2, 0.4, 0.8, 0.6), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); }); it("fromCssColorString wraps hue into valid range for hsl() format", function () { expect(Color.fromCssColorString("hsl(720, 100%, 50%)")).toEqual(Color.RED); expect(Color.fromCssColorString("hsla(720, 100%, 50%, 1.0)")).toEqual( - Color.RED + Color.RED, ); }); @@ -426,13 +426,13 @@ describe("Core/Color", function () { it("fromCssColorString understands the color string even with any number of unnecessary leading, trailing or middle spaces", function () { expect(Color.fromCssColorString(" rgb( 0, 0, 255)")).toEqual(Color.BLUE); expect(Color.fromCssColorString("rgb( 255, 255, 255) ")).toEqual( - Color.WHITE + Color.WHITE, ); expect(Color.fromCssColorString("rgb (0 0 255) ")).toEqual(Color.BLUE); expect(Color.fromCssColorString(" #FF0000")).toEqual(Color.RED); expect(Color.fromCssColorString("#FF0 ")).toEqual(Color.YELLOW); expect(Color.fromCssColorString(" hsla(720, 100%, 50%, 1.0) ")).toEqual( - Color.RED + Color.RED, ); expect(Color.fromCssColorString("hsl (720, 100%, 50%)")).toEqual(Color.RED); }); @@ -443,7 +443,7 @@ describe("Core/Color", function () { expect(Color.fromHsl(240.0 / 360.0, 1.0, 0.5, 1.0)).toEqual(Color.BLUE); expect(Color.fromHsl(220.0 / 360.0, 0.6, 0.5, 0.7)).toEqualEpsilon( new Color(0.2, 0.4, 0.8, 0.7), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); }); @@ -508,12 +508,12 @@ describe("Core/Color", function () { expect(color.red).toBeBetween(options.minimumRed, options.maximumRed); expect(color.green).toBeBetween( options.minimumGreen, - options.maximumGreen + options.maximumGreen, ); expect(color.blue).toBeBetween(options.minimumBlue, options.maximumBlue); expect(color.alpha).toBeBetween( options.minimumAlpha, - options.maximumAlpha + options.maximumAlpha, ); } }); @@ -597,7 +597,7 @@ describe("Core/Color", function () { it("toString produces correct results", function () { expect(new Color(0.1, 0.2, 0.3, 0.4).toString()).toEqual( - "(0.1, 0.2, 0.3, 0.4)" + "(0.1, 0.2, 0.3, 0.4)", ); }); @@ -939,10 +939,9 @@ describe("Core/Color", function () { expect(result.alpha).toEqualEpsilon(0.5, CesiumMath.EPSILON15); }); - createPackableSpecs(Color, new Color(0.1, 0.2, 0.3, 0.4), [ - 0.1, - 0.2, - 0.3, - 0.4, - ]); + createPackableSpecs( + Color, + new Color(0.1, 0.2, 0.3, 0.4), + [0.1, 0.2, 0.3, 0.4], + ); }); diff --git a/packages/engine/Specs/Core/ComponentDatatypeSpec.js b/packages/engine/Specs/Core/ComponentDatatypeSpec.js index 10957085f84b..b1047d3f1bb0 100644 --- a/packages/engine/Specs/Core/ComponentDatatypeSpec.js +++ b/packages/engine/Specs/Core/ComponentDatatypeSpec.js @@ -3,28 +3,28 @@ import { ComponentDatatype } from "../../index.js"; describe("Core/ComponentDatatype", function () { it("fromTypedArray works", function () { expect(ComponentDatatype.fromTypedArray(new Int8Array())).toBe( - ComponentDatatype.BYTE + ComponentDatatype.BYTE, ); expect(ComponentDatatype.fromTypedArray(new Uint8Array())).toBe( - ComponentDatatype.UNSIGNED_BYTE + ComponentDatatype.UNSIGNED_BYTE, ); expect(ComponentDatatype.fromTypedArray(new Int16Array())).toBe( - ComponentDatatype.SHORT + ComponentDatatype.SHORT, ); expect(ComponentDatatype.fromTypedArray(new Uint16Array())).toBe( - ComponentDatatype.UNSIGNED_SHORT + ComponentDatatype.UNSIGNED_SHORT, ); expect(ComponentDatatype.fromTypedArray(new Int32Array())).toBe( - ComponentDatatype.INT + ComponentDatatype.INT, ); expect(ComponentDatatype.fromTypedArray(new Uint32Array())).toBe( - ComponentDatatype.UNSIGNED_INT + ComponentDatatype.UNSIGNED_INT, ); expect(ComponentDatatype.fromTypedArray(new Float32Array())).toBe( - ComponentDatatype.FLOAT + ComponentDatatype.FLOAT, ); expect(ComponentDatatype.fromTypedArray(new Float64Array())).toBe( - ComponentDatatype.DOUBLE + ComponentDatatype.DOUBLE, ); }); @@ -37,15 +37,15 @@ describe("Core/ComponentDatatype", function () { it("validate works", function () { expect(ComponentDatatype.validate(ComponentDatatype.BYTE)).toBe(true); expect(ComponentDatatype.validate(ComponentDatatype.UNSIGNED_BYTE)).toBe( - true + true, ); expect(ComponentDatatype.validate(ComponentDatatype.SHORT)).toBe(true); expect(ComponentDatatype.validate(ComponentDatatype.UNSIGNED_SHORT)).toBe( - true + true, ); expect(ComponentDatatype.validate(ComponentDatatype.INT)).toBe(true); expect(ComponentDatatype.validate(ComponentDatatype.UNSIGNED_INT)).toBe( - true + true, ); expect(ComponentDatatype.validate(ComponentDatatype.FLOAT)).toBe(true); expect(ComponentDatatype.validate(ComponentDatatype.DOUBLE)).toBe(true); @@ -56,14 +56,14 @@ describe("Core/ComponentDatatype", function () { it("createTypedArray works with size", function () { let typedArray = ComponentDatatype.createTypedArray( ComponentDatatype.BYTE, - 0 + 0, ); expect(typedArray).toBeInstanceOf(Int8Array); expect(typedArray.length).toBe(0); typedArray = ComponentDatatype.createTypedArray( ComponentDatatype.UNSIGNED_BYTE, - 1 + 1, ); expect(typedArray).toBeInstanceOf(Uint8Array); expect(typedArray.length).toBe(1); @@ -74,7 +74,7 @@ describe("Core/ComponentDatatype", function () { typedArray = ComponentDatatype.createTypedArray( ComponentDatatype.UNSIGNED_SHORT, - 3 + 3, ); expect(typedArray).toBeInstanceOf(Uint16Array); expect(typedArray.length).toBe(3); @@ -85,7 +85,7 @@ describe("Core/ComponentDatatype", function () { typedArray = ComponentDatatype.createTypedArray( ComponentDatatype.UNSIGNED_INT, - 5 + 5, ); expect(typedArray).toBeInstanceOf(Uint32Array); expect(typedArray.length).toBe(5); @@ -96,7 +96,7 @@ describe("Core/ComponentDatatype", function () { typedArray = ComponentDatatype.createTypedArray( ComponentDatatype.DOUBLE, - 7 + 7, ); expect(typedArray).toBeInstanceOf(Float64Array); expect(typedArray.length).toBe(7); @@ -106,7 +106,7 @@ describe("Core/ComponentDatatype", function () { const values = [34, 12, 4, 1]; let typedArray = ComponentDatatype.createTypedArray( ComponentDatatype.BYTE, - values + values, ); expect(typedArray).toBeInstanceOf(Int8Array); expect(typedArray).toEqual(values); @@ -114,7 +114,7 @@ describe("Core/ComponentDatatype", function () { typedArray = ComponentDatatype.createTypedArray( ComponentDatatype.UNSIGNED_BYTE, - values + values, ); expect(typedArray).toBeInstanceOf(Uint8Array); expect(typedArray).toEqual(values); @@ -122,7 +122,7 @@ describe("Core/ComponentDatatype", function () { typedArray = ComponentDatatype.createTypedArray( ComponentDatatype.SHORT, - values + values, ); expect(typedArray).toBeInstanceOf(Int16Array); expect(typedArray).toEqual(values); @@ -130,7 +130,7 @@ describe("Core/ComponentDatatype", function () { typedArray = ComponentDatatype.createTypedArray( ComponentDatatype.UNSIGNED_SHORT, - values + values, ); expect(typedArray).toBeInstanceOf(Uint16Array); expect(typedArray).toEqual(values); @@ -138,7 +138,7 @@ describe("Core/ComponentDatatype", function () { typedArray = ComponentDatatype.createTypedArray( ComponentDatatype.INT, - values + values, ); expect(typedArray).toBeInstanceOf(Int32Array); expect(typedArray).toEqual(values); @@ -146,7 +146,7 @@ describe("Core/ComponentDatatype", function () { typedArray = ComponentDatatype.createTypedArray( ComponentDatatype.UNSIGNED_INT, - values + values, ); expect(typedArray).toBeInstanceOf(Uint32Array); expect(typedArray).toEqual(values); @@ -154,7 +154,7 @@ describe("Core/ComponentDatatype", function () { typedArray = ComponentDatatype.createTypedArray( ComponentDatatype.FLOAT, - values + values, ); expect(typedArray).toBeInstanceOf(Float32Array); expect(typedArray).toEqual(values); @@ -162,7 +162,7 @@ describe("Core/ComponentDatatype", function () { typedArray = ComponentDatatype.createTypedArray( ComponentDatatype.DOUBLE, - values + values, ); expect(typedArray).toBeInstanceOf(Float64Array); expect(typedArray).toEqual(values); @@ -176,64 +176,64 @@ describe("Core/ComponentDatatype", function () { ComponentDatatype.BYTE, buffer, 0, - 1 - ) + 1, + ), ).toBeInstanceOf(Int8Array); expect( ComponentDatatype.createArrayBufferView( ComponentDatatype.UNSIGNED_BYTE, buffer, 0, - 1 - ) + 1, + ), ).toBeInstanceOf(Uint8Array); expect( ComponentDatatype.createArrayBufferView( ComponentDatatype.SHORT, buffer, 0, - 1 - ) + 1, + ), ).toBeInstanceOf(Int16Array); expect( ComponentDatatype.createArrayBufferView( ComponentDatatype.UNSIGNED_SHORT, buffer, 0, - 1 - ) + 1, + ), ).toBeInstanceOf(Uint16Array); expect( ComponentDatatype.createArrayBufferView( ComponentDatatype.INT, buffer, 0, - 1 - ) + 1, + ), ).toBeInstanceOf(Int32Array); expect( ComponentDatatype.createArrayBufferView( ComponentDatatype.UNSIGNED_INT, buffer, 0, - 1 - ) + 1, + ), ).toBeInstanceOf(Uint32Array); expect( ComponentDatatype.createArrayBufferView( ComponentDatatype.FLOAT, buffer, 0, - 1 - ) + 1, + ), ).toBeInstanceOf(Float32Array); expect( ComponentDatatype.createArrayBufferView( ComponentDatatype.DOUBLE, buffer, 0, - 1 - ) + 1, + ), ).toBeInstanceOf(Float64Array); }); @@ -269,7 +269,7 @@ describe("Core/ComponentDatatype", function () { ComponentDatatype.BYTE, undefined, 0, - 1 + 1, ); }).toThrowDeveloperError(); }); @@ -277,23 +277,23 @@ describe("Core/ComponentDatatype", function () { it("fromName works", function () { expect(ComponentDatatype.fromName("BYTE")).toEqual(ComponentDatatype.BYTE); expect(ComponentDatatype.fromName("UNSIGNED_BYTE")).toEqual( - ComponentDatatype.UNSIGNED_BYTE + ComponentDatatype.UNSIGNED_BYTE, ); expect(ComponentDatatype.fromName("SHORT")).toEqual( - ComponentDatatype.SHORT + ComponentDatatype.SHORT, ); expect(ComponentDatatype.fromName("UNSIGNED_SHORT")).toEqual( - ComponentDatatype.UNSIGNED_SHORT + ComponentDatatype.UNSIGNED_SHORT, ); expect(ComponentDatatype.fromName("INT")).toEqual(ComponentDatatype.INT); expect(ComponentDatatype.fromName("UNSIGNED_INT")).toEqual( - ComponentDatatype.UNSIGNED_INT + ComponentDatatype.UNSIGNED_INT, ); expect(ComponentDatatype.fromName("FLOAT")).toEqual( - ComponentDatatype.FLOAT + ComponentDatatype.FLOAT, ); expect(ComponentDatatype.fromName("DOUBLE")).toEqual( - ComponentDatatype.DOUBLE + ComponentDatatype.DOUBLE, ); }); diff --git a/packages/engine/Specs/Core/CoplanarPolygonGeometrySpec.js b/packages/engine/Specs/Core/CoplanarPolygonGeometrySpec.js index 11e767ab5081..3ccf284c23c2 100644 --- a/packages/engine/Specs/Core/CoplanarPolygonGeometrySpec.js +++ b/packages/engine/Specs/Core/CoplanarPolygonGeometrySpec.js @@ -26,20 +26,10 @@ describe("Core/CoplanarPolygonGeometry", function () { const geometry = CoplanarPolygonGeometry.createGeometry( CoplanarPolygonGeometry.fromPositions({ positions: Cartesian3.fromDegreesArrayHeights([ - 49.0, - 18.0, - 1000.0, - 49.0, - 18.0, - 5000.0, - 49.0, - 18.0, - 5000.0, - 49.0, - 18.0, - 1000.0, + 49.0, 18.0, 1000.0, 49.0, 18.0, 5000.0, 49.0, 18.0, 5000.0, 49.0, + 18.0, 1000.0, ]), - }) + }), ); expect(geometry).toBeUndefined(); }); @@ -48,17 +38,9 @@ describe("Core/CoplanarPolygonGeometry", function () { const geometry = CoplanarPolygonGeometry.createGeometry( CoplanarPolygonGeometry.fromPositions({ positions: Cartesian3.fromDegreesArrayHeights([ - 0.0, - 0.0, - 1.0, - 0.0, - 0.0, - 2.0, - 0.0, - 0.0, - 3.0, + 0.0, 0.0, 1.0, 0.0, 0.0, 2.0, 0.0, 0.0, 3.0, ]), - }) + }), ); expect(geometry).toBeUndefined(); }); @@ -69,19 +51,14 @@ describe("Core/CoplanarPolygonGeometry", function () { holes: [ { positions: Cartesian3.fromDegreesArray([ - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, ]), }, ], }; const geometry = CoplanarPolygonGeometry.createGeometry( - new CoplanarPolygonGeometry({ polygonHierarchy: hierarchy }) + new CoplanarPolygonGeometry({ polygonHierarchy: hierarchy }), ); expect(geometry).toBeUndefined(); }); @@ -91,20 +68,9 @@ describe("Core/CoplanarPolygonGeometry", function () { CoplanarPolygonGeometry.fromPositions({ vertexFormat: VertexFormat.POSITION_ONLY, positions: Cartesian3.fromDegreesArrayHeights([ - -1.0, - -1.0, - 0.0, - -1.0, - 0.0, - 1.0, - -1.0, - 1.0, - 1.0, - -1.0, - 2.0, - 0.0, + -1.0, -1.0, 0.0, -1.0, 0.0, 1.0, -1.0, 1.0, 1.0, -1.0, 2.0, 0.0, ]), - }) + }), ); expect(p.attributes.position.values.length).toEqual(4 * 3); @@ -116,20 +82,9 @@ describe("Core/CoplanarPolygonGeometry", function () { CoplanarPolygonGeometry.fromPositions({ vertexFormat: VertexFormat.ALL, positions: Cartesian3.fromDegreesArrayHeights([ - -1.0, - -1.0, - 0.0, - -1.0, - 0.0, - 1.0, - -1.0, - 1.0, - 1.0, - -1.0, - 2.0, - 0.0, + -1.0, -1.0, 0.0, -1.0, 0.0, 1.0, -1.0, 1.0, 1.0, -1.0, 2.0, 0.0, ]), - }) + }), ); const numVertices = 4; @@ -147,20 +102,9 @@ describe("Core/CoplanarPolygonGeometry", function () { CoplanarPolygonGeometry.fromPositions({ vertexFormat: VertexFormat.ALL, positions: Cartesian3.fromDegreesArrayHeights([ - 90.0, - -1.0, - 0.0, - 90.0, - 1.0, - 0.0, - 92.0, - 1.0, - 0.0, - 92.0, - -1.0, - 0.0, + 90.0, -1.0, 0.0, 90.0, 1.0, 0.0, 92.0, 1.0, 0.0, 92.0, -1.0, 0.0, ]), - }) + }), ); const center = Cartesian3.fromDegrees(91.0, 0.0); @@ -174,28 +118,13 @@ describe("Core/CoplanarPolygonGeometry", function () { // pack without explicit texture coordinates const positions = Cartesian3.fromDegreesArray([ - -12.4, - 3.5, - -12.0, - 3.5, - -12.0, - 4.0, + -12.4, 3.5, -12.0, 3.5, -12.0, 4.0, ]); const holePositions0 = Cartesian3.fromDegreesArray([ - -12.2, - 3.5, - -12.2, - 3.6, - -12.3, - 3.6, + -12.2, 3.5, -12.2, 3.6, -12.3, 3.6, ]); const holePositions1 = Cartesian3.fromDegreesArray([ - -12.2, - 3.5, - -12.25, - 3.5, - -12.25, - 3.55, + -12.2, 3.5, -12.25, 3.5, -12.25, 3.55, ]); const hierarchy = { positions: positions, @@ -238,7 +167,7 @@ describe("Core/CoplanarPolygonGeometry", function () { packedInstance.push( Ellipsoid.WGS84.radii.x, Ellipsoid.WGS84.radii.y, - Ellipsoid.WGS84.radii.z + Ellipsoid.WGS84.radii.z, ); packedInstance.push(1, 0, 0, 0, 0, 0, 0, -1, 45); createPackableSpecs(CoplanarPolygonGeometry, polygon, packedInstance); @@ -275,7 +204,7 @@ describe("Core/CoplanarPolygonGeometry", function () { packedInstanceTextured.push( Ellipsoid.WGS84.radii.x, Ellipsoid.WGS84.radii.y, - Ellipsoid.WGS84.radii.z + Ellipsoid.WGS84.radii.z, ); packedInstanceTextured.push(1, 0, 0, 0, 0, 0, 0); packedInstanceTextured.push(9.0, 0.0); @@ -284,6 +213,6 @@ describe("Core/CoplanarPolygonGeometry", function () { createPackableSpecs( CoplanarPolygonGeometry, polygonTextured, - packedInstanceTextured + packedInstanceTextured, ); }); diff --git a/packages/engine/Specs/Core/CoplanarPolygonOutlineGeometrySpec.js b/packages/engine/Specs/Core/CoplanarPolygonOutlineGeometrySpec.js index 90c922124f6b..ee579d803f93 100644 --- a/packages/engine/Specs/Core/CoplanarPolygonOutlineGeometrySpec.js +++ b/packages/engine/Specs/Core/CoplanarPolygonOutlineGeometrySpec.js @@ -19,20 +19,10 @@ describe("Core/CoplanarPolygonOutlineGeometry", function () { const geometry = CoplanarPolygonOutlineGeometry.createGeometry( CoplanarPolygonOutlineGeometry.fromPositions({ positions: Cartesian3.fromDegreesArrayHeights([ - 49.0, - 18.0, - 1000.0, - 49.0, - 18.0, - 5000.0, - 49.0, - 18.0, - 5000.0, - 49.0, - 18.0, - 1000.0, + 49.0, 18.0, 1000.0, 49.0, 18.0, 5000.0, 49.0, 18.0, 5000.0, 49.0, + 18.0, 1000.0, ]), - }) + }), ); expect(geometry).toBeUndefined(); }); @@ -41,17 +31,9 @@ describe("Core/CoplanarPolygonOutlineGeometry", function () { const geometry = CoplanarPolygonOutlineGeometry.createGeometry( CoplanarPolygonOutlineGeometry.fromPositions({ positions: Cartesian3.fromDegreesArrayHeights([ - 0.0, - 0.0, - 1.0, - 0.0, - 0.0, - 2.0, - 0.0, - 0.0, - 3.0, + 0.0, 0.0, 1.0, 0.0, 0.0, 2.0, 0.0, 0.0, 3.0, ]), - }) + }), ); expect(geometry).toBeUndefined(); }); @@ -62,19 +44,14 @@ describe("Core/CoplanarPolygonOutlineGeometry", function () { holes: [ { positions: Cartesian3.fromDegreesArray([ - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, ]), }, ], }; const geometry = CoplanarPolygonOutlineGeometry.createGeometry( - new CoplanarPolygonOutlineGeometry({ polygonHierarchy: hierarchy }) + new CoplanarPolygonOutlineGeometry({ polygonHierarchy: hierarchy }), ); expect(geometry).toBeUndefined(); }); @@ -83,20 +60,9 @@ describe("Core/CoplanarPolygonOutlineGeometry", function () { const geometry = CoplanarPolygonOutlineGeometry.createGeometry( CoplanarPolygonOutlineGeometry.fromPositions({ positions: Cartesian3.fromDegreesArrayHeights([ - -1.0, - -1.0, - 0.0, - -1.0, - 0.0, - 1.0, - -1.0, - 1.0, - 1.0, - -1.0, - 2.0, - 0.0, + -1.0, -1.0, 0.0, -1.0, 0.0, 1.0, -1.0, 1.0, 1.0, -1.0, 2.0, 0.0, ]), - }) + }), ); expect(geometry.attributes.position.values.length).toEqual(4 * 3); @@ -104,28 +70,13 @@ describe("Core/CoplanarPolygonOutlineGeometry", function () { }); const positions = Cartesian3.fromDegreesArray([ - -124.0, - 35.0, - -110.0, - 35.0, - -110.0, - 40.0, + -124.0, 35.0, -110.0, 35.0, -110.0, 40.0, ]); const holePositions0 = Cartesian3.fromDegreesArray([ - -122.0, - 36.0, - -122.0, - 39.0, - -112.0, - 39.0, + -122.0, 36.0, -122.0, 39.0, -112.0, 39.0, ]); const holePositions1 = Cartesian3.fromDegreesArray([ - -120.0, - 36.5, - -114.0, - 36.5, - -114.0, - 38.5, + -120.0, 36.5, -114.0, 36.5, -114.0, 38.5, ]); const hierarchy = { positions: positions, diff --git a/packages/engine/Specs/Core/CorridorGeometrySpec.js b/packages/engine/Specs/Core/CorridorGeometrySpec.js index c8d4c6efd2d9..26c91005b708 100644 --- a/packages/engine/Specs/Core/CorridorGeometrySpec.js +++ b/packages/engine/Specs/Core/CorridorGeometrySpec.js @@ -31,7 +31,7 @@ describe("Core/CorridorGeometry", function () { new CorridorGeometry({ positions: Cartesian3.fromDegreesArray([90.0, -30.0, 90.0, -30.0]), width: 10000, - }) + }), ); expect(geometry).toBeUndefined(); @@ -41,16 +41,16 @@ describe("Core/CorridorGeometry", function () { new Cartesian3( -1349511.388149118, -5063973.22857992, - 3623141.6372688496 + 3623141.6372688496, ), //same lon/lat, different height new Cartesian3( -1349046.4811926484, -5062228.688739784, - 3621885.0521561056 + 3621885.0521561056, ), ], width: 10000, - }) + }), ); expect(geometry).toBeUndefined(); }); @@ -62,7 +62,7 @@ describe("Core/CorridorGeometry", function () { positions: Cartesian3.fromDegreesArray([90.0, -30.0, 90.0, -35.0]), cornerType: CornerType.MITERED, width: 30000, - }) + }), ); const numVertices = 12; //6 left + 6 right @@ -78,7 +78,7 @@ describe("Core/CorridorGeometry", function () { positions: Cartesian3.fromDegreesArray([90.0, -30.0, 90.0, -35.0]), cornerType: CornerType.MITERED, width: 30000, - }) + }), ); const numVertices = 12; @@ -99,7 +99,7 @@ describe("Core/CorridorGeometry", function () { cornerType: CornerType.MITERED, width: 30000, extrudedHeight: 30000, - }) + }), ); const numVertices = 72; // 6 positions x 4 for a box at each position x 3 to duplicate for normals @@ -116,7 +116,7 @@ describe("Core/CorridorGeometry", function () { cornerType: CornerType.MITERED, width: 30000, extrudedHeight: 30000, - }) + }), ); const numVertices = 72; @@ -137,7 +137,7 @@ describe("Core/CorridorGeometry", function () { cornerType: CornerType.MITERED, width: 30000, offsetAttribute: GeometryOffsetAttribute.TOP, - }) + }), ); const numVertices = 12; @@ -158,7 +158,7 @@ describe("Core/CorridorGeometry", function () { width: 30000, extrudedHeight: 30000, offsetAttribute: GeometryOffsetAttribute.TOP, - }) + }), ); const numVertices = 72; @@ -182,7 +182,7 @@ describe("Core/CorridorGeometry", function () { width: 30000, extrudedHeight: 30000, offsetAttribute: GeometryOffsetAttribute.ALL, - }) + }), ); const numVertices = 72; @@ -199,16 +199,11 @@ describe("Core/CorridorGeometry", function () { new CorridorGeometry({ vertexFormat: VertexFormat.POSITION_ONLY, positions: Cartesian3.fromDegreesArray([ - 90.0, - -30.0, - 90.0, - -31.0, - 91.0, - -31.0, + 90.0, -30.0, 90.0, -31.0, 91.0, -31.0, ]), cornerType: CornerType.MITERED, width: 30000, - }) + }), ); expect(m.attributes.position.values.length).toEqual(8 * 3); // 4 left + 4 right @@ -220,16 +215,11 @@ describe("Core/CorridorGeometry", function () { new CorridorGeometry({ vertexFormat: VertexFormat.POSITION_ONLY, positions: Cartesian3.fromDegreesArray([ - 90.0, - -30.0, - 90.0, - -31.0, - 89.0, - -31.0, + 90.0, -30.0, 90.0, -31.0, 89.0, -31.0, ]), cornerType: CornerType.MITERED, width: 30000, - }) + }), ); expect(m.attributes.position.values.length).toEqual(8 * 3); @@ -241,18 +231,11 @@ describe("Core/CorridorGeometry", function () { new CorridorGeometry({ vertexFormat: VertexFormat.POSITION_AND_ST, positions: Cartesian3.fromDegreesArray([ - 90.0, - -30.0, - 90.0, - -31.0, - 89.0, - -31.0, - 89.0, - -32.0, + 90.0, -30.0, 90.0, -31.0, 89.0, -31.0, 89.0, -32.0, ]), cornerType: CornerType.ROUNDED, width: 30000, - }) + }), ); const endCaps = 72; // 36 points * 2 end caps @@ -269,18 +252,11 @@ describe("Core/CorridorGeometry", function () { new CorridorGeometry({ vertexFormat: VertexFormat.POSITION_ONLY, positions: Cartesian3.fromDegreesArray([ - 90.0, - -30.0, - 90.0, - -31.0, - 89.0, - -31.0, - 89.0, - -32.0, + 90.0, -30.0, 90.0, -31.0, 89.0, -31.0, 89.0, -32.0, ]), cornerType: CornerType.BEVELED, width: 30000, - }) + }), ); expect(m.attributes.position.values.length).toEqual(10 * 3); @@ -292,20 +268,14 @@ describe("Core/CorridorGeometry", function () { new CorridorGeometry({ vertexFormat: VertexFormat.POSITION_ONLY, positions: Cartesian3.fromDegreesArray([ - 2.00571672577652, - 52.7781459942399, - 1.99188457974115, - 52.7764958852886, - 2.01325961458495, - 52.7674170680511, - 1.98708058340534, - 52.7733979856253, - 2.00634853946644, + 2.00571672577652, 52.7781459942399, 1.99188457974115, + 52.7764958852886, 2.01325961458495, 52.7674170680511, + 1.98708058340534, 52.7733979856253, 2.00634853946644, 52.7650460748473, ]), cornerType: CornerType.BEVELED, width: 100, - }) + }), ); expect(m.attributes.position.values.length).toEqual(13 * 3); // 3 points * 3 corners + 2 points * 2 ends @@ -317,17 +287,12 @@ describe("Core/CorridorGeometry", function () { new CorridorGeometry({ vertexFormat: VertexFormat.POSITION_ONLY, positions: Cartesian3.fromDegreesArray([ - -67.655, - 0.0, - -67.655, - 15.0, - -67.655, - 20.0, + -67.655, 0.0, -67.655, 15.0, -67.655, 20.0, ]), cornerType: CornerType.BEVELED, width: 400000, granularity: Math.PI / 6.0, - }) + }), ); expect(m.attributes.position.values.length).toEqual(4 * 3); @@ -346,24 +311,14 @@ describe("Core/CorridorGeometry", function () { const corridor1 = new CorridorGeometry({ vertexFormat: VertexFormat.POSITION_ONLY, positions: Cartesian3.fromDegreesArray([ - -67.655, - 0.0, - -67.655, - 15.0, - -67.655, - 20.0, + -67.655, 0.0, -67.655, 15.0, -67.655, 20.0, ]), width: 0, }); const corridor2 = new CorridorGeometry({ vertexFormat: VertexFormat.POSITION_ONLY, positions: Cartesian3.fromDegreesArray([ - -67.655, - 0.0, - -67.655, - 15.0, - -67.655, - 20.0, + -67.655, 0.0, -67.655, 15.0, -67.655, 20.0, ]), width: -100, }); @@ -375,19 +330,14 @@ describe("Core/CorridorGeometry", function () { expect(geometry0).toBeUndefined(); expect(geometry1).toBeUndefined(); expect(geometry2).toBeUndefined(); - } + }, ); it("computing rectangle property", function () { const c = new CorridorGeometry({ vertexFormat: VertexFormat.POSITION_ONLY, positions: Cartesian3.fromDegreesArray([ - -67.655, - 0.0, - -67.655, - 15.0, - -67.655, - 20.0, + -67.655, 0.0, -67.655, 15.0, -67.655, 20.0, ]), cornerType: CornerType.MITERED, width: 1, @@ -397,11 +347,11 @@ describe("Core/CorridorGeometry", function () { const r = c.rectangle; expect(CesiumMath.toDegrees(r.north)).toEqualEpsilon( 20.0, - CesiumMath.EPSILON13 + CesiumMath.EPSILON13, ); expect(CesiumMath.toDegrees(r.south)).toEqualEpsilon( 0.0, - CesiumMath.EPSILON20 + CesiumMath.EPSILON20, ); expect(CesiumMath.toDegrees(r.east)).toEqual(-67.65499522658291); expect(CesiumMath.toDegrees(r.west)).toEqual(-67.6550047734171); @@ -411,12 +361,7 @@ describe("Core/CorridorGeometry", function () { const options = { vertexFormat: VertexFormat.POSITION_ONLY, positions: Cartesian3.fromDegreesArray([ - -67.655, - 0.0, - -67.655, - 15.0, - -67.655, - 20.0, + -67.655, 0.0, -67.655, 15.0, -67.655, 20.0, ]), cornerType: CornerType.MITERED, width: 1, @@ -432,12 +377,7 @@ describe("Core/CorridorGeometry", function () { it("computeRectangle with result parameter", function () { const options = { positions: Cartesian3.fromDegreesArray([ - 72.0, - 0.0, - 85.0, - 15.0, - 83.0, - 20.0, + 72.0, 0.0, 85.0, 15.0, 83.0, 20.0, ]), width: 5, }; @@ -455,12 +395,7 @@ describe("Core/CorridorGeometry", function () { const c = new CorridorGeometry({ vertexFormat: VertexFormat.POSITION_ONLY, positions: Cartesian3.fromDegreesArray([ - -67.655, - 0.0, - -67.655, - 15.0, - -67.655, - 20.0, + -67.655, 0.0, -67.655, 15.0, -67.655, 20.0, ]), cornerType: CornerType.MITERED, width: 1, @@ -472,27 +407,27 @@ describe("Core/CorridorGeometry", function () { expect(textureCoordinateRotationPoints.length).toEqual(6); expect(textureCoordinateRotationPoints[0]).toEqualEpsilon( 0, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(textureCoordinateRotationPoints[1]).toEqualEpsilon( 0, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(textureCoordinateRotationPoints[2]).toEqualEpsilon( 0, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(textureCoordinateRotationPoints[3]).toEqualEpsilon( 1, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(textureCoordinateRotationPoints[4]).toEqualEpsilon( 1, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(textureCoordinateRotationPoints[5]).toEqualEpsilon( 0, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); }); @@ -517,7 +452,7 @@ describe("Core/CorridorGeometry", function () { packedInstance.push( Ellipsoid.WGS84.radii.x, Ellipsoid.WGS84.radii.y, - Ellipsoid.WGS84.radii.z + Ellipsoid.WGS84.radii.z, ); packedInstance.push(1.0, 0.0, 0.0, 0.0, 0.0, 0.0); packedInstance.push(30000.0, 0.0, 0.0, 2.0, 0.1, 0.0, -1); diff --git a/packages/engine/Specs/Core/CorridorOutlineGeometrySpec.js b/packages/engine/Specs/Core/CorridorOutlineGeometrySpec.js index 53ea95769ecf..5d8e84dee9ce 100644 --- a/packages/engine/Specs/Core/CorridorOutlineGeometrySpec.js +++ b/packages/engine/Specs/Core/CorridorOutlineGeometrySpec.js @@ -28,7 +28,7 @@ describe("Core/CorridorOutlineGeometry", function () { new CorridorOutlineGeometry({ positions: Cartesian3.fromDegreesArray([90.0, -30.0, 90.0, -30.0]), width: 10000, - }) + }), ); expect(geometry).toBeUndefined(); @@ -38,16 +38,16 @@ describe("Core/CorridorOutlineGeometry", function () { new Cartesian3( -1349511.388149118, -5063973.22857992, - 3623141.6372688496 + 3623141.6372688496, ), //same lon/lat, different height new Cartesian3( -1349046.4811926484, -5062228.688739784, - 3621885.0521561056 + 3621885.0521561056, ), ], width: 10000, - }) + }), ); expect(geometry).toBeUndefined(); }); @@ -58,7 +58,7 @@ describe("Core/CorridorOutlineGeometry", function () { positions: Cartesian3.fromDegreesArray([90.0, -30.0, 90.0, -35.0]), cornerType: CornerType.MITERED, width: 30000, - }) + }), ); expect(m.attributes.position.values.length).toEqual(12 * 3); // 6 left + 6 right @@ -72,7 +72,7 @@ describe("Core/CorridorOutlineGeometry", function () { cornerType: CornerType.MITERED, width: 30000, extrudedHeight: 30000, - }) + }), ); expect(m.attributes.position.values.length).toEqual(24 * 3); // 6 positions * 4 for a box at each position @@ -86,7 +86,7 @@ describe("Core/CorridorOutlineGeometry", function () { cornerType: CornerType.MITERED, width: 30000, offsetAttribute: GeometryOffsetAttribute.TOP, - }) + }), ); const numVertices = 12; @@ -106,7 +106,7 @@ describe("Core/CorridorOutlineGeometry", function () { width: 30000, extrudedHeight: 30000, offsetAttribute: GeometryOffsetAttribute.TOP, - }) + }), ); const numVertices = 24; @@ -126,7 +126,7 @@ describe("Core/CorridorOutlineGeometry", function () { width: 30000, extrudedHeight: 30000, offsetAttribute: GeometryOffsetAttribute.ALL, - }) + }), ); const numVertices = 24; @@ -142,16 +142,11 @@ describe("Core/CorridorOutlineGeometry", function () { const m = CorridorOutlineGeometry.createGeometry( new CorridorOutlineGeometry({ positions: Cartesian3.fromDegreesArray([ - 90.0, - -30.0, - 90.0, - -31.0, - 91.0, - -31.0, + 90.0, -30.0, 90.0, -31.0, 91.0, -31.0, ]), cornerType: CornerType.MITERED, width: 30000, - }) + }), ); expect(m.attributes.position.values.length).toEqual(8 * 3); @@ -162,16 +157,11 @@ describe("Core/CorridorOutlineGeometry", function () { const m = CorridorOutlineGeometry.createGeometry( new CorridorOutlineGeometry({ positions: Cartesian3.fromDegreesArray([ - 90.0, - -30.0, - 90.0, - -31.0, - 89.0, - -31.0, + 90.0, -30.0, 90.0, -31.0, 89.0, -31.0, ]), cornerType: CornerType.MITERED, width: 30000, - }) + }), ); expect(m.attributes.position.values.length).toEqual(8 * 3); @@ -182,18 +172,11 @@ describe("Core/CorridorOutlineGeometry", function () { const m = CorridorOutlineGeometry.createGeometry( new CorridorOutlineGeometry({ positions: Cartesian3.fromDegreesArray([ - 90.0, - -30.0, - 90.0, - -31.0, - 89.0, - -31.0, - 89.0, - -32.0, + 90.0, -30.0, 90.0, -31.0, 89.0, -31.0, 89.0, -32.0, ]), cornerType: CornerType.ROUNDED, width: 30000, - }) + }), ); const endCaps = 72; // 36 points * 2 end caps @@ -208,18 +191,11 @@ describe("Core/CorridorOutlineGeometry", function () { const m = CorridorOutlineGeometry.createGeometry( new CorridorOutlineGeometry({ positions: Cartesian3.fromDegreesArray([ - 90.0, - -30.0, - 90.0, - -31.0, - 89.0, - -31.0, - 89.0, - -32.0, + 90.0, -30.0, 90.0, -31.0, 89.0, -31.0, 89.0, -32.0, ]), cornerType: CornerType.BEVELED, width: 30000, - }) + }), ); expect(m.attributes.position.values.length).toEqual(10 * 3); @@ -236,41 +212,28 @@ describe("Core/CorridorOutlineGeometry", function () { }); const corridorOutline1 = new CorridorOutlineGeometry({ positions: Cartesian3.fromDegreesArray([ - -67.655, - 0.0, - -67.655, - 15.0, - -67.655, - 20.0, + -67.655, 0.0, -67.655, 15.0, -67.655, 20.0, ]), width: 0, }); const corridorOutline2 = new CorridorOutlineGeometry({ positions: Cartesian3.fromDegreesArray([ - -67.655, - 0.0, - -67.655, - 15.0, - -67.655, - 20.0, + -67.655, 0.0, -67.655, 15.0, -67.655, 20.0, ]), width: -100, }); - const geometry0 = CorridorOutlineGeometry.createGeometry( - corridorOutline0 - ); - const geometry1 = CorridorOutlineGeometry.createGeometry( - corridorOutline1 - ); - const geometry2 = CorridorOutlineGeometry.createGeometry( - corridorOutline2 - ); + const geometry0 = + CorridorOutlineGeometry.createGeometry(corridorOutline0); + const geometry1 = + CorridorOutlineGeometry.createGeometry(corridorOutline1); + const geometry2 = + CorridorOutlineGeometry.createGeometry(corridorOutline2); expect(geometry0).toBeUndefined(); expect(geometry1).toBeUndefined(); expect(geometry2).toBeUndefined(); - } + }, ); const positions = Cartesian3.fromDegreesArray([90.0, -30.0, 90.0, -31.0]); @@ -292,7 +255,7 @@ describe("Core/CorridorOutlineGeometry", function () { packedInstance.push( Ellipsoid.WGS84.radii.x, Ellipsoid.WGS84.radii.y, - Ellipsoid.WGS84.radii.z + Ellipsoid.WGS84.radii.z, ); packedInstance.push(30000.0, 0.0, 0.0, 2.0, 0.1, -1); createPackableSpecs(CorridorOutlineGeometry, corridor, packedInstance); diff --git a/packages/engine/Specs/Core/CullingVolumeSpec.js b/packages/engine/Specs/Core/CullingVolumeSpec.js index d991b148028c..e904e4d276a7 100644 --- a/packages/engine/Specs/Core/CullingVolumeSpec.js +++ b/packages/engine/Specs/Core/CullingVolumeSpec.js @@ -19,7 +19,7 @@ describe("Core/CullingVolume", function () { cullingVolume = frustum.computeCullingVolume( new Cartesian3(), Cartesian3.negate(Cartesian3.UNIT_Z, new Cartesian3()), - Cartesian3.UNIT_Y + Cartesian3.UNIT_Y, ); }); @@ -33,7 +33,7 @@ describe("Core/CullingVolume", function () { expect(function () { return new CullingVolume().computeVisibilityWithPlaneMask( undefined, - CullingVolume.MASK_INDETERMINATE + CullingVolume.MASK_INDETERMINATE, ); }).toThrowDeveloperError(); }); @@ -42,7 +42,7 @@ describe("Core/CullingVolume", function () { expect(function () { return new CullingVolume().computeVisibilityWithPlaneMask( new BoundingSphere(), - undefined + undefined, ); }).toThrowDeveloperError(); }); @@ -52,7 +52,7 @@ describe("Core/CullingVolume", function () { const mask = culling.computeVisibilityWithPlaneMask( bound, - CullingVolume.MASK_INDETERMINATE + CullingVolume.MASK_INDETERMINATE, ); if (intersect === Intersect.INSIDE) { expect(mask).toEqual(CullingVolume.MASK_INSIDE); @@ -87,7 +87,7 @@ describe("Core/CullingVolume", function () { testWithAndWithoutPlaneMask( cullingVolume, box2, - Intersect.INTERSECTING + Intersect.INTERSECTING, ); }); @@ -101,7 +101,7 @@ describe("Core/CullingVolume", function () { testWithAndWithoutPlaneMask( cullingVolume, box3, - Intersect.INTERSECTING + Intersect.INTERSECTING, ); }); @@ -115,7 +115,7 @@ describe("Core/CullingVolume", function () { testWithAndWithoutPlaneMask( cullingVolume, box4, - Intersect.INTERSECTING + Intersect.INTERSECTING, ); }); @@ -129,7 +129,7 @@ describe("Core/CullingVolume", function () { testWithAndWithoutPlaneMask( cullingVolume, box5, - Intersect.INTERSECTING + Intersect.INTERSECTING, ); }); @@ -143,7 +143,7 @@ describe("Core/CullingVolume", function () { testWithAndWithoutPlaneMask( cullingVolume, box6, - Intersect.INTERSECTING + Intersect.INTERSECTING, ); }); @@ -157,7 +157,7 @@ describe("Core/CullingVolume", function () { testWithAndWithoutPlaneMask( cullingVolume, box7, - Intersect.INTERSECTING + Intersect.INTERSECTING, ); }); }); @@ -243,7 +243,7 @@ describe("Core/CullingVolume", function () { testWithAndWithoutPlaneMask( cullingVolume, sphere2, - Intersect.INTERSECTING + Intersect.INTERSECTING, ); }); @@ -255,7 +255,7 @@ describe("Core/CullingVolume", function () { testWithAndWithoutPlaneMask( cullingVolume, sphere3, - Intersect.INTERSECTING + Intersect.INTERSECTING, ); }); @@ -267,7 +267,7 @@ describe("Core/CullingVolume", function () { testWithAndWithoutPlaneMask( cullingVolume, sphere4, - Intersect.INTERSECTING + Intersect.INTERSECTING, ); }); @@ -279,7 +279,7 @@ describe("Core/CullingVolume", function () { testWithAndWithoutPlaneMask( cullingVolume, sphere5, - Intersect.INTERSECTING + Intersect.INTERSECTING, ); }); @@ -291,7 +291,7 @@ describe("Core/CullingVolume", function () { testWithAndWithoutPlaneMask( cullingVolume, sphere6, - Intersect.INTERSECTING + Intersect.INTERSECTING, ); }); @@ -303,7 +303,7 @@ describe("Core/CullingVolume", function () { testWithAndWithoutPlaneMask( cullingVolume, sphere7, - Intersect.INTERSECTING + Intersect.INTERSECTING, ); }); }); @@ -362,10 +362,10 @@ describe("Core/CullingVolume", function () { describe("construct from bounding sphere", function () { const boundingSphereCullingVolume = new BoundingSphere( new Cartesian3(1000.0, 2000.0, 3000.0), - 100.0 + 100.0, ); const cullingVolume = CullingVolume.fromBoundingSphere( - boundingSphereCullingVolume + boundingSphereCullingVolume, ); it("throws without a boundingSphere", function () { @@ -385,12 +385,12 @@ describe("Core/CullingVolume", function () { const offset = new Cartesian3( 0.0, 0.0, - boundingSphereCullingVolume.radius * 1.5 + boundingSphereCullingVolume.radius * 1.5, ); const center = Cartesian3.add( boundingSphereCullingVolume.center, offset, - new Cartesian3() + new Cartesian3(), ); const radius = boundingSphereCullingVolume.radius * 0.5; const sphere2 = new BoundingSphere(center, radius); @@ -398,7 +398,7 @@ describe("Core/CullingVolume", function () { testWithAndWithoutPlaneMask( cullingVolume, sphere2, - Intersect.INTERSECTING + Intersect.INTERSECTING, ); }); @@ -406,12 +406,12 @@ describe("Core/CullingVolume", function () { const offset = new Cartesian3( 0.0, 0.0, - -boundingSphereCullingVolume.radius * 1.5 + -boundingSphereCullingVolume.radius * 1.5, ); const center = Cartesian3.add( boundingSphereCullingVolume.center, offset, - new Cartesian3() + new Cartesian3(), ); const radius = boundingSphereCullingVolume.radius * 0.5; const sphere3 = new BoundingSphere(center, radius); @@ -419,7 +419,7 @@ describe("Core/CullingVolume", function () { testWithAndWithoutPlaneMask( cullingVolume, sphere3, - Intersect.INTERSECTING + Intersect.INTERSECTING, ); }); @@ -427,12 +427,12 @@ describe("Core/CullingVolume", function () { const offset = new Cartesian3( -boundingSphereCullingVolume.radius * 1.5, 0.0, - 0.0 + 0.0, ); const center = Cartesian3.add( boundingSphereCullingVolume.center, offset, - new Cartesian3() + new Cartesian3(), ); const radius = boundingSphereCullingVolume.radius * 0.5; const sphere4 = new BoundingSphere(center, radius); @@ -440,7 +440,7 @@ describe("Core/CullingVolume", function () { testWithAndWithoutPlaneMask( cullingVolume, sphere4, - Intersect.INTERSECTING + Intersect.INTERSECTING, ); }); @@ -448,12 +448,12 @@ describe("Core/CullingVolume", function () { const offset = new Cartesian3( boundingSphereCullingVolume.radius * 1.5, 0.0, - 0.0 + 0.0, ); const center = Cartesian3.add( boundingSphereCullingVolume.center, offset, - new Cartesian3() + new Cartesian3(), ); const radius = boundingSphereCullingVolume.radius * 0.5; const sphere5 = new BoundingSphere(center, radius); @@ -461,7 +461,7 @@ describe("Core/CullingVolume", function () { testWithAndWithoutPlaneMask( cullingVolume, sphere5, - Intersect.INTERSECTING + Intersect.INTERSECTING, ); }); @@ -469,12 +469,12 @@ describe("Core/CullingVolume", function () { const offset = new Cartesian3( 0.0, boundingSphereCullingVolume.radius * 1.5, - 0.0 + 0.0, ); const center = Cartesian3.add( boundingSphereCullingVolume.center, offset, - new Cartesian3() + new Cartesian3(), ); const radius = boundingSphereCullingVolume.radius * 0.5; const sphere6 = new BoundingSphere(center, radius); @@ -482,7 +482,7 @@ describe("Core/CullingVolume", function () { testWithAndWithoutPlaneMask( cullingVolume, sphere6, - Intersect.INTERSECTING + Intersect.INTERSECTING, ); }); @@ -490,12 +490,12 @@ describe("Core/CullingVolume", function () { const offset = new Cartesian3( 0.0, -boundingSphereCullingVolume.radius * 1.5, - 0.0 + 0.0, ); const center = Cartesian3.add( boundingSphereCullingVolume.center, offset, - new Cartesian3() + new Cartesian3(), ); const radius = boundingSphereCullingVolume.radius * 0.5; const sphere7 = new BoundingSphere(center, radius); @@ -503,7 +503,7 @@ describe("Core/CullingVolume", function () { testWithAndWithoutPlaneMask( cullingVolume, sphere7, - Intersect.INTERSECTING + Intersect.INTERSECTING, ); }); }); @@ -513,12 +513,12 @@ describe("Core/CullingVolume", function () { const offset = new Cartesian3( 0.0, 0.0, - boundingSphereCullingVolume.radius * 2.0 + boundingSphereCullingVolume.radius * 2.0, ); const center = Cartesian3.add( boundingSphereCullingVolume.center, offset, - new Cartesian3() + new Cartesian3(), ); const radius = boundingSphereCullingVolume.radius * 0.5; const sphere8 = new BoundingSphere(center, radius); @@ -530,12 +530,12 @@ describe("Core/CullingVolume", function () { const offset = new Cartesian3( 0.0, 0.0, - -boundingSphereCullingVolume.radius * 2.0 + -boundingSphereCullingVolume.radius * 2.0, ); const center = Cartesian3.add( boundingSphereCullingVolume.center, offset, - new Cartesian3() + new Cartesian3(), ); const radius = boundingSphereCullingVolume.radius * 0.5; const sphere9 = new BoundingSphere(center, radius); @@ -547,12 +547,12 @@ describe("Core/CullingVolume", function () { const offset = new Cartesian3( -boundingSphereCullingVolume.radius * 2.0, 0.0, - 0.0 + 0.0, ); const center = Cartesian3.add( boundingSphereCullingVolume.center, offset, - new Cartesian3() + new Cartesian3(), ); const radius = boundingSphereCullingVolume.radius * 0.5; const sphere10 = new BoundingSphere(center, radius); @@ -564,12 +564,12 @@ describe("Core/CullingVolume", function () { const offset = new Cartesian3( boundingSphereCullingVolume.radius * 2.0, 0.0, - 0.0 + 0.0, ); const center = Cartesian3.add( boundingSphereCullingVolume.center, offset, - new Cartesian3() + new Cartesian3(), ); const radius = boundingSphereCullingVolume.radius * 0.5; const sphere11 = new BoundingSphere(center, radius); @@ -581,12 +581,12 @@ describe("Core/CullingVolume", function () { const offset = new Cartesian3( 0.0, boundingSphereCullingVolume.radius * 2.0, - 0.0 + 0.0, ); const center = Cartesian3.add( boundingSphereCullingVolume.center, offset, - new Cartesian3() + new Cartesian3(), ); const radius = boundingSphereCullingVolume.radius * 0.5; const sphere12 = new BoundingSphere(center, radius); @@ -598,12 +598,12 @@ describe("Core/CullingVolume", function () { const offset = new Cartesian3( 0.0, -boundingSphereCullingVolume.radius * 2.0, - 0.0 + 0.0, ); const center = Cartesian3.add( boundingSphereCullingVolume.center, offset, - new Cartesian3() + new Cartesian3(), ); const radius = boundingSphereCullingVolume.radius * 0.5; const sphere13 = new BoundingSphere(center, radius); diff --git a/packages/engine/Specs/Core/CustomHeightmapTerrainProviderSpec.js b/packages/engine/Specs/Core/CustomHeightmapTerrainProviderSpec.js index 226cad01729b..012574abf77c 100644 --- a/packages/engine/Specs/Core/CustomHeightmapTerrainProviderSpec.js +++ b/packages/engine/Specs/Core/CustomHeightmapTerrainProviderSpec.js @@ -7,7 +7,7 @@ import { describe("Core/CustomHeightmapTerrainProvider", function () { it("conforms to TerrainProvider interface", function () { expect(CustomHeightmapTerrainProvider).toConformToInterface( - TerrainProvider + TerrainProvider, ); }); @@ -117,11 +117,12 @@ describe("Core/CustomHeightmapTerrainProvider", function () { height: height, }); - const geometricError = TerrainProvider.getEstimatedLevelZeroGeometricErrorForAHeightmap( - provider.tilingScheme.ellipsoid, - Math.max(provider.width, provider.height), - provider.tilingScheme.getNumberOfXTilesAtLevel(0) - ); + const geometricError = + TerrainProvider.getEstimatedLevelZeroGeometricErrorForAHeightmap( + provider.tilingScheme.ellipsoid, + Math.max(provider.width, provider.height), + provider.tilingScheme.getNumberOfXTilesAtLevel(0), + ); expect(provider.getLevelMaximumGeometricError(0)).toBe(geometricError); }); diff --git a/packages/engine/Specs/Core/CylinderGeometrySpec.js b/packages/engine/Specs/Core/CylinderGeometrySpec.js index 2b00afbfe928..137b7a43faa2 100644 --- a/packages/engine/Specs/Core/CylinderGeometrySpec.js +++ b/packages/engine/Specs/Core/CylinderGeometrySpec.js @@ -49,7 +49,7 @@ describe("Core/CylinderGeometry", function () { topRadius: 1, bottomRadius: 1, slices: 3, - }) + }), ); const numVertices = 12; // (3 top + 3 bottom) * 2 to duplicate for sides @@ -67,7 +67,7 @@ describe("Core/CylinderGeometry", function () { bottomRadius: 1, slices: 3, offsetAttribute: GeometryOffsetAttribute.ALL, - }) + }), ); const numVertices = 12; @@ -87,7 +87,7 @@ describe("Core/CylinderGeometry", function () { topRadius: 1, bottomRadius: 1, slices: 3, - }) + }), ); const numVertices = 12; @@ -108,7 +108,7 @@ describe("Core/CylinderGeometry", function () { topRadius: 0, bottomRadius: 1, slices: 3, - }) + }), ); const numVertices = 12; //(3 top 3 bottom) duplicated @@ -125,7 +125,7 @@ describe("Core/CylinderGeometry", function () { topRadius: 1, bottomRadius: 0, slices: 3, - }) + }), ); const numVertices = 12; //(3 top 3 bottom) duplicated @@ -175,7 +175,7 @@ describe("Core/CylinderGeometry", function () { expect(geometry2).toBeUndefined(); expect(geometry3).toBeUndefined(); expect(geometry4).toBeUndefined(); - } + }, ); const cylinder = new CylinderGeometry({ @@ -186,17 +186,7 @@ describe("Core/CylinderGeometry", function () { slices: 3, }); const packedInstance = [ - 1.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 1.0, - 1.0, - 0.0, - 3.0, - -1.0, + 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 0.0, 3.0, -1.0, ]; createPackableSpecs(CylinderGeometry, cylinder, packedInstance); }); diff --git a/packages/engine/Specs/Core/CylinderOutlineGeometrySpec.js b/packages/engine/Specs/Core/CylinderOutlineGeometrySpec.js index 1868d8cf7135..55bb1c388bc3 100644 --- a/packages/engine/Specs/Core/CylinderOutlineGeometrySpec.js +++ b/packages/engine/Specs/Core/CylinderOutlineGeometrySpec.js @@ -47,7 +47,7 @@ describe("Core/CylinderOutlineGeometry", function () { topRadius: 1, bottomRadius: 1, slices: 3, - }) + }), ); expect(m.attributes.position.values.length).toEqual(6 * 3); // 3 top + 3 bottom @@ -62,7 +62,7 @@ describe("Core/CylinderOutlineGeometry", function () { bottomRadius: 1, slices: 3, offsetAttribute: GeometryOffsetAttribute.ALL, - }) + }), ); const numVertices = 6; @@ -82,7 +82,7 @@ describe("Core/CylinderOutlineGeometry", function () { bottomRadius: 1, slices: 3, numberOfVerticalLines: 0, - }) + }), ); const numVertices = 6; //3 top 3 bottom @@ -121,28 +121,23 @@ describe("Core/CylinderOutlineGeometry", function () { bottomRadius: -100, }); - const geometry0 = CylinderOutlineGeometry.createGeometry( - cylinderOutline0 - ); - const geometry1 = CylinderOutlineGeometry.createGeometry( - cylinderOutline1 - ); - const geometry2 = CylinderOutlineGeometry.createGeometry( - cylinderOutline2 - ); - const geometry3 = CylinderOutlineGeometry.createGeometry( - cylinderOutline3 - ); - const geometry4 = CylinderOutlineGeometry.createGeometry( - cylinderOutline4 - ); + const geometry0 = + CylinderOutlineGeometry.createGeometry(cylinderOutline0); + const geometry1 = + CylinderOutlineGeometry.createGeometry(cylinderOutline1); + const geometry2 = + CylinderOutlineGeometry.createGeometry(cylinderOutline2); + const geometry3 = + CylinderOutlineGeometry.createGeometry(cylinderOutline3); + const geometry4 = + CylinderOutlineGeometry.createGeometry(cylinderOutline4); expect(geometry0).toBeUndefined(); expect(geometry1).toBeUndefined(); expect(geometry2).toBeUndefined(); expect(geometry3).toBeUndefined(); expect(geometry4).toBeUndefined(); - } + }, ); const cylinder = new CylinderOutlineGeometry({ diff --git a/packages/engine/Specs/Core/DistanceDisplayConditionGeometryInstanceAttributeSpec.js b/packages/engine/Specs/Core/DistanceDisplayConditionGeometryInstanceAttributeSpec.js index 2a815fde929a..fe9db086a205 100644 --- a/packages/engine/Specs/Core/DistanceDisplayConditionGeometryInstanceAttributeSpec.js +++ b/packages/engine/Specs/Core/DistanceDisplayConditionGeometryInstanceAttributeSpec.js @@ -8,7 +8,7 @@ describe("Core/DistanceDisplayConditionGeometryInstanceAttribute", function () { it("constructor", function () { const attribute = new DistanceDisplayConditionGeometryInstanceAttribute( 10.0, - 100.0 + 100.0, ); expect(attribute.componentDatatype).toEqual(ComponentDatatype.FLOAT); expect(attribute.componentsPerAttribute).toEqual(2); @@ -26,9 +26,10 @@ describe("Core/DistanceDisplayConditionGeometryInstanceAttribute", function () { it("fromDistanceDisplayCondition", function () { const dc = new DistanceDisplayCondition(10.0, 100.0); - const attribute = DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition( - dc - ); + const attribute = + DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition( + dc, + ); expect(attribute.componentDatatype).toEqual(ComponentDatatype.FLOAT); expect(attribute.componentsPerAttribute).toEqual(2); expect(attribute.normalize).toEqual(false); @@ -46,7 +47,7 @@ describe("Core/DistanceDisplayConditionGeometryInstanceAttribute", function () { it("fromDistanceDisplayCondition throws with far >= near", function () { expect(function () { DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition( - new DistanceDisplayCondition(100.0, 10.0) + new DistanceDisplayCondition(100.0, 10.0), ); }).toThrowDeveloperError(); }); @@ -55,7 +56,7 @@ describe("Core/DistanceDisplayConditionGeometryInstanceAttribute", function () { const dc = new DistanceDisplayCondition(10.0, 200.0); const expectedResult = new Float32Array([dc.near, dc.far]); expect( - DistanceDisplayConditionGeometryInstanceAttribute.toValue(dc) + DistanceDisplayConditionGeometryInstanceAttribute.toValue(dc), ).toEqual(expectedResult); }); @@ -63,10 +64,8 @@ describe("Core/DistanceDisplayConditionGeometryInstanceAttribute", function () { const dc = new DistanceDisplayCondition(10.0, 200.0); const expectedResult = new Float32Array([dc.near, dc.far]); const result = new Float32Array(2); - const returnedResult = DistanceDisplayConditionGeometryInstanceAttribute.toValue( - dc, - result - ); + const returnedResult = + DistanceDisplayConditionGeometryInstanceAttribute.toValue(dc, result); expect(returnedResult).toBe(result); expect(returnedResult).toEqual(expectedResult); }); diff --git a/packages/engine/Specs/Core/DistanceDisplayConditionSpec.js b/packages/engine/Specs/Core/DistanceDisplayConditionSpec.js index c726947622c6..2eebd13e1b21 100644 --- a/packages/engine/Specs/Core/DistanceDisplayConditionSpec.js +++ b/packages/engine/Specs/Core/DistanceDisplayConditionSpec.js @@ -33,20 +33,20 @@ describe("Core/DistanceDisplayCondition", function () { expect( DistanceDisplayCondition.equals( dc, - new DistanceDisplayCondition(10.0, 100.0) - ) + new DistanceDisplayCondition(10.0, 100.0), + ), ).toEqual(true); expect( DistanceDisplayCondition.equals( dc, - new DistanceDisplayCondition(11.0, 100.0) - ) + new DistanceDisplayCondition(11.0, 100.0), + ), ).toEqual(false); expect( DistanceDisplayCondition.equals( dc, - new DistanceDisplayCondition(10.0, 101.0) - ) + new DistanceDisplayCondition(10.0, 101.0), + ), ).toEqual(false); expect(DistanceDisplayCondition.equals(dc, undefined)).toEqual(false); }); @@ -104,6 +104,6 @@ describe("Core/DistanceDisplayCondition", function () { createPackableSpecs( DistanceDisplayCondition, new DistanceDisplayCondition(1, 2), - [1, 2] + [1, 2], ); }); diff --git a/packages/engine/Specs/Core/EarthOrientationParametersSpec.js b/packages/engine/Specs/Core/EarthOrientationParametersSpec.js index 23e41e19ee2e..c93568689067 100644 --- a/packages/engine/Specs/Core/EarthOrientationParametersSpec.js +++ b/packages/engine/Specs/Core/EarthOrientationParametersSpec.js @@ -88,7 +88,7 @@ describe("Core/EarthOrientationParameters", function () { if (defined(previousDate)) { expect( - JulianDate.compare(previousDate, leapSecond.julianDate) + JulianDate.compare(previousDate, leapSecond.julianDate), ).toBeLessThan(0); } @@ -229,7 +229,7 @@ describe("Core/EarthOrientationParameters", function () { const dt = JulianDate.secondsDifference( date, - JulianDate.fromIso8601(eopDescription.data.samples[nColumns]) + JulianDate.fromIso8601(eopDescription.data.samples[nColumns]), ) / 86400.0; let expected = linearInterp(dt, x0, x1); expect(result.xPoleWander).toEqualEpsilon(expected, 1e-22); @@ -320,12 +320,12 @@ describe("Core/EarthOrientationParameters", function () { const dateSlightlyBefore = JulianDate.addSeconds( dateAtLeapSecond, -1.0, - new JulianDate() + new JulianDate(), ); const dateSlightlyAfter = JulianDate.addSeconds( dateAtLeapSecond, 1.0, - new JulianDate() + new JulianDate(), ); const nColumns = eopDescription.data.columnNames.length; const x0 = eopDescription.data.samples[1 * nColumns + 6]; @@ -333,7 +333,7 @@ describe("Core/EarthOrientationParameters", function () { const x2 = eopDescription.data.samples[3 * nColumns + 6]; const t0 = JulianDate.fromIso8601(eopDescription.data.samples[nColumns]); const t1 = JulianDate.fromIso8601( - eopDescription.data.samples[2 * nColumns] + eopDescription.data.samples[2 * nColumns], ); let dt = JulianDate.secondsDifference(dateSlightlyBefore, t0) / (86400.0 + 1); @@ -350,14 +350,14 @@ describe("Core/EarthOrientationParameters", function () { expect(resultAfter.ut1MinusUtc).toEqualEpsilon(expectedAfter, 1.0e-15); // Check to make sure the values are (correctly) discontinuous expect( - Math.abs(resultBefore.ut1MinusUtc - resultAfter.ut1MinusUtc) > 0.5 + Math.abs(resultBefore.ut1MinusUtc - resultAfter.ut1MinusUtc) > 0.5, ).toEqual(true); }); }); it("fromUrl loads EOP data", async function () { const eop = await EarthOrientationParameters.fromUrl( - "Data/EarthOrientationParameters/EOP-2011-July.json" + "Data/EarthOrientationParameters/EOP-2011-July.json", ); expect(eop).toBeInstanceOf(EarthOrientationParameters); @@ -374,22 +374,22 @@ describe("Core/EarthOrientationParameters", function () { it("fromUrl throws a RuntimeError when loading invalid EOP data", async function () { await expectAsync( EarthOrientationParameters.fromUrl( - "Data/EarthOrientationParameters/EOP-Invalid.json" - ) + "Data/EarthOrientationParameters/EOP-Invalid.json", + ), ).toBeRejectedWithError( RuntimeError, - "Error in loaded EOP data: The columnNames property is required." + "Error in loaded EOP data: The columnNames property is required.", ); }); it("fromUrl throws a RuntimeError when using a missing EOP data file", async function () { await expectAsync( EarthOrientationParameters.fromUrl( - "Data/EarthOrientationParameters/EOP-DoesNotExist.json" - ) + "Data/EarthOrientationParameters/EOP-DoesNotExist.json", + ), ).toBeRejectedWithError( RuntimeError, - "An error occurred while retrieving the EOP data from the URL Data/EarthOrientationParameters/EOP-DoesNotExist.json." + "An error occurred while retrieving the EOP data from the URL Data/EarthOrientationParameters/EOP-DoesNotExist.json.", ); }); }); diff --git a/packages/engine/Specs/Core/EllipseGeometrySpec.js b/packages/engine/Specs/Core/EllipseGeometrySpec.js index 06a1463fb84b..838f1aaa1fc1 100644 --- a/packages/engine/Specs/Core/EllipseGeometrySpec.js +++ b/packages/engine/Specs/Core/EllipseGeometrySpec.js @@ -68,7 +68,7 @@ describe("Core/EllipseGeometry", function () { granularity: 0.1, semiMajorAxis: 1.0, semiMinorAxis: 1.0, - }) + }), ); expect(m.attributes.position.values.length).toEqual(16 * 3); // rows of 1 + 4 + 6 + 4 + 1 @@ -85,7 +85,7 @@ describe("Core/EllipseGeometry", function () { granularity: 0.1, semiMajorAxis: 1.0, semiMinorAxis: 1.0, - }) + }), ); const numVertices = 16; @@ -108,7 +108,7 @@ describe("Core/EllipseGeometry", function () { semiMajorAxis: 1.0, semiMinorAxis: 1.0, stRotation: CesiumMath.PI_OVER_TWO, - }) + }), ); const positions = m.attributes.position.values; @@ -135,7 +135,7 @@ describe("Core/EllipseGeometry", function () { semiMajorAxis: 1.0, semiMinorAxis: 1.0, extrudedHeight: 50000, - }) + }), ); const numVertices = 48; // 16 top + 16 bottom + 8 top edge + 8 bottom edge @@ -154,7 +154,7 @@ describe("Core/EllipseGeometry", function () { semiMajorAxis: 1.0, semiMinorAxis: 1.0, offsetAttribute: GeometryOffsetAttribute.TOP, - }) + }), ); const numVertices = 16; @@ -177,7 +177,7 @@ describe("Core/EllipseGeometry", function () { semiMinorAxis: 1.0, extrudedHeight: 50000, offsetAttribute: GeometryOffsetAttribute.TOP, - }) + }), ); const numVertices = 48; @@ -203,7 +203,7 @@ describe("Core/EllipseGeometry", function () { semiMinorAxis: 1.0, extrudedHeight: 50000, offsetAttribute: GeometryOffsetAttribute.ALL, - }) + }), ); const numVertices = 48; @@ -225,7 +225,7 @@ describe("Core/EllipseGeometry", function () { semiMajorAxis: 1.0, semiMinorAxis: 1.0, extrudedHeight: 50000, - }) + }), ); const numVertices = 48; @@ -296,7 +296,7 @@ describe("Core/EllipseGeometry", function () { const sv = EllipseGeometry.createShadowVolume( m, minHeightFunc, - maxHeightFunc + maxHeightFunc, ); expect(sv._center.equals(m._center)).toBe(true); @@ -310,7 +310,7 @@ describe("Core/EllipseGeometry", function () { expect(sv._height).toBe(maxHeightFunc()); expect(sv._vertexFormat.bitangent).toBe( - VertexFormat.POSITION_ONLY.bitangent + VertexFormat.POSITION_ONLY.bitangent, ); expect(sv._vertexFormat.color).toBe(VertexFormat.POSITION_ONLY.color); expect(sv._vertexFormat.normal).toBe(VertexFormat.POSITION_ONLY.normal); @@ -344,7 +344,7 @@ describe("Core/EllipseGeometry", function () { r = ellipse.rectangle; expect(r.north).toEqualEpsilon( CesiumMath.PI_OVER_TWO - CesiumMath.EPSILON7, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(r.south).toEqualEpsilon(1.570483806950967, CesiumMath.EPSILON7); expect(r.east).toEqualEpsilon(CesiumMath.PI, CesiumMath.EPSILON7); @@ -399,27 +399,27 @@ describe("Core/EllipseGeometry", function () { expect(textureCoordinateRotationPoints.length).toEqual(6); expect(textureCoordinateRotationPoints[0]).toEqualEpsilon( 0, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(textureCoordinateRotationPoints[1]).toEqualEpsilon( 1, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(textureCoordinateRotationPoints[2]).toEqualEpsilon( 1, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(textureCoordinateRotationPoints[3]).toEqualEpsilon( 1, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(textureCoordinateRotationPoints[4]).toEqualEpsilon( 0, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(textureCoordinateRotationPoints[5]).toEqualEpsilon( 0, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); ellipse = new EllipseGeometry({ @@ -433,27 +433,27 @@ describe("Core/EllipseGeometry", function () { expect(textureCoordinateRotationPoints.length).toEqual(6); expect(textureCoordinateRotationPoints[0]).toEqualEpsilon( 0, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(textureCoordinateRotationPoints[1]).toEqualEpsilon( 0, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(textureCoordinateRotationPoints[2]).toEqualEpsilon( 0, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(textureCoordinateRotationPoints[3]).toEqualEpsilon( 1, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(textureCoordinateRotationPoints[4]).toEqualEpsilon( 1, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(textureCoordinateRotationPoints[5]).toEqualEpsilon( 0, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); }); diff --git a/packages/engine/Specs/Core/EllipseOutlineGeometrySpec.js b/packages/engine/Specs/Core/EllipseOutlineGeometrySpec.js index 8e4618e9fbee..c4be63eb0d56 100644 --- a/packages/engine/Specs/Core/EllipseOutlineGeometrySpec.js +++ b/packages/engine/Specs/Core/EllipseOutlineGeometrySpec.js @@ -64,7 +64,7 @@ describe("Core/EllipseOutlineGeometry", function () { granularity: 0.1, semiMajorAxis: 1.0, semiMinorAxis: 1.0, - }) + }), ); expect(m.attributes.position.values.length).toEqual(8 * 3); @@ -81,7 +81,7 @@ describe("Core/EllipseOutlineGeometry", function () { semiMajorAxis: 1.0, semiMinorAxis: 1.0, extrudedHeight: 5.0, - }) + }), ); expect(m.attributes.position.values.length).toEqual(16 * 3); // 8 top + 8 bottom @@ -97,7 +97,7 @@ describe("Core/EllipseOutlineGeometry", function () { semiMajorAxis: 1.0, semiMinorAxis: 1.0, offsetAttribute: GeometryOffsetAttribute.TOP, - }) + }), ); const numVertices = 8; @@ -119,7 +119,7 @@ describe("Core/EllipseOutlineGeometry", function () { semiMinorAxis: 1.0, extrudedHeight: 5.0, offsetAttribute: GeometryOffsetAttribute.TOP, - }) + }), ); const numVertices = 16; @@ -141,7 +141,7 @@ describe("Core/EllipseOutlineGeometry", function () { semiMinorAxis: 1.0, extrudedHeight: 5.0, offsetAttribute: GeometryOffsetAttribute.ALL, - }) + }), ); const numVertices = 16; @@ -163,7 +163,7 @@ describe("Core/EllipseOutlineGeometry", function () { semiMinorAxis: 1.0, extrudedHeight: 5.0, numberOfVerticalLines: 0, - }) + }), ); expect(m.attributes.position.values.length).toEqual(16 * 3); @@ -236,7 +236,7 @@ describe("Core/EllipseOutlineGeometry", function () { EllipseOutlineGeometry, packableInstance, packedInstance, - "extruded" + "extruded", ); //Because extrudedHeight is optional and has to be taken into account when packing, we have a second test without it. @@ -270,6 +270,6 @@ describe("Core/EllipseOutlineGeometry", function () { EllipseOutlineGeometry, packableInstance, packedInstance, - "at height" + "at height", ); }); diff --git a/packages/engine/Specs/Core/EllipsoidGeodesicSpec.js b/packages/engine/Specs/Core/EllipsoidGeodesicSpec.js index 3b7c1edb274f..20b9b4572831 100644 --- a/packages/engine/Specs/Core/EllipsoidGeodesicSpec.js +++ b/packages/engine/Specs/Core/EllipsoidGeodesicSpec.js @@ -24,7 +24,7 @@ describe("Core/EllipsoidGeodesic", function () { expect(function () { const elGeo = new EllipsoidGeodesic( new Cartographic(Math.PI, Math.PI), - new Cartographic(0, Math.PI) + new Cartographic(0, Math.PI), ); return elGeo.interpolateUsingSurfaceDistance(0); }).toThrowDeveloperError(); @@ -82,7 +82,7 @@ describe("Core/EllipsoidGeodesic", function () { const start = new Cartographic(CesiumMath.PI_OVER_TWO, 0); const end = new Cartographic( CesiumMath.PI_OVER_TWO, - CesiumMath.PI_OVER_TWO + CesiumMath.PI_OVER_TWO, ); const geodesic = new EllipsoidGeodesic(); geodesic.setEndPoints(start, end); @@ -98,7 +98,7 @@ describe("Core/EllipsoidGeodesic", function () { const geodesic = new EllipsoidGeodesic(start, end, ellipsoid); expect(CesiumMath.PI_OVER_TWO).toEqualEpsilon( geodesic.startHeading, - CesiumMath.EPSILON11 + CesiumMath.EPSILON11, ); }); @@ -110,7 +110,7 @@ describe("Core/EllipsoidGeodesic", function () { const geodesic = new EllipsoidGeodesic(start, end, ellipsoid); expect(CesiumMath.PI_OVER_TWO).toEqualEpsilon( geodesic.endHeading, - CesiumMath.EPSILON11 + CesiumMath.EPSILON11, ); }); @@ -122,7 +122,7 @@ describe("Core/EllipsoidGeodesic", function () { const geodesic = new EllipsoidGeodesic(start, end, ellipsoid); expect(CesiumMath.PI_OVER_TWO * 6).toEqualEpsilon( geodesic.surfaceDistance, - CesiumMath.EPSILON11 + CesiumMath.EPSILON11, ); }); @@ -150,7 +150,7 @@ describe("Core/EllipsoidGeodesic", function () { const thirtyDegrees = Math.PI / 6; expect(thirtyDegrees * 6).toEqualEpsilon( geodesic.surfaceDistance, - CesiumMath.EPSILON11 + CesiumMath.EPSILON11, ); }); @@ -165,7 +165,7 @@ describe("Core/EllipsoidGeodesic", function () { const sixtyDegrees = Math.PI / 3; expect(sixtyDegrees * 6).toEqualEpsilon( geodesic.surfaceDistance, - CesiumMath.EPSILON11 + CesiumMath.EPSILON11, ); }); @@ -183,7 +183,7 @@ describe("Core/EllipsoidGeodesic", function () { expect(start.longitude).toEqualEpsilon( first.longitude, - CesiumMath.EPSILON13 + CesiumMath.EPSILON13, ); expect(start.latitude).toEqualEpsilon(first.latitude, CesiumMath.EPSILON13); expect(end.longitude).toEqualEpsilon(last.longitude, CesiumMath.EPSILON13); @@ -205,11 +205,11 @@ describe("Core/EllipsoidGeodesic", function () { expect(expectedMid.longitude).toEqualEpsilon( midpoint.longitude, - CesiumMath.EPSILON13 + CesiumMath.EPSILON13, ); expect(expectedMid.latitude).toEqualEpsilon( midpoint.latitude, - CesiumMath.EPSILON13 + CesiumMath.EPSILON13, ); }); @@ -226,7 +226,7 @@ describe("Core/EllipsoidGeodesic", function () { expect(start.longitude).toEqualEpsilon( first.longitude, - CesiumMath.EPSILON13 + CesiumMath.EPSILON13, ); expect(start.latitude).toEqualEpsilon(first.latitude, CesiumMath.EPSILON13); expect(end.longitude).toEqualEpsilon(last.longitude, CesiumMath.EPSILON13); @@ -247,11 +247,11 @@ describe("Core/EllipsoidGeodesic", function () { expect(expectedMid.longitude).toEqualEpsilon( midpoint.longitude, - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); expect(expectedMid.latitude).toEqualEpsilon( midpoint.latitude, - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); }); @@ -270,11 +270,11 @@ describe("Core/EllipsoidGeodesic", function () { expect(expectedMid.longitude).toEqualEpsilon( result.longitude, - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); expect(expectedMid.latitude).toEqualEpsilon( result.latitude, - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); }); @@ -296,11 +296,11 @@ describe("Core/EllipsoidGeodesic", function () { expect(expectedMid.longitude).toEqualEpsilon( result.longitude, - CesiumMath.EPSILON13 + CesiumMath.EPSILON13, ); expect(expectedMid.latitude).toEqualEpsilon( result.latitude, - CesiumMath.EPSILON13 + CesiumMath.EPSILON13, ); }); }); diff --git a/packages/engine/Specs/Core/EllipsoidGeometrySpec.js b/packages/engine/Specs/Core/EllipsoidGeometrySpec.js index 7800e7afbba2..8165e22fa2be 100644 --- a/packages/engine/Specs/Core/EllipsoidGeometrySpec.js +++ b/packages/engine/Specs/Core/EllipsoidGeometrySpec.js @@ -47,7 +47,7 @@ describe("Core/EllipsoidGeometry", function () { vertexFormat: VertexFormat.POSITION_ONLY, slicePartitions: 3, stackPartitions: 3, - }) + }), ); // The vertices are 6x6 because an additional slice and stack are added @@ -66,7 +66,7 @@ describe("Core/EllipsoidGeometry", function () { slicePartitions: 3, stackPartitions: 3, offsetAttribute: GeometryOffsetAttribute.ALL, - }) + }), ); const numVertices = 36; @@ -84,7 +84,7 @@ describe("Core/EllipsoidGeometry", function () { vertexFormat: VertexFormat.ALL, slicePartitions: 3, stackPartitions: 3, - }) + }), ); const numVertices = 36; @@ -103,7 +103,7 @@ describe("Core/EllipsoidGeometry", function () { vertexFormat: VertexFormat.ALL, slicePartitions: 3, stackPartitions: 3, - }) + }), ); const positions = m.attributes.position.values; @@ -119,16 +119,16 @@ describe("Core/EllipsoidGeometry", function () { expect(Cartesian3.magnitude(position)).toEqualEpsilon( 1.0, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); expect(normal).toEqualEpsilon( Cartesian3.normalize(position, new Cartesian3()), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(Cartesian3.dot(Cartesian3.UNIT_Z, tangent)).not.toBeLessThan(0.0); expect(bitangent).toEqualEpsilon( Cartesian3.cross(normal, tangent, new Cartesian3()), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); } }); @@ -140,7 +140,7 @@ describe("Core/EllipsoidGeometry", function () { slicePartitions: 3, stackPartitions: 3, innerRadii: new Cartesian3(0.5, 0.5, 0.5), - }) + }), ); const numVertices = 72; // 6 rows * 6 positions * 2 surfaces @@ -159,7 +159,7 @@ describe("Core/EllipsoidGeometry", function () { innerRadii: new Cartesian3(0.5, 0.5, 0.5), minimumClock: CesiumMath.toRadians(90.0), maximumClock: CesiumMath.toRadians(270.0), - }) + }), ); const numVertices = 70; @@ -179,7 +179,7 @@ describe("Core/EllipsoidGeometry", function () { minimumClock: CesiumMath.toRadians(90.0), maximumClock: CesiumMath.toRadians(270.0), minimumCone: CesiumMath.toRadians(30.0), - }) + }), ); const numVertices = 60; @@ -212,7 +212,7 @@ describe("Core/EllipsoidGeometry", function () { innerRadii: new Cartesian3(0.5, 0.5, 0.5), minimumCone: CesiumMath.toRadians(60.0), maximumCone: CesiumMath.toRadians(140.0), - }) + }), ); const positions = m.attributes.position.values; @@ -248,7 +248,7 @@ describe("Core/EllipsoidGeometry", function () { maximumClock: CesiumMath.toRadians(270.0), minimumCone: CesiumMath.toRadians(30.0), maximumCone: CesiumMath.toRadians(120.0), - }) + }), ); const numVertices = 50; @@ -353,25 +353,8 @@ describe("Core/EllipsoidGeometry", function () { stackPartitions: 3, }); const packedInstance = [ - 1.0, - 2.0, - 3.0, - 0.5, - 0.6, - 0.7, - 1.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.1, - 0.2, - 0.3, - 0.4, - 3.0, - 3.0, - -1, + 1.0, 2.0, 3.0, 0.5, 0.6, 0.7, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.1, 0.2, 0.3, + 0.4, 3.0, 3.0, -1, ]; createPackableSpecs(EllipsoidGeometry, ellipsoidgeometry, packedInstance); }); diff --git a/packages/engine/Specs/Core/EllipsoidOutlineGeometrySpec.js b/packages/engine/Specs/Core/EllipsoidOutlineGeometrySpec.js index e24be1fefa9f..c71224601d3b 100644 --- a/packages/engine/Specs/Core/EllipsoidOutlineGeometrySpec.js +++ b/packages/engine/Specs/Core/EllipsoidOutlineGeometrySpec.js @@ -73,7 +73,7 @@ describe("Core/EllipsoidOutlineGeometry", function () { stackPartitions: 3, slicePartitions: 3, subdivisions: 3, - }) + }), ); expect(m.attributes.position.values.length).toEqual(24 * 3); @@ -92,7 +92,7 @@ describe("Core/EllipsoidOutlineGeometry", function () { stackPartitions: 3, slicePartitions: 3, subdivisions: 3, - }) + }), ); expect(m.attributes.position.values.length).toEqual(24 * 3); @@ -107,7 +107,7 @@ describe("Core/EllipsoidOutlineGeometry", function () { slicePartitions: 3, subdivisions: 3, offsetAttribute: GeometryOffsetAttribute.ALL, - }) + }), ); const numVertices = 24; @@ -176,42 +176,30 @@ describe("Core/EllipsoidOutlineGeometry", function () { innerRadii: new Cartesian3(100000.0, 100000.0, -10.0), }); - const geometry0 = EllipsoidOutlineGeometry.createGeometry( - ellipsoidOutline0 - ); - const geometry1 = EllipsoidOutlineGeometry.createGeometry( - ellipsoidOutline1 - ); - const geometry2 = EllipsoidOutlineGeometry.createGeometry( - ellipsoidOutline2 - ); - const geometry3 = EllipsoidOutlineGeometry.createGeometry( - ellipsoidOutline3 - ); - const geometry4 = EllipsoidOutlineGeometry.createGeometry( - ellipsoidOutline4 - ); - const geometry5 = EllipsoidOutlineGeometry.createGeometry( - ellipsoidOutline5 - ); - const geometry6 = EllipsoidOutlineGeometry.createGeometry( - ellipsoidOutline6 - ); - const geometry7 = EllipsoidOutlineGeometry.createGeometry( - ellipsoidOutline7 - ); - const geometry8 = EllipsoidOutlineGeometry.createGeometry( - ellipsoidOutline8 - ); - const geometry9 = EllipsoidOutlineGeometry.createGeometry( - ellipsoidOutline9 - ); - const geometry10 = EllipsoidOutlineGeometry.createGeometry( - ellipsoidOutline10 - ); - const geometry11 = EllipsoidOutlineGeometry.createGeometry( - ellipsoidOutline11 - ); + const geometry0 = + EllipsoidOutlineGeometry.createGeometry(ellipsoidOutline0); + const geometry1 = + EllipsoidOutlineGeometry.createGeometry(ellipsoidOutline1); + const geometry2 = + EllipsoidOutlineGeometry.createGeometry(ellipsoidOutline2); + const geometry3 = + EllipsoidOutlineGeometry.createGeometry(ellipsoidOutline3); + const geometry4 = + EllipsoidOutlineGeometry.createGeometry(ellipsoidOutline4); + const geometry5 = + EllipsoidOutlineGeometry.createGeometry(ellipsoidOutline5); + const geometry6 = + EllipsoidOutlineGeometry.createGeometry(ellipsoidOutline6); + const geometry7 = + EllipsoidOutlineGeometry.createGeometry(ellipsoidOutline7); + const geometry8 = + EllipsoidOutlineGeometry.createGeometry(ellipsoidOutline8); + const geometry9 = + EllipsoidOutlineGeometry.createGeometry(ellipsoidOutline9); + const geometry10 = + EllipsoidOutlineGeometry.createGeometry(ellipsoidOutline10); + const geometry11 = + EllipsoidOutlineGeometry.createGeometry(ellipsoidOutline11); expect(geometry0).toBeUndefined(); expect(geometry1).toBeUndefined(); @@ -239,24 +227,11 @@ describe("Core/EllipsoidOutlineGeometry", function () { subdivisions: 3, }); const packedInstance = [ - 1.0, - 2.0, - 3.0, - 0.5, - 0.6, - 0.7, - 0.1, - 0.2, - 0.3, - 0.4, - 3.0, - 3.0, - 3.0, - -1, + 1.0, 2.0, 3.0, 0.5, 0.6, 0.7, 0.1, 0.2, 0.3, 0.4, 3.0, 3.0, 3.0, -1, ]; createPackableSpecs( EllipsoidOutlineGeometry, ellipsoidgeometry, - packedInstance + packedInstance, ); }); diff --git a/packages/engine/Specs/Core/EllipsoidRhumbLineSpec.js b/packages/engine/Specs/Core/EllipsoidRhumbLineSpec.js index afc652627b08..add1998ace05 100644 --- a/packages/engine/Specs/Core/EllipsoidRhumbLineSpec.js +++ b/packages/engine/Specs/Core/EllipsoidRhumbLineSpec.js @@ -32,7 +32,7 @@ describe("Core/EllipsoidRhumbLine", function () { expect(function () { const rhumb = new EllipsoidRhumbLine( new Cartographic(Math.PI, Math.PI), - new Cartographic(0, Math.PI) + new Cartographic(0, Math.PI), ); return rhumb.interpolateUsingSurfaceDistance(0); }).toThrowDeveloperError(); @@ -64,7 +64,7 @@ describe("Core/EllipsoidRhumbLine", function () { start, heading, distance, - ellipsoid + ellipsoid, ); expect(start).toEqual(rhumb.start); expect(distance).toEqualEpsilon(rhumb.surfaceDistance, CesiumMath.EPSILON6); @@ -84,7 +84,7 @@ describe("Core/EllipsoidRhumbLine", function () { heading, distance, ellipsoid, - scratch + scratch, ); expect(rhumb).toBe(scratch); expect(rhumb.ellipsoid).toBe(ellipsoid); @@ -120,7 +120,7 @@ describe("Core/EllipsoidRhumbLine", function () { const start = new Cartographic(CesiumMath.PI_OVER_TWO, 0); const end = new Cartographic( CesiumMath.PI_OVER_TWO, - CesiumMath.PI_OVER_TWO + CesiumMath.PI_OVER_TWO, ); const rhumb = new EllipsoidRhumbLine(); rhumb.setEndPoints(start, end); @@ -136,7 +136,7 @@ describe("Core/EllipsoidRhumbLine", function () { const rhumb = new EllipsoidRhumbLine(start, end, ellipsoid); expect(CesiumMath.PI_OVER_TWO).toEqualEpsilon( rhumb.heading, - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); }); @@ -169,7 +169,7 @@ describe("Core/EllipsoidRhumbLine", function () { expect(CesiumMath.PI_OVER_TWO).toEqualEpsilon( rhumb.heading, - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); start = new Cartographic(3 * CesiumMath.PI_OVER_TWO, 0.3); @@ -177,7 +177,7 @@ describe("Core/EllipsoidRhumbLine", function () { const rhumb2 = new EllipsoidRhumbLine(start, end, ellipsoid); expect(-CesiumMath.PI_OVER_TWO).toEqualEpsilon( rhumb2.heading, - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); }); @@ -201,7 +201,7 @@ describe("Core/EllipsoidRhumbLine", function () { const rhumb = new EllipsoidRhumbLine(start, end, ellipsoid); expect(CesiumMath.PI_OVER_TWO * 6).toEqualEpsilon( rhumb.surfaceDistance, - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); }); @@ -213,7 +213,7 @@ describe("Core/EllipsoidRhumbLine", function () { const rhumb = new EllipsoidRhumbLine(start, end, ellipsoid); expect(thirtyDegrees * 6).toEqualEpsilon( rhumb.surfaceDistance, - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); }); @@ -227,47 +227,47 @@ describe("Core/EllipsoidRhumbLine", function () { const westEastRhumb = new EllipsoidRhumbLine( fortyFiveWest, fortyFiveEast, - ellipsoid + ellipsoid, ); const southNorthRhumb = new EllipsoidRhumbLine( fortyFiveSouth, fortyFiveNorth, - ellipsoid + ellipsoid, ); const eastWestRhumb = new EllipsoidRhumbLine( fortyFiveEast, fortyFiveWest, - ellipsoid + ellipsoid, ); const northSouthRhumb = new EllipsoidRhumbLine( fortyFiveNorth, fortyFiveSouth, - ellipsoid + ellipsoid, ); expect(CesiumMath.PI_OVER_TWO * 6).toEqualEpsilon( westEastRhumb.surfaceDistance, - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); expect(CesiumMath.PI_OVER_TWO * 6).toEqualEpsilon( southNorthRhumb.surfaceDistance, - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); expect(westEastRhumb.surfaceDistance).toEqualEpsilon( southNorthRhumb.surfaceDistance, - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); expect(CesiumMath.PI_OVER_TWO * 6).toEqualEpsilon( eastWestRhumb.surfaceDistance, - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); expect(CesiumMath.PI_OVER_TWO * 6).toEqualEpsilon( northSouthRhumb.surfaceDistance, - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); expect(eastWestRhumb.surfaceDistance).toEqualEpsilon( northSouthRhumb.surfaceDistance, - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); }); @@ -280,7 +280,7 @@ describe("Core/EllipsoidRhumbLine", function () { const distance = Math.cos(fortyfiveDegrees) * CesiumMath.PI_OVER_TWO * 6; expect(distance).toEqualEpsilon( rhumb.surfaceDistance, - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); }); @@ -294,7 +294,7 @@ describe("Core/EllipsoidRhumbLine", function () { initial, fifteenDegrees, 0.0, - ellipsoid + ellipsoid, ); return rhumb.interpolateUsingSurfaceDistance(0); }).toThrowDeveloperError(); @@ -310,14 +310,14 @@ describe("Core/EllipsoidRhumbLine", function () { initial, fifteenDegrees, distance, - ellipsoid + ellipsoid, ); const rhumb2 = new EllipsoidRhumbLine(initial, rhumb1.end, ellipsoid); expect(fifteenDegrees).toEqualEpsilon(rhumb2.heading, CesiumMath.EPSILON12); expect(distance).toEqualEpsilon( rhumb2.surfaceDistance, - CesiumMath.EPSILON6 + CesiumMath.EPSILON6, ); }); @@ -330,14 +330,14 @@ describe("Core/EllipsoidRhumbLine", function () { initial, fifteenDegrees, distance, - ellipsoid + ellipsoid, ); const rhumb2 = new EllipsoidRhumbLine(initial, rhumb1.end, ellipsoid); expect(fifteenDegrees).toEqualEpsilon(rhumb2.heading, CesiumMath.EPSILON12); expect(distance).toEqualEpsilon( rhumb2.surfaceDistance, - CesiumMath.EPSILON6 + CesiumMath.EPSILON6, ); }); @@ -357,65 +357,65 @@ describe("Core/EllipsoidRhumbLine", function () { initial, eightyNineDegrees, distance, - ellipsoid + ellipsoid, ); let rhumb2 = new EllipsoidRhumbLine(initial, rhumb1.end, ellipsoid); expect(rhumb1.heading).toEqualEpsilon(rhumb2.heading, CesiumMath.EPSILON12); expect(rhumb1.surfaceDistance).toEqualEpsilon( rhumb2.surfaceDistance, - CesiumMath.EPSILON6 + CesiumMath.EPSILON6, ); rhumb1 = EllipsoidRhumbLine.fromStartHeadingDistance( initial, eightyNinePointNineDegrees, distance, - ellipsoid + ellipsoid, ); rhumb2 = new EllipsoidRhumbLine(initial, rhumb1.end, ellipsoid); expect(rhumb1.heading).toEqualEpsilon(rhumb2.heading, CesiumMath.EPSILON12); expect(rhumb1.surfaceDistance).toEqualEpsilon( rhumb2.surfaceDistance, - CesiumMath.EPSILON6 + CesiumMath.EPSILON6, ); rhumb1 = EllipsoidRhumbLine.fromStartHeadingDistance( initial, ninetyDegrees, distance, - ellipsoid + ellipsoid, ); rhumb2 = new EllipsoidRhumbLine(initial, rhumb1.end, ellipsoid); expect(rhumb1.heading).toEqualEpsilon(rhumb2.heading, CesiumMath.EPSILON12); expect(rhumb1.surfaceDistance).toEqualEpsilon( rhumb2.surfaceDistance, - CesiumMath.EPSILON6 + CesiumMath.EPSILON6, ); rhumb1 = EllipsoidRhumbLine.fromStartHeadingDistance( initial, ninetyPointOneDegrees, distance, - ellipsoid + ellipsoid, ); rhumb2 = new EllipsoidRhumbLine(initial, rhumb1.end, ellipsoid); expect(rhumb1.heading).toEqualEpsilon(rhumb2.heading, CesiumMath.EPSILON12); expect(rhumb1.surfaceDistance).toEqualEpsilon( rhumb2.surfaceDistance, - CesiumMath.EPSILON6 + CesiumMath.EPSILON6, ); rhumb1 = EllipsoidRhumbLine.fromStartHeadingDistance( initial, ninetyPointZeroTwoDegrees, distance, - ellipsoid + ellipsoid, ); rhumb2 = new EllipsoidRhumbLine(initial, rhumb1.end, ellipsoid); expect(rhumb1.heading).toEqualEpsilon(rhumb2.heading, CesiumMath.EPSILON12); expect(rhumb1.surfaceDistance).toEqualEpsilon( rhumb2.surfaceDistance, - CesiumMath.EPSILON6 + CesiumMath.EPSILON6, ); }); @@ -434,65 +434,65 @@ describe("Core/EllipsoidRhumbLine", function () { initial, eightyNineDegrees, distance, - ellipsoid + ellipsoid, ); let rhumb2 = new EllipsoidRhumbLine(initial, rhumb1.end, ellipsoid); expect(rhumb1.heading).toEqualEpsilon(rhumb2.heading, CesiumMath.EPSILON12); expect(rhumb1.surfaceDistance).toEqualEpsilon( rhumb2.surfaceDistance, - CesiumMath.EPSILON6 + CesiumMath.EPSILON6, ); rhumb1 = EllipsoidRhumbLine.fromStartHeadingDistance( initial, eightyNinePointNineDegrees, distance, - ellipsoid + ellipsoid, ); rhumb2 = new EllipsoidRhumbLine(initial, rhumb1.end, ellipsoid); expect(rhumb1.heading).toEqualEpsilon(rhumb2.heading, CesiumMath.EPSILON12); expect(rhumb1.surfaceDistance).toEqualEpsilon( rhumb2.surfaceDistance, - CesiumMath.EPSILON6 + CesiumMath.EPSILON6, ); rhumb1 = EllipsoidRhumbLine.fromStartHeadingDistance( initial, ninetyDegrees, distance, - ellipsoid + ellipsoid, ); rhumb2 = new EllipsoidRhumbLine(initial, rhumb1.end, ellipsoid); expect(rhumb1.heading).toEqualEpsilon(rhumb2.heading, CesiumMath.EPSILON12); expect(rhumb1.surfaceDistance).toEqualEpsilon( rhumb2.surfaceDistance, - CesiumMath.EPSILON6 + CesiumMath.EPSILON6, ); rhumb1 = EllipsoidRhumbLine.fromStartHeadingDistance( initial, ninetyPointOneDegrees, distance, - ellipsoid + ellipsoid, ); rhumb2 = new EllipsoidRhumbLine(initial, rhumb1.end, ellipsoid); expect(rhumb1.heading).toEqualEpsilon(rhumb2.heading, CesiumMath.EPSILON12); expect(rhumb1.surfaceDistance).toEqualEpsilon( rhumb2.surfaceDistance, - CesiumMath.EPSILON6 + CesiumMath.EPSILON6, ); rhumb1 = EllipsoidRhumbLine.fromStartHeadingDistance( initial, ninetyPointZeroTwoDegrees, distance, - ellipsoid + ellipsoid, ); rhumb2 = new EllipsoidRhumbLine(initial, rhumb1.end, ellipsoid); expect(rhumb1.heading).toEqualEpsilon(rhumb2.heading, CesiumMath.EPSILON12); expect(rhumb1.surfaceDistance).toEqualEpsilon( rhumb2.surfaceDistance, - CesiumMath.EPSILON6 + CesiumMath.EPSILON6, ); }); @@ -507,13 +507,13 @@ describe("Core/EllipsoidRhumbLine", function () { initial, CesiumMath.PI_OVER_TWO, distance, - ellipsoid + ellipsoid, ); expect(rhumb1.heading).toEqualEpsilon(rhumb2.heading, CesiumMath.EPSILON12); expect(rhumb1.surfaceDistance).toEqualEpsilon( rhumb2.surfaceDistance, - CesiumMath.EPSILON6 + CesiumMath.EPSILON6, ); }); @@ -529,21 +529,21 @@ describe("Core/EllipsoidRhumbLine", function () { initial, 3.0 * CesiumMath.PI_OVER_TWO, distance, - ellipsoid + ellipsoid, ); expect(-CesiumMath.PI_OVER_TWO).toEqualEpsilon( rhumb1.heading, - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); expect(distance).toEqualEpsilon( rhumb1.surfaceDistance, - CesiumMath.EPSILON6 + CesiumMath.EPSILON6, ); expect(rhumb1.heading).toEqualEpsilon(rhumb2.heading, CesiumMath.EPSILON12); expect(rhumb1.surfaceDistance).toEqualEpsilon( rhumb2.surfaceDistance, - CesiumMath.EPSILON6 + CesiumMath.EPSILON6, ); const rhumb3 = new EllipsoidRhumbLine(final, initial, ellipsoid); @@ -551,20 +551,20 @@ describe("Core/EllipsoidRhumbLine", function () { final, CesiumMath.PI_OVER_TWO, distance, - ellipsoid + ellipsoid, ); expect(CesiumMath.PI_OVER_TWO).toEqualEpsilon( rhumb3.heading, - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); expect(distance).toEqualEpsilon( rhumb3.surfaceDistance, - CesiumMath.EPSILON6 + CesiumMath.EPSILON6, ); expect(rhumb3.heading).toEqualEpsilon(rhumb4.heading, CesiumMath.EPSILON12); expect(rhumb3.surfaceDistance).toEqualEpsilon( rhumb4.surfaceDistance, - CesiumMath.EPSILON6 + CesiumMath.EPSILON6, ); }); @@ -579,11 +579,11 @@ describe("Core/EllipsoidRhumbLine", function () { expect(0.0).toEqualEpsilon(rhumb.heading, CesiumMath.EPSILON12); expect(geodesic.startHeading).toEqualEpsilon( rhumb.heading, - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); expect(geodesic.surfaceDistance).toEqualEpsilon( rhumb.surfaceDistance, - CesiumMath.EPSILON6 + CesiumMath.EPSILON6, ); }); @@ -597,15 +597,15 @@ describe("Core/EllipsoidRhumbLine", function () { const geodesic = new EllipsoidGeodesic(initial, final, ellipsoid); expect(CesiumMath.PI_OVER_TWO).toEqualEpsilon( rhumb.heading, - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); expect(geodesic.startHeading).toEqualEpsilon( rhumb.heading, - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); expect(geodesic.surfaceDistance).toEqualEpsilon( rhumb.surfaceDistance, - CesiumMath.EPSILON4 + CesiumMath.EPSILON4, ); // Due to computational difference, slightly larger tolerance }); @@ -622,14 +622,14 @@ describe("Core/EllipsoidRhumbLine", function () { initial, eightyDegrees, distance, - ellipsoid + ellipsoid, ); const rhumb2 = new EllipsoidRhumbLine(initial, rhumb1.end, ellipsoid); expect(rhumb1.heading).toEqualEpsilon(rhumb2.heading, CesiumMath.EPSILON12); expect(rhumb1.surfaceDistance).toEqualEpsilon( rhumb2.surfaceDistance, - CesiumMath.EPSILON6 + CesiumMath.EPSILON6, ); }); @@ -644,11 +644,11 @@ describe("Core/EllipsoidRhumbLine", function () { expect(halfway.longitude).toEqualEpsilon( interpolatedPoint.longitude, - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); expect(halfway.latitude).toEqualEpsilon( interpolatedPoint.latitude, - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); }); @@ -665,11 +665,11 @@ describe("Core/EllipsoidRhumbLine", function () { expect(halfway.longitude).toEqualEpsilon( interpolatedPoint.longitude, - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); expect(halfway.latitude).toEqualEpsilon( interpolatedPoint.latitude, - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); }); @@ -685,7 +685,7 @@ describe("Core/EllipsoidRhumbLine", function () { expect(start.longitude).toEqualEpsilon( first.longitude, - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); expect(start.latitude).toEqualEpsilon(first.latitude, CesiumMath.EPSILON12); expect(end.longitude).toEqualEpsilon(last.longitude, CesiumMath.EPSILON12); @@ -704,11 +704,11 @@ describe("Core/EllipsoidRhumbLine", function () { expect(expectedMid.longitude).toEqualEpsilon( midpoint.longitude, - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); expect(expectedMid.latitude).toEqualEpsilon( midpoint.latitude, - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); }); @@ -723,7 +723,7 @@ describe("Core/EllipsoidRhumbLine", function () { expect(start.longitude).toEqualEpsilon( first.longitude, - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); expect(start.latitude).toEqualEpsilon(first.latitude, CesiumMath.EPSILON12); expect(end.longitude).toEqualEpsilon(last.longitude, CesiumMath.EPSILON12); @@ -741,11 +741,11 @@ describe("Core/EllipsoidRhumbLine", function () { expect(expectedMid.longitude).toEqualEpsilon( midpoint.longitude, - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); expect(expectedMid.latitude).toEqualEpsilon( midpoint.latitude, - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); }); @@ -761,11 +761,11 @@ describe("Core/EllipsoidRhumbLine", function () { expect(expectedMid.longitude).toEqualEpsilon( midpoint.longitude, - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); expect(expectedMid.latitude).toEqualEpsilon( midpoint.latitude, - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); }); @@ -781,11 +781,11 @@ describe("Core/EllipsoidRhumbLine", function () { expect(expectedMid.longitude).toEqualEpsilon( midpoint.longitude, - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); expect(expectedMid.latitude).toEqualEpsilon( midpoint.latitude, - CesiumMath.EPSILON3 + CesiumMath.EPSILON3, ); }); @@ -801,11 +801,11 @@ describe("Core/EllipsoidRhumbLine", function () { expect(expectedMid.longitude).toEqualEpsilon( result.longitude, - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); expect(expectedMid.latitude).toEqualEpsilon( result.latitude, - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); }); @@ -824,11 +824,11 @@ describe("Core/EllipsoidRhumbLine", function () { expect(expectedMid.longitude).toEqualEpsilon( result.longitude, - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); expect(expectedMid.latitude).toEqualEpsilon( result.latitude, - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); }); @@ -840,50 +840,50 @@ describe("Core/EllipsoidRhumbLine", function () { const midpointUsingInterpolation = rhumb.interpolateUsingFraction(0.5); const midpointUsingIntersection = rhumb.findIntersectionWithLongitude( - midpointUsingInterpolation.longitude + midpointUsingInterpolation.longitude, ); expect( Cartographic.equalsEpsilon( midpointUsingInterpolation, midpointUsingIntersection, - CesiumMath.EPSILON12 - ) + CesiumMath.EPSILON12, + ), ).toBe(true); let pointUsingInterpolation = rhumb.interpolateUsingFraction(0.1); let pointUsingIntersection = rhumb.findIntersectionWithLongitude( - pointUsingInterpolation.longitude + pointUsingInterpolation.longitude, ); expect( Cartographic.equalsEpsilon( pointUsingInterpolation, pointUsingIntersection, - CesiumMath.EPSILON12 - ) + CesiumMath.EPSILON12, + ), ).toBe(true); pointUsingInterpolation = rhumb.interpolateUsingFraction(0.75); pointUsingIntersection = rhumb.findIntersectionWithLongitude( - pointUsingInterpolation.longitude + pointUsingInterpolation.longitude, ); expect( Cartographic.equalsEpsilon( pointUsingInterpolation, pointUsingIntersection, - CesiumMath.EPSILON12 - ) + CesiumMath.EPSILON12, + ), ).toBe(true); pointUsingInterpolation = rhumb.interpolateUsingFraction(1.1); pointUsingIntersection = rhumb.findIntersectionWithLongitude( - pointUsingInterpolation.longitude + pointUsingInterpolation.longitude, ); expect( Cartographic.equalsEpsilon( pointUsingInterpolation, pointUsingIntersection, - CesiumMath.EPSILON12 - ) + CesiumMath.EPSILON12, + ), ).toBe(true); }); @@ -900,16 +900,16 @@ describe("Core/EllipsoidRhumbLine", function () { Cartographic.equalsEpsilon( idlIntersection1, idlIntersection2, - CesiumMath.EPSILON12 - ) + CesiumMath.EPSILON12, + ), ).toBe(true); expect(idlIntersection1.longitude).toEqualEpsilon( Math.PI, - CesiumMath.EPSILON14 + CesiumMath.EPSILON14, ); expect(idlIntersection2.longitude).toEqualEpsilon( Math.PI, - CesiumMath.EPSILON14 + CesiumMath.EPSILON14, ); rhumb.setEndPoints(end, start); @@ -921,16 +921,16 @@ describe("Core/EllipsoidRhumbLine", function () { Cartographic.equalsEpsilon( idlIntersection1, idlIntersection2, - CesiumMath.EPSILON12 - ) + CesiumMath.EPSILON12, + ), ).toBe(true); expect(idlIntersection1.longitude).toEqualEpsilon( -Math.PI, - CesiumMath.EPSILON14 + CesiumMath.EPSILON14, ); expect(idlIntersection2.longitude).toEqualEpsilon( -Math.PI, - CesiumMath.EPSILON14 + CesiumMath.EPSILON14, ); }); @@ -942,14 +942,14 @@ describe("Core/EllipsoidRhumbLine", function () { const midpointUsingInterpolation = rhumb.interpolateUsingFraction(0.5); const midpointUsingIntersection = rhumb.findIntersectionWithLongitude( - midpointUsingInterpolation.longitude + midpointUsingInterpolation.longitude, ); expect( Cartographic.equalsEpsilon( midpointUsingInterpolation, midpointUsingIntersection, - CesiumMath.EPSILON12 - ) + CesiumMath.EPSILON12, + ), ).toBe(true); }); @@ -961,7 +961,7 @@ describe("Core/EllipsoidRhumbLine", function () { const midpointUsingInterpolation = rhumb.interpolateUsingFraction(0.5); const midpointUsingIntersection = rhumb.findIntersectionWithLongitude( - midpointUsingInterpolation.longitude + midpointUsingInterpolation.longitude, ); expect(midpointUsingIntersection).not.toBeDefined(); @@ -973,13 +973,12 @@ describe("Core/EllipsoidRhumbLine", function () { const rhumb = new EllipsoidRhumbLine(start, end); - const midpointUsingIntersection = rhumb.findIntersectionWithLongitude( - thirtyDegrees - ); + const midpointUsingIntersection = + rhumb.findIntersectionWithLongitude(thirtyDegrees); expect(midpointUsingIntersection.latitude).toEqualEpsilon( CesiumMath.PI_OVER_TWO, - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); }); @@ -991,50 +990,50 @@ describe("Core/EllipsoidRhumbLine", function () { const midpointUsingInterpolation = rhumb.interpolateUsingFraction(0.5); const midpointUsingIntersection = rhumb.findIntersectionWithLatitude( - midpointUsingInterpolation.latitude + midpointUsingInterpolation.latitude, ); expect( Cartographic.equalsEpsilon( midpointUsingInterpolation, midpointUsingIntersection, - CesiumMath.EPSILON12 - ) + CesiumMath.EPSILON12, + ), ).toBe(true); let pointUsingInterpolation = rhumb.interpolateUsingFraction(0.1); let pointUsingIntersection = rhumb.findIntersectionWithLatitude( - pointUsingInterpolation.latitude + pointUsingInterpolation.latitude, ); expect( Cartographic.equalsEpsilon( pointUsingInterpolation, pointUsingIntersection, - CesiumMath.EPSILON12 - ) + CesiumMath.EPSILON12, + ), ).toBe(true); pointUsingInterpolation = rhumb.interpolateUsingFraction(0.75); pointUsingIntersection = rhumb.findIntersectionWithLatitude( - pointUsingInterpolation.latitude + pointUsingInterpolation.latitude, ); expect( Cartographic.equalsEpsilon( pointUsingInterpolation, pointUsingIntersection, - CesiumMath.EPSILON12 - ) + CesiumMath.EPSILON12, + ), ).toBe(true); pointUsingInterpolation = rhumb.interpolateUsingFraction(1.1); pointUsingIntersection = rhumb.findIntersectionWithLatitude( - pointUsingInterpolation.latitude + pointUsingInterpolation.latitude, ); expect( Cartographic.equalsEpsilon( pointUsingInterpolation, pointUsingIntersection, - CesiumMath.EPSILON12 - ) + CesiumMath.EPSILON12, + ), ).toBe(true); }); @@ -1046,7 +1045,7 @@ describe("Core/EllipsoidRhumbLine", function () { const midpointUsingInterpolation = rhumb.interpolateUsingFraction(0.5); const midpointUsingIntersection = rhumb.findIntersectionWithLatitude( - midpointUsingInterpolation.latitude + midpointUsingInterpolation.latitude, ); expect(midpointUsingIntersection).not.toBeDefined(); @@ -1060,14 +1059,14 @@ describe("Core/EllipsoidRhumbLine", function () { const midpointUsingInterpolation = rhumb.interpolateUsingFraction(0.5); const midpointUsingIntersection = rhumb.findIntersectionWithLatitude( - midpointUsingInterpolation.latitude + midpointUsingInterpolation.latitude, ); expect( Cartographic.equalsEpsilon( midpointUsingInterpolation, midpointUsingIntersection, - CesiumMath.EPSILON12 - ) + CesiumMath.EPSILON12, + ), ).toBe(true); }); @@ -1075,12 +1074,12 @@ describe("Core/EllipsoidRhumbLine", function () { const p0 = new Cartesian3( 899411.2767873341, -5079219.747324299, - 3738850.924729517 + 3738850.924729517, ); const p1 = new Cartesian3( 899411.0994891181, -5079219.778719673, - 3738850.9247295167 + 3738850.9247295167, ); const ellipsoid = Ellipsoid.WGS84; diff --git a/packages/engine/Specs/Core/EllipsoidSpec.js b/packages/engine/Specs/Core/EllipsoidSpec.js index 416d589039ee..40f470cbfed9 100644 --- a/packages/engine/Specs/Core/EllipsoidSpec.js +++ b/packages/engine/Specs/Core/EllipsoidSpec.js @@ -14,18 +14,18 @@ describe("Core/Ellipsoid", function () { const radiiSquared = Cartesian3.multiplyComponents( radii, radii, - new Cartesian3() + new Cartesian3(), ); const radiiToTheFourth = Cartesian3.multiplyComponents( radiiSquared, radiiSquared, - new Cartesian3() + new Cartesian3(), ); const oneOverRadii = new Cartesian3(1 / radii.x, 1 / radii.y, 1 / radii.z); const oneOverRadiiSquared = new Cartesian3( 1 / radiiSquared.x, 1 / radiiSquared.y, - 1 / radiiSquared.z + 1 / radiiSquared.z, ); const minimumRadius = 1.0; const maximumRadius = 3.0; @@ -34,34 +34,34 @@ describe("Core/Ellipsoid", function () { const spaceCartesian = new Cartesian3( 4582719.8827300891, -4582719.8827300882, - 1725510.4250797231 + 1725510.4250797231, ); const spaceCartesianGeodeticSurfaceNormal = new Cartesian3( 0.6829975339864266, -0.68299753398642649, - 0.25889908678270795 + 0.25889908678270795, ); const spaceCartographic = new Cartographic( CesiumMath.toRadians(-45.0), CesiumMath.toRadians(15.0), - 330000.0 + 330000.0, ); const spaceCartographicGeodeticSurfaceNormal = new Cartesian3( 0.68301270189221941, -0.6830127018922193, - 0.25881904510252074 + 0.25881904510252074, ); const surfaceCartesian = new Cartesian3( 4094327.7921465295, 1909216.4044747739, - 4487348.4088659193 + 4487348.4088659193, ); const surfaceCartographic = new Cartographic( CesiumMath.toRadians(25.0), CesiumMath.toRadians(45.0), - 0.0 + 0.0, ); it("default constructor creates zero Ellipsoid", function () { @@ -110,12 +110,11 @@ describe("Core/Ellipsoid", function () { it("geodeticSurfaceNormalCartographic works without a result parameter", function () { const ellipsoid = Ellipsoid.WGS84; - const returnedResult = ellipsoid.geodeticSurfaceNormalCartographic( - spaceCartographic - ); + const returnedResult = + ellipsoid.geodeticSurfaceNormalCartographic(spaceCartographic); expect(returnedResult).toEqualEpsilon( spaceCartographicGeodeticSurfaceNormal, - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); }); @@ -124,12 +123,12 @@ describe("Core/Ellipsoid", function () { const result = new Cartesian3(); const returnedResult = ellipsoid.geodeticSurfaceNormalCartographic( spaceCartographic, - result + result, ); expect(returnedResult).toBe(result); expect(returnedResult).toEqualEpsilon( spaceCartographicGeodeticSurfaceNormal, - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); }); @@ -138,7 +137,7 @@ describe("Core/Ellipsoid", function () { const returnedResult = ellipsoid.geodeticSurfaceNormal(spaceCartesian); expect(returnedResult).toEqualEpsilon( spaceCartesianGeodeticSurfaceNormal, - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); }); @@ -153,12 +152,12 @@ describe("Core/Ellipsoid", function () { const result = new Cartesian3(); const returnedResult = ellipsoid.geodeticSurfaceNormal( spaceCartesian, - result + result, ); expect(returnedResult).toBe(result); expect(returnedResult).toEqualEpsilon( spaceCartesianGeodeticSurfaceNormal, - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); }); @@ -173,7 +172,7 @@ describe("Core/Ellipsoid", function () { const result = new Cartesian3(); const returnedResult = ellipsoid.cartographicToCartesian( spaceCartographic, - result + result, ); expect(result).toBe(returnedResult); expect(returnedResult).toEqualEpsilon(spaceCartesian, CesiumMath.EPSILON7); @@ -188,11 +187,11 @@ describe("Core/Ellipsoid", function () { expect(returnedResult.length).toEqual(2); expect(returnedResult[0]).toEqualEpsilon( spaceCartesian, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(returnedResult[1]).toEqualEpsilon( surfaceCartesian, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); }); @@ -202,18 +201,18 @@ describe("Core/Ellipsoid", function () { const result = [resultCartesian]; const returnedResult = ellipsoid.cartographicArrayToCartesianArray( [spaceCartographic, surfaceCartographic], - result + result, ); expect(result).toBe(returnedResult); expect(result[0]).toBe(resultCartesian); expect(returnedResult.length).toEqual(2); expect(returnedResult[0]).toEqualEpsilon( spaceCartesian, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(returnedResult[1]).toEqualEpsilon( surfaceCartesian, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); }); @@ -222,7 +221,7 @@ describe("Core/Ellipsoid", function () { const returnedResult = ellipsoid.cartesianToCartographic(surfaceCartesian); expect(returnedResult).toEqualEpsilon( surfaceCartographic, - CesiumMath.EPSILON8 + CesiumMath.EPSILON8, ); }); @@ -231,12 +230,12 @@ describe("Core/Ellipsoid", function () { const result = new Cartographic(); const returnedResult = ellipsoid.cartesianToCartographic( surfaceCartesian, - result + result, ); expect(result).toBe(returnedResult); expect(returnedResult).toEqualEpsilon( surfaceCartographic, - CesiumMath.EPSILON8 + CesiumMath.EPSILON8, ); }); @@ -244,10 +243,10 @@ describe("Core/Ellipsoid", function () { const expected = new Cartographic( 9.999999999999999e-11, 1.0067394967422763e-20, - -6378137.0 + -6378137.0, ); const returnedResult = Ellipsoid.WGS84.cartesianToCartographic( - new Cartesian3(1e-50, 1e-60, 1e-70) + new Cartesian3(1e-50, 1e-60, 1e-70), ); expect(returnedResult).toEqual(expected); }); @@ -255,7 +254,7 @@ describe("Core/Ellipsoid", function () { it("cartesianToCartographic return undefined very close to center", function () { const ellipsoid = Ellipsoid.WGS84; const returnedResult = ellipsoid.cartesianToCartographic( - new Cartesian3(1e-150, 1e-150, 1e-150) + new Cartesian3(1e-150, 1e-150, 1e-150), ); expect(returnedResult).toBeUndefined(); }); @@ -275,11 +274,11 @@ describe("Core/Ellipsoid", function () { expect(returnedResult.length).toEqual(2); expect(returnedResult[0]).toEqualEpsilon( spaceCartographic, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(returnedResult[1]).toEqualEpsilon( surfaceCartographic, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); }); @@ -289,7 +288,7 @@ describe("Core/Ellipsoid", function () { const result = [resultCartographic]; const returnedResult = ellipsoid.cartesianArrayToCartographicArray( [spaceCartesian, surfaceCartesian], - result + result, ); expect(result).toBe(returnedResult); expect(result.length).toEqual(2); @@ -327,7 +326,7 @@ describe("Core/Ellipsoid", function () { const expected = new Cartesian3( 0.2680893773941855, 1.1160466902266495, - 2.3559801120411263 + 2.3559801120411263, ); const cartesian = new Cartesian3(4.0, 5.0, 6.0); const returnedResult = ellipsoid.scaleToGeodeticSurface(cartesian); @@ -339,7 +338,7 @@ describe("Core/Ellipsoid", function () { const expected = new Cartesian3( 0.2680893773941855, 1.1160466902266495, - 2.3559801120411263 + 2.3559801120411263, ); const cartesian = new Cartesian3(4.0, 5.0, 6.0); const result = new Cartesian3(); @@ -377,7 +376,7 @@ describe("Core/Ellipsoid", function () { const expected = new Cartesian3( 0.7807200583588266, 0.9759000729485333, - 1.1710800875382399 + 1.1710800875382399, ); const cartesian = new Cartesian3(4.0, 5.0, 6.0); const returnedResult = ellipsoid.scaleToGeocentricSurface(cartesian); @@ -389,13 +388,13 @@ describe("Core/Ellipsoid", function () { const expected = new Cartesian3( 0.7807200583588266, 0.9759000729485333, - 1.1710800875382399 + 1.1710800875382399, ); const cartesian = new Cartesian3(4.0, 5.0, 6.0); const result = new Cartesian3(); const returnedResult = ellipsoid.scaleToGeocentricSurface( cartesian, - result + result, ); expect(returnedResult).toBe(result); expect(result).toEqualEpsilon(expected, CesiumMath.EPSILON16); @@ -423,7 +422,7 @@ describe("Core/Ellipsoid", function () { const result = new Cartesian3(); const returnedResult = ellipsoid.transformPositionToScaledSpace( cartesian, - result + result, ); expect(returnedResult).toBe(result); expect(result).toEqualEpsilon(expected, CesiumMath.EPSILON16); @@ -433,9 +432,8 @@ describe("Core/Ellipsoid", function () { const ellipsoid = new Ellipsoid(2.0, 3.0, 4.0); const expected = new Cartesian3(4.0, 6.0, 8.0); const cartesian = new Cartesian3(2.0, 2.0, 2.0); - const returnedResult = ellipsoid.transformPositionFromScaledSpace( - cartesian - ); + const returnedResult = + ellipsoid.transformPositionFromScaledSpace(cartesian); expect(returnedResult).toEqualEpsilon(expected, CesiumMath.EPSILON16); }); @@ -446,7 +444,7 @@ describe("Core/Ellipsoid", function () { const result = new Cartesian3(); const returnedResult = ellipsoid.transformPositionFromScaledSpace( cartesian, - result + result, ); expect(returnedResult).toBe(result); expect(result).toEqualEpsilon(expected, CesiumMath.EPSILON16); @@ -595,11 +593,10 @@ describe("Core/Ellipsoid", function () { it("getSurfaceNormalIntersectionWithZAxis works without a result parameter", function () { const ellipsoid = Ellipsoid.WGS84; const cartographic = Cartographic.fromDegrees(35.23, 33.23); - const cartesianOnTheSurface = ellipsoid.cartographicToCartesian( - cartographic - ); + const cartesianOnTheSurface = + ellipsoid.cartographicToCartesian(cartographic); const returnedResult = ellipsoid.getSurfaceNormalIntersectionWithZAxis( - cartesianOnTheSurface + cartesianOnTheSurface, ); expect(returnedResult).toBeInstanceOf(Cartesian3); }); @@ -607,13 +604,12 @@ describe("Core/Ellipsoid", function () { it("getSurfaceNormalIntersectionWithZAxis works with a result parameter", function () { const ellipsoid = Ellipsoid.WGS84; const cartographic = Cartographic.fromDegrees(35.23, 33.23); - const cartesianOnTheSurface = ellipsoid.cartographicToCartesian( - cartographic - ); + const cartesianOnTheSurface = + ellipsoid.cartographicToCartesian(cartographic); const returnedResult = ellipsoid.getSurfaceNormalIntersectionWithZAxis( cartesianOnTheSurface, undefined, - cartesianOnTheSurface + cartesianOnTheSurface, ); expect(returnedResult).toBe(cartesianOnTheSurface); }); @@ -621,12 +617,11 @@ describe("Core/Ellipsoid", function () { it("getSurfaceNormalIntersectionWithZAxis returns undefined if the result is outside the ellipsoid with buffer parameter", function () { const ellipsoid = Ellipsoid.WGS84; const cartographic = Cartographic.fromDegrees(35.23, 33.23); - const cartesianOnTheSurface = ellipsoid.cartographicToCartesian( - cartographic - ); + const cartesianOnTheSurface = + ellipsoid.cartographicToCartesian(cartographic); const returnedResult = ellipsoid.getSurfaceNormalIntersectionWithZAxis( cartesianOnTheSurface, - ellipsoid.radii.z + ellipsoid.radii.z, ); expect(returnedResult).toBe(undefined); }); @@ -636,12 +631,11 @@ describe("Core/Ellipsoid", function () { const minorAxis = 1; const ellipsoid = new Ellipsoid(majorAxis, majorAxis, minorAxis); const cartographic = Cartographic.fromDegrees(45.0, 90.0); - const cartesianOnTheSurface = ellipsoid.cartographicToCartesian( - cartographic - ); + const cartesianOnTheSurface = + ellipsoid.cartographicToCartesian(cartographic); const returnedResult = ellipsoid.getSurfaceNormalIntersectionWithZAxis( cartesianOnTheSurface, - undefined + undefined, ); expect(returnedResult).toBe(undefined); }); @@ -651,7 +645,7 @@ describe("Core/Ellipsoid", function () { const cartographic = Cartographic.fromDegrees(35.23, 33.23); let cartesianOnTheSurface = ellipsoid.cartographicToCartesian(cartographic); const surfaceNormal = ellipsoid.geodeticSurfaceNormal( - cartesianOnTheSurface + cartesianOnTheSurface, ); const magnitude = cartesianOnTheSurface.x / surfaceNormal.x; @@ -659,7 +653,7 @@ describe("Core/Ellipsoid", function () { expected.z = cartesianOnTheSurface.z - surfaceNormal.z * magnitude; let result = ellipsoid.getSurfaceNormalIntersectionWithZAxis( cartesianOnTheSurface, - undefined + undefined, ); expect(result).toEqualEpsilon(expected, CesiumMath.EPSILON8); @@ -667,7 +661,7 @@ describe("Core/Ellipsoid", function () { cartesianOnTheSurface = new Cartesian3(ellipsoid.radii.x, 0, 0); result = ellipsoid.getSurfaceNormalIntersectionWithZAxis( cartesianOnTheSurface, - undefined + undefined, ); expect(result).toEqualEpsilon(Cartesian3.ZERO, CesiumMath.EPSILON8); }); @@ -680,24 +674,24 @@ describe("Core/Ellipsoid", function () { let result = ellipsoid.getSurfaceNormalIntersectionWithZAxis( cartesianOnTheSurface, - undefined + undefined, ); let surfaceNormalWithLength = Cartesian3.multiplyByScalar( surfaceNormal, ellipsoid.maximumRadius, - new Cartesian3() + new Cartesian3(), ); let position = Cartesian3.add( result, surfaceNormalWithLength, - new Cartesian3() + new Cartesian3(), ); let resultCartographic = ellipsoid.cartesianToCartographic(position); resultCartographic.height = 0.0; expect(resultCartographic).toEqualEpsilon( cartographic, - CesiumMath.EPSILON8 + CesiumMath.EPSILON8, ); // at the north pole @@ -707,22 +701,22 @@ describe("Core/Ellipsoid", function () { surfaceNormalWithLength = Cartesian3.multiplyByScalar( surfaceNormal, ellipsoid.maximumRadius, - new Cartesian3() + new Cartesian3(), ); result = ellipsoid.getSurfaceNormalIntersectionWithZAxis( cartesianOnTheSurface, - undefined + undefined, ); position = Cartesian3.add( result, surfaceNormalWithLength, - new Cartesian3() + new Cartesian3(), ); resultCartographic = ellipsoid.cartesianToCartographic(position); resultCartographic.height = 0.0; expect(resultCartographic).toEqualEpsilon( cartographic, - CesiumMath.EPSILON8 + CesiumMath.EPSILON8, ); }); @@ -735,14 +729,13 @@ describe("Core/Ellipsoid", function () { it("getLocalCurvature returns expected values at the equator", function () { const ellipsoid = Ellipsoid.WGS84; const cartographic = Cartographic.fromDegrees(0.0, 0.0); - const cartesianOnTheSurface = ellipsoid.cartographicToCartesian( - cartographic - ); + const cartesianOnTheSurface = + ellipsoid.cartographicToCartesian(cartographic); const returnedResult = ellipsoid.getLocalCurvature(cartesianOnTheSurface); const expectedResult = new Cartesian2( 1.0 / ellipsoid.maximumRadius, ellipsoid.maximumRadius / - (ellipsoid.minimumRadius * ellipsoid.minimumRadius) + (ellipsoid.minimumRadius * ellipsoid.minimumRadius), ); expect(returnedResult).toEqualEpsilon(expectedResult, CesiumMath.EPSILON8); }); @@ -750,16 +743,15 @@ describe("Core/Ellipsoid", function () { it("getLocalCurvature returns expected values at the north pole", function () { const ellipsoid = Ellipsoid.WGS84; const cartographic = Cartographic.fromDegrees(0.0, 90.0); - const cartesianOnTheSurface = ellipsoid.cartographicToCartesian( - cartographic - ); + const cartesianOnTheSurface = + ellipsoid.cartographicToCartesian(cartographic); const returnedResult = ellipsoid.getLocalCurvature(cartesianOnTheSurface); const semiLatusRectum = (ellipsoid.maximumRadius * ellipsoid.maximumRadius) / ellipsoid.minimumRadius; const expectedResult = new Cartesian2( 1.0 / semiLatusRectum, - 1.0 / semiLatusRectum + 1.0 / semiLatusRectum, ); expect(returnedResult).toEqualEpsilon(expectedResult, CesiumMath.EPSILON8); }); @@ -793,9 +785,9 @@ describe("Core/Ellipsoid", function () { -CesiumMath.PI, -CesiumMath.PI_OVER_TWO, CesiumMath.PI, - CesiumMath.PI_OVER_TWO - ) - ) + CesiumMath.PI_OVER_TWO, + ), + ), ).toEqualEpsilon(area, CesiumMath.EPSILON3); // area of a prolate spheroid @@ -813,9 +805,9 @@ describe("Core/Ellipsoid", function () { -CesiumMath.PI, -CesiumMath.PI_OVER_TWO, CesiumMath.PI, - CesiumMath.PI_OVER_TWO - ) - ) + CesiumMath.PI_OVER_TWO, + ), + ), ).toEqualEpsilon(area, CesiumMath.EPSILON3); }); diff --git a/packages/engine/Specs/Core/EllipsoidTangentPlaneSpec.js b/packages/engine/Specs/Core/EllipsoidTangentPlaneSpec.js index c421c4f0cb91..1ad3cf40cdab 100644 --- a/packages/engine/Specs/Core/EllipsoidTangentPlaneSpec.js +++ b/packages/engine/Specs/Core/EllipsoidTangentPlaneSpec.js @@ -16,7 +16,7 @@ describe("Core/EllipsoidTangentPlane", function () { it("constructor sets expected values", function () { const tangentPlane = new EllipsoidTangentPlane( Cartesian3.UNIT_X, - Ellipsoid.UNIT_SPHERE + Ellipsoid.UNIT_SPHERE, ); expect(tangentPlane.ellipsoid).toBe(Ellipsoid.UNIT_SPHERE); expect(tangentPlane.origin).toEqual(Cartesian3.UNIT_X); @@ -29,7 +29,7 @@ describe("Core/EllipsoidTangentPlane", function () { ]; const tangentPlane = EllipsoidTangentPlane.fromPoints( points, - Ellipsoid.UNIT_SPHERE + Ellipsoid.UNIT_SPHERE, ); expect(tangentPlane.ellipsoid).toBe(Ellipsoid.UNIT_SPHERE); expect(tangentPlane.origin).toEqual(Cartesian3.UNIT_X); @@ -65,7 +65,7 @@ describe("Core/EllipsoidTangentPlane", function () { const result = new Cartesian2(); const returnedResult = tangentPlane.projectPointOntoPlane( positions, - result + result, ); expect(result).toBe(returnedResult); expect(returnedResult).toEqual(expectedResult); @@ -110,7 +110,7 @@ describe("Core/EllipsoidTangentPlane", function () { const result = [index0]; const returnedResults = tangentPlane.projectPointsOntoPlane( positions, - result + result, ); expect(result).toBe(returnedResults); expect(result[0]).toBe(index0); @@ -159,7 +159,7 @@ describe("Core/EllipsoidTangentPlane", function () { const result = new Cartesian3(); const returnedResult = tangentPlane.projectPointOntoEllipsoid( position, - result + result, ); expect(result).toBe(returnedResult); expect(returnedResult).toEqual(expectedResult); @@ -199,7 +199,7 @@ describe("Core/EllipsoidTangentPlane", function () { const result = [index0]; const returnedResults = tangentPlane.projectPointsOntoEllipsoid( positions, - result + result, ); expect(result).toBe(returnedResults); expect(result[0]).toBe(index0); @@ -223,16 +223,16 @@ describe("Core/EllipsoidTangentPlane", function () { const tangentPlane = new EllipsoidTangentPlane(origin, ellipsoid); expect( - tangentPlane.projectPointToNearestOnPlane(new Cartesian3(2.0, 0.0, 0.0)) + tangentPlane.projectPointToNearestOnPlane(new Cartesian3(2.0, 0.0, 0.0)), ).toEqual(new Cartesian2(0.0, 0.0)); expect( - tangentPlane.projectPointToNearestOnPlane(new Cartesian3(1.0, 0.0, 0.0)) + tangentPlane.projectPointToNearestOnPlane(new Cartesian3(1.0, 0.0, 0.0)), ).toEqual(new Cartesian2(0.0, 0.0)); expect( - tangentPlane.projectPointToNearestOnPlane(new Cartesian3(0.0, 0.0, 0.0)) + tangentPlane.projectPointToNearestOnPlane(new Cartesian3(0.0, 0.0, 0.0)), ).toEqual(new Cartesian2(0.0, 0.0)); expect( - tangentPlane.projectPointToNearestOnPlane(new Cartesian3(-1.0, 0.0, 0.0)) + tangentPlane.projectPointToNearestOnPlane(new Cartesian3(-1.0, 0.0, 0.0)), ).toEqual(new Cartesian2(0.0, 0.0)); }); @@ -246,7 +246,7 @@ describe("Core/EllipsoidTangentPlane", function () { const result = new Cartesian2(); const returnedResult = tangentPlane.projectPointToNearestOnPlane( positions, - result + result, ); expect(result).toBe(returnedResult); expect(returnedResult).toEqual(expectedResult); @@ -267,9 +267,8 @@ describe("Core/EllipsoidTangentPlane", function () { new Cartesian2(0.0, 0.0), new Cartesian2(1.0, 0.0), ]; - const returnedResults = tangentPlane.projectPointsToNearestOnPlane( - positions - ); + const returnedResults = + tangentPlane.projectPointsToNearestOnPlane(positions); expect(returnedResults).toEqual(expectedResults); }); @@ -293,7 +292,7 @@ describe("Core/EllipsoidTangentPlane", function () { const result = [index0]; const returnedResults = tangentPlane.projectPointsToNearestOnPlane( positions, - result + result, ); expect(result).toBe(returnedResults); expect(result[0]).toBe(index0); @@ -321,7 +320,7 @@ describe("Core/EllipsoidTangentPlane", function () { it("projectPointOntoPlane throws without cartesian", function () { const tangentPlane = new EllipsoidTangentPlane( Cartesian3.UNIT_X, - Ellipsoid.UNIT_SPHERE + Ellipsoid.UNIT_SPHERE, ); expect(function () { return tangentPlane.projectPointOntoPlane(undefined); @@ -331,7 +330,7 @@ describe("Core/EllipsoidTangentPlane", function () { it("projectPointsOntoPlane throws without cartesians", function () { const tangentPlane = new EllipsoidTangentPlane( Cartesian3.UNIT_X, - Ellipsoid.UNIT_SPHERE + Ellipsoid.UNIT_SPHERE, ); expect(function () { return tangentPlane.projectPointsOntoPlane(undefined); @@ -341,7 +340,7 @@ describe("Core/EllipsoidTangentPlane", function () { it("projectPointToNearestOnPlane throws without cartesian", function () { const tangentPlane = new EllipsoidTangentPlane( Cartesian3.UNIT_X, - Ellipsoid.UNIT_SPHERE + Ellipsoid.UNIT_SPHERE, ); expect(function () { return tangentPlane.projectPointToNearestOnPlane(undefined); @@ -351,7 +350,7 @@ describe("Core/EllipsoidTangentPlane", function () { it("projectPointsToNearestOnPlane throws without cartesians", function () { const tangentPlane = new EllipsoidTangentPlane( Cartesian3.UNIT_X, - Ellipsoid.UNIT_SPHERE + Ellipsoid.UNIT_SPHERE, ); expect(function () { return tangentPlane.projectPointsToNearestOnPlane(undefined); @@ -361,7 +360,7 @@ describe("Core/EllipsoidTangentPlane", function () { it("projectPointsOntoEllipsoid throws without cartesians", function () { const tangentPlane = new EllipsoidTangentPlane( Cartesian3.UNIT_X, - Ellipsoid.UNIT_SPHERE + Ellipsoid.UNIT_SPHERE, ); expect(function () { return tangentPlane.projectPointsOntoEllipsoid(undefined); @@ -370,21 +369,12 @@ describe("Core/EllipsoidTangentPlane", function () { it("projectPointsOntoEllipsoid works with an arbitrary ellipsoid using fromPoints", function () { const points = Cartesian3.fromDegreesArray([ - -72.0, - 40.0, - -68.0, - 35.0, - -75.0, - 30.0, - -70.0, - 30.0, - -68.0, - 40.0, + -72.0, 40.0, -68.0, 35.0, -75.0, 30.0, -70.0, 30.0, -68.0, 40.0, ]); const tangentPlane = EllipsoidTangentPlane.fromPoints( points, - Ellipsoid.WGS84 + Ellipsoid.WGS84, ); const points2D = tangentPlane.projectPointsOntoPlane(points); const positionsBack = tangentPlane.projectPointsOntoEllipsoid(points2D); diff --git a/packages/engine/Specs/Core/EllipsoidTerrainProviderSpec.js b/packages/engine/Specs/Core/EllipsoidTerrainProviderSpec.js index f3ed58d94a70..04fb3e6a5005 100644 --- a/packages/engine/Specs/Core/EllipsoidTerrainProviderSpec.js +++ b/packages/engine/Specs/Core/EllipsoidTerrainProviderSpec.js @@ -36,5 +36,5 @@ describe( expect(provider.getTileDataAvailable()).toBeUndefined(); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Core/EllipsoidalOccluderSpec.js b/packages/engine/Specs/Core/EllipsoidalOccluderSpec.js index 154d4c502b55..1753aca0e7bc 100644 --- a/packages/engine/Specs/Core/EllipsoidalOccluderSpec.js +++ b/packages/engine/Specs/Core/EllipsoidalOccluderSpec.js @@ -53,39 +53,41 @@ describe("Core/EllipsoidalOccluder", function () { let direction = Cartesian3.normalize( new Cartesian3(1.0, 1.0, 1.0), - new Cartesian3() + new Cartesian3(), ); let point = Cartesian3.multiplyByScalar(direction, 0.5, new Cartesian3()); let scaledSpacePoint = occluder.computeHorizonCullingPoint(point, [point]); - let scaledSpacePointShrunk = occluder.computeHorizonCullingPointPossiblyUnderEllipsoid( - point, - [point], - height - ); + let scaledSpacePointShrunk = + occluder.computeHorizonCullingPointPossiblyUnderEllipsoid( + point, + [point], + height, + ); expect(occluder.isScaledSpacePointVisible(scaledSpacePoint)).toEqual(false); expect( occluder.isScaledSpacePointVisiblePossiblyUnderEllipsoid( scaledSpacePointShrunk, - height - ) + height, + ), ).toEqual(true); direction = new Cartesian3(0.0, 1.0, 0.0); point = Cartesian3.multiplyByScalar(direction, 0.5, new Cartesian3()); scaledSpacePoint = occluder.computeHorizonCullingPoint(point, [point]); - scaledSpacePointShrunk = occluder.computeHorizonCullingPointPossiblyUnderEllipsoid( - point, - [point], - height - ); + scaledSpacePointShrunk = + occluder.computeHorizonCullingPointPossiblyUnderEllipsoid( + point, + [point], + height, + ); expect(occluder.isScaledSpacePointVisible(scaledSpacePoint)).toEqual(false); expect( occluder.isScaledSpacePointVisiblePossiblyUnderEllipsoid( scaledSpacePointShrunk, - height - ) + height, + ), ).toEqual(false); }); @@ -104,7 +106,7 @@ describe("Core/EllipsoidalOccluder", function () { occluder.cameraPosition = new Cartesian3( ellipsoid.minimumRadius - 100, 0.0, - 0.0 + 0.0, ); const point = new Cartesian3(-7000000, 0.0, 0.0); @@ -152,7 +154,7 @@ describe("Core/EllipsoidalOccluder", function () { expect(function () { ellipsoidalOccluder.computeHorizonCullingPoint( directionToPoint, - undefined + undefined, ); }).toThrowDeveloperError(); }); @@ -165,7 +167,7 @@ describe("Core/EllipsoidalOccluder", function () { const result = ellipsoidalOccluder.computeHorizonCullingPoint( directionToPoint, - positions + positions, ); expect(result.x).toEqualEpsilon(1.0, CesiumMath.EPSILON14); @@ -181,7 +183,7 @@ describe("Core/EllipsoidalOccluder", function () { const result = ellipsoidalOccluder.computeHorizonCullingPoint( directionToPoint, - positions + positions, ); expect(result).toBeUndefined(); }); @@ -194,7 +196,7 @@ describe("Core/EllipsoidalOccluder", function () { const result = ellipsoidalOccluder.computeHorizonCullingPoint( directionToPoint, - positions + positions, ); expect(result).toBeUndefined(); }); @@ -210,7 +212,7 @@ describe("Core/EllipsoidalOccluder", function () { const result = ellipsoidalOccluder.computeHorizonCullingPoint( directionToPoint, - positions + positions, ); expect(result).toBeUndefined(); }); @@ -223,7 +225,7 @@ describe("Core/EllipsoidalOccluder", function () { const result = ellipsoidalOccluder.computeHorizonCullingPoint( directionToPoint, - positions + positions, ); expect(result).toBeUndefined(); }); @@ -241,28 +243,28 @@ describe("Core/EllipsoidalOccluder", function () { const firstPositionArray = [positions[0]]; const result = ellipsoidalOccluder.computeHorizonCullingPoint( boundingSphere.center, - firstPositionArray + firstPositionArray, ); const unscaledResult = Cartesian3.multiplyComponents( result, ellipsoid.radii, - new Cartesian3() + new Cartesian3(), ); // The grazing altitude of the ray from the horizon culling point to the // position used to compute it should be very nearly zero. const direction = Cartesian3.normalize( Cartesian3.subtract(positions[0], unscaledResult, new Cartesian3()), - new Cartesian3() + new Cartesian3(), ); const nearest = IntersectionTests.grazingAltitudeLocation( new Ray(unscaledResult, direction), - ellipsoid + ellipsoid, ); const nearestCartographic = ellipsoid.cartesianToCartographic(nearest); expect(nearestCartographic.height).toEqualEpsilon( 0.0, - CesiumMath.EPSILON5 + CesiumMath.EPSILON5, ); }); @@ -279,12 +281,12 @@ describe("Core/EllipsoidalOccluder", function () { const result = ellipsoidalOccluder.computeHorizonCullingPoint( boundingSphere.center, - positions + positions, ); const unscaledResult = Cartesian3.multiplyComponents( result, ellipsoid.radii, - new Cartesian3() + new Cartesian3(), ); // The grazing altitude of the ray from the horizon culling point to the @@ -293,11 +295,11 @@ describe("Core/EllipsoidalOccluder", function () { for (let i = 0; i < positions.length; ++i) { const direction = Cartesian3.normalize( Cartesian3.subtract(positions[i], unscaledResult, new Cartesian3()), - new Cartesian3() + new Cartesian3(), ); const nearest = IntersectionTests.grazingAltitudeLocation( new Ray(unscaledResult, direction), - ellipsoid + ellipsoid, ); const nearestCartographic = ellipsoid.cartesianToCartographic(nearest); if (Math.abs(nearestCartographic.height) < CesiumMath.EPSILON5) { @@ -316,11 +318,12 @@ describe("Core/EllipsoidalOccluder", function () { const positions = [new Cartesian3(12344.0, 0.0, 0.0)]; const directionToPoint = new Cartesian3(1.0, 0.0, 0.0); - const result = ellipsoidalOccluder.computeHorizonCullingPointPossiblyUnderEllipsoid( - directionToPoint, - positions, - -1.0 - ); + const result = + ellipsoidalOccluder.computeHorizonCullingPointPossiblyUnderEllipsoid( + directionToPoint, + positions, + -1.0, + ); expect(result.x).toEqualEpsilon(1.0, CesiumMath.EPSILON14); expect(result.y).toEqualEpsilon(0.0, CesiumMath.EPSILON14); @@ -355,14 +358,14 @@ describe("Core/EllipsoidalOccluder", function () { ellipsoidalOccluder.computeHorizonCullingPointFromVertices( boundingSphere.center, vertices, - 7 + 7, ); expect(function () { ellipsoidalOccluder.computeHorizonCullingPointFromVertices( undefined, vertices, - 7 + 7, ); }).toThrowDeveloperError(); @@ -370,7 +373,7 @@ describe("Core/EllipsoidalOccluder", function () { ellipsoidalOccluder.computeHorizonCullingPointFromVertices( boundingSphere.center, undefined, - 7 + 7, ); }).toThrowDeveloperError(); @@ -378,7 +381,7 @@ describe("Core/EllipsoidalOccluder", function () { ellipsoidalOccluder.computeHorizonCullingPointFromVertices( boundingSphere.center, vertices, - undefined + undefined, ); }).toThrowDeveloperError(); }); @@ -410,14 +413,15 @@ describe("Core/EllipsoidalOccluder", function () { const result1 = ellipsoidalOccluder.computeHorizonCullingPoint( boundingSphere.center, - positions - ); - const result2 = ellipsoidalOccluder.computeHorizonCullingPointFromVertices( - boundingSphere.center, - vertices, - 7, - center + positions, ); + const result2 = + ellipsoidalOccluder.computeHorizonCullingPointFromVertices( + boundingSphere.center, + vertices, + 7, + center, + ); expect(result1.x).toEqualEpsilon(result2.x, CesiumMath.EPSILON14); expect(result1.y).toEqualEpsilon(result2.y, CesiumMath.EPSILON14); @@ -431,13 +435,14 @@ describe("Core/EllipsoidalOccluder", function () { const directionToPoint = new Cartesian3(1.0, 0.0, 0.0); const center = Cartesian3.ZERO; - const result = ellipsoidalOccluder.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid( - directionToPoint, - vertices, - 3, - center, - -1.0 - ); + const result = + ellipsoidalOccluder.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid( + directionToPoint, + vertices, + 3, + center, + -1.0, + ); expect(result.x).toEqualEpsilon(1.0, CesiumMath.EPSILON14); expect(result.y).toEqualEpsilon(0.0, CesiumMath.EPSILON14); @@ -450,10 +455,11 @@ describe("Core/EllipsoidalOccluder", function () { const ellipsoid = new Ellipsoid(12345.0, 12345.0, 12345.0); const ellipsoidalOccluder = new EllipsoidalOccluder(ellipsoid); const rectangle = Rectangle.MAX_VALUE; - const result = ellipsoidalOccluder.computeHorizonCullingPointFromRectangle( - rectangle, - ellipsoid - ); + const result = + ellipsoidalOccluder.computeHorizonCullingPointFromRectangle( + rectangle, + ellipsoid, + ); expect(result).toBeUndefined(); }); @@ -462,15 +468,16 @@ describe("Core/EllipsoidalOccluder", function () { const ellipsoidalOccluder = new EllipsoidalOccluder(ellipsoid); const rectangle = new Rectangle(0.1, 0.2, 0.3, 0.4); - const result = ellipsoidalOccluder.computeHorizonCullingPointFromRectangle( - rectangle, - ellipsoid - ); + const result = + ellipsoidalOccluder.computeHorizonCullingPointFromRectangle( + rectangle, + ellipsoid, + ); expect(result).toBeDefined(); const unscaledResult = Cartesian3.multiplyComponents( result, ellipsoid.radii, - new Cartesian3() + new Cartesian3(), ); // The grazing altitude of the ray from the horizon culling point to the @@ -486,11 +493,11 @@ describe("Core/EllipsoidalOccluder", function () { for (let i = 0; i < positions.length; ++i) { const direction = Cartesian3.normalize( Cartesian3.subtract(positions[i], unscaledResult, new Cartesian3()), - new Cartesian3() + new Cartesian3(), ); const nearest = IntersectionTests.grazingAltitudeLocation( new Ray(unscaledResult, direction), - ellipsoid + ellipsoid, ); const nearestCartographic = ellipsoid.cartesianToCartographic(nearest); if (Math.abs(nearestCartographic.height) < CesiumMath.EPSILON5) { diff --git a/packages/engine/Specs/Core/EncodedCartesian3Spec.js b/packages/engine/Specs/Core/EncodedCartesian3Spec.js index 203e96725868..d78acddf983b 100644 --- a/packages/engine/Specs/Core/EncodedCartesian3Spec.js +++ b/packages/engine/Specs/Core/EncodedCartesian3Spec.js @@ -98,7 +98,7 @@ describe("Core/EncodedCartesian3", function () { EncodedCartesian3.writeElements( new Cartesian3(), new Float32Array(6), - -1 + -1, ); }).toThrowDeveloperError(); }); diff --git a/packages/engine/Specs/Core/FeatureDetectionSpec.js b/packages/engine/Specs/Core/FeatureDetectionSpec.js index a4a45dd49d03..f6d8fffbd26e 100644 --- a/packages/engine/Specs/Core/FeatureDetectionSpec.js +++ b/packages/engine/Specs/Core/FeatureDetectionSpec.js @@ -81,7 +81,7 @@ describe("Core/FeatureDetection", function () { console.log( `detected Webkit ${webkitVersion.join(".")}${ webkitVersion.isNightly ? " (Nightly)" : "" - }` + }`, ); } }); @@ -91,11 +91,12 @@ describe("Core/FeatureDetection", function () { expect(typeof isInternetExplorer).toEqual("boolean"); if (isInternetExplorer) { - const internetExplorerVersion = FeatureDetection.internetExplorerVersion(); + const internetExplorerVersion = + FeatureDetection.internetExplorerVersion(); checkVersionArray(internetExplorerVersion); console.log( - `detected Internet Explorer ${internetExplorerVersion.join(".")}` + `detected Internet Explorer ${internetExplorerVersion.join(".")}`, ); } }); @@ -131,7 +132,8 @@ describe("Core/FeatureDetection", function () { }); it("detects imageRendering support", function () { - const supportsImageRenderingPixelated = FeatureDetection.supportsImageRenderingPixelated(); + const supportsImageRenderingPixelated = + FeatureDetection.supportsImageRenderingPixelated(); expect(typeof supportsImageRenderingPixelated).toEqual("boolean"); if (supportsImageRenderingPixelated) { expect(FeatureDetection.imageRenderingValue()).toBeDefined(); @@ -163,7 +165,7 @@ describe("Core/FeatureDetection", function () { it("detects WebGL2 support", function () { const scene = createScene(); expect(FeatureDetection.supportsWebgl2(scene)).toEqual( - scene.context.webgl2 + scene.context.webgl2, ); scene.destroyForSpecs(); }); diff --git a/packages/engine/Specs/Core/FrustumGeometrySpec.js b/packages/engine/Specs/Core/FrustumGeometrySpec.js index 24af379c2583..ca897c753485 100644 --- a/packages/engine/Specs/Core/FrustumGeometrySpec.js +++ b/packages/engine/Specs/Core/FrustumGeometrySpec.js @@ -56,7 +56,7 @@ describe("Core/FrustumGeometry", function () { origin: Cartesian3.ZERO, orientation: Quaternion.IDENTITY, vertexFormat: VertexFormat.ALL, - }) + }), ); const numVertices = 24; //3 components x 8 corners @@ -89,27 +89,8 @@ describe("Core/FrustumGeometry", function () { vertexFormat: VertexFormat.POSITION_ONLY, }), [ - 0.0, - 1.0, - 2.0, - 3.0, - 4.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 1.0, - 1.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 1.0, - ] + 0.0, 1.0, 2.0, 3.0, 4.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, + 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, + ], ); }); diff --git a/packages/engine/Specs/Core/FrustumOutlineGeometrySpec.js b/packages/engine/Specs/Core/FrustumOutlineGeometrySpec.js index e5435ea98dd7..aaffd5196156 100644 --- a/packages/engine/Specs/Core/FrustumOutlineGeometrySpec.js +++ b/packages/engine/Specs/Core/FrustumOutlineGeometrySpec.js @@ -55,7 +55,7 @@ describe("Core/FrustumOutlineGeometry", function () { frustum: frustum, origin: Cartesian3.ZERO, orientation: Quaternion.IDENTITY, - }) + }), ); const numVertices = 8; @@ -82,6 +82,6 @@ describe("Core/FrustumOutlineGeometry", function () { orientation: Quaternion.IDENTITY, vertexFormat: VertexFormat.POSITION_ONLY, }), - [0.0, 1.0, 2.0, 3.0, 4.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0] + [0.0, 1.0, 2.0, 3.0, 4.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0], ); }); diff --git a/packages/engine/Specs/Core/FullscreenSpec.js b/packages/engine/Specs/Core/FullscreenSpec.js index 4f6c48700ec5..f3ddd8945bdf 100644 --- a/packages/engine/Specs/Core/FullscreenSpec.js +++ b/packages/engine/Specs/Core/FullscreenSpec.js @@ -38,7 +38,7 @@ describe("Core/Fullscreen", function () { Fullscreen.requestFullscreen(document.body); expect( - document.body[Fullscreen._names.requestFullscreen] + document.body[Fullscreen._names.requestFullscreen], ).toHaveBeenCalled(); Fullscreen.exitFullscreen(); diff --git a/packages/engine/Specs/Core/GeographicProjectionSpec.js b/packages/engine/Specs/Core/GeographicProjectionSpec.js index 19f890867cb4..33826e1fbd8e 100644 --- a/packages/engine/Specs/Core/GeographicProjectionSpec.js +++ b/packages/engine/Specs/Core/GeographicProjectionSpec.js @@ -23,7 +23,7 @@ describe("Core/GeographicProjection", function () { const cartographic = new Cartographic(0.0, 0.0, height); const projection = new GeographicProjection(); expect(projection.project(cartographic)).toEqual( - new Cartesian3(0.0, 0.0, height) + new Cartesian3(0.0, 0.0, height), ); }); @@ -33,7 +33,7 @@ describe("Core/GeographicProjection", function () { const expected = new Cartesian3( Math.PI * ellipsoid.radii.x, CesiumMath.PI_OVER_TWO * ellipsoid.radii.x, - 0.0 + 0.0, ); const projection = new GeographicProjection(ellipsoid); expect(projection.project(cartographic)).toEqual(expected); @@ -44,7 +44,7 @@ describe("Core/GeographicProjection", function () { const cartographic = new Cartographic( -Math.PI, CesiumMath.PI_OVER_TWO, - 0.0 + 0.0, ); const expected = new Cartesian3(-Math.PI, CesiumMath.PI_OVER_TWO, 0.0); const projection = new GeographicProjection(ellipsoid); @@ -57,7 +57,7 @@ describe("Core/GeographicProjection", function () { const expected = new Cartesian3( Math.PI * ellipsoid.radii.x, CesiumMath.PI_OVER_TWO * ellipsoid.radii.x, - 0.0 + 0.0, ); const projection = new GeographicProjection(ellipsoid); const result = new Cartesian3(0.0, 0.0, 0.0); @@ -70,7 +70,7 @@ describe("Core/GeographicProjection", function () { const cartographic = new Cartographic( CesiumMath.PI_OVER_TWO, CesiumMath.PI_OVER_FOUR, - 12.0 + 12.0, ); const projection = new GeographicProjection(); const projected = projection.project(cartographic); @@ -81,7 +81,7 @@ describe("Core/GeographicProjection", function () { const cartographic = new Cartographic( CesiumMath.PI_OVER_TWO, CesiumMath.PI_OVER_FOUR, - 12.0 + 12.0, ); const projection = new GeographicProjection(); const projected = projection.project(cartographic); diff --git a/packages/engine/Specs/Core/GeographicTilingSchemeSpec.js b/packages/engine/Specs/Core/GeographicTilingSchemeSpec.js index e08cc000e89b..612605618646 100644 --- a/packages/engine/Specs/Core/GeographicTilingSchemeSpec.js +++ b/packages/engine/Specs/Core/GeographicTilingSchemeSpec.js @@ -23,19 +23,19 @@ describe("Core/GeographicTilingScheme", function () { const rectangle = tilingScheme.tileXYToRectangle(0, 0, 0); expect(rectangle.west).toEqualEpsilon( tilingSchemeRectangle.west, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); expect(rectangle.south).toEqualEpsilon( tilingSchemeRectangle.south, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); expect(rectangle.east).toEqualEpsilon( tilingSchemeRectangle.east, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); expect(rectangle.north).toEqualEpsilon( tilingSchemeRectangle.north, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); }); @@ -50,19 +50,19 @@ describe("Core/GeographicTilingScheme", function () { expect(result).toEqual(rectangle); expect(rectangle.west).toEqualEpsilon( tilingSchemeRectangle.west, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); expect(rectangle.south).toEqualEpsilon( tilingSchemeRectangle.south, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); expect(rectangle.east).toEqualEpsilon( tilingSchemeRectangle.east, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); expect(rectangle.north).toEqualEpsilon( tilingSchemeRectangle.north, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); }); @@ -109,20 +109,20 @@ describe("Core/GeographicTilingScheme", function () { expect(northeast.south).toEqualEpsilon( southeast.north, - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); expect(northwest.south).toEqualEpsilon( southwest.north, - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); expect(northeast.west).toEqualEpsilon( northwest.east, - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); expect(southeast.west).toEqualEpsilon( southwest.east, - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); }); }); @@ -136,24 +136,23 @@ describe("Core/GeographicTilingScheme", function () { it("converts radians to degrees", function () { const tilingScheme = new GeographicTilingScheme(); const rectangleInRadians = new Rectangle(0.1, 0.2, 0.3, 0.4); - const nativeRectangle = tilingScheme.rectangleToNativeRectangle( - rectangleInRadians - ); + const nativeRectangle = + tilingScheme.rectangleToNativeRectangle(rectangleInRadians); expect(nativeRectangle.west).toEqualEpsilon( (rectangleInRadians.west * 180) / Math.PI, - CesiumMath.EPSILON13 + CesiumMath.EPSILON13, ); expect(nativeRectangle.south).toEqualEpsilon( (rectangleInRadians.south * 180) / Math.PI, - CesiumMath.EPSILON13 + CesiumMath.EPSILON13, ); expect(nativeRectangle.east).toEqualEpsilon( (rectangleInRadians.east * 180) / Math.PI, - CesiumMath.EPSILON13 + CesiumMath.EPSILON13, ); expect(nativeRectangle.north).toEqualEpsilon( (rectangleInRadians.north * 180) / Math.PI, - CesiumMath.EPSILON13 + CesiumMath.EPSILON13, ); }); @@ -163,24 +162,24 @@ describe("Core/GeographicTilingScheme", function () { const resultRectangle = new Rectangle(0.0, 0.0, 0.0, 0.0); const outputRectangle = tilingScheme.rectangleToNativeRectangle( rectangleInRadians, - resultRectangle + resultRectangle, ); expect(outputRectangle).toEqual(resultRectangle); expect(resultRectangle.west).toEqualEpsilon( (rectangleInRadians.west * 180) / Math.PI, - CesiumMath.EPSILON13 + CesiumMath.EPSILON13, ); expect(resultRectangle.south).toEqualEpsilon( (rectangleInRadians.south * 180) / Math.PI, - CesiumMath.EPSILON13 + CesiumMath.EPSILON13, ); expect(resultRectangle.east).toEqualEpsilon( (rectangleInRadians.east * 180) / Math.PI, - CesiumMath.EPSILON13 + CesiumMath.EPSILON13, ); expect(resultRectangle.north).toEqualEpsilon( (rectangleInRadians.north * 180) / Math.PI, - CesiumMath.EPSILON13 + CesiumMath.EPSILON13, ); }); }); @@ -206,18 +205,18 @@ describe("Core/GeographicTilingScheme", function () { const centerOfWesternRootTile = new Cartographic(-Math.PI / 2.0, 0.0); expect(tilingScheme.positionToTileXY(centerOfWesternRootTile, 0)).toEqual( - new Cartesian2(0, 0) + new Cartesian2(0, 0), ); const centerOfNortheastChildOfEasternRootTile = new Cartographic( (3.0 * Math.PI) / 4.0, - Math.PI / 2.0 + Math.PI / 2.0, ); expect( tilingScheme.positionToTileXY( centerOfNortheastChildOfEasternRootTile, - 1 - ) + 1, + ), ).toEqual(new Cartesian2(3, 0)); }); @@ -226,7 +225,7 @@ describe("Core/GeographicTilingScheme", function () { const centerOfMap = new Cartographic(0.0, 0.0); expect(tilingScheme.positionToTileXY(centerOfMap, 1)).toEqual( - new Cartesian2(2, 1) + new Cartesian2(2, 1), ); }); @@ -235,7 +234,7 @@ describe("Core/GeographicTilingScheme", function () { const southeastCorner = new Cartographic(Math.PI, -Math.PI / 2.0); expect(tilingScheme.positionToTileXY(southeastCorner, 0)).toEqual( - new Cartesian2(1, 0) + new Cartesian2(1, 0), ); }); @@ -244,13 +243,13 @@ describe("Core/GeographicTilingScheme", function () { const centerOfNortheastChildOfEasternRootTile = new Cartographic( (3.0 * Math.PI) / 4.0, - Math.PI / 2.0 + Math.PI / 2.0, ); const resultParameter = new Cartesian2(0, 0); const returnedResult = tilingScheme.positionToTileXY( centerOfNortheastChildOfEasternRootTile, 1, - resultParameter + resultParameter, ); expect(resultParameter).toEqual(returnedResult); expect(resultParameter).toEqual(new Cartesian2(3, 0)); diff --git a/packages/engine/Specs/Core/GeometryAttributeSpec.js b/packages/engine/Specs/Core/GeometryAttributeSpec.js index b13cd183c74e..d51bb6e4c848 100644 --- a/packages/engine/Specs/Core/GeometryAttributeSpec.js +++ b/packages/engine/Specs/Core/GeometryAttributeSpec.js @@ -13,18 +13,7 @@ describe("Core/GeometryAttribute", function () { expect(color.componentsPerAttribute).toEqual(4); expect(color.normalize).toEqual(true); expect(color.values).toEqual([ - 255, - 0, - 0, - 255, - 0, - 255, - 0, - 255, - 0, - 0, - 255, - 255, + 255, 0, 0, 255, 0, 255, 0, 255, 0, 0, 255, 255, ]); }); @@ -33,18 +22,7 @@ describe("Core/GeometryAttribute", function () { return new GeometryAttribute({ componentsPerAttribute: 4, values: new Uint8Array([ - 255, - 0, - 0, - 255, - 0, - 255, - 0, - 255, - 0, - 0, - 255, - 255, + 255, 0, 0, 255, 0, 255, 0, 255, 0, 0, 255, 255, ]), }); }).toThrowDeveloperError(); @@ -55,18 +33,7 @@ describe("Core/GeometryAttribute", function () { return new GeometryAttribute({ componentDatatype: ComponentDatatype.UNSIGNED_BYTE, values: new Uint8Array([ - 255, - 0, - 0, - 255, - 0, - 255, - 0, - 255, - 0, - 0, - 255, - 255, + 255, 0, 0, 255, 0, 255, 0, 255, 0, 0, 255, 255, ]), }); }).toThrowDeveloperError(); @@ -78,18 +45,7 @@ describe("Core/GeometryAttribute", function () { componentDatatype: ComponentDatatype.UNSIGNED_BYTE, componentsPerAttribute: 7, values: new Uint8Array([ - 255, - 0, - 0, - 255, - 0, - 255, - 0, - 255, - 0, - 0, - 255, - 255, + 255, 0, 0, 255, 0, 255, 0, 255, 0, 0, 255, 255, ]), }); }).toThrowDeveloperError(); diff --git a/packages/engine/Specs/Core/GeometryInstanceSpec.js b/packages/engine/Specs/Core/GeometryInstanceSpec.js index a6ea60e5be1d..7efb5bd1da72 100644 --- a/packages/engine/Specs/Core/GeometryInstanceSpec.js +++ b/packages/engine/Specs/Core/GeometryInstanceSpec.js @@ -18,15 +18,7 @@ describe("Core/GeometryInstance", function () { componentDatatype: ComponentDatatype.DOUBLE, componentsPerAttribute: 3, values: new Float64Array([ - 0.0, - 0.0, - 0.0, - 1.0, - 0.0, - 0.0, - 0.0, - 1.0, - 0.0, + 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, ]), }), }, @@ -37,7 +29,7 @@ describe("Core/GeometryInstance", function () { const modelMatrix = Matrix4.multiplyByTranslation( Matrix4.IDENTITY, new Cartesian3(0.0, 0.0, 9000000.0), - new Matrix4() + new Matrix4(), ); const attributes = { color: new GeometryInstanceAttribute({ diff --git a/packages/engine/Specs/Core/GeometryPipelineSpec.js b/packages/engine/Specs/Core/GeometryPipelineSpec.js index 4cba2dd3c472..3d1843964c56 100644 --- a/packages/engine/Specs/Core/GeometryPipelineSpec.js +++ b/packages/engine/Specs/Core/GeometryPipelineSpec.js @@ -29,7 +29,7 @@ describe("Core/GeometryPipeline", function () { attributes: {}, indices: [0, 1, 2, 3, 4, 5], primitiveType: PrimitiveType.TRIANGLES, - }) + }), ); expect(geometry.primitiveType).toEqual(PrimitiveType.LINES); @@ -58,7 +58,7 @@ describe("Core/GeometryPipeline", function () { attributes: {}, indices: [0, 1, 2, 3], primitiveType: PrimitiveType.TRIANGLE_FAN, - }) + }), ); expect(geometry.primitiveType).toEqual(PrimitiveType.LINES); @@ -87,7 +87,7 @@ describe("Core/GeometryPipeline", function () { attributes: {}, indices: [0, 1, 2, 3], primitiveType: PrimitiveType.TRIANGLE_STRIP, - }) + }), ); expect(geometry.primitiveType).toEqual(PrimitiveType.LINES); @@ -123,7 +123,7 @@ describe("Core/GeometryPipeline", function () { attributes: {}, indices: [], primitiveType: PrimitiveType.POINTS, - }) + }), ); }).toThrowDeveloperError(); }); @@ -148,27 +148,11 @@ describe("Core/GeometryPipeline", function () { const lines = GeometryPipeline.createLineSegmentsForVectors( geometry, "normal", - 1.0 + 1.0, ); const linePositions = [ - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 1.0, - 1.0, - 0.0, - 0.0, - 1.0, - 0.0, - 1.0, - 0.0, - 1.0, - 0.0, - 0.0, - 1.0, - 1.0, + 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 0.0, 0.0, 1.0, 0.0, 1.0, 0.0, 1.0, 0.0, + 0.0, 1.0, 1.0, ]; expect(lines.attributes).toBeDefined(); @@ -177,7 +161,7 @@ describe("Core/GeometryPipeline", function () { expect(lines.primitiveType).toEqual(PrimitiveType.LINES); expect(lines.boundingSphere.center).toEqual(geometry.boundingSphere.center); expect(lines.boundingSphere.radius).toEqual( - geometry.boundingSphere.radius + 1.0 + geometry.boundingSphere.radius + 1.0, ); }); @@ -260,24 +244,8 @@ describe("Core/GeometryPipeline", function () { componentDatatype: ComponentDatatype.FLOAT, componentsPerAttribute: 3, values: [ - 0.0, - 1.0, - 2.0, - 3.0, - 4.0, - 5.0, - 6.0, - 7.0, - 8.0, - 9.0, - 10.0, - 11.0, - 12.0, - 13.0, - 14.0, - 15.0, - 16.0, - 17.0, + 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, + 13.0, 14.0, 15.0, 16.0, 17.0, ], }), }, @@ -339,24 +307,8 @@ describe("Core/GeometryPipeline", function () { componentDatatype: ComponentDatatype.FLOAT, componentsPerAttribute: 3, values: [ - 0.0, - 1.0, - 2.0, - 3.0, - 4.0, - 5.0, - 6.0, - 7.0, - 8.0, - 9.0, - 10.0, - 11.0, - 12.0, - 13.0, - 14.0, - 15.0, - 16.0, - 17.0, + 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, + 13.0, 14.0, 15.0, 16.0, 17.0, ], }), }, @@ -466,7 +418,7 @@ describe("Core/GeometryPipeline", function () { expect(geometries.length).toEqual(1); expect(geometries[0].attributes.time.componentDatatype).toEqual( - ComponentDatatype.FLOAT + ComponentDatatype.FLOAT, ); expect(geometries[0].attributes.time.componentsPerAttribute).toEqual(1); expect(geometries[0].attributes.time.values).toEqual([0, sixtyFourK]); @@ -506,7 +458,7 @@ describe("Core/GeometryPipeline", function () { expect(geometries.length).toEqual(2); expect(geometries[0].attributes.position.values.length).toEqual( - positions.length - 6 + positions.length - 6, ); // Two vertices are not copied (0, 1) expect(geometries[0].indices.length).toEqual(indices.length - 3); // One triangle is not copied (0, 1, 2) @@ -545,7 +497,7 @@ describe("Core/GeometryPipeline", function () { expect(geometries.length).toEqual(2); expect(geometries[0].attributes.position.values.length).toEqual( - positions.length - 12 + positions.length - 12, ); // Four vertices are not copied expect(geometries[0].indices.length).toEqual(indices.length - 4); // Two lines are not copied @@ -580,7 +532,7 @@ describe("Core/GeometryPipeline", function () { expect(geometries.length).toEqual(2); expect(geometries[0].attributes.position.values.length).toEqual( - positions.length - 6 + positions.length - 6, ); // Two vertices are not copied expect(geometries[0].indices.length).toEqual(indices.length - 2); // Two points are not copied @@ -651,16 +603,16 @@ describe("Core/GeometryPipeline", function () { geometry, "position", "position3D", - "position2D" + "position2D", ); const ellipsoid = Ellipsoid.WGS84; const projection = new GeographicProjection(); const projectedP1 = projection.project( - ellipsoid.cartesianToCartographic(p1) + ellipsoid.cartesianToCartographic(p1), ); const projectedP2 = projection.project( - ellipsoid.cartesianToCartographic(p2) + ellipsoid.cartesianToCartographic(p2), ); expect(geometry.attributes.position2D.values[0]).toEqual(projectedP1.x); @@ -696,7 +648,7 @@ describe("Core/GeometryPipeline", function () { }), }, primitiveType: PrimitiveType.POINTS, - }) + }), ); }).toThrowDeveloperError(); }); @@ -714,7 +666,7 @@ describe("Core/GeometryPipeline", function () { }, primitiveType: PrimitiveType.POINTS, }), - "position" + "position", ); }).toThrowDeveloperError(); }); @@ -733,7 +685,7 @@ describe("Core/GeometryPipeline", function () { primitiveType: PrimitiveType.POINTS, }), "position", - "position3D" + "position3D", ); }).toThrowDeveloperError(); }); @@ -753,7 +705,7 @@ describe("Core/GeometryPipeline", function () { }), "position", "position3D", - "position2D" + "position2D", ); }).toThrowDeveloperError(); }); @@ -773,7 +725,7 @@ describe("Core/GeometryPipeline", function () { geometry, "position", "position3D", - "position2D" + "position2D", ); }).toThrowDeveloperError(); }); @@ -792,7 +744,7 @@ describe("Core/GeometryPipeline", function () { geometry, "position", "position3D", - "position2D" + "position2D", ); }).toThrowDeveloperError(); }); @@ -815,7 +767,7 @@ describe("Core/GeometryPipeline", function () { geometry, "position", "positionHigh", - "positionLow" + "positionLow", ); expect(geometry.attributes.positionHigh).toBeDefined(); @@ -847,7 +799,7 @@ describe("Core/GeometryPipeline", function () { }), }, primitiveType: PrimitiveType.POINTS, - }) + }), ); }).toThrowDeveloperError(); }); @@ -865,7 +817,7 @@ describe("Core/GeometryPipeline", function () { }, primitiveType: PrimitiveType.POINTS, }), - "position" + "position", ); }).toThrowDeveloperError(); }); @@ -884,7 +836,7 @@ describe("Core/GeometryPipeline", function () { primitiveType: PrimitiveType.POINTS, }), "position", - "positionHigh" + "positionHigh", ); }).toThrowDeveloperError(); }); @@ -904,7 +856,7 @@ describe("Core/GeometryPipeline", function () { }), "position", "positionHigh", - "positionLow" + "positionLow", ); }).toThrowDeveloperError(); }); @@ -924,7 +876,7 @@ describe("Core/GeometryPipeline", function () { geometry, "position", "positionHigh", - "positionLow" + "positionLow", ); }).toThrowDeveloperError(); }); @@ -964,7 +916,7 @@ describe("Core/GeometryPipeline", function () { 0.0, 0.0, 0.0, - 1.0 + 1.0, ), }); @@ -973,13 +925,13 @@ describe("Core/GeometryPipeline", function () { const transformedNormals = [1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0]; expect(transformed.geometry.attributes.position.values).toEqual( - transformedPositions + transformedPositions, ); expect(transformed.geometry.attributes.normal.values).toEqual( - transformedNormals + transformedNormals, ); expect(transformed.geometry.boundingSphere).toEqual( - new BoundingSphere(new Cartesian3(0.0, 0.5, 0.5), 1.0) + new BoundingSphere(new Cartesian3(0.0, 0.5, 0.5), 1.0), ); expect(transformed.modelMatrix).toEqual(Matrix4.IDENTITY); }); @@ -1011,13 +963,13 @@ describe("Core/GeometryPipeline", function () { const transformedNormals = [0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0]; expect(transformed.geometry.attributes.position.values).toEqual( - transformedPositions + transformedPositions, ); expect(transformed.geometry.attributes.normal.values).toEqual( - transformedNormals + transformedNormals, ); expect(transformed.geometry.boundingSphere).toEqual( - new BoundingSphere(new Cartesian3(0.5, 1.0, 0.0), 4.0) + new BoundingSphere(new Cartesian3(0.5, 1.0, 0.0), 4.0), ); expect(transformed.modelMatrix).toEqual(Matrix4.IDENTITY); }); @@ -1049,13 +1001,13 @@ describe("Core/GeometryPipeline", function () { const transformedNormals = [0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0]; expect(transformed.geometry.attributes.position.values).toEqual( - transformedPositions + transformedPositions, ); expect(transformed.geometry.attributes.normal.values).toEqual( - transformedNormals + transformedNormals, ); expect(transformed.geometry.boundingSphere).toEqual( - new BoundingSphere(new Cartesian3(0.5, 0.5, 0.0), 1.0) + new BoundingSphere(new Cartesian3(0.5, 0.5, 0.0), 1.0), ); expect(transformed.modelMatrix).toEqual(Matrix4.IDENTITY); }); @@ -1124,7 +1076,7 @@ describe("Core/GeometryPipeline", function () { }), }, primitiveType: PrimitiveType.POINTS, - }) + }), ); }); @@ -1172,30 +1124,14 @@ describe("Core/GeometryPipeline", function () { componentDatatype: ComponentDatatype.FLOAT, componentsPerAttribute: 3, values: new Float32Array([ - 0.0, - 0.0, - 0.0, - 1.0, - 1.0, - 1.0, - 2.0, - 2.0, - 2.0, - 3.0, - 3.0, - 3.0, - 4.0, - 4.0, - 4.0, - 5.0, - 5.0, - 5.0, + 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 2.0, 2.0, 2.0, 3.0, 3.0, 3.0, 4.0, + 4.0, 4.0, 5.0, 5.0, 5.0, ]), }), }, indices: new Uint16Array([0, 1, 2, 3, 4, 5]), primitiveType: PrimitiveType.TRIANGLES, - }) + }), ); }); @@ -1206,37 +1142,23 @@ describe("Core/GeometryPipeline", function () { geometry: PolygonGeometry.createGeometry( PolygonGeometry.fromPositions({ positions: Cartesian3.fromDegreesArray([ - 179.0, - 1.0, - 179.0, - -1.0, - -179.0, - -1.0, - -179.0, - 1.0, + 179.0, 1.0, 179.0, -1.0, -179.0, -1.0, -179.0, 1.0, ]), vertexFormat: VertexFormat.POSITION_ONLY, granularity: 2.0 * CesiumMath.RADIANS_PER_DEGREE, - }) + }), ), - }) + }), ), new GeometryInstance({ geometry: PolygonGeometry.createGeometry( PolygonGeometry.fromPositions({ positions: Cartesian3.fromDegreesArray([ - -1.0, - 1.0, - -1.0, - -1.0, - 1.0, - -1.0, - 1.0, - 1.0, + -1.0, 1.0, -1.0, -1.0, 1.0, -1.0, 1.0, 1.0, ]), vertexFormat: VertexFormat.POSITION_ONLY, granularity: 2.0 * CesiumMath.RADIANS_PER_DEGREE, - }) + }), ), }), ]; @@ -1281,7 +1203,7 @@ describe("Core/GeometryPipeline", function () { ])[0]; const expected = BoundingSphere.union( instance.geometry.boundingSphere, - anotherInstance.geometry.boundingSphere + anotherInstance.geometry.boundingSphere, ); expect(combined.boundingSphere).toEqual(expected); }); @@ -1483,15 +1405,7 @@ describe("Core/GeometryPipeline", function () { expect(geometry.attributes.normal.values.length).toEqual(3 * 3); expect(geometry.attributes.normal.values).toEqual([ - 0, - 0, - 1, - 0, - 0, - 1, - 0, - 0, - 1, + 0, 0, 1, 0, 0, 1, 0, 0, 1, ]); }); @@ -1517,21 +1431,21 @@ describe("Core/GeometryPipeline", function () { expect(Cartesian3.fromArray(normals, 0)).toEqualEpsilon( a, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(Cartesian3.fromArray(normals, 3)).toEqualEpsilon( Cartesian3.UNIT_Z, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(Cartesian3.fromArray(normals, 6)).toEqualEpsilon( Cartesian3.UNIT_Z, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); a = Cartesian3.normalize(new Cartesian3(1, 0, 1), new Cartesian3()); expect(Cartesian3.fromArray(normals, 9)).toEqualEpsilon( a, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); }); @@ -1540,27 +1454,7 @@ describe("Core/GeometryPipeline", function () { attributes: { position: new GeometryAttribute({ values: [ - 0, - 0, - 0, - 1, - 0, - 0, - 1, - 0, - 1, - 0, - 0, - 1, - 0, - 1, - 1, - 0, - 1, - 0, - 1, - 1, - 0, + 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, ], componentsPerAttribute: 3, componentDatatype: ComponentDatatype.FLOAT, @@ -1578,40 +1472,40 @@ describe("Core/GeometryPipeline", function () { let a = Cartesian3.normalize(new Cartesian3(-1, -1, -1), new Cartesian3()); expect(Cartesian3.fromArray(normals, 0)).toEqualEpsilon( a, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); a = Cartesian3.normalize(new Cartesian3(0, -1, -1), new Cartesian3()); expect(Cartesian3.fromArray(normals, 3)).toEqualEpsilon( a, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(Cartesian3.fromArray(normals, 6)).toEqualEpsilon( Cartesian3.negate(Cartesian3.UNIT_Y, new Cartesian3()), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); a = Cartesian3.normalize(new Cartesian3(-1, -1, 0), new Cartesian3()); expect(Cartesian3.fromArray(normals, 9)).toEqualEpsilon( a, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(Cartesian3.fromArray(normals, 12)).toEqualEpsilon( Cartesian3.negate(Cartesian3.UNIT_X, new Cartesian3()), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); a = Cartesian3.normalize(new Cartesian3(-1, 0, -1), new Cartesian3()); expect(Cartesian3.fromArray(normals, 15)).toEqualEpsilon( a, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(Cartesian3.fromArray(normals, 18)).toEqualEpsilon( Cartesian3.negate(Cartesian3.UNIT_Z, new Cartesian3()), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); }); @@ -1656,15 +1550,15 @@ describe("Core/GeometryPipeline", function () { expect(Cartesian3.fromArray(normals, 0)).toEqualEpsilon( a, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(Cartesian3.fromArray(normals, 3)).toEqualEpsilon( a, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(Cartesian3.fromArray(normals, 6)).toEqualEpsilon( a, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); }); @@ -1848,26 +1742,10 @@ describe("Core/GeometryPipeline", function () { geometry = GeometryPipeline.computeTangentAndBitangent(geometry); expect(geometry.attributes.tangent.values).toEqual([ - 1, - 0, - 0, - 1, - 0, - 0, - 1, - 0, - 0, + 1, 0, 0, 1, 0, 0, 1, 0, 0, ]); expect(geometry.attributes.bitangent.values).toEqual([ - 0, - 1, - 0, - 0, - 1, - 0, - 0, - 1, - 0, + 0, 1, 0, 0, 1, 0, 0, 1, 0, ]); }); @@ -1893,37 +1771,17 @@ describe("Core/GeometryPipeline", function () { geometry = GeometryPipeline.computeTangentAndBitangent(geometry); expect(geometry.attributes.tangent.values).toEqualEpsilon( [ - 0.7071067811865475, - 0, - 0.7071067811865475, - 0, - 1, - 0, - 0, - 1, - 0, - -0.5773502691896258, - 0.5773502691896258, - 0.5773502691896258, + 0.7071067811865475, 0, 0.7071067811865475, 0, 1, 0, 0, 1, 0, + -0.5773502691896258, 0.5773502691896258, 0.5773502691896258, ], - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(geometry.attributes.bitangent.values).toEqualEpsilon( [ - 0, - 1, - 0, - -1, - 0, - 0, - -1, - 0, - 0, - -0.4082482904638631, - -0.8164965809277261, + 0, 1, 0, -1, 0, 0, -1, 0, 0, -0.4082482904638631, -0.8164965809277261, 0.4082482904638631, ], - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); }); @@ -1937,7 +1795,7 @@ describe("Core/GeometryPipeline", function () { }), maximum: new Cartesian3(250000.0, 250000.0, 250000.0), minimum: new Cartesian3(-250000.0, -250000.0, -250000.0), - }) + }), ); geometry = GeometryPipeline.computeTangentAndBitangent(geometry); const actualTangents = geometry.attributes.tangent.values; @@ -1948,7 +1806,7 @@ describe("Core/GeometryPipeline", function () { vertexFormat: VertexFormat.ALL, maximum: new Cartesian3(250000.0, 250000.0, 250000.0), minimum: new Cartesian3(-250000.0, -250000.0, -250000.0), - }) + }), ); const expectedTangents = expectedGeometry.attributes.tangent.values; const expectedBitangents = expectedGeometry.attributes.bitangent.values; @@ -1981,7 +1839,7 @@ describe("Core/GeometryPipeline", function () { }), maximum: new Cartesian3(250000.0, 250000.0, 250000.0), minimum: new Cartesian3(-250000.0, -250000.0, -250000.0), - }) + }), ); expect(geometry.attributes.normal).not.toBeDefined(); geometry = GeometryPipeline.compressVertices(geometry); @@ -1997,7 +1855,7 @@ describe("Core/GeometryPipeline", function () { }), maximum: new Cartesian3(250000.0, 250000.0, 250000.0), minimum: new Cartesian3(-250000.0, -250000.0, -250000.0), - }) + }), ); expect(geometry.attributes.normal).toBeDefined(); const originalNormals = geometry.attributes.normal.values.slice(); @@ -2011,10 +1869,10 @@ describe("Core/GeometryPipeline", function () { for (let i = 0; i < normals.length; ++i) { expect( - AttributeCompression.octDecodeFloat(normals[i], new Cartesian3()) + AttributeCompression.octDecodeFloat(normals[i], new Cartesian3()), ).toEqualEpsilon( Cartesian3.fromArray(originalNormals, i * 3), - CesiumMath.EPSILON2 + CesiumMath.EPSILON2, ); } }); @@ -2028,7 +1886,7 @@ describe("Core/GeometryPipeline", function () { }), maximum: new Cartesian3(250000.0, 250000.0, 250000.0), minimum: new Cartesian3(-250000.0, -250000.0, -250000.0), - }) + }), ); expect(geometry.attributes.st).toBeDefined(); const originalST = geometry.attributes.st.values.slice(); @@ -2048,7 +1906,7 @@ describe("Core/GeometryPipeline", function () { const texCoord = new Cartesian2(stx, sty); expect(texCoord).toEqualEpsilon( Cartesian2.fromArray(originalST, i * 2, new Cartesian2()), - CesiumMath.EPSILON2 + CesiumMath.EPSILON2, ); } }); @@ -2063,7 +1921,7 @@ describe("Core/GeometryPipeline", function () { }), maximum: new Cartesian3(250000.0, 250000.0, 250000.0), minimum: new Cartesian3(-250000.0, -250000.0, -250000.0), - }) + }), ); expect(geometry.attributes.normal).toBeDefined(); expect(geometry.attributes.st).toBeDefined(); @@ -2083,17 +1941,17 @@ describe("Core/GeometryPipeline", function () { expect( AttributeCompression.decompressTextureCoordinates( stNormal[i], - new Cartesian2() - ) + new Cartesian2(), + ), ).toEqualEpsilon( Cartesian2.fromArray(originalST, i, new Cartesian2()), - CesiumMath.EPSILON2 + CesiumMath.EPSILON2, ); expect( - AttributeCompression.octDecodeFloat(stNormal[i + 1], new Cartesian3()) + AttributeCompression.octDecodeFloat(stNormal[i + 1], new Cartesian3()), ).toEqualEpsilon( Cartesian3.fromArray(originalNormals, (i / 2) * 3), - CesiumMath.EPSILON2 + CesiumMath.EPSILON2, ); } }); @@ -2109,7 +1967,7 @@ describe("Core/GeometryPipeline", function () { }), maximum: new Cartesian3(250000.0, 250000.0, 250000.0), minimum: new Cartesian3(-250000.0, -250000.0, -250000.0), - }) + }), ); expect(geometry.attributes.normal).toBeDefined(); expect(geometry.attributes.tangent).toBeDefined(); @@ -2135,21 +1993,21 @@ describe("Core/GeometryPipeline", function () { const compressed = Cartesian2.fromArray( compressedNormals, i, - new Cartesian2() + new Cartesian2(), ); AttributeCompression.octUnpack(compressed, normal, tangent, bitangent); expect(normal).toEqualEpsilon( Cartesian3.fromArray(originalNormals, (i / 2) * 3), - CesiumMath.EPSILON2 + CesiumMath.EPSILON2, ); expect(tangent).toEqualEpsilon( Cartesian3.fromArray(originalTangents, (i / 2) * 3), - CesiumMath.EPSILON2 + CesiumMath.EPSILON2, ); expect(bitangent).toEqualEpsilon( Cartesian3.fromArray(originalBitangents, (i / 2) * 3), - CesiumMath.EPSILON2 + CesiumMath.EPSILON2, ); } }); @@ -2159,18 +2017,11 @@ describe("Core/GeometryPipeline", function () { geometry: PolygonGeometry.createGeometry( PolygonGeometry.fromPositions({ positions: Cartesian3.fromDegreesArray([ - -1.0, - 1.0, - -1.0, - -1.0, - 1.0, - -1.0, - 1.0, - 1.0, + -1.0, 1.0, -1.0, -1.0, 1.0, -1.0, 1.0, 1.0, ]), vertexFormat: VertexFormat.POSITION_ONLY, granularity: 2.0 * CesiumMath.RADIANS_PER_DEGREE, - }) + }), ), }); @@ -2260,14 +2111,14 @@ describe("Core/GeometryPipeline", function () { index = i * 2; expect(newVec2s[index]).toBe(0); expect(newVec2s[index + 1] === 255 || newVec2s[index + 1] === 127).toBe( - true + true, ); index = i * 3; expect(newVec3s[index]).toBe(0); expect(newVec3s[index + 1]).toBe(0); expect(newVec3s[index + 2] === 255 || newVec3s[index + 2] === 127).toBe( - true + true, ); index = i * 4; @@ -2275,7 +2126,7 @@ describe("Core/GeometryPipeline", function () { expect(newVec4s[index + 1]).toBe(0); expect(newVec4s[index + 2]).toBe(0); expect(newVec4s[index + 3] === 255 || newVec4s[index + 3] === 127).toBe( - true + true, ); } @@ -2298,14 +2149,14 @@ describe("Core/GeometryPipeline", function () { index = i * 2; expect(newVec2s[index]).toBe(0); expect(newVec2s[index + 1] === 0 || newVec2s[index + 1] === 127).toBe( - true + true, ); index = i * 3; expect(newVec3s[index]).toBe(0); expect(newVec3s[index + 1]).toBe(0); expect(newVec3s[index + 2] === 0 || newVec3s[index + 2] === 127).toBe( - true + true, ); index = i * 4; @@ -2313,7 +2164,7 @@ describe("Core/GeometryPipeline", function () { expect(newVec4s[index + 1]).toBe(0); expect(newVec4s[index + 2]).toBe(0); expect(newVec4s[index + 3] === 0 || newVec4s[index + 3] === 127).toBe( - true + true, ); } }); @@ -2326,24 +2177,8 @@ describe("Core/GeometryPipeline", function () { componentDatatype: ComponentDatatype.DOUBLE, componentsPerAttribute: 3, values: new Float64Array([ - 0.0, - 1.0, - 2.0, - 3.0, - 4.0, - 5.0, - 6.0, - 7.0, - 8.0, - 8.0, - 7.0, - 6.0, - 5.0, - 4.0, - 3.0, - 2.0, - 1.0, - 0.0, + 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 8.0, 7.0, 6.0, 5.0, + 4.0, 3.0, 2.0, 1.0, 0.0, ]), }), }, @@ -2363,24 +2198,8 @@ describe("Core/GeometryPipeline", function () { componentDatatype: ComponentDatatype.DOUBLE, componentsPerAttribute: 3, values: new Float64Array([ - 0.0, - 1.0, - 2.0, - 3.0, - 4.0, - 5.0, - 6.0, - 7.0, - 8.0, - 8.0, - 7.0, - 6.0, - 5.0, - 4.0, - 3.0, - 2.0, - 1.0, - 0.0, + 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 8.0, 7.0, 6.0, 5.0, + 4.0, 3.0, 2.0, 1.0, 0.0, ]), }), }, @@ -2420,23 +2239,8 @@ describe("Core/GeometryPipeline", function () { componentDatatype: ComponentDatatype.DOUBLE, componentsPerAttribute: 3, values: new Float64Array([ - 0.0, - 1.0, - 2.0, - 3.0, - 4.0, - 5.0, - 6.0, - 7.0, - 8.0, - 8.0, - 7.0, - 6.0, - 5.0, - 4.0, - 3.0, - 2.0, - 1.0, + 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 8.0, 7.0, 6.0, 5.0, + 4.0, 3.0, 2.0, 1.0, ]), }), }, @@ -2457,18 +2261,7 @@ describe("Core/GeometryPipeline", function () { componentDatatype: ComponentDatatype.DOUBLE, componentsPerAttribute: 3, values: new Float64Array([ - 0.0, - 1.0, - 2.0, - 3.0, - 4.0, - 5.0, - 6.0, - 7.0, - 8.0, - 8.0, - 7.0, - 6.0, + 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 8.0, 7.0, 6.0, ]), }), }, @@ -2508,24 +2301,8 @@ describe("Core/GeometryPipeline", function () { componentDatatype: ComponentDatatype.DOUBLE, componentsPerAttribute: 3, values: new Float64Array([ - 0.0, - 1.0, - 2.0, - 3.0, - 4.0, - 5.0, - 6.0, - 7.0, - 8.0, - 8.0, - 7.0, - 6.0, - 5.0, - 4.0, - 3.0, - 2.0, - 1.0, - 0.0, + 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 8.0, 7.0, 6.0, 5.0, + 4.0, 3.0, 2.0, 1.0, 0.0, ]), }), }, @@ -2536,18 +2313,7 @@ describe("Core/GeometryPipeline", function () { GeometryPipeline.splitLongitude(instance); expect(instance.geometry.primitiveType).toEqual(PrimitiveType.TRIANGLES); expect(instance.geometry.indices).toEqual([ - 0, - 1, - 2, - 0, - 2, - 3, - 3, - 2, - 4, - 3, - 4, - 5, + 0, 1, 2, 0, 2, 3, 3, 2, 4, 3, 4, 5, ]); }); @@ -2578,18 +2344,7 @@ describe("Core/GeometryPipeline", function () { componentDatatype: ComponentDatatype.DOUBLE, componentsPerAttribute: 3, values: new Float64Array([ - 0.0, - 1.0, - 2.0, - 3.0, - 4.0, - 5.0, - 6.0, - 7.0, - 8.0, - 8.0, - 7.0, - 6.0, + 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 8.0, 7.0, 6.0, ]), }), }, @@ -2609,18 +2364,7 @@ describe("Core/GeometryPipeline", function () { componentDatatype: ComponentDatatype.DOUBLE, componentsPerAttribute: 3, values: new Float64Array([ - 0.0, - 1.0, - 2.0, - 3.0, - 4.0, - 5.0, - 6.0, - 7.0, - 8.0, - 8.0, - 7.0, - 6.0, + 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 8.0, 7.0, 6.0, ]), }), }, @@ -2660,15 +2404,7 @@ describe("Core/GeometryPipeline", function () { componentDatatype: ComponentDatatype.DOUBLE, componentsPerAttribute: 3, values: new Float64Array([ - 0.0, - 1.0, - 2.0, - 3.0, - 4.0, - 5.0, - 6.0, - 7.0, - 8.0, + 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, ]), }), }, @@ -2689,18 +2425,7 @@ describe("Core/GeometryPipeline", function () { componentDatatype: ComponentDatatype.DOUBLE, componentsPerAttribute: 3, values: new Float64Array([ - 0.0, - 1.0, - 2.0, - 3.0, - 4.0, - 5.0, - 6.0, - 7.0, - 8.0, - 8.0, - 7.0, - 6.0, + 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 8.0, 7.0, 6.0, ]), }), }, @@ -2740,18 +2465,7 @@ describe("Core/GeometryPipeline", function () { componentDatatype: ComponentDatatype.DOUBLE, componentsPerAttribute: 3, values: new Float64Array([ - 0.0, - 1.0, - 2.0, - 3.0, - 4.0, - 5.0, - 6.0, - 7.0, - 8.0, - 8.0, - 7.0, - 6.0, + 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 8.0, 7.0, 6.0, ]), }), }, @@ -2791,15 +2505,7 @@ describe("Core/GeometryPipeline", function () { componentDatatype: ComponentDatatype.DOUBLE, componentsPerAttribute: 3, values: new Float64Array([ - -1.0, - -1.0, - 0.0, - -1.0, - 1.0, - 2.0, - -1.0, - 2.0, - 2.0, + -1.0, -1.0, 0.0, -1.0, 1.0, 2.0, -1.0, 2.0, 2.0, ]), }), }, @@ -2815,7 +2521,7 @@ describe("Core/GeometryPipeline", function () { expect(instance.westHemisphereGeometry.indices.length).toEqual(3); expect(instance.westHemisphereGeometry.attributes.position).toBeDefined(); expect( - instance.westHemisphereGeometry.attributes.position.values.length + instance.westHemisphereGeometry.attributes.position.values.length, ).toEqual(3 * 3); expect(instance.eastHemisphereGeometry).toBeDefined(); @@ -2823,7 +2529,7 @@ describe("Core/GeometryPipeline", function () { expect(instance.eastHemisphereGeometry.indices.length).toEqual(6); expect(instance.eastHemisphereGeometry.attributes.position).toBeDefined(); expect( - instance.eastHemisphereGeometry.attributes.position.values.length + instance.eastHemisphereGeometry.attributes.position.values.length, ).toEqual(5 * 3); }); @@ -2835,15 +2541,7 @@ describe("Core/GeometryPipeline", function () { componentDatatype: ComponentDatatype.DOUBLE, componentsPerAttribute: 3, values: new Float64Array([ - -1.0, - 1.0, - 2.0, - -1.0, - -1.0, - 0.0, - -1.0, - 2.0, - 2.0, + -1.0, 1.0, 2.0, -1.0, -1.0, 0.0, -1.0, 2.0, 2.0, ]), }), }, @@ -2859,7 +2557,7 @@ describe("Core/GeometryPipeline", function () { expect(instance.westHemisphereGeometry.indices.length).toEqual(3); expect(instance.westHemisphereGeometry.attributes.position).toBeDefined(); expect( - instance.westHemisphereGeometry.attributes.position.values.length + instance.westHemisphereGeometry.attributes.position.values.length, ).toEqual(3 * 3); expect(instance.eastHemisphereGeometry).toBeDefined(); @@ -2867,7 +2565,7 @@ describe("Core/GeometryPipeline", function () { expect(instance.eastHemisphereGeometry.indices.length).toEqual(6); expect(instance.eastHemisphereGeometry.attributes.position).toBeDefined(); expect( - instance.eastHemisphereGeometry.attributes.position.values.length + instance.eastHemisphereGeometry.attributes.position.values.length, ).toEqual(5 * 3); }); @@ -2879,15 +2577,7 @@ describe("Core/GeometryPipeline", function () { componentDatatype: ComponentDatatype.DOUBLE, componentsPerAttribute: 3, values: new Float64Array([ - -1.0, - 1.0, - 2.0, - -1.0, - 2.0, - 2.0, - -1.0, - -1.0, - 0.0, + -1.0, 1.0, 2.0, -1.0, 2.0, 2.0, -1.0, -1.0, 0.0, ]), }), }, @@ -2903,7 +2593,7 @@ describe("Core/GeometryPipeline", function () { expect(instance.westHemisphereGeometry.indices.length).toEqual(3); expect(instance.westHemisphereGeometry.attributes.position).toBeDefined(); expect( - instance.westHemisphereGeometry.attributes.position.values.length + instance.westHemisphereGeometry.attributes.position.values.length, ).toEqual(3 * 3); expect(instance.eastHemisphereGeometry).toBeDefined(); @@ -2911,7 +2601,7 @@ describe("Core/GeometryPipeline", function () { expect(instance.eastHemisphereGeometry.indices.length).toEqual(6); expect(instance.eastHemisphereGeometry.attributes.position).toBeDefined(); expect( - instance.eastHemisphereGeometry.attributes.position.values.length + instance.eastHemisphereGeometry.attributes.position.values.length, ).toEqual(5 * 3); }); @@ -2923,15 +2613,7 @@ describe("Core/GeometryPipeline", function () { componentDatatype: ComponentDatatype.DOUBLE, componentsPerAttribute: 3, values: new Float64Array([ - -1.0, - 1.0, - 0.0, - -1.0, - -1.0, - 0.0, - -2.0, - -1.0, - 0.0, + -1.0, 1.0, 0.0, -1.0, -1.0, 0.0, -2.0, -1.0, 0.0, ]), }), }, @@ -2947,7 +2629,7 @@ describe("Core/GeometryPipeline", function () { expect(instance.westHemisphereGeometry.indices.length).toEqual(6); expect(instance.westHemisphereGeometry.attributes.position).toBeDefined(); expect( - instance.westHemisphereGeometry.attributes.position.values.length + instance.westHemisphereGeometry.attributes.position.values.length, ).toEqual(5 * 3); expect(instance.eastHemisphereGeometry).toBeDefined(); @@ -2955,7 +2637,7 @@ describe("Core/GeometryPipeline", function () { expect(instance.eastHemisphereGeometry.indices.length).toEqual(3); expect(instance.eastHemisphereGeometry.attributes.position).toBeDefined(); expect( - instance.eastHemisphereGeometry.attributes.position.values.length + instance.eastHemisphereGeometry.attributes.position.values.length, ).toEqual(3 * 3); }); @@ -2967,15 +2649,7 @@ describe("Core/GeometryPipeline", function () { componentDatatype: ComponentDatatype.DOUBLE, componentsPerAttribute: 3, values: new Float64Array([ - -2.0, - -1.0, - 0.0, - -1.0, - 1.0, - 0.0, - -1.0, - -1.0, - 0.0, + -2.0, -1.0, 0.0, -1.0, 1.0, 0.0, -1.0, -1.0, 0.0, ]), }), }, @@ -2991,7 +2665,7 @@ describe("Core/GeometryPipeline", function () { expect(instance.westHemisphereGeometry.indices.length).toEqual(6); expect(instance.westHemisphereGeometry.attributes.position).toBeDefined(); expect( - instance.westHemisphereGeometry.attributes.position.values.length + instance.westHemisphereGeometry.attributes.position.values.length, ).toEqual(5 * 3); expect(instance.eastHemisphereGeometry).toBeDefined(); @@ -2999,7 +2673,7 @@ describe("Core/GeometryPipeline", function () { expect(instance.eastHemisphereGeometry.indices.length).toEqual(3); expect(instance.eastHemisphereGeometry.attributes.position).toBeDefined(); expect( - instance.eastHemisphereGeometry.attributes.position.values.length + instance.eastHemisphereGeometry.attributes.position.values.length, ).toEqual(3 * 3); }); @@ -3011,15 +2685,7 @@ describe("Core/GeometryPipeline", function () { componentDatatype: ComponentDatatype.DOUBLE, componentsPerAttribute: 3, values: new Float64Array([ - -1.0, - -1.0, - 0.0, - -2.0, - -1.0, - 0.0, - -1.0, - 1.0, - 0.0, + -1.0, -1.0, 0.0, -2.0, -1.0, 0.0, -1.0, 1.0, 0.0, ]), }), }, @@ -3035,7 +2701,7 @@ describe("Core/GeometryPipeline", function () { expect(instance.westHemisphereGeometry.indices.length).toEqual(6); expect(instance.westHemisphereGeometry.attributes.position).toBeDefined(); expect( - instance.westHemisphereGeometry.attributes.position.values.length + instance.westHemisphereGeometry.attributes.position.values.length, ).toEqual(5 * 3); expect(instance.eastHemisphereGeometry).toBeDefined(); @@ -3043,7 +2709,7 @@ describe("Core/GeometryPipeline", function () { expect(instance.eastHemisphereGeometry.indices.length).toEqual(3); expect(instance.eastHemisphereGeometry.attributes.position).toBeDefined(); expect( - instance.eastHemisphereGeometry.attributes.position.values.length + instance.eastHemisphereGeometry.attributes.position.values.length, ).toEqual(3 * 3); }); @@ -3099,15 +2765,7 @@ describe("Core/GeometryPipeline", function () { componentDatatype: ComponentDatatype.DOUBLE, componentsPerAttribute: 3, values: new Float64Array([ - -1.0, - -1.0, - 1.0, - -1.0, - -2.0, - 1.0, - -1.0, - -2.0, - 2.0, + -1.0, -1.0, 1.0, -1.0, -2.0, 1.0, -1.0, -2.0, 2.0, ]), }), }, @@ -3122,15 +2780,7 @@ describe("Core/GeometryPipeline", function () { const positions = geometry.attributes.position.values; expect(positions).toEqual([ - -1.0, - -1.0, - 1.0, - -1.0, - -2.0, - 1.0, - -1.0, - -2.0, - 2.0, + -1.0, -1.0, 1.0, -1.0, -2.0, 1.0, -1.0, -2.0, 2.0, ]); expect(positions.length).toEqual(3 * 3); }); @@ -3143,15 +2793,7 @@ describe("Core/GeometryPipeline", function () { componentDatatype: ComponentDatatype.DOUBLE, componentsPerAttribute: 3, values: new Float64Array([ - -1.0, - 1.0, - 1.0, - -1.0, - 2.0, - 1.0, - -1.0, - 2.0, - 2.0, + -1.0, 1.0, 1.0, -1.0, 2.0, 1.0, -1.0, 2.0, 2.0, ]), }), }, @@ -3177,15 +2819,7 @@ describe("Core/GeometryPipeline", function () { componentDatatype: ComponentDatatype.DOUBLE, componentsPerAttribute: 3, values: new Float64Array([ - 1.0, - 1.0, - 1.0, - 1.0, - 2.0, - 1.0, - 1.0, - 2.0, - 2.0, + 1.0, 1.0, 1.0, 1.0, 2.0, 1.0, 1.0, 2.0, 2.0, ]), }), }, @@ -3211,60 +2845,28 @@ describe("Core/GeometryPipeline", function () { componentDatatype: ComponentDatatype.DOUBLE, componentsPerAttribute: 3, values: new Float64Array([ - -2.0, - -1.0, - 0.0, - -3.0, - 1.0, - 0.0, - -1.0, - 1.0, - 0.0, + -2.0, -1.0, 0.0, -3.0, 1.0, 0.0, -1.0, 1.0, 0.0, ]), }), normal: new GeometryAttribute({ componentDatatype: ComponentDatatype.FLOAT, componentsPerAttribute: 3, values: new Float32Array([ - 0.0, - 0.0, - 1.0, - 0.0, - 0.0, - 1.0, - 0.0, - 0.0, - 1.0, + 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, ]), }), tangent: new GeometryAttribute({ componentDatatype: ComponentDatatype.FLOAT, componentsPerAttribute: 3, values: new Float32Array([ - -1.0, - 0.0, - 0.0, - -1.0, - 0.0, - 0.0, - -1.0, - 0.0, - 0.0, + -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, ]), }), bitangent: new GeometryAttribute({ componentDatatype: ComponentDatatype.FLOAT, componentsPerAttribute: 3, values: new Float32Array([ - 0.0, - -1.0, - 0.0, - 0.0, - -1.0, - 0.0, - 0.0, - -1.0, - 0.0, + 0.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0, ]), }), st: new GeometryAttribute({ @@ -3285,23 +2887,23 @@ describe("Core/GeometryPipeline", function () { expect(instance.westHemisphereGeometry.indices.length).toEqual(3); expect(instance.westHemisphereGeometry.attributes.position).toBeDefined(); expect( - instance.westHemisphereGeometry.attributes.position.values.length + instance.westHemisphereGeometry.attributes.position.values.length, ).toEqual(3 * 3); expect(instance.westHemisphereGeometry.attributes.normal).toBeDefined(); expect( - instance.westHemisphereGeometry.attributes.normal.values.length + instance.westHemisphereGeometry.attributes.normal.values.length, ).toEqual(3 * 3); expect(instance.westHemisphereGeometry.attributes.bitangent).toBeDefined(); expect( - instance.westHemisphereGeometry.attributes.bitangent.values.length + instance.westHemisphereGeometry.attributes.bitangent.values.length, ).toEqual(3 * 3); expect(instance.westHemisphereGeometry.attributes.tangent).toBeDefined(); expect( - instance.westHemisphereGeometry.attributes.tangent.values.length + instance.westHemisphereGeometry.attributes.tangent.values.length, ).toEqual(3 * 3); expect(instance.westHemisphereGeometry.attributes.st).toBeDefined(); expect(instance.westHemisphereGeometry.attributes.st.values.length).toEqual( - 3 * 2 + 3 * 2, ); expect(instance.eastHemisphereGeometry).toBeDefined(); @@ -3309,23 +2911,23 @@ describe("Core/GeometryPipeline", function () { expect(instance.eastHemisphereGeometry.indices.length).toEqual(6); expect(instance.eastHemisphereGeometry.attributes.position).toBeDefined(); expect( - instance.eastHemisphereGeometry.attributes.position.values.length + instance.eastHemisphereGeometry.attributes.position.values.length, ).toEqual(5 * 3); expect(instance.eastHemisphereGeometry.attributes.normal).toBeDefined(); expect( - instance.eastHemisphereGeometry.attributes.normal.values.length + instance.eastHemisphereGeometry.attributes.normal.values.length, ).toEqual(5 * 3); expect(instance.eastHemisphereGeometry.attributes.bitangent).toBeDefined(); expect( - instance.eastHemisphereGeometry.attributes.bitangent.values.length + instance.eastHemisphereGeometry.attributes.bitangent.values.length, ).toEqual(5 * 3); expect(instance.eastHemisphereGeometry.attributes.tangent).toBeDefined(); expect( - instance.eastHemisphereGeometry.attributes.tangent.values.length + instance.eastHemisphereGeometry.attributes.tangent.values.length, ).toEqual(5 * 3); expect(instance.eastHemisphereGeometry.attributes.st).toBeDefined(); expect(instance.eastHemisphereGeometry.attributes.st.values.length).toEqual( - 5 * 2 + 5 * 2, ); }); @@ -3351,7 +2953,7 @@ describe("Core/GeometryPipeline", function () { expect(instance.westHemisphereGeometry.indices.length).toEqual(2); expect(instance.westHemisphereGeometry.attributes.position).toBeDefined(); expect( - instance.westHemisphereGeometry.attributes.position.values.length + instance.westHemisphereGeometry.attributes.position.values.length, ).toEqual(2 * 3); expect(instance.eastHemisphereGeometry).toBeDefined(); @@ -3359,7 +2961,7 @@ describe("Core/GeometryPipeline", function () { expect(instance.eastHemisphereGeometry.indices.length).toEqual(2); expect(instance.eastHemisphereGeometry.attributes.position).toBeDefined(); expect( - instance.eastHemisphereGeometry.attributes.position.values.length + instance.eastHemisphereGeometry.attributes.position.values.length, ).toEqual(2 * 3); }); @@ -3440,17 +3042,7 @@ describe("Core/GeometryPipeline", function () { componentDatatype: ComponentDatatype.DOUBLE, componentsPerAttribute: 3, values: new Float64Array([ - -1.0, - -1.0, - 0.0, - -1.0, - -1.0, - 0.0, - -1.0, - 1.0, - 2.0, - -1.0, - 1.0, + -1.0, -1.0, 0.0, -1.0, -1.0, 0.0, -1.0, 1.0, 2.0, -1.0, 1.0, 2.0, ]), }), @@ -3458,35 +3050,14 @@ describe("Core/GeometryPipeline", function () { componentDatatype: ComponentDatatype.DOUBLE, componentsPerAttribute: 3, values: new Float64Array([ - -1.0, - 1.0, - 2.0, - -1.0, - 1.0, - 2.0, - -1.0, - 2.0, - 3.0, - -1.0, - 2.0, - 3.0, + -1.0, 1.0, 2.0, -1.0, 1.0, 2.0, -1.0, 2.0, 3.0, -1.0, 2.0, 3.0, ]), }), prevPosition: new GeometryAttribute({ componentDatatype: ComponentDatatype.DOUBLE, componentsPerAttribute: 3, values: new Float64Array([ - -1.0, - -2.0, - -1.0, - -1.0, - -2.0, - -1.0, - -1.0, - -1.0, - 0.0, - -1.0, - -1.0, + -1.0, -2.0, -1.0, -1.0, -2.0, -1.0, -1.0, -1.0, 0.0, -1.0, -1.0, 0.0, ]), }), @@ -3494,14 +3065,7 @@ describe("Core/GeometryPipeline", function () { componentDatatype: ComponentDatatype.FLOAT, componentsPerAttribute: 2, values: new Float32Array([ - -1.0, - 5.0, - 1.0, - 5.0, - -1.0, - -5.0, - 1.0, - -5.0, + -1.0, 5.0, 1.0, 5.0, -1.0, -5.0, 1.0, -5.0, ]), }), }, @@ -3518,25 +3082,25 @@ describe("Core/GeometryPipeline", function () { expect(instance.westHemisphereGeometry.indices.length).toEqual(6); expect(instance.westHemisphereGeometry.attributes.position).toBeDefined(); expect( - instance.westHemisphereGeometry.attributes.position.values.length + instance.westHemisphereGeometry.attributes.position.values.length, ).toEqual(4 * 3); expect( - instance.westHemisphereGeometry.attributes.nextPosition + instance.westHemisphereGeometry.attributes.nextPosition, ).toBeDefined(); expect( - instance.westHemisphereGeometry.attributes.nextPosition.values.length + instance.westHemisphereGeometry.attributes.nextPosition.values.length, ).toEqual(4 * 3); expect( - instance.westHemisphereGeometry.attributes.prevPosition + instance.westHemisphereGeometry.attributes.prevPosition, ).toBeDefined(); expect( - instance.westHemisphereGeometry.attributes.prevPosition.values.length + instance.westHemisphereGeometry.attributes.prevPosition.values.length, ).toEqual(4 * 3); expect( - instance.westHemisphereGeometry.attributes.expandAndWidth + instance.westHemisphereGeometry.attributes.expandAndWidth, ).toBeDefined(); expect( - instance.westHemisphereGeometry.attributes.expandAndWidth.values.length + instance.westHemisphereGeometry.attributes.expandAndWidth.values.length, ).toEqual(4 * 2); expect(instance.eastHemisphereGeometry).toBeDefined(); @@ -3544,25 +3108,25 @@ describe("Core/GeometryPipeline", function () { expect(instance.eastHemisphereGeometry.indices.length).toEqual(6); expect(instance.eastHemisphereGeometry.attributes.position).toBeDefined(); expect( - instance.eastHemisphereGeometry.attributes.position.values.length + instance.eastHemisphereGeometry.attributes.position.values.length, ).toEqual(4 * 3); expect( - instance.eastHemisphereGeometry.attributes.nextPosition + instance.eastHemisphereGeometry.attributes.nextPosition, ).toBeDefined(); expect( - instance.eastHemisphereGeometry.attributes.nextPosition.values.length + instance.eastHemisphereGeometry.attributes.nextPosition.values.length, ).toEqual(4 * 3); expect( - instance.eastHemisphereGeometry.attributes.prevPosition + instance.eastHemisphereGeometry.attributes.prevPosition, ).toBeDefined(); expect( - instance.eastHemisphereGeometry.attributes.prevPosition.values.length + instance.eastHemisphereGeometry.attributes.prevPosition.values.length, ).toEqual(4 * 3); expect( - instance.eastHemisphereGeometry.attributes.expandAndWidth + instance.eastHemisphereGeometry.attributes.expandAndWidth, ).toBeDefined(); expect( - instance.eastHemisphereGeometry.attributes.expandAndWidth.values.length + instance.eastHemisphereGeometry.attributes.expandAndWidth.values.length, ).toEqual(4 * 2); }); @@ -3574,53 +3138,21 @@ describe("Core/GeometryPipeline", function () { componentDatatype: ComponentDatatype.DOUBLE, componentsPerAttribute: 3, values: new Float64Array([ - -1.0, - 0.0, - 0.0, - -1.0, - 0.0, - 0.0, - -1.0, - 1.0, - 2.0, - -1.0, - 1.0, - 2.0, + -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 1.0, 2.0, -1.0, 1.0, 2.0, ]), }), nextPosition: new GeometryAttribute({ componentDatatype: ComponentDatatype.DOUBLE, componentsPerAttribute: 3, values: new Float64Array([ - -1.0, - 1.0, - 2.0, - -1.0, - 1.0, - 2.0, - -1.0, - 2.0, - 3.0, - -1.0, - 2.0, - 3.0, + -1.0, 1.0, 2.0, -1.0, 1.0, 2.0, -1.0, 2.0, 3.0, -1.0, 2.0, 3.0, ]), }), prevPosition: new GeometryAttribute({ componentDatatype: ComponentDatatype.DOUBLE, componentsPerAttribute: 3, values: new Float64Array([ - -1.0, - -2.0, - -1.0, - -1.0, - -2.0, - -1.0, - -1.0, - 0.0, - 0.0, - -1.0, - 0.0, + -1.0, -2.0, -1.0, -1.0, -2.0, -1.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, ]), }), @@ -3628,14 +3160,7 @@ describe("Core/GeometryPipeline", function () { componentDatatype: ComponentDatatype.FLOAT, componentsPerAttribute: 2, values: new Float32Array([ - -1.0, - 5.0, - 1.0, - 5.0, - -1.0, - -5.0, - 1.0, - -5.0, + -1.0, 5.0, 1.0, 5.0, -1.0, -5.0, 1.0, -5.0, ]), }), }, @@ -3682,18 +3207,7 @@ describe("Core/GeometryPipeline", function () { 0.0, ]); expect(nextPositions).toEqual([ - -1.0, - 1.0, - 2.0, - -1.0, - 1.0, - 2.0, - -1.0, - 2.0, - 3.0, - -1.0, - 2.0, - 3.0, + -1.0, 1.0, 2.0, -1.0, 1.0, 2.0, -1.0, 2.0, 3.0, -1.0, 2.0, 3.0, ]); }); @@ -3705,17 +3219,7 @@ describe("Core/GeometryPipeline", function () { componentDatatype: ComponentDatatype.DOUBLE, componentsPerAttribute: 3, values: new Float64Array([ - -1.0, - 0.0, - 0.0, - -1.0, - 0.0, - 0.0, - -1.0, - -1.0, - 2.0, - -1.0, - -1.0, + -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0, -1.0, 2.0, -1.0, -1.0, 2.0, ]), }), @@ -3723,17 +3227,7 @@ describe("Core/GeometryPipeline", function () { componentDatatype: ComponentDatatype.DOUBLE, componentsPerAttribute: 3, values: new Float64Array([ - -1.0, - -1.0, - 2.0, - -1.0, - -1.0, - 2.0, - -1.0, - -2.0, - 0.0, - -1.0, - -2.0, + -1.0, -1.0, 2.0, -1.0, -1.0, 2.0, -1.0, -2.0, 0.0, -1.0, -2.0, 0.0, ]), }), @@ -3741,17 +3235,7 @@ describe("Core/GeometryPipeline", function () { componentDatatype: ComponentDatatype.DOUBLE, componentsPerAttribute: 3, values: new Float64Array([ - -1.0, - 1.0, - -1.0, - -1.0, - 1.0, - -1.0, - -1.0, - 0.0, - 0.0, - -1.0, - 0.0, + -1.0, 1.0, -1.0, -1.0, 1.0, -1.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, ]), }), @@ -3759,14 +3243,7 @@ describe("Core/GeometryPipeline", function () { componentDatatype: ComponentDatatype.FLOAT, componentsPerAttribute: 2, values: new Float32Array([ - -1.0, - 5.0, - 1.0, - 5.0, - -1.0, - -5.0, - 1.0, - -5.0, + -1.0, 5.0, 1.0, 5.0, -1.0, -5.0, 1.0, -5.0, ]), }), }, @@ -3813,18 +3290,7 @@ describe("Core/GeometryPipeline", function () { 0.0, ]); expect(nextPositions).toEqual([ - -1.0, - -1.0, - 2.0, - -1.0, - -1.0, - 2.0, - -1.0, - -2.0, - 0.0, - -1.0, - -2.0, - 0.0, + -1.0, -1.0, 2.0, -1.0, -1.0, 2.0, -1.0, -2.0, 0.0, -1.0, -2.0, 0.0, ]); }); @@ -3836,35 +3302,14 @@ describe("Core/GeometryPipeline", function () { componentDatatype: ComponentDatatype.DOUBLE, componentsPerAttribute: 3, values: new Float64Array([ - -1.0, - 1.0, - 2.0, - -1.0, - 1.0, - 2.0, - -1.0, - 0.0, - 0.0, - -1.0, - 0.0, - 0.0, + -1.0, 1.0, 2.0, -1.0, 1.0, 2.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, ]), }), nextPosition: new GeometryAttribute({ componentDatatype: ComponentDatatype.DOUBLE, componentsPerAttribute: 3, values: new Float64Array([ - -1.0, - 0.0, - 0.0, - -1.0, - 0.0, - 0.0, - -1.0, - -1.0, - 2.0, - -1.0, - -1.0, + -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0, -1.0, 2.0, -1.0, -1.0, 2.0, ]), }), @@ -3872,32 +3317,14 @@ describe("Core/GeometryPipeline", function () { componentDatatype: ComponentDatatype.DOUBLE, componentsPerAttribute: 3, values: new Float64Array([ - -2.0, - 2.0, - 2.0, - -1.0, - 2.0, - 2.0, - -1.0, - 1.0, - 2.0, - -1.0, - 1.0, - 2.0, + -2.0, 2.0, 2.0, -1.0, 2.0, 2.0, -1.0, 1.0, 2.0, -1.0, 1.0, 2.0, ]), }), expandAndWidth: new GeometryAttribute({ componentDatatype: ComponentDatatype.FLOAT, componentsPerAttribute: 2, values: new Float32Array([ - -1.0, - 5.0, - 1.0, - 5.0, - -1.0, - -5.0, - 1.0, - -5.0, + -1.0, 5.0, 1.0, 5.0, -1.0, -5.0, 1.0, -5.0, ]), }), }, @@ -3944,18 +3371,7 @@ describe("Core/GeometryPipeline", function () { 0.0, ]); expect(prevPositions).toEqual([ - -2.0, - 2.0, - 2.0, - -1.0, - 2.0, - 2.0, - -1.0, - 1.0, - 2.0, - -1.0, - 1.0, - 2.0, + -2.0, 2.0, 2.0, -1.0, 2.0, 2.0, -1.0, 1.0, 2.0, -1.0, 1.0, 2.0, ]); }); @@ -3967,17 +3383,7 @@ describe("Core/GeometryPipeline", function () { componentDatatype: ComponentDatatype.DOUBLE, componentsPerAttribute: 3, values: new Float64Array([ - -1.0, - -1.0, - 2.0, - -1.0, - -1.0, - 2.0, - -1.0, - 0.0, - 0.0, - -1.0, - 0.0, + -1.0, -1.0, 2.0, -1.0, -1.0, 2.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, ]), }), @@ -3985,35 +3391,14 @@ describe("Core/GeometryPipeline", function () { componentDatatype: ComponentDatatype.DOUBLE, componentsPerAttribute: 3, values: new Float64Array([ - -1.0, - 0.0, - 0.0, - -1.0, - 0.0, - 0.0, - -1.0, - 1.0, - 2.0, - -1.0, - 1.0, - 2.0, + -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 1.0, 2.0, -1.0, 1.0, 2.0, ]), }), prevPosition: new GeometryAttribute({ componentDatatype: ComponentDatatype.DOUBLE, componentsPerAttribute: 3, values: new Float64Array([ - -2.0, - -2.0, - 2.0, - -1.0, - -2.0, - 2.0, - -1.0, - -1.0, - 2.0, - -1.0, - -1.0, + -2.0, -2.0, 2.0, -1.0, -2.0, 2.0, -1.0, -1.0, 2.0, -1.0, -1.0, 2.0, ]), }), @@ -4021,14 +3406,7 @@ describe("Core/GeometryPipeline", function () { componentDatatype: ComponentDatatype.FLOAT, componentsPerAttribute: 2, values: new Float32Array([ - -1.0, - 5.0, - 1.0, - 5.0, - -1.0, - -5.0, - 1.0, - -5.0, + -1.0, 5.0, 1.0, 5.0, -1.0, -5.0, 1.0, -5.0, ]), }), }, @@ -4075,18 +3453,7 @@ describe("Core/GeometryPipeline", function () { 0.0, ]); expect(prevPositions).toEqual([ - -2.0, - -2.0, - 2.0, - -1.0, - -2.0, - 2.0, - -1.0, - -1.0, - 2.0, - -1.0, - -1.0, - 2.0, + -2.0, -2.0, 2.0, -1.0, -2.0, 2.0, -1.0, -1.0, 2.0, -1.0, -1.0, 2.0, ]); }); @@ -4098,53 +3465,21 @@ describe("Core/GeometryPipeline", function () { componentDatatype: ComponentDatatype.DOUBLE, componentsPerAttribute: 3, values: new Float64Array([ - -1.0, - 1.0, - 0.0, - -1.0, - 1.0, - 0.0, - -1.0, - 1.0, - 2.0, - -1.0, - 1.0, - 2.0, + -1.0, 1.0, 0.0, -1.0, 1.0, 0.0, -1.0, 1.0, 2.0, -1.0, 1.0, 2.0, ]), }), nextPosition: new GeometryAttribute({ componentDatatype: ComponentDatatype.DOUBLE, componentsPerAttribute: 3, values: new Float64Array([ - -1.0, - 1.0, - 2.0, - -1.0, - 1.0, - 2.0, - -1.0, - 2.0, - 3.0, - -1.0, - 2.0, - 3.0, + -1.0, 1.0, 2.0, -1.0, 1.0, 2.0, -1.0, 2.0, 3.0, -1.0, 2.0, 3.0, ]), }), prevPosition: new GeometryAttribute({ componentDatatype: ComponentDatatype.DOUBLE, componentsPerAttribute: 3, values: new Float64Array([ - -1.0, - -2.0, - -1.0, - -1.0, - -2.0, - -1.0, - -1.0, - 0.0, - 0.0, - -1.0, - 0.0, + -1.0, -2.0, -1.0, -1.0, -2.0, -1.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, ]), }), @@ -4152,14 +3487,7 @@ describe("Core/GeometryPipeline", function () { componentDatatype: ComponentDatatype.FLOAT, componentsPerAttribute: 2, values: new Float32Array([ - -1.0, - 5.0, - 1.0, - 5.0, - -1.0, - -5.0, - 1.0, - -5.0, + -1.0, 5.0, 1.0, 5.0, -1.0, -5.0, 1.0, -5.0, ]), }), }, @@ -4175,18 +3503,7 @@ describe("Core/GeometryPipeline", function () { const positions = geometry.attributes.position.values; expect(positions).toEqual([ - -1.0, - 1.0, - 0.0, - -1.0, - 1.0, - 0.0, - -1.0, - 1.0, - 2.0, - -1.0, - 1.0, - 2.0, + -1.0, 1.0, 0.0, -1.0, 1.0, 0.0, -1.0, 1.0, 2.0, -1.0, 1.0, 2.0, ]); }); }); diff --git a/packages/engine/Specs/Core/GeometrySpec.js b/packages/engine/Specs/Core/GeometrySpec.js index c07668cb52ea..2388cf5fb021 100644 --- a/packages/engine/Specs/Core/GeometrySpec.js +++ b/packages/engine/Specs/Core/GeometrySpec.js @@ -23,7 +23,7 @@ describe("Core/Geometry", function () { const indices = new Uint16Array([0, 1, 2]); const boundingSphere = new BoundingSphere( new Cartesian3(0.5, 0.5, 0.0), - 1.0 + 1.0, ); const geometry = new Geometry({ @@ -65,7 +65,7 @@ describe("Core/Geometry", function () { const indices = new Uint16Array([0, 1, 2]); const boundingSphere = new BoundingSphere( new Cartesian3(0.5, 0.5, 0.0), - 1.0 + 1.0, ); const geometry = new Geometry({ @@ -94,7 +94,7 @@ describe("Core/Geometry", function () { const indices = new Uint16Array([0, 1, 2]); const boundingSphere = new BoundingSphere( new Cartesian3(0.5, 0.5, 0.0), - 1.0 + 1.0, ); const geometry = new Geometry({ @@ -117,50 +117,40 @@ describe("Core/Geometry", function () { it("computes textureCoordinateRotationPoints for collections of points", function () { const positions = Cartesian3.fromDegreesArrayHeights([ - -10.0, - -10.0, - 0, - -10.0, - 10.0, - 0, - 10.0, - -10.0, - 0, - 10.0, - 10.0, - 0, + -10.0, -10.0, 0, -10.0, 10.0, 0, 10.0, -10.0, 0, 10.0, 10.0, 0, ]); const boundingRectangle = Rectangle.fromCartesianArray(positions); - const textureCoordinateRotationPoints = Geometry._textureCoordinateRotationPoints( - positions, - 0.0, - Ellipsoid.WGS84, - boundingRectangle - ); + const textureCoordinateRotationPoints = + Geometry._textureCoordinateRotationPoints( + positions, + 0.0, + Ellipsoid.WGS84, + boundingRectangle, + ); expect(textureCoordinateRotationPoints.length).toEqual(6); expect(textureCoordinateRotationPoints[0]).toEqualEpsilon( 0, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(textureCoordinateRotationPoints[1]).toEqualEpsilon( 0, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(textureCoordinateRotationPoints[2]).toEqualEpsilon( 0, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(textureCoordinateRotationPoints[3]).toEqualEpsilon( 1, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(textureCoordinateRotationPoints[4]).toEqualEpsilon( 1, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(textureCoordinateRotationPoints[5]).toEqualEpsilon( 0, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); }); }); diff --git a/packages/engine/Specs/Core/GoogleEarthEnterpriseMetadataSpec.js b/packages/engine/Specs/Core/GoogleEarthEnterpriseMetadataSpec.js index c0b0996b981b..ba106dde17b9 100644 --- a/packages/engine/Specs/Core/GoogleEarthEnterpriseMetadataSpec.js +++ b/packages/engine/Specs/Core/GoogleEarthEnterpriseMetadataSpec.js @@ -13,13 +13,13 @@ describe("Core/GoogleEarthEnterpriseMetadata", function () { it("tileXYToQuadKey", function () { expect(GoogleEarthEnterpriseMetadata.tileXYToQuadKey(1, 0, 0)).toEqual("2"); expect(GoogleEarthEnterpriseMetadata.tileXYToQuadKey(1, 2, 1)).toEqual( - "02" + "02", ); expect(GoogleEarthEnterpriseMetadata.tileXYToQuadKey(3, 5, 2)).toEqual( - "021" + "021", ); expect(GoogleEarthEnterpriseMetadata.tileXYToQuadKey(4, 7, 2)).toEqual( - "100" + "100", ); }); @@ -113,42 +113,41 @@ describe("Core/GoogleEarthEnterpriseMetadata", function () { let index = 0; spyOn( GoogleEarthEnterpriseMetadata.prototype, - "getQuadTreePacket" + "getQuadTreePacket", ).and.callFake(function (quadKey, version, request) { quadKey = defaultValue(quadKey, "") + index.toString(); this._tileInfo[quadKey] = new GoogleEarthEnterpriseTileInformation( 0xff, 1, 1, - 1 + 1, ); index = (index + 1) % 4; return Promise.resolve(); }); - const metadata = await GoogleEarthEnterpriseMetadata.fromUrl( - "http://test.server" - ); + const metadata = + await GoogleEarthEnterpriseMetadata.fromUrl("http://test.server"); const request = new Request({ throttle: true, }); const tileXY = GoogleEarthEnterpriseMetadata.quadKeyToTileXY(quad); await metadata.populateSubtree(tileXY.x, tileXY.y, tileXY.level, request); expect( - GoogleEarthEnterpriseMetadata.prototype.getQuadTreePacket.calls.count() + GoogleEarthEnterpriseMetadata.prototype.getQuadTreePacket.calls.count(), ).toEqual(4); expect( - GoogleEarthEnterpriseMetadata.prototype.getQuadTreePacket + GoogleEarthEnterpriseMetadata.prototype.getQuadTreePacket, ).toHaveBeenCalledWith("", 1); expect( - GoogleEarthEnterpriseMetadata.prototype.getQuadTreePacket + GoogleEarthEnterpriseMetadata.prototype.getQuadTreePacket, ).toHaveBeenCalledWith("0", 1, request); expect( - GoogleEarthEnterpriseMetadata.prototype.getQuadTreePacket + GoogleEarthEnterpriseMetadata.prototype.getQuadTreePacket, ).toHaveBeenCalledWith("01", 1, request); expect( - GoogleEarthEnterpriseMetadata.prototype.getQuadTreePacket + GoogleEarthEnterpriseMetadata.prototype.getQuadTreePacket, ).toHaveBeenCalledWith("012", 1, request); const tileInfo = metadata._tileInfo; @@ -162,32 +161,34 @@ describe("Core/GoogleEarthEnterpriseMetadata", function () { const baseurl = "http://fake.fake.invalid/"; let req = 0; - spyOn(Resource._Implementations, "loadWithXhr").and.callFake(function ( - url, - responseType, - method, - data, - headers, - deferred, - overrideMimeType - ) { - expect(responseType).toEqual("arraybuffer"); - if (req === 0) { - expect(url).toEqual(`${baseurl}dbRoot.v5?output=proto`); - deferred.reject(); // Reject dbRoot request and use defaults - } else { - expect(url).toEqual(`${baseurl}flatfile?q2-0-q.1`); - Resource._DefaultImplementations.loadWithXhr( - "Data/GoogleEarthEnterprise/gee.metadata", - responseType, - method, - data, - headers, - deferred - ); - } - ++req; - }); + spyOn(Resource._Implementations, "loadWithXhr").and.callFake( + function ( + url, + responseType, + method, + data, + headers, + deferred, + overrideMimeType, + ) { + expect(responseType).toEqual("arraybuffer"); + if (req === 0) { + expect(url).toEqual(`${baseurl}dbRoot.v5?output=proto`); + deferred.reject(); // Reject dbRoot request and use defaults + } else { + expect(url).toEqual(`${baseurl}flatfile?q2-0-q.1`); + Resource._DefaultImplementations.loadWithXhr( + "Data/GoogleEarthEnterprise/gee.metadata", + responseType, + method, + data, + headers, + deferred, + ); + } + ++req; + }, + ); const provider = await GoogleEarthEnterpriseMetadata.fromUrl(baseurl); @@ -215,32 +216,34 @@ describe("Core/GoogleEarthEnterpriseMetadata", function () { }); let req = 0; - spyOn(Resource._Implementations, "loadWithXhr").and.callFake(function ( - url, - responseType, - method, - data, - headers, - deferred, - overrideMimeType - ) { - expect(responseType).toEqual("arraybuffer"); - if (req === 0) { - expect(url).toEqual(`${baseurl}dbRoot.v5?output=proto`); - deferred.reject(); // Reject dbRoot request and use defaults - } else { - expect(url).toEqual(`${baseurl}flatfile?q2-0-q.1`); - Resource._DefaultImplementations.loadWithXhr( - "Data/GoogleEarthEnterprise/gee.metadata", - responseType, - method, - data, - headers, - deferred - ); - } - ++req; - }); + spyOn(Resource._Implementations, "loadWithXhr").and.callFake( + function ( + url, + responseType, + method, + data, + headers, + deferred, + overrideMimeType, + ) { + expect(responseType).toEqual("arraybuffer"); + if (req === 0) { + expect(url).toEqual(`${baseurl}dbRoot.v5?output=proto`); + deferred.reject(); // Reject dbRoot request and use defaults + } else { + expect(url).toEqual(`${baseurl}flatfile?q2-0-q.1`); + Resource._DefaultImplementations.loadWithXhr( + "Data/GoogleEarthEnterprise/gee.metadata", + responseType, + method, + data, + headers, + deferred, + ); + } + ++req; + }, + ); const metadata = await GoogleEarthEnterpriseMetadata.fromUrl(resource); @@ -264,10 +267,10 @@ describe("Core/GoogleEarthEnterpriseMetadata", function () { it("fromUrl rejects on error", async function () { const url = "host.invalid/"; await expectAsync( - GoogleEarthEnterpriseMetadata.fromUrl(url) + GoogleEarthEnterpriseMetadata.fromUrl(url), ).toBeRejectedWithError( RuntimeError, - new RegExp("Request has failed. Status Code: 404") + new RegExp("Request has failed. Status Code: 404"), ); }); }); diff --git a/packages/engine/Specs/Core/GoogleEarthEnterpriseTerrainDataSpec.js b/packages/engine/Specs/Core/GoogleEarthEnterpriseTerrainDataSpec.js index 25bc601ff706..6835b4ca3030 100644 --- a/packages/engine/Specs/Core/GoogleEarthEnterpriseTerrainDataSpec.js +++ b/packages/engine/Specs/Core/GoogleEarthEnterpriseTerrainDataSpec.js @@ -153,7 +153,7 @@ describe("Core/GoogleEarthEnterpriseTerrainData", function () { x: 0, y: 0, level: 0, - }) + }), ) .then(function () { const swPromise = data.upsample(tilingScheme, 0, 0, 0, 0, 0, 1); @@ -206,7 +206,7 @@ describe("Core/GoogleEarthEnterpriseTerrainData", function () { CesiumMath.equalsEpsilon( v, rectangle.south, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ) ) { ++south; @@ -214,7 +214,7 @@ describe("Core/GoogleEarthEnterpriseTerrainData", function () { CesiumMath.equalsEpsilon( v, rectangle.north, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ) ) { ++north; @@ -329,7 +329,7 @@ describe("Core/GoogleEarthEnterpriseTerrainData", function () { encoding.decodePosition(mesh.vertices, i, cartesian); wgs84.cartesianToCartographic(cartesian, cartographic); cartographic.longitude = CesiumMath.convertLongitudeRange( - cartographic.longitude + cartographic.longitude, ); expect(Rectangle.contains(rectangle, cartographic)).toBe(true); } else { @@ -396,7 +396,7 @@ describe("Core/GoogleEarthEnterpriseTerrainData", function () { it("clamps coordinates if given a position outside the mesh", function () { expect(mesh.interpolateHeight(rectangle, 0.0, 0.0)).toBe( - mesh.interpolateHeight(rectangle, rectangle.east, rectangle.south) + mesh.interpolateHeight(rectangle, rectangle.east, rectangle.south), ); }); diff --git a/packages/engine/Specs/Core/GoogleEarthEnterpriseTerrainProviderSpec.js b/packages/engine/Specs/Core/GoogleEarthEnterpriseTerrainProviderSpec.js index 8927fca15e42..57ccdbf5ae7a 100644 --- a/packages/engine/Specs/Core/GoogleEarthEnterpriseTerrainProviderSpec.js +++ b/packages/engine/Specs/Core/GoogleEarthEnterpriseTerrainProviderSpec.js @@ -20,7 +20,7 @@ describe("Core/GoogleEarthEnterpriseTerrainProvider", function () { function installMockGetQuadTreePacket() { spyOn( GoogleEarthEnterpriseMetadata.prototype, - "getQuadTreePacket" + "getQuadTreePacket", ).and.callFake(function (quadKey, version) { quadKey = defaultValue(quadKey, ""); let t = new GoogleEarthEnterpriseTileInformation(0xff, 1, 1, 1); @@ -47,9 +47,8 @@ describe("Core/GoogleEarthEnterpriseTerrainProvider", function () { async function waitForTile(level, x, y, f) { const metadata = await GoogleEarthEnterpriseMetadata.fromUrl("made/up/url"); - terrainProvider = GoogleEarthEnterpriseTerrainProvider.fromMetadata( - metadata - ); + terrainProvider = + GoogleEarthEnterpriseTerrainProvider.fromMetadata(metadata); return pollToPromise(function () { return terrainProvider.getTileDataAvailable(x, y, level); }).then(function () { @@ -78,14 +77,14 @@ describe("Core/GoogleEarthEnterpriseTerrainProvider", function () { it("conforms to TerrainProvider interface", function () { expect(GoogleEarthEnterpriseTerrainProvider).toConformToInterface( - TerrainProvider + TerrainProvider, ); }); it("fromMetadata throws without metadata", function () { installMockGetQuadTreePacket(); expect(() => - GoogleEarthEnterpriseTerrainProvider.fromMetadata() + GoogleEarthEnterpriseTerrainProvider.fromMetadata(), ).toThrowDeveloperError("metadata is required, actual value was undefined"); }); @@ -96,10 +95,10 @@ describe("Core/GoogleEarthEnterpriseTerrainProvider", function () { metadata.terrainPresent = false; expect(() => - GoogleEarthEnterpriseTerrainProvider.fromMetadata(metadata) + GoogleEarthEnterpriseTerrainProvider.fromMetadata(metadata), ).toThrowError( RuntimeError, - "The server made/up/url/ doesn't have terrain" + "The server made/up/url/ doesn't have terrain", ); }); @@ -107,9 +106,8 @@ describe("Core/GoogleEarthEnterpriseTerrainProvider", function () { installMockGetQuadTreePacket(); const metadata = await GoogleEarthEnterpriseMetadata.fromUrl("made/up/url"); - terrainProvider = GoogleEarthEnterpriseTerrainProvider.fromMetadata( - metadata - ); + terrainProvider = + GoogleEarthEnterpriseTerrainProvider.fromMetadata(metadata); expect(terrainProvider.tilingScheme).toBeInstanceOf(GeographicTilingScheme); }); @@ -123,7 +121,7 @@ describe("Core/GoogleEarthEnterpriseTerrainProvider", function () { metadata, { ellipsoid: ellipsoid, - } + }, ); expect(terrainProvider.tilingScheme.ellipsoid).toEqual(ellipsoid); @@ -133,9 +131,8 @@ describe("Core/GoogleEarthEnterpriseTerrainProvider", function () { installMockGetQuadTreePacket(); const metadata = await GoogleEarthEnterpriseMetadata.fromUrl("made/up/url"); - terrainProvider = GoogleEarthEnterpriseTerrainProvider.fromMetadata( - metadata - ); + terrainProvider = + GoogleEarthEnterpriseTerrainProvider.fromMetadata(metadata); expect(terrainProvider.errorEvent).toBeDefined(); expect(terrainProvider.errorEvent).toBe(terrainProvider.errorEvent); }); @@ -144,20 +141,19 @@ describe("Core/GoogleEarthEnterpriseTerrainProvider", function () { installMockGetQuadTreePacket(); const metadata = await GoogleEarthEnterpriseMetadata.fromUrl("made/up/url"); - terrainProvider = GoogleEarthEnterpriseTerrainProvider.fromMetadata( - metadata - ); + terrainProvider = + GoogleEarthEnterpriseTerrainProvider.fromMetadata(metadata); expect(terrainProvider.getLevelMaximumGeometricError(0)).toBeGreaterThan( - 0.0 + 0.0, ); expect(terrainProvider.getLevelMaximumGeometricError(0)).toEqualEpsilon( terrainProvider.getLevelMaximumGeometricError(1) * 2.0, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); expect(terrainProvider.getLevelMaximumGeometricError(1)).toEqualEpsilon( terrainProvider.getLevelMaximumGeometricError(2) * 2.0, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); }); @@ -165,9 +161,8 @@ describe("Core/GoogleEarthEnterpriseTerrainProvider", function () { installMockGetQuadTreePacket(); const metadata = await GoogleEarthEnterpriseMetadata.fromUrl("made/up/url"); - terrainProvider = GoogleEarthEnterpriseTerrainProvider.fromMetadata( - metadata - ); + terrainProvider = + GoogleEarthEnterpriseTerrainProvider.fromMetadata(metadata); expect(terrainProvider.credit).toBeUndefined(); }); @@ -180,7 +175,7 @@ describe("Core/GoogleEarthEnterpriseTerrainProvider", function () { metadata, { credit: "thanks to our awesome made up contributors!", - } + }, ); expect(terrainProvider.credit).toBeDefined(); @@ -190,9 +185,8 @@ describe("Core/GoogleEarthEnterpriseTerrainProvider", function () { installMockGetQuadTreePacket(); const metadata = await GoogleEarthEnterpriseMetadata.fromUrl("made/up/url"); - terrainProvider = GoogleEarthEnterpriseTerrainProvider.fromMetadata( - metadata - ); + terrainProvider = + GoogleEarthEnterpriseTerrainProvider.fromMetadata(metadata); expect(terrainProvider.hasWaterMask).toBe(false); }); @@ -201,9 +195,8 @@ describe("Core/GoogleEarthEnterpriseTerrainProvider", function () { installMockGetQuadTreePacket(); const metadata = await GoogleEarthEnterpriseMetadata.fromUrl("made/up/url"); - terrainProvider = GoogleEarthEnterpriseTerrainProvider.fromMetadata( - metadata - ); + terrainProvider = + GoogleEarthEnterpriseTerrainProvider.fromMetadata(metadata); expect(terrainProvider.hasVertexNormals).toBe(false); }); @@ -218,7 +211,7 @@ describe("Core/GoogleEarthEnterpriseTerrainProvider", function () { data, headers, deferred, - overrideMimeType + overrideMimeType, ) { Resource._DefaultImplementations.loadWithXhr( "Data/GoogleEarthEnterprise/gee.terrain", @@ -226,7 +219,7 @@ describe("Core/GoogleEarthEnterpriseTerrainProvider", function () { method, data, headers, - deferred + deferred, ); }; @@ -244,7 +237,7 @@ describe("Core/GoogleEarthEnterpriseTerrainProvider", function () { data, headers, deferred, - overrideMimeType + overrideMimeType, ) { Resource._DefaultImplementations.loadWithXhr( "Data/GoogleEarthEnterprise/gee.terrain", @@ -252,16 +245,14 @@ describe("Core/GoogleEarthEnterpriseTerrainProvider", function () { method, data, headers, - deferred + deferred, ); }; - const metadata = await GoogleEarthEnterpriseMetadata.fromUrl( - "made/up/url" - ); - terrainProvider = GoogleEarthEnterpriseTerrainProvider.fromMetadata( - metadata - ); + const metadata = + await GoogleEarthEnterpriseMetadata.fromUrl("made/up/url"); + terrainProvider = + GoogleEarthEnterpriseTerrainProvider.fromMetadata(metadata); await pollToPromise(function () { return terrainProvider.getTileDataAvailable(0, 0, 0); @@ -285,7 +276,7 @@ describe("Core/GoogleEarthEnterpriseTerrainProvider", function () { data, headers, deferred, - overrideMimeType + overrideMimeType, ) { if (url.indexOf("dbRoot.v5") !== -1) { return deferred.reject(); // Just reject dbRoot file and use defaults. @@ -299,7 +290,7 @@ describe("Core/GoogleEarthEnterpriseTerrainProvider", function () { method, data, headers, - deferred + deferred, ); } // Do nothing, so requests never complete @@ -307,9 +298,8 @@ describe("Core/GoogleEarthEnterpriseTerrainProvider", function () { }; const metadata = await GoogleEarthEnterpriseMetadata.fromUrl(baseUrl); - terrainProvider = GoogleEarthEnterpriseTerrainProvider.fromMetadata( - metadata - ); + terrainProvider = + GoogleEarthEnterpriseTerrainProvider.fromMetadata(metadata); const promises = []; return pollToPromise(function () { @@ -366,7 +356,7 @@ describe("Core/GoogleEarthEnterpriseTerrainProvider", function () { data, headers, deferred, - overrideMimeType + overrideMimeType, ) { Resource._DefaultImplementations.loadWithXhr( "Data/CesiumTerrainTileJson/tile.terrain", @@ -374,14 +364,13 @@ describe("Core/GoogleEarthEnterpriseTerrainProvider", function () { method, data, headers, - deferred + deferred, ); }; const metadata = await GoogleEarthEnterpriseMetadata.fromUrl(baseUrl); - terrainProvider = GoogleEarthEnterpriseTerrainProvider.fromMetadata( - metadata - ); + terrainProvider = + GoogleEarthEnterpriseTerrainProvider.fromMetadata(metadata); const tileInfo = terrainProvider._metadata._tileInfo; const info = diff --git a/packages/engine/Specs/Core/GroundPolylineGeometrySpec.js b/packages/engine/Specs/Core/GroundPolylineGeometrySpec.js index 84af45fa9cb9..6a6f842b7623 100644 --- a/packages/engine/Specs/Core/GroundPolylineGeometrySpec.js +++ b/packages/engine/Specs/Core/GroundPolylineGeometrySpec.js @@ -55,7 +55,7 @@ describe("Core/GroundPolylineGeometry", function () { }); const geometry = GroundPolylineGeometry.createGeometry( - groundPolylineGeometry + groundPolylineGeometry, ); expect(geometry.indices.length).toEqual(36); @@ -140,8 +140,8 @@ describe("Core/GroundPolylineGeometry", function () { Cartographic.equalsEpsilon( reconstructedCarto, startCartographic, - CesiumMath.EPSILON7 - ) + CesiumMath.EPSILON7, + ), ).toBe(true); const endPosition3D = new Cartesian3(); @@ -155,41 +155,41 @@ describe("Core/GroundPolylineGeometry", function () { Cartographic.equalsEpsilon( reconstructedCarto, endCartographic, - CesiumMath.EPSILON7 - ) + CesiumMath.EPSILON7, + ), ).toBe(true); const startNormal3D = Cartesian3.unpack( - startNormalAndForwardOffsetZ.values + startNormalAndForwardOffsetZ.values, ); expect( Cartesian3.equalsEpsilon( startNormal3D, new Cartesian3(0.0, 1.0, 0.0), - CesiumMath.EPSILON2 - ) + CesiumMath.EPSILON2, + ), ).toBe(true); const endNormal3D = Cartesian3.unpack( - endNormalAndTextureCoordinateNormalizationX.values + endNormalAndTextureCoordinateNormalizationX.values, ); expect( Cartesian3.equalsEpsilon( endNormal3D, new Cartesian3(0.0, -1.0, 0.0), - CesiumMath.EPSILON2 - ) + CesiumMath.EPSILON2, + ), ).toBe(true); const rightNormal3D = Cartesian3.unpack( - rightNormalAndTextureCoordinateNormalizationY.values + rightNormalAndTextureCoordinateNormalizationY.values, ); expect( Cartesian3.equalsEpsilon( rightNormal3D, new Cartesian3(0.0, 0.0, -1.0), - CesiumMath.EPSILON2 - ) + CesiumMath.EPSILON2, + ), ).toBe(true); let texcoordNormalizationX = @@ -208,8 +208,8 @@ describe("Core/GroundPolylineGeometry", function () { Cartographic.equalsEpsilon( reconstructedCarto, startCartographic, - CesiumMath.EPSILON7 - ) + CesiumMath.EPSILON7, + ), ).toBe(true); const endPosition2D = new Cartesian3(); @@ -221,8 +221,8 @@ describe("Core/GroundPolylineGeometry", function () { Cartographic.equalsEpsilon( reconstructedCarto, endCartographic, - CesiumMath.EPSILON7 - ) + CesiumMath.EPSILON7, + ), ).toBe(true); const startNormal2D = new Cartesian3(); @@ -232,8 +232,8 @@ describe("Core/GroundPolylineGeometry", function () { Cartesian3.equalsEpsilon( startNormal2D, new Cartesian3(1.0, 0.0, 0.0), - CesiumMath.EPSILON2 - ) + CesiumMath.EPSILON2, + ), ).toBe(true); const endNormal2D = new Cartesian3(); @@ -243,8 +243,8 @@ describe("Core/GroundPolylineGeometry", function () { Cartesian3.equalsEpsilon( endNormal2D, new Cartesian3(-1.0, 0.0, 0.0), - CesiumMath.EPSILON2 - ) + CesiumMath.EPSILON2, + ), ).toBe(true); const rightNormal2D = new Cartesian3(); @@ -254,8 +254,8 @@ describe("Core/GroundPolylineGeometry", function () { Cartesian3.equalsEpsilon( rightNormal2D, new Cartesian3(0.0, -1.0, 0.0), - CesiumMath.EPSILON2 - ) + CesiumMath.EPSILON2, + ), ).toBe(true); texcoordNormalizationX = texcoordNormalization2D.values[0]; @@ -278,17 +278,17 @@ describe("Core/GroundPolylineGeometry", function () { groundPolylineGeometry._scene3DOnly = true; const geometry = GroundPolylineGeometry.createGeometry( - groundPolylineGeometry + groundPolylineGeometry, ); expect(geometry.attributes.startHiAndForwardOffsetX).toBeDefined(); expect(geometry.attributes.startLoAndForwardOffsetY).toBeDefined(); expect(geometry.attributes.startNormalAndForwardOffsetZ).toBeDefined(); expect( - geometry.attributes.endNormalAndTextureCoordinateNormalizationX + geometry.attributes.endNormalAndTextureCoordinateNormalizationX, ).toBeDefined(); expect( - geometry.attributes.rightNormalAndTextureCoordinateNormalizationY + geometry.attributes.rightNormalAndTextureCoordinateNormalizationY, ).toBeDefined(); expect(geometry.attributes.startHiLo2D).not.toBeDefined(); @@ -319,7 +319,7 @@ describe("Core/GroundPolylineGeometry", function () { }); const geometry = GroundPolylineGeometry.createGeometry( - groundPolylineGeometry + groundPolylineGeometry, ); expect(geometry.indices.length).toEqual(36); @@ -341,7 +341,7 @@ describe("Core/GroundPolylineGeometry", function () { }); const geometry = GroundPolylineGeometry.createGeometry( - groundPolylineGeometry + groundPolylineGeometry, ); expect(geometry).toBeUndefined(); @@ -350,18 +350,13 @@ describe("Core/GroundPolylineGeometry", function () { it("miters turns", function () { const groundPolylineGeometry = new GroundPolylineGeometry({ positions: Cartesian3.fromDegreesArray([ - 0.01, - 0.0, - 0.02, - 0.0, - 0.02, - 0.01, + 0.01, 0.0, 0.02, 0.0, 0.02, 0.01, ]), granularity: 0.0, }); const geometry = GroundPolylineGeometry.createGeometry( - groundPolylineGeometry + groundPolylineGeometry, ); expect(geometry.indices.length).toEqual(72); expect(geometry.attributes.position.values.length).toEqual(48); @@ -373,37 +368,37 @@ describe("Core/GroundPolylineGeometry", function () { const miteredStartNormal = Cartesian3.unpack( startNormalAndForwardOffsetZvalues, - 32 + 32, ); const miteredEndNormal = Cartesian3.unpack( endNormalAndTextureCoordinateNormalizationXvalues, - 0 + 0, ); const reverseMiteredEndNormal = Cartesian3.multiplyByScalar( miteredEndNormal, -1.0, - new Cartesian3() + new Cartesian3(), ); expect( Cartesian3.equalsEpsilon( miteredStartNormal, reverseMiteredEndNormal, - CesiumMath.EPSILON7 - ) + CesiumMath.EPSILON7, + ), ).toBe(true); const approximateExpectedMiterNormal = new Cartesian3(0.0, 1.0, 1.0); Cartesian3.normalize( approximateExpectedMiterNormal, - approximateExpectedMiterNormal + approximateExpectedMiterNormal, ); expect( Cartesian3.equalsEpsilon( approximateExpectedMiterNormal, miteredStartNormal, - CesiumMath.EPSILON2 - ) + CesiumMath.EPSILON2, + ), ).toBe(true); }); @@ -421,7 +416,7 @@ describe("Core/GroundPolylineGeometry", function () { }); let geometry = GroundPolylineGeometry.createGeometry( - groundPolylineGeometry + groundPolylineGeometry, ); let startNormalAndForwardOffsetZvalues = @@ -431,33 +426,33 @@ describe("Core/GroundPolylineGeometry", function () { let miteredStartNormal = Cartesian3.unpack( startNormalAndForwardOffsetZvalues, - 32 + 32, ); let miteredEndNormal = Cartesian3.unpack( endNormalAndTextureCoordinateNormalizationXvalues, - 0 + 0, ); expect( Cartesian3.equalsEpsilon( miteredStartNormal, miteredEndNormal, - CesiumMath.EPSILON7 - ) + CesiumMath.EPSILON7, + ), ).toBe(true); let approximateExpectedMiterNormal = new Cartesian3(0.0, -1.0, 0.0); Cartesian3.normalize( approximateExpectedMiterNormal, - approximateExpectedMiterNormal + approximateExpectedMiterNormal, ); expect( Cartesian3.equalsEpsilon( approximateExpectedMiterNormal, miteredStartNormal, - CesiumMath.EPSILON2 - ) + CesiumMath.EPSILON2, + ), ).toBe(true); // Break miter on loop end @@ -484,33 +479,33 @@ describe("Core/GroundPolylineGeometry", function () { // Check normals at loop end miteredStartNormal = Cartesian3.unpack( startNormalAndForwardOffsetZvalues, - 0 + 0, ); miteredEndNormal = Cartesian3.unpack( endNormalAndTextureCoordinateNormalizationXvalues, - 32 * 2 + 32 * 2, ); expect( Cartesian3.equalsEpsilon( miteredStartNormal, miteredEndNormal, - CesiumMath.EPSILON7 - ) + CesiumMath.EPSILON7, + ), ).toBe(true); approximateExpectedMiterNormal = new Cartesian3(0.0, 1.0, 0.0); Cartesian3.normalize( approximateExpectedMiterNormal, - approximateExpectedMiterNormal + approximateExpectedMiterNormal, ); expect( Cartesian3.equalsEpsilon( approximateExpectedMiterNormal, miteredStartNormal, - CesiumMath.EPSILON2 - ) + CesiumMath.EPSILON2, + ), ).toBe(true); }); @@ -521,7 +516,7 @@ describe("Core/GroundPolylineGeometry", function () { }); let geometry = GroundPolylineGeometry.createGeometry( - groundPolylineGeometry + groundPolylineGeometry, ); expect(geometry.indices.length).toEqual(72); @@ -530,12 +525,7 @@ describe("Core/GroundPolylineGeometry", function () { // Interpolate one segment but not the other groundPolylineGeometry = new GroundPolylineGeometry({ positions: Cartesian3.fromDegreesArray([ - 0.01, - 0.0, - 0.02, - 0.0, - 0.0201, - 0.0, + 0.01, 0.0, 0.02, 0.0, 0.0201, 0.0, ]), granularity: 600.0, }); @@ -562,10 +552,10 @@ describe("Core/GroundPolylineGeometry", function () { }); let rhumbGeometry = GroundPolylineGeometry.createGeometry( - rhumbGroundPolylineGeometry + rhumbGroundPolylineGeometry, ); let geodesicGeometry = GroundPolylineGeometry.createGeometry( - geodesicGroundPolylineGeometry + geodesicGroundPolylineGeometry, ); expect(rhumbGeometry.indices.length).toEqual(3636); @@ -587,16 +577,16 @@ describe("Core/GroundPolylineGeometry", function () { }); rhumbGeometry = GroundPolylineGeometry.createGeometry( - rhumbGroundPolylineGeometry + rhumbGroundPolylineGeometry, ); geodesicGeometry = GroundPolylineGeometry.createGeometry( - geodesicGroundPolylineGeometry + geodesicGroundPolylineGeometry, ); expect(rhumbGeometry.indices.length).toEqual(3636 + 36); expect(geodesicGeometry.indices.length).toEqual(3600 + 36); expect(geodesicGeometry.attributes.position.values.length).toEqual( - 2400 + 24 + 2400 + 24, ); expect(rhumbGeometry.attributes.position.values.length).toEqual(2424 + 24); }); @@ -610,18 +600,13 @@ describe("Core/GroundPolylineGeometry", function () { // Not enough positions to loop, should still be a single segment let geometry = GroundPolylineGeometry.createGeometry( - groundPolylineGeometry + groundPolylineGeometry, ); expect(geometry.indices.length).toEqual(36); groundPolylineGeometry = new GroundPolylineGeometry({ positions: Cartesian3.fromDegreesArray([ - 0.01, - 0.0, - 0.02, - 0.0, - 0.02, - 0.02, + 0.01, 0.0, 0.02, 0.0, 0.02, 0.02, ]), granularity: 0.0, loop: true, @@ -640,7 +625,7 @@ describe("Core/GroundPolylineGeometry", function () { }); let geometry = GroundPolylineGeometry.createGeometry( - groundPolylineGeometry + groundPolylineGeometry, ); expect(geometry.indices.length).toEqual(72); @@ -660,14 +645,7 @@ describe("Core/GroundPolylineGeometry", function () { // Cross IDL going opposite direction and loop groundPolylineGeometry = new GroundPolylineGeometry({ positions: Cartesian3.fromDegreesArray([ - 179.0, - 0.0, - 179.0, - 1.0, - -179.0, - 1.0, - -179.0, - 0.0, + 179.0, 0.0, 179.0, 1.0, -179.0, 1.0, -179.0, 0.0, ]), granularity: 0.0, // no interpolative subdivision loop: true, @@ -709,7 +687,7 @@ describe("Core/GroundPolylineGeometry", function () { groundPolylineGeometry._scene3DOnly = true; GroundPolylineGeometry.setProjectionAndEllipsoid( groundPolylineGeometry, - new WebMercatorProjection(Ellipsoid.UNIT_SPHERE) + new WebMercatorProjection(Ellipsoid.UNIT_SPHERE), ); const packedArray = [0]; @@ -724,14 +702,14 @@ describe("Core/GroundPolylineGeometry", function () { expect( Cartesian3.equals( scratchPositions[0], - groundPolylineGeometry._positions[0] - ) + groundPolylineGeometry._positions[0], + ), ).toBe(true); expect( Cartesian3.equals( scratchPositions[1], - groundPolylineGeometry._positions[1] - ) + groundPolylineGeometry._positions[1], + ), ).toBe(true); expect(scratch.loop).toBe(true); expect(scratch.granularity).toEqual(10.0); @@ -749,7 +727,7 @@ describe("Core/GroundPolylineGeometry", function () { groundPolylineGeometry._scene3DOnly = true; GroundPolylineGeometry.setProjectionAndEllipsoid( groundPolylineGeometry, - new WebMercatorProjection(Ellipsoid.UNIT_SPHERE) + new WebMercatorProjection(Ellipsoid.UNIT_SPHERE), ); const packedArray = [0]; @@ -761,14 +739,14 @@ describe("Core/GroundPolylineGeometry", function () { expect( Cartesian3.equals( scratchPositions[0], - groundPolylineGeometry._positions[0] - ) + groundPolylineGeometry._positions[0], + ), ).toBe(true); expect( Cartesian3.equals( scratchPositions[1], - groundPolylineGeometry._positions[1] - ) + groundPolylineGeometry._positions[1], + ), ).toBe(true); expect(result.loop).toBe(true); expect(result.granularity).toEqual(10.0); @@ -786,22 +764,17 @@ describe("Core/GroundPolylineGeometry", function () { GroundPolylineGeometry.setProjectionAndEllipsoid( groundPolylineGeometry, - new WebMercatorProjection(Ellipsoid.UNIT_SPHERE) + new WebMercatorProjection(Ellipsoid.UNIT_SPHERE), ); expect(groundPolylineGeometry._projectionIndex).toEqual(1); expect( - groundPolylineGeometry._ellipsoid.equals(Ellipsoid.UNIT_SPHERE) + groundPolylineGeometry._ellipsoid.equals(Ellipsoid.UNIT_SPHERE), ).toBe(true); }); const positions = Cartesian3.fromDegreesArray([ - 0.01, - 0.0, - 0.02, - 0.0, - 0.02, - 0.1, + 0.01, 0.0, 0.02, 0.0, 0.02, 0.1, ]); const polyline = new GroundPolylineGeometry({ positions: positions, @@ -813,12 +786,12 @@ describe("Core/GroundPolylineGeometry", function () { const projection = new GeographicProjection(); const cartographic = new Cartographic( CesiumMath.PI - CesiumMath.EPSILON11, - 0.0 + 0.0, ); const normal = new Cartesian3(0.0, -1.0, 0.0); const projectedPosition = projection.project( cartographic, - new Cartesian3() + new Cartesian3(), ); const result = new Cartesian3(); @@ -827,22 +800,20 @@ describe("Core/GroundPolylineGeometry", function () { cartographic, normal, projectedPosition, - result + result, ); expect( Cartesian3.equalsEpsilon( result, new Cartesian3(1.0, 0.0, 0.0), - CesiumMath.EPSILON7 - ) + CesiumMath.EPSILON7, + ), ).toBe(true); }); it("creates bounding spheres that cover the entire polyline volume height", function () { const positions = Cartesian3.fromDegreesArray([ - -122.17580380403314, - 46.19984918190237, - -122.17581380403314, + -122.17580380403314, 46.19984918190237, -122.17581380403314, 46.19984918190237, ]); @@ -853,7 +824,7 @@ describe("Core/GroundPolylineGeometry", function () { }); const geometry = GroundPolylineGeometry.createGeometry( - groundPolylineGeometry + groundPolylineGeometry, ); const boundingSphere = geometry.boundingSphere; @@ -865,10 +836,7 @@ describe("Core/GroundPolylineGeometry", function () { it("creates bounding spheres that cover the entire polyline volume height in negative elevation regions", function () { const positions = Cartesian3.fromDegreesArray([ - 35.549174, - 31.377954, - 35.549174, - 31.377953, + 35.549174, 31.377954, 35.549174, 31.377953, ]); // Dead Sea - provided coordinates from below sea level to above sea level @@ -879,7 +847,7 @@ describe("Core/GroundPolylineGeometry", function () { }); const geometry = GroundPolylineGeometry.createGeometry( - groundPolylineGeometry + groundPolylineGeometry, ); const boundingSphere = geometry.boundingSphere; diff --git a/packages/engine/Specs/Core/HeadingPitchRollSpec.js b/packages/engine/Specs/Core/HeadingPitchRollSpec.js index a65df32d5633..e753e75cc7b4 100644 --- a/packages/engine/Specs/Core/HeadingPitchRollSpec.js +++ b/packages/engine/Specs/Core/HeadingPitchRollSpec.js @@ -18,22 +18,22 @@ describe("Core/HeadingPitchRoll", function () { const headingPitchRoll = new HeadingPitchRoll( 1.0 * deg2rad, 2.0 * deg2rad, - 3.0 * deg2rad + 3.0 * deg2rad, ); expect(headingPitchRoll.heading).toEqual( 1.0 * deg2rad, 2.0 * deg2rad, - 3.0 * deg2rad + 3.0 * deg2rad, ); expect(headingPitchRoll.pitch).toEqual( 2.0 * deg2rad, 2.0 * deg2rad, - 3.0 * deg2rad + 3.0 * deg2rad, ); expect(headingPitchRoll.roll).toEqual( 3.0 * deg2rad, 2.0 * deg2rad, - 3.0 * deg2rad + 3.0 * deg2rad, ); }); @@ -57,7 +57,7 @@ describe("Core/HeadingPitchRoll", function () { hpr.roll = init[2]; const result = HeadingPitchRoll.fromQuaternion( - Quaternion.fromHeadingPitchRoll(hpr) + Quaternion.fromHeadingPitchRoll(hpr), ); expect(init[0]).toEqualEpsilon(result.heading, CesiumMath.EPSILON11); expect(init[1]).toEqualEpsilon(result.pitch, CesiumMath.EPSILON11); @@ -70,7 +70,7 @@ describe("Core/HeadingPitchRoll", function () { 8.801218199179452e-17, -0.7071067801637715, -8.801218315071006e-17, - -0.7071067822093238 + -0.7071067822093238, ); const result = HeadingPitchRoll.fromQuaternion(q); expect(result.pitch).toEqual(-(Math.PI / 2)); @@ -93,15 +93,15 @@ describe("Core/HeadingPitchRoll", function () { const result = HeadingPitchRoll.fromDegrees(init[0], init[1], init[2]); expect(init[0] * deg2rad).toEqualEpsilon( result.heading, - CesiumMath.EPSILON11 + CesiumMath.EPSILON11, ); expect(init[1] * deg2rad).toEqualEpsilon( result.pitch, - CesiumMath.EPSILON11 + CesiumMath.EPSILON11, ); expect(init[2] * deg2rad).toEqualEpsilon( result.roll, - CesiumMath.EPSILON11 + CesiumMath.EPSILON11, ); } }); @@ -118,7 +118,7 @@ describe("Core/HeadingPitchRoll", function () { headingDeg, pitchDeg, rollDeg, - result + result, ); const expected = new HeadingPitchRoll(headingRad, pitchRad, rollRad); expect(actual).toEqual(expected); @@ -129,7 +129,7 @@ describe("Core/HeadingPitchRoll", function () { const headingPitchRoll = new HeadingPitchRoll( 1.0 * deg2rad, 2.0 * deg2rad, - 3.0 * deg2rad + 3.0 * deg2rad, ); const result = new HeadingPitchRoll(); const returnedResult = HeadingPitchRoll.clone(headingPitchRoll, result); @@ -142,11 +142,11 @@ describe("Core/HeadingPitchRoll", function () { const headingPitchRoll = new HeadingPitchRoll( 1.0 * deg2rad, 2.0 * deg2rad, - 3.0 * deg2rad + 3.0 * deg2rad, ); const returnedResult = HeadingPitchRoll.clone( headingPitchRoll, - headingPitchRoll + headingPitchRoll, ); expect(headingPitchRoll).toBe(returnedResult); }); @@ -156,26 +156,26 @@ describe("Core/HeadingPitchRoll", function () { expect( HeadingPitchRoll.equals( headingPitchRoll, - new HeadingPitchRoll(1.0, 2.0, 3.0) - ) + new HeadingPitchRoll(1.0, 2.0, 3.0), + ), ).toEqual(true); expect( HeadingPitchRoll.equals( headingPitchRoll, - new HeadingPitchRoll(2.0, 2.0, 3.0) - ) + new HeadingPitchRoll(2.0, 2.0, 3.0), + ), ).toEqual(false); expect( HeadingPitchRoll.equals( headingPitchRoll, - new HeadingPitchRoll(2.0, 1.0, 3.0) - ) + new HeadingPitchRoll(2.0, 1.0, 3.0), + ), ).toEqual(false); expect( HeadingPitchRoll.equals( headingPitchRoll, - new HeadingPitchRoll(1.0, 2.0, 4.0) - ) + new HeadingPitchRoll(1.0, 2.0, 4.0), + ), ).toEqual(false); expect(HeadingPitchRoll.equals(headingPitchRoll, undefined)).toEqual(false); }); @@ -183,37 +183,37 @@ describe("Core/HeadingPitchRoll", function () { it("equalsEpsilon", function () { let headingPitchRoll = new HeadingPitchRoll(1.0, 2.0, 3.0); expect( - headingPitchRoll.equalsEpsilon(new HeadingPitchRoll(1.0, 2.0, 3.0), 0.0) + headingPitchRoll.equalsEpsilon(new HeadingPitchRoll(1.0, 2.0, 3.0), 0.0), ).toEqual(true); expect( - headingPitchRoll.equalsEpsilon(new HeadingPitchRoll(1.0, 2.0, 3.0), 1.0) + headingPitchRoll.equalsEpsilon(new HeadingPitchRoll(1.0, 2.0, 3.0), 1.0), ).toEqual(true); expect( - headingPitchRoll.equalsEpsilon(new HeadingPitchRoll(2.0, 2.0, 3.0), 1.0) + headingPitchRoll.equalsEpsilon(new HeadingPitchRoll(2.0, 2.0, 3.0), 1.0), ).toEqual(true); expect( - headingPitchRoll.equalsEpsilon(new HeadingPitchRoll(1.0, 3.0, 3.0), 1.0) + headingPitchRoll.equalsEpsilon(new HeadingPitchRoll(1.0, 3.0, 3.0), 1.0), ).toEqual(true); expect( - headingPitchRoll.equalsEpsilon(new HeadingPitchRoll(1.0, 2.0, 4.0), 1.0) + headingPitchRoll.equalsEpsilon(new HeadingPitchRoll(1.0, 2.0, 4.0), 1.0), ).toEqual(true); expect( headingPitchRoll.equalsEpsilon( new HeadingPitchRoll(2.0, 2.0, 3.0), - CesiumMath.EPSILON6 - ) + CesiumMath.EPSILON6, + ), ).toEqual(false); expect( headingPitchRoll.equalsEpsilon( new HeadingPitchRoll(1.0, 3.0, 3.0), - CesiumMath.EPSILON6 - ) + CesiumMath.EPSILON6, + ), ).toEqual(false); expect( headingPitchRoll.equalsEpsilon( new HeadingPitchRoll(1.0, 2.0, 4.0), - CesiumMath.EPSILON6 - ) + CesiumMath.EPSILON6, + ), ).toEqual(false); expect(headingPitchRoll.equalsEpsilon(undefined, 1)).toEqual(false); @@ -221,43 +221,43 @@ describe("Core/HeadingPitchRoll", function () { expect( headingPitchRoll.equalsEpsilon( new HeadingPitchRoll(3000000.0, 4000000.0, 5000000.0), - 0.0 - ) + 0.0, + ), ).toEqual(true); expect( headingPitchRoll.equalsEpsilon( new HeadingPitchRoll(3000000.2, 4000000.0, 5000000.0), - CesiumMath.EPSILON7 - ) + CesiumMath.EPSILON7, + ), ).toEqual(true); expect( headingPitchRoll.equalsEpsilon( new HeadingPitchRoll(3000000.0, 4000000.2, 5000000.0), - CesiumMath.EPSILON7 - ) + CesiumMath.EPSILON7, + ), ).toEqual(true); expect( headingPitchRoll.equalsEpsilon( new HeadingPitchRoll(3000000.0, 4000000.0, 5000000.2), - CesiumMath.EPSILON7 - ) + CesiumMath.EPSILON7, + ), ).toEqual(true); expect( headingPitchRoll.equalsEpsilon( new HeadingPitchRoll(3000000.2, 4000000.2, 5000000.2), - CesiumMath.EPSILON7 - ) + CesiumMath.EPSILON7, + ), ).toEqual(true); expect( headingPitchRoll.equalsEpsilon( new HeadingPitchRoll(3000000.2, 4000000.2, 5000000.2), - CesiumMath.EPSILON9 - ) + CesiumMath.EPSILON9, + ), ).toEqual(false); expect(headingPitchRoll.equalsEpsilon(undefined, 1)).toEqual(false); expect( - HeadingPitchRoll.equalsEpsilon(undefined, headingPitchRoll, 1) + HeadingPitchRoll.equalsEpsilon(undefined, headingPitchRoll, 1), ).toEqual(false); }); diff --git a/packages/engine/Specs/Core/HeapSpec.js b/packages/engine/Specs/Core/HeapSpec.js index 0e5cf83af3c9..a2a480c9c745 100644 --- a/packages/engine/Specs/Core/HeapSpec.js +++ b/packages/engine/Specs/Core/HeapSpec.js @@ -77,7 +77,7 @@ describe("Core/Heap", function () { expect(heap.length).toBeLessThanOrEqual(heap.maximumLength); // allowed one extra slot for swapping expect(heap.internalArray.length).toBeLessThanOrEqual( - heap.maximumLength + 1 + heap.maximumLength + 1, ); }); diff --git a/packages/engine/Specs/Core/HeightmapTerrainDataSpec.js b/packages/engine/Specs/Core/HeightmapTerrainDataSpec.js index ea0b8657bf03..57d0c557da02 100644 --- a/packages/engine/Specs/Core/HeightmapTerrainDataSpec.js +++ b/packages/engine/Specs/Core/HeightmapTerrainDataSpec.js @@ -230,22 +230,8 @@ describe("Core/HeightmapTerrainData", function () { it("upsamples", function () { data = new HeightmapTerrainData({ buffer: new Float32Array([ - 1.0, - 2.0, - 3.0, - 4.0, - 5.0, - 6.0, - 7.0, - 8.0, - 9.0, - 10.0, - 11.0, - 12.0, - 13.0, - 14.0, - 15.0, - 16.0, + 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, + 14.0, 15.0, 16.0, ]), width: 4, height: 4, @@ -261,22 +247,8 @@ describe("Core/HeightmapTerrainData", function () { expect(upsampled._width).toBe(4); expect(upsampled._height).toBe(4); expect(upsampled._buffer).toEqual([ - 1.0, - 1.5, - 2.0, - 2.5, - 3.0, - 3.5, - 4.0, - 4.5, - 5.0, - 5.5, - 6.0, - 6.5, - 7.0, - 7.5, - 8.0, - 8.5, + 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5, 5.0, 5.5, 6.0, 6.5, 7.0, + 7.5, 8.0, 8.5, ]); }); }); @@ -284,54 +256,9 @@ describe("Core/HeightmapTerrainData", function () { it("upsample works with a stride", function () { data = new HeightmapTerrainData({ buffer: new Uint8Array([ - 1, - 1, - 10, - 2, - 1, - 10, - 3, - 1, - 10, - 4, - 1, - 10, - 5, - 1, - 10, - 6, - 1, - 10, - 7, - 1, - 10, - 8, - 1, - 10, - 9, - 1, - 10, - 10, - 1, - 10, - 11, - 1, - 10, - 12, - 1, - 10, - 13, - 1, - 10, - 14, - 1, - 10, - 15, - 1, - 10, - 16, - 1, - 10, + 1, 1, 10, 2, 1, 10, 3, 1, 10, 4, 1, 10, 5, 1, 10, 6, 1, 10, 7, 1, 10, + 8, 1, 10, 9, 1, 10, 10, 1, 10, 11, 1, 10, 12, 1, 10, 13, 1, 10, 14, 1, + 10, 15, 1, 10, 16, 1, 10, ]), width: 4, height: 4, @@ -351,54 +278,9 @@ describe("Core/HeightmapTerrainData", function () { expect(upsampled._width).toBe(4); expect(upsampled._height).toBe(4); expect(upsampled._buffer).toEqual([ - 1, - 1, - 0, - 1, - 1, - 0, - 2, - 1, - 0, - 2, - 1, - 0, - 3, - 1, - 0, - 3, - 1, - 0, - 4, - 1, - 0, - 4, - 1, - 0, - 5, - 1, - 0, - 5, - 1, - 0, - 6, - 1, - 0, - 6, - 1, - 0, - 7, - 1, - 0, - 7, - 1, - 0, - 8, - 1, - 0, - 8, - 1, - 0, + 1, 1, 0, 1, 1, 0, 2, 1, 0, 2, 1, 0, 3, 1, 0, 3, 1, 0, 4, 1, 0, 4, 1, + 0, 5, 1, 0, 5, 1, 0, 6, 1, 0, 6, 1, 0, 7, 1, 0, 7, 1, 0, 8, 1, 0, 8, + 1, 0, ]); }); }); @@ -406,54 +288,9 @@ describe("Core/HeightmapTerrainData", function () { it("upsample works with a big endian stride", function () { data = new HeightmapTerrainData({ buffer: new Uint8Array([ - 1, - 1, - 10, - 1, - 2, - 10, - 1, - 3, - 10, - 1, - 4, - 10, - 1, - 5, - 10, - 1, - 6, - 10, - 1, - 7, - 10, - 1, - 8, - 10, - 1, - 9, - 10, - 1, - 10, - 10, - 1, - 11, - 10, - 1, - 12, - 10, - 1, - 13, - 10, - 1, - 14, - 10, - 1, - 15, - 10, - 1, - 16, - 10, + 1, 1, 10, 1, 2, 10, 1, 3, 10, 1, 4, 10, 1, 5, 10, 1, 6, 10, 1, 7, 10, + 1, 8, 10, 1, 9, 10, 1, 10, 10, 1, 11, 10, 1, 12, 10, 1, 13, 10, 1, 14, + 10, 1, 15, 10, 1, 16, 10, ]), width: 4, height: 4, @@ -474,54 +311,9 @@ describe("Core/HeightmapTerrainData", function () { expect(upsampled._width).toBe(4); expect(upsampled._height).toBe(4); expect(upsampled._buffer).toEqual([ - 1, - 1, - 0, - 1, - 1, - 0, - 1, - 2, - 0, - 1, - 2, - 0, - 1, - 3, - 0, - 1, - 3, - 0, - 1, - 4, - 0, - 1, - 4, - 0, - 1, - 5, - 0, - 1, - 5, - 0, - 1, - 6, - 0, - 1, - 6, - 0, - 1, - 7, - 0, - 1, - 7, - 0, - 1, - 8, - 0, - 1, - 8, - 0, + 1, 1, 0, 1, 1, 0, 1, 2, 0, 1, 2, 0, 1, 3, 0, 1, 3, 0, 1, 4, 0, 1, 4, + 0, 1, 5, 0, 1, 5, 0, 1, 6, 0, 1, 6, 0, 1, 7, 0, 1, 7, 0, 1, 8, 0, 1, + 8, 0, ]); }); }); @@ -529,22 +321,8 @@ describe("Core/HeightmapTerrainData", function () { it("upsample works for an eastern child", function () { data = new HeightmapTerrainData({ buffer: new Float32Array([ - 1.0, - 2.0, - 3.0, - 4.0, - 5.0, - 6.0, - 7.0, - 8.0, - 9.0, - 10.0, - 11.0, - 12.0, - 13.0, - 14.0, - 15.0, - 16.0, + 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, + 14.0, 15.0, 16.0, ]), width: 4, height: 4, @@ -560,22 +338,8 @@ describe("Core/HeightmapTerrainData", function () { expect(upsampled._width).toBe(4); expect(upsampled._height).toBe(4); expect(upsampled._buffer).toEqual([ - 2.5, - 3.0, - 3.5, - 4.0, - 4.5, - 5.0, - 5.5, - 6.0, - 6.5, - 7.0, - 7.5, - 8.0, - 8.5, - 9.0, - 9.5, - 10.0, + 2.5, 3.0, 3.5, 4.0, 4.5, 5.0, 5.5, 6.0, 6.5, 7.0, 7.5, 8.0, 8.5, + 9.0, 9.5, 10.0, ]); }); }); @@ -583,54 +347,9 @@ describe("Core/HeightmapTerrainData", function () { it("upsample works with a stride for an eastern child", function () { data = new HeightmapTerrainData({ buffer: new Uint8Array([ - 1, - 1, - 10, - 2, - 1, - 10, - 3, - 1, - 10, - 4, - 1, - 10, - 5, - 1, - 10, - 6, - 1, - 10, - 7, - 1, - 10, - 8, - 1, - 10, - 9, - 1, - 10, - 10, - 1, - 10, - 11, - 1, - 10, - 12, - 1, - 10, - 13, - 1, - 10, - 14, - 1, - 10, - 15, - 1, - 10, - 16, - 1, - 10, + 1, 1, 10, 2, 1, 10, 3, 1, 10, 4, 1, 10, 5, 1, 10, 6, 1, 10, 7, 1, 10, + 8, 1, 10, 9, 1, 10, 10, 1, 10, 11, 1, 10, 12, 1, 10, 13, 1, 10, 14, 1, + 10, 15, 1, 10, 16, 1, 10, ]), width: 4, height: 4, @@ -650,54 +369,9 @@ describe("Core/HeightmapTerrainData", function () { expect(upsampled._width).toBe(4); expect(upsampled._height).toBe(4); expect(upsampled._buffer).toEqual([ - 2, - 1, - 0, - 3, - 1, - 0, - 3, - 1, - 0, - 4, - 1, - 0, - 4, - 1, - 0, - 5, - 1, - 0, - 5, - 1, - 0, - 6, - 1, - 0, - 6, - 1, - 0, - 7, - 1, - 0, - 7, - 1, - 0, - 8, - 1, - 0, - 8, - 1, - 0, - 9, - 1, - 0, - 9, - 1, - 0, - 10, - 1, - 0, + 2, 1, 0, 3, 1, 0, 3, 1, 0, 4, 1, 0, 4, 1, 0, 5, 1, 0, 5, 1, 0, 6, 1, + 0, 6, 1, 0, 7, 1, 0, 7, 1, 0, 8, 1, 0, 8, 1, 0, 9, 1, 0, 9, 1, 0, + 10, 1, 0, ]); }); }); @@ -705,22 +379,8 @@ describe("Core/HeightmapTerrainData", function () { it("upsample clamps out of range data", function () { data = new HeightmapTerrainData({ buffer: new Float32Array([ - -1.0, - -2.0, - -3.0, - -4.0, - 5.0, - 6.0, - 7.0, - 8.0, - 9.0, - 10.0, - 11.0, - 12.0, - 13.0, - 14.0, - 15.0, - 16.0, + -1.0, -2.0, -3.0, -4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, + 13.0, 14.0, 15.0, 16.0, ]), width: 4, height: 4, @@ -742,22 +402,7 @@ describe("Core/HeightmapTerrainData", function () { expect(upsampled._width).toBe(4); expect(upsampled._height).toBe(4); expect(upsampled._buffer).toEqual([ - 1, - 1, - 1, - 1, - 2, - 1.5, - 2, - 1.5, - 5, - 5.5, - 6, - 6.5, - 7, - 7, - 7, - 7, + 1, 1, 1, 1, 2, 1.5, 2, 1.5, 5, 5.5, 6, 6.5, 7, 7, 7, 7, ]); }); }); diff --git a/packages/engine/Specs/Core/HermitePolynomialApproximationSpec.js b/packages/engine/Specs/Core/HermitePolynomialApproximationSpec.js index b8a908263921..240888f62a30 100644 --- a/packages/engine/Specs/Core/HermitePolynomialApproximationSpec.js +++ b/packages/engine/Specs/Core/HermitePolynomialApproximationSpec.js @@ -6,40 +6,14 @@ describe("Core/HermitePolynomialApproximation", function () { const xTable = [0, 60, 120, 180, 240, 300, 360, 420]; const yTable = [ - 13378137.0, - 0, - 13374128.3576279, - 0, - 13362104.8328212, - 0, - 13342073.6310691, - 0, - 13314046.7567223, - 0, - 13278041.005799, - 0, - 13234077.9559193, - 0, - 13182183.953374, - 0, + 13378137.0, 0, 13374128.3576279, 0, 13362104.8328212, 0, 13342073.6310691, + 0, 13314046.7567223, 0, 13278041.005799, 0, 13234077.9559193, 0, + 13182183.953374, 0, ]; const dyTable = [ - 0.0, - 0, - -133.614738921601, - 0, - -267.149404854867, - 0, - -400.523972797808, - 0, - -533.658513692378, - 0, - -666.473242324565, - 0, - -798.888565138278, - 0, - -930.82512793439, - 0, + 0.0, 0, -133.614738921601, 0, -267.149404854867, 0, -400.523972797808, 0, + -533.658513692378, 0, -666.473242324565, 0, -798.888565138278, 0, + -930.82512793439, 0, ]; const yTableCombined = new Array(yTable.length * 2); @@ -59,7 +33,7 @@ describe("Core/HermitePolynomialApproximation", function () { x, xTable, yTableCombined, - 4 + 4, ); const expectedResult = 13367002.870928625; //The accuracy is lower because we are no longer using derivative info @@ -74,7 +48,7 @@ describe("Core/HermitePolynomialApproximation", function () { xTable, yTableCombined, 4, - result + result, ); const expectedResult = 13367002.870928625; expect(result).toBe(returnedResult); @@ -88,13 +62,13 @@ describe("Core/HermitePolynomialApproximation", function () { expect(HermitePolynomialApproximation.getRequiredDataPoints(2)).toEqual(3); expect(HermitePolynomialApproximation.getRequiredDataPoints(3)).toEqual(4); expect(HermitePolynomialApproximation.getRequiredDataPoints(3, 1)).toEqual( - 2 + 2, ); expect(HermitePolynomialApproximation.getRequiredDataPoints(5, 1)).toEqual( - 3 + 3, ); expect(HermitePolynomialApproximation.getRequiredDataPoints(7, 1)).toEqual( - 4 + 4, ); }); @@ -105,7 +79,7 @@ describe("Core/HermitePolynomialApproximation", function () { yTableCombined, 2, 1, - 1 + 1, ); const expectedResult = [13367002.870928625, 0.0, -222.65168787012135, 0.0]; expect(result).toEqualEpsilon(expectedResult, 1e-8); diff --git a/packages/engine/Specs/Core/HermiteSplineSpec.js b/packages/engine/Specs/Core/HermiteSplineSpec.js index 3b04ea682381..d66356a7aa9e 100644 --- a/packages/engine/Specs/Core/HermiteSplineSpec.js +++ b/packages/engine/Specs/Core/HermiteSplineSpec.js @@ -81,7 +81,7 @@ describe("Core/HermiteSpline", function () { return Cartesian3.add( Cartesian3.add(Cartesian3.add(p0, p1, p0), p2, p0), p3, - p0 + p0, ); }; } @@ -120,7 +120,7 @@ describe("Core/HermiteSpline", function () { for (let i = 0.0; i < 1.0; i = i + granularity) { expect(hs.evaluate(i)).toEqualEpsilon( interpolate(i), - CesiumMath.EPSILON3 + CesiumMath.EPSILON3, ); } }); @@ -191,7 +191,7 @@ describe("Core/HermiteSpline", function () { tangents[i] = Cartesian3.multiplyByScalar( Cartesian3.subtract(points[i + 1], points[i - 1], new Cartesian3()), 0.5, - new Cartesian3() + new Cartesian3(), ); } tangents[tangents.length - 1] = new Cartesian3(1165345, 112641, 47281); @@ -200,7 +200,7 @@ describe("Core/HermiteSpline", function () { points[0], tangents[0], points[1], - tangents[1] + tangents[1], ); const hs = HermiteSpline.createC1({ times: times, @@ -212,7 +212,7 @@ describe("Core/HermiteSpline", function () { for (let j = times[0]; j < times[1]; j = j + granularity) { expect(hs.evaluate(j)).toEqualEpsilon( interpolate(j), - CesiumMath.EPSILON3 + CesiumMath.EPSILON3, ); } }); @@ -263,7 +263,7 @@ describe("Core/HermiteSpline", function () { points[0], p0Tangent, points[1], - p1Tangent + p1Tangent, ); const hs = HermiteSpline.createNaturalCubic({ points: points, @@ -274,7 +274,7 @@ describe("Core/HermiteSpline", function () { for (let i = times[0]; i < times[1]; i = i + granularity) { expect(hs.evaluate(i)).toEqualEpsilon( interpolate(i), - CesiumMath.EPSILON3 + CesiumMath.EPSILON3, ); } }); @@ -347,7 +347,7 @@ describe("Core/HermiteSpline", function () { points[0], p0Tangent, points[1], - p1Tangent + p1Tangent, ); const hs = HermiteSpline.createClampedCubic({ points: points, @@ -360,7 +360,7 @@ describe("Core/HermiteSpline", function () { for (let i = points[0].time; i < points[1].time; i = i + granularity) { expect(hs.evaluate(i)).toEqualEpsilon( interpolate(i), - CesiumMath.EPSILON3 + CesiumMath.EPSILON3, ); } }); @@ -473,7 +473,7 @@ describe("Core/HermiteSpline", function () { const expected = new Quaternion(0.0, 0.0, -0.54567, 0.81546); point = hs.evaluate(0.75); expect(Quaternion.equalsEpsilon(point, expected, CesiumMath.EPSILON4)).toBe( - true + true, ); }); @@ -502,7 +502,7 @@ describe("Core/HermiteSpline", function () { const t = (times[0] + times[1]) * 0.5; expect(hs.evaluate(t)).toEqual( - Cartesian3.lerp(points[0], points[1], t, new Cartesian3()) + Cartesian3.lerp(points[0], points[1], t, new Cartesian3()), ); }); @@ -517,7 +517,7 @@ describe("Core/HermiteSpline", function () { const t = (times[0] + times[1]) * 0.5; expect(hs.evaluate(t)).toEqual( - Cartesian3.lerp(points[0], points[1], t, new Cartesian3()) + Cartesian3.lerp(points[0], points[1], t, new Cartesian3()), ); }); }); diff --git a/packages/engine/Specs/Core/Iau2006XysDataSpec.js b/packages/engine/Specs/Core/Iau2006XysDataSpec.js index 059ac4aef448..86e48b9a1d6b 100644 --- a/packages/engine/Specs/Core/Iau2006XysDataSpec.js +++ b/packages/engine/Specs/Core/Iau2006XysDataSpec.js @@ -38,8 +38,8 @@ describe("Core/Iau2006XysData", function () { new Iau2006XysSample( -0.0024019733101066816, -0.000024843279494458311, - -0.000000016941747917421229 - ) + -0.000000016941747917421229, + ), ); }); }); @@ -57,7 +57,7 @@ describe("Core/Iau2006XysData", function () { // this should be the same location as the default, but specifying the value // takes the code through a different code path. xysFileUrlTemplate: buildModuleUrl( - "Assets/IAU2006_XYS/IAU2006_XYS_{0}.json" + "Assets/IAU2006_XYS/IAU2006_XYS_{0}.json", ), }); diff --git a/packages/engine/Specs/Core/IauOrientationAxesSpec.js b/packages/engine/Specs/Core/IauOrientationAxesSpec.js index 8d220d4f1a1c..77c553f27741 100644 --- a/packages/engine/Specs/Core/IauOrientationAxesSpec.js +++ b/packages/engine/Specs/Core/IauOrientationAxesSpec.js @@ -27,7 +27,7 @@ describe("Core/IauOrientationAxes", function () { 0.31035675134719942, -0.022608671404182448, -0.41183090094261243, - 0.91097977859342938 + 0.91097977859342938, ); const mtx = axes.evaluate(date); diff --git a/packages/engine/Specs/Core/IndexDatatypeSpec.js b/packages/engine/Specs/Core/IndexDatatypeSpec.js index a3a8132643bc..7091e8529e4a 100644 --- a/packages/engine/Specs/Core/IndexDatatypeSpec.js +++ b/packages/engine/Specs/Core/IndexDatatypeSpec.js @@ -9,11 +9,11 @@ describe("Core/IndexDatatype", function () { it("createTypedArray creates array", function () { expect(IndexDatatype.createTypedArray(3, 3).BYTES_PER_ELEMENT).toEqual( - Uint16Array.BYTES_PER_ELEMENT + Uint16Array.BYTES_PER_ELEMENT, ); expect( IndexDatatype.createTypedArray(CesiumMath.SIXTY_FOUR_KILOBYTES + 1, 3) - .BYTES_PER_ELEMENT + .BYTES_PER_ELEMENT, ).toEqual(Uint32Array.BYTES_PER_ELEMENT); }); @@ -30,10 +30,10 @@ describe("Core/IndexDatatype", function () { 3, sourceArray.buffer, 0, - 5 + 5, ); expect(indexBuffer.BYTES_PER_ELEMENT).toEqual( - Uint16Array.BYTES_PER_ELEMENT + Uint16Array.BYTES_PER_ELEMENT, ); expect(indexBuffer.length).toEqual(5); expect(indexBuffer[0]).toEqual(0); @@ -46,10 +46,10 @@ describe("Core/IndexDatatype", function () { 3, sourceArray.buffer, Uint16Array.BYTES_PER_ELEMENT * 5, - 5 + 5, ); expect(indexBuffer.BYTES_PER_ELEMENT).toEqual( - Uint16Array.BYTES_PER_ELEMENT + Uint16Array.BYTES_PER_ELEMENT, ); expect(indexBuffer.length).toEqual(5); expect(indexBuffer[0]).toEqual(5); @@ -62,10 +62,10 @@ describe("Core/IndexDatatype", function () { CesiumMath.SIXTY_FOUR_KILOBYTES + 1, sourceArray.buffer, 0, - 5 + 5, ); expect(indexBuffer.BYTES_PER_ELEMENT).toEqual( - Uint32Array.BYTES_PER_ELEMENT + Uint32Array.BYTES_PER_ELEMENT, ); expect(indexBuffer.length).toEqual(5); expect(indexBuffer[0]).toEqual(0); @@ -78,10 +78,10 @@ describe("Core/IndexDatatype", function () { CesiumMath.SIXTY_FOUR_KILOBYTES + 1, sourceArray.buffer, Uint32Array.BYTES_PER_ELEMENT * 5, - 5 + 5, ); expect(indexBuffer.BYTES_PER_ELEMENT).toEqual( - Uint32Array.BYTES_PER_ELEMENT + Uint32Array.BYTES_PER_ELEMENT, ); expect(indexBuffer.length).toEqual(5); expect(indexBuffer[0]).toEqual(5); @@ -105,20 +105,20 @@ describe("Core/IndexDatatype", function () { IndexDatatype.createTypedArrayFromArrayBuffer( 3, sourceArray.buffer, - undefined + undefined, ); }).toThrowDeveloperError(); }); it("getSizeInBytes returns size", function () { expect(IndexDatatype.getSizeInBytes(IndexDatatype.UNSIGNED_BYTE)).toEqual( - Uint8Array.BYTES_PER_ELEMENT + Uint8Array.BYTES_PER_ELEMENT, ); expect(IndexDatatype.getSizeInBytes(IndexDatatype.UNSIGNED_SHORT)).toEqual( - Uint16Array.BYTES_PER_ELEMENT + Uint16Array.BYTES_PER_ELEMENT, ); expect(IndexDatatype.getSizeInBytes(IndexDatatype.UNSIGNED_INT)).toEqual( - Uint32Array.BYTES_PER_ELEMENT + Uint32Array.BYTES_PER_ELEMENT, ); }); @@ -130,13 +130,13 @@ describe("Core/IndexDatatype", function () { it("fromTypedArray works", function () { expect(IndexDatatype.fromTypedArray(new Uint8Array())).toBe( - IndexDatatype.UNSIGNED_BYTE + IndexDatatype.UNSIGNED_BYTE, ); expect(IndexDatatype.fromTypedArray(new Uint16Array())).toBe( - IndexDatatype.UNSIGNED_SHORT + IndexDatatype.UNSIGNED_SHORT, ); expect(IndexDatatype.fromTypedArray(new Uint32Array())).toBe( - IndexDatatype.UNSIGNED_INT + IndexDatatype.UNSIGNED_INT, ); }); diff --git a/packages/engine/Specs/Core/IntersectionTestsSpec.js b/packages/engine/Specs/Core/IntersectionTestsSpec.js index 8b1a1eb776f3..6e6d8ef2a0f9 100644 --- a/packages/engine/Specs/Core/IntersectionTestsSpec.js +++ b/packages/engine/Specs/Core/IntersectionTestsSpec.js @@ -12,7 +12,7 @@ describe("Core/IntersectionTests", function () { it("rayPlane intersects", function () { const ray = new Ray( new Cartesian3(2.0, 0.0, 0.0), - new Cartesian3(-1.0, 0.0, 0.0) + new Cartesian3(-1.0, 0.0, 0.0), ); const plane = new Plane(Cartesian3.UNIT_X, -1.0); @@ -24,7 +24,7 @@ describe("Core/IntersectionTests", function () { it("rayPlane misses", function () { const ray = new Ray( new Cartesian3(2.0, 0.0, 0.0), - new Cartesian3(1.0, 0.0, 0.0) + new Cartesian3(1.0, 0.0, 0.0), ); const plane = new Plane(Cartesian3.UNIT_X, -1.0); @@ -36,7 +36,7 @@ describe("Core/IntersectionTests", function () { it("rayPlane misses (parallel)", function () { const ray = new Ray( new Cartesian3(2.0, 0.0, 0.0), - new Cartesian3(0.0, 1.0, 0.0) + new Cartesian3(0.0, 1.0, 0.0), ); const plane = new Plane(Cartesian3.UNIT_X, -1.0); @@ -80,7 +80,7 @@ describe("Core/IntersectionTests", function () { IntersectionTests.rayTriangle( new Ray(), new Cartesian3(), - new Cartesian3() + new Cartesian3(), ); }).toThrowDeveloperError(); }); @@ -92,7 +92,7 @@ describe("Core/IntersectionTests", function () { const ray = new Ray( Cartesian3.UNIT_Z, - Cartesian3.negate(Cartesian3.UNIT_Z, new Cartesian3()) + Cartesian3.negate(Cartesian3.UNIT_Z, new Cartesian3()), ); const intersection = IntersectionTests.rayTriangle(ray, p0, p1, p2); @@ -106,7 +106,7 @@ describe("Core/IntersectionTests", function () { const ray = new Ray( Cartesian3.negate(Cartesian3.UNIT_Z, new Cartesian3()), - Cartesian3.UNIT_Z + Cartesian3.UNIT_Z, ); const intersection = IntersectionTests.rayTriangle(ray, p0, p1, p2); @@ -120,7 +120,7 @@ describe("Core/IntersectionTests", function () { const ray = new Ray( Cartesian3.negate(Cartesian3.UNIT_Z, new Cartesian3()), - Cartesian3.UNIT_Z + Cartesian3.UNIT_Z, ); const intersection = IntersectionTests.rayTriangle(ray, p0, p1, p2, true); @@ -134,7 +134,7 @@ describe("Core/IntersectionTests", function () { const ray = new Ray( new Cartesian3(0.0, -1.0, 1.0), - Cartesian3.negate(Cartesian3.UNIT_Z, new Cartesian3()) + Cartesian3.negate(Cartesian3.UNIT_Z, new Cartesian3()), ); const intersection = IntersectionTests.rayTriangle(ray, p0, p1, p2); @@ -148,7 +148,7 @@ describe("Core/IntersectionTests", function () { const ray = new Ray( new Cartesian3(1.0, 1.0, 1.0), - Cartesian3.negate(Cartesian3.UNIT_Z, new Cartesian3()) + Cartesian3.negate(Cartesian3.UNIT_Z, new Cartesian3()), ); const intersection = IntersectionTests.rayTriangle(ray, p0, p1, p2); @@ -162,7 +162,7 @@ describe("Core/IntersectionTests", function () { const ray = new Ray( new Cartesian3(-1.0, 1.0, 1.0), - Cartesian3.negate(Cartesian3.UNIT_Z, new Cartesian3()) + Cartesian3.negate(Cartesian3.UNIT_Z, new Cartesian3()), ); const intersection = IntersectionTests.rayTriangle(ray, p0, p1, p2); @@ -214,7 +214,7 @@ describe("Core/IntersectionTests", function () { IntersectionTests.lineSegmentTriangle( new Cartesian3(), new Cartesian3(), - new Cartesian3() + new Cartesian3(), ); }).toThrowDeveloperError(); }); @@ -225,7 +225,7 @@ describe("Core/IntersectionTests", function () { new Cartesian3(), new Cartesian3(), new Cartesian3(), - new Cartesian3() + new Cartesian3(), ); }).toThrowDeveloperError(); }); @@ -243,7 +243,7 @@ describe("Core/IntersectionTests", function () { v1, p0, p1, - p2 + p2, ); expect(intersection).toEqual(Cartesian3.ZERO); }); @@ -261,7 +261,7 @@ describe("Core/IntersectionTests", function () { v1, p0, p1, - p2 + p2, ); expect(intersection).toEqual(Cartesian3.ZERO); }); @@ -280,7 +280,7 @@ describe("Core/IntersectionTests", function () { p0, p1, p2, - true + true, ); expect(intersection).not.toBeDefined(); }); @@ -294,7 +294,7 @@ describe("Core/IntersectionTests", function () { const v1 = Cartesian3.add( v0, Cartesian3.negate(Cartesian3.UNIT_Z, new Cartesian3()), - new Cartesian3() + new Cartesian3(), ); const intersection = IntersectionTests.lineSegmentTriangle( @@ -302,7 +302,7 @@ describe("Core/IntersectionTests", function () { v1, p0, p1, - p2 + p2, ); expect(intersection).not.toBeDefined(); }); @@ -316,7 +316,7 @@ describe("Core/IntersectionTests", function () { const v1 = Cartesian3.add( v0, Cartesian3.negate(Cartesian3.UNIT_Z, new Cartesian3()), - new Cartesian3() + new Cartesian3(), ); const intersection = IntersectionTests.lineSegmentTriangle( @@ -324,7 +324,7 @@ describe("Core/IntersectionTests", function () { v1, p0, p1, - p2 + p2, ); expect(intersection).not.toBeDefined(); }); @@ -338,7 +338,7 @@ describe("Core/IntersectionTests", function () { const v1 = Cartesian3.add( v0, Cartesian3.negate(Cartesian3.UNIT_Z, new Cartesian3()), - new Cartesian3() + new Cartesian3(), ); const intersection = IntersectionTests.lineSegmentTriangle( @@ -346,7 +346,7 @@ describe("Core/IntersectionTests", function () { v1, p0, p1, - p2 + p2, ); expect(intersection).not.toBeDefined(); }); @@ -364,7 +364,7 @@ describe("Core/IntersectionTests", function () { v1, p0, p1, - p2 + p2, ); expect(intersection).not.toBeDefined(); }); @@ -378,7 +378,7 @@ describe("Core/IntersectionTests", function () { const v1 = Cartesian3.multiplyByScalar( Cartesian3.UNIT_Z, 2.0, - new Cartesian3() + new Cartesian3(), ); const intersection = IntersectionTests.lineSegmentTriangle( @@ -386,7 +386,7 @@ describe("Core/IntersectionTests", function () { v1, p0, p1, - p2 + p2, ); expect(intersection).not.toBeDefined(); }); @@ -399,7 +399,7 @@ describe("Core/IntersectionTests", function () { const v0 = Cartesian3.multiplyByScalar( Cartesian3.UNIT_Z, 2.0, - new Cartesian3() + new Cartesian3(), ); const v1 = Cartesian3.UNIT_Z; @@ -408,7 +408,7 @@ describe("Core/IntersectionTests", function () { v1, p0, p1, - p2 + p2, ); expect(intersection).not.toBeDefined(); }); @@ -430,7 +430,7 @@ describe("Core/IntersectionTests", function () { let ray = new Ray( new Cartesian3(2.0, 0.0, 0.0), - new Cartesian3(-1.0, 0.0, 0.0) + new Cartesian3(-1.0, 0.0, 0.0), ); let intersections = IntersectionTests.raySphere(ray, unitSphere); expect(intersections.start).toEqualEpsilon(1.0, CesiumMath.EPSILON14); @@ -438,7 +438,7 @@ describe("Core/IntersectionTests", function () { ray = new Ray( new Cartesian3(0.0, 2.0, 0.0), - new Cartesian3(0.0, -1.0, 0.0) + new Cartesian3(0.0, -1.0, 0.0), ); intersections = IntersectionTests.raySphere(ray, unitSphere); expect(intersections.start).toEqualEpsilon(1.0, CesiumMath.EPSILON14); @@ -446,7 +446,7 @@ describe("Core/IntersectionTests", function () { ray = new Ray( new Cartesian3(0.0, 0.0, 2.0), - new Cartesian3(0.0, 0.0, -1.0) + new Cartesian3(0.0, 0.0, -1.0), ); intersections = IntersectionTests.raySphere(ray, unitSphere); expect(intersections.start).toEqualEpsilon(1.0, CesiumMath.EPSILON14); @@ -454,14 +454,14 @@ describe("Core/IntersectionTests", function () { ray = new Ray( new Cartesian3(1.0, 1.0, 0.0), - new Cartesian3(-1.0, 0.0, 0.0) + new Cartesian3(-1.0, 0.0, 0.0), ); intersections = IntersectionTests.raySphere(ray, unitSphere); expect(intersections.start).toEqualEpsilon(1.0, CesiumMath.EPSILON14); ray = new Ray( new Cartesian3(-2.0, 0.0, 0.0), - new Cartesian3(1.0, 0.0, 0.0) + new Cartesian3(1.0, 0.0, 0.0), ); intersections = IntersectionTests.raySphere(ray, unitSphere); expect(intersections.start).toEqualEpsilon(1.0, CesiumMath.EPSILON14); @@ -469,7 +469,7 @@ describe("Core/IntersectionTests", function () { ray = new Ray( new Cartesian3(0.0, -2.0, 0.0), - new Cartesian3(0.0, 1.0, 0.0) + new Cartesian3(0.0, 1.0, 0.0), ); intersections = IntersectionTests.raySphere(ray, unitSphere); expect(intersections.start).toEqualEpsilon(1.0, CesiumMath.EPSILON14); @@ -477,7 +477,7 @@ describe("Core/IntersectionTests", function () { ray = new Ray( new Cartesian3(0.0, 0.0, -2.0), - new Cartesian3(0.0, 0.0, 1.0) + new Cartesian3(0.0, 0.0, 1.0), ); intersections = IntersectionTests.raySphere(ray, unitSphere); expect(intersections.start).toEqualEpsilon(1.0, CesiumMath.EPSILON14); @@ -485,28 +485,28 @@ describe("Core/IntersectionTests", function () { ray = new Ray( new Cartesian3(-1.0, -1.0, 0.0), - new Cartesian3(1.0, 0.0, 0.0) + new Cartesian3(1.0, 0.0, 0.0), ); intersections = IntersectionTests.raySphere(ray, unitSphere); expect(intersections.start).toEqualEpsilon(1.0, CesiumMath.EPSILON14); ray = new Ray( new Cartesian3(-2.0, 0.0, 0.0), - new Cartesian3(-1.0, 0.0, 0.0) + new Cartesian3(-1.0, 0.0, 0.0), ); intersections = IntersectionTests.raySphere(ray, unitSphere); expect(intersections).toBeUndefined(); ray = new Ray( new Cartesian3(0.0, -2.0, 0.0), - new Cartesian3(0.0, -1.0, 0.0) + new Cartesian3(0.0, -1.0, 0.0), ); intersections = IntersectionTests.raySphere(ray, unitSphere); expect(intersections).toBeUndefined(); ray = new Ray( new Cartesian3(0.0, 0.0, -2.0), - new Cartesian3(0.0, 0.0, -1.0) + new Cartesian3(0.0, 0.0, -1.0), ); intersections = IntersectionTests.raySphere(ray, unitSphere); expect(intersections).toBeUndefined(); @@ -518,7 +518,7 @@ describe("Core/IntersectionTests", function () { const origin = new Cartesian3(200.0, 0.0, 0.0); const direction = Cartesian3.negate( Cartesian3.normalize(origin, new Cartesian3()), - new Cartesian3() + new Cartesian3(), ); const ray = new Ray(origin, direction); @@ -564,14 +564,14 @@ describe("Core/IntersectionTests", function () { let ray = new Ray( new Cartesian3(2.0, 0.0, 0.0), - new Cartesian3(0.0, 0.0, 1.0) + new Cartesian3(0.0, 0.0, 1.0), ); let intersections = IntersectionTests.raySphere(ray, unitSphere); expect(intersections).not.toBeDefined(); ray = new Ray( new Cartesian3(2.0, 0.0, 0.0), - new Cartesian3(0.0, 0.0, -1.0) + new Cartesian3(0.0, 0.0, -1.0), ); intersections = IntersectionTests.raySphere(ray, unitSphere); expect(intersections).not.toBeDefined(); @@ -582,7 +582,7 @@ describe("Core/IntersectionTests", function () { ray = new Ray( new Cartesian3(2.0, 0.0, 0.0), - new Cartesian3(0.0, -1.0, 0.0) + new Cartesian3(0.0, -1.0, 0.0), ); intersections = IntersectionTests.raySphere(ray, unitSphere); expect(intersections).not.toBeDefined(); @@ -593,7 +593,7 @@ describe("Core/IntersectionTests", function () { let ray = new Ray( new Cartesian3(202.0, 0.0, 0.0), - new Cartesian3(-1.0, 0.0, 0.0) + new Cartesian3(-1.0, 0.0, 0.0), ); let intersections = IntersectionTests.raySphere(ray, unitSphere); expect(intersections.start).toEqualEpsilon(1.0, CesiumMath.EPSILON14); @@ -601,7 +601,7 @@ describe("Core/IntersectionTests", function () { ray = new Ray( new Cartesian3(200.0, 2.0, 0.0), - new Cartesian3(0.0, -1.0, 0.0) + new Cartesian3(0.0, -1.0, 0.0), ); intersections = IntersectionTests.raySphere(ray, unitSphere); expect(intersections.start).toEqualEpsilon(1.0, CesiumMath.EPSILON14); @@ -609,7 +609,7 @@ describe("Core/IntersectionTests", function () { ray = new Ray( new Cartesian3(200.0, 0.0, 2.0), - new Cartesian3(0.0, 0.0, -1.0) + new Cartesian3(0.0, 0.0, -1.0), ); intersections = IntersectionTests.raySphere(ray, unitSphere); expect(intersections.start).toEqualEpsilon(1.0, CesiumMath.EPSILON14); @@ -617,14 +617,14 @@ describe("Core/IntersectionTests", function () { ray = new Ray( new Cartesian3(201.0, 1.0, 0.0), - new Cartesian3(-1.0, 0.0, 0.0) + new Cartesian3(-1.0, 0.0, 0.0), ); intersections = IntersectionTests.raySphere(ray, unitSphere); expect(intersections.start).toEqualEpsilon(1.0, CesiumMath.EPSILON14); ray = new Ray( new Cartesian3(198.0, 0.0, 0.0), - new Cartesian3(1.0, 0.0, 0.0) + new Cartesian3(1.0, 0.0, 0.0), ); intersections = IntersectionTests.raySphere(ray, unitSphere); expect(intersections.start).toEqualEpsilon(1.0, CesiumMath.EPSILON14); @@ -632,7 +632,7 @@ describe("Core/IntersectionTests", function () { ray = new Ray( new Cartesian3(200.0, -2.0, 0.0), - new Cartesian3(0.0, 1.0, 0.0) + new Cartesian3(0.0, 1.0, 0.0), ); intersections = IntersectionTests.raySphere(ray, unitSphere); expect(intersections.start).toEqualEpsilon(1.0, CesiumMath.EPSILON14); @@ -640,7 +640,7 @@ describe("Core/IntersectionTests", function () { ray = new Ray( new Cartesian3(200.0, 0.0, -2.0), - new Cartesian3(0.0, 0.0, 1.0) + new Cartesian3(0.0, 0.0, 1.0), ); intersections = IntersectionTests.raySphere(ray, unitSphere); expect(intersections.start).toEqualEpsilon(1.0, CesiumMath.EPSILON14); @@ -648,28 +648,28 @@ describe("Core/IntersectionTests", function () { ray = new Ray( new Cartesian3(199.0, -1.0, 0.0), - new Cartesian3(1.0, 0.0, 0.0) + new Cartesian3(1.0, 0.0, 0.0), ); intersections = IntersectionTests.raySphere(ray, unitSphere); expect(intersections.start).toEqualEpsilon(1.0, CesiumMath.EPSILON14); ray = new Ray( new Cartesian3(198.0, 0.0, 0.0), - new Cartesian3(-1.0, 0.0, 0.0) + new Cartesian3(-1.0, 0.0, 0.0), ); intersections = IntersectionTests.raySphere(ray, unitSphere); expect(intersections).toBeUndefined(); ray = new Ray( new Cartesian3(200.0, -2.0, 0.0), - new Cartesian3(0.0, -1.0, 0.0) + new Cartesian3(0.0, -1.0, 0.0), ); intersections = IntersectionTests.raySphere(ray, unitSphere); expect(intersections).toBeUndefined(); ray = new Ray( new Cartesian3(200.0, 0.0, -2.0), - new Cartesian3(0.0, 0.0, -1.0) + new Cartesian3(0.0, 0.0, -1.0), ); intersections = IntersectionTests.raySphere(ray, unitSphere); expect(intersections).toBeUndefined(); @@ -684,7 +684,7 @@ describe("Core/IntersectionTests", function () { it("rayEllipsoid throws without ellipsoid", function () { expect(function () { IntersectionTests.rayEllipsoid( - new Ray(new Cartesian3(), new Cartesian3()) + new Ray(new Cartesian3(), new Cartesian3()), ); }).toThrowDeveloperError(); }); @@ -694,7 +694,7 @@ describe("Core/IntersectionTests", function () { let ray = new Ray( new Cartesian3(2.0, 0.0, 0.0), - new Cartesian3(-1.0, 0.0, 0.0) + new Cartesian3(-1.0, 0.0, 0.0), ); let intersections = IntersectionTests.rayEllipsoid(ray, unitSphere); expect(intersections.start).toEqualEpsilon(1.0, CesiumMath.EPSILON14); @@ -702,7 +702,7 @@ describe("Core/IntersectionTests", function () { ray = new Ray( new Cartesian3(0.0, 2.0, 0.0), - new Cartesian3(0.0, -1.0, 0.0) + new Cartesian3(0.0, -1.0, 0.0), ); intersections = IntersectionTests.rayEllipsoid(ray, unitSphere); expect(intersections.start).toEqualEpsilon(1.0, CesiumMath.EPSILON14); @@ -710,7 +710,7 @@ describe("Core/IntersectionTests", function () { ray = new Ray( new Cartesian3(0.0, 0.0, 2.0), - new Cartesian3(0.0, 0.0, -1.0) + new Cartesian3(0.0, 0.0, -1.0), ); intersections = IntersectionTests.rayEllipsoid(ray, unitSphere); expect(intersections.start).toEqualEpsilon(1.0, CesiumMath.EPSILON14); @@ -718,14 +718,14 @@ describe("Core/IntersectionTests", function () { ray = new Ray( new Cartesian3(1.0, 1.0, 0.0), - new Cartesian3(-1.0, 0.0, 0.0) + new Cartesian3(-1.0, 0.0, 0.0), ); intersections = IntersectionTests.rayEllipsoid(ray, unitSphere); expect(intersections.start).toEqualEpsilon(1.0, CesiumMath.EPSILON14); ray = new Ray( new Cartesian3(-2.0, 0.0, 0.0), - new Cartesian3(1.0, 0.0, 0.0) + new Cartesian3(1.0, 0.0, 0.0), ); intersections = IntersectionTests.rayEllipsoid(ray, unitSphere); expect(intersections.start).toEqualEpsilon(1.0, CesiumMath.EPSILON14); @@ -733,7 +733,7 @@ describe("Core/IntersectionTests", function () { ray = new Ray( new Cartesian3(0.0, -2.0, 0.0), - new Cartesian3(0.0, 1.0, 0.0) + new Cartesian3(0.0, 1.0, 0.0), ); intersections = IntersectionTests.rayEllipsoid(ray, unitSphere); expect(intersections.start).toEqualEpsilon(1.0, CesiumMath.EPSILON14); @@ -741,7 +741,7 @@ describe("Core/IntersectionTests", function () { ray = new Ray( new Cartesian3(0.0, 0.0, -2.0), - new Cartesian3(0.0, 0.0, 1.0) + new Cartesian3(0.0, 0.0, 1.0), ); intersections = IntersectionTests.rayEllipsoid(ray, unitSphere); expect(intersections.start).toEqualEpsilon(1.0, CesiumMath.EPSILON14); @@ -749,28 +749,28 @@ describe("Core/IntersectionTests", function () { ray = new Ray( new Cartesian3(-1.0, -1.0, 0.0), - new Cartesian3(1.0, 0.0, 0.0) + new Cartesian3(1.0, 0.0, 0.0), ); intersections = IntersectionTests.rayEllipsoid(ray, unitSphere); expect(intersections.start).toEqualEpsilon(1.0, CesiumMath.EPSILON14); ray = new Ray( new Cartesian3(-2.0, 0.0, 0.0), - new Cartesian3(-1.0, 0.0, 0.0) + new Cartesian3(-1.0, 0.0, 0.0), ); intersections = IntersectionTests.rayEllipsoid(ray, unitSphere); expect(intersections).toBeUndefined(); ray = new Ray( new Cartesian3(0.0, -2.0, 0.0), - new Cartesian3(0.0, -1.0, 0.0) + new Cartesian3(0.0, -1.0, 0.0), ); intersections = IntersectionTests.rayEllipsoid(ray, unitSphere); expect(intersections).toBeUndefined(); ray = new Ray( new Cartesian3(0.0, 0.0, -2.0), - new Cartesian3(0.0, 0.0, -1.0) + new Cartesian3(0.0, 0.0, -1.0), ); intersections = IntersectionTests.rayEllipsoid(ray, unitSphere); expect(intersections).toBeUndefined(); @@ -782,7 +782,7 @@ describe("Core/IntersectionTests", function () { const origin = new Cartesian3(20000.0, 0.0, 0.0); const direction = Cartesian3.negate( Cartesian3.normalize(origin, new Cartesian3()), - new Cartesian3() + new Cartesian3(), ); const ray = new Ray(origin, direction); @@ -828,14 +828,14 @@ describe("Core/IntersectionTests", function () { let ray = new Ray( new Cartesian3(2.0, 0.0, 0.0), - new Cartesian3(0.0, 0.0, 1.0) + new Cartesian3(0.0, 0.0, 1.0), ); let intersections = IntersectionTests.rayEllipsoid(ray, unitSphere); expect(intersections).not.toBeDefined(); ray = new Ray( new Cartesian3(2.0, 0.0, 0.0), - new Cartesian3(0.0, 0.0, -1.0) + new Cartesian3(0.0, 0.0, -1.0), ); intersections = IntersectionTests.rayEllipsoid(ray, unitSphere); expect(intersections).not.toBeDefined(); @@ -846,7 +846,7 @@ describe("Core/IntersectionTests", function () { ray = new Ray( new Cartesian3(2.0, 0.0, 0.0), - new Cartesian3(0.0, -1.0, 0.0) + new Cartesian3(0.0, -1.0, 0.0), ); intersections = IntersectionTests.rayEllipsoid(ray, unitSphere); expect(intersections).not.toBeDefined(); @@ -868,7 +868,7 @@ describe("Core/IntersectionTests", function () { const ellipsoid = Ellipsoid.UNIT_SPHERE; const ray = new Ray(new Cartesian3(3.0, 0.0, 0.0), Cartesian3.UNIT_X); expect(IntersectionTests.grazingAltitudeLocation(ray, ellipsoid)).toEqual( - ray.origin + ray.origin, ); }); @@ -881,7 +881,7 @@ describe("Core/IntersectionTests", function () { ray = new Ray( new Cartesian3(0.0, 2.0, 2.0), - Cartesian3.negate(Cartesian3.UNIT_Y, new Cartesian3()) + Cartesian3.negate(Cartesian3.UNIT_Y, new Cartesian3()), ); expected = new Cartesian3(0.0, 0.0, 2.0); actual = IntersectionTests.grazingAltitudeLocation(ray, ellipsoid); @@ -893,18 +893,18 @@ describe("Core/IntersectionTests", function () { const origin = new Cartesian3( 6502435.411150063, -6350860.759819263, - -7230794.954832983 + -7230794.954832983, ); const direction = new Cartesian3( -0.6053473557455881, 0.002372596412575323, - 0.7959578818493397 + 0.7959578818493397, ); const ray = new Ray(origin, direction); const expected = new Cartesian3( 628106.8386515155, -6327836.936616249, - 493230.07552381355 + 493230.07552381355, ); const actual = IntersectionTests.grazingAltitudeLocation(ray, ellipsoid); expect(actual).toEqualEpsilon(expected, CesiumMath.EPSILON8); @@ -915,18 +915,18 @@ describe("Core/IntersectionTests", function () { const origin = new Cartesian3( -6546204.940468501, -10625195.62660887, - -6933745.82875373 + -6933745.82875373, ); const direction = new Cartesian3( 0.5130076305689283, 0.38589525779680295, - 0.766751603185799 + 0.766751603185799, ); const ray = new Ray(origin, direction); const expected = new Cartesian3( -125.9063174739769, -5701095.640722358, - 2850156.57342018 + 2850156.57342018, ); const actual = IntersectionTests.grazingAltitudeLocation(ray, ellipsoid); expect(actual).toEqualEpsilon(expected, CesiumMath.EPSILON10); @@ -943,7 +943,7 @@ describe("Core/IntersectionTests", function () { const ellipsoid = Ellipsoid.UNIT_SPHERE; const ray = new Ray(Cartesian3.ZERO, Cartesian3.UNIT_Z); expect( - IntersectionTests.grazingAltitudeLocation(ray, ellipsoid) + IntersectionTests.grazingAltitudeLocation(ray, ellipsoid), ).not.toBeDefined(); }); @@ -958,7 +958,7 @@ describe("Core/IntersectionTests", function () { const intersectionPoint = IntersectionTests.lineSegmentPlane( endPoint0, endPoint1, - plane + plane, ); expect(intersectionPoint).toEqual(new Cartesian3(1.0, 2.0, 0.0)); @@ -973,7 +973,7 @@ describe("Core/IntersectionTests", function () { const intersectionPoint = IntersectionTests.lineSegmentPlane( endPoint0, endPoint1, - plane + plane, ); expect(intersectionPoint).not.toBeDefined(); @@ -988,7 +988,7 @@ describe("Core/IntersectionTests", function () { const intersectionPoint = IntersectionTests.lineSegmentPlane( endPoint0, endPoint1, - plane + plane, ); expect(intersectionPoint).not.toBeDefined(); @@ -1003,7 +1003,7 @@ describe("Core/IntersectionTests", function () { const intersectionPoint = IntersectionTests.lineSegmentPlane( endPoint0, endPoint1, - plane + plane, ); expect(intersectionPoint).not.toBeDefined(); @@ -1037,7 +1037,7 @@ describe("Core/IntersectionTests", function () { p0, p1, p2, - plane + plane, ); expect(triangles).not.toBeDefined(); }); @@ -1045,7 +1045,7 @@ describe("Core/IntersectionTests", function () { it("triangle is behind a plane", function () { const plane = new Plane( Cartesian3.negate(Cartesian3.UNIT_Z, new Cartesian3()), - 0.0 + 0.0, ); const p0 = new Cartesian3(0.0, 0.0, 2.0); const p1 = new Cartesian3(0.0, 1.0, 2.0); @@ -1055,7 +1055,7 @@ describe("Core/IntersectionTests", function () { p0, p1, p2, - plane + plane, ); expect(triangles).not.toBeDefined(); }); @@ -1070,12 +1070,12 @@ describe("Core/IntersectionTests", function () { p0, p1, p2, - plane + plane, ); expect(triangles).toBeDefined(); expect(triangles.indices.length).toEqual(3 + 6); expect( - Cartesian3.equals(triangles.positions[triangles.indices[0]], p0) + Cartesian3.equals(triangles.positions[triangles.indices[0]], p0), ).toEqual(true); }); @@ -1089,12 +1089,12 @@ describe("Core/IntersectionTests", function () { p0, p1, p2, - plane + plane, ); expect(triangles).toBeDefined(); expect(triangles.indices.length).toEqual(3 + 6); expect( - Cartesian3.equals(triangles.positions[triangles.indices[0]], p1) + Cartesian3.equals(triangles.positions[triangles.indices[0]], p1), ).toEqual(true); }); @@ -1108,12 +1108,12 @@ describe("Core/IntersectionTests", function () { p0, p1, p2, - plane + plane, ); expect(triangles).toBeDefined(); expect(triangles.indices.length).toEqual(3 + 6); expect( - Cartesian3.equals(triangles.positions[triangles.indices[0]], p2) + Cartesian3.equals(triangles.positions[triangles.indices[0]], p2), ).toEqual(true); }); @@ -1127,15 +1127,15 @@ describe("Core/IntersectionTests", function () { p0, p1, p2, - plane + plane, ); expect(triangles).toBeDefined(); expect(triangles.indices.length).toEqual(6 + 3); expect( - Cartesian3.equals(triangles.positions[triangles.indices[0]], p1) + Cartesian3.equals(triangles.positions[triangles.indices[0]], p1), ).toEqual(true); // p0 is in front expect( - Cartesian3.equals(triangles.positions[triangles.indices[1]], p2) + Cartesian3.equals(triangles.positions[triangles.indices[1]], p2), ).toEqual(true); }); @@ -1149,15 +1149,15 @@ describe("Core/IntersectionTests", function () { p0, p1, p2, - plane + plane, ); expect(triangles).toBeDefined(); expect(triangles.indices.length).toEqual(6 + 3); expect( - Cartesian3.equals(triangles.positions[triangles.indices[0]], p2) + Cartesian3.equals(triangles.positions[triangles.indices[0]], p2), ).toEqual(true); // p1 is in front expect( - Cartesian3.equals(triangles.positions[triangles.indices[1]], p0) + Cartesian3.equals(triangles.positions[triangles.indices[1]], p0), ).toEqual(true); }); @@ -1171,16 +1171,16 @@ describe("Core/IntersectionTests", function () { p0, p1, p2, - plane + plane, ); expect(triangles).toBeDefined(); expect(triangles.indices.length).toEqual(6 + 3); expect( Cartesian3.equals(triangles.positions[triangles.indices[0]], p0), - true + true, ); // p2 is in front expect( - Cartesian3.equals(triangles.positions[triangles.indices[1]], p1) + Cartesian3.equals(triangles.positions[triangles.indices[1]], p1), ).toEqual(true); }); diff --git a/packages/engine/Specs/Core/Intersections2DSpec.js b/packages/engine/Specs/Core/Intersections2DSpec.js index cfa2819c2534..fd922961eac1 100644 --- a/packages/engine/Specs/Core/Intersections2DSpec.js +++ b/packages/engine/Specs/Core/Intersections2DSpec.js @@ -8,7 +8,7 @@ describe("Core/Intersections2D", function () { false, 0.2, 0.3, - 0.4 + 0.4, ); expect(result.length).toBe(0); }); @@ -19,7 +19,7 @@ describe("Core/Intersections2D", function () { true, 0.2, 0.3, - 0.4 + 0.4, ); expect(result.length).toBe(3); expect(result[0]).toBe(0); @@ -33,7 +33,7 @@ describe("Core/Intersections2D", function () { false, 0.6, 0.4, - 0.2 + 0.2, ); expect(result.length).toBe(10); @@ -57,7 +57,7 @@ describe("Core/Intersections2D", function () { true, 0.4, 0.6, - 0.8 + 0.8, ); expect(result.length).toBe(10); @@ -81,7 +81,7 @@ describe("Core/Intersections2D", function () { false, 0.2, 0.6, - 0.4 + 0.4, ); expect(result.length).toBe(10); @@ -105,7 +105,7 @@ describe("Core/Intersections2D", function () { true, 0.8, 0.4, - 0.6 + 0.6, ); expect(result.length).toBe(10); @@ -129,7 +129,7 @@ describe("Core/Intersections2D", function () { false, 0.4, 0.2, - 0.6 + 0.6, ); expect(result.length).toBe(10); @@ -153,7 +153,7 @@ describe("Core/Intersections2D", function () { true, 0.6, 0.8, - 0.4 + 0.4, ); expect(result.length).toBe(10); @@ -177,7 +177,7 @@ describe("Core/Intersections2D", function () { false, 0.4, 0.6, - 0.8 + 0.8, ); expect(result.length).toBe(9); @@ -200,7 +200,7 @@ describe("Core/Intersections2D", function () { true, 0.6, 0.4, - 0.2 + 0.2, ); expect(result.length).toBe(9); @@ -223,7 +223,7 @@ describe("Core/Intersections2D", function () { false, 0.8, 0.4, - 0.6 + 0.6, ); expect(result.length).toBe(9); @@ -246,7 +246,7 @@ describe("Core/Intersections2D", function () { true, 0.2, 0.6, - 0.4 + 0.4, ); expect(result.length).toBe(9); @@ -269,7 +269,7 @@ describe("Core/Intersections2D", function () { false, 0.6, 0.8, - 0.4 + 0.4, ); expect(result.length).toBe(9); @@ -292,7 +292,7 @@ describe("Core/Intersections2D", function () { true, 0.4, 0.2, - 0.6 + 0.6, ); expect(result.length).toBe(9); @@ -320,7 +320,7 @@ describe("Core/Intersections2D", function () { 1.0, 0.0, 0.0, - 1.0 + 1.0, ); expect(ll.x).toEqualEpsilon(1.0, 1e-15); expect(ll.y).toEqualEpsilon(0.0, 1e-15); @@ -334,7 +334,7 @@ describe("Core/Intersections2D", function () { 1.0, 0.0, 0.0, - 1.0 + 1.0, ); expect(lr.x).toEqualEpsilon(0.0, 1e-15); expect(lr.y).toEqualEpsilon(1.0, 1e-15); @@ -348,7 +348,7 @@ describe("Core/Intersections2D", function () { 1.0, 0.0, 0.0, - 1.0 + 1.0, ); expect(ul.x).toEqualEpsilon(0.0, 1e-15); expect(ul.y).toEqualEpsilon(0.0, 1e-15); @@ -364,7 +364,7 @@ describe("Core/Intersections2D", function () { -1, -0.5, 1, - -0.5 + -0.5, ); expect(result.x).toEqualEpsilon(1.0 / 3.0, 1e-15); expect(result.y).toEqualEpsilon(1.0 / 3.0, 1e-15); @@ -380,7 +380,7 @@ describe("Core/Intersections2D", function () { 2.0, 1.0, 1.0, - 2.0 + 2.0, ); expect(e12.x).toEqualEpsilon(0.5, 1e-15); expect(e12.y).toEqualEpsilon(0.5, 1e-15); @@ -394,7 +394,7 @@ describe("Core/Intersections2D", function () { 2.0, 1.0, 1.0, - 2.0 + 2.0, ); expect(e23.x).toEqualEpsilon(0.0, 1e-15); expect(e23.y).toEqualEpsilon(0.5, 1e-15); @@ -408,7 +408,7 @@ describe("Core/Intersections2D", function () { 2.0, 1.0, 1.0, - 2.0 + 2.0, ); expect(e31.x).toEqualEpsilon(0.5, 1e-15); expect(e31.y).toEqualEpsilon(0.0, 1e-15); @@ -424,7 +424,7 @@ describe("Core/Intersections2D", function () { 2.0, 1.0, 1.0, - 2.0 + 2.0, ); expect(result1.x).toBeGreaterThan(0.0); expect(result1.y).toBeLessThan(0.0); @@ -438,7 +438,7 @@ describe("Core/Intersections2D", function () { 2.0, 1.0, 1.0, - 2.0 + 2.0, ); expect(result2.x).toBeLessThan(0.0); expect(result2.y).toBeGreaterThan(0.0); @@ -452,7 +452,7 @@ describe("Core/Intersections2D", function () { 2.0, 1.0, 1.0, - 2.0 + 2.0, ); expect(result3.x).toBeLessThan(0.0); expect(result3.y).toBeLessThan(0.0); @@ -462,162 +462,174 @@ describe("Core/Intersections2D", function () { describe("computeLineSegmentLineSegmentIntersection", function () { it("returns the correct result for intersection point", function () { - const intersection0 = Intersections2D.computeLineSegmentLineSegmentIntersection( - 0.0, - 0.0, - 0.0, - 2.0, - -1.0, - 1.0, - 1.0, - 1.0 - ); + const intersection0 = + Intersections2D.computeLineSegmentLineSegmentIntersection( + 0.0, + 0.0, + 0.0, + 2.0, + -1.0, + 1.0, + 1.0, + 1.0, + ); expect(intersection0.x).toEqualEpsilon(0.0, 1e-15); expect(intersection0.y).toEqualEpsilon(1.0, 1e-15); - const intersection1 = Intersections2D.computeLineSegmentLineSegmentIntersection( - 0.0, - 0.0, - 10.0, - 5.0, - 0.0, - 5.0, - 10.0, - 0.0 - ); + const intersection1 = + Intersections2D.computeLineSegmentLineSegmentIntersection( + 0.0, + 0.0, + 10.0, + 5.0, + 0.0, + 5.0, + 10.0, + 0.0, + ); expect(intersection1.x).toEqualEpsilon(5.0, 1e-15); expect(intersection1.y).toEqualEpsilon(2.5, 1e-15); - const intersection2 = Intersections2D.computeLineSegmentLineSegmentIntersection( - 0.0, - -5.0, - 4.0, - 3.0, - -2.0, - 1.0, - 4.0, - -2.0 - ); + const intersection2 = + Intersections2D.computeLineSegmentLineSegmentIntersection( + 0.0, + -5.0, + 4.0, + 3.0, + -2.0, + 1.0, + 4.0, + -2.0, + ); expect(intersection2.x).toEqualEpsilon(2.0, 1e-15); expect(intersection2.y).toEqualEpsilon(-1.0, 1e-15); }); it("returns the correct result for intersection point on a vertex", function () { - const intersection0 = Intersections2D.computeLineSegmentLineSegmentIntersection( - 0.0, - 0.0, - 0.0, - 2.0, - -1.0, - 0.0, - 1.0, - 0.0 - ); + const intersection0 = + Intersections2D.computeLineSegmentLineSegmentIntersection( + 0.0, + 0.0, + 0.0, + 2.0, + -1.0, + 0.0, + 1.0, + 0.0, + ); expect(intersection0.x).toEqualEpsilon(0.0, 1e-15); expect(intersection0.y).toEqualEpsilon(0.0, 1e-15); - const intersection1 = Intersections2D.computeLineSegmentLineSegmentIntersection( - 0.0, - 0.0, - 1.0, - 1.0, - 1.0, - 1.0, - 2.0, - 0.0 - ); + const intersection1 = + Intersections2D.computeLineSegmentLineSegmentIntersection( + 0.0, + 0.0, + 1.0, + 1.0, + 1.0, + 1.0, + 2.0, + 0.0, + ); expect(intersection1.x).toEqualEpsilon(1.0, 1e-15); expect(intersection1.y).toEqualEpsilon(1.0, 1e-15); - const intersection2 = Intersections2D.computeLineSegmentLineSegmentIntersection( - 0.0, - 0.0, - 4.0, - 3.0, - 5.0, - 0.0, - 4.0, - 3.0 - ); + const intersection2 = + Intersections2D.computeLineSegmentLineSegmentIntersection( + 0.0, + 0.0, + 4.0, + 3.0, + 5.0, + 0.0, + 4.0, + 3.0, + ); expect(intersection2.x).toEqualEpsilon(4.0, 1e-15); expect(intersection2.y).toEqualEpsilon(3.0, 1e-15); }); it("returns undefined for non-intersecting lines", function () { - const intersection0 = Intersections2D.computeLineSegmentLineSegmentIntersection( - 0.0, - 0.0, - 0.0, - 5.0, - 0.1, - 4.8, - 5.0, - 0.0 - ); + const intersection0 = + Intersections2D.computeLineSegmentLineSegmentIntersection( + 0.0, + 0.0, + 0.0, + 5.0, + 0.1, + 4.8, + 5.0, + 0.0, + ); expect(intersection0).toBeUndefined(); - const intersection1 = Intersections2D.computeLineSegmentLineSegmentIntersection( - 10.0, - 0.0, - 0.0, - -10.0, - 0.0, - 0.0, - -8.0, - -8.0 - ); + const intersection1 = + Intersections2D.computeLineSegmentLineSegmentIntersection( + 10.0, + 0.0, + 0.0, + -10.0, + 0.0, + 0.0, + -8.0, + -8.0, + ); expect(intersection1).toBeUndefined(); }); it("returns undefined for parallel lines", function () { - const intersection0 = Intersections2D.computeLineSegmentLineSegmentIntersection( - 0.0, - 0.0, - 0.0, - 2.0, - 1.0, - 1.0, - 1.0, - 4.0 - ); + const intersection0 = + Intersections2D.computeLineSegmentLineSegmentIntersection( + 0.0, + 0.0, + 0.0, + 2.0, + 1.0, + 1.0, + 1.0, + 4.0, + ); expect(intersection0).toBeUndefined(); - const intersection1 = Intersections2D.computeLineSegmentLineSegmentIntersection( - 1.0, - 1.0, - 4.0, - 4.0, - 0.0, - 0.0, - 3.0, - 3.0 - ); + const intersection1 = + Intersections2D.computeLineSegmentLineSegmentIntersection( + 1.0, + 1.0, + 4.0, + 4.0, + 0.0, + 0.0, + 3.0, + 3.0, + ); expect(intersection1).toBeUndefined(); }); it("returns undefined for coincident lines", function () { - const intersection0 = Intersections2D.computeLineSegmentLineSegmentIntersection( - 0.0, - 0.0, - 0.0, - 2.0, - 0.0, - 1.0, - 0.0, - 4.0 - ); + const intersection0 = + Intersections2D.computeLineSegmentLineSegmentIntersection( + 0.0, + 0.0, + 0.0, + 2.0, + 0.0, + 1.0, + 0.0, + 4.0, + ); expect(intersection0).toBeUndefined(); - const intersection1 = Intersections2D.computeLineSegmentLineSegmentIntersection( - 0.0, - 0.0, - 0.0, - 2.0, - 0.0, - 0.0, - 0.0, - 2.0 - ); + const intersection1 = + Intersections2D.computeLineSegmentLineSegmentIntersection( + 0.0, + 0.0, + 0.0, + 2.0, + 0.0, + 0.0, + 0.0, + 2.0, + ); expect(intersection1).toBeUndefined(); }); }); diff --git a/packages/engine/Specs/Core/IonGeocoderServiceSpec.js b/packages/engine/Specs/Core/IonGeocoderServiceSpec.js index 43b490eab0a1..17951c615c02 100644 --- a/packages/engine/Specs/Core/IonGeocoderServiceSpec.js +++ b/packages/engine/Specs/Core/IonGeocoderServiceSpec.js @@ -47,7 +47,7 @@ describe("Core/IonGeocoderService", function () { const expectedResult = ["results"]; spyOn(service._pelias, "geocode").and.returnValue( - Promise.resolve(expectedResult) + Promise.resolve(expectedResult), ); const query = "some query"; @@ -55,7 +55,7 @@ describe("Core/IonGeocoderService", function () { expect(result).toEqual(expectedResult); expect(service._pelias.geocode).toHaveBeenCalledWith( query, - GeocodeType.SEARCH + GeocodeType.SEARCH, ); }); diff --git a/packages/engine/Specs/Core/IonResourceSpec.js b/packages/engine/Specs/Core/IonResourceSpec.js index 754bbbb030c9..fe073840afc5 100644 --- a/packages/engine/Specs/Core/IonResourceSpec.js +++ b/packages/engine/Specs/Core/IonResourceSpec.js @@ -64,35 +64,35 @@ describe("Core/IonResource", function () { const options = {}; const resourceEndpoint = IonResource._createEndpointResource( tilesAssetId, - options + options, ); spyOn(IonResource, "_createEndpointResource").and.returnValue( - resourceEndpoint + resourceEndpoint, ); spyOn(resourceEndpoint, "fetchJson").and.returnValue( - Promise.resolve(tilesEndpoint) + Promise.resolve(tilesEndpoint), ); - return IonResource.fromAssetId(tilesAssetId, options).then(function ( - resource - ) { - expect(IonResource._createEndpointResource).toHaveBeenCalledWith( - tilesAssetId, - options - ); - expect(resourceEndpoint.fetchJson).toHaveBeenCalled(); - expect(resource._ionEndpointResource).toEqual(resourceEndpoint); - expect(resource._ionEndpoint).toEqual(tilesEndpoint); - }); + return IonResource.fromAssetId(tilesAssetId, options).then( + function (resource) { + expect(IonResource._createEndpointResource).toHaveBeenCalledWith( + tilesAssetId, + options, + ); + expect(resourceEndpoint.fetchJson).toHaveBeenCalled(); + expect(resource._ionEndpointResource).toEqual(resourceEndpoint); + expect(resource._ionEndpoint).toEqual(tilesEndpoint); + }, + ); }); function testNonImageryExternalResource(externalEndpoint) { const resourceEndpoint = IonResource._createEndpointResource(123890213); spyOn(IonResource, "_createEndpointResource").and.returnValue( - resourceEndpoint + resourceEndpoint, ); spyOn(resourceEndpoint, "fetchJson").and.returnValue( - Promise.resolve(externalEndpoint) + Promise.resolve(externalEndpoint), ); return IonResource.fromAssetId(123890213).then(function (resource) { @@ -137,7 +137,7 @@ describe("Core/IonResource", function () { const assetId = 2348234; const resource = IonResource._createEndpointResource(assetId); expect(resource.url).toBe( - `${Ion.defaultServer.url}v1/assets/${assetId}/endpoint?access_token=${Ion.defaultAccessToken}` + `${Ion.defaultServer.url}v1/assets/${assetId}/endpoint?access_token=${Ion.defaultAccessToken}`, ); }); @@ -151,7 +151,7 @@ describe("Core/IonResource", function () { accessToken: accessToken, }); expect(resource.url).toBe( - `${serverUrl}v1/assets/${assetId}/endpoint?access_token=${accessToken}` + `${serverUrl}v1/assets/${assetId}/endpoint?access_token=${accessToken}`, ); }); @@ -165,7 +165,7 @@ describe("Core/IonResource", function () { const assetId = 2348234; const resource = IonResource._createEndpointResource(assetId); expect(resource.url).toBe( - `${Ion.defaultServer.url}v1/assets/${assetId}/endpoint?access_token=${Ion.defaultAccessToken}` + `${Ion.defaultServer.url}v1/assets/${assetId}/endpoint?access_token=${Ion.defaultAccessToken}`, ); Ion.defaultServer = defaultServer; @@ -353,7 +353,7 @@ describe("Core/IonResource", function () { return testCallback(derived, error).then(function () { expect(derived._ionEndpoint).toBe(resource._ionEndpoint); expect(derived.headers.Authorization).toEqual( - resource.headers.Authorization + resource.headers.Authorization, ); }); }); diff --git a/packages/engine/Specs/Core/JulianDateSpec.js b/packages/engine/Specs/Core/JulianDateSpec.js index 4a034a293659..9bc22b32d88e 100644 --- a/packages/engine/Specs/Core/JulianDateSpec.js +++ b/packages/engine/Specs/Core/JulianDateSpec.js @@ -236,7 +236,7 @@ describe("Core/JulianDate", function () { it("Construct from ISO8601 UTC calendar date and time, basic format", function () { const expectedDate = JulianDate.fromDate( - new Date(Date.UTC(2009, 7, 1, 12, 30, 25)) + new Date(Date.UTC(2009, 7, 1, 12, 30, 25)), ); const computedDate = JulianDate.fromIso8601("20090801T123025Z"); expect(computedDate).toEqual(expectedDate); @@ -244,7 +244,7 @@ describe("Core/JulianDate", function () { it("Construct from ISO8601 UTC calendar date and time, extended format", function () { const expectedDate = JulianDate.fromDate( - new Date(Date.UTC(2009, 7, 1, 12, 30, 25)) + new Date(Date.UTC(2009, 7, 1, 12, 30, 25)), ); const computedDate = JulianDate.fromIso8601("2009-08-01T12:30:25Z"); expect(computedDate).toEqual(expectedDate); @@ -257,7 +257,7 @@ describe("Core/JulianDate", function () { const expectedDate = new JulianDate( 2455045, 1825.5125423, - TimeStandard.UTC + TimeStandard.UTC, ); const computedDate = JulianDate.fromIso8601("20090801T123025.5125423Z"); expect(computedDate).toEqual(expectedDate); @@ -269,7 +269,7 @@ describe("Core/JulianDate", function () { const expectedDate = new JulianDate( 2455045, 1825.5125423, - TimeStandard.UTC + TimeStandard.UTC, ); const computedDate = JulianDate.fromIso8601("2009-08-01T12:30:25.5125423Z"); expect(computedDate).toEqual(expectedDate); @@ -282,7 +282,7 @@ describe("Core/JulianDate", function () { const expectedDate = new JulianDate( 2455045, 1825.5125423, - TimeStandard.UTC + TimeStandard.UTC, ); const computedDate = JulianDate.fromIso8601("20090801T123025,5125423Z"); expect(computedDate).toEqual(expectedDate); @@ -294,7 +294,7 @@ describe("Core/JulianDate", function () { const expectedDate = new JulianDate( 2455045, 1825.5125423, - TimeStandard.UTC + TimeStandard.UTC, ); const computedDate = JulianDate.fromIso8601("2009-08-01T12:30:25,5125423Z"); expect(computedDate).toEqual(expectedDate); @@ -302,7 +302,7 @@ describe("Core/JulianDate", function () { it("Construct from ISO8601 UTC calendar date and time no seconds, basic format", function () { const expectedDate = JulianDate.fromDate( - new Date(Date.UTC(2009, 7, 1, 12, 30, 0)) + new Date(Date.UTC(2009, 7, 1, 12, 30, 0)), ); const computedDate = JulianDate.fromIso8601("20090801T1230Z"); expect(computedDate).toEqual(expectedDate); @@ -310,7 +310,7 @@ describe("Core/JulianDate", function () { it("Construct from ISO8601 UTC calendar date and time no seconds, extended format", function () { const expectedDate = JulianDate.fromDate( - new Date(Date.UTC(2009, 7, 1, 12, 30, 0)) + new Date(Date.UTC(2009, 7, 1, 12, 30, 0)), ); const computedDate = JulianDate.fromIso8601("2009-08-01T12:30Z"); expect(computedDate).toEqual(expectedDate); @@ -318,7 +318,7 @@ describe("Core/JulianDate", function () { it("Construct from ISO8601 UTC calendar date and time fractional minutes, basic format", function () { const expectedDate = JulianDate.fromDate( - new Date(Date.UTC(2009, 7, 1, 12, 30, 30)) + new Date(Date.UTC(2009, 7, 1, 12, 30, 30)), ); const computedDate = JulianDate.fromIso8601("20090801T1230.5Z"); expect(computedDate).toEqual(expectedDate); @@ -326,7 +326,7 @@ describe("Core/JulianDate", function () { it("Construct from ISO8601 UTC calendar date and time fractional minutes, extended format", function () { const expectedDate = JulianDate.fromDate( - new Date(Date.UTC(2009, 7, 1, 12, 30, 30)) + new Date(Date.UTC(2009, 7, 1, 12, 30, 30)), ); const computedDate = JulianDate.fromIso8601("2009-08-01T12:30.5Z"); expect(computedDate).toEqual(expectedDate); @@ -334,7 +334,7 @@ describe("Core/JulianDate", function () { it('Construct from ISO8601 UTC calendar date and time fractional minutes, basic format, "," instead of "."', function () { const expectedDate = JulianDate.fromDate( - new Date(Date.UTC(2009, 7, 1, 12, 30, 30)) + new Date(Date.UTC(2009, 7, 1, 12, 30, 30)), ); const computedDate = JulianDate.fromIso8601("20090801T1230,5Z"); expect(computedDate).toEqual(expectedDate); @@ -342,7 +342,7 @@ describe("Core/JulianDate", function () { it('Construct from ISO8601 UTC calendar date and time fractional minutes, extended format, "," instead of "."', function () { const expectedDate = JulianDate.fromDate( - new Date(Date.UTC(2009, 7, 1, 12, 30, 30)) + new Date(Date.UTC(2009, 7, 1, 12, 30, 30)), ); const computedDate = JulianDate.fromIso8601("2009-08-01T12:30,5Z"); expect(computedDate).toEqual(expectedDate); @@ -350,7 +350,7 @@ describe("Core/JulianDate", function () { it("Construct from ISO8601 UTC calendar date and time no minutes/seconds, basic format", function () { const expectedDate = JulianDate.fromDate( - new Date(Date.UTC(2009, 7, 1, 12, 0, 0)) + new Date(Date.UTC(2009, 7, 1, 12, 0, 0)), ); const computedDate = JulianDate.fromIso8601("20090801T12Z"); expect(computedDate).toEqual(expectedDate); @@ -358,7 +358,7 @@ describe("Core/JulianDate", function () { it("Construct from ISO8601 UTC calendar date and time no minutes/seconds, extended format", function () { const expectedDate = JulianDate.fromDate( - new Date(Date.UTC(2009, 7, 1, 12, 0, 0)) + new Date(Date.UTC(2009, 7, 1, 12, 0, 0)), ); const computedDate = JulianDate.fromIso8601("2009-08-01T12Z"); expect(computedDate).toEqual(expectedDate); @@ -366,7 +366,7 @@ describe("Core/JulianDate", function () { it("Construct from ISO8601 UTC calendar date and time fractional hours, basic format", function () { const expectedDate = JulianDate.fromDate( - new Date(Date.UTC(2009, 7, 1, 12, 30, 0)) + new Date(Date.UTC(2009, 7, 1, 12, 30, 0)), ); const computedDate = JulianDate.fromIso8601("20090801T12.5Z"); expect(computedDate).toEqual(expectedDate); @@ -374,7 +374,7 @@ describe("Core/JulianDate", function () { it("Construct from ISO8601 UTC calendar date and time fractional hours, extended format", function () { const expectedDate = JulianDate.fromDate( - new Date(Date.UTC(2009, 7, 1, 12, 30, 0)) + new Date(Date.UTC(2009, 7, 1, 12, 30, 0)), ); const computedDate = JulianDate.fromIso8601("2009-08-01T12.5Z"); expect(computedDate).toEqual(expectedDate); @@ -382,7 +382,7 @@ describe("Core/JulianDate", function () { it('Construct from ISO8601 UTC calendar date and time fractional hours, basic format, "," instead of "."', function () { const expectedDate = JulianDate.fromDate( - new Date(Date.UTC(2009, 7, 1, 12, 30, 0)) + new Date(Date.UTC(2009, 7, 1, 12, 30, 0)), ); const computedDate = JulianDate.fromIso8601("20090801T12,5Z"); expect(computedDate).toEqual(expectedDate); @@ -390,7 +390,7 @@ describe("Core/JulianDate", function () { it('Construct from ISO8601 UTC calendar date and time fractional hours, extended format, "," instead of "."', function () { const expectedDate = JulianDate.fromDate( - new Date(Date.UTC(2009, 7, 1, 12, 30, 0)) + new Date(Date.UTC(2009, 7, 1, 12, 30, 0)), ); const computedDate = JulianDate.fromIso8601("2009-08-01T12,5Z"); expect(computedDate).toEqual(expectedDate); @@ -404,12 +404,12 @@ describe("Core/JulianDate", function () { it("Construct from an ISO8601 UTC calendar date and time within a leap second", function () { const computedDate = JulianDate.fromIso8601( - "2008-12-31T23:59:60.123456789Z" + "2008-12-31T23:59:60.123456789Z", ); const expectedDate = new JulianDate( 2454832, 43233.123456789, - TimeStandard.TAI + TimeStandard.TAI, ); expect(computedDate).toEqual(expectedDate); }); @@ -428,7 +428,7 @@ describe("Core/JulianDate", function () { it("Construct from an ISO8601 calendar date and time using 24:00:00 midnight notation", function () { const expectedDate = JulianDate.fromDate( - new Date(Date.UTC(2009, 7, 2, 0, 0, 0)) + new Date(Date.UTC(2009, 7, 2, 0, 0, 0)), ); const computedDate = JulianDate.fromIso8601("2009-08-01T24:00:00Z"); expect(computedDate).toEqual(expectedDate); @@ -436,7 +436,7 @@ describe("Core/JulianDate", function () { it("Construct from an ISO8601 local calendar date with UTC offset that crosses into previous month", function () { const expectedDate = JulianDate.fromDate( - new Date(Date.UTC(1985, 2, 31, 23, 59, 0)) + new Date(Date.UTC(1985, 2, 31, 23, 59, 0)), ); const computedDate = JulianDate.fromIso8601("1985-04-01T00:59:00+01"); expect(computedDate).toEqual(expectedDate); @@ -444,7 +444,7 @@ describe("Core/JulianDate", function () { it("Construct from an ISO8601 local calendar date with UTC offset that crosses into next month", function () { const expectedDate = JulianDate.fromDate( - new Date(Date.UTC(1985, 3, 1, 0, 59, 0)) + new Date(Date.UTC(1985, 3, 1, 0, 59, 0)), ); const computedDate = JulianDate.fromIso8601("1985-03-31T23:59:00-01"); expect(computedDate).toEqual(expectedDate); @@ -452,7 +452,7 @@ describe("Core/JulianDate", function () { it("Construct from an ISO8601 local calendar date with UTC offset that crosses into next year", function () { const expectedDate = JulianDate.fromDate( - new Date(Date.UTC(2008, 11, 31, 23, 0, 0)) + new Date(Date.UTC(2008, 11, 31, 23, 0, 0)), ); const julianDate = JulianDate.fromIso8601("2009-01-01T01:00:00+02"); expect(julianDate).toEqual(expectedDate); @@ -460,7 +460,7 @@ describe("Core/JulianDate", function () { it("Construct from an ISO8601 local calendar date with UTC offset that crosses into previous year", function () { const expectedDate = JulianDate.fromDate( - new Date(Date.UTC(2009, 0, 1, 1, 0, 0)) + new Date(Date.UTC(2009, 0, 1, 1, 0, 0)), ); const julianDate = JulianDate.fromIso8601("2008-12-31T23:00:00-02"); expect(julianDate).toEqual(expectedDate); @@ -468,7 +468,7 @@ describe("Core/JulianDate", function () { it("Construct from an ISO8601 local calendar date with UTC offset", function () { const expectedDate = JulianDate.fromDate( - new Date(Date.UTC(2008, 10, 10, 12, 0, 0)) + new Date(Date.UTC(2008, 10, 10, 12, 0, 0)), ); const julianDate = JulianDate.fromIso8601("2008-11-10T14:00:00+02"); expect(julianDate).toEqual(expectedDate); @@ -476,7 +476,7 @@ describe("Core/JulianDate", function () { it("Construct from an ISO8601 local calendar date with UTC offset in extended format", function () { const expectedDate = JulianDate.fromDate( - new Date(Date.UTC(2008, 10, 10, 11, 30, 0)) + new Date(Date.UTC(2008, 10, 10, 11, 30, 0)), ); const julianDate = JulianDate.fromIso8601("2008-11-10T14:00:00+02:30"); expect(julianDate).toEqual(expectedDate); @@ -484,7 +484,7 @@ describe("Core/JulianDate", function () { it("Construct from an ISO8601 local calendar date with zero UTC offset in extended format", function () { const expectedDate = JulianDate.fromDate( - new Date(Date.UTC(2008, 10, 10, 14, 0, 0)) + new Date(Date.UTC(2008, 10, 10, 14, 0, 0)), ); const julianDate = JulianDate.fromIso8601("2008-11-10T14:00:00+00:00"); expect(julianDate).toEqual(expectedDate); @@ -492,7 +492,7 @@ describe("Core/JulianDate", function () { it("Construct from an ISO8601 local calendar date with zero UTC offset in extended format", function () { const expectedDate = JulianDate.fromDate( - new Date(Date.UTC(2008, 10, 10, 14, 0, 0)) + new Date(Date.UTC(2008, 10, 10, 14, 0, 0)), ); const julianDate = JulianDate.fromIso8601("2008-11-10T14:00:00+00"); expect(julianDate).toEqual(expectedDate); @@ -500,7 +500,7 @@ describe("Core/JulianDate", function () { it("Construct from ISO8601 local calendar date and time with no seconds and UTC offset in basic format", function () { const expectedDate = JulianDate.fromDate( - new Date(Date.UTC(2009, 7, 1, 12, 30, 0)) + new Date(Date.UTC(2009, 7, 1, 12, 30, 0)), ); const computedDate = JulianDate.fromIso8601("20090801T0730-0500"); expect(computedDate).toEqual(expectedDate); @@ -508,7 +508,7 @@ describe("Core/JulianDate", function () { it("Construct from ISO8601 local calendar date and time with no seconds and UTC offset in extended format", function () { const expectedDate = JulianDate.fromDate( - new Date(Date.UTC(2009, 7, 1, 12, 30, 0)) + new Date(Date.UTC(2009, 7, 1, 12, 30, 0)), ); const computedDate = JulianDate.fromIso8601("2009-08-01T07:30-05:00"); expect(computedDate).toEqual(expectedDate); @@ -559,7 +559,7 @@ describe("Core/JulianDate", function () { it("Fails to construct an ISO8601 date from a valid ISO8601 interval", function () { expect(function () { return JulianDate.fromIso8601( - "2007-03-01T13:00:00Z/2008-05-11T15:30:00Z" + "2007-03-01T13:00:00Z/2008-05-11T15:30:00Z", ); }).toThrowDeveloperError(); }); @@ -771,7 +771,7 @@ describe("Core/JulianDate", function () { it("toDate works a second before a leap second", function () { const expectedDate = new Date("6/30/1997 11:59:59 PM UTC"); const date = JulianDate.toDate( - new JulianDate(2450630, 43229.0, TimeStandard.TAI) + new JulianDate(2450630, 43229.0, TimeStandard.TAI), ); expect(date).toEqual(expectedDate); }); @@ -779,7 +779,7 @@ describe("Core/JulianDate", function () { it("toDate works on a leap second", function () { const expectedDate = new Date("6/30/1997 11:59:59 PM UTC"); const date = JulianDate.toDate( - new JulianDate(2450630, 43230.0, TimeStandard.TAI) + new JulianDate(2450630, 43230.0, TimeStandard.TAI), ); expect(date).toEqual(expectedDate); }); @@ -787,7 +787,7 @@ describe("Core/JulianDate", function () { it("toDate works a second after a leap second", function () { const expectedDate = new Date("7/1/1997 12:00:00 AM UTC"); const date = JulianDate.toDate( - new JulianDate(2450630, 43231.0, TimeStandard.TAI) + new JulianDate(2450630, 43231.0, TimeStandard.TAI), ); expect(date).toEqual(expectedDate); }); @@ -795,7 +795,7 @@ describe("Core/JulianDate", function () { it("toDate works on date before any leap seconds", function () { const expectedDate = new Date("09/10/1968 12:00:00 AM UTC"); const date = JulianDate.toDate( - new JulianDate(2440109, 43210.0, TimeStandard.TAI) + new JulianDate(2440109, 43210.0, TimeStandard.TAI), ); expect(date).toEqual(expectedDate); }); @@ -803,7 +803,7 @@ describe("Core/JulianDate", function () { it("toDate works on date later than all leap seconds", function () { const expectedDate = new Date("11/17/2039 12:00:00 AM UTC"); const date = JulianDate.toDate( - new JulianDate(2466109, 43237.0, TimeStandard.TAI) + new JulianDate(2466109, 43237.0, TimeStandard.TAI), ); expect(date).toEqual(expectedDate); }); @@ -892,7 +892,7 @@ describe("Core/JulianDate", function () { const end = JulianDate.fromDate(new Date("July 5, 2011 12:01:00 UTC")); expect(JulianDate.secondsDifference(end, start)).toEqualEpsilon( TimeConstants.SECONDS_PER_DAY + TimeConstants.SECONDS_PER_MINUTE, - CesiumMath.EPSILON5 + CesiumMath.EPSILON5, ); }); @@ -901,7 +901,7 @@ describe("Core/JulianDate", function () { const end = JulianDate.fromDate(new Date("July 5, 2011 12:01:00 UTC")); expect(JulianDate.secondsDifference(end, start)).toEqualEpsilon( TimeConstants.SECONDS_PER_DAY + TimeConstants.SECONDS_PER_MINUTE, - CesiumMath.EPSILON5 + CesiumMath.EPSILON5, ); }); @@ -910,7 +910,7 @@ describe("Core/JulianDate", function () { const end = JulianDate.fromDate(new Date("July 5, 2011 12:01:00 UTC")); expect(JulianDate.secondsDifference(end, start)).toEqualEpsilon( TimeConstants.SECONDS_PER_DAY + TimeConstants.SECONDS_PER_MINUTE, - CesiumMath.EPSILON5 + CesiumMath.EPSILON5, ); }); @@ -933,11 +933,11 @@ describe("Core/JulianDate", function () { const end = JulianDate.addSeconds(start, 95, new JulianDate()); expect(JulianDate.toDate(end).getUTCSeconds()).toEqualEpsilon( 5, - CesiumMath.EPSILON5 + CesiumMath.EPSILON5, ); expect(JulianDate.toDate(end).getUTCMinutes()).toEqualEpsilon( 2, - CesiumMath.EPSILON5 + CesiumMath.EPSILON5, ); }); @@ -951,7 +951,7 @@ describe("Core/JulianDate", function () { const start = JulianDate.fromDate(new Date("August 11 2011 6:00:00 UTC")); const end = JulianDate.addSeconds(start, 0.5, new JulianDate()); expect(JulianDate.secondsDifference(end, start, new JulianDate())).toEqual( - 0.5 + 0.5, ); }); @@ -959,7 +959,7 @@ describe("Core/JulianDate", function () { const start = JulianDate.fromDate(new Date("August 11 2011 11:59:59 UTC")); const end = JulianDate.addSeconds(start, 1.25, new JulianDate()); expect(JulianDate.secondsDifference(end, start, new JulianDate())).toEqual( - 1.25 + 1.25, ); }); @@ -987,7 +987,7 @@ describe("Core/JulianDate", function () { return JulianDate.addSeconds( JulianDate.now(), undefined, - new JulianDate() + new JulianDate(), ); }).toThrowDeveloperError(); }); @@ -996,11 +996,11 @@ describe("Core/JulianDate", function () { const end = JulianDate.addMinutes(start, 65, new JulianDate()); expect(JulianDate.toDate(end).getUTCMinutes()).toEqualEpsilon( 5, - CesiumMath.EPSILON5 + CesiumMath.EPSILON5, ); expect(JulianDate.toDate(end).getUTCHours()).toEqualEpsilon( 13, - CesiumMath.EPSILON5 + CesiumMath.EPSILON5, ); }); @@ -1009,11 +1009,11 @@ describe("Core/JulianDate", function () { const end = JulianDate.addMinutes(start, -35, new JulianDate()); expect(JulianDate.toDate(end).getUTCMinutes()).toEqualEpsilon( 25, - CesiumMath.EPSILON5 + CesiumMath.EPSILON5, ); expect(JulianDate.toDate(end).getUTCHours()).toEqualEpsilon( 11, - CesiumMath.EPSILON5 + CesiumMath.EPSILON5, ); }); @@ -1022,7 +1022,7 @@ describe("Core/JulianDate", function () { return JulianDate.addMinutes( JulianDate.now(), undefined, - new JulianDate() + new JulianDate(), ); }).toThrowDeveloperError(); }); @@ -1032,7 +1032,7 @@ describe("Core/JulianDate", function () { const end = JulianDate.addHours(start, 6, new JulianDate()); expect(JulianDate.toDate(end).getUTCHours()).toEqualEpsilon( 18, - CesiumMath.EPSILON5 + CesiumMath.EPSILON5, ); }); @@ -1041,7 +1041,7 @@ describe("Core/JulianDate", function () { const end = JulianDate.addHours(start, -6, new JulianDate()); expect(JulianDate.toDate(end).getUTCHours()).toEqualEpsilon( 6, - CesiumMath.EPSILON5 + CesiumMath.EPSILON5, ); }); it("addHours fails with undefined input", function () { @@ -1055,11 +1055,11 @@ describe("Core/JulianDate", function () { const end = JulianDate.addDays(start, 32, new JulianDate()); expect(JulianDate.toDate(end).getUTCDate()).toEqualEpsilon( 5, - CesiumMath.EPSILON5 + CesiumMath.EPSILON5, ); expect(JulianDate.toDate(end).getUTCMonth()).toEqualEpsilon( 7, - CesiumMath.EPSILON5 + CesiumMath.EPSILON5, ); }); @@ -1068,11 +1068,11 @@ describe("Core/JulianDate", function () { const end = JulianDate.addDays(start, -4, new JulianDate()); expect(JulianDate.toDate(end).getUTCDate()).toEqualEpsilon( 30, - CesiumMath.EPSILON5 + CesiumMath.EPSILON5, ); expect(JulianDate.toDate(end).getUTCMonth()).toEqualEpsilon( 5, - CesiumMath.EPSILON5 + CesiumMath.EPSILON5, ); }); @@ -1095,8 +1095,8 @@ describe("Core/JulianDate", function () { expect( JulianDate.lessThan( start, - JulianDate.addSeconds(end, 1, new JulianDate()) - ) + JulianDate.addSeconds(end, 1, new JulianDate()), + ), ).toEqual(true); }); @@ -1113,14 +1113,14 @@ describe("Core/JulianDate", function () { expect( JulianDate.lessThanOrEquals( JulianDate.addSeconds(start, 1, new JulianDate()), - end - ) + end, + ), ).toEqual(false); expect( JulianDate.lessThanOrEquals( JulianDate.addSeconds(start, -1, new JulianDate()), - end - ) + end, + ), ).toEqual(true); }); @@ -1137,8 +1137,8 @@ describe("Core/JulianDate", function () { expect( JulianDate.greaterThan( start, - JulianDate.addSeconds(end, -1, new JulianDate()) - ) + JulianDate.addSeconds(end, -1, new JulianDate()), + ), ).toEqual(true); }); @@ -1155,20 +1155,20 @@ describe("Core/JulianDate", function () { expect( JulianDate.greaterThanOrEquals( JulianDate.addSeconds(start, -1, new JulianDate()), - end - ) + end, + ), ).toEqual(false); expect( JulianDate.greaterThanOrEquals( JulianDate.addSeconds(start, 1, new JulianDate()), - end - ) + end, + ), ).toEqual(true); }); it("can be equal to within an epsilon of another JulianDate", function () { const original = JulianDate.fromDate( - new Date("September 7, 2011 12:55:00 UTC") + new Date("September 7, 2011 12:55:00 UTC"), ); let clone = JulianDate.fromDate(new Date("September 7, 2011 12:55:00 UTC")); clone = JulianDate.addSeconds(clone, 1, new JulianDate()); diff --git a/packages/engine/Specs/Core/LagrangePolynomialApproximationSpec.js b/packages/engine/Specs/Core/LagrangePolynomialApproximationSpec.js index d7771e80cc5b..cfeda6cf173b 100644 --- a/packages/engine/Specs/Core/LagrangePolynomialApproximationSpec.js +++ b/packages/engine/Specs/Core/LagrangePolynomialApproximationSpec.js @@ -6,30 +6,10 @@ describe("Core/LagrangePolynomialApproximation", function () { const xTable = [0, 60, 120, 180, 240, 300, 360, 420]; const yTable = [ - 13378137.0, - 0.0, - 0, - 13374128.3576279, - 327475.593690065, - 0, - 13362104.8328212, - 654754.936954423, - 0, - 13342073.6310691, - 981641.896976832, - 0, - 13314046.7567223, - 1307940.57608951, - 0, - 13278041.005799, - 1633455.42917117, - 0, - 13234077.9559193, - 1957991.38083385, - 0, - 13182183.953374, - 2281353.94232816, - 0, + 13378137.0, 0.0, 0, 13374128.3576279, 327475.593690065, 0, 13362104.8328212, + 654754.936954423, 0, 13342073.6310691, 981641.896976832, 0, + 13314046.7567223, 1307940.57608951, 0, 13278041.005799, 1633455.42917117, 0, + 13234077.9559193, 1957991.38083385, 0, 13182183.953374, 2281353.94232816, 0, ]; const x = 100.0; @@ -39,7 +19,7 @@ describe("Core/LagrangePolynomialApproximation", function () { x, xTable, yTable, - 3 + 3, ); const expectedResult = [13367002.870928623, 545695.7388100647, 0]; expect(result).toEqualEpsilon(expectedResult, 1e-15); @@ -52,7 +32,7 @@ describe("Core/LagrangePolynomialApproximation", function () { xTable, yTable, 3, - result + result, ); const expectedResult = [13367002.870928623, 545695.7388100647, 0]; expect(result).toBe(returnedResult); diff --git a/packages/engine/Specs/Core/LinearApproximationSpec.js b/packages/engine/Specs/Core/LinearApproximationSpec.js index d64c9de42620..cc5be320b17e 100644 --- a/packages/engine/Specs/Core/LinearApproximationSpec.js +++ b/packages/engine/Specs/Core/LinearApproximationSpec.js @@ -9,7 +9,7 @@ describe("Core/LinearApproximation", function () { 3.0, xTable, yTable, - 2 + 2, ); expect(results.length).toEqual(2); @@ -27,7 +27,7 @@ describe("Core/LinearApproximation", function () { xTable, yTable, 2, - result + result, ); expect(result).toBe(results); @@ -44,7 +44,7 @@ describe("Core/LinearApproximation", function () { 80.0, xTable2, yTable2, - 3 + 3, ); expect(results.length).toEqual(3); @@ -61,7 +61,7 @@ describe("Core/LinearApproximation", function () { 40, xTable3, yTable3, - 1 + 1, ); expect(results.length).toEqual(1); diff --git a/packages/engine/Specs/Core/LinearSplineSpec.js b/packages/engine/Specs/Core/LinearSplineSpec.js index b6f66748ffa6..c81a4a5ed935 100644 --- a/packages/engine/Specs/Core/LinearSplineSpec.js +++ b/packages/engine/Specs/Core/LinearSplineSpec.js @@ -93,7 +93,7 @@ describe("Core/LinearSpline", function () { cartesianPoints[0], cartesianPoints[1], t, - scratchCartesian + scratchCartesian, ); expect(ls.evaluate(time)).toEqual(expected); }); @@ -112,7 +112,7 @@ describe("Core/LinearSpline", function () { cartesianPoints[0], cartesianPoints[1], t, - scratchCartesian + scratchCartesian, ); expect(point).toBe(result); expect(result).toEqual(expected); diff --git a/packages/engine/Specs/Core/MathSpec.js b/packages/engine/Specs/Core/MathSpec.js index 5d4f5ac965bd..98af0d7c8ecf 100644 --- a/packages/engine/Specs/Core/MathSpec.js +++ b/packages/engine/Specs/Core/MathSpec.js @@ -165,21 +165,21 @@ describe("Core/Math", function () { it("convertLongitudeRange (1)", function () { expect( - CesiumMath.convertLongitudeRange(CesiumMath.THREE_PI_OVER_TWO) + CesiumMath.convertLongitudeRange(CesiumMath.THREE_PI_OVER_TWO), ).toEqualEpsilon(-CesiumMath.PI_OVER_TWO, CesiumMath.EPSILON16); }); it("convertLongitudeRange (2)", function () { expect(CesiumMath.convertLongitudeRange(-Math.PI)).toEqualEpsilon( -Math.PI, - CesiumMath.EPSILON16 + CesiumMath.EPSILON16, ); }); it("convertLongitudeRange (3)", function () { expect(CesiumMath.convertLongitudeRange(Math.PI)).toEqualEpsilon( -Math.PI, - CesiumMath.EPSILON16 + CesiumMath.EPSILON16, ); }); @@ -191,13 +191,13 @@ describe("Core/Math", function () { it("clampToLatitudeRange (1)", function () { expect(CesiumMath.clampToLatitudeRange(Math.PI)).toEqual( - CesiumMath.PI_OVER_TWO + CesiumMath.PI_OVER_TWO, ); }); it("clampToLatitudeRange (2)", function () { expect(CesiumMath.clampToLatitudeRange(-Math.PI)).toEqual( - -CesiumMath.PI_OVER_TWO + -CesiumMath.PI_OVER_TWO, ); }); @@ -217,11 +217,11 @@ describe("Core/Math", function () { expect(CesiumMath.negativePiToPi(-Math.PI + 0.1)).toEqual(-Math.PI + 0.1); expect(CesiumMath.negativePiToPi(+Math.PI + 0.1)).toEqualEpsilon( -Math.PI + 0.1, - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); expect(CesiumMath.negativePiToPi(-Math.PI - 0.1)).toEqualEpsilon( +Math.PI - 0.1, - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); expect(CesiumMath.negativePiToPi(+2.0 * Math.PI)).toEqual(0.0); @@ -249,17 +249,17 @@ describe("Core/Math", function () { expect(CesiumMath.zeroToTwoPi(+Math.PI - 1.0)).toEqual(+Math.PI - 1.0); expect(CesiumMath.zeroToTwoPi(-Math.PI + 1.0)).toEqualEpsilon( +Math.PI + 1.0, - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); expect(CesiumMath.zeroToTwoPi(+Math.PI - 0.1)).toEqual(+Math.PI - 0.1); expect(CesiumMath.zeroToTwoPi(-Math.PI + 0.1)).toEqualEpsilon( +Math.PI + 0.1, - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); expect(CesiumMath.zeroToTwoPi(+Math.PI + 0.1)).toEqual(+Math.PI + 0.1); expect(CesiumMath.zeroToTwoPi(-Math.PI - 0.1)).toEqualEpsilon( +Math.PI - 0.1, - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); expect(CesiumMath.zeroToTwoPi(+2.0 * Math.PI)).toEqual(2.0 * Math.PI); @@ -299,7 +299,7 @@ describe("Core/Math", function () { expect(CesiumMath.mod(1.0, -1.0)).toEqual(-0.0); expect(CesiumMath.mod(1.1, -1.0)).toEqualEpsilon( -0.9, - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); expect(CesiumMath.mod(-0.0, -1.0)).toEqual(-0.0); @@ -308,7 +308,7 @@ describe("Core/Math", function () { expect(CesiumMath.mod(-1.0, -1.0)).toEqual(-0.0); expect(CesiumMath.mod(-1.1, -1.0)).toEqualEpsilon( -0.1, - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); }); @@ -325,26 +325,26 @@ describe("Core/Math", function () { CesiumMath.equalsEpsilon( 1.0, 1.0 + CesiumMath.EPSILON7, - CesiumMath.EPSILON7 - ) + CesiumMath.EPSILON7, + ), ).toEqual(true); expect( CesiumMath.equalsEpsilon( 1.0, 1.0 + CesiumMath.EPSILON7, - CesiumMath.EPSILON9 - ) + CesiumMath.EPSILON9, + ), ).toEqual(false); expect(CesiumMath.equalsEpsilon(3000000.0, 3000000.0, 0.0)).toEqual(true); expect( - CesiumMath.equalsEpsilon(3000000.0, 3000000.0, CesiumMath.EPSILON7) + CesiumMath.equalsEpsilon(3000000.0, 3000000.0, CesiumMath.EPSILON7), ).toEqual(true); expect( - CesiumMath.equalsEpsilon(3000000.0, 3000000.2, CesiumMath.EPSILON7) + CesiumMath.equalsEpsilon(3000000.0, 3000000.2, CesiumMath.EPSILON7), ).toEqual(true); expect( - CesiumMath.equalsEpsilon(3000000.0, 3000000.2, CesiumMath.EPSILON9) + CesiumMath.equalsEpsilon(3000000.0, 3000000.2, CesiumMath.EPSILON9), ).toEqual(false); }); @@ -472,29 +472,10 @@ describe("Core/Math", function () { it("factorial produces the correct results", function () { const factorials = [ - 1, - 1, - 2, - 6, - 24, - 120, - 720, - 5040, - 40320, - 362880, - 3628800, - 39916800, - 479001600, - 6227020800, - 87178291200, - 1307674368000, - 20922789888000, - 355687428096000, - 6402373705728000, - 121645100408832000, - 2432902008176640000, - 51090942171709440000, - 1124000727777607680000, + 1, 1, 2, 6, 24, 120, 720, 5040, 40320, 362880, 3628800, 39916800, + 479001600, 6227020800, 87178291200, 1307674368000, 20922789888000, + 355687428096000, 6402373705728000, 121645100408832000, + 2432902008176640000, 51090942171709440000, 1124000727777607680000, // eslint-disable-next-line no-loss-of-precision 25852016738884976640000, // eslint-disable-next-line no-loss-of-precision @@ -723,20 +704,20 @@ describe("Core/Math", function () { it("chordLength finds the chord length", function () { expect( - CesiumMath.chordLength(CesiumMath.PI_OVER_THREE, 1.0) + CesiumMath.chordLength(CesiumMath.PI_OVER_THREE, 1.0), ).toEqualEpsilon(1.0, CesiumMath.EPSILON14); expect( - CesiumMath.chordLength(CesiumMath.PI_OVER_THREE, 5.0) + CesiumMath.chordLength(CesiumMath.PI_OVER_THREE, 5.0), ).toEqualEpsilon(5.0, CesiumMath.EPSILON14); expect( - CesiumMath.chordLength(2.0 * CesiumMath.PI_OVER_THREE, 1.0) + CesiumMath.chordLength(2.0 * CesiumMath.PI_OVER_THREE, 1.0), ).toEqualEpsilon(Math.sqrt(3.0), CesiumMath.EPSILON14); expect( - CesiumMath.chordLength(2.0 * CesiumMath.PI_OVER_THREE, 5.0) + CesiumMath.chordLength(2.0 * CesiumMath.PI_OVER_THREE, 5.0), ).toEqualEpsilon(5.0 * Math.sqrt(3.0), CesiumMath.EPSILON14); expect(CesiumMath.chordLength(CesiumMath.PI, 10.0)).toEqualEpsilon( 2.0 * 10.0, - CesiumMath.EPSILON14 + CesiumMath.EPSILON14, ); }); @@ -779,30 +760,30 @@ describe("Core/Math", function () { it("fastApproximateAtan", function () { expect(CesiumMath.fastApproximateAtan(0.0)).toEqualEpsilon( 0.0, - CesiumMath.EPSILON3 + CesiumMath.EPSILON3, ); expect(CesiumMath.fastApproximateAtan(1.0)).toEqualEpsilon( CesiumMath.PI_OVER_FOUR, - CesiumMath.EPSILON3 + CesiumMath.EPSILON3, ); expect(CesiumMath.fastApproximateAtan(-1.0)).toEqualEpsilon( -CesiumMath.PI_OVER_FOUR, - CesiumMath.EPSILON3 + CesiumMath.EPSILON3, ); }); it("fastApproximateAtan2", function () { expect(CesiumMath.fastApproximateAtan2(1.0, 0.0)).toEqualEpsilon( 0.0, - CesiumMath.EPSILON3 + CesiumMath.EPSILON3, ); expect(CesiumMath.fastApproximateAtan2(1.0, 1.0)).toEqualEpsilon( CesiumMath.PI_OVER_FOUR, - CesiumMath.EPSILON3 + CesiumMath.EPSILON3, ); expect(CesiumMath.fastApproximateAtan2(-1.0, 1.0)).toEqualEpsilon( CesiumMath.PI_OVER_FOUR + CesiumMath.PI_OVER_TWO, - CesiumMath.EPSILON3 + CesiumMath.EPSILON3, ); }); diff --git a/packages/engine/Specs/Core/Matrix2Spec.js b/packages/engine/Specs/Core/Matrix2Spec.js index 540b550d0c20..bfbab21851fb 100644 --- a/packages/engine/Specs/Core/Matrix2Spec.js +++ b/packages/engine/Specs/Core/Matrix2Spec.js @@ -40,7 +40,7 @@ describe("Core/Matrix2", function () { const matrix = Matrix2.fromArray( [0.0, 0.0, 0.0, 1.0, 3.0, 2.0, 4.0], 3, - result + result, ); expect(matrix).toBe(result); expect(matrix).toEqual(expected); @@ -136,7 +136,7 @@ describe("Core/Matrix2", function () { it("toArray works without a result parameter", function () { const expected = [1.0, 2.0, 3.0, 4.0]; const returnedResult = Matrix2.toArray( - Matrix2.fromColumnMajorArray(expected) + Matrix2.fromColumnMajorArray(expected), ); expect(returnedResult).not.toBe(expected); expect(returnedResult).toEqual(expected); @@ -147,7 +147,7 @@ describe("Core/Matrix2", function () { const result = []; const returnedResult = Matrix2.toArray( Matrix2.fromColumnMajorArray(expected), - result + result, ); expect(returnedResult).toBe(result); expect(returnedResult).not.toBe(expected); @@ -190,7 +190,7 @@ describe("Core/Matrix2", function () { matrix, 0, new Cartesian2(5.0, 6.0), - result + result, ); expect(result).toBe(returnedResult); expect(result).toEqual(expected); @@ -200,7 +200,7 @@ describe("Core/Matrix2", function () { matrix, 1, new Cartesian2(7.0, 8.0), - result + result, ); expect(result).toBe(returnedResult); expect(result).toEqual(expected); @@ -231,7 +231,7 @@ describe("Core/Matrix2", function () { matrix, 0, new Cartesian2(5.0, 6.0), - result + result, ); expect(result).toBe(returnedResult); expect(result).toEqual(expected); @@ -241,7 +241,7 @@ describe("Core/Matrix2", function () { matrix, 1, new Cartesian2(7.0, 8.0), - result + result, ); expect(result).toBe(returnedResult); expect(result).toEqual(expected); @@ -259,7 +259,7 @@ describe("Core/Matrix2", function () { const returnedResult = Matrix2.setScale(matrix, newScale, result); expect(Matrix2.getScale(returnedResult, new Cartesian2())).toEqual( - newScale + newScale, ); expect(result).toBe(returnedResult); }); @@ -276,7 +276,7 @@ describe("Core/Matrix2", function () { const returnedResult = Matrix2.setUniformScale(matrix, newScale, result); expect(Matrix2.getScale(returnedResult, new Cartesian2())).toEqual( - new Cartesian2(newScale, newScale) + new Cartesian2(newScale, newScale), ); expect(result).toBe(returnedResult); }); @@ -294,7 +294,7 @@ describe("Core/Matrix2", function () { const m = Matrix2.fromScale(new Cartesian2(2.0, 3.0)); expect(Matrix2.getMaximumScale(m)).toEqualEpsilon( 3.0, - CesiumMath.EPSILON14 + CesiumMath.EPSILON14, ); }); @@ -401,7 +401,7 @@ describe("Core/Matrix2", function () { const expected = Matrix2.multiply( m, Matrix2.fromScale(scale), - new Matrix2() + new Matrix2(), ); const result = new Matrix2(); const returnedResult = Matrix2.multiplyByScale(m, scale, result); @@ -415,7 +415,7 @@ describe("Core/Matrix2", function () { const expected = Matrix2.multiply( m, Matrix2.fromScale(scale), - new Matrix2() + new Matrix2(), ); const returnedResult = Matrix2.multiplyByScale(m, scale, m); expect(returnedResult).toBe(m); @@ -428,7 +428,7 @@ describe("Core/Matrix2", function () { const expected = Matrix2.multiply( m, Matrix2.fromUniformScale(scale), - new Matrix2() + new Matrix2(), ); const result = new Matrix2(); const returnedResult = Matrix2.multiplyByUniformScale(m, scale, result); @@ -442,7 +442,7 @@ describe("Core/Matrix2", function () { const expected = Matrix2.multiply( m, Matrix2.fromUniformScale(scale), - new Matrix2() + new Matrix2(), ); const returnedResult = Matrix2.multiplyByUniformScale(m, scale, m); expect(returnedResult).toBe(m); @@ -984,6 +984,6 @@ describe("Core/Matrix2", function () { new Matrix2(0, 1, -1, 0), ], [1, 0, 0, 1, 1, 3, 2, 4, 0, -1, 1, 0], - 4 + 4, ); }); diff --git a/packages/engine/Specs/Core/Matrix3Spec.js b/packages/engine/Specs/Core/Matrix3Spec.js index e0ada12c1755..3d2f4641aeb7 100644 --- a/packages/engine/Specs/Core/Matrix3Spec.js +++ b/packages/engine/Specs/Core/Matrix3Spec.js @@ -45,7 +45,7 @@ describe("Core/Matrix3", function () { const tmp = Cartesian3.multiplyByScalar( new Cartesian3(0.0, 0.0, 1.0), sPiOver4, - new Cartesian3() + new Cartesian3(), ); const quaternion = new Quaternion(tmp.x, tmp.y, tmp.z, cPiOver4); const expected = new Matrix3( @@ -57,7 +57,7 @@ describe("Core/Matrix3", function () { 0.0, 0.0, 0.0, - 1.0 + 1.0, ); const returnedResult = Matrix3.fromQuaternion(quaternion); @@ -73,7 +73,7 @@ describe("Core/Matrix3", function () { const tmp = Cartesian3.multiplyByScalar( new Cartesian3(0.0, 0.0, 1.0), sPiOver4, - new Cartesian3() + new Cartesian3(), ); const quaternion = new Quaternion(tmp.x, tmp.y, tmp.z, cPiOver4); const expected = new Matrix3( @@ -85,7 +85,7 @@ describe("Core/Matrix3", function () { 0.0, 0.0, 0.0, - 1.0 + 1.0, ); const result = new Matrix3(); const returnedResult = Matrix3.fromQuaternion(quaternion, result); @@ -102,7 +102,7 @@ describe("Core/Matrix3", function () { const tmp = Cartesian3.multiplyByScalar( new Cartesian3(0.0, 0.0, 1.0), sPiOver4, - new Cartesian3() + new Cartesian3(), ); const quaternion = new Quaternion(tmp.x, tmp.y, tmp.z, cPiOver4); const headingPitchRoll = HeadingPitchRoll.fromQuaternion(quaternion); @@ -115,7 +115,7 @@ describe("Core/Matrix3", function () { 0.0, 0.0, 0.0, - 1.0 + 1.0, ); const returnedResult = Matrix3.fromHeadingPitchRoll(headingPitchRoll); @@ -131,7 +131,7 @@ describe("Core/Matrix3", function () { const tmp = Cartesian3.multiplyByScalar( new Cartesian3(0.0, 0.0, 1.0), sPiOver4, - new Cartesian3() + new Cartesian3(), ); const quaternion = new Quaternion(tmp.x, tmp.y, tmp.z, cPiOver4); const headingPitchRoll = HeadingPitchRoll.fromQuaternion(quaternion); @@ -144,12 +144,12 @@ describe("Core/Matrix3", function () { 0.0, 0.0, 0.0, - 1.0 + 1.0, ); const result = new Matrix3(); const returnedResult = Matrix3.fromHeadingPitchRoll( headingPitchRoll, - result + result, ); expect(result).toBe(returnedResult); expect(returnedResult).toEqualEpsilon(expected, CesiumMath.EPSILON15); @@ -166,18 +166,18 @@ describe("Core/Matrix3", function () { -0.742685314912828, -0.642787609686539, 0.627506871597133, - 0.439385041770705 + 0.439385041770705, ); const headingPitchRoll = new HeadingPitchRoll( -CesiumMath.toRadians(10), -CesiumMath.toRadians(40), - CesiumMath.toRadians(55) + CesiumMath.toRadians(55), ); const result = new Matrix3(); const returnedResult = Matrix3.fromHeadingPitchRoll( headingPitchRoll, - result + result, ); expect(result).toBe(returnedResult); expect(returnedResult).toEqualEpsilon(expected, CesiumMath.EPSILON15); @@ -195,7 +195,7 @@ describe("Core/Matrix3", function () { const result = new Matrix3(); const returnedResult = Matrix3.fromScale( new Cartesian3(7.0, 8.0, 9.0), - result + result, ); expect(returnedResult).toBe(result); expect(returnedResult).not.toBe(expected); @@ -227,7 +227,7 @@ describe("Core/Matrix3", function () { -1.0, 2.0, 1.0, - 0.0 + 0.0, ); const left = new Cartesian3(1.0, -2.0, 3.0); const returnedResult = Matrix3.fromCrossProduct(left); @@ -246,7 +246,7 @@ describe("Core/Matrix3", function () { crossProductResult = Matrix3.multiply( returnedResult, right, - crossProductResult + crossProductResult, ); expect(crossProductResult).toEqual(crossProductExpected); }); @@ -261,7 +261,7 @@ describe("Core/Matrix3", function () { -1.0, 2.0, 1.0, - 0.0 + 0.0, ); const left = new Cartesian3(1.0, -2.0, 3.0); const result = new Matrix3(); @@ -281,7 +281,7 @@ describe("Core/Matrix3", function () { crossProductResult = Matrix3.multiply( returnedResult, right, - crossProductResult + crossProductResult, ); expect(crossProductResult).toEqual(crossProductExpected); }); @@ -289,15 +289,7 @@ describe("Core/Matrix3", function () { it("fromArray works without a result parameter", function () { const expected = new Matrix3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0); const matrix = Matrix3.fromArray([ - 1.0, - 4.0, - 7.0, - 2.0, - 5.0, - 8.0, - 3.0, - 6.0, - 9.0, + 1.0, 4.0, 7.0, 2.0, 5.0, 8.0, 3.0, 6.0, 9.0, ]); expect(matrix).toEqual(expected); }); @@ -308,7 +300,7 @@ describe("Core/Matrix3", function () { const matrix = Matrix3.fromArray( [1.0, 4.0, 7.0, 2.0, 5.0, 8.0, 3.0, 6.0, 9.0], 0, - result + result, ); expect(matrix).toBe(result); expect(matrix).toEqual(expected); @@ -320,7 +312,7 @@ describe("Core/Matrix3", function () { const matrix = Matrix3.fromArray( [0.0, 0.0, 0.0, 1.0, 4.0, 7.0, 2.0, 5.0, 8.0, 3.0, 6.0, 9.0], 3, - result + result, ); expect(matrix).toBe(result); expect(matrix).toEqual(expected); @@ -329,15 +321,7 @@ describe("Core/Matrix3", function () { it("fromRowMajorArray works without a result parameter", function () { const expected = new Matrix3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0); const matrix = Matrix3.fromRowMajorArray([ - 1.0, - 2.0, - 3.0, - 4.0, - 5.0, - 6.0, - 7.0, - 8.0, - 9.0, + 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, ]); expect(matrix).toEqual(expected); }); @@ -347,7 +331,7 @@ describe("Core/Matrix3", function () { const result = new Matrix3(); const matrix = Matrix3.fromRowMajorArray( [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0], - result + result, ); expect(matrix).toBe(result); expect(matrix).toEqual(expected); @@ -356,15 +340,7 @@ describe("Core/Matrix3", function () { it("fromColumnMajorArray works without a result parameter", function () { const expected = new Matrix3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0); const matrix = Matrix3.fromColumnMajorArray([ - 1.0, - 4.0, - 7.0, - 2.0, - 5.0, - 8.0, - 3.0, - 6.0, - 9.0, + 1.0, 4.0, 7.0, 2.0, 5.0, 8.0, 3.0, 6.0, 9.0, ]); expect(matrix).toEqual(expected); }); @@ -374,7 +350,7 @@ describe("Core/Matrix3", function () { const result = new Matrix3(); const matrix = Matrix3.fromColumnMajorArray( [1.0, 4.0, 7.0, 2.0, 5.0, 8.0, 3.0, 6.0, 9.0], - result + result, ); expect(matrix).toBe(result); expect(matrix).toEqual(expected); @@ -438,7 +414,7 @@ describe("Core/Matrix3", function () { it("toArray works without a result parameter", function () { const expected = [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0]; const returnedResult = Matrix3.toArray( - Matrix3.fromColumnMajorArray(expected) + Matrix3.fromColumnMajorArray(expected), ); expect(returnedResult).not.toBe(expected); expect(returnedResult).toEqual(expected); @@ -449,7 +425,7 @@ describe("Core/Matrix3", function () { const result = []; const returnedResult = Matrix3.toArray( Matrix3.fromColumnMajorArray(expected), - result + result, ); expect(returnedResult).toBe(result); expect(returnedResult).not.toBe(expected); @@ -497,7 +473,7 @@ describe("Core/Matrix3", function () { matrix, 0, new Cartesian3(10.0, 11.0, 12.0), - result + result, ); expect(result).toBe(returnedResult); expect(result).toEqual(expected); @@ -507,7 +483,7 @@ describe("Core/Matrix3", function () { matrix, 1, new Cartesian3(13.0, 14.0, 15.0), - result + result, ); expect(result).toBe(returnedResult); expect(result).toEqual(expected); @@ -517,7 +493,7 @@ describe("Core/Matrix3", function () { matrix, 2, new Cartesian3(16.0, 17.0, 18.0), - result + result, ); expect(result).toBe(returnedResult); expect(result).toEqual(expected); @@ -553,7 +529,7 @@ describe("Core/Matrix3", function () { matrix, 0, new Cartesian3(10.0, 11.0, 12.0), - result + result, ); expect(result).toBe(returnedResult); expect(result).toEqual(expected); @@ -563,7 +539,7 @@ describe("Core/Matrix3", function () { matrix, 1, new Cartesian3(13.0, 14.0, 15.0), - result + result, ); expect(result).toBe(returnedResult); expect(result).toEqual(expected); @@ -573,7 +549,7 @@ describe("Core/Matrix3", function () { matrix, 2, new Cartesian3(16.0, 17.0, 18.0), - result + result, ); expect(result).toBe(returnedResult); expect(result).toEqual(expected); @@ -591,7 +567,7 @@ describe("Core/Matrix3", function () { const returnedResult = Matrix3.setScale(matrix, newScale, result); expect(Matrix3.getScale(returnedResult, new Cartesian3())).toEqual( - newScale + newScale, ); expect(result).toBe(returnedResult); }); @@ -608,7 +584,7 @@ describe("Core/Matrix3", function () { const returnedResult = Matrix3.setUniformScale(matrix, newScale, result); expect(Matrix3.getScale(returnedResult, new Cartesian3())).toEqual( - new Cartesian3(newScale, newScale, newScale) + new Cartesian3(newScale, newScale, newScale), ); expect(result).toBe(returnedResult); }); @@ -626,7 +602,7 @@ describe("Core/Matrix3", function () { const m = Matrix3.fromScale(new Cartesian3(2.0, 3.0, 4.0)); expect(Matrix3.getMaximumScale(m)).toEqualEpsilon( 4.0, - CesiumMath.EPSILON14 + CesiumMath.EPSILON14, ); }); @@ -645,15 +621,7 @@ describe("Core/Matrix3", function () { it("getRotation returns matrix without scale", function () { const matrix = Matrix3.fromColumnMajorArray([ - 1.0, - 2.0, - 3.0, - 4.0, - 5.0, - 6.0, - 7.0, - 8.0, - 9.0, + 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, ]); const expectedRotation = Matrix3.fromArray([ 1.0 / Math.sqrt(1.0 * 1.0 + 2.0 * 2.0 + 3.0 * 3.0), @@ -672,15 +640,7 @@ describe("Core/Matrix3", function () { it("getRotation does not modify rotation matrix", function () { const matrix = Matrix3.fromColumnMajorArray([ - 1.0, - 2.0, - 3.0, - 4.0, - 5.0, - 6.0, - 7.0, - 8.0, - 9.0, + 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, ]); const duplicateMatrix = Matrix3.clone(matrix, new Matrix3()); const expectedRotation = Matrix3.fromArray([ @@ -763,7 +723,7 @@ describe("Core/Matrix3", function () { const expected = Matrix3.multiply( m, Matrix3.fromScale(scale), - new Matrix3() + new Matrix3(), ); const result = new Matrix3(); const returnedResult = Matrix3.multiplyByScale(m, scale, result); @@ -777,7 +737,7 @@ describe("Core/Matrix3", function () { const expected = Matrix3.multiply( m, Matrix3.fromScale(scale), - new Matrix3() + new Matrix3(), ); const returnedResult = Matrix3.multiplyByScale(m, scale, m); expect(returnedResult).toBe(m); @@ -790,7 +750,7 @@ describe("Core/Matrix3", function () { const expected = Matrix3.multiply( m, Matrix3.fromUniformScale(scale), - new Matrix3() + new Matrix3(), ); const result = new Matrix3(); const returnedResult = Matrix3.multiplyByUniformScale(m, scale, result); @@ -804,7 +764,7 @@ describe("Core/Matrix3", function () { const expected = Matrix3.multiply( m, Matrix3.fromUniformScale(scale), - new Matrix3() + new Matrix3(), ); const returnedResult = Matrix3.multiplyByUniformScale(m, scale, m); expect(returnedResult).toBe(m); @@ -842,7 +802,7 @@ describe("Core/Matrix3", function () { -6.0, -7.0, -8.0, - -9.0 + -9.0, ); const result = new Matrix3(); const returnedResult = Matrix3.negate(matrix, result); @@ -861,7 +821,7 @@ describe("Core/Matrix3", function () { -6.0, -7.0, -8.0, - -9.0 + -9.0, ); const returnedResult = Matrix3.negate(matrix, matrix); expect(matrix).toBe(returnedResult); @@ -882,7 +842,7 @@ describe("Core/Matrix3", function () { const expectedInverse = Matrix3.inverse(matrix, new Matrix3()); const expectedInverseTranspose = Matrix3.transpose( expectedInverse, - new Matrix3() + new Matrix3(), ); const result = Matrix3.inverseTranspose(matrix, new Matrix3()); expect(result).toEqual(expectedInverseTranspose); @@ -914,7 +874,7 @@ describe("Core/Matrix3", function () { 5.0, 3.0, -3.0, - 4.0 + 4.0, ); const result = new Matrix3(); const returnedResult = Matrix3.inverse(matrix, result); @@ -933,7 +893,7 @@ describe("Core/Matrix3", function () { 5.0, 3.0, -3.0, - 4.0 + 4.0, ); const returnedResult = Matrix3.inverse(matrix, matrix); expect(matrix).toBe(returnedResult); @@ -952,41 +912,44 @@ describe("Core/Matrix3", function () { 0.0, 0.0, 0.0, - 1.0 + 1.0, ); const decomposition = Matrix3.computeEigenDecomposition(a); expect(decomposition.diagonal).toEqualEpsilon( expectedDiagonal, - CesiumMath.EPSILON14 + CesiumMath.EPSILON14, ); let v = Matrix3.getColumn(decomposition.unitary, 0, new Cartesian3()); - let lambda = Matrix3.getColumn(decomposition.diagonal, 0, new Cartesian3()) - .x; + let lambda = Matrix3.getColumn( + decomposition.diagonal, + 0, + new Cartesian3(), + ).x; expect( - Cartesian3.multiplyByScalar(v, lambda, new Cartesian3()) + Cartesian3.multiplyByScalar(v, lambda, new Cartesian3()), ).toEqualEpsilon( Matrix3.multiplyByVector(a, v, new Cartesian3()), - CesiumMath.EPSILON14 + CesiumMath.EPSILON14, ); v = Matrix3.getColumn(decomposition.unitary, 1, new Cartesian3()); lambda = Matrix3.getColumn(decomposition.diagonal, 1, new Cartesian3()).y; expect( - Cartesian3.multiplyByScalar(v, lambda, new Cartesian3()) + Cartesian3.multiplyByScalar(v, lambda, new Cartesian3()), ).toEqualEpsilon( Matrix3.multiplyByVector(a, v, new Cartesian3()), - CesiumMath.EPSILON14 + CesiumMath.EPSILON14, ); v = Matrix3.getColumn(decomposition.unitary, 2, new Cartesian3()); lambda = Matrix3.getColumn(decomposition.diagonal, 2, new Cartesian3()).z; expect( - Cartesian3.multiplyByScalar(v, lambda, new Cartesian3()) + Cartesian3.multiplyByScalar(v, lambda, new Cartesian3()), ).toEqualEpsilon( Matrix3.multiplyByVector(a, v, new Cartesian3()), - CesiumMath.EPSILON14 + CesiumMath.EPSILON14, ); }); @@ -1002,7 +965,7 @@ describe("Core/Matrix3", function () { 0.0, 0.0, 0.0, - 1.0 + 1.0, ); const result = { unitary: new Matrix3(), @@ -1013,35 +976,38 @@ describe("Core/Matrix3", function () { expect(decomposition).toBe(result); expect(decomposition.diagonal).toEqualEpsilon( expectedDiagonal, - CesiumMath.EPSILON14 + CesiumMath.EPSILON14, ); let v = Matrix3.getColumn(decomposition.unitary, 0, new Cartesian3()); - let lambda = Matrix3.getColumn(decomposition.diagonal, 0, new Cartesian3()) - .x; + let lambda = Matrix3.getColumn( + decomposition.diagonal, + 0, + new Cartesian3(), + ).x; expect( - Cartesian3.multiplyByScalar(v, lambda, new Cartesian3()) + Cartesian3.multiplyByScalar(v, lambda, new Cartesian3()), ).toEqualEpsilon( Matrix3.multiplyByVector(a, v, new Cartesian3()), - CesiumMath.EPSILON14 + CesiumMath.EPSILON14, ); v = Matrix3.getColumn(decomposition.unitary, 1, new Cartesian3()); lambda = Matrix3.getColumn(decomposition.diagonal, 1, new Cartesian3()).y; expect( - Cartesian3.multiplyByScalar(v, lambda, new Cartesian3()) + Cartesian3.multiplyByScalar(v, lambda, new Cartesian3()), ).toEqualEpsilon( Matrix3.multiplyByVector(a, v, new Cartesian3()), - CesiumMath.EPSILON14 + CesiumMath.EPSILON14, ); v = Matrix3.getColumn(decomposition.unitary, 2, new Cartesian3()); lambda = Matrix3.getColumn(decomposition.diagonal, 2, new Cartesian3()).z; expect( - Cartesian3.multiplyByScalar(v, lambda, new Cartesian3()) + Cartesian3.multiplyByScalar(v, lambda, new Cartesian3()), ).toEqualEpsilon( Matrix3.multiplyByVector(a, v, new Cartesian3()), - CesiumMath.EPSILON14 + CesiumMath.EPSILON14, ); }); @@ -1055,7 +1021,7 @@ describe("Core/Matrix3", function () { -6.0, -7.0, -8.0, - -9.0 + -9.0, ); const expected = new Matrix3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0); const result = new Matrix3(); @@ -1081,7 +1047,7 @@ describe("Core/Matrix3", function () { -6.0, -7.0, -8.0, - -9.0 + -9.0, ); const expected = new Matrix3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0); const returnedResult = Matrix3.abs(matrix, matrix); @@ -1485,7 +1451,7 @@ describe("Core/Matrix3", function () { expect(function () { Matrix3.inverse( new Matrix3(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0), - new Matrix3() + new Matrix3(), ); }).toThrowDeveloperError(); }); diff --git a/packages/engine/Specs/Core/Matrix4Spec.js b/packages/engine/Specs/Core/Matrix4Spec.js index ae2c6fa15a81..375416d0a849 100644 --- a/packages/engine/Specs/Core/Matrix4Spec.js +++ b/packages/engine/Specs/Core/Matrix4Spec.js @@ -50,7 +50,7 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 15.0, - 16.0 + 16.0, ); expect(matrix[Matrix4.COLUMN0ROW0]).toEqual(1.0); expect(matrix[Matrix4.COLUMN1ROW0]).toEqual(2.0); @@ -87,25 +87,11 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 15.0, - 16.0 + 16.0, ); const matrix = Matrix4.fromArray([ - 1.0, - 5.0, - 9.0, - 13.0, - 2.0, - 6.0, - 10.0, - 14.0, - 3.0, - 7.0, - 11.0, - 15.0, - 4.0, - 8.0, - 12.0, - 16.0, + 1.0, 5.0, 9.0, 13.0, 2.0, 6.0, 10.0, 14.0, 3.0, 7.0, 11.0, 15.0, 4.0, 8.0, + 12.0, 16.0, ]); expect(matrix).toEqual(expected); }); @@ -127,30 +113,16 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 15.0, - 16.0 + 16.0, ); const result = new Matrix4(); const matrix = Matrix4.fromArray( [ - 1.0, - 5.0, - 9.0, - 13.0, - 2.0, - 6.0, - 10.0, - 14.0, - 3.0, - 7.0, - 11.0, - 15.0, - 4.0, - 8.0, - 12.0, - 16.0, + 1.0, 5.0, 9.0, 13.0, 2.0, 6.0, 10.0, 14.0, 3.0, 7.0, 11.0, 15.0, 4.0, + 8.0, 12.0, 16.0, ], 0, - result + result, ); expect(matrix).toBe(result); expect(matrix).toEqual(expected); @@ -173,33 +145,16 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 15.0, - 16.0 + 16.0, ); const result = new Matrix4(); const matrix = Matrix4.fromArray( [ - 0.0, - 0.0, - 0.0, - 1.0, - 5.0, - 9.0, - 13.0, - 2.0, - 6.0, - 10.0, - 14.0, - 3.0, - 7.0, - 11.0, - 15.0, - 4.0, - 8.0, - 12.0, - 16.0, + 0.0, 0.0, 0.0, 1.0, 5.0, 9.0, 13.0, 2.0, 6.0, 10.0, 14.0, 3.0, 7.0, + 11.0, 15.0, 4.0, 8.0, 12.0, 16.0, ], 3, - result + result, ); expect(matrix).toBe(result); expect(matrix).toEqual(expected); @@ -222,25 +177,11 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 15.0, - 16.0 + 16.0, ); const matrix = Matrix4.fromRowMajorArray([ - 1.0, - 2.0, - 3.0, - 4.0, - 5.0, - 6.0, - 7.0, - 8.0, - 9.0, - 10.0, - 11.0, - 12.0, - 13.0, - 14.0, - 15.0, - 16.0, + 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, + 15.0, 16.0, ]); expect(matrix).toEqual(expected); }); @@ -262,29 +203,15 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 15.0, - 16.0 + 16.0, ); const result = new Matrix4(); const matrix = Matrix4.fromRowMajorArray( [ - 1.0, - 2.0, - 3.0, - 4.0, - 5.0, - 6.0, - 7.0, - 8.0, - 9.0, - 10.0, - 11.0, - 12.0, - 13.0, - 14.0, - 15.0, - 16.0, + 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, + 14.0, 15.0, 16.0, ], - result + result, ); expect(matrix).toBe(result); expect(matrix).toEqual(expected); @@ -307,25 +234,11 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 15.0, - 16.0 + 16.0, ); const matrix = Matrix4.fromColumnMajorArray([ - 1.0, - 5.0, - 9.0, - 13.0, - 2.0, - 6.0, - 10.0, - 14.0, - 3.0, - 7.0, - 11.0, - 15.0, - 4.0, - 8.0, - 12.0, - 16.0, + 1.0, 5.0, 9.0, 13.0, 2.0, 6.0, 10.0, 14.0, 3.0, 7.0, 11.0, 15.0, 4.0, 8.0, + 12.0, 16.0, ]); expect(matrix).toEqual(expected); }); @@ -347,29 +260,15 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 15.0, - 16.0 + 16.0, ); const result = new Matrix4(); const matrix = Matrix4.fromColumnMajorArray( [ - 1.0, - 5.0, - 9.0, - 13.0, - 2.0, - 6.0, - 10.0, - 14.0, - 3.0, - 7.0, - 11.0, - 15.0, - 4.0, - 8.0, - 12.0, - 16.0, + 1.0, 5.0, 9.0, 13.0, 2.0, 6.0, 10.0, 14.0, 3.0, 7.0, 11.0, 15.0, 4.0, + 8.0, 12.0, 16.0, ], - result + result, ); expect(matrix).toBe(result); expect(matrix).toEqual(expected); @@ -392,7 +291,7 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 15.0, - 16.0 + 16.0, ); const returnedResult = expected.clone(); expect(returnedResult).not.toBe(expected); @@ -416,7 +315,7 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 15.0, - 16.0 + 16.0, ); const result = new Matrix4(); const returnedResult = expected.clone(result); @@ -442,11 +341,11 @@ describe("Core/Matrix4", function () { 0.0, 0.0, 0.0, - 1.0 + 1.0, ); const returnedResult = Matrix4.fromRotationTranslation( new Matrix3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0), - new Cartesian3(10.0, 11.0, 12.0) + new Cartesian3(10.0, 11.0, 12.0), ); expect(returnedResult).not.toBe(expected); expect(returnedResult).toEqual(expected); @@ -469,13 +368,13 @@ describe("Core/Matrix4", function () { 0.0, 0.0, 0.0, - 1.0 + 1.0, ); const result = new Matrix4(); const returnedResult = Matrix4.fromRotationTranslation( new Matrix3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0), new Cartesian3(10.0, 11.0, 12.0), - result + result, ); expect(returnedResult).toBe(result); expect(returnedResult).not.toBe(expected); @@ -499,10 +398,10 @@ describe("Core/Matrix4", function () { 0.0, 0.0, 0.0, - 1.0 + 1.0, ); const returnedResult = Matrix4.fromTranslation( - new Cartesian3(10.0, 11.0, 12.0) + new Cartesian3(10.0, 11.0, 12.0), ); expect(returnedResult).not.toBe(expected); expect(returnedResult).toEqual(expected); @@ -525,12 +424,12 @@ describe("Core/Matrix4", function () { 0.0, 0.0, 0.0, - 1.0 + 1.0, ); const returnedResult = Matrix4.fromTranslationQuaternionRotationScale( new Cartesian3(1.0, 2.0, 3.0), // translation Quaternion.fromAxisAngle(Cartesian3.UNIT_X, CesiumMath.toRadians(-90.0)), // rotation - new Cartesian3(7.0, 8.0, 9.0) + new Cartesian3(7.0, 8.0, 9.0), ); // scale expect(returnedResult).not.toBe(expected); expect(returnedResult).toEqualEpsilon(expected, CesiumMath.EPSILON14); @@ -553,14 +452,14 @@ describe("Core/Matrix4", function () { 0.0, 0.0, 0.0, - 1.0 + 1.0, ); const result = new Matrix4(); const returnedResult = Matrix4.fromTranslationQuaternionRotationScale( new Cartesian3(1.0, 2.0, 3.0), // translation Quaternion.fromAxisAngle(Cartesian3.UNIT_X, CesiumMath.toRadians(-90.0)), // rotation new Cartesian3(7.0, 8.0, 9.0), // scale - result + result, ); expect(returnedResult).toBe(result); expect(returnedResult).not.toBe(expected); @@ -584,13 +483,13 @@ describe("Core/Matrix4", function () { 0.0, 0.0, 0.0, - 1.0 + 1.0, ); const trs = new TranslationRotationScale( new Cartesian3(1.0, 2.0, 3.0), Quaternion.fromAxisAngle(Cartesian3.UNIT_X, CesiumMath.toRadians(-90.0)), - new Cartesian3(7.0, 8.0, 9.0) + new Cartesian3(7.0, 8.0, 9.0), ); const returnedResult = Matrix4.fromTranslationRotationScale(trs); @@ -615,13 +514,13 @@ describe("Core/Matrix4", function () { 0.0, 0.0, 0.0, - 1.0 + 1.0, ); const trs = new TranslationRotationScale( new Cartesian3(1.0, 2.0, 3.0), Quaternion.fromAxisAngle(Cartesian3.UNIT_X, CesiumMath.toRadians(-90.0)), - new Cartesian3(7.0, 8.0, 9.0) + new Cartesian3(7.0, 8.0, 9.0), ); const result = new Matrix4(); @@ -648,12 +547,12 @@ describe("Core/Matrix4", function () { 0.0, 0.0, 0.0, - 1.0 + 1.0, ); const result = new Matrix4(); const returnedResult = Matrix4.fromTranslation( new Cartesian3(10.0, 11.0, 12.0), - result + result, ); expect(returnedResult).toBe(result); expect(returnedResult).not.toBe(expected); @@ -677,7 +576,7 @@ describe("Core/Matrix4", function () { 0.0, 0.0, 0.0, - 1.0 + 1.0, ); const returnedResult = Matrix4.fromScale(new Cartesian3(7.0, 8.0, 9.0)); expect(returnedResult).not.toBe(expected); @@ -701,12 +600,12 @@ describe("Core/Matrix4", function () { 0.0, 0.0, 0.0, - 1.0 + 1.0, ); const result = new Matrix4(); const returnedResult = Matrix4.fromScale( new Cartesian3(7.0, 8.0, 9.0), - result + result, ); expect(returnedResult).toBe(result); expect(returnedResult).not.toBe(expected); @@ -730,7 +629,7 @@ describe("Core/Matrix4", function () { 0.0, 0.0, 0.0, - 1.0 + 1.0, ); const returnedResult = Matrix4.fromUniformScale(2.0); expect(returnedResult).toEqual(expected); @@ -753,7 +652,7 @@ describe("Core/Matrix4", function () { 0.0, 0.0, 0.0, - 1.0 + 1.0, ); const result = new Matrix4(); const returnedResult = Matrix4.fromUniformScale(2.0, result); @@ -763,73 +662,29 @@ describe("Core/Matrix4", function () { it("fromRotation works without a result parameter", function () { const expected = Matrix4.fromColumnMajorArray([ - 1.0, - 2.0, - 3.0, - 0.0, - 4.0, - 5.0, - 6.0, - 0.0, - 7.0, - 8.0, - 9.0, - 0.0, - 0.0, - 0.0, - 0.0, + 1.0, 2.0, 3.0, 0.0, 4.0, 5.0, 6.0, 0.0, 7.0, 8.0, 9.0, 0.0, 0.0, 0.0, 0.0, 1.0, ]); const returnedResult = Matrix4.fromRotation( Matrix3.fromColumnMajorArray([ - 1.0, - 2.0, - 3.0, - 4.0, - 5.0, - 6.0, - 7.0, - 8.0, - 9.0, - ]) + 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, + ]), ); expect(returnedResult).toEqual(expected); }); it("fromRotation works with a result parameter", function () { const expected = Matrix4.fromColumnMajorArray([ - 1.0, - 2.0, - 3.0, - 0.0, - 4.0, - 5.0, - 6.0, - 0.0, - 7.0, - 8.0, - 9.0, - 0.0, - 0.0, - 0.0, - 0.0, + 1.0, 2.0, 3.0, 0.0, 4.0, 5.0, 6.0, 0.0, 7.0, 8.0, 9.0, 0.0, 0.0, 0.0, 0.0, 1.0, ]); const result = new Matrix4(); const returnedResult = Matrix4.fromRotation( Matrix3.fromColumnMajorArray([ - 1.0, - 2.0, - 3.0, - 4.0, - 5.0, - 6.0, - 7.0, - 8.0, - 9.0, + 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, ]), - result + result, ); expect(returnedResult).toBe(result); expect(returnedResult).toEqual(expected); @@ -852,7 +707,7 @@ describe("Core/Matrix4", function () { 0, 0, -1, - 0 + 0, ); const result = new Matrix4(); const returnedResult = Matrix4.computePerspectiveFieldOfView( @@ -860,7 +715,7 @@ describe("Core/Matrix4", function () { 1, 1, 10, - result + result, ); expect(returnedResult).toEqualEpsilon(expected, CesiumMath.EPSILON15); }); @@ -884,7 +739,7 @@ describe("Core/Matrix4", function () { direction: Cartesian3.negate(Cartesian3.UNIT_Z, new Cartesian3()), up: Cartesian3.UNIT_Y, }, - result + result, ); expect(returnedResult).toBe(result); expect(returnedResult).toEqual(expected); @@ -907,7 +762,7 @@ describe("Core/Matrix4", function () { 0, 0, 0, - 1 + 1, ); const result = new Matrix4(); const returnedResult = Matrix4.computeOrthographicOffCenter( @@ -917,7 +772,7 @@ describe("Core/Matrix4", function () { 3, 0, 1, - result + result, ); expect(returnedResult).toBe(result); expect(returnedResult).toEqual(expected); @@ -940,7 +795,7 @@ describe("Core/Matrix4", function () { 0.0, 0.0, 0.0, - 1.0 + 1.0, ); const returnedResult = Matrix4.computeViewportTransformation( { @@ -950,7 +805,7 @@ describe("Core/Matrix4", function () { height: 6.0, }, 0.0, - 2.0 + 2.0, ); expect(returnedResult).toEqual(expected); }); @@ -972,7 +827,7 @@ describe("Core/Matrix4", function () { 0.0, 0.0, 0.0, - 1.0 + 1.0, ); const result = new Matrix4(); const returnedResult = Matrix4.computeViewportTransformation( @@ -984,7 +839,7 @@ describe("Core/Matrix4", function () { }, 0.0, 2.0, - result + result, ); expect(returnedResult).toEqual(expected); expect(returnedResult).toBe(result); @@ -1007,7 +862,7 @@ describe("Core/Matrix4", function () { 0, 0, -1, - 0 + 0, ); const result = new Matrix4(); const returnedResult = Matrix4.computePerspectiveOffCenter( @@ -1017,7 +872,7 @@ describe("Core/Matrix4", function () { 3, 1, 2, - result + result, ); expect(returnedResult).toEqual(expected); expect(returnedResult).toBe(result); @@ -1040,7 +895,7 @@ describe("Core/Matrix4", function () { 0, 0, -1, - 0 + 0, ); const result = new Matrix4(); const returnedResult = Matrix4.computeInfinitePerspectiveOffCenter( @@ -1049,32 +904,18 @@ describe("Core/Matrix4", function () { 2, 3, 1, - result + result, ); expect(returnedResult).toEqual(expected); }); it("toArray works without a result parameter", function () { const expected = [ - 1.0, - 2.0, - 3.0, - 4.0, - 5.0, - 6.0, - 7.0, - 8.0, - 9.0, - 10.0, - 11.0, - 12.0, - 13.0, - 14.0, - 15.0, - 16.0, + 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, + 15.0, 16.0, ]; const returnedResult = Matrix4.toArray( - Matrix4.fromColumnMajorArray(expected) + Matrix4.fromColumnMajorArray(expected), ); expect(returnedResult).not.toBe(expected); expect(returnedResult).toEqual(expected); @@ -1082,27 +923,13 @@ describe("Core/Matrix4", function () { it("toArray works with a result parameter", function () { const expected = [ - 1.0, - 2.0, - 3.0, - 4.0, - 5.0, - 6.0, - 7.0, - 8.0, - 9.0, - 10.0, - 11.0, - 12.0, - 13.0, - 14.0, - 15.0, - 16.0, + 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, + 15.0, 16.0, ]; const result = []; const returnedResult = Matrix4.toArray( Matrix4.fromColumnMajorArray(expected), - result + result, ); expect(returnedResult).toBe(result); expect(returnedResult).not.toBe(expected); @@ -1137,7 +964,7 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 15.0, - 16.0 + 16.0, ); const expectedColumn0 = new Cartesian4(1.0, 5.0, 9.0, 13.0); const expectedColumn1 = new Cartesian4(2.0, 6.0, 10.0, 14.0); @@ -1180,7 +1007,7 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 15.0, - 16.0 + 16.0, ); const result = new Matrix4(); @@ -1201,13 +1028,13 @@ describe("Core/Matrix4", function () { 20.0, 14.0, 15.0, - 16.0 + 16.0, ); let returnedResult = Matrix4.setColumn( matrix, 0, new Cartesian4(17.0, 18.0, 19.0, 20.0), - result + result, ); expect(result).toBe(returnedResult); expect(result).toEqual(expected); @@ -1228,13 +1055,13 @@ describe("Core/Matrix4", function () { 13.0, 20.0, 15.0, - 16.0 + 16.0, ); returnedResult = Matrix4.setColumn( matrix, 1, new Cartesian4(17.0, 18.0, 19.0, 20.0), - result + result, ); expect(result).toBe(returnedResult); expect(result).toEqual(expected); @@ -1255,13 +1082,13 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 20.0, - 16.0 + 16.0, ); returnedResult = Matrix4.setColumn( matrix, 2, new Cartesian4(17.0, 18.0, 19.0, 20.0), - result + result, ); expect(result).toBe(returnedResult); expect(result).toEqual(expected); @@ -1282,13 +1109,13 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 15.0, - 20.0 + 20.0, ); returnedResult = Matrix4.setColumn( matrix, 3, new Cartesian4(17.0, 18.0, 19.0, 20.0), - result + result, ); expect(result).toBe(returnedResult); expect(result).toEqual(expected); @@ -1311,7 +1138,7 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 15.0, - 16.0 + 16.0, ); const translation = new Cartesian3(-1.0, -2.0, -3.0); const result = new Matrix4(); @@ -1332,7 +1159,7 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 15.0, - 16.0 + 16.0, ); const returnedResult = Matrix4.setTranslation(matrix, translation, result); expect(result).toBe(returnedResult); @@ -1356,7 +1183,7 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 15.0, - 16.0 + 16.0, ); const expectedRow0 = new Cartesian4(1.0, 2.0, 3.0, 4.0); const expectedRow1 = new Cartesian4(5.0, 6.0, 7.0, 8.0); @@ -1399,7 +1226,7 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 15.0, - 16.0 + 16.0, ); const result = new Matrix4(); @@ -1419,13 +1246,13 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 15.0, - 16.0 + 16.0, ); let returnedResult = Matrix4.setRow( matrix, 0, new Cartesian4(91.0, 92.0, 93.0, 94.0), - result + result, ); expect(result).toBe(returnedResult); expect(result).toEqual(expected); @@ -1446,13 +1273,13 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 15.0, - 16.0 + 16.0, ); returnedResult = Matrix4.setRow( matrix, 1, new Cartesian4(95.0, 96.0, 97.0, 98.0), - result + result, ); expect(result).toBe(returnedResult); expect(result).toEqual(expected); @@ -1473,13 +1300,13 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 15.0, - 16.0 + 16.0, ); returnedResult = Matrix4.setRow( matrix, 2, new Cartesian4(99.0, 910.0, 911.0, 912.0), - result + result, ); expect(result).toBe(returnedResult); expect(result).toEqual(expected); @@ -1500,13 +1327,13 @@ describe("Core/Matrix4", function () { 913.0, 914.0, 915.0, - 916.0 + 916.0, ); returnedResult = Matrix4.setRow( matrix, 3, new Cartesian4(913.0, 914.0, 915.0, 916.0), - result + result, ); expect(result).toBe(returnedResult); expect(result).toEqual(expected); @@ -1524,7 +1351,7 @@ describe("Core/Matrix4", function () { const returnedResult = Matrix4.setScale(matrix, newScale, result); expect(Matrix4.getScale(returnedResult, new Cartesian3())).toEqual( - newScale + newScale, ); expect(result).toBe(returnedResult); }); @@ -1541,7 +1368,7 @@ describe("Core/Matrix4", function () { const returnedResult = Matrix4.setUniformScale(matrix, newScale, result); expect(Matrix4.getScale(returnedResult, new Cartesian3())).toEqual( - new Cartesian3(newScale, newScale, newScale) + new Cartesian3(newScale, newScale, newScale), ); expect(result).toBe(returnedResult); }); @@ -1559,7 +1386,7 @@ describe("Core/Matrix4", function () { const m = Matrix4.fromScale(new Cartesian3(2.0, 3.0, 4.0)); expect(Matrix4.getMaximumScale(m)).toEqualEpsilon( 4.0, - CesiumMath.EPSILON14 + CesiumMath.EPSILON14, ); }); @@ -1579,16 +1406,8 @@ describe("Core/Matrix4", function () { it("getRotation returns matrix without scale", function () { const matrix = Matrix4.fromRotation( Matrix3.fromColumnMajorArray([ - 1.0, - 2.0, - 3.0, - 4.0, - 5.0, - 6.0, - 7.0, - 8.0, - 9.0, - ]) + 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, + ]), ); const expectedRotation = Matrix3.fromColumnMajorArray([ 1.0 / Math.sqrt(1.0 * 1.0 + 2.0 * 2.0 + 3.0 * 3.0), @@ -1608,16 +1427,8 @@ describe("Core/Matrix4", function () { it("getRotation does not modify rotation matrix", function () { const matrix = Matrix4.fromRotation( Matrix3.fromColumnMajorArray([ - 1.0, - 2.0, - 3.0, - 4.0, - 5.0, - 6.0, - 7.0, - 8.0, - 9.0, - ]) + 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, + ]), ); const duplicateMatrix = Matrix4.clone(matrix, new Matrix4()); const expectedRotation = Matrix3.fromColumnMajorArray([ @@ -1654,7 +1465,7 @@ describe("Core/Matrix4", function () { 13, 14, 15, - 16 + 16, ); const right = new Matrix4( 17, @@ -1672,7 +1483,7 @@ describe("Core/Matrix4", function () { 29, 30, 31, - 32 + 32, ); const expected = new Matrix4( 250, @@ -1690,7 +1501,7 @@ describe("Core/Matrix4", function () { 1354, 1412, 1470, - 1528 + 1528, ); const result = new Matrix4(); const returnedResult = Matrix4.multiply(left, right, result); @@ -1715,7 +1526,7 @@ describe("Core/Matrix4", function () { 13, 14, 15, - 16 + 16, ); const right = new Matrix4( 17, @@ -1733,7 +1544,7 @@ describe("Core/Matrix4", function () { 29, 30, 31, - 32 + 32, ); const expected = new Matrix4( 250, @@ -1751,7 +1562,7 @@ describe("Core/Matrix4", function () { 1354, 1412, 1470, - 1528 + 1528, ); const returnedResult = Matrix4.multiply(left, right, left); expect(returnedResult).toBe(left); @@ -1775,7 +1586,7 @@ describe("Core/Matrix4", function () { 13, 14, 15, - 16 + 16, ); const right = new Matrix4( 17, @@ -1793,7 +1604,7 @@ describe("Core/Matrix4", function () { 29, 30, 31, - 32 + 32, ); const expected = new Matrix4( 18, @@ -1811,7 +1622,7 @@ describe("Core/Matrix4", function () { 42, 44, 46, - 48 + 48, ); const result = new Matrix4(); const returnedResult = Matrix4.add(left, right, result); @@ -1836,7 +1647,7 @@ describe("Core/Matrix4", function () { 13, 14, 15, - 16 + 16, ); const right = new Matrix4( 17, @@ -1854,7 +1665,7 @@ describe("Core/Matrix4", function () { 29, 30, 31, - 32 + 32, ); const expected = new Matrix4( 18, @@ -1872,7 +1683,7 @@ describe("Core/Matrix4", function () { 42, 44, 46, - 48 + 48, ); const returnedResult = Matrix4.add(left, right, left); expect(returnedResult).toBe(left); @@ -1896,7 +1707,7 @@ describe("Core/Matrix4", function () { 42, 44, 46, - 48 + 48, ); const right = new Matrix4( 17, @@ -1914,7 +1725,7 @@ describe("Core/Matrix4", function () { 29, 30, 31, - 32 + 32, ); const expected = new Matrix4( 1, @@ -1932,7 +1743,7 @@ describe("Core/Matrix4", function () { 13, 14, 15, - 16 + 16, ); const result = new Matrix4(); const returnedResult = Matrix4.subtract(left, right, result); @@ -1957,7 +1768,7 @@ describe("Core/Matrix4", function () { 42, 44, 46, - 48 + 48, ); const right = new Matrix4( 17, @@ -1975,7 +1786,7 @@ describe("Core/Matrix4", function () { 29, 30, 31, - 32 + 32, ); const expected = new Matrix4( 1, @@ -1993,7 +1804,7 @@ describe("Core/Matrix4", function () { 13, 14, 15, - 16 + 16, ); const returnedResult = Matrix4.subtract(left, right, left); expect(returnedResult).toBe(left); @@ -2018,7 +1829,7 @@ describe("Core/Matrix4", function () { 0, 0, 0, - 1 + 1, ); const expected = new Matrix4( 134, @@ -2036,7 +1847,7 @@ describe("Core/Matrix4", function () { 0, 0, 0, - 1 + 1, ); const result = new Matrix4(); const returnedResult = Matrix4.multiplyTransformation(left, right, result); @@ -2062,7 +1873,7 @@ describe("Core/Matrix4", function () { 0, 0, 0, - 1 + 1, ); const expected = new Matrix4( 134, @@ -2080,7 +1891,7 @@ describe("Core/Matrix4", function () { 0, 0, 0, - 1 + 1, ); const returnedResult = Matrix4.multiplyTransformation(left, right, left); expect(returnedResult).toBe(left); @@ -2090,20 +1901,20 @@ describe("Core/Matrix4", function () { it("multiplyByMatrix3 works", function () { const left = Matrix4.fromRotationTranslation( Matrix3.fromRotationZ(CesiumMath.toRadians(45.0)), - new Cartesian3(1.0, 2.0, 3.0) + new Cartesian3(1.0, 2.0, 3.0), ); const rightRotation = Matrix3.fromRotationX(CesiumMath.toRadians(30.0)); const right = Matrix4.fromRotationTranslation(rightRotation); const expected = new Matrix4.multiplyTransformation( left, right, - new Matrix4() + new Matrix4(), ); const result = new Matrix4(); const returnedResult = Matrix4.multiplyByMatrix3( left, rightRotation, - result + result, ); expect(returnedResult).toBe(result); expect(result).toEqual(expected); @@ -2112,14 +1923,14 @@ describe("Core/Matrix4", function () { it("multiplyByMatrix3 works with a result parameter that is an input result parameter", function () { const left = Matrix4.fromRotationTranslation( Matrix3.fromRotationZ(CesiumMath.toRadians(45.0)), - new Cartesian3(1.0, 2.0, 3.0) + new Cartesian3(1.0, 2.0, 3.0), ); const rightRotation = Matrix3.fromRotationX(CesiumMath.toRadians(30.0)); const right = Matrix4.fromRotationTranslation(rightRotation); const expected = new Matrix4.multiplyTransformation( left, right, - new Matrix4() + new Matrix4(), ); const returnedResult = Matrix4.multiplyByMatrix3(left, rightRotation, left); expect(returnedResult).toBe(left); @@ -2132,13 +1943,13 @@ describe("Core/Matrix4", function () { const expected = Matrix4.multiply( m, Matrix4.fromTranslation(translation), - new Matrix4() + new Matrix4(), ); const result = new Matrix4(); const returnedResult = Matrix4.multiplyByTranslation( m, translation, - result + result, ); expect(returnedResult).toBe(result); expect(result).toEqual(expected); @@ -2150,7 +1961,7 @@ describe("Core/Matrix4", function () { const expected = Matrix4.multiply( m, Matrix4.fromTranslation(translation), - new Matrix4() + new Matrix4(), ); const returnedResult = Matrix4.multiplyByTranslation(m, translation, m); expect(returnedResult).toBe(m); @@ -2159,22 +1970,7 @@ describe("Core/Matrix4", function () { it("multiplyByUniformScale works", function () { const m = Matrix4.fromColumnMajorArray([ - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10, - 11, - 12, - 13, - 14, - 15, - 16, - 17, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, ]); const scale = 2.0; const expected = Matrix4.fromColumnMajorArray([ @@ -2203,22 +1999,7 @@ describe("Core/Matrix4", function () { it("multiplyByUniformScale works with a result parameter that is an input result parameter", function () { const m = Matrix4.fromColumnMajorArray([ - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10, - 11, - 12, - 13, - 14, - 15, - 16, - 17, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, ]); const scale = 2.0; const expected = Matrix4.fromColumnMajorArray([ @@ -2268,7 +2049,7 @@ describe("Core/Matrix4", function () { const expected = Matrix4.multiply( m, Matrix4.fromScale(scale), - new Matrix4() + new Matrix4(), ); const returnedResult = Matrix4.multiplyByScale(m, scale, m); expect(returnedResult).toBe(m); @@ -2277,22 +2058,7 @@ describe("Core/Matrix4", function () { it("multiplyByUniformScale works", function () { const m = Matrix4.fromColumnMajorArray([ - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10, - 11, - 12, - 13, - 14, - 15, - 16, - 17, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, ]); const scale = 2.0; const expected = Matrix4.fromColumnMajorArray([ @@ -2322,22 +2088,7 @@ describe("Core/Matrix4", function () { it('multiplyByUniformScale works with "this" result parameter', function () { const m = Matrix4.fromColumnMajorArray([ - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10, - 11, - 12, - 13, - 14, - 15, - 16, - 17, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, ]); const scale = 2.0; const expected = Matrix4.fromColumnMajorArray([ @@ -2381,7 +2132,7 @@ describe("Core/Matrix4", function () { 13, 14, 15, - 16 + 16, ); const right = new Cartesian4(17, 18, 19, 20); const expected = new Cartesian4(190, 486, 782, 1078); @@ -2408,7 +2159,7 @@ describe("Core/Matrix4", function () { 13, 14, 15, - 16 + 16, ); const right = new Cartesian3(17, 18, 19); const expected = new Cartesian3(114, 334, 554); @@ -2435,7 +2186,7 @@ describe("Core/Matrix4", function () { 13, 14, 15, - 16 + 16, ); const right = new Cartesian3(17, 18, 19); const expected = new Cartesian3(110, 326, 542); @@ -2462,7 +2213,7 @@ describe("Core/Matrix4", function () { 13, 14, 15, - 16 + 16, ); const right = 2; const expected = new Matrix4( @@ -2481,7 +2232,7 @@ describe("Core/Matrix4", function () { 26, 28, 30, - 32 + 32, ); const result = new Matrix4(); const returnedResult = Matrix4.multiplyByScalar(left, right, result); @@ -2506,7 +2257,7 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 15.0, - 16.0 + 16.0, ); const expected = new Matrix4( -1.0, @@ -2524,7 +2275,7 @@ describe("Core/Matrix4", function () { -13.0, -14.0, -15.0, - -16.0 + -16.0, ); const result = new Matrix4(); const returnedResult = Matrix4.negate(matrix, result); @@ -2549,7 +2300,7 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 15.0, - 16.0 + 16.0, ); const expected = new Matrix4( -1.0, @@ -2567,7 +2318,7 @@ describe("Core/Matrix4", function () { -13.0, -14.0, -15.0, - -16.0 + -16.0, ); const returnedResult = Matrix4.negate(matrix, matrix); expect(matrix).toBe(returnedResult); @@ -2591,7 +2342,7 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 15.0, - 16.0 + 16.0, ); const expected = new Matrix4( 1.0, @@ -2609,7 +2360,7 @@ describe("Core/Matrix4", function () { 4.0, 8.0, 12.0, - 16.0 + 16.0, ); const result = new Matrix4(); const returnedResult = Matrix4.transpose(matrix, result); @@ -2634,12 +2385,12 @@ describe("Core/Matrix4", function () { 13.0, -27.0, 15.0, - 16.0 + 16.0, ); const expectedInverse = Matrix4.inverse(matrix, new Matrix4()); const expectedInverseTranspose = Matrix4.transpose( expectedInverse, - new Matrix4() + new Matrix4(), ); const result = Matrix4.inverseTranspose(matrix, new Matrix4()); expect(result).toEqual(expectedInverseTranspose); @@ -2662,7 +2413,7 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 15.0, - 16.0 + 16.0, ); const expected = new Matrix4( 1.0, @@ -2680,7 +2431,7 @@ describe("Core/Matrix4", function () { 4.0, 8.0, 12.0, - 16.0 + 16.0, ); const returnedResult = Matrix4.transpose(matrix, matrix); expect(matrix).toBe(returnedResult); @@ -2704,7 +2455,7 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 15.0, - 16.0 + 16.0, ); let right = new Matrix4( 1.0, @@ -2722,7 +2473,7 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 15.0, - 16.0 + 16.0, ); expect(Matrix4.equals(left, right)).toEqual(true); @@ -2742,7 +2493,7 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 15.0, - 16.0 + 16.0, ); right = new Matrix4(5.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0); expect(Matrix4.equals(left, right)).toEqual(false); @@ -2763,7 +2514,7 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 15.0, - 16.0 + 16.0, ); right = new Matrix4(1.0, 6.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0); expect(Matrix4.equals(left, right)).toEqual(false); @@ -2784,7 +2535,7 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 15.0, - 16.0 + 16.0, ); right = new Matrix4(1.0, 2.0, 7.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0); expect(Matrix4.equals(left, right)).toEqual(false); @@ -2805,7 +2556,7 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 15.0, - 16.0 + 16.0, ); right = new Matrix4(1.0, 2.0, 3.0, 8.0, 5.0, 6.0, 7.0, 8.0, 9.0); expect(Matrix4.equals(left, right)).toEqual(false); @@ -2826,7 +2577,7 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 15.0, - 16.0 + 16.0, ); right = new Matrix4(1.0, 2.0, 3.0, 4.0, 9.0, 6.0, 7.0, 8.0, 9.0); expect(Matrix4.equals(left, right)).toEqual(false); @@ -2847,7 +2598,7 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 15.0, - 16.0 + 16.0, ); right = new Matrix4(1.0, 2.0, 3.0, 4.0, 5.0, 10.0, 7.0, 8.0, 9.0); expect(Matrix4.equals(left, right)).toEqual(false); @@ -2868,7 +2619,7 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 15.0, - 16.0 + 16.0, ); right = new Matrix4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 11.0, 8.0, 9.0); expect(Matrix4.equals(left, right)).toEqual(false); @@ -2889,7 +2640,7 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 15.0, - 16.0 + 16.0, ); right = new Matrix4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 12.0, 9.0); expect(Matrix4.equals(left, right)).toEqual(false); @@ -2910,7 +2661,7 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 15.0, - 16.0 + 16.0, ); right = new Matrix4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 13.0); expect(Matrix4.equals(left, right)).toEqual(false); @@ -2939,7 +2690,7 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 15.0, - 16.0 + 16.0, ); let right = new Matrix4( 1.0, @@ -2957,7 +2708,7 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 15.0, - 16.0 + 16.0, ); expect(Matrix4.equalsEpsilon(left, right, 1.0)).toEqual(true); @@ -2977,7 +2728,7 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 15.0, - 16.0 + 16.0, ); right = new Matrix4( 5.0, @@ -2995,7 +2746,7 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 15.0, - 16.0 + 16.0, ); expect(Matrix4.equalsEpsilon(left, right, 3.9)).toEqual(false); expect(Matrix4.equalsEpsilon(left, right, 4.0)).toEqual(true); @@ -3016,7 +2767,7 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 15.0, - 16.0 + 16.0, ); right = new Matrix4( 1.0, @@ -3034,7 +2785,7 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 15.0, - 16.0 + 16.0, ); expect(Matrix4.equalsEpsilon(left, right, 3.9)).toEqual(false); expect(Matrix4.equalsEpsilon(left, right, 4.0)).toEqual(true); @@ -3055,7 +2806,7 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 15.0, - 16.0 + 16.0, ); right = new Matrix4( 1.0, @@ -3073,7 +2824,7 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 15.0, - 16.0 + 16.0, ); expect(Matrix4.equalsEpsilon(left, right, 3.9)).toEqual(false); expect(Matrix4.equalsEpsilon(left, right, 4.0)).toEqual(true); @@ -3094,7 +2845,7 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 15.0, - 16.0 + 16.0, ); right = new Matrix4( 1.0, @@ -3112,7 +2863,7 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 15.0, - 16.0 + 16.0, ); expect(Matrix4.equalsEpsilon(left, right, 3.9)).toEqual(false); expect(Matrix4.equalsEpsilon(left, right, 4.0)).toEqual(true); @@ -3133,7 +2884,7 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 15.0, - 16.0 + 16.0, ); right = new Matrix4( 1.0, @@ -3151,7 +2902,7 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 15.0, - 16.0 + 16.0, ); expect(Matrix4.equalsEpsilon(left, right, 3.9)).toEqual(false); expect(Matrix4.equalsEpsilon(left, right, 4.0)).toEqual(true); @@ -3172,7 +2923,7 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 15.0, - 16.0 + 16.0, ); right = new Matrix4( 1.0, @@ -3190,7 +2941,7 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 15.0, - 16.0 + 16.0, ); expect(Matrix4.equalsEpsilon(left, right, 3.9)).toEqual(false); expect(Matrix4.equalsEpsilon(left, right, 4.0)).toEqual(true); @@ -3211,7 +2962,7 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 15.0, - 16.0 + 16.0, ); right = new Matrix4( 1.0, @@ -3229,7 +2980,7 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 15.0, - 16.0 + 16.0, ); expect(Matrix4.equalsEpsilon(left, right, 3.9)).toEqual(false); expect(Matrix4.equalsEpsilon(left, right, 4.0)).toEqual(true); @@ -3250,7 +3001,7 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 15.0, - 16.0 + 16.0, ); right = new Matrix4( 1.0, @@ -3268,7 +3019,7 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 15.0, - 16.0 + 16.0, ); expect(Matrix4.equalsEpsilon(left, right, 3.9)).toEqual(false); expect(Matrix4.equalsEpsilon(left, right, 4.0)).toEqual(true); @@ -3289,7 +3040,7 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 15.0, - 16.0 + 16.0, ); right = new Matrix4( 1.0, @@ -3307,7 +3058,7 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 15.0, - 16.0 + 16.0, ); expect(Matrix4.equalsEpsilon(left, right, 3.9)).toEqual(false); expect(Matrix4.equalsEpsilon(left, right, 4.0)).toEqual(true); @@ -3328,7 +3079,7 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 15.0, - 16.0 + 16.0, ); right = new Matrix4( 1.0, @@ -3346,7 +3097,7 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 15.0, - 16.0 + 16.0, ); expect(Matrix4.equalsEpsilon(left, right, 3.9)).toEqual(false); expect(Matrix4.equalsEpsilon(left, right, 4.0)).toEqual(true); @@ -3367,7 +3118,7 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 15.0, - 16.0 + 16.0, ); right = new Matrix4( 1.0, @@ -3385,7 +3136,7 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 15.0, - 16.0 + 16.0, ); expect(Matrix4.equalsEpsilon(left, right, 3.9)).toEqual(false); expect(Matrix4.equalsEpsilon(left, right, 4.0)).toEqual(true); @@ -3406,7 +3157,7 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 15.0, - 16.0 + 16.0, ); right = new Matrix4( 1.0, @@ -3424,7 +3175,7 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 15.0, - 16.0 + 16.0, ); expect(Matrix4.equalsEpsilon(left, right, 3.9)).toEqual(false); expect(Matrix4.equalsEpsilon(left, right, 4.0)).toEqual(true); @@ -3445,7 +3196,7 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 15.0, - 16.0 + 16.0, ); right = new Matrix4( 1.0, @@ -3463,7 +3214,7 @@ describe("Core/Matrix4", function () { 17.0, 14.0, 15.0, - 16.0 + 16.0, ); expect(Matrix4.equalsEpsilon(left, right, 3.9)).toEqual(false); expect(Matrix4.equalsEpsilon(left, right, 4.0)).toEqual(true); @@ -3484,7 +3235,7 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 15.0, - 16.0 + 16.0, ); right = new Matrix4( 1.0, @@ -3502,7 +3253,7 @@ describe("Core/Matrix4", function () { 13.0, 18.0, 15.0, - 16.0 + 16.0, ); expect(Matrix4.equalsEpsilon(left, right, 3.9)).toEqual(false); expect(Matrix4.equalsEpsilon(left, right, 4.0)).toEqual(true); @@ -3523,7 +3274,7 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 15.0, - 16.0 + 16.0, ); right = new Matrix4( 1.0, @@ -3541,7 +3292,7 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 19.0, - 16.0 + 16.0, ); expect(Matrix4.equalsEpsilon(left, right, 3.9)).toEqual(false); expect(Matrix4.equalsEpsilon(left, right, 4.0)).toEqual(true); @@ -3562,7 +3313,7 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 15.0, - 16.0 + 16.0, ); right = new Matrix4( 1.0, @@ -3580,7 +3331,7 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 15.0, - 20.0 + 20.0, ); expect(Matrix4.equalsEpsilon(left, right, 3.9)).toEqual(false); expect(Matrix4.equalsEpsilon(left, right, 4.0)).toEqual(true); @@ -3609,10 +3360,10 @@ describe("Core/Matrix4", function () { 13, 14, 15, - 16 + 16, ); expect(matrix.toString()).toEqual( - "(1, 2, 3, 4)\n(5, 6, 7, 8)\n(9, 10, 11, 12)\n(13, 14, 15, 16)" + "(1, 2, 3, 4)\n(5, 6, 7, 8)\n(9, 10, 11, 12)\n(13, 14, 15, 16)", ); }); @@ -3633,7 +3384,7 @@ describe("Core/Matrix4", function () { 13, 14, 15, - 16 + 16, ); const expected = new Cartesian3(4, 8, 12); const result = new Cartesian3(); @@ -3659,7 +3410,7 @@ describe("Core/Matrix4", function () { 13, 14, 15, - 16 + 16, ); const expected = new Matrix3(1, 2, 3, 5, 6, 7, 9, 10, 11); const result = new Matrix3(); @@ -3685,7 +3436,7 @@ describe("Core/Matrix4", function () { 0.0, 0.0, 0.0, - 1.0 + 1.0, ); const expected = new Matrix4( @@ -3704,7 +3455,7 @@ describe("Core/Matrix4", function () { 0.0, 0.0, 0.0, - 1.0 + 1.0, ); const result = new Matrix4(); @@ -3712,7 +3463,7 @@ describe("Core/Matrix4", function () { expect(returnedResult).toBe(result); expect(expected).toEqualEpsilon(returnedResult, CesiumMath.EPSILON20); expect( - Matrix4.multiply(returnedResult, matrix, new Matrix4()) + Matrix4.multiply(returnedResult, matrix, new Matrix4()), ).toEqualEpsilon(Matrix4.IDENTITY, CesiumMath.EPSILON15); }); @@ -3730,7 +3481,7 @@ describe("Core/Matrix4", function () { const trs = new TranslationRotationScale( new Cartesian3(0.0, 0.0, 0.0), Quaternion.fromAxisAngle(Cartesian3.UNIT_X, 0.0), - new Cartesian3(1.0e-7, 1.0e-7, 1.1e-7) + new Cartesian3(1.0e-7, 1.0e-7, 1.1e-7), ); const matrix = Matrix4.fromTranslationRotationScale(trs); @@ -3751,7 +3502,7 @@ describe("Core/Matrix4", function () { 0, 0, 0, - 1 + 1, ); const result = Matrix4.inverse(matrix, new Matrix4()); @@ -3762,7 +3513,7 @@ describe("Core/Matrix4", function () { const trs = new TranslationRotationScale( new Cartesian3(0.0, 0.0, 0.0), Quaternion.fromAxisAngle(Cartesian3.UNIT_X, 0.0), - new Cartesian3(1.8e-8, 1.2e-8, 1.2e-8) + new Cartesian3(1.8e-8, 1.2e-8, 1.2e-8), ); const matrix = Matrix4.fromTranslationRotationScale(trs); @@ -3783,7 +3534,7 @@ describe("Core/Matrix4", function () { 0, 0, 0, - 1 + 1, ); const result = Matrix4.inverse(matrix, new Matrix4()); @@ -3807,7 +3558,7 @@ describe("Core/Matrix4", function () { 0, 0, 0, - 1 + 1, ); const expected = new Matrix4( @@ -3826,7 +3577,7 @@ describe("Core/Matrix4", function () { 0, 0, 0, - 1 + 1, ); const result = new Matrix4(); @@ -3834,7 +3585,7 @@ describe("Core/Matrix4", function () { expect(returnedResult).toBe(result); expect(expected).toEqual(returnedResult); expect(Matrix4.multiply(returnedResult, matrix, new Matrix4())).toEqual( - Matrix4.IDENTITY + Matrix4.IDENTITY, ); }); @@ -3861,7 +3612,7 @@ describe("Core/Matrix4", function () { -13.0, -14.0, -15.0, - -16.0 + -16.0, ); const expected = new Matrix4( 1.0, @@ -3879,7 +3630,7 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 15.0, - 16.0 + 16.0, ); const result = new Matrix4(); let returnedResult = Matrix4.abs(matrix, result); @@ -3901,7 +3652,7 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 15.0, - 16.0 + 16.0, ); returnedResult = Matrix4.abs(matrix, result); expect(returnedResult).toEqual(expected); @@ -3922,7 +3673,7 @@ describe("Core/Matrix4", function () { 13.0, -14.0, 15.0, - -16.0 + -16.0, ); returnedResult = Matrix4.abs(matrix, result); expect(returnedResult).toEqual(expected); @@ -3945,7 +3696,7 @@ describe("Core/Matrix4", function () { -13.0, -14.0, -15.0, - -16.0 + -16.0, ); const expected = new Matrix4( 1.0, @@ -3963,7 +3714,7 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 15.0, - 16.0 + 16.0, ); const returnedResult = Matrix4.abs(matrix, matrix); expect(matrix).toBe(returnedResult); @@ -3999,7 +3750,7 @@ describe("Core/Matrix4", function () { Matrix4.fromTranslationQuaternionRotationScale( undefined, new Quaternion(), - new Cartesian3() + new Cartesian3(), ); }).toThrowDeveloperError(); }); @@ -4009,7 +3760,7 @@ describe("Core/Matrix4", function () { Matrix4.fromTranslationQuaternionRotationScale( new Matrix3(), undefined, - new Cartesian3() + new Cartesian3(), ); }).toThrowDeveloperError(); }); @@ -4019,7 +3770,7 @@ describe("Core/Matrix4", function () { Matrix4.fromTranslationQuaternionRotationScale( new Matrix3(), new Quaternion(), - undefined + undefined, ); }).toThrowDeveloperError(); }); @@ -4118,7 +3869,7 @@ describe("Core/Matrix4", function () { bottom, top, near, - far + far, ); }).toThrowDeveloperError(); }); @@ -4136,7 +3887,7 @@ describe("Core/Matrix4", function () { bottom, top, near, - far + far, ); }).toThrowDeveloperError(); }); @@ -4154,7 +3905,7 @@ describe("Core/Matrix4", function () { undefined, top, near, - far + far, ); }).toThrowDeveloperError(); }); @@ -4172,7 +3923,7 @@ describe("Core/Matrix4", function () { bottom, undefined, near, - far + far, ); }).toThrowDeveloperError(); }); @@ -4190,7 +3941,7 @@ describe("Core/Matrix4", function () { bottom, top, undefined, - far + far, ); }).toThrowDeveloperError(); }); @@ -4208,7 +3959,7 @@ describe("Core/Matrix4", function () { bottom, top, near, - undefined + undefined, ); }).toThrowDeveloperError(); }); @@ -4226,7 +3977,7 @@ describe("Core/Matrix4", function () { bottom, top, near, - far + far, ); }).toThrowDeveloperError(); }); @@ -4244,7 +3995,7 @@ describe("Core/Matrix4", function () { bottom, top, near, - far + far, ); }).toThrowDeveloperError(); }); @@ -4262,7 +4013,7 @@ describe("Core/Matrix4", function () { undefined, top, near, - far + far, ); }).toThrowDeveloperError(); }); @@ -4280,7 +4031,7 @@ describe("Core/Matrix4", function () { bottom, undefined, near, - far + far, ); }).toThrowDeveloperError(); }); @@ -4298,7 +4049,7 @@ describe("Core/Matrix4", function () { bottom, top, undefined, - far + far, ); }).toThrowDeveloperError(); }); @@ -4316,7 +4067,7 @@ describe("Core/Matrix4", function () { bottom, top, near, - undefined + undefined, ); }).toThrowDeveloperError(); }); @@ -4334,7 +4085,7 @@ describe("Core/Matrix4", function () { bottom, top, near, - far + far, ); }).toThrowDeveloperError(); }); @@ -4352,7 +4103,7 @@ describe("Core/Matrix4", function () { bottom, top, near, - far + far, ); }).toThrowDeveloperError(); }); @@ -4370,7 +4121,7 @@ describe("Core/Matrix4", function () { undefined, top, near, - far + far, ); }).toThrowDeveloperError(); }); @@ -4388,7 +4139,7 @@ describe("Core/Matrix4", function () { bottom, undefined, near, - far + far, ); }).toThrowDeveloperError(); }); @@ -4406,7 +4157,7 @@ describe("Core/Matrix4", function () { bottom, top, undefined, - far + far, ); }).toThrowDeveloperError(); }); @@ -4756,7 +4507,7 @@ describe("Core/Matrix4", function () { 13, 14, 15, - 16 + 16, ); expect(function () { Matrix4.inverse(matrix, new Matrix4()); @@ -5003,7 +4754,7 @@ describe("Core/Matrix4", function () { right, bottom, top, - near + near, ); }).toThrowDeveloperError(); }); @@ -5035,7 +4786,7 @@ describe("Core/Matrix4", function () { 4, 8, 12, - 16 + 16, ); expect(matrix.length).toEqual(16); const intArray = new Uint32Array(matrix.length); diff --git a/packages/engine/Specs/Core/NearFarScalarSpec.js b/packages/engine/Specs/Core/NearFarScalarSpec.js index 3350cddc431b..1e133af23edb 100644 --- a/packages/engine/Specs/Core/NearFarScalarSpec.js +++ b/packages/engine/Specs/Core/NearFarScalarSpec.js @@ -40,10 +40,9 @@ describe("Core/NearFarScalar", function () { expect(scalar).toBe(returnedResult); }); - createPackableSpecs(NearFarScalar, new NearFarScalar(1, 2, 3, 4), [ - 1, - 2, - 3, - 4, - ]); + createPackableSpecs( + NearFarScalar, + new NearFarScalar(1, 2, 3, 4), + [1, 2, 3, 4], + ); }); diff --git a/packages/engine/Specs/Core/OccluderSpec.js b/packages/engine/Specs/Core/OccluderSpec.js index d4e18ff9b12e..ccb915e2470c 100644 --- a/packages/engine/Specs/Core/OccluderSpec.js +++ b/packages/engine/Specs/Core/OccluderSpec.js @@ -129,7 +129,7 @@ describe("Core/Occluder", function () { Occluder.computeOccludeePoint( occluderBS, new Cartesian3(0, 0, -3), - positions + positions, ); }).toThrowDeveloperError(); }); @@ -149,7 +149,7 @@ describe("Core/Occluder", function () { Occluder.computeOccludeePoint( occluderBS, new Cartesian3(0, 0, -5), - new Cartesian3(0, 0, -3) + new Cartesian3(0, 0, -3), ); }).toThrowDeveloperError(); }); @@ -165,11 +165,11 @@ describe("Core/Occluder", function () { const result = Occluder.computeOccludeePoint( occluderBS, occludeePosition, - positions + positions, ); expect(result).toEqualEpsilon( new Cartesian3(0, 0, -5), - CesiumMath.EPSILON1 + CesiumMath.EPSILON1, ); }); @@ -184,16 +184,16 @@ describe("Core/Occluder", function () { const occludeePosition = occludee.position; const occluderPlaneNormal = Cartesian3.normalize( Cartesian3.subtract(occludeePosition, occluderPosition, new Cartesian3()), - new Cartesian3() + new Cartesian3(), ); const occluderPlaneD = -Cartesian3.dot( occluderPlaneNormal, - occluderPosition + occluderPosition, ); const tempVec0 = Cartesian3.abs( Cartesian3.clone(occluderPlaneNormal), - new Cartesian3() + new Cartesian3(), ); let majorAxis = tempVec0.x > tempVec0.y ? 0 : 1; if ( @@ -206,7 +206,7 @@ describe("Core/Occluder", function () { const aRotationVector = Occluder._anyRotationVector( occluderPosition, occluderPlaneNormal, - occluderPlaneD + occluderPlaneD, ); expect(aRotationVector).toBeTruthy(); }); @@ -222,16 +222,16 @@ describe("Core/Occluder", function () { const occludeePosition = occludee.position; const occluderPlaneNormal = Cartesian3.normalize( Cartesian3.subtract(occludeePosition, occluderPosition, new Cartesian3()), - new Cartesian3() + new Cartesian3(), ); const occluderPlaneD = -Cartesian3.dot( occluderPlaneNormal, - occluderPosition + occluderPosition, ); const tempVec0 = Cartesian3.abs( Cartesian3.clone(occluderPlaneNormal), - new Cartesian3() + new Cartesian3(), ); let majorAxis = tempVec0.x > tempVec0.y ? 0 : 1; if ( @@ -244,7 +244,7 @@ describe("Core/Occluder", function () { const aRotationVector = Occluder._anyRotationVector( occluderPosition, occluderPlaneNormal, - occluderPlaneD + occluderPlaneD, ); expect(aRotationVector).toBeTruthy(); }); @@ -260,16 +260,16 @@ describe("Core/Occluder", function () { const occludeePosition = occludee.position; const occluderPlaneNormal = Cartesian3.normalize( Cartesian3.subtract(occludeePosition, occluderPosition, new Cartesian3()), - new Cartesian3() + new Cartesian3(), ); const occluderPlaneD = -Cartesian3.dot( occluderPlaneNormal, - occluderPosition + occluderPosition, ); const tempVec0 = Cartesian3.abs( Cartesian3.clone(occluderPlaneNormal), - new Cartesian3() + new Cartesian3(), ); let majorAxis = tempVec0.x > tempVec0.y ? 0 : 1; if ( @@ -282,7 +282,7 @@ describe("Core/Occluder", function () { const aRotationVector = Occluder._anyRotationVector( occluderPosition, occluderPlaneNormal, - occluderPlaneD + occluderPlaneD, ); expect(aRotationVector).toBeTruthy(); }); @@ -300,7 +300,7 @@ describe("Core/Occluder", function () { const result = Occluder.computeOccludeePoint( occluderBS, occludeePosition, - positions + positions, ); const bs = new BoundingSphere(result, 0.0); @@ -322,10 +322,10 @@ describe("Core/Occluder", function () { const result = Occluder.computeOccludeePoint( occluderBS, occludeePosition, - positions + positions, ); expect( - occluder.isBoundingSphereVisible(new BoundingSphere(result, 0.0)) + occluder.isBoundingSphereVisible(new BoundingSphere(result, 0.0)), ).toEqual(true); }); @@ -338,7 +338,7 @@ describe("Core/Occluder", function () { it("compute invalid occludee point from rectangle", function () { const rectangle = Rectangle.MAX_VALUE; expect(Occluder.computeOccludeePointFromRectangle(rectangle)).toEqual( - undefined + undefined, ); }); @@ -351,7 +351,7 @@ describe("Core/Occluder", function () { const point = Occluder.computeOccludeePoint( new BoundingSphere(Cartesian3.ZERO, ellipsoid.minimumRadius), bs.center, - positions + positions, ); const actual = Occluder.computeOccludeePointFromRectangle(rectangle); expect(actual).toEqual(point); @@ -387,7 +387,7 @@ describe("Core/Occluder", function () { const occluder1 = Occluder.fromBoundingSphere( occluderBS, cameraPosition, - result + result, ); expect(occluder1).toBe(result); diff --git a/packages/engine/Specs/Core/OpenCageGeocoderServiceSpec.js b/packages/engine/Specs/Core/OpenCageGeocoderServiceSpec.js index 50ab76102342..a3a06264cccf 100644 --- a/packages/engine/Specs/Core/OpenCageGeocoderServiceSpec.js +++ b/packages/engine/Specs/Core/OpenCageGeocoderServiceSpec.js @@ -51,7 +51,7 @@ describe("Core/OpenCageGeocoderService", function () { ], }; spyOn(Resource.prototype, "fetchJson").and.returnValue( - Promise.resolve(data) + Promise.resolve(data), ); const results = await service.geocode(query); @@ -66,7 +66,7 @@ describe("Core/OpenCageGeocoderService", function () { const query = ""; const data = { results: [] }; spyOn(Resource.prototype, "fetchJson").and.returnValue( - Promise.resolve(data) + Promise.resolve(data), ); const results = await service.geocode(query); @@ -78,7 +78,7 @@ describe("Core/OpenCageGeocoderService", function () { expect(service.credit).toBeInstanceOf(Credit); expect(service.credit.html).toEqual( - `Geodata copyright <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors` + `Geodata copyright <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors`, ); expect(service.credit.showOnScreen).toBe(false); }); diff --git a/packages/engine/Specs/Core/OrientedBoundingBoxSpec.js b/packages/engine/Specs/Core/OrientedBoundingBoxSpec.js index a424c6561c35..3bd41233c5fd 100644 --- a/packages/engine/Specs/Core/OrientedBoundingBoxSpec.js +++ b/packages/engine/Specs/Core/OrientedBoundingBoxSpec.js @@ -34,7 +34,7 @@ describe("Core/OrientedBoundingBox", function () { for (let i = 0; i < positions.length; ++i) { points.push( - Matrix3.multiplyByVector(rotation, positions[i], new Cartesian3()) + Matrix3.multiplyByVector(rotation, positions[i], new Cartesian3()), ); } @@ -74,7 +74,7 @@ describe("Core/OrientedBoundingBox", function () { it("fromPoints correct scale", function () { const box = OrientedBoundingBox.fromPoints(positions); expect(box.halfAxes).toEqual( - Matrix3.fromScale(new Cartesian3(2.0, 3.0, 4.0)) + Matrix3.fromScale(new Cartesian3(2.0, 3.0, 4.0)), ); expect(box.center).toEqual(Cartesian3.ZERO); }); @@ -84,7 +84,7 @@ describe("Core/OrientedBoundingBox", function () { const points = translatePositions(positions, translation); const box = OrientedBoundingBox.fromPoints(points); expect(box.halfAxes).toEqual( - Matrix3.fromScale(new Cartesian3(2.0, 3.0, 4.0)) + Matrix3.fromScale(new Cartesian3(2.0, 3.0, 4.0)), ); expect(box.center).toEqual(translation); }); @@ -93,7 +93,7 @@ describe("Core/OrientedBoundingBox", function () { const result = rotatePositions( positions, Cartesian3.UNIT_Z, - CesiumMath.PI_OVER_FOUR + CesiumMath.PI_OVER_FOUR, ); const points = result.points; const rotation = result.rotation; @@ -105,9 +105,9 @@ describe("Core/OrientedBoundingBox", function () { Matrix3.multiplyByScale( rotation, new Cartesian3(3.0, 2.0, 4.0), - new Matrix3() + new Matrix3(), ), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); expect(box.center).toEqualEpsilon(Cartesian3.ZERO, CesiumMath.EPSILON15); }); @@ -116,7 +116,7 @@ describe("Core/OrientedBoundingBox", function () { const result = rotatePositions( positions, Cartesian3.UNIT_Y, - CesiumMath.PI_OVER_FOUR + CesiumMath.PI_OVER_FOUR, ); const points = result.points; const rotation = result.rotation; @@ -128,9 +128,9 @@ describe("Core/OrientedBoundingBox", function () { Matrix3.multiplyByScale( rotation, new Cartesian3(4.0, 3.0, 2.0), - new Matrix3() + new Matrix3(), ), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); expect(box.center).toEqualEpsilon(Cartesian3.ZERO, CesiumMath.EPSILON15); }); @@ -139,7 +139,7 @@ describe("Core/OrientedBoundingBox", function () { const result = rotatePositions( positions, Cartesian3.UNIT_X, - CesiumMath.PI_OVER_FOUR + CesiumMath.PI_OVER_FOUR, ); const points = result.points; const rotation = result.rotation; @@ -151,9 +151,9 @@ describe("Core/OrientedBoundingBox", function () { Matrix3.multiplyByScale( rotation, new Cartesian3(2.0, 4.0, 3.0), - new Matrix3() + new Matrix3(), ), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); expect(box.center).toEqualEpsilon(Cartesian3.ZERO, CesiumMath.EPSILON15); }); @@ -162,7 +162,7 @@ describe("Core/OrientedBoundingBox", function () { const result = rotatePositions( positions, Cartesian3.UNIT_Z, - CesiumMath.PI_OVER_FOUR + CesiumMath.PI_OVER_FOUR, ); let points = result.points; const rotation = result.rotation; @@ -177,9 +177,9 @@ describe("Core/OrientedBoundingBox", function () { Matrix3.multiplyByScale( rotation, new Cartesian3(3.0, 2.0, 4.0), - new Matrix3() + new Matrix3(), ), - CesiumMath.EPSILON14 + CesiumMath.EPSILON14, ); expect(box.center).toEqualEpsilon(translation, CesiumMath.EPSILON15); }); @@ -191,7 +191,7 @@ describe("Core/OrientedBoundingBox", function () { rectangle, 0.0, 0.0, - Ellipsoid.WGS84 + Ellipsoid.WGS84, ); expect(box1.center).toEqualEpsilon(box2.center, CesiumMath.EPSILON15); @@ -205,12 +205,12 @@ describe("Core/OrientedBoundingBox", function () { rectangle, undefined, undefined, - Ellipsoid.UNIT_SPHERE + Ellipsoid.UNIT_SPHERE, ); expect(box.center).toEqualEpsilon( new Cartesian3(1.0, 0.0, 0.0), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); const rotScale = Matrix3.ZERO; @@ -231,7 +231,7 @@ describe("Core/OrientedBoundingBox", function () { new Rectangle(-1.0, 1.0, 1.0, -1.0), 0.0, 0.0, - ellipsoid + ellipsoid, ); }).toThrowDeveloperError(); expect(function () { @@ -239,7 +239,7 @@ describe("Core/OrientedBoundingBox", function () { new Rectangle(-2.0, 2.0, -1.0, 1.0), 0.0, 0.0, - ellipsoid + ellipsoid, ); }).toThrowDeveloperError(); expect(function () { @@ -247,7 +247,7 @@ describe("Core/OrientedBoundingBox", function () { new Rectangle(-4.0, -2.0, 4.0, 1.0), 0.0, 0.0, - ellipsoid + ellipsoid, ); }).toThrowDeveloperError(); expect(function () { @@ -255,7 +255,7 @@ describe("Core/OrientedBoundingBox", function () { new Rectangle(-2.0, -2.0, 1.0, 2.0), 0.0, 0.0, - ellipsoid + ellipsoid, ); }).toThrowDeveloperError(); expect(function () { @@ -263,7 +263,7 @@ describe("Core/OrientedBoundingBox", function () { new Rectangle(-1.0, -2.0, 2.0, 2.0), 0.0, 0.0, - ellipsoid + ellipsoid, ); }).toThrowDeveloperError(); expect(function () { @@ -271,7 +271,7 @@ describe("Core/OrientedBoundingBox", function () { new Rectangle(-4.0, -1.0, 4.0, 2.0), 0.0, 0.0, - ellipsoid + ellipsoid, ); }).toThrowDeveloperError(); }); @@ -283,7 +283,7 @@ describe("Core/OrientedBoundingBox", function () { rectangle, 0.0, 0.0, - new Ellipsoid(1.01, 1.0, 1.01) + new Ellipsoid(1.01, 1.0, 1.01), ); }).toThrowDeveloperError(); expect(function () { @@ -291,7 +291,7 @@ describe("Core/OrientedBoundingBox", function () { rectangle, 0.0, 0.0, - new Ellipsoid(1.0, 1.01, 1.01) + new Ellipsoid(1.0, 1.01, 1.01), ); }).toThrowDeveloperError(); }); @@ -303,12 +303,12 @@ describe("Core/OrientedBoundingBox", function () { rectangle, 0.0, 0.0, - ellipsoid + ellipsoid, ); expect(box.center).toEqualEpsilon( new Cartesian3(1.0, 0.0, 0.0), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); const rotScale = Matrix3.ZERO; @@ -324,13 +324,13 @@ describe("Core/OrientedBoundingBox", function () { 0.0, 0.0, ellipsoid, - result + result, ); expect(box).toBe(result); expect(box.center).toEqualEpsilon( new Cartesian3(1.0, 0.0, 0.0), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); const rotScale = Matrix3.ZERO; @@ -346,11 +346,11 @@ describe("Core/OrientedBoundingBox", function () { new Rectangle(0.0, 0.0, 0.0, 0.0), 1.0, 1.0, - Ellipsoid.UNIT_SPHERE + Ellipsoid.UNIT_SPHERE, ); expect(box.center).toEqualEpsilon( new Cartesian3(2.0, 0.0, 0.0), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); expect(box.halfAxes).toEqualEpsilon(Matrix3.ZERO, CesiumMath.EPSILON15); @@ -358,11 +358,11 @@ describe("Core/OrientedBoundingBox", function () { new Rectangle(0.0, 0.0, 0.0, 0.0), -1.0, -1.0, - Ellipsoid.UNIT_SPHERE + Ellipsoid.UNIT_SPHERE, ); expect(box.center).toEqualEpsilon( new Cartesian3(0.0, 0.0, 0.0), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); expect(box.halfAxes).toEqualEpsilon(Matrix3.ZERO, CesiumMath.EPSILON15); @@ -370,41 +370,41 @@ describe("Core/OrientedBoundingBox", function () { new Rectangle(0.0, 0.0, 0.0, 0.0), -1.0, 1.0, - Ellipsoid.UNIT_SPHERE + Ellipsoid.UNIT_SPHERE, ); expect(box.center).toEqualEpsilon( new Cartesian3(1.0, 0.0, 0.0), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); expect(box.halfAxes).toEqualEpsilon( new Matrix3(0, 0, 1, 0, 0, 0, 0, 0, 0), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); box = OrientedBoundingBox.fromRectangle( new Rectangle(-d90, -d90, d90, d90), 0.0, 1.0, - Ellipsoid.UNIT_SPHERE + Ellipsoid.UNIT_SPHERE, ); expect(box.center).toEqualEpsilon( new Cartesian3(1.0, 0.0, 0.0), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); expect(box.halfAxes).toEqualEpsilon( new Matrix3(0, 0, 1, 2, 0, 0, 0, 2, 0), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); box = OrientedBoundingBox.fromRectangle( new Rectangle(-d90, -d90, d90, d90), -1.0, -1.0, - Ellipsoid.UNIT_SPHERE + Ellipsoid.UNIT_SPHERE, ); expect(box.center).toEqualEpsilon( new Cartesian3(0.0, 0.0, 0.0), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); expect(box.halfAxes).toEqualEpsilon(Matrix3.ZERO, CesiumMath.EPSILON15); @@ -412,15 +412,15 @@ describe("Core/OrientedBoundingBox", function () { new Rectangle(-d90, -d90, d90, d90), -1.0, 0.0, - Ellipsoid.UNIT_SPHERE + Ellipsoid.UNIT_SPHERE, ); expect(box.center).toEqualEpsilon( new Cartesian3(0.5, 0.0, 0.0), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); expect(box.halfAxes).toEqualEpsilon( new Matrix3(0, 0, 0.5, 1, 0, 0, 0, 1, 0), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); }); @@ -440,15 +440,15 @@ describe("Core/OrientedBoundingBox", function () { new Rectangle(-d180, -d90, d180, d90), 0, 0, - Ellipsoid.UNIT_SPHERE + Ellipsoid.UNIT_SPHERE, ); expect(box.center).toEqualEpsilon( new Cartesian3(0, 0, 0), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); expect(box.halfAxes).toEqualEpsilon( new Matrix3(0, 0, 1, 1, 0, 0, 0, 1, 0), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); // 3/4s of longitude, full latitude @@ -456,15 +456,15 @@ describe("Core/OrientedBoundingBox", function () { new Rectangle(-d135, -d90, d135, d90), 0, 0, - Ellipsoid.UNIT_SPHERE + Ellipsoid.UNIT_SPHERE, ); expect(box.center).toEqualEpsilon( new Cartesian3(oneMinusOnePlusSqrtHalfDivTwo, 0, 0), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); expect(box.halfAxes).toEqualEpsilon( new Matrix3(0, 0, onePlusSqrtHalfDivTwo, 1, 0, 0, 0, 1, 0), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); // 3/4s of longitude, 1/2 of latitude centered at equator @@ -472,15 +472,15 @@ describe("Core/OrientedBoundingBox", function () { new Rectangle(-d135, -d45, d135, d45), 0, 0, - Ellipsoid.UNIT_SPHERE + Ellipsoid.UNIT_SPHERE, ); expect(box.center).toEqualEpsilon( new Cartesian3(oneMinusOnePlusSqrtHalfDivTwo, 0, 0), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); expect(box.halfAxes).toEqualEpsilon( new Matrix3(0, 0, onePlusSqrtHalfDivTwo, 1, 0, 0, 0, Math.SQRT1_2, 0), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); // 3/4s of longitude centered at IDL, 1/2 of latitude centered at equator @@ -488,11 +488,11 @@ describe("Core/OrientedBoundingBox", function () { new Rectangle(d180, -d45, d90, d45), 0, 0, - Ellipsoid.UNIT_SPHERE + Ellipsoid.UNIT_SPHERE, ); expect(box.center).toEqualEpsilon( new Cartesian3(sqrtTwoMinusOneDivFour, -sqrtTwoMinusOneDivFour, 0), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); expect(box.halfAxes).toEqualEpsilon( new Matrix3( @@ -504,9 +504,9 @@ describe("Core/OrientedBoundingBox", function () { -sqrtTwoPlusOneDivFour, 0, Math.SQRT1_2, - 0.0 + 0.0, ), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); // Full longitude, 1/2 of latitude centered at equator @@ -514,15 +514,15 @@ describe("Core/OrientedBoundingBox", function () { new Rectangle(-d180, -d45, d180, d45), 0, 0, - Ellipsoid.UNIT_SPHERE + Ellipsoid.UNIT_SPHERE, ); expect(box.center).toEqualEpsilon( new Cartesian3(0, 0, 0), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); expect(box.halfAxes).toEqualEpsilon( new Matrix3(0, 0, 1, 1, 0, 0, 0, Math.SQRT1_2, 0), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); // Full longitude, 1/4 of latitude starting from north pole @@ -530,11 +530,11 @@ describe("Core/OrientedBoundingBox", function () { new Rectangle(-d180, d45, d180, d90), 0, 0, - Ellipsoid.UNIT_SPHERE + Ellipsoid.UNIT_SPHERE, ); expect(box.center).toEqualEpsilon( new Cartesian3(0, 0, onePlusSqrtHalfDivTwo), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); expect(box.halfAxes).toEqualEpsilon( new Matrix3( @@ -546,9 +546,9 @@ describe("Core/OrientedBoundingBox", function () { 0, 0, oneMinusOnePlusSqrtHalfDivTwo, - 0 + 0, ), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); // Full longitude, 1/4 of latitude starting from south pole @@ -556,11 +556,11 @@ describe("Core/OrientedBoundingBox", function () { new Rectangle(-d180, -d90, d180, -d45), 0, 0, - Ellipsoid.UNIT_SPHERE + Ellipsoid.UNIT_SPHERE, ); expect(box.center).toEqualEpsilon( new Cartesian3(0, 0, -onePlusSqrtHalfDivTwo), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); expect(box.halfAxes).toEqualEpsilon( new Matrix3( @@ -572,9 +572,9 @@ describe("Core/OrientedBoundingBox", function () { 0, 0, oneMinusOnePlusSqrtHalfDivTwo, - 0 + 0, ), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); // Cmpletely on north pole @@ -582,15 +582,15 @@ describe("Core/OrientedBoundingBox", function () { new Rectangle(-d180, d90, d180, d90), 0, 0, - Ellipsoid.UNIT_SPHERE + Ellipsoid.UNIT_SPHERE, ); expect(box.center).toEqualEpsilon( new Cartesian3(0, 0, 1), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); expect(box.halfAxes).toEqualEpsilon( new Matrix3(0, 0, 0, 0, 0, 0, 0, 0, 0), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); // Completely on north pole 2 @@ -598,15 +598,15 @@ describe("Core/OrientedBoundingBox", function () { new Rectangle(-d135, d90, d135, d90), 0, 0, - Ellipsoid.UNIT_SPHERE + Ellipsoid.UNIT_SPHERE, ); expect(box.center).toEqualEpsilon( new Cartesian3(0, 0, 1), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); expect(box.halfAxes).toEqualEpsilon( new Matrix3(0, 0, 0, 0, 0, 0, 0, 0, 0), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); // Completely on south pole @@ -614,15 +614,15 @@ describe("Core/OrientedBoundingBox", function () { new Rectangle(-d180, -d90, d180, -d90), 0, 0, - Ellipsoid.UNIT_SPHERE + Ellipsoid.UNIT_SPHERE, ); expect(box.center).toEqualEpsilon( new Cartesian3(0, 0, -1), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); expect(box.halfAxes).toEqualEpsilon( new Matrix3(0, 0, 0, 0, 0, 0, 0, 0, 0), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); // Completely on south pole 2 @@ -630,15 +630,15 @@ describe("Core/OrientedBoundingBox", function () { new Rectangle(-d135, -d90, d135, -d90), 0, 0, - Ellipsoid.UNIT_SPHERE + Ellipsoid.UNIT_SPHERE, ); expect(box.center).toEqualEpsilon( new Cartesian3(0, 0, -1), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); expect(box.halfAxes).toEqualEpsilon( new Matrix3(0, 0, 0, 0, 0, 0, 0, 0, 0), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); }); @@ -656,11 +656,11 @@ describe("Core/OrientedBoundingBox", function () { new Rectangle(0.0, 0.0, 0.0, 0.0), 0.0, 0.0, - Ellipsoid.UNIT_SPHERE + Ellipsoid.UNIT_SPHERE, ); expect(box.center).toEqualEpsilon( new Cartesian3(1.0, 0.0, 0.0), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); expect(box.halfAxes).toEqualEpsilon(Matrix3.ZERO, CesiumMath.EPSILON15); @@ -668,11 +668,11 @@ describe("Core/OrientedBoundingBox", function () { new Rectangle(d180, 0.0, -d180, 0.0), 0.0, 0.0, - Ellipsoid.UNIT_SPHERE + Ellipsoid.UNIT_SPHERE, ); expect(box.center).toEqualEpsilon( new Cartesian3(-1.0, 0.0, 0.0), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); expect(box.halfAxes).toEqualEpsilon(Matrix3.ZERO, CesiumMath.EPSILON15); @@ -680,11 +680,11 @@ describe("Core/OrientedBoundingBox", function () { new Rectangle(d180, 0.0, d180, 0.0), 0.0, 0.0, - Ellipsoid.UNIT_SPHERE + Ellipsoid.UNIT_SPHERE, ); expect(box.center).toEqualEpsilon( new Cartesian3(-1.0, 0.0, 0.0), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); expect(box.halfAxes).toEqualEpsilon(Matrix3.ZERO, CesiumMath.EPSILON15); @@ -692,11 +692,11 @@ describe("Core/OrientedBoundingBox", function () { new Rectangle(0.0, d90, 0.0, d90), 0.0, 0.0, - Ellipsoid.UNIT_SPHERE + Ellipsoid.UNIT_SPHERE, ); expect(box.center).toEqualEpsilon( new Cartesian3(0.0, 0.0, 1.0), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); expect(box.halfAxes).toEqualEpsilon(Matrix3.ZERO, CesiumMath.EPSILON15); @@ -704,101 +704,101 @@ describe("Core/OrientedBoundingBox", function () { new Rectangle(0.0, 0.0, d180, 0.0), 0.0, 0.0, - Ellipsoid.UNIT_SPHERE + Ellipsoid.UNIT_SPHERE, ); expect(box.center).toEqualEpsilon( new Cartesian3(0.0, 0.5, 0.0), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); expect(box.halfAxes).toEqualEpsilon( new Matrix3(-1.0, 0.0, 0.0, 0.0, 0.0, 0.5, 0.0, 0.0, 0.0), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); box = OrientedBoundingBox.fromRectangle( new Rectangle(-d90, -d90, d90, d90), 0.0, 0.0, - Ellipsoid.UNIT_SPHERE + Ellipsoid.UNIT_SPHERE, ); expect(box.center).toEqualEpsilon( new Cartesian3(0.5, 0.0, 0.0), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); expect(box.halfAxes).toEqualEpsilon( new Matrix3(0.0, 0.0, 0.5, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); box = OrientedBoundingBox.fromRectangle( new Rectangle(-d90, -d30, d90, d90), 0.0, 0.0, - Ellipsoid.UNIT_SPHERE + Ellipsoid.UNIT_SPHERE, ); expect(box.center).toEqualEpsilon( new Cartesian3(0.1875 * sqrt3, 0.0, 0.1875), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); expect(box.halfAxes).toEqualEpsilon( new Matrix3(0, -sqrt3 / 4, (5 * sqrt3) / 16, 1, 0, 0, 0, 3 / 4, 5 / 16), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); box = OrientedBoundingBox.fromRectangle( new Rectangle(-d90, -d90, d90, d30), 0.0, 0.0, - Ellipsoid.UNIT_SPHERE + Ellipsoid.UNIT_SPHERE, ); expect(box.center).toEqualEpsilon( new Cartesian3(0.1875 * sqrt3, 0.0, -0.1875), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); expect(box.halfAxes).toEqualEpsilon( new Matrix3(0, sqrt3 / 4, (5 * sqrt3) / 16, 1, 0, 0, 0, 3 / 4, -5 / 16), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); box = OrientedBoundingBox.fromRectangle( new Rectangle(0.0, -d30, d180, d90), 0.0, 0.0, - Ellipsoid.UNIT_SPHERE + Ellipsoid.UNIT_SPHERE, ); expect(box.center).toEqualEpsilon( new Cartesian3(0.0, 0.1875 * sqrt3, 0.1875), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); expect(box.halfAxes).toEqualEpsilon( new Matrix3(-1, 0, 0, 0, -sqrt3 / 4, (5 * sqrt3) / 16, 0, 3 / 4, 5 / 16), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); box = OrientedBoundingBox.fromRectangle( new Rectangle(0.0, -d90, d180, d30), 0.0, 0.0, - Ellipsoid.UNIT_SPHERE + Ellipsoid.UNIT_SPHERE, ); expect(box.center).toEqualEpsilon( new Cartesian3(0.0, 0.1875 * sqrt3, -0.1875), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); expect(box.halfAxes).toEqualEpsilon( new Matrix3(-1, 0, 0, 0, sqrt3 / 4, (5 * sqrt3) / 16, 0, 3 / 4, -5 / 16), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); box = OrientedBoundingBox.fromRectangle( new Rectangle(-d45, 0.0, d45, 0.0), 0.0, 0.0, - Ellipsoid.UNIT_SPHERE + Ellipsoid.UNIT_SPHERE, ); expect(box.center).toEqualEpsilon( new Cartesian3((1.0 + Math.SQRT1_2) / 2.0, 0.0, 0.0), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); expect(box.halfAxes).toEqualEpsilon( new Matrix3( @@ -810,20 +810,20 @@ describe("Core/OrientedBoundingBox", function () { 0.0, 0.0, 0.0, - 0.0 + 0.0, ), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); box = OrientedBoundingBox.fromRectangle( new Rectangle(d135, 0.0, -d135, 0.0), 0.0, 0.0, - Ellipsoid.UNIT_SPHERE + Ellipsoid.UNIT_SPHERE, ); expect(box.center).toEqualEpsilon( new Cartesian3(-(1.0 + Math.SQRT1_2) / 2.0, 0.0, 0.0), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); expect(box.halfAxes).toEqualEpsilon( new Matrix3( @@ -835,20 +835,20 @@ describe("Core/OrientedBoundingBox", function () { 0.0, 0.0, 0.0, - 0.0 + 0.0, ), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); box = OrientedBoundingBox.fromRectangle( new Rectangle(0.0, -d45, 0.0, d45), 0.0, 0.0, - Ellipsoid.UNIT_SPHERE + Ellipsoid.UNIT_SPHERE, ); expect(box.center).toEqualEpsilon( new Cartesian3((1.0 + Math.SQRT1_2) / 2.0, 0.0, 0.0), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); expect(box.halfAxes).toEqualEpsilon( new Matrix3( @@ -860,39 +860,39 @@ describe("Core/OrientedBoundingBox", function () { 0.0, 0.0, Math.SQRT1_2, - 0.0 + 0.0, ), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); box = OrientedBoundingBox.fromRectangle( new Rectangle(-d90, 0.0, d90, 0.0), 0.0, 0.0, - Ellipsoid.UNIT_SPHERE + Ellipsoid.UNIT_SPHERE, ); expect(box.center).toEqualEpsilon( new Cartesian3(0.5, 0.0, 0.0), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); expect(box.halfAxes).toEqualEpsilon( new Matrix3(0.0, 0.0, 0.5, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); box = OrientedBoundingBox.fromRectangle( new Rectangle(0.0, -d90, 0.0, d90), 0.0, 0.0, - Ellipsoid.UNIT_SPHERE + Ellipsoid.UNIT_SPHERE, ); expect(box.center).toEqualEpsilon( new Cartesian3(0.5, 0.0, 0.0), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); expect(box.halfAxes).toEqualEpsilon( new Matrix3(0.0, 0.0, 0.5, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); }); @@ -903,7 +903,7 @@ describe("Core/OrientedBoundingBox", function () { const transformation = Matrix4.fromTranslationQuaternionRotationScale( translation, rotation, - scale + scale, ); const box = new OrientedBoundingBox(); @@ -914,9 +914,9 @@ describe("Core/OrientedBoundingBox", function () { Matrix3.multiplyByUniformScale( Matrix4.getMatrix3(transformation, new Matrix3()), 0.5, - new Matrix3() + new Matrix3(), ), - CesiumMath.EPSILON14 + CesiumMath.EPSILON14, ); }); @@ -927,7 +927,7 @@ describe("Core/OrientedBoundingBox", function () { const transformation = Matrix4.fromTranslationQuaternionRotationScale( translation, rotation, - scale + scale, ); const box = OrientedBoundingBox.fromTransformation(transformation); @@ -937,9 +937,9 @@ describe("Core/OrientedBoundingBox", function () { Matrix3.multiplyByUniformScale( Matrix4.getMatrix3(transformation, new Matrix3()), 0.5, - new Matrix3() + new Matrix3(), ), - CesiumMath.EPSILON14 + CesiumMath.EPSILON14, ); }); @@ -964,7 +964,7 @@ describe("Core/OrientedBoundingBox", function () { const box = new OrientedBoundingBox( center, - Matrix3.multiplyByScalar(axes, 0.5, new Matrix3()) + Matrix3.multiplyByScalar(axes, 0.5, new Matrix3()), ); const planeNormXform = function (nx, ny, nz, dist) { @@ -1438,11 +1438,11 @@ describe("Core/OrientedBoundingBox", function () { it("intersectPlane works with off-center box", function () { intersectPlaneTestCornersEdgesFaces( new Cartesian3(1.0, 0.0, 0.0), - Matrix3.IDENTITY + Matrix3.IDENTITY, ); intersectPlaneTestCornersEdgesFaces( new Cartesian3(0.7, -1.8, 12.0), - Matrix3.IDENTITY + Matrix3.IDENTITY, ); }); @@ -1451,8 +1451,8 @@ describe("Core/OrientedBoundingBox", function () { Cartesian3.ZERO, Matrix3.fromQuaternion( Quaternion.fromAxisAngle(new Cartesian3(0.5, 1.5, -1.2), 1.2), - new Matrix3() - ) + new Matrix3(), + ), ); }); @@ -1460,23 +1460,23 @@ describe("Core/OrientedBoundingBox", function () { const m = new Matrix3(); intersectPlaneTestCornersEdgesFaces( Cartesian3.ZERO, - Matrix3.fromScale(new Cartesian3(1.5, 0.4, 20.6), m) + Matrix3.fromScale(new Cartesian3(1.5, 0.4, 20.6), m), ); intersectPlaneTestCornersEdgesFaces( Cartesian3.ZERO, - Matrix3.fromScale(new Cartesian3(0.0, 0.4, 20.6), m) + Matrix3.fromScale(new Cartesian3(0.0, 0.4, 20.6), m), ); intersectPlaneTestCornersEdgesFaces( Cartesian3.ZERO, - Matrix3.fromScale(new Cartesian3(1.5, 0.0, 20.6), m) + Matrix3.fromScale(new Cartesian3(1.5, 0.0, 20.6), m), ); intersectPlaneTestCornersEdgesFaces( Cartesian3.ZERO, - Matrix3.fromScale(new Cartesian3(1.5, 0.4, 0.0), m) + Matrix3.fromScale(new Cartesian3(1.5, 0.4, 0.0), m), ); intersectPlaneTestCornersEdgesFaces( Cartesian3.ZERO, - Matrix3.fromScale(new Cartesian3(0.0, 0.0, 0.0), m) + Matrix3.fromScale(new Cartesian3(0.0, 0.0, 0.0), m), ); }); @@ -1484,7 +1484,7 @@ describe("Core/OrientedBoundingBox", function () { const m = Matrix3.fromScale(new Cartesian3(1.5, 80.4, 2.6), new Matrix3()); const n = Matrix3.fromQuaternion( Quaternion.fromAxisAngle(new Cartesian3(0.5, 1.5, -1.2), 1.2), - new Matrix3() + new Matrix3(), ); Matrix3.multiply(m, n, n); intersectPlaneTestCornersEdgesFaces(new Cartesian3(-5.1, 0.0, 0.1), n); @@ -1513,7 +1513,7 @@ describe("Core/OrientedBoundingBox", function () { const rotationScale = Matrix3.multiplyByScale( rotation, scale, - new Matrix3() + new Matrix3(), ); const center = new Cartesian3(4.0, 3.0, 2.0); @@ -1533,7 +1533,7 @@ describe("Core/OrientedBoundingBox", function () { let expected = d * d; expect(obb.distanceSquaredTo(cartesian)).toEqualEpsilon( expected, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); // from negative x direction @@ -1544,7 +1544,7 @@ describe("Core/OrientedBoundingBox", function () { expected = d * d; expect(obb.distanceSquaredTo(cartesian)).toEqualEpsilon( expected, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); // from positive y direction @@ -1555,7 +1555,7 @@ describe("Core/OrientedBoundingBox", function () { expected = d * d; expect(obb.distanceSquaredTo(cartesian)).toEqualEpsilon( expected, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); // from negative y direction @@ -1566,7 +1566,7 @@ describe("Core/OrientedBoundingBox", function () { expected = d * d; expect(obb.distanceSquaredTo(cartesian)).toEqualEpsilon( expected, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); // from positive z direction @@ -1577,7 +1577,7 @@ describe("Core/OrientedBoundingBox", function () { expected = d * d; expect(obb.distanceSquaredTo(cartesian)).toEqualEpsilon( expected, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); // from negative z direction @@ -1588,7 +1588,7 @@ describe("Core/OrientedBoundingBox", function () { expected = d * d; expect(obb.distanceSquaredTo(cartesian)).toEqualEpsilon( expected, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); // from corner point @@ -1602,7 +1602,7 @@ describe("Core/OrientedBoundingBox", function () { expected = d * d; expect(obb.distanceSquaredTo(cartesian)).toEqualEpsilon( expected, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); // inside box @@ -1611,7 +1611,7 @@ describe("Core/OrientedBoundingBox", function () { Cartesian3.add(center, offset, cartesian); expect(obb.distanceSquaredTo(cartesian)).toEqualEpsilon( 0.0, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); }); @@ -1622,7 +1622,7 @@ describe("Core/OrientedBoundingBox", function () { const rotationScale = Matrix3.multiplyByScale( rotation, scale, - new Matrix3() + new Matrix3(), ); const center = new Cartesian3(4.0, 3.0, 2.0); @@ -1647,7 +1647,7 @@ describe("Core/OrientedBoundingBox", function () { let expected = d * d; expect(obb.distanceSquaredTo(cartesian)).toEqualEpsilon( expected, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); // from negative x direction @@ -1658,7 +1658,7 @@ describe("Core/OrientedBoundingBox", function () { expected = d * d; expect(obb.distanceSquaredTo(cartesian)).toEqualEpsilon( expected, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); // from positive y direction @@ -1669,7 +1669,7 @@ describe("Core/OrientedBoundingBox", function () { expected = d * d; expect(obb.distanceSquaredTo(cartesian)).toEqualEpsilon( expected, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); // from negative y direction @@ -1680,7 +1680,7 @@ describe("Core/OrientedBoundingBox", function () { expected = d * d; expect(obb.distanceSquaredTo(cartesian)).toEqualEpsilon( expected, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); // from positive z direction @@ -1691,7 +1691,7 @@ describe("Core/OrientedBoundingBox", function () { expected = d * d; expect(obb.distanceSquaredTo(cartesian)).toEqualEpsilon( expected, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); // from negative z direction @@ -1702,7 +1702,7 @@ describe("Core/OrientedBoundingBox", function () { expected = d * d; expect(obb.distanceSquaredTo(cartesian)).toEqualEpsilon( expected, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); // from corner point @@ -1715,7 +1715,7 @@ describe("Core/OrientedBoundingBox", function () { expected = d * d; expect(obb.distanceSquaredTo(cartesian)).toEqualEpsilon( expected, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); // inside box @@ -1724,7 +1724,7 @@ describe("Core/OrientedBoundingBox", function () { Cartesian3.add(center, offset, cartesian); expect(obb.distanceSquaredTo(cartesian)).toEqualEpsilon( 0.0, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); }); @@ -1735,7 +1735,7 @@ describe("Core/OrientedBoundingBox", function () { const rotationScale = Matrix3.multiplyByScale( rotation, scale, - new Matrix3() + new Matrix3(), ); const center = new Cartesian3(4.0, 3.0, 2.0); @@ -1760,7 +1760,7 @@ describe("Core/OrientedBoundingBox", function () { let expected = d * d; expect(obb.distanceSquaredTo(cartesian)).toEqualEpsilon( expected, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); // from negative x direction @@ -1771,7 +1771,7 @@ describe("Core/OrientedBoundingBox", function () { expected = d * d; expect(obb.distanceSquaredTo(cartesian)).toEqualEpsilon( expected, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); // from positive y direction @@ -1782,7 +1782,7 @@ describe("Core/OrientedBoundingBox", function () { expected = d * d; expect(obb.distanceSquaredTo(cartesian)).toEqualEpsilon( expected, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); // from negative y direction @@ -1793,7 +1793,7 @@ describe("Core/OrientedBoundingBox", function () { expected = d * d; expect(obb.distanceSquaredTo(cartesian)).toEqualEpsilon( expected, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); // from positive z direction @@ -1804,7 +1804,7 @@ describe("Core/OrientedBoundingBox", function () { expected = d * d; expect(obb.distanceSquaredTo(cartesian)).toEqualEpsilon( expected, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); // from negative z direction @@ -1815,7 +1815,7 @@ describe("Core/OrientedBoundingBox", function () { expected = d * d; expect(obb.distanceSquaredTo(cartesian)).toEqualEpsilon( expected, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); // from corner point @@ -1828,7 +1828,7 @@ describe("Core/OrientedBoundingBox", function () { expected = d * d; expect(obb.distanceSquaredTo(cartesian)).toEqualEpsilon( expected, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); // inside box @@ -1837,7 +1837,7 @@ describe("Core/OrientedBoundingBox", function () { Cartesian3.add(center, offset, cartesian); expect(obb.distanceSquaredTo(cartesian)).toEqualEpsilon( 0.0, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); }); @@ -1869,7 +1869,7 @@ describe("Core/OrientedBoundingBox", function () { let expected = d * d; expect(obb.distanceSquaredTo(cartesian)).toEqualEpsilon( expected, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); // from negative x direction @@ -1880,7 +1880,7 @@ describe("Core/OrientedBoundingBox", function () { expected = d * d; expect(obb.distanceSquaredTo(cartesian)).toEqualEpsilon( expected, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); // from positive y direction @@ -1891,7 +1891,7 @@ describe("Core/OrientedBoundingBox", function () { expected = d * d; expect(obb.distanceSquaredTo(cartesian)).toEqualEpsilon( expected, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); // from negative y direction @@ -1902,7 +1902,7 @@ describe("Core/OrientedBoundingBox", function () { expected = d * d; expect(obb.distanceSquaredTo(cartesian)).toEqualEpsilon( expected, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); // from positive z direction @@ -1913,7 +1913,7 @@ describe("Core/OrientedBoundingBox", function () { expected = d * d; expect(obb.distanceSquaredTo(cartesian)).toEqualEpsilon( expected, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); // from negative z direction @@ -1924,7 +1924,7 @@ describe("Core/OrientedBoundingBox", function () { expected = d * d; expect(obb.distanceSquaredTo(cartesian)).toEqualEpsilon( expected, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); // from corner point @@ -1937,7 +1937,7 @@ describe("Core/OrientedBoundingBox", function () { expected = d * d; expect(obb.distanceSquaredTo(cartesian)).toEqualEpsilon( expected, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); // inside box @@ -1945,7 +1945,7 @@ describe("Core/OrientedBoundingBox", function () { Cartesian3.add(center, offset, cartesian); expect(obb.distanceSquaredTo(cartesian)).toEqualEpsilon( 0.0, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); }); @@ -1958,7 +1958,7 @@ describe("Core/OrientedBoundingBox", function () { const rotationScale = Matrix3.multiplyByScale( rotation, scale, - new Matrix3() + new Matrix3(), ); const center = new Cartesian3(4.0, 3.0, 2.0); @@ -1988,7 +1988,7 @@ describe("Core/OrientedBoundingBox", function () { let expected = d * d; expect(obb.distanceSquaredTo(cartesian)).toEqualEpsilon( expected, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); // from negative x direction @@ -1999,7 +1999,7 @@ describe("Core/OrientedBoundingBox", function () { expected = d * d; expect(obb.distanceSquaredTo(cartesian)).toEqualEpsilon( expected, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); // from positive y direction @@ -2010,7 +2010,7 @@ describe("Core/OrientedBoundingBox", function () { expected = d * d; expect(obb.distanceSquaredTo(cartesian)).toEqualEpsilon( expected, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); // from negative y direction @@ -2021,7 +2021,7 @@ describe("Core/OrientedBoundingBox", function () { expected = d * d; expect(obb.distanceSquaredTo(cartesian)).toEqualEpsilon( expected, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); // from positive z direction @@ -2032,7 +2032,7 @@ describe("Core/OrientedBoundingBox", function () { expected = d * d; expect(obb.distanceSquaredTo(cartesian)).toEqualEpsilon( expected, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); // from negative z direction @@ -2043,7 +2043,7 @@ describe("Core/OrientedBoundingBox", function () { expected = d * d; expect(obb.distanceSquaredTo(cartesian)).toEqualEpsilon( expected, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); // from endpoint in posiive direction @@ -2055,7 +2055,7 @@ describe("Core/OrientedBoundingBox", function () { expected = d * d; expect(obb.distanceSquaredTo(cartesian)).toEqualEpsilon( expected, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); // from endpoint in negative direction @@ -2068,7 +2068,7 @@ describe("Core/OrientedBoundingBox", function () { expected = d * d; expect(obb.distanceSquaredTo(cartesian)).toEqualEpsilon( expected, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); // inside box @@ -2077,7 +2077,7 @@ describe("Core/OrientedBoundingBox", function () { Cartesian3.add(center, offset, cartesian); expect(obb.distanceSquaredTo(cartesian)).toEqualEpsilon( 0.0, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); }); @@ -2090,7 +2090,7 @@ describe("Core/OrientedBoundingBox", function () { const rotationScale = Matrix3.multiplyByScale( rotation, scale, - new Matrix3() + new Matrix3(), ); const center = new Cartesian3(4.0, 3.0, 2.0); @@ -2120,7 +2120,7 @@ describe("Core/OrientedBoundingBox", function () { let expected = d * d; expect(obb.distanceSquaredTo(cartesian)).toEqualEpsilon( expected, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); // from negative x direction @@ -2131,7 +2131,7 @@ describe("Core/OrientedBoundingBox", function () { expected = d * d; expect(obb.distanceSquaredTo(cartesian)).toEqualEpsilon( expected, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); // from positive y direction @@ -2142,7 +2142,7 @@ describe("Core/OrientedBoundingBox", function () { expected = d * d; expect(obb.distanceSquaredTo(cartesian)).toEqualEpsilon( expected, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); // from negative y direction @@ -2153,7 +2153,7 @@ describe("Core/OrientedBoundingBox", function () { expected = d * d; expect(obb.distanceSquaredTo(cartesian)).toEqualEpsilon( expected, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); // from positive z direction @@ -2164,7 +2164,7 @@ describe("Core/OrientedBoundingBox", function () { expected = d * d; expect(obb.distanceSquaredTo(cartesian)).toEqualEpsilon( expected, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); // from negative z direction @@ -2175,7 +2175,7 @@ describe("Core/OrientedBoundingBox", function () { expected = d * d; expect(obb.distanceSquaredTo(cartesian)).toEqualEpsilon( expected, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); // from endpoint in positive direction @@ -2187,7 +2187,7 @@ describe("Core/OrientedBoundingBox", function () { expected = d * d; expect(obb.distanceSquaredTo(cartesian)).toEqualEpsilon( expected, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); // from endpoint in negative direction @@ -2200,7 +2200,7 @@ describe("Core/OrientedBoundingBox", function () { expected = d * d; expect(obb.distanceSquaredTo(cartesian)).toEqualEpsilon( expected, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); // inside box @@ -2209,7 +2209,7 @@ describe("Core/OrientedBoundingBox", function () { Cartesian3.add(center, offset, cartesian); expect(obb.distanceSquaredTo(cartesian)).toEqualEpsilon( 0.0, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); }); @@ -2222,7 +2222,7 @@ describe("Core/OrientedBoundingBox", function () { const rotationScale = Matrix3.multiplyByScale( rotation, scale, - new Matrix3() + new Matrix3(), ); const center = new Cartesian3(4.0, 3.0, 2.0); @@ -2252,7 +2252,7 @@ describe("Core/OrientedBoundingBox", function () { let expected = d * d; expect(obb.distanceSquaredTo(cartesian)).toEqualEpsilon( expected, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); // from negative x direction @@ -2263,7 +2263,7 @@ describe("Core/OrientedBoundingBox", function () { expected = d * d; expect(obb.distanceSquaredTo(cartesian)).toEqualEpsilon( expected, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); // from positive y direction @@ -2274,7 +2274,7 @@ describe("Core/OrientedBoundingBox", function () { expected = d * d; expect(obb.distanceSquaredTo(cartesian)).toEqualEpsilon( expected, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); // from negative y direction @@ -2285,7 +2285,7 @@ describe("Core/OrientedBoundingBox", function () { expected = d * d; expect(obb.distanceSquaredTo(cartesian)).toEqualEpsilon( expected, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); // from positive z direction @@ -2296,7 +2296,7 @@ describe("Core/OrientedBoundingBox", function () { expected = d * d; expect(obb.distanceSquaredTo(cartesian)).toEqualEpsilon( expected, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); // from negative z direction @@ -2307,7 +2307,7 @@ describe("Core/OrientedBoundingBox", function () { expected = d * d; expect(obb.distanceSquaredTo(cartesian)).toEqualEpsilon( expected, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); // from endpoint in positive direction @@ -2319,7 +2319,7 @@ describe("Core/OrientedBoundingBox", function () { expected = d * d; expect(obb.distanceSquaredTo(cartesian)).toEqualEpsilon( expected, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); // from endpoint in negative direction // from endpoint in negative direction @@ -2332,7 +2332,7 @@ describe("Core/OrientedBoundingBox", function () { expected = d * d; expect(obb.distanceSquaredTo(cartesian)).toEqualEpsilon( expected, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); // inside box @@ -2341,7 +2341,7 @@ describe("Core/OrientedBoundingBox", function () { Cartesian3.add(center, offset, cartesian); expect(obb.distanceSquaredTo(cartesian)).toEqualEpsilon( 0.0, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); }); @@ -2372,7 +2372,7 @@ describe("Core/OrientedBoundingBox", function () { let expected = d * d; expect(obb.distanceSquaredTo(cartesian)).toEqualEpsilon( expected, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); // from negative x direction @@ -2383,7 +2383,7 @@ describe("Core/OrientedBoundingBox", function () { expected = d * d; expect(obb.distanceSquaredTo(cartesian)).toEqualEpsilon( expected, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); // from positive y direction @@ -2394,7 +2394,7 @@ describe("Core/OrientedBoundingBox", function () { expected = d * d; expect(obb.distanceSquaredTo(cartesian)).toEqualEpsilon( expected, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); // from negative y direction @@ -2405,7 +2405,7 @@ describe("Core/OrientedBoundingBox", function () { expected = d * d; expect(obb.distanceSquaredTo(cartesian)).toEqualEpsilon( expected, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); // from positive z direction @@ -2416,7 +2416,7 @@ describe("Core/OrientedBoundingBox", function () { expected = d * d; expect(obb.distanceSquaredTo(cartesian)).toEqualEpsilon( expected, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); // from negative z direction @@ -2427,7 +2427,7 @@ describe("Core/OrientedBoundingBox", function () { expected = d * d; expect(obb.distanceSquaredTo(cartesian)).toEqualEpsilon( expected, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); // from arbitrary point @@ -2438,14 +2438,14 @@ describe("Core/OrientedBoundingBox", function () { expected = d * d; expect(obb.distanceSquaredTo(cartesian)).toEqualEpsilon( expected, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); // inside box cartesian = center; expect(obb.distanceSquaredTo(center)).toEqualEpsilon( 0.0, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); }); @@ -2459,7 +2459,7 @@ describe("Core/OrientedBoundingBox", function () { expect(function () { OrientedBoundingBox.distanceSquaredTo( new OrientedBoundingBox(), - undefined + undefined, ); }).toThrowDeveloperError(); }); @@ -2550,7 +2550,7 @@ describe("Core/OrientedBoundingBox", function () { OrientedBoundingBox.computePlaneDistances( undefined, new Cartesian3(), - new Cartesian3() + new Cartesian3(), ); }).toThrowDeveloperError(); }); @@ -2560,7 +2560,7 @@ describe("Core/OrientedBoundingBox", function () { OrientedBoundingBox.computePlaneDistances( new OrientedBoundingBox(), undefined, - new Cartesian3() + new Cartesian3(), ); }).toThrowDeveloperError(); }); @@ -2570,7 +2570,7 @@ describe("Core/OrientedBoundingBox", function () { OrientedBoundingBox.computePlaneDistances( new OrientedBoundingBox(), new Cartesian3(), - undefined + undefined, ); }).toThrowDeveloperError(); }); @@ -2589,7 +2589,7 @@ describe("Core/OrientedBoundingBox", function () { new Cartesian3(), new Cartesian3(), new Cartesian3(), - new Cartesian3() + new Cartesian3(), ); const result = box.computeCorners(corners); @@ -2658,7 +2658,7 @@ describe("Core/OrientedBoundingBox", function () { const extractedTranslation = Matrix4.getTranslation( result, - new Cartesian3() + new Cartesian3(), ); const extractedScale = Matrix4.getScale(result, new Cartesian3()); @@ -2678,7 +2678,7 @@ describe("Core/OrientedBoundingBox", function () { const extractedTranslation = Matrix4.getTranslation( transformation, - new Cartesian3() + new Cartesian3(), ); const extractedScale = Matrix4.getScale(transformation, new Cartesian3()); @@ -2711,7 +2711,7 @@ describe("Core/OrientedBoundingBox", function () { let halfAxes = Matrix3.multiplyByScale( Matrix3.IDENTITY, new Cartesian3(radius, radius, radius), - new Matrix3() + new Matrix3(), ); let obb = new OrientedBoundingBox(new Cartesian3(0, 0, -2.75), halfAxes); expect(obb.isOccluded(occluder)).toEqual(true); @@ -2723,7 +2723,7 @@ describe("Core/OrientedBoundingBox", function () { halfAxes = Matrix3.multiplyByScale( Matrix3.IDENTITY, new Cartesian3(radius, radius, radius), - new Matrix3() + new Matrix3(), ); obb = new OrientedBoundingBox(new Cartesian3(0, 0, -1.5), halfAxes); expect(obb.isOccluded(occluder)).toEqual(false); @@ -2733,7 +2733,7 @@ describe("Core/OrientedBoundingBox", function () { expect(function () { OrientedBoundingBox.isOccluded( undefined, - new Occluder(new BoundingSphere(), new Cartesian3()) + new Occluder(new BoundingSphere(), new Cartesian3()), ); }).toThrowDeveloperError(); }); @@ -2794,6 +2794,6 @@ describe("Core/OrientedBoundingBox", function () { createPackableSpecs( OrientedBoundingBox, new OrientedBoundingBox(new Cartesian3(1.0, 2.0, 3.0), Matrix3.IDENTITY), - [1.0, 2.0, 3.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0] + [1.0, 2.0, 3.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0], ); }); diff --git a/packages/engine/Specs/Core/OrthographicFrustumSpec.js b/packages/engine/Specs/Core/OrthographicFrustumSpec.js index fa90747bbd10..cb9deacbb96e 100644 --- a/packages/engine/Specs/Core/OrthographicFrustumSpec.js +++ b/packages/engine/Specs/Core/OrthographicFrustumSpec.js @@ -21,7 +21,7 @@ describe("Core/OrthographicFrustum", function () { planes = frustum.computeCullingVolume( new Cartesian3(), Cartesian3.negate(Cartesian3.UNIT_Z, new Cartesian3()), - Cartesian3.UNIT_Y + Cartesian3.UNIT_Y, ).planes; }); @@ -145,7 +145,7 @@ describe("Core/OrthographicFrustum", function () { frustum.top, frustum.near, frustum.far, - new Matrix4() + new Matrix4(), ); const projectionMatrix = frustum.projectionMatrix; expect(projectionMatrix).toEqualEpsilon(expected, CesiumMath.EPSILON6); @@ -158,7 +158,7 @@ describe("Core/OrthographicFrustum", function () { undefined, 0.0, 1.0, - new Cartesian2() + new Cartesian2(), ); }).toThrowDeveloperError(); }); @@ -170,7 +170,7 @@ describe("Core/OrthographicFrustum", function () { 1.0, 0.0, 1.0, - new Cartesian2() + new Cartesian2(), ); }).toThrowDeveloperError(); }); @@ -194,7 +194,7 @@ describe("Core/OrthographicFrustum", function () { 1.0, 0.0, undefined, - new Cartesian2() + new Cartesian2(), ); }).toThrowDeveloperError(); }); @@ -214,14 +214,14 @@ describe("Core/OrthographicFrustum", function () { dimensions.y, distance, pixelRatio, - new Cartesian2() + new Cartesian2(), ); const expected = frustum.offCenterFrustum.getPixelDimensions( dimensions.x, dimensions.y, distance, pixelRatio, - new Cartesian2() + new Cartesian2(), ); expect(pixelSize.x).toEqual(expected.x); expect(pixelSize.y).toEqual(expected.y); @@ -236,14 +236,14 @@ describe("Core/OrthographicFrustum", function () { dimensions.y, distance, pixelRatio, - new Cartesian2() + new Cartesian2(), ); const expected = frustum.offCenterFrustum.getPixelDimensions( dimensions.x, dimensions.y, distance, pixelRatio, - new Cartesian2() + new Cartesian2(), ); expect(pixelSize.x).toEqual(expected.x); expect(pixelSize.y).toEqual(expected.y); @@ -312,6 +312,6 @@ describe("Core/OrthographicFrustum", function () { near: 3.0, far: 4.0, }), - [1.0, 2.0, 3.0, 4.0] + [1.0, 2.0, 3.0, 4.0], ); }); diff --git a/packages/engine/Specs/Core/OrthographicOffCenterFrustumSpec.js b/packages/engine/Specs/Core/OrthographicOffCenterFrustumSpec.js index 4040ffc5df38..90c8153a5ab4 100644 --- a/packages/engine/Specs/Core/OrthographicOffCenterFrustumSpec.js +++ b/packages/engine/Specs/Core/OrthographicOffCenterFrustumSpec.js @@ -21,7 +21,7 @@ describe("Core/OrthographicOffCenterFrustum", function () { planes = frustum.computeCullingVolume( new Cartesian3(), Cartesian3.negate(Cartesian3.UNIT_Z, new Cartesian3()), - Cartesian3.UNIT_Y + Cartesian3.UNIT_Y, ).planes; }); @@ -147,7 +147,7 @@ describe("Core/OrthographicOffCenterFrustum", function () { frustum.top, frustum.near, frustum.far, - new Matrix4() + new Matrix4(), ); expect(projectionMatrix).toEqualEpsilon(expected, CesiumMath.EPSILON6); }); @@ -159,7 +159,7 @@ describe("Core/OrthographicOffCenterFrustum", function () { undefined, 0.0, 1.0, - new Cartesian2() + new Cartesian2(), ); }).toThrowDeveloperError(); }); @@ -171,7 +171,7 @@ describe("Core/OrthographicOffCenterFrustum", function () { 1.0, 0.0, 1.0, - new Cartesian2() + new Cartesian2(), ); }).toThrowDeveloperError(); }); @@ -195,7 +195,7 @@ describe("Core/OrthographicOffCenterFrustum", function () { 1.0, 0.0, undefined, - new Cartesian2() + new Cartesian2(), ); }).toThrowDeveloperError(); }); @@ -212,7 +212,7 @@ describe("Core/OrthographicOffCenterFrustum", function () { 1.0, 0.0, 1.0, - new Cartesian2() + new Cartesian2(), ); expect(pixelSize.x).toEqual(2.0); expect(pixelSize.y).toEqual(2.0); @@ -224,7 +224,7 @@ describe("Core/OrthographicOffCenterFrustum", function () { 1.0, 0.0, 2.0, - new Cartesian2() + new Cartesian2(), ); expect(pixelSize.x).toEqual(4.0); expect(pixelSize.y).toEqual(4.0); diff --git a/packages/engine/Specs/Core/PeliasGeocoderServiceSpec.js b/packages/engine/Specs/Core/PeliasGeocoderServiceSpec.js index a12b2cc1899e..1211b0b1353a 100644 --- a/packages/engine/Specs/Core/PeliasGeocoderServiceSpec.js +++ b/packages/engine/Specs/Core/PeliasGeocoderServiceSpec.js @@ -36,7 +36,7 @@ describe("Core/PeliasGeocoderService", function () { ], }; spyOn(Resource.prototype, "fetchJson").and.returnValue( - Promise.resolve(data) + Promise.resolve(data), ); const results = await service.geocode(query); @@ -70,7 +70,7 @@ describe("Core/PeliasGeocoderService", function () { ], }; spyOn(Resource.prototype, "fetchJson").and.returnValue( - Promise.resolve(data) + Promise.resolve(data), ); const results = await service.geocode(query); @@ -87,7 +87,7 @@ describe("Core/PeliasGeocoderService", function () { const query = "some query"; const data = { features: [] }; spyOn(Resource.prototype, "fetchJson").and.returnValue( - Promise.resolve(data) + Promise.resolve(data), ); const results = await service.geocode(query); @@ -100,11 +100,11 @@ describe("Core/PeliasGeocoderService", function () { const query = "some query"; const data = { features: [] }; spyOn(Resource.prototype, "fetchJson").and.returnValue( - Promise.resolve(data) + Promise.resolve(data), ); const getDerivedResource = spyOn( service._url, - "getDerivedResource" + "getDerivedResource", ).and.callThrough(); await service.geocode(query, GeocodeType.SEARCH); @@ -122,11 +122,11 @@ describe("Core/PeliasGeocoderService", function () { const query = "some query"; const data = { features: [] }; spyOn(Resource.prototype, "fetchJson").and.returnValue( - Promise.resolve(data) + Promise.resolve(data), ); const getDerivedResource = spyOn( service._url, - "getDerivedResource" + "getDerivedResource", ).and.callThrough(); await service.geocode(query, GeocodeType.AUTOCOMPLETE); diff --git a/packages/engine/Specs/Core/PerspectiveFrustumSpec.js b/packages/engine/Specs/Core/PerspectiveFrustumSpec.js index 3e3c16fdcf1a..7fd5d508e69f 100644 --- a/packages/engine/Specs/Core/PerspectiveFrustumSpec.js +++ b/packages/engine/Specs/Core/PerspectiveFrustumSpec.js @@ -21,7 +21,7 @@ describe("Core/PerspectiveFrustum", function () { planes = frustum.computeCullingVolume( new Cartesian3(), Cartesian3.negate(Cartesian3.UNIT_Z, new Cartesian3()), - Cartesian3.UNIT_Y + Cartesian3.UNIT_Y, ).planes; }); @@ -116,7 +116,7 @@ describe("Core/PerspectiveFrustum", function () { -Math.sqrt(3.0) / 2.0, 0.0, -0.5, - 0.0 + 0.0, ); expect(rightPlane).toEqualEpsilon(expectedResult, CesiumMath.EPSILON14); }); @@ -133,7 +133,7 @@ describe("Core/PerspectiveFrustum", function () { 0.0, -Math.sqrt(3.0) / 2.0, -0.5, - 0.0 + 0.0, ); expect(topPlane).toEqualEpsilon(expectedResult, CesiumMath.EPSILON14); }); @@ -161,7 +161,7 @@ describe("Core/PerspectiveFrustum", function () { frustum.aspectRatio, frustum.near, frustum.far, - new Matrix4() + new Matrix4(), ); expect(projectionMatrix).toEqualEpsilon(expected, CesiumMath.EPSILON6); }); @@ -179,7 +179,7 @@ describe("Core/PerspectiveFrustum", function () { bottom, top, near, - new Matrix4() + new Matrix4(), ); expect(frustum.infiniteProjectionMatrix).toEqual(expected); }); @@ -191,7 +191,7 @@ describe("Core/PerspectiveFrustum", function () { undefined, 1.0, 1.0, - new Cartesian2() + new Cartesian2(), ); }).toThrowDeveloperError(); }); @@ -203,7 +203,7 @@ describe("Core/PerspectiveFrustum", function () { 1.0, 1.0, 1.0, - new Cartesian2() + new Cartesian2(), ); }).toThrowDeveloperError(); }); @@ -227,7 +227,7 @@ describe("Core/PerspectiveFrustum", function () { 1.0, 1.0, undefined, - new Cartesian2() + new Cartesian2(), ); }).toThrowDeveloperError(); }); @@ -247,14 +247,14 @@ describe("Core/PerspectiveFrustum", function () { dimensions.y, distance, pixelRatio, - new Cartesian2() + new Cartesian2(), ); const expected = frustum.offCenterFrustum.getPixelDimensions( dimensions.x, dimensions.y, distance, pixelRatio, - new Cartesian2() + new Cartesian2(), ); expect(pixelSize.x).toEqual(expected.x); expect(pixelSize.y).toEqual(expected.y); @@ -269,14 +269,14 @@ describe("Core/PerspectiveFrustum", function () { dimensions.y, distance, pixelRatio, - new Cartesian2() + new Cartesian2(), ); const expected = frustum.offCenterFrustum.getPixelDimensions( dimensions.x, dimensions.y, distance, pixelRatio, - new Cartesian2() + new Cartesian2(), ); expect(pixelSize.x).toEqual(expected.x); expect(pixelSize.y).toEqual(expected.y); @@ -347,6 +347,6 @@ describe("Core/PerspectiveFrustum", function () { xOffset: 5.0, yOffset: 6.0, }), - [1.0, 2.0, 3.0, 4.0, 5.0, 6.0] + [1.0, 2.0, 3.0, 4.0, 5.0, 6.0], ); }); diff --git a/packages/engine/Specs/Core/PerspectiveOffCenterFrustumSpec.js b/packages/engine/Specs/Core/PerspectiveOffCenterFrustumSpec.js index 3d4201bff5ca..4e443c690d0e 100644 --- a/packages/engine/Specs/Core/PerspectiveOffCenterFrustumSpec.js +++ b/packages/engine/Specs/Core/PerspectiveOffCenterFrustumSpec.js @@ -21,7 +21,7 @@ describe("Core/PerspectiveOffCenterFrustum", function () { planes = frustum.computeCullingVolume( new Cartesian3(), Cartesian3.negate(Cartesian3.UNIT_Z, new Cartesian3()), - Cartesian3.UNIT_Y + Cartesian3.UNIT_Y, ).planes; }); @@ -139,7 +139,7 @@ describe("Core/PerspectiveOffCenterFrustum", function () { top, near, far, - new Matrix4() + new Matrix4(), ); expect(projectionMatrix).toEqualEpsilon(expected, CesiumMath.EPSILON6); @@ -158,7 +158,7 @@ describe("Core/PerspectiveOffCenterFrustum", function () { bottom, top, near, - new Matrix4() + new Matrix4(), ); expect(expected).toEqual(frustum.infiniteProjectionMatrix); }); @@ -170,7 +170,7 @@ describe("Core/PerspectiveOffCenterFrustum", function () { undefined, 1.0, 1.0, - new Cartesian2() + new Cartesian2(), ); }).toThrowDeveloperError(); }); @@ -182,7 +182,7 @@ describe("Core/PerspectiveOffCenterFrustum", function () { 1.0, 1.0, 1.0, - new Cartesian2() + new Cartesian2(), ); }).toThrowDeveloperError(); }); @@ -206,7 +206,7 @@ describe("Core/PerspectiveOffCenterFrustum", function () { 1.0, 1.0, undefined, - new Cartesian2() + new Cartesian2(), ); }).toThrowDeveloperError(); }); @@ -223,7 +223,7 @@ describe("Core/PerspectiveOffCenterFrustum", function () { 1.0, 1.0, 1.0, - new Cartesian2() + new Cartesian2(), ); expect(pixelSize.x).toEqual(2.0); expect(pixelSize.y).toEqual(2.0); @@ -235,7 +235,7 @@ describe("Core/PerspectiveOffCenterFrustum", function () { 1.0, 1.0, 2.0, - new Cartesian2() + new Cartesian2(), ); expect(pixelSize.x).toEqual(4.0); expect(pixelSize.y).toEqual(4.0); diff --git a/packages/engine/Specs/Core/PinBuilderSpec.js b/packages/engine/Specs/Core/PinBuilderSpec.js index 5e863733d0d8..8b8cd0342878 100644 --- a/packages/engine/Specs/Core/PinBuilderSpec.js +++ b/packages/engine/Specs/Core/PinBuilderSpec.js @@ -35,8 +35,8 @@ describe("Core/PinBuilder", function () { builder.fromUrl( buildModuleUrl("Assets/Textures/maki/square.png"), Color.RED, - 128 - ) + 128, + ), ).then(function (canvas) { expect(getPinColor(canvas)).toEqual(Color.RED); expect(getIconColor(canvas)).toEqual(Color.WHITE); @@ -48,7 +48,7 @@ describe("Core/PinBuilder", function () { //Solid square icon return Promise.resolve( - builder.fromMakiIconId("square", Color.YELLOW, 128) + builder.fromMakiIconId("square", Color.YELLOW, 128), ).then(function (canvas) { expect(getPinColor(canvas)).toEqual(Color.YELLOW); expect(getIconColor(canvas)).toEqual(Color.WHITE); diff --git a/packages/engine/Specs/Core/PixelDatatypeSpec.js b/packages/engine/Specs/Core/PixelDatatypeSpec.js index f943dbcbb04a..76f67c0878a2 100644 --- a/packages/engine/Specs/Core/PixelDatatypeSpec.js +++ b/packages/engine/Specs/Core/PixelDatatypeSpec.js @@ -3,16 +3,16 @@ import { PixelDatatype } from "../../index.js"; describe("Core/PixelDatatype", function () { it("getTypedArrayConstructor returns the expected constructor", function () { expect( - PixelDatatype.getTypedArrayConstructor(PixelDatatype.UNSIGNED_BYTE) + PixelDatatype.getTypedArrayConstructor(PixelDatatype.UNSIGNED_BYTE), ).toBe(Uint8Array); expect( - PixelDatatype.getTypedArrayConstructor(PixelDatatype.UNSIGNED_SHORT) + PixelDatatype.getTypedArrayConstructor(PixelDatatype.UNSIGNED_SHORT), ).toBe(Uint16Array); expect( - PixelDatatype.getTypedArrayConstructor(PixelDatatype.UNSIGNED_INT) + PixelDatatype.getTypedArrayConstructor(PixelDatatype.UNSIGNED_INT), ).toBe(Uint32Array); expect(PixelDatatype.getTypedArrayConstructor(PixelDatatype.FLOAT)).toBe( - Float32Array + Float32Array, ); }); }); diff --git a/packages/engine/Specs/Core/PixelFormatSpec.js b/packages/engine/Specs/Core/PixelFormatSpec.js index 386a4b31dd61..a8a3141035d9 100644 --- a/packages/engine/Specs/Core/PixelFormatSpec.js +++ b/packages/engine/Specs/Core/PixelFormatSpec.js @@ -14,7 +14,7 @@ describe("Core/PixelFormat", function () { PixelFormat.RGB, PixelDatatype.UNSIGNED_BYTE, width, - height + height, ); expect(flipped).toEqual(expectedDataBuffer); }); @@ -30,7 +30,7 @@ describe("Core/PixelFormat", function () { PixelFormat.RGB, PixelDatatype.UNSIGNED_BYTE, width, - height + height, ); expect(flipped).toBe(dataBuffer); }); diff --git a/packages/engine/Specs/Core/PlaneGeometrySpec.js b/packages/engine/Specs/Core/PlaneGeometrySpec.js index ba566d5f7f75..bc780ff32050 100644 --- a/packages/engine/Specs/Core/PlaneGeometrySpec.js +++ b/packages/engine/Specs/Core/PlaneGeometrySpec.js @@ -7,7 +7,7 @@ describe("Core/PlaneGeometry", function () { const m = PlaneGeometry.createGeometry( new PlaneGeometry({ vertexFormat: VertexFormat.POSITION_ONLY, - }) + }), ); expect(m.attributes.position.values.length).toEqual(4 * 3); // 4 corners @@ -18,7 +18,7 @@ describe("Core/PlaneGeometry", function () { const m = PlaneGeometry.createGeometry( new PlaneGeometry({ vertexFormat: VertexFormat.ALL, - }) + }), ); const numVertices = 4; @@ -40,6 +40,6 @@ describe("Core/PlaneGeometry", function () { new PlaneGeometry({ vertexFormat: VertexFormat.POSITION_AND_NORMAL, }), - [1.0, 1.0, 0.0, 0.0, 0.0, 0.0] + [1.0, 1.0, 0.0, 0.0, 0.0, 0.0], ); }); diff --git a/packages/engine/Specs/Core/PlaneSpec.js b/packages/engine/Specs/Core/PlaneSpec.js index cd41d22d07b0..d91f7c2f9d93 100644 --- a/packages/engine/Specs/Core/PlaneSpec.js +++ b/packages/engine/Specs/Core/PlaneSpec.js @@ -107,7 +107,7 @@ describe("Core/Plane", function () { const point = new Cartesian3(4.0, 5.0, 6.0); expect(Plane.getPointDistance(plane, point)).toEqual( - Cartesian3.dot(plane.normal, point) + plane.distance + Cartesian3.dot(plane.normal, point) + plane.distance, ); }); @@ -149,7 +149,7 @@ describe("Core/Plane", function () { expect(function () { return Plane.projectPointOntoPlane( new Plane(Cartesian3.UNIT_X, 0), - undefined + undefined, ); }).toThrowDeveloperError(); @@ -230,14 +230,14 @@ describe("Core/Plane", function () { transform = Matrix4.multiplyByMatrix3( transform, Matrix3.fromRotationY(Math.PI), - transform + transform, ); const transformedPlane = Plane.transform(plane, transform); expect(transformedPlane.distance).toEqual(plane.distance * 2.0); expect(transformedPlane.normal.x).toEqualEpsilon( -plane.normal.x, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); expect(transformedPlane.normal.y).toEqual(plane.normal.y); expect(transformedPlane.normal.z).toEqual(-plane.normal.z); @@ -252,25 +252,25 @@ describe("Core/Plane", function () { const planeDiff = Cartesian3.subtract( planePosition, planeOrigin, - new Cartesian3() + new Cartesian3(), ); expect(Cartesian3.dot(planeDiff, plane.normal)).toEqualEpsilon( 0.0, - CesiumMath.EPSILON16 + CesiumMath.EPSILON16, ); const transform = Matrix4.fromScale( new Cartesian3(4.0, 1.0, 10.0), - new Matrix4() + new Matrix4(), ); const transformPlane = Plane.transform(plane, transform); const transformPlaneDiff = Matrix4.multiplyByPointAsVector( transform, planeDiff, - new Cartesian3() + new Cartesian3(), ); expect( - Cartesian3.dot(transformPlaneDiff, transformPlane.normal) + Cartesian3.dot(transformPlaneDiff, transformPlane.normal), ).toEqualEpsilon(0.0, CesiumMath.EPSILON16); }); diff --git a/packages/engine/Specs/Core/PolygonGeometryLibrarySpec.js b/packages/engine/Specs/Core/PolygonGeometryLibrarySpec.js index f82851fc9bcf..9abbd6d5d6f8 100644 --- a/packages/engine/Specs/Core/PolygonGeometryLibrarySpec.js +++ b/packages/engine/Specs/Core/PolygonGeometryLibrarySpec.js @@ -10,78 +10,61 @@ describe("Core/PolygonGeometryLibrary", function () { describe("splitPolygonByPlane", function () { it("splits a simple polygon at the equator", function () { const positions = Cartesian3.unpackArray([ - 3813220.0, - -5085291.0, - 527179.0, - 3701301.0, - -5097773.0, - -993503.0, - 5037375.0, - -3776794.0, - -1017021.0, - 5049166.0, - -3865306.0, - 494270.0, + 3813220.0, -5085291.0, 527179.0, 3701301.0, -5097773.0, -993503.0, + 5037375.0, -3776794.0, -1017021.0, 5049166.0, -3865306.0, 494270.0, ]); const polygons = PolygonGeometryLibrary.splitPolygonsOnEquator( [positions], Ellipsoid.WGS84, - ArcType.GEODESIC + ArcType.GEODESIC, ); const expectedIntersection1 = new Cartesian3( 3799258.6687873346, -5123110.886796548, - 0.0 + 0.0, ); const expectedIntersection2 = new Cartesian3( 5077099.353935631, -3860530.240917096, - 0.0 + 0.0, ); expect(polygons.length).toBe(2); expect(polygons[0].length).toBe(4); expect(polygons[0][0]).toEqual(positions[0]); expect(polygons[0][1]).toEqualEpsilon( expectedIntersection1, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(polygons[0][2]).toEqualEpsilon( expectedIntersection2, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(polygons[0][3]).toEqual(positions[3]); expect(polygons[1].length).toBe(4); expect(polygons[1][0]).toEqualEpsilon( expectedIntersection1, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(polygons[1][1]).toEqual(positions[1]); expect(polygons[1][2]).toEqual(positions[2]); expect(polygons[1][3]).toEqualEpsilon( expectedIntersection2, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); }); it("does not split a simple polygon with one position touching the equator", function () { const positions = Cartesian3.unpackArray([ - 3813220.0, - -5085291.0, - 527179.0, - 3701301.0, - -5097773.0, - 0.0, - 5049166.0, - -3865306.0, - 494270.0, + 3813220.0, -5085291.0, 527179.0, 3701301.0, -5097773.0, 0.0, 5049166.0, + -3865306.0, 494270.0, ]); const polygons = PolygonGeometryLibrary.splitPolygonsOnEquator( [positions], Ellipsoid.WGS84, - ArcType.GEODESIC + ArcType.GEODESIC, ); expect(polygons.length).toBe(1); @@ -93,24 +76,14 @@ describe("Core/PolygonGeometryLibrary", function () { it("does not split a simple polygon with one edge on the equator, starting above the equator", function () { const positions = Cartesian3.unpackArray([ - -3219367.0, - -5491259.0, - 401098.0, - -3217795.0, - -5506913.0, - 0.0, - -2713036.0, - -5772334.0, - 0.0, - -2713766.0, - -5757498.0, - 406910.0, + -3219367.0, -5491259.0, 401098.0, -3217795.0, -5506913.0, 0.0, + -2713036.0, -5772334.0, 0.0, -2713766.0, -5757498.0, 406910.0, ]); const polygons = PolygonGeometryLibrary.splitPolygonsOnEquator( [positions], Ellipsoid.WGS84, - ArcType.GEODESIC + ArcType.GEODESIC, ); expect(polygons.length).toBe(1); expect(polygons[0].length).toBe(4); @@ -122,24 +95,14 @@ describe("Core/PolygonGeometryLibrary", function () { it("does not split a simple polygon with one edge on the equator, starting below the equator", function () { const positions = Cartesian3.unpackArray([ - -3180138.0, - -5441382.0, - -974441.0, - -3186540.0, - -5525048.0, - 0.0, - -2198716.0, - -5986569.0, - 0.0, - -2135113.0, - -5925878.0, - -996868.0, + -3180138.0, -5441382.0, -974441.0, -3186540.0, -5525048.0, 0.0, + -2198716.0, -5986569.0, 0.0, -2135113.0, -5925878.0, -996868.0, ]); const polygons = PolygonGeometryLibrary.splitPolygonsOnEquator( [positions], Ellipsoid.WGS84, - ArcType.GEODESIC + ArcType.GEODESIC, ); expect(polygons.length).toBe(1); expect(polygons[0].length).toBe(4); @@ -151,240 +114,208 @@ describe("Core/PolygonGeometryLibrary", function () { it("splits a positively concave polygon at the equator", function () { const positions = Cartesian3.unpackArray([ - -3723536.687096985, - -5140643.423654287, - 622159.6094790212, - -3706443.9124709764, - -5089398.802336418, - -1016836.564118223, - -1818346.3577937474, - -5988204.417556031, - -1226992.0906221648, - -1949728.2308330906, - -6022778.780648997, - 775419.1678640501, - -2891108.934831509, - -5659936.656854747, - -534148.7427656263, + -3723536.687096985, -5140643.423654287, 622159.6094790212, + -3706443.9124709764, -5089398.802336418, -1016836.564118223, + -1818346.3577937474, -5988204.417556031, -1226992.0906221648, + -1949728.2308330906, -6022778.780648997, 775419.1678640501, + -2891108.934831509, -5659936.656854747, -534148.7427656263, ]); const polygons = PolygonGeometryLibrary.splitPolygonsOnEquator( [positions], Ellipsoid.WGS84, - ArcType.GEODESIC + ArcType.GEODESIC, ); const expectedIntersection1 = new Cartesian3( -3746523.7934060274, -5161801.144582336, - 0 + 0, ); const expectedIntersection2 = new Cartesian3( -3298992.8935172106, -5458688.2562839165, - 0 + 0, ); const expectedIntersection3 = new Cartesian3( -2527814.313071595, -5855833.534980258, - 0 + 0, ); const expectedIntersection4 = new Cartesian3( -1921714.863778476, -6081746.753450187, - 0 + 0, ); expect(polygons.length).toBe(3); expect(polygons[0].length).toBe(3); expect(polygons[0][0]).toEqual(positions[0]); expect(polygons[0][1]).toEqualEpsilon( expectedIntersection1, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(polygons[0][2]).toEqualEpsilon( expectedIntersection2, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(polygons[1].length).toBe(7); expect(polygons[1][0]).toEqualEpsilon( expectedIntersection1, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(polygons[1][1]).toEqual(positions[1]); expect(polygons[1][2]).toEqual(positions[2]); expect(polygons[1][3]).toEqualEpsilon( expectedIntersection4, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(polygons[1][4]).toEqualEpsilon( expectedIntersection3, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(polygons[1][5]).toEqual(positions[4]); expect(polygons[1][6]).toEqualEpsilon( expectedIntersection2, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(polygons[2].length).toBe(3); expect(polygons[2][0]).toEqualEpsilon( expectedIntersection4, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(polygons[2][1]).toEqual(positions[3]); expect(polygons[2][2]).toEqualEpsilon( expectedIntersection3, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); }); it("splits a negatively concave polygon at the equator", function () { const positions = Cartesian3.unpackArray([ - -4164072.7435535816, - -4791571.5503237555, - 605958.8290040599, - -4167507.7232260685, - -4800497.02674794, - -508272.2109012767, - -3712172.6000501625, - -5184159.589216706, - 116723.13202563708, - -3259646.0020361557, - -5455158.378873343, - -532227.4715966922, - -3283717.3855494126, - -5434359.545068984, - 592819.1229613343, + -4164072.7435535816, -4791571.5503237555, 605958.8290040599, + -4167507.7232260685, -4800497.02674794, -508272.2109012767, + -3712172.6000501625, -5184159.589216706, 116723.13202563708, + -3259646.0020361557, -5455158.378873343, -532227.4715966922, + -3283717.3855494126, -5434359.545068984, 592819.1229613343, ]); const polygons = PolygonGeometryLibrary.splitPolygonsOnEquator( [positions], Ellipsoid.WGS84, - ArcType.GEODESIC + ArcType.GEODESIC, ); const expectedIntersection1 = new Cartesian3( -4182416.3757553473, -4815394.568525253, - 0 + 0, ); const expectedIntersection2 = new Cartesian3( -3803015.1382151386, -5120322.982906009, - 0 + 0, ); const expectedIntersection3 = new Cartesian3( -3635913.2183307745, -5240302.153458, - 0 + 0, ); const expectedIntersection4 = new Cartesian3( -3284360.5276909056, -5467504.688147503, - 0 + 0, ); expect(polygons.length).toBe(3); expect(polygons[0].length).toBe(7); expect(polygons[0][0]).toEqual(positions[0]); expect(polygons[0][1]).toEqualEpsilon( expectedIntersection1, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(polygons[0][2]).toEqualEpsilon( expectedIntersection2, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(polygons[0][3]).toEqual(positions[2]); expect(polygons[0][4]).toEqualEpsilon( expectedIntersection3, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(polygons[0][5]).toEqualEpsilon( expectedIntersection4, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(polygons[0][6]).toEqual(positions[4]); expect(polygons[1].length).toBe(3); expect(polygons[1][0]).toEqualEpsilon( expectedIntersection1, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(polygons[1][1]).toEqual(positions[1]); expect(polygons[1][2]).toEqualEpsilon( expectedIntersection2, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(polygons[2].length).toBe(3); expect(polygons[2][0]).toEqualEpsilon( expectedIntersection3, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(polygons[2][1]).toEqual(positions[3]); expect(polygons[2][2]).toEqualEpsilon( expectedIntersection4, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); }); it("splits a positively concave polygon with a point on the equator", function () { const positions = Cartesian3.unpackArray([ - -3592289.0, - -5251493.0, - 433532.0, - -3568746.0, - -5245699.0, - -646544.0, - -2273628.0, - -5915229.0, - -715098.0, - -2410175.0, - -5885323.0, - 475855.0, - -3012338.0, - -5621469.0, - 0.0, + -3592289.0, -5251493.0, 433532.0, -3568746.0, -5245699.0, -646544.0, + -2273628.0, -5915229.0, -715098.0, -2410175.0, -5885323.0, 475855.0, + -3012338.0, -5621469.0, 0.0, ]); const polygons = PolygonGeometryLibrary.splitPolygonsOnEquator( [positions], Ellipsoid.WGS84, - ArcType.GEODESIC + ArcType.GEODESIC, ); const expectedIntersection1 = new Cartesian3( -3595684.3882232937, -5267986.8423389485, - 0 + 0, ); const expectedIntersection2 = new Cartesian3( -2365929.6862513637, -5923091.111107741, - 0 + 0, ); expect(polygons.length).toBe(3); expect(polygons[0].length).toBe(3); expect(polygons[0][0]).toEqual(positions[0]); expect(polygons[0][1]).toEqualEpsilon( expectedIntersection1, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(polygons[0][2]).toEqual(positions[4]); expect(polygons[1].length).toBe(5); expect(polygons[1][0]).toEqualEpsilon( expectedIntersection1, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(polygons[1][1]).toEqual(positions[1]); expect(polygons[1][2]).toEqual(positions[2]); expect(polygons[1][3]).toEqualEpsilon( expectedIntersection2, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(polygons[1][4]).toEqual(positions[4]); expect(polygons[2].length).toBe(3); expect(polygons[2][0]).toEqualEpsilon( expectedIntersection2, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(polygons[2][1]).toEqual(positions[3]); expect(polygons[2][2]).toEqual(positions[4]); @@ -392,56 +323,44 @@ describe("Core/PolygonGeometryLibrary", function () { it("splits a negatively concave polygon with a point on the equator", function () { const positions = Cartesian3.unpackArray([ - -3774632.0, - -5136123.0, - 222459.0, - -3714187.0, - -5173580.0, - -341046.0, - -3516544.0, - -5320967.0, - 0.0, - -3304860.0, - -5444086.0, - -342567.0, - -3277484.0, - -5466977.0, - 218213.0, + -3774632.0, -5136123.0, 222459.0, -3714187.0, -5173580.0, -341046.0, + -3516544.0, -5320967.0, 0.0, -3304860.0, -5444086.0, -342567.0, + -3277484.0, -5466977.0, 218213.0, ]); const polygons = PolygonGeometryLibrary.splitPolygonsOnEquator( [positions], Ellipsoid.WGS84, - ArcType.GEODESIC + ArcType.GEODESIC, ); const expectedIntersection1 = new Cartesian3( -3754485.468265927, -5156013.039098039, - 0 + 0, ); const expectedIntersection2 = new Cartesian3( -3291304.258941832, -5463327.545172482, - 0 + 0, ); expect(polygons.length).toBe(3); expect(polygons[0].length).toBe(5); expect(polygons[0][0]).toEqual(positions[0]); expect(polygons[0][1]).toEqualEpsilon( expectedIntersection1, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(polygons[0][2]).toEqual(positions[2]); expect(polygons[0][3]).toEqualEpsilon( expectedIntersection2, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(polygons[0][4]).toEqual(positions[4]); expect(polygons[1].length).toBe(3); expect(polygons[1][0]).toEqualEpsilon( expectedIntersection1, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(polygons[1][1]).toEqual(positions[1]); expect(polygons[1][2]).toEqual(positions[2]); @@ -450,56 +369,41 @@ describe("Core/PolygonGeometryLibrary", function () { expect(polygons[2][1]).toEqual(positions[3]); expect(polygons[2][2]).toEqualEpsilon( expectedIntersection2, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); }); it("splits a polygon with an edge equator", function () { const positions = Cartesian3.unpackArray([ - -3227931.0, - -5469496.0, - 584508.0, - -3150093.0, - -5488360.0, - -792747.0, - -1700622.0, - -6089685.0, - -835364.0, - -1786389.0, - -6122714.0, - 0.0, - -2593600.0, - -5826977.0, - 0.0, - -2609132.0, - -5790155.0, - 584508.0, + -3227931.0, -5469496.0, 584508.0, -3150093.0, -5488360.0, -792747.0, + -1700622.0, -6089685.0, -835364.0, -1786389.0, -6122714.0, 0.0, + -2593600.0, -5826977.0, 0.0, -2609132.0, -5790155.0, 584508.0, ]); const polygons = PolygonGeometryLibrary.splitPolygonsOnEquator( [positions], Ellipsoid.WGS84, - ArcType.GEODESIC + ArcType.GEODESIC, ); const expectedIntersection = new Cartesian3( -3213523.577073882, -5509437.159126084, - 0 + 0, ); expect(polygons.length).toBe(2); expect(polygons[0].length).toBe(4); expect(polygons[0][0]).toEqual(positions[0]); expect(polygons[0][1]).toEqualEpsilon( expectedIntersection, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(polygons[0][2]).toEqual(positions[4]); expect(polygons[0][3]).toEqual(positions[5]); expect(polygons[1].length).toBe(5); expect(polygons[1][0]).toEqualEpsilon( expectedIntersection, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(polygons[1][1]).toEqual(positions[1]); expect(polygons[1][2]).toEqual(positions[2]); @@ -509,36 +413,21 @@ describe("Core/PolygonGeometryLibrary", function () { it("splits a polygon with a backtracking edge on the equator", function () { const positions = Cartesian3.unpackArray([ - -3491307.0, - -5296123.0, - 650596.0, - -3495031.0, - -5334507.0, - 0.0, - -4333607.0, - -4677312.0, - 0.0, - -4275491.0, - -4629182.0, - -968553.0, - -2403691.0, - -5827997.0, - -943662.0, - -2484409.0, - -5837281.0, - 631344.0, + -3491307.0, -5296123.0, 650596.0, -3495031.0, -5334507.0, 0.0, + -4333607.0, -4677312.0, 0.0, -4275491.0, -4629182.0, -968553.0, + -2403691.0, -5827997.0, -943662.0, -2484409.0, -5837281.0, 631344.0, ]); const polygons = PolygonGeometryLibrary.splitPolygonsOnEquator( [positions], Ellipsoid.WGS84, - ArcType.GEODESIC + ArcType.GEODESIC, ); const expectedIntersection = new Cartesian3( -2471499.3842933537, -5879823.32933623, - 0 + 0, ); expect(polygons.length).toBe(2); expect(polygons[0].length).toBe(4); @@ -546,7 +435,7 @@ describe("Core/PolygonGeometryLibrary", function () { expect(polygons[0][1]).toEqual(positions[1]); expect(polygons[0][2]).toEqualEpsilon( expectedIntersection, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(polygons[0][3]).toEqual(positions[5]); expect(polygons[1].length).toBe(5); @@ -556,140 +445,113 @@ describe("Core/PolygonGeometryLibrary", function () { expect(polygons[1][3]).toEqual(positions[4]); expect(polygons[1][4]).toEqualEpsilon( expectedIntersection, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); }); it("splits a simple rhumb polygon at the equator", function () { const positions = Cartesian3.unpackArray([ - 3813220.0, - -5085291.0, - 527179.0, - 3701301.0, - -5097773.0, - -993503.0, - 5037375.0, - -3776794.0, - -1017021.0, - 5049166.0, - -3865306.0, - 494270.0, + 3813220.0, -5085291.0, 527179.0, 3701301.0, -5097773.0, -993503.0, + 5037375.0, -3776794.0, -1017021.0, 5049166.0, -3865306.0, 494270.0, ]); const polygons = PolygonGeometryLibrary.splitPolygonsOnEquator( [positions], Ellipsoid.WGS84, - ArcType.RHUMB + ArcType.RHUMB, ); const expectedIntersection1 = new Cartesian3( 3799205.595277112, -5123150.245267465, - 0.0 + 0.0, ); const expectedIntersection2 = new Cartesian3( 5077127.456540122, -3860493.2820580625, - 0.0 + 0.0, ); expect(polygons.length).toBe(2); expect(polygons[0].length).toBe(4); expect(polygons[0][0]).toEqual(positions[0]); expect(polygons[0][1]).toEqualEpsilon( expectedIntersection1, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(polygons[0][2]).toEqualEpsilon( expectedIntersection2, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(polygons[0][3]).toEqual(positions[3]); expect(polygons[1].length).toBe(4); expect(polygons[1][0]).toEqualEpsilon( expectedIntersection1, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(polygons[1][1]).toEqual(positions[1]); expect(polygons[1][2]).toEqual(positions[2]); expect(polygons[1][3]).toEqualEpsilon( expectedIntersection2, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); }); it("splits a simple rhumb polygon at the equator across the IDL", function () { const positions = Cartesian3.fromDegreesArray([ - 30, - -30, - 20, - 30, - -20, - 30, - -30, - -30, + 30, -30, 20, 30, -20, 30, -30, -30, ]); const polygons = PolygonGeometryLibrary.splitPolygonsOnEquator( [positions], Ellipsoid.WGS84, - ArcType.RHUMB + ArcType.RHUMB, ); const expectedIntersection1 = new Cartesian3( 5780555.229886577, 2695517.1720840395, - 0.0 + 0.0, ); const expectedIntersection2 = new Cartesian3( 5780555.229886577, -2695517.1720840395, - 0.0 + 0.0, ); expect(polygons.length).toBe(2); expect(polygons[0].length).toBe(4); expect(polygons[0][0]).toEqual(positions[0]); expect(polygons[0][1]).toEqualEpsilon( expectedIntersection1, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(polygons[0][2]).toEqualEpsilon( expectedIntersection2, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(polygons[0][3]).toEqual(positions[3]); expect(polygons[1].length).toBe(4); expect(polygons[1][0]).toEqualEpsilon( expectedIntersection1, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(polygons[1][1]).toEqual(positions[1]); expect(polygons[1][2]).toEqual(positions[2]); expect(polygons[1][3]).toEqualEpsilon( expectedIntersection2, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); }); it("splits an array of polygons", function () { const positions = Cartesian3.unpackArray([ - 3813220.0, - -5085291.0, - 527179.0, - 3701301.0, - -5097773.0, - -993503.0, - 5037375.0, - -3776794.0, - -1017021.0, - 5049166.0, - -3865306.0, - 494270.0, + 3813220.0, -5085291.0, 527179.0, 3701301.0, -5097773.0, -993503.0, + 5037375.0, -3776794.0, -1017021.0, 5049166.0, -3865306.0, 494270.0, ]); const polygons = PolygonGeometryLibrary.splitPolygonsOnEquator( [positions, positions], Ellipsoid.WGS84, - ArcType.GEODESIC + ArcType.GEODESIC, ); expect(polygons.length).toBe(4); diff --git a/packages/engine/Specs/Core/PolygonGeometrySpec.js b/packages/engine/Specs/Core/PolygonGeometrySpec.js index 14d51ec71915..e47cbd9605a2 100644 --- a/packages/engine/Specs/Core/PolygonGeometrySpec.js +++ b/packages/engine/Specs/Core/PolygonGeometrySpec.js @@ -42,8 +42,8 @@ describe("Core/PolygonGeometry", function () { PolygonGeometry.createGeometry( PolygonGeometry.fromPositions({ positions: [new Cartesian3()], - }) - ) + }), + ), ).toBeUndefined(); }); @@ -54,8 +54,8 @@ describe("Core/PolygonGeometry", function () { polygonHierarchy: { positions: [Cartesian3.fromDegrees(0, 0)], }, - }) - ) + }), + ), ).toBeUndefined(); }); @@ -76,7 +76,7 @@ describe("Core/PolygonGeometry", function () { const geometry = PolygonGeometry.createGeometry( PolygonGeometry.fromPositions({ positions: Cartesian3.fromDegreesArray([0.0, 0.0, 0.0, 0.0, 0.0, 0.0]), - }) + }), ); expect(geometry).toBeUndefined(); }); @@ -86,7 +86,7 @@ describe("Core/PolygonGeometry", function () { PolygonGeometry.fromPositions({ positions: Cartesian3.fromDegreesArray([0.0, 0.0, 0.0, 0.0, 0.0, 0.0]), extrudedHeight: 2, - }) + }), ); expect(geometry).toBeUndefined(); }); @@ -97,19 +97,14 @@ describe("Core/PolygonGeometry", function () { holes: [ { positions: Cartesian3.fromDegreesArray([ - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, ]), }, ], }; const geometry = PolygonGeometry.createGeometry( - new PolygonGeometry({ polygonHierarchy: hierarchy }) + new PolygonGeometry({ polygonHierarchy: hierarchy }), ); expect(geometry).toBeUndefined(); }); @@ -117,35 +112,19 @@ describe("Core/PolygonGeometry", function () { it("createGeometry returns undefined due to duplicate hierarchy positions with different heights", function () { const hierarchy = { positions: Cartesian3.fromDegreesArrayHeights([ - 1.0, - 1.0, - 10.0, - 1.0, - 1.0, - 20.0, - 1.0, - 1.0, - 30.0, + 1.0, 1.0, 10.0, 1.0, 1.0, 20.0, 1.0, 1.0, 30.0, ]), holes: [ { positions: Cartesian3.fromDegreesArrayHeights([ - 0.0, - 0.0, - 10.0, - 0.0, - 0.0, - 20.0, - 0.0, - 0.0, - 30.0, + 0.0, 0.0, 10.0, 0.0, 0.0, 20.0, 0.0, 0.0, 30.0, ]), }, ], }; const geometry = PolygonGeometry.createGeometry( - new PolygonGeometry({ polygonHierarchy: hierarchy }) + new PolygonGeometry({ polygonHierarchy: hierarchy }), ); expect(geometry).toBeUndefined(); }); @@ -153,28 +132,12 @@ describe("Core/PolygonGeometry", function () { it("createGeometry returns geometry if duplicate hierarchy positions with different heights and perPositionHeight is true", function () { const hierarchy = { positions: Cartesian3.fromDegreesArrayHeights([ - 1.0, - 1.0, - 10.0, - 1.0, - 1.0, - 20.0, - 1.0, - 1.0, - 30.0, + 1.0, 1.0, 10.0, 1.0, 1.0, 20.0, 1.0, 1.0, 30.0, ]), holes: [ { positions: Cartesian3.fromDegreesArrayHeights([ - 0.0, - 0.0, - 10.0, - 0.0, - 0.0, - 20.0, - 0.0, - 0.0, - 30.0, + 0.0, 0.0, 10.0, 0.0, 0.0, 20.0, 0.0, 0.0, 30.0, ]), }, ], @@ -184,7 +147,7 @@ describe("Core/PolygonGeometry", function () { new PolygonGeometry({ polygonHierarchy: hierarchy, perPositionHeight: true, - }) + }), ); expect(geometry).toBeDefined(); }); @@ -194,17 +157,10 @@ describe("Core/PolygonGeometry", function () { PolygonGeometry.fromPositions({ vertexFormat: VertexFormat.POSITION_ONLY, positions: Cartesian3.fromDegreesArray([ - -1.0, - -1.0, - 1.0, - -1.0, - 1.0, - 1.0, - -1.0, - 1.0, + -1.0, -1.0, 1.0, -1.0, 1.0, 1.0, -1.0, 1.0, ]), granularity: CesiumMath.RADIANS_PER_DEGREE, - }) + }), ); expect(p.attributes.position.values.length).toEqual(13 * 3); // 8 around edge + 5 in the middle @@ -232,18 +188,18 @@ describe("Core/PolygonGeometry", function () { PolygonGeometry.fromPositions({ positions: positions, perPositionHeight: true, - }) + }), ); expect( ellipsoid.cartesianToCartographic( - Cartesian3.fromArray(p.attributes.position.values, 0) - ).height + Cartesian3.fromArray(p.attributes.position.values, 0), + ).height, ).toEqualEpsilon(height, CesiumMath.EPSILON6); expect( ellipsoid.cartesianToCartographic( - Cartesian3.fromArray(p.attributes.position.values, 3) - ).height + Cartesian3.fromArray(p.attributes.position.values, 3), + ).height, ).toEqualEpsilon(0, CesiumMath.EPSILON6); }); @@ -252,18 +208,11 @@ describe("Core/PolygonGeometry", function () { PolygonGeometry.fromPositions({ vertexFormat: VertexFormat.POSITION_ONLY, positions: Cartesian3.fromDegreesArray([ - -1.0, - -1.0, - 1.0, - -1.0, - 1.0, - 1.0, - -1.0, - 1.0, + -1.0, -1.0, 1.0, -1.0, 1.0, 1.0, -1.0, 1.0, ]), granularity: CesiumMath.RADIANS_PER_DEGREE, arcType: ArcType.RHUMB, - }) + }), ); expect(p.attributes.position.values.length).toEqual(15 * 3); // 8 around edge + 7 in the middle @@ -276,32 +225,18 @@ describe("Core/PolygonGeometry", function () { PolygonGeometry.fromPositions({ vertexFormat: VertexFormat.POSITION_ONLY, positions: Cartesian3.fromDegreesArray([ - -1.0, - -1.0, - 1.0, - -1.0, - 1.0, - 1.0, - -1.0, - 1.0, + -1.0, -1.0, 1.0, -1.0, 1.0, 1.0, -1.0, 1.0, ]), granularity: CesiumMath.RADIANS_PER_DEGREE, arcType: ArcType.NONE, - }) + }), ); }).toThrowDeveloperError(); }); it("create geometry creates with lines with different number of subdivisions for geodesic and rhumb", function () { const positions = Cartesian3.fromDegreesArray([ - -30.0, - -30.0, - 30.0, - -30.0, - 30.0, - 30.0, - -30.0, - 30.0, + -30.0, -30.0, 30.0, -30.0, 30.0, 30.0, -30.0, 30.0, ]); const geodesic = PolygonGeometry.createGeometry( PolygonGeometry.fromPositions({ @@ -309,7 +244,7 @@ describe("Core/PolygonGeometry", function () { positions: positions, granularity: CesiumMath.RADIANS_PER_DEGREE, arcType: ArcType.GEODESIC, - }) + }), ); const rhumb = PolygonGeometry.createGeometry( PolygonGeometry.fromPositions({ @@ -317,11 +252,11 @@ describe("Core/PolygonGeometry", function () { positions: positions, granularity: CesiumMath.RADIANS_PER_DEGREE, arcType: ArcType.RHUMB, - }) + }), ); expect(geodesic.attributes.position.values.length).not.toEqual( - rhumb.attributes.position.values.length + rhumb.attributes.position.values.length, ); expect(geodesic.indices.length).not.toEqual(rhumb.indices.length); }); @@ -348,18 +283,18 @@ describe("Core/PolygonGeometry", function () { positions: positions, perPositionHeight: true, arcType: ArcType.RHUMB, - }) + }), ); expect( ellipsoid.cartesianToCartographic( - Cartesian3.fromArray(p.attributes.position.values, 0) - ).height + Cartesian3.fromArray(p.attributes.position.values, 0), + ).height, ).toEqualEpsilon(height, CesiumMath.EPSILON6); expect( ellipsoid.cartesianToCartographic( - Cartesian3.fromArray(p.attributes.position.values, 3) - ).height + Cartesian3.fromArray(p.attributes.position.values, 3), + ).height, ).toEqualEpsilon(0, CesiumMath.EPSILON6); }); @@ -368,16 +303,9 @@ describe("Core/PolygonGeometry", function () { PolygonGeometry.fromPositions({ vertexFormat: VertexFormat.ALL, positions: Cartesian3.fromDegreesArray([ - -1.0, - -1.0, - 1.0, - -1.0, - 1.0, - 1.0, - -1.0, - 1.0, + -1.0, -1.0, 1.0, -1.0, 1.0, 1.0, -1.0, 1.0, ]), - }) + }), ); const numVertices = 13; @@ -393,38 +321,17 @@ describe("Core/PolygonGeometry", function () { it("creates a polygon from hierarchy", function () { const hierarchy = { positions: Cartesian3.fromDegreesArray([ - -124.0, - 35.0, - -110.0, - 35.0, - -110.0, - 40.0, - -124.0, - 40.0, + -124.0, 35.0, -110.0, 35.0, -110.0, 40.0, -124.0, 40.0, ]), holes: [ { positions: Cartesian3.fromDegreesArray([ - -122.0, - 36.0, - -122.0, - 39.0, - -112.0, - 39.0, - -112.0, - 36.0, + -122.0, 36.0, -122.0, 39.0, -112.0, 39.0, -112.0, 36.0, ]), holes: [ { positions: Cartesian3.fromDegreesArray([ - -120.0, - 36.5, - -114.0, - 36.5, - -114.0, - 38.5, - -120.0, - 38.5, + -120.0, 36.5, -114.0, 36.5, -114.0, 38.5, -120.0, 38.5, ]), }, ], @@ -437,7 +344,7 @@ describe("Core/PolygonGeometry", function () { vertexFormat: VertexFormat.POSITION_ONLY, polygonHierarchy: hierarchy, granularity: CesiumMath.PI_OVER_THREE, - }) + }), ); expect(p.attributes.position.values.length).toEqual(12 * 3); // 4 points * 3 rectangles @@ -447,38 +354,17 @@ describe("Core/PolygonGeometry", function () { it("creates a polygon from hierarchy with rhumb lines", function () { const hierarchy = { positions: Cartesian3.fromDegreesArray([ - -124.0, - 35.0, - -110.0, - 35.0, - -110.0, - 40.0, - -124.0, - 40.0, + -124.0, 35.0, -110.0, 35.0, -110.0, 40.0, -124.0, 40.0, ]), holes: [ { positions: Cartesian3.fromDegreesArray([ - -122.0, - 36.0, - -122.0, - 39.0, - -112.0, - 39.0, - -112.0, - 36.0, + -122.0, 36.0, -122.0, 39.0, -112.0, 39.0, -112.0, 36.0, ]), holes: [ { positions: Cartesian3.fromDegreesArray([ - -120.0, - 36.5, - -114.0, - 36.5, - -114.0, - 38.5, - -120.0, - 38.5, + -120.0, 36.5, -114.0, 36.5, -114.0, 38.5, -120.0, 38.5, ]), }, ], @@ -492,7 +378,7 @@ describe("Core/PolygonGeometry", function () { polygonHierarchy: hierarchy, granularity: CesiumMath.PI_OVER_THREE, arcType: ArcType.RHUMB, - }) + }), ); expect(p.attributes.position.values.length).toEqual(12 * 3); // 4 points * 3 rectangles @@ -502,43 +388,18 @@ describe("Core/PolygonGeometry", function () { it("removes duplicates in polygon hierarchy", function () { const hierarchy = { positions: Cartesian3.fromDegreesArray([ - -124.0, - 35.0, - -110.0, - 35.0, - -110.0, - 35.0, - -110.0, - 40.0, - -124.0, - 40.0, + -124.0, 35.0, -110.0, 35.0, -110.0, 35.0, -110.0, 40.0, -124.0, 40.0, ]), holes: [ { positions: Cartesian3.fromDegreesArray([ - -122.0, - 36.0, - -122.0, - 39.0, - -122.0, - 39.0, - -112.0, - 39.0, - -112.0, + -122.0, 36.0, -122.0, 39.0, -122.0, 39.0, -112.0, 39.0, -112.0, 36.0, ]), holes: [ { positions: Cartesian3.fromDegreesArray([ - -120.0, - 36.5, - -114.0, - 36.5, - -114.0, - 36.5, - -114.0, - 38.5, - -120.0, + -120.0, 36.5, -114.0, 36.5, -114.0, 36.5, -114.0, 38.5, -120.0, 38.5, ]), }, @@ -552,7 +413,7 @@ describe("Core/PolygonGeometry", function () { vertexFormat: VertexFormat.POSITION_ONLY, polygonHierarchy: hierarchy, granularity: CesiumMath.PI_OVER_THREE, - }) + }), ); expect(p.attributes.position.values.length).toEqual(12 * 3); @@ -562,38 +423,17 @@ describe("Core/PolygonGeometry", function () { it("creates a polygon from clockwise hierarchy", function () { const hierarchy = { positions: Cartesian3.fromDegreesArray([ - -124.0, - 35.0, - -124.0, - 40.0, - -110.0, - 40.0, - -110.0, - 35.0, + -124.0, 35.0, -124.0, 40.0, -110.0, 40.0, -110.0, 35.0, ]), holes: [ { positions: Cartesian3.fromDegreesArray([ - -122.0, - 36.0, - -112.0, - 36.0, - -112.0, - 39.0, - -122.0, - 39.0, + -122.0, 36.0, -112.0, 36.0, -112.0, 39.0, -122.0, 39.0, ]), holes: [ { positions: Cartesian3.fromDegreesArray([ - -120.0, - 36.5, - -120.0, - 38.5, - -114.0, - 38.5, - -114.0, - 36.5, + -120.0, 36.5, -120.0, 38.5, -114.0, 38.5, -114.0, 36.5, ]), }, ], @@ -606,7 +446,7 @@ describe("Core/PolygonGeometry", function () { vertexFormat: VertexFormat.POSITION_ONLY, polygonHierarchy: hierarchy, granularity: CesiumMath.PI_OVER_THREE, - }) + }), ); expect(p.attributes.position.values.length).toEqual(12 * 3); @@ -615,34 +455,13 @@ describe("Core/PolygonGeometry", function () { it("doesn't reverse clockwise input array", function () { const p = Cartesian3.fromDegreesArray([ - -124.0, - 35.0, - -124.0, - 40.0, - -110.0, - 40.0, - -110.0, - 35.0, + -124.0, 35.0, -124.0, 40.0, -110.0, 40.0, -110.0, 35.0, ]); const h1 = Cartesian3.fromDegreesArray([ - -122.0, - 36.0, - -112.0, - 36.0, - -112.0, - 39.0, - -122.0, - 39.0, + -122.0, 36.0, -112.0, 36.0, -112.0, 39.0, -122.0, 39.0, ]); const h2 = Cartesian3.fromDegreesArray([ - -120.0, - 36.5, - -120.0, - 38.5, - -114.0, - 38.5, - -114.0, - 36.5, + -120.0, 36.5, -120.0, 38.5, -114.0, 38.5, -114.0, 36.5, ]); const hierarchy = { positions: p, @@ -663,47 +482,26 @@ describe("Core/PolygonGeometry", function () { vertexFormat: VertexFormat.POSITION_ONLY, polygonHierarchy: hierarchy, granularity: CesiumMath.PI_OVER_THREE, - }) + }), ); let i; const pExpected = Cartesian3.fromDegreesArray([ - -124.0, - 35.0, - -124.0, - 40.0, - -110.0, - 40.0, - -110.0, - 35.0, + -124.0, 35.0, -124.0, 40.0, -110.0, 40.0, -110.0, 35.0, ]); for (i = 0; i < p.length; i++) { expect(p[i]).toEqualEpsilon(pExpected[i], CesiumMath.EPSILON7); } const h1Expected = Cartesian3.fromDegreesArray([ - -122.0, - 36.0, - -112.0, - 36.0, - -112.0, - 39.0, - -122.0, - 39.0, + -122.0, 36.0, -112.0, 36.0, -112.0, 39.0, -122.0, 39.0, ]); for (i = 0; i < h1.length; i++) { expect(h1[i]).toEqualEpsilon(h1Expected[i], CesiumMath.EPSILON7); } const h2Expected = Cartesian3.fromDegreesArray([ - -120.0, - 36.5, - -120.0, - 38.5, - -114.0, - 38.5, - -114.0, - 36.5, + -120.0, 36.5, -120.0, 38.5, -114.0, 38.5, -114.0, 36.5, ]); for (i = 0; i < h2.length; i++) { expect(h2[i]).toEqualEpsilon(h2Expected[i], CesiumMath.EPSILON7); @@ -715,41 +513,27 @@ describe("Core/PolygonGeometry", function () { PolygonGeometry.fromPositions({ vertexFormat: VertexFormat.ALL, positions: Cartesian3.fromDegreesArray([ - -108.0, - 1.0, - -108.0, - -1.0, - -106.0, - -1.0, - -106.0, - 1.0, + -108.0, 1.0, -108.0, -1.0, -106.0, -1.0, -106.0, 1.0, ]), granularity: CesiumMath.PI_OVER_THREE, - }) + }), ); const bs = BoundingSphere.fromVertices(p.attributes.position.values); expect(p.boundingSphere.center).toEqualEpsilon( bs.center, - CesiumMath.EPSILON9 + CesiumMath.EPSILON9, ); expect(p.boundingSphere.radius).toEqualEpsilon( bs.radius, - CesiumMath.EPSILON9 + CesiumMath.EPSILON9, ); }); it("computes correct bounding sphere at height >>> 0", function () { const height = 40000000.0; const positions = Cartesian3.fromDegreesArray([ - -108.0, - 1.0, - -108.0, - -1.0, - -106.0, - -1.0, - -106.0, - 1.0, + -108.0, 1.0, -108.0, -1.0, -106.0, -1.0, -106.0, 1.0, ]); const p = PolygonGeometry.createGeometry( @@ -757,7 +541,7 @@ describe("Core/PolygonGeometry", function () { vertexFormat: VertexFormat.POSITIONS_ONLY, positions: positions, height: height, - }) + }), ); const bs = BoundingSphere.fromPoints( @@ -774,7 +558,7 @@ describe("Core/PolygonGeometry", function () { -106.0, 1.0, height, - ]) + ]), ); expect(Math.abs(p.boundingSphere.radius - bs.radius)).toBeLessThan(100.0); }); @@ -784,17 +568,10 @@ describe("Core/PolygonGeometry", function () { PolygonGeometry.fromPositions({ vertexFormat: VertexFormat.POSITION_ONLY, positions: Cartesian3.fromDegreesArray([ - -1.0, - -1.0, - 1.0, - -1.0, - 1.0, - 1.0, - -1.0, - 1.0, + -1.0, -1.0, 1.0, -1.0, 1.0, 1.0, -1.0, 1.0, ]), extrudedHeight: 30000, - }) + }), ); const numVertices = 50; // 13 top + 13 bottom + 8 top edge + 8 bottom edge + 4 top corner + 4 bottom corner @@ -808,18 +585,11 @@ describe("Core/PolygonGeometry", function () { PolygonGeometry.fromPositions({ vertexFormat: VertexFormat.POSITION_ONLY, positions: Cartesian3.fromDegreesArray([ - -1.0, - -1.0, - 1.0, - -1.0, - 1.0, - 1.0, - -1.0, - 1.0, + -1.0, -1.0, 1.0, -1.0, 1.0, 1.0, -1.0, 1.0, ]), extrudedHeight: 30000, closeTop: false, - }) + }), ); const numVertices = 37; // 13 bottom + 8 top edge + 8 bottom edge + 4 top corner + 4 bottom corner @@ -833,18 +603,11 @@ describe("Core/PolygonGeometry", function () { PolygonGeometry.fromPositions({ vertexFormat: VertexFormat.POSITION_ONLY, positions: Cartesian3.fromDegreesArray([ - -1.0, - -1.0, - 1.0, - -1.0, - 1.0, - 1.0, - -1.0, - 1.0, + -1.0, -1.0, 1.0, -1.0, 1.0, 1.0, -1.0, 1.0, ]), extrudedHeight: 30000, closeBottom: false, - }) + }), ); const numVertices = 37; // 13 top + 8 top edge + 8 bottom edge + 4 top corner + 4 bottom corner @@ -858,19 +621,12 @@ describe("Core/PolygonGeometry", function () { PolygonGeometry.fromPositions({ vertexFormat: VertexFormat.POSITION_ONLY, positions: Cartesian3.fromDegreesArray([ - -1.0, - -1.0, - 1.0, - -1.0, - 1.0, - 1.0, - -1.0, - 1.0, + -1.0, -1.0, 1.0, -1.0, 1.0, 1.0, -1.0, 1.0, ]), extrudedHeight: 30000, closeTop: false, closeBottom: false, - }) + }), ); const numVertices = 24; // 8 top edge + 8 bottom edge + 4 top corner + 4 bottom corner @@ -884,18 +640,11 @@ describe("Core/PolygonGeometry", function () { PolygonGeometry.fromPositions({ vertexFormat: VertexFormat.POSITION_ONLY, positions: Cartesian3.fromDegreesArray([ - -1.0, - -1.0, - 1.0, - -1.0, - 1.0, - 1.0, - -1.0, - 1.0, + -1.0, -1.0, 1.0, -1.0, 1.0, 1.0, -1.0, 1.0, ]), granularity: CesiumMath.RADIANS_PER_DEGREE, offsetAttribute: GeometryOffsetAttribute.TOP, - }) + }), ); const numVertices = 13; @@ -912,18 +661,11 @@ describe("Core/PolygonGeometry", function () { PolygonGeometry.fromPositions({ vertexFormat: VertexFormat.POSITION_ONLY, positions: Cartesian3.fromDegreesArray([ - -1.0, - -1.0, - 1.0, - -1.0, - 1.0, - 1.0, - -1.0, - 1.0, + -1.0, -1.0, 1.0, -1.0, 1.0, 1.0, -1.0, 1.0, ]), extrudedHeight: 30000, offsetAttribute: GeometryOffsetAttribute.TOP, - }) + }), ); const numVertices = 50; @@ -943,19 +685,12 @@ describe("Core/PolygonGeometry", function () { PolygonGeometry.fromPositions({ vertexFormat: VertexFormat.POSITION_ONLY, positions: Cartesian3.fromDegreesArray([ - -1.0, - -1.0, - 1.0, - -1.0, - 1.0, - 1.0, - -1.0, - 1.0, + -1.0, -1.0, 1.0, -1.0, 1.0, 1.0, -1.0, 1.0, ]), extrudedHeight: 30000, closeTop: false, offsetAttribute: GeometryOffsetAttribute.TOP, - }) + }), ); const numVertices = 37; // 13 bottom + 8 top edge + 8 bottom edge + 4 top corner + 4 bottom corner @@ -972,19 +707,12 @@ describe("Core/PolygonGeometry", function () { PolygonGeometry.fromPositions({ vertexFormat: VertexFormat.POSITION_ONLY, positions: Cartesian3.fromDegreesArray([ - -1.0, - -1.0, - 1.0, - -1.0, - 1.0, - 1.0, - -1.0, - 1.0, + -1.0, -1.0, 1.0, -1.0, 1.0, 1.0, -1.0, 1.0, ]), extrudedHeight: 30000, closeBottom: false, offsetAttribute: GeometryOffsetAttribute.TOP, - }) + }), ); const numVertices = 37; @@ -1001,20 +729,13 @@ describe("Core/PolygonGeometry", function () { PolygonGeometry.fromPositions({ vertexFormat: VertexFormat.POSITION_ONLY, positions: Cartesian3.fromDegreesArray([ - -1.0, - -1.0, - 1.0, - -1.0, - 1.0, - 1.0, - -1.0, - 1.0, + -1.0, -1.0, 1.0, -1.0, 1.0, 1.0, -1.0, 1.0, ]), extrudedHeight: 30000, closeTop: false, closeBottom: false, offsetAttribute: GeometryOffsetAttribute.TOP, - }) + }), ); const numVertices = 24; @@ -1031,18 +752,11 @@ describe("Core/PolygonGeometry", function () { PolygonGeometry.fromPositions({ vertexFormat: VertexFormat.POSITION_ONLY, positions: Cartesian3.fromDegreesArray([ - -1.0, - -1.0, - 1.0, - -1.0, - 1.0, - 1.0, - -1.0, - 1.0, + -1.0, -1.0, 1.0, -1.0, 1.0, 1.0, -1.0, 1.0, ]), extrudedHeight: 30000, offsetAttribute: GeometryOffsetAttribute.ALL, - }) + }), ); const numVertices = 50; @@ -1059,19 +773,12 @@ describe("Core/PolygonGeometry", function () { PolygonGeometry.fromPositions({ vertexFormat: VertexFormat.POSITION_ONLY, positions: Cartesian3.fromDegreesArray([ - -1.0, - -1.0, - 1.0, - -1.0, - 1.0, - 1.0, - -1.0, - 1.0, + -1.0, -1.0, 1.0, -1.0, 1.0, 1.0, -1.0, 1.0, ]), extrudedHeight: 30000, closeTop: false, offsetAttribute: GeometryOffsetAttribute.ALL, - }) + }), ); const numVertices = 37; // 13 bottom + 8 top edge + 8 bottom edge + 4 top corner + 4 bottom corner @@ -1088,19 +795,12 @@ describe("Core/PolygonGeometry", function () { PolygonGeometry.fromPositions({ vertexFormat: VertexFormat.POSITION_ONLY, positions: Cartesian3.fromDegreesArray([ - -1.0, - -1.0, - 1.0, - -1.0, - 1.0, - 1.0, - -1.0, - 1.0, + -1.0, -1.0, 1.0, -1.0, 1.0, 1.0, -1.0, 1.0, ]), extrudedHeight: 30000, closeBottom: false, offsetAttribute: GeometryOffsetAttribute.ALL, - }) + }), ); const numVertices = 37; @@ -1117,20 +817,13 @@ describe("Core/PolygonGeometry", function () { PolygonGeometry.fromPositions({ vertexFormat: VertexFormat.POSITION_ONLY, positions: Cartesian3.fromDegreesArray([ - -1.0, - -1.0, - 1.0, - -1.0, - 1.0, - 1.0, - -1.0, - 1.0, + -1.0, -1.0, 1.0, -1.0, 1.0, 1.0, -1.0, 1.0, ]), extrudedHeight: 30000, closeTop: false, closeBottom: false, offsetAttribute: GeometryOffsetAttribute.ALL, - }) + }), ); const numVertices = 24; @@ -1147,19 +840,10 @@ describe("Core/PolygonGeometry", function () { PolygonGeometry.fromPositions({ vertexFormat: VertexFormat.POSITION_ONLY, positions: Cartesian3.fromDegreesArray([ - -1.0, - -1.0, - 1.0, - -1.0, - 1.0, - 1.0, - -1.0, - 1.0, - -1.0, - -1.0, + -1.0, -1.0, 1.0, -1.0, 1.0, 1.0, -1.0, 1.0, -1.0, -1.0, ]), extrudedHeight: 30000, - }) + }), ); expect(p.attributes.position.values.length).toEqual(50 * 3); @@ -1171,18 +855,11 @@ describe("Core/PolygonGeometry", function () { PolygonGeometry.fromPositions({ vertexFormat: VertexFormat.POSITION_ONLY, positions: Cartesian3.fromDegreesArray([ - -1.0, - -1.0, - 1.0, - -1.0, - 1.0, - 1.0, - -1.0, - 1.0, + -1.0, -1.0, 1.0, -1.0, 1.0, 1.0, -1.0, 1.0, ]), height: 0, extrudedHeight: CesiumMath.EPSILON7, - }) + }), ); expect(p.attributes.position.values.length).toEqual(13 * 3); @@ -1195,18 +872,11 @@ describe("Core/PolygonGeometry", function () { vertexFormat: VertexFormat.ALL, polygonHierarchy: { positions: Cartesian3.fromDegreesArray([ - -1.0, - -1.0, - 1.0, - -1.0, - 1.0, - 1.0, - -1.0, - 1.0, + -1.0, -1.0, 1.0, -1.0, 1.0, 1.0, -1.0, 1.0, ]), }, extrudedHeight: 30000, - }) + }), ); const numVertices = 50; @@ -1225,19 +895,12 @@ describe("Core/PolygonGeometry", function () { vertexFormat: VertexFormat.POSITION_AND_ST, polygonHierarchy: { positions: Cartesian3.fromDegreesArray([ - -100.5, - 30.0, - -100.0, - 30.0, - -100.0, - 30.5, - -100.5, - 30.5, + -100.5, 30.0, -100.0, 30.0, -100.0, 30.5, -100.5, 30.5, ]), }, height: 150000, granularity: CesiumMath.PI, - }) + }), ); const st = p.attributes.st.values; @@ -1253,22 +916,12 @@ describe("Core/PolygonGeometry", function () { vertexFormat: VertexFormat.POSITION_AND_ST, polygonHierarchy: { positions: Cartesian3.fromDegreesArrayHeights([ - -100.5, - 30.0, - 92, - -100.0, - 30.0, - 92, - -100.0, - 30.5, - 92, - -100.5, - 30.5, + -100.5, 30.0, 92, -100.0, 30.0, 92, -100.0, 30.5, 92, -100.5, 30.5, 92, ]), }, granularity: CesiumMath.PI, - }) + }), ); const st = p.attributes.st.values; @@ -1292,20 +945,13 @@ describe("Core/PolygonGeometry", function () { vertexFormat: VertexFormat.POSITION_AND_ST, polygonHierarchy: { positions: Cartesian3.fromDegreesArray([ - -100.5, - 30.0, - -100.0, - 30.0, - -100.0, - 30.5, - -100.5, - 30.5, + -100.5, 30.0, -100.0, 30.0, -100.0, 30.5, -100.5, 30.5, ]), }, textureCoordinates: textureCoordinates, height: 150000, granularity: CesiumMath.PI, - }) + }), ); const st = p.attributes.st.values; @@ -1318,38 +964,17 @@ describe("Core/PolygonGeometry", function () { it("creates a polygon from hierarchy extruded", function () { const hierarchy = { positions: Cartesian3.fromDegreesArray([ - -124.0, - 35.0, - -110.0, - 35.0, - -110.0, - 40.0, - -124.0, - 40.0, + -124.0, 35.0, -110.0, 35.0, -110.0, 40.0, -124.0, 40.0, ]), holes: [ { positions: Cartesian3.fromDegreesArray([ - -122.0, - 36.0, - -122.0, - 39.0, - -112.0, - 39.0, - -112.0, - 36.0, + -122.0, 36.0, -122.0, 39.0, -112.0, 39.0, -112.0, 36.0, ]), holes: [ { positions: Cartesian3.fromDegreesArray([ - -120.0, - 36.5, - -114.0, - 36.5, - -114.0, - 38.5, - -120.0, - 38.5, + -120.0, 36.5, -114.0, 36.5, -114.0, 38.5, -120.0, 38.5, ]), }, ], @@ -1363,7 +988,7 @@ describe("Core/PolygonGeometry", function () { polygonHierarchy: hierarchy, granularity: CesiumMath.PI_OVER_THREE, extrudedHeight: 30000, - }) + }), ); // (4 points * 3 rectangles * 3 to duplicate for normals) * 2 for top and bottom @@ -1389,24 +1014,24 @@ describe("Core/PolygonGeometry", function () { new Cartesian3( 1333485.211963876, -4654510.505548239, - 4138557.5850382405 + 4138557.5850382405, ), new Cartesian3( 1333441.3994441305, -4654261.147368878, - 4138322.784348336 + 4138322.784348336, ), new Cartesian3( 1333521.9333286814, -4654490.298890729, - 4138567.564118971 + 4138567.564118971, ), ], extrudedHeight: 56, vertexFormat: VertexFormat.POSITION_AND_NORMAL, perPositionHeight: true, closeBottom: false, - }) + }), ); const normals = geometry.attributes.normal.values; @@ -1420,7 +1045,7 @@ describe("Core/PolygonGeometry", function () { !CesiumMath.equalsEpsilon( normals[i], expectedNormals[i], - CesiumMath.EPSILON6 + CesiumMath.EPSILON6, ) ) { notEqualCount++; @@ -1434,18 +1059,7 @@ describe("Core/PolygonGeometry", function () { it("computes geometry with position only vertex format with perPositionHeight and extrudedHeight", function () { const positions = Cartesian3.fromDegreesArrayHeights([ - -1.0, - -1.0, - 100.0, - 1.0, - -1.0, - 0.0, - 1.0, - 1.0, - 100.0, - -1.0, - 1.0, - 0.0, + -1.0, -1.0, 100.0, 1.0, -1.0, 0.0, 1.0, 1.0, 100.0, -1.0, 1.0, 0.0, ]); const geometry = PolygonGeometry.createGeometry( PolygonGeometry.fromPositions({ @@ -1453,7 +1067,7 @@ describe("Core/PolygonGeometry", function () { extrudedHeight: 0, vertexFormat: VertexFormat.POSITION_ONLY, perPositionHeight: true, - }) + }), ); expect(geometry).toBeDefined(); expect(geometry.attributes.position).toBeDefined(); @@ -1462,15 +1076,9 @@ describe("Core/PolygonGeometry", function () { it("does not include indices for extruded walls that are too small", function () { const positions = Cartesian3.fromDegreesArray([ - 7.757161063097392, - 48.568676799636634, - 7.753968290229146, - 48.571796467099077, - 7.755340073906587, - 48.571948854067948, - 7.756263393414589, - 48.571947951609708, - 7.756894446412183, + 7.757161063097392, 48.568676799636634, 7.753968290229146, + 48.571796467099077, 7.755340073906587, 48.571948854067948, + 7.756263393414589, 48.571947951609708, 7.756894446412183, 48.569396703043992, ]); @@ -1482,7 +1090,7 @@ describe("Core/PolygonGeometry", function () { closeTop: false, closeBottom: false, arcType: ArcType.RHUMB, - }) + }), ); let numVertices = 20; @@ -1498,13 +1106,13 @@ describe("Core/PolygonGeometry", function () { closeTop: false, closeBottom: false, arcType: ArcType.GEODESIC, - }) + }), ); numVertices = 20; numTriangles = 10; expect(pGeodesic.attributes.position.values.length).toEqual( - numVertices * 3 + numVertices * 3, ); expect(pGeodesic.indices.length).toEqual(numTriangles * 3); }); @@ -1514,17 +1122,7 @@ describe("Core/PolygonGeometry", function () { vertexFormat: VertexFormat.POSITION_AND_ST, polygonHierarchy: { positions: Cartesian3.fromDegreesArrayHeights([ - -100.5, - 30.0, - 92, - -100.0, - 30.0, - 92, - -100.0, - 30.5, - 92, - -100.5, - 30.5, + -100.5, 30.0, 92, -100.0, 30.0, 92, -100.0, 30.5, 92, -100.5, 30.5, 92, ]), }, @@ -1536,15 +1134,15 @@ describe("Core/PolygonGeometry", function () { expect(CesiumMath.toDegrees(r.north)).toBeLessThan(30.5999); expect(CesiumMath.toDegrees(r.south)).toEqualEpsilon( 30.0, - CesiumMath.EPSILON5 + CesiumMath.EPSILON5, ); expect(CesiumMath.toDegrees(r.east)).toEqualEpsilon( -100.0, - CesiumMath.EPSILON13 + CesiumMath.EPSILON13, ); expect(CesiumMath.toDegrees(r.west)).toEqualEpsilon( -100.5, - CesiumMath.EPSILON13 + CesiumMath.EPSILON13, ); }); @@ -1553,18 +1151,7 @@ describe("Core/PolygonGeometry", function () { vertexFormat: VertexFormat.POSITION_AND_ST, polygonHierarchy: { positions: Cartesian3.fromDegreesArrayHeights([ - -90.0, - 30.0, - 0, - -80.0, - 30.0, - 0, - -80.0, - 40.0, - 0, - -90.0, - 40.0, - 0, + -90.0, 30.0, 0, -80.0, 30.0, 0, -80.0, 40.0, 0, -90.0, 40.0, 0, ]), }, granularity: CesiumMath.RADIANS_PER_DEGREE, @@ -1575,33 +1162,22 @@ describe("Core/PolygonGeometry", function () { expect(CesiumMath.toDegrees(boundingGeodesic.north)).toBeGreaterThan(40.0); expect(CesiumMath.toDegrees(boundingGeodesic.south)).toEqualEpsilon( 30.0, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); expect(CesiumMath.toDegrees(boundingGeodesic.east)).toEqualEpsilon( -80.0, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); expect(CesiumMath.toDegrees(boundingGeodesic.west)).toEqualEpsilon( -90.0, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); const pRhumb = new PolygonGeometry({ vertexFormat: VertexFormat.POSITION_AND_ST, polygonHierarchy: { positions: Cartesian3.fromDegreesArrayHeights([ - -90.0, - 30.0, - 0, - -80.0, - 30.0, - 0, - -80.0, - 40.0, - 0, - -90.0, - 40.0, - 0, + -90.0, 30.0, 0, -80.0, 30.0, 0, -80.0, 40.0, 0, -90.0, 40.0, 0, ]), }, granularity: CesiumMath.RADIANS_PER_DEGREE, @@ -1611,19 +1187,19 @@ describe("Core/PolygonGeometry", function () { const boundingRhumb = pRhumb.rectangle; expect(CesiumMath.toDegrees(boundingRhumb.north)).toEqualEpsilon( 40.0, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); expect(CesiumMath.toDegrees(boundingRhumb.south)).toEqualEpsilon( 30.0, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); expect(CesiumMath.toDegrees(boundingRhumb.east)).toEqualEpsilon( -80.0, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); expect(CesiumMath.toDegrees(boundingRhumb.west)).toEqualEpsilon( -90.0, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); }); @@ -1632,14 +1208,7 @@ describe("Core/PolygonGeometry", function () { vertexFormat: VertexFormat.POSITION_AND_ST, polygonHierarchy: { positions: Cartesian3.fromDegreesArray([ - 175, - 30, - -170, - 30, - -170, - 40, - 175, - 40, + 175, 30, -170, 30, -170, 40, 175, 40, ]), }, granularity: CesiumMath.RADIANS_PER_DEGREE, @@ -1649,19 +1218,19 @@ describe("Core/PolygonGeometry", function () { const boundingRhumb = pRhumb.rectangle; expect(CesiumMath.toDegrees(boundingRhumb.north)).toEqualEpsilon( 40.0, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); expect(CesiumMath.toDegrees(boundingRhumb.south)).toEqualEpsilon( 30.0, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); expect(CesiumMath.toDegrees(boundingRhumb.east)).toEqualEpsilon( -170.0, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); expect(CesiumMath.toDegrees(boundingRhumb.west)).toEqualEpsilon( 175.0, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); }); @@ -1689,19 +1258,19 @@ describe("Core/PolygonGeometry", function () { const boundingGeodesic = pGeodesic.rectangle; expect(boundingGeodesic.east).toEqualEpsilon( minLon.longitude, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); expect(boundingGeodesic.south).toEqualEpsilon( minLat.latitude, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); expect(boundingGeodesic.west).toEqualEpsilon( maxLon.longitude, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); expect(boundingGeodesic.north).toEqualEpsilon( maxLat.latitude, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); }); @@ -1714,7 +1283,7 @@ describe("Core/PolygonGeometry", function () { positions, Ellipsoid.WGS84, ArcType.GEODESIC, - result + result, ); expect(returned).toBe(result); @@ -1725,21 +1294,21 @@ describe("Core/PolygonGeometry", function () { const result = PolygonGeometry.computeRectangleFromPositions( positions, - Ellipsoid.WGS84 + Ellipsoid.WGS84, ); expect(result).toBeInstanceOf(Rectangle); expect(result.west).toEqualEpsilon( CesiumMath.toRadians(30), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(result.south).toEqualEpsilon( CesiumMath.toRadians(30), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(result.east).toEqualEpsilon( CesiumMath.toRadians(60), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(result.north).toBeGreaterThan(CesiumMath.toRadians(60)); expect(result.north).toBeLessThan(CesiumMath.toRadians(70)); @@ -1751,411 +1320,340 @@ describe("Core/PolygonGeometry", function () { const result = PolygonGeometry.computeRectangleFromPositions( positions, Ellipsoid.WGS84, - ArcType.RHUMB + ArcType.RHUMB, ); expect(result).toBeInstanceOf(Rectangle); expect(result.west).toEqualEpsilon( CesiumMath.toRadians(30), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(result.south).toEqualEpsilon( CesiumMath.toRadians(30), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(result.east).toEqualEpsilon( CesiumMath.toRadians(60), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(result.north).toEqualEpsilon( CesiumMath.toRadians(60), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); }); it("computes a rectangle enclosing a simple geodesic polygon in the southern hemisphere", function () { const positions = Cartesian3.fromDegreesArray([ - -30, - -30, - -60, - -60, - -30, - -60, + -30, -30, -60, -60, -30, -60, ]); const result = PolygonGeometry.computeRectangleFromPositions( positions, - Ellipsoid.WGS84 + Ellipsoid.WGS84, ); expect(result).toBeInstanceOf(Rectangle); expect(result.west).toEqualEpsilon( CesiumMath.toRadians(-60), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(result.south).toBeLessThan(CesiumMath.toRadians(-60)); expect(result.south).toBeGreaterThan(CesiumMath.toRadians(-70)); expect(result.east).toEqualEpsilon( CesiumMath.toRadians(-30), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(result.north).toEqualEpsilon( CesiumMath.toRadians(-30), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); }); it("computes a rectangle enclosing a simple rhumb polygon in the southern hemisphere", function () { const positions = Cartesian3.fromDegreesArray([ - -30, - -30, - -60, - -60, - -30, - -60, + -30, -30, -60, -60, -30, -60, ]); const result = PolygonGeometry.computeRectangleFromPositions( positions, Ellipsoid.WGS84, - ArcType.RHUMB + ArcType.RHUMB, ); expect(result).toBeInstanceOf(Rectangle); expect(result.west).toEqualEpsilon( CesiumMath.toRadians(-60), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(result.south).toEqualEpsilon( CesiumMath.toRadians(-60), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(result.east).toEqualEpsilon( CesiumMath.toRadians(-30), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(result.north).toEqualEpsilon( CesiumMath.toRadians(-30), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); }); it("computes a rectangle enclosing a simple polygon across the IDL", function () { const positions = Cartesian3.fromDegreesArray([ - 170, - 60, - 170, - 30, - -170, - 30, + 170, 60, 170, 30, -170, 30, ]); const result = PolygonGeometry.computeRectangleFromPositions( positions, - Ellipsoid.WGS84 + Ellipsoid.WGS84, ); expect(result).toBeInstanceOf(Rectangle); expect(result.west).toEqualEpsilon( CesiumMath.toRadians(170), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(result.south).toEqualEpsilon( CesiumMath.toRadians(30), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(result.east).toEqualEpsilon( CesiumMath.toRadians(-170), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(result.north).toEqualEpsilon( CesiumMath.toRadians(60), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); }); it("computes a rectangle enclosing a simple polygon across the equator", function () { const positions = Cartesian3.fromDegreesArray([ - 30, - 30, - -30, - 30, - -30, - -30, - 30, - -30, + 30, 30, -30, 30, -30, -30, 30, -30, ]); const result = PolygonGeometry.computeRectangleFromPositions( positions, Ellipsoid.WGS84, - ArcType.RHUMB + ArcType.RHUMB, ); expect(result).toBeInstanceOf(Rectangle); expect(result.west).toEqualEpsilon( CesiumMath.toRadians(-30), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(result.south).toEqualEpsilon( CesiumMath.toRadians(-30), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(result.east).toEqualEpsilon( CesiumMath.toRadians(30), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(result.north).toEqualEpsilon( CesiumMath.toRadians(30), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); }); it("computes a rectangle enclosing a simple convex polygon around the north pole", function () { const positions = Cartesian3.fromDegreesArray([ - 45, - 60, - -45, - 60, - -135, - 60, - 140, - 60, + 45, 60, -45, 60, -135, 60, 140, 60, ]); const result = PolygonGeometry.computeRectangleFromPositions( positions, - Ellipsoid.WGS84 + Ellipsoid.WGS84, ); expect(result).toBeInstanceOf(Rectangle); expect(result.west).toEqualEpsilon( CesiumMath.toRadians(-180), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(result.south).toEqualEpsilon( CesiumMath.toRadians(60), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(result.east).toEqualEpsilon( CesiumMath.toRadians(180), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(result.north).toEqualEpsilon( CesiumMath.toRadians(90), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); }); it("computes a rectangle enclosing a simple concave polygon around the north pole", function () { const positions = Cartesian3.fromDegreesArray([ - 45, - 60, - -45, - 60, - -135, - 60, - -45, - 80, + 45, 60, -45, 60, -135, 60, -45, 80, ]); const result = PolygonGeometry.computeRectangleFromPositions( positions, - Ellipsoid.WGS84 + Ellipsoid.WGS84, ); expect(result).toBeInstanceOf(Rectangle); expect(result.west).toEqualEpsilon( CesiumMath.toRadians(-135), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(result.south).toEqualEpsilon( CesiumMath.toRadians(60), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(result.east).toEqualEpsilon( CesiumMath.toRadians(45), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(result.north).toEqualEpsilon(1.40485733, CesiumMath.EPSILON7); }); it("computes a rectangle enclosing a simple clockwise convex polygon around the north pole", function () { const positions = Cartesian3.fromDegreesArray([ - 140, - 60, - -135, - 60, - -45, - 60, - 45, - 60, + 140, 60, -135, 60, -45, 60, 45, 60, ]); const result = PolygonGeometry.computeRectangleFromPositions( positions, - Ellipsoid.WGS84 + Ellipsoid.WGS84, ); expect(result).toBeInstanceOf(Rectangle); expect(result.west).toEqualEpsilon( CesiumMath.toRadians(-180), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(result.south).toEqualEpsilon( CesiumMath.toRadians(60), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(result.east).toEqualEpsilon( CesiumMath.toRadians(180), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(result.north).toEqualEpsilon( CesiumMath.toRadians(90), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); }); it("computes a rectangle enclosing a simple convex polygon around the south pole", function () { const positions = Cartesian3.fromDegreesArray([ - 140, - -60, - -135, - -60, - -45, - -60, - 45, - -60, + 140, -60, -135, -60, -45, -60, 45, -60, ]); const result = PolygonGeometry.computeRectangleFromPositions( positions, - Ellipsoid.WGS84 + Ellipsoid.WGS84, ); expect(result).toBeInstanceOf(Rectangle); expect(result.west).toEqualEpsilon( CesiumMath.toRadians(-180), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(result.south).toEqualEpsilon( CesiumMath.toRadians(-90), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(result.east).toEqualEpsilon( CesiumMath.toRadians(180), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(result.north).toEqualEpsilon( CesiumMath.toRadians(-60), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); }); it("computes a rectangle enclosing a simple concave rhumb polygon around the south pole", function () { const positions = Cartesian3.fromDegreesArray([ - 45, - -60, - -45, - -60, - -135, - -60, - -45, - -80, + 45, -60, -45, -60, -135, -60, -45, -80, ]); const result = PolygonGeometry.computeRectangleFromPositions( positions, Ellipsoid.WGS84, - ArcType.RHUMB + ArcType.RHUMB, ); expect(result).toBeInstanceOf(Rectangle); expect(result.west).toEqualEpsilon( CesiumMath.toRadians(-135), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(result.south).toEqualEpsilon( CesiumMath.toRadians(-80), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(result.east).toEqualEpsilon( CesiumMath.toRadians(45), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(result.north).toEqualEpsilon( CesiumMath.toRadians(-60), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); }); it("computes a rectangle enclosing a simple concave geodesic polygon around the south pole", function () { const positions = Cartesian3.fromDegreesArray([ - 45, - -60, - -45, - -60, - -135, - -60, - -45, - -80, + 45, -60, -45, -60, -135, -60, -45, -80, ]); const result = PolygonGeometry.computeRectangleFromPositions( positions, - Ellipsoid.WGS84 + Ellipsoid.WGS84, ); expect(result).toBeInstanceOf(Rectangle); expect(result.west).toEqualEpsilon( CesiumMath.toRadians(-135), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(result.south).toBeLessThan(CesiumMath.toRadians(-80)); expect(result.south).toBeGreaterThan(CesiumMath.toRadians(-90)); expect(result.east).toEqualEpsilon( CesiumMath.toRadians(45), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(result.north).toEqualEpsilon( CesiumMath.toRadians(-60), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); }); it("computes a rectangle enclosing a simple clockwise convex polygon around the south pole", function () { const positions = Cartesian3.fromDegreesArray([ - 45, - -60, - -45, - -60, - -135, - -60, - 140, - -60, + 45, -60, -45, -60, -135, -60, 140, -60, ]); const result = PolygonGeometry.computeRectangleFromPositions( positions, - Ellipsoid.WGS84 + Ellipsoid.WGS84, ); expect(result).toBeInstanceOf(Rectangle); expect(result.west).toEqualEpsilon( CesiumMath.toRadians(-180), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(result.south).toEqualEpsilon( CesiumMath.toRadians(-90), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(result.east).toEqualEpsilon( CesiumMath.toRadians(180), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(result.north).toEqualEpsilon( CesiumMath.toRadians(-60), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); }); }); @@ -2165,18 +1663,7 @@ describe("Core/PolygonGeometry", function () { vertexFormat: VertexFormat.POSITION_AND_ST, polygonHierarchy: { positions: Cartesian3.fromDegreesArrayHeights([ - -10.0, - -10.0, - 0, - -10.0, - 10.0, - 0, - 10.0, - -10.0, - 0, - 10.0, - 10.0, - 0, + -10.0, -10.0, 0, -10.0, 10.0, 0, 10.0, -10.0, 0, 10.0, 10.0, 0, ]), }, granularity: CesiumMath.PI, @@ -2189,45 +1676,34 @@ describe("Core/PolygonGeometry", function () { expect(textureCoordinateRotationPoints.length).toEqual(6); expect(textureCoordinateRotationPoints[0]).toEqualEpsilon( 0, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(textureCoordinateRotationPoints[1]).toEqualEpsilon( 1, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(textureCoordinateRotationPoints[2]).toEqualEpsilon( 1, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(textureCoordinateRotationPoints[3]).toEqualEpsilon( 1, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(textureCoordinateRotationPoints[4]).toEqualEpsilon( 0, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(textureCoordinateRotationPoints[5]).toEqualEpsilon( 0, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); p = new PolygonGeometry({ vertexFormat: VertexFormat.POSITION_AND_ST, polygonHierarchy: { positions: Cartesian3.fromDegreesArrayHeights([ - -10.0, - -10.0, - 0, - -10.0, - 10.0, - 0, - 10.0, - -10.0, - 0, - 10.0, - 10.0, - 0, + -10.0, -10.0, 0, -10.0, 10.0, 0, 10.0, -10.0, 0, 10.0, 10.0, 0, ]), }, granularity: CesiumMath.PI, @@ -2238,55 +1714,40 @@ describe("Core/PolygonGeometry", function () { expect(textureCoordinateRotationPoints.length).toEqual(6); expect(textureCoordinateRotationPoints[0]).toEqualEpsilon( 0, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(textureCoordinateRotationPoints[1]).toEqualEpsilon( 0, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(textureCoordinateRotationPoints[2]).toEqualEpsilon( 0, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(textureCoordinateRotationPoints[3]).toEqualEpsilon( 1, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(textureCoordinateRotationPoints[4]).toEqualEpsilon( 1, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(textureCoordinateRotationPoints[5]).toEqualEpsilon( 0, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); }); // pack without explicit texture coordinates const positions = Cartesian3.fromDegreesArray([ - -12.4, - 3.5, - -12.0, - 3.5, - -12.0, - 4.0, + -12.4, 3.5, -12.0, 3.5, -12.0, 4.0, ]); const holePositions0 = Cartesian3.fromDegreesArray([ - -12.2, - 3.5, - -12.2, - 3.6, - -12.3, - 3.6, + -12.2, 3.5, -12.2, 3.6, -12.3, 3.6, ]); const holePositions1 = Cartesian3.fromDegreesArray([ - -12.2, - 3.5, - -12.25, - 3.5, - -12.25, - 3.55, + -12.2, 3.5, -12.25, 3.5, -12.25, 3.55, ]); const hierarchy = { positions: positions, @@ -2333,7 +1794,7 @@ describe("Core/PolygonGeometry", function () { packedInstance.push( Ellipsoid.WGS84.radii.x, Ellipsoid.WGS84.radii.y, - Ellipsoid.WGS84.radii.z + Ellipsoid.WGS84.radii.z, ); packedInstance.push(1.0, 0.0, 0.0, 0.0, 0.0, 0.0); packedInstance.push( @@ -2349,7 +1810,7 @@ describe("Core/PolygonGeometry", function () { -1, ArcType.GEODESIC, -1, - 55 + 55, ); createPackableSpecs(PolygonGeometry, polygon, packedInstance); @@ -2389,7 +1850,7 @@ describe("Core/PolygonGeometry", function () { packedInstanceTextured.push( Ellipsoid.WGS84.radii.x, Ellipsoid.WGS84.radii.y, - Ellipsoid.WGS84.radii.z + Ellipsoid.WGS84.radii.z, ); packedInstanceTextured.push(1.0, 0.0, 0.0, 0.0, 0.0, 0.0); packedInstanceTextured.push( @@ -2403,7 +1864,7 @@ describe("Core/PolygonGeometry", function () { 1, 0, -1, - ArcType.GEODESIC + ArcType.GEODESIC, ); packedInstanceTextured.push(9.0, 0.0); addPositions2D(packedInstanceTextured, textureCoordinates.positions); diff --git a/packages/engine/Specs/Core/PolygonOutlineGeometrySpec.js b/packages/engine/Specs/Core/PolygonOutlineGeometrySpec.js index 92838d833a14..a8e6ef401049 100644 --- a/packages/engine/Specs/Core/PolygonOutlineGeometrySpec.js +++ b/packages/engine/Specs/Core/PolygonOutlineGeometrySpec.js @@ -37,8 +37,8 @@ describe("Core/PolygonOutlineGeometry", function () { PolygonOutlineGeometry.createGeometry( PolygonOutlineGeometry.fromPositions({ positions: [new Cartesian3()], - }) - ) + }), + ), ).toBeUndefined(); }); @@ -49,8 +49,8 @@ describe("Core/PolygonOutlineGeometry", function () { polygonHierarchy: { positions: [Cartesian3.fromDegrees(0, 0)], }, - }) - ) + }), + ), ).toBeUndefined(); }); @@ -71,7 +71,7 @@ describe("Core/PolygonOutlineGeometry", function () { const geometry = PolygonOutlineGeometry.createGeometry( PolygonOutlineGeometry.fromPositions({ positions: Cartesian3.fromDegreesArray([0.0, 0.0, 0.0, 0.0, 0.0, 0.0]), - }) + }), ); expect(geometry).toBeUndefined(); }); @@ -81,7 +81,7 @@ describe("Core/PolygonOutlineGeometry", function () { PolygonOutlineGeometry.fromPositions({ positions: Cartesian3.fromDegreesArray([0.0, 0.0, 0.0, 0.0, 0.0, 0.0]), extrudedHeight: 2, - }) + }), ); expect(geometry).toBeUndefined(); }); @@ -92,19 +92,14 @@ describe("Core/PolygonOutlineGeometry", function () { holes: [ { positions: Cartesian3.fromDegreesArray([ - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, ]), }, ], }; const geometry = PolygonOutlineGeometry.createGeometry( - new PolygonOutlineGeometry({ polygonHierarchy: hierarchy }) + new PolygonOutlineGeometry({ polygonHierarchy: hierarchy }), ); expect(geometry).toBeUndefined(); }); @@ -112,35 +107,19 @@ describe("Core/PolygonOutlineGeometry", function () { it("createGeometry returns undefined due to duplicate hierarchy positions with different heights", function () { const hierarchy = { positions: Cartesian3.fromDegreesArrayHeights([ - 1.0, - 1.0, - 10.0, - 1.0, - 1.0, - 20.0, - 1.0, - 1.0, - 30.0, + 1.0, 1.0, 10.0, 1.0, 1.0, 20.0, 1.0, 1.0, 30.0, ]), holes: [ { positions: Cartesian3.fromDegreesArrayHeights([ - 0.0, - 0.0, - 10.0, - 0.0, - 0.0, - 20.0, - 0.0, - 0.0, - 30.0, + 0.0, 0.0, 10.0, 0.0, 0.0, 20.0, 0.0, 0.0, 30.0, ]), }, ], }; const geometry = PolygonOutlineGeometry.createGeometry( - new PolygonOutlineGeometry({ polygonHierarchy: hierarchy }) + new PolygonOutlineGeometry({ polygonHierarchy: hierarchy }), ); expect(geometry).toBeUndefined(); }); @@ -148,28 +127,12 @@ describe("Core/PolygonOutlineGeometry", function () { it("createGeometry returns geometry if duplicate hierarchy positions with different heights and perPositionHeight is true", function () { const hierarchy = { positions: Cartesian3.fromDegreesArrayHeights([ - 1.0, - 1.0, - 10.0, - 1.0, - 1.0, - 20.0, - 1.0, - 1.0, - 30.0, + 1.0, 1.0, 10.0, 1.0, 1.0, 20.0, 1.0, 1.0, 30.0, ]), holes: [ { positions: Cartesian3.fromDegreesArrayHeights([ - 0.0, - 0.0, - 10.0, - 0.0, - 0.0, - 20.0, - 0.0, - 0.0, - 30.0, + 0.0, 0.0, 10.0, 0.0, 0.0, 20.0, 0.0, 0.0, 30.0, ]), }, ], @@ -179,7 +142,7 @@ describe("Core/PolygonOutlineGeometry", function () { new PolygonOutlineGeometry({ polygonHierarchy: hierarchy, perPositionHeight: true, - }) + }), ); expect(geometry).toBeDefined(); }); @@ -188,16 +151,9 @@ describe("Core/PolygonOutlineGeometry", function () { const p = PolygonOutlineGeometry.createGeometry( PolygonOutlineGeometry.fromPositions({ positions: Cartesian3.fromDegreesArray([ - -1.0, - -1.0, - 1.0, - -1.0, - 1.0, - 1.0, - -1.0, - 1.0, + -1.0, -1.0, 1.0, -1.0, 1.0, 1.0, -1.0, 1.0, ]), - }) + }), ); expect(p.attributes.position.values.length).toEqual(8 * 3); @@ -225,18 +181,18 @@ describe("Core/PolygonOutlineGeometry", function () { PolygonOutlineGeometry.fromPositions({ positions: positions, perPositionHeight: true, - }) + }), ); expect( ellipsoid.cartesianToCartographic( - Cartesian3.fromArray(p.attributes.position.values, 0) - ).height + Cartesian3.fromArray(p.attributes.position.values, 0), + ).height, ).toEqualEpsilon(height, CesiumMath.EPSILON6); expect( ellipsoid.cartesianToCartographic( - Cartesian3.fromArray(p.attributes.position.values, 3) - ).height + Cartesian3.fromArray(p.attributes.position.values, 3), + ).height, ).toEqualEpsilon(0, CesiumMath.EPSILON6); }); @@ -244,18 +200,11 @@ describe("Core/PolygonOutlineGeometry", function () { const p = PolygonOutlineGeometry.createGeometry( PolygonOutlineGeometry.fromPositions({ positions: Cartesian3.fromDegreesArray([ - -1.0, - -1.0, - 1.0, - -1.0, - 1.0, - 1.0, - -1.0, - 1.0, + -1.0, -1.0, 1.0, -1.0, 1.0, 1.0, -1.0, 1.0, ]), granularity: CesiumMath.RADIANS_PER_DEGREE, arcType: ArcType.RHUMB, - }) + }), ); expect(p.attributes.position.values.length).toEqual(8 * 3); // 8 around edge @@ -267,50 +216,36 @@ describe("Core/PolygonOutlineGeometry", function () { PolygonOutlineGeometry.createGeometry( PolygonOutlineGeometry.fromPositions({ positions: Cartesian3.fromDegreesArray([ - -1.0, - -1.0, - 1.0, - -1.0, - 1.0, - 1.0, - -1.0, - 1.0, + -1.0, -1.0, 1.0, -1.0, 1.0, 1.0, -1.0, 1.0, ]), granularity: CesiumMath.RADIANS_PER_DEGREE, arcType: ArcType.NONE, - }) + }), ); }).toThrowDeveloperError(); }); it("create geometry creates with lines with different number of subdivisions for geodesic and rhumb", function () { const positions = Cartesian3.fromDegreesArray([ - -80.0, - 75.0, - 80.0, - 75.0, - 80.0, - 45.0, - -80.0, - 45.0, + -80.0, 75.0, 80.0, 75.0, 80.0, 45.0, -80.0, 45.0, ]); const geodesic = PolygonOutlineGeometry.createGeometry( PolygonOutlineGeometry.fromPositions({ positions: positions, granularity: CesiumMath.RADIANS_PER_DEGREE, arcType: ArcType.GEODESIC, - }) + }), ); const rhumb = PolygonOutlineGeometry.createGeometry( PolygonOutlineGeometry.fromPositions({ positions: positions, granularity: CesiumMath.RADIANS_PER_DEGREE, arcType: ArcType.RHUMB, - }) + }), ); expect(geodesic.attributes.position.values.length).not.toEqual( - rhumb.attributes.position.values.length + rhumb.attributes.position.values.length, ); expect(geodesic.indices.length).not.toEqual(rhumb.indices.length); }); @@ -337,18 +272,18 @@ describe("Core/PolygonOutlineGeometry", function () { positions: positions, perPositionHeight: true, arcType: ArcType.RHUMB, - }) + }), ); expect( ellipsoid.cartesianToCartographic( - Cartesian3.fromArray(p.attributes.position.values, 0) - ).height + Cartesian3.fromArray(p.attributes.position.values, 0), + ).height, ).toEqualEpsilon(height, CesiumMath.EPSILON6); expect( ellipsoid.cartesianToCartographic( - Cartesian3.fromArray(p.attributes.position.values, 3) - ).height + Cartesian3.fromArray(p.attributes.position.values, 3), + ).height, ).toEqualEpsilon(0, CesiumMath.EPSILON6); }); @@ -376,61 +311,40 @@ describe("Core/PolygonOutlineGeometry", function () { positions: positions, perPositionHeight: true, extrudedHeight: extrudedHeight, - }) + }), ); expect( ellipsoid.cartesianToCartographic( - Cartesian3.fromArray(p.attributes.position.values, 0) - ).height + Cartesian3.fromArray(p.attributes.position.values, 0), + ).height, ).toEqualEpsilon(maxHeight, CesiumMath.EPSILON6); expect( ellipsoid.cartesianToCartographic( - Cartesian3.fromArray(p.attributes.position.values, 3) - ).height + Cartesian3.fromArray(p.attributes.position.values, 3), + ).height, ).toEqualEpsilon(minHeight, CesiumMath.EPSILON6); expect( ellipsoid.cartesianToCartographic( - Cartesian3.fromArray(p.attributes.position.values, 24) - ).height + Cartesian3.fromArray(p.attributes.position.values, 24), + ).height, ).toEqualEpsilon(extrudedHeight, CesiumMath.EPSILON6); }); it("creates a polygon from hierarchy", function () { const hierarchy = { positions: Cartesian3.fromDegreesArray([ - -124.0, - 35.0, - -110.0, - 35.0, - -110.0, - 40.0, - -124.0, - 40.0, + -124.0, 35.0, -110.0, 35.0, -110.0, 40.0, -124.0, 40.0, ]), holes: [ { positions: Cartesian3.fromDegreesArray([ - -122.0, - 36.0, - -122.0, - 39.0, - -112.0, - 39.0, - -112.0, - 36.0, + -122.0, 36.0, -122.0, 39.0, -112.0, 39.0, -112.0, 36.0, ]), holes: [ { positions: Cartesian3.fromDegreesArray([ - -120.0, - 36.5, - -114.0, - 36.5, - -114.0, - 38.5, - -120.0, - 38.5, + -120.0, 36.5, -114.0, 36.5, -114.0, 38.5, -120.0, 38.5, ]), }, ], @@ -442,7 +356,7 @@ describe("Core/PolygonOutlineGeometry", function () { new PolygonOutlineGeometry({ polygonHierarchy: hierarchy, granularity: CesiumMath.PI_OVER_THREE, - }) + }), ); expect(p.attributes.position.values.length).toEqual(12 * 3); // 4 corners * 3 rectangles @@ -452,38 +366,17 @@ describe("Core/PolygonOutlineGeometry", function () { it("creates a polygon from clockwise hierarchy", function () { const hierarchy = { positions: Cartesian3.fromDegreesArray([ - -124.0, - 35.0, - -124.0, - 40.0, - -110.0, - 40.0, - -110.0, - 35.0, + -124.0, 35.0, -124.0, 40.0, -110.0, 40.0, -110.0, 35.0, ]), holes: [ { positions: Cartesian3.fromDegreesArray([ - -122.0, - 36.0, - -112.0, - 36.0, - -112.0, - 39.0, - -122.0, - 39.0, + -122.0, 36.0, -112.0, 36.0, -112.0, 39.0, -122.0, 39.0, ]), holes: [ { positions: Cartesian3.fromDegreesArray([ - -120.0, - 36.5, - -120.0, - 38.5, - -114.0, - 38.5, - -114.0, - 36.5, + -120.0, 36.5, -120.0, 38.5, -114.0, 38.5, -114.0, 36.5, ]), }, ], @@ -495,7 +388,7 @@ describe("Core/PolygonOutlineGeometry", function () { new PolygonOutlineGeometry({ polygonHierarchy: hierarchy, granularity: CesiumMath.PI_OVER_THREE, - }) + }), ); expect(p.attributes.position.values.length).toEqual(12 * 3); @@ -504,34 +397,13 @@ describe("Core/PolygonOutlineGeometry", function () { it("doesn't reverse clockwise input array", function () { const p = Cartesian3.fromDegreesArray([ - -124.0, - 35.0, - -124.0, - 40.0, - -110.0, - 40.0, - -110.0, - 35.0, + -124.0, 35.0, -124.0, 40.0, -110.0, 40.0, -110.0, 35.0, ]); const h1 = Cartesian3.fromDegreesArray([ - -122.0, - 36.0, - -112.0, - 36.0, - -112.0, - 39.0, - -122.0, - 39.0, + -122.0, 36.0, -112.0, 36.0, -112.0, 39.0, -122.0, 39.0, ]); const h2 = Cartesian3.fromDegreesArray([ - -120.0, - 36.5, - -120.0, - 38.5, - -114.0, - 38.5, - -114.0, - 36.5, + -120.0, 36.5, -120.0, 38.5, -114.0, 38.5, -114.0, 36.5, ]); const hierarchy = { positions: p, @@ -551,47 +423,26 @@ describe("Core/PolygonOutlineGeometry", function () { new PolygonOutlineGeometry({ polygonHierarchy: hierarchy, granularity: CesiumMath.PI_OVER_THREE, - }) + }), ); expect(p).toEqualEpsilon( Cartesian3.fromDegreesArray([ - -124.0, - 35.0, - -124.0, - 40.0, - -110.0, - 40.0, - -110.0, - 35.0, + -124.0, 35.0, -124.0, 40.0, -110.0, 40.0, -110.0, 35.0, ]), - CesiumMath.EPSILON9 + CesiumMath.EPSILON9, ); expect(h1).toEqualEpsilon( Cartesian3.fromDegreesArray([ - -122.0, - 36.0, - -112.0, - 36.0, - -112.0, - 39.0, - -122.0, - 39.0, + -122.0, 36.0, -112.0, 36.0, -112.0, 39.0, -122.0, 39.0, ]), - CesiumMath.EPSILON9 + CesiumMath.EPSILON9, ); expect(h2).toEqualEpsilon( Cartesian3.fromDegreesArray([ - -120.0, - 36.5, - -120.0, - 38.5, - -114.0, - 38.5, - -114.0, - 36.5, + -120.0, 36.5, -120.0, 38.5, -114.0, 38.5, -114.0, 36.5, ]), - CesiumMath.EPSILON9 + CesiumMath.EPSILON9, ); }); @@ -599,48 +450,34 @@ describe("Core/PolygonOutlineGeometry", function () { const p = PolygonOutlineGeometry.createGeometry( PolygonOutlineGeometry.fromPositions({ positions: Cartesian3.fromDegreesArray([ - -108.0, - 1.0, - -108.0, - -1.0, - -106.0, - -1.0, - -106.0, - 1.0, + -108.0, 1.0, -108.0, -1.0, -106.0, -1.0, -106.0, 1.0, ]), granularity: CesiumMath.PI_OVER_THREE, - }) + }), ); const bs = BoundingSphere.fromVertices(p.attributes.position.values); expect(p.boundingSphere.center).toEqualEpsilon( bs.center, - CesiumMath.EPSILON9 + CesiumMath.EPSILON9, ); expect(p.boundingSphere.radius).toEqualEpsilon( bs.radius, - CesiumMath.EPSILON9 + CesiumMath.EPSILON9, ); }); it("computes correct bounding sphere at height >>> 0", function () { const height = 40000000.0; const positions = Cartesian3.fromDegreesArray([ - -108.0, - 1.0, - -108.0, - -1.0, - -106.0, - -1.0, - -106.0, - 1.0, + -108.0, 1.0, -108.0, -1.0, -106.0, -1.0, -106.0, 1.0, ]); const p = PolygonOutlineGeometry.createGeometry( PolygonOutlineGeometry.fromPositions({ positions: positions, height: height, - }) + }), ); const bs = BoundingSphere.fromPoints( @@ -657,7 +494,7 @@ describe("Core/PolygonOutlineGeometry", function () { -106.0, 1.0, height, - ]) + ]), ); expect(Math.abs(p.boundingSphere.radius - bs.radius)).toBeLessThan(100.0); }); @@ -666,17 +503,10 @@ describe("Core/PolygonOutlineGeometry", function () { const p = PolygonOutlineGeometry.createGeometry( PolygonOutlineGeometry.fromPositions({ positions: Cartesian3.fromDegreesArray([ - -1.0, - -1.0, - 1.0, - -1.0, - 1.0, - 1.0, - -1.0, - 1.0, + -1.0, -1.0, 1.0, -1.0, 1.0, 1.0, -1.0, 1.0, ]), extrudedHeight: 30000, - }) + }), ); expect(p.attributes.position.values.length).toEqual(16 * 3); // 8 top + 8 bottom @@ -686,38 +516,17 @@ describe("Core/PolygonOutlineGeometry", function () { it("creates a polygon from hierarchy extruded", function () { const hierarchy = { positions: Cartesian3.fromDegreesArray([ - -124.0, - 35.0, - -110.0, - 35.0, - -110.0, - 40.0, - -124.0, - 40.0, + -124.0, 35.0, -110.0, 35.0, -110.0, 40.0, -124.0, 40.0, ]), holes: [ { positions: Cartesian3.fromDegreesArray([ - -122.0, - 36.0, - -122.0, - 39.0, - -112.0, - 39.0, - -112.0, - 36.0, + -122.0, 36.0, -122.0, 39.0, -112.0, 39.0, -112.0, 36.0, ]), holes: [ { positions: Cartesian3.fromDegreesArray([ - -120.0, - 36.5, - -114.0, - 36.5, - -114.0, - 38.5, - -120.0, - 38.5, + -120.0, 36.5, -114.0, 36.5, -114.0, 38.5, -120.0, 38.5, ]), }, ], @@ -730,7 +539,7 @@ describe("Core/PolygonOutlineGeometry", function () { polygonHierarchy: hierarchy, granularity: CesiumMath.PI_OVER_THREE, extrudedHeight: 30000, - }) + }), ); expect(p.attributes.position.values.length).toEqual(24 * 3); // 12 top + 12 bottom @@ -741,17 +550,10 @@ describe("Core/PolygonOutlineGeometry", function () { const p = PolygonOutlineGeometry.createGeometry( PolygonOutlineGeometry.fromPositions({ positions: Cartesian3.fromDegreesArray([ - -1.0, - -1.0, - 1.0, - -1.0, - 1.0, - 1.0, - -1.0, - 1.0, + -1.0, -1.0, 1.0, -1.0, 1.0, 1.0, -1.0, 1.0, ]), offsetAttribute: GeometryOffsetAttribute.TOP, - }) + }), ); const numVertices = 8; @@ -766,18 +568,11 @@ describe("Core/PolygonOutlineGeometry", function () { const p = PolygonOutlineGeometry.createGeometry( PolygonOutlineGeometry.fromPositions({ positions: Cartesian3.fromDegreesArray([ - -1.0, - -1.0, - 1.0, - -1.0, - 1.0, - 1.0, - -1.0, - 1.0, + -1.0, -1.0, 1.0, -1.0, 1.0, 1.0, -1.0, 1.0, ]), extrudedHeight: 30000, offsetAttribute: GeometryOffsetAttribute.TOP, - }) + }), ); const numVertices = 16; @@ -793,18 +588,11 @@ describe("Core/PolygonOutlineGeometry", function () { const p = PolygonOutlineGeometry.createGeometry( PolygonOutlineGeometry.fromPositions({ positions: Cartesian3.fromDegreesArray([ - -1.0, - -1.0, - 1.0, - -1.0, - 1.0, - 1.0, - -1.0, - 1.0, + -1.0, -1.0, 1.0, -1.0, 1.0, 1.0, -1.0, 1.0, ]), extrudedHeight: 30000, offsetAttribute: GeometryOffsetAttribute.ALL, - }) + }), ); const numVertices = 16; @@ -827,28 +615,13 @@ describe("Core/PolygonOutlineGeometry", function () { }); const positions = Cartesian3.fromDegreesArray([ - -124.0, - 35.0, - -110.0, - 35.0, - -110.0, - 40.0, + -124.0, 35.0, -110.0, 35.0, -110.0, 40.0, ]); const holePositions0 = Cartesian3.fromDegreesArray([ - -122.0, - 36.0, - -122.0, - 39.0, - -112.0, - 39.0, + -122.0, 36.0, -122.0, 39.0, -112.0, 39.0, ]); const holePositions1 = Cartesian3.fromDegreesArray([ - -120.0, - 36.5, - -114.0, - 36.5, - -114.0, - 38.5, + -120.0, 36.5, -114.0, 36.5, -114.0, 38.5, ]); const hierarchy = { positions: positions, @@ -883,7 +656,7 @@ describe("Core/PolygonOutlineGeometry", function () { packedInstance.push( Ellipsoid.WGS84.radii.x, Ellipsoid.WGS84.radii.y, - Ellipsoid.WGS84.radii.z + Ellipsoid.WGS84.radii.z, ); packedInstance.push( 0.0, @@ -893,7 +666,7 @@ describe("Core/PolygonOutlineGeometry", function () { 1.0, ArcType.GEODESIC, -1, - 44 + 44, ); createPackableSpecs(PolygonOutlineGeometry, polygon, packedInstance); }); diff --git a/packages/engine/Specs/Core/PolygonPipelineSpec.js b/packages/engine/Specs/Core/PolygonPipelineSpec.js index b39594523eca..9819f86e64c8 100644 --- a/packages/engine/Specs/Core/PolygonPipelineSpec.js +++ b/packages/engine/Specs/Core/PolygonPipelineSpec.js @@ -131,30 +131,7 @@ describe("Core/PolygonPipeline", function () { const indices = PolygonPipeline.triangulate(combinedPositions, [4]); expect(indices).toEqual([ - 0, - 4, - 7, - 5, - 4, - 0, - 3, - 0, - 7, - 5, - 0, - 1, - 2, - 3, - 7, - 6, - 5, - 1, - 2, - 7, - 6, - 6, - 1, - 2, + 0, 4, 7, 5, 4, 0, 3, 0, 7, 5, 0, 1, 2, 3, 7, 6, 5, 1, 2, 7, 6, 6, 1, 2, ]); }); @@ -182,48 +159,8 @@ describe("Core/PolygonPipeline", function () { const indices = PolygonPipeline.triangulate(combinedPositions, [4, 8]); expect(indices).toEqual([ - 0, - 8, - 11, - 0, - 4, - 7, - 5, - 4, - 0, - 3, - 0, - 11, - 8, - 0, - 7, - 5, - 0, - 1, - 2, - 3, - 11, - 9, - 8, - 7, - 6, - 5, - 1, - 2, - 11, - 10, - 9, - 7, - 6, - 6, - 1, - 2, - 2, - 10, - 9, - 9, - 6, - 2, + 0, 8, 11, 0, 4, 7, 5, 4, 0, 3, 0, 11, 8, 0, 7, 5, 0, 1, 2, 3, 11, 9, 8, + 7, 6, 5, 1, 2, 11, 10, 9, 7, 6, 6, 1, 2, 2, 10, 9, 9, 6, 2, ]); }); }); @@ -267,7 +204,7 @@ describe("Core/PolygonPipeline", function () { [], [1, 2, 3], undefined, - -1.0 + -1.0, ); }).toThrowDeveloperError(); }); @@ -284,7 +221,7 @@ describe("Core/PolygonPipeline", function () { positions, indices, undefined, - 60.0 + 60.0, ); expect(subdivision.attributes.position.values[0]).toEqual(0.0); @@ -308,7 +245,7 @@ describe("Core/PolygonPipeline", function () { new Cartesian3( 6377802.759444977, -58441.30561735455, - -29025.647900582237 + -29025.647900582237, ), new Cartesian3(6378137, 0, 0), new Cartesian3(6377802.759444977, 58441.30561735455, -29025.647900582237), @@ -318,54 +255,54 @@ describe("Core/PolygonPipeline", function () { const subdivision = PolygonPipeline.computeSubdivision( Ellipsoid.WGS84, positions, - indices + indices, ); expect(subdivision.attributes.position.values[0]).toEqual( - 6377802.759444977 + 6377802.759444977, ); expect(subdivision.attributes.position.values[1]).toEqual( - -58441.30561735455 + -58441.30561735455, ); expect(subdivision.attributes.position.values[2]).toEqual( - 29025.647900582237 + 29025.647900582237, ); expect(subdivision.attributes.position.values[3]).toEqual( - 6377802.759444977 + 6377802.759444977, ); expect(subdivision.attributes.position.values[4]).toEqual( - -58441.30561735455 + -58441.30561735455, ); expect(subdivision.attributes.position.values[5]).toEqual( - -29025.647900582237 + -29025.647900582237, ); expect(subdivision.attributes.position.values[6]).toEqual(6378137); expect(subdivision.attributes.position.values[7]).toEqual(0); expect(subdivision.attributes.position.values[8]).toEqual(0); expect(subdivision.attributes.position.values[9]).toEqual( - 6377802.759444977 + 6377802.759444977, ); expect(subdivision.attributes.position.values[10]).toEqual( - 58441.30561735455 + 58441.30561735455, ); expect(subdivision.attributes.position.values[11]).toEqual( - -29025.647900582237 + -29025.647900582237, ); expect(subdivision.attributes.position.values[12]).toEqual( - 6377802.759444977 + 6377802.759444977, ); expect(subdivision.attributes.position.values[13]).toEqual( - 58441.30561735455 + 58441.30561735455, ); expect(subdivision.attributes.position.values[14]).toEqual( - 29025.647900582237 + 29025.647900582237, ); expect(subdivision.attributes.position.values[15]).toEqual( - 6377802.759444977 + 6377802.759444977, ); expect(subdivision.attributes.position.values[16]).toEqual(0); expect(subdivision.attributes.position.values[17]).toEqual( - 29025.647900582237 + 29025.647900582237, ); expect(subdivision.indices[0]).toEqual(5); @@ -388,7 +325,7 @@ describe("Core/PolygonPipeline", function () { new Cartesian3( 6377802.759444977, -58441.30561735455, - -29025.647900582237 + -29025.647900582237, ), new Cartesian3(6378137, 0, 0), new Cartesian3(6377802.759444977, 58441.30561735455, -29025.647900582237), @@ -406,54 +343,54 @@ describe("Core/PolygonPipeline", function () { Ellipsoid.WGS84, positions, indices, - texcoords + texcoords, ); expect(subdivision.attributes.position.values[0]).toEqual( - 6377802.759444977 + 6377802.759444977, ); expect(subdivision.attributes.position.values[1]).toEqual( - -58441.30561735455 + -58441.30561735455, ); expect(subdivision.attributes.position.values[2]).toEqual( - 29025.647900582237 + 29025.647900582237, ); expect(subdivision.attributes.position.values[3]).toEqual( - 6377802.759444977 + 6377802.759444977, ); expect(subdivision.attributes.position.values[4]).toEqual( - -58441.30561735455 + -58441.30561735455, ); expect(subdivision.attributes.position.values[5]).toEqual( - -29025.647900582237 + -29025.647900582237, ); expect(subdivision.attributes.position.values[6]).toEqual(6378137); expect(subdivision.attributes.position.values[7]).toEqual(0); expect(subdivision.attributes.position.values[8]).toEqual(0); expect(subdivision.attributes.position.values[9]).toEqual( - 6377802.759444977 + 6377802.759444977, ); expect(subdivision.attributes.position.values[10]).toEqual( - 58441.30561735455 + 58441.30561735455, ); expect(subdivision.attributes.position.values[11]).toEqual( - -29025.647900582237 + -29025.647900582237, ); expect(subdivision.attributes.position.values[12]).toEqual( - 6377802.759444977 + 6377802.759444977, ); expect(subdivision.attributes.position.values[13]).toEqual( - 58441.30561735455 + 58441.30561735455, ); expect(subdivision.attributes.position.values[14]).toEqual( - 29025.647900582237 + 29025.647900582237, ); expect(subdivision.attributes.position.values[15]).toEqual( - 6377802.759444977 + 6377802.759444977, ); expect(subdivision.attributes.position.values[16]).toEqual(0); expect(subdivision.attributes.position.values[17]).toEqual( - 29025.647900582237 + 29025.647900582237, ); expect(subdivision.indices[0]).toEqual(5); @@ -513,7 +450,7 @@ describe("Core/PolygonPipeline", function () { PolygonPipeline.computeRhumbLineSubdivision( Ellipsoid.WGS84, [], - [1, 2, 3, 4] + [1, 2, 3, 4], ); }).toThrowDeveloperError(); }); @@ -525,7 +462,7 @@ describe("Core/PolygonPipeline", function () { [], [1, 2, 3], undefined, - -1.0 + -1.0, ); }).toThrowDeveloperError(); }); @@ -538,7 +475,7 @@ describe("Core/PolygonPipeline", function () { positions, indices, undefined, - 2 * CesiumMath.RADIANS_PER_DEGREE + 2 * CesiumMath.RADIANS_PER_DEGREE, ); expect(subdivision.attributes.position.values[0]).toEqual(positions[0].x); @@ -564,7 +501,7 @@ describe("Core/PolygonPipeline", function () { positions, indices, undefined, - 0.5 * CesiumMath.RADIANS_PER_DEGREE + 0.5 * CesiumMath.RADIANS_PER_DEGREE, ); expect(subdivision.attributes.position.values.length).toEqual(36); // 12 vertices @@ -579,7 +516,7 @@ describe("Core/PolygonPipeline", function () { positions, indices, undefined, - 0.5 * CesiumMath.RADIANS_PER_DEGREE + 0.5 * CesiumMath.RADIANS_PER_DEGREE, ); expect(subdivision.attributes.position.values.length).toEqual(180); // 60 vertices @@ -592,7 +529,7 @@ describe("Core/PolygonPipeline", function () { new Cartesian3( 6377802.759444977, -58441.30561735455, - -29025.647900582237 + -29025.647900582237, ), new Cartesian3(6378137, 0, 0), new Cartesian3(6377802.759444977, 58441.30561735455, -29025.647900582237), @@ -610,56 +547,56 @@ describe("Core/PolygonPipeline", function () { Ellipsoid.WGS84, positions, indices, - texcoords + texcoords, ); expect(subdivision.attributes.position.values[0]).toEqual( - 6377802.759444977 + 6377802.759444977, ); expect(subdivision.attributes.position.values[1]).toEqual( - -58441.30561735455 + -58441.30561735455, ); expect(subdivision.attributes.position.values[2]).toEqual( - 29025.647900582237 + 29025.647900582237, ); expect(subdivision.attributes.position.values[3]).toEqual( - 6377802.759444977 + 6377802.759444977, ); expect(subdivision.attributes.position.values[4]).toEqual( - -58441.30561735455 + -58441.30561735455, ); expect(subdivision.attributes.position.values[5]).toEqual( - -29025.647900582237 + -29025.647900582237, ); expect(subdivision.attributes.position.values[6]).toEqual(6378137); expect(subdivision.attributes.position.values[7]).toEqual(0); expect(subdivision.attributes.position.values[8]).toEqual(0); expect(subdivision.attributes.position.values[9]).toEqual( - 6377802.759444977 + 6377802.759444977, ); expect(subdivision.attributes.position.values[10]).toEqual( - 58441.30561735455 + 58441.30561735455, ); expect(subdivision.attributes.position.values[11]).toEqual( - -29025.647900582237 + -29025.647900582237, ); expect(subdivision.attributes.position.values[12]).toEqual( - 6377802.759444977 + 6377802.759444977, ); expect(subdivision.attributes.position.values[13]).toEqual( - 58441.30561735455 + 58441.30561735455, ); expect(subdivision.attributes.position.values[14]).toEqual( - 29025.647900582237 + 29025.647900582237, ); expect(subdivision.attributes.position.values[15]).toEqual( - 6378070.509533917 + 6378070.509533917, ); expect(subdivision.attributes.position.values[16]).toEqual( - 1.1064188644323841e-11 + 1.1064188644323841e-11, ); expect(subdivision.attributes.position.values[17]).toEqual( - 29025.64790058224 + 29025.64790058224, ); expect(subdivision.indices[0]).toEqual(5); diff --git a/packages/engine/Specs/Core/PolylineGeometrySpec.js b/packages/engine/Specs/Core/PolylineGeometrySpec.js index 46f0bf04b4d1..4cbbaac0309f 100644 --- a/packages/engine/Specs/Core/PolylineGeometrySpec.js +++ b/packages/engine/Specs/Core/PolylineGeometrySpec.js @@ -48,7 +48,7 @@ describe("Core/PolylineGeometry", function () { vertexFormat: VertexFormat.ALL, granularity: Math.PI, ellipsoid: Ellipsoid.UNIT_SPHERE, - }) + }), ); expect(line).toBeUndefined(); @@ -67,7 +67,7 @@ describe("Core/PolylineGeometry", function () { vertexFormat: VertexFormat.ALL, granularity: Math.PI, ellipsoid: Ellipsoid.UNIT_SPHERE, - }) + }), ); expect(line.attributes.position).toBeDefined(); @@ -81,7 +81,7 @@ describe("Core/PolylineGeometry", function () { expect(line.attributes.prevPosition.values.length).toEqual(numVertices * 3); expect(line.attributes.nextPosition.values.length).toEqual(numVertices * 3); expect(line.attributes.expandAndWidth.values.length).toEqual( - numVertices * 2 + numVertices * 2, ); expect(line.attributes.st.values.length).toEqual(numVertices * 2); expect(line.indices.length).toEqual(positions.length * 6 - 6); @@ -97,7 +97,7 @@ describe("Core/PolylineGeometry", function () { granularity: Math.PI, ellipsoid: Ellipsoid.UNIT_SPHERE, arcType: ArcType.RHUMB, - }) + }), ); expect(line.attributes.position).toBeDefined(); @@ -111,7 +111,7 @@ describe("Core/PolylineGeometry", function () { expect(line.attributes.prevPosition.values.length).toEqual(numVertices * 3); expect(line.attributes.nextPosition.values.length).toEqual(numVertices * 3); expect(line.attributes.expandAndWidth.values.length).toEqual( - numVertices * 2 + numVertices * 2, ); expect(line.attributes.st.values.length).toEqual(numVertices * 2); expect(line.indices.length).toEqual(positions.length * 6 - 6); @@ -136,7 +136,7 @@ describe("Core/PolylineGeometry", function () { vertexFormat: VertexFormat.ALL, granularity: Math.PI, ellipsoid: Ellipsoid.UNIT_SPHERE, - }) + }), ); expect(line.attributes.color).toBeDefined(); @@ -165,7 +165,7 @@ describe("Core/PolylineGeometry", function () { vertexFormat: VertexFormat.ALL, granularity: Math.PI, ellipsoid: Ellipsoid.UNIT_SPHERE, - }) + }), ); expect(line.attributes.color).toBeDefined(); @@ -184,19 +184,14 @@ describe("Core/PolylineGeometry", function () { width: 10.0, vertexFormat: VertexFormat.POSITION_ONLY, arcType: ArcType.NONE, - }) + }), ); expect(geometry).not.toBeDefined(); }); it("createGeometry returns positions if their endpoints'longtitude and latitude are the same for rhumb line", function () { const positions = Cartesian3.fromDegreesArrayHeights([ - 30.0, - 30.0, - 10.0, - 30.0, - 30.0, - 5.0, + 30.0, 30.0, 10.0, 30.0, 30.0, 5.0, ]); const geometry = PolylineGeometry.createGeometry( new PolylineGeometry({ @@ -204,7 +199,7 @@ describe("Core/PolylineGeometry", function () { width: 10.0, vertexFormat: VertexFormat.POSITION_ONLY, arcType: ArcType.RHUMB, - }) + }), ); const attributePositions = geometry.attributes.position.values; @@ -215,8 +210,8 @@ describe("Core/PolylineGeometry", function () { Cartesian3.equalsEpsilon( geometryPosition, positions[0], - CesiumMath.EPSILON7 - ) + CesiumMath.EPSILON7, + ), ).toBe(true); Cartesian3.fromArray(attributePositions, 3, geometryPosition); @@ -224,8 +219,8 @@ describe("Core/PolylineGeometry", function () { Cartesian3.equalsEpsilon( geometryPosition, positions[0], - CesiumMath.EPSILON7 - ) + CesiumMath.EPSILON7, + ), ).toBe(true); Cartesian3.fromArray(attributePositions, 6, geometryPosition); @@ -233,8 +228,8 @@ describe("Core/PolylineGeometry", function () { Cartesian3.equalsEpsilon( geometryPosition, positions[1], - CesiumMath.EPSILON7 - ) + CesiumMath.EPSILON7, + ), ).toBe(true); Cartesian3.fromArray(attributePositions, 9, geometryPosition); @@ -242,8 +237,8 @@ describe("Core/PolylineGeometry", function () { Cartesian3.equalsEpsilon( geometryPosition, positions[1], - CesiumMath.EPSILON7 - ) + CesiumMath.EPSILON7, + ), ).toBe(true); }); @@ -273,7 +268,7 @@ describe("Core/PolylineGeometry", function () { width: 10.0, vertexFormat: VertexFormat.POSITION_ONLY, arcType: ArcType.NONE, - }) + }), ); const numVertices = expectedPositions.length * 4 - 4; @@ -285,7 +280,7 @@ describe("Core/PolylineGeometry", function () { function attributeArrayEqualsColorArray( attributeArray, colorArray, - colorsPerVertex + colorsPerVertex, ) { colorsPerVertex = defaultValue(colorsPerVertex, false); let i; @@ -366,7 +361,7 @@ describe("Core/PolylineGeometry", function () { width: 10.0, vertexFormat: VertexFormat.POSITION_ONLY, arcType: ArcType.NONE, - }) + }), ); const numVertices = expectedPositions.length * 4 - 4; @@ -374,8 +369,8 @@ describe("Core/PolylineGeometry", function () { expect( attributeArrayEqualsColorArray( line.attributes.color.values, - expectedColors - ) + expectedColors, + ), ).toBe(true); }); @@ -430,7 +425,7 @@ describe("Core/PolylineGeometry", function () { width: 10.0, vertexFormat: VertexFormat.DEFAULT, arcType: ArcType.NONE, - }) + }), ); const numVertices = expectedPositions.length * 4 - 4; @@ -439,8 +434,8 @@ describe("Core/PolylineGeometry", function () { attributeArrayEqualsColorArray( line.attributes.color.values, expectedColors, - true - ) + true, + ), ).toBe(true); }); @@ -479,7 +474,7 @@ describe("Core/PolylineGeometry", function () { width: 10.0, vertexFormat: VertexFormat.DEFAULT, arcType: ArcType.NONE, - }) + }), ); const numVertices = expectedPositions.length * 4 - 4; @@ -488,8 +483,8 @@ describe("Core/PolylineGeometry", function () { attributeArrayEqualsColorArray( line.attributes.color.values, expectedColors, - true - ) + true, + ), ).toBe(true); }); @@ -509,48 +504,14 @@ describe("Core/PolylineGeometry", function () { ellipsoid: new Ellipsoid(12, 13, 14), }); let packedInstance = [ - 3, - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 3, - 1, - 0, - 0, - 1, - 0, - 1, - 0, - 1, - 0, - 0, - 1, - 1, - 12, - 13, - 14, - 1, - 0, - 0, - 0, - 0, - 0, - 10, - 1, - 0, - 11, + 3, 1, 2, 3, 4, 5, 6, 7, 8, 9, 3, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 12, 13, + 14, 1, 0, 0, 0, 0, 0, 10, 1, 0, 11, ]; createPackableSpecs( PolylineGeometry, line, packedInstance, - "per vertex colors" + "per vertex colors", ); line = new PolylineGeometry({ @@ -563,30 +524,7 @@ describe("Core/PolylineGeometry", function () { ellipsoid: new Ellipsoid(12, 13, 14), }); packedInstance = [ - 3, - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 0, - 12, - 13, - 14, - 1, - 0, - 0, - 0, - 0, - 0, - 10, - 0, - 0, - 11, + 3, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 12, 13, 14, 1, 0, 0, 0, 0, 0, 10, 0, 0, 11, ]; createPackableSpecs(PolylineGeometry, line, packedInstance, "straight line"); @@ -600,30 +538,7 @@ describe("Core/PolylineGeometry", function () { ellipsoid: new Ellipsoid(12, 13, 14), }); packedInstance = [ - 3, - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 0, - 12, - 13, - 14, - 1, - 0, - 0, - 0, - 0, - 0, - 10, - 0, - 1, - 11, + 3, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 12, 13, 14, 1, 0, 0, 0, 0, 0, 10, 0, 1, 11, ]; createPackableSpecs(PolylineGeometry, line, packedInstance, "geodesic line"); @@ -637,30 +552,7 @@ describe("Core/PolylineGeometry", function () { ellipsoid: new Ellipsoid(12, 13, 14), }); packedInstance = [ - 3, - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 0, - 12, - 13, - 14, - 1, - 0, - 0, - 0, - 0, - 0, - 10, - 0, - 2, - 11, + 3, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 12, 13, 14, 1, 0, 0, 0, 0, 0, 10, 0, 2, 11, ]; createPackableSpecs(PolylineGeometry, line, packedInstance, "rhumb line"); }); diff --git a/packages/engine/Specs/Core/PolylinePipelineSpec.js b/packages/engine/Specs/Core/PolylinePipelineSpec.js index 2c8d62b014e1..25f3790aeaef 100644 --- a/packages/engine/Specs/Core/PolylinePipelineSpec.js +++ b/packages/engine/Specs/Core/PolylinePipelineSpec.js @@ -9,10 +9,7 @@ import { describe("Core/PolylinePipeline", function () { it("wrapLongitude", function () { const positions = Cartesian3.fromDegreesArray([ - -75.163789, - 39.952335, - -80.2264393, - 25.7889689, + -75.163789, 39.952335, -80.2264393, 25.7889689, ]); const segments = PolylinePipeline.wrapLongitude(positions); expect(segments.lengths.length).toEqual(1); @@ -64,7 +61,7 @@ describe("Core/PolylinePipeline", function () { expect(newPositions.length).toEqual(3); expect(Cartesian3.fromArray(newPositions, 0)).toEqualEpsilon( Cartesian3.fromDegrees(0, 0, 30), - CesiumMath.EPSILON6 + CesiumMath.EPSILON6, ); }); @@ -85,13 +82,13 @@ describe("Core/PolylinePipeline", function () { const p3n = Cartesian3.fromArray(newPositions, 3); const p2n = Cartesian3.fromArray(newPositions, 6); expect(Cartesian3.equalsEpsilon(p1, p1n, CesiumMath.EPSILON4)).toEqual( - true + true, ); expect(Cartesian3.equalsEpsilon(p2, p2n, CesiumMath.EPSILON4)).toEqual( - true + true, ); expect(Cartesian3.equalsEpsilon(p3, p3n, CesiumMath.EPSILON4)).toEqual( - true + true, ); }); @@ -131,7 +128,7 @@ describe("Core/PolylinePipeline", function () { expect(newPositions.length).toEqual(3); expect(Cartesian3.fromArray(newPositions, 0)).toEqualEpsilon( Cartesian3.fromDegrees(0, 0, 30), - CesiumMath.EPSILON6 + CesiumMath.EPSILON6, ); }); @@ -152,13 +149,13 @@ describe("Core/PolylinePipeline", function () { const p3n = Cartesian3.fromArray(newPositions, 3); const p2n = Cartesian3.fromArray(newPositions, 6); expect(Cartesian3.equalsEpsilon(p1, p1n, CesiumMath.EPSILON4)).toEqual( - true + true, ); expect(Cartesian3.equalsEpsilon(p2, p2n, CesiumMath.EPSILON4)).toEqual( - true + true, ); expect(Cartesian3.equalsEpsilon(p3, p3n, CesiumMath.EPSILON4)).toEqual( - true + true, ); }); diff --git a/packages/engine/Specs/Core/PolylineVolumeGeometrySpec.js b/packages/engine/Specs/Core/PolylineVolumeGeometrySpec.js index a78a3b3f02d3..4f3fdb5fd4e7 100644 --- a/packages/engine/Specs/Core/PolylineVolumeGeometrySpec.js +++ b/packages/engine/Specs/Core/PolylineVolumeGeometrySpec.js @@ -40,7 +40,7 @@ describe("Core/PolylineVolumeGeometry", function () { new PolylineVolumeGeometry({ polylinePositions: [new Cartesian3()], shapePositions: shape, - }) + }), ); expect(geometry).toBeUndefined(); }); @@ -54,7 +54,7 @@ describe("Core/PolylineVolumeGeometry", function () { Cartesian2.UNIT_X, Cartesian2.UNIT_X, ], - }) + }), ); expect(geometry).toBeUndefined(); }); @@ -64,14 +64,11 @@ describe("Core/PolylineVolumeGeometry", function () { new PolylineVolumeGeometry({ vertexFormat: VertexFormat.POSITION_ONLY, polylinePositions: Cartesian3.fromDegreesArray([ - 90.0, - -30.0, - 90.0, - -35.0, + 90.0, -30.0, 90.0, -35.0, ]), cornerType: CornerType.MITERED, shapePositions: shape, - }) + }), ); // 6 positions * 4 box positions * 2 to duplicate for normals + 4 positions * 2 ends @@ -85,14 +82,11 @@ describe("Core/PolylineVolumeGeometry", function () { new PolylineVolumeGeometry({ vertexFormat: VertexFormat.POSITION_ONLY, polylinePositions: Cartesian3.fromDegreesArray([ - 90.0, - -30.0, - 90.0, - -35.0, + 90.0, -30.0, 90.0, -35.0, ]), cornerType: CornerType.MITERED, shapePositions: shape.reverse(), - }) + }), ); expect(m.attributes.position.values.length).toEqual(56 * 3); @@ -104,14 +98,11 @@ describe("Core/PolylineVolumeGeometry", function () { new PolylineVolumeGeometry({ vertexFormat: VertexFormat.POSITION_NORMAL_AND_ST, polylinePositions: Cartesian3.fromDegreesArray([ - 90.0, - -30.0, - 90.0, - -35.0, + 90.0, -30.0, 90.0, -35.0, ]), cornerType: CornerType.MITERED, shapePositions: shape, - }) + }), ); const numVertices = 56; @@ -128,14 +119,11 @@ describe("Core/PolylineVolumeGeometry", function () { new PolylineVolumeGeometry({ vertexFormat: VertexFormat.ALL, polylinePositions: Cartesian3.fromDegreesArray([ - 90.0, - -30.0, - 90.0, - -35.0, + 90.0, -30.0, 90.0, -35.0, ]), cornerType: CornerType.MITERED, shapePositions: shape, - }) + }), ); const numVertices = 56; @@ -153,16 +141,11 @@ describe("Core/PolylineVolumeGeometry", function () { new PolylineVolumeGeometry({ vertexFormat: VertexFormat.POSITION_ONLY, polylinePositions: Cartesian3.fromDegreesArray([ - 90.0, - -30.0, - 90.0, - -31.0, - 91.0, - -31.0, + 90.0, -30.0, 90.0, -31.0, 91.0, -31.0, ]), cornerType: CornerType.MITERED, shapePositions: shape, - }) + }), ); // (3 duplicates * 2 ends + 2 duplicates * 2 middle points + 4 duplicates * 1 corner) * 4 box positions @@ -176,16 +159,11 @@ describe("Core/PolylineVolumeGeometry", function () { new PolylineVolumeGeometry({ vertexFormat: VertexFormat.POSITION_ONLY, polylinePositions: Cartesian3.fromDegreesArray([ - 90.0, - -30.0, - 90.0, - -31.0, - 89.0, - -31.0, + 90.0, -30.0, 90.0, -31.0, 89.0, -31.0, ]), cornerType: CornerType.MITERED, shapePositions: shape, - }) + }), ); expect(m.attributes.position.values.length).toEqual(56 * 3); @@ -197,18 +175,11 @@ describe("Core/PolylineVolumeGeometry", function () { new PolylineVolumeGeometry({ vertexFormat: VertexFormat.POSITION_ONLY, polylinePositions: Cartesian3.fromDegreesArray([ - 90.0, - -30.0, - 90.0, - -31.0, - 89.0, - -31.0, - 89.0, - -32.0, + 90.0, -30.0, 90.0, -31.0, 89.0, -31.0, 89.0, -32.0, ]), cornerType: CornerType.ROUNDED, shapePositions: shape, - }) + }), ); const corners = 36 * 4 * 4; // positions * 4 for shape * 4 for normal duplication @@ -223,18 +194,11 @@ describe("Core/PolylineVolumeGeometry", function () { new PolylineVolumeGeometry({ vertexFormat: VertexFormat.POSITION_ONLY, polylinePositions: Cartesian3.fromDegreesArray([ - 90.0, - -30.0, - 90.0, - -31.0, - 89.0, - -31.0, - 89.0, - -32.0, + 90.0, -30.0, 90.0, -31.0, 89.0, -31.0, 89.0, -32.0, ]), cornerType: CornerType.BEVELED, shapePositions: shape, - }) + }), ); const corners = 4 * 4; // 4 for shape * 4 for normal duplication @@ -249,25 +213,14 @@ describe("Core/PolylineVolumeGeometry", function () { new PolylineVolumeGeometry({ vertexFormat: VertexFormat.POSITION_ONLY, polylinePositions: Cartesian3.fromDegreesArrayHeights([ - 2.00571672577652, - 52.7781459942399, - 500, - 1.99188457974115, - 52.7764958852886, - 500, - 2.01325961458495, - 52.7674170680511, - 500, - 1.98708058340534, - 52.7733979856253, - 500, - 2.00634853946644, - 52.7650460748473, - 500, + 2.00571672577652, 52.7781459942399, 500, 1.99188457974115, + 52.7764958852886, 500, 2.01325961458495, 52.7674170680511, 500, + 1.98708058340534, 52.7733979856253, 500, 2.00634853946644, + 52.7650460748473, 500, ]), cornerType: CornerType.BEVELED, shapePositions: shape, - }) + }), ); // (8 positions * 3 duplications + 1 duplication * 6 corners) * 4 for shape @@ -281,17 +234,12 @@ describe("Core/PolylineVolumeGeometry", function () { new PolylineVolumeGeometry({ vertexFormat: VertexFormat.POSITION_ONLY, polylinePositions: Cartesian3.fromDegreesArray([ - -67.655, - 0.0, - -67.655, - 15.0, - -67.655, - 20.0, + -67.655, 0.0, -67.655, 15.0, -67.655, 20.0, ]), cornerType: CornerType.BEVELED, shapePositions: shape, granularity: Math.PI / 6.0, - }) + }), ); expect(m.attributes.position.values.length).toEqual(32 * 3); // 4 positions * 2 for duplication * 4 for shape @@ -317,34 +265,8 @@ describe("Core/PolylineVolumeGeometry", function () { granularity: 0.1, }); const packedInstance = [ - 3.0, - 1.0, - 0.0, - 0.0, - 0.0, - 1.0, - 0.0, - 0.0, - 0.0, - 1.0, - 3.0, - 0.0, - 0.0, - 1.0, - 0.0, - 0.0, - 1.0, - 1.0, - 1.0, - 1.0, - 1.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 2.0, - 0.1, + 3.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 3.0, 0.0, 0.0, 1.0, 0.0, + 0.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.1, ]; createPackableSpecs(PolylineVolumeGeometry, volume, packedInstance); }); diff --git a/packages/engine/Specs/Core/PolylineVolumeOutlineGeometrySpec.js b/packages/engine/Specs/Core/PolylineVolumeOutlineGeometrySpec.js index f887fc86a97f..e5b4fd46b27f 100644 --- a/packages/engine/Specs/Core/PolylineVolumeOutlineGeometrySpec.js +++ b/packages/engine/Specs/Core/PolylineVolumeOutlineGeometrySpec.js @@ -39,7 +39,7 @@ describe("Core/PolylineVolumeOutlineGeometry", function () { new PolylineVolumeOutlineGeometry({ polylinePositions: [new Cartesian3()], shapePositions: shape, - }) + }), ); expect(geometry).toBeUndefined(); }); @@ -53,7 +53,7 @@ describe("Core/PolylineVolumeOutlineGeometry", function () { Cartesian2.UNIT_X, Cartesian2.UNIT_X, ], - }) + }), ); expect(geometry).toBeUndefined(); }); @@ -62,14 +62,11 @@ describe("Core/PolylineVolumeOutlineGeometry", function () { const m = PolylineVolumeOutlineGeometry.createGeometry( new PolylineVolumeOutlineGeometry({ polylinePositions: Cartesian3.fromDegreesArray([ - 90.0, - -30.0, - 90.0, - -35.0, + 90.0, -30.0, 90.0, -35.0, ]), shapePositions: shape, cornerType: CornerType.MITERED, - }) + }), ); expect(m.attributes.position.values.length).toEqual(24 * 3); // 6 polyline positions * 4 box positions @@ -80,14 +77,11 @@ describe("Core/PolylineVolumeOutlineGeometry", function () { const m = PolylineVolumeOutlineGeometry.createGeometry( new PolylineVolumeOutlineGeometry({ polylinePositions: Cartesian3.fromDegreesArray([ - 90.0, - -30.0, - 90.0, - -35.0, + 90.0, -30.0, 90.0, -35.0, ]), shapePositions: shape.reverse(), cornerType: CornerType.MITERED, - }) + }), ); expect(m.attributes.position.values.length).toEqual(24 * 3); @@ -98,16 +92,11 @@ describe("Core/PolylineVolumeOutlineGeometry", function () { const m = PolylineVolumeOutlineGeometry.createGeometry( new PolylineVolumeOutlineGeometry({ polylinePositions: Cartesian3.fromDegreesArray([ - 90.0, - -30.0, - 90.0, - -31.0, - 91.0, - -31.0, + 90.0, -30.0, 90.0, -31.0, 91.0, -31.0, ]), cornerType: CornerType.MITERED, shapePositions: shape, - }) + }), ); expect(m.attributes.position.values.length).toEqual(20 * 3); // (2 ends + 3 corner positions) * 4 box positions @@ -118,16 +107,11 @@ describe("Core/PolylineVolumeOutlineGeometry", function () { const m = PolylineVolumeOutlineGeometry.createGeometry( new PolylineVolumeOutlineGeometry({ polylinePositions: Cartesian3.fromDegreesArray([ - 90.0, - -30.0, - 90.0, - -31.0, - 89.0, - -31.0, + 90.0, -30.0, 90.0, -31.0, 89.0, -31.0, ]), cornerType: CornerType.MITERED, shapePositions: shape, - }) + }), ); expect(m.attributes.position.values.length).toEqual(20 * 3); @@ -138,18 +122,11 @@ describe("Core/PolylineVolumeOutlineGeometry", function () { const m = PolylineVolumeOutlineGeometry.createGeometry( new PolylineVolumeOutlineGeometry({ polylinePositions: Cartesian3.fromDegreesArray([ - 90.0, - -30.0, - 90.0, - -31.0, - 89.0, - -31.0, - 89.0, - -32.0, + 90.0, -30.0, 90.0, -31.0, 89.0, -31.0, 89.0, -32.0, ]), cornerType: CornerType.ROUNDED, shapePositions: shape, - }) + }), ); const corners = 36 * 4; @@ -163,18 +140,11 @@ describe("Core/PolylineVolumeOutlineGeometry", function () { const m = PolylineVolumeOutlineGeometry.createGeometry( new PolylineVolumeOutlineGeometry({ polylinePositions: Cartesian3.fromDegreesArray([ - 90.0, - -30.0, - 90.0, - -31.0, - 89.0, - -31.0, - 89.0, - -32.0, + 90.0, -30.0, 90.0, -31.0, 89.0, -31.0, 89.0, -32.0, ]), cornerType: CornerType.BEVELED, shapePositions: shape, - }) + }), ); expect(m.attributes.position.values.length).toEqual(40 * 3); // 10 positions * 4 for shape @@ -199,28 +169,8 @@ describe("Core/PolylineVolumeOutlineGeometry", function () { granularity: 0.1, }); const packedInstance = [ - 3.0, - 1.0, - 0.0, - 0.0, - 0.0, - 1.0, - 0.0, - 0.0, - 0.0, - 1.0, - 3.0, - 0.0, - 0.0, - 1.0, - 0.0, - 0.0, - 1.0, - 1.0, - 1.0, - 1.0, - 2.0, - 0.1, + 3.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 3.0, 0.0, 0.0, 1.0, 0.0, + 0.0, 1.0, 1.0, 1.0, 1.0, 2.0, 0.1, ]; createPackableSpecs(PolylineVolumeOutlineGeometry, volume, packedInstance); }); diff --git a/packages/engine/Specs/Core/QuadraticRealPolynomialSpec.js b/packages/engine/Specs/Core/QuadraticRealPolynomialSpec.js index 283e769fab98..bcddbf851244 100644 --- a/packages/engine/Specs/Core/QuadraticRealPolynomialSpec.js +++ b/packages/engine/Specs/Core/QuadraticRealPolynomialSpec.js @@ -23,7 +23,7 @@ describe("Core/QuadraticRealPolynomial", function () { const discriminant = QuadraticRealPolynomial.computeDiscriminant( 1.0, 2.0, - 3.0 + 3.0, ); expect(discriminant).toEqual(-8.0); }); @@ -64,7 +64,7 @@ describe("Core/QuadraticRealPolynomial", function () { const roots = QuadraticRealPolynomial.computeRealRoots( 2.0, -3.999999999999999, - 2 + 2, ); expect(roots.length).toEqual(2); expect(roots[0]).toEqualEpsilon(1.0, CesiumMath.EPSILON15); diff --git a/packages/engine/Specs/Core/QuantizedMeshTerrainDataSpec.js b/packages/engine/Specs/Core/QuantizedMeshTerrainDataSpec.js index 11097df0680f..0706bc4688dd 100644 --- a/packages/engine/Specs/Core/QuantizedMeshTerrainDataSpec.js +++ b/packages/engine/Specs/Core/QuantizedMeshTerrainDataSpec.js @@ -46,13 +46,13 @@ describe("Core/QuantizedMeshTerrainData", function () { interceptCoordinate1, interceptCoordinate2, otherCoordinate1, - otherCoordinate2 + otherCoordinate2, ) { return CesiumMath.lerp( otherCoordinate1, otherCoordinate2, (0.5 - interceptCoordinate1) / - (interceptCoordinate2 - interceptCoordinate1) + (interceptCoordinate2 - interceptCoordinate1), ); } @@ -103,7 +103,7 @@ describe("Core/QuantizedMeshTerrainData", function () { const tilingScheme = new GeographicTilingScheme(); return Promise.resolve( - data.createMesh({ tilingScheme: tilingScheme, x: 0, y: 0, level: 0 }) + data.createMesh({ tilingScheme: tilingScheme, x: 0, y: 0, level: 0 }), ) .then(function () { const swPromise = data.upsample(tilingScheme, 0, 0, 0, 0, 0, 1); @@ -199,7 +199,7 @@ describe("Core/QuantizedMeshTerrainData", function () { const tilingScheme = new GeographicTilingScheme(); return Promise.resolve( - data.createMesh({ tilingScheme: tilingScheme, x: 0, y: 0, level: 0 }) + data.createMesh({ tilingScheme: tilingScheme, x: 0, y: 0, level: 0 }), ) .then(function () { const swPromise = data.upsample(tilingScheme, 0, 0, 0, 0, 0, 1); @@ -268,7 +268,7 @@ describe("Core/QuantizedMeshTerrainData", function () { const tilingScheme = new GeographicTilingScheme(); return Promise.resolve( - data.createMesh({ tilingScheme: tilingScheme, x: 0, y: 0, level: 0 }) + data.createMesh({ tilingScheme: tilingScheme, x: 0, y: 0, level: 0 }), ) .then(function () { return data.upsample(tilingScheme, 0, 0, 0, 0, 0, 1); @@ -297,7 +297,7 @@ describe("Core/QuantizedMeshTerrainData", function () { uBuffer, vBuffer, horizontalIntercept(0.0, 0.0, 0.125, 0.75) * 2.0, - 0.0 + 0.0, ); expect(v40).not.toBe(-1); const v42 = findVertexWithCoordinates( @@ -307,23 +307,23 @@ describe("Core/QuantizedMeshTerrainData", function () { 0.5, verticalIntercept(1.0, 0.0, 0.125, 0.75), 0.125, - 0.75 + 0.75, ) * 2.0, - 0.0 + 0.0, ); expect(v42).not.toBe(-1); const v402 = findVertexWithCoordinates( uBuffer, vBuffer, horizontalIntercept(0.5, 0.0, 0.125, 0.75) * 2.0, - 0.0 + 0.0, ); expect(v402).not.toBe(-1); const v43 = findVertexWithCoordinates( uBuffer, vBuffer, 1.0, - verticalIntercept(1.0, 1.0, 0.125, 0.75) * 2.0 - 1.0 + verticalIntercept(1.0, 1.0, 0.125, 0.75) * 2.0 - 1.0, ); expect(v43).not.toBe(-1); @@ -379,7 +379,7 @@ describe("Core/QuantizedMeshTerrainData", function () { const tilingScheme = new GeographicTilingScheme(); return Promise.resolve( - data.createMesh({ tilingScheme: tilingScheme, x: 0, y: 0, level: 0 }) + data.createMesh({ tilingScheme: tilingScheme, x: 0, y: 0, level: 0 }), ) .then(function () { const nwPromise = data.upsample(tilingScheme, 0, 0, 0, 0, 0, 1); @@ -421,7 +421,7 @@ describe("Core/QuantizedMeshTerrainData", function () { uBuffer, vBuffer, horizontalIntercept(0.0, 0.0, 0.5, 0.75) * 2.0, - 0.0 + 0.0, ); expect(v40).not.toBe(-1); expect(upsampleResults[0]._westIndices.length).toBe(2); @@ -438,7 +438,7 @@ describe("Core/QuantizedMeshTerrainData", function () { uBuffer, vBuffer, horizontalIntercept(1.0, 0.0, 0.5, 0.75) * 0.5, - 0.0 + 0.0, ); expect(v42).not.toBe(-1); expect(upsampleResults[1]._westIndices.length).toBe(3); @@ -566,7 +566,7 @@ describe("Core/QuantizedMeshTerrainData", function () { expect(mesh.minimumHeight).toBe(data._minimumHeight); expect(mesh.maximumHeight).toBe(data._maximumHeight); expect(mesh.boundingSphere3D.radius).toBe( - data._boundingSphere.radius + data._boundingSphere.radius, ); expect(mesh.encoding.exaggeration).toBe(2.0); }); @@ -700,7 +700,7 @@ describe("Core/QuantizedMeshTerrainData", function () { }); expect(mesh.interpolateHeight(rectangle, 0.0, 0.0)).toBe( - mesh.interpolateHeight(rectangle, rectangle.east, rectangle.south) + mesh.interpolateHeight(rectangle, rectangle.east, rectangle.south), ); }); @@ -713,20 +713,11 @@ describe("Core/QuantizedMeshTerrainData", function () { quantizedVertices: new Uint16Array([ // order is sw nw se ne // u - 0, - 0, - 32767, - 32767, + 0, 0, 32767, 32767, // v - 0, - 32767, - 0, - 32767, + 0, 32767, 0, 32767, // heights - 16384, - 0, - 32767, - 16384, + 16384, 0, 32767, 16384, ]), indices: new Uint16Array([0, 3, 1, 0, 2, 3]), boundingSphere: new BoundingSphere(), @@ -776,20 +767,11 @@ describe("Core/QuantizedMeshTerrainData", function () { quantizedVertices: new Uint16Array([ // order is sw nw se ne // u - 0, - 0, - 32767, - 32767, + 0, 0, 32767, 32767, // v - 0, - 32767, - 0, - 32767, + 0, 32767, 0, 32767, // heights - 16384, - 0, - 32767, - 16384, + 16384, 0, 32767, 16384, ]), indices: new Uint16Array([0, 3, 1, 0, 2, 3]), boundingSphere: new BoundingSphere(), @@ -837,20 +819,11 @@ describe("Core/QuantizedMeshTerrainData", function () { quantizedVertices: new Uint16Array([ // order is sw nw se ne // u - 0, - 0, - 32767, - 32767, + 0, 0, 32767, 32767, // v - 0, - 32767, - 0, - 32767, + 0, 32767, 0, 32767, // heights - 16384, - 0, - 32767, - 16384, + 16384, 0, 32767, 16384, ]), indices: new Uint16Array([0, 3, 1, 0, 2, 3]), boundingSphere: new BoundingSphere(), @@ -878,20 +851,11 @@ describe("Core/QuantizedMeshTerrainData", function () { quantizedVertices: new Uint16Array([ // order is sw nw se ne // u - 0, - 0, - 32767, - 32767, + 0, 0, 32767, 32767, // v - 0, - 32767, - 0, - 32767, + 0, 32767, 0, 32767, // heights - 16384, - 0, - 32767, - 16384, + 16384, 0, 32767, 16384, ]), indices: new Uint16Array([0, 3, 1, 0, 2, 3]), boundingSphere: new BoundingSphere(), @@ -920,20 +884,11 @@ describe("Core/QuantizedMeshTerrainData", function () { quantizedVertices: new Uint16Array([ // order is sw nw se ne // u - 0, - 0, - 32767, - 32767, + 0, 0, 32767, 32767, // v - 0, - 32767, - 0, - 32767, + 0, 32767, 0, 32767, // heights - 16384, - 0, - 32767, - 16384, + 16384, 0, 32767, 16384, ]), indices: new Uint16Array([0, 3, 1, 0, 2, 3]), boundingSphere: new BoundingSphere(), @@ -962,20 +917,11 @@ describe("Core/QuantizedMeshTerrainData", function () { quantizedVertices: new Uint16Array([ // order is sw nw se ne // u - 0, - 0, - 32767, - 32767, + 0, 0, 32767, 32767, // v - 0, - 32767, - 0, - 32767, + 0, 32767, 0, 32767, // heights - 16384, - 0, - 32767, - 16384, + 16384, 0, 32767, 16384, ]), indices: new Uint16Array([0, 3, 1, 0, 2, 3]), boundingSphere: new BoundingSphere(), @@ -1004,20 +950,11 @@ describe("Core/QuantizedMeshTerrainData", function () { quantizedVertices: new Uint16Array([ // order is sw nw se ne // u - 0, - 0, - 32767, - 32767, + 0, 0, 32767, 32767, // v - 0, - 32767, - 0, - 32767, + 0, 32767, 0, 32767, // heights - 16384, - 0, - 32767, - 16384, + 16384, 0, 32767, 16384, ]), indices: new Uint16Array([0, 3, 1, 0, 2, 3]), boundingSphere: new BoundingSphere(), diff --git a/packages/engine/Specs/Core/QuarticRealPolynomialSpec.js b/packages/engine/Specs/Core/QuarticRealPolynomialSpec.js index ff3259814cfd..30c1594c6c2f 100644 --- a/packages/engine/Specs/Core/QuarticRealPolynomialSpec.js +++ b/packages/engine/Specs/Core/QuarticRealPolynomialSpec.js @@ -108,7 +108,7 @@ describe("Core/QuarticRealPolynomial", function () { -16.0, 48.0, -64.0, - 32.0 + 32.0, ); expect(roots.length).toEqual(4); expect(roots[0]).toEqualEpsilon(2.0, CesiumMath.EPSILON15); @@ -123,7 +123,7 @@ describe("Core/QuarticRealPolynomial", function () { 0.0, -4.0, 0.0, - 2.0 + 2.0, ); expect(roots.length).toEqual(4); expect(roots[0]).toEqualEpsilon(-1.0, CesiumMath.EPSILON15); @@ -138,7 +138,7 @@ describe("Core/QuarticRealPolynomial", function () { -8.0, 16.0, -16.0, - 6.0 + 6.0, ); expect(roots.length).toEqual(2); expect(roots[0]).toEqualEpsilon(1.0, CesiumMath.EPSILON14); @@ -151,7 +151,7 @@ describe("Core/QuarticRealPolynomial", function () { 8.0, -6.0, -20.0, - 16.0 + 16.0, ); expect(roots.length).toEqual(4); expect(roots[0]).toEqualEpsilon(-4.0, CesiumMath.EPSILON15); @@ -166,7 +166,7 @@ describe("Core/QuarticRealPolynomial", function () { 4.0, -26.0, -28.0, - 48.0 + 48.0, ); expect(roots.length).toEqual(4); expect(roots[0]).toEqualEpsilon(-4.0, CesiumMath.EPSILON15); @@ -181,7 +181,7 @@ describe("Core/QuarticRealPolynomial", function () { -8.0, 14.0, -8.0, - 3.0 + 3.0, ); expect(roots.length).toEqual(0); }); @@ -192,7 +192,7 @@ describe("Core/QuarticRealPolynomial", function () { 2.0, 6.0, -26.0, - -30.0 + -30.0, ); expect(roots.length).toEqual(3); expect(roots[0]).toEqualEpsilon(-5.0, CesiumMath.EPSILON15); diff --git a/packages/engine/Specs/Core/QuaternionSpec.js b/packages/engine/Specs/Core/QuaternionSpec.js index b5186d4e1eeb..a9b103647518 100644 --- a/packages/engine/Specs/Core/QuaternionSpec.js +++ b/packages/engine/Specs/Core/QuaternionSpec.js @@ -52,36 +52,36 @@ describe("Core/Quaternion", function () { it("fromRotationMatrix works when m22 is max", function () { const q = Quaternion.fromAxisAngle( Cartesian3.negate(Cartesian3.UNIT_Z, new Cartesian3()), - Math.PI + Math.PI, ); const rotation = new Matrix3(-1.0, 0.0, 0.0, 0.0, -1.0, 0.0, 0.0, 0.0, 1.0); expect(Quaternion.fromRotationMatrix(rotation)).toEqualEpsilon( q, - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); }); it("fromRotationMatrix works when m11 is max", function () { const q = Quaternion.fromAxisAngle( Cartesian3.negate(Cartesian3.UNIT_Y, new Cartesian3()), - Math.PI + Math.PI, ); const rotation = new Matrix3(-1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, -1.0); expect(Quaternion.fromRotationMatrix(rotation)).toEqualEpsilon( q, - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); }); it("fromRotationMatrix works when m00 is max", function () { const q = Quaternion.fromAxisAngle( Cartesian3.negate(Cartesian3.UNIT_X, new Cartesian3()), - Math.PI + Math.PI, ); const rotation = new Matrix3(1.0, 0.0, 0.0, 0.0, -1.0, 0.0, 0.0, 0.0, -1.0); expect(Quaternion.fromRotationMatrix(rotation)).toEqualEpsilon( q, - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); }); @@ -90,7 +90,7 @@ describe("Core/Quaternion", function () { const q = new Quaternion(0.0, 0.0, 0.0, 1.0); expect(Quaternion.fromRotationMatrix(rotation)).toEqualEpsilon( q, - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); }); @@ -107,17 +107,17 @@ describe("Core/Quaternion", function () { const direction = new Cartesian3( -0.2349326833984488, 0.8513513009480378, - 0.46904967396353314 + 0.46904967396353314, ); const up = new Cartesian3( 0.12477198625717335, -0.4521499177166376, - 0.8831717858696695 + 0.8831717858696695, ); const right = new Cartesian3( 0.9639702203483635, 0.26601017702986895, - 6.456422901079747e-10 + 6.456422901079747e-10, ); const matrix = new Matrix3( right.x, @@ -128,12 +128,12 @@ describe("Core/Quaternion", function () { up.z, -direction.x, -direction.y, - -direction.z + -direction.z, ); const quaternion = Quaternion.fromRotationMatrix(matrix); expect(Matrix3.fromQuaternion(quaternion)).toEqualEpsilon( matrix, - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); }); @@ -143,7 +143,7 @@ describe("Core/Quaternion", function () { const quaternion = Quaternion.fromHeadingPitchRoll(hpr); expect(Matrix3.fromQuaternion(quaternion)).toEqualEpsilon( Matrix3.fromRotationZ(-angle), - CesiumMath.EPSILON11 + CesiumMath.EPSILON11, ); }); @@ -153,7 +153,7 @@ describe("Core/Quaternion", function () { const quaternion = Quaternion.fromHeadingPitchRoll(hpr); expect(Matrix3.fromQuaternion(quaternion)).toEqualEpsilon( Matrix3.fromRotationY(-angle), - CesiumMath.EPSILON11 + CesiumMath.EPSILON11, ); }); @@ -163,7 +163,7 @@ describe("Core/Quaternion", function () { const quaternion = Quaternion.fromHeadingPitchRoll(hpr); expect(Matrix3.fromQuaternion(quaternion)).toEqualEpsilon( Matrix3.fromRotationX(angle), - CesiumMath.EPSILON11 + CesiumMath.EPSILON11, ); }); @@ -176,7 +176,7 @@ describe("Core/Quaternion", function () { Matrix3.multiply(Matrix3.fromRotationZ(-angle), expected, expected); expect(Matrix3.fromQuaternion(quaternion)).toEqualEpsilon( expected, - CesiumMath.EPSILON11 + CesiumMath.EPSILON11, ); }); @@ -191,7 +191,7 @@ describe("Core/Quaternion", function () { Matrix3.multiply(Matrix3.fromRotationZ(-heading), expected, expected); expect(Matrix3.fromQuaternion(quaternion)).toEqualEpsilon( expected, - CesiumMath.EPSILON11 + CesiumMath.EPSILON11, ); }); @@ -201,7 +201,7 @@ describe("Core/Quaternion", function () { const result = new Quaternion(); const quaternion = Quaternion.fromHeadingPitchRoll(hpr, result); const expected = Quaternion.fromRotationMatrix( - Matrix3.fromRotationX(angle) + Matrix3.fromRotationX(angle), ); expect(quaternion).toBe(result); expect(quaternion).toEqualEpsilon(expected, CesiumMath.EPSILON11); @@ -284,7 +284,7 @@ describe("Core/Quaternion", function () { -2.0 / magnitudeSquared, -3.0 / magnitudeSquared, -4.0 / magnitudeSquared, - 5.0 / magnitudeSquared + 5.0 / magnitudeSquared, ); const result = new Quaternion(); const returnedResult = Quaternion.inverse(quaternion, result); @@ -299,7 +299,7 @@ describe("Core/Quaternion", function () { -2.0 / magnitudeSquared, -3.0 / magnitudeSquared, -4.0 / magnitudeSquared, - 5.0 / magnitudeSquared + 5.0 / magnitudeSquared, ); const returnedResult = Quaternion.inverse(quaternion, quaternion); expect(returnedResult).toEqual(expected); @@ -381,7 +381,7 @@ describe("Core/Quaternion", function () { const returnedResult = Quaternion.multiplyByScalar( quaternion, scalar, - result + result, ); expect(result).toBe(returnedResult); expect(result).toEqual(expectedResult); @@ -394,7 +394,7 @@ describe("Core/Quaternion", function () { const returnedResult = Quaternion.multiplyByScalar( quaternion, scalar, - quaternion + quaternion, ); expect(quaternion).toBe(returnedResult); expect(quaternion).toEqual(expectedResult); @@ -408,7 +408,7 @@ describe("Core/Quaternion", function () { const returnedResult = Quaternion.divideByScalar( quaternion, scalar, - result + result, ); expect(result).toBe(returnedResult); expect(result).toEqual(expectedResult); @@ -421,7 +421,7 @@ describe("Core/Quaternion", function () { const returnedResult = Quaternion.divideByScalar( quaternion, scalar, - quaternion + quaternion, ); expect(quaternion).toBe(returnedResult); expect(quaternion).toEqual(expectedResult); @@ -434,13 +434,13 @@ describe("Core/Quaternion", function () { const sin = Math.sin(angle / 2.0); const expected = Cartesian3.normalize( new Cartesian3(2.0, 3.0, 6.0), - new Cartesian3() + new Cartesian3(), ); const quaternion = new Quaternion( sin * expected.x, sin * expected.y, sin * expected.z, - cos + cos, ); const result = new Cartesian3(); const returnedResult = Quaternion.computeAxis(quaternion, result); @@ -473,13 +473,13 @@ describe("Core/Quaternion", function () { const sin = Math.sin(angle / 2.0); const axis = Cartesian3.normalize( new Cartesian3(2.0, 3.0, 6.0), - new Cartesian3() + new Cartesian3(), ); const quaternion = new Quaternion( sin * axis.x, sin * axis.y, sin * axis.z, - cos + cos, ); const result = Quaternion.computeAngle(quaternion); expect(result).toEqualEpsilon(angle, CesiumMath.EPSILON15); @@ -544,19 +544,19 @@ describe("Core/Quaternion", function () { it("slerp works", function () { const start = Quaternion.normalize( new Quaternion(0.0, 0.0, 0.0, 1.0), - new Quaternion() + new Quaternion(), ); const end = new Quaternion( 0.0, 0.0, Math.sin(CesiumMath.PI_OVER_FOUR), - Math.cos(CesiumMath.PI_OVER_FOUR) + Math.cos(CesiumMath.PI_OVER_FOUR), ); const expected = new Quaternion( 0.0, 0.0, Math.sin(Math.PI / 8.0), - Math.cos(Math.PI / 8.0) + Math.cos(Math.PI / 8.0), ); const result = new Quaternion(); @@ -568,19 +568,19 @@ describe("Core/Quaternion", function () { it("slerp works with a result parameter that is an input parameter", function () { const start = Quaternion.normalize( new Quaternion(0.0, 0.0, 0.0, 1.0), - new Quaternion() + new Quaternion(), ); const end = new Quaternion( 0.0, 0.0, Math.sin(CesiumMath.PI_OVER_FOUR), - Math.cos(CesiumMath.PI_OVER_FOUR) + Math.cos(CesiumMath.PI_OVER_FOUR), ); const expected = new Quaternion( 0.0, 0.0, Math.sin(Math.PI / 8.0), - Math.cos(Math.PI / 8.0) + Math.cos(Math.PI / 8.0), ); const returnedResult = Quaternion.slerp(start, end, 0.5, start); @@ -591,23 +591,23 @@ describe("Core/Quaternion", function () { it("slerp works with obtuse angles", function () { const start = Quaternion.normalize( new Quaternion(0.0, 0.0, 0.0, -1.0), - new Quaternion() + new Quaternion(), ); const end = new Quaternion( 0.0, 0.0, Math.sin(CesiumMath.PI_OVER_FOUR), - Math.cos(CesiumMath.PI_OVER_FOUR) + Math.cos(CesiumMath.PI_OVER_FOUR), ); const expected = new Quaternion( 0.0, 0.0, -Math.sin(Math.PI / 8.0), - -Math.cos(Math.PI / 8.0) + -Math.cos(Math.PI / 8.0), ); expect(Quaternion.slerp(start, end, 0.5, new Quaternion())).toEqualEpsilon( expected, - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); }); @@ -634,7 +634,7 @@ describe("Core/Quaternion", function () { it("log works", function () { const axis = Cartesian3.normalize( new Cartesian3(1.0, -1.0, 1.0), - new Cartesian3() + new Cartesian3(), ); const angle = CesiumMath.PI_OVER_FOUR; const quat = Quaternion.fromAxisAngle(axis, angle); @@ -644,7 +644,7 @@ describe("Core/Quaternion", function () { const expected = Cartesian3.multiplyByScalar( axis, angle * 0.5, - new Cartesian3() + new Cartesian3(), ); expect(log).toBe(result); expect(log).toEqualEpsilon(expected, CesiumMath.EPSILON15); @@ -653,13 +653,13 @@ describe("Core/Quaternion", function () { it("exp works", function () { const axis = Cartesian3.normalize( new Cartesian3(1.0, -1.0, 1.0), - new Cartesian3() + new Cartesian3(), ); const angle = CesiumMath.PI_OVER_FOUR; const cartesian = Cartesian3.multiplyByScalar( axis, angle * 0.5, - new Cartesian3() + new Cartesian3(), ); const result = new Quaternion(); @@ -673,15 +673,15 @@ describe("Core/Quaternion", function () { const q0 = Quaternion.fromAxisAngle(Cartesian3.UNIT_X, 0.0); const q1 = Quaternion.fromAxisAngle( Cartesian3.UNIT_X, - CesiumMath.PI_OVER_FOUR + CesiumMath.PI_OVER_FOUR, ); const q2 = Quaternion.fromAxisAngle( Cartesian3.UNIT_Z, - CesiumMath.PI_OVER_FOUR + CesiumMath.PI_OVER_FOUR, ); const q3 = Quaternion.fromAxisAngle( Cartesian3.UNIT_X, - -CesiumMath.PI_OVER_FOUR + -CesiumMath.PI_OVER_FOUR, ); const s1Result = new Quaternion(); @@ -699,19 +699,19 @@ describe("Core/Quaternion", function () { it("fastSlerp works", function () { const start = Quaternion.normalize( new Quaternion(0.0, 0.0, 0.0, 1.0), - new Quaternion() + new Quaternion(), ); const end = new Quaternion( 0.0, 0.0, Math.sin(CesiumMath.PI_OVER_FOUR), - Math.cos(CesiumMath.PI_OVER_FOUR) + Math.cos(CesiumMath.PI_OVER_FOUR), ); const expected = new Quaternion( 0.0, 0.0, Math.sin(Math.PI / 8.0), - Math.cos(Math.PI / 8.0) + Math.cos(Math.PI / 8.0), ); const result = new Quaternion(); @@ -723,19 +723,19 @@ describe("Core/Quaternion", function () { it("fastSlerp works with a result parameter that is an input parameter", function () { const start = Quaternion.normalize( new Quaternion(0.0, 0.0, 0.0, 1.0), - new Quaternion() + new Quaternion(), ); const end = new Quaternion( 0.0, 0.0, Math.sin(CesiumMath.PI_OVER_FOUR), - Math.cos(CesiumMath.PI_OVER_FOUR) + Math.cos(CesiumMath.PI_OVER_FOUR), ); const expected = new Quaternion( 0.0, 0.0, Math.sin(Math.PI / 8.0), - Math.cos(Math.PI / 8.0) + Math.cos(Math.PI / 8.0), ); const returnedResult = Quaternion.fastSlerp(start, end, 0.5, start); @@ -746,35 +746,35 @@ describe("Core/Quaternion", function () { it("fastSlerp works with obtuse angles", function () { const start = Quaternion.normalize( new Quaternion(0.0, 0.0, 0.0, -1.0), - new Quaternion() + new Quaternion(), ); const end = new Quaternion( 0.0, 0.0, Math.sin(CesiumMath.PI_OVER_FOUR), - Math.cos(CesiumMath.PI_OVER_FOUR) + Math.cos(CesiumMath.PI_OVER_FOUR), ); const expected = new Quaternion( 0.0, 0.0, -Math.sin(Math.PI / 8.0), - -Math.cos(Math.PI / 8.0) + -Math.cos(Math.PI / 8.0), ); expect( - Quaternion.fastSlerp(start, end, 0.5, new Quaternion()) + Quaternion.fastSlerp(start, end, 0.5, new Quaternion()), ).toEqualEpsilon(expected, CesiumMath.EPSILON6); }); it("fastSlerp vs slerp", function () { const start = Quaternion.normalize( new Quaternion(0.0, 0.0, 0.0, 1.0), - new Quaternion() + new Quaternion(), ); const end = new Quaternion( 0.0, 0.0, Math.sin(CesiumMath.PI_OVER_FOUR), - Math.cos(CesiumMath.PI_OVER_FOUR) + Math.cos(CesiumMath.PI_OVER_FOUR), ); let expected = Quaternion.slerp(start, end, 0.25, new Quaternion()); @@ -794,15 +794,15 @@ describe("Core/Quaternion", function () { const q0 = Quaternion.fromAxisAngle(Cartesian3.UNIT_X, 0.0); const q1 = Quaternion.fromAxisAngle( Cartesian3.UNIT_X, - CesiumMath.PI_OVER_FOUR + CesiumMath.PI_OVER_FOUR, ); const q2 = Quaternion.fromAxisAngle( Cartesian3.UNIT_Z, - CesiumMath.PI_OVER_FOUR + CesiumMath.PI_OVER_FOUR, ); const q3 = Quaternion.fromAxisAngle( Cartesian3.UNIT_X, - -CesiumMath.PI_OVER_FOUR + -CesiumMath.PI_OVER_FOUR, ); const s1 = Quaternion.computeInnerQuadrangle(q0, q1, q2, new Quaternion()); @@ -818,15 +818,15 @@ describe("Core/Quaternion", function () { const q0 = Quaternion.fromAxisAngle(Cartesian3.UNIT_X, 0.0); const q1 = Quaternion.fromAxisAngle( Cartesian3.UNIT_X, - CesiumMath.PI_OVER_FOUR + CesiumMath.PI_OVER_FOUR, ); const q2 = Quaternion.fromAxisAngle( Cartesian3.UNIT_Z, - CesiumMath.PI_OVER_FOUR + CesiumMath.PI_OVER_FOUR, ); const q3 = Quaternion.fromAxisAngle( Cartesian3.UNIT_X, - -CesiumMath.PI_OVER_FOUR + -CesiumMath.PI_OVER_FOUR, ); const s1 = Quaternion.computeInnerQuadrangle(q0, q1, q2, new Quaternion()); @@ -848,19 +848,19 @@ describe("Core/Quaternion", function () { it("equals", function () { const quaternion = new Quaternion(1.0, 2.0, 3.0, 4.0); expect( - Quaternion.equals(quaternion, new Quaternion(1.0, 2.0, 3.0, 4.0)) + Quaternion.equals(quaternion, new Quaternion(1.0, 2.0, 3.0, 4.0)), ).toEqual(true); expect( - Quaternion.equals(quaternion, new Quaternion(2.0, 2.0, 3.0, 4.0)) + Quaternion.equals(quaternion, new Quaternion(2.0, 2.0, 3.0, 4.0)), ).toEqual(false); expect( - Quaternion.equals(quaternion, new Quaternion(2.0, 1.0, 3.0, 4.0)) + Quaternion.equals(quaternion, new Quaternion(2.0, 1.0, 3.0, 4.0)), ).toEqual(false); expect( - Quaternion.equals(quaternion, new Quaternion(1.0, 2.0, 4.0, 4.0)) + Quaternion.equals(quaternion, new Quaternion(1.0, 2.0, 4.0, 4.0)), ).toEqual(false); expect( - Quaternion.equals(quaternion, new Quaternion(1.0, 2.0, 3.0, 5.0)) + Quaternion.equals(quaternion, new Quaternion(1.0, 2.0, 3.0, 5.0)), ).toEqual(false); expect(Quaternion.equals(quaternion, undefined)).toEqual(false); }); @@ -871,71 +871,71 @@ describe("Core/Quaternion", function () { Quaternion.equalsEpsilon( quaternion, new Quaternion(1.0, 2.0, 3.0, 4.0), - 0.0 - ) + 0.0, + ), ).toEqual(true); expect( Quaternion.equalsEpsilon( quaternion, new Quaternion(1.0, 2.0, 3.0, 4.0), - 1.0 - ) + 1.0, + ), ).toEqual(true); expect( Quaternion.equalsEpsilon( quaternion, new Quaternion(2.0, 2.0, 3.0, 4.0), - 1.0 - ) + 1.0, + ), ).toEqual(true); expect( Quaternion.equalsEpsilon( quaternion, new Quaternion(1.0, 3.0, 3.0, 4.0), - 1.0 - ) + 1.0, + ), ).toEqual(true); expect( Quaternion.equalsEpsilon( quaternion, new Quaternion(1.0, 2.0, 4.0, 4.0), - 1.0 - ) + 1.0, + ), ).toEqual(true); expect( Quaternion.equalsEpsilon( quaternion, new Quaternion(1.0, 2.0, 3.0, 5.0), - 1.0 - ) + 1.0, + ), ).toEqual(true); expect( Quaternion.equalsEpsilon( quaternion, new Quaternion(2.0, 2.0, 3.0, 4.0), - 0.99999 - ) + 0.99999, + ), ).toEqual(false); expect( Quaternion.equalsEpsilon( quaternion, new Quaternion(1.0, 3.0, 3.0, 4.0), - 0.99999 - ) + 0.99999, + ), ).toEqual(false); expect( Quaternion.equalsEpsilon( quaternion, new Quaternion(1.0, 2.0, 4.0, 4.0), - 0.99999 - ) + 0.99999, + ), ).toEqual(false); expect( Quaternion.equalsEpsilon( quaternion, new Quaternion(1.0, 2.0, 3.0, 5.0), - 0.99999 - ) + 0.99999, + ), ).toEqual(false); expect(Quaternion.equalsEpsilon(quaternion, undefined, 1)).toEqual(false); }); @@ -1165,7 +1165,7 @@ describe("Core/Quaternion", function () { new Quaternion(), new Quaternion(), new Quaternion(), - new Quaternion() + new Quaternion(), ); }).toThrowDeveloperError(); }); @@ -1247,7 +1247,7 @@ describe("Core/Quaternion", function () { Quaternion.computeInnerQuadrangle( new Quaternion(), new Quaternion(), - new Quaternion() + new Quaternion(), ); }).toThrowDeveloperError(); }); @@ -1259,7 +1259,7 @@ describe("Core/Quaternion", function () { new Quaternion(), new Quaternion(), new Quaternion(), - 3 + 3, ); }).toThrowDeveloperError(); }); @@ -1311,7 +1311,7 @@ describe("Core/Quaternion", function () { Quaternion.fastSquad( new Quaternion(), new Quaternion(), - new Quaternion() + new Quaternion(), ); }).toThrowDeveloperError(); }); @@ -1322,7 +1322,7 @@ describe("Core/Quaternion", function () { new Quaternion(), new Quaternion(), new Quaternion(), - new Quaternion() + new Quaternion(), ); }).toThrowDeveloperError(); }); @@ -1334,7 +1334,7 @@ describe("Core/Quaternion", function () { new Quaternion(), new Quaternion(), new Quaternion(), - 3 + 3, ); }).toThrowDeveloperError(); }); diff --git a/packages/engine/Specs/Core/QuaternionSplineSpec.js b/packages/engine/Specs/Core/QuaternionSplineSpec.js index e8c953433e6e..48bd44be8546 100644 --- a/packages/engine/Specs/Core/QuaternionSplineSpec.js +++ b/packages/engine/Specs/Core/QuaternionSplineSpec.js @@ -80,7 +80,7 @@ describe("Core/QuaternionSpline", function () { points[1], points[2], t, - new Quaternion() + new Quaternion(), ); expect(actual).toEqualEpsilon(expected, CesiumMath.EPSILON6); }); @@ -112,7 +112,7 @@ describe("Core/QuaternionSpline", function () { points[0], points[1], t, - new Quaternion() + new Quaternion(), ); expect(actual).toEqualEpsilon(expected, CesiumMath.EPSILON6); }); @@ -133,7 +133,7 @@ describe("Core/QuaternionSpline", function () { points[0], points[1], t, - new Quaternion() + new Quaternion(), ); expect(actual).toBe(result); expect(actual).toEqualEpsilon(expected, CesiumMath.EPSILON6); diff --git a/packages/engine/Specs/Core/RaySpec.js b/packages/engine/Specs/Core/RaySpec.js index 1650c63c4ed3..b27e910e5df6 100644 --- a/packages/engine/Specs/Core/RaySpec.js +++ b/packages/engine/Specs/Core/RaySpec.js @@ -20,7 +20,7 @@ describe("Core/Ray", function () { const direction = Cartesian3.multiplyByScalar( Cartesian3.UNIT_X, 18, - new Cartesian3() + new Cartesian3(), ); const ray = new Ray(origin, direction); expect(ray.origin).toEqual(origin); @@ -30,7 +30,7 @@ describe("Core/Ray", function () { it("clone without a result parameter", function () { const direction = Cartesian3.normalize( new Cartesian3(1, 2, 3), - new Cartesian3() + new Cartesian3(), ); const ray = new Ray(Cartesian3.UNIT_X, direction); const returnedResult = Ray.clone(ray); @@ -43,7 +43,7 @@ describe("Core/Ray", function () { it("clone with a result parameter", function () { const direction = Cartesian3.normalize( new Cartesian3(1, 2, 3), - new Cartesian3() + new Cartesian3(), ); const ray = new Ray(Cartesian3.UNIT_X, direction); const result = new Ray(); @@ -58,7 +58,7 @@ describe("Core/Ray", function () { it("clone works with a result parameter that is an input parameter", function () { const direction = Cartesian3.normalize( new Cartesian3(1, 2, 3), - new Cartesian3() + new Cartesian3(), ); const ray = new Ray(Cartesian3.UNIT_X, direction); const returnedResult = Ray.clone(ray, ray); @@ -72,14 +72,14 @@ describe("Core/Ray", function () { it("getPoint along ray works without a result parameter", function () { const direction = Cartesian3.normalize( new Cartesian3(1, 2, 3), - new Cartesian3() + new Cartesian3(), ); const ray = new Ray(Cartesian3.UNIT_X, direction); for (let i = -10; i < 11; i++) { const expectedResult = Cartesian3.add( Cartesian3.multiplyByScalar(direction, i, new Cartesian3()), Cartesian3.UNIT_X, - new Cartesian3() + new Cartesian3(), ); const returnedResult = Ray.getPoint(ray, i); expect(returnedResult).toEqual(expectedResult); @@ -89,7 +89,7 @@ describe("Core/Ray", function () { it("getPoint works with a result parameter", function () { const direction = Cartesian3.normalize( new Cartesian3(1, 2, 3), - new Cartesian3() + new Cartesian3(), ); const ray = new Ray(Cartesian3.UNIT_X, direction); const result = new Cartesian3(); @@ -97,7 +97,7 @@ describe("Core/Ray", function () { const expectedResult = Cartesian3.add( Cartesian3.multiplyByScalar(direction, i, new Cartesian3()), Cartesian3.UNIT_X, - new Cartesian3() + new Cartesian3(), ); const returnedResult = Ray.getPoint(ray, i, result); expect(result).toBe(returnedResult); @@ -108,7 +108,7 @@ describe("Core/Ray", function () { it("getPoint throws without a point", function () { const direction = Cartesian3.normalize( new Cartesian3(1, 2, 3), - new Cartesian3() + new Cartesian3(), ); const ray = new Ray(Cartesian3.UNIT_X, direction); expect(function () { diff --git a/packages/engine/Specs/Core/RectangleGeometrySpec.js b/packages/engine/Specs/Core/RectangleGeometrySpec.js index 2c2451a18350..7c7ce0e29061 100644 --- a/packages/engine/Specs/Core/RectangleGeometrySpec.js +++ b/packages/engine/Specs/Core/RectangleGeometrySpec.js @@ -21,7 +21,7 @@ describe("Core/RectangleGeometry", function () { vertexFormat: VertexFormat.POSITION_ONLY, rectangle: rectangle, granularity: 1.0, - }) + }), ); const positions = m.attributes.position.values; const length = positions.length; @@ -30,20 +30,20 @@ describe("Core/RectangleGeometry", function () { expect(m.indices.length).toEqual(8 * 3); const expectedNWCorner = Ellipsoid.WGS84.cartographicToCartesian( - Rectangle.northwest(rectangle) + Rectangle.northwest(rectangle), ); const expectedSECorner = Ellipsoid.WGS84.cartographicToCartesian( - Rectangle.southeast(rectangle) + Rectangle.southeast(rectangle), ); expect( - new Cartesian3(positions[0], positions[1], positions[2]) + new Cartesian3(positions[0], positions[1], positions[2]), ).toEqualEpsilon(expectedNWCorner, CesiumMath.EPSILON9); expect( new Cartesian3( positions[length - 3], positions[length - 2], - positions[length - 1] - ) + positions[length - 1], + ), ).toEqualEpsilon(expectedSECorner, CesiumMath.EPSILON9); }); @@ -53,7 +53,7 @@ describe("Core/RectangleGeometry", function () { new RectangleGeometry({ vertexFormat: VertexFormat.POSITION_ONLY, rectangle: rectangle, - }) + }), ); const positions = m.attributes.position.values; const length = positions.length; @@ -62,20 +62,20 @@ describe("Core/RectangleGeometry", function () { expect(m.indices.length).toEqual(8 * 3); const expectedNWCorner = Ellipsoid.WGS84.cartographicToCartesian( - Rectangle.northwest(rectangle) + Rectangle.northwest(rectangle), ); const expectedSECorner = Ellipsoid.WGS84.cartographicToCartesian( - Rectangle.southeast(rectangle) + Rectangle.southeast(rectangle), ); expect( - new Cartesian3(positions[0], positions[1], positions[2]) + new Cartesian3(positions[0], positions[1], positions[2]), ).toEqualEpsilon(expectedNWCorner, CesiumMath.EPSILON8); expect( new Cartesian3( positions[length - 3], positions[length - 2], - positions[length - 1] - ) + positions[length - 1], + ), ).toEqualEpsilon(expectedSECorner, CesiumMath.EPSILON8); }); @@ -85,7 +85,7 @@ describe("Core/RectangleGeometry", function () { new RectangleGeometry({ vertexFormat: VertexFormat.POSITION_ONLY, rectangle: rectangle, - }) + }), ); const positions = m.attributes.position.values; expect(positions.length).toEqual(5 * 3); @@ -98,7 +98,7 @@ describe("Core/RectangleGeometry", function () { new RectangleGeometry({ vertexFormat: VertexFormat.POSITION_ONLY, rectangle: rectangle, - }) + }), ); const positions = m.attributes.position.values; expect(positions.length).toEqual(5 * 3); @@ -111,7 +111,7 @@ describe("Core/RectangleGeometry", function () { vertexFormat: VertexFormat.ALL, rectangle: new Rectangle(-2.0, -1.0, 0.0, 1.0), granularity: 1.0, - }) + }), ); const numVertices = 9; // 8 around edge + 1 in middle const numTriangles = 8; // 4 squares * 2 triangles per square @@ -132,7 +132,7 @@ describe("Core/RectangleGeometry", function () { rectangle: rectangle, rotation: angle, granularity: 1.0, - }) + }), ); const positions = m.attributes.position.values; const length = positions.length; @@ -145,15 +145,15 @@ describe("Core/RectangleGeometry", function () { const projectedSECorner = projection.project(unrotatedSECorner); const rotation = Matrix2.fromRotation(angle); const rotatedSECornerCartographic = projection.unproject( - Matrix2.multiplyByVector(rotation, projectedSECorner, new Cartesian2()) + Matrix2.multiplyByVector(rotation, projectedSECorner, new Cartesian2()), ); const rotatedSECorner = Ellipsoid.WGS84.cartographicToCartesian( - rotatedSECornerCartographic + rotatedSECornerCartographic, ); const actual = new Cartesian3( positions[length - 3], positions[length - 2], - positions[length - 1] + positions[length - 1], ); expect(actual).toEqualEpsilon(rotatedSECorner, CesiumMath.EPSILON6); }); @@ -165,7 +165,7 @@ describe("Core/RectangleGeometry", function () { rectangle: rectangle, rotation: CesiumMath.PI, granularity: 1.0, - }) + }), ); const positions = m.attributes.position.values; const length = positions.length; @@ -174,10 +174,10 @@ describe("Core/RectangleGeometry", function () { expect(m.indices.length).toEqual(8 * 3); const unrotatedNWCorner = Ellipsoid.WGS84.cartographicToCartesian( - Rectangle.northwest(rectangle) + Rectangle.northwest(rectangle), ); const unrotatedSECorner = Ellipsoid.WGS84.cartographicToCartesian( - Rectangle.southeast(rectangle) + Rectangle.southeast(rectangle), ); let actual = new Cartesian3(positions[0], positions[1], positions[2]); @@ -186,7 +186,7 @@ describe("Core/RectangleGeometry", function () { actual = new Cartesian3( positions[length - 3], positions[length - 2], - positions[length - 1] + positions[length - 1], ); expect(actual).toEqualEpsilon(unrotatedNWCorner, CesiumMath.EPSILON8); }); @@ -200,7 +200,7 @@ describe("Core/RectangleGeometry", function () { rectangle: rectangle, stRotation: angle, granularity: 1.0, - }) + }), ); const positions = m.attributes.position.values; const st = m.attributes.st.values; @@ -224,7 +224,7 @@ describe("Core/RectangleGeometry", function () { rotation: angle, stRotation: angle, granularity: 1.0, - }) + }), ); const st = m.attributes.st.values; @@ -252,10 +252,10 @@ describe("Core/RectangleGeometry", function () { -CesiumMath.PI_OVER_TWO, 1, CesiumMath.PI_OVER_TWO, - CesiumMath.PI_OVER_TWO + CesiumMath.PI_OVER_TWO, ), rotation: CesiumMath.PI_OVER_TWO, - }) + }), ); }).toThrowDeveloperError(); }); @@ -267,7 +267,7 @@ describe("Core/RectangleGeometry", function () { -CesiumMath.PI_OVER_TWO, CesiumMath.PI_OVER_TWO, CesiumMath.PI_OVER_TWO, - -CesiumMath.PI_OVER_TWO + -CesiumMath.PI_OVER_TWO, ), }); }).toThrowDeveloperError(); @@ -281,7 +281,7 @@ describe("Core/RectangleGeometry", function () { rectangle: rectangle, granularity: 1.0, extrudedHeight: 2, - }) + }), ); const positions = m.attributes.position.values; @@ -296,7 +296,7 @@ describe("Core/RectangleGeometry", function () { vertexFormat: VertexFormat.POSITION_ONLY, rectangle: rectangle, extrudedHeight: 2, - }) + }), ); const positions = m.attributes.position.values; @@ -311,7 +311,7 @@ describe("Core/RectangleGeometry", function () { vertexFormat: VertexFormat.POSITION_ONLY, rectangle: rectangle, extrudedHeight: 2, - }) + }), ); const positions = m.attributes.position.values; @@ -326,7 +326,7 @@ describe("Core/RectangleGeometry", function () { rectangle: new Rectangle(-2.0, -1.0, 0.0, 1.0), granularity: 1.0, extrudedHeight: 2, - }) + }), ); const numVertices = 42; const numTriangles = 32; @@ -348,7 +348,7 @@ describe("Core/RectangleGeometry", function () { rotation: angle, granularity: 1.0, extrudedHeight: 2, - }) + }), ); const positions = m.attributes.position.values; const length = positions.length; @@ -361,10 +361,10 @@ describe("Core/RectangleGeometry", function () { const projectedSECorner = projection.project(unrotatedSECorner); const rotation = Matrix2.fromRotation(angle); const rotatedSECornerCartographic = projection.unproject( - Matrix2.multiplyByVector(rotation, projectedSECorner, new Cartesian2()) + Matrix2.multiplyByVector(rotation, projectedSECorner, new Cartesian2()), ); const rotatedSECorner = Ellipsoid.WGS84.cartographicToCartesian( - rotatedSECornerCartographic + rotatedSECornerCartographic, ); const actual = new Cartesian3(positions[51], positions[52], positions[53]); expect(actual).toEqualEpsilon(rotatedSECorner, CesiumMath.EPSILON6); @@ -378,7 +378,7 @@ describe("Core/RectangleGeometry", function () { rectangle: rectangle, granularity: 1.0, extrudedHeight: CesiumMath.EPSILON14, - }) + }), ); const positions = m.attributes.position.values; @@ -396,7 +396,7 @@ describe("Core/RectangleGeometry", function () { rectangle: rectangle, granularity: 1.0, offsetAttribute: GeometryOffsetAttribute.TOP, - }) + }), ); const positions = m.attributes.position.values; @@ -418,7 +418,7 @@ describe("Core/RectangleGeometry", function () { granularity: 1.0, extrudedHeight: 2, offsetAttribute: GeometryOffsetAttribute.TOP, - }) + }), ); const positions = m.attributes.position.values; @@ -443,7 +443,7 @@ describe("Core/RectangleGeometry", function () { granularity: 1.0, extrudedHeight: 2, offsetAttribute: GeometryOffsetAttribute.ALL, - }) + }), ); const positions = m.attributes.position.values; @@ -506,19 +506,19 @@ describe("Core/RectangleGeometry", function () { const r = geometry.rectangle; expect(CesiumMath.toDegrees(r.north)).toEqualEpsilon( 1.414213562373095, - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); expect(CesiumMath.toDegrees(r.south)).toEqualEpsilon( -1.414213562373095, - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); expect(CesiumMath.toDegrees(r.east)).toEqualEpsilon( 1.414213562373095, - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); expect(CesiumMath.toDegrees(r.west)).toEqualEpsilon( -1.4142135623730951, - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); }); @@ -537,27 +537,27 @@ describe("Core/RectangleGeometry", function () { expect(textureCoordinateRotationPoints.length).toEqual(6); expect(textureCoordinateRotationPoints[0]).toEqualEpsilon( 0, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(textureCoordinateRotationPoints[1]).toEqualEpsilon( 0, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(textureCoordinateRotationPoints[2]).toEqualEpsilon( 0, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(textureCoordinateRotationPoints[3]).toEqualEpsilon( 1, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(textureCoordinateRotationPoints[4]).toEqualEpsilon( 1, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(textureCoordinateRotationPoints[5]).toEqualEpsilon( 0, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); geometry = new RectangleGeometry({ @@ -571,27 +571,27 @@ describe("Core/RectangleGeometry", function () { expect(textureCoordinateRotationPoints.length).toEqual(6); expect(textureCoordinateRotationPoints[0]).toEqualEpsilon( 0, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(textureCoordinateRotationPoints[1]).toEqualEpsilon( 0, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(textureCoordinateRotationPoints[2]).toEqualEpsilon( 0, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(textureCoordinateRotationPoints[3]).toEqualEpsilon( 1, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(textureCoordinateRotationPoints[4]).toEqualEpsilon( 1, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(textureCoordinateRotationPoints[5]).toEqualEpsilon( 0, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); }); @@ -634,7 +634,7 @@ describe("Core/RectangleGeometry", function () { rectangle: Rectangle.MAX_VALUE, granularity: 1.0, rotation: 0, - }) + }), ); }).not.toThrowDeveloperError(); }); @@ -644,7 +644,7 @@ describe("Core/RectangleGeometry", function () { Math.PI - 0.005, CesiumMath.PI_OVER_SIX + 0.02, 0.01 - Math.PI, - CesiumMath.PI_OVER_SIX + 0.04 + CesiumMath.PI_OVER_SIX + 0.04, ); const geometry = new RectangleGeometry({ @@ -664,26 +664,8 @@ describe("Core/RectangleGeometry", function () { ellipsoid: Ellipsoid.UNIT_SPHERE, }); const packedInstance = [ - -2.0, - -1.0, - 0.0, - 1.0, - 1.0, - 1.0, - 1.0, - 1.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 1.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - -1, + -2.0, -1.0, 0.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, + 0.0, 0.0, 0.0, 0.0, -1, ]; createPackableSpecs(RectangleGeometry, rectangle, packedInstance); }); diff --git a/packages/engine/Specs/Core/RectangleOutlineGeometrySpec.js b/packages/engine/Specs/Core/RectangleOutlineGeometrySpec.js index 47def1381cc5..9b3cfc4cd14a 100644 --- a/packages/engine/Specs/Core/RectangleOutlineGeometrySpec.js +++ b/packages/engine/Specs/Core/RectangleOutlineGeometrySpec.js @@ -19,7 +19,7 @@ describe("Core/RectangleOutlineGeometry", function () { new RectangleOutlineGeometry({ rectangle: rectangle, granularity: 1.0, - }) + }), ); const positions = m.attributes.position.values; @@ -27,10 +27,10 @@ describe("Core/RectangleOutlineGeometry", function () { expect(m.indices.length).toEqual(8 * 2); const expectedNWCorner = Ellipsoid.WGS84.cartographicToCartesian( - Rectangle.northwest(rectangle) + Rectangle.northwest(rectangle), ); expect( - new Cartesian3(positions[0], positions[1], positions[2]) + new Cartesian3(positions[0], positions[1], positions[2]), ).toEqualEpsilon(expectedNWCorner, CesiumMath.EPSILON9); }); @@ -39,7 +39,7 @@ describe("Core/RectangleOutlineGeometry", function () { const m = RectangleOutlineGeometry.createGeometry( new RectangleOutlineGeometry({ rectangle: rectangle, - }) + }), ); const positions = m.attributes.position.values; @@ -47,10 +47,10 @@ describe("Core/RectangleOutlineGeometry", function () { expect(m.indices.length).toEqual(8 * 2); const expectedNWCorner = Ellipsoid.WGS84.cartographicToCartesian( - Rectangle.northwest(rectangle) + Rectangle.northwest(rectangle), ); expect( - new Cartesian3(positions[0], positions[1], positions[2]) + new Cartesian3(positions[0], positions[1], positions[2]), ).toEqualEpsilon(expectedNWCorner, CesiumMath.EPSILON9); }); @@ -59,7 +59,7 @@ describe("Core/RectangleOutlineGeometry", function () { const m = RectangleOutlineGeometry.createGeometry( new RectangleOutlineGeometry({ rectangle: rectangle, - }) + }), ); const positions = m.attributes.position.values; @@ -72,7 +72,7 @@ describe("Core/RectangleOutlineGeometry", function () { const m = RectangleOutlineGeometry.createGeometry( new RectangleOutlineGeometry({ rectangle: rectangle, - }) + }), ); const positions = m.attributes.position.values; @@ -88,7 +88,7 @@ describe("Core/RectangleOutlineGeometry", function () { rectangle: rectangle, rotation: angle, granularity: 1.0, - }) + }), ); const positions = m.attributes.position.values; @@ -100,10 +100,10 @@ describe("Core/RectangleOutlineGeometry", function () { const projectedNWCorner = projection.project(unrotatedNWCorner); const rotation = Matrix2.fromRotation(angle); const rotatedNWCornerCartographic = projection.unproject( - Matrix2.multiplyByVector(rotation, projectedNWCorner, new Cartesian2()) + Matrix2.multiplyByVector(rotation, projectedNWCorner, new Cartesian2()), ); const rotatedNWCorner = Ellipsoid.WGS84.cartographicToCartesian( - rotatedNWCornerCartographic + rotatedNWCornerCartographic, ); const actual = new Cartesian3(positions[0], positions[1], positions[2]); expect(actual).toEqualEpsilon(rotatedNWCorner, CesiumMath.EPSILON6); @@ -123,10 +123,10 @@ describe("Core/RectangleOutlineGeometry", function () { -CesiumMath.PI_OVER_TWO, 1, CesiumMath.PI_OVER_TWO, - CesiumMath.PI_OVER_TWO + CesiumMath.PI_OVER_TWO, ), rotation: CesiumMath.PI_OVER_TWO, - }) + }), ); }).toThrowDeveloperError(); }); @@ -138,7 +138,7 @@ describe("Core/RectangleOutlineGeometry", function () { -CesiumMath.PI_OVER_TWO, CesiumMath.PI_OVER_TWO, CesiumMath.PI_OVER_TWO, - -CesiumMath.PI_OVER_TWO + -CesiumMath.PI_OVER_TWO, ), }); }).toThrowDeveloperError(); @@ -151,7 +151,7 @@ describe("Core/RectangleOutlineGeometry", function () { rectangle: rectangle, granularity: 1.0, extrudedHeight: 2, - }) + }), ); const positions = m.attributes.position.values; @@ -165,7 +165,7 @@ describe("Core/RectangleOutlineGeometry", function () { new RectangleOutlineGeometry({ rectangle: rectangle, extrudedHeight: 2, - }) + }), ); const positions = m.attributes.position.values; @@ -179,7 +179,7 @@ describe("Core/RectangleOutlineGeometry", function () { new RectangleOutlineGeometry({ rectangle: rectangle, extrudedHeight: 2, - }) + }), ); const positions = m.attributes.position.values; @@ -196,7 +196,7 @@ describe("Core/RectangleOutlineGeometry", function () { rotation: angle, granularity: 1.0, extrudedHeight: 2, - }) + }), ); const positions = m.attributes.position.values; @@ -208,11 +208,11 @@ describe("Core/RectangleOutlineGeometry", function () { const projectedNWCorner = projection.project(unrotatedNWCorner); const rotation = Matrix2.fromRotation(angle); const rotatedNWCornerCartographic = projection.unproject( - Matrix2.multiplyByVector(rotation, projectedNWCorner, new Cartesian2()) + Matrix2.multiplyByVector(rotation, projectedNWCorner, new Cartesian2()), ); rotatedNWCornerCartographic.height = 2; const rotatedNWCorner = Ellipsoid.WGS84.cartographicToCartesian( - rotatedNWCornerCartographic + rotatedNWCornerCartographic, ); const actual = new Cartesian3(positions[0], positions[1], positions[2]); expect(actual).toEqualEpsilon(rotatedNWCorner, CesiumMath.EPSILON6); @@ -225,7 +225,7 @@ describe("Core/RectangleOutlineGeometry", function () { rectangle: rectangle, granularity: 1.0, extrudedHeight: CesiumMath.EPSILON14, - }) + }), ); const positions = m.attributes.position.values; @@ -244,15 +244,12 @@ describe("Core/RectangleOutlineGeometry", function () { rectangle: Rectangle.fromDegrees(-80.0, 39.0, -80.0, 39.0), }); - const geometry0 = RectangleOutlineGeometry.createGeometry( - rectangleOutline0 - ); - const geometry1 = RectangleOutlineGeometry.createGeometry( - rectangleOutline1 - ); - const geometry2 = RectangleOutlineGeometry.createGeometry( - rectangleOutline2 - ); + const geometry0 = + RectangleOutlineGeometry.createGeometry(rectangleOutline0); + const geometry1 = + RectangleOutlineGeometry.createGeometry(rectangleOutline1); + const geometry2 = + RectangleOutlineGeometry.createGeometry(rectangleOutline2); expect(geometry0).toBeUndefined(); expect(geometry1).toBeUndefined(); @@ -266,7 +263,7 @@ describe("Core/RectangleOutlineGeometry", function () { rectangle: rectangle, granularity: 1.0, offsetAttribute: GeometryOffsetAttribute.TOP, - }) + }), ); const positions = m.attributes.position.values; @@ -287,7 +284,7 @@ describe("Core/RectangleOutlineGeometry", function () { granularity: 1.0, extrudedHeight: 2, offsetAttribute: GeometryOffsetAttribute.TOP, - }) + }), ); const positions = m.attributes.position.values; @@ -308,7 +305,7 @@ describe("Core/RectangleOutlineGeometry", function () { granularity: 1.0, extrudedHeight: 2, offsetAttribute: GeometryOffsetAttribute.ALL, - }) + }), ); const positions = m.attributes.position.values; @@ -334,7 +331,7 @@ describe("Core/RectangleOutlineGeometry", function () { RectangleOutlineGeometry, rectangle, packedInstance, - "extruded" + "extruded", ); rectangle = new RectangleOutlineGeometry({ @@ -349,6 +346,6 @@ describe("Core/RectangleOutlineGeometry", function () { RectangleOutlineGeometry, rectangle, packedInstance, - "at height" + "at height", ); }); diff --git a/packages/engine/Specs/Core/RectangleSpec.js b/packages/engine/Specs/Core/RectangleSpec.js index c1ddbcc627a9..eeadc4bcd51f 100644 --- a/packages/engine/Specs/Core/RectangleSpec.js +++ b/packages/engine/Specs/Core/RectangleSpec.js @@ -150,7 +150,7 @@ describe("Core/Rectangle", function () { const result = new Rectangle(); const rectangle = Rectangle.fromCartographicArray( [minLat, minLon, maxLat, maxLon], - result + result, ); expect(result).toBe(rectangle); expect(rectangle.west).toEqual(minLon.longitude); @@ -169,23 +169,23 @@ describe("Core/Rectangle", function () { const rectangle = Rectangle.fromCartesianArray( wgs84.cartographicArrayToCartesianArray([minLat, minLon, maxLat, maxLon]), - wgs84 + wgs84, ); expect(rectangle.west).toEqualEpsilon( minLon.longitude, - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); expect(rectangle.south).toEqualEpsilon( minLat.latitude, - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); expect(rectangle.east).toEqualEpsilon( maxLon.longitude, - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); expect(rectangle.north).toEqualEpsilon( maxLat.latitude, - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); }); @@ -199,7 +199,7 @@ describe("Core/Rectangle", function () { const rectangle = Rectangle.fromCartesianArray( wgs84.cartographicArrayToCartesianArray([minLat, minLon, maxLat, maxLon]), - wgs84 + wgs84, ); expect(rectangle.east).toEqual(minLon.longitude); expect(rectangle.south).toEqual(minLat.latitude); @@ -219,24 +219,24 @@ describe("Core/Rectangle", function () { const rectangle = Rectangle.fromCartesianArray( wgs84.cartographicArrayToCartesianArray([minLat, minLon, maxLat, maxLon]), wgs84, - result + result, ); expect(result).toBe(rectangle); expect(rectangle.west).toEqualEpsilon( minLon.longitude, - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); expect(rectangle.south).toEqualEpsilon( minLat.latitude, - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); expect(rectangle.east).toEqualEpsilon( maxLon.longitude, - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); expect(rectangle.north).toEqualEpsilon( maxLat.latitude, - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); }); @@ -280,19 +280,19 @@ describe("Core/Rectangle", function () { it("Static equals works in all cases", function () { const rectangle = new Rectangle(0.1, 0.2, 0.3, 0.4); expect( - Rectangle.equals(rectangle, new Rectangle(0.1, 0.2, 0.3, 0.4)) + Rectangle.equals(rectangle, new Rectangle(0.1, 0.2, 0.3, 0.4)), ).toEqual(true); expect( - Rectangle.equals(rectangle, new Rectangle(0.5, 0.2, 0.3, 0.4)) + Rectangle.equals(rectangle, new Rectangle(0.5, 0.2, 0.3, 0.4)), ).toEqual(false); expect( - Rectangle.equals(rectangle, new Rectangle(0.1, 0.5, 0.3, 0.4)) + Rectangle.equals(rectangle, new Rectangle(0.1, 0.5, 0.3, 0.4)), ).toEqual(false); expect( - Rectangle.equals(rectangle, new Rectangle(0.1, 0.2, 0.5, 0.4)) + Rectangle.equals(rectangle, new Rectangle(0.1, 0.2, 0.5, 0.4)), ).toEqual(false); expect( - Rectangle.equals(rectangle, new Rectangle(0.1, 0.2, 0.3, 0.5)) + Rectangle.equals(rectangle, new Rectangle(0.1, 0.2, 0.3, 0.5)), ).toEqual(false); expect(Rectangle.equals(rectangle, undefined)).toEqual(false); }); @@ -303,64 +303,64 @@ describe("Core/Rectangle", function () { Rectangle.equalsEpsilon( rectangle1, new Rectangle(0.1, 0.2, 0.3, 0.4), - 0.0 - ) + 0.0, + ), ).toEqual(true); expect( Rectangle.equalsEpsilon( rectangle1, new Rectangle(0.5, 0.2, 0.3, 0.4), - 0.0 - ) + 0.0, + ), ).toEqual(false); expect( Rectangle.equalsEpsilon( rectangle1, new Rectangle(0.1, 0.5, 0.3, 0.4), - 0.0 - ) + 0.0, + ), ).toEqual(false); expect( Rectangle.equalsEpsilon( rectangle1, new Rectangle(0.1, 0.2, 0.5, 0.4), - 0.0 - ) + 0.0, + ), ).toEqual(false); expect( Rectangle.equalsEpsilon( rectangle1, new Rectangle(0.1, 0.2, 0.3, 0.5), - 0.0 - ) + 0.0, + ), ).toEqual(false); expect( Rectangle.equalsEpsilon( rectangle1, new Rectangle(0.5, 0.2, 0.3, 0.4), - 0.4 - ) + 0.4, + ), ).toEqual(true); expect( Rectangle.equalsEpsilon( rectangle1, new Rectangle(0.1, 0.5, 0.3, 0.4), - 0.3 - ) + 0.3, + ), ).toEqual(true); expect( Rectangle.equalsEpsilon( rectangle1, new Rectangle(0.1, 0.2, 0.5, 0.4), - 0.2 - ) + 0.2, + ), ).toEqual(true); expect( Rectangle.equalsEpsilon( rectangle1, new Rectangle(0.1, 0.2, 0.3, 0.5), - 0.1 - ) + 0.1, + ), ).toEqual(true); expect(Rectangle.equalsEpsilon(rectangle1, undefined, 0.0)).toEqual(false); expect(Rectangle.equalsEpsilon(undefined, rectangle1, 0.0)).toEqual(false); @@ -370,31 +370,31 @@ describe("Core/Rectangle", function () { it("Equals epsilon works in all cases", function () { const rectangle = new Rectangle(0.1, 0.2, 0.3, 0.4); expect( - rectangle.equalsEpsilon(new Rectangle(0.1, 0.2, 0.3, 0.4), 0.0) + rectangle.equalsEpsilon(new Rectangle(0.1, 0.2, 0.3, 0.4), 0.0), ).toEqual(true); expect( - rectangle.equalsEpsilon(new Rectangle(0.5, 0.2, 0.3, 0.4), 0.0) + rectangle.equalsEpsilon(new Rectangle(0.5, 0.2, 0.3, 0.4), 0.0), ).toEqual(false); expect( - rectangle.equalsEpsilon(new Rectangle(0.1, 0.5, 0.3, 0.4), 0.0) + rectangle.equalsEpsilon(new Rectangle(0.1, 0.5, 0.3, 0.4), 0.0), ).toEqual(false); expect( - rectangle.equalsEpsilon(new Rectangle(0.1, 0.2, 0.5, 0.4), 0.0) + rectangle.equalsEpsilon(new Rectangle(0.1, 0.2, 0.5, 0.4), 0.0), ).toEqual(false); expect( - rectangle.equalsEpsilon(new Rectangle(0.1, 0.2, 0.3, 0.5), 0.0) + rectangle.equalsEpsilon(new Rectangle(0.1, 0.2, 0.3, 0.5), 0.0), ).toEqual(false); expect( - rectangle.equalsEpsilon(new Rectangle(0.5, 0.2, 0.3, 0.4), 0.4) + rectangle.equalsEpsilon(new Rectangle(0.5, 0.2, 0.3, 0.4), 0.4), ).toEqual(true); expect( - rectangle.equalsEpsilon(new Rectangle(0.1, 0.5, 0.3, 0.4), 0.3) + rectangle.equalsEpsilon(new Rectangle(0.1, 0.5, 0.3, 0.4), 0.3), ).toEqual(true); expect( - rectangle.equalsEpsilon(new Rectangle(0.1, 0.2, 0.5, 0.4), 0.2) + rectangle.equalsEpsilon(new Rectangle(0.1, 0.2, 0.5, 0.4), 0.2), ).toEqual(true); expect( - rectangle.equalsEpsilon(new Rectangle(0.1, 0.2, 0.3, 0.5), 0.1) + rectangle.equalsEpsilon(new Rectangle(0.1, 0.2, 0.3, 0.5), 0.1), ).toEqual(true); expect(rectangle.equalsEpsilon(undefined, 0.0)).toEqual(false); }); @@ -588,28 +588,28 @@ describe("Core/Rectangle", function () { let returnedResult = Rectangle.center(rectangle); expect(returnedResult).toEqualEpsilon( Cartographic.fromDegrees(180, 0), - CesiumMath.EPSILON11 + CesiumMath.EPSILON11, ); rectangle = Rectangle.fromDegrees(160, 0, -170, 0); returnedResult = Rectangle.center(rectangle); expect(returnedResult).toEqualEpsilon( Cartographic.fromDegrees(175, 0), - CesiumMath.EPSILON11 + CesiumMath.EPSILON11, ); rectangle = Rectangle.fromDegrees(170, 0, -160, 0); returnedResult = Rectangle.center(rectangle); expect(returnedResult).toEqualEpsilon( Cartographic.fromDegrees(-175, 0), - CesiumMath.EPSILON11 + CesiumMath.EPSILON11, ); rectangle = Rectangle.fromDegrees(160, 0, 140, 0); returnedResult = Rectangle.center(rectangle); expect(returnedResult).toEqualEpsilon( Cartographic.fromDegrees(-30, 0), - CesiumMath.EPSILON11 + CesiumMath.EPSILON11, ); }); @@ -635,7 +635,7 @@ describe("Core/Rectangle", function () { const returnedResult = Rectangle.intersection( rectangle, rectangle2, - result + result, ); expect(returnedResult).toEqual(expected); expect(result).toBe(returnedResult); @@ -785,19 +785,19 @@ describe("Core/Rectangle", function () { -CesiumMath.PI, -CesiumMath.PI_OVER_TWO, +CesiumMath.PI, - 0.0 + 0.0, ); const rectangle2 = new Rectangle( -CesiumMath.PI, 0.0, +CesiumMath.PI, - +CesiumMath.PI_OVER_TWO + +CesiumMath.PI_OVER_TWO, ); const expected = new Rectangle( -CesiumMath.PI, -CesiumMath.PI_OVER_TWO, +CesiumMath.PI, - +CesiumMath.PI_OVER_TWO + +CesiumMath.PI_OVER_TWO, ); const returnedResult = Rectangle.union(rectangle1, rectangle2); expect(returnedResult).toEqualEpsilon(expected, CesiumMath.EPSILON15); @@ -856,31 +856,31 @@ describe("Core/Rectangle", function () { it("contains works", function () { const rectangle = new Rectangle(west, south, east, north); expect( - Rectangle.contains(rectangle, new Cartographic(west, south)) + Rectangle.contains(rectangle, new Cartographic(west, south)), ).toEqual(true); expect( - Rectangle.contains(rectangle, new Cartographic(west, north)) + Rectangle.contains(rectangle, new Cartographic(west, north)), ).toEqual(true); expect( - Rectangle.contains(rectangle, new Cartographic(east, south)) + Rectangle.contains(rectangle, new Cartographic(east, south)), ).toEqual(true); expect( - Rectangle.contains(rectangle, new Cartographic(east, north)) + Rectangle.contains(rectangle, new Cartographic(east, north)), ).toEqual(true); expect(Rectangle.contains(rectangle, Rectangle.center(rectangle))).toEqual( - true + true, ); expect( - Rectangle.contains(rectangle, new Cartographic(west - 0.1, south)) + Rectangle.contains(rectangle, new Cartographic(west - 0.1, south)), ).toEqual(false); expect( - Rectangle.contains(rectangle, new Cartographic(west, north + 0.1)) + Rectangle.contains(rectangle, new Cartographic(west, north + 0.1)), ).toEqual(false); expect( - Rectangle.contains(rectangle, new Cartographic(east, south - 0.1)) + Rectangle.contains(rectangle, new Cartographic(east, south - 0.1)), ).toEqual(false); expect( - Rectangle.contains(rectangle, new Cartographic(east + 0.1, north)) + Rectangle.contains(rectangle, new Cartographic(east + 0.1, north)), ).toEqual(false); }); @@ -892,31 +892,31 @@ describe("Core/Rectangle", function () { const rectangle = new Rectangle(west, south, east, north); expect( - Rectangle.contains(rectangle, new Cartographic(west, south)) + Rectangle.contains(rectangle, new Cartographic(west, south)), ).toEqual(true); expect( - Rectangle.contains(rectangle, new Cartographic(west, north)) + Rectangle.contains(rectangle, new Cartographic(west, north)), ).toEqual(true); expect( - Rectangle.contains(rectangle, new Cartographic(east, south)) + Rectangle.contains(rectangle, new Cartographic(east, south)), ).toEqual(true); expect( - Rectangle.contains(rectangle, new Cartographic(east, north)) + Rectangle.contains(rectangle, new Cartographic(east, north)), ).toEqual(true); expect(Rectangle.contains(rectangle, Rectangle.center(rectangle))).toEqual( - true + true, ); expect( - Rectangle.contains(rectangle, new Cartographic(west - 0.1, south)) + Rectangle.contains(rectangle, new Cartographic(west - 0.1, south)), ).toEqual(false); expect( - Rectangle.contains(rectangle, new Cartographic(west, north + 0.1)) + Rectangle.contains(rectangle, new Cartographic(west, north + 0.1)), ).toEqual(false); expect( - Rectangle.contains(rectangle, new Cartographic(east, south - 0.1)) + Rectangle.contains(rectangle, new Cartographic(east, south - 0.1)), ).toEqual(false); expect( - Rectangle.contains(rectangle, new Cartographic(east + 0.1, north)) + Rectangle.contains(rectangle, new Cartographic(east + 0.1, north)), ).toEqual(false); }); @@ -947,7 +947,7 @@ describe("Core/Rectangle", function () { rectangle, Ellipsoid.WGS84, 0.0, - results + results, ); expect(results).toBe(returnedResult); expect(results[0]).toBe(cartesian0); @@ -983,26 +983,26 @@ describe("Core/Rectangle", function () { const returnedResult = Rectangle.subsample(rectangle); expect(returnedResult.length).toEqual(6); expect(returnedResult[0]).toEqual( - Ellipsoid.WGS84.cartographicToCartesian(Rectangle.northwest(rectangle)) + Ellipsoid.WGS84.cartographicToCartesian(Rectangle.northwest(rectangle)), ); expect(returnedResult[1]).toEqual( - Ellipsoid.WGS84.cartographicToCartesian(Rectangle.northeast(rectangle)) + Ellipsoid.WGS84.cartographicToCartesian(Rectangle.northeast(rectangle)), ); expect(returnedResult[2]).toEqual( - Ellipsoid.WGS84.cartographicToCartesian(Rectangle.southeast(rectangle)) + Ellipsoid.WGS84.cartographicToCartesian(Rectangle.southeast(rectangle)), ); expect(returnedResult[3]).toEqual( - Ellipsoid.WGS84.cartographicToCartesian(Rectangle.southwest(rectangle)) + Ellipsoid.WGS84.cartographicToCartesian(Rectangle.southwest(rectangle)), ); const cartographic4 = Ellipsoid.WGS84.cartesianToCartographic( - returnedResult[4] + returnedResult[4], ); expect(cartographic4.latitude).toEqual(0.0); expect(cartographic4.longitude).toEqualEpsilon(west, CesiumMath.EPSILON16); const cartographic5 = Ellipsoid.WGS84.cartesianToCartographic( - returnedResult[5] + returnedResult[5], ); expect(cartographic5.latitude).toEqual(0.0); expect(cartographic5.longitude).toEqualEpsilon(east, CesiumMath.EPSILON16); @@ -1018,7 +1018,7 @@ describe("Core/Rectangle", function () { const returnedResult = Rectangle.subsample( rectangle, Ellipsoid.WGS84, - height + height, ); const nw = Rectangle.northwest(rectangle); @@ -1064,7 +1064,7 @@ describe("Core/Rectangle", function () { expectedWest, expectedSouth, expectedEast, - expectedNorth + expectedNorth, ); const subsection = new Rectangle(); @@ -1074,7 +1074,7 @@ describe("Core/Rectangle", function () { southLerp, eastLerp, northLerp, - subsection + subsection, ); expect(result).toEqual(expectedRectangle); @@ -1101,7 +1101,7 @@ describe("Core/Rectangle", function () { expectedWest, expectedSouth, expectedEast, - expectedNorth + expectedNorth, ); const subsection = Rectangle.subsection( @@ -1109,7 +1109,7 @@ describe("Core/Rectangle", function () { westLerp, southLerp, eastLerp, - northLerp + northLerp, ); expect(subsection).toEqual(expectedRectangle); @@ -1135,7 +1135,7 @@ describe("Core/Rectangle", function () { expectedWest, expectedSouth, expectedEast, - expectedNorth + expectedNorth, ); const subsection = Rectangle.subsection( @@ -1143,7 +1143,7 @@ describe("Core/Rectangle", function () { westLerp, southLerp, eastLerp, - northLerp + northLerp, ); expect(subsection).toEqual(expectedRectangle); @@ -1169,7 +1169,7 @@ describe("Core/Rectangle", function () { expectedWest, expectedSouth, expectedEast, - expectedNorth + expectedNorth, ); const subsection = Rectangle.subsection( @@ -1177,7 +1177,7 @@ describe("Core/Rectangle", function () { westLerp, southLerp, eastLerp, - northLerp + northLerp, ); expect(subsection).toEqual(expectedRectangle); @@ -1205,7 +1205,7 @@ describe("Core/Rectangle", function () { expectedWest, expectedSouth, expectedEast, - expectedNorth + expectedNorth, ); const subsection = Rectangle.subsection( @@ -1213,7 +1213,7 @@ describe("Core/Rectangle", function () { westLerp, southLerp, eastLerp, - northLerp + northLerp, ); expect(subsection).toEqual(expectedRectangle); @@ -1239,7 +1239,7 @@ describe("Core/Rectangle", function () { expectedWest, expectedSouth, expectedEast, - expectedNorth + expectedNorth, ); const subsection = Rectangle.subsection( @@ -1247,7 +1247,7 @@ describe("Core/Rectangle", function () { westLerp, southLerp, eastLerp, - northLerp + northLerp, ); expect(subsection).toEqualEpsilon(expectedRectangle, CesiumMath.EPSILON14); @@ -1273,7 +1273,7 @@ describe("Core/Rectangle", function () { expectedWest, expectedSouth, expectedEast, - expectedNorth + expectedNorth, ); const subsection = Rectangle.subsection( @@ -1281,7 +1281,7 @@ describe("Core/Rectangle", function () { westLerp, southLerp, eastLerp, - northLerp + northLerp, ); expect(subsection).toEqualEpsilon(expectedRectangle, CesiumMath.EPSILON14); @@ -1307,7 +1307,7 @@ describe("Core/Rectangle", function () { expectedWest, expectedSouth, expectedEast, - expectedNorth + expectedNorth, ); const subsection = Rectangle.subsection( @@ -1315,7 +1315,7 @@ describe("Core/Rectangle", function () { westLerp, southLerp, eastLerp, - northLerp + northLerp, ); expect(subsection).toEqualEpsilon(expectedRectangle, CesiumMath.EPSILON14); @@ -1455,7 +1455,7 @@ describe("Core/Rectangle", function () { it("fromBoundingSphere works with non-zero values", function () { const boundingSphere = new BoundingSphere( new Cartesian3(10000000.0, 0.0, 0.0), - 1000.0 + 1000.0, ); const result = Rectangle.fromBoundingSphere(boundingSphere); const expectedRectangle = new Rectangle(); @@ -1469,7 +1469,7 @@ describe("Core/Rectangle", function () { it("fromBoundingSphere works with bounding sphere centered at the poles", function () { const boundingSphere = new BoundingSphere( new Cartesian3(0.0, 0.0, Ellipsoid.WGS84.radii.z), - 1000.0 + 1000.0, ); const result = Rectangle.fromBoundingSphere(boundingSphere); const expectedRectangle = new Rectangle(); @@ -1483,13 +1483,13 @@ describe("Core/Rectangle", function () { it("fromBoundingSphere uses result parameter", function () { const boundingSphere = new BoundingSphere( new Cartesian3(10000000.0, 0.0, 0.0), - 1000.0 + 1000.0, ); const result = new Rectangle(); const returned = Rectangle.fromBoundingSphere( boundingSphere, Ellipsoid.WGS84, - result + result, ); const expectedRectangle = new Rectangle(); diff --git a/packages/engine/Specs/Core/RequestErrorEventSpec.js b/packages/engine/Specs/Core/RequestErrorEventSpec.js index 61ca4a8890cd..23bf29e65580 100644 --- a/packages/engine/Specs/Core/RequestErrorEventSpec.js +++ b/packages/engine/Specs/Core/RequestErrorEventSpec.js @@ -5,7 +5,7 @@ describe("Core/RequestErrorEvent", function () { const event = new RequestErrorEvent( 404, "foo", - "This-is-a-test: first\r\nAnother: second value!" + "This-is-a-test: first\r\nAnother: second value!", ); expect(event.responseHeaders).toEqual({ "This-is-a-test": "first", diff --git a/packages/engine/Specs/Core/RequestSchedulerSpec.js b/packages/engine/Specs/Core/RequestSchedulerSpec.js index d1f8f9c0ea76..71ad16c07887 100644 --- a/packages/engine/Specs/Core/RequestSchedulerSpec.js +++ b/packages/engine/Specs/Core/RequestSchedulerSpec.js @@ -21,7 +21,8 @@ describe("Core/RequestScheduler", function () { afterEach(function () { RequestScheduler.maximumRequests = originalMaximumRequests; - RequestScheduler.maximumRequestsPerServer = originalMaximumRequestsPerServer; + RequestScheduler.maximumRequestsPerServer = + originalMaximumRequestsPerServer; RequestScheduler.priorityHeapLength = originalPriorityHeapLength; RequestScheduler.requestsByServer = originalRequestsByServer; }); @@ -39,7 +40,7 @@ describe("Core/RequestScheduler", function () { requestFunction: function (url) { return undefined; }, - }) + }), ); }).toThrowDeveloperError(); }); @@ -49,7 +50,7 @@ describe("Core/RequestScheduler", function () { RequestScheduler.request( new Request({ url: "file/path", - }) + }), ); }).toThrowDeveloperError(); }); @@ -234,12 +235,12 @@ describe("Core/RequestScheduler", function () { RequestScheduler.priorityHeapLength = 1; const firstRequest = createRequest(0.0); - const promise = RequestScheduler.request(firstRequest).catch(function ( - error - ) { - // Request will be cancelled - expect(error).toBeUndefined(); - }); + const promise = RequestScheduler.request(firstRequest).catch( + function (error) { + // Request will be cancelled + expect(error).toBeUndefined(); + }, + ); expect(promise).toBeDefined(); const promise2 = RequestScheduler.request(createRequest(1.0)); expect(promise2).toBeUndefined(); @@ -282,7 +283,7 @@ describe("Core/RequestScheduler", function () { } else { expect(statistics.numberOfActiveRequests).toBe(1); expect( - RequestScheduler.numberOfActiveRequestsByServer(request.serverKey) + RequestScheduler.numberOfActiveRequestsByServer(request.serverKey), ).toBe(1); } @@ -293,7 +294,7 @@ describe("Core/RequestScheduler", function () { expect(statistics.numberOfActiveRequests).toBe(0); if (!dataOrBlobUri) { expect( - RequestScheduler.numberOfActiveRequestsByServer(request.serverKey) + RequestScheduler.numberOfActiveRequestsByServer(request.serverKey), ).toBe(0); } }); @@ -406,7 +407,7 @@ describe("Core/RequestScheduler", function () { expect(statistics.numberOfCancelledRequests).toBe(1); expect(statistics.numberOfCancelledActiveRequests).toBe(1); expect( - RequestScheduler.numberOfActiveRequestsByServer(request.serverKey) + RequestScheduler.numberOfActiveRequestsByServer(request.serverKey), ).toBe(0); expect(cancelFunction).toHaveBeenCalled(); @@ -767,18 +768,18 @@ describe("Core/RequestScheduler", function () { return Promise.all( requests.map(function (request) { return request.deferred; - }) + }), ).finally(function () { RequestScheduler.update(); expect(console.log).toHaveBeenCalledWith( - "Number of attempted requests: 3" + "Number of attempted requests: 3", ); expect(console.log).toHaveBeenCalledWith( - "Number of cancelled requests: 3" + "Number of cancelled requests: 3", ); expect(console.log).toHaveBeenCalledWith( - "Number of cancelled active requests: 2" + "Number of cancelled active requests: 2", ); expect(console.log).toHaveBeenCalledWith("Number of failed requests: 1"); @@ -811,11 +812,10 @@ describe("Core/RequestScheduler", function () { expect(promise).toBeDefined(); let eventRaised = false; - const removeListenerCallback = RequestScheduler.requestCompletedEvent.addEventListener( - function () { + const removeListenerCallback = + RequestScheduler.requestCompletedEvent.addEventListener(function () { eventRaised = true; - } - ); + }); deferred.resolve(); @@ -842,11 +842,10 @@ describe("Core/RequestScheduler", function () { }); let eventRaised = false; - const removeListenerCallback = RequestScheduler.requestCompletedEvent.addEventListener( - function () { + const removeListenerCallback = + RequestScheduler.requestCompletedEvent.addEventListener(function () { eventRaised = true; - } - ); + }); const promise = RequestScheduler.request(request); expect(promise).toBeDefined(); @@ -884,11 +883,10 @@ describe("Core/RequestScheduler", function () { }); let eventRaised = false; - const removeListenerCallback = RequestScheduler.requestCompletedEvent.addEventListener( - function () { + const removeListenerCallback = + RequestScheduler.requestCompletedEvent.addEventListener(function () { eventRaised = true; - } - ); + }); const promise = RequestScheduler.request(request); expect(promise).toBeDefined(); @@ -918,12 +916,11 @@ describe("Core/RequestScheduler", function () { }); let eventRaised = false; - const removeListenerCallback = RequestScheduler.requestCompletedEvent.addEventListener( - function (error) { + const removeListenerCallback = + RequestScheduler.requestCompletedEvent.addEventListener(function (error) { eventRaised = true; expect(error).toBeDefined(); - } - ); + }); const promise = RequestScheduler.request(request); expect(promise).toBeDefined(); @@ -959,11 +956,10 @@ describe("Core/RequestScheduler", function () { const promise = RequestScheduler.request(requestToCancel); - const removeListenerCallback = RequestScheduler.requestCompletedEvent.addEventListener( - function () { + const removeListenerCallback = + RequestScheduler.requestCompletedEvent.addEventListener(function () { fail("should not be called"); - } - ); + }); requestToCancel.cancel(); RequestScheduler.update(); @@ -994,7 +990,7 @@ describe("Core/RequestScheduler", function () { requestFunction: function () { return deferred.promise; }, - }) + }), ); RequestScheduler.update(); expect(promise).toBeDefined(); @@ -1009,7 +1005,7 @@ describe("Core/RequestScheduler", function () { requestFunction: function () { return defer(); }, - }) + }), ); expect(promise).toBeUndefined(); @@ -1074,10 +1070,10 @@ describe("Core/RequestScheduler", function () { promises.push(RequestScheduler.request(createRequest())); promises.push(RequestScheduler.request(createRequest())); expect(RequestScheduler.serverHasOpenSlots("test.invalid:80", 3)).toBe( - true + true, ); expect(RequestScheduler.serverHasOpenSlots("test.invalid:80", 4)).toBe( - false + false, ); const length = deferreds.length; diff --git a/packages/engine/Specs/Core/ResourceSpec.js b/packages/engine/Specs/Core/ResourceSpec.js index 8ce027c2b09e..c4e50c3d2744 100644 --- a/packages/engine/Specs/Core/ResourceSpec.js +++ b/packages/engine/Specs/Core/ResourceSpec.js @@ -50,22 +50,22 @@ describe("Core/Resource", function () { }); expect(resource.getUrlComponent(false, false)).toEqual( - "http://test.com/tileset" + "http://test.com/tileset", ); expect(resource.getUrlComponent(true, false)).toEqual( - "http://test.com/tileset?key1=value1&key2=value2" + "http://test.com/tileset?key1=value1&key2=value2", ); expect(resource.getUrlComponent(false, true)).toEqual( - proxy.getURL("http://test.com/tileset") + proxy.getURL("http://test.com/tileset"), ); expect(resource.getUrlComponent(true, true)).toEqual( - proxy.getURL("http://test.com/tileset?key1=value1&key2=value2") + proxy.getURL("http://test.com/tileset?key1=value1&key2=value2"), ); expect(resource.url).toEqual( - proxy.getURL("http://test.com/tileset?key1=value1&key2=value2") + proxy.getURL("http://test.com/tileset?key1=value1&key2=value2"), ); expect(String(resource)).toEqual( - proxy.getURL("http://test.com/tileset?key1=value1&key2=value2") + proxy.getURL("http://test.com/tileset?key1=value1&key2=value2"), ); expect(resource.queryParameters).toEqual({ key1: "value1", @@ -131,7 +131,7 @@ describe("Core/Resource", function () { }); expect(resource.getUrlComponent()).toEqual("http://test.com/tileset"); expect(resource.getUrlComponent(true)).toEqual( - "http://test.com/tileset?foo=bar&baz=foo" + "http://test.com/tileset?foo=bar&baz=foo", ); expect(resource.queryParameters).toEqual({ foo: "bar", @@ -145,10 +145,10 @@ describe("Core/Resource", function () { parseUrl: false, }); expect(resource.getUrlComponent()).toEqual( - "http://test.com/tileset?foo=bar&baz=foo" + "http://test.com/tileset?foo=bar&baz=foo", ); expect(resource.getUrlComponent(true)).toEqual( - "http://test.com/tileset?foo=bar&baz=foo" + "http://test.com/tileset?foo=bar&baz=foo", ); expect(resource.queryParameters).toEqual({}); }); @@ -171,25 +171,25 @@ describe("Core/Resource", function () { it("multiple values for query parameters are allowed", function () { const resource = new Resource( - "http://test.com/tileset/endpoint?a=1&a=2&b=3&a=4" + "http://test.com/tileset/endpoint?a=1&a=2&b=3&a=4", ); expect(resource.queryParameters.a).toEqual(["1", "2", "4"]); expect(resource.queryParameters.b).toEqual("3"); expect(resource.url).toEqual( - "http://test.com/tileset/endpoint?a=1&a=2&a=4&b=3" + "http://test.com/tileset/endpoint?a=1&a=2&a=4&b=3", ); }); it("multiple values for query parameters works with getDerivedResource without preserverQueryParameters", function () { const resource = new Resource( - "http://test.com/tileset/endpoint?a=1&a=2&b=3&a=4" + "http://test.com/tileset/endpoint?a=1&a=2&b=3&a=4", ); expect(resource.queryParameters.a).toEqual(["1", "2", "4"]); expect(resource.queryParameters.b).toEqual("3"); expect(resource.url).toEqual( - "http://test.com/tileset/endpoint?a=1&a=2&a=4&b=3" + "http://test.com/tileset/endpoint?a=1&a=2&a=4&b=3", ); const derived = resource.getDerivedResource({ @@ -200,19 +200,19 @@ describe("Core/Resource", function () { expect(derived.queryParameters.b).toEqual("6"); expect(derived.url).toEqual( - "http://test.com/tileset/other_endpoint?a=5&a=7&b=6" + "http://test.com/tileset/other_endpoint?a=5&a=7&b=6", ); }); it("multiple values for query parameters works with getDerivedResource with preserveQueryParameters", function () { const resource = new Resource( - "http://test.com/tileset/endpoint?a=1&a=2&b=3&a=4" + "http://test.com/tileset/endpoint?a=1&a=2&b=3&a=4", ); expect(resource.queryParameters.a).toEqual(["1", "2", "4"]); expect(resource.queryParameters.b).toEqual("3"); expect(resource.url).toEqual( - "http://test.com/tileset/endpoint?a=1&a=2&a=4&b=3" + "http://test.com/tileset/endpoint?a=1&a=2&a=4&b=3", ); const derived = resource.getDerivedResource({ @@ -224,7 +224,7 @@ describe("Core/Resource", function () { expect(derived.queryParameters.b).toEqual(["6", "3"]); expect(derived.url).toEqual( - "http://test.com/tileset/other_endpoint?a=5&a=7&a=1&a=2&a=4&b=6&b=3" + "http://test.com/tileset/other_endpoint?a=5&a=7&a=1&a=2&a=4&b=6&b=3", ); }); @@ -309,23 +309,23 @@ describe("Core/Resource", function () { }); expect(resource.getUrlComponent(false, false)).toEqual( - "http://test.com/tileset/tileset.json" + "http://test.com/tileset/tileset.json", ); expect(resource.getUrlComponent(true, false)).toEqual( - "http://test.com/tileset/tileset.json?key1=value1&key2=value2&key=value&foo=bar" + "http://test.com/tileset/tileset.json?key1=value1&key2=value2&key=value&foo=bar", ); expect(resource.getUrlComponent(false, true)).toEqual( - proxy.getURL("http://test.com/tileset/tileset.json") + proxy.getURL("http://test.com/tileset/tileset.json"), ); expect(resource.getUrlComponent(true, true)).toEqual( proxy.getURL( - "http://test.com/tileset/tileset.json?key1=value1&key2=value2&key=value&foo=bar" - ) + "http://test.com/tileset/tileset.json?key1=value1&key2=value2&key=value&foo=bar", + ), ); expect(resource.url).toEqual( proxy.getURL( - "http://test.com/tileset/tileset.json?key1=value1&key2=value2&key=value&foo=bar" - ) + "http://test.com/tileset/tileset.json?key1=value1&key2=value2&key=value&foo=bar", + ), ); expect(resource.queryParameters).toEqual({ foo: "bar", @@ -433,7 +433,7 @@ describe("Core/Resource", function () { y: 4, z: 0, }, - true + true, ); expect(resource.queryParameters).toEqual({ @@ -463,7 +463,7 @@ describe("Core/Resource", function () { y: 4, z: 0, }, - false + false, ); expect(resource.queryParameters).toEqual({ @@ -552,7 +552,7 @@ describe("Core/Resource", function () { z: 0, style: "my style", }, - true + true, ); expect(resource.templateValues).toEqual({ @@ -587,7 +587,7 @@ describe("Core/Resource", function () { z: 0, style: "my style", }, - false + false, ); expect(resource.templateValues).toEqual({ @@ -698,24 +698,26 @@ describe("Core/Resource", function () { headers: expectedHeaders, }); - spyOn(Resource._Implementations, "loadWithXhr").and.callFake(function ( - url, - responseType, - method, - data, - headers, - deferred, - overrideMimeType - ) { - expect(url).toEqual(expectedUrl); - expect(responseType).toEqual(expectedResponseType); - expect(method).toEqual("POST"); - expect(data).toEqual(expectedData); - expect(headers["X-My-Header"]).toEqual("My-Value"); - expect(headers["X-My-Other-Header"]).toEqual("My-Other-Value"); - expect(overrideMimeType).toBe(expectedMimeType); - deferred.resolve(expectedResult); - }); + spyOn(Resource._Implementations, "loadWithXhr").and.callFake( + function ( + url, + responseType, + method, + data, + headers, + deferred, + overrideMimeType, + ) { + expect(url).toEqual(expectedUrl); + expect(responseType).toEqual(expectedResponseType); + expect(method).toEqual("POST"); + expect(data).toEqual(expectedData); + expect(headers["X-My-Header"]).toEqual("My-Value"); + expect(headers["X-My-Other-Header"]).toEqual("My-Other-Value"); + expect(overrideMimeType).toBe(expectedMimeType); + deferred.resolve(expectedResult); + }, + ); return resource .post(expectedData, { @@ -744,23 +746,25 @@ describe("Core/Resource", function () { }; const expectedMimeType = "application/test-data"; - spyOn(Resource._Implementations, "loadWithXhr").and.callFake(function ( - url, - responseType, - method, - data, - headers, - deferred, - overrideMimeType - ) { - expect(url).toEqual(expectedUrl); - expect(responseType).toEqual(expectedResponseType); - expect(method).toEqual("POST"); - expect(data).toEqual(expectedData); - expect(headers).toEqual(expectedHeaders); - expect(overrideMimeType).toBe(expectedMimeType); - deferred.resolve(expectedResult); - }); + spyOn(Resource._Implementations, "loadWithXhr").and.callFake( + function ( + url, + responseType, + method, + data, + headers, + deferred, + overrideMimeType, + ) { + expect(url).toEqual(expectedUrl); + expect(responseType).toEqual(expectedResponseType); + expect(method).toEqual("POST"); + expect(data).toEqual(expectedData); + expect(headers).toEqual(expectedHeaders); + expect(overrideMimeType).toBe(expectedMimeType); + deferred.resolve(expectedResult); + }, + ); return Resource.post({ url: expectedUrl, @@ -791,24 +795,26 @@ describe("Core/Resource", function () { headers: expectedHeaders, }); - spyOn(Resource._Implementations, "loadWithXhr").and.callFake(function ( - url, - responseType, - method, - data, - headers, - deferred, - overrideMimeType - ) { - expect(url).toEqual(expectedUrl); - expect(responseType).toEqual(expectedResponseType); - expect(method).toEqual("PUT"); - expect(data).toEqual(expectedData); - expect(headers["X-My-Header"]).toEqual("My-Value"); - expect(headers["X-My-Other-Header"]).toEqual("My-Other-Value"); - expect(overrideMimeType).toBe(expectedMimeType); - deferred.resolve(expectedResult); - }); + spyOn(Resource._Implementations, "loadWithXhr").and.callFake( + function ( + url, + responseType, + method, + data, + headers, + deferred, + overrideMimeType, + ) { + expect(url).toEqual(expectedUrl); + expect(responseType).toEqual(expectedResponseType); + expect(method).toEqual("PUT"); + expect(data).toEqual(expectedData); + expect(headers["X-My-Header"]).toEqual("My-Value"); + expect(headers["X-My-Other-Header"]).toEqual("My-Other-Value"); + expect(overrideMimeType).toBe(expectedMimeType); + deferred.resolve(expectedResult); + }, + ); return resource .put(expectedData, { @@ -837,23 +843,25 @@ describe("Core/Resource", function () { }; const expectedMimeType = "application/test-data"; - spyOn(Resource._Implementations, "loadWithXhr").and.callFake(function ( - url, - responseType, - method, - data, - headers, - deferred, - overrideMimeType - ) { - expect(url).toEqual(expectedUrl); - expect(responseType).toEqual(expectedResponseType); - expect(method).toEqual("PUT"); - expect(data).toEqual(expectedData); - expect(headers).toEqual(expectedHeaders); - expect(overrideMimeType).toBe(expectedMimeType); - deferred.resolve(expectedResult); - }); + spyOn(Resource._Implementations, "loadWithXhr").and.callFake( + function ( + url, + responseType, + method, + data, + headers, + deferred, + overrideMimeType, + ) { + expect(url).toEqual(expectedUrl); + expect(responseType).toEqual(expectedResponseType); + expect(method).toEqual("PUT"); + expect(data).toEqual(expectedData); + expect(headers).toEqual(expectedHeaders); + expect(overrideMimeType).toBe(expectedMimeType); + deferred.resolve(expectedResult); + }, + ); return Resource.put({ url: expectedUrl, @@ -884,24 +892,26 @@ describe("Core/Resource", function () { headers: expectedHeaders, }); - spyOn(Resource._Implementations, "loadWithXhr").and.callFake(function ( - url, - responseType, - method, - data, - headers, - deferred, - overrideMimeType - ) { - expect(url).toEqual(expectedUrl); - expect(responseType).toEqual(expectedResponseType); - expect(method).toEqual("PATCH"); - expect(data).toEqual(expectedData); - expect(headers["X-My-Header"]).toEqual("My-Value"); - expect(headers["X-My-Other-Header"]).toEqual("My-Other-Value"); - expect(overrideMimeType).toBe(expectedMimeType); - deferred.resolve(expectedResult); - }); + spyOn(Resource._Implementations, "loadWithXhr").and.callFake( + function ( + url, + responseType, + method, + data, + headers, + deferred, + overrideMimeType, + ) { + expect(url).toEqual(expectedUrl); + expect(responseType).toEqual(expectedResponseType); + expect(method).toEqual("PATCH"); + expect(data).toEqual(expectedData); + expect(headers["X-My-Header"]).toEqual("My-Value"); + expect(headers["X-My-Other-Header"]).toEqual("My-Other-Value"); + expect(overrideMimeType).toBe(expectedMimeType); + deferred.resolve(expectedResult); + }, + ); return resource .patch(expectedData, { @@ -930,23 +940,25 @@ describe("Core/Resource", function () { }; const expectedMimeType = "application/test-data"; - spyOn(Resource._Implementations, "loadWithXhr").and.callFake(function ( - url, - responseType, - method, - data, - headers, - deferred, - overrideMimeType - ) { - expect(url).toEqual(expectedUrl); - expect(responseType).toEqual(expectedResponseType); - expect(method).toEqual("PATCH"); - expect(data).toEqual(expectedData); - expect(headers).toEqual(expectedHeaders); - expect(overrideMimeType).toBe(expectedMimeType); - deferred.resolve(expectedResult); - }); + spyOn(Resource._Implementations, "loadWithXhr").and.callFake( + function ( + url, + responseType, + method, + data, + headers, + deferred, + overrideMimeType, + ) { + expect(url).toEqual(expectedUrl); + expect(responseType).toEqual(expectedResponseType); + expect(method).toEqual("PATCH"); + expect(data).toEqual(expectedData); + expect(headers).toEqual(expectedHeaders); + expect(overrideMimeType).toBe(expectedMimeType); + deferred.resolve(expectedResult); + }, + ); return Resource.patch({ url: expectedUrl, @@ -963,7 +975,7 @@ describe("Core/Resource", function () { const url = "http://test.com/data"; const expectedResult = Promise.resolve(); spyOn(Resource.prototype, "fetchArrayBuffer").and.returnValue( - expectedResult + expectedResult, ); const result = Resource.fetchArrayBuffer(url); expect(result).toBe(expectedResult); @@ -1059,7 +1071,7 @@ describe("Core/Resource", function () { it("fetchJson calls fetch with expected parameters and parses result", function () { const expectedResult = { x: 123 }; spyOn(Resource.prototype, "fetch").and.returnValue( - Promise.resolve(JSON.stringify(expectedResult)) + Promise.resolve(JSON.stringify(expectedResult)), ); return Resource.fetchJson("url").then(function (result) { expect(result).toEqual(expectedResult); @@ -1116,19 +1128,21 @@ describe("Core/Resource", function () { status: "success", }; - spyOn(Resource._Implementations, "loadWithXhr").and.callFake(function ( - url, - responseType, - method, - data, - headers, - deferred, - overrideMimeType - ) { - expect(url).toEqual(expectedUrl); - expect(method).toEqual("GET"); - deferred.resolve(expectedResult); - }); + spyOn(Resource._Implementations, "loadWithXhr").and.callFake( + function ( + url, + responseType, + method, + data, + headers, + deferred, + overrideMimeType, + ) { + expect(url).toEqual(expectedUrl); + expect(method).toEqual("GET"); + deferred.resolve(expectedResult); + }, + ); const resource = new Resource({ url: expectedUrl }); return resource.fetch().then(function (result) { @@ -1150,19 +1164,21 @@ describe("Core/Resource", function () { status: "success", }; - spyOn(Resource._Implementations, "loadWithXhr").and.callFake(function ( - url, - responseType, - method, - data, - headers, - deferred, - overrideMimeType - ) { - expect(url).toEqual(expectedUrl); - expect(method).toEqual("DELETE"); - deferred.resolve(expectedResult); - }); + spyOn(Resource._Implementations, "loadWithXhr").and.callFake( + function ( + url, + responseType, + method, + data, + headers, + deferred, + overrideMimeType, + ) { + expect(url).toEqual(expectedUrl); + expect(method).toEqual("DELETE"); + deferred.resolve(expectedResult); + }, + ); const resource = new Resource({ url: expectedUrl }); return resource.delete().then(function (result) { @@ -1212,27 +1228,29 @@ describe("Core/Resource", function () { }; spyOn(window, "XMLHttpRequest").and.returnValue(fakeXHR); - spyOn(Resource._Implementations, "loadWithXhr").and.callFake(function ( - url, - responseType, - method, - data, - headers, - deferred, - overrideMimeType - ) { - expect(url).toEqual(expectedUrl); - expect(method).toEqual("HEAD"); - Resource._DefaultImplementations.loadWithXhr( + spyOn(Resource._Implementations, "loadWithXhr").and.callFake( + function ( url, responseType, method, data, headers, deferred, - overrideMimeType - ); - }); + overrideMimeType, + ) { + expect(url).toEqual(expectedUrl); + expect(method).toEqual("HEAD"); + Resource._DefaultImplementations.loadWithXhr( + url, + responseType, + method, + data, + headers, + deferred, + overrideMimeType, + ); + }, + ); const resource = new Resource({ url: expectedUrl }); return resource.head().then(function (result) { @@ -1242,15 +1260,15 @@ describe("Core/Resource", function () { expect(result.etag).toEqual(expectedResult.etag); expect(result["content-type"]).toEqual(expectedResult["content-type"]); expect(result["access-control-allow-origin"]).toEqual( - expectedResult["access-control-allow-origin"] + expectedResult["access-control-allow-origin"], ); expect(result["cache-control"]).toEqual(expectedResult["cache-control"]); expect(result["accept-ranges"]).toEqual(expectedResult["accept-ranges"]); expect(result["access-control-allow-headers"]).toEqual( - expectedResult["access-control-allow-headers"] + expectedResult["access-control-allow-headers"], ); expect(result["content-length"]).toEqual( - expectedResult["content-length"] + expectedResult["content-length"], ); }); }); @@ -1296,27 +1314,29 @@ describe("Core/Resource", function () { }; spyOn(window, "XMLHttpRequest").and.returnValue(fakeXHR); - spyOn(Resource._Implementations, "loadWithXhr").and.callFake(function ( - url, - responseType, - method, - data, - headers, - deferred, - overrideMimeType - ) { - expect(url).toEqual(expectedUrl); - expect(method).toEqual("OPTIONS"); - Resource._DefaultImplementations.loadWithXhr( + spyOn(Resource._Implementations, "loadWithXhr").and.callFake( + function ( url, responseType, method, data, headers, deferred, - overrideMimeType - ); - }); + overrideMimeType, + ) { + expect(url).toEqual(expectedUrl); + expect(method).toEqual("OPTIONS"); + Resource._DefaultImplementations.loadWithXhr( + url, + responseType, + method, + data, + headers, + deferred, + overrideMimeType, + ); + }, + ); const resource = new Resource({ url: expectedUrl }); return resource.options().then(function (result) { @@ -1325,45 +1345,45 @@ describe("Core/Resource", function () { expect(result.etag).toEqual(expectedResult.etag); expect(result["content-type"]).toEqual(expectedResult["content-type"]); expect(result["access-control-allow-origin"]).toEqual( - expectedResult["access-control-allow-origin"] + expectedResult["access-control-allow-origin"], ); expect(result["access-control-allow-methods"]).toEqual( - expectedResult["access-control-allow-methods"] + expectedResult["access-control-allow-methods"], ); expect(result["access-control-allow-headers"]).toEqual( - expectedResult["access-control-allow-headers"] + expectedResult["access-control-allow-headers"], ); expect(result["content-length"]).toEqual( - expectedResult["content-length"] + expectedResult["content-length"], ); }); }); it("can load an SVG", function () { - return Resource.fetchImage("./Data/Images/Red16x16.svg").then(function ( - loadedImage - ) { - expect(loadedImage.width).toEqual(16); - expect(loadedImage.height).toEqual(16); - }); + return Resource.fetchImage("./Data/Images/Red16x16.svg").then( + function (loadedImage) { + expect(loadedImage.width).toEqual(16); + expect(loadedImage.height).toEqual(16); + }, + ); }); it("can load a dimensionless SVG", function () { - return Resource.fetchImage("./Data/Images/Blue.svg").then(function ( - loadedImage - ) { - expect(loadedImage.width).toBeGreaterThan(0); - expect(loadedImage.height).toBeGreaterThan(0); - }); + return Resource.fetchImage("./Data/Images/Blue.svg").then( + function (loadedImage) { + expect(loadedImage.width).toBeGreaterThan(0); + expect(loadedImage.height).toBeGreaterThan(0); + }, + ); }); it("can load an image preferring blob", function () { - return Resource.fetchImage("./Data/Images/Green.png", true).then(function ( - loadedImage - ) { - expect(loadedImage.width).toEqual(1); - expect(loadedImage.height).toEqual(1); - }); + return Resource.fetchImage("./Data/Images/Green.png", true).then( + function (loadedImage) { + expect(loadedImage.width).toEqual(1); + expect(loadedImage.height).toEqual(1); + }, + ); }); it("can load an image from a data URI", function () { @@ -1514,7 +1534,7 @@ describe("Core/Resource", function () { } spyOn(Resource, "supportsImageBitmapOptions").and.returnValue( - Promise.resolve(false) + Promise.resolve(false), ); spyOn(window, "createImageBitmap").and.callThrough(); @@ -1550,7 +1570,7 @@ describe("Core/Resource", function () { // Force the fetching of a bad blob that is not an image to trigger the error spyOn(Resource.prototype, "fetch").and.returnValue( - Promise.resolve(new Blob([new Uint8Array([])], { type: "text/plain" })) + Promise.resolve(new Blob([new Uint8Array([])], { type: "text/plain" })), ); return Resource.fetchImage({ @@ -1573,17 +1593,17 @@ describe("Core/Resource", function () { // specific functionality of this code path. For example, the crossOrigin // restriction does not apply to images loaded with ImageBitmap. spyOn(Resource, "supportsImageBitmapOptions").and.returnValue( - Promise.resolve(false) + Promise.resolve(false), ); }); it("can load an image", function () { - return Resource.fetchImage("./Data/Images/Green.png").then(function ( - loadedImage - ) { - expect(loadedImage.width).toEqual(1); - expect(loadedImage.height).toEqual(1); - }); + return Resource.fetchImage("./Data/Images/Green.png").then( + function (loadedImage) { + expect(loadedImage.width).toEqual(1); + expect(loadedImage.height).toEqual(1); + }, + ); }); it("sets the crossOrigin property for cross-origin images", function () { @@ -1593,7 +1613,7 @@ describe("Core/Resource", function () { function () { deferred.resolve(); return fakeImage; - } + }, ); // mock image loading so that the promise resolves @@ -1605,7 +1625,7 @@ describe("Core/Resource", function () { function () { expect(imageConstructorSpy).toHaveBeenCalled(); expect(fakeImage.crossOrigin).toEqual(""); - } + }, ); }); @@ -1616,7 +1636,7 @@ describe("Core/Resource", function () { function () { deferred.resolve(); return fakeImage; - } + }, ); // mock image loading so that the promise resolves @@ -1637,7 +1657,7 @@ describe("Core/Resource", function () { function () { deferred.resolve(); return fakeImage; - } + }, ); // mock image loading so that the promise resolves @@ -1727,23 +1747,25 @@ describe("Core/Resource", function () { const expectedHeaders = { "X-my-header": "my-value", }; - spyOn(Resource._Implementations, "loadWithXhr").and.callFake(function ( - url, - responseType, - method, - data, - headers, - deferred, - overrideMimeType - ) { - expect(url).toEqual(expectedUrl); - expect(headers).toEqual(expectedHeaders); - expect(responseType).toEqual("blob"); - - const binary = dataUriToBuffer(dataUri); - - deferred.resolve(new Blob([binary], { type: "image/png" })); - }); + spyOn(Resource._Implementations, "loadWithXhr").and.callFake( + function ( + url, + responseType, + method, + data, + headers, + deferred, + overrideMimeType, + ) { + expect(url).toEqual(expectedUrl); + expect(headers).toEqual(expectedHeaders); + expect(responseType).toEqual("blob"); + + const binary = dataUriToBuffer(dataUri); + + deferred.resolve(new Blob([binary], { type: "image/png" })); + }, + ); const testResource = new Resource({ url: expectedUrl, @@ -1758,17 +1780,19 @@ describe("Core/Resource", function () { }); it("Doesn't call loadWithXhr with blob response type if headers is set but is a data URI", function () { - spyOn(Resource._Implementations, "loadWithXhr").and.callFake(function ( - url, - responseType, - method, - data, - headers, - deferred, - overrideMimeType - ) { - deferred.reject("this shouldn't happen"); - }); + spyOn(Resource._Implementations, "loadWithXhr").and.callFake( + function ( + url, + responseType, + method, + data, + headers, + deferred, + overrideMimeType, + ) { + deferred.reject("this shouldn't happen"); + }, + ); spyOn(Resource._Implementations, "createImage") .and.callFake(function (url, crossOrigin, deferred) { @@ -2143,7 +2167,7 @@ describe("Core/Resource", function () { responseType: "json", }).then(function (result) { expect(result).toEqual( - jasmine.objectContaining({ hello: "world" }) + jasmine.objectContaining({ hello: "world" }), ); }); }); @@ -2187,7 +2211,7 @@ describe("Core/Resource", function () { }; requestConstructorSpy = spyOn(window, "XMLHttpRequest").and.returnValue( - fakeXHR + fakeXHR, ); }); @@ -2489,7 +2513,7 @@ describe("Core/Resource", function () { expect(receivedResource.url).toEqual(resource.url); expect(receivedResource._retryCount).toEqual(1); expect(cb.calls.argsFor(0)[1] instanceof RequestErrorEvent).toBe( - true + true, ); }); }); @@ -2519,7 +2543,7 @@ describe("Core/Resource", function () { expect(receivedResource.url).toEqual(resource.url); expect(receivedResource._retryCount).toEqual(1); expect(cb.calls.argsFor(0)[1] instanceof RequestErrorEvent).toBe( - true + true, ); }); }); @@ -2553,7 +2577,7 @@ describe("Core/Resource", function () { expect(receivedResource.url).toEqual(resource.url); expect(receivedResource._retryCount).toEqual(1); expect(cb.calls.argsFor(0)[1] instanceof RequestErrorEvent).toBe( - true + true, ); }); }); @@ -2570,7 +2594,7 @@ describe("Core/Resource", function () { expect(name).toContain("loadJsonp"); expect(deferred).toBeDefined(); deferred.resolve(); - } + }, ); return Resource.fetchJsonp(testUrl); }); @@ -2591,7 +2615,7 @@ describe("Core/Resource", function () { function (url, functionName, deferred) { expect(url).toContain("callback=loadJsonp"); deferred.resolve(); - } + }, ); return Resource.fetchJsonp(testUrl, options); }); @@ -2604,7 +2628,7 @@ describe("Core/Resource", function () { spyOn(Resource._Implementations, "loadAndExecuteScript").and.callFake( function (url, functionName, deferred) { lastDeferred = deferred; - } + }, ); const resource = new Resource({ @@ -2646,7 +2670,7 @@ describe("Core/Resource", function () { spyOn(Resource._Implementations, "loadAndExecuteScript").and.callFake( function (url, functionName, deferred) { lastDeferred = deferred; - } + }, ); const resource = new Resource({ @@ -2683,7 +2707,7 @@ describe("Core/Resource", function () { function (url, functionName, deferred) { lastUrl = url; lastDeferred = deferred; - } + }, ); const resource = new Resource({ diff --git a/packages/engine/Specs/Core/S2CellSpec.js b/packages/engine/Specs/Core/S2CellSpec.js index 57a4f7ef2640..6bb0947ac748 100644 --- a/packages/engine/Specs/Core/S2CellSpec.js +++ b/packages/engine/Specs/Core/S2CellSpec.js @@ -143,8 +143,8 @@ describe("Core/S2Cell", function () { cellIdValidity = S2Cell.isValidId( BigInt( - "0b0010101000000000000000000000000000000000000000000000000000000000" - ) + "0b0010101000000000000000000000000000000000000000000000000000000000", + ), ); expect(cellIdValidity).toBe(false); }); @@ -162,7 +162,7 @@ describe("Core/S2Cell", function () { expect(S2Cell.getIdFromToken("04")).toEqual(BigInt("288230376151711744")); expect(S2Cell.getIdFromToken("3")).toEqual(BigInt("3458764513820540928")); expect(S2Cell.getIdFromToken("2ef59bd352b93ac3")).toEqual( - BigInt("3383782026967071427") + BigInt("3383782026967071427"), ); }); @@ -170,7 +170,7 @@ describe("Core/S2Cell", function () { expect(S2Cell.getTokenFromId(BigInt("288230376151711744"))).toEqual("04"); expect(S2Cell.getTokenFromId(BigInt("3458764513820540928"))).toEqual("3"); expect(S2Cell.getTokenFromId(BigInt("3383782026967071427"))).toEqual( - "2ef59bd352b93ac3" + "2ef59bd352b93ac3", ); }); @@ -269,35 +269,35 @@ describe("Core/S2Cell", function () { it("gets correct center of cell", function () { expect(S2Cell.fromToken("1").getCenter()).toEqualEpsilon( Cartesian3.fromDegrees(0.0, 0.0), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); expect(S2Cell.fromToken("3").getCenter()).toEqualEpsilon( Cartesian3.fromDegrees(90.0, 0.0), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); expect(S2Cell.fromToken("5").getCenter()).toEqualEpsilon( Cartesian3.fromDegrees(-180.0, 90.0), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); expect(S2Cell.fromToken("7").getCenter()).toEqualEpsilon( Cartesian3.fromDegrees(-180.0, 0.0), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); expect(S2Cell.fromToken("9").getCenter()).toEqualEpsilon( Cartesian3.fromDegrees(-90.0, 0.0), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); expect(S2Cell.fromToken("b").getCenter()).toEqualEpsilon( Cartesian3.fromDegrees(0.0, -90.0), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); expect(S2Cell.fromToken("2ef59bd352b93ac3").getCenter()).toEqualEpsilon( Cartesian3.fromDegrees(105.64131803774308, -10.490091033598308), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); expect(S2Cell.fromToken("1234567").getCenter()).toEqualEpsilon( Cartesian3.fromDegrees(9.868307318504081, 27.468392925827605), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); }); @@ -316,19 +316,19 @@ describe("Core/S2Cell", function () { const cell = S2Cell.fromToken("2ef59bd352b93ac3"); expect(cell.getVertex(0)).toEqualEpsilon( Cartesian3.fromDegrees(105.64131799299665, -10.490091077431977), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); expect(cell.getVertex(1)).toEqualEpsilon( Cartesian3.fromDegrees(105.64131808248949, -10.490091072946313), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); expect(cell.getVertex(2)).toEqualEpsilon( Cartesian3.fromDegrees(105.64131808248948, -10.490090989764633), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); expect(cell.getVertex(3)).toEqualEpsilon( Cartesian3.fromDegrees(105.64131799299665, -10.4900909942503), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); }); }); diff --git a/packages/engine/Specs/Core/ScreenSpaceEventHandlerSpec.js b/packages/engine/Specs/Core/ScreenSpaceEventHandlerSpec.js index 58719b46a4b3..6aa4b9d1ad2a 100644 --- a/packages/engine/Specs/Core/ScreenSpaceEventHandlerSpec.js +++ b/packages/engine/Specs/Core/ScreenSpaceEventHandlerSpec.js @@ -48,9 +48,10 @@ describe("Core/ScreenSpaceEventHandler", function () { return cloningSpy; } - const eventsToStop = "pointerdown pointerup pointermove pointercancel mousedown mouseup mousemove touchstart touchend touchmove touchcancel dblclick wheel mousewheel DOMMouseScroll".split( - " " - ); + const eventsToStop = + "pointerdown pointerup pointermove pointercancel mousedown mouseup mousemove touchstart touchend touchmove touchcancel dblclick wheel mousewheel DOMMouseScroll".split( + " ", + ); function stop(event) { event.stopPropagation(); @@ -140,7 +141,7 @@ describe("Core/ScreenSpaceEventHandler", function () { if (defined(modifier)) { specName += ` with ${keyForValue( KeyboardEventModifier, - modifier + modifier, )} modifier`; } it(specName, function () { @@ -158,7 +159,7 @@ describe("Core/ScreenSpaceEventHandler", function () { specFunction, possibleButtons, possibleModifiers, - possibleEventTypes + possibleEventTypes, ) { for (let i = 0; i < possibleButtons.length; ++i) { const eventType = possibleEventTypes[i]; @@ -176,7 +177,7 @@ describe("Core/ScreenSpaceEventHandler", function () { element, combine(options, { pointerType: "mouse", - }) + }), ); } else { DomEventSimulator.fireMouseDown(element, options); @@ -189,7 +190,7 @@ describe("Core/ScreenSpaceEventHandler", function () { element, combine(options, { pointerType: "mouse", - }) + }), ); } else { DomEventSimulator.fireMouseUp(element, options); @@ -202,7 +203,7 @@ describe("Core/ScreenSpaceEventHandler", function () { element, combine(options, { pointerType: "mouse", - }) + }), ); } else { DomEventSimulator.fireMouseMove(element, options); @@ -224,8 +225,8 @@ describe("Core/ScreenSpaceEventHandler", function () { clientX: 1, clientY: 2, }, - eventOptions - ) + eventOptions, + ), ); } @@ -266,7 +267,7 @@ describe("Core/ScreenSpaceEventHandler", function () { testMouseDownEvent, possibleButtons, possibleModifiers, - possibleEventTypes + possibleEventTypes, ); }); @@ -286,8 +287,8 @@ describe("Core/ScreenSpaceEventHandler", function () { clientX: 1, clientY: 2, }, - eventOptions - ) + eventOptions, + ), ); simulateMouseUp( element, @@ -296,8 +297,8 @@ describe("Core/ScreenSpaceEventHandler", function () { clientX: 1, clientY: 2, }, - eventOptions - ) + eventOptions, + ), ); } @@ -319,8 +320,8 @@ describe("Core/ScreenSpaceEventHandler", function () { clientX: 1, clientY: 2, }, - eventOptions - ) + eventOptions, + ), ); simulateMouseMove( element, @@ -329,8 +330,8 @@ describe("Core/ScreenSpaceEventHandler", function () { clientX: 10, clientY: 11, }, - eventOptions - ) + eventOptions, + ), ); simulateMouseUp( element, @@ -339,8 +340,8 @@ describe("Core/ScreenSpaceEventHandler", function () { clientX: 10, clientY: 11, }, - eventOptions - ) + eventOptions, + ), ); } @@ -382,7 +383,7 @@ describe("Core/ScreenSpaceEventHandler", function () { testMouseUpEvent, possibleButtons, possibleModifiers, - possibleEventTypes + possibleEventTypes, ); }); @@ -402,8 +403,8 @@ describe("Core/ScreenSpaceEventHandler", function () { clientX: 1, clientY: 2, }, - eventOptions - ) + eventOptions, + ), ); simulateMouseUp( element, @@ -412,8 +413,8 @@ describe("Core/ScreenSpaceEventHandler", function () { clientX: 1, clientY: 2, }, - eventOptions - ) + eventOptions, + ), ); } @@ -433,8 +434,8 @@ describe("Core/ScreenSpaceEventHandler", function () { clientX: 1, clientY: 2, }, - eventOptions - ) + eventOptions, + ), ); simulateMouseUp( element, @@ -443,8 +444,8 @@ describe("Core/ScreenSpaceEventHandler", function () { clientX: 10, clientY: 11, }, - eventOptions - ) + eventOptions, + ), ); expect(action).not.toHaveBeenCalled(); @@ -479,7 +480,7 @@ describe("Core/ScreenSpaceEventHandler", function () { testMouseClickEvent, possibleButtons, possibleModifiers, - possibleEventTypes + possibleEventTypes, ); }); @@ -498,8 +499,8 @@ describe("Core/ScreenSpaceEventHandler", function () { clientX: 1, clientY: 2, }, - eventOptions - ) + eventOptions, + ), ); } @@ -532,7 +533,7 @@ describe("Core/ScreenSpaceEventHandler", function () { testMouseDoubleClickEvent, possibleButtons, possibleModifiers, - possibleEventTypes + possibleEventTypes, ); }); @@ -551,8 +552,8 @@ describe("Core/ScreenSpaceEventHandler", function () { clientX: 1, clientY: 2, }, - eventOptions - ) + eventOptions, + ), ); simulateMouseMove( element, @@ -561,8 +562,8 @@ describe("Core/ScreenSpaceEventHandler", function () { clientX: 2, clientY: 3, }, - eventOptions - ) + eventOptions, + ), ); } @@ -596,7 +597,7 @@ describe("Core/ScreenSpaceEventHandler", function () { testMouseMoveEvent, possibleButtons, possibleModifiers, - possibleEventTypes + possibleEventTypes, ); }); @@ -616,8 +617,8 @@ describe("Core/ScreenSpaceEventHandler", function () { { deltaY: 120, }, - eventOptions - ) + eventOptions, + ), ); } @@ -650,7 +651,7 @@ describe("Core/ScreenSpaceEventHandler", function () { testWheelEvent, possibleButtons, possibleModifiers, - possibleEventTypes + possibleEventTypes, ); }); } else if (document.onmousewheel !== undefined) { @@ -668,8 +669,8 @@ describe("Core/ScreenSpaceEventHandler", function () { { wheelDelta: -120, }, - eventOptions - ) + eventOptions, + ), ); } @@ -700,7 +701,7 @@ describe("Core/ScreenSpaceEventHandler", function () { testMouseWheelEvent, possibleButtons, possibleModifiers, - possibleEventTypes + possibleEventTypes, ); }); } @@ -728,8 +729,8 @@ describe("Core/ScreenSpaceEventHandler", function () { pointerType: "touch", pointerId: 1, }, - touchStartPosition - ) + touchStartPosition, + ), ); } else { DomEventSimulator.fireTouchStart(element, { @@ -738,7 +739,7 @@ describe("Core/ScreenSpaceEventHandler", function () { { identifier: 0, }, - touchStartPosition + touchStartPosition, ), ], }); @@ -789,8 +790,8 @@ describe("Core/ScreenSpaceEventHandler", function () { pointerType: "touch", pointerId: 1, }, - touchStartPosition - ) + touchStartPosition, + ), ); DomEventSimulator.firePointerMove( element, @@ -799,8 +800,8 @@ describe("Core/ScreenSpaceEventHandler", function () { pointerType: "touch", pointerId: 1, }, - touchMovePosition - ) + touchMovePosition, + ), ); } else { DomEventSimulator.fireTouchStart(element, { @@ -809,7 +810,7 @@ describe("Core/ScreenSpaceEventHandler", function () { { identifier: 0, }, - touchStartPosition + touchStartPosition, ), ], }); @@ -819,7 +820,7 @@ describe("Core/ScreenSpaceEventHandler", function () { { identifier: 0, }, - touchMovePosition + touchMovePosition, ), ], }); @@ -871,8 +872,8 @@ describe("Core/ScreenSpaceEventHandler", function () { pointerType: "touch", pointerId: 1, }, - touchStartPosition - ) + touchStartPosition, + ), ); DomEventSimulator.firePointerUp( element, @@ -881,8 +882,8 @@ describe("Core/ScreenSpaceEventHandler", function () { pointerType: "touch", pointerId: 1, }, - touchEndPosition - ) + touchEndPosition, + ), ); } else { DomEventSimulator.fireTouchStart(element, { @@ -891,7 +892,7 @@ describe("Core/ScreenSpaceEventHandler", function () { { identifier: 0, }, - touchStartPosition + touchStartPosition, ), ], }); @@ -901,7 +902,7 @@ describe("Core/ScreenSpaceEventHandler", function () { { identifier: 0, }, - touchEndPosition + touchEndPosition, ), ], }); @@ -940,8 +941,8 @@ describe("Core/ScreenSpaceEventHandler", function () { pointerType: "touch", pointerId: 1, }, - touchStartPosition - ) + touchStartPosition, + ), ); DomEventSimulator.firePointerMove( element, @@ -950,8 +951,8 @@ describe("Core/ScreenSpaceEventHandler", function () { pointerType: "touch", pointerId: 1, }, - touchMovePosition - ) + touchMovePosition, + ), ); DomEventSimulator.firePointerUp( element, @@ -960,8 +961,8 @@ describe("Core/ScreenSpaceEventHandler", function () { pointerType: "touch", pointerId: 1, }, - touchEndPosition - ) + touchEndPosition, + ), ); } else { DomEventSimulator.fireTouchStart(element, { @@ -970,7 +971,7 @@ describe("Core/ScreenSpaceEventHandler", function () { { identifier: 0, }, - touchStartPosition + touchStartPosition, ), ], }); @@ -980,7 +981,7 @@ describe("Core/ScreenSpaceEventHandler", function () { { identifier: 0, }, - touchMovePosition + touchMovePosition, ), ], }); @@ -990,7 +991,7 @@ describe("Core/ScreenSpaceEventHandler", function () { { identifier: 0, }, - touchEndPosition + touchEndPosition, ), ], }); @@ -1042,8 +1043,8 @@ describe("Core/ScreenSpaceEventHandler", function () { pointerType: "touch", pointerId: 1, }, - touchStartPosition - ) + touchStartPosition, + ), ); DomEventSimulator.firePointerCancel( element, @@ -1052,8 +1053,8 @@ describe("Core/ScreenSpaceEventHandler", function () { pointerType: "touch", pointerId: 1, }, - touchEndPosition - ) + touchEndPosition, + ), ); } else { DomEventSimulator.fireTouchStart(element, { @@ -1062,7 +1063,7 @@ describe("Core/ScreenSpaceEventHandler", function () { { identifier: 0, }, - touchStartPosition + touchStartPosition, ), ], }); @@ -1072,7 +1073,7 @@ describe("Core/ScreenSpaceEventHandler", function () { { identifier: 0, }, - touchEndPosition + touchEndPosition, ), ], }); @@ -1111,8 +1112,8 @@ describe("Core/ScreenSpaceEventHandler", function () { pointerType: "touch", pointerId: 1, }, - touchStartPosition - ) + touchStartPosition, + ), ); DomEventSimulator.firePointerMove( element, @@ -1121,8 +1122,8 @@ describe("Core/ScreenSpaceEventHandler", function () { pointerType: "touch", pointerId: 1, }, - touchMovePosition - ) + touchMovePosition, + ), ); DomEventSimulator.firePointerCancel( element, @@ -1131,8 +1132,8 @@ describe("Core/ScreenSpaceEventHandler", function () { pointerType: "touch", pointerId: 1, }, - touchEndPosition - ) + touchEndPosition, + ), ); } else { DomEventSimulator.fireTouchStart(element, { @@ -1141,7 +1142,7 @@ describe("Core/ScreenSpaceEventHandler", function () { { identifier: 0, }, - touchStartPosition + touchStartPosition, ), ], }); @@ -1151,7 +1152,7 @@ describe("Core/ScreenSpaceEventHandler", function () { { identifier: 0, }, - touchMovePosition + touchMovePosition, ), ], }); @@ -1161,7 +1162,7 @@ describe("Core/ScreenSpaceEventHandler", function () { { identifier: 0, }, - touchEndPosition + touchEndPosition, ), ], }); @@ -1213,8 +1214,8 @@ describe("Core/ScreenSpaceEventHandler", function () { pointerType: "touch", pointerId: 1, }, - touch1StartPosition - ) + touch1StartPosition, + ), ); DomEventSimulator.firePointerDown( element, @@ -1223,8 +1224,8 @@ describe("Core/ScreenSpaceEventHandler", function () { pointerType: "touch", pointerId: 2, }, - touch2StartPosition - ) + touch2StartPosition, + ), ); } else { DomEventSimulator.fireTouchStart(element, { @@ -1233,7 +1234,7 @@ describe("Core/ScreenSpaceEventHandler", function () { { identifier: 0, }, - touch1StartPosition + touch1StartPosition, ), ], }); @@ -1243,13 +1244,13 @@ describe("Core/ScreenSpaceEventHandler", function () { { identifier: 0, }, - touch1StartPosition + touch1StartPosition, ), combine( { identifier: 1, }, - touch2StartPosition + touch2StartPosition, ), ], }); @@ -1309,8 +1310,8 @@ describe("Core/ScreenSpaceEventHandler", function () { pointerType: "touch", pointerId: 1, }, - touch1StartPosition - ) + touch1StartPosition, + ), ); DomEventSimulator.firePointerDown( element, @@ -1319,8 +1320,8 @@ describe("Core/ScreenSpaceEventHandler", function () { pointerType: "touch", pointerId: 2, }, - touch2StartPosition - ) + touch2StartPosition, + ), ); DomEventSimulator.firePointerMove( element, @@ -1329,8 +1330,8 @@ describe("Core/ScreenSpaceEventHandler", function () { pointerType: "touch", pointerId: 1, }, - touch1MovePosition - ) + touch1MovePosition, + ), ); DomEventSimulator.firePointerMove( element, @@ -1339,8 +1340,8 @@ describe("Core/ScreenSpaceEventHandler", function () { pointerType: "touch", pointerId: 2, }, - touch2MovePosition - ) + touch2MovePosition, + ), ); } else { DomEventSimulator.fireTouchStart(element, { @@ -1349,7 +1350,7 @@ describe("Core/ScreenSpaceEventHandler", function () { { identifier: 0, }, - touch1StartPosition + touch1StartPosition, ), ], }); @@ -1359,13 +1360,13 @@ describe("Core/ScreenSpaceEventHandler", function () { { identifier: 0, }, - touch1StartPosition + touch1StartPosition, ), combine( { identifier: 1, }, - touch2StartPosition + touch2StartPosition, ), ], }); @@ -1375,13 +1376,13 @@ describe("Core/ScreenSpaceEventHandler", function () { { identifier: 0, }, - touch1MovePosition + touch1MovePosition, ), combine( { identifier: 1, }, - touch2MovePosition + touch2MovePosition, ), ], }); @@ -1475,8 +1476,8 @@ describe("Core/ScreenSpaceEventHandler", function () { pointerType: "touch", pointerId: 1, }, - touch1Position - ) + touch1Position, + ), ); DomEventSimulator.firePointerDown( element, @@ -1485,8 +1486,8 @@ describe("Core/ScreenSpaceEventHandler", function () { pointerType: "touch", pointerId: 2, }, - touch2Position - ) + touch2Position, + ), ); // Releasing one of two fingers should not trigger @@ -1499,8 +1500,8 @@ describe("Core/ScreenSpaceEventHandler", function () { pointerType: "touch", pointerId: 1, }, - touch1Position - ) + touch1Position, + ), ); expect(pinchEndAction).not.toHaveBeenCalled(); expect(leftDownAction).not.toHaveBeenCalled(); @@ -1516,8 +1517,8 @@ describe("Core/ScreenSpaceEventHandler", function () { pointerType: "touch", pointerId: 1, }, - touch2Position - ) + touch2Position, + ), ); expect(pinchStartAction).not.toHaveBeenCalled(); @@ -1529,8 +1530,8 @@ describe("Core/ScreenSpaceEventHandler", function () { pointerType: "touch", pointerId: 1, }, - touch2Position - ) + touch2Position, + ), ); DomEventSimulator.firePointerUp( element, @@ -1539,8 +1540,8 @@ describe("Core/ScreenSpaceEventHandler", function () { pointerType: "touch", pointerId: 2, }, - touch2Position - ) + touch2Position, + ), ); expect(pinchEndAction).toHaveBeenCalled(); } else { @@ -1597,8 +1598,8 @@ describe("Core/ScreenSpaceEventHandler", function () { pointerType: "touch", pointerId: 1, }, - touchStartPosition - ) + touchStartPosition, + ), ); DomEventSimulator.firePointerUp( element, @@ -1607,8 +1608,8 @@ describe("Core/ScreenSpaceEventHandler", function () { pointerType: "touch", pointerId: 1, }, - touchEndPosition - ) + touchEndPosition, + ), ); } else { DomEventSimulator.fireTouchStart(element, { @@ -1617,7 +1618,7 @@ describe("Core/ScreenSpaceEventHandler", function () { { identifier: 0, }, - touchStartPosition + touchStartPosition, ), ], }); @@ -1627,7 +1628,7 @@ describe("Core/ScreenSpaceEventHandler", function () { { identifier: 0, }, - touchEndPosition + touchEndPosition, ), ], }); @@ -1682,8 +1683,8 @@ describe("Core/ScreenSpaceEventHandler", function () { pointerType: "touch", pointerId: 1, }, - touchStartPosition - ) + touchStartPosition, + ), ); jasmine.clock().tick(timeout); DomEventSimulator.firePointerUp( @@ -1693,8 +1694,8 @@ describe("Core/ScreenSpaceEventHandler", function () { pointerType: "touch", pointerId: 1, }, - touchEndPosition - ) + touchEndPosition, + ), ); } else { DomEventSimulator.fireTouchStart(element, { @@ -1703,7 +1704,7 @@ describe("Core/ScreenSpaceEventHandler", function () { { identifier: 0, }, - touchStartPosition + touchStartPosition, ), ], }); @@ -1714,7 +1715,7 @@ describe("Core/ScreenSpaceEventHandler", function () { { identifier: 0, }, - touchEndPosition + touchEndPosition, ), ], }); @@ -1783,8 +1784,8 @@ describe("Core/ScreenSpaceEventHandler", function () { pointerType: "touch", pointerId: 1, }, - touchStartPosition - ) + touchStartPosition, + ), ); DomEventSimulator.firePointerCancel( element, @@ -1793,8 +1794,8 @@ describe("Core/ScreenSpaceEventHandler", function () { pointerType: "touch", pointerId: 1, }, - touchEndPosition - ) + touchEndPosition, + ), ); } else { DomEventSimulator.fireTouchStart(element, { @@ -1803,7 +1804,7 @@ describe("Core/ScreenSpaceEventHandler", function () { { identifier: 0, }, - touchStartPosition + touchStartPosition, ), ], }); @@ -1813,7 +1814,7 @@ describe("Core/ScreenSpaceEventHandler", function () { { identifier: 0, }, - touchEndPosition + touchEndPosition, ), ], }); @@ -1857,7 +1858,7 @@ describe("Core/ScreenSpaceEventHandler", function () { handler.destroy(); expect(element.removeEventListener.calls.count()).toEqual( - element.addEventListener.calls.count() + element.addEventListener.calls.count(), ); }); }); diff --git a/packages/engine/Specs/Core/ShowGeometryInstanceAttributeSpec.js b/packages/engine/Specs/Core/ShowGeometryInstanceAttributeSpec.js index ccccf6ddd37c..ebfe89da903b 100644 --- a/packages/engine/Specs/Core/ShowGeometryInstanceAttributeSpec.js +++ b/packages/engine/Specs/Core/ShowGeometryInstanceAttributeSpec.js @@ -7,7 +7,7 @@ describe("Core/ShowGeometryInstanceAttribute", function () { it("constructor", function () { const attribute = new ShowGeometryInstanceAttribute(false); expect(attribute.componentDatatype).toEqual( - ComponentDatatype.UNSIGNED_BYTE + ComponentDatatype.UNSIGNED_BYTE, ); expect(attribute.componentsPerAttribute).toEqual(1); expect(attribute.normalize).toEqual(false); diff --git a/packages/engine/Specs/Core/Simon1994PlanetaryPositionsSpec.js b/packages/engine/Specs/Core/Simon1994PlanetaryPositionsSpec.js index 01d26b41a644..51b47155d828 100644 --- a/packages/engine/Specs/Core/Simon1994PlanetaryPositionsSpec.js +++ b/packages/engine/Specs/Core/Simon1994PlanetaryPositionsSpec.js @@ -84,14 +84,15 @@ describe("Core/Simon1994PlanetaryPositions", function () { for (i = 0; i < 24; i++) { transformMatrix = Transforms.computeIcrfToCentralBodyFixedMatrix( timesOfDay[i], - transformMatrix - ); - const position = PlanetaryPositions.computeSunPositionInEarthInertialFrame( - timesOfDay[i] + transformMatrix, ); + const position = + PlanetaryPositions.computeSunPositionInEarthInertialFrame( + timesOfDay[i], + ); Matrix3.multiplyByVector(transformMatrix, position, position); angles.push( - CesiumMath.convertLongitudeRange(Math.atan2(position.y, position.x)) + CesiumMath.convertLongitudeRange(Math.atan2(position.y, position.x)), ); } //Expect a clockwise motion. diff --git a/packages/engine/Specs/Core/SimplePolylineGeometrySpec.js b/packages/engine/Specs/Core/SimplePolylineGeometrySpec.js index 1375664dfda4..c4c8713f5c71 100644 --- a/packages/engine/Specs/Core/SimplePolylineGeometrySpec.js +++ b/packages/engine/Specs/Core/SimplePolylineGeometrySpec.js @@ -46,12 +46,12 @@ describe("Core/SimplePolylineGeometry", function () { positions: positions, granularity: Math.PI, ellipsoid: Ellipsoid.UNIT_SPHERE, - }) + }), ); expect(line.attributes.position.values).toEqualEpsilon( [1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0], - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); expect(line.indices).toEqual([0, 1, 1, 2]); expect(line.primitiveType).toEqual(PrimitiveType.LINES); @@ -66,7 +66,7 @@ describe("Core/SimplePolylineGeometry", function () { granularity: Math.PI, ellipsoid: Ellipsoid.UNIT_SPHERE, arcType: ArcType.RHUMB, - }) + }), ); const cartesian3Array = []; @@ -74,7 +74,7 @@ describe("Core/SimplePolylineGeometry", function () { expect(line.attributes.position.values).toEqualEpsilon( cartesian3Array, - CesiumMath.EPSILON8 + CesiumMath.EPSILON8, ); expect(line.indices).toEqual([0, 1, 1, 2]); expect(line.primitiveType).toEqual(PrimitiveType.LINES); @@ -98,7 +98,7 @@ describe("Core/SimplePolylineGeometry", function () { colors: colors, granularity: Math.PI, ellipsoid: Ellipsoid.UNIT_SPHERE, - }) + }), ); expect(line.attributes.color).toBeDefined(); @@ -125,7 +125,7 @@ describe("Core/SimplePolylineGeometry", function () { colorsPerVertex: true, granularity: Math.PI, ellipsoid: Ellipsoid.UNIT_SPHERE, - }) + }), ); expect(line.attributes.color).toBeDefined(); @@ -144,19 +144,11 @@ describe("Core/SimplePolylineGeometry", function () { new SimplePolylineGeometry({ positions: positions, arcType: ArcType.NONE, - }) + }), ); expect(line.attributes.position.values).toEqual([ - 0.0, - 0.0, - 0.0, - 1.0, - 0.0, - 0.0, - 2.0, - 0.0, - 0.0, + 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 2.0, 0.0, 0.0, ]); expect(line.indices).toEqual([0, 1, 1, 2]); expect(line.primitiveType).toEqual(PrimitiveType.LINES); @@ -179,7 +171,7 @@ describe("Core/SimplePolylineGeometry", function () { positions: positions, colors: colors, arcType: ArcType.NONE, - }) + }), ); expect(line.attributes.color).toBeDefined(); @@ -205,7 +197,7 @@ describe("Core/SimplePolylineGeometry", function () { colors: colors, colorsPerVertex: true, arcType: ArcType.NONE, - }) + }), ); expect(line.attributes.color).toBeDefined(); @@ -228,41 +220,14 @@ describe("Core/SimplePolylineGeometry", function () { ellipsoid: new Ellipsoid(12, 13, 14), }); let packedInstance = [ - 3, - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 3, - 1, - 0, - 0, - 1, - 0, - 1, - 0, - 1, - 0, - 0, - 1, - 1, - 12, - 13, - 14, - 1, - 0, - 11, + 3, 1, 2, 3, 4, 5, 6, 7, 8, 9, 3, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 12, 13, + 14, 1, 0, 11, ]; createPackableSpecs( SimplePolylineGeometry, line, packedInstance, - "per vertex colors" + "per vertex colors", ); line = new SimplePolylineGeometry({ @@ -288,7 +253,7 @@ describe("Core/SimplePolylineGeometry", function () { SimplePolylineGeometry, line, packedInstance, - "geodesic line" + "geodesic line", ); line = new SimplePolylineGeometry({ @@ -304,7 +269,7 @@ describe("Core/SimplePolylineGeometry", function () { SimplePolylineGeometry, line, packedInstance, - "rhumb line" + "rhumb line", ); line = new SimplePolylineGeometry({ @@ -320,6 +285,6 @@ describe("Core/SimplePolylineGeometry", function () { SimplePolylineGeometry, line, packedInstance, - "straight line" + "straight line", ); }); diff --git a/packages/engine/Specs/Core/SphereGeometrySpec.js b/packages/engine/Specs/Core/SphereGeometrySpec.js index d4aa38e45c5e..6c05a8f85192 100644 --- a/packages/engine/Specs/Core/SphereGeometrySpec.js +++ b/packages/engine/Specs/Core/SphereGeometrySpec.js @@ -31,7 +31,7 @@ describe("Core/SphereGeometry", function () { radius: 1, stackPartitions: 3, slicePartitions: 3, - }) + }), ); // The vertices are 6x6 because an additional slice and stack are added @@ -50,7 +50,7 @@ describe("Core/SphereGeometry", function () { radius: 1, stackPartitions: 3, slicePartitions: 3, - }) + }), ); const numVertices = 36; @@ -70,7 +70,7 @@ describe("Core/SphereGeometry", function () { radius: 1, stackPartitions: 3, slicePartitions: 3, - }) + }), ); const positions = m.attributes.position.values; @@ -86,16 +86,16 @@ describe("Core/SphereGeometry", function () { expect(Cartesian3.magnitude(position)).toEqualEpsilon( 1.0, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); expect(normal).toEqualEpsilon( Cartesian3.normalize(position, position), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(Cartesian3.dot(Cartesian3.UNIT_Z, tangent)).not.toBeLessThan(0.0); expect(bitangent).toEqualEpsilon( Cartesian3.cross(normal, tangent, normal), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); } }); diff --git a/packages/engine/Specs/Core/SphereOutlineGeometrySpec.js b/packages/engine/Specs/Core/SphereOutlineGeometrySpec.js index fe20690fb5bb..973677b2890b 100644 --- a/packages/engine/Specs/Core/SphereOutlineGeometrySpec.js +++ b/packages/engine/Specs/Core/SphereOutlineGeometrySpec.js @@ -33,7 +33,7 @@ describe("Core/SphereOutlineGeometry", function () { stackPartitions: 2, slicePartitions: 2, subdivisions: 2, - }) + }), ); expect(m.attributes.position.values.length).toEqual(12 * 3); diff --git a/packages/engine/Specs/Core/SphericalSpec.js b/packages/engine/Specs/Core/SphericalSpec.js index c5515a14f861..3e38416c67a4 100644 --- a/packages/engine/Specs/Core/SphericalSpec.js +++ b/packages/engine/Specs/Core/SphericalSpec.js @@ -36,13 +36,13 @@ describe("Core/Spherical", function () { const spherical = new Spherical( sixtyDegrees, fortyFiveDegrees + Math.PI / 2.0, - Math.sqrt(8.0) + Math.sqrt(8.0), ); it("Can convert Cartesian3 to a new spherical instance", function () { expect(spherical).toEqualEpsilon( Spherical.fromCartesian3(cartesian), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); }); @@ -50,7 +50,7 @@ describe("Core/Spherical", function () { const existing = new Spherical(); expect(spherical).toEqualEpsilon( Spherical.fromCartesian3(cartesian, existing), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); expect(spherical).toEqualEpsilon(existing, CesiumMath.EPSILON15); }); @@ -110,7 +110,7 @@ describe("Core/Spherical", function () { it("equalsEpsilon returns false for expected values.", function () { expect(new Spherical(1, 2, 1)).not.toEqualEpsilon( new NotSpherical(1, 2, 3), - 1 + 1, ); }); diff --git a/packages/engine/Specs/Core/SplineSpec.js b/packages/engine/Specs/Core/SplineSpec.js index 8a38ca5a2acb..94570c49ce62 100644 --- a/packages/engine/Specs/Core/SplineSpec.js +++ b/packages/engine/Specs/Core/SplineSpec.js @@ -93,7 +93,7 @@ describe("Core/Spline", function () { // jump far forward expect(spline.findTimeInterval(times[times.length - 2], 0)).toEqual( - times.length - 2 + times.length - 2, ); // jump far back diff --git a/packages/engine/Specs/Core/StereographicSpec.js b/packages/engine/Specs/Core/StereographicSpec.js index 60c742a4b3c7..285e8b39bd36 100644 --- a/packages/engine/Specs/Core/StereographicSpec.js +++ b/packages/engine/Specs/Core/StereographicSpec.js @@ -11,208 +11,208 @@ describe("Core/Stereographic", function () { expect(stereographic.x).toEqual(0.0); expect(stereographic.y).toEqual(0.0); expect(stereographic.tangentPlane).toEqual( - Stereographic.NORTH_POLE_TANGENT_PLANE + Stereographic.NORTH_POLE_TANGENT_PLANE, ); }); it("construct with values", function () { const stereographic = new Stereographic( new Cartesian2(1.0, 2.0), - Stereographic.SOUTH_POLE_TANGENT_PLANE + Stereographic.SOUTH_POLE_TANGENT_PLANE, ); expect(stereographic.x).toEqual(1.0); expect(stereographic.y).toEqual(2.0); expect(stereographic.tangentPlane).toEqual( - Stereographic.SOUTH_POLE_TANGENT_PLANE + Stereographic.SOUTH_POLE_TANGENT_PLANE, ); }); it("fromCartesian constructs a Stereographic in the northern hemisphere", function () { const stereographic = new Stereographic.fromCartesian( - Cartesian3.fromDegrees(30.0, 60.0) + Cartesian3.fromDegrees(30.0, 60.0), ); expect(stereographic.x).toEqualEpsilon(0.1347555369, CesiumMath.EPSILON7); expect(stereographic.y).toEqualEpsilon(-0.2334034365, CesiumMath.EPSILON7); expect(stereographic.tangentPlane).toEqual( - Stereographic.NORTH_POLE_TANGENT_PLANE + Stereographic.NORTH_POLE_TANGENT_PLANE, ); }); it("fromCartesian constructs a Stereographic at 0,0", function () { const stereographic = new Stereographic.fromCartesian( - Cartesian3.fromDegrees(0.0, 0.0) + Cartesian3.fromDegrees(0.0, 0.0), ); expect(stereographic.x).toEqualEpsilon(0.0, CesiumMath.EPSILON7); expect(stereographic.y).toEqualEpsilon(-1.0, CesiumMath.EPSILON7); expect(stereographic.tangentPlane).toEqual( - Stereographic.NORTH_POLE_TANGENT_PLANE + Stereographic.NORTH_POLE_TANGENT_PLANE, ); }); it("fromCartesian constructs a Stereographic in the southern hemisphere", function () { const stereographic = new Stereographic.fromCartesian( - Cartesian3.fromDegrees(30.0, -60.0) + Cartesian3.fromDegrees(30.0, -60.0), ); expect(stereographic.x).toEqualEpsilon(0.1347555369, CesiumMath.EPSILON7); expect(stereographic.y).toEqualEpsilon(-0.2334034365, CesiumMath.EPSILON7); expect(stereographic.tangentPlane).toEqual( - Stereographic.SOUTH_POLE_TANGENT_PLANE + Stereographic.SOUTH_POLE_TANGENT_PLANE, ); }); it("can get longitude from a Stereographic in the northern hemisphere", function () { let stereographic = new Stereographic.fromCartesian( - Cartesian3.fromDegrees(30.0, 60.0) + Cartesian3.fromDegrees(30.0, 60.0), ); expect(stereographic.longitude).toEqualEpsilon( CesiumMath.toRadians(30.0), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); stereographic = new Stereographic.fromCartesian( - Cartesian3.fromDegrees(60.0, 30.0) + Cartesian3.fromDegrees(60.0, 30.0), ); expect(stereographic.longitude).toEqualEpsilon( CesiumMath.toRadians(60.0), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); stereographic = new Stereographic.fromCartesian( - Cartesian3.fromDegrees(-60.0, 30.0) + Cartesian3.fromDegrees(-60.0, 30.0), ); expect(stereographic.longitude).toEqualEpsilon( CesiumMath.toRadians(-60.0), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); stereographic = new Stereographic.fromCartesian( - Cartesian3.fromDegrees(-135.0, 60.0) + Cartesian3.fromDegrees(-135.0, 60.0), ); expect(stereographic.longitude).toEqualEpsilon( CesiumMath.toRadians(-135.0), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); stereographic = new Stereographic.fromCartesian( - Cartesian3.fromDegrees(135.0, 60.0) + Cartesian3.fromDegrees(135.0, 60.0), ); expect(stereographic.longitude).toEqualEpsilon( CesiumMath.toRadians(135.0), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); }); it("can get longitude from a Stereographic in the southern hemisphere", function () { let stereographic = new Stereographic.fromCartesian( - Cartesian3.fromDegrees(30.0, -60.0) + Cartesian3.fromDegrees(30.0, -60.0), ); expect(stereographic.longitude).toEqualEpsilon( CesiumMath.toRadians(30.0), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); stereographic = new Stereographic.fromCartesian( - Cartesian3.fromDegrees(60.0, -30.0) + Cartesian3.fromDegrees(60.0, -30.0), ); expect(stereographic.longitude).toEqualEpsilon( CesiumMath.toRadians(60.0), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); stereographic = new Stereographic.fromCartesian( - Cartesian3.fromDegrees(-60.0, -30.0) + Cartesian3.fromDegrees(-60.0, -30.0), ); expect(stereographic.longitude).toEqualEpsilon( CesiumMath.toRadians(-60.0), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); stereographic = new Stereographic.fromCartesian( - Cartesian3.fromDegrees(-135.0, -60.0) + Cartesian3.fromDegrees(-135.0, -60.0), ); expect(stereographic.longitude).toEqualEpsilon( CesiumMath.toRadians(-135.0), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); stereographic = new Stereographic.fromCartesian( - Cartesian3.fromDegrees(135.0, -60.0) + Cartesian3.fromDegrees(135.0, -60.0), ); expect(stereographic.longitude).toEqualEpsilon( CesiumMath.toRadians(135.0), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); }); it("can get conformal latitidude from a Stereographic in the northern hemisphere", function () { let stereographic = new Stereographic.fromCartesian( - Cartesian3.fromDegrees(30.0, 60.0) + Cartesian3.fromDegrees(30.0, 60.0), ); expect(stereographic.conformalLatitude).toEqualEpsilon( 1.04428418, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); stereographic = new Stereographic.fromCartesian( - Cartesian3.fromDegrees(60.0, 30.0) + Cartesian3.fromDegrees(60.0, 30.0), ); expect(stereographic.conformalLatitude).toEqualEpsilon( 0.52069517, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); }); it("can get conformal latitidude from a Stereographic in the southern hemisphere", function () { let stereographic = new Stereographic.fromCartesian( - Cartesian3.fromDegrees(30.0, -60.0) + Cartesian3.fromDegrees(30.0, -60.0), ); expect(stereographic.conformalLatitude).toEqualEpsilon( -1.04428418, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); stereographic = new Stereographic.fromCartesian( - Cartesian3.fromDegrees(60.0, -30.0) + Cartesian3.fromDegrees(60.0, -30.0), ); expect(stereographic.conformalLatitude).toEqualEpsilon( -0.52069517, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); }); it("can get latitidude from a Stereographic in the northern hemisphere", function () { let stereographic = new Stereographic.fromCartesian( - Cartesian3.fromDegrees(30.0, 60.0) + Cartesian3.fromDegrees(30.0, 60.0), ); expect(stereographic.getLatitude()).toEqualEpsilon( CesiumMath.toRadians(60.0), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); stereographic = new Stereographic.fromCartesian( - Cartesian3.fromDegrees(60.0, 30.0) + Cartesian3.fromDegrees(60.0, 30.0), ); expect(stereographic.getLatitude()).toEqualEpsilon( CesiumMath.toRadians(30.0), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); }); it("can get latitidude from a Stereographic in the southern hemisphere", function () { let stereographic = new Stereographic.fromCartesian( - Cartesian3.fromDegrees(30.0, -60.0) + Cartesian3.fromDegrees(30.0, -60.0), ); expect(stereographic.getLatitude()).toEqualEpsilon( CesiumMath.toRadians(-60.0), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); stereographic = new Stereographic.fromCartesian( - Cartesian3.fromDegrees(60.0, -30.0) + Cartesian3.fromDegrees(60.0, -30.0), ); expect(stereographic.getLatitude()).toEqualEpsilon( CesiumMath.toRadians(-30.0), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); }); @@ -225,33 +225,33 @@ describe("Core/Stereographic", function () { expect(stereographics[0].x).toEqualEpsilon( 0.1347555369, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(stereographics[0].y).toEqualEpsilon( -0.2334034365, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(stereographics[0].tangentPlane).toEqual( - Stereographic.NORTH_POLE_TANGENT_PLANE + Stereographic.NORTH_POLE_TANGENT_PLANE, ); expect(stereographics[1].x).toEqualEpsilon( 0.1347555369, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(stereographics[1].y).toEqualEpsilon( -0.2334034365, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(stereographics[1].tangentPlane).toEqual( - Stereographic.SOUTH_POLE_TANGENT_PLANE + Stereographic.SOUTH_POLE_TANGENT_PLANE, ); }); it("clone works with a result parameter", function () { const stereographic = new Stereographic( new Cartesian2(1.0, 2.0), - Stereographic.SOUTH_POLE_TANGENT_PLANE + Stereographic.SOUTH_POLE_TANGENT_PLANE, ); const result = new Stereographic(); const returnedResult = Stereographic.clone(stereographic, result); @@ -263,7 +263,7 @@ describe("Core/Stereographic", function () { it("clone works without result parmater", function () { const stereographic = new Stereographic( new Cartesian2(1.0, 2.0), - Stereographic.SOUTH_POLE_TANGENT_PLANE + Stereographic.SOUTH_POLE_TANGENT_PLANE, ); const result = Stereographic.clone(stereographic); expect(stereographic).not.toBe(result); diff --git a/packages/engine/Specs/Core/TaskProcessorSpec.js b/packages/engine/Specs/Core/TaskProcessorSpec.js index 80c541b87769..9279ca0ba673 100644 --- a/packages/engine/Specs/Core/TaskProcessorSpec.js +++ b/packages/engine/Specs/Core/TaskProcessorSpec.js @@ -22,7 +22,7 @@ describe("Core/TaskProcessor", function () { it("throws runtime error if browser is not supported", async function () { spyOn(FeatureDetection, "supportsEsmWebWorkers").and.returnValue(false); taskProcessor = new TaskProcessor( - absolutize("../Specs/Build/TestWorkers/returnParameters.js") + absolutize("../Specs/Build/TestWorkers/returnParameters.js"), ); expect(() => taskProcessor.scheduleTask()).toThrowError(RuntimeError); @@ -30,7 +30,7 @@ describe("Core/TaskProcessor", function () { it("works with a simple worker", async function () { taskProcessor = new TaskProcessor( - absolutize("../Build/Specs/TestWorkers/returnParameters.js") + absolutize("../Build/Specs/TestWorkers/returnParameters.js"), ); const parameters = { @@ -41,7 +41,7 @@ describe("Core/TaskProcessor", function () { }; await expectAsync(taskProcessor.scheduleTask(parameters)).toBeResolvedTo( - parameters + parameters, ); }); @@ -49,7 +49,7 @@ describe("Core/TaskProcessor", function () { window.CESIUM_WORKERS = undefined; TaskProcessor._workerModulePrefix = absolutize( - "../Build/Specs/TestWorkers/" + "../Build/Specs/TestWorkers/", ); taskProcessor = new TaskProcessor("returnParameters.js"); @@ -61,7 +61,7 @@ describe("Core/TaskProcessor", function () { }; await expectAsync(taskProcessor.scheduleTask(parameters)).toBeResolvedTo( - parameters + parameters, ); }); @@ -82,7 +82,7 @@ describe("Core/TaskProcessor", function () { expect(blobSpy).toHaveBeenCalledWith( [`import "http://test.com/source/Workers/transferTypedArrayTest.js";`], - { type: "application/javascript" } + { type: "application/javascript" }, ); // Reset old values for BASE_URL @@ -101,13 +101,13 @@ describe("Core/TaskProcessor", function () { expect(blobSpy).toHaveBeenCalledWith( [`import "http://test.com/Workers/testing.js";`], - { type: "application/javascript" } + { type: "application/javascript" }, ); }); it("can be destroyed", function () { taskProcessor = new TaskProcessor( - absolutize("../Specs/Build/TestWorkers/returnParameters.js") + absolutize("../Specs/Build/TestWorkers/returnParameters.js"), ); expect(taskProcessor.isDestroyed()).toEqual(false); @@ -119,7 +119,7 @@ describe("Core/TaskProcessor", function () { it("can transfer array buffer", async function () { taskProcessor = new TaskProcessor( - absolutize("../Build/Specs/TestWorkers/returnByteLength.js") + absolutize("../Build/Specs/TestWorkers/returnByteLength.js"), ); const byteLength = 100; @@ -140,7 +140,7 @@ describe("Core/TaskProcessor", function () { it("can transfer array buffer back from worker", async function () { taskProcessor = new TaskProcessor( - absolutize("../Build/Specs/TestWorkers/transferArrayBuffer.js") + absolutize("../Build/Specs/TestWorkers/transferArrayBuffer.js"), ); const byteLength = 100; @@ -155,7 +155,7 @@ describe("Core/TaskProcessor", function () { it("rejects promise if worker throws", async function () { taskProcessor = new TaskProcessor( - absolutize("../Build/Specs/TestWorkers/throwError.js") + absolutize("../Build/Specs/TestWorkers/throwError.js"), ); const message = "foo"; @@ -164,13 +164,13 @@ describe("Core/TaskProcessor", function () { }; await expectAsync( - taskProcessor.scheduleTask(parameters) + taskProcessor.scheduleTask(parameters), ).toBeRejectedWithError(Error, message); }); it("rejects promise if worker returns a non-clonable result", async function () { taskProcessor = new TaskProcessor( - absolutize("../Build/Specs/TestWorkers/returnNonCloneable.js") + absolutize("../Build/Specs/TestWorkers/returnNonCloneable.js"), ); const message = "foo"; @@ -179,13 +179,13 @@ describe("Core/TaskProcessor", function () { }; await expectAsync(taskProcessor.scheduleTask(parameters)).toBeRejectedWith( - jasmine.stringContaining("postMessage failed") + jasmine.stringContaining("postMessage failed"), ); }); it("successful task raises the taskCompletedEvent", async function () { taskProcessor = new TaskProcessor( - absolutize("../Build/Specs/TestWorkers/returnParameters.js") + absolutize("../Build/Specs/TestWorkers/returnParameters.js"), ); const parameters = { @@ -195,11 +195,10 @@ describe("Core/TaskProcessor", function () { }, }; let eventRaised = false; - const removeListenerCallback = TaskProcessor.taskCompletedEvent.addEventListener( - function () { + const removeListenerCallback = + TaskProcessor.taskCompletedEvent.addEventListener(function () { eventRaised = true; - } - ); + }); await expectAsync(taskProcessor.scheduleTask(parameters)).toBeResolved(); expect(eventRaised).toBe(true); @@ -208,7 +207,7 @@ describe("Core/TaskProcessor", function () { it("unsuccessful task raises the taskCompletedEvent with error", async function () { taskProcessor = new TaskProcessor( - absolutize("../Build/Specs/TestWorkers/returnNonCloneable.js") + absolutize("../Build/Specs/TestWorkers/returnNonCloneable.js"), ); const message = "foo"; @@ -217,12 +216,11 @@ describe("Core/TaskProcessor", function () { }; let eventRaised = false; - const removeListenerCallback = TaskProcessor.taskCompletedEvent.addEventListener( - function (error) { + const removeListenerCallback = + TaskProcessor.taskCompletedEvent.addEventListener(function (error) { eventRaised = true; expect(error).toBeDefined(); - } - ); + }); await expectAsync(taskProcessor.scheduleTask(parameters)).toBeRejected(); expect(eventRaised).toBe(true); @@ -232,7 +230,7 @@ describe("Core/TaskProcessor", function () { it("can load and compile web assembly module", async function () { const binaryUrl = absolutize("../Specs/TestWorkers/TestWasm/testWasm.wasm"); taskProcessor = new TaskProcessor( - absolutize("../Build/Specs/TestWorkers/returnWasmConfig.js", 5) + absolutize("../Build/Specs/TestWorkers/returnWasmConfig.js", 5), ); const result = await taskProcessor.initWebAssemblyModule({ wasmBinaryFile: binaryUrl, @@ -249,7 +247,7 @@ describe("Core/TaskProcessor", function () { it("uses a backup module if web assembly is not supported", async function () { const binaryUrl = absolutize("../Specs/TestWorkers/TestWasm/testWasm.wasm"); taskProcessor = new TaskProcessor( - absolutize("../Build/Specs/TestWorkers/returnWasmConfig.js", 5) + absolutize("../Build/Specs/TestWorkers/returnWasmConfig.js", 5), ); spyOn(FeatureDetection, "supportsWebAssembly").and.returnValue(false); @@ -267,7 +265,7 @@ describe("Core/TaskProcessor", function () { it("throws runtime error if web assembly is not supported and no backup is provided", async function () { const binaryUrl = absolutize("../Specs/TestWorkers/TestWasm/testWasm.wasm"); taskProcessor = new TaskProcessor( - absolutize("../Build/Specs/TestWorkers/returnWasmConfig.js", 5) + absolutize("../Build/Specs/TestWorkers/returnWasmConfig.js", 5), ); spyOn(FeatureDetection, "supportsWebAssembly").and.returnValue(false); @@ -275,7 +273,7 @@ describe("Core/TaskProcessor", function () { await expectAsync( taskProcessor.initWebAssemblyModule({ wasmBinaryFile: binaryUrl, - }) + }), ).toBeRejectedWithError(RuntimeError); }); }); diff --git a/packages/engine/Specs/Core/TerrainEncodingSpec.js b/packages/engine/Specs/Core/TerrainEncodingSpec.js index 3856b6a59521..b6a896a3be58 100644 --- a/packages/engine/Specs/Core/TerrainEncodingSpec.js +++ b/packages/engine/Specs/Core/TerrainEncodingSpec.js @@ -56,7 +56,7 @@ describe("Core/TerrainEncoding", function () { minimumHeight, maximumHeight, fromENU, - hasVertexNormals + hasVertexNormals, ); expect(encoding.quantization).toEqual(TerrainQuantization.NONE); @@ -85,7 +85,7 @@ describe("Core/TerrainEncoding", function () { minimumHeight, maximumHeight, fromENU, - hasVertexNormals + hasVertexNormals, ); expect(encoding.quantization).toEqual(TerrainQuantization.BITS12); @@ -114,7 +114,7 @@ describe("Core/TerrainEncoding", function () { minimumHeight, maximumHeight, fromENU, - hasVertexNormals + hasVertexNormals, ); const position = new Cartesian3(1.0e3, 1.0e3, 1.0e3); @@ -142,7 +142,7 @@ describe("Core/TerrainEncoding", function () { minimumHeight, maximumHeight, fromENU, - hasVertexNormals + hasVertexNormals, ); const position = new Cartesian3(1.0e3, 1.0e3, 1.0e3); @@ -166,7 +166,7 @@ describe("Core/TerrainEncoding", function () { minimumHeight, maximumHeight, fromENU, - hasVertexNormals + hasVertexNormals, ); const position = new Cartesian3(1.0e2, 1.0e2, 1.0e2); @@ -189,7 +189,7 @@ describe("Core/TerrainEncoding", function () { minimumHeight, maximumHeight, fromENU, - hasVertexNormals + hasVertexNormals, ); const position = new Cartesian3(1.0e2, 1.0e2, 1.0e2); @@ -219,7 +219,7 @@ describe("Core/TerrainEncoding", function () { const exaggeratedHeight = VerticalExaggeration.getHeight( height, exaggeration, - exaggerationRelativeHeight + exaggerationRelativeHeight, ); const exaggeratedPosition = new Cartesian3(exaggeratedHeight, 0.0, 0.0); @@ -239,7 +239,7 @@ describe("Core/TerrainEncoding", function () { hasWebMercatorT, hasGeodeticSurfaceNormals, exaggeration, - exaggerationRelativeHeight + exaggerationRelativeHeight, ); const buffer = []; @@ -251,17 +251,17 @@ describe("Core/TerrainEncoding", function () { height, undefined, undefined, - geodeticSurfaceNormal + geodeticSurfaceNormal, ); expect(encoding.stride).toEqual(9); expect(buffer.length).toEqual(encoding.stride); expect(encoding.getExaggeratedPosition(buffer, 0)).toEqualEpsilon( exaggeratedPosition, - CesiumMath.EPSILON5 + CesiumMath.EPSILON5, ); expect( - encoding.decodeGeodeticSurfaceNormal(buffer, 0, new Cartesian3()) + encoding.decodeGeodeticSurfaceNormal(buffer, 0, new Cartesian3()), ).toEqualEpsilon(geodeticSurfaceNormal, CesiumMath.EPSILON5); }); @@ -273,7 +273,7 @@ describe("Core/TerrainEncoding", function () { minimumHeight, maximumHeight, fromENU, - hasVertexNormals + hasVertexNormals, ); const texCoords = new Cartesian2(0.25, 0.75); @@ -286,7 +286,7 @@ describe("Core/TerrainEncoding", function () { expect(encoding.decodeTextureCoordinates(buffer, 0)).toEqualEpsilon( texCoords, - 1.0 / 4095.0 + 1.0 / 4095.0, ); }); @@ -298,7 +298,7 @@ describe("Core/TerrainEncoding", function () { minimumHeight, maximumHeight, fromENU, - hasVertexNormals + hasVertexNormals, ); const texCoords = new Cartesian2(0.75, 0.25); @@ -310,7 +310,7 @@ describe("Core/TerrainEncoding", function () { Cartesian3.ZERO, texCoords, 100.0, - Cartesian3.UNIT_X + Cartesian3.UNIT_X, ); expect(encoding.stride).toEqual(4); @@ -318,7 +318,7 @@ describe("Core/TerrainEncoding", function () { expect(encoding.decodeTextureCoordinates(buffer, 0)).toEqualEpsilon( texCoords, - 1.0 / 4095.0 + 1.0 / 4095.0, ); }); @@ -332,7 +332,7 @@ describe("Core/TerrainEncoding", function () { minimumHeight, maximumHeight, fromENU, - hasVertexNormals + hasVertexNormals, ); const buffer = []; @@ -344,7 +344,7 @@ describe("Core/TerrainEncoding", function () { expect(encoding.decodeHeight(buffer, 0)).toEqualEpsilon( height, - 200.0 / 4095.0 + 200.0 / 4095.0, ); }); @@ -358,7 +358,7 @@ describe("Core/TerrainEncoding", function () { minimumHeight, maximumHeight, fromENU, - hasVertexNormals + hasVertexNormals, ); const buffer = []; @@ -369,7 +369,7 @@ describe("Core/TerrainEncoding", function () { center, Cartesian2.ZERO, height, - Cartesian3.UNIT_X + Cartesian3.UNIT_X, ); expect(encoding.stride).toEqual(4); @@ -377,7 +377,7 @@ describe("Core/TerrainEncoding", function () { expect(encoding.decodeHeight(buffer, 0)).toEqualEpsilon( height, - 200.0 / 4095.0 + 200.0 / 4095.0, ); }); @@ -389,7 +389,7 @@ describe("Core/TerrainEncoding", function () { minimumHeight, maximumHeight, fromENU, - hasVertexNormals + hasVertexNormals, ); const normal = new Cartesian3(1.0, 1.0, 1.0); @@ -403,7 +403,7 @@ describe("Core/TerrainEncoding", function () { center, Cartesian2.ZERO, minimumHeight, - octNormal + octNormal, ); expect(encoding.stride).toEqual(4); @@ -420,7 +420,7 @@ describe("Core/TerrainEncoding", function () { minimumHeight, maximumHeight, fromENU, - hasVertexNormals + hasVertexNormals, ); const oldBuffer = []; @@ -450,7 +450,7 @@ describe("Core/TerrainEncoding", function () { fromENU, hasVertexNormals, hasWebMarcatorT, - hasGeodeticSurfaceNormals + hasGeodeticSurfaceNormals, ); const geodeticSurfaceNormal = new Cartesian3(1.0, 0.0, 0.0); @@ -463,7 +463,7 @@ describe("Core/TerrainEncoding", function () { minimumHeight, undefined, undefined, - geodeticSurfaceNormal + geodeticSurfaceNormal, ); const oldStride = encoding.stride; @@ -496,7 +496,7 @@ describe("Core/TerrainEncoding", function () { minimumHeight, maximumHeight, fromENU, - hasVertexNormals + hasVertexNormals, ); const buffer = []; @@ -525,7 +525,7 @@ describe("Core/TerrainEncoding", function () { minimumHeight, maximumHeight, fromENU, - hasVertexNormals + hasVertexNormals, ); const attributeLocations = encoding.getAttributeLocations(); @@ -551,7 +551,7 @@ describe("Core/TerrainEncoding", function () { minimumHeight, maximumHeight, fromENU, - hasVertexNormals + hasVertexNormals, ); const cloned = TerrainEncoding.clone(encoding); @@ -584,7 +584,7 @@ describe("Core/TerrainEncoding", function () { minimumHeight, maximumHeight, fromENU, - hasVertexNormals + hasVertexNormals, ); const result = new TerrainEncoding(); const cloned = TerrainEncoding.clone(encoding, result); diff --git a/packages/engine/Specs/Core/TileAvailabilitySpec.js b/packages/engine/Specs/Core/TileAvailabilitySpec.js index 6dabad854007..fe4766f80417 100644 --- a/packages/engine/Specs/Core/TileAvailabilitySpec.js +++ b/packages/engine/Specs/Core/TileAvailabilitySpec.js @@ -18,7 +18,7 @@ describe("Core/TileAvailability", function () { 0, 0, tilingScheme.getNumberOfXTilesAtLevel(), - tilingScheme.getNumberOfYTilesAtLevel() + tilingScheme.getNumberOfYTilesAtLevel(), ); return availability; } @@ -28,8 +28,8 @@ describe("Core/TileAvailability", function () { const availability = createAvailability(webMercator, 15); expect( availability.computeMaximumLevelAtPosition( - Cartographic.fromDegrees(25.0, 88.0) - ) + Cartographic.fromDegrees(25.0, 88.0), + ), ).toBe(-1); }); @@ -37,8 +37,8 @@ describe("Core/TileAvailability", function () { const availability = createAvailability(geographic, 15); expect( availability.computeMaximumLevelAtPosition( - Cartographic.fromDegrees(25.0, 88.0) - ) + Cartographic.fromDegrees(25.0, 88.0), + ), ).toBe(0); }); @@ -48,8 +48,8 @@ describe("Core/TileAvailability", function () { availability.addAvailableTileRange(1, 1, 0, 1, 0); expect( availability.computeMaximumLevelAtPosition( - Cartographic.fromRadians(0.0, 0.0) - ) + Cartographic.fromRadians(0.0, 0.0), + ), ).toBe(1); // Make sure it isn't dependent on the order we add the rectangles. @@ -58,8 +58,8 @@ describe("Core/TileAvailability", function () { availability.addAvailableTileRange(0, 0, 0, 0, 0); expect( availability.computeMaximumLevelAtPosition( - Cartographic.fromRadians(0.0, 0.0) - ) + Cartographic.fromRadians(0.0, 0.0), + ), ).toBe(1); }); @@ -69,8 +69,8 @@ describe("Core/TileAvailability", function () { availability.addAvailableTileRange(1, 1, 1, 1, 1); expect( availability.computeMaximumLevelAtPosition( - Cartographic.fromRadians(-Math.PI / 2.0, 0.0) - ) + Cartographic.fromRadians(-Math.PI / 2.0, 0.0), + ), ).toBe(1); }); }); @@ -80,8 +80,8 @@ describe("Core/TileAvailability", function () { const availability = createAvailability(geographic, 15); expect( availability.computeBestAvailableLevelOverRectangle( - Rectangle.fromDegrees(1.0, 2.0, 3.0, 4.0) - ) + Rectangle.fromDegrees(1.0, 2.0, 3.0, 4.0), + ), ).toBe(0); }); @@ -92,13 +92,13 @@ describe("Core/TileAvailability", function () { 0, 0, geographic.getNumberOfXTilesAtLevel(5) - 1, - geographic.getNumberOfYTilesAtLevel(5) - 1 + geographic.getNumberOfYTilesAtLevel(5) - 1, ); availability.addAvailableTileRange(6, 7, 8, 9, 10); expect( availability.computeBestAvailableLevelOverRectangle( - Rectangle.fromDegrees(1.0, 2.0, 3.0, 4.0) - ) + Rectangle.fromDegrees(1.0, 2.0, 3.0, 4.0), + ), ).toBe(5); }); @@ -109,12 +109,12 @@ describe("Core/TileAvailability", function () { 0, 0, geographic.getNumberOfXTilesAtLevel(5) - 1, - geographic.getNumberOfYTilesAtLevel(5) - 1 + geographic.getNumberOfYTilesAtLevel(5) - 1, ); availability.addAvailableTileRange(6, 7, 8, 9, 10); const rectangle = geographic.tileXYToRectangle(8, 9, 6); expect( - availability.computeBestAvailableLevelOverRectangle(rectangle) + availability.computeBestAvailableLevelOverRectangle(rectangle), ).toBe(6); }); @@ -125,7 +125,7 @@ describe("Core/TileAvailability", function () { 0, 0, geographic.getNumberOfXTilesAtLevel(5) - 1, - geographic.getNumberOfYTilesAtLevel(5) - 1 + geographic.getNumberOfYTilesAtLevel(5) - 1, ); availability.addAvailableTileRange(6, 7, 8, 7, 8); const rectangle = geographic.tileXYToRectangle(7, 8, 6); @@ -134,7 +134,7 @@ describe("Core/TileAvailability", function () { rectangle.south -= 0.01; rectangle.north += 0.01; expect( - availability.computeBestAvailableLevelOverRectangle(rectangle) + availability.computeBestAvailableLevelOverRectangle(rectangle), ).toBe(5); }); @@ -145,30 +145,30 @@ describe("Core/TileAvailability", function () { 0, 0, geographic.getNumberOfXTilesAtLevel(5) - 1, - geographic.getNumberOfYTilesAtLevel(5) - 1 + geographic.getNumberOfYTilesAtLevel(5) - 1, ); availability.addAvailableTileRange( 6, 0, 0, 10, - geographic.getNumberOfYTilesAtLevel(6) - 1 + geographic.getNumberOfYTilesAtLevel(6) - 1, ); availability.addAvailableTileRange( 6, geographic.getNumberOfXTilesAtLevel(6) - 11, 0, geographic.getNumberOfXTilesAtLevel(6) - 1, - geographic.getNumberOfYTilesAtLevel(6) - 1 + geographic.getNumberOfYTilesAtLevel(6) - 1, ); let rectangle = Rectangle.fromDegrees(179.0, 45.0, -179.0, 50.0); expect( - availability.computeBestAvailableLevelOverRectangle(rectangle) + availability.computeBestAvailableLevelOverRectangle(rectangle), ).toBe(6); rectangle = Rectangle.fromDegrees(45.0, 45.0, -45.0, 50.0); expect( - availability.computeBestAvailableLevelOverRectangle(rectangle) + availability.computeBestAvailableLevelOverRectangle(rectangle), ).toBe(5); }); @@ -179,7 +179,7 @@ describe("Core/TileAvailability", function () { 0, 0, geographic.getNumberOfXTilesAtLevel(5) - 1, - geographic.getNumberOfYTilesAtLevel(5) - 1 + geographic.getNumberOfYTilesAtLevel(5) - 1, ); availability.addAvailableTileRange(6, 0, 2, 1, 3); availability.addAvailableTileRange(6, 2, 0, 3, 1); @@ -187,7 +187,7 @@ describe("Core/TileAvailability", function () { availability.addAvailableTileRange(6, 2, 2, 3, 3); const rectangle = geographic.tileXYToRectangle(0, 0, 4); expect( - availability.computeBestAvailableLevelOverRectangle(rectangle) + availability.computeBestAvailableLevelOverRectangle(rectangle), ).toBe(6); }); }); @@ -202,7 +202,7 @@ describe("Core/TileAvailability", function () { for (let i = 0; i < levelRectangles.length; ++i) { for (let j = i; j < levelRectangles.length; ++j) { expect(levelRectangles[i].level <= levelRectangles[j].level).toBe( - true + true, ); } } @@ -219,8 +219,8 @@ describe("Core/TileAvailability", function () { availability.addAvailableTileRange(1, 0, 0, 3, 1); expect( availability.computeMaximumLevelAtPosition( - new Cartographic(-Math.PI / 2.0, 0.0) - ) + new Cartographic(-Math.PI / 2.0, 0.0), + ), ).toBe(1); // We should get the same result adding them in the opposite order. @@ -229,8 +229,8 @@ describe("Core/TileAvailability", function () { availability.addAvailableTileRange(0, 0, 0, 1, 0); expect( availability.computeMaximumLevelAtPosition( - new Cartographic(-Math.PI / 2.0, 0.0) - ) + new Cartographic(-Math.PI / 2.0, 0.0), + ), ).toBe(1); }); diff --git a/packages/engine/Specs/Core/TimeIntervalCollectionSpec.js b/packages/engine/Specs/Core/TimeIntervalCollectionSpec.js index 707215ec6292..f365491cb12f 100644 --- a/packages/engine/Specs/Core/TimeIntervalCollectionSpec.js +++ b/packages/engine/Specs/Core/TimeIntervalCollectionSpec.js @@ -26,7 +26,7 @@ describe("Core/TimeIntervalCollection", function () { julianDates, isStartIncluded, isStopIncluded, - dataCallback + dataCallback, ) { dataCallback = defaultValue(dataCallback, defaultDataCallback); const length = intervals.length; @@ -37,7 +37,7 @@ describe("Core/TimeIntervalCollection", function () { expect(JulianDate.compare(interval.stop, julianDates[i + 1])).toEqual(0); expect(interval.isStartIncluded).toBe(i === 0 ? isStartIncluded : true); expect(interval.isStopIncluded).toBe( - i === length - 1 ? isStopIncluded : false + i === length - 1 ? isStopIncluded : false, ); expect(interval.data).toEqual(dataCallback(interval, i)); } @@ -291,7 +291,7 @@ describe("Core/TimeIntervalCollection", function () { stop: interval2.stop, isStartIncluded: true, isStopIncluded: false, - }) + }), ).toEqual(interval2); }); @@ -325,7 +325,7 @@ describe("Core/TimeIntervalCollection", function () { intervals.findInterval({ start: interval2.start, stop: interval2.stop, - }) + }), ).toEqual(interval2); }); @@ -357,7 +357,7 @@ describe("Core/TimeIntervalCollection", function () { stop: new JulianDate(2), isStartIncluded: false, isStopIncluded: true, - }) + }), ); expect(intervals.isEmpty).toEqual(false); intervals.removeAll(); @@ -375,7 +375,7 @@ describe("Core/TimeIntervalCollection", function () { isStartIncluded: true, isStopIncluded: true, data: 1, - }) + }), ); expect(intervals.length).toEqual(1); @@ -386,7 +386,7 @@ describe("Core/TimeIntervalCollection", function () { isStartIncluded: true, isStopIncluded: true, data: 2, - }) + }), ); expect(intervals.length).toEqual(3); @@ -404,7 +404,7 @@ describe("Core/TimeIntervalCollection", function () { isStartIncluded: true, isStopIncluded: true, data: 1, - }) + }), ); expect(intervals.length).toEqual(1); @@ -415,7 +415,7 @@ describe("Core/TimeIntervalCollection", function () { isStartIncluded: true, isStopIncluded: true, data: 1, - }) + }), ); expect(intervals.length).toEqual(1); @@ -455,10 +455,10 @@ describe("Core/TimeIntervalCollection", function () { expect(intervals.isEmpty).toEqual(false); expect(intervals.findIntervalContainingDate(interval1.start)).toEqual( - interval1 + interval1, ); expect(intervals.findIntervalContainingDate(interval1.stop)).toEqual( - interval1 + interval1, ); intervals.addInterval(interval2); @@ -469,13 +469,13 @@ describe("Core/TimeIntervalCollection", function () { expect(intervals.isEmpty).toEqual(false); expect(intervals.findIntervalContainingDate(interval1.start)).toEqual( - interval1 + interval1, ); expect(intervals.findIntervalContainingDate(interval1.stop)).toEqual( - interval1 + interval1, ); expect(intervals.findIntervalContainingDate(interval2.stop)).toEqual( - interval2 + interval2, ); intervals.addInterval(interval3); @@ -485,19 +485,19 @@ describe("Core/TimeIntervalCollection", function () { expect(intervals.isEmpty).toEqual(false); expect(intervals.findIntervalContainingDate(interval1.start)).toEqual( - interval1 + interval1, ); expect(intervals.findIntervalContainingDate(interval1.stop)).toEqual( - interval1 + interval1, ); expect(intervals.findIntervalContainingDate(interval2.stop)).toEqual( - interval2 + interval2, ); expect(intervals.findIntervalContainingDate(interval3.start)).toEqual( - interval3 + interval3, ); expect(intervals.findIntervalContainingDate(interval3.stop)).toEqual( - interval3 + interval3, ); }); @@ -533,10 +533,10 @@ describe("Core/TimeIntervalCollection", function () { expect(intervals.isEmpty).toEqual(false); expect(intervals.findIntervalContainingDate(interval1.start).data).toEqual( - 1 + 1, ); expect(intervals.findIntervalContainingDate(interval1.stop).data).toEqual( - 1 + 1, ); intervals.addInterval(interval2); @@ -547,13 +547,13 @@ describe("Core/TimeIntervalCollection", function () { expect(intervals.isEmpty).toEqual(false); expect(intervals.findIntervalContainingDate(interval1.start).data).toEqual( - 1 + 1, ); expect(intervals.findIntervalContainingDate(interval1.stop).data).toEqual( - 2 + 2, ); expect(intervals.findIntervalContainingDate(interval2.stop).data).toEqual( - 2 + 2, ); intervals.addInterval(interval3); @@ -563,22 +563,22 @@ describe("Core/TimeIntervalCollection", function () { expect(intervals.isEmpty).toEqual(false); expect(intervals.findIntervalContainingDate(interval1.start).data).toEqual( - 3 + 3, ); expect(intervals.findIntervalContainingDate(interval1.stop).data).toEqual( - 3 + 3, ); expect(intervals.findIntervalContainingDate(interval2.start).data).toEqual( - 3 + 3, ); expect(intervals.findIntervalContainingDate(interval2.stop).data).toEqual( - 3 + 3, ); expect(intervals.findIntervalContainingDate(interval3.start).data).toEqual( - 3 + 3, ); expect(intervals.findIntervalContainingDate(interval3.stop).data).toEqual( - 3 + 3, ); }); @@ -601,25 +601,25 @@ describe("Core/TimeIntervalCollection", function () { const intervals = new TimeIntervalCollection(); intervals.addInterval(interval1); expect( - intervals.findDataForIntervalContainingDate(interval1.start) + intervals.findDataForIntervalContainingDate(interval1.start), ).toEqual(1); expect(intervals.findDataForIntervalContainingDate(interval1.stop)).toEqual( - 1 + 1, ); intervals.addInterval(interval2); expect( - intervals.findDataForIntervalContainingDate(interval1.start) + intervals.findDataForIntervalContainingDate(interval1.start), ).toEqual(1); expect(intervals.findDataForIntervalContainingDate(interval1.stop)).toEqual( - 2 + 2, ); expect(intervals.findDataForIntervalContainingDate(interval2.stop)).toEqual( - 2 + 2, ); expect( - intervals.findDataForIntervalContainingDate(new JulianDate(5)) + intervals.findDataForIntervalContainingDate(new JulianDate(5)), ).toBeUndefined(); }); @@ -697,7 +697,7 @@ describe("Core/TimeIntervalCollection", function () { startDays, stopDays, isStartIncluded, - isStopIncluded + isStopIncluded, ) { return new TimeInterval({ start: new JulianDate(startDays, 0.0, TimeStandard.TAI), @@ -717,25 +717,25 @@ describe("Core/TimeIntervalCollection", function () { // Before first expect(intervals.removeInterval(createTimeInterval(1.0, 5.0))).toEqual( - false + false, ); expect(intervals.length).toEqual(2); // After last expect(intervals.removeInterval(createTimeInterval(50.0, 60.0))).toEqual( - false + false, ); expect(intervals.length).toEqual(2); // Inside hole expect(intervals.removeInterval(createTimeInterval(22.0, 28.0))).toEqual( - false + false, ); expect(intervals.length).toEqual(2); // From beginning expect(intervals.removeInterval(createTimeInterval(5.0, 15.0))).toEqual( - true + true, ); expect(intervals.length).toEqual(2); expect(JulianDate.totalDays(intervals.get(0).start)).toEqual(15.0); @@ -743,7 +743,7 @@ describe("Core/TimeIntervalCollection", function () { // From end expect(intervals.removeInterval(createTimeInterval(35.0, 45.0))).toEqual( - true + true, ); expect(intervals.length).toEqual(2); expect(JulianDate.totalDays(intervals.get(1).start)).toEqual(30.0); @@ -755,7 +755,7 @@ describe("Core/TimeIntervalCollection", function () { // From middle of single interval expect(intervals.removeInterval(createTimeInterval(12.0, 18.0))).toEqual( - true + true, ); expect(intervals.length).toEqual(3); expect(JulianDate.totalDays(intervals.get(0).stop)).toEqual(12.0); @@ -770,7 +770,7 @@ describe("Core/TimeIntervalCollection", function () { // Span an entire interval and into part of next expect(intervals.removeInterval(createTimeInterval(25.0, 46.0))).toEqual( - true + true, ); expect(intervals.length).toEqual(2); expect(JulianDate.totalDays(intervals.get(1).start)).toEqual(46.0); @@ -783,7 +783,7 @@ describe("Core/TimeIntervalCollection", function () { // Interval ends at same date as an existing interval expect(intervals.removeInterval(createTimeInterval(25.0, 40.0))).toEqual( - true + true, ); expect(intervals.length).toEqual(2); expect(JulianDate.totalDays(intervals.get(0).stop)).toEqual(20.0); @@ -797,7 +797,7 @@ describe("Core/TimeIntervalCollection", function () { // Interval ends at same date as an existing interval and single point of existing // interval survives. expect( - intervals.removeInterval(createTimeInterval(25.0, 40.0, true, false)) + intervals.removeInterval(createTimeInterval(25.0, 40.0, true, false)), ).toEqual(true); expect(intervals.length).toEqual(3); expect(JulianDate.totalDays(intervals.get(0).stop)).toEqual(20.0); @@ -815,7 +815,7 @@ describe("Core/TimeIntervalCollection", function () { // Interval ends at same date as an existing interval, single point of existing // interval survives, and single point can be combined with the next interval. expect( - intervals.removeInterval(createTimeInterval(25.0, 40.0, true, false)) + intervals.removeInterval(createTimeInterval(25.0, 40.0, true, false)), ).toEqual(true); expect(intervals.length).toEqual(2); expect(JulianDate.totalDays(intervals.get(0).stop)).toEqual(20.0); @@ -827,7 +827,7 @@ describe("Core/TimeIntervalCollection", function () { // End point of removal interval overlaps first point of existing interval. expect(intervals.removeInterval(createTimeInterval(0.0, 10.0))).toEqual( - true + true, ); expect(intervals.length).toEqual(1); expect(JulianDate.totalDays(intervals.get(0).start)).toEqual(10.0); @@ -841,7 +841,7 @@ describe("Core/TimeIntervalCollection", function () { // Start point of removal interval does NOT overlap last point of existing interval // because the start point is not included. expect( - intervals.removeInterval(createTimeInterval(20.0, 30.0, false, true)) + intervals.removeInterval(createTimeInterval(20.0, 30.0, false, true)), ).toEqual(false); expect(intervals.length).toEqual(1); expect(JulianDate.totalDays(intervals.get(0).start)).toEqual(10.0); @@ -853,7 +853,7 @@ describe("Core/TimeIntervalCollection", function () { intervals.removeAll(); intervals.addInterval(createTimeInterval(0.0, 20.0)); expect( - intervals.removeInterval(createTimeInterval(0.0, 20.0, false, false)) + intervals.removeInterval(createTimeInterval(0.0, 20.0, false, false)), ).toEqual(true); expect(intervals.length).toEqual(2); expect(JulianDate.totalDays(intervals.get(0).start)).toEqual(0.0); @@ -946,37 +946,37 @@ describe("Core/TimeIntervalCollection", function () { isStartIncluded: true, isStopIncluded: true, data: undefined, - }) + }), ); } function expectCollection(collection, count, expectation) { expectation.forEach(function (item) { const interval = collection.findIntervalContainingDate( - new JulianDate(CONST_DAY_NUM, item.sec) + new JulianDate(CONST_DAY_NUM, item.sec), ); if (item.data === null) { // expect the interval at this time not to exist if (interval !== undefined) { throw new Error( - `expected undefined at ${item.sec} seconds but it was ${interval.data}` + `expected undefined at ${item.sec} seconds but it was ${interval.data}`, ); } expect(interval).toBeUndefined(); } else if (interval === undefined) { throw new Error( - `expected ${item.data} at ${item.sec} seconds, but it was undefined` + `expected ${item.data} at ${item.sec} seconds, but it was undefined`, ); } else if (interval.data !== item.data) { throw new Error( - `expected ${item.data} at ${item.sec} seconds, but it was ${interval.data}` + `expected ${item.data} at ${item.sec} seconds, but it was ${interval.data}`, ); } }); if (collection.length !== count) { throw new Error( - `Expected interval to have ${count} elements but it had ${collection.length}` + `Expected interval to have ${count} elements but it had ${collection.length}`, ); } } @@ -1232,7 +1232,7 @@ describe("Core/TimeIntervalCollection", function () { stop: new JulianDate(2), isStartIncluded: true, isStopIncluded: false, - }) + }), ); intervals.addInterval( new TimeInterval({ @@ -1240,7 +1240,7 @@ describe("Core/TimeIntervalCollection", function () { stop: new JulianDate(3), isStartIncluded: false, isStopIncluded: false, - }) + }), ); intervals.addInterval( new TimeInterval({ @@ -1248,7 +1248,7 @@ describe("Core/TimeIntervalCollection", function () { stop: new JulianDate(4), isStartIncluded: false, isStopIncluded: false, - }) + }), ); intervals.addInterval( new TimeInterval({ @@ -1256,7 +1256,7 @@ describe("Core/TimeIntervalCollection", function () { stop: new JulianDate(5), isStartIncluded: false, isStopIncluded: true, - }) + }), ); const removedInterval = new TimeInterval({ @@ -1280,7 +1280,7 @@ describe("Core/TimeIntervalCollection", function () { stop: new JulianDate(4), isStartIncluded: true, isStopIncluded: true, - }) + }), ); expect(left.intersect(new TimeIntervalCollection()).length).toEqual(0); }); @@ -1293,7 +1293,7 @@ describe("Core/TimeIntervalCollection", function () { stop: new JulianDate(2), isStartIncluded: true, isStopIncluded: false, - }) + }), ); const right = new TimeIntervalCollection(); @@ -1303,7 +1303,7 @@ describe("Core/TimeIntervalCollection", function () { stop: new JulianDate(3), isStartIncluded: true, isStopIncluded: true, - }) + }), ); expect(left.intersect(right).length).toEqual(0); }); @@ -1316,7 +1316,7 @@ describe("Core/TimeIntervalCollection", function () { stop: new JulianDate(4), isStartIncluded: true, isStopIncluded: true, - }) + }), ); const right = new TimeIntervalCollection(); @@ -1326,7 +1326,7 @@ describe("Core/TimeIntervalCollection", function () { stop: new JulianDate(3), isStartIncluded: false, isStopIncluded: false, - }) + }), ); const intersectedIntervals = left.intersect(right); @@ -1347,7 +1347,7 @@ describe("Core/TimeIntervalCollection", function () { isStartIncluded: true, isStopIncluded: true, data: new TestObject(1), - }) + }), ); const right = new TimeIntervalCollection(); @@ -1358,13 +1358,13 @@ describe("Core/TimeIntervalCollection", function () { isStartIncluded: false, isStopIncluded: false, data: new TestObject(2), - }) + }), ); const intersectedIntervals = left.intersect( right, TestObject.equals, - TestObject.merge + TestObject.merge, ); expect(intersectedIntervals.length).toEqual(1); @@ -1416,7 +1416,7 @@ describe("Core/TimeIntervalCollection", function () { isStartIncluded: true, isStopIncluded: true, data: {}, - }) + }), ); left.addInterval( new TimeInterval({ @@ -1425,7 +1425,7 @@ describe("Core/TimeIntervalCollection", function () { isStartIncluded: false, isStopIncluded: true, data: {}, - }) + }), ); left.addInterval( new TimeInterval({ @@ -1434,7 +1434,7 @@ describe("Core/TimeIntervalCollection", function () { isStartIncluded: true, isStopIncluded: true, data: {}, - }) + }), ); const right = new TimeIntervalCollection(); @@ -1445,7 +1445,7 @@ describe("Core/TimeIntervalCollection", function () { isStartIncluded: true, isStopIncluded: true, data: {}, - }) + }), ); right.addInterval( new TimeInterval({ @@ -1454,7 +1454,7 @@ describe("Core/TimeIntervalCollection", function () { isStartIncluded: false, isStopIncluded: true, data: {}, - }) + }), ); right.addInterval( new TimeInterval({ @@ -1463,7 +1463,7 @@ describe("Core/TimeIntervalCollection", function () { isStartIncluded: true, isStopIncluded: true, data: {}, - }) + }), ); expect(left.equals(right)).toEqual(false); @@ -1471,13 +1471,13 @@ describe("Core/TimeIntervalCollection", function () { expect( left.equals(right, function () { return true; - }) + }), ).toEqual(true); expect( left.equals(right, function () { return false; - }) + }), ).toEqual(false); }); @@ -1891,7 +1891,7 @@ describe("Core/TimeIntervalCollection", function () { // Check trailing interval const trailing = intervals._intervals.pop(); expect( - JulianDate.compare(trailing.start, julianDates[iso8601Dates.length - 1]) + JulianDate.compare(trailing.start, julianDates[iso8601Dates.length - 1]), ).toEqual(0); expect(JulianDate.compare(trailing.stop, Iso8601.MAXIMUM_VALUE)).toEqual(0); expect(trailing.isStartIncluded).toBe(false); @@ -1938,7 +1938,7 @@ describe("Core/TimeIntervalCollection", function () { // Check trailing interval const trailing = intervals._intervals.pop(); expect( - JulianDate.compare(trailing.start, julianDates[iso8601Dates.length - 1]) + JulianDate.compare(trailing.start, julianDates[iso8601Dates.length - 1]), ).toEqual(0); expect(JulianDate.compare(trailing.stop, Iso8601.MAXIMUM_VALUE)).toEqual(0); expect(trailing.isStartIncluded).toBe(true); @@ -2009,7 +2009,7 @@ describe("Core/TimeIntervalCollection", function () { // Check trailing interval const trailing = intervals._intervals.pop(); expect( - JulianDate.compare(trailing.start, julianDates[iso8601Dates.length - 1]) + JulianDate.compare(trailing.start, julianDates[iso8601Dates.length - 1]), ).toEqual(0); expect(JulianDate.compare(trailing.stop, Iso8601.MAXIMUM_VALUE)).toEqual(0); expect(trailing.isStartIncluded).toBe(false); @@ -2054,7 +2054,7 @@ describe("Core/TimeIntervalCollection", function () { // Check trailing interval const trailing = intervals._intervals.pop(); expect( - JulianDate.compare(trailing.start, julianDates[iso8601Dates.length - 1]) + JulianDate.compare(trailing.start, julianDates[iso8601Dates.length - 1]), ).toEqual(0); expect(JulianDate.compare(trailing.stop, Iso8601.MAXIMUM_VALUE)).toEqual(0); expect(trailing.isStartIncluded).toBe(true); @@ -2103,7 +2103,7 @@ describe("Core/TimeIntervalCollection", function () { // Check trailing interval const trailing = intervals._intervals.pop(); expect( - JulianDate.compare(trailing.start, julianDates[iso8601Dates.length - 1]) + JulianDate.compare(trailing.start, julianDates[iso8601Dates.length - 1]), ).toEqual(0); expect(JulianDate.compare(trailing.stop, Iso8601.MAXIMUM_VALUE)).toEqual(0); expect(trailing.isStartIncluded).toBe(true); @@ -2152,7 +2152,7 @@ describe("Core/TimeIntervalCollection", function () { // Check trailing interval const trailing = intervals._intervals.pop(); expect( - JulianDate.compare(trailing.start, julianDates[iso8601Dates.length - 1]) + JulianDate.compare(trailing.start, julianDates[iso8601Dates.length - 1]), ).toEqual(0); expect(JulianDate.compare(trailing.stop, Iso8601.MAXIMUM_VALUE)).toEqual(0); expect(trailing.isStartIncluded).toBe(true); diff --git a/packages/engine/Specs/Core/TimeIntervalSpec.js b/packages/engine/Specs/Core/TimeIntervalSpec.js index 465c1382f83e..ec596303ab8c 100644 --- a/packages/engine/Specs/Core/TimeIntervalSpec.js +++ b/packages/engine/Specs/Core/TimeIntervalSpec.js @@ -87,7 +87,7 @@ describe("Core/TimeInterval", function () { isStopIncluded: isStopIncluded, data: data, }, - expectedResult + expectedResult, ); expect(expectedResult).toBe(interval); @@ -112,7 +112,7 @@ describe("Core/TimeInterval", function () { stop: JulianDate.fromIso8601(isoDate2), }); expect(TimeInterval.toIso8601(interval)).toEqual( - "0950-01-02T03:04:05Z/0950-01-03T03:04:05Z" + "0950-01-02T03:04:05Z/0950-01-03T03:04:05Z", ); }); @@ -124,7 +124,7 @@ describe("Core/TimeInterval", function () { expect( TimeInterval.fromIso8601({ iso8601: TimeInterval.toIso8601(interval), - }) + }), ).toEqual(interval); }); @@ -136,10 +136,10 @@ describe("Core/TimeInterval", function () { stop: JulianDate.fromIso8601(isoDate2), }); expect(TimeInterval.toIso8601(interval, 0)).toEqual( - "0950-01-02T03:04:05Z/0950-01-03T03:04:05Z" + "0950-01-02T03:04:05Z/0950-01-03T03:04:05Z", ); expect(TimeInterval.toIso8601(interval, 7)).toEqual( - "0950-01-02T03:04:05.0123450Z/0950-01-03T03:04:05.0123450Z" + "0950-01-02T03:04:05.0123450Z/0950-01-03T03:04:05.0123450Z", ); }); @@ -223,16 +223,16 @@ describe("Core/TimeInterval", function () { stop: new JulianDate(2451546), }); expect(TimeInterval.contains(interval, new JulianDate(2451545.5))).toEqual( - true + true, ); expect(TimeInterval.contains(interval, new JulianDate(2451546.5))).toEqual( - false + false, ); }); it("contains works for an empty interval.", function () { expect(TimeInterval.contains(TimeInterval.EMPTY, new JulianDate())).toEqual( - false + false, ); }); @@ -244,10 +244,10 @@ describe("Core/TimeInterval", function () { isStopIncluded: true, }); expect(TimeInterval.contains(interval, new JulianDate(2451545))).toEqual( - true + true, ); expect(TimeInterval.contains(interval, new JulianDate(2451546))).toEqual( - true + true, ); }); @@ -259,10 +259,10 @@ describe("Core/TimeInterval", function () { isStopIncluded: false, }); expect(TimeInterval.contains(interval, new JulianDate(2451545))).toEqual( - false + false, ); expect(TimeInterval.contains(interval, new JulianDate(2451546))).toEqual( - false + false, ); }); @@ -571,12 +571,12 @@ describe("Core/TimeInterval", function () { const intersect1 = TimeInterval.intersect( first, second, - new TimeInterval() + new TimeInterval(), ); const intersect2 = TimeInterval.intersect( second, first, - new TimeInterval() + new TimeInterval(), ); expect(intersect1).toEqual(intersect2); expect(intersect2).toEqual(intersect1); @@ -590,7 +590,7 @@ describe("Core/TimeInterval", function () { stop: new JulianDate(2), }); expect( - TimeInterval.intersect(interval, undefined, new TimeInterval()) + TimeInterval.intersect(interval, undefined, new TimeInterval()), ).toEqual(TimeInterval.EMPTY); }); @@ -611,7 +611,7 @@ describe("Core/TimeInterval", function () { new TimeInterval(), function (left, right) { return left + right; - } + }, ); expect(twoToThree.start).toEqual(twoToFour.start); expect(twoToThree.stop).toEqual(oneToThree.stop); diff --git a/packages/engine/Specs/Core/TipsifySpec.js b/packages/engine/Specs/Core/TipsifySpec.js index df81516f5aa3..354d5630ff83 100644 --- a/packages/engine/Specs/Core/TipsifySpec.js +++ b/packages/engine/Specs/Core/TipsifySpec.js @@ -8,7 +8,7 @@ describe("Core/Tipsify", function () { indices: [0, 1, 2, 0, 2, 3, 0, 3, 4, 0, 4, 5, 0, 5, 6, 0, 1, 6], maximumIndex: 6, cacheSize: 3, - }) + }), ).toEqual(2); }); @@ -17,7 +17,7 @@ describe("Core/Tipsify", function () { Tipsify.calculateACMR({ indices: [0, 1, 2, 0, 2, 3, 0, 3, 4, 0, 4, 5, 0, 5, 6, 0, 1, 6], cacheSize: 3, - }) + }), ).toEqual(2); }); @@ -93,117 +93,12 @@ describe("Core/Tipsify", function () { it("can lower ACMR using the Tipsify algorithm", function () { const indices = [ - 0, - 1, - 7, - 1, - 7, - 8, - 1, - 2, - 8, - 2, - 8, - 9, - 2, - 3, - 9, - 3, - 9, - 10, - 3, - 4, - 10, - 4, - 10, - 11, - 4, - 5, - 11, - 5, - 11, - 12, - 6, - 13, - 14, - 6, - 7, - 14, - 7, - 14, - 15, - 7, - 8, - 15, - 8, - 15, - 16, - 8, - 9, - 16, - 9, - 16, - 17, - 9, - 10, - 17, - 10, - 17, - 18, - 10, - 11, - 18, - 11, - 18, - 19, - 11, - 12, - 19, - 12, - 19, - 20, - 13, - 21, - 22, - 13, - 14, - 22, - 14, - 22, - 23, - 14, - 15, - 23, - 15, - 23, - 24, - 15, - 16, - 24, - 16, - 24, - 25, - 16, - 17, - 25, - 17, - 25, - 26, - 17, - 18, - 26, - 18, - 26, - 27, - 18, - 19, - 27, - 19, - 27, - 28, - 19, - 20, - 28, + 0, 1, 7, 1, 7, 8, 1, 2, 8, 2, 8, 9, 2, 3, 9, 3, 9, 10, 3, 4, 10, 4, 10, + 11, 4, 5, 11, 5, 11, 12, 6, 13, 14, 6, 7, 14, 7, 14, 15, 7, 8, 15, 8, 15, + 16, 8, 9, 16, 9, 16, 17, 9, 10, 17, 10, 17, 18, 10, 11, 18, 11, 18, 19, + 11, 12, 19, 12, 19, 20, 13, 21, 22, 13, 14, 22, 14, 22, 23, 14, 15, 23, + 15, 23, 24, 15, 16, 24, 16, 24, 25, 16, 17, 25, 17, 25, 26, 17, 18, 26, + 18, 26, 27, 18, 19, 27, 19, 27, 28, 19, 20, 28, ]; const acmrBefore = Tipsify.calculateACMR({ indices: indices, @@ -225,120 +120,15 @@ describe("Core/Tipsify", function () { it("can Tipsify without knowing the maximum index", function () { const indices = [ - 0, - 1, - 7, - 1, - 7, - 8, - 1, - 2, - 8, - 2, - 8, - 9, - 2, - 3, - 9, - 3, - 9, - 10, - 3, - 4, - 10, - 4, - 10, - 11, - 4, - 5, - 11, - 5, - 11, - 12, - 6, - 13, - 14, - 6, - 7, - 14, - 7, - 14, - 15, - 7, - 8, - 15, - 8, - 15, - 16, - 8, - 9, - 16, - 9, - 16, - 17, - 9, - 10, - 17, - 10, - 17, - 18, - 10, - 11, - 18, - 11, - 18, - 19, - 11, - 12, - 19, - 12, - 19, - 20, - 13, - 21, - 22, - 13, - 14, - 22, - 14, - 22, - 23, - 14, - 15, - 23, - 15, - 23, - 24, - 15, - 16, - 24, - 16, - 24, - 25, - 16, - 17, - 25, - 17, - 25, - 26, - 17, - 18, - 26, - 18, - 26, - 27, - 18, - 19, - 27, - 19, - 27, - 28, - 19, - 20, - 28, + 0, 1, 7, 1, 7, 8, 1, 2, 8, 2, 8, 9, 2, 3, 9, 3, 9, 10, 3, 4, 10, 4, 10, + 11, 4, 5, 11, 5, 11, 12, 6, 13, 14, 6, 7, 14, 7, 14, 15, 7, 8, 15, 8, 15, + 16, 8, 9, 16, 9, 16, 17, 9, 10, 17, 10, 17, 18, 10, 11, 18, 11, 18, 19, + 11, 12, 19, 12, 19, 20, 13, 21, 22, 13, 14, 22, 14, 22, 23, 14, 15, 23, + 15, 23, 24, 15, 16, 24, 16, 24, 25, 16, 17, 25, 17, 25, 26, 17, 18, 26, + 18, 26, 27, 18, 19, 27, 19, 27, 28, 19, 20, 28, ]; expect(Tipsify.tipsify({ indices: indices, cacheSize: 6 })).toEqual( - Tipsify.tipsify({ indices: indices, maximumIndex: 28, cacheSize: 6 }) + Tipsify.tipsify({ indices: indices, maximumIndex: 28, cacheSize: 6 }), ); }); }); diff --git a/packages/engine/Specs/Core/TransformsSpec.js b/packages/engine/Specs/Core/TransformsSpec.js index 1f2277b58330..a879b23d9a35 100644 --- a/packages/engine/Specs/Core/TransformsSpec.js +++ b/packages/engine/Specs/Core/TransformsSpec.js @@ -30,24 +30,24 @@ describe("Core/Transforms", function () { origin.x, origin.y, origin.z, - 1.0 + 1.0, ); const returnedResult = Transforms.eastNorthUpToFixedFrame( origin, - Ellipsoid.UNIT_SPHERE + Ellipsoid.UNIT_SPHERE, ); expect(Matrix4.getColumn(returnedResult, 0, new Cartesian4())).toEqual( - Cartesian4.UNIT_Y + Cartesian4.UNIT_Y, ); // east expect(Matrix4.getColumn(returnedResult, 1, new Cartesian4())).toEqual( - Cartesian4.UNIT_Z + Cartesian4.UNIT_Z, ); // north expect(Matrix4.getColumn(returnedResult, 2, new Cartesian4())).toEqual( - Cartesian4.UNIT_X + Cartesian4.UNIT_X, ); // up expect(Matrix4.getColumn(returnedResult, 3, new Cartesian4())).toEqual( - expectedTranslation + expectedTranslation, ); // translation }); @@ -57,27 +57,27 @@ describe("Core/Transforms", function () { origin.x, origin.y, origin.z, - 1.0 + 1.0, ); const result = new Matrix4(2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2); const returnedResult = Transforms.eastNorthUpToFixedFrame( origin, Ellipsoid.UNIT_SPHERE, - result + result, ); expect(result).toBe(returnedResult); expect(Matrix4.getColumn(returnedResult, 0, new Cartesian4())).toEqual( - Cartesian4.UNIT_Y + Cartesian4.UNIT_Y, ); // east expect(Matrix4.getColumn(returnedResult, 1, new Cartesian4())).toEqual( - Cartesian4.UNIT_Z + Cartesian4.UNIT_Z, ); // north expect(Matrix4.getColumn(returnedResult, 2, new Cartesian4())).toEqual( - Cartesian4.UNIT_X + Cartesian4.UNIT_X, ); // up expect(Matrix4.getColumn(returnedResult, 3, new Cartesian4())).toEqual( - expectedTranslation + expectedTranslation, ); // translation }); @@ -87,27 +87,27 @@ describe("Core/Transforms", function () { northPole.x, northPole.y, northPole.z, - 1.0 + 1.0, ); const result = new Matrix4(); const returnedResult = Transforms.eastNorthUpToFixedFrame( northPole, Ellipsoid.UNIT_SPHERE, - result + result, ); expect(returnedResult).toBe(result); expect(Matrix4.getColumn(returnedResult, 0, new Cartesian4())).toEqual( - Cartesian4.UNIT_Y + Cartesian4.UNIT_Y, ); // east expect(Matrix4.getColumn(returnedResult, 1, new Cartesian4())).toEqual( - negativeX + negativeX, ); // north expect(Matrix4.getColumn(returnedResult, 2, new Cartesian4())).toEqual( - Cartesian4.UNIT_Z + Cartesian4.UNIT_Z, ); // up expect(Matrix4.getColumn(returnedResult, 3, new Cartesian4())).toEqual( - expectedTranslation + expectedTranslation, ); // translation }); @@ -117,24 +117,24 @@ describe("Core/Transforms", function () { southPole.x, southPole.y, southPole.z, - 1.0 + 1.0, ); const returnedResult = Transforms.eastNorthUpToFixedFrame( southPole, - Ellipsoid.UNIT_SPHERE + Ellipsoid.UNIT_SPHERE, ); expect(Matrix4.getColumn(returnedResult, 0, new Cartesian4())).toEqual( - Cartesian4.UNIT_Y + Cartesian4.UNIT_Y, ); // east expect(Matrix4.getColumn(returnedResult, 1, new Cartesian4())).toEqual( - Cartesian4.UNIT_X + Cartesian4.UNIT_X, ); // north expect(Matrix4.getColumn(returnedResult, 2, new Cartesian4())).toEqual( - negativeZ + negativeZ, ); // up expect(Matrix4.getColumn(returnedResult, 3, new Cartesian4())).toEqual( - expectedTranslation + expectedTranslation, ); // translation }); @@ -144,19 +144,19 @@ describe("Core/Transforms", function () { const returnedResult = Transforms.eastNorthUpToFixedFrame( origin, - Ellipsoid.WGS84 + Ellipsoid.WGS84, ); expect(Matrix4.getColumn(returnedResult, 0, new Cartesian4())).toEqual( - Cartesian4.UNIT_Y + Cartesian4.UNIT_Y, ); // east expect(Matrix4.getColumn(returnedResult, 1, new Cartesian4())).toEqual( - negativeX + negativeX, ); // north expect(Matrix4.getColumn(returnedResult, 2, new Cartesian4())).toEqual( - Cartesian4.UNIT_Z + Cartesian4.UNIT_Z, ); // up expect(Matrix4.getColumn(returnedResult, 3, new Cartesian4())).toEqual( - expectedTranslation + expectedTranslation, ); // translation }); @@ -166,24 +166,24 @@ describe("Core/Transforms", function () { origin.x, origin.y, origin.z, - 1.0 + 1.0, ); const returnedResult = Transforms.northEastDownToFixedFrame( origin, - Ellipsoid.UNIT_SPHERE + Ellipsoid.UNIT_SPHERE, ); expect(Matrix4.getColumn(returnedResult, 0, new Cartesian4())).toEqual( - Cartesian4.UNIT_Z + Cartesian4.UNIT_Z, ); // north expect(Matrix4.getColumn(returnedResult, 1, new Cartesian4())).toEqual( - Cartesian4.UNIT_Y + Cartesian4.UNIT_Y, ); // east expect(Matrix4.getColumn(returnedResult, 2, new Cartesian4())).toEqual( - negativeX + negativeX, ); // down expect(Matrix4.getColumn(returnedResult, 3, new Cartesian4())).toEqual( - expectedTranslation + expectedTranslation, ); // translation }); @@ -193,27 +193,27 @@ describe("Core/Transforms", function () { origin.x, origin.y, origin.z, - 1.0 + 1.0, ); const result = new Matrix4(2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2); const returnedResult = Transforms.northEastDownToFixedFrame( origin, Ellipsoid.UNIT_SPHERE, - result + result, ); expect(result).toBe(returnedResult); expect(Matrix4.getColumn(returnedResult, 0, new Cartesian4())).toEqual( - Cartesian4.UNIT_Z + Cartesian4.UNIT_Z, ); // north expect(Matrix4.getColumn(returnedResult, 1, new Cartesian4())).toEqual( - Cartesian4.UNIT_Y + Cartesian4.UNIT_Y, ); // east expect(Matrix4.getColumn(returnedResult, 2, new Cartesian4())).toEqual( - negativeX + negativeX, ); // down expect(Matrix4.getColumn(returnedResult, 3, new Cartesian4())).toEqual( - expectedTranslation + expectedTranslation, ); // translation }); @@ -223,27 +223,27 @@ describe("Core/Transforms", function () { northPole.x, northPole.y, northPole.z, - 1.0 + 1.0, ); const result = new Matrix4(); const returnedResult = Transforms.northEastDownToFixedFrame( northPole, Ellipsoid.UNIT_SPHERE, - result + result, ); expect(returnedResult).toBe(result); expect(Matrix4.getColumn(returnedResult, 0, new Cartesian4())).toEqual( - negativeX + negativeX, ); // north expect(Matrix4.getColumn(returnedResult, 1, new Cartesian4())).toEqual( - Cartesian4.UNIT_Y + Cartesian4.UNIT_Y, ); // east expect(Matrix4.getColumn(returnedResult, 2, new Cartesian4())).toEqual( - negativeZ + negativeZ, ); // down expect(Matrix4.getColumn(returnedResult, 3, new Cartesian4())).toEqual( - expectedTranslation + expectedTranslation, ); // translation }); @@ -253,24 +253,24 @@ describe("Core/Transforms", function () { southPole.x, southPole.y, southPole.z, - 1.0 + 1.0, ); const returnedResult = Transforms.northEastDownToFixedFrame( southPole, - Ellipsoid.UNIT_SPHERE + Ellipsoid.UNIT_SPHERE, ); expect(Matrix4.getColumn(returnedResult, 0, new Cartesian4())).toEqual( - Cartesian4.UNIT_X + Cartesian4.UNIT_X, ); // north expect(Matrix4.getColumn(returnedResult, 1, new Cartesian4())).toEqual( - Cartesian4.UNIT_Y + Cartesian4.UNIT_Y, ); // east expect(Matrix4.getColumn(returnedResult, 2, new Cartesian4())).toEqual( - Cartesian4.UNIT_Z + Cartesian4.UNIT_Z, ); // down expect(Matrix4.getColumn(returnedResult, 3, new Cartesian4())).toEqual( - expectedTranslation + expectedTranslation, ); // translation }); @@ -280,19 +280,19 @@ describe("Core/Transforms", function () { const returnedResult = Transforms.northEastDownToFixedFrame( origin, - Ellipsoid.UNIT_SPHERE + Ellipsoid.UNIT_SPHERE, ); expect(Matrix4.getColumn(returnedResult, 0, new Cartesian4())).toEqual( - negativeX + negativeX, ); // north expect(Matrix4.getColumn(returnedResult, 1, new Cartesian4())).toEqual( - Cartesian4.UNIT_Y + Cartesian4.UNIT_Y, ); // east expect(Matrix4.getColumn(returnedResult, 2, new Cartesian4())).toEqual( - negativeZ + negativeZ, ); // down expect(Matrix4.getColumn(returnedResult, 3, new Cartesian4())).toEqual( - expectedTranslation + expectedTranslation, ); // translation }); @@ -302,24 +302,24 @@ describe("Core/Transforms", function () { origin.x, origin.y, origin.z, - 1.0 + 1.0, ); const returnedResult = Transforms.northUpEastToFixedFrame( origin, - Ellipsoid.UNIT_SPHERE + Ellipsoid.UNIT_SPHERE, ); expect(Matrix4.getColumn(returnedResult, 0, new Cartesian4())).toEqual( - Cartesian4.UNIT_Z + Cartesian4.UNIT_Z, ); // north expect(Matrix4.getColumn(returnedResult, 1, new Cartesian4())).toEqual( - Cartesian4.UNIT_X + Cartesian4.UNIT_X, ); // up expect(Matrix4.getColumn(returnedResult, 2, new Cartesian4())).toEqual( - Cartesian4.UNIT_Y + Cartesian4.UNIT_Y, ); // east expect(Matrix4.getColumn(returnedResult, 3, new Cartesian4())).toEqual( - expectedTranslation + expectedTranslation, ); // translation }); @@ -329,27 +329,27 @@ describe("Core/Transforms", function () { origin.x, origin.y, origin.z, - 1.0 + 1.0, ); const result = new Matrix4(2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2); const returnedResult = Transforms.northUpEastToFixedFrame( origin, Ellipsoid.UNIT_SPHERE, - result + result, ); expect(result).toBe(returnedResult); expect(Matrix4.getColumn(returnedResult, 0, new Cartesian4())).toEqual( - Cartesian4.UNIT_Z + Cartesian4.UNIT_Z, ); // north expect(Matrix4.getColumn(returnedResult, 1, new Cartesian4())).toEqual( - Cartesian4.UNIT_X + Cartesian4.UNIT_X, ); // up expect(Matrix4.getColumn(returnedResult, 2, new Cartesian4())).toEqual( - Cartesian4.UNIT_Y + Cartesian4.UNIT_Y, ); // east expect(Matrix4.getColumn(returnedResult, 3, new Cartesian4())).toEqual( - expectedTranslation + expectedTranslation, ); // translation }); @@ -359,27 +359,27 @@ describe("Core/Transforms", function () { northPole.x, northPole.y, northPole.z, - 1.0 + 1.0, ); const result = new Matrix4(); const returnedResult = Transforms.northUpEastToFixedFrame( northPole, Ellipsoid.UNIT_SPHERE, - result + result, ); expect(returnedResult).toBe(result); expect(Matrix4.getColumn(returnedResult, 0, new Cartesian4())).toEqual( - negativeX + negativeX, ); // north expect(Matrix4.getColumn(returnedResult, 1, new Cartesian4())).toEqual( - Cartesian4.UNIT_Z + Cartesian4.UNIT_Z, ); // up expect(Matrix4.getColumn(returnedResult, 2, new Cartesian4())).toEqual( - Cartesian4.UNIT_Y + Cartesian4.UNIT_Y, ); // east expect(Matrix4.getColumn(returnedResult, 3, new Cartesian4())).toEqual( - expectedTranslation + expectedTranslation, ); // translation }); @@ -389,24 +389,24 @@ describe("Core/Transforms", function () { southPole.x, southPole.y, southPole.z, - 1.0 + 1.0, ); const returnedResult = Transforms.northUpEastToFixedFrame( southPole, - Ellipsoid.UNIT_SPHERE + Ellipsoid.UNIT_SPHERE, ); expect(Matrix4.getColumn(returnedResult, 0, new Cartesian4())).toEqual( - Cartesian4.UNIT_X + Cartesian4.UNIT_X, ); // north expect(Matrix4.getColumn(returnedResult, 1, new Cartesian4())).toEqual( - negativeZ + negativeZ, ); // up expect(Matrix4.getColumn(returnedResult, 2, new Cartesian4())).toEqual( - Cartesian4.UNIT_Y + Cartesian4.UNIT_Y, ); // east expect(Matrix4.getColumn(returnedResult, 3, new Cartesian4())).toEqual( - expectedTranslation + expectedTranslation, ); // translation }); @@ -416,19 +416,19 @@ describe("Core/Transforms", function () { const returnedResult = Transforms.northUpEastToFixedFrame( origin, - Ellipsoid.UNIT_SPHERE + Ellipsoid.UNIT_SPHERE, ); expect(Matrix4.getColumn(returnedResult, 0, new Cartesian4())).toEqual( - negativeX + negativeX, ); // north expect(Matrix4.getColumn(returnedResult, 1, new Cartesian4())).toEqual( - Cartesian4.UNIT_Z + Cartesian4.UNIT_Z, ); // up expect(Matrix4.getColumn(returnedResult, 2, new Cartesian4())).toEqual( - Cartesian4.UNIT_Y + Cartesian4.UNIT_Y, ); // east expect(Matrix4.getColumn(returnedResult, 3, new Cartesian4())).toEqual( - expectedTranslation + expectedTranslation, ); // translation }); @@ -438,24 +438,24 @@ describe("Core/Transforms", function () { origin.x, origin.y, origin.z, - 1.0 + 1.0, ); const returnedResult = Transforms.northWestUpToFixedFrame( origin, - Ellipsoid.UNIT_SPHERE + Ellipsoid.UNIT_SPHERE, ); expect(Matrix4.getColumn(returnedResult, 0, new Cartesian4())).toEqual( - Cartesian4.UNIT_Z + Cartesian4.UNIT_Z, ); // north expect(Matrix4.getColumn(returnedResult, 1, new Cartesian4())).toEqual( - negativeY + negativeY, ); // west expect(Matrix4.getColumn(returnedResult, 2, new Cartesian4())).toEqual( - Cartesian4.UNIT_X + Cartesian4.UNIT_X, ); // up expect(Matrix4.getColumn(returnedResult, 3, new Cartesian4())).toEqual( - expectedTranslation + expectedTranslation, ); // translation }); @@ -465,27 +465,27 @@ describe("Core/Transforms", function () { origin.x, origin.y, origin.z, - 1.0 + 1.0, ); const result = new Matrix4(2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2); const returnedResult = Transforms.northWestUpToFixedFrame( origin, Ellipsoid.UNIT_SPHERE, - result + result, ); expect(result).toBe(returnedResult); expect(Matrix4.getColumn(returnedResult, 0, new Cartesian4())).toEqual( - Cartesian4.UNIT_Z + Cartesian4.UNIT_Z, ); // north expect(Matrix4.getColumn(returnedResult, 1, new Cartesian4())).toEqual( - negativeY + negativeY, ); // west expect(Matrix4.getColumn(returnedResult, 2, new Cartesian4())).toEqual( - Cartesian4.UNIT_X + Cartesian4.UNIT_X, ); // up expect(Matrix4.getColumn(returnedResult, 3, new Cartesian4())).toEqual( - expectedTranslation + expectedTranslation, ); // translation }); @@ -495,27 +495,27 @@ describe("Core/Transforms", function () { northPole.x, northPole.y, northPole.z, - 1.0 + 1.0, ); const result = new Matrix4(); const returnedResult = Transforms.northWestUpToFixedFrame( northPole, Ellipsoid.UNIT_SPHERE, - result + result, ); expect(returnedResult).toBe(result); expect(Matrix4.getColumn(returnedResult, 0, new Cartesian4())).toEqual( - negativeX + negativeX, ); // north expect(Matrix4.getColumn(returnedResult, 1, new Cartesian4())).toEqual( - negativeY + negativeY, ); // west expect(Matrix4.getColumn(returnedResult, 2, new Cartesian4())).toEqual( - Cartesian4.UNIT_Z + Cartesian4.UNIT_Z, ); // up expect(Matrix4.getColumn(returnedResult, 3, new Cartesian4())).toEqual( - expectedTranslation + expectedTranslation, ); // translation }); @@ -525,24 +525,24 @@ describe("Core/Transforms", function () { southPole.x, southPole.y, southPole.z, - 1.0 + 1.0, ); const returnedResult = Transforms.northWestUpToFixedFrame( southPole, - Ellipsoid.UNIT_SPHERE + Ellipsoid.UNIT_SPHERE, ); expect(Matrix4.getColumn(returnedResult, 0, new Cartesian4())).toEqual( - Cartesian4.UNIT_X + Cartesian4.UNIT_X, ); // north expect(Matrix4.getColumn(returnedResult, 1, new Cartesian4())).toEqual( - negativeY + negativeY, ); // west expect(Matrix4.getColumn(returnedResult, 2, new Cartesian4())).toEqual( - negativeZ + negativeZ, ); // up expect(Matrix4.getColumn(returnedResult, 3, new Cartesian4())).toEqual( - expectedTranslation + expectedTranslation, ); // translation }); @@ -552,19 +552,19 @@ describe("Core/Transforms", function () { const returnedResult = Transforms.northWestUpToFixedFrame( origin, - Ellipsoid.UNIT_SPHERE + Ellipsoid.UNIT_SPHERE, ); expect(Matrix4.getColumn(returnedResult, 0, new Cartesian4())).toEqual( - negativeX + negativeX, ); // north expect(Matrix4.getColumn(returnedResult, 1, new Cartesian4())).toEqual( - negativeY + negativeY, ); // west expect(Matrix4.getColumn(returnedResult, 2, new Cartesian4())).toEqual( - Cartesian4.UNIT_Z + Cartesian4.UNIT_Z, ); // up expect(Matrix4.getColumn(returnedResult, 3, new Cartesian4())).toEqual( - expectedTranslation + expectedTranslation, ); // translation }); @@ -667,7 +667,7 @@ describe("Core/Transforms", function () { for (let i = 0; i < converterTab.length; i++) { const converterMatrix = converterTab[i].converter( position, - Ellipsoid.UNIT_SPHERE + Ellipsoid.UNIT_SPHERE, ); const order = converterTab[i].order; // check translation @@ -701,10 +701,8 @@ describe("Core/Transforms", function () { for (let i = 0; i < cartesianTab.length; i++) { const cartesian = cartesianTab[i]; - const classicalEastNorthUpReferential = Transforms.eastNorthUpToFixedFrame( - cartesian, - Ellipsoid.UNIT_SPHERE - ); + const classicalEastNorthUpReferential = + Transforms.eastNorthUpToFixedFrame(cartesian, Ellipsoid.UNIT_SPHERE); testAllLocalFrame(classicalEastNorthUpReferential, cartesian); } }); @@ -746,7 +744,7 @@ describe("Core/Transforms", function () { const hpr = new HeadingPitchRoll(heading, pitch, roll); const expectedRotation = Matrix3.fromQuaternion( - Quaternion.fromHeadingPitchRoll(hpr) + Quaternion.fromHeadingPitchRoll(hpr), ); const expectedX = Matrix3.getColumn(expectedRotation, 0, new Cartesian3()); const expectedY = Matrix3.getColumn(expectedRotation, 1, new Cartesian3()); @@ -759,19 +757,19 @@ describe("Core/Transforms", function () { const returnedResult = Transforms.headingPitchRollToFixedFrame( origin, hpr, - Ellipsoid.UNIT_SPHERE + Ellipsoid.UNIT_SPHERE, ); const actualX = Cartesian3.fromCartesian4( - Matrix4.getColumn(returnedResult, 0, new Cartesian4()) + Matrix4.getColumn(returnedResult, 0, new Cartesian4()), ); const actualY = Cartesian3.fromCartesian4( - Matrix4.getColumn(returnedResult, 1, new Cartesian4()) + Matrix4.getColumn(returnedResult, 1, new Cartesian4()), ); const actualZ = Cartesian3.fromCartesian4( - Matrix4.getColumn(returnedResult, 2, new Cartesian4()) + Matrix4.getColumn(returnedResult, 2, new Cartesian4()), ); const actualTranslation = Cartesian3.fromCartesian4( - Matrix4.getColumn(returnedResult, 3, new Cartesian4()) + Matrix4.getColumn(returnedResult, 3, new Cartesian4()), ); expect(actualX).toEqual(expectedX); @@ -788,7 +786,7 @@ describe("Core/Transforms", function () { const hpr = new HeadingPitchRoll(heading, pitch, roll); const expectedRotation = Matrix3.fromQuaternion( - Quaternion.fromHeadingPitchRoll(hpr) + Quaternion.fromHeadingPitchRoll(hpr), ); const expectedX = Matrix3.getColumn(expectedRotation, 0, new Cartesian3()); const expectedY = Matrix3.getColumn(expectedRotation, 1, new Cartesian3()); @@ -801,19 +799,19 @@ describe("Core/Transforms", function () { const returnedResult = Transforms.headingPitchRollToFixedFrame( origin, hpr, - Ellipsoid.UNIT_SPHERE + Ellipsoid.UNIT_SPHERE, ); const actualX = Cartesian3.fromCartesian4( - Matrix4.getColumn(returnedResult, 0, new Cartesian4()) + Matrix4.getColumn(returnedResult, 0, new Cartesian4()), ); const actualY = Cartesian3.fromCartesian4( - Matrix4.getColumn(returnedResult, 1, new Cartesian4()) + Matrix4.getColumn(returnedResult, 1, new Cartesian4()), ); const actualZ = Cartesian3.fromCartesian4( - Matrix4.getColumn(returnedResult, 2, new Cartesian4()) + Matrix4.getColumn(returnedResult, 2, new Cartesian4()), ); const actualTranslation = Cartesian3.fromCartesian4( - Matrix4.getColumn(returnedResult, 3, new Cartesian4()) + Matrix4.getColumn(returnedResult, 3, new Cartesian4()), ); expect(actualX).toEqual(expectedX); @@ -830,7 +828,7 @@ describe("Core/Transforms", function () { const hpr = new HeadingPitchRoll(heading, pitch, roll); const expectedRotation = Matrix3.fromQuaternion( - Quaternion.fromHeadingPitchRoll(hpr) + Quaternion.fromHeadingPitchRoll(hpr), ); const expectedX = Matrix3.getColumn(expectedRotation, 0, new Cartesian3()); const expectedY = Matrix3.getColumn(expectedRotation, 1, new Cartesian3()); @@ -844,19 +842,19 @@ describe("Core/Transforms", function () { origin, hpr, Ellipsoid.UNIT_SPHERE, - Transforms.eastNorthUpToFixedFrame + Transforms.eastNorthUpToFixedFrame, ); const actualX = Cartesian3.fromCartesian4( - Matrix4.getColumn(returnedResult, 0, new Cartesian4()) + Matrix4.getColumn(returnedResult, 0, new Cartesian4()), ); const actualY = Cartesian3.fromCartesian4( - Matrix4.getColumn(returnedResult, 1, new Cartesian4()) + Matrix4.getColumn(returnedResult, 1, new Cartesian4()), ); const actualZ = Cartesian3.fromCartesian4( - Matrix4.getColumn(returnedResult, 2, new Cartesian4()) + Matrix4.getColumn(returnedResult, 2, new Cartesian4()), ); const actualTranslation = Cartesian3.fromCartesian4( - Matrix4.getColumn(returnedResult, 3, new Cartesian4()) + Matrix4.getColumn(returnedResult, 3, new Cartesian4()), ); expect(actualX).toEqual(expectedX); @@ -873,7 +871,7 @@ describe("Core/Transforms", function () { const hpr = new HeadingPitchRoll(heading, pitch, roll); const expectedRotation = Matrix3.fromQuaternion( - Quaternion.fromHeadingPitchRoll(hpr) + Quaternion.fromHeadingPitchRoll(hpr), ); const expectedX = Matrix3.getColumn(expectedRotation, 0, new Cartesian3()); const expectedY = Matrix3.getColumn(expectedRotation, 1, new Cartesian3()); @@ -889,19 +887,19 @@ describe("Core/Transforms", function () { hpr, Ellipsoid.UNIT_SPHERE, Transforms.eastNorthUpToFixedFrame, - result + result, ); const actualX = Cartesian3.fromCartesian4( - Matrix4.getColumn(returnedResult, 0, new Cartesian4()) + Matrix4.getColumn(returnedResult, 0, new Cartesian4()), ); const actualY = Cartesian3.fromCartesian4( - Matrix4.getColumn(returnedResult, 1, new Cartesian4()) + Matrix4.getColumn(returnedResult, 1, new Cartesian4()), ); const actualZ = Cartesian3.fromCartesian4( - Matrix4.getColumn(returnedResult, 2, new Cartesian4()) + Matrix4.getColumn(returnedResult, 2, new Cartesian4()), ); const actualTranslation = Cartesian3.fromCartesian4( - Matrix4.getColumn(returnedResult, 3, new Cartesian4()) + Matrix4.getColumn(returnedResult, 3, new Cartesian4()), ); expect(returnedResult).toBe(result); @@ -919,17 +917,17 @@ describe("Core/Transforms", function () { const hpr = new HeadingPitchRoll(heading, pitch, roll); const expectedRotation = Matrix3.fromQuaternion( - Quaternion.fromHeadingPitchRoll(hpr) + Quaternion.fromHeadingPitchRoll(hpr), ); const expectedEast = Matrix3.getColumn( expectedRotation, 0, - new Cartesian3() + new Cartesian3(), ); // east const expectedNorth = Matrix3.getColumn( expectedRotation, 1, - new Cartesian3() + new Cartesian3(), ); // north const expectedUp = Matrix3.getColumn(expectedRotation, 2, new Cartesian3()); // up @@ -937,19 +935,19 @@ describe("Core/Transforms", function () { expectedEast.z, expectedEast.x, expectedEast.y, - expectedEast + expectedEast, ); Cartesian3.fromElements( expectedNorth.z, expectedNorth.x, expectedNorth.y, - expectedNorth + expectedNorth, ); Cartesian3.fromElements( expectedUp.z, expectedUp.x, expectedUp.y, - expectedUp + expectedUp, ); const result = new Matrix4(); @@ -958,19 +956,19 @@ describe("Core/Transforms", function () { hpr, Ellipsoid.UNIT_SPHERE, Transforms.eastNorthUpToFixedFrame, - result + result, ); let actualEast = Cartesian3.fromCartesian4( - Matrix4.getColumn(returnedResult, 0, new Cartesian4()) + Matrix4.getColumn(returnedResult, 0, new Cartesian4()), ); // east let actualNorth = Cartesian3.fromCartesian4( - Matrix4.getColumn(returnedResult, 1, new Cartesian4()) + Matrix4.getColumn(returnedResult, 1, new Cartesian4()), ); // north let actualUp = Cartesian3.fromCartesian4( - Matrix4.getColumn(returnedResult, 2, new Cartesian4()) + Matrix4.getColumn(returnedResult, 2, new Cartesian4()), ); // up let actualTranslation = Cartesian3.fromCartesian4( - Matrix4.getColumn(returnedResult, 3, new Cartesian4()) + Matrix4.getColumn(returnedResult, 3, new Cartesian4()), ); expect(returnedResult).toBe(result); @@ -981,32 +979,32 @@ describe("Core/Transforms", function () { const UNEFixedFrameConverter = Transforms.localFrameToFixedFrameGenerator( "west", - "south" + "south", ); // up north east returnedResult = Transforms.headingPitchRollToFixedFrame( origin, hpr, Ellipsoid.UNIT_SPHERE, UNEFixedFrameConverter, - result + result, ); actualEast = Cartesian3.fromCartesian4( - Matrix4.getColumn(returnedResult, 0, new Cartesian4()) + Matrix4.getColumn(returnedResult, 0, new Cartesian4()), ); // east actualEast.y = -actualEast.y; actualEast.z = -actualEast.z; actualNorth = Cartesian3.fromCartesian4( - Matrix4.getColumn(returnedResult, 1, new Cartesian4()) + Matrix4.getColumn(returnedResult, 1, new Cartesian4()), ); // north actualNorth.y = -actualNorth.y; actualNorth.z = -actualNorth.z; actualUp = Cartesian3.fromCartesian4( - Matrix4.getColumn(returnedResult, 2, new Cartesian4()) + Matrix4.getColumn(returnedResult, 2, new Cartesian4()), ); // up actualUp.y = -actualUp.y; actualUp.z = -actualUp.z; actualTranslation = Cartesian3.fromCartesian4( - Matrix4.getColumn(returnedResult, 3, new Cartesian4()) + Matrix4.getColumn(returnedResult, 3, new Cartesian4()), ); expect(returnedResult).toBe(result); @@ -1026,7 +1024,7 @@ describe("Core/Transforms", function () { const transform = Transforms.headingPitchRollToFixedFrame( origin, hpr, - Ellipsoid.UNIT_SPHERE + Ellipsoid.UNIT_SPHERE, ); const expected = Matrix4.getMatrix3(transform, new Matrix3()); @@ -1034,7 +1032,7 @@ describe("Core/Transforms", function () { origin, hpr, Ellipsoid.UNIT_SPHERE, - Transforms.eastNorthUpToFixedFrame + Transforms.eastNorthUpToFixedFrame, ); const actual = Matrix3.fromQuaternion(quaternion); expect(actual).toEqualEpsilon(expected, CesiumMath.EPSILON11); @@ -1050,7 +1048,7 @@ describe("Core/Transforms", function () { const transform = Transforms.headingPitchRollToFixedFrame( origin, hpr, - Ellipsoid.UNIT_SPHERE + Ellipsoid.UNIT_SPHERE, ); const expected = Matrix4.getMatrix3(transform, new Matrix3()); @@ -1060,7 +1058,7 @@ describe("Core/Transforms", function () { hpr, Ellipsoid.UNIT_SPHERE, Transforms.eastNorthUpToFixedFrame, - result + result, ); const actual = Matrix3.fromQuaternion(quaternion); expect(quaternion).toBe(result); @@ -1077,7 +1075,7 @@ describe("Core/Transforms", function () { const transform = Transforms.headingPitchRollToFixedFrame( origin, hpr, - Ellipsoid.UNIT_SPHERE + Ellipsoid.UNIT_SPHERE, ); const expected = Matrix4.getMatrix3(transform, new Matrix3()); @@ -1087,7 +1085,7 @@ describe("Core/Transforms", function () { hpr, Ellipsoid.UNIT_SPHERE, undefined, - result + result, ); const actual = Matrix3.fromQuaternion(quaternion); expect(quaternion).toBe(result); @@ -1102,14 +1100,14 @@ describe("Core/Transforms", function () { const hpr = new HeadingPitchRoll(heading, pitch, roll); const fixedFrameTransform = Transforms.localFrameToFixedFrameGenerator( "west", - "south" + "south", ); const transform = Transforms.headingPitchRollToFixedFrame( origin, hpr, Ellipsoid.UNIT_SPHERE, - fixedFrameTransform + fixedFrameTransform, ); const expected = Matrix4.getMatrix3(transform, new Matrix3()); @@ -1119,7 +1117,7 @@ describe("Core/Transforms", function () { hpr, Ellipsoid.UNIT_SPHERE, fixedFrameTransform, - result + result, ); const actual = Matrix3.fromQuaternion(quaternion); expect(quaternion).toBe(result); @@ -1144,11 +1142,11 @@ describe("Core/Transforms", function () { const t4 = Matrix4.fromRotationTranslation( t, Cartesian3.ZERO, - new Matrix4() + new Matrix4(), ); expect(Matrix4.inverse(t4, new Matrix4())).toEqualEpsilon( Matrix4.inverseTransformation(t4, new Matrix4()), - CesiumMath.EPSILON14 + CesiumMath.EPSILON14, ); time = JulianDate.addHours(time, 23.93447, new JulianDate()); // add one sidereal day @@ -1177,7 +1175,7 @@ describe("Core/Transforms", function () { const t4 = Matrix4.fromRotationTranslation(t); expect(Matrix4.inverse(t4, new Matrix4())).toEqualEpsilon( Matrix4.inverseTransformation(t4, new Matrix4()), - CesiumMath.EPSILON14 + CesiumMath.EPSILON14, ); time = JulianDate.addHours(time, 23.93447, new JulianDate()); // add one sidereal day @@ -1208,7 +1206,7 @@ describe("Core/Transforms", function () { const t4 = Matrix4.fromRotationTranslation(t); expect(Matrix4.inverse(t4, new Matrix4())).toEqualEpsilon( Matrix4.inverseTransformation(t4, new Matrix4()), - CesiumMath.EPSILON14 + CesiumMath.EPSILON14, ); time = JulianDate.addHours(time, 23.93447, new JulianDate()); // add one sidereal day @@ -1253,7 +1251,7 @@ describe("Core/Transforms", function () { const t4 = Matrix4.fromRotationTranslation(t); expect(Matrix4.inverse(t4, new Matrix4())).toEqualEpsilon( Matrix4.inverseTransformation(t4, new Matrix4()), - CesiumMath.EPSILON14 + CesiumMath.EPSILON14, ); time = JulianDate.addHours(time, 27.321661 * 24, new JulianDate()); // add one sidereal month @@ -1273,13 +1271,13 @@ describe("Core/Transforms", function () { 0.4170384828971786, 0.3598159441089767, 0.2133099942194372, - -0.9083123541662688 + -0.9083123541662688, ); const testInverse = Matrix3.multiply( Matrix3.transpose(t, new Matrix3()), expectedMtx, - new Matrix3() + new Matrix3(), ); const testDiff = new Matrix3(); for (let i = 0; i < 9; i++) { @@ -1287,7 +1285,7 @@ describe("Core/Transforms", function () { } expect(testInverse).toEqualEpsilon( Matrix3.IDENTITY, - CesiumMath.EPSILON14 + CesiumMath.EPSILON14, ); expect(testDiff).toEqualEpsilon(new Matrix3(), CesiumMath.EPSILON14); }); @@ -1296,9 +1294,8 @@ describe("Core/Transforms", function () { describe("computeIcrfToFixedMatrix", function () { async function preloadTransformationData(start, stop, eopUrl) { if (defined(eopUrl)) { - Transforms.earthOrientationParameters = await EarthOrientationParameters.fromUrl( - eopUrl - ); + Transforms.earthOrientationParameters = + await EarthOrientationParameters.fromUrl(eopUrl); } Transforms.iau2006XysData = new Iau2006XysData(); @@ -1326,17 +1323,17 @@ describe("Core/Transforms", function () { // what happens when we try evaluating at times when we don't have EOP as well as at // times where we do. The samples are not at exact EOP times, in order to test interpolation. const componentsData = await Resource.fetchJson( - "Data/EarthOrientationParameters/IcrfToFixedStkComponentsRotationData.json" + "Data/EarthOrientationParameters/IcrfToFixedStkComponentsRotationData.json", ); const start = JulianDate.fromIso8601(componentsData[0].date); const stop = JulianDate.fromIso8601( - componentsData[componentsData.length - 1].date + componentsData[componentsData.length - 1].date, ); await preloadTransformationData( start, stop, - "Data/EarthOrientationParameters/EOP-2011-July.json" + "Data/EarthOrientationParameters/EOP-2011-July.json", ); for (let i = 0; i < componentsData.length; ++i) { const time = JulianDate.fromIso8601(componentsData[i].date); @@ -1358,19 +1355,19 @@ describe("Core/Transforms", function () { const t4 = Matrix4.fromRotationTranslation(t); expect(Matrix4.inverse(t4, new Matrix4())).toEqualEpsilon( Matrix4.inverseTransformation(t4, new Matrix4()), - CesiumMath.EPSILON14 + CesiumMath.EPSILON14, ); const expectedMtx = Matrix3.fromQuaternion( Quaternion.conjugate( componentsData[i].icrfToFixedQuaternion, - new Quaternion() - ) + new Quaternion(), + ), ); const testInverse = Matrix3.multiply( Matrix3.transpose(t, new Matrix3()), expectedMtx, - new Matrix3() + new Matrix3(), ); const testDiff = new Matrix3(); for (let k = 0; k < 9; k++) { @@ -1378,7 +1375,7 @@ describe("Core/Transforms", function () { } expect(testInverse).toEqualEpsilon( Matrix3.IDENTITY, - CesiumMath.EPSILON14 + CesiumMath.EPSILON14, ); expect(testDiff).toEqualEpsilon(new Matrix3(), CesiumMath.EPSILON14); } @@ -1391,7 +1388,7 @@ describe("Core/Transforms", function () { await preloadTransformationData( time, time, - "Data/EarthOrientationParameters/EOP-2011-July.json" + "Data/EarthOrientationParameters/EOP-2011-July.json", ); const resultT = new Matrix3(); const t = Transforms.computeIcrfToFixedMatrix(time, resultT); @@ -1411,7 +1408,7 @@ describe("Core/Transforms", function () { const t4 = Matrix4.fromRotationTranslation(t); expect(Matrix4.inverse(t4, new Matrix4())).toEqualEpsilon( Matrix4.inverseTransformation(t4, new Matrix4()), - CesiumMath.EPSILON14 + CesiumMath.EPSILON14, ); time = JulianDate.addHours(time, 23.93447, new JulianDate()); // add one sidereal day @@ -1432,13 +1429,13 @@ describe("Core/Transforms", function () { -0.0011325710874539787, 0.0011536112127187594, -0.0000089534866085598909, - 0.99999933455028112 + 0.99999933455028112, ); const testInverse = Matrix3.multiply( Matrix3.transpose(t, new Matrix3()), expectedMtx, - new Matrix3() + new Matrix3(), ); const testDiff = new Matrix3(); for (let i = 0; i < 9; i++) { @@ -1446,7 +1443,7 @@ describe("Core/Transforms", function () { } expect(testInverse).toEqualEpsilon( Matrix3.IDENTITY, - CesiumMath.EPSILON14 + CesiumMath.EPSILON14, ); expect(testDiff).toEqualEpsilon(new Matrix3(), CesiumMath.EPSILON14); }); @@ -1457,7 +1454,7 @@ describe("Core/Transforms", function () { await preloadTransformationData( time, time, - "Data/EarthOrientationParameters/EOP-2011-July.json" + "Data/EarthOrientationParameters/EOP-2011-July.json", ); const resultT = new Matrix3(); const t = Transforms.computeIcrfToFixedMatrix(time, resultT); @@ -1472,13 +1469,13 @@ describe("Core/Transforms", function () { 0.0011266944449015753, 0.0011497249933208494, -0.000010082996932331842, - 0.99999933901516791 + 0.99999933901516791, ); const testInverse = Matrix3.multiply( Matrix3.transpose(t, new Matrix3()), expectedMtx, - new Matrix3() + new Matrix3(), ); const testDiff = new Matrix3(); for (let i = 0; i < 9; i++) { @@ -1486,7 +1483,7 @@ describe("Core/Transforms", function () { } expect(testInverse).toEqualEpsilon( Matrix3.IDENTITY, - CesiumMath.EPSILON14 + CesiumMath.EPSILON14, ); expect(testDiff).toEqualEpsilon(new Matrix3(), CesiumMath.EPSILON14); }); @@ -1497,7 +1494,7 @@ describe("Core/Transforms", function () { await preloadTransformationData( time, time, - "Data/EarthOrientationParameters/EOP-2011-July.json" + "Data/EarthOrientationParameters/EOP-2011-July.json", ); const resultT = new Matrix3(); const t = Transforms.computeIcrfToFixedMatrix(time, resultT); @@ -1512,13 +1509,13 @@ describe("Core/Transforms", function () { 0.0011297972845023996, 0.0011493056536445096, -0.00001025368996280683, - 0.99999933949547 + 0.99999933949547, ); const testInverse = Matrix3.multiply( Matrix3.transpose(t, new Matrix3()), expectedMtx, - new Matrix3() + new Matrix3(), ); const testDiff = new Matrix3(); for (let i = 0; i < 9; i++) { @@ -1526,7 +1523,7 @@ describe("Core/Transforms", function () { } expect(testInverse).toEqualEpsilon( Matrix3.IDENTITY, - CesiumMath.EPSILON14 + CesiumMath.EPSILON14, ); expect(testDiff).toEqualEpsilon(new Matrix3(), CesiumMath.EPSILON14); }); @@ -1536,13 +1533,13 @@ describe("Core/Transforms", function () { const inertialPos = new Cartesian3( -7322101.15395708, -41525699.1558387, - 0 + 0, ); // The following is the value computed by STK Components for the date specified below const expectedFixedPos = new Cartesian3( 39489858.9917795, -14783363.192887, - -8075.05820056297 + -8075.05820056297, ); // 2011-07-03 00:00:00 UTC @@ -1551,7 +1548,7 @@ describe("Core/Transforms", function () { await preloadTransformationData( time, time, - "Data/EarthOrientationParameters/EOP-2011-July.json" + "Data/EarthOrientationParameters/EOP-2011-July.json", ); const resultT = new Matrix3(); const t = Transforms.computeIcrfToFixedMatrix(time, resultT); @@ -1560,7 +1557,7 @@ describe("Core/Transforms", function () { const error = Cartesian3.subtract( result, expectedFixedPos, - new Cartesian3() + new Cartesian3(), ); // Given the magnitude of the positions involved (1e8) @@ -1576,7 +1573,7 @@ describe("Core/Transforms", function () { // we don't have the data in Cesium to load. await preloadTransformationData( time, - JulianDate.addDays(time, 1, new JulianDate()) + JulianDate.addDays(time, 1, new JulianDate()), ); const resultT = new Matrix3(); @@ -1593,7 +1590,7 @@ describe("Core/Transforms", function () { // we don't have the data in Cesium to load. await preloadTransformationData( time, - JulianDate.addDays(time, 1, new JulianDate()) + JulianDate.addDays(time, 1, new JulianDate()), ); const resultT = new Matrix3(); const t = Transforms.computeIcrfToFixedMatrix(time, resultT); @@ -1605,13 +1602,13 @@ describe("Core/Transforms", function () { const inertialPos = new Cartesian3( -7322101.15395708, -41525699.1558387, - 0 + 0, ); // The following is the value computed by STK Components for the date specified below const expectedFixedPos = new Cartesian3( 39489545.7583001, -14784199.9085371, - -8034.77037239318 + -8034.77037239318, ); // 2011-07-03 00:00:00 UTC @@ -1626,7 +1623,7 @@ describe("Core/Transforms", function () { const error = Cartesian3.subtract( result, expectedFixedPos, - new Cartesian3() + new Cartesian3(), ); // Given the magnitude of the positions involved (1e8) @@ -1643,13 +1640,13 @@ describe("Core/Transforms", function () { await preloadTransformationData( time, time, - "Data/EarthOrientationParameters/EOP-Invalid.json" + "Data/EarthOrientationParameters/EOP-Invalid.json", ); return Transforms.computeIcrfToFixedMatrix(time); - })() + })(), ).toBeRejectedWithError( RuntimeError, - "Error in loaded EOP data: The columnNames property is required." + "Error in loaded EOP data: The columnNames property is required.", ); }); @@ -1669,7 +1666,7 @@ describe("Core/Transforms", function () { width / height, 1.0, 10.0, - new Matrix4() + new Matrix4(), ); const vpTransform = Matrix4.computeViewportTransformation( { @@ -1678,7 +1675,7 @@ describe("Core/Transforms", function () { }, 0, 1, - new Matrix4() + new Matrix4(), ); it("pointToGLWindowCoordinates works at the center", function () { @@ -1686,7 +1683,7 @@ describe("Core/Transforms", function () { position: Cartesian3.multiplyByScalar( Cartesian3.UNIT_X, 2.0, - new Cartesian3() + new Cartesian3(), ), direction: Cartesian3.negate(Cartesian3.UNIT_X, new Cartesian3()), up: Cartesian3.UNIT_Z, @@ -1697,7 +1694,7 @@ describe("Core/Transforms", function () { const returnedResult = Transforms.pointToGLWindowCoordinates( mvpMatrix, vpTransform, - Cartesian3.ZERO + Cartesian3.ZERO, ); expect(returnedResult).toEqual(expected); }); @@ -1707,7 +1704,7 @@ describe("Core/Transforms", function () { position: Cartesian3.multiplyByScalar( Cartesian3.UNIT_X, 2.0, - new Cartesian3() + new Cartesian3(), ), direction: Cartesian3.negate(Cartesian3.UNIT_X, new Cartesian3()), up: Cartesian3.UNIT_Z, @@ -1720,7 +1717,7 @@ describe("Core/Transforms", function () { mvpMatrix, vpTransform, Cartesian3.ZERO, - result + result, ); expect(result).toBe(returnedResult); expect(returnedResult).toEqual(expected); @@ -1737,7 +1734,7 @@ describe("Core/Transforms", function () { const returnedResult = Transforms.pointToGLWindowCoordinates( perspective, vpTransform, - point + point, ); expect(returnedResult).toEqualEpsilon(expected, CesiumMath.EPSILON12); }); @@ -1753,7 +1750,7 @@ describe("Core/Transforms", function () { const returnedResult = Transforms.pointToGLWindowCoordinates( perspective, vpTransform, - point + point, ); expect(returnedResult).toEqualEpsilon(expected, CesiumMath.EPSILON12); }); @@ -1763,7 +1760,7 @@ describe("Core/Transforms", function () { position: Cartesian3.multiplyByScalar( Cartesian3.UNIT_X, 2.0, - new Cartesian3() + new Cartesian3(), ), direction: Cartesian3.negate(Cartesian3.UNIT_X, new Cartesian3()), up: Cartesian3.UNIT_Z, @@ -1774,7 +1771,7 @@ describe("Core/Transforms", function () { const returnedResult = Transforms.pointToWindowCoordinates( mvpMatrix, vpTransform, - Cartesian3.ZERO + Cartesian3.ZERO, ); expect(returnedResult).toEqual(expected); }); @@ -1784,7 +1781,7 @@ describe("Core/Transforms", function () { position: Cartesian3.multiplyByScalar( Cartesian3.UNIT_X, 2.0, - new Cartesian3() + new Cartesian3(), ), direction: Cartesian3.negate(Cartesian3.UNIT_X, new Cartesian3()), up: Cartesian3.UNIT_Z, @@ -1797,7 +1794,7 @@ describe("Core/Transforms", function () { mvpMatrix, vpTransform, Cartesian3.ZERO, - result + result, ); expect(result).toBe(returnedResult); expect(returnedResult).toEqual(expected); @@ -1814,7 +1811,7 @@ describe("Core/Transforms", function () { const returnedResult = Transforms.pointToWindowCoordinates( perspective, vpTransform, - point + point, ); expect(returnedResult).toEqualEpsilon(expected, CesiumMath.EPSILON12); }); @@ -1830,7 +1827,7 @@ describe("Core/Transforms", function () { const returnedResult = Transforms.pointToWindowCoordinates( perspective, vpTransform, - point + point, ); expect(returnedResult).toEqualEpsilon(expected, CesiumMath.EPSILON12); }); @@ -1838,21 +1835,21 @@ describe("Core/Transforms", function () { it("rotationMatrixFromPositionVelocity works without a result parameter", function () { let matrix = Transforms.rotationMatrixFromPositionVelocity( Cartesian3.UNIT_X, - Cartesian3.UNIT_Y + Cartesian3.UNIT_Y, ); let expected = new Matrix3(0, 0, 1, 1, 0, 0, 0, 1, 0); expect(matrix).toEqualEpsilon(expected, CesiumMath.EPSILON14); matrix = Transforms.rotationMatrixFromPositionVelocity( Cartesian3.UNIT_X, - Cartesian3.UNIT_Z + Cartesian3.UNIT_Z, ); expected = new Matrix3(0, 0, 1, 0, -1, 0, 1, 0, 0); expect(matrix).toEqualEpsilon(expected, CesiumMath.EPSILON14); matrix = Transforms.rotationMatrixFromPositionVelocity( Cartesian3.UNIT_Y, - Cartesian3.UNIT_Z + Cartesian3.UNIT_Z, ); expected = new Matrix3(0, 1, 0, 0, 0, 1, 1, 0, 0); expect(matrix).toEqualEpsilon(expected, CesiumMath.EPSILON14); @@ -1864,7 +1861,7 @@ describe("Core/Transforms", function () { Cartesian3.UNIT_X, Cartesian3.UNIT_Y, Ellipsoid.WGS84, - result + result, ); let expected = new Matrix3(0, 0, 1, 1, 0, 0, 0, 1, 0); expect(result).toEqualEpsilon(expected, CesiumMath.EPSILON14); @@ -1873,7 +1870,7 @@ describe("Core/Transforms", function () { Cartesian3.UNIT_X, Cartesian3.UNIT_Z, Ellipsoid.WGS84, - result + result, ); expected = new Matrix3(0, 0, 1, 0, -1, 0, 1, 0, 0); expect(result).toEqualEpsilon(expected, CesiumMath.EPSILON14); @@ -1882,7 +1879,7 @@ describe("Core/Transforms", function () { Cartesian3.UNIT_Y, Cartesian3.UNIT_Z, Ellipsoid.WGS84, - result + result, ); expected = new Matrix3(0, 1, 0, 0, 0, 1, 1, 0, 0); expect(result).toEqualEpsilon(expected, CesiumMath.EPSILON14); @@ -1900,16 +1897,16 @@ describe("Core/Transforms", function () { const modelMatrix = Transforms.headingPitchRollToFixedFrame( origin, hpr, - ellipsoid + ellipsoid, ); const modelMatrix2D = Transforms.basisTo2D( projection, modelMatrix, - new Matrix4() + new Matrix4(), ); const translation2D = Cartesian3.fromCartesian4( - Matrix4.getColumn(modelMatrix2D, 3, new Cartesian4()) + Matrix4.getColumn(modelMatrix2D, 3, new Cartesian4()), ); const carto = ellipsoid.cartesianToCartographic(origin); @@ -1931,12 +1928,12 @@ describe("Core/Transforms", function () { const modelMatrix = Transforms.headingPitchRollToFixedFrame( origin, hpr, - ellipsoid + ellipsoid, ); const modelMatrix2D = Transforms.basisTo2D( projection, modelMatrix, - new Matrix4() + new Matrix4(), ); const rotation2D = Matrix4.getMatrix3(modelMatrix2D, new Matrix3()); @@ -1947,7 +1944,7 @@ describe("Core/Transforms", function () { const hprPlusTranslate = Matrix4.multiply( enuInverse, modelMatrix, - new Matrix4() + new Matrix4(), ); const hpr2 = Matrix4.getMatrix3(hprPlusTranslate, new Matrix3()); @@ -1971,7 +1968,7 @@ describe("Core/Transforms", function () { const actual = Transforms.ellipsoidTo2DModelMatrix( projection, origin, - new Matrix4() + new Matrix4(), ); const expected = Matrix4.fromTranslation(origin); Transforms.basisTo2D(projection, expected, expected); @@ -1980,19 +1977,19 @@ describe("Core/Transforms", function () { const expectedRotation = Matrix4.getMatrix3(expected, new Matrix3()); expect(actualRotation).toEqualEpsilon( expectedRotation, - CesiumMath.EPSILON14 + CesiumMath.EPSILON14, ); const fromENU = Transforms.eastNorthUpToFixedFrame( origin, ellipsoid, - new Matrix4() + new Matrix4(), ); const toENU = Matrix4.inverseTransformation(fromENU, new Matrix4()); const toENUTranslation = Matrix4.getTranslation(toENU, new Cartesian4()); const projectedTranslation = Matrix4.getTranslation( expected, - new Cartesian4() + new Cartesian4(), ); const expectedTranslation = new Cartesian4(); @@ -2004,7 +2001,7 @@ describe("Core/Transforms", function () { expect(actualTranslation).toEqualEpsilon( expectedTranslation, - CesiumMath.EPSILON14 + CesiumMath.EPSILON14, ); }); @@ -2012,12 +2009,12 @@ describe("Core/Transforms", function () { const expected = new HeadingPitchRoll(0.5, 0.6, 0.7); let transform = Transforms.eastNorthUpToFixedFrame( - Cartesian3.fromDegrees(0, 0) + Cartesian3.fromDegrees(0, 0), ); const transform2 = Matrix4.fromTranslationQuaternionRotationScale( new Cartesian3(), Quaternion.fromHeadingPitchRoll(expected), - new Cartesian3(1, 1, 1) + new Cartesian3(1, 1, 1), ); transform = Matrix4.multiply(transform, transform2, transform2); @@ -2053,7 +2050,7 @@ describe("Core/Transforms", function () { expect(function () { Transforms.headingPitchRollToFixedFrame( undefined, - new HeadingPitchRoll() + new HeadingPitchRoll(), ); }).toThrowDeveloperError(); }); @@ -2075,7 +2072,7 @@ describe("Core/Transforms", function () { Transforms.pointToWindowCoordinates( undefined, Matrix4.IDENTITY, - Cartesian3.ZERO + Cartesian3.ZERO, ); }).toThrowDeveloperError(); }); @@ -2085,7 +2082,7 @@ describe("Core/Transforms", function () { Transforms.pointToWindowCoordinates( Matrix4.IDENTITY, undefined, - Cartesian3.ZERO + Cartesian3.ZERO, ); }).toThrowDeveloperError(); }); @@ -2095,7 +2092,7 @@ describe("Core/Transforms", function () { Transforms.pointToWindowCoordinates( Matrix4.IDENTITY, Matrix4.IDENTITY, - undefined + undefined, ); }).toThrowDeveloperError(); }); @@ -2111,7 +2108,7 @@ describe("Core/Transforms", function () { Transforms.basisTo2D( new GeographicProjection(), undefined, - new Matrix4() + new Matrix4(), ); }).toThrowDeveloperError(); }); @@ -2121,7 +2118,7 @@ describe("Core/Transforms", function () { Transforms.basisTo2D( new GeographicProjection(), Matrix4.IDENTITY, - undefined + undefined, ); }).toThrowDeveloperError(); }); @@ -2131,7 +2128,7 @@ describe("Core/Transforms", function () { Transforms.ellipsoidTo2DModelMatrix( undefined, Cartesian3.UNIT_X, - new Matrix4() + new Matrix4(), ); }).toThrowDeveloperError(); }); @@ -2141,7 +2138,7 @@ describe("Core/Transforms", function () { Transforms.ellipsoidTo2DModelMatrix( new GeographicProjection(), undefined, - new Matrix4() + new Matrix4(), ); }).toThrowDeveloperError(); }); @@ -2151,7 +2148,7 @@ describe("Core/Transforms", function () { Transforms.ellipsoidTo2DModelMatrix( new GeographicProjection(), Cartesian3.UNIT_X, - undefined + undefined, ); }).toThrowDeveloperError(); }); diff --git a/packages/engine/Specs/Core/TranslationRotationScaleSpec.js b/packages/engine/Specs/Core/TranslationRotationScaleSpec.js index c673745259eb..ad3afec38d79 100644 --- a/packages/engine/Specs/Core/TranslationRotationScaleSpec.js +++ b/packages/engine/Specs/Core/TranslationRotationScaleSpec.js @@ -21,7 +21,7 @@ describe("Core/TranslationRotationScale", function () { const transformation = new TranslationRotationScale( translation, rotation, - scale + scale, ); expect(transformation.translation).toEqual(translation); diff --git a/packages/engine/Specs/Core/TridiagonalSystemSolverSpec.js b/packages/engine/Specs/Core/TridiagonalSystemSolverSpec.js index b96c8720ab31..15db6f082ce6 100644 --- a/packages/engine/Specs/Core/TridiagonalSystemSolverSpec.js +++ b/packages/engine/Specs/Core/TridiagonalSystemSolverSpec.js @@ -73,14 +73,7 @@ describe("Core/TridiagonalSystemSolver", function () { it("solve nine unknowns", function () { const l = [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0]; const d = [ - -2.0304, - -2.0288, - -2.0272, - -2.0256, - -2.024, - -2.0224, - -2.0208, - -2.0192, + -2.0304, -2.0288, -2.0272, -2.0256, -2.024, -2.0224, -2.0208, -2.0192, -2.0176, ]; const u = [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0]; diff --git a/packages/engine/Specs/Core/TrustedServersSpec.js b/packages/engine/Specs/Core/TrustedServersSpec.js index f5a174a0f8d5..77efce7480ed 100644 --- a/packages/engine/Specs/Core/TrustedServersSpec.js +++ b/packages/engine/Specs/Core/TrustedServersSpec.js @@ -26,55 +26,55 @@ describe("Core/TrustedServers", function () { it("http without a port", function () { TrustedServers.add("cesiumjs.org", 80); expect(TrustedServers.contains("http://cesiumjs.org/index.html")).toBe( - true + true, ); expect(TrustedServers.contains("https://cesiumjs.org/index.html")).toBe( - false + false, ); }); it("https without a port", function () { TrustedServers.add("cesiumjs.org", 443); expect(TrustedServers.contains("https://cesiumjs.org/index.html")).toBe( - true + true, ); expect(TrustedServers.contains("http://cesiumjs.org/index.html")).toBe( - false + false, ); }); it("add", function () { expect(TrustedServers.contains("http://cesiumjs.org:81/index.html")).toBe( - false + false, ); TrustedServers.add("cesiumjs.org", 81); expect(TrustedServers.contains("http://cesiumjs.org/index.html")).toBe( - false + false, ); expect(TrustedServers.contains("http://cesiumjs.org:81/index.html")).toBe( - true + true, ); }); it("remove", function () { TrustedServers.add("cesiumjs.org", 81); expect(TrustedServers.contains("http://cesiumjs.org:81/index.html")).toBe( - true + true, ); TrustedServers.remove("cesiumjs.org", 8080); expect(TrustedServers.contains("http://cesiumjs.org:81/index.html")).toBe( - true + true, ); TrustedServers.remove("cesiumjs.org", 81); expect(TrustedServers.contains("http://cesiumjs.org:81/index.html")).toBe( - false + false, ); }); it("handles username/password credentials", function () { TrustedServers.add("cesiumjs.org", 81); expect( - TrustedServers.contains("http://user:pass@cesiumjs.org:81/index.html") + TrustedServers.contains("http://user:pass@cesiumjs.org:81/index.html"), ).toBe(true); }); @@ -90,15 +90,15 @@ describe("Core/TrustedServers", function () { it("clear", function () { TrustedServers.add("cesiumjs.org", 80); expect(TrustedServers.contains("http://cesiumjs.org/index.html")).toBe( - true + true, ); TrustedServers.clear(); expect(TrustedServers.contains("http://cesiumjs.org/index.html")).toBe( - false + false, ); TrustedServers.add("cesiumjs.org", 80); expect(TrustedServers.contains("http://cesiumjs.org/index.html")).toBe( - true + true, ); }); }); diff --git a/packages/engine/Specs/Core/VRTheWorldTerrainProviderSpec.js b/packages/engine/Specs/Core/VRTheWorldTerrainProviderSpec.js index a4103ae80051..900ca48d8131 100644 --- a/packages/engine/Specs/Core/VRTheWorldTerrainProviderSpec.js +++ b/packages/engine/Specs/Core/VRTheWorldTerrainProviderSpec.js @@ -21,7 +21,7 @@ describe("Core/VRTheWorldTerrainProvider", function () { data, headers, deferred, - overrideMimeType + overrideMimeType, ) { if (url === imageUrl) { Resource._DefaultImplementations.loadWithXhr( @@ -31,7 +31,7 @@ describe("Core/VRTheWorldTerrainProvider", function () { data, headers, deferred, - overrideMimeType + overrideMimeType, ); return; } @@ -90,9 +90,9 @@ describe("Core/VRTheWorldTerrainProvider", function () { it("fromUrl rejects without url", async function () { await expectAsync( - VRTheWorldTerrainProvider.fromUrl() + VRTheWorldTerrainProvider.fromUrl(), ).toBeRejectedWithDeveloperError( - "url is required, actual value was undefined" + "url is required, actual value was undefined", ); }); @@ -131,11 +131,11 @@ describe("Core/VRTheWorldTerrainProvider", function () { expect(provider.getLevelMaximumGeometricError(0)).toBeGreaterThan(0.0); expect(provider.getLevelMaximumGeometricError(0)).toEqualEpsilon( provider.getLevelMaximumGeometricError(1) * 2.0, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); expect(provider.getLevelMaximumGeometricError(1)).toEqualEpsilon( provider.getLevelMaximumGeometricError(2) * 2.0, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); }); @@ -168,7 +168,7 @@ describe("Core/VRTheWorldTerrainProvider", function () { data, headers, deferred, - overrideMimeType + overrideMimeType, ) { setTimeout(function () { const parser = new DOMParser(); @@ -198,10 +198,10 @@ describe("Core/VRTheWorldTerrainProvider", function () { }; await expectAsync( - VRTheWorldTerrainProvider.fromUrl("made/up/url") + VRTheWorldTerrainProvider.fromUrl("made/up/url"), ).toBeRejectedWithError( RuntimeError, - "An error occurred while accessing made/up/url: SRS EPSG:foo is not supported" + "An error occurred while accessing made/up/url: SRS EPSG:foo is not supported", ); }); @@ -214,24 +214,24 @@ describe("Core/VRTheWorldTerrainProvider", function () { Resource._Implementations.createImage = function ( request, crossOrigin, - deferred + deferred, ) { expect(request.url.indexOf(".tif?cesium=true")).toBeGreaterThanOrEqual( - 0 + 0, ); // Just return any old image. Resource._DefaultImplementations.createImage( new Request({ url: imageUrl }), crossOrigin, - deferred + deferred, ); }; const terrainProvider = await VRTheWorldTerrainProvider.fromUrl(baseUrl); expect(terrainProvider.tilingScheme).toBeInstanceOf( - GeographicTilingScheme + GeographicTilingScheme, ); const loadedData = await terrainProvider.requestTileGeometry(0, 0, 0); expect(loadedData).toBeInstanceOf(HeightmapTerrainData); @@ -244,7 +244,7 @@ describe("Core/VRTheWorldTerrainProvider", function () { RequestScheduler.maximumRequestsPerServer = 0; expect( - terrainProvider.requestTileGeometry(0, 0, 0, createRequest()) + terrainProvider.requestTileGeometry(0, 0, 0, createRequest()), ).toBeUndefined(); }); }); diff --git a/packages/engine/Specs/Core/VertexFormatSpec.js b/packages/engine/Specs/Core/VertexFormatSpec.js index 85acde809a35..f14735bc596c 100644 --- a/packages/engine/Specs/Core/VertexFormatSpec.js +++ b/packages/engine/Specs/Core/VertexFormatSpec.js @@ -23,12 +23,9 @@ describe("Core/VertexFormat", function () { expect(cloned).toEqual(vertexFormat); }); - createPackableSpecs(VertexFormat, VertexFormat.POSITION_AND_NORMAL, [ - 1.0, - 1.0, - 0.0, - 0.0, - 0.0, - 0.0, - ]); + createPackableSpecs( + VertexFormat, + VertexFormat.POSITION_AND_NORMAL, + [1.0, 1.0, 0.0, 0.0, 0.0, 0.0], + ); }); diff --git a/packages/engine/Specs/Core/VerticalExaggerationSpec.js b/packages/engine/Specs/Core/VerticalExaggerationSpec.js index 1d261e5c9791..e429cf93c09f 100644 --- a/packages/engine/Specs/Core/VerticalExaggerationSpec.js +++ b/packages/engine/Specs/Core/VerticalExaggerationSpec.js @@ -14,7 +14,7 @@ describe("Core/VerticalExaggeration", function () { const result = VerticalExaggeration.getHeight( height, scale, - relativeHeight + relativeHeight, ); expect(result).toEqual(height); }); @@ -27,7 +27,7 @@ describe("Core/VerticalExaggeration", function () { const result = VerticalExaggeration.getHeight( height, scale, - relativeHeight + relativeHeight, ); expect(result).toEqual(200.0); }); @@ -40,7 +40,7 @@ describe("Core/VerticalExaggeration", function () { const result = VerticalExaggeration.getHeight( height, scale, - relativeHeight + relativeHeight, ); expect(result).toEqual(100.0); }); @@ -53,7 +53,7 @@ describe("Core/VerticalExaggeration", function () { const result = VerticalExaggeration.getHeight( height, scale, - relativeHeight + relativeHeight, ); expect(result).toEqual(0.0); }); @@ -68,7 +68,7 @@ describe("Core/VerticalExaggeration", function () { position, ellipsoid, verticalExaggeration, - verticalExaggerationRelativeHeight + verticalExaggerationRelativeHeight, ); expect(result).toEqualEpsilon(position, CesiumMath.EPSILON8); }); @@ -83,11 +83,11 @@ describe("Core/VerticalExaggeration", function () { position, ellipsoid, verticalExaggeration, - verticalExaggerationRelativeHeight + verticalExaggerationRelativeHeight, ); expect(result).toEqualEpsilon( Cartesian3.fromRadians(0.0, 0.0, 200.0), - CesiumMath.EPSILON8 + CesiumMath.EPSILON8, ); }); @@ -101,7 +101,7 @@ describe("Core/VerticalExaggeration", function () { position, ellipsoid, verticalExaggeration, - verticalExaggerationRelativeHeight + verticalExaggerationRelativeHeight, ); expect(result).toEqualEpsilon(position, CesiumMath.EPSILON8); }); @@ -116,11 +116,11 @@ describe("Core/VerticalExaggeration", function () { position, ellipsoid, verticalExaggeration, - verticalExaggerationRelativeHeight + verticalExaggerationRelativeHeight, ); expect(result).toEqualEpsilon( Cartesian3.fromRadians(0.0, 0.0, 0.0), - CesiumMath.EPSILON8 + CesiumMath.EPSILON8, ); }); }); diff --git a/packages/engine/Specs/Core/VideoSynchronizerSpec.js b/packages/engine/Specs/Core/VideoSynchronizerSpec.js index 2b7e578238d1..642011a73da8 100644 --- a/packages/engine/Specs/Core/VideoSynchronizerSpec.js +++ b/packages/engine/Specs/Core/VideoSynchronizerSpec.js @@ -102,7 +102,7 @@ describe("Core/VideoSynchronizer", function () { return CesiumMath.equalsEpsilon( element.currentTime, 60 - element.duration, - CesiumMath.EPSILON3 + CesiumMath.EPSILON3, ); }); }) @@ -113,7 +113,7 @@ describe("Core/VideoSynchronizer", function () { return CesiumMath.equalsEpsilon( element.currentTime, element.duration - 1, - CesiumMath.EPSILON1 + CesiumMath.EPSILON1, ); }); }) @@ -154,7 +154,7 @@ describe("Core/VideoSynchronizer", function () { return CesiumMath.equalsEpsilon( element.currentTime, element.duration, - CesiumMath.EPSILON3 + CesiumMath.EPSILON3, ); }); }) diff --git a/packages/engine/Specs/Core/WallGeometrySpec.js b/packages/engine/Specs/Core/WallGeometrySpec.js index d8f430d9f0ab..c7667e7217f3 100644 --- a/packages/engine/Specs/Core/WallGeometrySpec.js +++ b/packages/engine/Specs/Core/WallGeometrySpec.js @@ -39,17 +39,9 @@ describe("Core/WallGeometry", function () { const geometry = WallGeometry.createGeometry( new WallGeometry({ positions: Cartesian3.fromDegreesArrayHeights([ - 49.0, - 18.0, - 1000.0, - 49.0, - 18.0, - 5000.0, - 49.0, - 18.0, - 1000.0, + 49.0, 18.0, 1000.0, 49.0, 18.0, 5000.0, 49.0, 18.0, 1000.0, ]), - }) + }), ); expect(geometry).toBeUndefined(); }); @@ -58,29 +50,19 @@ describe("Core/WallGeometry", function () { let geometry = WallGeometry.createGeometry( new WallGeometry({ positions: Cartesian3.fromDegreesArray([ - 49.0, - 18.0, - 49.0, - 18.0, - 49.0, - 18.0, + 49.0, 18.0, 49.0, 18.0, 49.0, 18.0, ]), - }) + }), ); expect(geometry).toBeUndefined(); geometry = WallGeometry.createGeometry( new WallGeometry({ positions: Cartesian3.fromDegreesArray([ - 49.0, - 18.0, - 49.0, - 18.0, - 49.0, - 18.0, + 49.0, 18.0, 49.0, 18.0, 49.0, 18.0, ]), maximumHeights: [0, 0, 0], - }) + }), ); expect(geometry).toBeUndefined(); }); @@ -90,12 +72,10 @@ describe("Core/WallGeometry", function () { new WallGeometry({ vertexFormat: VertexFormat.POSITION_ONLY, positions: Cartesian3.fromDegreesArray([ - -47.93121266896352, - -15.771192496304398, - -47.93119792786269, + -47.93121266896352, -15.771192496304398, -47.93119792786269, -15.771148001875085, ]), - }) + }), ); }); @@ -104,14 +84,9 @@ describe("Core/WallGeometry", function () { new WallGeometry({ vertexFormat: VertexFormat.POSITION_ONLY, positions: Cartesian3.fromDegreesArrayHeights([ - 49.0, - 18.0, - 1000.0, - 50.0, - 18.0, - 1000.0, + 49.0, 18.0, 1000.0, 50.0, 18.0, 1000.0, ]), - }) + }), ); const positions = w.attributes.position.values; @@ -121,12 +96,12 @@ describe("Core/WallGeometry", function () { expect(w.indices.length).toEqual(numTriangles * 3); let cartographic = ellipsoid.cartesianToCartographic( - Cartesian3.fromArray(positions, 0) + Cartesian3.fromArray(positions, 0), ); expect(cartographic.height).toEqualEpsilon(0.0, CesiumMath.EPSILON8); cartographic = ellipsoid.cartesianToCartographic( - Cartesian3.fromArray(positions, 3) + Cartesian3.fromArray(positions, 3), ); expect(cartographic.height).toEqualEpsilon(1000.0, CesiumMath.EPSILON8); }); @@ -136,23 +111,10 @@ describe("Core/WallGeometry", function () { new WallGeometry({ vertexFormat: VertexFormat.POSITION_ONLY, positions: Cartesian3.fromDegreesArrayHeights([ - -107.0, - 43.0, - 1000.0, - -106.0, - 43.0, - 1000.0, - -106.0, - 42.0, - 1000.0, - -107.0, - 42.0, - 1000.0, - -107.0, - 43.0, - 1000.0, + -107.0, 43.0, 1000.0, -106.0, 43.0, 1000.0, -106.0, 42.0, 1000.0, + -107.0, 42.0, 1000.0, -107.0, 43.0, 1000.0, ]), - }) + }), ); const positions = w.attributes.position.values; @@ -162,12 +124,12 @@ describe("Core/WallGeometry", function () { expect(w.indices.length).toEqual(numTriangles * 3); let cartographic = ellipsoid.cartesianToCartographic( - Cartesian3.fromArray(positions, 0) + Cartesian3.fromArray(positions, 0), ); expect(cartographic.height).toEqualEpsilon(0.0, CesiumMath.EPSILON8); cartographic = ellipsoid.cartesianToCartographic( - Cartesian3.fromArray(positions, 3) + Cartesian3.fromArray(positions, 3), ); expect(cartographic.height).toEqualEpsilon(1000.0, CesiumMath.EPSILON8); }); @@ -177,16 +139,11 @@ describe("Core/WallGeometry", function () { new WallGeometry({ vertexFormat: VertexFormat.POSITION_ONLY, positions: Cartesian3.fromDegreesArrayHeights([ - 49.0, - 18.0, - 1000.0, - 50.0, - 18.0, - 1000.0, + 49.0, 18.0, 1000.0, 50.0, 18.0, 1000.0, ]), minimumHeights: [1000.0, 2000.0], maximumHeights: [3000.0, 4000.0], - }) + }), ); const positions = w.attributes.position.values; @@ -196,22 +153,22 @@ describe("Core/WallGeometry", function () { expect(w.indices.length).toEqual(numTriangles * 3); let cartographic = ellipsoid.cartesianToCartographic( - Cartesian3.fromArray(positions, 0) + Cartesian3.fromArray(positions, 0), ); expect(cartographic.height).toEqualEpsilon(1000.0, CesiumMath.EPSILON8); cartographic = ellipsoid.cartesianToCartographic( - Cartesian3.fromArray(positions, 3) + Cartesian3.fromArray(positions, 3), ); expect(cartographic.height).toEqualEpsilon(3000.0, CesiumMath.EPSILON8); cartographic = ellipsoid.cartesianToCartographic( - Cartesian3.fromArray(positions, 6) + Cartesian3.fromArray(positions, 6), ); expect(cartographic.height).toEqualEpsilon(2000.0, CesiumMath.EPSILON8); cartographic = ellipsoid.cartesianToCartographic( - Cartesian3.fromArray(positions, 9) + Cartesian3.fromArray(positions, 9), ); expect(cartographic.height).toEqualEpsilon(4000.0, CesiumMath.EPSILON8); }); @@ -221,29 +178,11 @@ describe("Core/WallGeometry", function () { new WallGeometry({ vertexFormat: VertexFormat.POSITION_ONLY, positions: Cartesian3.fromDegreesArrayHeights([ - 49.0, - 18.0, - 1000.0, - 49.0, - 18.0, - 2000.0, - 50.0, - 18.0, - 1000.0, - 50.0, - 18.0, - 1000.0, - 50.0, - 18.0, - 1000.0, - 51.0, - 18.0, - 1000.0, - 51.0, - 18.0, + 49.0, 18.0, 1000.0, 49.0, 18.0, 2000.0, 50.0, 18.0, 1000.0, 50.0, + 18.0, 1000.0, 50.0, 18.0, 1000.0, 51.0, 18.0, 1000.0, 51.0, 18.0, 1000.0, ]), - }) + }), ); const numPositions = 8; @@ -253,12 +192,12 @@ describe("Core/WallGeometry", function () { expect(w.indices.length).toEqual(numTriangles * 3); let cartographic = ellipsoid.cartesianToCartographic( - Cartesian3.fromArray(positions, 0) + Cartesian3.fromArray(positions, 0), ); expect(cartographic.height).toEqualEpsilon(0.0, CesiumMath.EPSILON8); cartographic = ellipsoid.cartesianToCartographic( - Cartesian3.fromArray(positions, 3) + Cartesian3.fromArray(positions, 3), ); expect(cartographic.height).toEqualEpsilon(2000.0, CesiumMath.EPSILON8); }); @@ -271,25 +210,25 @@ describe("Core/WallGeometry", function () { new Cartesian3( 4347090.215457887, 1061403.4237998386, - 4538066.036525028 + 4538066.036525028, ), new Cartesian3( 4348147.589624987, 1043897.8776143644, - 4541092.234751661 + 4541092.234751661, ), new Cartesian3( 4348147.589882754, 1043897.8776762491, - 4541092.234492364 + 4541092.234492364, ), new Cartesian3( 4335659.882947743, 1047571.602084736, - 4552098.654605664 + 4552098.654605664, ), ], - }) + }), ); const numPositions = 8; @@ -319,7 +258,7 @@ describe("Core/WallGeometry", function () { new WallGeometry({ vertexFormat: VertexFormat.POSITION_ONLY, positions: inputPositions, - }) + }), ); expect(w).toBeDefined(); @@ -335,11 +274,11 @@ describe("Core/WallGeometry", function () { new WallGeometry({ vertexFormat: VertexFormat.POSITION_ONLY, positions: expectedPositions, - }) + }), ); const positions = w.attributes.position.values; expect(positions.length).toEqual( - expectedW.attributes.position.values.length + expectedW.attributes.position.values.length, ); }); @@ -348,23 +287,10 @@ describe("Core/WallGeometry", function () { new WallGeometry({ vertexFormat: VertexFormat.POSITION_ONLY, positions: Cartesian3.fromDegreesArrayHeights([ - 49.0, - 18.0, - 1000.0, - 50.0, - 18.0, - 1000.0, - 50.0, - 18.0, - 6000.0, - 50.0, - 18.0, - 10000.0, - 51.0, - 18.0, - 1000.0, + 49.0, 18.0, 1000.0, 50.0, 18.0, 1000.0, 50.0, 18.0, 6000.0, 50.0, + 18.0, 10000.0, 51.0, 18.0, 1000.0, ]), - }) + }), ); const numPositions = 8; @@ -374,12 +300,12 @@ describe("Core/WallGeometry", function () { expect(w.indices.length).toEqual(numTriangles * 3); let cartographic = ellipsoid.cartesianToCartographic( - Cartesian3.fromArray(positions, 0) + Cartesian3.fromArray(positions, 0), ); expect(cartographic.height).toEqualEpsilon(0.0, CesiumMath.EPSILON8); cartographic = ellipsoid.cartesianToCartographic( - Cartesian3.fromArray(positions, 9) + Cartesian3.fromArray(positions, 9), ); expect(cartographic.height).toEqualEpsilon(10000.0, CesiumMath.EPSILON8); }); @@ -389,17 +315,9 @@ describe("Core/WallGeometry", function () { new WallGeometry({ vertexFormat: VertexFormat.ALL, positions: Cartesian3.fromDegreesArrayHeights([ - 49.0, - 18.0, - 1000.0, - 50.0, - 18.0, - 1000.0, - 51.0, - 18.0, - 1000.0, + 49.0, 18.0, 1000.0, 50.0, 18.0, 1000.0, 51.0, 18.0, 1000.0, ]), - }) + }), ); const numPositions = 8; @@ -417,36 +335,14 @@ describe("Core/WallGeometry", function () { new WallGeometry({ vertexFormat: VertexFormat.ALL, positions: Cartesian3.fromDegreesArrayHeights([ - 49.0, - 18.0, - 1000.0, - 50.0, - 18.0, - 1000.0, - 51.0, - 18.0, - 1000.0, + 49.0, 18.0, 1000.0, 50.0, 18.0, 1000.0, 51.0, 18.0, 1000.0, ]), - }) + }), ); expect(w.attributes.st.values.length).toEqual(4 * 2 * 2); expect(w.attributes.st.values).toEqual([ - 0.0, - 0.0, - 0.0, - 1.0, - 0.5, - 0.0, - 0.5, - 1.0, - 0.5, - 0.0, - 0.5, - 1.0, - 1.0, - 0.0, - 1.0, + 0.0, 0.0, 0.0, 1.0, 0.5, 0.0, 0.5, 1.0, 0.5, 0.0, 0.5, 1.0, 1.0, 0.0, 1.0, 1.0, ]); }); @@ -456,39 +352,15 @@ describe("Core/WallGeometry", function () { new WallGeometry({ vertexFormat: VertexFormat.ALL, positions: Cartesian3.fromDegreesArrayHeights([ - 49.0, - 18.0, - 1000.0, - 50.0, - 18.0, - 1000.0, - 50.0, - 18.0, - 1000.0, - 51.0, - 18.0, - 1000.0, + 49.0, 18.0, 1000.0, 50.0, 18.0, 1000.0, 50.0, 18.0, 1000.0, 51.0, + 18.0, 1000.0, ]), - }) + }), ); expect(w.attributes.st.values.length).toEqual(4 * 2 * 2); expect(w.attributes.st.values).toEqual([ - 0.0, - 0.0, - 0.0, - 1.0, - 0.5, - 0.0, - 0.5, - 1.0, - 0.5, - 0.0, - 0.5, - 1.0, - 1.0, - 0.0, - 1.0, + 0.0, 0.0, 0.0, 1.0, 0.5, 0.0, 0.5, 1.0, 0.5, 0.0, 0.5, 1.0, 1.0, 0.0, 1.0, 1.0, ]); }); @@ -507,16 +379,11 @@ describe("Core/WallGeometry", function () { WallGeometry.fromConstantHeights({ vertexFormat: VertexFormat.POSITION_ONLY, positions: Cartesian3.fromDegreesArrayHeights([ - 49.0, - 18.0, - 1000.0, - 50.0, - 18.0, - 1000.0, + 49.0, 18.0, 1000.0, 50.0, 18.0, 1000.0, ]), minimumHeight: min, maximumHeight: max, - }) + }), ); const numPositions = 4; @@ -526,22 +393,22 @@ describe("Core/WallGeometry", function () { expect(w.indices.length).toEqual(numTriangles * 3); let cartographic = ellipsoid.cartesianToCartographic( - Cartesian3.fromArray(positions, 0) + Cartesian3.fromArray(positions, 0), ); expect(cartographic.height).toEqualEpsilon(min, CesiumMath.EPSILON8); cartographic = ellipsoid.cartesianToCartographic( - Cartesian3.fromArray(positions, 3) + Cartesian3.fromArray(positions, 3), ); expect(cartographic.height).toEqualEpsilon(max, CesiumMath.EPSILON8); cartographic = ellipsoid.cartesianToCartographic( - Cartesian3.fromArray(positions, 6) + Cartesian3.fromArray(positions, 6), ); expect(cartographic.height).toEqualEpsilon(min, CesiumMath.EPSILON8); cartographic = ellipsoid.cartesianToCartographic( - Cartesian3.fromArray(positions, 9) + Cartesian3.fromArray(positions, 9), ); expect(cartographic.height).toEqualEpsilon(max, CesiumMath.EPSILON8); }); @@ -558,28 +425,8 @@ describe("Core/WallGeometry", function () { ellipsoid: Ellipsoid.UNIT_SPHERE, }); const packedInstance = [ - 3.0, - 1.0, - 0.0, - 0.0, - 0.0, - 1.0, - 0.0, - 0.0, - 0.0, - 1.0, - 0.0, - 0.0, - 1.0, - 1.0, - 1.0, - 1.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.01, + 3.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 1.0, 1.0, + 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.01, ]; createPackableSpecs(WallGeometry, wall, packedInstance); }); diff --git a/packages/engine/Specs/Core/WallOutlineGeometrySpec.js b/packages/engine/Specs/Core/WallOutlineGeometrySpec.js index 42435f0eb47c..7b4777cd3a29 100644 --- a/packages/engine/Specs/Core/WallOutlineGeometrySpec.js +++ b/packages/engine/Specs/Core/WallOutlineGeometrySpec.js @@ -38,17 +38,9 @@ describe("Core/WallOutlineGeometry", function () { const geometry = WallOutlineGeometry.createGeometry( new WallOutlineGeometry({ positions: Cartesian3.fromDegreesArrayHeights([ - 49.0, - 18.0, - 1000.0, - 49.0, - 18.0, - 5000.0, - 49.0, - 18.0, - 1000.0, + 49.0, 18.0, 1000.0, 49.0, 18.0, 5000.0, 49.0, 18.0, 1000.0, ]), - }) + }), ); expect(geometry).toBeUndefined(); }); @@ -57,29 +49,19 @@ describe("Core/WallOutlineGeometry", function () { let geometry = WallOutlineGeometry.createGeometry( new WallOutlineGeometry({ positions: Cartesian3.fromDegreesArray([ - 49.0, - 18.0, - 49.0, - 18.0, - 49.0, - 18.0, + 49.0, 18.0, 49.0, 18.0, 49.0, 18.0, ]), - }) + }), ); expect(geometry).toBeUndefined(); geometry = WallOutlineGeometry.createGeometry( new WallOutlineGeometry({ positions: Cartesian3.fromDegreesArray([ - 49.0, - 18.0, - 49.0, - 18.0, - 49.0, - 18.0, + 49.0, 18.0, 49.0, 18.0, 49.0, 18.0, ]), maximumHeights: [0, 0, 0], - }) + }), ); expect(geometry).toBeUndefined(); }); @@ -88,15 +70,10 @@ describe("Core/WallOutlineGeometry", function () { const w = WallOutlineGeometry.createGeometry( new WallOutlineGeometry({ positions: Cartesian3.fromDegreesArrayHeights([ - 49.0, - 18.0, - 1000.0, - 50.0, - 18.0, - 1000.0, + 49.0, 18.0, 1000.0, 50.0, 18.0, 1000.0, ]), granularity: Math.PI, - }) + }), ); const positions = w.attributes.position.values; @@ -104,12 +81,12 @@ describe("Core/WallOutlineGeometry", function () { expect(w.indices.length).toEqual(4 * 2); let cartographic = ellipsoid.cartesianToCartographic( - Cartesian3.fromArray(positions, 0) + Cartesian3.fromArray(positions, 0), ); expect(cartographic.height).toEqualEpsilon(0.0, CesiumMath.EPSILON8); cartographic = ellipsoid.cartesianToCartographic( - Cartesian3.fromArray(positions, 3) + Cartesian3.fromArray(positions, 3), ); expect(cartographic.height).toEqualEpsilon(1000.0, CesiumMath.EPSILON8); }); @@ -118,17 +95,12 @@ describe("Core/WallOutlineGeometry", function () { const w = WallOutlineGeometry.createGeometry( new WallOutlineGeometry({ positions: Cartesian3.fromDegreesArrayHeights([ - 49.0, - 18.0, - 1000.0, - 50.0, - 18.0, - 1000.0, + 49.0, 18.0, 1000.0, 50.0, 18.0, 1000.0, ]), minimumHeights: [1000.0, 2000.0], maximumHeights: [3000.0, 4000.0], granularity: Math.PI, - }) + }), ); const positions = w.attributes.position.values; @@ -136,22 +108,22 @@ describe("Core/WallOutlineGeometry", function () { expect(w.indices.length).toEqual(4 * 2); let cartographic = ellipsoid.cartesianToCartographic( - Cartesian3.fromArray(positions, 0) + Cartesian3.fromArray(positions, 0), ); expect(cartographic.height).toEqualEpsilon(1000.0, CesiumMath.EPSILON8); cartographic = ellipsoid.cartesianToCartographic( - Cartesian3.fromArray(positions, 3) + Cartesian3.fromArray(positions, 3), ); expect(cartographic.height).toEqualEpsilon(3000.0, CesiumMath.EPSILON8); cartographic = ellipsoid.cartesianToCartographic( - Cartesian3.fromArray(positions, 6) + Cartesian3.fromArray(positions, 6), ); expect(cartographic.height).toEqualEpsilon(2000.0, CesiumMath.EPSILON8); cartographic = ellipsoid.cartesianToCartographic( - Cartesian3.fromArray(positions, 9) + Cartesian3.fromArray(positions, 9), ); expect(cartographic.height).toEqualEpsilon(4000.0, CesiumMath.EPSILON8); }); @@ -160,29 +132,11 @@ describe("Core/WallOutlineGeometry", function () { const w = WallOutlineGeometry.createGeometry( new WallOutlineGeometry({ positions: Cartesian3.fromDegreesArrayHeights([ - 49.0, - 18.0, - 1000.0, - 49.0, - 18.0, - 2000.0, - 50.0, - 18.0, - 1000.0, - 50.0, - 18.0, - 1000.0, - 50.0, - 18.0, - 1000.0, - 51.0, - 18.0, - 1000.0, - 51.0, - 18.0, + 49.0, 18.0, 1000.0, 49.0, 18.0, 2000.0, 50.0, 18.0, 1000.0, 50.0, + 18.0, 1000.0, 50.0, 18.0, 1000.0, 51.0, 18.0, 1000.0, 51.0, 18.0, 1000.0, ]), - }) + }), ); const positions = w.attributes.position.values; @@ -190,12 +144,12 @@ describe("Core/WallOutlineGeometry", function () { expect(w.indices.length).toEqual(7 * 2); //3 vertical + 4 horizontal let cartographic = ellipsoid.cartesianToCartographic( - Cartesian3.fromArray(positions, 0) + Cartesian3.fromArray(positions, 0), ); expect(cartographic.height).toEqualEpsilon(0.0, CesiumMath.EPSILON8); cartographic = ellipsoid.cartesianToCartographic( - Cartesian3.fromArray(positions, 3) + Cartesian3.fromArray(positions, 3), ); expect(cartographic.height).toEqualEpsilon(2000.0, CesiumMath.EPSILON8); }); @@ -213,16 +167,11 @@ describe("Core/WallOutlineGeometry", function () { const w = WallOutlineGeometry.createGeometry( WallOutlineGeometry.fromConstantHeights({ positions: Cartesian3.fromDegreesArrayHeights([ - 49.0, - 18.0, - 1000.0, - 50.0, - 18.0, - 1000.0, + 49.0, 18.0, 1000.0, 50.0, 18.0, 1000.0, ]), minimumHeight: min, maximumHeight: max, - }) + }), ); const positions = w.attributes.position.values; @@ -230,22 +179,22 @@ describe("Core/WallOutlineGeometry", function () { expect(w.indices.length).toEqual(4 * 2); let cartographic = ellipsoid.cartesianToCartographic( - Cartesian3.fromArray(positions, 0) + Cartesian3.fromArray(positions, 0), ); expect(cartographic.height).toEqualEpsilon(min, CesiumMath.EPSILON8); cartographic = ellipsoid.cartesianToCartographic( - Cartesian3.fromArray(positions, 3) + Cartesian3.fromArray(positions, 3), ); expect(cartographic.height).toEqualEpsilon(max, CesiumMath.EPSILON8); cartographic = ellipsoid.cartesianToCartographic( - Cartesian3.fromArray(positions, 6) + Cartesian3.fromArray(positions, 6), ); expect(cartographic.height).toEqualEpsilon(min, CesiumMath.EPSILON8); cartographic = ellipsoid.cartesianToCartographic( - Cartesian3.fromArray(positions, 9) + Cartesian3.fromArray(positions, 9), ); expect(cartographic.height).toEqualEpsilon(max, CesiumMath.EPSILON8); }); @@ -261,21 +210,7 @@ describe("Core/WallOutlineGeometry", function () { ellipsoid: Ellipsoid.UNIT_SPHERE, }); const packedInstance = [ - 3.0, - 1.0, - 0.0, - 0.0, - 0.0, - 1.0, - 0.0, - 0.0, - 0.0, - 1.0, - 0.0, - 0.0, - 1.0, - 1.0, - 1.0, + 3.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 1.0, 1.0, 0.01, ]; createPackableSpecs(WallOutlineGeometry, wall, packedInstance); diff --git a/packages/engine/Specs/Core/WebMercatorProjectionSpec.js b/packages/engine/Specs/Core/WebMercatorProjectionSpec.js index e8c8d0eee172..5c0045d22f8c 100644 --- a/packages/engine/Specs/Core/WebMercatorProjectionSpec.js +++ b/packages/engine/Specs/Core/WebMercatorProjectionSpec.js @@ -24,7 +24,7 @@ describe("Core/WebMercatorProjection", function () { const cartographic = new Cartographic(0.0, 0.0, height); const projection = new WebMercatorProjection(); expect(projection.project(cartographic)).toEqual( - new Cartesian3(0.0, 0.0, height) + new Cartesian3(0.0, 0.0, height), ); }); @@ -33,7 +33,7 @@ describe("Core/WebMercatorProjection", function () { const cartographic = new Cartographic( Math.PI, CesiumMath.PI_OVER_FOUR, - 0.0 + 0.0, ); // expected equations from Wolfram MathWorld: @@ -42,13 +42,13 @@ describe("Core/WebMercatorProjection", function () { ellipsoid.maximumRadius * cartographic.longitude, ellipsoid.maximumRadius * Math.log(Math.tan(Math.PI / 4.0 + cartographic.latitude / 2.0)), - 0.0 + 0.0, ); const projection = new WebMercatorProjection(ellipsoid); expect(projection.project(cartographic)).toEqualEpsilon( expected, - CesiumMath.EPSILON8 + CesiumMath.EPSILON8, ); }); @@ -57,7 +57,7 @@ describe("Core/WebMercatorProjection", function () { const cartographic = new Cartographic( -Math.PI, CesiumMath.PI_OVER_FOUR, - 0.0 + 0.0, ); // expected equations from Wolfram MathWorld: @@ -66,13 +66,13 @@ describe("Core/WebMercatorProjection", function () { ellipsoid.maximumRadius * cartographic.longitude, ellipsoid.maximumRadius * Math.log(Math.tan(Math.PI / 4.0 + cartographic.latitude / 2.0)), - 0.0 + 0.0, ); const projection = new WebMercatorProjection(ellipsoid); expect(projection.project(cartographic)).toEqualEpsilon( expected, - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); }); @@ -81,7 +81,7 @@ describe("Core/WebMercatorProjection", function () { const cartographic = new Cartographic( Math.PI, CesiumMath.PI_OVER_FOUR, - 0.0 + 0.0, ); // expected equations from Wolfram MathWorld: @@ -90,7 +90,7 @@ describe("Core/WebMercatorProjection", function () { ellipsoid.maximumRadius * cartographic.longitude, ellipsoid.maximumRadius * Math.log(Math.tan(Math.PI / 4.0 + cartographic.latitude / 2.0)), - 0.0 + 0.0, ); const projection = new WebMercatorProjection(ellipsoid); @@ -104,13 +104,13 @@ describe("Core/WebMercatorProjection", function () { const cartographic = new Cartographic( CesiumMath.PI_OVER_TWO, CesiumMath.PI_OVER_FOUR, - 12.0 + 12.0, ); const projection = new WebMercatorProjection(); const projected = projection.project(cartographic); expect(projection.unproject(projected)).toEqualEpsilon( cartographic, - CesiumMath.EPSILON14 + CesiumMath.EPSILON14, ); }); @@ -118,7 +118,7 @@ describe("Core/WebMercatorProjection", function () { const cartographic = new Cartographic( CesiumMath.PI_OVER_TWO, CesiumMath.PI_OVER_FOUR, - 12.0 + 12.0, ); const projection = new WebMercatorProjection(); const projected = projection.project(cartographic); @@ -131,39 +131,39 @@ describe("Core/WebMercatorProjection", function () { it("unproject is correct at corners", function () { const projection = new WebMercatorProjection(); const southwest = projection.unproject( - new Cartesian2(-20037508.342787, -20037508.342787) + new Cartesian2(-20037508.342787, -20037508.342787), ); expect(southwest.longitude).toEqualEpsilon(-Math.PI, CesiumMath.EPSILON12); expect(southwest.latitude).toEqualEpsilon( CesiumMath.toRadians(-85.05112878), - CesiumMath.EPSILON11 + CesiumMath.EPSILON11, ); const southeast = projection.unproject( - new Cartesian2(20037508.342787, -20037508.342787) + new Cartesian2(20037508.342787, -20037508.342787), ); expect(southeast.longitude).toEqualEpsilon(Math.PI, CesiumMath.EPSILON12); expect(southeast.latitude).toEqualEpsilon( CesiumMath.toRadians(-85.05112878), - CesiumMath.EPSILON11 + CesiumMath.EPSILON11, ); const northeast = projection.unproject( - new Cartesian2(20037508.342787, 20037508.342787) + new Cartesian2(20037508.342787, 20037508.342787), ); expect(northeast.longitude).toEqualEpsilon(Math.PI, CesiumMath.EPSILON12); expect(northeast.latitude).toEqualEpsilon( CesiumMath.toRadians(85.05112878), - CesiumMath.EPSILON11 + CesiumMath.EPSILON11, ); const northwest = projection.unproject( - new Cartesian2(-20037508.342787, 20037508.342787) + new Cartesian2(-20037508.342787, 20037508.342787), ); expect(northwest.longitude).toEqualEpsilon(-Math.PI, CesiumMath.EPSILON12); expect(northwest.latitude).toEqualEpsilon( CesiumMath.toRadians(85.05112878), - CesiumMath.EPSILON11 + CesiumMath.EPSILON11, ); }); @@ -173,25 +173,25 @@ describe("Core/WebMercatorProjection", function () { const projection = new WebMercatorProjection(); const southwest = projection.project( - new Cartographic(-Math.PI, -maxLatitude) + new Cartographic(-Math.PI, -maxLatitude), ); expect(southwest.x).toEqualEpsilon(-20037508.342787, CesiumMath.EPSILON3); expect(southwest.y).toEqualEpsilon(-20037508.342787, CesiumMath.EPSILON3); const southeast = projection.project( - new Cartographic(Math.PI, -maxLatitude) + new Cartographic(Math.PI, -maxLatitude), ); expect(southeast.x).toEqualEpsilon(20037508.342787, CesiumMath.EPSILON3); expect(southeast.y).toEqualEpsilon(-20037508.342787, CesiumMath.EPSILON3); const northeast = projection.project( - new Cartographic(Math.PI, maxLatitude) + new Cartographic(Math.PI, maxLatitude), ); expect(northeast.x).toEqualEpsilon(20037508.342787, CesiumMath.EPSILON3); expect(northeast.y).toEqualEpsilon(20037508.342787, CesiumMath.EPSILON3); const northwest = projection.project( - new Cartographic(-Math.PI, maxLatitude) + new Cartographic(-Math.PI, maxLatitude), ); expect(northwest.x).toEqualEpsilon(-20037508.342787, CesiumMath.EPSILON3); expect(northwest.y).toEqualEpsilon(20037508.342787, CesiumMath.EPSILON3); @@ -200,18 +200,18 @@ describe("Core/WebMercatorProjection", function () { it("projected y is clamped to valid latitude range.", function () { const projection = new WebMercatorProjection(); const southPole = projection.project( - new Cartographic(0.0, -CesiumMath.PI_OVER_TWO) + new Cartographic(0.0, -CesiumMath.PI_OVER_TWO), ); const southLimit = projection.project( - new Cartographic(0.0, -WebMercatorProjection.MaximumLatitude) + new Cartographic(0.0, -WebMercatorProjection.MaximumLatitude), ); expect(southPole.y).toEqual(southLimit.y); const northPole = projection.project( - new Cartographic(0.0, CesiumMath.PI_OVER_TWO) + new Cartographic(0.0, CesiumMath.PI_OVER_TWO), ); const northLimit = projection.project( - new Cartographic(0.0, WebMercatorProjection.MaximumLatitude) + new Cartographic(0.0, WebMercatorProjection.MaximumLatitude), ); expect(northPole.y).toEqual(northLimit.y); }); diff --git a/packages/engine/Specs/Core/WebMercatorTilingSchemeSpec.js b/packages/engine/Specs/Core/WebMercatorTilingSchemeSpec.js index 8c1b325fbeac..985be4a81ce8 100644 --- a/packages/engine/Specs/Core/WebMercatorTilingSchemeSpec.js +++ b/packages/engine/Specs/Core/WebMercatorTilingSchemeSpec.js @@ -37,19 +37,19 @@ describe("Core/WebMercatorTilingScheme", function () { const tilingSchemeRectangle = tilingScheme.rectangle; expect(rectangle.west).toEqualEpsilon( tilingSchemeRectangle.west, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); expect(rectangle.south).toEqualEpsilon( tilingSchemeRectangle.south, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); expect(rectangle.east).toEqualEpsilon( tilingSchemeRectangle.east, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); expect(rectangle.north).toEqualEpsilon( tilingSchemeRectangle.north, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); }); @@ -60,19 +60,19 @@ describe("Core/WebMercatorTilingScheme", function () { expect(result).toEqual(rectangle); expect(rectangle.west).toEqualEpsilon( tilingSchemeRectangle.west, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); expect(rectangle.south).toEqualEpsilon( tilingSchemeRectangle.south, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); expect(rectangle.east).toEqualEpsilon( tilingSchemeRectangle.east, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); expect(rectangle.north).toEqualEpsilon( tilingSchemeRectangle.north, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); }); @@ -111,20 +111,20 @@ describe("Core/WebMercatorTilingScheme", function () { expect(northeast.south).toEqualEpsilon( southeast.north, - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); expect(northwest.south).toEqualEpsilon( southwest.north, - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); expect(northeast.west).toEqualEpsilon( northwest.east, - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); expect(southeast.west).toEqualEpsilon( southwest.east, - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); }); }); @@ -136,28 +136,28 @@ describe("Core/WebMercatorTilingScheme", function () { coordinates = tilingScheme.positionToTileXY( Rectangle.southwest(tilingSchemeRectangle), - 0 + 0, ); expect(coordinates.x).toEqual(0); expect(coordinates.y).toEqual(0); coordinates = tilingScheme.positionToTileXY( Rectangle.northwest(tilingSchemeRectangle), - 0 + 0, ); expect(coordinates.x).toEqual(0); expect(coordinates.y).toEqual(0); coordinates = tilingScheme.positionToTileXY( Rectangle.northeast(tilingSchemeRectangle), - 0 + 0, ); expect(coordinates.x).toEqual(0); expect(coordinates.y).toEqual(0); coordinates = tilingScheme.positionToTileXY( Rectangle.southeast(tilingSchemeRectangle), - 0 + 0, ); expect(coordinates.x).toEqual(0); expect(coordinates.y).toEqual(0); @@ -169,28 +169,28 @@ describe("Core/WebMercatorTilingScheme", function () { coordinates = tilingScheme.positionToTileXY( Rectangle.southwest(tilingSchemeRectangle), - 1 + 1, ); expect(coordinates.x).toEqual(0); expect(coordinates.y).toEqual(1); coordinates = tilingScheme.positionToTileXY( Rectangle.northwest(tilingSchemeRectangle), - 1 + 1, ); expect(coordinates.x).toEqual(0); expect(coordinates.y).toEqual(0); coordinates = tilingScheme.positionToTileXY( Rectangle.northeast(tilingSchemeRectangle), - 1 + 1, ); expect(coordinates.x).toEqual(1); expect(coordinates.y).toEqual(0); coordinates = tilingScheme.positionToTileXY( Rectangle.southeast(tilingSchemeRectangle), - 1 + 1, ); expect(coordinates.x).toEqual(1); expect(coordinates.y).toEqual(1); @@ -199,7 +199,7 @@ describe("Core/WebMercatorTilingScheme", function () { it("calculates correct tile indices for the center at level 1", function () { const coordinates = tilingScheme.positionToTileXY( new Cartographic(0, 0), - 1 + 1, ); expect(coordinates.x).toEqual(1); expect(coordinates.y).toEqual(1); @@ -208,7 +208,7 @@ describe("Core/WebMercatorTilingScheme", function () { it("calculates correct tile indices for the center at level 2", function () { const coordinates = tilingScheme.positionToTileXY( new Cartographic(0, 0), - 2 + 2, ); expect(coordinates.x).toEqual(2); expect(coordinates.y).toEqual(2); @@ -219,28 +219,28 @@ describe("Core/WebMercatorTilingScheme", function () { coordinates = tilingScheme.positionToTileXY( new Cartographic(-0.05, -0.05), - 2 + 2, ); expect(coordinates.x).toEqual(1); expect(coordinates.y).toEqual(2); coordinates = tilingScheme.positionToTileXY( new Cartographic(-0.05, 0.05), - 2 + 2, ); expect(coordinates.x).toEqual(1); expect(coordinates.y).toEqual(1); coordinates = tilingScheme.positionToTileXY( new Cartographic(0.05, 0.05), - 2 + 2, ); expect(coordinates.x).toEqual(2); expect(coordinates.y).toEqual(1); coordinates = tilingScheme.positionToTileXY( new Cartographic(0.05, -0.05), - 2 + 2, ); expect(coordinates.x).toEqual(2); expect(coordinates.y).toEqual(2); @@ -256,33 +256,32 @@ describe("Core/WebMercatorTilingScheme", function () { it("converts radians to web mercator meters", function () { const tilingScheme = new WebMercatorTilingScheme(); const rectangleInRadians = new Rectangle(0.1, 0.2, 0.3, 0.4); - const nativeRectangle = tilingScheme.rectangleToNativeRectangle( - rectangleInRadians - ); + const nativeRectangle = + tilingScheme.rectangleToNativeRectangle(rectangleInRadians); const projection = new WebMercatorProjection(); const expectedSouthwest = projection.project( - Rectangle.southwest(rectangleInRadians) + Rectangle.southwest(rectangleInRadians), ); const expectedNortheast = projection.project( - Rectangle.northeast(rectangleInRadians) + Rectangle.northeast(rectangleInRadians), ); expect(nativeRectangle.west).toEqualEpsilon( expectedSouthwest.x, - CesiumMath.EPSILON13 + CesiumMath.EPSILON13, ); expect(nativeRectangle.south).toEqualEpsilon( expectedSouthwest.y, - CesiumMath.EPSILON13 + CesiumMath.EPSILON13, ); expect(nativeRectangle.east).toEqualEpsilon( expectedNortheast.x, - CesiumMath.EPSILON13 + CesiumMath.EPSILON13, ); expect(nativeRectangle.north).toEqualEpsilon( expectedNortheast.y, - CesiumMath.EPSILON13 + CesiumMath.EPSILON13, ); }); @@ -292,34 +291,34 @@ describe("Core/WebMercatorTilingScheme", function () { const projection = new WebMercatorProjection(); const expectedSouthwest = projection.project( - Rectangle.southwest(rectangleInRadians) + Rectangle.southwest(rectangleInRadians), ); const expectedNortheast = projection.project( - Rectangle.northeast(rectangleInRadians) + Rectangle.northeast(rectangleInRadians), ); const resultRectangle = new Rectangle(0.0, 0.0, 0.0, 0.0); const outputRectangle = tilingScheme.rectangleToNativeRectangle( rectangleInRadians, - resultRectangle + resultRectangle, ); expect(outputRectangle).toEqual(resultRectangle); expect(resultRectangle.west).toEqualEpsilon( expectedSouthwest.x, - CesiumMath.EPSILON13 + CesiumMath.EPSILON13, ); expect(resultRectangle.south).toEqualEpsilon( expectedSouthwest.y, - CesiumMath.EPSILON13 + CesiumMath.EPSILON13, ); expect(resultRectangle.east).toEqualEpsilon( expectedNortheast.x, - CesiumMath.EPSILON13 + CesiumMath.EPSILON13, ); expect(resultRectangle.north).toEqualEpsilon( expectedNortheast.y, - CesiumMath.EPSILON13 + CesiumMath.EPSILON13, ); }); }); @@ -330,10 +329,10 @@ describe("Core/WebMercatorTilingScheme", function () { const rectangleInRadians = new Rectangle(0.1, 0.2, 0.3, 0.4); const tilingScheme = new WebMercatorTilingScheme({ rectangleSouthwestInMeters: projection.project( - Rectangle.southwest(rectangleInRadians) + Rectangle.southwest(rectangleInRadians), ), rectangleNortheastInMeters: projection.project( - Rectangle.northeast(rectangleInRadians) + Rectangle.northeast(rectangleInRadians), ), }); @@ -352,18 +351,18 @@ describe("Core/WebMercatorTilingScheme", function () { const centerOfSouthwesternChild = new Cartographic( -Math.PI / 2.0, - -Math.PI / 4.0 + -Math.PI / 4.0, ); expect( - tilingScheme.positionToTileXY(centerOfSouthwesternChild, 1) + tilingScheme.positionToTileXY(centerOfSouthwesternChild, 1), ).toEqual(new Cartesian2(0, 1)); const centerOfNortheasternChild = new Cartographic( Math.PI / 2.0, - Math.PI / 4.0 + Math.PI / 4.0, ); expect( - tilingScheme.positionToTileXY(centerOfNortheasternChild, 1) + tilingScheme.positionToTileXY(centerOfNortheasternChild, 1), ).toEqual(new Cartesian2(1, 0)); }); @@ -372,7 +371,7 @@ describe("Core/WebMercatorTilingScheme", function () { const centerOfMap = new Cartographic(0.0, 0.0); expect(tilingScheme.positionToTileXY(centerOfMap, 1)).toEqual( - new Cartesian2(1, 1) + new Cartesian2(1, 1), ); }); @@ -381,7 +380,7 @@ describe("Core/WebMercatorTilingScheme", function () { const southeastCorner = Rectangle.southeast(tilingScheme.rectangle); expect(tilingScheme.positionToTileXY(southeastCorner, 1)).toEqual( - new Cartesian2(1, 1) + new Cartesian2(1, 1), ); }); @@ -390,13 +389,13 @@ describe("Core/WebMercatorTilingScheme", function () { const centerOfNortheasternChild = new Cartographic( Math.PI / 2.0, - Math.PI / 4.0 + Math.PI / 4.0, ); const resultParameter = new Cartesian2(0, 0); const returnedResult = tilingScheme.positionToTileXY( centerOfNortheasternChild, 1, - resultParameter + resultParameter, ); expect(resultParameter).toEqual(returnedResult); expect(resultParameter).toEqual(new Cartesian2(1, 0)); diff --git a/packages/engine/Specs/Core/WireframeIndexGeneratorSpec.js b/packages/engine/Specs/Core/WireframeIndexGeneratorSpec.js index 1ece2697105e..ade29ffccce7 100644 --- a/packages/engine/Specs/Core/WireframeIndexGeneratorSpec.js +++ b/packages/engine/Specs/Core/WireframeIndexGeneratorSpec.js @@ -62,7 +62,7 @@ describe("Core/WireframeIndexGenerator", function () { const result = createWireframeIndices( PrimitiveType.TRIANGLE_STRIP, 6, - indices + indices, ); expect(result).toEqual(expected); }); @@ -91,7 +91,7 @@ describe("Core/WireframeIndexGenerator", function () { const result = createWireframeIndices( PrimitiveType.TRIANGLE_FAN, 6, - indices + indices, ); expect(result).toEqual(expected); }); @@ -115,19 +115,19 @@ describe("Core/WireframeIndexGenerator", function () { const originalCount = 6; let result = getWireframeIndicesCount( PrimitiveType.TRIANGLES, - originalCount + originalCount, ); expect(result).toEqual(12); result = getWireframeIndicesCount( PrimitiveType.TRIANGLE_STRIP, - originalCount + originalCount, ); expect(result).toEqual(18); result = getWireframeIndicesCount( PrimitiveType.TRIANGLE_FAN, - originalCount + originalCount, ); expect(result).toEqual(18); }); diff --git a/packages/engine/Specs/Core/appendForwardSlashSpec.js b/packages/engine/Specs/Core/appendForwardSlashSpec.js index c60d227362c3..2c6d52337fde 100644 --- a/packages/engine/Specs/Core/appendForwardSlashSpec.js +++ b/packages/engine/Specs/Core/appendForwardSlashSpec.js @@ -3,13 +3,13 @@ import { appendForwardSlash } from "../../index.js"; describe("Core/appendForwardSlash", function () { it("Appends to a url", function () { expect(appendForwardSlash("http://cesiumjs.org")).toEqual( - "http://cesiumjs.org/" + "http://cesiumjs.org/", ); }); it("Does not append to a url", function () { expect(appendForwardSlash("http://cesiumjs.org/")).toEqual( - "http://cesiumjs.org/" + "http://cesiumjs.org/", ); }); diff --git a/packages/engine/Specs/Core/arrayRemoveDuplicatesSpec.js b/packages/engine/Specs/Core/arrayRemoveDuplicatesSpec.js index fa7bd7714a78..8cb95a15b3a4 100644 --- a/packages/engine/Specs/Core/arrayRemoveDuplicatesSpec.js +++ b/packages/engine/Specs/Core/arrayRemoveDuplicatesSpec.js @@ -10,7 +10,7 @@ describe("Core/arrayRemoveDuplicates", function () { const positions = [Cartesian3.ZERO]; const noDuplicates = arrayRemoveDuplicates( positions, - Cartesian3.equalsEpsilon + Cartesian3.equalsEpsilon, ); expect(noDuplicates).toBe(positions); }); @@ -24,7 +24,7 @@ describe("Core/arrayRemoveDuplicates", function () { ]; const noDuplicates = arrayRemoveDuplicates( positions, - Cartesian3.equalsEpsilon + Cartesian3.equalsEpsilon, ); expect(noDuplicates).toBe(positions); }); @@ -39,7 +39,7 @@ describe("Core/arrayRemoveDuplicates", function () { const noDuplicates = arrayRemoveDuplicates( positions, Cartesian3.equalsEpsilon, - true + true, ); expect(noDuplicates).toBe(positions); }); @@ -61,7 +61,7 @@ describe("Core/arrayRemoveDuplicates", function () { ]; const noDuplicates = arrayRemoveDuplicates( positions, - Cartesian3.equalsEpsilon + Cartesian3.equalsEpsilon, ); expect(noDuplicates).toEqual(expectedPositions); }); @@ -85,7 +85,7 @@ describe("Core/arrayRemoveDuplicates", function () { ]; const noDuplicates = arrayRemoveDuplicates( positions, - Cartesian3.equalsEpsilon + Cartesian3.equalsEpsilon, ); expect(noDuplicates).toEqual(expectedPositions); }); @@ -107,7 +107,7 @@ describe("Core/arrayRemoveDuplicates", function () { ]; const noDuplicates = arrayRemoveDuplicates( positions, - Cartesian3.equalsEpsilon + Cartesian3.equalsEpsilon, ); expect(noDuplicates).toEqual(expectedPositions); }); @@ -130,7 +130,7 @@ describe("Core/arrayRemoveDuplicates", function () { ]; const noDuplicates = arrayRemoveDuplicates( positions, - Spherical.equalsEpsilon + Spherical.equalsEpsilon, ); expect(noDuplicates).toEqual(expectedPositions); }); @@ -139,7 +139,7 @@ describe("Core/arrayRemoveDuplicates", function () { const positions = []; const noDuplicates = arrayRemoveDuplicates( positions, - Cartesian3.equalsEpsilon + Cartesian3.equalsEpsilon, ); expect(noDuplicates).toEqual(positions); }); @@ -156,7 +156,7 @@ describe("Core/arrayRemoveDuplicates", function () { ]; const noDuplicates = arrayRemoveDuplicates( positions, - Cartesian3.equalsEpsilon + Cartesian3.equalsEpsilon, ); expect(noDuplicates).toEqual(expectedPositions); }); @@ -173,7 +173,7 @@ describe("Core/arrayRemoveDuplicates", function () { ]; const noDuplicates = arrayRemoveDuplicates( positions, - Cartesian3.equalsEpsilon + Cartesian3.equalsEpsilon, ); expect(noDuplicates).toEqual(expectedPositions); }); @@ -192,7 +192,7 @@ describe("Core/arrayRemoveDuplicates", function () { ]; const noDuplicates = arrayRemoveDuplicates( positions, - Cartesian3.equalsEpsilon + Cartesian3.equalsEpsilon, ); expect(noDuplicates).toEqual(expectedPositions); }); @@ -200,7 +200,7 @@ describe("Core/arrayRemoveDuplicates", function () { it("removeDuplicates returns undefined", function () { const noDuplicates = arrayRemoveDuplicates( undefined, - Cartesian3.equalsEpsilon + Cartesian3.equalsEpsilon, ); expect(noDuplicates).toBe(undefined); }); @@ -214,7 +214,7 @@ describe("Core/arrayRemoveDuplicates", function () { ]; const noDuplicates = arrayRemoveDuplicates( positions, - Cartesian3.equalsEpsilon + Cartesian3.equalsEpsilon, ); expect(noDuplicates).toBe(positions); @@ -237,7 +237,7 @@ describe("Core/arrayRemoveDuplicates", function () { const noDuplicates = arrayRemoveDuplicates( positions, Cartesian3.equalsEpsilon, - true + true, ); expect(noDuplicates).toEqual(expectedPositions); @@ -263,7 +263,7 @@ describe("Core/arrayRemoveDuplicates", function () { const noDuplicates = arrayRemoveDuplicates( positions, Cartesian3.equalsEpsilon, - true + true, ); expect(noDuplicates).toEqual(expectedPositions); @@ -291,7 +291,7 @@ describe("Core/arrayRemoveDuplicates", function () { const noDuplicates = arrayRemoveDuplicates( positions, Cartesian3.equalsEpsilon, - true + true, ); expect(noDuplicates).toEqual(expectedPositions); @@ -316,7 +316,7 @@ describe("Core/arrayRemoveDuplicates", function () { const noDuplicates = arrayRemoveDuplicates( positions, Cartesian3.equalsEpsilon, - true + true, ); expect(noDuplicates).toEqual(expectedPositions); @@ -331,7 +331,7 @@ describe("Core/arrayRemoveDuplicates", function () { positions, Cartesian3.equalsEpsilon, false, - removedIndices + removedIndices, ); expect(noDuplicates).toBe(positions); @@ -352,7 +352,7 @@ describe("Core/arrayRemoveDuplicates", function () { positions, Cartesian3.equalsEpsilon, false, - removedIndices + removedIndices, ); expect(noDuplicates).toBe(positions); @@ -382,7 +382,7 @@ describe("Core/arrayRemoveDuplicates", function () { positions, Cartesian3.equalsEpsilon, false, - removedIndices + removedIndices, ); expect(noDuplicates).toEqual(expectedPositions); @@ -403,7 +403,7 @@ describe("Core/arrayRemoveDuplicates", function () { positions, Cartesian3.equalsEpsilon, false, - removedIndices + removedIndices, ); expect(noDuplicates).toBe(positions); @@ -432,7 +432,7 @@ describe("Core/arrayRemoveDuplicates", function () { positions, Cartesian3.equalsEpsilon, true, - removedIndices + removedIndices, ); expect(noDuplicates).toEqual(expectedPositions); @@ -463,7 +463,7 @@ describe("Core/arrayRemoveDuplicates", function () { positions, Cartesian3.equalsEpsilon, true, - removedIndices + removedIndices, ); expect(noDuplicates).toEqual(expectedPositions); @@ -494,7 +494,7 @@ describe("Core/arrayRemoveDuplicates", function () { positions, Cartesian3.equalsEpsilon, true, - removedIndices + removedIndices, ); expect(noDuplicates).toEqual(expectedPositions); @@ -530,7 +530,7 @@ describe("Core/arrayRemoveDuplicates", function () { positions, Cartesian3.equalsEpsilon, true, - removedIndices + removedIndices, ); expect(noDuplicates).toEqual(expectedPositions); diff --git a/packages/engine/Specs/Core/barycentricCoordinatesSpec.js b/packages/engine/Specs/Core/barycentricCoordinatesSpec.js index 3b8f81d46388..767af70e54b7 100644 --- a/packages/engine/Specs/Core/barycentricCoordinatesSpec.js +++ b/packages/engine/Specs/Core/barycentricCoordinatesSpec.js @@ -12,21 +12,21 @@ describe("Core/barycentricCoordinates", function () { it("evaluates to p0", function () { const point = Cartesian3.clone(p0); expect(barycentricCoordinates(point, p0, p1, p2)).toEqual( - Cartesian3.UNIT_X + Cartesian3.UNIT_X, ); }); it("evaluates to p1", function () { const point = Cartesian3.clone(p1); expect(barycentricCoordinates(point, p0, p1, p2)).toEqual( - Cartesian3.UNIT_Y + Cartesian3.UNIT_Y, ); }); it("evaluates to p2", function () { const point = Cartesian3.clone(p2); expect(barycentricCoordinates(point, p0, p1, p2)).toEqual( - Cartesian3.UNIT_Z + Cartesian3.UNIT_Z, ); }); @@ -34,10 +34,10 @@ describe("Core/barycentricCoordinates", function () { const point = Cartesian3.multiplyByScalar( Cartesian3.add(p1, p0, new Cartesian3()), 0.5, - new Cartesian3() + new Cartesian3(), ); expect(barycentricCoordinates(point, p0, p1, p2)).toEqual( - new Cartesian3(0.5, 0.5, 0.0) + new Cartesian3(0.5, 0.5, 0.0), ); }); @@ -45,10 +45,10 @@ describe("Core/barycentricCoordinates", function () { const point = Cartesian3.multiplyByScalar( Cartesian3.add(p2, p0, new Cartesian3()), 0.5, - new Cartesian3() + new Cartesian3(), ); expect(barycentricCoordinates(point, p0, p1, p2)).toEqual( - new Cartesian3(0.5, 0.0, 0.5) + new Cartesian3(0.5, 0.0, 0.5), ); }); @@ -56,10 +56,10 @@ describe("Core/barycentricCoordinates", function () { const point = Cartesian3.multiplyByScalar( Cartesian3.add(p2, p1, new Cartesian3()), 0.5, - new Cartesian3() + new Cartesian3(), ); expect(barycentricCoordinates(point, p0, p1, p2)).toEqual( - new Cartesian3(0.0, 0.5, 0.5) + new Cartesian3(0.0, 0.5, 0.5), ); }); @@ -69,14 +69,14 @@ describe("Core/barycentricCoordinates", function () { Cartesian3.add( Cartesian3.add(p0, p1, new Cartesian3()), p2, - new Cartesian3() + new Cartesian3(), ), scalar, - new Cartesian3() + new Cartesian3(), ); expect(barycentricCoordinates(point, p0, p1, p2)).toEqualEpsilon( new Cartesian3(scalar, scalar, scalar), - CesiumMath.EPSILON14 + CesiumMath.EPSILON14, ); }); @@ -93,17 +93,17 @@ describe("Core/barycentricCoordinates", function () { const p0 = new Cartesian3( 9635312487071484, 13827945400273020, - -16479219993905144 + -16479219993905144, ); const p1 = new Cartesian3( 12832234.180639317, -10455085.701705107, - 750010.7274386138 + 750010.7274386138, ); const p2 = new Cartesian3( -9689011.10628853, -13420063.892507521, - 750010.7274386119 + 750010.7274386119, ); expect(barycentricCoordinates(p0, p0, p1, p2)).toEqual(Cartesian3.UNIT_X); expect(barycentricCoordinates(p1, p0, p1, p2)).toEqual(Cartesian3.UNIT_Y); @@ -133,7 +133,7 @@ describe("Core/barycentricCoordinates", function () { barycentricCoordinates( new Cartesian3(), new Cartesian3(), - new Cartesian3() + new Cartesian3(), ); }).toThrowDeveloperError(); }); diff --git a/packages/engine/Specs/Core/buildModuleUrlSpec.js b/packages/engine/Specs/Core/buildModuleUrlSpec.js index c2ab34ca0b24..7013370154a2 100644 --- a/packages/engine/Specs/Core/buildModuleUrlSpec.js +++ b/packages/engine/Specs/Core/buildModuleUrlSpec.js @@ -22,10 +22,10 @@ describe("Core/buildModuleUrl", function () { expect(r.exec("assets/foo/Cesium.js")[1]).toEqual("assets/foo/"); expect(r.exec("assets/foo/Cesium.js?v=1.7")[1]).toEqual("assets/foo/"); expect( - r.exec("http://example.invalid/Cesium/assets/foo/Cesium.js")[1] + r.exec("http://example.invalid/Cesium/assets/foo/Cesium.js")[1], ).toEqual("http://example.invalid/Cesium/assets/foo/"); expect( - r.exec("http://example.invalid/Cesium/assets/foo/Cesium.js?v=1.7")[1] + r.exec("http://example.invalid/Cesium/assets/foo/Cesium.js?v=1.7")[1], ).toEqual("http://example.invalid/Cesium/assets/foo/"); expect(r.exec("cesium.js")).toBeNull(); diff --git a/packages/engine/Specs/Core/createGuidSpec.js b/packages/engine/Specs/Core/createGuidSpec.js index 3d5d6dd994b4..9339e3b28102 100644 --- a/packages/engine/Specs/Core/createGuidSpec.js +++ b/packages/engine/Specs/Core/createGuidSpec.js @@ -2,7 +2,8 @@ import { createGuid } from "../../index.js"; describe("Core/createGuid", function () { it("creates GUIDs", function () { - const isGuidRegex = /^(\{){0,1}[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}(\}){0,1}$/; + const isGuidRegex = + /^(\{){0,1}[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}(\}){0,1}$/; //Create three GUIDs const guid1 = createGuid(); diff --git a/packages/engine/Specs/Core/getAbsoluteUriSpec.js b/packages/engine/Specs/Core/getAbsoluteUriSpec.js index 9d4b1d11b575..0cfb50541ada 100644 --- a/packages/engine/Specs/Core/getAbsoluteUriSpec.js +++ b/packages/engine/Specs/Core/getAbsoluteUriSpec.js @@ -3,7 +3,7 @@ import { getAbsoluteUri, getBaseUri } from "../../index.js"; describe("Core/getAbsoluteUri", function () { it("works as expected", function () { let result = getAbsoluteUri( - "http://www.mysite.com/awesome?makeitawesome=true" + "http://www.mysite.com/awesome?makeitawesome=true", ); expect(result).toEqual("http://www.mysite.com/awesome?makeitawesome=true"); @@ -23,7 +23,7 @@ describe("Core/getAbsoluteUri", function () { const result = getAbsoluteUri._implementation( "awesome.png", undefined, - fakeDocument + fakeDocument, ); expect(result).toEqual("http://test.com/awesome.png"); }); diff --git a/packages/engine/Specs/Core/getBaseUriSpec.js b/packages/engine/Specs/Core/getBaseUriSpec.js index 909941e6dd8c..13c095001d77 100644 --- a/packages/engine/Specs/Core/getBaseUriSpec.js +++ b/packages/engine/Specs/Core/getBaseUriSpec.js @@ -6,7 +6,7 @@ describe("Core/getBaseUri", function () { expect(result).toEqual("http://www.mysite.com/"); result = getBaseUri( - "http://www.mysite.com/somefolder/awesome.png#makeitawesome" + "http://www.mysite.com/somefolder/awesome.png#makeitawesome", ); expect(result).toEqual("http://www.mysite.com/somefolder/"); }); @@ -14,13 +14,13 @@ describe("Core/getBaseUri", function () { it("works with includeQuery flag", function () { let result = getBaseUri( "http://www.mysite.com/awesome?makeitawesome=true", - true + true, ); expect(result).toEqual("http://www.mysite.com/?makeitawesome=true"); result = getBaseUri( "http://www.mysite.com/somefolder/awesome.png#makeitawesome", - true + true, ); expect(result).toEqual("http://www.mysite.com/somefolder/#makeitawesome"); }); diff --git a/packages/engine/Specs/Core/getExtensionFromUriSpec.js b/packages/engine/Specs/Core/getExtensionFromUriSpec.js index 7817f7493c79..3e19accb260b 100644 --- a/packages/engine/Specs/Core/getExtensionFromUriSpec.js +++ b/packages/engine/Specs/Core/getExtensionFromUriSpec.js @@ -3,12 +3,12 @@ import { getExtensionFromUri } from "../../index.js"; describe("Core/getExtensionFromUri", function () { it("works as expected", function () { let result = getExtensionFromUri( - "http://www.mysite.com/awesome?makeitawesome=true" + "http://www.mysite.com/awesome?makeitawesome=true", ); expect(result).toEqual(""); result = getExtensionFromUri( - "http://www.mysite.com/somefolder/awesome.png#makeitawesome" + "http://www.mysite.com/somefolder/awesome.png#makeitawesome", ); expect(result).toEqual("png"); diff --git a/packages/engine/Specs/Core/getFilenameFromUriSpec.js b/packages/engine/Specs/Core/getFilenameFromUriSpec.js index 71611a9ff752..7c7fa482a6e6 100644 --- a/packages/engine/Specs/Core/getFilenameFromUriSpec.js +++ b/packages/engine/Specs/Core/getFilenameFromUriSpec.js @@ -3,12 +3,12 @@ import { getFilenameFromUri } from "../../index.js"; describe("Core/getFilenameFromUri", function () { it("works as expected", function () { let result = getFilenameFromUri( - "http://www.mysite.com/awesome?makeitawesome=true" + "http://www.mysite.com/awesome?makeitawesome=true", ); expect(result).toEqual("awesome"); result = getFilenameFromUri( - "http://www.mysite.com/somefolder/awesome.png#makeitawesome" + "http://www.mysite.com/somefolder/awesome.png#makeitawesome", ); expect(result).toEqual("awesome.png"); }); diff --git a/packages/engine/Specs/Core/getStringFromTypedArraySpec.js b/packages/engine/Specs/Core/getStringFromTypedArraySpec.js index 0c348a6665d9..5ea515ebd778 100644 --- a/packages/engine/Specs/Core/getStringFromTypedArraySpec.js +++ b/packages/engine/Specs/Core/getStringFromTypedArraySpec.js @@ -17,7 +17,7 @@ describe("Core/getStringFromTypedArray", function () { it("converts a typed array to string when forced to use fromCharCode", function () { spyOn(getStringFromTypedArray, "decode").and.callFake( - getStringFromTypedArray.decodeWithFromCharCode + getStringFromTypedArray.decodeWithFromCharCode, ); verifyString(); @@ -63,7 +63,7 @@ describe("Core/getStringFromTypedArray", function () { it("Unicode 2-byte characters work with decodeWithFromCharCode forced", function () { spyOn(getStringFromTypedArray, "decode").and.callFake( - getStringFromTypedArray.decodeWithFromCharCode + getStringFromTypedArray.decodeWithFromCharCode, ); const arr = new Uint8Array([90, 195, 188, 114, 105, 99, 104]); @@ -77,7 +77,7 @@ describe("Core/getStringFromTypedArray", function () { it("Unicode 3-byte characters work with decodeWithFromCharCode forced", function () { spyOn(getStringFromTypedArray, "decode").and.callFake( - getStringFromTypedArray.decodeWithFromCharCode + getStringFromTypedArray.decodeWithFromCharCode, ); const arr = new Uint8Array([224, 162, 160]); @@ -91,7 +91,7 @@ describe("Core/getStringFromTypedArray", function () { it("Unicode 4-byte characters work with decodeWithFromCharCode forced", function () { spyOn(getStringFromTypedArray, "decode").and.callFake( - getStringFromTypedArray.decodeWithFromCharCode + getStringFromTypedArray.decodeWithFromCharCode, ); const arr = new Uint8Array([240, 144, 138, 129]); diff --git a/packages/engine/Specs/Core/isCrossOriginUrlSpec.js b/packages/engine/Specs/Core/isCrossOriginUrlSpec.js index f3a238635dea..9f6fb85bb7f3 100644 --- a/packages/engine/Specs/Core/isCrossOriginUrlSpec.js +++ b/packages/engine/Specs/Core/isCrossOriginUrlSpec.js @@ -17,7 +17,7 @@ describe("Core/isCrossOriginUrl", function () { it("returns true for absolute urls that are cross-origin", function () { expect(isCrossOriginUrl("http://example.invalid/some/url.jpg")).toEqual( - true + true, ); // a different scheme counts as cross-origin diff --git a/packages/engine/Specs/Core/loadImageFromTypedArraySpec.js b/packages/engine/Specs/Core/loadImageFromTypedArraySpec.js index bc73ccd2086c..698f6ef538ba 100644 --- a/packages/engine/Specs/Core/loadImageFromTypedArraySpec.js +++ b/packages/engine/Specs/Core/loadImageFromTypedArraySpec.js @@ -21,7 +21,7 @@ describe("Core/loadImageFromTypedArray", function () { expect(image.width).toEqual(10); expect(image.height).toEqual(10); }); - } + }, ); }); @@ -116,7 +116,7 @@ describe("Core/loadImageFromTypedArray", function () { } spyOn(Resource, "supportsImageBitmapOptions").and.returnValue( - Promise.resolve(false) + Promise.resolve(false), ); spyOn(window, "createImageBitmap").and.callThrough(); return Resource.fetchArrayBuffer("./Data/Images/Blue10x10.png").then( @@ -131,7 +131,7 @@ describe("Core/loadImageFromTypedArray", function () { expect(image.height).toEqual(10); expect(window.createImageBitmap).not.toHaveBeenCalled(); }); - } + }, ); }); diff --git a/packages/engine/Specs/Core/loadKTX2Spec.js b/packages/engine/Specs/Core/loadKTX2Spec.js index e046e41f28a1..56d9fb783f04 100644 --- a/packages/engine/Specs/Core/loadKTX2Spec.js +++ b/packages/engine/Specs/Core/loadKTX2Spec.js @@ -36,7 +36,7 @@ describe("Core/loadKTX2", function () { supportedFormats, width, height, - isCompressed + isCompressed, ) { const resource = Resource.createIfNeeded(url); const loadPromise = resource.fetchArrayBuffer(); @@ -47,7 +47,7 @@ describe("Core/loadKTX2", function () { expect(result.width).toEqual(width); expect(result.height).toEqual(height); expect(PixelFormat.isCompressedFormat(result.internalFormat)).toEqual( - isCompressed + isCompressed, ); expect(result.bufferView).toBeDefined(); }); @@ -60,7 +60,7 @@ describe("Core/loadKTX2", function () { { etc: true }, 4, 4, - true + true, ); }); @@ -70,7 +70,7 @@ describe("Core/loadKTX2", function () { { etc: true }, 32, 32, - true + true, ); }); @@ -80,7 +80,7 @@ describe("Core/loadKTX2", function () { { etc1: true }, 4, 4, - true + true, ); }); @@ -90,7 +90,7 @@ describe("Core/loadKTX2", function () { { etc1: true }, 32, 32, - true + true, ); }); @@ -100,7 +100,7 @@ describe("Core/loadKTX2", function () { { astc: true }, 4, 4, - true + true, ); }); @@ -110,7 +110,7 @@ describe("Core/loadKTX2", function () { { astc: true }, 32, 32, - true + true, ); }); @@ -120,7 +120,7 @@ describe("Core/loadKTX2", function () { { pvrtc: true }, 4, 4, - true + true, ); }); @@ -130,7 +130,7 @@ describe("Core/loadKTX2", function () { { pvrtc: true }, 32, 32, - true + true, ); }); @@ -140,7 +140,7 @@ describe("Core/loadKTX2", function () { { s3tc: true }, 4, 4, - true + true, ); }); @@ -150,7 +150,7 @@ describe("Core/loadKTX2", function () { { s3tc: true }, 32, 32, - true + true, ); }); @@ -160,7 +160,7 @@ describe("Core/loadKTX2", function () { { bc7: true }, 4, 4, - true + true, ); }); @@ -170,7 +170,7 @@ describe("Core/loadKTX2", function () { { bc7: true }, 32, 32, - true + true, ); }); @@ -180,13 +180,13 @@ describe("Core/loadKTX2", function () { { s3tc: true }, 4, 4, - false + false, ); }); it("returns a promise that resolves to an uncompressed texture containing all mip levels of the original texture", function () { const resource = Resource.createIfNeeded( - "./Data/Images/Green4x4Mipmap.ktx2" + "./Data/Images/Green4x4Mipmap.ktx2", ); const loadPromise = resource.fetchArrayBuffer(); return loadPromise.then(function (buffer) { @@ -199,7 +199,7 @@ describe("Core/loadKTX2", function () { expect(resolvedValue[i].width).toEqual(dims[i]); expect(resolvedValue[i].height).toEqual(dims[i]); expect( - PixelFormat.isCompressedFormat(resolvedValue[i].internalFormat) + PixelFormat.isCompressedFormat(resolvedValue[i].internalFormat), ).toEqual(false); expect(resolvedValue[i].bufferView).toBeDefined(); } @@ -209,7 +209,7 @@ describe("Core/loadKTX2", function () { it("returns a promise that resolves to a compressed texture containing all mip levels of the original texture", function () { const resource = Resource.createIfNeeded( - "./Data/Images/Green4x4Mipmap_ETC1S.ktx2" + "./Data/Images/Green4x4Mipmap_ETC1S.ktx2", ); const loadPromise = resource.fetchArrayBuffer(); return loadPromise.then(function (buffer) { @@ -222,7 +222,7 @@ describe("Core/loadKTX2", function () { expect(resolvedValue[i].width).toEqual(dims[i]); expect(resolvedValue[i].height).toEqual(dims[i]); expect( - PixelFormat.isCompressedFormat(resolvedValue[i].internalFormat) + PixelFormat.isCompressedFormat(resolvedValue[i].internalFormat), ).toEqual(true); expect(resolvedValue[i].bufferView).toBeDefined(); } @@ -266,7 +266,7 @@ describe("Core/loadKTX2", function () { expect(resolvedValue).toBeUndefined(); expect(rejectedError).toBeInstanceOf(RuntimeError); expect(rejectedError.message).toEqual( - "KTX2 3D textures are unsupported." + "KTX2 3D textures are unsupported.", ); }); }); @@ -291,7 +291,7 @@ describe("Core/loadKTX2", function () { expect(resolvedValue).toBeUndefined(); expect(rejectedError).toBeInstanceOf(RuntimeError); expect(rejectedError.message).toEqual( - "KTX2 texture arrays are not supported." + "KTX2 texture arrays are not supported.", ); }); }); diff --git a/packages/engine/Specs/Core/pointInsideTriangleSpec.js b/packages/engine/Specs/Core/pointInsideTriangleSpec.js index 931a7ff67fe7..77239352ab6f 100644 --- a/packages/engine/Specs/Core/pointInsideTriangleSpec.js +++ b/packages/engine/Specs/Core/pointInsideTriangleSpec.js @@ -7,8 +7,8 @@ describe("Core/pointInsideTriangle", function () { new Cartesian2(0.25, 0.25), Cartesian2.ZERO, new Cartesian2(1.0, 0.0), - new Cartesian2(0.0, 1.0) - ) + new Cartesian2(0.0, 1.0), + ), ).toEqual(true); }); @@ -18,8 +18,8 @@ describe("Core/pointInsideTriangle", function () { new Cartesian2(1.0, 1.0), Cartesian2.ZERO, new Cartesian2(1.0, 0.0), - new Cartesian2(0.0, 1.0) - ) + new Cartesian2(0.0, 1.0), + ), ).toEqual(false); }); @@ -29,8 +29,8 @@ describe("Core/pointInsideTriangle", function () { new Cartesian2(0.5, -0.5), Cartesian2.ZERO, new Cartesian2(1.0, 0.0), - new Cartesian2(0.0, 1.0) - ) + new Cartesian2(0.0, 1.0), + ), ).toEqual(false); }); @@ -40,8 +40,8 @@ describe("Core/pointInsideTriangle", function () { new Cartesian2(-0.5, 0.5), Cartesian2.ZERO, new Cartesian2(1.0, 0.0), - new Cartesian2(0.0, 1.0) - ) + new Cartesian2(0.0, 1.0), + ), ).toEqual(false); }); @@ -51,8 +51,8 @@ describe("Core/pointInsideTriangle", function () { Cartesian2.ZERO, Cartesian2.ZERO, new Cartesian2(1.0, 0.0), - new Cartesian2(0.0, 1.0) - ) + new Cartesian2(0.0, 1.0), + ), ).toEqual(false); }); @@ -62,8 +62,8 @@ describe("Core/pointInsideTriangle", function () { new Cartesian2(0.5, 0.0), Cartesian2.ZERO, new Cartesian2(1.0, 0.0), - new Cartesian2(0.0, 1.0) - ) + new Cartesian2(0.0, 1.0), + ), ).toEqual(false); }); diff --git a/packages/engine/Specs/Core/sampleTerrainMostDetailedSpec.js b/packages/engine/Specs/Core/sampleTerrainMostDetailedSpec.js index 77635449b0d9..9649ad6a11e0 100644 --- a/packages/engine/Specs/Core/sampleTerrainMostDetailedSpec.js +++ b/packages/engine/Specs/Core/sampleTerrainMostDetailedSpec.js @@ -19,7 +19,7 @@ describe("Core/sampleTerrainMostDetailed", function () { const passedPositions = await sampleTerrainMostDetailed( worldTerrain, - positions + positions, ); expect(passedPositions).toBe(positions); expect(positions[0].height).toBeGreaterThan(5000); @@ -30,7 +30,7 @@ describe("Core/sampleTerrainMostDetailed", function () { it("should throw querying heights from terrain without availability", async function () { const terrainProvider = await CesiumTerrainProvider.fromUrl( - "Data/CesiumTerrainTileJson/StandardHeightmap.tile.json" + "Data/CesiumTerrainTileJson/StandardHeightmap.tile.json", ); const positions = [ @@ -39,9 +39,9 @@ describe("Core/sampleTerrainMostDetailed", function () { ]; await expectAsync( - sampleTerrainMostDetailed(terrainProvider, positions) + sampleTerrainMostDetailed(terrainProvider, positions), ).toBeRejectedWithDeveloperError( - "sampleTerrainMostDetailed requires a terrain provider that has tile availability." + "sampleTerrainMostDetailed requires a terrain provider that has tile availability.", ); }); @@ -65,13 +65,13 @@ describe("Core/sampleTerrainMostDetailed", function () { ]; await expectAsync( - sampleTerrainMostDetailed(undefined, positions) + sampleTerrainMostDetailed(undefined, positions), ).toBeRejectedWithDeveloperError("terrainProvider is required."); }); it("throws without positions", async function () { await expectAsync( - sampleTerrainMostDetailed(worldTerrain, undefined) + sampleTerrainMostDetailed(worldTerrain, undefined), ).toBeRejectedWithDeveloperError("positions is required."); }); @@ -94,7 +94,7 @@ describe("Core/sampleTerrainMostDetailed", function () { const positions = [Cartographic.fromDegrees(0.0, 0.0, 0.0)]; return expectAsync( - sampleTerrainMostDetailed(terrainProvider, positions, true) + sampleTerrainMostDetailed(terrainProvider, positions, true), ).toBeRejected(); }); }); diff --git a/packages/engine/Specs/Core/sampleTerrainSpec.js b/packages/engine/Specs/Core/sampleTerrainSpec.js index ce265ee5ca58..1c7ef5b2f0cd 100644 --- a/packages/engine/Specs/Core/sampleTerrainSpec.js +++ b/packages/engine/Specs/Core/sampleTerrainSpec.js @@ -26,15 +26,15 @@ describe("Core/sampleTerrain", function () { Cartographic.fromDegrees(87.0, 28.0), ]; - return sampleTerrain(worldTerrain, 11, positions).then(function ( - passedPositions - ) { - expect(passedPositions).toBe(positions); - expect(positions[0].height).toBeGreaterThan(5000); - expect(positions[0].height).toBeLessThan(10000); - expect(positions[1].height).toBeGreaterThan(5000); - expect(positions[1].height).toBeLessThan(10000); - }); + return sampleTerrain(worldTerrain, 11, positions).then( + function (passedPositions) { + expect(passedPositions).toBe(positions); + expect(positions[0].height).toBeGreaterThan(5000); + expect(positions[0].height).toBeLessThan(10000); + expect(positions[1].height).toBeGreaterThan(5000); + expect(positions[1].height).toBeLessThan(10000); + }, + ); }); it("queries heights from terrain without availability", async function () { @@ -46,7 +46,7 @@ describe("Core/sampleTerrain", function () { data, headers, deferred, - overrideMimeType + overrideMimeType, ) { if (defined(url.match(/\/\d+\/\d+\/\d+\.terrain/))) { Resource._DefaultImplementations.loadWithXhr( @@ -55,7 +55,7 @@ describe("Core/sampleTerrain", function () { method, data, headers, - deferred + deferred, ); return; } @@ -67,12 +67,12 @@ describe("Core/sampleTerrain", function () { data, headers, deferred, - overrideMimeType + overrideMimeType, ); }; const terrainProvider = await CesiumTerrainProvider.fromUrl( - "Data/CesiumTerrainTileJson/StandardHeightmap.tile.json" + "Data/CesiumTerrainTileJson/StandardHeightmap.tile.json", ); const positions = [ @@ -100,7 +100,7 @@ describe("Core/sampleTerrain", function () { const positions = [Cartographic.fromDegrees(0.0, 0.0, 0.0)]; return expectAsync( - sampleTerrain(worldTerrain, 18, positions, true) + sampleTerrain(worldTerrain, 18, positions, true), ).toBeRejected(); }); @@ -110,7 +110,7 @@ describe("Core/sampleTerrain", function () { const positions = [positionWithData, positionWithoutData]; return expectAsync( - sampleTerrain(worldTerrain, 12, positions, true) + sampleTerrain(worldTerrain, 12, positions, true), ).toBeRejected(); }); @@ -138,15 +138,15 @@ describe("Core/sampleTerrain", function () { ]; await expectAsync( - sampleTerrain(undefined, 11, positions) + sampleTerrain(undefined, 11, positions), ).toBeRejectedWithDeveloperError(); await expectAsync( - sampleTerrain(worldTerrain, undefined, positions) + sampleTerrain(worldTerrain, undefined, positions), ).toBeRejectedWithDeveloperError(); await expectAsync( - sampleTerrain(worldTerrain, 11, undefined) + sampleTerrain(worldTerrain, 11, undefined), ).toBeRejectedWithDeveloperError(); }); @@ -173,31 +173,28 @@ describe("Core/sampleTerrain", function () { function spyOnTerrainDataCreateMesh(terrainProvider) { // do some sneaky spying, so we can check how many times createMesh is called const originalRequestTileGeometry = terrainProvider.requestTileGeometry; - spyOn(terrainProvider, "requestTileGeometry").and.callFake(function ( - x, - y, - level, - request - ) { - // Call the original function! - return originalRequestTileGeometry - .call(terrainProvider, x, y, level, request) - .then(function (tile) { - spyOn(tile, "createMesh").and.callThrough(); - // return the original tile - after we've spied on the createMesh method - return tile; - }); - }); + spyOn(terrainProvider, "requestTileGeometry").and.callFake( + function (x, y, level, request) { + // Call the original function! + return originalRequestTileGeometry + .call(terrainProvider, x, y, level, request) + .then(function (tile) { + spyOn(tile, "createMesh").and.callThrough(); + // return the original tile - after we've spied on the createMesh method + return tile; + }); + }, + ); } function expectTileAndMeshCounts( terrainProvider, numberOfTilesRequested, - wasFirstTileMeshCreated + wasFirstTileMeshCreated, ) { // assert how many tiles were requested expect(terrainProvider.requestTileGeometry.calls.count()).toEqual( - numberOfTilesRequested + numberOfTilesRequested, ); // get the first tile that was requested @@ -208,7 +205,7 @@ describe("Core/sampleTerrain", function () { .returnValue.then(function (terrainData) { // assert if the mesh was created or not for this tile expect(terrainData.createMesh.calls.count()).toEqual( - wasFirstTileMeshCreated ? 1 : 0 + wasFirstTileMeshCreated ? 1 : 0, ); }) ); @@ -226,7 +223,7 @@ describe("Core/sampleTerrain", function () { data, headers, deferred, - overrideMimeType + overrideMimeType, ) { // find a key (source path) path in the spec which matches (ends with) the requested url const availablePaths = Object.keys(proxySpec); @@ -244,8 +241,8 @@ describe("Core/sampleTerrain", function () { if (!defined(proxiedUrl)) { throw new Error( `Unexpected XHR load to url: ${url}; spec includes: ${availablePaths.join( - ", " - )}` + ", ", + )}`, ); } @@ -257,7 +254,7 @@ describe("Core/sampleTerrain", function () { data, headers, deferred, - overrideMimeType + overrideMimeType, ); }; } @@ -268,23 +265,22 @@ describe("Core/sampleTerrain", function () { "/9/759/335.terrain?v=1.2.0": "Data/CesiumTerrainTileJson/9_759_335/9_759_335.terrain", }); - const terrainProvider = await CesiumTerrainProvider.fromUrl( - "made/up/url" - ); + const terrainProvider = + await CesiumTerrainProvider.fromUrl("made/up/url"); spyOnTerrainDataCreateMesh(terrainProvider); const positionA = Cartographic.fromDegrees( 86.93666235421982, - 27.97989963555095 + 27.97989963555095, ); const positionB = Cartographic.fromDegrees( 86.9366623542198, - 27.9798996355509 + 27.9798996355509, ); const positionC = Cartographic.fromDegrees( 86.936662354213, - 27.979899635557 + 27.979899635557, ); const level = 9; @@ -311,23 +307,22 @@ describe("Core/sampleTerrain", function () { "/tile/9/214/379": "Data/ArcGIS/9_214_379/tile_9_214_379.tile", }); - const terrainProvider = await ArcGISTiledElevationTerrainProvider.fromUrl( - "made/up/url" - ); + const terrainProvider = + await ArcGISTiledElevationTerrainProvider.fromUrl("made/up/url"); spyOnTerrainDataCreateMesh(terrainProvider); const positionA = Cartographic.fromDegrees( 86.93666235421982, - 27.97989963555095 + 27.97989963555095, ); const positionB = Cartographic.fromDegrees( 86.9366623542198, - 27.9798996355509 + 27.9798996355509, ); const positionC = Cartographic.fromDegrees( 86.936662354213, - 27.979899635557 + 27.979899635557, ); const level = 9; @@ -356,33 +351,29 @@ describe("Core/sampleTerrain", function () { "/tile/9/214/376": "Data/ArcGIS/9_214_379/tile_9_214_379.tile", }); - const terrainProvider = await ArcGISTiledElevationTerrainProvider.fromUrl( - "made/up/url" - ); + const terrainProvider = + await ArcGISTiledElevationTerrainProvider.fromUrl("made/up/url"); let i = 0; const originalRequestTileGeometry = terrainProvider.requestTileGeometry; - spyOn(terrainProvider, "requestTileGeometry").and.callFake(function ( - x, - y, - level, - request - ) { - i++; - if (i === 2 || i === 3) { - // on the 2nd and 3rd requestTileGeometry call, return undefined - // to simulate RequestScheduler throttling the request - return undefined; - } - // otherwise, call the original method - return originalRequestTileGeometry.call( - terrainProvider, - x, - y, - level, - request - ); - }); + spyOn(terrainProvider, "requestTileGeometry").and.callFake( + function (x, y, level, request) { + i++; + if (i === 2 || i === 3) { + // on the 2nd and 3rd requestTileGeometry call, return undefined + // to simulate RequestScheduler throttling the request + return undefined; + } + // otherwise, call the original method + return originalRequestTileGeometry.call( + terrainProvider, + x, + y, + level, + request, + ); + }, + ); // 3 positions, quite far apart (requires multiple tile requests) const positionA = Cartographic.fromDegrees(85, 28); diff --git a/packages/engine/Specs/DataSources/BillboardGraphicsSpec.js b/packages/engine/Specs/DataSources/BillboardGraphicsSpec.js index 6da4f355301c..68fd9c52383c 100644 --- a/packages/engine/Specs/DataSources/BillboardGraphicsSpec.js +++ b/packages/engine/Specs/DataSources/BillboardGraphicsSpec.js @@ -53,7 +53,7 @@ describe("DataSources/BillboardGraphics", function () { expect(billboard.scaleByDistance).toBeInstanceOf(ConstantProperty); expect(billboard.translucencyByDistance).toBeInstanceOf(ConstantProperty); expect(billboard.pixelOffsetScaleByDistance).toBeInstanceOf( - ConstantProperty + ConstantProperty, ); expect(billboard.sizeInMeters).toBeInstanceOf(ConstantProperty); expect(billboard.distanceDisplayCondition).toBeInstanceOf(ConstantProperty); @@ -65,10 +65,10 @@ describe("DataSources/BillboardGraphics", function () { expect(billboard.alignedAxis.getValue()).toEqual(options.alignedAxis); expect(billboard.color.getValue()).toEqual(options.color); expect(billboard.heightReference.getValue()).toEqual( - options.heightReference + options.heightReference, ); expect(billboard.horizontalOrigin.getValue()).toEqual( - options.horizontalOrigin + options.horizontalOrigin, ); expect(billboard.verticalOrigin.getValue()).toEqual(options.verticalOrigin); expect(billboard.eyeOffset.getValue()).toEqual(options.eyeOffset); @@ -77,20 +77,20 @@ describe("DataSources/BillboardGraphics", function () { expect(billboard.width.getValue()).toEqual(options.width); expect(billboard.height.getValue()).toEqual(options.height); expect(billboard.scaleByDistance.getValue()).toEqual( - options.scaleByDistance + options.scaleByDistance, ); expect(billboard.translucencyByDistance.getValue()).toEqual( - options.translucencyByDistance + options.translucencyByDistance, ); expect(billboard.pixelOffsetScaleByDistance.getValue()).toEqual( - options.pixelOffsetScaleByDistance + options.pixelOffsetScaleByDistance, ); expect(billboard.sizeInMeters.getValue()).toEqual(options.sizeInMeters); expect(billboard.distanceDisplayCondition.getValue()).toEqual( - options.distanceDisplayCondition + options.distanceDisplayCondition, ); expect(billboard.disableDepthTestDistance.getValue()).toEqual( - options.disableDepthTestDistance + options.disableDepthTestDistance, ); expect(billboard.splitDirection.getValue()).toEqual(options.splitDirection); }); @@ -103,7 +103,7 @@ describe("DataSources/BillboardGraphics", function () { source.alignedAxis = new ConstantProperty(new Cartesian3()); source.color = new ConstantProperty(Color.BLACK); source.heightReference = new ConstantProperty( - HeightReference.CLAMP_TO_GROUND + HeightReference.CLAMP_TO_GROUND, ); source.horizontalOrigin = new ConstantProperty(HorizontalOrigin.LEFT); source.verticalOrigin = new ConstantProperty(VerticalOrigin.BOTTOM); @@ -116,11 +116,11 @@ describe("DataSources/BillboardGraphics", function () { source.scaleByDistance = new ConstantProperty(new NearFarScalar()); source.translucencyByDistance = new ConstantProperty(new NearFarScalar()); source.pixelOffsetScaleByDistance = new ConstantProperty( - new NearFarScalar(1.0, 0.0, 3.0e9, 0.0) + new NearFarScalar(1.0, 0.0, 3.0e9, 0.0), ); source.sizeInMeters = new ConstantProperty(true); source.distanceDisplayCondition = new ConstantProperty( - new DistanceDisplayCondition(10.0, 100.0) + new DistanceDisplayCondition(10.0, 100.0), ); source.disableDepthTestDistance = new ConstantProperty(10.0); source.splitDirection = new ConstantProperty(SplitDirection.LEFT); @@ -145,14 +145,14 @@ describe("DataSources/BillboardGraphics", function () { expect(target.scaleByDistance).toBe(source.scaleByDistance); expect(target.translucencyByDistance).toBe(source.translucencyByDistance); expect(target.pixelOffsetScaleByDistance).toBe( - source.pixelOffsetScaleByDistance + source.pixelOffsetScaleByDistance, ); expect(target.sizeInMeters).toBe(source.sizeInMeters); expect(target.distanceDisplayCondition).toBe( - source.distanceDisplayCondition + source.distanceDisplayCondition, ); expect(target.disableDepthTestDistance).toBe( - source.disableDepthTestDistance + source.disableDepthTestDistance, ); expect(target.splitDirection).toBe(source.splitDirection); }); @@ -165,7 +165,7 @@ describe("DataSources/BillboardGraphics", function () { source.alignedAxis = new ConstantProperty(new Cartesian3()); source.color = new ConstantProperty(Color.BLACK); source.heightReference = new ConstantProperty( - HeightReference.CLAMP_TO_GROUND + HeightReference.CLAMP_TO_GROUND, ); source.horizontalOrigin = new ConstantProperty(HorizontalOrigin.LEFT); source.verticalOrigin = new ConstantProperty(VerticalOrigin.BOTTOM); @@ -178,11 +178,11 @@ describe("DataSources/BillboardGraphics", function () { source.scaleByDistance = new ConstantProperty(new NearFarScalar()); source.translucencyByDistance = new ConstantProperty(new NearFarScalar()); source.pixelOffsetScaleByDistance = new ConstantProperty( - new NearFarScalar(1.0, 0.0, 3.0e9, 0.0) + new NearFarScalar(1.0, 0.0, 3.0e9, 0.0), ); source.sizeInMeters = new ConstantProperty(true); source.distanceDisplayCondition = new ConstantProperty( - new DistanceDisplayCondition(10.0, 100.0) + new DistanceDisplayCondition(10.0, 100.0), ); source.disableDepthTestDistance = new ConstantProperty(10.0); source.splitDirection = new ConstantProperty(SplitDirection.LEFT); @@ -193,7 +193,7 @@ describe("DataSources/BillboardGraphics", function () { const alignedAxis = new ConstantProperty(new Cartesian3()); const color = new ConstantProperty(Color.BLACK); const heightReference = new ConstantProperty( - HeightReference.CLAMP_TO_GROUND + HeightReference.CLAMP_TO_GROUND, ); const horizontalOrigin = new ConstantProperty(HorizontalOrigin.LEFT); const verticalOrigin = new ConstantProperty(VerticalOrigin.BOTTOM); @@ -206,11 +206,11 @@ describe("DataSources/BillboardGraphics", function () { const scaleByDistance = new ConstantProperty(new NearFarScalar()); const translucencyByDistance = new ConstantProperty(new NearFarScalar()); const pixelOffsetScaleByDistance = new ConstantProperty( - new NearFarScalar() + new NearFarScalar(), ); const sizeInMeters = new ConstantProperty(true); const distanceDisplayCondition = new ConstantProperty( - new DistanceDisplayCondition() + new DistanceDisplayCondition(), ); const disableDepthTestDistance = new ConstantProperty(10.0); const splitDirection = new ConstantProperty(SplitDirection.LEFT); @@ -271,7 +271,7 @@ describe("DataSources/BillboardGraphics", function () { source.alignedAxis = new ConstantProperty(new Cartesian3()); source.color = new ConstantProperty(Color.BLACK); source.heightReference = new ConstantProperty( - HeightReference.CLAMP_TO_GROUND + HeightReference.CLAMP_TO_GROUND, ); source.horizontalOrigin = new ConstantProperty(HorizontalOrigin.LEFT); source.verticalOrigin = new ConstantProperty(VerticalOrigin.BOTTOM); @@ -284,11 +284,11 @@ describe("DataSources/BillboardGraphics", function () { source.scaleByDistance = new ConstantProperty(new NearFarScalar()); source.translucencyByDistance = new ConstantProperty(new NearFarScalar()); source.pixelOffsetScaleByDistance = new ConstantProperty( - new NearFarScalar(1.0, 0.0, 3.0e9, 0.0) + new NearFarScalar(1.0, 0.0, 3.0e9, 0.0), ); source.sizeInMeters = new ConstantProperty(true); source.distanceDisplayCondition = new ConstantProperty( - new DistanceDisplayCondition(10.0, 100.0) + new DistanceDisplayCondition(10.0, 100.0), ); source.disableDepthTestDistance = new ConstantProperty(10.0); source.splitDirection = new ConstantProperty(SplitDirection.LEFT); @@ -311,14 +311,14 @@ describe("DataSources/BillboardGraphics", function () { expect(result.scaleByDistance).toBe(source.scaleByDistance); expect(result.translucencyByDistance).toBe(source.translucencyByDistance); expect(result.pixelOffsetScaleByDistance).toBe( - source.pixelOffsetScaleByDistance + source.pixelOffsetScaleByDistance, ); expect(result.sizeInMeters).toBe(source.sizeInMeters); expect(result.distanceDisplayCondition).toBe( - source.distanceDisplayCondition + source.distanceDisplayCondition, ); expect(result.disableDepthTestDistance).toBe( - source.disableDepthTestDistance + source.disableDepthTestDistance, ); expect(result.splitDirection).toBe(source.splitDirection); }); diff --git a/packages/engine/Specs/DataSources/BillboardVisualizerSpec.js b/packages/engine/Specs/DataSources/BillboardVisualizerSpec.js index a01bec49ccbf..b0b10a7ceebc 100644 --- a/packages/engine/Specs/DataSources/BillboardVisualizerSpec.js +++ b/packages/engine/Specs/DataSources/BillboardVisualizerSpec.js @@ -79,7 +79,7 @@ describe( const entityCollection = new EntityCollection(); const visualizer = new BillboardVisualizer( entityCluster, - entityCollection + entityCollection, ); expect(entityCollection.collectionChanged.numberOfListeners).toEqual(1); visualizer.destroy(); @@ -92,7 +92,7 @@ describe( const testObject = entityCollection.getOrCreateEntity("test"); testObject.position = new ConstantProperty( - new Cartesian3(1234, 5678, 9101112) + new Cartesian3(1234, 5678, 9101112), ); visualizer.update(JulianDate.now()); expect(entityCluster._billboardCollection).not.toBeDefined(); @@ -117,7 +117,7 @@ describe( const testObject = entityCollection.getOrCreateEntity("test"); testObject.position = new ConstantProperty( - new Cartesian3(1234, 5678, 9101112) + new Cartesian3(1234, 5678, 9101112), ); const billboard = (testObject.billboard = new BillboardGraphics()); billboard.show = new ConstantProperty(true); @@ -136,20 +136,20 @@ describe( const billboard = (testObject.billboard = new BillboardGraphics()); testObject.position = new ConstantProperty( - new Cartesian3(1234, 5678, 9101112) + new Cartesian3(1234, 5678, 9101112), ); billboard.show = new ConstantProperty(true); billboard.color = new ConstantProperty(new Color(0.5, 0.5, 0.5, 0.5)); billboard.image = new ConstantProperty("Data/Images/Blue.png"); billboard.imageSubRegion = new ConstantProperty( - new BoundingRectangle(0, 0, 1, 1) + new BoundingRectangle(0, 0, 1, 1), ); billboard.eyeOffset = new ConstantProperty(new Cartesian3(1.0, 2.0, 3.0)); billboard.scale = new ConstantProperty(12.5); billboard.rotation = new ConstantProperty(1.5); billboard.alignedAxis = new ConstantProperty(Cartesian3.UNIT_Z); billboard.heightReference = new ConstantProperty( - HeightReference.CLAMP_TO_GROUND + HeightReference.CLAMP_TO_GROUND, ); billboard.horizontalOrigin = new ConstantProperty(HorizontalOrigin.RIGHT); billboard.verticalOrigin = new ConstantProperty(VerticalOrigin.TOP); @@ -158,14 +158,14 @@ describe( billboard.height = new ConstantProperty(5); billboard.scaleByDistance = new ConstantProperty(new NearFarScalar()); billboard.translucencyByDistance = new ConstantProperty( - new NearFarScalar() + new NearFarScalar(), ); billboard.pixelOffsetScaleByDistance = new ConstantProperty( - new NearFarScalar(1.0, 0.0, 3.0e9, 0.0) + new NearFarScalar(1.0, 0.0, 3.0e9, 0.0), ); billboard.sizeInMeters = new ConstantProperty(true); billboard.distanceDisplayCondition = new ConstantProperty( - new DistanceDisplayCondition(10.0, 100.0) + new DistanceDisplayCondition(10.0, 100.0), ); billboard.disableDepthTestDistance = new ConstantProperty(10.0); billboard.splitDirection = new ConstantProperty(SplitDirection.LEFT); @@ -184,49 +184,49 @@ describe( expect(bb.position).toEqual(testObject.position.getValue(time)); expect(bb.color).toEqual(testObject.billboard.color.getValue(time)); expect(bb.eyeOffset).toEqual( - testObject.billboard.eyeOffset.getValue(time) + testObject.billboard.eyeOffset.getValue(time), ); expect(bb.scale).toEqual(testObject.billboard.scale.getValue(time)); expect(bb.rotation).toEqual( - testObject.billboard.rotation.getValue(time) + testObject.billboard.rotation.getValue(time), ); expect(bb.alignedAxis).toEqual( - testObject.billboard.alignedAxis.getValue(time) + testObject.billboard.alignedAxis.getValue(time), ); expect(bb.heightReference).toEqual( - testObject.billboard.heightReference.getValue(time) + testObject.billboard.heightReference.getValue(time), ); expect(bb.horizontalOrigin).toEqual( - testObject.billboard.horizontalOrigin.getValue(time) + testObject.billboard.horizontalOrigin.getValue(time), ); expect(bb.verticalOrigin).toEqual( - testObject.billboard.verticalOrigin.getValue(time) + testObject.billboard.verticalOrigin.getValue(time), ); expect(bb.width).toEqual(testObject.billboard.width.getValue(time)); expect(bb.height).toEqual(testObject.billboard.height.getValue(time)); expect(bb.scaleByDistance).toEqual( - testObject.billboard.scaleByDistance.getValue(time) + testObject.billboard.scaleByDistance.getValue(time), ); expect(bb.translucencyByDistance).toEqual( - testObject.billboard.translucencyByDistance.getValue(time) + testObject.billboard.translucencyByDistance.getValue(time), ); expect(bb.pixelOffsetScaleByDistance).toEqual( - testObject.billboard.pixelOffsetScaleByDistance.getValue(time) + testObject.billboard.pixelOffsetScaleByDistance.getValue(time), ); expect(bb.sizeInMeters).toEqual( - testObject.billboard.sizeInMeters.getValue(time) + testObject.billboard.sizeInMeters.getValue(time), ); expect(bb.distanceDisplayCondition).toEqual( - testObject.billboard.distanceDisplayCondition.getValue(time) + testObject.billboard.distanceDisplayCondition.getValue(time), ); expect(bb.disableDepthTestDistance).toEqual( - testObject.billboard.disableDepthTestDistance.getValue(time) + testObject.billboard.disableDepthTestDistance.getValue(time), ); expect(bb.splitDirection).toEqual( - testObject.billboard.splitDirection.getValue(time) + testObject.billboard.splitDirection.getValue(time), ); expect(bb._imageSubRegion).toEqual( - testObject.billboard.imageSubRegion.getValue(time) + testObject.billboard.imageSubRegion.getValue(time), ); billboard.show = new ConstantProperty(false); @@ -248,20 +248,20 @@ describe( const billboard = (testObject.billboard = new BillboardGraphics()); testObject.position = new ConstantProperty( - new Cartesian3(1234, 5678, 9101112) + new Cartesian3(1234, 5678, 9101112), ); billboard.show = new ConstantProperty(true); billboard.color = new ConstantProperty(new Color(0.5, 0.5, 0.5, 0.5)); billboard.image = new ConstantProperty("Data/Images/Blue.png"); billboard.imageSubRegion = new ConstantProperty( - new BoundingRectangle(0, 0, 1, 1) + new BoundingRectangle(0, 0, 1, 1), ); billboard.eyeOffset = new ConstantProperty(new Cartesian3(1.0, 2.0, 3.0)); billboard.scale = new ConstantProperty(12.5); billboard.rotation = new ConstantProperty(1.5); billboard.alignedAxis = new ConstantProperty(Cartesian3.UNIT_Z); billboard.heightReference = new ConstantProperty( - HeightReference.CLAMP_TO_GROUND + HeightReference.CLAMP_TO_GROUND, ); billboard.horizontalOrigin = new ConstantProperty(HorizontalOrigin.RIGHT); billboard.verticalOrigin = new ConstantProperty(VerticalOrigin.TOP); @@ -270,14 +270,14 @@ describe( billboard.height = new ConstantProperty(5); billboard.scaleByDistance = new ConstantProperty(new NearFarScalar()); billboard.translucencyByDistance = new ConstantProperty( - new NearFarScalar() + new NearFarScalar(), ); billboard.pixelOffsetScaleByDistance = new ConstantProperty( - new NearFarScalar(1.0, 0.0, 3.0e9, 0.0) + new NearFarScalar(1.0, 0.0, 3.0e9, 0.0), ); billboard.sizeInMeters = new ConstantProperty(true); billboard.distanceDisplayCondition = new ConstantProperty( - new DistanceDisplayCondition(10.0, 100.0) + new DistanceDisplayCondition(10.0, 100.0), ); billboard.disableDepthTestDistance = new ConstantProperty(10.0); billboard.splitDirection = new ConstantProperty(SplitDirection.LEFT); @@ -308,52 +308,52 @@ describe( expect(bb.position).toEqual(testObject.position.getValue(time)); expect(bb.color).toEqual(testObject.billboard.color.getValue(time)); expect(bb.eyeOffset).toEqual( - testObject.billboard.eyeOffset.getValue(time) + testObject.billboard.eyeOffset.getValue(time), ); expect(bb.scale).toEqual(testObject.billboard.scale.getValue(time)); expect(bb.rotation).toEqual( - testObject.billboard.rotation.getValue(time) + testObject.billboard.rotation.getValue(time), ); expect(bb.alignedAxis).toEqual( - testObject.billboard.alignedAxis.getValue(time) + testObject.billboard.alignedAxis.getValue(time), ); expect(bb.heightReference).toEqual( - testObject.billboard.heightReference.getValue(time) + testObject.billboard.heightReference.getValue(time), ); expect(bb.horizontalOrigin).toEqual( - testObject.billboard.horizontalOrigin.getValue(time) + testObject.billboard.horizontalOrigin.getValue(time), ); expect(bb.verticalOrigin).toEqual( - testObject.billboard.verticalOrigin.getValue(time) + testObject.billboard.verticalOrigin.getValue(time), ); expect(bb.width).toEqual(testObject.billboard.width.getValue(time)); expect(bb.height).toEqual( - testObject.billboard.height.getValue(time) + testObject.billboard.height.getValue(time), ); expect(bb.scaleByDistance).toEqual( - testObject.billboard.scaleByDistance.getValue(time) + testObject.billboard.scaleByDistance.getValue(time), ); expect(bb.translucencyByDistance).toEqual( - testObject.billboard.translucencyByDistance.getValue(time) + testObject.billboard.translucencyByDistance.getValue(time), ); expect(bb.pixelOffsetScaleByDistance).toEqual( - testObject.billboard.pixelOffsetScaleByDistance.getValue(time) + testObject.billboard.pixelOffsetScaleByDistance.getValue(time), ); expect(bb.sizeInMeters).toEqual( - testObject.billboard.sizeInMeters.getValue(time) + testObject.billboard.sizeInMeters.getValue(time), ); expect(bb.distanceDisplayCondition).toEqual( - testObject.billboard.distanceDisplayCondition.getValue(time) + testObject.billboard.distanceDisplayCondition.getValue(time), ); expect(bb.disableDepthTestDistance).toEqual( - testObject.billboard.disableDepthTestDistance.getValue(time) + testObject.billboard.disableDepthTestDistance.getValue(time), ); expect(bb.splitDirection).toEqual( - testObject.billboard.splitDirection.getValue(time) + testObject.billboard.splitDirection.getValue(time), ); expect(bb.image).toBeDefined(); expect(bb._imageSubRegion).toEqual( - testObject.billboard.imageSubRegion.getValue(time) + testObject.billboard.imageSubRegion.getValue(time), ); }); }); @@ -367,7 +367,7 @@ describe( const testObject = entityCollection.getOrCreateEntity("test"); testObject.position = new ConstantProperty( - new Cartesian3(1234, 5678, 9101112) + new Cartesian3(1234, 5678, 9101112), ); testObject.billboard = new BillboardGraphics(); testObject.billboard.image = new ConstantProperty("Data/Images/Blue.png"); @@ -386,11 +386,11 @@ describe( const testObject2 = entityCollection.getOrCreateEntity("test2"); testObject2.position = new ConstantProperty( - new Cartesian3(1234, 5678, 9101112) + new Cartesian3(1234, 5678, 9101112), ); testObject2.billboard = new BillboardGraphics(); testObject2.billboard.image = new ConstantProperty( - "Data/Images/Blue.png" + "Data/Images/Blue.png", ); testObject2.billboard.show = new ConstantProperty(true); @@ -408,7 +408,7 @@ describe( const billboard = (testObject.billboard = new BillboardGraphics()); testObject.position = new ConstantProperty( - new Cartesian3(1234, 5678, 9101112) + new Cartesian3(1234, 5678, 9101112), ); billboard.show = new ConstantProperty(true); billboard.image = new ConstantProperty("Data/Images/Blue.png"); @@ -439,7 +439,7 @@ describe( const billboard = (testObject.billboard = new BillboardGraphics()); testObject.position = new ConstantProperty( - new Cartesian3(1234, 5678, 9101112) + new Cartesian3(1234, 5678, 9101112), ); billboard.show = new ConstantProperty(true); billboard.image = new ConstantProperty("Data/Images/Blue.png"); @@ -460,7 +460,7 @@ describe( const billboard = (testObject.billboard = new BillboardGraphics()); testObject.position = new ConstantProperty( - new Cartesian3(1234, 5678, 9101112) + new Cartesian3(1234, 5678, 9101112), ); billboard.show = new ConstantProperty(true); billboard.image = new ConstantProperty("Data/Images/Blue.png"); @@ -502,5 +502,5 @@ describe( }).toThrowDeveloperError(); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/DataSources/BoxGeometryUpdaterSpec.js b/packages/engine/Specs/DataSources/BoxGeometryUpdaterSpec.js index 55d6932c9fbd..5dd917aeb550 100644 --- a/packages/engine/Specs/DataSources/BoxGeometryUpdaterSpec.js +++ b/packages/engine/Specs/DataSources/BoxGeometryUpdaterSpec.js @@ -38,7 +38,7 @@ describe( box.dimensions = new ConstantProperty(new Cartesian3(1, 2, 3)); const entity = new Entity(); entity.position = new ConstantPositionProperty( - Cartesian3.fromDegrees(0, 0, 0) + Cartesian3.fromDegrees(0, 0, 0), ); entity.box = box; return entity; @@ -74,14 +74,14 @@ describe( instance = updater.createFillGeometryInstance(time); geometry = instance.geometry; expect(geometry._maximum).toEqual( - Cartesian3.multiplyByScalar(dimensions, 0.5, new Cartesian3()) + Cartesian3.multiplyByScalar(dimensions, 0.5, new Cartesian3()), ); expect(geometry._offsetAttribute).toBeUndefined(); instance = updater.createOutlineGeometryInstance(time); geometry = instance.geometry; expect(geometry._max).toEqual( - Cartesian3.multiplyByScalar(dimensions, 0.5, new Cartesian3()) + Cartesian3.multiplyByScalar(dimensions, 0.5, new Cartesian3()), ); expect(geometry._offsetAttribute).toBeUndefined(); }); @@ -111,29 +111,29 @@ describe( expect(instance.geometry._offsetAttribute).toBeUndefined(); graphics.heightReference = new ConstantProperty( - HeightReference.CLAMP_TO_GROUND + HeightReference.CLAMP_TO_GROUND, ); updater._onEntityPropertyChanged(entity, "box"); instance = updater.createFillGeometryInstance(time); expect(instance.geometry._offsetAttribute).toEqual( - GeometryOffsetAttribute.ALL + GeometryOffsetAttribute.ALL, ); instance = updater.createOutlineGeometryInstance(time); expect(instance.geometry._offsetAttribute).toEqual( - GeometryOffsetAttribute.ALL + GeometryOffsetAttribute.ALL, ); graphics.heightReference = new ConstantProperty( - HeightReference.RELATIVE_TO_GROUND + HeightReference.RELATIVE_TO_GROUND, ); updater._onEntityPropertyChanged(entity, "box"); instance = updater.createFillGeometryInstance(time); expect(instance.geometry._offsetAttribute).toEqual( - GeometryOffsetAttribute.ALL + GeometryOffsetAttribute.ALL, ); instance = updater.createOutlineGeometryInstance(time); expect(instance.geometry._offsetAttribute).toEqual( - GeometryOffsetAttribute.ALL + GeometryOffsetAttribute.ALL, ); }); @@ -143,12 +143,12 @@ describe( const updater = new BoxGeometryUpdater(entity, scene); const dynamicUpdater = updater.createDynamicUpdater( new PrimitiveCollection(), - new PrimitiveCollection() + new PrimitiveCollection(), ); dynamicUpdater.update(JulianDate.now()); expect(dynamicUpdater._options.dimensions).toEqual( - entity.box.dimensions.getValue() + entity.box.dimensions.getValue(), ); expect(dynamicUpdater._options.offsetAttribute).toBeUndefined(); }); @@ -186,7 +186,7 @@ describe( const updater = new BoxGeometryUpdater(entity, scene); expect(updater._computeCenter(time)).toEqual( - entity.position.getValue(time) + entity.position.getValue(time), ); }); @@ -198,15 +198,15 @@ describe( BoxGeometryUpdater, "box", createBasicBox, - getScene + getScene, ); createDynamicGeometryUpdaterSpecs( BoxGeometryUpdater, "box", createDynamicBox, - getScene + getScene, ); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/DataSources/BoxGraphicsSpec.js b/packages/engine/Specs/DataSources/BoxGraphicsSpec.js index 6c1a2080f629..aa71c78b741d 100644 --- a/packages/engine/Specs/DataSources/BoxGraphicsSpec.js +++ b/packages/engine/Specs/DataSources/BoxGraphicsSpec.js @@ -45,7 +45,7 @@ describe("DataSources/BoxGraphics", function () { expect(box.dimensions.getValue()).toEqual(options.dimensions); expect(box.shadows.getValue()).toEqual(options.shadows); expect(box.distanceDisplayCondition.getValue()).toEqual( - options.distanceDisplayCondition + options.distanceDisplayCondition, ); }); @@ -60,7 +60,7 @@ describe("DataSources/BoxGraphics", function () { source.dimensions = new ConstantProperty(); source.shadows = new ConstantProperty(ShadowMode.ENABLED); source.distanceDisplayCondition = new ConstantProperty( - new DistanceDisplayCondition(10.0, 100.0) + new DistanceDisplayCondition(10.0, 100.0), ); const target = new BoxGraphics(); @@ -75,7 +75,7 @@ describe("DataSources/BoxGraphics", function () { expect(target.dimensions).toBe(source.dimensions); expect(target.shadows).toBe(source.shadows); expect(target.distanceDisplayCondition).toBe( - source.distanceDisplayCondition + source.distanceDisplayCondition, ); }); @@ -138,7 +138,7 @@ describe("DataSources/BoxGraphics", function () { expect(result.dimensions).toBe(source.dimensions); expect(result.shadows).toBe(source.shadows); expect(result.distanceDisplayCondition).toBe( - source.distanceDisplayCondition + source.distanceDisplayCondition, ); }); @@ -161,19 +161,19 @@ describe("DataSources/BoxGraphics", function () { property, "dimensions", new Cartesian3(0, 0, 0), - new Cartesian3(1, 1, 1) + new Cartesian3(1, 1, 1), ); testDefinitionChanged( property, "shadows", ShadowMode.ENABLED, - ShadowMode.DISABLED + ShadowMode.DISABLED, ); testDefinitionChanged( property, "distanceDisplayCondition", new DistanceDisplayCondition(), - new DistanceDisplayCondition(10.0, 100.0) + new DistanceDisplayCondition(10.0, 100.0), ); }); }); diff --git a/packages/engine/Specs/DataSources/CallbackPositionPropertySpec.js b/packages/engine/Specs/DataSources/CallbackPositionPropertySpec.js index c9c2470f89aa..8668e22daf7a 100644 --- a/packages/engine/Specs/DataSources/CallbackPositionPropertySpec.js +++ b/packages/engine/Specs/DataSources/CallbackPositionPropertySpec.js @@ -29,7 +29,7 @@ describe("DataSources/CallbackPositionProperty", function () { property = new CallbackPositionProperty( callback, true, - ReferenceFrame.INERTIAL + ReferenceFrame.INERTIAL, ); expect(property.referenceFrame).toBe(ReferenceFrame.INERTIAL); }); @@ -62,7 +62,7 @@ describe("DataSources/CallbackPositionProperty", function () { time, valueInertial, ReferenceFrame.INERTIAL, - ReferenceFrame.FIXED + ReferenceFrame.FIXED, ); const callback = function (_time, result) { return valueInertial.clone(result); @@ -70,7 +70,7 @@ describe("DataSources/CallbackPositionProperty", function () { const property = new CallbackPositionProperty( callback, true, - ReferenceFrame.INERTIAL + ReferenceFrame.INERTIAL, ); const result = property.getValue(time); @@ -99,7 +99,7 @@ describe("DataSources/CallbackPositionProperty", function () { const result = property.getValueInReferenceFrame( time, - ReferenceFrame.INERTIAL + ReferenceFrame.INERTIAL, ); expect(result).not.toBe(value); expect(result).toEqual( @@ -107,8 +107,8 @@ describe("DataSources/CallbackPositionProperty", function () { time, value, ReferenceFrame.FIXED, - ReferenceFrame.INERTIAL - ) + ReferenceFrame.INERTIAL, + ), ); }); @@ -120,14 +120,14 @@ describe("DataSources/CallbackPositionProperty", function () { const property = new CallbackPositionProperty( callback, true, - ReferenceFrame.INERTIAL + ReferenceFrame.INERTIAL, ); const expected = new Cartesian3(); const result = property.getValueInReferenceFrame( time, ReferenceFrame.FIXED, - expected + expected, ); expect(result).toBe(expected); expect(expected).toEqual( @@ -135,8 +135,8 @@ describe("DataSources/CallbackPositionProperty", function () { time, value, ReferenceFrame.INERTIAL, - ReferenceFrame.FIXED - ) + ReferenceFrame.FIXED, + ), ); }); @@ -189,7 +189,7 @@ describe("DataSources/CallbackPositionProperty", function () { right = new CallbackPositionProperty( callback, true, - ReferenceFrame.INERTIAL + ReferenceFrame.INERTIAL, ); expect(left.equals(right)).toEqual(false); }); diff --git a/packages/engine/Specs/DataSources/Cesium3DTilesetGraphicsSpec.js b/packages/engine/Specs/DataSources/Cesium3DTilesetGraphicsSpec.js index 37d85b422952..be59405ccd3c 100644 --- a/packages/engine/Specs/DataSources/Cesium3DTilesetGraphicsSpec.js +++ b/packages/engine/Specs/DataSources/Cesium3DTilesetGraphicsSpec.js @@ -16,7 +16,7 @@ describe("DataSources/Cesium3DTilesetGraphics", function () { expect(model.uri.getValue()).toEqual(options.uri); expect(model.show.getValue()).toEqual(options.show); expect(model.maximumScreenSpaceError.getValue()).toEqual( - options.maximumScreenSpaceError + options.maximumScreenSpaceError, ); }); diff --git a/packages/engine/Specs/DataSources/Cesium3DTilesetVisualizerSpec.js b/packages/engine/Specs/DataSources/Cesium3DTilesetVisualizerSpec.js index 95c9db6e8767..0c9ef09da4fe 100644 --- a/packages/engine/Specs/DataSources/Cesium3DTilesetVisualizerSpec.js +++ b/packages/engine/Specs/DataSources/Cesium3DTilesetVisualizerSpec.js @@ -80,7 +80,7 @@ describe( const testObject = entityCollection.getOrCreateEntity("test"); testObject.position = new ConstantProperty( - new Cartesian3(1234, 5678, 9101112) + new Cartesian3(1234, 5678, 9101112), ); visualizer.update(JulianDate.now()); expect(scene.primitives.length).toEqual(0); @@ -116,7 +116,7 @@ describe( const testObject = entityCollection.getOrCreateEntity("test"); testObject.position = new ConstantPositionProperty( - Cartesian3.fromDegrees(1, 2, 3) + Cartesian3.fromDegrees(1, 2, 3), ); testObject.tileset = tileset; @@ -145,12 +145,12 @@ describe( tileset.uri = new ConstantProperty( new Resource({ url: tilesetUrl, - }) + }), ); const testObject = entityCollection.getOrCreateEntity("test"); testObject.position = new ConstantPositionProperty( - Cartesian3.fromDegrees(1, 2, 3) + Cartesian3.fromDegrees(1, 2, 3), ); testObject.tileset = tileset; @@ -174,7 +174,7 @@ describe( const time = JulianDate.now(); const testObject = entityCollection.getOrCreateEntity("test"); testObject.position = new ConstantProperty( - new Cartesian3(5678, 1234, 1101112) + new Cartesian3(5678, 1234, 1101112), ); testObject.tileset = tileset; visualizer.update(time); @@ -198,7 +198,7 @@ describe( testObject.tileset = tileset; testObject.position = new ConstantProperty( - new Cartesian3(5678, 1234, 1101112) + new Cartesian3(5678, 1234, 1101112), ); tileset.uri = new ConstantProperty(tilesetUrl); visualizer.update(time); @@ -221,12 +221,12 @@ describe( tileset.uri = new ConstantProperty( new Resource({ url: tilesetUrl, - }) + }), ); const testObject = entityCollection.getOrCreateEntity("test"); testObject.position = new ConstantPositionProperty( - Cartesian3.fromDegrees(1, 2, 3) + Cartesian3.fromDegrees(1, 2, 3), ); testObject.tileset = tileset; @@ -261,12 +261,12 @@ describe( tileset.uri = new ConstantProperty( new Resource({ url: tilesetUrl, - }) + }), ); const testObject = entityCollection.getOrCreateEntity("test"); testObject.position = new ConstantPositionProperty( - Cartesian3.fromDegrees(1, 2, 3) + Cartesian3.fromDegrees(1, 2, 3), ); testObject.tileset = tileset; @@ -288,7 +288,7 @@ describe( testObject.tileset = tileset; testObject.position = new ConstantProperty( - new Cartesian3(5678, 1234, 1101112) + new Cartesian3(5678, 1234, 1101112), ); tileset.uri = new ConstantProperty(tilesetUrl); visualizer.update(time); @@ -317,7 +317,7 @@ describe( testObject.tileset = tileset; testObject.position = new ConstantProperty( - new Cartesian3(5678, 1234, 1101112) + new Cartesian3(5678, 1234, 1101112), ); tileset.uri = new ConstantProperty(tilesetUrl); visualizer.update(time); @@ -356,7 +356,7 @@ describe( testObject.tileset = tileset; testObject.position = new ConstantProperty( - new Cartesian3(5678, 1234, 1101112) + new Cartesian3(5678, 1234, 1101112), ); tileset.uri = new ConstantProperty("/path/to/incorrect/file"); visualizer.update(time); @@ -392,5 +392,5 @@ describe( }).toThrowDeveloperError(); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/DataSources/CheckerboardMaterialPropertySpec.js b/packages/engine/Specs/DataSources/CheckerboardMaterialPropertySpec.js index 26a349ac869f..31f11faea7e0 100644 --- a/packages/engine/Specs/DataSources/CheckerboardMaterialPropertySpec.js +++ b/packages/engine/Specs/DataSources/CheckerboardMaterialPropertySpec.js @@ -67,21 +67,21 @@ describe("DataSources/CheckerboardMaterialProperty", function () { start: start, stop: stop, data: Color.RED, - }) + }), ); property.oddColor.intervals.addInterval( new TimeInterval({ start: start, stop: stop, data: Color.BLUE, - }) + }), ); property.repeat.intervals.addInterval( new TimeInterval({ start: start, stop: stop, data: new Cartesian2(5, 5), - }) + }), ); expect(property.isConstant).toBe(false); @@ -146,7 +146,7 @@ describe("DataSources/CheckerboardMaterialProperty", function () { property, "repeat", new Cartesian2(5, 5), - new Cartesian2(7, 7) + new Cartesian2(7, 7), ); }); }); diff --git a/packages/engine/Specs/DataSources/ColorMaterialPropertySpec.js b/packages/engine/Specs/DataSources/ColorMaterialPropertySpec.js index f3b6b0bd2f4f..47da83aea010 100644 --- a/packages/engine/Specs/DataSources/ColorMaterialPropertySpec.js +++ b/packages/engine/Specs/DataSources/ColorMaterialPropertySpec.js @@ -45,7 +45,7 @@ describe("DataSources/ColorMaterialProperty", function () { start: start, stop: stop, data: Color.BLUE, - }) + }), ); expect(property.isConstant).toBe(false); @@ -90,7 +90,7 @@ describe("DataSources/ColorMaterialProperty", function () { property, "color", property.color, - oldValue + oldValue, ); listener.calls.reset(); @@ -99,7 +99,7 @@ describe("DataSources/ColorMaterialProperty", function () { property, "color", property.color, - property.color + property.color, ); listener.calls.reset(); diff --git a/packages/engine/Specs/DataSources/CompositeEntityCollectionSpec.js b/packages/engine/Specs/DataSources/CompositeEntityCollectionSpec.js index bf0194423096..093e32c15d9d 100644 --- a/packages/engine/Specs/DataSources/CompositeEntityCollectionSpec.js +++ b/packages/engine/Specs/DataSources/CompositeEntityCollectionSpec.js @@ -21,7 +21,7 @@ describe("DataSources/CompositeEntityCollection", function () { CollectionListener.prototype.onCollectionChanged = function ( collection, added, - removed + removed, ) { this.timesCalled++; this.added = added.slice(0); @@ -207,7 +207,7 @@ describe("DataSources/CompositeEntityCollection", function () { const listener = new CollectionListener(); composite.collectionChanged.addEventListener( listener.onCollectionChanged, - listener + listener, ); entityCollection.add(entity); @@ -236,7 +236,7 @@ describe("DataSources/CompositeEntityCollection", function () { composite.collectionChanged.removeEventListener( listener.onCollectionChanged, - listener + listener, ); }); @@ -251,7 +251,7 @@ describe("DataSources/CompositeEntityCollection", function () { const listener = new CollectionListener(); composite.collectionChanged.addEventListener( listener.onCollectionChanged, - listener + listener, ); composite.suspendEvents(); @@ -284,7 +284,7 @@ describe("DataSources/CompositeEntityCollection", function () { composite.collectionChanged.removeEventListener( listener.onCollectionChanged, - listener + listener, ); }); @@ -314,7 +314,7 @@ describe("DataSources/CompositeEntityCollection", function () { composite.collectionChanged.addEventListener( listener.onCollectionChanged, - listener + listener, ); composite.removeAllCollections(); @@ -329,7 +329,7 @@ describe("DataSources/CompositeEntityCollection", function () { composite.collectionChanged.removeEventListener( listener.onCollectionChanged, - listener + listener, ); }); @@ -346,7 +346,7 @@ describe("DataSources/CompositeEntityCollection", function () { composite.collectionChanged.addEventListener( listener.onCollectionChanged, - listener + listener, ); composite.suspendEvents(); @@ -367,7 +367,7 @@ describe("DataSources/CompositeEntityCollection", function () { composite.collectionChanged.removeEventListener( listener.onCollectionChanged, - listener + listener, ); }); @@ -410,13 +410,13 @@ describe("DataSources/CompositeEntityCollection", function () { entity.availability.addInterval( TimeInterval.fromIso8601({ iso8601: "2012-08-01/2012-08-02", - }) + }), ); entity2.availability = new TimeIntervalCollection(); entity2.availability.addInterval( TimeInterval.fromIso8601({ iso8601: "2012-08-05/2012-08-06", - }) + }), ); entity3.availability = undefined; @@ -438,13 +438,13 @@ describe("DataSources/CompositeEntityCollection", function () { entity.availability.addInterval( TimeInterval.fromIso8601({ iso8601: "2012-08-01/9999-12-31T24:00:00Z", - }) + }), ); entity2.availability = new TimeIntervalCollection(); entity2.availability.addInterval( TimeInterval.fromIso8601({ iso8601: "0000-01-01T00:00:00Z/2012-08-06", - }) + }), ); entity3.availability = undefined; @@ -568,7 +568,7 @@ describe("DataSources/CompositeEntityCollection", function () { availability1.addInterval( TimeInterval.fromIso8601({ iso8601: "2019-01-01/2019-01-04", - }) + }), ); const entity1 = new Entity({ id: id, @@ -581,7 +581,7 @@ describe("DataSources/CompositeEntityCollection", function () { availability2.addInterval( TimeInterval.fromIso8601({ iso8601: "2019-01-02/2019-01-05", - }) + }), ); const entity2 = new Entity({ id: id, @@ -594,7 +594,7 @@ describe("DataSources/CompositeEntityCollection", function () { availability3.addInterval( TimeInterval.fromIso8601({ iso8601: "2019-01-03/2019-01-06", - }) + }), ); const entity3 = new Entity({ id: id, @@ -610,17 +610,17 @@ describe("DataSources/CompositeEntityCollection", function () { const compositeObject = composite.getById(id); expect(compositeObject.availability.start).toEqual( - JulianDate.fromIso8601("2019-01-01") + JulianDate.fromIso8601("2019-01-01"), ); composite.removeCollection(collection1); expect(compositeObject.availability.start).toEqual( - JulianDate.fromIso8601("2019-01-02") + JulianDate.fromIso8601("2019-01-02"), ); composite.removeCollection(collection2); expect(compositeObject.availability.start).toEqual( - JulianDate.fromIso8601("2019-01-03") + JulianDate.fromIso8601("2019-01-03"), ); }); @@ -663,7 +663,7 @@ describe("DataSources/CompositeEntityCollection", function () { e1Composite, propertyName, newValue, - oldValue + oldValue, ); }); @@ -691,7 +691,7 @@ describe("DataSources/CompositeEntityCollection", function () { e1Composite, propertyName, newValue, - oldValue + oldValue, ); }); @@ -727,17 +727,17 @@ describe("DataSources/CompositeEntityCollection", function () { composite2.addCollection(collection2); expect( - composite1.getById(id).billboard.show.getValue(JulianDate.now()) + composite1.getById(id).billboard.show.getValue(JulianDate.now()), ).toEqual(true); expect( - composite2.getById(id).billboard.show.getValue(JulianDate.now()) + composite2.getById(id).billboard.show.getValue(JulianDate.now()), ).toEqual(false); // switch the billboard show for the entity in collection2 to true, this should affect // composite2 but not composite1 entity2.billboard.show = new ConstantProperty(true); expect( - composite2.getById(id).billboard.show.getValue(JulianDate.now()) + composite2.getById(id).billboard.show.getValue(JulianDate.now()), ).toEqual(true); expect(composite1.getById(id).billboard.show).toBe(entity1.billboard.show); expect(composite2.getById(id).billboard.show).toBe(entity2.billboard.show); diff --git a/packages/engine/Specs/DataSources/CompositePositionPropertySpec.js b/packages/engine/Specs/DataSources/CompositePositionPropertySpec.js index 8d9263c0f7ba..703a67111cae 100644 --- a/packages/engine/Specs/DataSources/CompositePositionPropertySpec.js +++ b/packages/engine/Specs/DataSources/CompositePositionPropertySpec.js @@ -115,7 +115,7 @@ describe("DataSources/CompositePositionProperty", function () { stop: new JulianDate(12, 0), data: new ConstantPositionProperty( new Cartesian3(1, 2, 3), - ReferenceFrame.INERTIAL + ReferenceFrame.INERTIAL, ), }); const interval2 = new TimeInterval({ @@ -124,7 +124,7 @@ describe("DataSources/CompositePositionProperty", function () { isStartIncluded: false, data: new ConstantPositionProperty( new Cartesian3(4, 5, 6), - ReferenceFrame.FIXED + ReferenceFrame.FIXED, ), }); @@ -137,7 +137,7 @@ describe("DataSources/CompositePositionProperty", function () { interval1.start, valueInertial, ReferenceFrame.INERTIAL, - ReferenceFrame.FIXED + ReferenceFrame.FIXED, ); const result1 = property.getValue(interval1.start); @@ -153,7 +153,7 @@ describe("DataSources/CompositePositionProperty", function () { stop: new JulianDate(12, 0), data: new ConstantPositionProperty( new Cartesian3(1, 2, 3), - ReferenceFrame.INERTIAL + ReferenceFrame.INERTIAL, ), }); const interval2 = new TimeInterval({ @@ -162,7 +162,7 @@ describe("DataSources/CompositePositionProperty", function () { isStartIncluded: false, data: new ConstantPositionProperty( new Cartesian3(4, 5, 6), - ReferenceFrame.FIXED + ReferenceFrame.FIXED, ), }); @@ -174,27 +174,27 @@ describe("DataSources/CompositePositionProperty", function () { const result1 = property.getValueInReferenceFrame( interval1.start, ReferenceFrame.INERTIAL, - expected + expected, ); expect(result1).toBe(expected); expect(result1).toEqual( interval1.data.getValueInReferenceFrame( interval1.start, - ReferenceFrame.INERTIAL - ) + ReferenceFrame.INERTIAL, + ), ); const result2 = property.getValueInReferenceFrame( interval2.stop, ReferenceFrame.FIXED, - expected + expected, ); expect(result2).toBe(expected); expect(result2).toEqual( interval2.data.getValueInReferenceFrame( interval2.stop, - ReferenceFrame.FIXED - ) + ReferenceFrame.FIXED, + ), ); }); @@ -204,7 +204,7 @@ describe("DataSources/CompositePositionProperty", function () { stop: new JulianDate(12, 0), data: new ConstantPositionProperty( new Cartesian3(1, 2, 3), - ReferenceFrame.INERTIAL + ReferenceFrame.INERTIAL, ), }); const interval2 = new TimeInterval({ @@ -213,7 +213,7 @@ describe("DataSources/CompositePositionProperty", function () { isStartIncluded: false, data: new ConstantPositionProperty( new Cartesian3(4, 5, 6), - ReferenceFrame.FIXED + ReferenceFrame.FIXED, ), }); @@ -223,24 +223,24 @@ describe("DataSources/CompositePositionProperty", function () { const result1 = property.getValueInReferenceFrame( interval1.start, - ReferenceFrame.INERTIAL + ReferenceFrame.INERTIAL, ); expect(result1).toEqual( interval1.data.getValueInReferenceFrame( interval1.start, - ReferenceFrame.INERTIAL - ) + ReferenceFrame.INERTIAL, + ), ); const result2 = property.getValueInReferenceFrame( interval2.stop, - ReferenceFrame.FIXED + ReferenceFrame.FIXED, ); expect(result2).toEqual( interval2.data.getValueInReferenceFrame( interval2.stop, - ReferenceFrame.FIXED - ) + ReferenceFrame.FIXED, + ), ); }); diff --git a/packages/engine/Specs/DataSources/ConstantPositionPropertySpec.js b/packages/engine/Specs/DataSources/ConstantPositionPropertySpec.js index 0d4c734aeef8..4811bf078653 100644 --- a/packages/engine/Specs/DataSources/ConstantPositionPropertySpec.js +++ b/packages/engine/Specs/DataSources/ConstantPositionPropertySpec.js @@ -15,7 +15,7 @@ describe("DataSources/ConstantPositionProperty", function () { property = new ConstantPositionProperty( new Cartesian3(1, 2, 3), - ReferenceFrame.INERTIAL + ReferenceFrame.INERTIAL, ); expect(property.referenceFrame).toBe(ReferenceFrame.INERTIAL); }); @@ -45,11 +45,11 @@ describe("DataSources/ConstantPositionProperty", function () { time, valueInertial, ReferenceFrame.INERTIAL, - ReferenceFrame.FIXED + ReferenceFrame.FIXED, ); const property = new ConstantPositionProperty( valueInertial, - ReferenceFrame.INERTIAL + ReferenceFrame.INERTIAL, ); const result = property.getValue(time); @@ -64,7 +64,7 @@ describe("DataSources/ConstantPositionProperty", function () { it("getValue works with undefined inertial value", function () { const property = new ConstantPositionProperty( undefined, - ReferenceFrame.INERTIAL + ReferenceFrame.INERTIAL, ); expect(property.getValue(time)).toBeUndefined(); }); @@ -75,7 +75,7 @@ describe("DataSources/ConstantPositionProperty", function () { const result = property.getValueInReferenceFrame( time, - ReferenceFrame.INERTIAL + ReferenceFrame.INERTIAL, ); expect(result).not.toBe(value); expect(result).toEqual( @@ -83,8 +83,8 @@ describe("DataSources/ConstantPositionProperty", function () { time, value, ReferenceFrame.FIXED, - ReferenceFrame.INERTIAL - ) + ReferenceFrame.INERTIAL, + ), ); }); @@ -92,14 +92,14 @@ describe("DataSources/ConstantPositionProperty", function () { const value = new Cartesian3(1, 2, 3); const property = new ConstantPositionProperty( value, - ReferenceFrame.INERTIAL + ReferenceFrame.INERTIAL, ); const expected = new Cartesian3(); const result = property.getValueInReferenceFrame( time, ReferenceFrame.FIXED, - expected + expected, ); expect(result).toBe(expected); expect(expected).toEqual( @@ -107,8 +107,8 @@ describe("DataSources/ConstantPositionProperty", function () { time, value, ReferenceFrame.INERTIAL, - ReferenceFrame.FIXED - ) + ReferenceFrame.FIXED, + ), ); }); @@ -131,7 +131,7 @@ describe("DataSources/ConstantPositionProperty", function () { it("setValue raises definitionChanged when referenceFrame changes", function () { const property = new ConstantPositionProperty( new Cartesian3(0, 0, 0), - ReferenceFrame.FIXED + ReferenceFrame.FIXED, ); const listener = jasmine.createSpy("listener"); property.definitionChanged.addEventListener(listener); @@ -142,24 +142,24 @@ describe("DataSources/ConstantPositionProperty", function () { it("equals works", function () { const left = new ConstantPositionProperty( new Cartesian3(1, 2, 3), - ReferenceFrame.INERTIAL + ReferenceFrame.INERTIAL, ); let right = new ConstantPositionProperty( new Cartesian3(1, 2, 3), - ReferenceFrame.INERTIAL + ReferenceFrame.INERTIAL, ); expect(left.equals(right)).toEqual(true); right = new ConstantPositionProperty( new Cartesian3(1, 2, 3), - ReferenceFrame.FIXED + ReferenceFrame.FIXED, ); expect(left.equals(right)).toEqual(false); right = new ConstantPositionProperty( new Cartesian3(1, 2, 4), - ReferenceFrame.INERTIAL + ReferenceFrame.INERTIAL, ); expect(left.equals(right)).toEqual(false); }); diff --git a/packages/engine/Specs/DataSources/CorridorGeometryUpdaterSpec.js b/packages/engine/Specs/DataSources/CorridorGeometryUpdaterSpec.js index 6f455e96ce6e..599a4446c955 100644 --- a/packages/engine/Specs/DataSources/CorridorGeometryUpdaterSpec.js +++ b/packages/engine/Specs/DataSources/CorridorGeometryUpdaterSpec.js @@ -46,7 +46,7 @@ describe( function createBasicCorridor() { const corridor = new CorridorGraphics(); corridor.positions = new ConstantProperty( - Cartesian3.fromDegreesArray([0, 0, 1, 0, 1, 1, 0, 1]) + Cartesian3.fromDegreesArray([0, 0, 1, 0, 1, 1, 0, 1]), ); corridor.width = new ConstantProperty(1); corridor.height = new ConstantProperty(0); @@ -58,7 +58,7 @@ describe( function createDynamicCorridor() { const entity = createBasicCorridor(); entity.corridor.positions = createDynamicProperty( - Cartesian3.fromDegreesArray([0, 0, 1, 0, 1, 1, 0, 1]) + Cartesian3.fromDegreesArray([0, 0, 1, 0, 1, 1, 0, 1]), ); return entity; } @@ -66,7 +66,7 @@ describe( function createBasicCorridorWithoutHeight() { const corridor = new CorridorGraphics(); corridor.positions = new ConstantProperty( - Cartesian3.fromDegreesArray([0, 0, 1, 0, 1, 1, 0, 1]) + Cartesian3.fromDegreesArray([0, 0, 1, 0, 1, 1, 0, 1]), ); corridor.width = new ConstantProperty(1); const entity = new Entity(); @@ -77,7 +77,7 @@ describe( function createDynamicCorridorWithoutHeight() { const entity = createBasicCorridorWithoutHeight(); entity.corridor.positions = createDynamicProperty( - Cartesian3.fromDegreesArray([0, 0, 1, 0, 1, 1, 0, 1]) + Cartesian3.fromDegreesArray([0, 0, 1, 0, 1, 1, 0, 1]), ); return entity; } @@ -148,7 +148,7 @@ describe( start: JulianDate.now(), stop: JulianDate.now(), data: CornerType.ROUNDED, - }) + }), ); updater._onEntityPropertyChanged(entity, "corridor"); @@ -199,7 +199,7 @@ describe( it("dynamic updater sets properties", function () { const corridor = new CorridorGraphics(); corridor.positions = createDynamicProperty( - Cartesian3.fromDegreesArray([0, 0, 1, 0, 1, 1, 0, 1]) + Cartesian3.fromDegreesArray([0, 0, 1, 0, 1, 1, 0, 1]), ); corridor.show = createDynamicProperty(true); corridor.height = createDynamicProperty(3); @@ -216,7 +216,7 @@ describe( const updater = new CorridorGeometryUpdater(entity, scene); const dynamicUpdater = updater.createDynamicUpdater( new PrimitiveCollection(), - new PrimitiveCollection() + new PrimitiveCollection(), ); dynamicUpdater.update(time); @@ -224,7 +224,7 @@ describe( expect(options.positions).toEqual(corridor.positions.getValue()); expect(options.height).toEqual(corridor.height.getValue()); expect(options.extrudedHeight).toEqual( - corridor.extrudedHeight.getValue() + corridor.extrudedHeight.getValue(), ); expect(options.width).toEqual(corridor.width.getValue()); expect(options.granularity).toEqual(corridor.granularity.getValue()); @@ -270,7 +270,7 @@ describe( expect(updater._computeCenter(time)).toEqualEpsilon( Cartesian3.fromDegrees(1.0, 1.0), - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); }); @@ -282,14 +282,14 @@ describe( CorridorGeometryUpdater, "corridor", createBasicCorridor, - getScene + getScene, ); createDynamicGeometryUpdaterSpecs( CorridorGeometryUpdater, "corridor", createDynamicCorridor, - getScene + getScene, ); createGeometryUpdaterGroundGeometrySpecs( @@ -297,8 +297,8 @@ describe( "corridor", createBasicCorridorWithoutHeight, createDynamicCorridorWithoutHeight, - getScene + getScene, ); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/DataSources/CorridorGraphicsSpec.js b/packages/engine/Specs/DataSources/CorridorGraphicsSpec.js index 1f311c4d7d0d..a18b4cc398ae 100644 --- a/packages/engine/Specs/DataSources/CorridorGraphicsSpec.js +++ b/packages/engine/Specs/DataSources/CorridorGraphicsSpec.js @@ -65,10 +65,10 @@ describe("DataSources/CorridorGraphics", function () { expect(corridor.cornerType.getValue()).toEqual(options.cornerType); expect(corridor.shadows.getValue()).toEqual(options.shadows); expect(corridor.distanceDisplayCondition.getValue()).toEqual( - options.distanceDisplayCondition + options.distanceDisplayCondition, ); expect(corridor.classificationType.getValue()).toEqual( - options.classificationType + options.classificationType, ); expect(corridor.zIndex.getValue()).toEqual(options.zIndex); }); @@ -89,10 +89,10 @@ describe("DataSources/CorridorGraphics", function () { source.cornerType = new ConstantProperty(); source.shadows = new ConstantProperty(ShadowMode.ENABLED); source.distanceDisplayCondition = new ConstantProperty( - new DistanceDisplayCondition(10.0, 100.0) + new DistanceDisplayCondition(10.0, 100.0), ); source.classificationType = new ConstantProperty( - ClassificationType.TERRAIN + ClassificationType.TERRAIN, ); source.zIndex = new ConstantProperty(3); @@ -113,7 +113,7 @@ describe("DataSources/CorridorGraphics", function () { expect(target.cornerType).toBe(source.cornerType); expect(target.shadows).toBe(source.shadows); expect(target.distanceDisplayCondition).toBe( - source.distanceDisplayCondition + source.distanceDisplayCondition, ); expect(target.classificationType).toBe(source.classificationType); expect(target.zIndex).toBe(source.zIndex); @@ -211,7 +211,7 @@ describe("DataSources/CorridorGraphics", function () { expect(result.cornerType).toBe(source.cornerType); expect(result.shadows).toBe(source.shadows); expect(result.distanceDisplayCondition).toBe( - source.distanceDisplayCondition + source.distanceDisplayCondition, ); expect(result.classificationType).toBe(source.classificationType); expect(result.zIndex).toBe(source.zIndex); @@ -241,25 +241,25 @@ describe("DataSources/CorridorGraphics", function () { property, "cornerType", CornerType.BEVELED, - CornerType.MITERED + CornerType.MITERED, ); testDefinitionChanged( property, "shadows", ShadowMode.ENABLED, - ShadowMode.DISABLED + ShadowMode.DISABLED, ); testDefinitionChanged( property, "distanceDisplayCondition", new DistanceDisplayCondition(), - new DistanceDisplayCondition(10.0, 100.0) + new DistanceDisplayCondition(10.0, 100.0), ); testDefinitionChanged( property, "classificationType", ClassificationType.TERRAIN, - ClassificationType.BOTH + ClassificationType.BOTH, ); testDefinitionChanged(property, "zIndex", 3, 0); }); diff --git a/packages/engine/Specs/DataSources/CylinderGeometryUpdaterSpec.js b/packages/engine/Specs/DataSources/CylinderGeometryUpdaterSpec.js index ff00f1535d99..b6edf9c6f11c 100644 --- a/packages/engine/Specs/DataSources/CylinderGeometryUpdaterSpec.js +++ b/packages/engine/Specs/DataSources/CylinderGeometryUpdaterSpec.js @@ -44,7 +44,7 @@ describe( const entity = new Entity(); entity.position = new ConstantPositionProperty( - Cartesian3.fromDegrees(0, 0, 0) + Cartesian3.fromDegrees(0, 0, 0), ); entity.cylinder = cylinder; return entity; @@ -142,7 +142,7 @@ describe( const cylinder = new CylinderGraphics(); cylinder.outline = true; cylinder.numberOfVerticalLines = new ConstantProperty( - options.numberOfVerticalLines + options.numberOfVerticalLines, ); cylinder.length = new ConstantProperty(options.length); cylinder.topRadius = new ConstantProperty(options.topRadius); @@ -166,7 +166,7 @@ describe( expect(geometry._bottomRadius).toEqual(options.bottomRadius); expect(geometry._length).toEqual(options.length); expect(geometry._numberOfVerticalLines).toEqual( - options.numberOfVerticalLines + options.numberOfVerticalLines, ); expect(geometry._offsetAttribute).toBeUndefined(); }); @@ -196,29 +196,29 @@ describe( expect(instance.geometry._offsetAttribute).toBeUndefined(); graphics.heightReference = new ConstantProperty( - HeightReference.CLAMP_TO_GROUND + HeightReference.CLAMP_TO_GROUND, ); updater._onEntityPropertyChanged(entity, "cylinder"); instance = updater.createFillGeometryInstance(time); expect(instance.geometry._offsetAttribute).toEqual( - GeometryOffsetAttribute.ALL + GeometryOffsetAttribute.ALL, ); instance = updater.createOutlineGeometryInstance(time); expect(instance.geometry._offsetAttribute).toEqual( - GeometryOffsetAttribute.ALL + GeometryOffsetAttribute.ALL, ); graphics.heightReference = new ConstantProperty( - HeightReference.RELATIVE_TO_GROUND + HeightReference.RELATIVE_TO_GROUND, ); updater._onEntityPropertyChanged(entity, "cylinder"); instance = updater.createFillGeometryInstance(time); expect(instance.geometry._offsetAttribute).toEqual( - GeometryOffsetAttribute.ALL + GeometryOffsetAttribute.ALL, ); instance = updater.createOutlineGeometryInstance(time); expect(instance.geometry._offsetAttribute).toEqual( - GeometryOffsetAttribute.ALL + GeometryOffsetAttribute.ALL, ); }); @@ -236,7 +236,7 @@ describe( const updater = new CylinderGeometryUpdater(entity, scene); const dynamicUpdater = updater.createDynamicUpdater( new PrimitiveCollection(), - new PrimitiveCollection() + new PrimitiveCollection(), ); dynamicUpdater.update(JulianDate.now()); const options = dynamicUpdater._options; @@ -288,7 +288,7 @@ describe( const updater = new CylinderGeometryUpdater(entity, scene); expect(updater._computeCenter(time)).toEqual( - entity.position.getValue(time) + entity.position.getValue(time), ); }); @@ -300,15 +300,15 @@ describe( CylinderGeometryUpdater, "cylinder", createBasicCylinder, - getScene + getScene, ); createDynamicGeometryUpdaterSpecs( CylinderGeometryUpdater, "cylinder", createDynamicCylinder, - getScene + getScene, ); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/DataSources/CylinderGraphicsSpec.js b/packages/engine/Specs/DataSources/CylinderGraphicsSpec.js index acc20e7caa8e..75cc56d36cc8 100644 --- a/packages/engine/Specs/DataSources/CylinderGraphicsSpec.js +++ b/packages/engine/Specs/DataSources/CylinderGraphicsSpec.js @@ -49,7 +49,7 @@ describe("DataSources/CylinderGraphics", function () { expect(cylinder.topRadius.getValue()).toEqual(options.topRadius); expect(cylinder.bottomRadius.getValue()).toEqual(options.bottomRadius); expect(cylinder.numberOfVerticalLines.getValue()).toEqual( - options.numberOfVerticalLines + options.numberOfVerticalLines, ); expect(cylinder.slices.getValue()).toEqual(options.slices); expect(cylinder.fill.getValue()).toEqual(options.fill); @@ -58,7 +58,7 @@ describe("DataSources/CylinderGraphics", function () { expect(cylinder.outlineWidth.getValue()).toEqual(options.outlineWidth); expect(cylinder.shadows.getValue()).toEqual(options.shadows); expect(cylinder.distanceDisplayCondition.getValue()).toEqual( - options.distanceDisplayCondition + options.distanceDisplayCondition, ); }); @@ -92,7 +92,7 @@ describe("DataSources/CylinderGraphics", function () { expect(target.outlineWidth).toBe(source.outlineWidth); expect(target.shadows).toBe(source.shadows); expect(target.distanceDisplayCondition).toBe( - source.distanceDisplayCondition + source.distanceDisplayCondition, ); }); @@ -170,7 +170,7 @@ describe("DataSources/CylinderGraphics", function () { expect(result.outlineWidth).toBe(source.outlineWidth); expect(result.shadows).toBe(source.shadows); expect(result.distanceDisplayCondition).toBe( - source.distanceDisplayCondition + source.distanceDisplayCondition, ); }); @@ -197,13 +197,13 @@ describe("DataSources/CylinderGraphics", function () { property, "shadows", ShadowMode.ENABLED, - ShadowMode.DISABLED + ShadowMode.DISABLED, ); testDefinitionChanged( property, "distanceDisplayCondition", new DistanceDisplayCondition(), - new DistanceDisplayCondition(10.0, 100.0) + new DistanceDisplayCondition(10.0, 100.0), ); }); }); diff --git a/packages/engine/Specs/DataSources/CzmlDataSourceSpec.js b/packages/engine/Specs/DataSources/CzmlDataSourceSpec.js index 492d54fd31bc..735d0e24eb30 100644 --- a/packages/engine/Specs/DataSources/CzmlDataSourceSpec.js +++ b/packages/engine/Specs/DataSources/CzmlDataSourceSpec.js @@ -152,14 +152,14 @@ describe("DataSources/CzmlDataSource", function () { function cartesianFromArrayDegrees(array, startIndex, ellipsoid) { return Cartesian3.fromDegrees.apply( null, - [].concat(arraySubset(array, startIndex, 3), ellipsoid) + [].concat(arraySubset(array, startIndex, 3), ellipsoid), ); } function cartesianFromArrayRadians(array, startIndex, ellipsoid) { return Cartesian3.fromRadians.apply( null, - [].concat(arraySubset(array, startIndex, 3), ellipsoid) + [].concat(arraySubset(array, startIndex, 3), ellipsoid), ); } @@ -222,11 +222,11 @@ describe("DataSources/CzmlDataSource", function () { }); it("clock returns undefined for static CZML", function () { - return CzmlDataSource.load(makeDocument(staticCzml)).then(function ( - dataSource - ) { - expect(dataSource.clock).toBeUndefined(); - }); + return CzmlDataSource.load(makeDocument(staticCzml)).then( + function (dataSource) { + expect(dataSource.clock).toBeUndefined(); + }, + ); }); it("clock returns CZML defined clock", function () { @@ -260,20 +260,20 @@ describe("DataSources/CzmlDataSource", function () { iso8601: dynamicCzml.availability, }); - return CzmlDataSource.load(makeDocument(dynamicCzml)).then(function ( - dataSource - ) { - const clock = dataSource.clock; - expect(clock).toBeDefined(); - expect(clock.startTime).toEqual(interval.start); - expect(clock.stopTime).toEqual(interval.stop); - expect(clock.currentTime).toEqual(interval.start); - expect(clock.clockRange).toEqual(ClockRange.LOOP_STOP); - expect(clock.clockStep).toEqual(ClockStep.SYSTEM_CLOCK_MULTIPLIER); - expect(clock.multiplier).toEqual( - JulianDate.secondsDifference(interval.stop, interval.start) / 120.0 - ); - }); + return CzmlDataSource.load(makeDocument(dynamicCzml)).then( + function (dataSource) { + const clock = dataSource.clock; + expect(clock).toBeDefined(); + expect(clock.startTime).toEqual(interval.start); + expect(clock.stopTime).toEqual(interval.stop); + expect(clock.currentTime).toEqual(interval.start); + expect(clock.clockRange).toEqual(ClockRange.LOOP_STOP); + expect(clock.clockStep).toEqual(ClockStep.SYSTEM_CLOCK_MULTIPLIER); + expect(clock.multiplier).toEqual( + JulianDate.secondsDifference(interval.stop, interval.start) / 120.0, + ); + }, + ); }); it("process loads expected data", function () { @@ -289,7 +289,7 @@ describe("DataSources/CzmlDataSource", function () { .process( new Resource({ url: simpleUrl, - }) + }), ) .then(function (dataSource) { expect(dataSource.entities.values.length).toEqual(10); @@ -529,66 +529,66 @@ describe("DataSources/CzmlDataSource", function () { expect(entity.billboard).toBeDefined(); expect(entity.billboard.image.getValue(time).url).toEqual( - sourceUri + packet.billboard.image + sourceUri + packet.billboard.image, ); expect(entity.billboard.rotation.getValue(time)).toEqual( - packet.billboard.rotation + packet.billboard.rotation, ); expect(entity.billboard.scale.getValue(time)).toEqual( - packet.billboard.scale + packet.billboard.scale, ); expect(entity.billboard.heightReference.getValue(time)).toEqual( - HeightReference[packet.billboard.heightReference] + HeightReference[packet.billboard.heightReference], ); expect(entity.billboard.horizontalOrigin.getValue(time)).toEqual( - HorizontalOrigin[packet.billboard.horizontalOrigin] + HorizontalOrigin[packet.billboard.horizontalOrigin], ); expect(entity.billboard.verticalOrigin.getValue(time)).toEqual( - VerticalOrigin[packet.billboard.verticalOrigin] + VerticalOrigin[packet.billboard.verticalOrigin], ); expect(entity.billboard.color.getValue(time)).toEqual( - Color.unpack(packet.billboard.color.rgbaf) + Color.unpack(packet.billboard.color.rgbaf), ); expect(entity.billboard.eyeOffset.getValue(time)).toEqual( - Cartesian3.unpack(packet.billboard.eyeOffset.cartesian) + Cartesian3.unpack(packet.billboard.eyeOffset.cartesian), ); expect(entity.billboard.pixelOffset.getValue(time)).toEqual( - Cartesian2.unpack(packet.billboard.pixelOffset.cartesian2) + Cartesian2.unpack(packet.billboard.pixelOffset.cartesian2), ); expect(entity.billboard.alignedAxis.getValue(time)).toEqual( - Cartesian3.unpack(packet.billboard.alignedAxis.unitCartesian) + Cartesian3.unpack(packet.billboard.alignedAxis.unitCartesian), ); expect(entity.billboard.show.getValue(time)).toEqual( - packet.billboard.show + packet.billboard.show, ); expect(entity.billboard.sizeInMeters.getValue(time)).toEqual( - packet.billboard.sizeInMeters + packet.billboard.sizeInMeters, ); expect(entity.billboard.width.getValue(time)).toEqual( - packet.billboard.width + packet.billboard.width, ); expect(entity.billboard.height.getValue(time)).toEqual( - packet.billboard.height + packet.billboard.height, ); expect(entity.billboard.scaleByDistance.getValue(time)).toEqual( - NearFarScalar.unpack(packet.billboard.scaleByDistance.nearFarScalar) + NearFarScalar.unpack(packet.billboard.scaleByDistance.nearFarScalar), ); expect(entity.billboard.translucencyByDistance.getValue(time)).toEqual( NearFarScalar.unpack( - packet.billboard.translucencyByDistance.nearFarScalar - ) + packet.billboard.translucencyByDistance.nearFarScalar, + ), ); expect( - entity.billboard.pixelOffsetScaleByDistance.getValue(time) + entity.billboard.pixelOffsetScaleByDistance.getValue(time), ).toEqual( NearFarScalar.unpack( - packet.billboard.pixelOffsetScaleByDistance.nearFarScalar - ) + packet.billboard.pixelOffsetScaleByDistance.nearFarScalar, + ), ); expect(entity.billboard.imageSubRegion.getValue(time)).toEqual( BoundingRectangle.unpack( - packet.billboard.imageSubRegion.boundingRectangle - ) + packet.billboard.imageSubRegion.boundingRectangle, + ), ); }); }); @@ -607,16 +607,16 @@ describe("DataSources/CzmlDataSource", function () { const time = Iso8601.MINIMUM_VALUE; - return CzmlDataSource.load(makeDocument(packet)).then(function ( - dataSource - ) { - const entity = dataSource.entities.values[0]; + return CzmlDataSource.load(makeDocument(packet)).then( + function (dataSource) { + const entity = dataSource.entities.values[0]; - expect(entity.billboard).toBeDefined(); - expect(entity.billboard.alignedAxis.getValue(time)).toEqual( - Cartesian3.unpack(packet.billboard.alignedAxis.cartesian) - ); - }); + expect(entity.billboard).toBeDefined(); + expect(entity.billboard.alignedAxis.getValue(time)).toEqual( + Cartesian3.unpack(packet.billboard.alignedAxis.cartesian), + ); + }, + ); }); it("can handle aligned axis expressed as a velocity reference", function () { @@ -632,25 +632,25 @@ describe("DataSources/CzmlDataSource", function () { }, }; - return CzmlDataSource.load(makeDocument(packet)).then(function ( - dataSource - ) { - const entity = dataSource.entities.values[0]; - const property = entity.billboard.alignedAxis; + return CzmlDataSource.load(makeDocument(packet)).then( + function (dataSource) { + const entity = dataSource.entities.values[0]; + const property = entity.billboard.alignedAxis; - const expectedVelocity = new Cartesian3(1.0, 2.0, 3.0); - const expectedVelocityDirection = Cartesian3.normalize( - expectedVelocity, - new Cartesian3() - ); + const expectedVelocity = new Cartesian3(1.0, 2.0, 3.0); + const expectedVelocityDirection = Cartesian3.normalize( + expectedVelocity, + new Cartesian3(), + ); - expect( - property.getValue(JulianDate.fromIso8601("2016-06-17T12:00:00Z")) - ).toEqualEpsilon(expectedVelocityDirection, CesiumMath.EPSILON15); - expect( - property.getValue(JulianDate.fromIso8601("2016-06-17T12:00:30Z")) - ).toEqualEpsilon(expectedVelocityDirection, CesiumMath.EPSILON15); - }); + expect( + property.getValue(JulianDate.fromIso8601("2016-06-17T12:00:00Z")), + ).toEqualEpsilon(expectedVelocityDirection, CesiumMath.EPSILON15); + expect( + property.getValue(JulianDate.fromIso8601("2016-06-17T12:00:30Z")), + ).toEqualEpsilon(expectedVelocityDirection, CesiumMath.EPSILON15); + }, + ); }); it("can handle aligned axis expressed as a velocity reference within an interval", function () { @@ -673,33 +673,33 @@ describe("DataSources/CzmlDataSource", function () { }, }; - return CzmlDataSource.load(makeDocument(packet)).then(function ( - dataSource - ) { - const entity = dataSource.entities.values[0]; - const property = entity.billboard.alignedAxis; + return CzmlDataSource.load(makeDocument(packet)).then( + function (dataSource) { + const entity = dataSource.entities.values[0]; + const property = entity.billboard.alignedAxis; - const expected = new Cartesian3(0, 1, 0); - expect( - property.getValue(JulianDate.fromIso8601("2016-06-17T12:00:00Z")) - ).toEqual(expected); - expect( - property.getValue(JulianDate.fromIso8601("2016-06-17T12:00:29Z")) - ).toEqual(expected); + const expected = new Cartesian3(0, 1, 0); + expect( + property.getValue(JulianDate.fromIso8601("2016-06-17T12:00:00Z")), + ).toEqual(expected); + expect( + property.getValue(JulianDate.fromIso8601("2016-06-17T12:00:29Z")), + ).toEqual(expected); - const expectedVelocity = new Cartesian3(1.0, 2.0, 3.0); - const expectedVelocityDirection = Cartesian3.normalize( - expectedVelocity, - new Cartesian3() - ); + const expectedVelocity = new Cartesian3(1.0, 2.0, 3.0); + const expectedVelocityDirection = Cartesian3.normalize( + expectedVelocity, + new Cartesian3(), + ); - expect( - property.getValue(JulianDate.fromIso8601("2016-06-17T12:00:30Z")) - ).toEqualEpsilon(expectedVelocityDirection, CesiumMath.EPSILON15); - expect( - property.getValue(JulianDate.fromIso8601("2016-06-17T12:01:00Z")) - ).toEqualEpsilon(expectedVelocityDirection, CesiumMath.EPSILON12); - }); + expect( + property.getValue(JulianDate.fromIso8601("2016-06-17T12:00:30Z")), + ).toEqualEpsilon(expectedVelocityDirection, CesiumMath.EPSILON15); + expect( + property.getValue(JulianDate.fromIso8601("2016-06-17T12:01:00Z")), + ).toEqualEpsilon(expectedVelocityDirection, CesiumMath.EPSILON12); + }, + ); }); it("can handle image intervals both of type uri and image", function () { @@ -726,11 +726,11 @@ describe("DataSources/CzmlDataSource", function () { const imageProperty = entity.billboard.image; expect( imageProperty.getValue(JulianDate.fromIso8601("2013-01-01T00:00:00Z")) - .url + .url, ).toEqual(`${source}image.png`); expect( imageProperty.getValue(JulianDate.fromIso8601("2013-01-01T01:00:00Z")) - .url + .url, ).toEqual(`${source}image2.png`); }); }); @@ -761,53 +761,55 @@ describe("DataSources/CzmlDataSource", function () { }).start; const invalidTime = JulianDate.addSeconds(validTime, -1, new JulianDate()); - return CzmlDataSource.load(makeDocument(packet)).then(function ( - dataSource - ) { - const entity = dataSource.entities.values[0]; + return CzmlDataSource.load(makeDocument(packet)).then( + function (dataSource) { + const entity = dataSource.entities.values[0]; - expect(entity.billboard).toBeDefined(); - expect(entity.billboard.image.getValue(validTime).url).toEqual( - packet.billboard.image - ); - expect(entity.billboard.scale.getValue(validTime)).toEqual( - packet.billboard.scale - ); - expect(entity.billboard.horizontalOrigin.getValue(validTime)).toEqual( - HorizontalOrigin[packet.billboard.horizontalOrigin] - ); - expect(entity.billboard.verticalOrigin.getValue(validTime)).toEqual( - VerticalOrigin[packet.billboard.verticalOrigin] - ); - expect(entity.billboard.color.getValue(validTime)).toEqual( - Color.unpack(packet.billboard.color.rgbaf) - ); - expect(entity.billboard.eyeOffset.getValue(validTime)).toEqual( - Cartesian3.unpack(packet.billboard.eyeOffset.cartesian) - ); - expect(entity.billboard.pixelOffset.getValue(validTime)).toEqual( - Cartesian2.unpack(packet.billboard.pixelOffset.cartesian2) - ); - expect(entity.billboard.show.getValue(validTime)).toEqual( - packet.billboard.show - ); + expect(entity.billboard).toBeDefined(); + expect(entity.billboard.image.getValue(validTime).url).toEqual( + packet.billboard.image, + ); + expect(entity.billboard.scale.getValue(validTime)).toEqual( + packet.billboard.scale, + ); + expect(entity.billboard.horizontalOrigin.getValue(validTime)).toEqual( + HorizontalOrigin[packet.billboard.horizontalOrigin], + ); + expect(entity.billboard.verticalOrigin.getValue(validTime)).toEqual( + VerticalOrigin[packet.billboard.verticalOrigin], + ); + expect(entity.billboard.color.getValue(validTime)).toEqual( + Color.unpack(packet.billboard.color.rgbaf), + ); + expect(entity.billboard.eyeOffset.getValue(validTime)).toEqual( + Cartesian3.unpack(packet.billboard.eyeOffset.cartesian), + ); + expect(entity.billboard.pixelOffset.getValue(validTime)).toEqual( + Cartesian2.unpack(packet.billboard.pixelOffset.cartesian2), + ); + expect(entity.billboard.show.getValue(validTime)).toEqual( + packet.billboard.show, + ); - expect(entity.billboard).toBeDefined(); - expect(entity.billboard.image.getValue(invalidTime)).toBeUndefined(); - expect(entity.billboard.scale.getValue(invalidTime)).toBeUndefined(); - expect( - entity.billboard.horizontalOrigin.getValue(invalidTime) - ).toBeUndefined(); - expect( - entity.billboard.verticalOrigin.getValue(invalidTime) - ).toBeUndefined(); - expect(entity.billboard.color.getValue(invalidTime)).toBeUndefined(); - expect(entity.billboard.eyeOffset.getValue(invalidTime)).toBeUndefined(); - expect( - entity.billboard.pixelOffset.getValue(invalidTime) - ).toBeUndefined(); - expect(entity.billboard.show.getValue(invalidTime)).toBeUndefined(); - }); + expect(entity.billboard).toBeDefined(); + expect(entity.billboard.image.getValue(invalidTime)).toBeUndefined(); + expect(entity.billboard.scale.getValue(invalidTime)).toBeUndefined(); + expect( + entity.billboard.horizontalOrigin.getValue(invalidTime), + ).toBeUndefined(); + expect( + entity.billboard.verticalOrigin.getValue(invalidTime), + ).toBeUndefined(); + expect(entity.billboard.color.getValue(invalidTime)).toBeUndefined(); + expect( + entity.billboard.eyeOffset.getValue(invalidTime), + ).toBeUndefined(); + expect( + entity.billboard.pixelOffset.getValue(invalidTime), + ).toBeUndefined(); + expect(entity.billboard.show.getValue(invalidTime)).toBeUndefined(); + }, + ); }); it("can load interval data with further constrained intervals in subproperties", function () { @@ -848,41 +850,45 @@ describe("DataSources/CzmlDataSource", function () { }, }; - return CzmlDataSource.load(makeDocument(packet)).then(function ( - dataSource - ) { - const entity = dataSource.entities.values[0]; - - expect(entity.billboard).toBeDefined(); - expect(entity.ellipsoid).toBeDefined(); - - // before billboard interval: not defined, even though the scaleByDistance includes the time in its intervals - let time = JulianDate.fromIso8601("2009-01-01T00:00:00Z"); - expect(entity.billboard.scaleByDistance.getValue(time)).toBeUndefined(); - expect(entity.ellipsoid.material.getValue(time)).toBeUndefined(); + return CzmlDataSource.load(makeDocument(packet)).then( + function (dataSource) { + const entity = dataSource.entities.values[0]; - // within both billboard and scaleByDistance intervals - time = JulianDate.fromIso8601("2010-01-01T00:05:00Z"); - expect(entity.billboard.scaleByDistance.getValue(time)).toEqual( - NearFarScalar.unpack(packet.billboard.scaleByDistance[0].nearFarScalar) - ); - expect(entity.ellipsoid.material.getValue(time).color).toEqual( - Color.unpack(packet.ellipsoid.material[0].solidColor.color.rgbaf) - ); + expect(entity.billboard).toBeDefined(); + expect(entity.ellipsoid).toBeDefined(); + + // before billboard interval: not defined, even though the scaleByDistance includes the time in its intervals + let time = JulianDate.fromIso8601("2009-01-01T00:00:00Z"); + expect(entity.billboard.scaleByDistance.getValue(time)).toBeUndefined(); + expect(entity.ellipsoid.material.getValue(time)).toBeUndefined(); + + // within both billboard and scaleByDistance intervals + time = JulianDate.fromIso8601("2010-01-01T00:05:00Z"); + expect(entity.billboard.scaleByDistance.getValue(time)).toEqual( + NearFarScalar.unpack( + packet.billboard.scaleByDistance[0].nearFarScalar, + ), + ); + expect(entity.ellipsoid.material.getValue(time).color).toEqual( + Color.unpack(packet.ellipsoid.material[0].solidColor.color.rgbaf), + ); - time = JulianDate.fromIso8601("2010-01-01T00:35:00Z"); - expect(entity.billboard.scaleByDistance.getValue(time)).toEqual( - NearFarScalar.unpack(packet.billboard.scaleByDistance[1].nearFarScalar) - ); - expect(entity.ellipsoid.material.getValue(time).color).toEqual( - Color.unpack(packet.ellipsoid.material[1].solidColor.color.rgbaf) - ); + time = JulianDate.fromIso8601("2010-01-01T00:35:00Z"); + expect(entity.billboard.scaleByDistance.getValue(time)).toEqual( + NearFarScalar.unpack( + packet.billboard.scaleByDistance[1].nearFarScalar, + ), + ); + expect(entity.ellipsoid.material.getValue(time).color).toEqual( + Color.unpack(packet.ellipsoid.material[1].solidColor.color.rgbaf), + ); - // after billboard interval: not defined, even though the scaleByDistance includes the time in its intervals - time = JulianDate.fromIso8601("2010-01-03T00:00:00Z"); - expect(entity.billboard.scaleByDistance.getValue(time)).toBeUndefined(); - expect(entity.ellipsoid.material.getValue(time)).toBeUndefined(); - }); + // after billboard interval: not defined, even though the scaleByDistance includes the time in its intervals + time = JulianDate.fromIso8601("2010-01-03T00:00:00Z"); + expect(entity.billboard.scaleByDistance.getValue(time)).toBeUndefined(); + expect(entity.ellipsoid.material.getValue(time)).toBeUndefined(); + }, + ); }); it("can constrain a constant property by sending an interval in a subsequent packet", function () { @@ -915,18 +921,18 @@ describe("DataSources/CzmlDataSource", function () { expect(entity.billboard.scale).toBeInstanceOf(CompositeProperty); expect( entity.billboard.scale.getValue( - JulianDate.fromIso8601("2009-01-01T00:00:00Z") - ) + JulianDate.fromIso8601("2009-01-01T00:00:00Z"), + ), ).toEqual(constantPacket.billboard.scale); expect( entity.billboard.scale.getValue( - JulianDate.fromIso8601("2010-01-01T00:00:00Z") - ) + JulianDate.fromIso8601("2010-01-01T00:00:00Z"), + ), ).toEqual(intervalPacket.billboard.scale.number); expect( entity.billboard.scale.getValue( - JulianDate.fromIso8601("2011-01-01T00:00:00Z") - ) + JulianDate.fromIso8601("2011-01-01T00:00:00Z"), + ), ).toEqual(constantPacket.billboard.scale); }); }); @@ -958,24 +964,30 @@ describe("DataSources/CzmlDataSource", function () { expect(entity.position).toBeInstanceOf(CompositePositionProperty); expect( entity.position.getValue( - JulianDate.fromIso8601("2009-01-01T00:00:00Z") - ) + JulianDate.fromIso8601("2009-01-01T00:00:00Z"), + ), ).toEqual( - cartesianFromArrayDegrees(constantPacket.position.cartographicDegrees) + cartesianFromArrayDegrees( + constantPacket.position.cartographicDegrees, + ), ); expect( entity.position.getValue( - JulianDate.fromIso8601("2010-01-01T00:00:00Z") - ) + JulianDate.fromIso8601("2010-01-01T00:00:00Z"), + ), ).toEqual( - cartesianFromArrayDegrees(intervalPacket.position.cartographicDegrees) + cartesianFromArrayDegrees( + intervalPacket.position.cartographicDegrees, + ), ); expect( entity.position.getValue( - JulianDate.fromIso8601("2011-01-01T00:00:00Z") - ) + JulianDate.fromIso8601("2011-01-01T00:00:00Z"), + ), ).toEqual( - cartesianFromArrayDegrees(constantPacket.position.cartographicDegrees) + cartesianFromArrayDegrees( + constantPacket.position.cartographicDegrees, + ), ); }); }); @@ -1020,35 +1032,35 @@ describe("DataSources/CzmlDataSource", function () { expect(entity.billboard.scale).toBeInstanceOf(CompositeProperty); expect( entity.billboard.scale.getValue( - JulianDate.fromIso8601("2010-01-01T00:00:00Z") - ) + JulianDate.fromIso8601("2010-01-01T00:00:00Z"), + ), ).toEqual(1.0); expect( entity.billboard.scale.getValue( - JulianDate.fromIso8601("2010-01-01T00:20:00Z") - ) + JulianDate.fromIso8601("2010-01-01T00:20:00Z"), + ), ).toEqual(10.0); expect( entity.billboard.scale.getValue( - JulianDate.fromIso8601("2010-01-01T00:21:00Z") - ) + JulianDate.fromIso8601("2010-01-01T00:21:00Z"), + ), ).toEqual(15.0); expect( entity.billboard.scale.getValue( - JulianDate.fromIso8601("2010-01-01T00:22:00Z") - ) + JulianDate.fromIso8601("2010-01-01T00:22:00Z"), + ), ).toEqual(20.0); expect( entity.billboard.scale.getValue( - JulianDate.fromIso8601("2010-01-01T01:00:00Z") - ) + JulianDate.fromIso8601("2010-01-01T01:00:00Z"), + ), ).toEqual(2.0); expect( entity.billboard.scale.getValue( - JulianDate.fromIso8601("2010-01-01T02:00:00Z") - ) + JulianDate.fromIso8601("2010-01-01T02:00:00Z"), + ), ).toEqual(3.0); }); }); @@ -1100,33 +1112,33 @@ describe("DataSources/CzmlDataSource", function () { expect(entity.position).toBeInstanceOf(CompositePositionProperty); expect( entity.position.getValue( - JulianDate.fromIso8601("2010-01-01T00:00:00Z") - ) + JulianDate.fromIso8601("2010-01-01T00:00:00Z"), + ), ).toEqual(Cartesian3.fromDegrees(34, 117, 10000)); expect( entity.position.getValue( - JulianDate.fromIso8601("2010-01-01T00:20:00Z") - ) + JulianDate.fromIso8601("2010-01-01T00:20:00Z"), + ), ).toEqual(Cartesian3.fromDegrees(40, 100, 10000)); expect( entity.position.getValue( - JulianDate.fromIso8601("2010-01-01T00:21:00Z") - ) + JulianDate.fromIso8601("2010-01-01T00:21:00Z"), + ), ).toEqualEpsilon( Cartesian3.fromDegrees(40, 100, 15000), - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); expect( entity.position.getValue( - JulianDate.fromIso8601("2010-01-01T00:22:00Z") - ) + JulianDate.fromIso8601("2010-01-01T00:22:00Z"), + ), ).toEqual(Cartesian3.fromDegrees(40, 100, 20000)); expect( entity.position.getValue( - JulianDate.fromIso8601("2010-01-01T01:00:00Z") - ) + JulianDate.fromIso8601("2010-01-01T01:00:00Z"), + ), ).toEqual(Cartesian3.fromDegrees(34, 117, 20000)); }); }); @@ -1143,25 +1155,25 @@ describe("DataSources/CzmlDataSource", function () { }, }; - return CzmlDataSource.load(makeDocument(packet)).then(function ( - dataSource - ) { - const entity = dataSource.entities.values[0]; + return CzmlDataSource.load(makeDocument(packet)).then( + function (dataSource) { + const entity = dataSource.entities.values[0]; - expect(entity.billboard).toBeDefined(); - const date1 = epoch; - const date2 = JulianDate.addSeconds(epoch, 0.5, new JulianDate()); - const date3 = JulianDate.addSeconds(epoch, 1.0, new JulianDate()); - expect(entity.billboard.pixelOffset.getValue(date1)).toEqual( - new Cartesian2(1.0, 2.0) - ); - expect(entity.billboard.pixelOffset.getValue(date2)).toEqual( - new Cartesian2(2.0, 3.0) - ); - expect(entity.billboard.pixelOffset.getValue(date3)).toEqual( - new Cartesian2(3.0, 4.0) - ); - }); + expect(entity.billboard).toBeDefined(); + const date1 = epoch; + const date2 = JulianDate.addSeconds(epoch, 0.5, new JulianDate()); + const date3 = JulianDate.addSeconds(epoch, 1.0, new JulianDate()); + expect(entity.billboard.pixelOffset.getValue(date1)).toEqual( + new Cartesian2(1.0, 2.0), + ); + expect(entity.billboard.pixelOffset.getValue(date2)).toEqual( + new Cartesian2(2.0, 3.0), + ); + expect(entity.billboard.pixelOffset.getValue(date3)).toEqual( + new Cartesian2(3.0, 4.0), + ); + }, + ); }); it("can handle interval billboard scaleByDistance", function () { @@ -1180,27 +1192,31 @@ describe("DataSources/CzmlDataSource", function () { }, }; - return CzmlDataSource.load(makeDocument(packet)).then(function ( - dataSource - ) { - const entity = dataSource.entities.values[0]; + return CzmlDataSource.load(makeDocument(packet)).then( + function (dataSource) { + const entity = dataSource.entities.values[0]; - expect(entity.billboard).toBeDefined(); - expect( - entity.billboard.scaleByDistance.getValue( - JulianDate.fromIso8601("2013-01-01T00:00:00Z") - ) - ).toEqual( - NearFarScalar.unpack(packet.billboard.scaleByDistance[0].nearFarScalar) - ); - expect( - entity.billboard.scaleByDistance.getValue( - JulianDate.fromIso8601("2013-01-01T01:00:00Z") - ) - ).toEqual( - NearFarScalar.unpack(packet.billboard.scaleByDistance[1].nearFarScalar) - ); - }); + expect(entity.billboard).toBeDefined(); + expect( + entity.billboard.scaleByDistance.getValue( + JulianDate.fromIso8601("2013-01-01T00:00:00Z"), + ), + ).toEqual( + NearFarScalar.unpack( + packet.billboard.scaleByDistance[0].nearFarScalar, + ), + ); + expect( + entity.billboard.scaleByDistance.getValue( + JulianDate.fromIso8601("2013-01-01T01:00:00Z"), + ), + ).toEqual( + NearFarScalar.unpack( + packet.billboard.scaleByDistance[1].nearFarScalar, + ), + ); + }, + ); }); it("can handle sampled billboard scaleByDistance", function () { @@ -1215,25 +1231,25 @@ describe("DataSources/CzmlDataSource", function () { }, }; - return CzmlDataSource.load(makeDocument(packet)).then(function ( - dataSource - ) { - const entity = dataSource.entities.values[0]; + return CzmlDataSource.load(makeDocument(packet)).then( + function (dataSource) { + const entity = dataSource.entities.values[0]; - expect(entity.billboard).toBeDefined(); - const date1 = epoch; - const date2 = JulianDate.addSeconds(epoch, 1.0, new JulianDate()); - const date3 = JulianDate.addSeconds(epoch, 2.0, new JulianDate()); - expect(entity.billboard.scaleByDistance.getValue(date1)).toEqual( - new NearFarScalar(1.0, 2.0, 10000.0, 3.0) - ); - expect(entity.billboard.scaleByDistance.getValue(date2)).toEqual( - new NearFarScalar(1.5, 2.5, 15000.0, 3.5) - ); - expect(entity.billboard.scaleByDistance.getValue(date3)).toEqual( - new NearFarScalar(2.0, 3.0, 20000.0, 4.0) - ); - }); + expect(entity.billboard).toBeDefined(); + const date1 = epoch; + const date2 = JulianDate.addSeconds(epoch, 1.0, new JulianDate()); + const date3 = JulianDate.addSeconds(epoch, 2.0, new JulianDate()); + expect(entity.billboard.scaleByDistance.getValue(date1)).toEqual( + new NearFarScalar(1.0, 2.0, 10000.0, 3.0), + ); + expect(entity.billboard.scaleByDistance.getValue(date2)).toEqual( + new NearFarScalar(1.5, 2.5, 15000.0, 3.5), + ); + expect(entity.billboard.scaleByDistance.getValue(date3)).toEqual( + new NearFarScalar(2.0, 3.0, 20000.0, 4.0), + ); + }, + ); }); it("can handle sampled billboard color rgba.", function () { @@ -1248,25 +1264,25 @@ describe("DataSources/CzmlDataSource", function () { }, }; - return CzmlDataSource.load(makeDocument(packet)).then(function ( - dataSource - ) { - const entity = dataSource.entities.values[0]; + return CzmlDataSource.load(makeDocument(packet)).then( + function (dataSource) { + const entity = dataSource.entities.values[0]; - expect(entity.billboard).toBeDefined(); - const date1 = epoch; - const date2 = JulianDate.addSeconds(epoch, 1.0, new JulianDate()); - const date3 = JulianDate.addSeconds(epoch, 2.0, new JulianDate()); - expect(entity.billboard.color.getValue(date1)).toEqual( - Color.fromBytes(200, 202, 204, 206) - ); - expect(entity.billboard.color.getValue(date2)).toEqual( - Color.fromBytes(100, 101, 102, 103) - ); - expect(entity.billboard.color.getValue(date3)).toEqual( - Color.fromBytes(0, 0, 0, 0) - ); - }); + expect(entity.billboard).toBeDefined(); + const date1 = epoch; + const date2 = JulianDate.addSeconds(epoch, 1.0, new JulianDate()); + const date3 = JulianDate.addSeconds(epoch, 2.0, new JulianDate()); + expect(entity.billboard.color.getValue(date1)).toEqual( + Color.fromBytes(200, 202, 204, 206), + ); + expect(entity.billboard.color.getValue(date2)).toEqual( + Color.fromBytes(100, 101, 102, 103), + ); + expect(entity.billboard.color.getValue(date3)).toEqual( + Color.fromBytes(0, 0, 0, 0), + ); + }, + ); }); it("can handle clock data.", function () { @@ -1292,7 +1308,7 @@ describe("DataSources/CzmlDataSource", function () { expect(clock.startTime).toEqual(interval.start); expect(clock.stopTime).toEqual(interval.stop); expect(clock.currentTime).toEqual( - JulianDate.fromIso8601(documentPacket.clock.currentTime) + JulianDate.fromIso8601(documentPacket.clock.currentTime), ); expect(clock.clockRange).toEqual(ClockRange[documentPacket.clock.range]); expect(clock.clockStep).toEqual(ClockStep[documentPacket.clock.step]); @@ -1307,15 +1323,15 @@ describe("DataSources/CzmlDataSource", function () { }, }; - return CzmlDataSource.load(makeDocument(packet)).then(function ( - dataSource - ) { - const entity = dataSource.entities.values[0]; - const resultCartesian = entity.position.getValue(JulianDate.now()); - expect(resultCartesian).toEqual( - cartesianFromArrayDegrees(packet.position.cartographicDegrees) - ); - }); + return CzmlDataSource.load(makeDocument(packet)).then( + function (dataSource) { + const entity = dataSource.entities.values[0]; + const resultCartesian = entity.position.getValue(JulianDate.now()); + expect(resultCartesian).toEqual( + cartesianFromArrayDegrees(packet.position.cartographicDegrees), + ); + }, + ); }); it("can handle position specified as constant cartographicsDegrees with non-standard ellipsoid", async function () { @@ -1333,8 +1349,8 @@ describe("DataSources/CzmlDataSource", function () { cartesianFromArrayDegrees( packet.position.cartographicDegrees, 0, - Ellipsoid.default - ) + Ellipsoid.default, + ), ); Ellipsoid.default = Ellipsoid.WGS84; }); @@ -1353,14 +1369,14 @@ describe("DataSources/CzmlDataSource", function () { const entity = dataSource.entities.values[0]; let resultCartesian = entity.position.getValue(epoch); expect(resultCartesian).toEqual( - cartesianFromArrayDegrees(packet.position.cartographicDegrees, 1) + cartesianFromArrayDegrees(packet.position.cartographicDegrees, 1), ); resultCartesian = entity.position.getValue( - JulianDate.addSeconds(epoch, 1, new JulianDate()) + JulianDate.addSeconds(epoch, 1, new JulianDate()), ); expect(resultCartesian).toEqual( - cartesianFromArrayDegrees(packet.position.cartographicDegrees, 5) + cartesianFromArrayDegrees(packet.position.cartographicDegrees, 5), ); }); @@ -1387,12 +1403,12 @@ describe("DataSources/CzmlDataSource", function () { const entity = dataSource.entities.values[0]; let resultCartesian = entity.position.getValue(firstDate); expect(resultCartesian).toEqual( - cartesianFromArrayDegrees(packet.position.cartographicDegrees, 1) + cartesianFromArrayDegrees(packet.position.cartographicDegrees, 1), ); resultCartesian = entity.position.getValue(lastDate); expect(resultCartesian).toEqual( - cartesianFromArrayDegrees(packet.position.cartographicDegrees, 5) + cartesianFromArrayDegrees(packet.position.cartographicDegrees, 5), ); }); @@ -1407,7 +1423,7 @@ describe("DataSources/CzmlDataSource", function () { const entity = dataSource.entities.values[0]; const resultCartesian = entity.position.getValue(JulianDate.now()); expect(resultCartesian).toEqual( - cartesianFromArrayRadians(packet.position.cartographicRadians) + cartesianFromArrayRadians(packet.position.cartographicRadians), ); }); @@ -1426,8 +1442,8 @@ describe("DataSources/CzmlDataSource", function () { cartesianFromArrayRadians( packet.position.cartographicRadians, 0, - Ellipsoid.default - ) + Ellipsoid.default, + ), ); Ellipsoid.default = Ellipsoid.WGS84; }); @@ -1442,22 +1458,22 @@ describe("DataSources/CzmlDataSource", function () { }, }; - return CzmlDataSource.load(makeDocument(packet)).then(function ( - dataSource - ) { - const entity = dataSource.entities.values[0]; - let resultCartesian = entity.position.getValue(epoch); - expect(resultCartesian).toEqual( - cartesianFromArrayRadians(packet.position.cartographicRadians, 1) - ); + return CzmlDataSource.load(makeDocument(packet)).then( + function (dataSource) { + const entity = dataSource.entities.values[0]; + let resultCartesian = entity.position.getValue(epoch); + expect(resultCartesian).toEqual( + cartesianFromArrayRadians(packet.position.cartographicRadians, 1), + ); - resultCartesian = entity.position.getValue( - JulianDate.addSeconds(epoch, 1, new JulianDate()) - ); - expect(resultCartesian).toEqual( - cartesianFromArrayRadians(packet.position.cartographicRadians, 5) - ); - }); + resultCartesian = entity.position.getValue( + JulianDate.addSeconds(epoch, 1, new JulianDate()), + ); + expect(resultCartesian).toEqual( + cartesianFromArrayRadians(packet.position.cartographicRadians, 5), + ); + }, + ); }); it("can set position reference frame", function () { @@ -1504,12 +1520,12 @@ describe("DataSources/CzmlDataSource", function () { }, }; - return CzmlDataSource.load(makeDocument(packet)).then(function ( - dataSource - ) { - const entity = dataSource.entities.values[0]; - expect(entity.position.referenceFrame).toEqual(ReferenceFrame.FIXED); - }); + return CzmlDataSource.load(makeDocument(packet)).then( + function (dataSource) { + const entity = dataSource.entities.values[0]; + expect(entity.position.referenceFrame).toEqual(ReferenceFrame.FIXED); + }, + ); }); it("does not reset value to FIXED when omitting reference frame on subsequent packet", function () { @@ -1562,16 +1578,16 @@ describe("DataSources/CzmlDataSource", function () { }, }; - return CzmlDataSource.load(makeDocument(packet)).then(function ( - dataSource - ) { - const entity = dataSource.entities.values[0]; + return CzmlDataSource.load(makeDocument(packet)).then( + function (dataSource) { + const entity = dataSource.entities.values[0]; - expect(entity.ellipse).toBeDefined(); - expect(entity.ellipse.semiMajorAxis.getValue(firstDate)).toEqual(0); - expect(entity.ellipse.semiMajorAxis.getValue(midDate)).toEqual(5); - expect(entity.ellipse.semiMajorAxis.getValue(lastDate)).toEqual(10); - }); + expect(entity.ellipse).toBeDefined(); + expect(entity.ellipse.semiMajorAxis.getValue(firstDate)).toEqual(0); + expect(entity.ellipse.semiMajorAxis.getValue(midDate)).toEqual(5); + expect(entity.ellipse.semiMajorAxis.getValue(lastDate)).toEqual(10); + }, + ); }); it("can load a direction specified as constant unitSpherical", function () { @@ -1583,17 +1599,17 @@ describe("DataSources/CzmlDataSource", function () { }, }; - return CzmlDataSource.load(makeDocument(packet)).then(function ( - dataSource - ) { - const entity = dataSource.entities.values[0]; - const resultCartesian = entity.billboard.alignedAxis.getValue( - JulianDate.now() - ); - expect(resultCartesian).toEqual( - Cartesian3.fromSpherical(new Spherical(1.0, 2.0)) - ); - }); + return CzmlDataSource.load(makeDocument(packet)).then( + function (dataSource) { + const entity = dataSource.entities.values[0]; + const resultCartesian = entity.billboard.alignedAxis.getValue( + JulianDate.now(), + ); + expect(resultCartesian).toEqual( + Cartesian3.fromSpherical(new Spherical(1.0, 2.0)), + ); + }, + ); }); it("can load a direction specified as sampled unitSpherical", function () { @@ -1608,22 +1624,22 @@ describe("DataSources/CzmlDataSource", function () { }, }; - return CzmlDataSource.load(makeDocument(packet)).then(function ( - dataSource - ) { - const entity = dataSource.entities.values[0]; - let resultCartesian = entity.billboard.alignedAxis.getValue(epoch); - expect(resultCartesian).toEqual( - Cartesian3.fromSpherical(new Spherical(1.0, 2.0)) - ); + return CzmlDataSource.load(makeDocument(packet)).then( + function (dataSource) { + const entity = dataSource.entities.values[0]; + let resultCartesian = entity.billboard.alignedAxis.getValue(epoch); + expect(resultCartesian).toEqual( + Cartesian3.fromSpherical(new Spherical(1.0, 2.0)), + ); - resultCartesian = entity.billboard.alignedAxis.getValue( - JulianDate.addSeconds(epoch, 1, new JulianDate()) - ); - expect(resultCartesian).toEqual( - Cartesian3.fromSpherical(new Spherical(-1.0, -2.0)) - ); - }); + resultCartesian = entity.billboard.alignedAxis.getValue( + JulianDate.addSeconds(epoch, 1, new JulianDate()), + ); + expect(resultCartesian).toEqual( + Cartesian3.fromSpherical(new Spherical(-1.0, -2.0)), + ); + }, + ); }); it("can load a direction specified as constant spherical", function () { @@ -1635,17 +1651,19 @@ describe("DataSources/CzmlDataSource", function () { }, }; - return CzmlDataSource.load(makeDocument(packet)).then(function ( - dataSource - ) { - const entity = dataSource.entities.values[0]; - const resultCartesian = entity.billboard.alignedAxis.getValue( - JulianDate.now() - ); - const expected = Cartesian3.fromSpherical(new Spherical(1.0, 2.0, 30.0)); - Cartesian3.normalize(expected, expected); - expect(resultCartesian).toEqual(expected); - }); + return CzmlDataSource.load(makeDocument(packet)).then( + function (dataSource) { + const entity = dataSource.entities.values[0]; + const resultCartesian = entity.billboard.alignedAxis.getValue( + JulianDate.now(), + ); + const expected = Cartesian3.fromSpherical( + new Spherical(1.0, 2.0, 30.0), + ); + Cartesian3.normalize(expected, expected); + expect(resultCartesian).toEqual(expected); + }, + ); }); it("can load a direction specified as sampled spherical", function () { @@ -1660,22 +1678,22 @@ describe("DataSources/CzmlDataSource", function () { }, }; - return CzmlDataSource.load(makeDocument(packet)).then(function ( - dataSource - ) { - const entity = dataSource.entities.values[0]; - let resultCartesian = entity.billboard.alignedAxis.getValue(epoch); - let expected = Cartesian3.fromSpherical(new Spherical(1.0, 2.0, 30.0)); - Cartesian3.normalize(expected, expected); - expect(resultCartesian).toEqual(expected); + return CzmlDataSource.load(makeDocument(packet)).then( + function (dataSource) { + const entity = dataSource.entities.values[0]; + let resultCartesian = entity.billboard.alignedAxis.getValue(epoch); + let expected = Cartesian3.fromSpherical(new Spherical(1.0, 2.0, 30.0)); + Cartesian3.normalize(expected, expected); + expect(resultCartesian).toEqual(expected); - resultCartesian = entity.billboard.alignedAxis.getValue( - JulianDate.addSeconds(epoch, 1, new JulianDate()) - ); - expected = Cartesian3.fromSpherical(new Spherical(-1.0, -2.0, 40.0)); - Cartesian3.normalize(expected, expected); - expect(resultCartesian).toEqual(expected); - }); + resultCartesian = entity.billboard.alignedAxis.getValue( + JulianDate.addSeconds(epoch, 1, new JulianDate()), + ); + expected = Cartesian3.fromSpherical(new Spherical(-1.0, -2.0, 40.0)); + Cartesian3.normalize(expected, expected); + expect(resultCartesian).toEqual(expected); + }, + ); }); it("can load constant data for ellipse", function () { @@ -1697,40 +1715,40 @@ describe("DataSources/CzmlDataSource", function () { const time = Iso8601.MINIMUM_VALUE; - return CzmlDataSource.load(makeDocument(packet)).then(function ( - dataSource - ) { - const entity = dataSource.entities.values[0]; + return CzmlDataSource.load(makeDocument(packet)).then( + function (dataSource) { + const entity = dataSource.entities.values[0]; - expect(entity.ellipse).toBeDefined(); - expect(entity.ellipse.semiMajorAxis.getValue(time)).toEqual( - packet.ellipse.semiMajorAxis - ); - expect(entity.ellipse.semiMinorAxis.getValue(time)).toEqual( - packet.ellipse.semiMinorAxis - ); - expect(entity.ellipse.rotation.getValue(time)).toEqual( - packet.ellipse.rotation - ); - expect(entity.ellipse.outline.getValue(time)).toEqual( - packet.ellipse.outline - ); - expect(entity.ellipse.outlineColor.getValue(time)).toEqual( - Color.unpack(packet.ellipse.outlineColor.rgbaf) - ); - expect(entity.ellipse.outlineWidth.getValue(time)).toEqual( - packet.ellipse.outlineWidth - ); - expect(entity.ellipse.shadows.getValue(time)).toEqual( - ShadowMode[packet.ellipse.shadows] - ); - expect(entity.ellipse.zIndex.getValue(time)).toEqual( - packet.ellipse.zIndex - ); - expect(entity.ellipse.classificationType.getValue(time)).toEqual( - ClassificationType[packet.ellipse.classificationType] - ); - }); + expect(entity.ellipse).toBeDefined(); + expect(entity.ellipse.semiMajorAxis.getValue(time)).toEqual( + packet.ellipse.semiMajorAxis, + ); + expect(entity.ellipse.semiMinorAxis.getValue(time)).toEqual( + packet.ellipse.semiMinorAxis, + ); + expect(entity.ellipse.rotation.getValue(time)).toEqual( + packet.ellipse.rotation, + ); + expect(entity.ellipse.outline.getValue(time)).toEqual( + packet.ellipse.outline, + ); + expect(entity.ellipse.outlineColor.getValue(time)).toEqual( + Color.unpack(packet.ellipse.outlineColor.rgbaf), + ); + expect(entity.ellipse.outlineWidth.getValue(time)).toEqual( + packet.ellipse.outlineWidth, + ); + expect(entity.ellipse.shadows.getValue(time)).toEqual( + ShadowMode[packet.ellipse.shadows], + ); + expect(entity.ellipse.zIndex.getValue(time)).toEqual( + packet.ellipse.zIndex, + ); + expect(entity.ellipse.classificationType.getValue(time)).toEqual( + ClassificationType[packet.ellipse.classificationType], + ); + }, + ); }); it("can load interval data for ellipse", function () { @@ -1744,43 +1762,43 @@ describe("DataSources/CzmlDataSource", function () { }, }; - return CzmlDataSource.load(makeDocument(packet)).then(function ( - dataSource - ) { - const entity = dataSource.entities.values[0]; + return CzmlDataSource.load(makeDocument(packet)).then( + function (dataSource) { + const entity = dataSource.entities.values[0]; - const validTime = TimeInterval.fromIso8601({ - iso8601: packet.ellipse.interval, - }).start; - const invalidTime = JulianDate.addSeconds( - validTime, - -1, - new JulianDate() - ); + const validTime = TimeInterval.fromIso8601({ + iso8601: packet.ellipse.interval, + }).start; + const invalidTime = JulianDate.addSeconds( + validTime, + -1, + new JulianDate(), + ); - expect(entity.ellipse).toBeDefined(); - expect(entity.ellipse.semiMajorAxis.getValue(validTime)).toEqual( - packet.ellipse.semiMajorAxis - ); - expect(entity.ellipse.semiMinorAxis.getValue(validTime)).toEqual( - packet.ellipse.semiMinorAxis - ); - expect(entity.ellipse.rotation.getValue(validTime)).toEqual( - packet.ellipse.rotation - ); - expect(entity.ellipse.shadows.getValue(validTime)).toEqual( - ShadowMode[packet.ellipse.shadows] - ); + expect(entity.ellipse).toBeDefined(); + expect(entity.ellipse.semiMajorAxis.getValue(validTime)).toEqual( + packet.ellipse.semiMajorAxis, + ); + expect(entity.ellipse.semiMinorAxis.getValue(validTime)).toEqual( + packet.ellipse.semiMinorAxis, + ); + expect(entity.ellipse.rotation.getValue(validTime)).toEqual( + packet.ellipse.rotation, + ); + expect(entity.ellipse.shadows.getValue(validTime)).toEqual( + ShadowMode[packet.ellipse.shadows], + ); - expect( - entity.ellipse.semiMajorAxis.getValue(invalidTime) - ).toBeUndefined(); - expect( - entity.ellipse.semiMinorAxis.getValue(invalidTime) - ).toBeUndefined(); - expect(entity.ellipse.rotation.getValue(invalidTime)).toBeUndefined(); - expect(entity.ellipse.shadows.getValue(invalidTime)).toBeUndefined(); - }); + expect( + entity.ellipse.semiMajorAxis.getValue(invalidTime), + ).toBeUndefined(); + expect( + entity.ellipse.semiMinorAxis.getValue(invalidTime), + ).toBeUndefined(); + expect(entity.ellipse.rotation.getValue(invalidTime)).toBeUndefined(); + expect(entity.ellipse.shadows.getValue(invalidTime)).toBeUndefined(); + }, + ); }); it("can load constant data for ellipsoid", function () { @@ -1811,43 +1829,43 @@ describe("DataSources/CzmlDataSource", function () { const time = Iso8601.MINIMUM_VALUE; - return CzmlDataSource.load(makeDocument(packet)).then(function ( - dataSource - ) { - const entity = dataSource.entities.values[0]; + return CzmlDataSource.load(makeDocument(packet)).then( + function (dataSource) { + const entity = dataSource.entities.values[0]; - expect(entity.ellipsoid).toBeDefined(); - expect(entity.ellipsoid.radii.getValue(time)).toEqual( - Cartesian3.unpack(packet.ellipsoid.radii.cartesian) - ); - expect(entity.ellipsoid.show.getValue(time)).toEqual( - packet.ellipsoid.show - ); - expect(entity.ellipsoid.material.getValue(time).color).toEqual( - Color.unpack(packet.ellipsoid.material.solidColor.color.rgbaf) - ); - expect(entity.ellipsoid.outline.getValue(time)).toEqual( - packet.ellipsoid.outline - ); - expect(entity.ellipsoid.outlineColor.getValue(time)).toEqual( - Color.unpack(packet.ellipsoid.outlineColor.rgbaf) - ); - expect(entity.ellipsoid.outlineWidth.getValue(time)).toEqual( - packet.ellipsoid.outlineWidth - ); - expect(entity.ellipsoid.stackPartitions.getValue(time)).toEqual( - packet.ellipsoid.stackPartitions - ); - expect(entity.ellipsoid.slicePartitions.getValue(time)).toEqual( - packet.ellipsoid.slicePartitions - ); - expect(entity.ellipsoid.subdivisions.getValue(time)).toEqual( - packet.ellipsoid.subdivisions - ); - expect(entity.ellipsoid.shadows.getValue(time)).toEqual( - ShadowMode[packet.ellipsoid.shadows] - ); - }); + expect(entity.ellipsoid).toBeDefined(); + expect(entity.ellipsoid.radii.getValue(time)).toEqual( + Cartesian3.unpack(packet.ellipsoid.radii.cartesian), + ); + expect(entity.ellipsoid.show.getValue(time)).toEqual( + packet.ellipsoid.show, + ); + expect(entity.ellipsoid.material.getValue(time).color).toEqual( + Color.unpack(packet.ellipsoid.material.solidColor.color.rgbaf), + ); + expect(entity.ellipsoid.outline.getValue(time)).toEqual( + packet.ellipsoid.outline, + ); + expect(entity.ellipsoid.outlineColor.getValue(time)).toEqual( + Color.unpack(packet.ellipsoid.outlineColor.rgbaf), + ); + expect(entity.ellipsoid.outlineWidth.getValue(time)).toEqual( + packet.ellipsoid.outlineWidth, + ); + expect(entity.ellipsoid.stackPartitions.getValue(time)).toEqual( + packet.ellipsoid.stackPartitions, + ); + expect(entity.ellipsoid.slicePartitions.getValue(time)).toEqual( + packet.ellipsoid.slicePartitions, + ); + expect(entity.ellipsoid.subdivisions.getValue(time)).toEqual( + packet.ellipsoid.subdivisions, + ); + expect(entity.ellipsoid.shadows.getValue(time)).toEqual( + ShadowMode[packet.ellipsoid.shadows], + ); + }, + ); }); it("can load interval data for ellipsoid", function () { @@ -1874,30 +1892,30 @@ describe("DataSources/CzmlDataSource", function () { }).start; const invalidTime = JulianDate.addSeconds(validTime, -1, new JulianDate()); - return CzmlDataSource.load(makeDocument(packet)).then(function ( - dataSource - ) { - const entity = dataSource.entities.values[0]; + return CzmlDataSource.load(makeDocument(packet)).then( + function (dataSource) { + const entity = dataSource.entities.values[0]; - expect(entity.ellipsoid).toBeDefined(); - expect(entity.ellipsoid.radii.getValue(validTime)).toEqual( - Cartesian3.unpack(packet.ellipsoid.radii.cartesian) - ); - expect(entity.ellipsoid.show.getValue(validTime)).toEqual( - packet.ellipsoid.show - ); - expect(entity.ellipsoid.material.getValue(validTime).color).toEqual( - Color.unpack(packet.ellipsoid.material.solidColor.color.rgbaf) - ); - expect(entity.ellipsoid.shadows.getValue(validTime)).toEqual( - ShadowMode[packet.ellipsoid.shadows] - ); + expect(entity.ellipsoid).toBeDefined(); + expect(entity.ellipsoid.radii.getValue(validTime)).toEqual( + Cartesian3.unpack(packet.ellipsoid.radii.cartesian), + ); + expect(entity.ellipsoid.show.getValue(validTime)).toEqual( + packet.ellipsoid.show, + ); + expect(entity.ellipsoid.material.getValue(validTime).color).toEqual( + Color.unpack(packet.ellipsoid.material.solidColor.color.rgbaf), + ); + expect(entity.ellipsoid.shadows.getValue(validTime)).toEqual( + ShadowMode[packet.ellipsoid.shadows], + ); - expect(entity.ellipsoid.radii.getValue(invalidTime)).toBeUndefined(); - expect(entity.ellipsoid.show.getValue(invalidTime)).toBeUndefined(); - expect(entity.ellipsoid.material.getValue(invalidTime)).toBeUndefined(); - expect(entity.ellipsoid.shadows.getValue(invalidTime)).toBeUndefined(); - }); + expect(entity.ellipsoid.radii.getValue(invalidTime)).toBeUndefined(); + expect(entity.ellipsoid.show.getValue(invalidTime)).toBeUndefined(); + expect(entity.ellipsoid.material.getValue(invalidTime)).toBeUndefined(); + expect(entity.ellipsoid.shadows.getValue(invalidTime)).toBeUndefined(); + }, + ); }); it("can load constant data for label", function () { @@ -1934,49 +1952,51 @@ describe("DataSources/CzmlDataSource", function () { const time = Iso8601.MINIMUM_VALUE; - return CzmlDataSource.load(makeDocument(packet)).then(function ( - dataSource - ) { - const entity = dataSource.entities.values[0]; + return CzmlDataSource.load(makeDocument(packet)).then( + function (dataSource) { + const entity = dataSource.entities.values[0]; - expect(entity.label).toBeDefined(); - expect(entity.label.text.getValue(time)).toEqual(packet.label.text); - expect(entity.label.font.getValue(time)).toEqual(packet.label.font); - expect(entity.label.style.getValue(time)).toEqual( - LabelStyle[packet.label.style] - ); - expect(entity.label.fillColor.getValue(time)).toEqual( - Color.unpack(packet.label.fillColor.rgbaf) - ); - expect(entity.label.outlineColor.getValue(time)).toEqual( - Color.unpack(packet.label.outlineColor.rgbaf) - ); - expect(entity.label.outlineWidth.getValue(time)).toEqual( - packet.label.outlineWidth - ); - expect(entity.label.horizontalOrigin.getValue(time)).toEqual( - HorizontalOrigin[packet.label.horizontalOrigin] - ); - expect(entity.label.verticalOrigin.getValue(time)).toEqual( - VerticalOrigin[packet.label.verticalOrigin] - ); - expect(entity.label.eyeOffset.getValue(time)).toEqual( - Cartesian3.unpack(packet.label.eyeOffset.cartesian) - ); - expect(entity.label.pixelOffset.getValue(time)).toEqual( - Cartesian2.unpack(packet.label.pixelOffset.cartesian2) - ); - expect(entity.label.scale.getValue(time)).toEqual(packet.label.scale); - expect(entity.label.show.getValue(time)).toEqual(packet.label.show); - expect(entity.label.translucencyByDistance.getValue(time)).toEqual( - NearFarScalar.unpack(packet.label.translucencyByDistance.nearFarScalar) - ); - expect(entity.label.pixelOffsetScaleByDistance.getValue(time)).toEqual( - NearFarScalar.unpack( - packet.label.pixelOffsetScaleByDistance.nearFarScalar - ) - ); - }); + expect(entity.label).toBeDefined(); + expect(entity.label.text.getValue(time)).toEqual(packet.label.text); + expect(entity.label.font.getValue(time)).toEqual(packet.label.font); + expect(entity.label.style.getValue(time)).toEqual( + LabelStyle[packet.label.style], + ); + expect(entity.label.fillColor.getValue(time)).toEqual( + Color.unpack(packet.label.fillColor.rgbaf), + ); + expect(entity.label.outlineColor.getValue(time)).toEqual( + Color.unpack(packet.label.outlineColor.rgbaf), + ); + expect(entity.label.outlineWidth.getValue(time)).toEqual( + packet.label.outlineWidth, + ); + expect(entity.label.horizontalOrigin.getValue(time)).toEqual( + HorizontalOrigin[packet.label.horizontalOrigin], + ); + expect(entity.label.verticalOrigin.getValue(time)).toEqual( + VerticalOrigin[packet.label.verticalOrigin], + ); + expect(entity.label.eyeOffset.getValue(time)).toEqual( + Cartesian3.unpack(packet.label.eyeOffset.cartesian), + ); + expect(entity.label.pixelOffset.getValue(time)).toEqual( + Cartesian2.unpack(packet.label.pixelOffset.cartesian2), + ); + expect(entity.label.scale.getValue(time)).toEqual(packet.label.scale); + expect(entity.label.show.getValue(time)).toEqual(packet.label.show); + expect(entity.label.translucencyByDistance.getValue(time)).toEqual( + NearFarScalar.unpack( + packet.label.translucencyByDistance.nearFarScalar, + ), + ); + expect(entity.label.pixelOffsetScaleByDistance.getValue(time)).toEqual( + NearFarScalar.unpack( + packet.label.pixelOffsetScaleByDistance.nearFarScalar, + ), + ); + }, + ); }); it("can load interval data for label", function () { @@ -2011,58 +2031,66 @@ describe("DataSources/CzmlDataSource", function () { }).start; const invalidTime = JulianDate.addSeconds(validTime, -1, new JulianDate()); - return CzmlDataSource.load(makeDocument(packet)).then(function ( - dataSource - ) { - const entity = dataSource.entities.values[0]; + return CzmlDataSource.load(makeDocument(packet)).then( + function (dataSource) { + const entity = dataSource.entities.values[0]; - expect(entity.label).toBeDefined(); - expect(entity.label.text.getValue(validTime)).toEqual(packet.label.text); - expect(entity.label.font.getValue(validTime)).toEqual(packet.label.font); - expect(entity.label.style.getValue(validTime)).toEqual( - LabelStyle[packet.label.style] - ); - expect(entity.label.fillColor.getValue(validTime)).toEqual( - Color.unpack(packet.label.fillColor.rgbaf) - ); - expect(entity.label.outlineColor.getValue(validTime)).toEqual( - Color.unpack(packet.label.outlineColor.rgbaf) - ); - expect(entity.label.outlineWidth.getValue(validTime)).toEqual( - packet.label.outlineWidth - ); - expect(entity.label.horizontalOrigin.getValue(validTime)).toEqual( - HorizontalOrigin[packet.label.horizontalOrigin] - ); - expect(entity.label.verticalOrigin.getValue(validTime)).toEqual( - VerticalOrigin[packet.label.verticalOrigin] - ); - expect(entity.label.eyeOffset.getValue(validTime)).toEqual( - Cartesian3.unpack(packet.label.eyeOffset.cartesian) - ); - expect(entity.label.pixelOffset.getValue(validTime)).toEqual( - Cartesian2.unpack(packet.label.pixelOffset.cartesian2) - ); - expect(entity.label.scale.getValue(validTime)).toEqual( - packet.label.scale - ); - expect(entity.label.show.getValue(validTime)).toEqual(packet.label.show); - - expect(entity.label.text.getValue(invalidTime)).toBeUndefined(); - expect(entity.label.font.getValue(invalidTime)).toBeUndefined(); - expect(entity.label.style.getValue(invalidTime)).toBeUndefined(); - expect(entity.label.fillColor.getValue(invalidTime)).toBeUndefined(); - expect(entity.label.outlineColor.getValue(invalidTime)).toBeUndefined(); - expect(entity.label.outlineWidth.getValue(invalidTime)).toBeUndefined(); - expect( - entity.label.horizontalOrigin.getValue(invalidTime) - ).toBeUndefined(); - expect(entity.label.verticalOrigin.getValue(invalidTime)).toBeUndefined(); - expect(entity.label.eyeOffset.getValue(invalidTime)).toBeUndefined(); - expect(entity.label.pixelOffset.getValue(invalidTime)).toBeUndefined(); - expect(entity.label.scale.getValue(invalidTime)).toBeUndefined(); - expect(entity.label.show.getValue(invalidTime)).toBeUndefined(); - }); + expect(entity.label).toBeDefined(); + expect(entity.label.text.getValue(validTime)).toEqual( + packet.label.text, + ); + expect(entity.label.font.getValue(validTime)).toEqual( + packet.label.font, + ); + expect(entity.label.style.getValue(validTime)).toEqual( + LabelStyle[packet.label.style], + ); + expect(entity.label.fillColor.getValue(validTime)).toEqual( + Color.unpack(packet.label.fillColor.rgbaf), + ); + expect(entity.label.outlineColor.getValue(validTime)).toEqual( + Color.unpack(packet.label.outlineColor.rgbaf), + ); + expect(entity.label.outlineWidth.getValue(validTime)).toEqual( + packet.label.outlineWidth, + ); + expect(entity.label.horizontalOrigin.getValue(validTime)).toEqual( + HorizontalOrigin[packet.label.horizontalOrigin], + ); + expect(entity.label.verticalOrigin.getValue(validTime)).toEqual( + VerticalOrigin[packet.label.verticalOrigin], + ); + expect(entity.label.eyeOffset.getValue(validTime)).toEqual( + Cartesian3.unpack(packet.label.eyeOffset.cartesian), + ); + expect(entity.label.pixelOffset.getValue(validTime)).toEqual( + Cartesian2.unpack(packet.label.pixelOffset.cartesian2), + ); + expect(entity.label.scale.getValue(validTime)).toEqual( + packet.label.scale, + ); + expect(entity.label.show.getValue(validTime)).toEqual( + packet.label.show, + ); + + expect(entity.label.text.getValue(invalidTime)).toBeUndefined(); + expect(entity.label.font.getValue(invalidTime)).toBeUndefined(); + expect(entity.label.style.getValue(invalidTime)).toBeUndefined(); + expect(entity.label.fillColor.getValue(invalidTime)).toBeUndefined(); + expect(entity.label.outlineColor.getValue(invalidTime)).toBeUndefined(); + expect(entity.label.outlineWidth.getValue(invalidTime)).toBeUndefined(); + expect( + entity.label.horizontalOrigin.getValue(invalidTime), + ).toBeUndefined(); + expect( + entity.label.verticalOrigin.getValue(invalidTime), + ).toBeUndefined(); + expect(entity.label.eyeOffset.getValue(invalidTime)).toBeUndefined(); + expect(entity.label.pixelOffset.getValue(invalidTime)).toBeUndefined(); + expect(entity.label.scale.getValue(invalidTime)).toBeUndefined(); + expect(entity.label.show.getValue(invalidTime)).toBeUndefined(); + }, + ); }); it("can handle sampled label pixelOffset.", function () { @@ -2077,21 +2105,21 @@ describe("DataSources/CzmlDataSource", function () { }, }; - return CzmlDataSource.load(makeDocument(packet)).then(function ( - dataSource - ) { - const entity = dataSource.entities.values[0]; + return CzmlDataSource.load(makeDocument(packet)).then( + function (dataSource) { + const entity = dataSource.entities.values[0]; - expect(entity.label).toBeDefined(); - const date1 = epoch; - const date2 = JulianDate.addSeconds(epoch, 1.0, new JulianDate()); - expect(entity.label.pixelOffset.getValue(date1)).toEqual( - new Cartesian2(1.0, 2.0) - ); - expect(entity.label.pixelOffset.getValue(date2)).toEqual( - new Cartesian2(3.0, 4.0) - ); - }); + expect(entity.label).toBeDefined(); + const date1 = epoch; + const date2 = JulianDate.addSeconds(epoch, 1.0, new JulianDate()); + expect(entity.label.pixelOffset.getValue(date1)).toEqual( + new Cartesian2(1.0, 2.0), + ); + expect(entity.label.pixelOffset.getValue(date2)).toEqual( + new Cartesian2(3.0, 4.0), + ); + }, + ); }); it("can load position", function () { @@ -2103,14 +2131,14 @@ describe("DataSources/CzmlDataSource", function () { const time = Iso8601.MINIMUM_VALUE; - return CzmlDataSource.load(makeDocument(packet)).then(function ( - dataSource - ) { - const entity = dataSource.entities.values[0]; - expect(entity.position.getValue(time)).toEqual( - Cartesian3.unpack(packet.position.cartesian) - ); - }); + return CzmlDataSource.load(makeDocument(packet)).then( + function (dataSource) { + const entity = dataSource.entities.values[0]; + expect(entity.position.getValue(time)).toEqual( + Cartesian3.unpack(packet.position.cartesian), + ); + }, + ); }); it("can load orientation", function () { @@ -2122,14 +2150,14 @@ describe("DataSources/CzmlDataSource", function () { const time = Iso8601.MINIMUM_VALUE; - return CzmlDataSource.load(makeDocument(packet)).then(function ( - dataSource - ) { - const entity = dataSource.entities.values[0]; - expect(entity.orientation.getValue(time)).toEqual( - Quaternion.unpack(packet.orientation.unitQuaternion) - ); - }); + return CzmlDataSource.load(makeDocument(packet)).then( + function (dataSource) { + const entity = dataSource.entities.values[0]; + expect(entity.orientation.getValue(time)).toEqual( + Quaternion.unpack(packet.orientation.unitQuaternion), + ); + }, + ); }); it("normalizes constant orientation on load", function () { @@ -2144,12 +2172,12 @@ describe("DataSources/CzmlDataSource", function () { const time = Iso8601.MINIMUM_VALUE; - return CzmlDataSource.load(makeDocument(packet)).then(function ( - dataSource - ) { - const entity = dataSource.entities.values[0]; - expect(entity.orientation.getValue(time)).toEqual(expected); - }); + return CzmlDataSource.load(makeDocument(packet)).then( + function (dataSource) { + const entity = dataSource.entities.values[0]; + expect(entity.orientation.getValue(time)).toEqual(expected); + }, + ); }); it("normalizes sampled orientation on load", function () { @@ -2178,17 +2206,17 @@ describe("DataSources/CzmlDataSource", function () { const expected2 = Quaternion.unpack(packet.orientation.unitQuaternion, 6); Quaternion.normalize(expected2, expected2); - return CzmlDataSource.load(makeDocument(packet)).then(function ( - dataSource - ) { - const entity = dataSource.entities.values[0]; - expect( - entity.orientation.getValue(JulianDate.fromIso8601(time1)) - ).toEqual(expected1); - expect( - entity.orientation.getValue(JulianDate.fromIso8601(time2)) - ).toEqual(expected2); - }); + return CzmlDataSource.load(makeDocument(packet)).then( + function (dataSource) { + const entity = dataSource.entities.values[0]; + expect( + entity.orientation.getValue(JulianDate.fromIso8601(time1)), + ).toEqual(expected1); + expect( + entity.orientation.getValue(JulianDate.fromIso8601(time2)), + ).toEqual(expected2); + }, + ); }); it("can handle orientation expressed as a velocity reference", function () { @@ -2202,34 +2230,33 @@ describe("DataSources/CzmlDataSource", function () { }, }; - return CzmlDataSource.load(makeDocument(packet)).then(function ( - dataSource - ) { - const entity = dataSource.entities.values[0]; - const property = entity.orientation; + return CzmlDataSource.load(makeDocument(packet)).then( + function (dataSource) { + const entity = dataSource.entities.values[0]; + const property = entity.orientation; - const expectedVelocity = new Cartesian3(1.0, 2.0, 3.0); - const expectedVelocityDirection = Cartesian3.normalize( - expectedVelocity, - new Cartesian3() - ); + const expectedVelocity = new Cartesian3(1.0, 2.0, 3.0); + const expectedVelocityDirection = Cartesian3.normalize( + expectedVelocity, + new Cartesian3(), + ); - const expectedPosition = new Cartesian3(1, 2, 3); - const expectedRotation = Transforms.rotationMatrixFromPositionVelocity( - expectedPosition, - expectedVelocityDirection - ); - const expectedOrientation = Quaternion.fromRotationMatrix( - expectedRotation - ); + const expectedPosition = new Cartesian3(1, 2, 3); + const expectedRotation = Transforms.rotationMatrixFromPositionVelocity( + expectedPosition, + expectedVelocityDirection, + ); + const expectedOrientation = + Quaternion.fromRotationMatrix(expectedRotation); - expect( - property.getValue(JulianDate.fromIso8601("2016-06-17T12:00:00Z")) - ).toEqualEpsilon(expectedOrientation, CesiumMath.EPSILON15); - expect( - property.getValue(JulianDate.fromIso8601("2016-06-17T12:00:30Z")) - ).toEqualEpsilon(expectedOrientation, CesiumMath.EPSILON15); - }); + expect( + property.getValue(JulianDate.fromIso8601("2016-06-17T12:00:00Z")), + ).toEqualEpsilon(expectedOrientation, CesiumMath.EPSILON15); + expect( + property.getValue(JulianDate.fromIso8601("2016-06-17T12:00:30Z")), + ).toEqualEpsilon(expectedOrientation, CesiumMath.EPSILON15); + }, + ); }); it("can load positions expressed as cartesians", function () { @@ -2243,14 +2270,14 @@ describe("DataSources/CzmlDataSource", function () { const time = Iso8601.MINIMUM_VALUE; - return CzmlDataSource.load(makeDocument(packet)).then(function ( - dataSource - ) { - const entity = dataSource.entities.values[0]; - expect(entity.polyline.positions.getValue(time)).toEqual( - Cartesian3.unpackArray(packet.polyline.positions.cartesian) - ); - }); + return CzmlDataSource.load(makeDocument(packet)).then( + function (dataSource) { + const entity = dataSource.entities.values[0]; + expect(entity.polyline.positions.getValue(time)).toEqual( + Cartesian3.unpackArray(packet.polyline.positions.cartesian), + ); + }, + ); }); it("can load positions expressed as cartographicRadians", function () { @@ -2264,16 +2291,16 @@ describe("DataSources/CzmlDataSource", function () { const time = Iso8601.MINIMUM_VALUE; - return CzmlDataSource.load(makeDocument(packet)).then(function ( - dataSource - ) { - const entity = dataSource.entities.values[0]; - expect(entity.polyline.positions.getValue(time)).toEqual( - Cartesian3.fromRadiansArrayHeights( - packet.polyline.positions.cartographicRadians - ) - ); - }); + return CzmlDataSource.load(makeDocument(packet)).then( + function (dataSource) { + const entity = dataSource.entities.values[0]; + expect(entity.polyline.positions.getValue(time)).toEqual( + Cartesian3.fromRadiansArrayHeights( + packet.polyline.positions.cartographicRadians, + ), + ); + }, + ); }); it("can load positions expressed as cartographicDegrees", function () { @@ -2287,16 +2314,16 @@ describe("DataSources/CzmlDataSource", function () { const time = Iso8601.MINIMUM_VALUE; - return CzmlDataSource.load(makeDocument(packet)).then(function ( - dataSource - ) { - const entity = dataSource.entities.values[0]; - expect(entity.polyline.positions.getValue(time)).toEqual( - Cartesian3.fromDegreesArrayHeights( - packet.polyline.positions.cartographicDegrees - ) - ); - }); + return CzmlDataSource.load(makeDocument(packet)).then( + function (dataSource) { + const entity = dataSource.entities.values[0]; + expect(entity.polyline.positions.getValue(time)).toEqual( + Cartesian3.fromDegreesArrayHeights( + packet.polyline.positions.cartographicDegrees, + ), + ); + }, + ); }); it("can load viewFrom", function () { @@ -2308,14 +2335,14 @@ describe("DataSources/CzmlDataSource", function () { const time = Iso8601.MINIMUM_VALUE; - return CzmlDataSource.load(makeDocument(packet)).then(function ( - dataSource - ) { - const entity = dataSource.entities.values[0]; - expect(entity.viewFrom.getValue(time)).toEqual( - Cartesian3.unpack(packet.viewFrom.cartesian) - ); - }); + return CzmlDataSource.load(makeDocument(packet)).then( + function (dataSource) { + const entity = dataSource.entities.values[0]; + expect(entity.viewFrom.getValue(time)).toEqual( + Cartesian3.unpack(packet.viewFrom.cartesian), + ); + }, + ); }); it("can load description", function () { @@ -2325,12 +2352,12 @@ describe("DataSources/CzmlDataSource", function () { const time = Iso8601.MINIMUM_VALUE; - return CzmlDataSource.load(makeDocument(packet)).then(function ( - dataSource - ) { - const entity = dataSource.entities.values[0]; - expect(entity.description.getValue(time)).toEqual(packet.description); - }); + return CzmlDataSource.load(makeDocument(packet)).then( + function (dataSource) { + const entity = dataSource.entities.values[0]; + expect(entity.description.getValue(time)).toEqual(packet.description); + }, + ); }); it("can load constant custom properties", function () { @@ -2357,23 +2384,23 @@ describe("DataSources/CzmlDataSource", function () { const time = Iso8601.MINIMUM_VALUE; - return CzmlDataSource.load(makeDocument(packet)).then(function ( - dataSource - ) { - const entity = dataSource.entities.values[0]; - expect(entity.properties.constant_name.getValue(time)).toEqual( - packet.properties.constant_name - ); - expect(entity.properties.constant_height.getValue(time)).toEqual( - packet.properties.constant_height - ); - expect(entity.properties.constant_object.getValue(time)).toEqual( - testObject - ); - expect(entity.properties.constant_array.getValue(time)).toEqual( - testArray - ); - }); + return CzmlDataSource.load(makeDocument(packet)).then( + function (dataSource) { + const entity = dataSource.entities.values[0]; + expect(entity.properties.constant_name.getValue(time)).toEqual( + packet.properties.constant_name, + ); + expect(entity.properties.constant_height.getValue(time)).toEqual( + packet.properties.constant_height, + ); + expect(entity.properties.constant_object.getValue(time)).toEqual( + testObject, + ); + expect(entity.properties.constant_array.getValue(time)).toEqual( + testArray, + ); + }, + ); }); it("can load custom properties which are constant with specified type", function () { @@ -2403,23 +2430,23 @@ describe("DataSources/CzmlDataSource", function () { const time = Iso8601.MINIMUM_VALUE; - return CzmlDataSource.load(makeDocument(packet)).then(function ( - dataSource - ) { - const entity = dataSource.entities.values[0]; - expect(entity.properties.constant_name.getValue(time)).toEqual( - packet.properties.constant_name.string - ); - expect(entity.properties.constant_height.getValue(time)).toEqual( - packet.properties.constant_height.number - ); - expect(entity.properties.constant_object.getValue(time)).toEqual( - testObject - ); - expect(entity.properties.constant_array.getValue(time)).toEqual( - testArray - ); - }); + return CzmlDataSource.load(makeDocument(packet)).then( + function (dataSource) { + const entity = dataSource.entities.values[0]; + expect(entity.properties.constant_name.getValue(time)).toEqual( + packet.properties.constant_name.string, + ); + expect(entity.properties.constant_height.getValue(time)).toEqual( + packet.properties.constant_height.number, + ); + expect(entity.properties.constant_object.getValue(time)).toEqual( + testObject, + ); + expect(entity.properties.constant_array.getValue(time)).toEqual( + testArray, + ); + }, + ); }); it("can load custom properties with one interval", function () { @@ -2432,18 +2459,22 @@ describe("DataSources/CzmlDataSource", function () { }, }; - return CzmlDataSource.load(makeDocument(packet)).then(function ( - dataSource - ) { - const entity = dataSource.entities.values[0]; + return CzmlDataSource.load(makeDocument(packet)).then( + function (dataSource) { + const entity = dataSource.entities.values[0]; - expect( - entity.properties.changing_name.getValue(JulianDate.fromIso8601("2013")) - ).toEqual(packet.properties.changing_name.value); - expect( - entity.properties.changing_name.getValue(JulianDate.fromIso8601("2015")) - ).toBeUndefined(); - }); + expect( + entity.properties.changing_name.getValue( + JulianDate.fromIso8601("2013"), + ), + ).toEqual(packet.properties.changing_name.value); + expect( + entity.properties.changing_name.getValue( + JulianDate.fromIso8601("2015"), + ), + ).toBeUndefined(); + }, + ); }); it("can load custom properties with one interval with specified type", function () { @@ -2456,18 +2487,22 @@ describe("DataSources/CzmlDataSource", function () { }, }; - return CzmlDataSource.load(makeDocument(packet)).then(function ( - dataSource - ) { - const entity = dataSource.entities.values[0]; + return CzmlDataSource.load(makeDocument(packet)).then( + function (dataSource) { + const entity = dataSource.entities.values[0]; - expect( - entity.properties.changing_name.getValue(JulianDate.fromIso8601("2013")) - ).toEqual(packet.properties.changing_name.string); - expect( - entity.properties.changing_name.getValue(JulianDate.fromIso8601("2015")) - ).toBeUndefined(); - }); + expect( + entity.properties.changing_name.getValue( + JulianDate.fromIso8601("2013"), + ), + ).toEqual(packet.properties.changing_name.string); + expect( + entity.properties.changing_name.getValue( + JulianDate.fromIso8601("2015"), + ), + ).toBeUndefined(); + }, + ); }); it("can load custom properties with multiple intervals", function () { @@ -2488,22 +2523,22 @@ describe("DataSources/CzmlDataSource", function () { }, }; - return CzmlDataSource.load(makeDocument(packet)).then(function ( - dataSource - ) { - const entity = dataSource.entities.values[0]; + return CzmlDataSource.load(makeDocument(packet)).then( + function (dataSource) { + const entity = dataSource.entities.values[0]; - expect( - entity.properties.changing_array.getValue( - JulianDate.fromIso8601("2012-06-01") - ) - ).toEqual(array1); - expect( - entity.properties.changing_array.getValue( - JulianDate.fromIso8601("2013-06-01") - ) - ).toEqual(array2); - }); + expect( + entity.properties.changing_array.getValue( + JulianDate.fromIso8601("2012-06-01"), + ), + ).toEqual(array1); + expect( + entity.properties.changing_array.getValue( + JulianDate.fromIso8601("2013-06-01"), + ), + ).toEqual(array2); + }, + ); }); it("can load boolean custom properties with multiple intervals", function () { @@ -2527,30 +2562,30 @@ describe("DataSources/CzmlDataSource", function () { }, }; - return CzmlDataSource.load(makeDocument(packet)).then(function ( - dataSource - ) { - const entity = dataSource.entities.getById("MyID"); - expect(entity).toBeDefined(); - expect(entity.properties).toBeDefined(); - expect(entity.properties.custom_boolean).toBeDefined(); + return CzmlDataSource.load(makeDocument(packet)).then( + function (dataSource) { + const entity = dataSource.entities.getById("MyID"); + expect(entity).toBeDefined(); + expect(entity.properties).toBeDefined(); + expect(entity.properties.custom_boolean).toBeDefined(); - expect( - entity.properties.custom_boolean.getValue( - JulianDate.fromIso8601("2012-04-02T12:00:00Z") - ) - ).toEqual(true); - expect( - entity.properties.custom_boolean.getValue( - JulianDate.fromIso8601("2012-04-02T12:00:01Z") - ) - ).toEqual(false); - expect( - entity.properties.custom_boolean.getValue( - JulianDate.fromIso8601("2012-04-02T12:00:02Z") - ) - ).toEqual(true); - }); + expect( + entity.properties.custom_boolean.getValue( + JulianDate.fromIso8601("2012-04-02T12:00:00Z"), + ), + ).toEqual(true); + expect( + entity.properties.custom_boolean.getValue( + JulianDate.fromIso8601("2012-04-02T12:00:01Z"), + ), + ).toEqual(false); + expect( + entity.properties.custom_boolean.getValue( + JulianDate.fromIso8601("2012-04-02T12:00:02Z"), + ), + ).toEqual(true); + }, + ); }); it("can load custom properties with multiple intervals with specified type", function () { @@ -2571,22 +2606,22 @@ describe("DataSources/CzmlDataSource", function () { }, }; - return CzmlDataSource.load(makeDocument(packet)).then(function ( - dataSource - ) { - const entity = dataSource.entities.values[0]; + return CzmlDataSource.load(makeDocument(packet)).then( + function (dataSource) { + const entity = dataSource.entities.values[0]; - expect( - entity.properties.changing_array.getValue( - JulianDate.fromIso8601("2012-06-01") - ) - ).toEqual(array1); - expect( - entity.properties.changing_array.getValue( - JulianDate.fromIso8601("2013-06-01") - ) - ).toEqual(array2); - }); + expect( + entity.properties.changing_array.getValue( + JulianDate.fromIso8601("2012-06-01"), + ), + ).toEqual(array1); + expect( + entity.properties.changing_array.getValue( + JulianDate.fromIso8601("2013-06-01"), + ), + ).toEqual(array2); + }, + ); }); it("can load sampled custom properties", function () { @@ -2600,42 +2635,42 @@ describe("DataSources/CzmlDataSource", function () { }, }; - return CzmlDataSource.load(makeDocument(packet)).then(function ( - dataSource - ) { - const entity = dataSource.entities.getById("MyID"); + return CzmlDataSource.load(makeDocument(packet)).then( + function (dataSource) { + const entity = dataSource.entities.getById("MyID"); - expect(entity).toBeDefined(); - expect(entity.properties).toBeDefined(); - expect(entity.properties.custom_cartesian).toBeDefined(); + expect(entity).toBeDefined(); + expect(entity.properties).toBeDefined(); + expect(entity.properties.custom_cartesian).toBeDefined(); - expect( - entity.properties.custom_cartesian.getValue( - JulianDate.fromIso8601("2012-04-02T12:00:00Z") - ) - ).toBeInstanceOf(Cartesian3); - expect( - entity.properties.custom_cartesian.getValue( - JulianDate.fromIso8601("2012-04-02T12:00:00Z") - ) - ).toEqual(new Cartesian3(1, 2, 3)); - // halfway between two samples, linearly interpolated - expect( - entity.properties.custom_cartesian.getValue( - JulianDate.fromIso8601("2012-04-02T12:00:30Z") - ) - ).toEqual(new Cartesian3((1 + 4) / 2, (2 + 5) / 2, (3 + 6) / 2)); - expect( - entity.properties.custom_cartesian.getValue( - JulianDate.fromIso8601("2012-04-02T12:01:00Z") - ) - ).toEqual(new Cartesian3(4, 5, 6)); - expect( - entity.properties.custom_cartesian.getValue( - JulianDate.fromIso8601("2012-04-02T12:02:00Z") - ) - ).toEqual(new Cartesian3(7, 8, 9)); - }); + expect( + entity.properties.custom_cartesian.getValue( + JulianDate.fromIso8601("2012-04-02T12:00:00Z"), + ), + ).toBeInstanceOf(Cartesian3); + expect( + entity.properties.custom_cartesian.getValue( + JulianDate.fromIso8601("2012-04-02T12:00:00Z"), + ), + ).toEqual(new Cartesian3(1, 2, 3)); + // halfway between two samples, linearly interpolated + expect( + entity.properties.custom_cartesian.getValue( + JulianDate.fromIso8601("2012-04-02T12:00:30Z"), + ), + ).toEqual(new Cartesian3((1 + 4) / 2, (2 + 5) / 2, (3 + 6) / 2)); + expect( + entity.properties.custom_cartesian.getValue( + JulianDate.fromIso8601("2012-04-02T12:01:00Z"), + ), + ).toEqual(new Cartesian3(4, 5, 6)); + expect( + entity.properties.custom_cartesian.getValue( + JulianDate.fromIso8601("2012-04-02T12:02:00Z"), + ), + ).toEqual(new Cartesian3(7, 8, 9)); + }, + ); }); it("can load various types of custom properties", function () { @@ -2754,264 +2789,279 @@ describe("DataSources/CzmlDataSource", function () { }, }; - return CzmlDataSource.load(makeDocument(packet)).then(function ( - dataSource - ) { - const entity = dataSource.entities.getById("MyID"); + return CzmlDataSource.load(makeDocument(packet)).then( + function (dataSource) { + const entity = dataSource.entities.getById("MyID"); - expect(entity).toBeDefined(); - expect(entity.properties).toBeDefined(); + expect(entity).toBeDefined(); + expect(entity.properties).toBeDefined(); - const time1 = JulianDate.fromIso8601("2012-06-01"); - const time2 = JulianDate.fromIso8601("2013-06-01"); + const time1 = JulianDate.fromIso8601("2012-06-01"); + const time2 = JulianDate.fromIso8601("2013-06-01"); - expect(entity.properties.custom_array_constant).toBeDefined(); - expect( - entity.properties.custom_array_constant.getValue(time1) - ).toBeInstanceOf(Array); - expect(entity.properties.custom_array_constant.getValue(time1)).toEqual( - packet.properties.custom_array_constant.array - ); + expect(entity.properties.custom_array_constant).toBeDefined(); + expect( + entity.properties.custom_array_constant.getValue(time1), + ).toBeInstanceOf(Array); + expect(entity.properties.custom_array_constant.getValue(time1)).toEqual( + packet.properties.custom_array_constant.array, + ); - expect(entity.properties.custom_array_interval).toBeDefined(); - expect( - entity.properties.custom_array_interval.getValue(time1) - ).toBeInstanceOf(Array); - expect(entity.properties.custom_array_interval.getValue(time1)).toEqual( - packet.properties.custom_array_interval[0].array - ); - expect(entity.properties.custom_array_interval.getValue(time2)).toEqual( - packet.properties.custom_array_interval[1].array - ); + expect(entity.properties.custom_array_interval).toBeDefined(); + expect( + entity.properties.custom_array_interval.getValue(time1), + ).toBeInstanceOf(Array); + expect(entity.properties.custom_array_interval.getValue(time1)).toEqual( + packet.properties.custom_array_interval[0].array, + ); + expect(entity.properties.custom_array_interval.getValue(time2)).toEqual( + packet.properties.custom_array_interval[1].array, + ); - expect(entity.properties.custom_boolean_constant).toBeDefined(); - expect(entity.properties.custom_boolean_constant.getValue(time1)).toEqual( - packet.properties.custom_boolean_constant.boolean - ); + expect(entity.properties.custom_boolean_constant).toBeDefined(); + expect( + entity.properties.custom_boolean_constant.getValue(time1), + ).toEqual(packet.properties.custom_boolean_constant.boolean); - expect(entity.properties.custom_boolean_interval).toBeDefined(); - expect(entity.properties.custom_boolean_interval.getValue(time1)).toEqual( - packet.properties.custom_boolean_interval[0].boolean - ); - expect(entity.properties.custom_boolean_interval.getValue(time2)).toEqual( - packet.properties.custom_boolean_interval[1].boolean - ); + expect(entity.properties.custom_boolean_interval).toBeDefined(); + expect( + entity.properties.custom_boolean_interval.getValue(time1), + ).toEqual(packet.properties.custom_boolean_interval[0].boolean); + expect( + entity.properties.custom_boolean_interval.getValue(time2), + ).toEqual(packet.properties.custom_boolean_interval[1].boolean); - expect(entity.properties.custom_boundingRectangle_constant).toBeDefined(); - expect( - entity.properties.custom_boundingRectangle_constant.getValue(time1) - ).toBeInstanceOf(BoundingRectangle); - expect( - entity.properties.custom_boundingRectangle_constant.getValue(time1) - ).toEqual( - BoundingRectangle.unpack( - packet.properties.custom_boundingRectangle_constant.boundingRectangle - ) - ); + expect( + entity.properties.custom_boundingRectangle_constant, + ).toBeDefined(); + expect( + entity.properties.custom_boundingRectangle_constant.getValue(time1), + ).toBeInstanceOf(BoundingRectangle); + expect( + entity.properties.custom_boundingRectangle_constant.getValue(time1), + ).toEqual( + BoundingRectangle.unpack( + packet.properties.custom_boundingRectangle_constant + .boundingRectangle, + ), + ); - expect(entity.properties.custom_boundingRectangle_interval).toBeDefined(); - expect( - entity.properties.custom_boundingRectangle_interval.getValue(time1) - ).toBeInstanceOf(BoundingRectangle); - expect( - entity.properties.custom_boundingRectangle_interval.getValue(time1) - ).toEqual( - BoundingRectangle.unpack( - packet.properties.custom_boundingRectangle_interval[0] - .boundingRectangle - ) - ); - expect( - entity.properties.custom_boundingRectangle_interval.getValue(time2) - ).toEqual( - BoundingRectangle.unpack( - packet.properties.custom_boundingRectangle_interval[1] - .boundingRectangle - ) - ); + expect( + entity.properties.custom_boundingRectangle_interval, + ).toBeDefined(); + expect( + entity.properties.custom_boundingRectangle_interval.getValue(time1), + ).toBeInstanceOf(BoundingRectangle); + expect( + entity.properties.custom_boundingRectangle_interval.getValue(time1), + ).toEqual( + BoundingRectangle.unpack( + packet.properties.custom_boundingRectangle_interval[0] + .boundingRectangle, + ), + ); + expect( + entity.properties.custom_boundingRectangle_interval.getValue(time2), + ).toEqual( + BoundingRectangle.unpack( + packet.properties.custom_boundingRectangle_interval[1] + .boundingRectangle, + ), + ); - expect(entity.properties.custom_boundingRectangle_sampled).toBeDefined(); - expect( - entity.properties.custom_boundingRectangle_sampled.getValue(time1) - ).toBeInstanceOf(BoundingRectangle); - expect( - entity.properties.custom_boundingRectangle_sampled.getValue(time1) - ).toEqual( - BoundingRectangle.unpack( - packet.properties.custom_boundingRectangle_sampled.boundingRectangle, - 0 + 1 - ) - ); - expect( - entity.properties.custom_boundingRectangle_sampled.getValue( - JulianDate.addSeconds(time1, 60, new JulianDate()) - ) - ).toEqual( - BoundingRectangle.unpack( - packet.properties.custom_boundingRectangle_sampled.boundingRectangle, - 4 + 2 - ) - ); + expect( + entity.properties.custom_boundingRectangle_sampled, + ).toBeDefined(); + expect( + entity.properties.custom_boundingRectangle_sampled.getValue(time1), + ).toBeInstanceOf(BoundingRectangle); + expect( + entity.properties.custom_boundingRectangle_sampled.getValue(time1), + ).toEqual( + BoundingRectangle.unpack( + packet.properties.custom_boundingRectangle_sampled + .boundingRectangle, + 0 + 1, + ), + ); + expect( + entity.properties.custom_boundingRectangle_sampled.getValue( + JulianDate.addSeconds(time1, 60, new JulianDate()), + ), + ).toEqual( + BoundingRectangle.unpack( + packet.properties.custom_boundingRectangle_sampled + .boundingRectangle, + 4 + 2, + ), + ); - expect(entity.properties.custom_cartesian2_constant).toBeDefined(); - expect( - entity.properties.custom_cartesian2_constant.getValue(time1) - ).toBeInstanceOf(Cartesian2); - expect( - entity.properties.custom_cartesian2_constant.getValue(time1) - ).toEqual( - Cartesian2.unpack( - packet.properties.custom_cartesian2_constant.cartesian2 - ) - ); + expect(entity.properties.custom_cartesian2_constant).toBeDefined(); + expect( + entity.properties.custom_cartesian2_constant.getValue(time1), + ).toBeInstanceOf(Cartesian2); + expect( + entity.properties.custom_cartesian2_constant.getValue(time1), + ).toEqual( + Cartesian2.unpack( + packet.properties.custom_cartesian2_constant.cartesian2, + ), + ); - expect(entity.properties.custom_cartesian2_interval).toBeDefined(); - expect( - entity.properties.custom_cartesian2_interval.getValue(time1) - ).toBeInstanceOf(Cartesian2); - expect( - entity.properties.custom_cartesian2_interval.getValue(time1) - ).toEqual( - Cartesian2.unpack( - packet.properties.custom_cartesian2_interval[0].cartesian2 - ) - ); - expect( - entity.properties.custom_cartesian2_interval.getValue(time2) - ).toEqual( - Cartesian2.unpack( - packet.properties.custom_cartesian2_interval[1].cartesian2 - ) - ); + expect(entity.properties.custom_cartesian2_interval).toBeDefined(); + expect( + entity.properties.custom_cartesian2_interval.getValue(time1), + ).toBeInstanceOf(Cartesian2); + expect( + entity.properties.custom_cartesian2_interval.getValue(time1), + ).toEqual( + Cartesian2.unpack( + packet.properties.custom_cartesian2_interval[0].cartesian2, + ), + ); + expect( + entity.properties.custom_cartesian2_interval.getValue(time2), + ).toEqual( + Cartesian2.unpack( + packet.properties.custom_cartesian2_interval[1].cartesian2, + ), + ); - expect(entity.properties.custom_cartesian2_sampled).toBeDefined(); - expect( - entity.properties.custom_cartesian2_sampled.getValue(time1) - ).toBeInstanceOf(Cartesian2); - expect( - entity.properties.custom_cartesian2_sampled.getValue(time1) - ).toEqual( - Cartesian2.unpack( - packet.properties.custom_cartesian2_sampled.cartesian2, - 0 + 1 - ) - ); - expect( - entity.properties.custom_cartesian2_sampled.getValue( - JulianDate.addSeconds(time1, 60, new JulianDate()) - ) - ).toEqual( - Cartesian2.unpack( - packet.properties.custom_cartesian2_sampled.cartesian2, - 2 + 2 - ) - ); + expect(entity.properties.custom_cartesian2_sampled).toBeDefined(); + expect( + entity.properties.custom_cartesian2_sampled.getValue(time1), + ).toBeInstanceOf(Cartesian2); + expect( + entity.properties.custom_cartesian2_sampled.getValue(time1), + ).toEqual( + Cartesian2.unpack( + packet.properties.custom_cartesian2_sampled.cartesian2, + 0 + 1, + ), + ); + expect( + entity.properties.custom_cartesian2_sampled.getValue( + JulianDate.addSeconds(time1, 60, new JulianDate()), + ), + ).toEqual( + Cartesian2.unpack( + packet.properties.custom_cartesian2_sampled.cartesian2, + 2 + 2, + ), + ); - expect(entity.properties.custom_cartesian_constant).toBeDefined(); - expect( - entity.properties.custom_cartesian_constant.getValue(time1) - ).toBeInstanceOf(Cartesian3); - expect( - entity.properties.custom_cartesian_constant.getValue(time1) - ).toEqual( - Cartesian3.unpack(packet.properties.custom_cartesian_constant.cartesian) - ); + expect(entity.properties.custom_cartesian_constant).toBeDefined(); + expect( + entity.properties.custom_cartesian_constant.getValue(time1), + ).toBeInstanceOf(Cartesian3); + expect( + entity.properties.custom_cartesian_constant.getValue(time1), + ).toEqual( + Cartesian3.unpack( + packet.properties.custom_cartesian_constant.cartesian, + ), + ); - expect(entity.properties.custom_cartesian_interval).toBeDefined(); - expect( - entity.properties.custom_cartesian_interval.getValue(time1) - ).toBeInstanceOf(Cartesian3); - expect( - entity.properties.custom_cartesian_interval.getValue(time1) - ).toEqual( - Cartesian3.unpack( - packet.properties.custom_cartesian_interval[0].cartesian - ) - ); - expect( - entity.properties.custom_cartesian_interval.getValue(time2) - ).toEqual( - Cartesian3.unpack( - packet.properties.custom_cartesian_interval[1].cartesian - ) - ); + expect(entity.properties.custom_cartesian_interval).toBeDefined(); + expect( + entity.properties.custom_cartesian_interval.getValue(time1), + ).toBeInstanceOf(Cartesian3); + expect( + entity.properties.custom_cartesian_interval.getValue(time1), + ).toEqual( + Cartesian3.unpack( + packet.properties.custom_cartesian_interval[0].cartesian, + ), + ); + expect( + entity.properties.custom_cartesian_interval.getValue(time2), + ).toEqual( + Cartesian3.unpack( + packet.properties.custom_cartesian_interval[1].cartesian, + ), + ); - expect(entity.properties.custom_cartesian_sampled).toBeDefined(); - expect( - entity.properties.custom_cartesian_sampled.getValue(time1) - ).toBeInstanceOf(Cartesian3); - expect( - entity.properties.custom_cartesian_sampled.getValue(time1) - ).toEqual( - Cartesian3.unpack( - packet.properties.custom_cartesian_sampled.cartesian, - 0 + 1 - ) - ); - expect( - entity.properties.custom_cartesian_sampled.getValue( - JulianDate.addSeconds(time1, 60, new JulianDate()) - ) - ).toEqual( - Cartesian3.unpack( - packet.properties.custom_cartesian_sampled.cartesian, - 3 + 2 - ) - ); + expect(entity.properties.custom_cartesian_sampled).toBeDefined(); + expect( + entity.properties.custom_cartesian_sampled.getValue(time1), + ).toBeInstanceOf(Cartesian3); + expect( + entity.properties.custom_cartesian_sampled.getValue(time1), + ).toEqual( + Cartesian3.unpack( + packet.properties.custom_cartesian_sampled.cartesian, + 0 + 1, + ), + ); + expect( + entity.properties.custom_cartesian_sampled.getValue( + JulianDate.addSeconds(time1, 60, new JulianDate()), + ), + ).toEqual( + Cartesian3.unpack( + packet.properties.custom_cartesian_sampled.cartesian, + 3 + 2, + ), + ); - expect(entity.properties.custom_color_constant).toBeDefined(); - expect( - entity.properties.custom_color_constant.getValue(time1) - ).toBeInstanceOf(Color); - expect(entity.properties.custom_color_constant.getValue(time1)).toEqual( - Color.unpack(packet.properties.custom_color_constant.rgbaf) - ); + expect(entity.properties.custom_color_constant).toBeDefined(); + expect( + entity.properties.custom_color_constant.getValue(time1), + ).toBeInstanceOf(Color); + expect(entity.properties.custom_color_constant.getValue(time1)).toEqual( + Color.unpack(packet.properties.custom_color_constant.rgbaf), + ); - expect(entity.properties.custom_color_interval).toBeDefined(); - expect( - entity.properties.custom_color_interval.getValue(time1) - ).toBeInstanceOf(Color); - expect(entity.properties.custom_color_interval.getValue(time1)).toEqual( - Color.unpack(packet.properties.custom_color_interval[0].rgbaf) - ); - expect(entity.properties.custom_color_interval.getValue(time2)).toEqual( - Color.unpack(packet.properties.custom_color_interval[1].rgbaf) - ); + expect(entity.properties.custom_color_interval).toBeDefined(); + expect( + entity.properties.custom_color_interval.getValue(time1), + ).toBeInstanceOf(Color); + expect(entity.properties.custom_color_interval.getValue(time1)).toEqual( + Color.unpack(packet.properties.custom_color_interval[0].rgbaf), + ); + expect(entity.properties.custom_color_interval.getValue(time2)).toEqual( + Color.unpack(packet.properties.custom_color_interval[1].rgbaf), + ); - expect(entity.properties.custom_color_sampled).toBeDefined(); - expect( - entity.properties.custom_color_sampled.getValue(time1) - ).toBeInstanceOf(Color); - expect(entity.properties.custom_color_sampled.getValue(time1)).toEqual( - Color.unpack(packet.properties.custom_color_sampled.rgbaf, 0 + 1) - ); - expect( - entity.properties.custom_color_sampled.getValue( - JulianDate.addSeconds(time1, 60, new JulianDate()) - ) - ).toEqual( - Color.unpack(packet.properties.custom_color_sampled.rgbaf, 4 + 2) - ); + expect(entity.properties.custom_color_sampled).toBeDefined(); + expect( + entity.properties.custom_color_sampled.getValue(time1), + ).toBeInstanceOf(Color); + expect(entity.properties.custom_color_sampled.getValue(time1)).toEqual( + Color.unpack(packet.properties.custom_color_sampled.rgbaf, 0 + 1), + ); + expect( + entity.properties.custom_color_sampled.getValue( + JulianDate.addSeconds(time1, 60, new JulianDate()), + ), + ).toEqual( + Color.unpack(packet.properties.custom_color_sampled.rgbaf, 4 + 2), + ); - expect(entity.properties.custom_date_constant).toBeDefined(); - expect( - entity.properties.custom_date_constant.getValue(time1) - ).toBeInstanceOf(JulianDate); - expect(entity.properties.custom_date_constant.getValue(time1)).toEqual( - JulianDate.fromIso8601(packet.properties.custom_date_constant.date) - ); + expect(entity.properties.custom_date_constant).toBeDefined(); + expect( + entity.properties.custom_date_constant.getValue(time1), + ).toBeInstanceOf(JulianDate); + expect(entity.properties.custom_date_constant.getValue(time1)).toEqual( + JulianDate.fromIso8601(packet.properties.custom_date_constant.date), + ); - expect(entity.properties.custom_date_interval).toBeDefined(); - expect( - entity.properties.custom_date_interval.getValue(time1) - ).toBeInstanceOf(JulianDate); - expect(entity.properties.custom_date_interval.getValue(time1)).toEqual( - JulianDate.fromIso8601(packet.properties.custom_date_interval[0].date) - ); - expect(entity.properties.custom_date_interval.getValue(time2)).toEqual( - JulianDate.fromIso8601(packet.properties.custom_date_interval[1].date) - ); - }); + expect(entity.properties.custom_date_interval).toBeDefined(); + expect( + entity.properties.custom_date_interval.getValue(time1), + ).toBeInstanceOf(JulianDate); + expect(entity.properties.custom_date_interval.getValue(time1)).toEqual( + JulianDate.fromIso8601( + packet.properties.custom_date_interval[0].date, + ), + ); + expect(entity.properties.custom_date_interval.getValue(time2)).toEqual( + JulianDate.fromIso8601( + packet.properties.custom_date_interval[1].date, + ), + ); + }, + ); }); it("can delete an entire property", function () { @@ -3111,7 +3161,7 @@ describe("DataSources/CzmlDataSource", function () { expect(entity.billboard.scale).toBeInstanceOf(ConstantProperty); entity = dataSource.entities.getById("test-interval"); expect(entity.billboard.scale).toBeInstanceOf( - TimeIntervalCollectionProperty + TimeIntervalCollectionProperty, ); entity = dataSource.entities.getById("test-sampled"); expect(entity.billboard.scale).toBeInstanceOf(SampledProperty); @@ -3289,7 +3339,7 @@ describe("DataSources/CzmlDataSource", function () { expect(entity.position).toBeInstanceOf(ConstantPositionProperty); entity = dataSource.entities.getById("test-interval"); expect(entity.position).toBeInstanceOf( - TimeIntervalCollectionPositionProperty + TimeIntervalCollectionPositionProperty, ); entity = dataSource.entities.getById("test-sampled"); expect(entity.position).toBeInstanceOf(SampledPositionProperty); @@ -3355,18 +3405,18 @@ describe("DataSources/CzmlDataSource", function () { expect( entity.billboard.scale.getValue( - JulianDate.fromIso8601("2012-03-15T10:00:00Z") - ) + JulianDate.fromIso8601("2012-03-15T10:00:00Z"), + ), ).toEqual(1); expect( entity.billboard.scale.getValue( - JulianDate.fromIso8601("2012-03-15T11:00:00Z") - ) + JulianDate.fromIso8601("2012-03-15T11:00:00Z"), + ), ).toEqual(5); expect( entity.billboard.scale.getValue( - JulianDate.fromIso8601("2012-03-15T12:00:00Z") - ) + JulianDate.fromIso8601("2012-03-15T12:00:00Z"), + ), ).toEqual(3); return dataSource; @@ -3389,19 +3439,19 @@ describe("DataSources/CzmlDataSource", function () { expect( entity.billboard.scale.getValue( - JulianDate.fromIso8601("2012-03-15T10:00:00Z") - ) + JulianDate.fromIso8601("2012-03-15T10:00:00Z"), + ), ).toEqual(1); // deleting sample will cause the property to interpolate from remaining samples expect( entity.billboard.scale.getValue( - JulianDate.fromIso8601("2012-03-15T11:00:00Z") - ) + JulianDate.fromIso8601("2012-03-15T11:00:00Z"), + ), ).toEqual(2); expect( entity.billboard.scale.getValue( - JulianDate.fromIso8601("2012-03-15T12:00:00Z") - ) + JulianDate.fromIso8601("2012-03-15T12:00:00Z"), + ), ).toEqual(3); }); }); @@ -3430,18 +3480,18 @@ describe("DataSources/CzmlDataSource", function () { expect( entity.properties.custom.getValue( - JulianDate.fromIso8601("2012-03-15T10:00:00Z") - ) + JulianDate.fromIso8601("2012-03-15T10:00:00Z"), + ), ).toEqual(1); expect( entity.properties.custom.getValue( - JulianDate.fromIso8601("2012-03-15T11:00:00Z") - ) + JulianDate.fromIso8601("2012-03-15T11:00:00Z"), + ), ).toEqual(5); expect( entity.properties.custom.getValue( - JulianDate.fromIso8601("2012-03-15T12:00:00Z") - ) + JulianDate.fromIso8601("2012-03-15T12:00:00Z"), + ), ).toEqual(3); return dataSource; @@ -3464,19 +3514,19 @@ describe("DataSources/CzmlDataSource", function () { expect( entity.properties.custom.getValue( - JulianDate.fromIso8601("2012-03-15T10:00:00Z") - ) + JulianDate.fromIso8601("2012-03-15T10:00:00Z"), + ), ).toEqual(1); // deleting sample will cause the property to interpolate from remaining samples expect( entity.properties.custom.getValue( - JulianDate.fromIso8601("2012-03-15T11:00:00Z") - ) + JulianDate.fromIso8601("2012-03-15T11:00:00Z"), + ), ).toEqual(2); expect( entity.properties.custom.getValue( - JulianDate.fromIso8601("2012-03-15T12:00:00Z") - ) + JulianDate.fromIso8601("2012-03-15T12:00:00Z"), + ), ).toEqual(3); }); }); @@ -3497,18 +3547,18 @@ describe("DataSources/CzmlDataSource", function () { expect( entity.position.getValue( - JulianDate.fromIso8601("2016-06-17T12:00:00Z") - ) + JulianDate.fromIso8601("2016-06-17T12:00:00Z"), + ), ).toEqual(new Cartesian3(1, 2, 3)); expect( entity.position.getValue( - JulianDate.fromIso8601("2016-06-17T12:01:00Z") - ) + JulianDate.fromIso8601("2016-06-17T12:01:00Z"), + ), ).toEqual(new Cartesian3(61, 122, 183)); expect( entity.position.getValue( - JulianDate.fromIso8601("2016-06-17T12:02:00Z") - ) + JulianDate.fromIso8601("2016-06-17T12:02:00Z"), + ), ).toEqual(new Cartesian3(3, 4, 5)); return dataSource; @@ -3529,19 +3579,19 @@ describe("DataSources/CzmlDataSource", function () { expect( entity.position.getValue( - JulianDate.fromIso8601("2016-06-17T12:00:00Z") - ) + JulianDate.fromIso8601("2016-06-17T12:00:00Z"), + ), ).toEqual(new Cartesian3(1, 2, 3)); // deleting sample will cause the property to interpolate from remaining samples expect( entity.position.getValue( - JulianDate.fromIso8601("2016-06-17T12:01:00Z") - ) + JulianDate.fromIso8601("2016-06-17T12:01:00Z"), + ), ).toEqual(new Cartesian3(2, 3, 4)); expect( entity.position.getValue( - JulianDate.fromIso8601("2016-06-17T12:02:00Z") - ) + JulianDate.fromIso8601("2016-06-17T12:02:00Z"), + ), ).toEqual(new Cartesian3(3, 4, 5)); }); }); @@ -3567,18 +3617,18 @@ describe("DataSources/CzmlDataSource", function () { .then(function (dataSource) { const entity = dataSource.entities.getById("id"); expect(entity.billboard.scale).toBeInstanceOf( - TimeIntervalCollectionProperty + TimeIntervalCollectionProperty, ); expect( entity.billboard.scale.getValue( - JulianDate.fromIso8601("2013-01-01T00:30:00Z") - ) + JulianDate.fromIso8601("2013-01-01T00:30:00Z"), + ), ).toEqual(2); expect( entity.billboard.scale.getValue( - JulianDate.fromIso8601("2013-01-01T01:30:00Z") - ) + JulianDate.fromIso8601("2013-01-01T01:30:00Z"), + ), ).toEqual(6); return dataSource; @@ -3598,28 +3648,28 @@ describe("DataSources/CzmlDataSource", function () { .then(function (dataSource) { const entity = dataSource.entities.getById("id"); expect(entity.billboard.scale).toBeInstanceOf( - TimeIntervalCollectionProperty + TimeIntervalCollectionProperty, ); expect( entity.billboard.scale.getValue( - JulianDate.fromIso8601("2013-01-01T00:30:00Z") - ) + JulianDate.fromIso8601("2013-01-01T00:30:00Z"), + ), ).toBeUndefined(); expect( entity.billboard.scale.getValue( - JulianDate.fromIso8601("2013-01-01T01:30:00Z") - ) + JulianDate.fromIso8601("2013-01-01T01:30:00Z"), + ), ).toBeUndefined(); expect( entity.billboard.scale.getValue( - JulianDate.fromIso8601("2013-01-01T00:29:00Z") - ) + JulianDate.fromIso8601("2013-01-01T00:29:00Z"), + ), ).toEqual(2); expect( entity.billboard.scale.getValue( - JulianDate.fromIso8601("2013-01-01T01:31:00Z") - ) + JulianDate.fromIso8601("2013-01-01T01:31:00Z"), + ), ).toEqual(6); }); }); @@ -3643,18 +3693,18 @@ describe("DataSources/CzmlDataSource", function () { .then(function (dataSource) { const entity = dataSource.entities.getById("id"); expect(entity.position).toBeInstanceOf( - TimeIntervalCollectionPositionProperty + TimeIntervalCollectionPositionProperty, ); expect( entity.position.getValue( - JulianDate.fromIso8601("2013-01-01T00:30:00Z") - ) + JulianDate.fromIso8601("2013-01-01T00:30:00Z"), + ), ).toEqual(new Cartesian3(1, 2, 3)); expect( entity.position.getValue( - JulianDate.fromIso8601("2013-01-01T01:30:00Z") - ) + JulianDate.fromIso8601("2013-01-01T01:30:00Z"), + ), ).toEqual(new Cartesian3(4, 5, 6)); return dataSource; @@ -3672,28 +3722,28 @@ describe("DataSources/CzmlDataSource", function () { .then(function (dataSource) { const entity = dataSource.entities.getById("id"); expect(entity.position).toBeInstanceOf( - TimeIntervalCollectionPositionProperty + TimeIntervalCollectionPositionProperty, ); expect( entity.position.getValue( - JulianDate.fromIso8601("2013-01-01T00:30:00Z") - ) + JulianDate.fromIso8601("2013-01-01T00:30:00Z"), + ), ).toBeUndefined(); expect( entity.position.getValue( - JulianDate.fromIso8601("2013-01-01T01:30:00Z") - ) + JulianDate.fromIso8601("2013-01-01T01:30:00Z"), + ), ).toBeUndefined(); expect( entity.position.getValue( - JulianDate.fromIso8601("2013-01-01T00:29:00Z") - ) + JulianDate.fromIso8601("2013-01-01T00:29:00Z"), + ), ).toEqual(new Cartesian3(1, 2, 3)); expect( entity.position.getValue( - JulianDate.fromIso8601("2013-01-01T01:31:00Z") - ) + JulianDate.fromIso8601("2013-01-01T01:31:00Z"), + ), ).toEqual(new Cartesian3(4, 5, 6)); }); }); @@ -3734,38 +3784,38 @@ describe("DataSources/CzmlDataSource", function () { expect( entity.billboard.scale.getValue( - JulianDate.fromIso8601("2013-01-01T00:00:00Z") - ) + JulianDate.fromIso8601("2013-01-01T00:00:00Z"), + ), ).toEqual(1); expect( entity.billboard.scale.getValue( - JulianDate.fromIso8601("2013-01-01T00:00:30Z") - ) + JulianDate.fromIso8601("2013-01-01T00:00:30Z"), + ), ).toEqual(6); expect( entity.billboard.scale.getValue( - JulianDate.fromIso8601("2013-01-01T00:01:00Z") - ) + JulianDate.fromIso8601("2013-01-01T00:01:00Z"), + ), ).toEqual(3); expect( entity.billboard.scale.getValue( - JulianDate.fromIso8601("2013-01-01T00:02:00Z") - ) + JulianDate.fromIso8601("2013-01-01T00:02:00Z"), + ), ).toEqual(33); expect( entity.billboard.scale.getValue( - JulianDate.fromIso8601("2013-01-01T01:00:00Z") - ) + JulianDate.fromIso8601("2013-01-01T01:00:00Z"), + ), ).toEqual(9); expect( entity.billboard.scale.getValue( - JulianDate.fromIso8601("2013-01-01T01:00:30Z") - ) + JulianDate.fromIso8601("2013-01-01T01:00:30Z"), + ), ).toEqual(19); expect( entity.billboard.scale.getValue( - JulianDate.fromIso8601("2013-01-01T01:01:00Z") - ) + JulianDate.fromIso8601("2013-01-01T01:01:00Z"), + ), ).toEqual(11); return dataSource; @@ -3788,38 +3838,38 @@ describe("DataSources/CzmlDataSource", function () { expect( entity.billboard.scale.getValue( - JulianDate.fromIso8601("2013-01-01T00:00:00Z") - ) + JulianDate.fromIso8601("2013-01-01T00:00:00Z"), + ), ).toEqual(1); expect( entity.billboard.scale.getValue( - JulianDate.fromIso8601("2013-01-01T00:00:30Z") - ) + JulianDate.fromIso8601("2013-01-01T00:00:30Z"), + ), ).toEqual(6); expect( entity.billboard.scale.getValue( - JulianDate.fromIso8601("2013-01-01T00:01:00Z") - ) + JulianDate.fromIso8601("2013-01-01T00:01:00Z"), + ), ).toBeUndefined(); expect( entity.billboard.scale.getValue( - JulianDate.fromIso8601("2013-01-01T00:02:00Z") - ) + JulianDate.fromIso8601("2013-01-01T00:02:00Z"), + ), ).toBeUndefined(); expect( entity.billboard.scale.getValue( - JulianDate.fromIso8601("2013-01-01T01:00:00Z") - ) + JulianDate.fromIso8601("2013-01-01T01:00:00Z"), + ), ).toBeUndefined(); expect( entity.billboard.scale.getValue( - JulianDate.fromIso8601("2013-01-01T01:00:30Z") - ) + JulianDate.fromIso8601("2013-01-01T01:00:30Z"), + ), ).toEqual(19); expect( entity.billboard.scale.getValue( - JulianDate.fromIso8601("2013-01-01T01:01:00Z") - ) + JulianDate.fromIso8601("2013-01-01T01:01:00Z"), + ), ).toEqual(11); }); }); @@ -3864,38 +3914,38 @@ describe("DataSources/CzmlDataSource", function () { expect( entity.position.getValue( - JulianDate.fromIso8601("2013-01-01T00:00:00Z") - ) + JulianDate.fromIso8601("2013-01-01T00:00:00Z"), + ), ).toEqual(new Cartesian3(1, 2, 3)); expect( entity.position.getValue( - JulianDate.fromIso8601("2013-01-01T00:00:30Z") - ) + JulianDate.fromIso8601("2013-01-01T00:00:30Z"), + ), ).toEqual(new Cartesian3(6, 7, 8)); expect( entity.position.getValue( - JulianDate.fromIso8601("2013-01-01T00:01:00Z") - ) + JulianDate.fromIso8601("2013-01-01T00:01:00Z"), + ), ).toEqual(new Cartesian3(3, 4, 5)); expect( entity.position.getValue( - JulianDate.fromIso8601("2013-01-01T00:02:00Z") - ) + JulianDate.fromIso8601("2013-01-01T00:02:00Z"), + ), ).toEqual(new Cartesian3(15, 16, 17)); expect( entity.position.getValue( - JulianDate.fromIso8601("2013-01-01T01:00:00Z") - ) + JulianDate.fromIso8601("2013-01-01T01:00:00Z"), + ), ).toEqual(new Cartesian3(9, 15, 10)); expect( entity.position.getValue( - JulianDate.fromIso8601("2013-01-01T01:00:30Z") - ) + JulianDate.fromIso8601("2013-01-01T01:00:30Z"), + ), ).toEqual(new Cartesian3(19, 16, 11)); expect( entity.position.getValue( - JulianDate.fromIso8601("2013-01-01T01:01:00Z") - ) + JulianDate.fromIso8601("2013-01-01T01:01:00Z"), + ), ).toEqual(new Cartesian3(11, 17, 12)); return dataSource; @@ -3916,38 +3966,38 @@ describe("DataSources/CzmlDataSource", function () { expect( entity.position.getValue( - JulianDate.fromIso8601("2013-01-01T00:00:00Z") - ) + JulianDate.fromIso8601("2013-01-01T00:00:00Z"), + ), ).toEqual(new Cartesian3(1, 2, 3)); expect( entity.position.getValue( - JulianDate.fromIso8601("2013-01-01T00:00:30Z") - ) + JulianDate.fromIso8601("2013-01-01T00:00:30Z"), + ), ).toEqual(new Cartesian3(6, 7, 8)); expect( entity.position.getValue( - JulianDate.fromIso8601("2013-01-01T00:01:00Z") - ) + JulianDate.fromIso8601("2013-01-01T00:01:00Z"), + ), ).toBeUndefined(); expect( entity.position.getValue( - JulianDate.fromIso8601("2013-01-01T00:02:00Z") - ) + JulianDate.fromIso8601("2013-01-01T00:02:00Z"), + ), ).toBeUndefined(); expect( entity.position.getValue( - JulianDate.fromIso8601("2013-01-01T01:00:00Z") - ) + JulianDate.fromIso8601("2013-01-01T01:00:00Z"), + ), ).toBeUndefined(); expect( entity.position.getValue( - JulianDate.fromIso8601("2013-01-01T01:00:30Z") - ) + JulianDate.fromIso8601("2013-01-01T01:00:30Z"), + ), ).toEqual(new Cartesian3(19, 16, 11)); expect( entity.position.getValue( - JulianDate.fromIso8601("2013-01-01T01:01:00Z") - ) + JulianDate.fromIso8601("2013-01-01T01:01:00Z"), + ), ).toEqual(new Cartesian3(11, 17, 12)); }); }); @@ -4012,16 +4062,16 @@ describe("DataSources/CzmlDataSource", function () { // Initially we use all the properties from dataSource1. entity = composite.values[0]; expect(entity.properties.constant_name.getValue(time)).toEqual( - packet1.properties.constant_name + packet1.properties.constant_name, ); expect(entity.properties.constant_height.getValue(time)).toEqual( - packet1.properties.constant_height + packet1.properties.constant_height, ); expect(entity.properties.constant_object.getValue(time)).toEqual( - testObject1 + testObject1, ); expect(entity.properties.constant_array.getValue(time)).toEqual( - testArray1 + testArray1, ); // Load a new packet into dataSource2 and it should take precedence in the composite. @@ -4030,16 +4080,16 @@ describe("DataSources/CzmlDataSource", function () { .then(function () { entity = composite.values[0]; expect(entity.properties.constant_name.getValue(time)).toEqual( - packet2.properties.constant_name + packet2.properties.constant_name, ); expect(entity.properties.constant_height.getValue(time)).toEqual( - packet1.properties.constant_height + packet1.properties.constant_height, ); expect(entity.properties.constant_object.getValue(time)).toEqual( - testObject1 + testObject1, ); expect(entity.properties.constant_array.getValue(time)).toEqual( - testArray1 + testArray1, ); // Changed values should be mirrored in the composite, too. @@ -4048,16 +4098,16 @@ describe("DataSources/CzmlDataSource", function () { .then(function () { entity = composite.values[0]; expect(entity.properties.constant_name.getValue(time)).toEqual( - packet2.properties.constant_name + packet2.properties.constant_name, ); expect(entity.properties.constant_height.getValue(time)).toEqual( - packet3.properties.constant_height + packet3.properties.constant_height, ); expect(entity.properties.constant_object.getValue(time)).toEqual( - testObject3 + testObject3, ); expect(entity.properties.constant_array.getValue(time)).toEqual( - testArray3 + testArray3, ); }); }); @@ -4162,31 +4212,33 @@ describe("DataSources/CzmlDataSource", function () { const time = Iso8601.MINIMUM_VALUE; - return CzmlDataSource.load(makeDocument(packet)).then(function ( - dataSource - ) { - const entity = dataSource.entities.values[0]; + return CzmlDataSource.load(makeDocument(packet)).then( + function (dataSource) { + const entity = dataSource.entities.values[0]; - expect(entity.path).toBeDefined(); - expect(entity.path.material.color.getValue(time)).toEqual( - Color.unpack(packet.path.material.polylineOutline.color.rgbaf) - ); - expect(entity.path.material.outlineColor.getValue(time)).toEqual( - Color.unpack(packet.path.material.polylineOutline.outlineColor.rgbaf) - ); - expect(entity.path.material.outlineWidth.getValue(time)).toEqual( - packet.path.material.polylineOutline.outlineWidth - ); - expect(entity.path.width.getValue(time)).toEqual(packet.path.width); - expect(entity.path.resolution.getValue(time)).toEqual( - packet.path.resolution - ); - expect(entity.path.leadTime.getValue(time)).toEqual(packet.path.leadTime); - expect(entity.path.trailTime.getValue(time)).toEqual( - packet.path.trailTime - ); - expect(entity.path.show.getValue(time)).toEqual(packet.path.show); - }); + expect(entity.path).toBeDefined(); + expect(entity.path.material.color.getValue(time)).toEqual( + Color.unpack(packet.path.material.polylineOutline.color.rgbaf), + ); + expect(entity.path.material.outlineColor.getValue(time)).toEqual( + Color.unpack(packet.path.material.polylineOutline.outlineColor.rgbaf), + ); + expect(entity.path.material.outlineWidth.getValue(time)).toEqual( + packet.path.material.polylineOutline.outlineWidth, + ); + expect(entity.path.width.getValue(time)).toEqual(packet.path.width); + expect(entity.path.resolution.getValue(time)).toEqual( + packet.path.resolution, + ); + expect(entity.path.leadTime.getValue(time)).toEqual( + packet.path.leadTime, + ); + expect(entity.path.trailTime.getValue(time)).toEqual( + packet.path.trailTime, + ); + expect(entity.path.show.getValue(time)).toEqual(packet.path.show); + }, + ); }); it("can load interval data for path", function () { @@ -4217,39 +4269,41 @@ describe("DataSources/CzmlDataSource", function () { }).start; const invalidTime = JulianDate.addSeconds(validTime, -1, new JulianDate()); - return CzmlDataSource.load(makeDocument(packet)).then(function ( - dataSource - ) { - const entity = dataSource.entities.values[0]; + return CzmlDataSource.load(makeDocument(packet)).then( + function (dataSource) { + const entity = dataSource.entities.values[0]; - expect(entity.path).toBeDefined(); - expect(entity.path.width.getValue(validTime)).toEqual(packet.path.width); - expect(entity.path.resolution.getValue(validTime)).toEqual( - packet.path.resolution - ); - expect(entity.path.leadTime.getValue(validTime)).toEqual( - packet.path.leadTime - ); - expect(entity.path.trailTime.getValue(validTime)).toEqual( - packet.path.trailTime - ); - expect(entity.path.show.getValue(validTime)).toEqual(packet.path.show); - expect(entity.path.material.getValue(validTime).color).toEqual( - Color.unpack(packet.path.material.polylineOutline.color.rgbaf) - ); - expect(entity.path.material.getValue(validTime).outlineColor).toEqual( - Color.unpack(packet.path.material.polylineOutline.outlineColor.rgbaf) - ); - expect(entity.path.material.getValue(validTime).outlineWidth).toEqual( - packet.path.material.polylineOutline.outlineWidth - ); + expect(entity.path).toBeDefined(); + expect(entity.path.width.getValue(validTime)).toEqual( + packet.path.width, + ); + expect(entity.path.resolution.getValue(validTime)).toEqual( + packet.path.resolution, + ); + expect(entity.path.leadTime.getValue(validTime)).toEqual( + packet.path.leadTime, + ); + expect(entity.path.trailTime.getValue(validTime)).toEqual( + packet.path.trailTime, + ); + expect(entity.path.show.getValue(validTime)).toEqual(packet.path.show); + expect(entity.path.material.getValue(validTime).color).toEqual( + Color.unpack(packet.path.material.polylineOutline.color.rgbaf), + ); + expect(entity.path.material.getValue(validTime).outlineColor).toEqual( + Color.unpack(packet.path.material.polylineOutline.outlineColor.rgbaf), + ); + expect(entity.path.material.getValue(validTime).outlineWidth).toEqual( + packet.path.material.polylineOutline.outlineWidth, + ); - expect(entity.path.material.getValue(invalidTime)).toBeUndefined(); - expect(entity.path.width.getValue(invalidTime)).toBeUndefined(); - expect(entity.path.leadTime.getValue(invalidTime)).toBeUndefined(); - expect(entity.path.trailTime.getValue(invalidTime)).toBeUndefined(); - expect(entity.path.show.getValue(invalidTime)).toBeUndefined(); - }); + expect(entity.path.material.getValue(invalidTime)).toBeUndefined(); + expect(entity.path.width.getValue(invalidTime)).toBeUndefined(); + expect(entity.path.leadTime.getValue(invalidTime)).toBeUndefined(); + expect(entity.path.trailTime.getValue(invalidTime)).toBeUndefined(); + expect(entity.path.show.getValue(invalidTime)).toBeUndefined(); + }, + ); }); it("can load constant data for point", function () { @@ -4276,35 +4330,37 @@ describe("DataSources/CzmlDataSource", function () { const time = Iso8601.MINIMUM_VALUE; - return CzmlDataSource.load(makeDocument(packet)).then(function ( - dataSource - ) { - const entity = dataSource.entities.values[0]; + return CzmlDataSource.load(makeDocument(packet)).then( + function (dataSource) { + const entity = dataSource.entities.values[0]; - expect(entity.point).toBeDefined(); - expect(entity.point.color.getValue(time)).toEqual( - Color.unpack(packet.point.color.rgbaf) - ); - expect(entity.point.pixelSize.getValue(time)).toEqual( - packet.point.pixelSize - ); - expect(entity.point.outlineColor.getValue(time)).toEqual( - Color.unpack(packet.point.outlineColor.rgbaf) - ); - expect(entity.point.outlineWidth.getValue(time)).toEqual( - packet.point.outlineWidth - ); - expect(entity.point.show.getValue(time)).toEqual(packet.point.show); - expect(entity.point.scaleByDistance.getValue(time)).toEqual( - NearFarScalar.unpack(packet.point.scaleByDistance.nearFarScalar) - ); - expect(entity.point.translucencyByDistance.getValue(time)).toEqual( - NearFarScalar.unpack(packet.point.translucencyByDistance.nearFarScalar) - ); - expect(entity.point.heightReference.getValue(time)).toEqual( - HeightReference[packet.point.heightReference] - ); - }); + expect(entity.point).toBeDefined(); + expect(entity.point.color.getValue(time)).toEqual( + Color.unpack(packet.point.color.rgbaf), + ); + expect(entity.point.pixelSize.getValue(time)).toEqual( + packet.point.pixelSize, + ); + expect(entity.point.outlineColor.getValue(time)).toEqual( + Color.unpack(packet.point.outlineColor.rgbaf), + ); + expect(entity.point.outlineWidth.getValue(time)).toEqual( + packet.point.outlineWidth, + ); + expect(entity.point.show.getValue(time)).toEqual(packet.point.show); + expect(entity.point.scaleByDistance.getValue(time)).toEqual( + NearFarScalar.unpack(packet.point.scaleByDistance.nearFarScalar), + ); + expect(entity.point.translucencyByDistance.getValue(time)).toEqual( + NearFarScalar.unpack( + packet.point.translucencyByDistance.nearFarScalar, + ), + ); + expect(entity.point.heightReference.getValue(time)).toEqual( + HeightReference[packet.point.heightReference], + ); + }, + ); }); it("can load interval data for point", function () { @@ -4328,32 +4384,34 @@ describe("DataSources/CzmlDataSource", function () { }).start; const invalidTime = JulianDate.addSeconds(validTime, -1, new JulianDate()); - return CzmlDataSource.load(makeDocument(packet)).then(function ( - dataSource - ) { - const entity = dataSource.entities.values[0]; + return CzmlDataSource.load(makeDocument(packet)).then( + function (dataSource) { + const entity = dataSource.entities.values[0]; - expect(entity.point).toBeDefined(); - expect(entity.point.color.getValue(validTime)).toEqual( - Color.unpack(packet.point.color.rgbaf) - ); - expect(entity.point.pixelSize.getValue(validTime)).toEqual( - packet.point.pixelSize - ); - expect(entity.point.outlineColor.getValue(validTime)).toEqual( - Color.unpack(packet.point.outlineColor.rgbaf) - ); - expect(entity.point.outlineWidth.getValue(validTime)).toEqual( - packet.point.outlineWidth - ); - expect(entity.point.show.getValue(validTime)).toEqual(packet.point.show); + expect(entity.point).toBeDefined(); + expect(entity.point.color.getValue(validTime)).toEqual( + Color.unpack(packet.point.color.rgbaf), + ); + expect(entity.point.pixelSize.getValue(validTime)).toEqual( + packet.point.pixelSize, + ); + expect(entity.point.outlineColor.getValue(validTime)).toEqual( + Color.unpack(packet.point.outlineColor.rgbaf), + ); + expect(entity.point.outlineWidth.getValue(validTime)).toEqual( + packet.point.outlineWidth, + ); + expect(entity.point.show.getValue(validTime)).toEqual( + packet.point.show, + ); - expect(entity.point.color.getValue(invalidTime)).toBeUndefined(); - expect(entity.point.pixelSize.getValue(invalidTime)).toBeUndefined(); - expect(entity.point.outlineColor.getValue(invalidTime)).toBeUndefined(); - expect(entity.point.outlineWidth.getValue(invalidTime)).toBeUndefined(); - expect(entity.point.show.getValue(invalidTime)).toBeUndefined(); - }); + expect(entity.point.color.getValue(invalidTime)).toBeUndefined(); + expect(entity.point.pixelSize.getValue(invalidTime)).toBeUndefined(); + expect(entity.point.outlineColor.getValue(invalidTime)).toBeUndefined(); + expect(entity.point.outlineWidth.getValue(invalidTime)).toBeUndefined(); + expect(entity.point.show.getValue(invalidTime)).toBeUndefined(); + }, + ); }); it("can load constant data for polygon", function () { @@ -4386,53 +4444,53 @@ describe("DataSources/CzmlDataSource", function () { const time = Iso8601.MINIMUM_VALUE; - return CzmlDataSource.load(makeDocument(packet)).then(function ( - dataSource - ) { - const entity = dataSource.entities.values[0]; + return CzmlDataSource.load(makeDocument(packet)).then( + function (dataSource) { + const entity = dataSource.entities.values[0]; - expect(entity.polygon).toBeDefined(); - expect(entity.polygon.material.getValue(time).color).toEqual( - Color.unpack(packet.polygon.material.solidColor.color.rgbaf) - ); - expect(entity.polygon.show.getValue(time)).toEqual(packet.polygon.show); - expect(entity.polygon.height.getValue(time)).toEqual( - packet.polygon.height - ); - expect(entity.polygon.extrudedHeight.getValue(time)).toEqual( - packet.polygon.extrudedHeight - ); - expect(entity.polygon.granularity.getValue(time)).toEqual( - packet.polygon.granularity - ); - expect(entity.polygon.stRotation.getValue(time)).toEqual( - packet.polygon.stRotation - ); - expect(entity.polygon.outline.getValue(time)).toEqual( - packet.polygon.outline - ); - expect(entity.polygon.outlineColor.getValue(time)).toEqual( - Color.unpack(packet.polygon.outlineColor.rgbaf) - ); - expect(entity.polygon.outlineWidth.getValue(time)).toEqual( - packet.polygon.outlineWidth - ); - expect(entity.polygon.closeTop.getValue(time)).toEqual( - packet.polygon.closeTop - ); - expect(entity.polygon.closeBottom.getValue(time)).toEqual( - packet.polygon.closeBottom - ); - expect(entity.polygon.shadows.getValue(time)).toEqual( - ShadowMode[packet.polygon.shadows] - ); - expect(entity.polygon.zIndex.getValue(time)).toEqual( - packet.polygon.zIndex - ); - expect(entity.polygon.classificationType.getValue(time)).toEqual( - ClassificationType[packet.polygon.classificationType] - ); - }); + expect(entity.polygon).toBeDefined(); + expect(entity.polygon.material.getValue(time).color).toEqual( + Color.unpack(packet.polygon.material.solidColor.color.rgbaf), + ); + expect(entity.polygon.show.getValue(time)).toEqual(packet.polygon.show); + expect(entity.polygon.height.getValue(time)).toEqual( + packet.polygon.height, + ); + expect(entity.polygon.extrudedHeight.getValue(time)).toEqual( + packet.polygon.extrudedHeight, + ); + expect(entity.polygon.granularity.getValue(time)).toEqual( + packet.polygon.granularity, + ); + expect(entity.polygon.stRotation.getValue(time)).toEqual( + packet.polygon.stRotation, + ); + expect(entity.polygon.outline.getValue(time)).toEqual( + packet.polygon.outline, + ); + expect(entity.polygon.outlineColor.getValue(time)).toEqual( + Color.unpack(packet.polygon.outlineColor.rgbaf), + ); + expect(entity.polygon.outlineWidth.getValue(time)).toEqual( + packet.polygon.outlineWidth, + ); + expect(entity.polygon.closeTop.getValue(time)).toEqual( + packet.polygon.closeTop, + ); + expect(entity.polygon.closeBottom.getValue(time)).toEqual( + packet.polygon.closeBottom, + ); + expect(entity.polygon.shadows.getValue(time)).toEqual( + ShadowMode[packet.polygon.shadows], + ); + expect(entity.polygon.zIndex.getValue(time)).toEqual( + packet.polygon.zIndex, + ); + expect(entity.polygon.classificationType.getValue(time)).toEqual( + ClassificationType[packet.polygon.classificationType], + ); + }, + ); }); it("can load interval data for polygon", function () { @@ -4456,26 +4514,26 @@ describe("DataSources/CzmlDataSource", function () { }).start; const invalidTime = JulianDate.addSeconds(validTime, -1, new JulianDate()); - return CzmlDataSource.load(makeDocument(packet)).then(function ( - dataSource - ) { - const entity = dataSource.entities.values[0]; + return CzmlDataSource.load(makeDocument(packet)).then( + function (dataSource) { + const entity = dataSource.entities.values[0]; - expect(entity.polygon).toBeDefined(); - expect(entity.polygon.material.getValue(validTime).color).toEqual( - Color.unpack(packet.polygon.material.solidColor.color.rgbaf) - ); - expect(entity.polygon.show.getValue(validTime)).toEqual( - packet.polygon.show - ); - expect(entity.polygon.shadows.getValue(validTime)).toEqual( - ShadowMode[packet.polygon.shadows] - ); + expect(entity.polygon).toBeDefined(); + expect(entity.polygon.material.getValue(validTime).color).toEqual( + Color.unpack(packet.polygon.material.solidColor.color.rgbaf), + ); + expect(entity.polygon.show.getValue(validTime)).toEqual( + packet.polygon.show, + ); + expect(entity.polygon.shadows.getValue(validTime)).toEqual( + ShadowMode[packet.polygon.shadows], + ); - expect(entity.polygon.material.getValue(invalidTime)).toBeUndefined(); - expect(entity.polygon.show.getValue(invalidTime)).toBeUndefined(); - expect(entity.polygon.shadows.getValue(invalidTime)).toBeUndefined(); - }); + expect(entity.polygon.material.getValue(invalidTime)).toBeUndefined(); + expect(entity.polygon.show.getValue(invalidTime)).toBeUndefined(); + expect(entity.polygon.shadows.getValue(invalidTime)).toBeUndefined(); + }, + ); }); it("can load constant polygon positions", function () { @@ -4489,39 +4547,39 @@ describe("DataSources/CzmlDataSource", function () { const time = Iso8601.MINIMUM_VALUE; - return CzmlDataSource.load(makeDocument(packet)).then(function ( - dataSource - ) { - const entity = dataSource.entities.values[0]; + return CzmlDataSource.load(makeDocument(packet)).then( + function (dataSource) { + const entity = dataSource.entities.values[0]; - expect(entity.polygon).toBeDefined(); - expect(entity.polygon.hierarchy).toBeDefined(); - expect(entity.polygon.hierarchy.isConstant).toEqual(true); + expect(entity.polygon).toBeDefined(); + expect(entity.polygon.hierarchy).toBeDefined(); + expect(entity.polygon.hierarchy.isConstant).toEqual(true); - let hierarchy = entity.polygon.hierarchy.getValue(time); - expect(hierarchy).toBeInstanceOf(PolygonHierarchy); - expect(hierarchy.positions).toEqual( - Cartesian3.fromDegreesArrayHeights( - packet.polygon.positions.cartographicDegrees - ) - ); + let hierarchy = entity.polygon.hierarchy.getValue(time); + expect(hierarchy).toBeInstanceOf(PolygonHierarchy); + expect(hierarchy.positions).toEqual( + Cartesian3.fromDegreesArrayHeights( + packet.polygon.positions.cartographicDegrees, + ), + ); - hierarchy = entity.polygon.hierarchy.getValue( - time, - new PolygonHierarchy() - ); - expect(hierarchy).toBeInstanceOf(PolygonHierarchy); - expect(hierarchy.positions).toEqual( - Cartesian3.fromDegreesArrayHeights( - packet.polygon.positions.cartographicDegrees - ) - ); - }); + hierarchy = entity.polygon.hierarchy.getValue( + time, + new PolygonHierarchy(), + ); + expect(hierarchy).toBeInstanceOf(PolygonHierarchy); + expect(hierarchy.positions).toEqual( + Cartesian3.fromDegreesArrayHeights( + packet.polygon.positions.cartographicDegrees, + ), + ); + }, + ); }); function unpackPolygonHoleFromCartographicDegrees(holePositions) { return new PolygonHierarchy( - Cartesian3.fromDegreesArrayHeights(holePositions) + Cartesian3.fromDegreesArrayHeights(holePositions), ); } @@ -4542,28 +4600,28 @@ describe("DataSources/CzmlDataSource", function () { const time = Iso8601.MINIMUM_VALUE; - return CzmlDataSource.load(makeDocument(packet)).then(function ( - dataSource - ) { - const entity = dataSource.entities.values[0]; + return CzmlDataSource.load(makeDocument(packet)).then( + function (dataSource) { + const entity = dataSource.entities.values[0]; - expect(entity.polygon).toBeDefined(); - expect(entity.polygon.hierarchy).toBeDefined(); - expect(entity.polygon.hierarchy.isConstant).toEqual(true); + expect(entity.polygon).toBeDefined(); + expect(entity.polygon.hierarchy).toBeDefined(); + expect(entity.polygon.hierarchy.isConstant).toEqual(true); - const hierarchy = entity.polygon.hierarchy.getValue(time); - expect(hierarchy).toBeInstanceOf(PolygonHierarchy); - expect(hierarchy.positions).toEqual( - Cartesian3.fromDegreesArrayHeights( - packet.polygon.positions.cartographicDegrees - ) - ); - expect(hierarchy.holes).toEqual( - packet.polygon.holes.cartographicDegrees.map( - unpackPolygonHoleFromCartographicDegrees - ) - ); - }); + const hierarchy = entity.polygon.hierarchy.getValue(time); + expect(hierarchy).toBeInstanceOf(PolygonHierarchy); + expect(hierarchy.positions).toEqual( + Cartesian3.fromDegreesArrayHeights( + packet.polygon.positions.cartographicDegrees, + ), + ); + expect(hierarchy.holes).toEqual( + packet.polygon.holes.cartographicDegrees.map( + unpackPolygonHoleFromCartographicDegrees, + ), + ); + }, + ); }); it("can load interval polygon positions", function () { @@ -4573,18 +4631,7 @@ describe("DataSources/CzmlDataSource", function () { { interval: "2012-08-04T16:00:00Z/2012-08-04T16:20:00Z", cartographicDegrees: [ - -50, - 20, - 0, - -50, - 40, - 0, - -40, - 40, - 0, - -40, - 20, - 0, + -50, 20, 0, -50, 40, 0, -40, 40, 0, -40, 20, 0, ], }, { @@ -4595,35 +4642,35 @@ describe("DataSources/CzmlDataSource", function () { }, }; - return CzmlDataSource.load(makeDocument(packet)).then(function ( - dataSource - ) { - const entity = dataSource.entities.values[0]; + return CzmlDataSource.load(makeDocument(packet)).then( + function (dataSource) { + const entity = dataSource.entities.values[0]; - expect(entity.polygon).toBeDefined(); - expect(entity.polygon.hierarchy).toBeDefined(); - expect(entity.polygon.hierarchy.isConstant).toEqual(false); + expect(entity.polygon).toBeDefined(); + expect(entity.polygon.hierarchy).toBeDefined(); + expect(entity.polygon.hierarchy.isConstant).toEqual(false); - let hierarchy = entity.polygon.hierarchy.getValue( - JulianDate.fromIso8601("2012-08-04T16:10:00Z") - ); - expect(hierarchy).toBeInstanceOf(PolygonHierarchy); - expect(hierarchy.positions).toEqual( - Cartesian3.fromDegreesArrayHeights( - packet.polygon.positions[0].cartographicDegrees - ) - ); + let hierarchy = entity.polygon.hierarchy.getValue( + JulianDate.fromIso8601("2012-08-04T16:10:00Z"), + ); + expect(hierarchy).toBeInstanceOf(PolygonHierarchy); + expect(hierarchy.positions).toEqual( + Cartesian3.fromDegreesArrayHeights( + packet.polygon.positions[0].cartographicDegrees, + ), + ); - hierarchy = entity.polygon.hierarchy.getValue( - JulianDate.fromIso8601("2012-08-04T16:20:00Z") - ); - expect(hierarchy).toBeInstanceOf(PolygonHierarchy); - expect(hierarchy.positions).toEqual( - Cartesian3.fromDegreesArrayHeights( - packet.polygon.positions[1].cartographicDegrees - ) - ); - }); + hierarchy = entity.polygon.hierarchy.getValue( + JulianDate.fromIso8601("2012-08-04T16:20:00Z"), + ); + expect(hierarchy).toBeInstanceOf(PolygonHierarchy); + expect(hierarchy.positions).toEqual( + Cartesian3.fromDegreesArrayHeights( + packet.polygon.positions[1].cartographicDegrees, + ), + ); + }, + ); }); it("can load interval polygon positions with holes expressed as degrees", function () { @@ -4633,18 +4680,7 @@ describe("DataSources/CzmlDataSource", function () { { interval: "2012-08-04T16:00:00Z/2012-08-04T16:20:00Z", cartographicDegrees: [ - -50, - 20, - 0, - -50, - 40, - 0, - -40, - 40, - 0, - -40, - 20, - 0, + -50, 20, 0, -50, 40, 0, -40, 40, 0, -40, 20, 0, ], }, { @@ -4668,50 +4704,50 @@ describe("DataSources/CzmlDataSource", function () { }, }; - return CzmlDataSource.load(makeDocument(packet)).then(function ( - dataSource - ) { - const entity = dataSource.entities.values[0]; + return CzmlDataSource.load(makeDocument(packet)).then( + function (dataSource) { + const entity = dataSource.entities.values[0]; - expect(entity.polygon).toBeDefined(); - expect(entity.polygon.hierarchy).toBeDefined(); - expect(entity.polygon.hierarchy.isConstant).toEqual(false); + expect(entity.polygon).toBeDefined(); + expect(entity.polygon.hierarchy).toBeDefined(); + expect(entity.polygon.hierarchy.isConstant).toEqual(false); - let hierarchy = entity.polygon.hierarchy.getValue( - JulianDate.fromIso8601("2012-08-04T16:10:00Z") - ); - expect(hierarchy).toBeInstanceOf(PolygonHierarchy); - expect(hierarchy.positions).toEqual( - Cartesian3.fromDegreesArrayHeights( - packet.polygon.positions[0].cartographicDegrees - ) - ); - expect(hierarchy.holes).toEqual( - packet.polygon.holes[0].cartographicDegrees.map( - unpackPolygonHoleFromCartographicDegrees - ) - ); + let hierarchy = entity.polygon.hierarchy.getValue( + JulianDate.fromIso8601("2012-08-04T16:10:00Z"), + ); + expect(hierarchy).toBeInstanceOf(PolygonHierarchy); + expect(hierarchy.positions).toEqual( + Cartesian3.fromDegreesArrayHeights( + packet.polygon.positions[0].cartographicDegrees, + ), + ); + expect(hierarchy.holes).toEqual( + packet.polygon.holes[0].cartographicDegrees.map( + unpackPolygonHoleFromCartographicDegrees, + ), + ); - hierarchy = entity.polygon.hierarchy.getValue( - JulianDate.fromIso8601("2012-08-04T16:20:00Z") - ); - expect(hierarchy).toBeInstanceOf(PolygonHierarchy); - expect(hierarchy.positions).toEqual( - Cartesian3.fromDegreesArrayHeights( - packet.polygon.positions[1].cartographicDegrees - ) - ); - expect(hierarchy.holes).toEqual( - packet.polygon.holes[1].cartographicDegrees.map( - unpackPolygonHoleFromCartographicDegrees - ) - ); - }); + hierarchy = entity.polygon.hierarchy.getValue( + JulianDate.fromIso8601("2012-08-04T16:20:00Z"), + ); + expect(hierarchy).toBeInstanceOf(PolygonHierarchy); + expect(hierarchy.positions).toEqual( + Cartesian3.fromDegreesArrayHeights( + packet.polygon.positions[1].cartographicDegrees, + ), + ); + expect(hierarchy.holes).toEqual( + packet.polygon.holes[1].cartographicDegrees.map( + unpackPolygonHoleFromCartographicDegrees, + ), + ); + }, + ); }); function unpackPolygonHoleFromCartographicRadians(holePositions) { return new PolygonHierarchy( - Cartesian3.fromRadiansArrayHeights(holePositions) + Cartesian3.fromRadiansArrayHeights(holePositions), ); } @@ -4722,18 +4758,9 @@ describe("DataSources/CzmlDataSource", function () { { interval: "2012-08-04T16:00:00Z/2012-08-04T16:20:00Z", cartographicRadians: [ - -0.8726646259971648, - 0.3490658503988659, - 0, - -0.8726646259971648, - 0.6981317007977318, - 0, - -0.6981317007977318, - 0.6981317007977318, - 0, - -0.6981317007977318, - 0.3490658503988659, - 0, + -0.8726646259971648, 0.3490658503988659, 0, -0.8726646259971648, + 0.6981317007977318, 0, -0.6981317007977318, 0.6981317007977318, 0, + -0.6981317007977318, 0.3490658503988659, 0, ], }, ], @@ -4742,18 +4769,9 @@ describe("DataSources/CzmlDataSource", function () { interval: "2012-08-04T16:00:00Z/2012-08-04T16:20:00Z", cartographicRadians: [ [ - -0.8412486994612669, - 0.6806784082777885, - 0, - -0.7766715171374766, - 0.6457718232379019, - 0, - -0.8534660042252271, - 0.5777039824101231, - 0, - -0.8552113334772214, - 0.6387905062299246, - 0, + -0.8412486994612669, 0.6806784082777885, 0, -0.7766715171374766, + 0.6457718232379019, 0, -0.8534660042252271, 0.5777039824101231, + 0, -0.8552113334772214, 0.6387905062299246, 0, ], ], }, @@ -4761,30 +4779,30 @@ describe("DataSources/CzmlDataSource", function () { }, }; - return CzmlDataSource.load(makeDocument(packet)).then(function ( - dataSource - ) { - const entity = dataSource.entities.values[0]; + return CzmlDataSource.load(makeDocument(packet)).then( + function (dataSource) { + const entity = dataSource.entities.values[0]; - expect(entity.polygon).toBeDefined(); - expect(entity.polygon.hierarchy).toBeDefined(); - expect(entity.polygon.hierarchy.isConstant).toEqual(false); + expect(entity.polygon).toBeDefined(); + expect(entity.polygon.hierarchy).toBeDefined(); + expect(entity.polygon.hierarchy.isConstant).toEqual(false); - const hierarchy = entity.polygon.hierarchy.getValue( - JulianDate.fromIso8601("2012-08-04T16:10:00Z") - ); - expect(hierarchy).toBeInstanceOf(PolygonHierarchy); - expect(hierarchy.positions).toEqual( - Cartesian3.fromRadiansArrayHeights( - packet.polygon.positions[0].cartographicRadians - ) - ); - expect(hierarchy.holes).toEqual( - packet.polygon.holes[0].cartographicRadians.map( - unpackPolygonHoleFromCartographicRadians - ) - ); - }); + const hierarchy = entity.polygon.hierarchy.getValue( + JulianDate.fromIso8601("2012-08-04T16:10:00Z"), + ); + expect(hierarchy).toBeInstanceOf(PolygonHierarchy); + expect(hierarchy.positions).toEqual( + Cartesian3.fromRadiansArrayHeights( + packet.polygon.positions[0].cartographicRadians, + ), + ); + expect(hierarchy.holes).toEqual( + packet.polygon.holes[0].cartographicRadians.map( + unpackPolygonHoleFromCartographicRadians, + ), + ); + }, + ); }); function unpackPolygonHoleFromCartesian(holePositions) { @@ -4809,26 +4827,26 @@ describe("DataSources/CzmlDataSource", function () { }, }; - return CzmlDataSource.load(makeDocument(packet)).then(function ( - dataSource - ) { - const entity = dataSource.entities.values[0]; + return CzmlDataSource.load(makeDocument(packet)).then( + function (dataSource) { + const entity = dataSource.entities.values[0]; - expect(entity.polygon).toBeDefined(); - expect(entity.polygon.hierarchy).toBeDefined(); - expect(entity.polygon.hierarchy.isConstant).toEqual(false); + expect(entity.polygon).toBeDefined(); + expect(entity.polygon.hierarchy).toBeDefined(); + expect(entity.polygon.hierarchy.isConstant).toEqual(false); - const hierarchy = entity.polygon.hierarchy.getValue( - JulianDate.fromIso8601("2012-08-04T16:10:00Z") - ); - expect(hierarchy).toBeInstanceOf(PolygonHierarchy); - expect(hierarchy.positions).toEqual( - Cartesian3.unpackArray(packet.polygon.positions[0].cartesian) - ); - expect(hierarchy.holes).toEqual( - packet.polygon.holes[0].cartesian.map(unpackPolygonHoleFromCartesian) - ); - }); + const hierarchy = entity.polygon.hierarchy.getValue( + JulianDate.fromIso8601("2012-08-04T16:10:00Z"), + ); + expect(hierarchy).toBeInstanceOf(PolygonHierarchy); + expect(hierarchy.positions).toEqual( + Cartesian3.unpackArray(packet.polygon.positions[0].cartesian), + ); + expect(hierarchy.holes).toEqual( + packet.polygon.holes[0].cartesian.map(unpackPolygonHoleFromCartesian), + ); + }, + ); }); it("can load reference polygon positions with holes", function () { @@ -4928,18 +4946,7 @@ describe("DataSources/CzmlDataSource", function () { polygon: { positions: { cartographicDegrees: [ - -50, - 20, - 0, - -50, - 40, - 0, - -40, - 40, - 0, - -40, - 20, - 0, + -50, 20, 0, -50, 40, 0, -40, 40, 0, -40, 20, 0, ], }, holes: [ @@ -4963,18 +4970,7 @@ describe("DataSources/CzmlDataSource", function () { { interval: "2012-08-04T16:00:00Z/2012-08-04T16:20:00Z", cartographicDegrees: [ - -50, - 20, - 0, - -50, - 40, - 0, - -40, - 40, - 0, - -40, - 20, - 0, + -50, 20, 0, -50, 40, 0, -40, 40, 0, -40, 20, 0, ], }, { @@ -4991,7 +4987,7 @@ describe("DataSources/CzmlDataSource", function () { return CzmlDataSource.load(document).then(function (dataSource) { let entity = dataSource.entities.getById( - "constantPositionsTimeVaryingHoles" + "constantPositionsTimeVaryingHoles", ); expect(entity.polygon).toBeDefined(); @@ -5029,34 +5025,36 @@ describe("DataSources/CzmlDataSource", function () { const time = Iso8601.MINIMUM_VALUE; - return CzmlDataSource.load(makeDocument(packet)).then(function ( - dataSource - ) { - const entity = dataSource.entities.values[0]; + return CzmlDataSource.load(makeDocument(packet)).then( + function (dataSource) { + const entity = dataSource.entities.values[0]; - expect(entity.polyline).toBeDefined(); - expect(entity.polyline.material.color.getValue(time)).toEqual( - Color.unpack(packet.polyline.material.polylineOutline.color.rgbaf) - ); - expect(entity.polyline.material.outlineColor.getValue(time)).toEqual( - Color.unpack( - packet.polyline.material.polylineOutline.outlineColor.rgbaf - ) - ); - expect(entity.polyline.material.outlineWidth.getValue(time)).toEqual( - packet.polyline.material.polylineOutline.outlineWidth - ); - expect(entity.polyline.width.getValue(time)).toEqual( - packet.polyline.width - ); - expect(entity.polyline.show.getValue(time)).toEqual(packet.polyline.show); - expect(entity.polyline.shadows.getValue(time)).toEqual( - ShadowMode[packet.polyline.shadows] - ); - expect(entity.polyline.classificationType.getValue(time)).toEqual( - ClassificationType[packet.polyline.classificationType] - ); - }); + expect(entity.polyline).toBeDefined(); + expect(entity.polyline.material.color.getValue(time)).toEqual( + Color.unpack(packet.polyline.material.polylineOutline.color.rgbaf), + ); + expect(entity.polyline.material.outlineColor.getValue(time)).toEqual( + Color.unpack( + packet.polyline.material.polylineOutline.outlineColor.rgbaf, + ), + ); + expect(entity.polyline.material.outlineWidth.getValue(time)).toEqual( + packet.polyline.material.polylineOutline.outlineWidth, + ); + expect(entity.polyline.width.getValue(time)).toEqual( + packet.polyline.width, + ); + expect(entity.polyline.show.getValue(time)).toEqual( + packet.polyline.show, + ); + expect(entity.polyline.shadows.getValue(time)).toEqual( + ShadowMode[packet.polyline.shadows], + ); + expect(entity.polyline.classificationType.getValue(time)).toEqual( + ClassificationType[packet.polyline.classificationType], + ); + }, + ); }); it("can load interval data for polyline", function () { @@ -5085,38 +5083,40 @@ describe("DataSources/CzmlDataSource", function () { }).start; const invalidTime = JulianDate.addSeconds(validTime, -1, new JulianDate()); - return CzmlDataSource.load(makeDocument(packet)).then(function ( - dataSource - ) { - const entity = dataSource.entities.values[0]; + return CzmlDataSource.load(makeDocument(packet)).then( + function (dataSource) { + const entity = dataSource.entities.values[0]; - expect(entity.polyline).toBeDefined(); - expect(entity.polyline.material.getValue(validTime).color).toEqual( - Color.unpack(packet.polyline.material.polylineOutline.color.rgbaf) - ); - expect(entity.polyline.material.getValue(validTime).outlineColor).toEqual( - Color.unpack( - packet.polyline.material.polylineOutline.outlineColor.rgbaf - ) - ); - expect(entity.polyline.material.getValue(validTime).outlineWidth).toEqual( - packet.polyline.material.polylineOutline.outlineWidth - ); - expect(entity.polyline.width.getValue(validTime)).toEqual( - packet.polyline.width - ); - expect(entity.polyline.show.getValue(validTime)).toEqual( - packet.polyline.show - ); - expect(entity.polyline.shadows.getValue(validTime)).toEqual( - ShadowMode[packet.polyline.shadows] - ); + expect(entity.polyline).toBeDefined(); + expect(entity.polyline.material.getValue(validTime).color).toEqual( + Color.unpack(packet.polyline.material.polylineOutline.color.rgbaf), + ); + expect( + entity.polyline.material.getValue(validTime).outlineColor, + ).toEqual( + Color.unpack( + packet.polyline.material.polylineOutline.outlineColor.rgbaf, + ), + ); + expect( + entity.polyline.material.getValue(validTime).outlineWidth, + ).toEqual(packet.polyline.material.polylineOutline.outlineWidth); + expect(entity.polyline.width.getValue(validTime)).toEqual( + packet.polyline.width, + ); + expect(entity.polyline.show.getValue(validTime)).toEqual( + packet.polyline.show, + ); + expect(entity.polyline.shadows.getValue(validTime)).toEqual( + ShadowMode[packet.polyline.shadows], + ); - expect(entity.polyline.material.getValue(invalidTime)).toBeUndefined(); - expect(entity.polyline.width.getValue(invalidTime)).toBeUndefined(); - expect(entity.polyline.show.getValue(invalidTime)).toBeUndefined(); - expect(entity.polyline.shadows.getValue(invalidTime)).toBeUndefined(); - }); + expect(entity.polyline.material.getValue(invalidTime)).toBeUndefined(); + expect(entity.polyline.width.getValue(invalidTime)).toBeUndefined(); + expect(entity.polyline.show.getValue(invalidTime)).toBeUndefined(); + expect(entity.polyline.shadows.getValue(invalidTime)).toBeUndefined(); + }, + ); }); it("can load constant data for polyline clamped to terrain.", function () { @@ -5142,34 +5142,36 @@ describe("DataSources/CzmlDataSource", function () { const time = Iso8601.MINIMUM_VALUE; - return CzmlDataSource.load(makeDocument(packet)).then(function ( - dataSource - ) { - const entity = dataSource.entities.values[0]; + return CzmlDataSource.load(makeDocument(packet)).then( + function (dataSource) { + const entity = dataSource.entities.values[0]; - expect(entity.polyline).toBeDefined(); - expect(entity.polyline.material.color.getValue(time)).toEqual( - Color.unpack(packet.polyline.material.polylineOutline.color.rgbaf) - ); - expect(entity.polyline.material.outlineColor.getValue(time)).toEqual( - Color.unpack( - packet.polyline.material.polylineOutline.outlineColor.rgbaf - ) - ); - expect(entity.polyline.material.outlineWidth.getValue(time)).toEqual( - packet.polyline.material.polylineOutline.outlineWidth - ); - expect(entity.polyline.width.getValue(time)).toEqual( - packet.polyline.width - ); - expect(entity.polyline.show.getValue(time)).toEqual(packet.polyline.show); - expect(entity.polyline.clampToGround.getValue(time)).toEqual( - packet.polyline.clampToGround - ); - expect(entity.polyline.zIndex.getValue(time)).toEqual( - packet.polyline.zIndex - ); - }); + expect(entity.polyline).toBeDefined(); + expect(entity.polyline.material.color.getValue(time)).toEqual( + Color.unpack(packet.polyline.material.polylineOutline.color.rgbaf), + ); + expect(entity.polyline.material.outlineColor.getValue(time)).toEqual( + Color.unpack( + packet.polyline.material.polylineOutline.outlineColor.rgbaf, + ), + ); + expect(entity.polyline.material.outlineWidth.getValue(time)).toEqual( + packet.polyline.material.polylineOutline.outlineWidth, + ); + expect(entity.polyline.width.getValue(time)).toEqual( + packet.polyline.width, + ); + expect(entity.polyline.show.getValue(time)).toEqual( + packet.polyline.show, + ); + expect(entity.polyline.clampToGround.getValue(time)).toEqual( + packet.polyline.clampToGround, + ); + expect(entity.polyline.zIndex.getValue(time)).toEqual( + packet.polyline.zIndex, + ); + }, + ); }); it("can load constant data for polylineVolume", function () { @@ -5213,33 +5215,33 @@ describe("DataSources/CzmlDataSource", function () { expect(entity.polylineVolume).toBeDefined(); expect(entity.polylineVolume.positions.getValue(time)).toEqual( - Cartesian3.unpackArray(packet.polylineVolume.positions.cartesian) + Cartesian3.unpackArray(packet.polylineVolume.positions.cartesian), ); expect(entity.polylineVolume.shape.getValue(time)).toEqual( - Cartesian2.unpackArray(packet.polylineVolume.shape.cartesian2) + Cartesian2.unpackArray(packet.polylineVolume.shape.cartesian2), ); expect(entity.polylineVolume.cornerType.getValue(time)).toEqual( - CornerType[packet.polylineVolume.cornerType] + CornerType[packet.polylineVolume.cornerType], ); expect(entity.polylineVolume.show.getValue(time)).toEqual( - packet.polylineVolume.show + packet.polylineVolume.show, ); expect(entity.polylineVolume.fill.getValue(time)).toEqual( - packet.polylineVolume.fill + packet.polylineVolume.fill, ); expect(entity.polylineVolume.material.getValue(time).color).toEqual( - Color.unpack(packet.polylineVolume.material.solidColor.color.rgbaf) + Color.unpack(packet.polylineVolume.material.solidColor.color.rgbaf), ); expect(entity.polylineVolume.outline.getValue(time)).toEqual(true); expect(entity.polylineVolume.outlineColor.getValue(time)).toEqual( - Color.unpack(packet.polylineVolume.outlineColor.rgbaf) + Color.unpack(packet.polylineVolume.outlineColor.rgbaf), ); expect(entity.polylineVolume.outlineWidth.getValue(time)).toEqual(6); expect(entity.polylineVolume.granularity.getValue(time)).toEqual( - packet.polylineVolume.granularity + packet.polylineVolume.granularity, ); expect(entity.polylineVolume.shadows.getValue(time)).toEqual( - ShadowMode[packet.polylineVolume.shadows] + ShadowMode[packet.polylineVolume.shadows], ); // for backwards compatibility, also accept `shape` specified as `cartesian` @@ -5255,7 +5257,7 @@ describe("DataSources/CzmlDataSource", function () { expect(entity.id).toEqual("id"); expect(entity.polylineVolume.shape.getValue(time)).toEqual( - Cartesian2.unpackArray(packet.polylineVolume.shape.cartesian) + Cartesian2.unpackArray(packet.polylineVolume.shape.cartesian), ); }); }); @@ -5267,8 +5269,7 @@ describe("DataSources/CzmlDataSource", function () { scale: 3.0, minimumPixelSize: 5.0, maximumScale: 4.0, - gltf: - "./Data/Models/glTF-2.0/BoxArticulations/glTF/BoxArticulations.gltf", + gltf: "./Data/Models/glTF-2.0/BoxArticulations/glTF/BoxArticulations.gltf", incrementallyLoadTextures: true, shadows: "ENABLED", heightReference: "CLAMP_TO_GROUND", @@ -5304,92 +5305,96 @@ describe("DataSources/CzmlDataSource", function () { const time = Iso8601.MINIMUM_VALUE; - return CzmlDataSource.load(makeDocument(packet)).then(function ( - dataSource - ) { - const entity = dataSource.entities.values[0]; + return CzmlDataSource.load(makeDocument(packet)).then( + function (dataSource) { + const entity = dataSource.entities.values[0]; - expect(entity.model).toBeDefined(); - expect(entity.model.show.getValue(time)).toEqual(packet.model.show); - expect(entity.model.scale.getValue(time)).toEqual(packet.model.scale); - expect(entity.model.minimumPixelSize.getValue(time)).toEqual( - packet.model.minimumPixelSize - ); - expect(entity.model.maximumScale.getValue(time)).toEqual( - packet.model.maximumScale - ); - expect(entity.model.uri.getValue(time).url).toEqual(packet.model.gltf); - expect(entity.model.incrementallyLoadTextures.getValue(time)).toEqual( - packet.model.incrementallyLoadTextures - ); - expect(entity.model.shadows.getValue(time)).toEqual( - ShadowMode[packet.model.shadows] - ); - expect(entity.model.heightReference.getValue(time)).toEqual( - HeightReference[packet.model.heightReference] - ); - expect(entity.model.silhouetteColor.getValue(time)).toEqual( - Color.unpack(packet.model.silhouetteColor.rgbaf) - ); - expect(entity.model.silhouetteSize.getValue(time)).toEqual( - packet.model.silhouetteSize - ); - expect(entity.model.color.getValue(time)).toEqual( - Color.unpack(packet.model.color.rgbaf) - ); - expect(entity.model.colorBlendMode.getValue(time)).toEqual( - ColorBlendMode[packet.model.colorBlendMode] - ); - expect(entity.model.colorBlendAmount.getValue(time)).toEqual( - packet.model.colorBlendAmount - ); + expect(entity.model).toBeDefined(); + expect(entity.model.show.getValue(time)).toEqual(packet.model.show); + expect(entity.model.scale.getValue(time)).toEqual(packet.model.scale); + expect(entity.model.minimumPixelSize.getValue(time)).toEqual( + packet.model.minimumPixelSize, + ); + expect(entity.model.maximumScale.getValue(time)).toEqual( + packet.model.maximumScale, + ); + expect(entity.model.uri.getValue(time).url).toEqual(packet.model.gltf); + expect(entity.model.incrementallyLoadTextures.getValue(time)).toEqual( + packet.model.incrementallyLoadTextures, + ); + expect(entity.model.shadows.getValue(time)).toEqual( + ShadowMode[packet.model.shadows], + ); + expect(entity.model.heightReference.getValue(time)).toEqual( + HeightReference[packet.model.heightReference], + ); + expect(entity.model.silhouetteColor.getValue(time)).toEqual( + Color.unpack(packet.model.silhouetteColor.rgbaf), + ); + expect(entity.model.silhouetteSize.getValue(time)).toEqual( + packet.model.silhouetteSize, + ); + expect(entity.model.color.getValue(time)).toEqual( + Color.unpack(packet.model.color.rgbaf), + ); + expect(entity.model.colorBlendMode.getValue(time)).toEqual( + ColorBlendMode[packet.model.colorBlendMode], + ); + expect(entity.model.colorBlendAmount.getValue(time)).toEqual( + packet.model.colorBlendAmount, + ); - const nodeTransform = entity.model.nodeTransformations.getValue(time) - .Mesh; - expect(nodeTransform).toBeDefined(); - expect(nodeTransform.scale).toEqual( - Cartesian3.unpack(packet.model.nodeTransformations.Mesh.scale.cartesian) - ); - expect(nodeTransform.translation).toEqual( - Cartesian3.unpack( - packet.model.nodeTransformations.Mesh.translation.cartesian - ) - ); + const nodeTransform = + entity.model.nodeTransformations.getValue(time).Mesh; + expect(nodeTransform).toBeDefined(); + expect(nodeTransform.scale).toEqual( + Cartesian3.unpack( + packet.model.nodeTransformations.Mesh.scale.cartesian, + ), + ); + expect(nodeTransform.translation).toEqual( + Cartesian3.unpack( + packet.model.nodeTransformations.Mesh.translation.cartesian, + ), + ); - const expectedRotation = Quaternion.unpack( - packet.model.nodeTransformations.Mesh.rotation.unitQuaternion - ); - Quaternion.normalize(expectedRotation, expectedRotation); - expect(nodeTransform.rotation).toEqual(expectedRotation); + const expectedRotation = Quaternion.unpack( + packet.model.nodeTransformations.Mesh.rotation.unitQuaternion, + ); + Quaternion.normalize(expectedRotation, expectedRotation); + expect(nodeTransform.rotation).toEqual(expectedRotation); - expect( - entity.model.nodeTransformations.Mesh.scale.getValue(time) - ).toEqual( - Cartesian3.unpack(packet.model.nodeTransformations.Mesh.scale.cartesian) - ); - expect( - entity.model.nodeTransformations.Mesh.translation.getValue(time) - ).toEqual( - Cartesian3.unpack( - packet.model.nodeTransformations.Mesh.translation.cartesian - ) - ); - expect( - entity.model.nodeTransformations.Mesh.rotation.getValue(time) - ).toEqual(expectedRotation); + expect( + entity.model.nodeTransformations.Mesh.scale.getValue(time), + ).toEqual( + Cartesian3.unpack( + packet.model.nodeTransformations.Mesh.scale.cartesian, + ), + ); + expect( + entity.model.nodeTransformations.Mesh.translation.getValue(time), + ).toEqual( + Cartesian3.unpack( + packet.model.nodeTransformations.Mesh.translation.cartesian, + ), + ); + expect( + entity.model.nodeTransformations.Mesh.rotation.getValue(time), + ).toEqual(expectedRotation); - const articulations = entity.model.articulations.getValue(time); - expect(articulations).toBeDefined(); - expect(articulations["SampleArticulation Yaw"]).toEqual( - packet.model.articulations["SampleArticulation Yaw"] - ); - expect(articulations["SampleArticulation Pitch"]).toEqual( - packet.model.articulations["SampleArticulation Pitch"] - ); - expect(articulations["SampleArticulation Roll"]).toEqual( - packet.model.articulations["SampleArticulation Roll"] - ); - }); + const articulations = entity.model.articulations.getValue(time); + expect(articulations).toBeDefined(); + expect(articulations["SampleArticulation Yaw"]).toEqual( + packet.model.articulations["SampleArticulation Yaw"], + ); + expect(articulations["SampleArticulation Pitch"]).toEqual( + packet.model.articulations["SampleArticulation Pitch"], + ); + expect(articulations["SampleArticulation Roll"]).toEqual( + packet.model.articulations["SampleArticulation Roll"], + ); + }, + ); }); it("can load interval data for model", function () { @@ -5399,8 +5404,7 @@ describe("DataSources/CzmlDataSource", function () { show: true, scale: 3.0, minimumPixelSize: 5.0, - gltf: - "./Data/Models/glTF-2.0/BoxArticulations/glTF/BoxArticulations.gltf", + gltf: "./Data/Models/glTF-2.0/BoxArticulations/glTF/BoxArticulations.gltf", incrementallyLoadTextures: true, shadows: "ENABLED", heightReference: "CLAMP_TO_GROUND", @@ -5439,137 +5443,150 @@ describe("DataSources/CzmlDataSource", function () { }).start; const invalidTime = JulianDate.addSeconds(validTime, -1, new JulianDate()); - return CzmlDataSource.load(makeDocument(packet)).then(function ( - dataSource - ) { - const entity = dataSource.entities.values[0]; + return CzmlDataSource.load(makeDocument(packet)).then( + function (dataSource) { + const entity = dataSource.entities.values[0]; - expect(entity.model).toBeDefined(); - expect(entity.model.show.getValue(validTime)).toEqual(packet.model.show); - expect(entity.model.scale.getValue(validTime)).toEqual( - packet.model.scale - ); - expect(entity.model.minimumPixelSize.getValue(validTime)).toEqual( - packet.model.minimumPixelSize - ); - expect(entity.model.uri.getValue(validTime).url).toEqual( - packet.model.gltf - ); - expect( - entity.model.incrementallyLoadTextures.getValue(validTime) - ).toEqual(packet.model.incrementallyLoadTextures); - expect(entity.model.shadows.getValue(validTime)).toEqual( - ShadowMode[packet.model.shadows] - ); - expect(entity.model.heightReference.getValue(validTime)).toEqual( - HeightReference[packet.model.heightReference] - ); - expect(entity.model.silhouetteColor.getValue(validTime)).toEqual( - Color.unpack(packet.model.silhouetteColor.rgbaf) - ); - expect(entity.model.silhouetteSize.getValue(validTime)).toEqual( - packet.model.silhouetteSize - ); - expect(entity.model.color.getValue(validTime)).toEqual( - Color.unpack(packet.model.color.rgbaf) - ); - expect(entity.model.colorBlendMode.getValue(validTime)).toEqual( - ColorBlendMode[packet.model.colorBlendMode] - ); - expect(entity.model.colorBlendAmount.getValue(validTime)).toEqual( - packet.model.colorBlendAmount - ); + expect(entity.model).toBeDefined(); + expect(entity.model.show.getValue(validTime)).toEqual( + packet.model.show, + ); + expect(entity.model.scale.getValue(validTime)).toEqual( + packet.model.scale, + ); + expect(entity.model.minimumPixelSize.getValue(validTime)).toEqual( + packet.model.minimumPixelSize, + ); + expect(entity.model.uri.getValue(validTime).url).toEqual( + packet.model.gltf, + ); + expect( + entity.model.incrementallyLoadTextures.getValue(validTime), + ).toEqual(packet.model.incrementallyLoadTextures); + expect(entity.model.shadows.getValue(validTime)).toEqual( + ShadowMode[packet.model.shadows], + ); + expect(entity.model.heightReference.getValue(validTime)).toEqual( + HeightReference[packet.model.heightReference], + ); + expect(entity.model.silhouetteColor.getValue(validTime)).toEqual( + Color.unpack(packet.model.silhouetteColor.rgbaf), + ); + expect(entity.model.silhouetteSize.getValue(validTime)).toEqual( + packet.model.silhouetteSize, + ); + expect(entity.model.color.getValue(validTime)).toEqual( + Color.unpack(packet.model.color.rgbaf), + ); + expect(entity.model.colorBlendMode.getValue(validTime)).toEqual( + ColorBlendMode[packet.model.colorBlendMode], + ); + expect(entity.model.colorBlendAmount.getValue(validTime)).toEqual( + packet.model.colorBlendAmount, + ); - const nodeTransform = entity.model.nodeTransformations.getValue(validTime) - .Mesh; - expect(nodeTransform).toBeDefined(); - expect(nodeTransform.scale).toEqual( - Cartesian3.unpack(packet.model.nodeTransformations.Mesh.scale.cartesian) - ); - expect(nodeTransform.translation).toEqual( - Cartesian3.unpack( - packet.model.nodeTransformations.Mesh.translation.cartesian - ) - ); + const nodeTransform = + entity.model.nodeTransformations.getValue(validTime).Mesh; + expect(nodeTransform).toBeDefined(); + expect(nodeTransform.scale).toEqual( + Cartesian3.unpack( + packet.model.nodeTransformations.Mesh.scale.cartesian, + ), + ); + expect(nodeTransform.translation).toEqual( + Cartesian3.unpack( + packet.model.nodeTransformations.Mesh.translation.cartesian, + ), + ); - const expectedRotation = Quaternion.unpack( - packet.model.nodeTransformations.Mesh.rotation.unitQuaternion - ); - Quaternion.normalize(expectedRotation, expectedRotation); - expect(nodeTransform.rotation).toEqual(expectedRotation); + const expectedRotation = Quaternion.unpack( + packet.model.nodeTransformations.Mesh.rotation.unitQuaternion, + ); + Quaternion.normalize(expectedRotation, expectedRotation); + expect(nodeTransform.rotation).toEqual(expectedRotation); - expect( - entity.model.nodeTransformations.Mesh.scale.getValue(validTime) - ).toEqual( - Cartesian3.unpack(packet.model.nodeTransformations.Mesh.scale.cartesian) - ); - expect( - entity.model.nodeTransformations.Mesh.translation.getValue(validTime) - ).toEqual( - Cartesian3.unpack( - packet.model.nodeTransformations.Mesh.translation.cartesian - ) - ); - expect( - entity.model.nodeTransformations.Mesh.rotation.getValue(validTime) - ).toEqual(expectedRotation); + expect( + entity.model.nodeTransformations.Mesh.scale.getValue(validTime), + ).toEqual( + Cartesian3.unpack( + packet.model.nodeTransformations.Mesh.scale.cartesian, + ), + ); + expect( + entity.model.nodeTransformations.Mesh.translation.getValue(validTime), + ).toEqual( + Cartesian3.unpack( + packet.model.nodeTransformations.Mesh.translation.cartesian, + ), + ); + expect( + entity.model.nodeTransformations.Mesh.rotation.getValue(validTime), + ).toEqual(expectedRotation); - const articulations = entity.model.articulations.getValue(validTime); - expect(articulations).toBeDefined(); - expect(articulations["SampleArticulation Yaw"]).toEqual( - packet.model.articulations["SampleArticulation Yaw"] - ); - expect(articulations["SampleArticulation Pitch"]).toEqual( - packet.model.articulations["SampleArticulation Pitch"] - ); - expect(articulations["SampleArticulation Roll"]).toEqual( - packet.model.articulations["SampleArticulation Roll"] - ); + const articulations = entity.model.articulations.getValue(validTime); + expect(articulations).toBeDefined(); + expect(articulations["SampleArticulation Yaw"]).toEqual( + packet.model.articulations["SampleArticulation Yaw"], + ); + expect(articulations["SampleArticulation Pitch"]).toEqual( + packet.model.articulations["SampleArticulation Pitch"], + ); + expect(articulations["SampleArticulation Roll"]).toEqual( + packet.model.articulations["SampleArticulation Roll"], + ); - expect(entity.model.show.getValue(invalidTime)).toBeUndefined(); - expect(entity.model.scale.getValue(invalidTime)).toBeUndefined(); - expect( - entity.model.minimumPixelSize.getValue(invalidTime) - ).toBeUndefined(); - expect(entity.model.uri.getValue(invalidTime)).toBeUndefined(); - expect( - entity.model.incrementallyLoadTextures.getValue(invalidTime) - ).toBeUndefined(); - expect(entity.model.shadows.getValue(invalidTime)).toBeUndefined(); - expect( - entity.model.heightReference.getValue(invalidTime) - ).toBeUndefined(); - expect(entity.model.color.getValue(invalidTime)).toBeUndefined(); - expect( - entity.model.silhouetteColor.getValue(invalidTime) - ).toBeUndefined(); - expect(entity.model.silhouetteSize.getValue(invalidTime)).toBeUndefined(); - expect(entity.model.colorBlendMode.getValue(invalidTime)).toBeUndefined(); - expect( - entity.model.colorBlendAmount.getValue(invalidTime) - ).toBeUndefined(); + expect(entity.model.show.getValue(invalidTime)).toBeUndefined(); + expect(entity.model.scale.getValue(invalidTime)).toBeUndefined(); + expect( + entity.model.minimumPixelSize.getValue(invalidTime), + ).toBeUndefined(); + expect(entity.model.uri.getValue(invalidTime)).toBeUndefined(); + expect( + entity.model.incrementallyLoadTextures.getValue(invalidTime), + ).toBeUndefined(); + expect(entity.model.shadows.getValue(invalidTime)).toBeUndefined(); + expect( + entity.model.heightReference.getValue(invalidTime), + ).toBeUndefined(); + expect(entity.model.color.getValue(invalidTime)).toBeUndefined(); + expect( + entity.model.silhouetteColor.getValue(invalidTime), + ).toBeUndefined(); + expect( + entity.model.silhouetteSize.getValue(invalidTime), + ).toBeUndefined(); + expect( + entity.model.colorBlendMode.getValue(invalidTime), + ).toBeUndefined(); + expect( + entity.model.colorBlendAmount.getValue(invalidTime), + ).toBeUndefined(); - expect( - entity.model.nodeTransformations.Mesh.getValue(invalidTime) - ).toEqual(new TranslationRotationScale()); - expect( - entity.model.nodeTransformations.Mesh.scale.getValue(invalidTime) - ).toBeUndefined(); - expect( - entity.model.nodeTransformations.Mesh.translation.getValue(invalidTime) - ).toBeUndefined(); - expect( - entity.model.nodeTransformations.Mesh.rotation.getValue(invalidTime) - ).toBeUndefined(); + expect( + entity.model.nodeTransformations.Mesh.getValue(invalidTime), + ).toEqual(new TranslationRotationScale()); + expect( + entity.model.nodeTransformations.Mesh.scale.getValue(invalidTime), + ).toBeUndefined(); + expect( + entity.model.nodeTransformations.Mesh.translation.getValue( + invalidTime, + ), + ).toBeUndefined(); + expect( + entity.model.nodeTransformations.Mesh.rotation.getValue(invalidTime), + ).toBeUndefined(); - const invalidArticulations = entity.model.articulations.getValue( - invalidTime - ); - expect(invalidArticulations).toBeDefined(); - expect(invalidArticulations["SampleArticulation Yaw"]).toBeUndefined(); - expect(invalidArticulations["SampleArticulation Pitch"]).toBeUndefined(); - expect(invalidArticulations["SampleArticulation Roll"]).toBeUndefined(); - }); + const invalidArticulations = + entity.model.articulations.getValue(invalidTime); + expect(invalidArticulations).toBeDefined(); + expect(invalidArticulations["SampleArticulation Yaw"]).toBeUndefined(); + expect( + invalidArticulations["SampleArticulation Pitch"], + ).toBeUndefined(); + expect(invalidArticulations["SampleArticulation Roll"]).toBeUndefined(); + }, + ); }); it("can load node transformations expressed as intervals", function () { @@ -5609,53 +5626,54 @@ describe("DataSources/CzmlDataSource", function () { }, }; - return CzmlDataSource.load(makeDocument(packet)).then(function ( - dataSource - ) { - const entity = dataSource.entities.values[0]; + return CzmlDataSource.load(makeDocument(packet)).then( + function (dataSource) { + const entity = dataSource.entities.values[0]; - expect(entity.model).toBeDefined(); + expect(entity.model).toBeDefined(); - let time = JulianDate.fromIso8601("2012-04-02T12:00:00Z"); - let nodeTransform = entity.model.nodeTransformations.getValue(time).Mesh; - expect(nodeTransform).toBeDefined(); - expect(nodeTransform.scale).toEqual( - Cartesian3.unpack( - packet.model.nodeTransformations[0].Mesh.scale.cartesian - ) - ); - expect(nodeTransform.translation).toEqual( - Cartesian3.unpack( - packet.model.nodeTransformations[0].Mesh.translation.cartesian - ) - ); + let time = JulianDate.fromIso8601("2012-04-02T12:00:00Z"); + let nodeTransform = + entity.model.nodeTransformations.getValue(time).Mesh; + expect(nodeTransform).toBeDefined(); + expect(nodeTransform.scale).toEqual( + Cartesian3.unpack( + packet.model.nodeTransformations[0].Mesh.scale.cartesian, + ), + ); + expect(nodeTransform.translation).toEqual( + Cartesian3.unpack( + packet.model.nodeTransformations[0].Mesh.translation.cartesian, + ), + ); - let expectedRotation = Quaternion.unpack( - packet.model.nodeTransformations[0].Mesh.rotation.unitQuaternion - ); - Quaternion.normalize(expectedRotation, expectedRotation); - expect(nodeTransform.rotation).toEqual(expectedRotation); - - time = JulianDate.fromIso8601("2012-04-02T12:00:01Z"); - nodeTransform = entity.model.nodeTransformations.getValue(time).Mesh; - expect(nodeTransform).toBeDefined(); - expect(nodeTransform.scale).toEqual( - Cartesian3.unpack( - packet.model.nodeTransformations[1].Mesh.scale.cartesian - ) - ); - expect(nodeTransform.translation).toEqual( - Cartesian3.unpack( - packet.model.nodeTransformations[1].Mesh.translation.cartesian - ) - ); + let expectedRotation = Quaternion.unpack( + packet.model.nodeTransformations[0].Mesh.rotation.unitQuaternion, + ); + Quaternion.normalize(expectedRotation, expectedRotation); + expect(nodeTransform.rotation).toEqual(expectedRotation); + + time = JulianDate.fromIso8601("2012-04-02T12:00:01Z"); + nodeTransform = entity.model.nodeTransformations.getValue(time).Mesh; + expect(nodeTransform).toBeDefined(); + expect(nodeTransform.scale).toEqual( + Cartesian3.unpack( + packet.model.nodeTransformations[1].Mesh.scale.cartesian, + ), + ); + expect(nodeTransform.translation).toEqual( + Cartesian3.unpack( + packet.model.nodeTransformations[1].Mesh.translation.cartesian, + ), + ); - expectedRotation = Quaternion.unpack( - packet.model.nodeTransformations[1].Mesh.rotation.unitQuaternion - ); - Quaternion.normalize(expectedRotation, expectedRotation); - expect(nodeTransform.rotation).toEqual(expectedRotation); - }); + expectedRotation = Quaternion.unpack( + packet.model.nodeTransformations[1].Mesh.rotation.unitQuaternion, + ); + Quaternion.normalize(expectedRotation, expectedRotation); + expect(nodeTransform.rotation).toEqual(expectedRotation); + }, + ); }); it("can load articulations expressed as intervals", function () { @@ -5679,39 +5697,39 @@ describe("DataSources/CzmlDataSource", function () { }, }; - return CzmlDataSource.load(makeDocument(packet)).then(function ( - dataSource - ) { - const entity = dataSource.entities.values[0]; + return CzmlDataSource.load(makeDocument(packet)).then( + function (dataSource) { + const entity = dataSource.entities.values[0]; - expect(entity.model).toBeDefined(); + expect(entity.model).toBeDefined(); - let time = JulianDate.fromIso8601("2012-04-02T12:00:00Z"); - let articulations = entity.model.articulations.getValue(time); - expect(articulations).toBeDefined(); - expect(articulations["SampleArticulation Yaw"]).toEqual( - packet.model.articulations[0]["SampleArticulation Yaw"] - ); - expect(articulations["SampleArticulation Pitch"]).toEqual( - packet.model.articulations[0]["SampleArticulation Pitch"] - ); - expect(articulations["SampleArticulation Roll"]).toEqual( - packet.model.articulations[0]["SampleArticulation Roll"] - ); + let time = JulianDate.fromIso8601("2012-04-02T12:00:00Z"); + let articulations = entity.model.articulations.getValue(time); + expect(articulations).toBeDefined(); + expect(articulations["SampleArticulation Yaw"]).toEqual( + packet.model.articulations[0]["SampleArticulation Yaw"], + ); + expect(articulations["SampleArticulation Pitch"]).toEqual( + packet.model.articulations[0]["SampleArticulation Pitch"], + ); + expect(articulations["SampleArticulation Roll"]).toEqual( + packet.model.articulations[0]["SampleArticulation Roll"], + ); - time = JulianDate.fromIso8601("2012-04-02T12:00:01Z"); - articulations = entity.model.articulations.getValue(time); - expect(articulations).toBeDefined(); - expect(articulations["SampleArticulation Yaw"]).toEqual( - packet.model.articulations[1]["SampleArticulation Yaw"] - ); - expect(articulations["SampleArticulation Pitch"]).toEqual( - packet.model.articulations[1]["SampleArticulation Pitch"] - ); - expect(articulations["SampleArticulation Roll"]).toEqual( - packet.model.articulations[1]["SampleArticulation Roll"] - ); - }); + time = JulianDate.fromIso8601("2012-04-02T12:00:01Z"); + articulations = entity.model.articulations.getValue(time); + expect(articulations).toBeDefined(); + expect(articulations["SampleArticulation Yaw"]).toEqual( + packet.model.articulations[1]["SampleArticulation Yaw"], + ); + expect(articulations["SampleArticulation Pitch"]).toEqual( + packet.model.articulations[1]["SampleArticulation Pitch"], + ); + expect(articulations["SampleArticulation Roll"]).toEqual( + packet.model.articulations[1]["SampleArticulation Roll"], + ); + }, + ); }); it("can delete an existing object", function () { @@ -5810,7 +5828,7 @@ describe("DataSources/CzmlDataSource", function () { JulianDate, object, "simpleDate", - JulianDate.toIso8601(date) + JulianDate.toIso8601(date), ); expect(object.simpleDate).toBeDefined(); @@ -5874,7 +5892,7 @@ describe("DataSources/CzmlDataSource", function () { new TimeInterval({ start: startTime, stop: stopTime, - }) + }), ); } @@ -5925,41 +5943,41 @@ describe("DataSources/CzmlDataSource", function () { const entity = dataSource.entities.getById("obj"); expect(entity.polygon.material).toBeInstanceOf( - CompositeMaterialProperty + CompositeMaterialProperty, ); expect(entity.polygon.material.getType(solidTime)).toEqual("Color"); expect(entity.polygon.material.getValue(solidTime).color).toEqual( Color.unpack( packet.polygon.material[0].solidColor.color.rgba.map( - Color.byteToFloat - ) - ) + Color.byteToFloat, + ), + ), ); function assertValuesForGridMaterial(time) { expect(entity.polygon.material.getValue(time).color).toEqual( Color.unpack( - packet.polygon.material[1].grid.color.rgba.map(Color.byteToFloat) - ) + packet.polygon.material[1].grid.color.rgba.map(Color.byteToFloat), + ), ); expect(entity.polygon.material.getValue(time).cellAlpha).toEqual( - packet.polygon.material[1].grid.cellAlpha + packet.polygon.material[1].grid.cellAlpha, ); expect(entity.polygon.material.getValue(time).lineCount).toEqual( Cartesian2.unpack( - packet.polygon.material[1].grid.lineCount.cartesian2 - ) + packet.polygon.material[1].grid.lineCount.cartesian2, + ), ); expect(entity.polygon.material.getValue(time).lineThickness).toEqual( Cartesian2.unpack( - packet.polygon.material[1].grid.lineThickness.cartesian2 - ) + packet.polygon.material[1].grid.lineThickness.cartesian2, + ), ); expect(entity.polygon.material.getValue(time).lineOffset).toEqual( Cartesian2.unpack( - packet.polygon.material[1].grid.lineOffset.cartesian2 - ) + packet.polygon.material[1].grid.lineOffset.cartesian2, + ), ); } @@ -5996,15 +6014,15 @@ describe("DataSources/CzmlDataSource", function () { const entity = dataSource.entities.getById("obj"); expect(entity.polygon.material).toBeInstanceOf( - CompositeMaterialProperty + CompositeMaterialProperty, ); expect(entity.polygon.material.getType(solidTime)).toEqual("Color"); expect(entity.polygon.material.getValue(solidTime).color).toEqual( Color.unpack( secondPacket.polygon.material[0].solidColor.color.rgba.map( - Color.byteToFloat - ) - ) + Color.byteToFloat, + ), + ), ); }); }); @@ -6041,55 +6059,55 @@ describe("DataSources/CzmlDataSource", function () { const time = Iso8601.MINIMUM_VALUE; - return CzmlDataSource.load(makeDocument(packet)).then(function ( - dataSource - ) { - const entity = dataSource.entities.values[0]; + return CzmlDataSource.load(makeDocument(packet)).then( + function (dataSource) { + const entity = dataSource.entities.values[0]; - expect(entity.rectangle).toBeDefined(); - expect(entity.rectangle.coordinates.getValue(time)).toEqual( - Rectangle.unpack(packet.rectangle.coordinates.wsen) - ); - expect(entity.rectangle.material.getValue(time).color).toEqual( - Color.unpack(packet.rectangle.material.solidColor.color.rgbaf) - ); - expect(entity.rectangle.show.getValue(time)).toEqual( - packet.rectangle.show - ); - expect(entity.rectangle.height.getValue(time)).toEqual( - packet.rectangle.height - ); - expect(entity.rectangle.extrudedHeight.getValue(time)).toEqual( - packet.rectangle.extrudedHeight - ); - expect(entity.rectangle.granularity.getValue(time)).toEqual( - packet.rectangle.granularity - ); - expect(entity.rectangle.rotation.getValue(time)).toEqual( - packet.rectangle.rotation - ); - expect(entity.rectangle.stRotation.getValue(time)).toEqual( - packet.rectangle.stRotation - ); - expect(entity.rectangle.outline.getValue(time)).toEqual( - packet.rectangle.outline - ); - expect(entity.rectangle.outlineColor.getValue(time)).toEqual( - Color.unpack(packet.rectangle.outlineColor.rgbaf) - ); - expect(entity.rectangle.outlineWidth.getValue(time)).toEqual( - packet.rectangle.outlineWidth - ); - expect(entity.rectangle.shadows.getValue(time)).toEqual( - ShadowMode[packet.rectangle.shadows] - ); - expect(entity.rectangle.zIndex.getValue(time)).toEqual( - packet.rectangle.zIndex - ); - expect(entity.rectangle.classificationType.getValue(time)).toEqual( - ClassificationType[packet.rectangle.classificationType] - ); - }); + expect(entity.rectangle).toBeDefined(); + expect(entity.rectangle.coordinates.getValue(time)).toEqual( + Rectangle.unpack(packet.rectangle.coordinates.wsen), + ); + expect(entity.rectangle.material.getValue(time).color).toEqual( + Color.unpack(packet.rectangle.material.solidColor.color.rgbaf), + ); + expect(entity.rectangle.show.getValue(time)).toEqual( + packet.rectangle.show, + ); + expect(entity.rectangle.height.getValue(time)).toEqual( + packet.rectangle.height, + ); + expect(entity.rectangle.extrudedHeight.getValue(time)).toEqual( + packet.rectangle.extrudedHeight, + ); + expect(entity.rectangle.granularity.getValue(time)).toEqual( + packet.rectangle.granularity, + ); + expect(entity.rectangle.rotation.getValue(time)).toEqual( + packet.rectangle.rotation, + ); + expect(entity.rectangle.stRotation.getValue(time)).toEqual( + packet.rectangle.stRotation, + ); + expect(entity.rectangle.outline.getValue(time)).toEqual( + packet.rectangle.outline, + ); + expect(entity.rectangle.outlineColor.getValue(time)).toEqual( + Color.unpack(packet.rectangle.outlineColor.rgbaf), + ); + expect(entity.rectangle.outlineWidth.getValue(time)).toEqual( + packet.rectangle.outlineWidth, + ); + expect(entity.rectangle.shadows.getValue(time)).toEqual( + ShadowMode[packet.rectangle.shadows], + ); + expect(entity.rectangle.zIndex.getValue(time)).toEqual( + packet.rectangle.zIndex, + ); + expect(entity.rectangle.classificationType.getValue(time)).toEqual( + ClassificationType[packet.rectangle.classificationType], + ); + }, + ); }); it("can handle constant rectangle coordinates in degrees.", function () { @@ -6103,14 +6121,14 @@ describe("DataSources/CzmlDataSource", function () { const time = Iso8601.MINIMUM_VALUE; - return CzmlDataSource.load(makeDocument(packet)).then(function ( - dataSource - ) { - const entity = dataSource.entities.values[0]; - expect(entity.rectangle.coordinates.getValue(time)).toEqual( - Rectangle.fromDegrees(0, 1, 2, 3) - ); - }); + return CzmlDataSource.load(makeDocument(packet)).then( + function (dataSource) { + const entity = dataSource.entities.values[0]; + expect(entity.rectangle.coordinates.getValue(time)).toEqual( + Rectangle.fromDegrees(0, 1, 2, 3), + ); + }, + ); }); it("can handle sampled rectangle coordinates.", function () { @@ -6125,25 +6143,25 @@ describe("DataSources/CzmlDataSource", function () { }, }; - return CzmlDataSource.load(makeDocument(packet)).then(function ( - dataSource - ) { - const entity = dataSource.entities.values[0]; + return CzmlDataSource.load(makeDocument(packet)).then( + function (dataSource) { + const entity = dataSource.entities.values[0]; - expect(entity.rectangle).toBeDefined(); - const date1 = epoch; - const date2 = JulianDate.addSeconds(epoch, 0.5, new JulianDate()); - const date3 = JulianDate.addSeconds(epoch, 1.0, new JulianDate()); - expect(entity.rectangle.coordinates.getValue(date1)).toEqual( - new Rectangle(1.0, 2.0, 3.0, 4.0) - ); - expect(entity.rectangle.coordinates.getValue(date2)).toEqual( - new Rectangle(2.0, 3.0, 4.0, 5.0) - ); - expect(entity.rectangle.coordinates.getValue(date3)).toEqual( - new Rectangle(3.0, 4.0, 5.0, 6.0) - ); - }); + expect(entity.rectangle).toBeDefined(); + const date1 = epoch; + const date2 = JulianDate.addSeconds(epoch, 0.5, new JulianDate()); + const date3 = JulianDate.addSeconds(epoch, 1.0, new JulianDate()); + expect(entity.rectangle.coordinates.getValue(date1)).toEqual( + new Rectangle(1.0, 2.0, 3.0, 4.0), + ); + expect(entity.rectangle.coordinates.getValue(date2)).toEqual( + new Rectangle(2.0, 3.0, 4.0, 5.0), + ); + expect(entity.rectangle.coordinates.getValue(date3)).toEqual( + new Rectangle(3.0, 4.0, 5.0, 6.0), + ); + }, + ); }); it("can handle sampled rectangle coordinates in degrees.", function () { @@ -6158,26 +6176,26 @@ describe("DataSources/CzmlDataSource", function () { }, }; - return CzmlDataSource.load(makeDocument(packet)).then(function ( - dataSource - ) { - const entity = dataSource.entities.values[0]; + return CzmlDataSource.load(makeDocument(packet)).then( + function (dataSource) { + const entity = dataSource.entities.values[0]; - expect(entity.rectangle).toBeDefined(); - const date1 = epoch; - const date2 = JulianDate.addSeconds(epoch, 0.5, new JulianDate()); - const date3 = JulianDate.addSeconds(epoch, 1.0, new JulianDate()); - expect(entity.rectangle.coordinates.getValue(date1)).toEqual( - Rectangle.fromDegrees(1.0, 2.0, 3.0, 4.0) - ); - expect(entity.rectangle.coordinates.getValue(date2)).toEqualEpsilon( - Rectangle.fromDegrees(2.0, 3.0, 4.0, 5.0), - CesiumMath.EPSILON15 - ); - expect(entity.rectangle.coordinates.getValue(date3)).toEqual( - Rectangle.fromDegrees(3.0, 4.0, 5.0, 6.0) - ); - }); + expect(entity.rectangle).toBeDefined(); + const date1 = epoch; + const date2 = JulianDate.addSeconds(epoch, 0.5, new JulianDate()); + const date3 = JulianDate.addSeconds(epoch, 1.0, new JulianDate()); + expect(entity.rectangle.coordinates.getValue(date1)).toEqual( + Rectangle.fromDegrees(1.0, 2.0, 3.0, 4.0), + ); + expect(entity.rectangle.coordinates.getValue(date2)).toEqualEpsilon( + Rectangle.fromDegrees(2.0, 3.0, 4.0, 5.0), + CesiumMath.EPSILON15, + ); + expect(entity.rectangle.coordinates.getValue(date3)).toEqual( + Rectangle.fromDegrees(3.0, 4.0, 5.0, 6.0), + ); + }, + ); }); it("can load constant data for wall", function () { @@ -6209,36 +6227,36 @@ describe("DataSources/CzmlDataSource", function () { const time = Iso8601.MINIMUM_VALUE; - return CzmlDataSource.load(makeDocument(packet)).then(function ( - dataSource - ) { - const entity = dataSource.entities.values[0]; + return CzmlDataSource.load(makeDocument(packet)).then( + function (dataSource) { + const entity = dataSource.entities.values[0]; - expect(entity.wall).toBeDefined(); - expect(entity.wall.material.getValue(time).color).toEqual( - Color.unpack(packet.wall.material.solidColor.color.rgbaf) - ); - expect(entity.wall.show.getValue(time)).toEqual(packet.wall.show); - expect(entity.wall.granularity.getValue(time)).toEqual( - packet.wall.granularity - ); - expect(entity.wall.minimumHeights.getValue(time)).toEqual( - packet.wall.minimumHeights.array - ); - expect(entity.wall.maximumHeights.getValue(time)).toEqual( - packet.wall.maximumHeights.array - ); - expect(entity.wall.outline.getValue(time)).toEqual(packet.wall.outline); - expect(entity.wall.outlineColor.getValue(time)).toEqual( - new Color(0.2, 0.2, 0.2, 0.2) - ); - expect(entity.wall.outlineWidth.getValue(time)).toEqual( - packet.wall.outlineWidth - ); - expect(entity.wall.shadows.getValue(time)).toEqual( - ShadowMode[packet.wall.shadows] - ); - }); + expect(entity.wall).toBeDefined(); + expect(entity.wall.material.getValue(time).color).toEqual( + Color.unpack(packet.wall.material.solidColor.color.rgbaf), + ); + expect(entity.wall.show.getValue(time)).toEqual(packet.wall.show); + expect(entity.wall.granularity.getValue(time)).toEqual( + packet.wall.granularity, + ); + expect(entity.wall.minimumHeights.getValue(time)).toEqual( + packet.wall.minimumHeights.array, + ); + expect(entity.wall.maximumHeights.getValue(time)).toEqual( + packet.wall.maximumHeights.array, + ); + expect(entity.wall.outline.getValue(time)).toEqual(packet.wall.outline); + expect(entity.wall.outlineColor.getValue(time)).toEqual( + new Color(0.2, 0.2, 0.2, 0.2), + ); + expect(entity.wall.outlineWidth.getValue(time)).toEqual( + packet.wall.outlineWidth, + ); + expect(entity.wall.shadows.getValue(time)).toEqual( + ShadowMode[packet.wall.shadows], + ); + }, + ); }); it("can load data for wall with minimumHeights as references.", function () { @@ -6337,18 +6355,18 @@ describe("DataSources/CzmlDataSource", function () { expect(entity.wall.minimumHeights).toBeInstanceOf(CompositeProperty); expect( entity.wall.minimumHeights.getValue( - JulianDate.fromIso8601("2009-01-01T00:00:00Z") - ) + JulianDate.fromIso8601("2009-01-01T00:00:00Z"), + ), ).toBeUndefined(); expect( entity.wall.minimumHeights.getValue( - JulianDate.fromIso8601("2010-01-01T00:00:00Z") - ) + JulianDate.fromIso8601("2010-01-01T00:00:00Z"), + ), ).toEqual([packets[1].billboard.scale, packets[2].billboard.scale]); expect( entity.wall.minimumHeights.getValue( - JulianDate.fromIso8601("2010-01-01T01:00:00Z") - ) + JulianDate.fromIso8601("2010-01-01T01:00:00Z"), + ), ).toEqual([packets[2].billboard.scale, packets[3].billboard.scale]); }); }); @@ -6378,30 +6396,30 @@ describe("DataSources/CzmlDataSource", function () { const time = Iso8601.MINIMUM_VALUE; - return CzmlDataSource.load(makeDocument(packet)).then(function ( - dataSource - ) { - const entity = dataSource.entities.values[0]; + return CzmlDataSource.load(makeDocument(packet)).then( + function (dataSource) { + const entity = dataSource.entities.values[0]; - expect(entity.box).toBeDefined(); - expect(entity.box.dimensions.getValue(time)).toEqual( - Cartesian3.unpack(packet.box.dimensions.cartesian) - ); - expect(entity.box.material.getValue(time).color).toEqual( - Color.unpack(packet.box.material.solidColor.color.rgbaf) - ); - expect(entity.box.show.getValue(time)).toEqual(packet.box.show); - expect(entity.box.outline.getValue(time)).toEqual(packet.box.outline); - expect(entity.box.outlineColor.getValue(time)).toEqual( - Color.unpack(packet.box.outlineColor.rgbaf) - ); - expect(entity.box.outlineWidth.getValue(time)).toEqual( - packet.box.outlineWidth - ); - expect(entity.box.shadows.getValue(time)).toEqual( - ShadowMode[packet.box.shadows] - ); - }); + expect(entity.box).toBeDefined(); + expect(entity.box.dimensions.getValue(time)).toEqual( + Cartesian3.unpack(packet.box.dimensions.cartesian), + ); + expect(entity.box.material.getValue(time).color).toEqual( + Color.unpack(packet.box.material.solidColor.color.rgbaf), + ); + expect(entity.box.show.getValue(time)).toEqual(packet.box.show); + expect(entity.box.outline.getValue(time)).toEqual(packet.box.outline); + expect(entity.box.outlineColor.getValue(time)).toEqual( + Color.unpack(packet.box.outlineColor.rgbaf), + ); + expect(entity.box.outlineWidth.getValue(time)).toEqual( + packet.box.outlineWidth, + ); + expect(entity.box.shadows.getValue(time)).toEqual( + ShadowMode[packet.box.shadows], + ); + }, + ); }); it("can load constant data for cylinder", function () { @@ -6431,44 +6449,46 @@ describe("DataSources/CzmlDataSource", function () { const time = Iso8601.MINIMUM_VALUE; - return CzmlDataSource.load(makeDocument(packet)).then(function ( - dataSource - ) { - const entity = dataSource.entities.values[0]; + return CzmlDataSource.load(makeDocument(packet)).then( + function (dataSource) { + const entity = dataSource.entities.values[0]; - expect(entity.cylinder).toBeDefined(); - expect(entity.cylinder.length.getValue(time)).toEqual( - packet.cylinder.length - ); - expect(entity.cylinder.topRadius.getValue(time)).toEqual( - packet.cylinder.topRadius - ); - expect(entity.cylinder.bottomRadius.getValue(time)).toEqual( - packet.cylinder.bottomRadius - ); - expect(entity.cylinder.material.getValue(time).color).toEqual( - Color.unpack(packet.cylinder.material.solidColor.color.rgbaf) - ); - expect(entity.cylinder.show.getValue(time)).toEqual(packet.cylinder.show); - expect(entity.cylinder.outline.getValue(time)).toEqual( - packet.cylinder.outline - ); - expect(entity.cylinder.outlineColor.getValue(time)).toEqual( - Color.unpack(packet.cylinder.outlineColor.rgbaf) - ); - expect(entity.cylinder.outlineWidth.getValue(time)).toEqual( - packet.cylinder.outlineWidth - ); - expect(entity.cylinder.numberOfVerticalLines.getValue(time)).toEqual( - packet.cylinder.numberOfVerticalLines - ); - expect(entity.cylinder.slices.getValue(time)).toEqual( - packet.cylinder.slices - ); - expect(entity.cylinder.shadows.getValue(time)).toEqual( - ShadowMode[packet.cylinder.shadows] - ); - }); + expect(entity.cylinder).toBeDefined(); + expect(entity.cylinder.length.getValue(time)).toEqual( + packet.cylinder.length, + ); + expect(entity.cylinder.topRadius.getValue(time)).toEqual( + packet.cylinder.topRadius, + ); + expect(entity.cylinder.bottomRadius.getValue(time)).toEqual( + packet.cylinder.bottomRadius, + ); + expect(entity.cylinder.material.getValue(time).color).toEqual( + Color.unpack(packet.cylinder.material.solidColor.color.rgbaf), + ); + expect(entity.cylinder.show.getValue(time)).toEqual( + packet.cylinder.show, + ); + expect(entity.cylinder.outline.getValue(time)).toEqual( + packet.cylinder.outline, + ); + expect(entity.cylinder.outlineColor.getValue(time)).toEqual( + Color.unpack(packet.cylinder.outlineColor.rgbaf), + ); + expect(entity.cylinder.outlineWidth.getValue(time)).toEqual( + packet.cylinder.outlineWidth, + ); + expect(entity.cylinder.numberOfVerticalLines.getValue(time)).toEqual( + packet.cylinder.numberOfVerticalLines, + ); + expect(entity.cylinder.slices.getValue(time)).toEqual( + packet.cylinder.slices, + ); + expect(entity.cylinder.shadows.getValue(time)).toEqual( + ShadowMode[packet.cylinder.shadows], + ); + }, + ); }); it("can load constant data for corridor", function () { @@ -6503,53 +6523,55 @@ describe("DataSources/CzmlDataSource", function () { const time = Iso8601.MINIMUM_VALUE; - return CzmlDataSource.load(makeDocument(packet)).then(function ( - dataSource - ) { - const entity = dataSource.entities.values[0]; + return CzmlDataSource.load(makeDocument(packet)).then( + function (dataSource) { + const entity = dataSource.entities.values[0]; - expect(entity.corridor).toBeDefined(); - expect(entity.corridor.positions.getValue(time)).toEqual( - Cartesian3.unpackArray(packet.corridor.positions.cartesian) - ); - expect(entity.corridor.material.getValue(time).color).toEqual( - Color.unpack(packet.corridor.material.solidColor.color.rgbaf) - ); - expect(entity.corridor.show.getValue(time)).toEqual(packet.corridor.show); - expect(entity.corridor.height.getValue(time)).toEqual( - packet.corridor.height - ); - expect(entity.corridor.width.getValue(time)).toEqual( - packet.corridor.width - ); - expect(entity.corridor.cornerType.getValue(time)).toEqual( - CornerType[packet.corridor.cornerType] - ); - expect(entity.corridor.extrudedHeight.getValue(time)).toEqual( - packet.corridor.extrudedHeight - ); - expect(entity.corridor.granularity.getValue(time)).toEqual( - packet.corridor.granularity - ); - expect(entity.corridor.outline.getValue(time)).toEqual( - packet.corridor.outline - ); - expect(entity.corridor.outlineColor.getValue(time)).toEqual( - Color.unpack(packet.corridor.outlineColor.rgbaf) - ); - expect(entity.corridor.outlineWidth.getValue(time)).toEqual( - packet.corridor.outlineWidth - ); - expect(entity.corridor.shadows.getValue(time)).toEqual( - ShadowMode[packet.corridor.shadows] - ); - expect(entity.corridor.zIndex.getValue(time)).toEqual( - packet.corridor.zIndex - ); - expect(entity.corridor.classificationType.getValue(time)).toEqual( - ClassificationType[packet.corridor.classificationType] - ); - }); + expect(entity.corridor).toBeDefined(); + expect(entity.corridor.positions.getValue(time)).toEqual( + Cartesian3.unpackArray(packet.corridor.positions.cartesian), + ); + expect(entity.corridor.material.getValue(time).color).toEqual( + Color.unpack(packet.corridor.material.solidColor.color.rgbaf), + ); + expect(entity.corridor.show.getValue(time)).toEqual( + packet.corridor.show, + ); + expect(entity.corridor.height.getValue(time)).toEqual( + packet.corridor.height, + ); + expect(entity.corridor.width.getValue(time)).toEqual( + packet.corridor.width, + ); + expect(entity.corridor.cornerType.getValue(time)).toEqual( + CornerType[packet.corridor.cornerType], + ); + expect(entity.corridor.extrudedHeight.getValue(time)).toEqual( + packet.corridor.extrudedHeight, + ); + expect(entity.corridor.granularity.getValue(time)).toEqual( + packet.corridor.granularity, + ); + expect(entity.corridor.outline.getValue(time)).toEqual( + packet.corridor.outline, + ); + expect(entity.corridor.outlineColor.getValue(time)).toEqual( + Color.unpack(packet.corridor.outlineColor.rgbaf), + ); + expect(entity.corridor.outlineWidth.getValue(time)).toEqual( + packet.corridor.outlineWidth, + ); + expect(entity.corridor.shadows.getValue(time)).toEqual( + ShadowMode[packet.corridor.shadows], + ); + expect(entity.corridor.zIndex.getValue(time)).toEqual( + packet.corridor.zIndex, + ); + expect(entity.corridor.classificationType.getValue(time)).toEqual( + ClassificationType[packet.corridor.classificationType], + ); + }, + ); }); it("has entity collection with link to data source", function () { @@ -6559,12 +6581,12 @@ describe("DataSources/CzmlDataSource", function () { }); it("has entity with link to entity collection", function () { - return CzmlDataSource.load(makeDocument(staticCzml)).then(function ( - dataSource - ) { - const entities = dataSource.entities; - expect(entities.values[0].entityCollection).toEqual(entities); - }); + return CzmlDataSource.load(makeDocument(staticCzml)).then( + function (dataSource) { + const entities = dataSource.entities; + expect(entities.values[0].entityCollection).toEqual(entities); + }, + ); }); it("can use constant reference properties", function () { @@ -6596,7 +6618,7 @@ describe("DataSources/CzmlDataSource", function () { expect(referenceObject.point.pixelSize).toBeInstanceOf(ReferenceProperty); expect(targetEntity.point.pixelSize.getValue(time)).toEqual( - referenceObject.point.pixelSize.getValue(time) + referenceObject.point.pixelSize.getValue(time), ); }); }); @@ -6645,10 +6667,10 @@ describe("DataSources/CzmlDataSource", function () { const referenceObject = dataSource.entities.getById("referenceId"); expect(targetEntity.point.pixelSize.getValue(time1)).toEqual( - referenceObject.point.pixelSize.getValue(time1) + referenceObject.point.pixelSize.getValue(time1), ); expect(targetEntity2.point.pixelSize.getValue(time2)).toEqual( - referenceObject.point.pixelSize.getValue(time2) + referenceObject.point.pixelSize.getValue(time2), ); }); }); @@ -6681,7 +6703,7 @@ describe("DataSources/CzmlDataSource", function () { expect(referenceObject.position).toBeInstanceOf(ReferenceProperty); expect(targetEntity.position.getValue(time)).toEqual( - referenceObject.position.getValue(time) + referenceObject.position.getValue(time), ); }); }); @@ -6728,10 +6750,10 @@ describe("DataSources/CzmlDataSource", function () { const referenceObject = dataSource.entities.getById("referenceId"); expect(targetEntity.position.getValue(time1)).toEqual( - referenceObject.position.getValue(time1) + referenceObject.position.getValue(time1), ); expect(targetEntity2.position.getValue(time2)).toEqual( - referenceObject.position.getValue(time2) + referenceObject.position.getValue(time2), ); }); }); @@ -6765,7 +6787,7 @@ describe("DataSources/CzmlDataSource", function () { expect(referenceObject.point.pixelSize).toBeInstanceOf(ReferenceProperty); expect(targetEntity.point.pixelSize.getValue(time)).toEqual( - referenceObject.point.pixelSize.getValue(time) + referenceObject.point.pixelSize.getValue(time), ); }); }); @@ -6782,15 +6804,17 @@ describe("DataSources/CzmlDataSource", function () { }, }; - return CzmlDataSource.load(makeDocument(packet)).then(function ( - dataSource - ) { - const targetEntity = dataSource.entities.getById("testObject"); - expect(targetEntity.point.outlineWidth).toBeInstanceOf(ReferenceProperty); - expect(targetEntity.point.outlineWidth.getValue(time)).toEqual( - targetEntity.point.pixelSize.getValue(time) - ); - }); + return CzmlDataSource.load(makeDocument(packet)).then( + function (dataSource) { + const targetEntity = dataSource.entities.getById("testObject"); + expect(targetEntity.point.outlineWidth).toBeInstanceOf( + ReferenceProperty, + ); + expect(targetEntity.point.outlineWidth.getValue(time)).toEqual( + targetEntity.point.pixelSize.getValue(time), + ); + }, + ); }); it("can load a polyline with polyline glow material", function () { @@ -6809,21 +6833,21 @@ describe("DataSources/CzmlDataSource", function () { }, }; - return CzmlDataSource.load(makeDocument(packet)).then(function ( - dataSource - ) { - const entity = dataSource.entities.getById("polylineGlow"); + return CzmlDataSource.load(makeDocument(packet)).then( + function (dataSource) { + const entity = dataSource.entities.getById("polylineGlow"); - expect(entity.polyline.material.color.getValue()).toEqual( - Color.unpack(packet.polyline.material.polylineGlow.color.rgbaf) - ); - expect(entity.polyline.material.glowPower.getValue()).toEqual( - packet.polyline.material.polylineGlow.glowPower - ); - expect(entity.polyline.material.taperPower.getValue()).toEqual( - packet.polyline.material.polylineGlow.taperPower - ); - }); + expect(entity.polyline.material.color.getValue()).toEqual( + Color.unpack(packet.polyline.material.polylineGlow.color.rgbaf), + ); + expect(entity.polyline.material.glowPower.getValue()).toEqual( + packet.polyline.material.polylineGlow.glowPower, + ); + expect(entity.polyline.material.taperPower.getValue()).toEqual( + packet.polyline.material.polylineGlow.taperPower, + ); + }, + ); }); it("can load a polyline with polyline arrow material", function () { @@ -6840,15 +6864,15 @@ describe("DataSources/CzmlDataSource", function () { }, }; - return CzmlDataSource.load(makeDocument(packet)).then(function ( - dataSource - ) { - const entity = dataSource.entities.getById("polylineArrow"); + return CzmlDataSource.load(makeDocument(packet)).then( + function (dataSource) { + const entity = dataSource.entities.getById("polylineArrow"); - expect(entity.polyline.material.color.getValue()).toEqual( - Color.unpack(packet.polyline.material.polylineArrow.color.rgbaf) - ); - }); + expect(entity.polyline.material.color.getValue()).toEqual( + Color.unpack(packet.polyline.material.polylineArrow.color.rgbaf), + ); + }, + ); }); it("can load a polyline with polyline dash material", function () { @@ -6867,21 +6891,21 @@ describe("DataSources/CzmlDataSource", function () { }, }; - return CzmlDataSource.load(makeDocument(packet)).then(function ( - dataSource - ) { - const entity = dataSource.entities.getById("polylineDash"); + return CzmlDataSource.load(makeDocument(packet)).then( + function (dataSource) { + const entity = dataSource.entities.getById("polylineDash"); - expect(entity.polyline.material.color.getValue()).toEqual( - Color.unpack(packet.polyline.material.polylineDash.color.rgbaf) - ); - expect(entity.polyline.material.dashLength.getValue()).toEqual( - packet.polyline.material.polylineDash.dashLength - ); - expect(entity.polyline.material.dashPattern.getValue()).toEqual( - packet.polyline.material.polylineDash.dashPattern - ); - }); + expect(entity.polyline.material.color.getValue()).toEqual( + Color.unpack(packet.polyline.material.polylineDash.color.rgbaf), + ); + expect(entity.polyline.material.dashLength.getValue()).toEqual( + packet.polyline.material.polylineDash.dashLength, + ); + expect(entity.polyline.material.dashPattern.getValue()).toEqual( + packet.polyline.material.polylineDash.dashPattern, + ); + }, + ); }); it("loads extrapolation options", function () { @@ -6905,38 +6929,38 @@ describe("DataSources/CzmlDataSource", function () { }, }; - return CzmlDataSource.load(makeDocument(packet)).then(function ( - dataSource - ) { - const entity = dataSource.entities.getById("point"); - const color = entity.point.color; - expect(color.forwardExtrapolationType).toEqual( - ExtrapolationType[packet.point.color.forwardExtrapolationType] - ); - expect(color.forwardExtrapolationDuration).toEqual( - packet.point.color.forwardExtrapolationDuration - ); - expect(color.backwardExtrapolationType).toEqual( - ExtrapolationType[packet.point.color.backwardExtrapolationType] - ); - expect(color.backwardExtrapolationDuration).toEqual( - packet.point.color.backwardExtrapolationDuration - ); + return CzmlDataSource.load(makeDocument(packet)).then( + function (dataSource) { + const entity = dataSource.entities.getById("point"); + const color = entity.point.color; + expect(color.forwardExtrapolationType).toEqual( + ExtrapolationType[packet.point.color.forwardExtrapolationType], + ); + expect(color.forwardExtrapolationDuration).toEqual( + packet.point.color.forwardExtrapolationDuration, + ); + expect(color.backwardExtrapolationType).toEqual( + ExtrapolationType[packet.point.color.backwardExtrapolationType], + ); + expect(color.backwardExtrapolationDuration).toEqual( + packet.point.color.backwardExtrapolationDuration, + ); - const position = entity.position; - expect(position.forwardExtrapolationType).toEqual( - ExtrapolationType[packet.position.forwardExtrapolationType] - ); - expect(position.forwardExtrapolationDuration).toEqual( - packet.position.forwardExtrapolationDuration - ); - expect(position.backwardExtrapolationType).toEqual( - ExtrapolationType[packet.position.backwardExtrapolationType] - ); - expect(position.backwardExtrapolationDuration).toEqual( - packet.position.backwardExtrapolationDuration - ); - }); + const position = entity.position; + expect(position.forwardExtrapolationType).toEqual( + ExtrapolationType[packet.position.forwardExtrapolationType], + ); + expect(position.forwardExtrapolationDuration).toEqual( + packet.position.forwardExtrapolationDuration, + ); + expect(position.backwardExtrapolationType).toEqual( + ExtrapolationType[packet.position.backwardExtrapolationType], + ); + expect(position.backwardExtrapolationDuration).toEqual( + packet.position.backwardExtrapolationDuration, + ); + }, + ); }); it("rejects if first document packet lacks version information", function () { @@ -6949,7 +6973,7 @@ describe("DataSources/CzmlDataSource", function () { .catch(function (error) { expect(error).toBeInstanceOf(RuntimeError); expect(error.message).toEqual( - "CZML version information invalid. It is expected to be a property on the document object in the <Major>.<Minor> version format." + "CZML version information invalid. It is expected to be a property on the document object in the <Major>.<Minor> version format.", ); }); }); @@ -6964,7 +6988,7 @@ describe("DataSources/CzmlDataSource", function () { .catch(function (error) { expect(error).toBeInstanceOf(RuntimeError); expect(error.message).toEqual( - "The first CZML packet is required to be the document object." + "The first CZML packet is required to be the document object.", ); }); }); @@ -6979,7 +7003,7 @@ describe("DataSources/CzmlDataSource", function () { .catch(function (error) { expect(error).toBeInstanceOf(RuntimeError); expect(error.message).toContain( - "CZML version information invalid. It is expected to be a property on the document object in the <Major>.<Minor> version format." + "CZML version information invalid. It is expected to be a property on the document object in the <Major>.<Minor> version format.", ); }); }); @@ -6993,14 +7017,14 @@ describe("DataSources/CzmlDataSource", function () { }, }; - return CzmlDataSource.load(makeDocument(packet)).then(function ( - dataSource - ) { - const entity = dataSource.entities.values[0]; + return CzmlDataSource.load(makeDocument(packet)).then( + function (dataSource) { + const entity = dataSource.entities.values[0]; - expect(entity.billboard).toBeDefined(); - expect(entity.billboard.color).toBeUndefined(); - }); + expect(entity.billboard).toBeDefined(); + expect(entity.billboard.color).toBeUndefined(); + }, + ); }); it("ignores rectangle values not expressed as a known type", function () { @@ -7012,14 +7036,14 @@ describe("DataSources/CzmlDataSource", function () { }, }; - return CzmlDataSource.load(makeDocument(packet)).then(function ( - dataSource - ) { - const entity = dataSource.entities.values[0]; + return CzmlDataSource.load(makeDocument(packet)).then( + function (dataSource) { + const entity = dataSource.entities.values[0]; - expect(entity.rectangle).toBeDefined(); - expect(entity.rectangle.coordinates).toBeUndefined(); - }); + expect(entity.rectangle).toBeDefined(); + expect(entity.rectangle.coordinates).toBeUndefined(); + }, + ); }); it("converts followSurface to arcType for backwards compatibility", function () { @@ -7079,13 +7103,13 @@ describe("DataSources/CzmlDataSource", function () { expect(entity.polyline.arcType.isConstant).toEqual(false); expect( entity.polyline.arcType.getValue( - JulianDate.fromIso8601("2013-01-01T00:00:00Z") - ) + JulianDate.fromIso8601("2013-01-01T00:00:00Z"), + ), ).toEqual(ArcType.GEODESIC); expect( entity.polyline.arcType.getValue( - JulianDate.fromIso8601("2013-01-01T01:00:00Z") - ) + JulianDate.fromIso8601("2013-01-01T01:00:00Z"), + ), ).toEqual(ArcType.NONE); entity = dataSource.entities.getById("arcType-overrides-followSurface"); diff --git a/packages/engine/Specs/DataSources/DataSourceCollectionSpec.js b/packages/engine/Specs/DataSources/DataSourceCollectionSpec.js index 566532c75a79..3bb3a4208104 100644 --- a/packages/engine/Specs/DataSources/DataSourceCollectionSpec.js +++ b/packages/engine/Specs/DataSources/DataSourceCollectionSpec.js @@ -154,14 +154,13 @@ describe("DataSources/DataSourceCollection", function () { const collection = new DataSourceCollection(); let removeCalled = 0; - collection.dataSourceRemoved.addEventListener(function ( - sender, - dataSource - ) { - expect(sender).toBe(collection); - expect(sources.indexOf(dataSource)).not.toEqual(-1); - removeCalled++; - }); + collection.dataSourceRemoved.addEventListener( + function (sender, dataSource) { + expect(sender).toBe(collection); + expect(sources.indexOf(dataSource)).not.toEqual(-1); + removeCalled++; + }, + ); return Promise.all([ collection.add(sources[0]), @@ -184,14 +183,13 @@ describe("DataSources/DataSourceCollection", function () { const collection = new DataSourceCollection(); let removeCalled = 0; - collection.dataSourceRemoved.addEventListener(function ( - sender, - dataSource - ) { - expect(sender).toBe(collection); - expect(sources.indexOf(dataSource)).not.toEqual(-1); - removeCalled++; - }); + collection.dataSourceRemoved.addEventListener( + function (sender, dataSource) { + expect(sender).toBe(collection); + expect(sources.indexOf(dataSource)).not.toEqual(-1); + removeCalled++; + }, + ); return Promise.all([ collection.add(sources[0]), diff --git a/packages/engine/Specs/DataSources/DataSourceDisplaySpec.js b/packages/engine/Specs/DataSources/DataSourceDisplaySpec.js index fea15067b3e5..7169eb3414ee 100644 --- a/packages/engine/Specs/DataSources/DataSourceDisplaySpec.js +++ b/packages/engine/Specs/DataSources/DataSourceDisplaySpec.js @@ -105,14 +105,14 @@ describe( const visualizer1 = new MockVisualizer(); visualizer1.getBoundingSphereResult = new BoundingSphere( new Cartesian3(1, 2, 3), - 456 + 456, ); visualizer1.getBoundingSphereState = BoundingSphereState.DONE; const visualizer2 = new MockVisualizer(); visualizer2.getBoundingSphereResult = new BoundingSphere( new Cartesian3(7, 8, 9), - 1011 + 1011, ); visualizer2.getBoundingSphereState = BoundingSphereState.DONE; @@ -135,7 +135,7 @@ describe( const expected = BoundingSphere.union( visualizer1.getBoundingSphereResult, - visualizer2.getBoundingSphereResult + visualizer2.getBoundingSphereResult, ); expect(state).toBe(BoundingSphereState.DONE); @@ -147,14 +147,14 @@ describe( const visualizer1 = new MockVisualizer(); visualizer1.getBoundingSphereResult = new BoundingSphere( new Cartesian3(1, 2, 3), - 456 + 456, ); visualizer1.getBoundingSphereState = BoundingSphereState.PENDING; const visualizer2 = new MockVisualizer(); visualizer2.getBoundingSphereResult = new BoundingSphere( new Cartesian3(7, 8, 9), - 1011 + 1011, ); visualizer2.getBoundingSphereState = BoundingSphereState.DONE; @@ -184,14 +184,14 @@ describe( const visualizer1 = new MockVisualizer(); visualizer1.getBoundingSphereResult = new BoundingSphere( new Cartesian3(1, 2, 3), - 456 + 456, ); visualizer1.getBoundingSphereState = BoundingSphereState.PENDING; const visualizer2 = new MockVisualizer(); visualizer2.getBoundingSphereResult = new BoundingSphere( new Cartesian3(7, 8, 9), - 1011 + 1011, ); visualizer2.getBoundingSphereState = BoundingSphereState.DONE; @@ -470,7 +470,7 @@ describe( expect(display._primitives.contains(source._primitives)).toBe(true); expect( - display._groundPrimitives.contains(source._groundPrimitives) + display._groundPrimitives.contains(source._groundPrimitives), ).toBe(true); }); }); @@ -487,7 +487,7 @@ describe( return dataSourceCollection.add(source).then(function () { expect(display._primitives.contains(source._primitives)).toBe(true); expect( - display._groundPrimitives.contains(source._groundPrimitives) + display._groundPrimitives.contains(source._groundPrimitives), ).toBe(true); dataSourceCollection.remove(source); @@ -601,13 +601,13 @@ describe( }); expect(scene.primitives.contains(display._primitives)).toBe(false); expect(scene.groundPrimitives.contains(display._groundPrimitives)).toBe( - false + false, ); return dataSourceCollection.add(new MockDataSource()).then(function () { expect(scene.primitives.contains(display._primitives)).toBe(true); expect(scene.groundPrimitives.contains(display._groundPrimitives)).toBe( - true + true, ); }); }); @@ -622,7 +622,7 @@ describe( expect(scene.primitives.contains(display._primitives)).toBe(true); expect(scene.groundPrimitives.contains(display._groundPrimitives)).toBe( - true + true, ); }); }); @@ -635,14 +635,14 @@ describe( }); expect(scene.primitives.contains(display._primitives)).toBe(false); expect(scene.groundPrimitives.contains(display._groundPrimitives)).toBe( - false + false, ); display.defaultDataSource.entities.add(new Entity()); expect(scene.primitives.contains(display._primitives)).toBe(true); expect(scene.groundPrimitives.contains(display._groundPrimitives)).toBe( - true + true, ); }); @@ -652,7 +652,7 @@ describe( const callback = DataSourceDisplay.defaultVisualizersCallback( scene, entityCluster, - dataSource + dataSource, ); expect(callback.length).toEqual(8); expect(callback[0]).toBeInstanceOf(BillboardVisualizer); @@ -673,7 +673,7 @@ describe( const callback = DataSourceDisplay.defaultVisualizersCallback( scene, entityCluster, - dataSource + dataSource, ); expect(callback.length).withContext("length before register").toEqual(8); @@ -681,7 +681,7 @@ describe( const callback2 = DataSourceDisplay.defaultVisualizersCallback( scene, entityCluster, - dataSource + dataSource, ); expect(callback2.length).withContext("length after register").toEqual(9); expect(callback2[8]).toBeInstanceOf(FakeVisualizer); @@ -690,12 +690,12 @@ describe( const callback3 = DataSourceDisplay.defaultVisualizersCallback( scene, entityCluster, - dataSource + dataSource, ); expect(callback3.length) .withContext("length after unregister") .toEqual(8); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/DataSources/DynamicGeometryUpdaterSpec.js b/packages/engine/Specs/DataSources/DynamicGeometryUpdaterSpec.js index 3d908213f4be..9b4533d52a31 100644 --- a/packages/engine/Specs/DataSources/DynamicGeometryUpdaterSpec.js +++ b/packages/engine/Specs/DataSources/DynamicGeometryUpdaterSpec.js @@ -23,7 +23,7 @@ describe("DataSources/DynamicGeometryUpdater", function () { return new DynamicGeometryUpdater( undefined, new PrimitiveCollection(), - new PrimitiveCollection() + new PrimitiveCollection(), ); }).toThrowDeveloperError(); }); @@ -40,7 +40,7 @@ describe("DataSources/DynamicGeometryUpdater", function () { return new DynamicGeometryUpdater( updater, undefined, - new PrimitiveCollection() + new PrimitiveCollection(), ); }).toThrowDeveloperError(); }); @@ -57,7 +57,7 @@ describe("DataSources/DynamicGeometryUpdater", function () { return new DynamicGeometryUpdater( updater, undefined, - new PrimitiveCollection() + new PrimitiveCollection(), ); }).toThrowDeveloperError(); }); @@ -73,7 +73,7 @@ describe("DataSources/DynamicGeometryUpdater", function () { const dynamicUpdater = new DynamicGeometryUpdater( updater, new PrimitiveCollection(), - new PrimitiveCollection() + new PrimitiveCollection(), ); expect(function () { return dynamicUpdater.update(); diff --git a/packages/engine/Specs/DataSources/EllipseGeometryUpdaterSpec.js b/packages/engine/Specs/DataSources/EllipseGeometryUpdaterSpec.js index 75ac52a43e41..d2549e89b0ca 100644 --- a/packages/engine/Specs/DataSources/EllipseGeometryUpdaterSpec.js +++ b/packages/engine/Specs/DataSources/EllipseGeometryUpdaterSpec.js @@ -47,7 +47,7 @@ describe( const entity = new Entity(); entity.position = new ConstantPositionProperty( - Cartesian3.fromDegrees(0, 0, 0) + Cartesian3.fromDegrees(0, 0, 0), ); entity.ellipse = ellipse; return entity; @@ -66,7 +66,7 @@ describe( const entity = new Entity(); entity.position = new ConstantPositionProperty( - Cartesian3.fromDegrees(0, 0, 0) + Cartesian3.fromDegrees(0, 0, 0), ); entity.ellipse = ellipse; return entity; @@ -208,7 +208,7 @@ describe( const ellipse = new EllipseGraphics(); ellipse.outline = true; ellipse.numberOfVerticalLines = new ConstantProperty( - options.numberOfVerticalLines + options.numberOfVerticalLines, ); ellipse.semiMajorAxis = new ConstantProperty(options.semiMajorAxis); ellipse.semiMinorAxis = new ConstantProperty(options.semiMinorAxis); @@ -245,7 +245,7 @@ describe( expect(geometry._granularity).toEqual(options.granularity); expect(geometry._extrudedHeight).toEqual(options.extrudedHeight); expect(geometry._numberOfVerticalLines).toEqual( - options.numberOfVerticalLines + options.numberOfVerticalLines, ); expect(geometry._offsetAttribute).toBeUndefined(); }); @@ -263,7 +263,7 @@ describe( const updater = new EllipseGeometryUpdater(entity, scene); const dynamicUpdater = updater.createDynamicUpdater( new PrimitiveCollection(), - new PrimitiveCollection() + new PrimitiveCollection(), ); dynamicUpdater.update(JulianDate.now()); @@ -316,7 +316,7 @@ describe( const updater = new EllipseGeometryUpdater(entity, scene); expect(updater._computeCenter(time)).toEqual( - entity.position.getValue(time) + entity.position.getValue(time), ); }); @@ -328,14 +328,14 @@ describe( EllipseGeometryUpdater, "ellipse", createBasicEllipse, - getScene + getScene, ); createDynamicGeometryUpdaterSpecs( EllipseGeometryUpdater, "ellipse", createDynamicEllipse, - getScene + getScene, ); createGeometryUpdaterGroundGeometrySpecs( @@ -343,8 +343,8 @@ describe( "ellipse", createBasicEllipseWithoutHeight, createDynamicEllipseWithoutHeight, - getScene + getScene, ); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/DataSources/EllipseGraphicsSpec.js b/packages/engine/Specs/DataSources/EllipseGraphicsSpec.js index 587e63e4517e..bd88399496ff 100644 --- a/packages/engine/Specs/DataSources/EllipseGraphicsSpec.js +++ b/packages/engine/Specs/DataSources/EllipseGraphicsSpec.js @@ -64,7 +64,7 @@ describe("DataSources/EllipseGraphics", function () { expect(ellipse.rotation.getValue()).toEqual(options.rotation); expect(ellipse.stRotation.getValue()).toEqual(options.stRotation); expect(ellipse.numberOfVerticalLines.getValue()).toEqual( - options.numberOfVerticalLines + options.numberOfVerticalLines, ); expect(ellipse.fill.getValue()).toEqual(options.fill); expect(ellipse.outline.getValue()).toEqual(options.outline); @@ -72,10 +72,10 @@ describe("DataSources/EllipseGraphics", function () { expect(ellipse.outlineWidth.getValue()).toEqual(options.outlineWidth); expect(ellipse.shadows.getValue()).toEqual(options.shadows); expect(ellipse.distanceDisplayCondition.getValue()).toEqual( - options.distanceDisplayCondition + options.distanceDisplayCondition, ); expect(ellipse.classificationType.getValue()).toEqual( - options.classificationType + options.classificationType, ); expect(ellipse.zIndex.getValue()).toEqual(options.zIndex); }); @@ -98,10 +98,10 @@ describe("DataSources/EllipseGraphics", function () { source.numberOfVerticalLines = new ConstantProperty(); source.shadows = new ConstantProperty(ShadowMode.ENABLED); source.distanceDisplayCondition = new ConstantProperty( - new DistanceDisplayCondition(10.0, 100.0) + new DistanceDisplayCondition(10.0, 100.0), ); source.classificationType = new ConstantProperty( - ClassificationType.TERRAIN + ClassificationType.TERRAIN, ); source.zIndex = new ConstantProperty(3); @@ -124,7 +124,7 @@ describe("DataSources/EllipseGraphics", function () { expect(target.numberOfVerticalLines).toBe(source.numberOfVerticalLines); expect(target.shadows).toBe(source.shadows); expect(target.distanceDisplayCondition).toBe( - source.distanceDisplayCondition + source.distanceDisplayCondition, ); expect(target.classificationType).toBe(source.classificationType); expect(target.zIndex).toBe(source.zIndex); @@ -232,7 +232,7 @@ describe("DataSources/EllipseGraphics", function () { expect(result.numberOfVerticalLines).toBe(source.numberOfVerticalLines); expect(result.shadows).toBe(source.shadows); expect(result.distanceDisplayCondition).toBe( - source.distanceDisplayCondition + source.distanceDisplayCondition, ); expect(result.classificationType).toBe(source.classificationType); expect(result.zIndex).toBe(source.zIndex); @@ -265,19 +265,19 @@ describe("DataSources/EllipseGraphics", function () { property, "shadows", ShadowMode.ENABLED, - ShadowMode.DISABLED + ShadowMode.DISABLED, ); testDefinitionChanged( property, "distanceDisplayCondition", new DistanceDisplayCondition(), - new DistanceDisplayCondition(10.0, 100.0) + new DistanceDisplayCondition(10.0, 100.0), ); testDefinitionChanged( property, "classificationType", ClassificationType.TERRAIN, - ClassificationType.BOTH + ClassificationType.BOTH, ); testDefinitionChanged(property, "zIndex", 4, 0); }); diff --git a/packages/engine/Specs/DataSources/EllipsoidGeometryUpdaterSpec.js b/packages/engine/Specs/DataSources/EllipsoidGeometryUpdaterSpec.js index 15429632c911..767061d8bbba 100644 --- a/packages/engine/Specs/DataSources/EllipsoidGeometryUpdaterSpec.js +++ b/packages/engine/Specs/DataSources/EllipsoidGeometryUpdaterSpec.js @@ -44,7 +44,7 @@ describe( const entity = new Entity(); entity.position = new ConstantPositionProperty( - Cartesian3.fromDegrees(0, 0, 0) + Cartesian3.fromDegrees(0, 0, 0), ); entity.ellipsoid = ellipsoid; return entity; @@ -254,29 +254,29 @@ describe( expect(instance.geometry._offsetAttribute).toBeUndefined(); graphics.heightReference = new ConstantProperty( - HeightReference.CLAMP_TO_GROUND + HeightReference.CLAMP_TO_GROUND, ); updater._onEntityPropertyChanged(entity, "ellipsoid"); instance = updater.createFillGeometryInstance(time); expect(instance.geometry._offsetAttribute).toEqual( - GeometryOffsetAttribute.ALL + GeometryOffsetAttribute.ALL, ); instance = updater.createOutlineGeometryInstance(time); expect(instance.geometry._offsetAttribute).toEqual( - GeometryOffsetAttribute.ALL + GeometryOffsetAttribute.ALL, ); graphics.heightReference = new ConstantProperty( - HeightReference.RELATIVE_TO_GROUND + HeightReference.RELATIVE_TO_GROUND, ); updater._onEntityPropertyChanged(entity, "ellipsoid"); instance = updater.createFillGeometryInstance(time); expect(instance.geometry._offsetAttribute).toEqual( - GeometryOffsetAttribute.ALL + GeometryOffsetAttribute.ALL, ); instance = updater.createOutlineGeometryInstance(time); expect(instance.geometry._offsetAttribute).toEqual( - GeometryOffsetAttribute.ALL + GeometryOffsetAttribute.ALL, ); }); @@ -285,7 +285,7 @@ describe( const updater = new EllipsoidGeometryUpdater(entity, scene); expect(updater._computeCenter(time)).toEqual( - entity.position.getValue(time) + entity.position.getValue(time), ); }); @@ -306,7 +306,7 @@ describe( const dynamicUpdater = updater.createDynamicUpdater( primitives, - new PrimitiveCollection() + new PrimitiveCollection(), ); expect(dynamicUpdater.isDestroyed()).toBe(false); expect(primitives.length).toBe(0); @@ -344,7 +344,7 @@ describe( const dynamicUpdater = updater.createDynamicUpdater( primitives, - new PrimitiveCollection() + new PrimitiveCollection(), ); dynamicUpdater.update(time); expect(primitives.length).toBe(2); //Ellipsoid always has both fill and outline primitives regardless of setting @@ -389,7 +389,7 @@ describe( ellipsoid.innerRadii = createDynamicProperty(new Cartesian3(0.5, 1, 1.5)); // Turns 3d mode path off ellipsoid.heightReference = new ConstantProperty( - HeightReference.RELATIVE_TO_GROUND + HeightReference.RELATIVE_TO_GROUND, ); ellipsoid.material = new ColorMaterialProperty(Color.RED); @@ -403,7 +403,7 @@ describe( const dynamicUpdater = updater.createDynamicUpdater( primitives, - new PrimitiveCollection() + new PrimitiveCollection(), ); dynamicUpdater.update(time); @@ -411,7 +411,7 @@ describe( scene.render(); expect(dynamicUpdater._options.innerRadii).toEqual( - ellipsoid.innerRadii.getValue() + ellipsoid.innerRadii.getValue(), ); }); @@ -430,7 +430,7 @@ describe( const dynamicUpdater = updater.createDynamicUpdater( primitives, - new PrimitiveCollection() + new PrimitiveCollection(), ); dynamicUpdater.update(time); @@ -461,7 +461,7 @@ describe( const dynamicUpdater = updater.createDynamicUpdater( primitives, - new PrimitiveCollection() + new PrimitiveCollection(), ); dynamicUpdater.update(time); expect(primitives.length).toBe(2); //Ellipsoid always has both fill and outline primitives regardless of setting @@ -479,15 +479,15 @@ describe( let attributes = primitives.get(0).getGeometryInstanceAttributes(entity); expect(attributes.show[0]).toEqual(0); expect(primitives.get(0).appearance.material.uniforms.color).toEqual( - ellipsoid.material.color.getValue() + ellipsoid.material.color.getValue(), ); attributes = primitives.get(1).getGeometryInstanceAttributes(entity); expect(attributes.show[0]).toEqual(0); expect(attributes.color).toEqual( ColorGeometryInstanceAttribute.toValue( - ellipsoid.outlineColor.getValue() - ) + ellipsoid.outlineColor.getValue(), + ), ); }); @@ -532,15 +532,15 @@ describe( EllipsoidGeometryUpdater, "ellipsoid", createBasicEllipsoid, - getScene + getScene, ); createDynamicGeometryUpdaterSpecs( EllipsoidGeometryUpdater, "ellipsoid", createDynamicEllipsoid, - getScene + getScene, ); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/DataSources/EllipsoidGraphicsSpec.js b/packages/engine/Specs/DataSources/EllipsoidGraphicsSpec.js index adb4edd3efc0..3a31b4213f7e 100644 --- a/packages/engine/Specs/DataSources/EllipsoidGraphicsSpec.js +++ b/packages/engine/Specs/DataSources/EllipsoidGraphicsSpec.js @@ -43,10 +43,10 @@ describe("DataSources/EllipsoidGraphics", function () { expect(ellipsoid.material.color.getValue()).toEqual(options.material); expect(ellipsoid.show.getValue()).toEqual(options.show); expect(ellipsoid.stackPartitions.getValue()).toEqual( - options.stackPartitions + options.stackPartitions, ); expect(ellipsoid.slicePartitions.getValue()).toEqual( - options.slicePartitions + options.slicePartitions, ); expect(ellipsoid.subdivisions.getValue()).toEqual(options.subdivisions); expect(ellipsoid.fill.getValue()).toEqual(options.fill); @@ -55,7 +55,7 @@ describe("DataSources/EllipsoidGraphics", function () { expect(ellipsoid.outlineWidth.getValue()).toEqual(options.outlineWidth); expect(ellipsoid.shadows.getValue()).toEqual(options.shadows); expect(ellipsoid.distanceDisplayCondition.getValue()).toEqual( - options.distanceDisplayCondition + options.distanceDisplayCondition, ); }); @@ -78,7 +78,7 @@ describe("DataSources/EllipsoidGraphics", function () { source.outlineWidth = new ConstantProperty(); source.shadows = new ConstantProperty(ShadowMode.ENABLED); source.distanceDisplayCondition = new ConstantProperty( - new DistanceDisplayCondition() + new DistanceDisplayCondition(), ); const target = new EllipsoidGraphics(); @@ -101,7 +101,7 @@ describe("DataSources/EllipsoidGraphics", function () { expect(target.outlineWidth).toBe(source.outlineWidth); expect(target.shadows).toBe(source.shadows); expect(target.distanceDisplayCondition).toBe( - source.distanceDisplayCondition + source.distanceDisplayCondition, ); }); @@ -195,7 +195,7 @@ describe("DataSources/EllipsoidGraphics", function () { expect(result.outlineWidth).toBe(source.outlineWidth); expect(result.shadows).toBe(source.shadows); expect(result.distanceDisplayCondition).toBe( - source.distanceDisplayCondition + source.distanceDisplayCondition, ); // Clone with source passed @@ -212,7 +212,7 @@ describe("DataSources/EllipsoidGraphics", function () { expect(result.outlineWidth).toBe(source.outlineWidth); expect(result.shadows).toBe(source.shadows); expect(result.distanceDisplayCondition).toBe( - source.distanceDisplayCondition + source.distanceDisplayCondition, ); }); @@ -230,7 +230,7 @@ describe("DataSources/EllipsoidGraphics", function () { property, "radii", new Cartesian3(1, 2, 3), - new Cartesian3(4, 5, 6) + new Cartesian3(4, 5, 6), ); testDefinitionChanged(property, "show", true, false); testDefinitionChanged(property, "stackPartitions", 1, 2); @@ -244,13 +244,13 @@ describe("DataSources/EllipsoidGraphics", function () { property, "shadows", ShadowMode.ENABLED, - ShadowMode.DISABLED + ShadowMode.DISABLED, ); testDefinitionChanged( property, "distanceDisplayCondition", new DistanceDisplayCondition(), - new DistanceDisplayCondition(10.0, 100.0) + new DistanceDisplayCondition(10.0, 100.0), ); }); }); diff --git a/packages/engine/Specs/DataSources/EntityClusterSpec.js b/packages/engine/Specs/DataSources/EntityClusterSpec.js index 2d4aa8beb9ce..e1c70e5e3fd3 100644 --- a/packages/engine/Specs/DataSources/EntityClusterSpec.js +++ b/packages/engine/Specs/DataSources/EntityClusterSpec.js @@ -158,7 +158,7 @@ describe( billboard.position = SceneTransforms.drawingBufferToWorldCoordinates( scene, new Cartesian2(0.0, 0.0), - depth + depth, ); entity = new Entity(); @@ -168,7 +168,7 @@ describe( billboard.position = SceneTransforms.drawingBufferToWorldCoordinates( scene, new Cartesian2(scene.canvas.clientWidth, scene.canvas.clientHeight), - depth + depth, ); const frameState = scene.frameState; @@ -200,7 +200,7 @@ describe( label.position = SceneTransforms.drawingBufferToWorldCoordinates( scene, new Cartesian2(0.0, 0.0), - depth + depth, ); entity = new Entity(); @@ -210,7 +210,7 @@ describe( label.position = SceneTransforms.drawingBufferToWorldCoordinates( scene, new Cartesian2(scene.canvas.clientWidth, scene.canvas.clientHeight), - depth + depth, ); const frameState = scene.frameState; @@ -241,7 +241,7 @@ describe( point.position = SceneTransforms.drawingBufferToWorldCoordinates( scene, new Cartesian2(0.0, 0.0), - depth + depth, ); entity = new Entity(); @@ -251,7 +251,7 @@ describe( point.position = SceneTransforms.drawingBufferToWorldCoordinates( scene, new Cartesian2(scene.canvas.clientWidth, scene.canvas.clientHeight), - depth + depth, ); const frameState = scene.frameState; @@ -282,7 +282,7 @@ describe( point.position = SceneTransforms.drawingBufferToWorldCoordinates( scene, new Cartesian2(0.0, 0.0), - depth + depth, ); entity = new Entity(); @@ -292,7 +292,7 @@ describe( point.position = SceneTransforms.drawingBufferToWorldCoordinates( scene, new Cartesian2(scene.canvas.clientWidth, scene.canvas.clientHeight), - depth + depth, ); cluster.enabled = true; @@ -313,7 +313,7 @@ describe( point.position = SceneTransforms.drawingBufferToWorldCoordinates( scene, new Cartesian2(0.0, 0.0), - depth + depth, ); entity = new Entity(); @@ -323,7 +323,7 @@ describe( point.position = SceneTransforms.drawingBufferToWorldCoordinates( scene, new Cartesian2(scene.canvas.clientWidth, scene.canvas.clientHeight), - depth + depth, ); const frameState = scene.frameState; @@ -355,13 +355,13 @@ describe( cluster.getPoint(entity); expect( - cluster._collectionIndicesByEntity[entity.id].billboardIndex + cluster._collectionIndicesByEntity[entity.id].billboardIndex, ).toBeDefined(); expect( - cluster._collectionIndicesByEntity[entity.id].labelIndex + cluster._collectionIndicesByEntity[entity.id].labelIndex, ).toBeDefined(); expect( - cluster._collectionIndicesByEntity[entity.id].pointIndex + cluster._collectionIndicesByEntity[entity.id].pointIndex, ).toBeDefined(); }); @@ -436,7 +436,7 @@ describe( billboard.position = SceneTransforms.drawingBufferToWorldCoordinates( scene, new Cartesian2(0.0, 0.0), - depth + depth, ); entity = new Entity(); @@ -446,7 +446,7 @@ describe( billboard.position = SceneTransforms.drawingBufferToWorldCoordinates( scene, new Cartesian2(scene.canvas.clientWidth, scene.canvas.clientHeight), - depth + depth, ); const frameState = scene.frameState; @@ -477,7 +477,7 @@ describe( billboard.position = SceneTransforms.drawingBufferToWorldCoordinates( scene, new Cartesian2(0.0, 0.0), - depth + depth, ); entity = new Entity(); @@ -487,7 +487,7 @@ describe( billboard.position = SceneTransforms.drawingBufferToWorldCoordinates( scene, new Cartesian2(scene.canvas.clientWidth, 0), - depth + depth, ); entity = new Entity(); @@ -497,7 +497,7 @@ describe( billboard.position = SceneTransforms.drawingBufferToWorldCoordinates( scene, new Cartesian2(0, scene.canvas.clientHeight), - depth + depth, ); entity = new Entity(); @@ -507,7 +507,7 @@ describe( billboard.position = SceneTransforms.drawingBufferToWorldCoordinates( scene, new Cartesian2(scene.canvas.clientWidth, scene.canvas.clientHeight), - depth + depth, ); const frameState = scene.frameState; @@ -538,7 +538,7 @@ describe( billboard.position = SceneTransforms.drawingBufferToWorldCoordinates( scene, new Cartesian2(0.0, 0.0), - farDepth + farDepth, ); entity = new Entity(); @@ -548,7 +548,7 @@ describe( billboard.position = SceneTransforms.drawingBufferToWorldCoordinates( scene, new Cartesian2(scene.canvas.clientWidth, scene.canvas.clientHeight), - farDepth + farDepth, ); const frameState = scene.frameState; @@ -562,7 +562,7 @@ describe( expect(cluster._clusterLabelCollection.length).toEqual(1); const position = Cartesian3.clone( - cluster._clusterLabelCollection.get(0).position + cluster._clusterLabelCollection.get(0).position, ); scene.camera.moveForward(1.0e-6); @@ -572,7 +572,7 @@ describe( expect(cluster._clusterLabelCollection).toBeDefined(); expect(cluster._clusterLabelCollection.length).toEqual(1); expect(cluster._clusterLabelCollection.get(0).position).toEqual( - position + position, ); }); }); @@ -581,14 +581,13 @@ describe( cluster = new EntityCluster(); cluster._initialize(scene); - cluster.clusterEvent.addEventListener(function ( - clusteredEntities, - cluster - ) { - cluster.billboard.show = true; - cluster.billboard.image = createBillboardImage(); - cluster.label.text = "cluster"; - }); + cluster.clusterEvent.addEventListener( + function (clusteredEntities, cluster) { + cluster.billboard.show = true; + cluster.billboard.image = createBillboardImage(); + cluster.label.text = "cluster"; + }, + ); let entity = new Entity(); let point = cluster.getPoint(entity); @@ -597,7 +596,7 @@ describe( point.position = SceneTransforms.drawingBufferToWorldCoordinates( scene, new Cartesian2(0.0, 0.0), - farDepth + farDepth, ); entity = new Entity(); @@ -607,7 +606,7 @@ describe( point.position = SceneTransforms.drawingBufferToWorldCoordinates( scene, new Cartesian2(scene.canvas.clientWidth, scene.canvas.clientHeight), - farDepth + farDepth, ); const frameState = scene.frameState; @@ -637,7 +636,7 @@ describe( dataSource._visualizers = DataSourceDisplay.defaultVisualizersCallback( scene, cluster, - dataSource + dataSource, ); const entityCollection = dataSource.entities; @@ -646,7 +645,7 @@ describe( position: SceneTransforms.drawingBufferToWorldCoordinates( scene, new Cartesian2(0.0, 0.0), - depth + depth, ), billboard: { image: createBillboardImage(), @@ -660,7 +659,7 @@ describe( position: SceneTransforms.drawingBufferToWorldCoordinates( scene, new Cartesian2(scene.canvas.clientWidth, scene.canvas.clientHeight), - depth + depth, ), billboard: { image: createBillboardImage(), @@ -693,5 +692,5 @@ describe( expect(cluster._billboardCollection.length).toEqual(2); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/DataSources/EntityCollectionSpec.js b/packages/engine/Specs/DataSources/EntityCollectionSpec.js index a8b94f763355..a00f5d431079 100644 --- a/packages/engine/Specs/DataSources/EntityCollectionSpec.js +++ b/packages/engine/Specs/DataSources/EntityCollectionSpec.js @@ -18,7 +18,7 @@ describe("DataSources/EntityCollection", function () { collection, added, removed, - changed + changed, ) { this.timesCalled++; this.added = added.slice(0); @@ -101,7 +101,7 @@ describe("DataSources/EntityCollection", function () { const listener = new CollectionListener(); entityCollection.collectionChanged.addEventListener( listener.onCollectionChanged, - listener + listener, ); entityCollection.add(entity); @@ -140,7 +140,7 @@ describe("DataSources/EntityCollection", function () { entityCollection.collectionChanged.removeEventListener( listener.onCollectionChanged, - listener + listener, ); }); @@ -213,7 +213,7 @@ describe("DataSources/EntityCollection", function () { const listener = new CollectionListener(); entityCollection.collectionChanged.addEventListener( listener.onCollectionChanged, - listener + listener, ); entityCollection.suspendEvents(); @@ -260,7 +260,7 @@ describe("DataSources/EntityCollection", function () { entityCollection.collectionChanged.removeEventListener( listener.onCollectionChanged, - listener + listener, ); }); @@ -287,7 +287,7 @@ describe("DataSources/EntityCollection", function () { entityCollection.collectionChanged.addEventListener( listener.onCollectionChanged, - listener + listener, ); entityCollection.removeAll(); @@ -302,7 +302,7 @@ describe("DataSources/EntityCollection", function () { entityCollection.collectionChanged.removeEventListener( listener.onCollectionChanged, - listener + listener, ); }); @@ -318,7 +318,7 @@ describe("DataSources/EntityCollection", function () { entityCollection.collectionChanged.addEventListener( listener.onCollectionChanged, - listener + listener, ); entityCollection.suspendEvents(); @@ -342,7 +342,7 @@ describe("DataSources/EntityCollection", function () { entityCollection.collectionChanged.removeEventListener( listener.onCollectionChanged, - listener + listener, ); }); @@ -406,13 +406,13 @@ describe("DataSources/EntityCollection", function () { entity.availability.addInterval( TimeInterval.fromIso8601({ iso8601: "2012-08-01/2012-08-02", - }) + }), ); entity2.availability = new TimeIntervalCollection(); entity2.availability.addInterval( TimeInterval.fromIso8601({ iso8601: "2012-08-05/2012-08-06", - }) + }), ); entity3.availability = undefined; @@ -432,13 +432,13 @@ describe("DataSources/EntityCollection", function () { entity.availability.addInterval( TimeInterval.fromIso8601({ iso8601: "2012-08-01/9999-12-31T24:00:00Z", - }) + }), ); entity2.availability = new TimeIntervalCollection(); entity2.availability.addInterval( TimeInterval.fromIso8601({ iso8601: "0000-01-01T00:00:00Z/2012-08-06", - }) + }), ); entity3.availability = undefined; diff --git a/packages/engine/Specs/DataSources/EntitySpec.js b/packages/engine/Specs/DataSources/EntitySpec.js index f38163f0d0e3..4edfdbffc4da 100644 --- a/packages/engine/Specs/DataSources/EntitySpec.js +++ b/packages/engine/Specs/DataSources/EntitySpec.js @@ -145,15 +145,15 @@ describe("DataSources/Entity", function () { entity.availability = intervals; expect( entity.isAvailable( - JulianDate.addSeconds(interval.start, -1, new JulianDate()) - ) + JulianDate.addSeconds(interval.start, -1, new JulianDate()), + ), ).toEqual(false); expect(entity.isAvailable(interval.start)).toEqual(true); expect(entity.isAvailable(interval.stop)).toEqual(true); expect( entity.isAvailable( - JulianDate.addSeconds(interval.stop, 1, new JulianDate()) - ) + JulianDate.addSeconds(interval.stop, 1, new JulianDate()), + ), ).toEqual(false); }); @@ -198,7 +198,7 @@ describe("DataSources/Entity", function () { entity, propertyName, newValue, - oldValue + oldValue, ); }); @@ -298,7 +298,7 @@ describe("DataSources/Entity", function () { const modelMatrix = entity.computeModelMatrix(new JulianDate()); const expected = Matrix4.fromRotationTranslation( Matrix3.fromQuaternion(orientation), - position + position, ); expect(modelMatrix).toEqual(expected); }); diff --git a/packages/engine/Specs/DataSources/EntityViewSpec.js b/packages/engine/Specs/DataSources/EntityViewSpec.js index 5cba71e6ca8b..1406cf8207d3 100644 --- a/packages/engine/Specs/DataSources/EntityViewSpec.js +++ b/packages/engine/Specs/DataSources/EntityViewSpec.js @@ -56,7 +56,7 @@ describe( EntityView.defaultOffset3D = sampleOffset; const entity = new Entity(); entity.position = new ConstantPositionProperty( - Cartesian3.fromDegrees(0.0, 0.0) + Cartesian3.fromDegrees(0.0, 0.0), ); const view = new EntityView(entity, scene); view.update(JulianDate.now()); @@ -68,7 +68,7 @@ describe( const sampleOffset = new Cartesian3(1, 2, 3); const entity = new Entity(); entity.position = new ConstantPositionProperty( - Cartesian3.fromDegrees(0.0, 0.0) + Cartesian3.fromDegrees(0.0, 0.0), ); entity.viewFrom = sampleOffset; const view = new EntityView(entity, scene); @@ -80,16 +80,16 @@ describe( const sampleOffset = new Cartesian3( -1.3322676295501878e-15, -7.348469228349534, - 7.3484692283495345 + 7.3484692283495345, ); const entity = new Entity(); entity.position = new ConstantPositionProperty( - Cartesian3.fromDegrees(0.0, 0.0) + Cartesian3.fromDegrees(0.0, 0.0), ); const view = new EntityView(entity, scene, undefined); view.update( JulianDate.now(), - new BoundingSphere(new Cartesian3(3, 4, 5), 6) + new BoundingSphere(new Cartesian3(3, 4, 5), 6), ); expect(view.scene.camera.position).toEqualEpsilon(sampleOffset, 1e-10); }); @@ -98,14 +98,14 @@ describe( const sampleOffset = new Cartesian3(1, 2, 3); const entity = new Entity(); entity.position = new ConstantPositionProperty( - Cartesian3.fromDegrees(0.0, 0.0) + Cartesian3.fromDegrees(0.0, 0.0), ); entity.viewFrom = sampleOffset; const view = new EntityView( entity, scene, undefined, - new BoundingSphere(new Cartesian3(3, 4, 5), 6) + new BoundingSphere(new Cartesian3(3, 4, 5), 6), ); view.update(JulianDate.now()); expect(view.scene.camera.position).toEqualEpsilon(sampleOffset, 1e-10); @@ -126,5 +126,5 @@ describe( view.update(JulianDate.now()); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/DataSources/GeoJsonDataSourceSpec.js b/packages/engine/Specs/DataSources/GeoJsonDataSourceSpec.js index aff11fe035c4..c702bea93968 100644 --- a/packages/engine/Specs/DataSources/GeoJsonDataSourceSpec.js +++ b/packages/engine/Specs/DataSources/GeoJsonDataSourceSpec.js @@ -48,7 +48,7 @@ describe("DataSources/GeoJsonDataSource", function () { return Cartesian3.fromDegrees( coordinates[0], coordinates[1], - coordinates[2] + coordinates[2], ); } @@ -414,7 +414,7 @@ describe("DataSources/GeoJsonDataSource", function () { const entity = entityCollection.values[0]; expect(entity.properties).toBe(feature.properties); expect(entity.position.getValue(time)).toEqual( - coordinatesToCartesian(feature.geometry.coordinates) + coordinatesToCartesian(feature.geometry.coordinates), ); expect(entity.billboard).toBeDefined(); }); @@ -523,7 +523,7 @@ describe("DataSources/GeoJsonDataSource", function () { function testDescribeProperty(properties, nameProperty) { return new CallbackProperty( createDescriptionCallback(testDescribe, properties, nameProperty), - true + true, ); } @@ -559,7 +559,7 @@ describe("DataSources/GeoJsonDataSource", function () { const entity = entityCollection.values[0]; expect(entity.description).toBeDefined(); expect(entity.description.getValue(time)).toEqual( - featureWithDescription.properties.description + featureWithDescription.properties.description, ); }); }); @@ -588,13 +588,13 @@ describe("DataSources/GeoJsonDataSource", function () { const entity = entityCollection.values[0]; expect(entity.name).toBeUndefined(); expect(entity.properties.name.getValue()).toBe( - featureWithNullName.properties.name + featureWithNullName.properties.name, ); expect(entity.properties.getValue(time)).toEqual( - featureWithNullName.properties + featureWithNullName.properties, ); expect(entity.position.getValue(time)).toEqual( - coordinatesToCartesian(featureWithNullName.geometry.coordinates) + coordinatesToCartesian(featureWithNullName.geometry.coordinates), ); expect(entity.billboard).toBeDefined(); }); @@ -665,7 +665,7 @@ describe("DataSources/GeoJsonDataSource", function () { const entity = entityCollection.values[0]; expect(entity.properties).toBe(point.properties); expect(entity.position.getValue(time)).toEqual( - coordinatesToCartesian(point.coordinates) + coordinatesToCartesian(point.coordinates), ); expect(entity.billboard).toBeDefined(); expect(entity.billboard.image).toBeDefined(); @@ -683,12 +683,12 @@ describe("DataSources/GeoJsonDataSource", function () { const entity = entityCollection.values[0]; expect(entity.properties).toBe(point.properties); expect(entity.position.getValue(time)).toEqual( - coordinatesToCartesian(point.coordinates) + coordinatesToCartesian(point.coordinates), ); expect(entity.billboard).toBeDefined(); expect(entity.billboard.image).toBeDefined(); expect(entity.billboard.heightReference.getValue(time)).toBe( - HeightReference.CLAMP_TO_GROUND + HeightReference.CLAMP_TO_GROUND, ); }); }); @@ -710,7 +710,7 @@ describe("DataSources/GeoJsonDataSource", function () { const entity = entityCollection.values[0]; expect(entity.billboard).toBeDefined(); return Promise.resolve( - dataSource._pinBuilder.fromMakiIconId("bus", Color.WHITE, 64) + dataSource._pinBuilder.fromMakiIconId("bus", Color.WHITE, 64), ).then(function (image) { expect(entity.billboard.image.getValue()).toBe(image); }); @@ -732,7 +732,7 @@ describe("DataSources/GeoJsonDataSource", function () { return dataSource.load(geojson).then(function () { const image = dataSource._pinBuilder.fromColor( GeoJsonDataSource.markerColor, - GeoJsonDataSource.markerSize + GeoJsonDataSource.markerSize, ); const entityCollection = dataSource.entities; const entity = entityCollection.values[0]; @@ -758,7 +758,7 @@ describe("DataSources/GeoJsonDataSource", function () { const entity = entityCollection.values[0]; expect(entity.billboard).toBeDefined(); return Promise.resolve( - dataSource._pinBuilder.fromColor(Color.WHITE, 64) + dataSource._pinBuilder.fromColor(Color.WHITE, 64), ).then(function (image) { expect(entity.billboard.image.getValue()).toBe(image); }); @@ -771,7 +771,7 @@ describe("DataSources/GeoJsonDataSource", function () { const entityCollection = dataSource.entities; const entities = entityCollection.values; const expectedPositions = coordinatesArrayToCartesian( - multiPoint.coordinates + multiPoint.coordinates, ); for (let i = 0; i < multiPoint.coordinates.length; i++) { const entity = entities[i]; @@ -790,7 +790,7 @@ describe("DataSources/GeoJsonDataSource", function () { const entityCollection = dataSource.entities; const entities = entityCollection.values; const expectedPositions = coordinatesArrayToCartesian( - multiPoint.coordinates + multiPoint.coordinates, ); for (let i = 0; i < multiPoint.coordinates.length; i++) { const entity = entities[i]; @@ -799,7 +799,7 @@ describe("DataSources/GeoJsonDataSource", function () { expect(entity.billboard).toBeDefined(); expect(entity.billboard.image).toBeDefined(); expect(entity.billboard.heightReference.getValue()).toBe( - HeightReference.CLAMP_TO_GROUND + HeightReference.CLAMP_TO_GROUND, ); } }); @@ -812,10 +812,10 @@ describe("DataSources/GeoJsonDataSource", function () { const entity = entityCollection.values[0]; expect(entity.properties).toBe(lineString.properties); expect(entity.polyline.positions.getValue(time)).toEqual( - coordinatesArrayToCartesian(lineString.coordinates) + coordinatesArrayToCartesian(lineString.coordinates), ); expect(entity.polyline.material.color.getValue(time)).toEqual( - GeoJsonDataSource.stroke + GeoJsonDataSource.stroke, ); expect(entity.polyline.width.getValue(time)).toEqual(2); }); @@ -832,10 +832,10 @@ describe("DataSources/GeoJsonDataSource", function () { const entity = entityCollection.values[0]; expect(entity.properties).toBe(lineString.properties); expect(entity.polyline.positions.getValue(time)).toEqual( - coordinatesArrayToCartesian(lineString.coordinates) + coordinatesArrayToCartesian(lineString.coordinates), ); expect(entity.polyline.material.color.getValue(time)).toEqual( - GeoJsonDataSource.stroke + GeoJsonDataSource.stroke, ); expect(entity.polyline.width.getValue(time)).toEqual(2); expect(entity.polyline.clampToGround.getValue(time)).toEqual(true); @@ -853,7 +853,7 @@ describe("DataSources/GeoJsonDataSource", function () { expect(entity.properties).toBe(multiLineString.properties); expect(entity.polyline.positions.getValue(time)).toEqual(lines[i]); expect(entity.polyline.material.color.getValue(time)).toEqual( - Color.YELLOW + Color.YELLOW, ); expect(entity.polyline.width.getValue(time)).toEqual(2); } @@ -875,7 +875,7 @@ describe("DataSources/GeoJsonDataSource", function () { expect(entity.properties).toBe(multiLineString.properties); expect(entity.polyline.positions.getValue(time)).toEqual(lines[i]); expect(entity.polyline.material.color.getValue(time)).toEqual( - Color.YELLOW + Color.YELLOW, ); expect(entity.polyline.width.getValue(time)).toEqual(2); expect(entity.polyline.clampToGround.getValue(time)).toEqual(true); @@ -891,19 +891,19 @@ describe("DataSources/GeoJsonDataSource", function () { expect(entity.properties).toBe(polygon.properties); expect(entity.polygon.hierarchy.getValue(time)).toEqual( new PolygonHierarchy( - polygonCoordinatesToCartesian(polygon.coordinates[0]) - ) + polygonCoordinatesToCartesian(polygon.coordinates[0]), + ), ); expect(entity.polygon.perPositionHeight).toBeUndefined(); expect(entity.polygon.material.color.getValue(time)).toEqual( - GeoJsonDataSource.fill + GeoJsonDataSource.fill, ); expect(entity.polygon.outline.getValue(time)).toEqual(true); expect(entity.polygon.outlineWidth.getValue(time)).toEqual( - GeoJsonDataSource.strokeWidth + GeoJsonDataSource.strokeWidth, ); expect(entity.polygon.outlineColor.getValue(time)).toEqual( - GeoJsonDataSource.stroke + GeoJsonDataSource.stroke, ); expect(entity.polygon.height).toBeInstanceOf(ConstantProperty); }); @@ -921,19 +921,19 @@ describe("DataSources/GeoJsonDataSource", function () { expect(entity.properties).toBe(polygon.properties); expect(entity.polygon.hierarchy.getValue(time)).toEqual( new PolygonHierarchy( - polygonCoordinatesToCartesian(polygon.coordinates[0]) - ) + polygonCoordinatesToCartesian(polygon.coordinates[0]), + ), ); expect(entity.polygon.perPositionHeight).toBeUndefined(); expect(entity.polygon.material.color.getValue(time)).toEqual( - GeoJsonDataSource.fill + GeoJsonDataSource.fill, ); expect(entity.polygon.outline.getValue(time)).toEqual(true); expect(entity.polygon.outlineWidth.getValue(time)).toEqual( - GeoJsonDataSource.strokeWidth + GeoJsonDataSource.strokeWidth, ); expect(entity.polygon.outlineColor.getValue(time)).toEqual( - GeoJsonDataSource.stroke + GeoJsonDataSource.stroke, ); expect(entity.polygon.height).toBeUndefined(); }); @@ -947,19 +947,19 @@ describe("DataSources/GeoJsonDataSource", function () { expect(entity.properties).toBe(polygonWithHeights.properties); expect(entity.polygon.hierarchy.getValue(time)).toEqual( new PolygonHierarchy( - polygonCoordinatesToCartesian(polygonWithHeights.coordinates[0]) - ) + polygonCoordinatesToCartesian(polygonWithHeights.coordinates[0]), + ), ); expect(entity.polygon.perPositionHeight.getValue(time)).toBe(true); expect(entity.polygon.material.color.getValue(time)).toEqual( - GeoJsonDataSource.fill + GeoJsonDataSource.fill, ); expect(entity.polygon.outline.getValue(time)).toEqual(true); expect(entity.polygon.outlineWidth.getValue(time)).toEqual( - GeoJsonDataSource.strokeWidth + GeoJsonDataSource.strokeWidth, ); expect(entity.polygon.outlineColor.getValue(time)).toEqual( - GeoJsonDataSource.stroke + GeoJsonDataSource.stroke, ); }); }); @@ -975,10 +975,10 @@ describe("DataSources/GeoJsonDataSource", function () { polygonCoordinatesToCartesian(polygonWithHoles.coordinates[0]), [ new PolygonHierarchy( - polygonCoordinatesToCartesian(polygonWithHoles.coordinates[1]) + polygonCoordinatesToCartesian(polygonWithHoles.coordinates[1]), ), - ] - ) + ], + ), ); }); }); @@ -989,13 +989,13 @@ describe("DataSources/GeoJsonDataSource", function () { const entityCollection = dataSource.entities; const entities = entityCollection.values; const positions = multiPolygonCoordinatesToCartesian( - multiPolygon.coordinates + multiPolygon.coordinates, ); for (let i = 0; i < multiPolygon.coordinates.length; i++) { const entity = entities[i]; expect(entity.properties).toBe(multiPolygon.properties); expect(entity.polygon.hierarchy.getValue(time)).toEqual( - new PolygonHierarchy(positions[i]) + new PolygonHierarchy(positions[i]), ); } }); @@ -1009,20 +1009,20 @@ describe("DataSources/GeoJsonDataSource", function () { const polygon = entities[0]; expect(polygon.properties.myProps.getValue()).toBe( - topoJson.objects.polygon.properties.myProps + topoJson.objects.polygon.properties.myProps, ); expect(polygon.properties.getValue(time)).toEqual( - topoJson.objects.polygon.properties + topoJson.objects.polygon.properties, ); expect(polygon.polygon.hierarchy).toBeDefined(); const lineString = entities[1]; expect(lineString.properties.myProps.getValue()).toBe( - topoJson.objects.lineString.properties.myProps + topoJson.objects.lineString.properties.myProps, ); expect(lineString.properties.getValue(time)).toEqual( - topoJson.objects.lineString.properties + topoJson.objects.lineString.properties, ); expect(lineString.polyline).toBeDefined(); @@ -1052,14 +1052,14 @@ describe("DataSources/GeoJsonDataSource", function () { expect(entity.polygon.material.color.getValue()).toEqual(options.fill); expect(entity.polygon.outlineColor.getValue()).toEqual(options.stroke); expect(entity.polygon.outlineWidth.getValue()).toEqual( - options.strokeWidth + options.strokeWidth, ); entity = entities[2]; const expectedImage = dataSource._pinBuilder.fromMakiIconId( options.markerSymbol, options.markerColor, - options.markerSize + options.markerSize, ); expect(entity.billboard.image.getValue()).toEqual(expectedImage); }); @@ -1080,28 +1080,28 @@ describe("DataSources/GeoJsonDataSource", function () { let entity = entities[0]; expect(entity.polyline.material.color.getValue()).toEqual( - GeoJsonDataSource.stroke + GeoJsonDataSource.stroke, ); expect(entity.polyline.width.getValue()).toEqual( - GeoJsonDataSource.strokeWidth + GeoJsonDataSource.strokeWidth, ); entity = entities[1]; expect(entity.polygon.material.color.getValue()).toEqual( - GeoJsonDataSource.fill + GeoJsonDataSource.fill, ); expect(entity.polygon.outlineColor.getValue()).toEqual( - GeoJsonDataSource.stroke + GeoJsonDataSource.stroke, ); expect(entity.polygon.outlineWidth.getValue()).toEqual( - GeoJsonDataSource.strokeWidth + GeoJsonDataSource.strokeWidth, ); entity = entities[2]; const expectedImage = dataSource._pinBuilder.fromMakiIconId( GeoJsonDataSource.markerSymbol, GeoJsonDataSource.markerColor, - GeoJsonDataSource.markerSize + GeoJsonDataSource.markerSize, ); expect(entity.billboard.image.getValue()).toEqual(expectedImage); }); @@ -1124,7 +1124,7 @@ describe("DataSources/GeoJsonDataSource", function () { let entity = entityCollection.values[0]; expect(entity.properties).toBe(geometryCollection.properties); expect(entity.position.getValue(time)).toEqual( - coordinatesToCartesian(geometryCollection.geometries[0].coordinates) + coordinatesToCartesian(geometryCollection.geometries[0].coordinates), ); expect(entity.billboard).toBeDefined(); @@ -1132,8 +1132,8 @@ describe("DataSources/GeoJsonDataSource", function () { expect(entity.properties).toBe(geometryCollection.properties); expect(entity.polyline.positions.getValue(time)).toEqual( coordinatesArrayToCartesian( - geometryCollection.geometries[1].coordinates - ) + geometryCollection.geometries[1].coordinates, + ), ); }); }); @@ -1144,7 +1144,7 @@ describe("DataSources/GeoJsonDataSource", function () { const entityCollection = dataSource.entities; const entity = entityCollection.values[0]; expect(entity.position.getValue(time)).toEqual( - coordinatesToCartesian(point.coordinates) + coordinatesToCartesian(point.coordinates), ); }); }); @@ -1155,7 +1155,7 @@ describe("DataSources/GeoJsonDataSource", function () { const entityCollection = dataSource.entities; const entity = entityCollection.values[0]; expect(entity.position.getValue(time)).toEqual( - coordinatesToCartesian(point.coordinates) + coordinatesToCartesian(point.coordinates), ); }); }); @@ -1166,24 +1166,23 @@ describe("DataSources/GeoJsonDataSource", function () { const entityCollection = dataSource.entities; const entity = entityCollection.values[0]; expect(entity.position.getValue(time)).toEqual( - coordinatesToCartesian(point.coordinates) + coordinatesToCartesian(point.coordinates), ); }); }); it("Works with link crs href", function () { const projectedPosition = new Cartesian3(1, 2, 3); - GeoJsonDataSource.crsLinkHrefs[ - pointCrsLinkHref.crs.properties.href - ] = function (properties) { - expect(properties).toBe(pointCrsLinkHref.crs.properties); - return Promise.resolve(properties.href).then(function (href) { - return function (coordinate) { - expect(coordinate).toBe(pointCrsLinkHref.coordinates); - return projectedPosition; - }; - }); - }; + GeoJsonDataSource.crsLinkHrefs[pointCrsLinkHref.crs.properties.href] = + function (properties) { + expect(properties).toBe(pointCrsLinkHref.crs.properties); + return Promise.resolve(properties.href).then(function (href) { + return function (coordinate) { + expect(coordinate).toBe(pointCrsLinkHref.coordinates); + return projectedPosition; + }; + }); + }; const dataSource = new GeoJsonDataSource(); return dataSource.load(pointCrsLinkHref).then(function () { @@ -1200,7 +1199,7 @@ describe("DataSources/GeoJsonDataSource", function () { const entityCollection = dataSource.entities; const entity = entityCollection.values[0]; expect(entity.position.getValue(time)).toEqual( - coordinatesToCartesian(point.coordinates) + coordinatesToCartesian(point.coordinates), ); }); }); @@ -1230,16 +1229,16 @@ describe("DataSources/GeoJsonDataSource", function () { const entity = entityCollection.values[0]; expect(entity.name).toEqual(geoJson.properties.title); expect(entity.description.getValue(time)).toEqual( - geoJson.properties.description + geoJson.properties.description, ); const expectedColor = Color.fromCssColorString(geoJson.properties.stroke); expectedColor.alpha = geoJson.properties["stroke-opacity"]; expect(entity.polyline.material.color.getValue(time)).toEqual( - expectedColor + expectedColor, ); expect(entity.polyline.width.getValue(time)).toEqual( - geoJson.properties["stroke-width"] + geoJson.properties["stroke-width"], ); }); }); @@ -1270,10 +1269,10 @@ describe("DataSources/GeoJsonDataSource", function () { expect(entity.name).toBeUndefined(); expect(entity.description).toBeUndefined(); expect(entity.polyline.material.color.getValue(time)).toEqual( - GeoJsonDataSource.stroke + GeoJsonDataSource.stroke, ); expect(entity.polyline.width.getValue(time)).toEqual( - GeoJsonDataSource.strokeWidth + GeoJsonDataSource.strokeWidth, ); }); }); @@ -1307,10 +1306,10 @@ describe("DataSources/GeoJsonDataSource", function () { const expectedMaterialColor = GeoJsonDataSource.stroke.clone(); expectedMaterialColor.alpha = 0.42; expect(entity.polyline.material.color.getValue(time)).toEqual( - expectedMaterialColor + expectedMaterialColor, ); expect(entity.polyline.width.getValue(time)).toEqual( - GeoJsonDataSource.strokeWidth + GeoJsonDataSource.strokeWidth, ); }); }); @@ -1347,24 +1346,24 @@ describe("DataSources/GeoJsonDataSource", function () { const entity = entityCollection.values[0]; expect(entity.name).toEqual(geoJson.properties.title); expect(entity.description.getValue(time)).toEqual( - geoJson.properties.description + geoJson.properties.description, ); const expectedFill = Color.fromCssColorString(geoJson.properties.fill); expectedFill.alpha = geoJson.properties["fill-opacity"]; const expectedOutlineColor = Color.fromCssColorString( - geoJson.properties.stroke + geoJson.properties.stroke, ); expectedOutlineColor.alpha = geoJson.properties["stroke-opacity"]; expect(entity.polygon.material.color.getValue(time)).toEqual( - expectedFill + expectedFill, ); expect(entity.polygon.outline.getValue(time)).toEqual(true); expect(entity.polygon.outlineWidth.getValue(time)).toEqual(5); expect(entity.polygon.outlineColor.getValue(time)).toEqual( - expectedOutlineColor + expectedOutlineColor, ); }); }); @@ -1402,14 +1401,14 @@ describe("DataSources/GeoJsonDataSource", function () { expect(entity.name).toBeUndefined(); expect(entity.description).toBeUndefined(); expect(entity.polygon.material.color.getValue(time)).toEqual( - GeoJsonDataSource.fill + GeoJsonDataSource.fill, ); expect(entity.polygon.outline.getValue(time)).toEqual(true); expect(entity.polygon.outlineWidth.getValue(time)).toEqual( - GeoJsonDataSource.strokeWidth + GeoJsonDataSource.strokeWidth, ); expect(entity.polygon.outlineColor.getValue(time)).toEqual( - GeoJsonDataSource.stroke + GeoJsonDataSource.stroke, ); }); }); @@ -1450,17 +1449,17 @@ describe("DataSources/GeoJsonDataSource", function () { const expectedFill = GeoJsonDataSource.fill.clone(); expectedFill.alpha = geoJson.properties["fill-opacity"]; expect(entity.polygon.material.color.getValue(time)).toEqual( - expectedFill + expectedFill, ); const expectedOutlineColor = GeoJsonDataSource.stroke.clone(); expectedOutlineColor.alpha = 0.42; expect(entity.polygon.outline.getValue(time)).toEqual(true); expect(entity.polygon.outlineWidth.getValue(time)).toEqual( - GeoJsonDataSource.strokeWidth + GeoJsonDataSource.strokeWidth, ); expect(entity.polygon.outlineColor.getValue(time)).toEqual( - expectedOutlineColor + expectedOutlineColor, ); }); }); @@ -1517,7 +1516,7 @@ describe("DataSources/GeoJsonDataSource", function () { .catch(function (error) { expect(error).toBeInstanceOf(RuntimeError); expect(error.message).toContain( - "Unsupported GeoJSON object type: TimeyWimey" + "Unsupported GeoJSON object type: TimeyWimey", ); }); }); @@ -1539,11 +1538,11 @@ describe("DataSources/GeoJsonDataSource", function () { crs: null, }; - return GeoJsonDataSource.load(featureWithNullCrs).then(function ( - dataSource - ) { - expect(dataSource.entities.values.length).toBe(0); - }); + return GeoJsonDataSource.load(featureWithNullCrs).then( + function (dataSource) { + expect(dataSource.entities.values.length).toBe(0); + }, + ); }); it("rejects unknown CRS", function () { @@ -1627,7 +1626,7 @@ describe("DataSources/GeoJsonDataSource", function () { .catch(function (error) { expect(error).toBeInstanceOf(RuntimeError); expect(error.message).toContain( - 'Unable to resolve crs link: {"href":"failMe","type":"failMeTwice"}' + 'Unable to resolve crs link: {"href":"failMe","type":"failMeTwice"}', ); }); }); diff --git a/packages/engine/Specs/DataSources/GeometryUpdaterSetSpec.js b/packages/engine/Specs/DataSources/GeometryUpdaterSetSpec.js index 79da7d2f5a34..4aec38f38203 100644 --- a/packages/engine/Specs/DataSources/GeometryUpdaterSetSpec.js +++ b/packages/engine/Specs/DataSources/GeometryUpdaterSetSpec.js @@ -37,7 +37,7 @@ describe("GeometryUpdaterSet", () => { expect(updaterSet.updaters[5]).toBeInstanceOf(PlaneGeometryUpdater); expect(updaterSet.updaters[6]).toBeInstanceOf(PolygonGeometryUpdater); expect(updaterSet.updaters[7]).toBeInstanceOf( - PolylineVolumeGeometryUpdater + PolylineVolumeGeometryUpdater, ); expect(updaterSet.updaters[8]).toBeInstanceOf(RectangleGeometryUpdater); expect(updaterSet.updaters[9]).toBeInstanceOf(WallGeometryUpdater); diff --git a/packages/engine/Specs/DataSources/GeometryUpdaterSpec.js b/packages/engine/Specs/DataSources/GeometryUpdaterSpec.js index 39b3e15e293d..26d4c323ef09 100644 --- a/packages/engine/Specs/DataSources/GeometryUpdaterSpec.js +++ b/packages/engine/Specs/DataSources/GeometryUpdaterSpec.js @@ -84,7 +84,7 @@ describe("DataSources/GeometryUpdater", function () { expect(function () { return updater.createDynamicUpdater( new PrimitiveCollection(), - new PrimitiveCollection() + new PrimitiveCollection(), ); }).toThrowDeveloperError(); }); diff --git a/packages/engine/Specs/DataSources/GeometryVisualizerSpec.js b/packages/engine/Specs/DataSources/GeometryVisualizerSpec.js index 8b8aae5048a2..1cea7ceba254 100644 --- a/packages/engine/Specs/DataSources/GeometryVisualizerSpec.js +++ b/packages/engine/Specs/DataSources/GeometryVisualizerSpec.js @@ -77,7 +77,7 @@ describe( scene, objects, scene.primitives, - scene.groundPrimitives + scene.groundPrimitives, ); expect(visualizer.update(time)).toBe(true); expect(scene.primitives.length).toBe(0); @@ -92,7 +92,7 @@ describe( scene, objects, scene.primitives, - scene.groundPrimitives + scene.groundPrimitives, ); const ellipse = new EllipseGraphics(); @@ -103,7 +103,7 @@ describe( const entity = new Entity(); entity.position = new ConstantPositionProperty( - new Cartesian3(1234, 5678, 9101112) + new Cartesian3(1234, 5678, 9101112), ); entity.ellipse = ellipse; objects.add(entity); @@ -113,10 +113,10 @@ describe( const attributes = primitive.getGeometryInstanceAttributes(entity); expect(attributes).toBeDefined(); expect(attributes.show).toEqual( - ShowGeometryInstanceAttribute.toValue(true) + ShowGeometryInstanceAttribute.toValue(true), ); expect(attributes.color).toEqual( - ColorGeometryInstanceAttribute.toValue(Color.WHITE) + ColorGeometryInstanceAttribute.toValue(Color.WHITE), ); expect(primitive.appearance).toBeInstanceOf(PerInstanceColorAppearance); expect(primitive.appearance.closed).toBe(true); @@ -135,7 +135,7 @@ describe( scene, objects, scene.primitives, - scene.groundPrimitives + scene.groundPrimitives, ); const ellipse = new EllipseGraphics(); @@ -146,7 +146,7 @@ describe( const entity = new Entity(); entity.position = new ConstantPositionProperty( - new Cartesian3(1234, 5678, 9101112) + new Cartesian3(1234, 5678, 9101112), ); entity.ellipse = ellipse; objects.add(entity); @@ -156,7 +156,7 @@ describe( const attributes = primitive.getGeometryInstanceAttributes(entity); expect(attributes).toBeDefined(); expect(attributes.show).toEqual( - ShowGeometryInstanceAttribute.toValue(true) + ShowGeometryInstanceAttribute.toValue(true), ); expect(attributes.color).toBeUndefined(); expect(primitive.appearance).toBeInstanceOf(MaterialAppearance); @@ -176,7 +176,7 @@ describe( scene, objects, scene.primitives, - scene.groundPrimitives + scene.groundPrimitives, ); const ellipse = new EllipseGraphics(); @@ -187,7 +187,7 @@ describe( const entity = new Entity(); entity.position = new ConstantPositionProperty( - new Cartesian3(1234, 5678, 9101112) + new Cartesian3(1234, 5678, 9101112), ); entity.ellipse = ellipse; objects.add(entity); @@ -197,10 +197,10 @@ describe( const attributes = primitive.getGeometryInstanceAttributes(entity); expect(attributes).toBeDefined(); expect(attributes.show).toEqual( - ShowGeometryInstanceAttribute.toValue(true) + ShowGeometryInstanceAttribute.toValue(true), ); expect(attributes.color).toEqual( - ColorGeometryInstanceAttribute.toValue(Color.WHITE) + ColorGeometryInstanceAttribute.toValue(Color.WHITE), ); expect(primitive.appearance).toBeInstanceOf(PerInstanceColorAppearance); expect(primitive.appearance.closed).toBe(true); @@ -219,7 +219,7 @@ describe( scene, objects, scene.primitives, - scene.groundPrimitives + scene.groundPrimitives, ); const ellipse = new EllipseGraphics(); @@ -230,7 +230,7 @@ describe( const entity = new Entity(); entity.position = new ConstantPositionProperty( - new Cartesian3(1234, 5678, 9101112) + new Cartesian3(1234, 5678, 9101112), ); entity.ellipse = ellipse; objects.add(entity); @@ -240,7 +240,7 @@ describe( const attributes = primitive.getGeometryInstanceAttributes(entity); expect(attributes).toBeDefined(); expect(attributes.show).toEqual( - ShowGeometryInstanceAttribute.toValue(true) + ShowGeometryInstanceAttribute.toValue(true), ); expect(attributes.color).toBeUndefined(); expect(primitive.appearance).toBeInstanceOf(MaterialAppearance); @@ -260,7 +260,7 @@ describe( scene, objects, scene.primitives, - scene.groundPrimitives + scene.groundPrimitives, ); const ellipse = new EllipseGraphics(); @@ -272,7 +272,7 @@ describe( const entity = new Entity(); entity.position = new ConstantPositionProperty( - new Cartesian3(1234, 5678, 9101112) + new Cartesian3(1234, 5678, 9101112), ); entity.ellipse = ellipse; objects.add(entity); @@ -282,10 +282,10 @@ describe( const attributes = primitive.getGeometryInstanceAttributes(entity); expect(attributes).toBeDefined(); expect(attributes.show).toEqual( - ShowGeometryInstanceAttribute.toValue(true) + ShowGeometryInstanceAttribute.toValue(true), ); expect(attributes.color).toEqual( - ColorGeometryInstanceAttribute.toValue(Color.BLUE) + ColorGeometryInstanceAttribute.toValue(Color.BLUE), ); expect(primitive.appearance).toBeInstanceOf(PerInstanceColorAppearance); @@ -303,7 +303,7 @@ describe( scene, objects, scene.primitives, - scene.groundPrimitives + scene.groundPrimitives, ); const ellipse = new EllipseGraphics(); @@ -315,7 +315,7 @@ describe( const entity = new Entity(); entity.position = new ConstantPositionProperty( - new Cartesian3(1234, 5678, 9101112) + new Cartesian3(1234, 5678, 9101112), ); entity.ellipse = ellipse; objects.add(entity); @@ -354,7 +354,7 @@ describe( scene, objects, scene.primitives, - scene.groundPrimitives + scene.groundPrimitives, ); const ellipse = new EllipseGraphics(); @@ -365,7 +365,7 @@ describe( const entity = new Entity(); entity.position = new ConstantPositionProperty( - new Cartesian3(1234, 5678, 9101112) + new Cartesian3(1234, 5678, 9101112), ); entity.ellipse = ellipse; objects.add(entity); @@ -384,19 +384,19 @@ describe( it("Creates and removes geometry classifying terrain", function () { return createAndRemoveGeometryWithClassificationType( - ClassificationType.TERRAIN + ClassificationType.TERRAIN, ); }); it("Creates and removes geometry classifying 3D Tiles", function () { return createAndRemoveGeometryWithClassificationType( - ClassificationType.CESIUM_3D_TILE + ClassificationType.CESIUM_3D_TILE, ); }); it("Creates and removes geometry classifying both terrain and 3D Tiles", function () { return createAndRemoveGeometryWithClassificationType( - ClassificationType.BOTH + ClassificationType.BOTH, ); }); @@ -406,7 +406,7 @@ describe( scene, objects, scene.primitives, - scene.groundPrimitives + scene.groundPrimitives, ); const ellipse = new EllipseGraphics(); @@ -417,7 +417,7 @@ describe( const entity = new Entity(); entity.position = new ConstantPositionProperty( - new Cartesian3(1234, 5678, 9101112) + new Cartesian3(1234, 5678, 9101112), ); entity.ellipse = ellipse; objects.add(entity); @@ -427,10 +427,10 @@ describe( let attributes = primitive.getGeometryInstanceAttributes(entity); expect(attributes).toBeDefined(); expect(attributes.show).toEqual( - ShowGeometryInstanceAttribute.toValue(true) + ShowGeometryInstanceAttribute.toValue(true), ); expect(attributes.color).toEqual( - ColorGeometryInstanceAttribute.toValue(Color.WHITE) + ColorGeometryInstanceAttribute.toValue(Color.WHITE), ); expect(primitive.appearance).toBeInstanceOf(PerInstanceColorAppearance); @@ -441,7 +441,7 @@ describe( attributes = primitive.getGeometryInstanceAttributes(entity); expect(attributes).toBeDefined(); expect(attributes.show).toEqual( - ShowGeometryInstanceAttribute.toValue(true) + ShowGeometryInstanceAttribute.toValue(true), ); expect(attributes.color).toBeUndefined(); expect(primitive.appearance).toBeInstanceOf(MaterialAppearance); @@ -464,7 +464,7 @@ describe( scene, entities, scene.primitives, - scene.groundPrimitives + scene.groundPrimitives, ); let color = Color.BLUE.withAlpha(0.5); @@ -485,7 +485,7 @@ describe( const attributes = primitive.getGeometryInstanceAttributes(entity); expect(attributes).toBeDefined(); expect(attributes.color).toEqual( - ColorGeometryInstanceAttribute.toValue(color) + ColorGeometryInstanceAttribute.toValue(color), ); color = Color.RED.withAlpha(0.5); @@ -498,7 +498,7 @@ describe( const attributes = primitive.getGeometryInstanceAttributes(entity); expect(attributes).toBeDefined(); expect(attributes.color).toEqual( - ColorGeometryInstanceAttribute.toValue(color) + ColorGeometryInstanceAttribute.toValue(color), ); entities.remove(entity); @@ -512,7 +512,7 @@ describe( scene, objects, scene.primitives, - scene.groundPrimitives + scene.groundPrimitives, ); const ellipse = new EllipseGraphics(); @@ -524,7 +524,7 @@ describe( const entity = new Entity(); entity.position = new ConstantPositionProperty( - new Cartesian3(1234, 5678, 9101112) + new Cartesian3(1234, 5678, 9101112), ); entity.ellipse = ellipse; objects.add(entity); @@ -546,7 +546,7 @@ describe( scene, objects, scene.primitives, - scene.groundPrimitives + scene.groundPrimitives, ); const ellipse = new EllipseGraphics(); @@ -557,7 +557,7 @@ describe( const entity = new Entity(); entity.position = new ConstantPositionProperty( - new Cartesian3(1234, 5678, 9101112) + new Cartesian3(1234, 5678, 9101112), ); entity.ellipse = ellipse; objects.add(entity); @@ -580,7 +580,7 @@ describe( undefined, objects, scene.primitives, - scene.groundPrimitives + scene.groundPrimitives, ); }).toThrowDeveloperError(); }); @@ -591,7 +591,7 @@ describe( scene, undefined, scene.primitives, - scene.groundPrimitives + scene.groundPrimitives, ); }).toThrowDeveloperError(); }); @@ -601,7 +601,7 @@ describe( scene, new EntityCollection(), scene.primitives, - scene.groundPrimitives + scene.groundPrimitives, ); expect(function () { visualizer.update(undefined); @@ -614,7 +614,7 @@ describe( scene, entityCollection, scene.primitives, - scene.groundPrimitives + scene.groundPrimitives, ); expect(entityCollection.collectionChanged.numberOfListeners).toEqual(1); visualizer.destroy(); @@ -627,7 +627,7 @@ describe( scene, entityCollection, scene.primitives, - scene.groundPrimitives + scene.groundPrimitives, ); const destroySpy = jasmine.createSpy("destroy"); @@ -649,7 +649,7 @@ describe( scene, entityCollection, scene.primitives, - scene.groundPrimitives + scene.groundPrimitives, ); const ellipse = new EllipseGraphics(); @@ -679,8 +679,8 @@ describe( BoundingSphere.transform( attributes.boundingSphere, primitive.modelMatrix, - new BoundingSphere() - ) + new BoundingSphere(), + ), ); visualizer.destroy(); @@ -693,7 +693,7 @@ describe( scene, entityCollection, scene.primitives, - scene.groundPrimitives + scene.groundPrimitives, ); const result = new BoundingSphere(); @@ -712,7 +712,7 @@ describe( scene, entityCollection, scene.primitives, - scene.groundPrimitives + scene.groundPrimitives, ); expect(function () { @@ -728,7 +728,7 @@ describe( scene, objects, scene.primitives, - scene.groundPrimitives + scene.groundPrimitives, ); const entity = new Entity({ @@ -763,13 +763,13 @@ describe( const attributes = primitive.getGeometryInstanceAttributes(entity2); expect(attributes).toBeDefined(); expect(attributes.show).toEqual( - ShowGeometryInstanceAttribute.toValue(true) + ShowGeometryInstanceAttribute.toValue(true), ); expect(attributes.color).toEqual( - ColorGeometryInstanceAttribute.toValue(Color.BLUE) + ColorGeometryInstanceAttribute.toValue(Color.BLUE), ); expect(primitive.appearance).toBeInstanceOf( - PerInstanceColorAppearance + PerInstanceColorAppearance, ); objects.remove(entity); @@ -787,7 +787,7 @@ describe( scene, entities, scene.primitives, - scene.groundPrimitives + scene.groundPrimitives, ); const entity = entities.add({ @@ -796,7 +796,7 @@ describe( semiMajorAxis: 2, semiMinorAxis: 1, material: new ColorMaterialProperty( - createDynamicProperty(Color.BLUE) + createDynamicProperty(Color.BLUE), ), height: 0, }, @@ -808,7 +808,7 @@ describe( const attributes = primitive.getGeometryInstanceAttributes(entity); expect(attributes).toBeDefined(); expect(attributes.show).toEqual( - ShowGeometryInstanceAttribute.toValue(true) + ShowGeometryInstanceAttribute.toValue(true), ); entity.show = false; @@ -820,7 +820,7 @@ describe( const attributes = primitive.getGeometryInstanceAttributes(entity); expect(attributes).toBeDefined(); expect(attributes.show).toEqual( - ShowGeometryInstanceAttribute.toValue(false) + ShowGeometryInstanceAttribute.toValue(false), ); entities.remove(entity); @@ -834,7 +834,7 @@ describe( scene, entities, scene.primitives, - scene.groundPrimitives + scene.groundPrimitives, ); const entity = entities.add({ @@ -854,7 +854,7 @@ describe( const attributes = primitive.getGeometryInstanceAttributes(entity); expect(attributes).toBeDefined(); expect(attributes.show).toEqual( - ShowGeometryInstanceAttribute.toValue(true) + ShowGeometryInstanceAttribute.toValue(true), ); entity.show = false; @@ -866,7 +866,7 @@ describe( const attributes = primitive.getGeometryInstanceAttributes(entity); expect(attributes).toBeDefined(); expect(attributes.show).toEqual( - ShowGeometryInstanceAttribute.toValue(false) + ShowGeometryInstanceAttribute.toValue(false), ); entities.remove(entity); @@ -880,7 +880,7 @@ describe( scene, entities, scene.primitives, - scene.groundPrimitives + scene.groundPrimitives, ); const entity = entities.add({ @@ -901,7 +901,7 @@ describe( const attributes = primitive.getGeometryInstanceAttributes(entity); expect(attributes).toBeDefined(); expect(attributes.show).toEqual( - ShowGeometryInstanceAttribute.toValue(true) + ShowGeometryInstanceAttribute.toValue(true), ); entity.show = false; @@ -913,7 +913,7 @@ describe( const attributes = primitive.getGeometryInstanceAttributes(entity); expect(attributes).toBeDefined(); expect(attributes.show).toEqual( - ShowGeometryInstanceAttribute.toValue(false) + ShowGeometryInstanceAttribute.toValue(false), ); entities.remove(entity); @@ -934,7 +934,7 @@ describe( scene, entities, scene.primitives, - scene.groundPrimitives + scene.groundPrimitives, ); const blueColor = Color.BLUE.withAlpha(0.5); @@ -1035,5 +1035,5 @@ describe( expect(spy).toHaveBeenCalledOnceWith(FakeUpdater); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/DataSources/GpxDataSourceSpec.js b/packages/engine/Specs/DataSources/GpxDataSourceSpec.js index 8c9152c1572f..73224a389d60 100755 --- a/packages/engine/Specs/DataSources/GpxDataSourceSpec.js +++ b/packages/engine/Specs/DataSources/GpxDataSourceSpec.js @@ -271,7 +271,7 @@ describe("DataSources/GpxDataSource", function () { expect(entity.name).toBe("Test"); expect(entity.label).toBeDefined(); expect(entity.label.text.getValue()).toBe("Test"); - } + }, ); }); @@ -285,7 +285,7 @@ describe("DataSources/GpxDataSource", function () { return GpxDataSource.load(parser.parseFromString(gpx, "text/xml")).catch( function (e) { expect(e).toBeInstanceOf(DeveloperError); - } + }, ); }); @@ -299,7 +299,7 @@ describe("DataSources/GpxDataSource", function () { return GpxDataSource.load(parser.parseFromString(gpx, "text/xml")).catch( function (e) { expect(e).toBeInstanceOf(DeveloperError); - } + }, ); }); @@ -316,10 +316,10 @@ describe("DataSources/GpxDataSource", function () { const entities = dataSource.entities.values; expect(entities.length).toEqual(1); expect(entities[0].position.getValue(Iso8601.MINIMUM_VALUE)).toEqual( - Cartesian3.fromDegrees(38.737125, -9.139242, undefined) + Cartesian3.fromDegrees(38.737125, -9.139242, undefined), ); expect(entities[0].name).toEqual("Position 1"); - } + }, ); }); @@ -338,10 +338,10 @@ describe("DataSources/GpxDataSource", function () { expect(entities[0].billboard.height.getValue()).toEqual(BILLBOARD_SIZE); expect(entities[0].billboard.width.getValue()).toEqual(BILLBOARD_SIZE); expect(entities[0].billboard.verticalOrigin.getValue()).toEqual( - VerticalOrigin.BOTTOM + VerticalOrigin.BOTTOM, ); expect(entities[0].billboard.heightReference).toBeUndefined(); - } + }, ); }); @@ -358,7 +358,7 @@ describe("DataSources/GpxDataSource", function () { }).then(function (dataSource) { const entities = dataSource.entities.values; expect(entities[0].billboard.heightReference.getValue()).toEqual( - HeightReference.CLAMP_TO_GROUND + HeightReference.CLAMP_TO_GROUND, ); }); }); @@ -398,9 +398,9 @@ describe("DataSources/GpxDataSource", function () { const entities = dataSource.entities.values; expect(entities.length).toEqual(1); expect(entities[0].position.getValue(Iso8601.MINIMUM_VALUE)).toEqual( - Cartesian3.fromDegrees(1, 2, 3) + Cartesian3.fromDegrees(1, 2, 3), ); - } + }, ); }); @@ -423,15 +423,15 @@ describe("DataSources/GpxDataSource", function () { const entities = dataSource.entities.values; expect(entities.length).toEqual(3); expect(entities[0].position.getValue(Iso8601.MINIMUM_VALUE)).toEqual( - Cartesian3.fromDegrees(1, 2, undefined) + Cartesian3.fromDegrees(1, 2, undefined), ); expect(entities[1].position.getValue(Iso8601.MINIMUM_VALUE)).toEqual( - Cartesian3.fromDegrees(3, 4, undefined) + Cartesian3.fromDegrees(3, 4, undefined), ); expect(entities[2].position.getValue(Iso8601.MINIMUM_VALUE)).toEqual( - Cartesian3.fromDegrees(5, 6, undefined) + Cartesian3.fromDegrees(5, 6, undefined), ); - } + }, ); }); @@ -455,7 +455,7 @@ describe("DataSources/GpxDataSource", function () { expect(div.style["background-color"]).toEqual("rgb(255, 255, 255)"); expect(div.style.color).toEqual("rgb(0, 0, 0)"); expect(div.textContent).toEqual("Description: The Description"); - } + }, ); }); @@ -479,7 +479,7 @@ describe("DataSources/GpxDataSource", function () { expect(div.style["background-color"]).toEqual("rgb(255, 255, 255)"); expect(div.style.color).toEqual("rgb(0, 0, 0)"); expect(div.textContent).toEqual("Time: 2015-08-17T00:06Z"); - } + }, ); }); @@ -503,7 +503,7 @@ describe("DataSources/GpxDataSource", function () { expect(div.style["background-color"]).toEqual("rgb(255, 255, 255)"); expect(div.style.color).toEqual("rgb(0, 0, 0)"); expect(div.textContent).toEqual("Comment: The comment"); - } + }, ); }); @@ -527,7 +527,7 @@ describe("DataSources/GpxDataSource", function () { expect(div.style["background-color"]).toEqual("rgb(255, 255, 255)"); expect(div.style.color).toEqual("rgb(0, 0, 0)"); expect(div.textContent).toEqual("Source: The source"); - } + }, ); }); @@ -551,7 +551,7 @@ describe("DataSources/GpxDataSource", function () { expect(div.style["background-color"]).toEqual("rgb(255, 255, 255)"); expect(div.style.color).toEqual("rgb(0, 0, 0)"); expect(div.textContent).toEqual("GPS track/route number: The number"); - } + }, ); }); @@ -575,7 +575,7 @@ describe("DataSources/GpxDataSource", function () { expect(div.style["background-color"]).toEqual("rgb(255, 255, 255)"); expect(div.style.color).toEqual("rgb(0, 0, 0)"); expect(div.textContent).toEqual("Type: The type"); - } + }, ); }); @@ -601,9 +601,9 @@ describe("DataSources/GpxDataSource", function () { expect(div.style["background-color"]).toEqual("rgb(255, 255, 255)"); expect(div.style.color).toEqual("rgb(0, 0, 0)"); expect(div.textContent).toEqual( - "Comment: The commentDescription: The descriptionType: The type" + "Comment: The commentDescription: The descriptionType: The type", ); - } + }, ); }); @@ -645,9 +645,9 @@ describe("DataSources/GpxDataSource", function () { expect(div.style["background-color"]).toEqual("rgb(255, 255, 255)"); expect(div.style.color).toEqual("rgb(0, 0, 0)"); expect(div.textContent).toEqual( - "Comment: The commentDescription: The descriptionType: The type" + "Comment: The commentDescription: The descriptionType: The type", ); - } + }, ); }); @@ -680,18 +680,18 @@ describe("DataSources/GpxDataSource", function () { const entities = dataSource.entities.values; expect(entities.length).toEqual(5); //1 for the route and 4 routepoints expect(entities[1].position.getValue(Iso8601.MINIMUM_VALUE)).toEqual( - Cartesian3.fromDegrees(1, 2, 1) + Cartesian3.fromDegrees(1, 2, 1), ); expect(entities[2].position.getValue(Iso8601.MINIMUM_VALUE)).toEqual( - Cartesian3.fromDegrees(3, 4, 1) + Cartesian3.fromDegrees(3, 4, 1), ); expect(entities[3].position.getValue(Iso8601.MINIMUM_VALUE)).toEqual( - Cartesian3.fromDegrees(5, 6, 1) + Cartesian3.fromDegrees(5, 6, 1), ); expect(entities[4].position.getValue(Iso8601.MINIMUM_VALUE)).toEqual( - Cartesian3.fromDegrees(7, 8, 1) + Cartesian3.fromDegrees(7, 8, 1), ); - } + }, ); }); @@ -723,13 +723,13 @@ describe("DataSources/GpxDataSource", function () { expect(entity.polyline).toBeDefined(); const positions = entity.polyline.positions.getValue( - Iso8601.MINIMUM_VALUE + Iso8601.MINIMUM_VALUE, ); expect(positions).toEqual([ Cartesian3.fromDegrees(1, 2, 1), Cartesian3.fromDegrees(3, 4, 1), ]); - } + }, ); }); @@ -764,9 +764,9 @@ describe("DataSources/GpxDataSource", function () { expect(entity.polyline.material.color.getValue()).toEqual(Color.RED); expect(entity.polyline.material.outlineWidth.getValue()).toEqual(2); expect(entity.polyline.material.outlineColor.getValue()).toEqual( - Color.BLACK + Color.BLACK, ); - } + }, ); }); @@ -894,19 +894,19 @@ describe("DataSources/GpxDataSource", function () { const entity = dataSource.entities.values[0]; expect(entity.position.getValue(time1)).toEqual( - Cartesian3.fromDegrees(1, 2, 1) + Cartesian3.fromDegrees(1, 2, 1), ); expect(entity.position.getValue(time2)).toEqual( - Cartesian3.fromDegrees(3, 4, 1) + Cartesian3.fromDegrees(3, 4, 1), ); expect(entity.position.getValue(time3)).toEqual( - Cartesian3.fromDegrees(5, 6, 1) + Cartesian3.fromDegrees(5, 6, 1), ); expect(entity.polyline).toBeDefined(); expect(entity.availability.start).toEqual(time1); expect(entity.availability.stop).toEqual(time3); - } + }, ); }); @@ -947,9 +947,9 @@ describe("DataSources/GpxDataSource", function () { expect(entity.polyline.material.color.getValue()).toEqual(Color.RED); expect(entity.polyline.material.outlineWidth.getValue()).toEqual(2); expect(entity.polyline.material.outlineColor.getValue()).toEqual( - Color.BLACK + Color.BLACK, ); - } + }, ); }); diff --git a/packages/engine/Specs/DataSources/GridMaterialPropertySpec.js b/packages/engine/Specs/DataSources/GridMaterialPropertySpec.js index efeb61875a5d..0986d5119394 100644 --- a/packages/engine/Specs/DataSources/GridMaterialPropertySpec.js +++ b/packages/engine/Specs/DataSources/GridMaterialPropertySpec.js @@ -82,35 +82,35 @@ describe("DataSources/GridMaterialProperty", function () { start: start, stop: stop, data: Color.BLUE, - }) + }), ); property.cellAlpha.intervals.addInterval( new TimeInterval({ start: start, stop: stop, data: 1.0, - }) + }), ); property.lineCount.intervals.addInterval( new TimeInterval({ start: start, stop: stop, data: new Cartesian2(3.4, 5.0), - }) + }), ); property.lineThickness.intervals.addInterval( new TimeInterval({ start: start, stop: stop, data: new Cartesian2(2, 3), - }) + }), ); property.lineOffset.intervals.addInterval( new TimeInterval({ start: start, stop: stop, data: new Cartesian2(0.7, 0.8), - }) + }), ); const result = property.getValue(start); @@ -190,7 +190,7 @@ describe("DataSources/GridMaterialProperty", function () { property, "color", property.color, - oldValue + oldValue, ); listener.calls.reset(); @@ -199,7 +199,7 @@ describe("DataSources/GridMaterialProperty", function () { property, "color", property.color, - property.color + property.color, ); listener.calls.reset(); @@ -213,7 +213,7 @@ describe("DataSources/GridMaterialProperty", function () { property, "cellAlpha", property.cellAlpha, - oldValue + oldValue, ); listener.calls.reset(); @@ -222,7 +222,7 @@ describe("DataSources/GridMaterialProperty", function () { property, "cellAlpha", property.cellAlpha, - property.cellAlpha + property.cellAlpha, ); listener.calls.reset(); @@ -236,7 +236,7 @@ describe("DataSources/GridMaterialProperty", function () { property, "lineCount", property.lineCount, - oldValue + oldValue, ); listener.calls.reset(); @@ -245,7 +245,7 @@ describe("DataSources/GridMaterialProperty", function () { property, "lineCount", property.lineCount, - property.lineCount + property.lineCount, ); listener.calls.reset(); @@ -259,7 +259,7 @@ describe("DataSources/GridMaterialProperty", function () { property, "lineThickness", property.lineThickness, - oldValue + oldValue, ); listener.calls.reset(); @@ -268,7 +268,7 @@ describe("DataSources/GridMaterialProperty", function () { property, "lineThickness", property.lineThickness, - property.lineThickness + property.lineThickness, ); listener.calls.reset(); @@ -278,7 +278,7 @@ describe("DataSources/GridMaterialProperty", function () { property, "lineOffset", property.lineOffset, - oldValue + oldValue, ); listener.calls.reset(); @@ -287,7 +287,7 @@ describe("DataSources/GridMaterialProperty", function () { property, "lineOffset", property.lineOffset, - property.lineOffset + property.lineOffset, ); listener.calls.reset(); diff --git a/packages/engine/Specs/DataSources/GroundGeometryUpdaterSpec.js b/packages/engine/Specs/DataSources/GroundGeometryUpdaterSpec.js index 1b52765079f3..35c1980dd34a 100644 --- a/packages/engine/Specs/DataSources/GroundGeometryUpdaterSpec.js +++ b/packages/engine/Specs/DataSources/GroundGeometryUpdaterSpec.js @@ -20,12 +20,12 @@ describe("DataSources/GroundGeometryUpdater", function () { const height = expected; let heightReference = HeightReference.NONE; expect( - GroundGeometryUpdater.getGeometryHeight(height, heightReference) + GroundGeometryUpdater.getGeometryHeight(height, heightReference), ).toEqual(expected); heightReference = HeightReference.RELATIVE_TO_GROUND; expect( - GroundGeometryUpdater.getGeometryHeight(height, heightReference) + GroundGeometryUpdater.getGeometryHeight(height, heightReference), ).toEqual(expected); }); @@ -33,7 +33,7 @@ describe("DataSources/GroundGeometryUpdater", function () { const height = 50; const heightReference = HeightReference.CLAMP_TO_GROUND; expect( - GroundGeometryUpdater.getGeometryHeight(height, heightReference) + GroundGeometryUpdater.getGeometryHeight(height, heightReference), ).toEqual(0); }); @@ -42,12 +42,12 @@ describe("DataSources/GroundGeometryUpdater", function () { const height = expected; let heightReference = HeightReference.NONE; expect( - GroundGeometryUpdater.getGeometryExtrudedHeight(height, heightReference) + GroundGeometryUpdater.getGeometryExtrudedHeight(height, heightReference), ).toEqual(expected); heightReference = HeightReference.RELATIVE_TO_GROUND; expect( - GroundGeometryUpdater.getGeometryExtrudedHeight(height, heightReference) + GroundGeometryUpdater.getGeometryExtrudedHeight(height, heightReference), ).toEqual(expected); }); @@ -55,7 +55,7 @@ describe("DataSources/GroundGeometryUpdater", function () { const height = 50; const heightReference = HeightReference.CLAMP_TO_GROUND; expect( - GroundGeometryUpdater.getGeometryExtrudedHeight(height, heightReference) + GroundGeometryUpdater.getGeometryExtrudedHeight(height, heightReference), ).toEqual(GroundGeometryUpdater.CLAMP_TO_GROUND); }); @@ -68,7 +68,7 @@ describe("DataSources/GroundGeometryUpdater", function () { height, heightReference, extrudedHeight, - extrudedHeightReference + extrudedHeightReference, ); expect(result).toBeUndefined(); @@ -78,7 +78,7 @@ describe("DataSources/GroundGeometryUpdater", function () { height, heightReference, extrudedHeight, - extrudedHeightReference + extrudedHeightReference, ); expect(result).toBeUndefined(); @@ -88,7 +88,7 @@ describe("DataSources/GroundGeometryUpdater", function () { height, heightReference, extrudedHeight, - extrudedHeightReference + extrudedHeightReference, ); expect(result).toBeUndefined(); @@ -98,7 +98,7 @@ describe("DataSources/GroundGeometryUpdater", function () { height, heightReference, extrudedHeight, - extrudedHeightReference + extrudedHeightReference, ); expect(result).toBe(GeometryOffsetAttribute.TOP); @@ -108,7 +108,7 @@ describe("DataSources/GroundGeometryUpdater", function () { height, heightReference, extrudedHeight, - extrudedHeightReference + extrudedHeightReference, ); expect(result).toBe(GeometryOffsetAttribute.TOP); @@ -118,7 +118,7 @@ describe("DataSources/GroundGeometryUpdater", function () { height, heightReference, extrudedHeight, - extrudedHeightReference + extrudedHeightReference, ); expect(result).toBe(GeometryOffsetAttribute.TOP); @@ -128,7 +128,7 @@ describe("DataSources/GroundGeometryUpdater", function () { height, heightReference, extrudedHeight, - extrudedHeightReference + extrudedHeightReference, ); expect(result).toBe(GeometryOffsetAttribute.ALL); @@ -138,7 +138,7 @@ describe("DataSources/GroundGeometryUpdater", function () { height, heightReference, extrudedHeight, - extrudedHeightReference + extrudedHeightReference, ); expect(result).toBe(GeometryOffsetAttribute.TOP); @@ -148,7 +148,7 @@ describe("DataSources/GroundGeometryUpdater", function () { height, heightReference, extrudedHeight, - extrudedHeightReference + extrudedHeightReference, ); expect(result).toBe(GeometryOffsetAttribute.TOP); @@ -158,7 +158,7 @@ describe("DataSources/GroundGeometryUpdater", function () { height, heightReference, extrudedHeight, - extrudedHeightReference + extrudedHeightReference, ); expect(result).toBe(GeometryOffsetAttribute.ALL); @@ -166,7 +166,7 @@ describe("DataSources/GroundGeometryUpdater", function () { undefined, heightReference, undefined, - extrudedHeightReference + extrudedHeightReference, ); expect(result).toBeUndefined(); }); diff --git a/packages/engine/Specs/DataSources/ImageMaterialPropertySpec.js b/packages/engine/Specs/DataSources/ImageMaterialPropertySpec.js index 7bd5eeaa214a..aee441645283 100644 --- a/packages/engine/Specs/DataSources/ImageMaterialPropertySpec.js +++ b/packages/engine/Specs/DataSources/ImageMaterialPropertySpec.js @@ -61,14 +61,14 @@ describe("DataSources/ImageMaterialProperty", function () { start: start, stop: stop, data: "http://test.invalid/image.png", - }) + }), ); property.repeat.intervals.addInterval( new TimeInterval({ start: start, stop: stop, data: new Cartesian2(2, 3), - }) + }), ); const result = property.getValue(start); @@ -121,7 +121,7 @@ describe("DataSources/ImageMaterialProperty", function () { property, "image", property.image, - oldValue + oldValue, ); listener.calls.reset(); @@ -130,7 +130,7 @@ describe("DataSources/ImageMaterialProperty", function () { property, "image", property.image, - property.image + property.image, ); listener.calls.reset(); @@ -144,7 +144,7 @@ describe("DataSources/ImageMaterialProperty", function () { property, "repeat", property.repeat, - oldValue + oldValue, ); listener.calls.reset(); @@ -153,7 +153,7 @@ describe("DataSources/ImageMaterialProperty", function () { property, "repeat", property.repeat, - property.repeat + property.repeat, ); listener.calls.reset(); @@ -177,7 +177,7 @@ describe("DataSources/ImageMaterialProperty", function () { start: start, stop: stop, data: "http://test.invalid/image.png", - }) + }), ); expect(property.isConstant).toBe(false); @@ -189,7 +189,7 @@ describe("DataSources/ImageMaterialProperty", function () { start: start, stop: stop, data: new Cartesian2(2, 3), - }) + }), ); expect(property.isConstant).toBe(false); }); diff --git a/packages/engine/Specs/DataSources/KmlDataSourceSpec.js b/packages/engine/Specs/DataSources/KmlDataSourceSpec.js index 0fe44e005c4b..ba8b4d048e04 100644 --- a/packages/engine/Specs/DataSources/KmlDataSourceSpec.js +++ b/packages/engine/Specs/DataSources/KmlDataSourceSpec.js @@ -250,7 +250,7 @@ describe("DataSources/KmlDataSource", function () { return dataSource.load("Data/KML/backslash.kmz").then(function (source) { expect(source).toBe(dataSource); expect( - isDataUri(source.entities.values[0]._billboard._image._value.url) + isDataUri(source.entities.values[0]._billboard._image._value.url), ).toBe(true); }); }); @@ -287,25 +287,25 @@ describe("DataSources/KmlDataSource", function () { const OrigDeferredLoading = KmlDataSource._DeferredLoading; let deferredLoading; - spyOn(KmlDataSource, "_DeferredLoading").and.callFake(function ( - datasource - ) { - deferredLoading = new OrigDeferredLoading(datasource); - - const process = deferredLoading._process.bind(deferredLoading); - spyOn(deferredLoading, "_process").and.callFake(function (isFirst) { - jasmine.clock().tick(1001); // Step over a second everytime, so we only process 1 feature - return process(isFirst); - }); - - const giveUpTime = deferredLoading._giveUpTime.bind(deferredLoading); - spyOn(deferredLoading, "_giveUpTime").and.callFake(function () { - giveUpTime(); - jasmine.clock().tick(1); // Fire the setTimeout callback - }); - - return deferredLoading; - }); + spyOn(KmlDataSource, "_DeferredLoading").and.callFake( + function (datasource) { + deferredLoading = new OrigDeferredLoading(datasource); + + const process = deferredLoading._process.bind(deferredLoading); + spyOn(deferredLoading, "_process").and.callFake(function (isFirst) { + jasmine.clock().tick(1001); // Step over a second everytime, so we only process 1 feature + return process(isFirst); + }); + + const giveUpTime = deferredLoading._giveUpTime.bind(deferredLoading); + spyOn(deferredLoading, "_giveUpTime").and.callFake(function () { + giveUpTime(); + jasmine.clock().tick(1); // Fire the setTimeout callback + }); + + return deferredLoading; + }, + ); const dataSource = new KmlDataSource(options); return dataSource @@ -364,20 +364,20 @@ describe("DataSources/KmlDataSource", function () { }); it("load rejects loading non-KML URL", function () { - return KmlDataSource.load("Data/Images/Blue.png", options).catch(function ( - e - ) { - expect(e).toBeInstanceOf(RuntimeError); - }); + return KmlDataSource.load("Data/Images/Blue.png", options).catch( + function (e) { + expect(e).toBeInstanceOf(RuntimeError); + }, + ); }); it("load rejects valid KMZ zip URL with no KML contained", function () { - return KmlDataSource.load("Data/KML/empty.kmz", options).catch(function ( - e - ) { - expect(e).toBeInstanceOf(RuntimeError); - expect(e.message).toEqual("KMZ file does not contain a KML document."); - }); + return KmlDataSource.load("Data/KML/empty.kmz", options).catch( + function (e) { + expect(e).toBeInstanceOf(RuntimeError); + expect(e.message).toEqual("KMZ file does not contain a KML document."); + }, + ); }); it("if load contains <icon> tag with no image included, no image is added", function () { @@ -391,7 +391,7 @@ describe("DataSources/KmlDataSource", function () { expect(source.entities.values.length).toEqual(1); expect(source.entities._entities._array.length).toEqual(1); expect( - source.entities._entities._array[0]._billboard._image + source.entities._entities._array[0]._billboard._image, ).toBeUndefined(); }); }); @@ -407,7 +407,7 @@ describe("DataSources/KmlDataSource", function () { expect(source.entities.values.length).toEqual(1); expect(source.entities._entities._array.length).toEqual(1); expect( - source.entities._entities._array[0]._billboard._image._value + source.entities._entities._array[0]._billboard._image._value, ).toEqual(dataSource._pinBuilder.fromColor(Color.YELLOW, 64)); }); }); @@ -423,7 +423,7 @@ describe("DataSources/KmlDataSource", function () { expect(source.entities.values.length).toEqual(1); expect(source.entities._entities._array.length).toEqual(1); expect( - source.entities._entities._array[0]._billboard._image._value + source.entities._entities._array[0]._billboard._image._value, ).toEqual(dataSource._pinBuilder.fromColor(Color.YELLOW, 64)); }); }); @@ -583,7 +583,7 @@ describe("DataSources/KmlDataSource", function () { expect(clock.clockRange).toEqual(ClockRange.LOOP_STOP); expect(clock.clockStep).toEqual(ClockStep.SYSTEM_CLOCK_MULTIPLIER); expect(clock.multiplier).toEqual( - JulianDate.secondsDifference(endDate, beginDate) / 60 + JulianDate.secondsDifference(endDate, beginDate) / 60, ); return dataSource; }) @@ -599,7 +599,7 @@ describe("DataSources/KmlDataSource", function () { return dataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ); }) .then(function (dataSource) { @@ -615,7 +615,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entity = dataSource.entities.values[0]; expect(entity.id).toBe("Bob"); @@ -635,7 +635,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entities = dataSource.entities.values; expect(entities[0].id).toBe("Bob"); @@ -652,7 +652,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entity = dataSource.entities.values[0]; expect(entity.name).toBe("bob"); @@ -670,7 +670,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entity = dataSource.entities.values[0]; expect(entity.kml.address).toBe("1826 South 16th Street"); @@ -686,7 +686,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entity = dataSource.entities.values[0]; expect(entity.kml.phoneNumber).toBe("555-555-5555"); @@ -702,7 +702,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entity = dataSource.entities.values[0]; expect(entity.kml.snippet).toBe("Hey!"); @@ -723,7 +723,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entity = dataSource.entities.values[0]; expect(entity.kml).toBeDefined(); @@ -750,7 +750,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entity = dataSource.entities.values[0]; expect(entity.kml).toBeDefined(); @@ -779,7 +779,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entity = dataSource.entities.values[0]; expect(entity.availability).toBeDefined(); @@ -803,7 +803,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entity = dataSource.entities.values[0]; expect(entity.availability).toBeDefined(); @@ -822,7 +822,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entity = dataSource.entities.values[0]; expect(entity.availability).toBeUndefined(); @@ -842,7 +842,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entity = dataSource.entities.values[0]; expect(entity.availability).toBeDefined(); @@ -864,7 +864,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entity = dataSource.entities.values[0]; expect(entity.availability).toBeDefined(); @@ -886,7 +886,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entity = dataSource.entities.values[0]; expect(entity.availability).toBeDefined(); @@ -904,7 +904,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entity = dataSource.entities.values[0]; expect(entity.show).toBe(false); @@ -921,7 +921,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entity = dataSource.entities.values[0]; expect(entity.availability).toBeUndefined(); @@ -939,7 +939,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entity = dataSource.entities.values[0]; expect(entity.availability).toBeUndefined(); @@ -966,7 +966,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entity = dataSource.entities.values[0]; expect(entity.kml.extendedData).toBeDefined(); @@ -993,7 +993,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entity = dataSource.entities.values[0]; expect(entity.name).toBeUndefined(); @@ -1018,12 +1018,12 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entity = dataSource.entities.values[0]; expect(entity.rectangle.material).toBeInstanceOf(ImageMaterialProperty); expect(entity.rectangle.material.image.getValue().url).toEqual( - "http://test.invalid/image.png" + "http://test.invalid/image.png", ); }); }); @@ -1040,15 +1040,15 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entity = dataSource.entities.values[0]; expect(entity.rectangle.material).toBeInstanceOf(ImageMaterialProperty); expect(entity.rectangle.material.image.getValue().url).toEqual( - "http://test.invalid/image.png" + "http://test.invalid/image.png", ); expect(entity.rectangle.material.color.getValue()).toEqual( - new Color(1.0, 0.0, 0.0, 127 / 255) + new Color(1.0, 0.0, 0.0, 127 / 255), ); }); }); @@ -1063,7 +1063,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entity = dataSource.entities.values[0]; expect(entity.rectangle.material).toBeInstanceOf(ColorMaterialProperty); @@ -1087,13 +1087,13 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entity = dataSource.entities.values[0]; expect(entity.polygon).toBeUndefined(); expect(entity.rectangle.coordinates.getValue()).toEqualEpsilon( Rectangle.fromDegrees(3, 1, 4, 2), - CesiumMath.EPSILON14 + CesiumMath.EPSILON14, ); expect(entity.rectangle.rotation.getValue()).toEqual(Math.PI / 4); expect(entity.rectangle.stRotation.getValue()).toEqual(Math.PI / 4); @@ -1115,12 +1115,12 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entity = dataSource.entities.values[0]; expect(entity.polygon).toBeUndefined(); expect(entity.rectangle.coordinates.getValue()).toEqual( - Rectangle.fromDegrees(-180, -90, 180, 90) + Rectangle.fromDegrees(-180, -90, 180, 90), ); }); }); @@ -1139,12 +1139,12 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entity = dataSource.entities.values[0]; expect(entity.polygon).toBeUndefined(); expect(entity.rectangle.coordinates.getValue()).toEqual( - Rectangle.fromDegrees(-180, -90, 180, 90) + Rectangle.fromDegrees(-180, -90, 180, 90), ); }); }); @@ -1163,13 +1163,13 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entity = dataSource.entities.values[0]; expect(entity.rectangle).toBeUndefined(); expect(entity.polygon.hierarchy.getValue().positions).toEqualEpsilon( Cartesian3.fromDegreesArray([1, 2, 3, 4, 5, 6, 7, 8]), - CesiumMath.EPSILON14 + CesiumMath.EPSILON14, ); }); }); @@ -1191,12 +1191,12 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entity = dataSource.entities.values[0]; expect(entity.polygon.material).toBeInstanceOf(ImageMaterialProperty); expect(entity.polygon.material.image.getValue().url).toEqual( - "http://test.invalid/image.png" + "http://test.invalid/image.png", ); }); }); @@ -1216,7 +1216,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entity = dataSource.entities.values[0]; expect(entity.polygon.zIndex.getValue()).toEqual(3); @@ -1233,7 +1233,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entity = dataSource.entities.values[0]; expect(entity.rectangle.height.getValue()).toEqual(23); @@ -1254,7 +1254,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { expect(screenOverlayContainer.children.length).toEqual(1); const child = screenOverlayContainer.children[0]; @@ -1267,7 +1267,7 @@ describe("DataSources/KmlDataSource", function () { expect(child.style.height).toEqual(""); expect(child.style.top).toEqual(""); expect(["calc(100% + 0px)", "calc(100% - 0px)"]).toContain( - child.style.bottom + child.style.bottom, ); expect(child.style.right).toEqual(""); expect(["calc(0% + 0px)", "calc(0% - 0px)"]).toContain(child.style.left); @@ -1300,16 +1300,16 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { expect(screenOverlayContainer.children.length).toEqual(2); expect(screenOverlayContainer.children[0].tagName).toEqual("IMG"); expect(screenOverlayContainer.children[0].getAttribute("src")).toEqual( - "http://invalid.url/first" + "http://invalid.url/first", ); expect(screenOverlayContainer.children[1].tagName).toEqual("IMG"); expect(screenOverlayContainer.children[1].getAttribute("src")).toEqual( - "http://invalid.url/second" + "http://invalid.url/second", ); dataSource.destroy(); @@ -1330,7 +1330,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { expect(screenOverlayContainer.children.length).toEqual(1); const child = screenOverlayContainer.children[0]; @@ -1364,7 +1364,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { expect(screenOverlayContainer.children.length).toEqual(1); const child = screenOverlayContainer.children[0]; @@ -1398,7 +1398,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { expect(screenOverlayContainer.children.length).toEqual(1); const child = screenOverlayContainer.children[0]; @@ -1432,7 +1432,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { expect(screenOverlayContainer.children.length).toEqual(1); dataSource.destroy(); @@ -1456,7 +1456,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entities = dataSource.entities.values; expect(entities.length).toEqual(1); @@ -1480,7 +1480,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entities = dataSource.entities.values; expect(entities.length).toEqual(1); @@ -1497,7 +1497,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entities = dataSource.entities.values; expect(entities[0].billboard.scale.getValue()).toEqual(3.0); @@ -1513,7 +1513,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entities = dataSource.entities.values; expect(entities[0].billboard.scale.getValue()).toEqual(3.0); @@ -1545,7 +1545,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entities = dataSource.entities.values; expect(entities.length).toEqual(1); @@ -1573,9 +1573,10 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { - const generatedColor = dataSource.entities.values[0].billboard.color.getValue(); + const generatedColor = + dataSource.entities.values[0].billboard.color.getValue(); expect(generatedColor.red).toBeLessThan(1.0); expect(generatedColor.green).toBeLessThan(1.0); expect(generatedColor.blue).toBeLessThan(1.0); @@ -1599,9 +1600,10 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { - const generatedColor = dataSource.entities.values[0].billboard.color.getValue(); + const generatedColor = + dataSource.entities.values[0].billboard.color.getValue(); expect(generatedColor.red).toEqual(0); expect(generatedColor.green).toEqual(0); expect(generatedColor.blue).toEqual(0); @@ -1624,7 +1626,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { expect(dataSource.entities.values[0].billboard.color).toBeUndefined(); }); @@ -1645,7 +1647,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entity = dataSource.entities.values[0]; @@ -1680,7 +1682,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entity = dataSource.entities.values[0]; @@ -1716,7 +1718,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entity = dataSource.entities.values[0]; expect(entity.polyline.material).toBeInstanceOf(ColorMaterialProperty); @@ -1746,7 +1748,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entity = dataSource.entities.values[0]; @@ -1785,7 +1787,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entity = dataSource.entities.values[0]; @@ -1816,7 +1818,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entity = dataSource.entities.values[0]; @@ -1859,7 +1861,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entity = dataSource.entities.values[0]; @@ -1904,7 +1906,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entity = dataSource.entities.values[0]; @@ -1949,7 +1951,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entity = dataSource.entities.values[0]; @@ -1996,7 +1998,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entity = dataSource.entities.values[0]; expect(entity.billboard.scale.getValue()).toBe(2.0); @@ -2024,7 +2026,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entity = dataSource.entities.values[0]; expect(entity.billboard.scale.getValue()).toBe(2.0); @@ -2053,7 +2055,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entity = dataSource.entities.values[0]; expect(entity.billboard.scale.getValue()).toBe(2.0); @@ -2082,7 +2084,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entity = dataSource.entities.values[0]; expect(entity.billboard.scale.getValue()).toBe(2.0); @@ -2101,7 +2103,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entities = dataSource.entities.values; expect(entities[0].billboard).toBeDefined(); @@ -2123,12 +2125,12 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entities = dataSource.entities.values; const billboard = entities[0].billboard; expect(billboard.image.getValue().url).toEqual( - "http://test.invalid/image.png" + "http://test.invalid/image.png", ); }); }); @@ -2148,12 +2150,12 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entities = dataSource.entities.values; const billboard = entities[0].billboard; expect(billboard.image.getValue().url).toEqual( - "https://maps.google.com/mapfiles/kml/pal3/icon56.png" + "https://maps.google.com/mapfiles/kml/pal3/icon56.png", ); }); }); @@ -2177,19 +2179,19 @@ describe("DataSources/KmlDataSource", function () { const entities = dataSource.entities.values; const billboard = entities[0].billboard; expect(billboard.image.getValue().url).toEqual( - "http://test.invalid/image.png" + "http://test.invalid/image.png", ); }); }); it("IconStyle: Sets billboard image inside KMZ", function () { - return KmlDataSource.load("Data/KML/simple.kmz", options).then(function ( - dataSource - ) { - const entities = dataSource.entities.values; - const billboard = entities[0].billboard; - expect(billboard.image.getValue().url).toEqual(image); - }); + return KmlDataSource.load("Data/KML/simple.kmz", options).then( + function (dataSource) { + const entities = dataSource.entities.values; + const billboard = entities[0].billboard; + expect(billboard.image.getValue().url).toEqual(image); + }, + ); }); it("IconStyle: Sets billboard image with subregion", function () { @@ -2216,12 +2218,12 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const billboard = dataSource.entities.values[0].billboard; expect(billboard.image.getValue().url).toEqual(expectedIconHref); expect(billboard.imageSubRegion.getValue()).toEqual( - new BoundingRectangle(49, 43, 18, 18) + new BoundingRectangle(49, 43, 18, 18), ); }); }); @@ -2239,7 +2241,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const billboard = dataSource.entities.values[0].billboard; expect(billboard.pixelOffset.getValue()).toEqual(new Cartesian2(8, 8)); @@ -2259,7 +2261,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const billboard = dataSource.entities.values[0].billboard; expect(billboard.pixelOffset.getValue()).toEqual(new Cartesian2(15, -14)); @@ -2279,7 +2281,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const billboard = dataSource.entities.values[0].billboard; expect(billboard.pixelOffset.getValue()).toEqual(new Cartesian2(-15, 14)); @@ -2300,7 +2302,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entities = dataSource.entities.values; expect(entities[0].billboard.color.getValue()).toEqual(color); @@ -2320,7 +2322,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entities = dataSource.entities.values; expect(entities[0].billboard.scale.getValue()).toEqual(2.2); @@ -2340,14 +2342,14 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entities = dataSource.entities.values; expect(entities[0].billboard.rotation.getValue()).toEqual( - CesiumMath.toRadians(-4) + CesiumMath.toRadians(-4), ); expect(entities[0].billboard.alignedAxis.getValue()).toEqual( - Cartesian3.UNIT_Z + Cartesian3.UNIT_Z, ); }); }); @@ -2377,7 +2379,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entity = dataSource.entities.values[0]; @@ -2389,7 +2391,7 @@ describe("DataSources/KmlDataSource", function () { expect(div.style["background-color"]).toEqual("rgba(102, 68, 34, 0)"); expect(div.style.color).toEqual("rgba(0, 34, 68, 0.4)"); expect(div.textContent).toEqual( - "The Name The Description The Address The Snippet The ID The Property The Value $[prop2/displayName] $[prop2]" + "The Name The Description The Address The Snippet The ID The Property The Value $[prop2/displayName] $[prop2]", ); }); }); @@ -2407,7 +2409,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entity = dataSource.entities.values[0]; @@ -2428,7 +2430,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entity = dataSource.entities.values[0]; @@ -2463,7 +2465,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entity = dataSource.entities.values[0]; @@ -2503,7 +2505,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entity = dataSource.entities.values[0]; expect(entity.description).toBeUndefined(); @@ -2519,7 +2521,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entity = dataSource.entities.values[0]; @@ -2563,7 +2565,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entity = dataSource.entities.values[0]; @@ -2587,7 +2589,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entity = dataSource.entities.values[0]; @@ -2600,27 +2602,27 @@ describe("DataSources/KmlDataSource", function () { }); it("BalloonStyle: description is rewritten for embedded kmz links and images", function () { - return KmlDataSource.load("Data/KML/simple.kmz", options).then(function ( - dataSource - ) { - const entity = dataSource.entities.values[0]; - const description = entity.description.getValue(); - const div = document.createElement("div"); - div.innerHTML = description; - - expect(div.textContent).toEqual("image.png image.png"); - const children = div.firstChild.querySelectorAll("*"); - expect(children.length).toEqual(2); - - const link = children[0]; - expect(link.localName).toEqual("a"); - expect(link.getAttribute("href")).toEqual(image); - expect(link.getAttribute("download")).toEqual("image.png"); - - const img = children[1]; - expect(img.localName).toEqual("img"); - expect(img.src).toEqual(image); - }); + return KmlDataSource.load("Data/KML/simple.kmz", options).then( + function (dataSource) { + const entity = dataSource.entities.values[0]; + const description = entity.description.getValue(); + const div = document.createElement("div"); + div.innerHTML = description; + + expect(div.textContent).toEqual("image.png image.png"); + const children = div.firstChild.querySelectorAll("*"); + expect(children.length).toEqual(2); + + const link = children[0]; + expect(link.localName).toEqual("a"); + expect(link.getAttribute("href")).toEqual(image); + expect(link.getAttribute("download")).toEqual("image.png"); + + const img = children[1]; + expect(img.localName).toEqual("img"); + expect(img.src).toEqual(image); + }, + ); }); it("LabelStyle: Sets defaults", function () { @@ -2635,7 +2637,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entities = dataSource.entities.values; const label = entities[0].label; @@ -2666,7 +2668,7 @@ describe("DataSources/KmlDataSource", function () { expect(label.horizontalOrigin.getValue()).toEqual(HorizontalOrigin.LEFT); expect(label.pixelOffset.getValue()).toEqual(new Cartesian2(17, 0)); expect(label.translucencyByDistance.getValue()).toEqual( - new NearFarScalar(3000000, 1.0, 5000000, 0.0) + new NearFarScalar(3000000, 1.0, 5000000, 0.0), ); }); }); @@ -2685,7 +2687,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entities = dataSource.entities.values; expect(entities[0].label.fillColor.getValue()).toEqual(color); @@ -2707,11 +2709,11 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entities = dataSource.entities.values; expect(entities[0].label.pixelOffset.getValue()).toEqual( - new Cartesian2(33, 0) + new Cartesian2(33, 0), ); }); }); @@ -2729,11 +2731,11 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entities = dataSource.entities.values; expect(entities[0].label.pixelOffset.getValue()).toEqual( - new Cartesian3(3 * 16 + 1, 0) + new Cartesian3(3 * 16 + 1, 0), ); }); }); @@ -2751,7 +2753,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entities = dataSource.entities.values; expect(entities[0].label.pixelOffset).toBeUndefined(); @@ -2771,7 +2773,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entities = dataSource.entities.values; const polyline = entities[0].polyline; @@ -2800,7 +2802,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entities = dataSource.entities.values; const polyline = entities[0].polyline; @@ -2822,7 +2824,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entities = dataSource.entities.values; const polyline = entities[0].polyline; @@ -2842,7 +2844,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entities = dataSource.entities.values; const polygon = entities[0].polygon; @@ -2878,7 +2880,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entities = dataSource.entities.values; const polygon = entities[0].polygon; @@ -2900,7 +2902,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entities = dataSource.entities.values; const polygon = entities[0].polygon; @@ -2921,7 +2923,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entities = dataSource.entities.values; const polygon = entities[0].polygon; @@ -2939,7 +2941,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entities = dataSource.entities; const folder = entities.getById("parent"); @@ -2965,7 +2967,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const start = JulianDate.fromIso8601("2000-01-01"); const stop = JulianDate.fromIso8601("2000-01-03"); @@ -2998,7 +3000,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const startFolder = JulianDate.fromIso8601("2000-01-01"); const stopFolder = JulianDate.fromIso8601("2000-01-04"); @@ -3030,7 +3032,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const start = JulianDate.fromIso8601("2000-01-03"); @@ -3061,7 +3063,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const startFolder = JulianDate.fromIso8601("2000-01-03"); const startFeature = JulianDate.fromIso8601("2000-01-04"); @@ -3089,12 +3091,12 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entities = dataSource.entities.values; expect(entities.length).toEqual(1); expect(entities[0].position.getValue(Iso8601.MINIMUM_VALUE)).toEqual( - Cartesian3.fromDegrees(0, 0, 0) + Cartesian3.fromDegrees(0, 0, 0), ); expect(entities[0].polyline).toBeUndefined(); }); @@ -3112,12 +3114,12 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entities = dataSource.entities.values; expect(entities.length).toEqual(1); expect(entities[0].position.getValue(Iso8601.MINIMUM_VALUE)).toEqual( - Cartesian3.fromDegrees(1, 2, 3) + Cartesian3.fromDegrees(1, 2, 3), ); expect(entities[0].polyline).toBeUndefined(); }); @@ -3134,12 +3136,12 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entities = dataSource.entities.values; expect(entities.length).toEqual(1); expect(entities[0].position.getValue(Iso8601.MINIMUM_VALUE)).toEqual( - Cartesian3.fromDegrees(0, 0, 0) + Cartesian3.fromDegrees(0, 0, 0), ); expect(entities[0].polyline).toBeUndefined(); }); @@ -3160,7 +3162,7 @@ describe("DataSources/KmlDataSource", function () { const entities = dataSource.entities.values; expect(entities.length).toEqual(1); expect( - entities[0].billboard.heightReference.getValue(Iso8601.MINIMUM_VALUE) + entities[0].billboard.heightReference.getValue(Iso8601.MINIMUM_VALUE), ).toEqual(HeightReference.CLAMP_TO_GROUND); expect(entities[0].polyline).toBeUndefined(); }); @@ -3178,12 +3180,12 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entities = dataSource.entities.values; expect(entities.length).toEqual(1); expect(entities[0].position.getValue(Iso8601.MINIMUM_VALUE)).toEqual( - Cartesian3.fromDegrees(1, 2, 3) + Cartesian3.fromDegrees(1, 2, 3), ); expect(entities[0].billboard.pixelOffset).toBeUndefined(); expect(entities[0].polyline).toBeUndefined(); @@ -3202,12 +3204,12 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entities = dataSource.entities.values; expect(entities.length).toEqual(1); expect(entities[0].position.getValue(Iso8601.MINIMUM_VALUE)).toEqual( - Cartesian3.fromDegrees(1, 2, 3) + Cartesian3.fromDegrees(1, 2, 3), ); expect(entities[0].billboard.pixelOffset).toBeUndefined(); expect(entities[0].polyline).toBeUndefined(); @@ -3227,12 +3229,12 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entities = dataSource.entities.values; expect(entities.length).toEqual(1); expect(entities[0].position.getValue(Iso8601.MINIMUM_VALUE)).toEqual( - Cartesian3.fromDegrees(1, 2, 0) + Cartesian3.fromDegrees(1, 2, 0), ); expect(entities[0].billboard.pixelOffset).toBeUndefined(); expect(entities[0].polyline).toBeUndefined(); @@ -3253,12 +3255,12 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entities = dataSource.entities.values; expect(entities.length).toEqual(1); expect(entities[0].position.getValue(Iso8601.MINIMUM_VALUE)).toEqual( - Cartesian3.fromDegrees(1, 2) + Cartesian3.fromDegrees(1, 2), ); expect(entities[0].polyline).toBeUndefined(); }); @@ -3277,21 +3279,21 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entities = dataSource.entities.values; expect(entities.length).toEqual(1); expect(entities[0].position.getValue(Iso8601.MINIMUM_VALUE)).toEqual( - Cartesian3.fromDegrees(1, 2, 3) + Cartesian3.fromDegrees(1, 2, 3), ); expect(entities[0].polyline).toBeDefined(); const positions = entities[0].polyline.positions.getValue( - Iso8601.MINIMUM_VALUE + Iso8601.MINIMUM_VALUE, ); expect(positions).toEqualEpsilon( [Cartesian3.fromDegrees(1, 2, 3), Cartesian3.fromDegrees(1, 2, 0)], - CesiumMath.EPSILON13 + CesiumMath.EPSILON13, ); }); }); @@ -3310,21 +3312,21 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entities = dataSource.entities.values; expect(entities.length).toEqual(1); expect(entities[0].position.getValue(Iso8601.MINIMUM_VALUE)).toEqual( - Cartesian3.fromDegrees(1, 2, 3) + Cartesian3.fromDegrees(1, 2, 3), ); expect(entities[0].polyline).toBeDefined(); const positions = entities[0].polyline.positions.getValue( - Iso8601.MINIMUM_VALUE + Iso8601.MINIMUM_VALUE, ); expect(positions).toEqualEpsilon( [Cartesian3.fromDegrees(1, 2, 3), Cartesian3.fromDegrees(1, 2, 0)], - CesiumMath.EPSILON13 + CesiumMath.EPSILON13, ); }); }); @@ -3342,21 +3344,21 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entities = dataSource.entities.values; expect(entities.length).toEqual(1); expect(entities[0].position.getValue(Iso8601.MINIMUM_VALUE)).toEqual( - Cartesian3.fromDegrees(1, 2, 3) + Cartesian3.fromDegrees(1, 2, 3), ); expect(entities[0].polyline).toBeDefined(); const positions = entities[0].polyline.positions.getValue( - Iso8601.MINIMUM_VALUE + Iso8601.MINIMUM_VALUE, ); expect(positions).toEqualEpsilon( [Cartesian3.fromDegrees(1, 2, 3), Cartesian3.fromDegrees(1, 2, 0)], - CesiumMath.EPSILON13 + CesiumMath.EPSILON13, ); }); }); @@ -3372,15 +3374,15 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entities = dataSource.entities.values; expect(entities.length).toEqual(1); expect( - entities[0].position.getValue(Iso8601.MINIMUM_VALUE) + entities[0].position.getValue(Iso8601.MINIMUM_VALUE), ).toEqualEpsilon( new Cartesian3(213935.5635247161, 95566.36983235707, 6352461.425213023), - CesiumMath.EPSILON13 + CesiumMath.EPSILON13, ); }); }); @@ -3397,15 +3399,15 @@ describe("DataSources/KmlDataSource", function () { const moonOptions = combine(options, { ellipsoid: Ellipsoid.MOON }); return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - moonOptions + moonOptions, ).then(function (moonDataSource) { const entities = moonDataSource.entities.values; expect(entities.length).toEqual(1); expect( - entities[0].position.getValue(Iso8601.MINIMUM_VALUE) + entities[0].position.getValue(Iso8601.MINIMUM_VALUE), ).toEqualEpsilon( new Cartesian3(58080.7702560248, 25945.04756005268, 1736235.0758562544), - CesiumMath.EPSILON13 + CesiumMath.EPSILON13, ); }); }); @@ -3426,7 +3428,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entity = dataSource.entities.values[0]; expect(entity.polygon.hierarchy).toBeUndefined(); @@ -3452,7 +3454,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entity = dataSource.entities.values[0]; const coordinates = [ @@ -3461,7 +3463,7 @@ describe("DataSources/KmlDataSource", function () { Cartesian3.fromDegrees(7, 8, 9), ]; expect(entity.polygon.hierarchy.getValue().positions).toEqual( - coordinates + coordinates, ); }); }); @@ -3503,7 +3505,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entity = dataSource.entities.values[0]; const coordinates = [ @@ -3546,7 +3548,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entity = dataSource.entities.values[0]; expect(entity.polygon.perPositionHeight.getValue()).toEqual(true); @@ -3566,7 +3568,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entity = dataSource.entities.values[0]; expect(entity.polygon.perPositionHeight.getValue()).toEqual(true); @@ -3587,7 +3589,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entity = dataSource.entities.values[0]; expect(entity.polygon.perPositionHeight).toBeUndefined(); @@ -3608,7 +3610,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entity = dataSource.entities.values[0]; expect(entity.polygon.perPositionHeight.getValue()).toEqual(true); @@ -3629,7 +3631,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entity = dataSource.entities.values[0]; expect(entity.polygon.perPositionHeight).toBeUndefined(); @@ -3658,13 +3660,13 @@ describe("DataSources/KmlDataSource", function () { const moonOptions = combine(options, { ellipsoid: Ellipsoid.MOON }); return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - moonOptions + moonOptions, ).then(function (moonDataSource) { const entity = moonDataSource.entities.values[0]; const moonPoint = entity.polygon.hierarchy.getValue().positions[0]; expect(moonPoint).toEqualEpsilon( new Cartesian3(58080.7702560248, 25945.04756005268, 1736235.0758562544), - CesiumMath.EPSILON13 + CesiumMath.EPSILON13, ); }); }); @@ -3689,13 +3691,13 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entity = dataSource.entities.values[0]; const earthPoint = entity.polygon.hierarchy.getValue().positions[0]; expect(earthPoint).toEqualEpsilon( new Cartesian3(213935.5635247161, 95566.36983235707, 6352461.425213023), - CesiumMath.EPSILON13 + CesiumMath.EPSILON13, ); }); }); @@ -3710,7 +3712,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entities = dataSource.entities.values; expect(entities.length).toEqual(1); @@ -3735,7 +3737,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entities = dataSource.entities.values; expect(entities.length).toEqual(1); @@ -3745,11 +3747,11 @@ describe("DataSources/KmlDataSource", function () { expect(entity.polyline).toBeDefined(); const positions = entity.polyline.positions.getValue( - Iso8601.MINIMUM_VALUE + Iso8601.MINIMUM_VALUE, ); expect(positions).toEqualEpsilon( [Cartesian3.fromDegrees(1, 2), Cartesian3.fromDegrees(4, 5)], - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); expect(entity.polyline.arcType.getValue()).toEqual(ArcType.NONE); }); @@ -3770,7 +3772,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entities = dataSource.entities.values; expect(entities.length).toEqual(1); @@ -3782,7 +3784,7 @@ describe("DataSources/KmlDataSource", function () { const positions = entity.wall.positions.getValue(Iso8601.MINIMUM_VALUE); expect(positions).toEqualEpsilon( [Cartesian3.fromDegrees(1, 2, 3), Cartesian3.fromDegrees(4, 5, 6)], - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); }); }); @@ -3801,7 +3803,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entities = dataSource.entities.values; expect(entities.length).toEqual(1); @@ -3809,11 +3811,11 @@ describe("DataSources/KmlDataSource", function () { const entity = entities[0]; expect(entity.polyline.arcType).toBeUndefined(); const positions = entity.polyline.positions.getValue( - Iso8601.MINIMUM_VALUE + Iso8601.MINIMUM_VALUE, ); expect(positions).toEqualEpsilon( [Cartesian3.fromDegrees(1, 2), Cartesian3.fromDegrees(4, 5)], - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); }); }); @@ -3833,7 +3835,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entities = dataSource.entities.values; expect(entities.length).toEqual(1); @@ -3841,11 +3843,11 @@ describe("DataSources/KmlDataSource", function () { const entity = entities[0]; expect(entity.polyline.arcType).toBeUndefined(); const positions = entity.polyline.positions.getValue( - Iso8601.MINIMUM_VALUE + Iso8601.MINIMUM_VALUE, ); expect(positions).toEqualEpsilon( [Cartesian3.fromDegrees(1, 2), Cartesian3.fromDegrees(4, 5)], - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); }); }); @@ -3865,7 +3867,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entities = dataSource.entities.values; expect(entities.length).toEqual(1); @@ -3876,7 +3878,7 @@ describe("DataSources/KmlDataSource", function () { const positions = entity.wall.positions.getValue(Iso8601.MINIMUM_VALUE); expect(positions).toEqualEpsilon( [Cartesian3.fromDegrees(1, 2, 3), Cartesian3.fromDegrees(4, 5, 6)], - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); }); }); @@ -3895,7 +3897,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entities = dataSource.entities.values; expect(entities.length).toEqual(1); @@ -3906,7 +3908,7 @@ describe("DataSources/KmlDataSource", function () { const positions = entity.wall.positions.getValue(Iso8601.MINIMUM_VALUE); expect(positions).toEqualEpsilon( [Cartesian3.fromDegrees(1, 2, 3), Cartesian3.fromDegrees(4, 5, 6)], - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); }); }); @@ -3925,7 +3927,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entities = dataSource.entities.values; expect(entities.length).toEqual(1); @@ -3936,7 +3938,7 @@ describe("DataSources/KmlDataSource", function () { const positions = entity.wall.positions.getValue(Iso8601.MINIMUM_VALUE); expect(positions).toEqualEpsilon( [Cartesian3.fromDegrees(1, 2, 3), Cartesian3.fromDegrees(4, 5, 6)], - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); }); }); @@ -3966,24 +3968,24 @@ describe("DataSources/KmlDataSource", function () { const entity = dataSource.entities.values[0]; expect(entity.position.getValue(time1)).toEqualEpsilon( Cartesian3.fromDegrees(1, 2, 3), - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); expect(entity.position.getValue(time2)).toEqualEpsilon( Cartesian3.fromDegrees(4, 5, 6), - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); expect(entity.position.getValue(time3)).toEqualEpsilon( Cartesian3.fromDegrees(7, 8, 9), - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); expect(entity.billboard.heightReference.getValue(time1)).toEqual( - HeightReference.CLAMP_TO_GROUND + HeightReference.CLAMP_TO_GROUND, ); expect(entity.billboard.heightReference.getValue(time2)).toEqual( - HeightReference.CLAMP_TO_GROUND + HeightReference.CLAMP_TO_GROUND, ); expect(entity.billboard.heightReference.getValue(time3)).toEqual( - HeightReference.CLAMP_TO_GROUND + HeightReference.CLAMP_TO_GROUND, ); expect(entity.polyline).toBeUndefined(); @@ -4019,24 +4021,24 @@ describe("DataSources/KmlDataSource", function () { const entity = dataSource.entities.values[0]; expect(entity.position.getValue(time1)).toEqualEpsilon( Cartesian3.fromDegrees(1, 2, 3), - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); expect(entity.position.getValue(time2)).toEqualEpsilon( Cartesian3.fromDegrees(4, 5, 6), - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); expect(entity.position.getValue(time3)).toEqualEpsilon( Cartesian3.fromDegrees(7, 8, 9), - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); expect(entity.billboard.heightReference.getValue(time1)).toEqual( - HeightReference.CLAMP_TO_GROUND + HeightReference.CLAMP_TO_GROUND, ); expect(entity.billboard.heightReference.getValue(time2)).toEqual( - HeightReference.CLAMP_TO_GROUND + HeightReference.CLAMP_TO_GROUND, ); expect(entity.billboard.heightReference.getValue(time3)).toEqual( - HeightReference.CLAMP_TO_GROUND + HeightReference.CLAMP_TO_GROUND, ); expect(entity.polyline).toBeUndefined(); }); @@ -4061,7 +4063,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const time1 = JulianDate.fromIso8601("2000-01-01T00:00:00Z"); const time2 = JulianDate.fromIso8601("2000-01-01T00:00:01Z"); @@ -4070,28 +4072,28 @@ describe("DataSources/KmlDataSource", function () { const entity = dataSource.entities.values[0]; expect(entity.position.getValue(time1)).toEqualEpsilon( Cartesian3.fromDegrees(1, 2, 3), - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); expect(entity.position.getValue(time2)).toEqualEpsilon( Cartesian3.fromDegrees(4, 5, 6), - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); expect(entity.position.getValue(time3)).toEqualEpsilon( Cartesian3.fromDegrees(7, 8, 9), - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); expect(entity.polyline.positions.getValue(time1)).toEqualEpsilon( [Cartesian3.fromDegrees(1, 2, 3), Cartesian3.fromDegrees(1, 2)], - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); expect(entity.polyline.positions.getValue(time2)).toEqualEpsilon( [Cartesian3.fromDegrees(4, 5, 6), Cartesian3.fromDegrees(4, 5)], - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); expect(entity.polyline.positions.getValue(time3)).toEqualEpsilon( [Cartesian3.fromDegrees(7, 8, 9), Cartesian3.fromDegrees(7, 8)], - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); }); }); @@ -4115,7 +4117,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const time1 = JulianDate.fromIso8601("2000-01-01T00:00:00Z"); const time2 = JulianDate.fromIso8601("2000-01-01T00:00:01Z"); @@ -4124,28 +4126,28 @@ describe("DataSources/KmlDataSource", function () { const entity = dataSource.entities.values[0]; expect(entity.position.getValue(time1)).toEqualEpsilon( Cartesian3.fromDegrees(1, 2, 3), - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); expect(entity.position.getValue(time2)).toEqualEpsilon( Cartesian3.fromDegrees(4, 5, 6), - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); expect(entity.position.getValue(time3)).toEqualEpsilon( Cartesian3.fromDegrees(7, 8, 9), - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); expect(entity.polyline.positions.getValue(time1)).toEqualEpsilon( [Cartesian3.fromDegrees(1, 2, 3), Cartesian3.fromDegrees(1, 2)], - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); expect(entity.polyline.positions.getValue(time2)).toEqualEpsilon( [Cartesian3.fromDegrees(4, 5, 6), Cartesian3.fromDegrees(4, 5)], - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); expect(entity.polyline.positions.getValue(time3)).toEqualEpsilon( [Cartesian3.fromDegrees(7, 8, 9), Cartesian3.fromDegrees(7, 8)], - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); }); }); @@ -4174,23 +4176,23 @@ describe("DataSources/KmlDataSource", function () { const entity = dataSource.entities.values[0]; expect(entity.position.getValue(time1)).toEqualEpsilon( Cartesian3.fromDegrees(1, 2, 3), - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); expect(entity.position.getValue(time2)).toEqualEpsilon( Cartesian3.fromDegrees(4, 5, 6), - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); expect(entity.position.getValue(time3)).toBeUndefined(); // heightReference should be constant so its available all the time expect(entity.billboard.heightReference.getValue(time1)).toEqual( - HeightReference.CLAMP_TO_GROUND + HeightReference.CLAMP_TO_GROUND, ); expect(entity.billboard.heightReference.getValue(time2)).toEqual( - HeightReference.CLAMP_TO_GROUND + HeightReference.CLAMP_TO_GROUND, ); expect(entity.billboard.heightReference.getValue(time3)).toEqual( - HeightReference.CLAMP_TO_GROUND + HeightReference.CLAMP_TO_GROUND, ); expect(entity.availability.start).toEqual(time1); @@ -4221,7 +4223,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const time1 = JulianDate.fromIso8601("2000-01-01T00:00:00Z"); const time2 = JulianDate.fromIso8601("2000-01-01T00:00:01Z"); @@ -4237,19 +4239,19 @@ describe("DataSources/KmlDataSource", function () { expect(entity.position.getValue(time1)).toEqualEpsilon( Cartesian3.fromDegrees(1, 2), - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); expect(entity.position.getValue(time2)).toEqualEpsilon( Cartesian3.fromDegrees(4, 5), - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); expect(entity.position.getValue(time3)).toEqualEpsilon( Cartesian3.fromDegrees(6, 5), - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); expect(entity.position.getValue(time4)).toEqualEpsilon( Cartesian3.fromDegrees(3, 2), - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); }); }); @@ -4278,7 +4280,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const time1 = JulianDate.fromIso8601("2000-01-01T00:00:00Z"); const time2 = JulianDate.fromIso8601("2000-01-01T00:00:01Z"); @@ -4292,19 +4294,19 @@ describe("DataSources/KmlDataSource", function () { expect(entity.position.getValue(time1)).toEqualEpsilon( Cartesian3.fromDegrees(1, 2), - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); expect(entity.position.getValue(time2)).toEqualEpsilon( Cartesian3.fromDegrees(4, 5), - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); expect(entity.position.getValue(time3)).toEqualEpsilon( Cartesian3.fromDegrees(6, 5), - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); expect(entity.position.getValue(time4)).toEqualEpsilon( Cartesian3.fromDegrees(3, 2), - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); }); }); @@ -4337,7 +4339,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const time1 = JulianDate.fromIso8601("2000-01-01T00:00:00Z"); const time2 = JulianDate.fromIso8601("2000-01-01T00:00:01Z"); @@ -4350,16 +4352,16 @@ describe("DataSources/KmlDataSource", function () { expect(entity.availability.get(0).stop).toEqual(time4); expect(entity.position.getValue(time1)).toEqual( - Cartesian3.fromDegrees(1, 2, 3) + Cartesian3.fromDegrees(1, 2, 3), ); expect(entity.position.getValue(time2)).toEqual( - Cartesian3.fromDegrees(4, 5, 6) + Cartesian3.fromDegrees(4, 5, 6), ); expect(entity.position.getValue(time3)).toEqual( - Cartesian3.fromDegrees(6, 5, 4) + Cartesian3.fromDegrees(6, 5, 4), ); expect(entity.position.getValue(time4)).toEqual( - Cartesian3.fromDegrees(3, 2, 1) + Cartesian3.fromDegrees(3, 2, 1), ); }); }); @@ -4382,7 +4384,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entities = dataSource.entities; expect(entities.values.length).toEqual(3); @@ -4398,7 +4400,7 @@ describe("DataSources/KmlDataSource", function () { expect(point1.kml).toBe(multi.kml); expect(point1.position.getValue(Iso8601.MINIMUM_VALUE)).toEqualEpsilon( Cartesian3.fromDegrees(1, 2), - CesiumMath.EPSILON13 + CesiumMath.EPSILON13, ); const point2 = entities.getById("testIDpoint2"); @@ -4409,7 +4411,7 @@ describe("DataSources/KmlDataSource", function () { expect(point2.kml).toBe(multi.kml); expect(point2.position.getValue(Iso8601.MINIMUM_VALUE)).toEqualEpsilon( Cartesian3.fromDegrees(3, 4), - CesiumMath.EPSILON13 + CesiumMath.EPSILON13, ); }); }); @@ -4421,7 +4423,7 @@ describe("DataSources/KmlDataSource", function () { expect(entities.length).toEqual(2); expect(entities[0].id).toEqual("link"); expect(entities[1].parent).toBe(entities[0]); - } + }, ); }); @@ -4438,7 +4440,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entities = dataSource.entities.values; expect(entities.length).toEqual(3); @@ -4484,7 +4486,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entities = dataSource.entities.values; expect(entities.length).toEqual(3); @@ -4534,7 +4536,7 @@ describe("DataSources/KmlDataSource", function () { canvas: uberCanvas, camera: uberCamera, options: options, - }) + }), ).then(function (dataSource) { const entities = dataSource.entities.values; expect(entities.length).toEqual(3); @@ -4557,7 +4559,7 @@ describe("DataSources/KmlDataSource", function () { }).then(function () { expect(spy).toHaveBeenCalledWith( dataSource, - `${expectedRefreshLinkHref}?BBOX=-180%2C-90%2C180%2C90` + `${expectedRefreshLinkHref}?BBOX=-180%2C-90%2C180%2C90`, ); expect(entities.length).toEqual(3); @@ -4584,18 +4586,20 @@ describe("DataSources/KmlDataSource", function () { </NetworkLink>'; const requestNetworkLink = defer(); - spyOn(Resource._Implementations, "loadWithXhr").and.callFake(function ( - url, - responseType, - method, - data, - headers, - deferred, - overrideMimeType - ) { - requestNetworkLink.resolve(url); - deferred.reject(); - }); + spyOn(Resource._Implementations, "loadWithXhr").and.callFake( + function ( + url, + responseType, + method, + data, + headers, + deferred, + overrideMimeType, + ) { + requestNetworkLink.resolve(url); + deferred.reject(); + }, + ); KmlDataSource.load(parser.parseFromString(kml, "text/xml"), options); @@ -4614,18 +4618,20 @@ describe("DataSources/KmlDataSource", function () { </NetworkLink>'; const requestNetworkLink = defer(); - spyOn(Resource._Implementations, "loadWithXhr").and.callFake(function ( - url, - responseType, - method, - data, - headers, - deferred, - overrideMimeType - ) { - requestNetworkLink.resolve(url); - deferred.reject(); - }); + spyOn(Resource._Implementations, "loadWithXhr").and.callFake( + function ( + url, + responseType, + method, + data, + headers, + deferred, + overrideMimeType, + ) { + requestNetworkLink.resolve(url); + deferred.reject(); + }, + ); KmlDataSource.load(parser.parseFromString(kml, "text/xml"), options); @@ -4645,24 +4651,26 @@ describe("DataSources/KmlDataSource", function () { </NetworkLink>'; const requestNetworkLink = defer(); - spyOn(Resource._Implementations, "loadWithXhr").and.callFake(function ( - url, - responseType, - method, - data, - headers, - deferred, - overrideMimeType - ) { - requestNetworkLink.resolve(url); - deferred.reject(); - }); + spyOn(Resource._Implementations, "loadWithXhr").and.callFake( + function ( + url, + responseType, + method, + data, + headers, + deferred, + overrideMimeType, + ) { + requestNetworkLink.resolve(url); + deferred.reject(); + }, + ); KmlDataSource.load(parser.parseFromString(kml, "text/xml"), options); return requestNetworkLink.promise.then(function (url) { expect(url).toEqual( - `${expectedRefreshLinkHref}?BBOX=-180%2C-90%2C180%2C90` + `${expectedRefreshLinkHref}?BBOX=-180%2C-90%2C180%2C90`, ); }); }); @@ -4679,24 +4687,26 @@ describe("DataSources/KmlDataSource", function () { </NetworkLink>'; const requestNetworkLink = defer(); - spyOn(Resource._Implementations, "loadWithXhr").and.callFake(function ( - url, - responseType, - method, - data, - headers, - deferred, - overrideMimeType - ) { - requestNetworkLink.resolve(url); - deferred.reject(); - }); + spyOn(Resource._Implementations, "loadWithXhr").and.callFake( + function ( + url, + responseType, + method, + data, + headers, + deferred, + overrideMimeType, + ) { + requestNetworkLink.resolve(url); + deferred.reject(); + }, + ); KmlDataSource.load(parser.parseFromString(kml, "text/xml"), options); return requestNetworkLink.promise.then(function (url) { expect(url).toEqual( - `${expectedRefreshLinkHref}?client=Cesium-v1&v=2.2&lang=English` + `${expectedRefreshLinkHref}?client=Cesium-v1&v=2.2&lang=English`, ); }); }); @@ -4713,24 +4723,26 @@ describe("DataSources/KmlDataSource", function () { </NetworkLink>'; const requestNetworkLink = defer(); - spyOn(Resource._Implementations, "loadWithXhr").and.callFake(function ( - url, - responseType, - method, - data, - headers, - deferred, - overrideMimeType - ) { - requestNetworkLink.resolve(url); - deferred.reject(); - }); + spyOn(Resource._Implementations, "loadWithXhr").and.callFake( + function ( + url, + responseType, + method, + data, + headers, + deferred, + overrideMimeType, + ) { + requestNetworkLink.resolve(url); + deferred.reject(); + }, + ); KmlDataSource.load(parser.parseFromString(kml, "text/xml"), options); return requestNetworkLink.promise.then(function (url) { expect(url).toEqual( - `${expectedRefreshLinkHref}?client=Cesium-v1&v=2.2&lang=English` + `${expectedRefreshLinkHref}?client=Cesium-v1&v=2.2&lang=English`, ); }); }); @@ -4749,27 +4761,29 @@ describe("DataSources/KmlDataSource", function () { </NetworkLink>'; const requestNetworkLink = defer(); - spyOn(Resource._Implementations, "loadWithXhr").and.callFake(function ( - url, - responseType, - method, - data, - headers, - deferred, - overrideMimeType - ) { - requestNetworkLink.resolve(url); - deferred.reject(); - }); + spyOn(Resource._Implementations, "loadWithXhr").and.callFake( + function ( + url, + responseType, + method, + data, + headers, + deferred, + overrideMimeType, + ) { + requestNetworkLink.resolve(url); + deferred.reject(); + }, + ); KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - Object.assign({ camera: uberCamera, canvas: uberCanvas }, options) + Object.assign({ camera: uberCamera, canvas: uberCanvas }, options), ); return requestNetworkLink.promise.then(function (url) { expect(url).toEqual( - `${expectedRefreshLinkHref}?BBOX=-180%2C-90%2C180%2C90&CAMERA=0%2C0%2C6378137%2C0%2C0&VIEW=45%2C45%2C512%2C512%2C1` + `${expectedRefreshLinkHref}?BBOX=-180%2C-90%2C180%2C90&CAMERA=0%2C0%2C6378137%2C0%2C0&VIEW=45%2C45%2C512%2C512%2C1`, ); }); }); @@ -4788,18 +4802,20 @@ describe("DataSources/KmlDataSource", function () { </NetworkLink>'; const requestNetworkLink = defer(); - spyOn(Resource._Implementations, "loadWithXhr").and.callFake(function ( - url, - responseType, - method, - data, - headers, - deferred, - overrideMimeType - ) { - requestNetworkLink.resolve(url); - deferred.reject(); - }); + spyOn(Resource._Implementations, "loadWithXhr").and.callFake( + function ( + url, + responseType, + method, + data, + headers, + deferred, + overrideMimeType, + ) { + requestNetworkLink.resolve(url); + deferred.reject(); + }, + ); const src = new KmlDataSource(); src.camera = uberCamera; @@ -4808,7 +4824,7 @@ describe("DataSources/KmlDataSource", function () { return requestNetworkLink.promise.then(function (url) { expect(url).toEqual( - `${expectedRefreshLinkHref}?BBOX=-180%2C-90%2C180%2C90&CAMERA=0%2C0%2C6378137%2C0%2C0&VIEW=45%2C45%2C512%2C512%2C1` + `${expectedRefreshLinkHref}?BBOX=-180%2C-90%2C180%2C90&CAMERA=0%2C0%2C6378137%2C0%2C0&VIEW=45%2C45%2C512%2C512%2C1`, ); }); }); @@ -4826,18 +4842,20 @@ describe("DataSources/KmlDataSource", function () { </NetworkLink>'; const requestNetworkLink = defer(); - spyOn(Resource._Implementations, "loadWithXhr").and.callFake(function ( - url, - responseType, - method, - data, - headers, - deferred, - overrideMimeType - ) { - requestNetworkLink.resolve(url); - deferred.reject(); - }); + spyOn(Resource._Implementations, "loadWithXhr").and.callFake( + function ( + url, + responseType, + method, + data, + headers, + deferred, + overrideMimeType, + ) { + requestNetworkLink.resolve(url); + deferred.reject(); + }, + ); KmlDataSource.load(parser.parseFromString(kml, "text/xml"), options); @@ -4879,7 +4897,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - ourOptions + ourOptions, ).then(function (dataSource) { const entities = dataSource.entities.values; expect(entities.length).toEqual(3); @@ -4902,7 +4920,7 @@ describe("DataSources/KmlDataSource", function () { }).then(function () { expect(spy).toHaveBeenCalledWith( dataSource, - `${expectedRefreshLinkHref}?BBOX=0%2C0%2C0%2C0` + `${expectedRefreshLinkHref}?BBOX=0%2C0%2C0%2C0`, ); expect(entities.length).toEqual(3); @@ -4934,7 +4952,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const start = JulianDate.fromIso8601("2000-01-01"); const stop = JulianDate.fromIso8601("2000-01-03"); @@ -4963,7 +4981,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const start = JulianDate.fromIso8601("2000-01-03"); @@ -4984,7 +5002,7 @@ describe("DataSources/KmlDataSource", function () { expect(entities.length).toBe(3); expect(entities[1].billboard).not.toBeNull(); expect(entities[1].position.getValue(Iso8601.MINIMUM_VALUE)).toEqual( - Cartesian3.fromDegrees(1, 2, 3) + Cartesian3.fromDegrees(1, 2, 3), ); // The root network link is loaded, then the children @@ -4993,7 +5011,7 @@ describe("DataSources/KmlDataSource", function () { expect(entities[0].parent).toBeUndefined(); expect(entities[2].parent).toBe(entities[0]); expect(entities[1].parent).toBe(entities[2]); - } + }, ); }); @@ -5001,7 +5019,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load("Data/KML/namespaced.kml", options).then( function (dataSource) { expect(dataSource.entities.values.length).toBe(3); - } + }, ); }); @@ -5014,7 +5032,7 @@ describe("DataSources/KmlDataSource", function () { const polylineColor = polyline.material.color.getValue(); expect(polylineColor).toEqual(expectedColor); expect(polyline.width.getValue()).toEqual(10); - } + }, ); }); @@ -5030,7 +5048,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entity = dataSource.entities.values[0]; expect(entity.polygon.perPositionHeight.getValue()).toEqual(true); @@ -5049,7 +5067,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entity = dataSource.entities.values[0]; expect(entity.polygon.perPositionHeight.getValue()).toEqual(true); @@ -5069,7 +5087,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entity = dataSource.entities.values[0]; expect(entity.name).toBe("bob"); @@ -5095,7 +5113,7 @@ describe("DataSources/KmlDataSource", function () { </Placemark>'; return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entityCollection = dataSource.entities; const entity = entityCollection.values[0]; @@ -5117,12 +5135,12 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { expect(dataSource.entities.values.length).toEqual(1); expect(console.warn.calls.count()).toEqual(1); expect(console.warn).toHaveBeenCalledWith( - "KML - Unsupported Icon refreshMode: onInterval" + "KML - Unsupported Icon refreshMode: onInterval", ); }); }); @@ -5141,12 +5159,12 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { expect(dataSource.entities.values.length).toEqual(1); expect(console.warn.calls.count()).toEqual(1); expect(console.warn).toHaveBeenCalledWith( - "KML - Unsupported Icon viewRefreshMode: onStop" + "KML - Unsupported Icon viewRefreshMode: onStop", ); }); }); @@ -5168,12 +5186,12 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { expect(dataSource.entities.values.length).toEqual(1); expect(console.warn.calls.count()).toEqual(1); expect(console.warn).toHaveBeenCalledWith( - "KML - gx:x, gx:y, gx:w, gx:h aren't supported for GroundOverlays" + "KML - gx:x, gx:y, gx:w, gx:h aren't supported for GroundOverlays", ); }); }); @@ -5204,21 +5222,21 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { expect(dataSource.entities.values.length).toEqual(1); expect(console.warn.calls.count()).toEqual(4); expect(console.warn.calls.argsFor(0)[0]).toBe( - "KML - gx:outerColor is not supported in a LineStyle" + "KML - gx:outerColor is not supported in a LineStyle", ); expect(console.warn.calls.argsFor(1)[0]).toBe( - "KML - gx:outerWidth is not supported in a LineStyle" + "KML - gx:outerWidth is not supported in a LineStyle", ); expect(console.warn.calls.argsFor(2)[0]).toBe( - "KML - gx:physicalWidth is not supported in a LineStyle" + "KML - gx:physicalWidth is not supported in a LineStyle", ); expect(console.warn.calls.argsFor(3)[0]).toBe( - "KML - gx:labelVisibility is not supported in a LineStyle" + "KML - gx:labelVisibility is not supported in a LineStyle", ); }); }); @@ -5238,12 +5256,12 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { expect(dataSource.entities.values.length).toEqual(1); expect(console.warn.calls.count()).toEqual(1); expect(console.warn).toHaveBeenCalledWith( - "KML - Unsupported ListStyle with listItemType: radioFolder" + "KML - Unsupported ListStyle with listItemType: radioFolder", ); }); }); @@ -5270,12 +5288,12 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { expect(dataSource.entities.values.length).toEqual(1); expect(console.warn.calls.count()).toEqual(1); expect(console.warn).toHaveBeenCalledWith( - "KML - Unsupported StyleMap key: highlighted" + "KML - Unsupported StyleMap key: highlighted", ); }); }); @@ -5299,12 +5317,12 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { expect(dataSource.entities.values.length).toEqual(1); expect(console.warn.calls.count()).toEqual(1); expect(console.warn).toHaveBeenCalledWith( - "KML - gx:drawOrder is not supported in LineStrings when clampToGround is false" + "KML - gx:drawOrder is not supported in LineStrings when clampToGround is false", ); }); }); @@ -5325,12 +5343,12 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { expect(dataSource.entities.values.length).toEqual(1); expect(console.warn.calls.count()).toEqual(1); expect(console.warn).toHaveBeenCalledWith( - "KML - gx:angles are not supported in gx:Tracks" + "KML - gx:angles are not supported in gx:Tracks", ); }); }); @@ -5346,12 +5364,12 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { expect(dataSource.entities.values.length).toEqual(1); expect(console.warn.calls.count()).toEqual(1); expect(console.warn).toHaveBeenCalledWith( - "KML - Unsupported geometry: Model" + "KML - Unsupported geometry: Model", ); }); }); @@ -5374,15 +5392,15 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { expect(dataSource.entities.values.length).toEqual(1); expect(console.warn.calls.count()).toEqual(2); expect(console.warn.calls.argsFor(0)[0]).toBe( - "KML - SchemaData is unsupported" + "KML - SchemaData is unsupported", ); expect(console.warn.calls.argsFor(1)[0]).toBe( - "KML - ExtendedData with xmlns:prefix is unsupported" + "KML - ExtendedData with xmlns:prefix is unsupported", ); }); }); @@ -5411,22 +5429,22 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { expect(dataSource.entities.values.length).toEqual(1); const placemark = dataSource.entities.values[0]; expect(placemark.kml.camera).toBeInstanceOf(KmlCamera); expect(placemark.kml.lookAt).toBeInstanceOf(KmlLookAt); expect(placemark.kml.lookAt.position).toEqual( - Cartesian3.fromDegrees(-120, 40, 100) + Cartesian3.fromDegrees(-120, 40, 100), ); expect(placemark.kml.lookAt.headingPitchRange).toEqualEpsilon( new HeadingPitchRange( CesiumMath.toRadians(90), CesiumMath.toRadians(30 - 90), - 1250 + 1250, ), - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); }); }); @@ -5447,12 +5465,12 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { expect(dataSource.entities.values.length).toEqual(1); expect(console.warn.calls.count()).toEqual(1); expect(console.warn).toHaveBeenCalledWith( - "KML - Placemark Regions are unsupported" + "KML - Placemark Regions are unsupported", ); }); }); @@ -5471,12 +5489,12 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { expect(dataSource.entities.values.length).toEqual(1); expect(console.warn.calls.count()).toEqual(1); expect(console.warn).toHaveBeenCalledWith( - "KML - Unsupported viewRefreshMode: onRegion" + "KML - Unsupported viewRefreshMode: onRegion", ); }); }); @@ -5501,7 +5519,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { expect(dataSource.kmlTours.length).toEqual(1); const tour = dataSource.kmlTours[0]; @@ -5554,7 +5572,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { expect(dataSource.kmlTours.length).toEqual(1); const tour = dataSource.kmlTours[0]; @@ -5599,18 +5617,18 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { expect(dataSource.kmlTours.length).toEqual(1); expect(dataSource.kmlTours[0].playlist.length).toEqual(0); expect(console.warn).toHaveBeenCalledWith( - "KML Tour unsupported node AnimatedUpdate" + "KML Tour unsupported node AnimatedUpdate", ); expect(console.warn).toHaveBeenCalledWith( - "KML Tour unsupported node TourControl" + "KML Tour unsupported node TourControl", ); expect(console.warn).toHaveBeenCalledWith( - "KML Tour unsupported node SoundCue" + "KML Tour unsupported node SoundCue", ); }); }); @@ -5629,12 +5647,12 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { expect(dataSource.entities.values.length).toEqual(2); expect(console.warn.calls.count()).toEqual(1); expect(console.warn).toHaveBeenCalledWith( - "KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element" + "KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element", ); }); }); @@ -5663,7 +5681,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - kmlOptions + kmlOptions, ).then(function (dataSource) { expect(dataSource.entities.values.length).toEqual(2); }); @@ -5680,7 +5698,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entity = dataSource.entities.values[0]; expect(entity.polygon.perPositionHeight.getValue()).toEqual(true); @@ -5699,7 +5717,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { const entity = dataSource.entities.values[0]; expect(entity.polygon.perPositionHeight).toBeUndefined(); @@ -5727,7 +5745,7 @@ describe("DataSources/KmlDataSource", function () { const clampToGroundOptions = combine(options, { clampToGround: true }); return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - clampToGroundOptions + clampToGroundOptions, ).then(function (dataSource) { const entity = dataSource.entities.values[0]; expect(entity.polyline).toBeDefined(); @@ -5760,7 +5778,7 @@ describe("DataSources/KmlDataSource", function () { const clampToGroundOptions = combine(options, { clampToGround: true }); return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - clampToGroundOptions + clampToGroundOptions, ).then(function (dataSource) { const entity = dataSource.entities.values[0]; expect(entity.polyline).toBeDefined(); @@ -5833,13 +5851,13 @@ describe("DataSources/KmlDataSource", function () { CesiumMath.setRandomNumberSeed(0); return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options + options, ).then(function (dataSource) { expect(dataSource.entities.values.length).toEqual(4); expect( - dataSource.entities.values[2].polygon.material.color.getValue() + dataSource.entities.values[2].polygon.material.color.getValue(), ).not.toEqual( - dataSource.entities.values[3].polygon.material.color.getValue() + dataSource.entities.values[3].polygon.material.color.getValue(), ); }); }); diff --git a/packages/engine/Specs/DataSources/KmlTourFlyToSpec.js b/packages/engine/Specs/DataSources/KmlTourFlyToSpec.js index da982b9920aa..b7647fd76368 100644 --- a/packages/engine/Specs/DataSources/KmlTourFlyToSpec.js +++ b/packages/engine/Specs/DataSources/KmlTourFlyToSpec.js @@ -16,7 +16,7 @@ describe("DataSources/KmlTourFlyTo", function () { const hpr = new HeadingPitchRange( CesiumMath.toRadians(10.0), CesiumMath.toRadians(45.0), - 10000 + 10000, ); const flyto = new KmlTourFlyTo(10, "bounce", new KmlLookAt(position, hpr)); @@ -35,7 +35,7 @@ describe("DataSources/KmlTourFlyTo", function () { const hpr = new HeadingPitchRoll( CesiumMath.toRadians(10.0), CesiumMath.toRadians(45.0), - 0 + 0, ); const flyto = new KmlTourFlyTo(10, "bounce", new KmlCamera(position, hpr)); @@ -56,7 +56,7 @@ describe("DataSources/KmlTourFlyTo", function () { const hpr = new HeadingPitchRange( CesiumMath.toRadians(10.0), CesiumMath.toRadians(45.0), - 10000 + 10000, ); const flyto = new KmlTourFlyTo(10, "bounce", new KmlLookAt(position, hpr)); @@ -73,13 +73,13 @@ describe("DataSources/KmlTourFlyTo", function () { const hpr = new HeadingPitchRoll( CesiumMath.toRadians(10.0), CesiumMath.toRadians(45.0), - 0 + 0, ); const flyto = new KmlTourFlyTo( 0.01, "bounce", - new KmlCamera(position, hpr) + new KmlCamera(position, hpr), ); const doneSpy = jasmine.createSpy("cameraDone"); const flyFake = jasmine.createSpy("flyTo").and.callFake(function (options) { @@ -97,7 +97,7 @@ describe("DataSources/KmlTourFlyTo", function () { }).then(function () { expect(fakeCamera.flyTo).toHaveBeenCalled(); expect(fakeCamera.flyTo.calls.mostRecent().args[0].destination).toBe( - position + position, ); expect(fakeCamera.flyTo.calls.mostRecent().args[0].orientation).toBe(hpr); expect(doneSpy).toHaveBeenCalled(); @@ -109,13 +109,13 @@ describe("DataSources/KmlTourFlyTo", function () { const hpr = new HeadingPitchRange( CesiumMath.toRadians(10.0), CesiumMath.toRadians(45.0), - 10000 + 10000, ); const flyto = new KmlTourFlyTo( 0.01, "bounce", - new KmlLookAt(position, hpr) + new KmlLookAt(position, hpr), ); const doneSpy = jasmine.createSpy("cameraDone"); const flyFake = jasmine @@ -135,16 +135,16 @@ describe("DataSources/KmlTourFlyTo", function () { }).then(function () { expect(fakeCamera.flyToBoundingSphere).toHaveBeenCalled(); expect( - fakeCamera.flyToBoundingSphere.calls.mostRecent().args[0].center.x + fakeCamera.flyToBoundingSphere.calls.mostRecent().args[0].center.x, ).toEqual(position.x); expect( - fakeCamera.flyToBoundingSphere.calls.mostRecent().args[0].center.y + fakeCamera.flyToBoundingSphere.calls.mostRecent().args[0].center.y, ).toEqual(position.y); expect( - fakeCamera.flyToBoundingSphere.calls.mostRecent().args[0].center.z + fakeCamera.flyToBoundingSphere.calls.mostRecent().args[0].center.z, ).toEqual(position.z); expect( - fakeCamera.flyToBoundingSphere.calls.mostRecent().args[1].offset + fakeCamera.flyToBoundingSphere.calls.mostRecent().args[1].offset, ).toBe(hpr); expect(doneSpy).toHaveBeenCalled(); }); diff --git a/packages/engine/Specs/DataSources/KmlTourSpec.js b/packages/engine/Specs/DataSources/KmlTourSpec.js index 4e2c87e8f35a..bfb9f4b6f883 100644 --- a/packages/engine/Specs/DataSources/KmlTourSpec.js +++ b/packages/engine/Specs/DataSources/KmlTourSpec.js @@ -16,7 +16,7 @@ describe("DataSources/KmlTour", function () { const hpr = new HeadingPitchRange( CesiumMath.toRadians(10.0), CesiumMath.toRadians(45.0), - 10000 + 10000, ); return new KmlLookAt(position, hpr); } @@ -55,16 +55,16 @@ describe("DataSources/KmlTour", function () { }); it("calls entries play", function () { - const waitSpy = spyOn(KmlTourWait.prototype, "play").and.callFake(function ( - callback - ) { - callback(); - }); - const flySpy = spyOn(KmlTourFlyTo.prototype, "play").and.callFake(function ( - callback - ) { - callback(); - }); + const waitSpy = spyOn(KmlTourWait.prototype, "play").and.callFake( + function (callback) { + callback(); + }, + ); + const flySpy = spyOn(KmlTourFlyTo.prototype, "play").and.callFake( + function (callback) { + callback(); + }, + ); const tour = new KmlTour("test", "test"); const wait = new KmlTourWait(0.1); @@ -147,7 +147,7 @@ describe("DataSources/KmlTour", function () { expect(mockWidget.scene.camera.flyTo.calls.count()).toEqual(0); expect(mockWidget.scene.camera.flyToBoundingSphere.calls.count()).toEqual( - 0 + 0, ); }, 5); }); diff --git a/packages/engine/Specs/DataSources/LabelGraphicsSpec.js b/packages/engine/Specs/DataSources/LabelGraphicsSpec.js index 8c712664d2cd..eed297c88dba 100644 --- a/packages/engine/Specs/DataSources/LabelGraphicsSpec.js +++ b/packages/engine/Specs/DataSources/LabelGraphicsSpec.js @@ -63,17 +63,17 @@ describe("DataSources/LabelGraphics", function () { expect(label.scale.getValue()).toEqual(options.scale); expect(label.show.getValue()).toEqual(options.show); expect(label.translucencyByDistance.getValue()).toEqual( - options.translucencyByDistance + options.translucencyByDistance, ); expect(label.pixelOffsetScaleByDistance.getValue()).toEqual( - options.pixelOffsetScaleByDistance + options.pixelOffsetScaleByDistance, ); expect(label.scaleByDistance.getValue()).toEqual(options.scaleByDistance); expect(label.distanceDisplayCondition.getValue()).toEqual( - options.distanceDisplayCondition + options.distanceDisplayCondition, ); expect(label.disableDepthTestDistance.getValue()).toEqual( - options.disableDepthTestDistance + options.disableDepthTestDistance, ); }); @@ -93,13 +93,13 @@ describe("DataSources/LabelGraphics", function () { source.show = new ConstantProperty(false); source.translucencyByDistance = new ConstantProperty(new NearFarScalar()); source.pixelOffsetScaleByDistance = new ConstantProperty( - new NearFarScalar(1.0, 0.0, 3.0e9, 0.0) + new NearFarScalar(1.0, 0.0, 3.0e9, 0.0), ); source.scaleByDistance = new ConstantProperty( - new NearFarScalar(1.0, 0.0, 3.0e9, 0.0) + new NearFarScalar(1.0, 0.0, 3.0e9, 0.0), ); source.distanceDisplayCondition = new ConstantProperty( - new DistanceDisplayCondition(10.0, 100.0) + new DistanceDisplayCondition(10.0, 100.0), ); source.disableDepthTestDistance = new ConstantProperty(10.0); @@ -120,14 +120,14 @@ describe("DataSources/LabelGraphics", function () { expect(target.show).toBe(source.show); expect(target.translucencyByDistance).toBe(source.translucencyByDistance); expect(target.pixelOffsetScaleByDistance).toBe( - source.pixelOffsetScaleByDistance + source.pixelOffsetScaleByDistance, ); expect(target.scaleByDistance).toBe(source.scaleByDistance); expect(target.distanceDisplayCondition).toBe( - source.distanceDisplayCondition + source.distanceDisplayCondition, ); expect(target.disableDepthTestDistance).toBe( - source.disableDepthTestDistance + source.disableDepthTestDistance, ); }); @@ -147,13 +147,13 @@ describe("DataSources/LabelGraphics", function () { source.show = new ConstantProperty(false); source.translucencyByDistance = new ConstantProperty(new NearFarScalar()); source.pixelOffsetScaleByDistance = new ConstantProperty( - new NearFarScalar(1.0, 0.0, 3.0e9, 0.0) + new NearFarScalar(1.0, 0.0, 3.0e9, 0.0), ); source.scaleByDistance = new ConstantProperty( - new NearFarScalar(1.0, 0.0, 3.0e9, 0.0) + new NearFarScalar(1.0, 0.0, 3.0e9, 0.0), ); source.distanceDisplayCondition = new ConstantProperty( - new DistanceDisplayCondition(10.0, 100.0) + new DistanceDisplayCondition(10.0, 100.0), ); source.disableDepthTestDistance = new ConstantProperty(10.0); @@ -171,11 +171,11 @@ describe("DataSources/LabelGraphics", function () { const show = new ConstantProperty(true); const translucencyByDistance = new ConstantProperty(new NearFarScalar()); const pixelOffsetScaleByDistance = new ConstantProperty( - new NearFarScalar() + new NearFarScalar(), ); const scaleByDistance = new ConstantProperty(new NearFarScalar()); const distanceDisplayCondition = new ConstantProperty( - new DistanceDisplayCondition() + new DistanceDisplayCondition(), ); const disableDepthTestDistance = new ConstantProperty(20.0); @@ -235,13 +235,13 @@ describe("DataSources/LabelGraphics", function () { source.show = new ConstantProperty(false); source.translucencyByDistance = new ConstantProperty(new NearFarScalar()); source.pixelOffsetScaleByDistance = new ConstantProperty( - new NearFarScalar(1.0, 0.0, 3.0e9, 0.0) + new NearFarScalar(1.0, 0.0, 3.0e9, 0.0), ); source.scaleByDistance = new ConstantProperty( - new NearFarScalar(1.0, 0.0, 3.0e9, 0.0) + new NearFarScalar(1.0, 0.0, 3.0e9, 0.0), ); source.distanceDisplayCondition = new ConstantProperty( - new DistanceDisplayCondition(10.0, 100.0) + new DistanceDisplayCondition(10.0, 100.0), ); source.disableDepthTestDistance = new ConstantProperty(10.0); @@ -260,14 +260,14 @@ describe("DataSources/LabelGraphics", function () { expect(result.show).toBe(source.show); expect(result.translucencyByDistance).toBe(source.translucencyByDistance); expect(result.pixelOffsetScaleByDistance).toBe( - source.pixelOffsetScaleByDistance + source.pixelOffsetScaleByDistance, ); expect(result.scaleByDistance).toBe(source.scaleByDistance); expect(result.distanceDisplayCondition).toBe( - source.distanceDisplayCondition + source.distanceDisplayCondition, ); expect(result.disableDepthTestDistance).toBe( - source.disableDepthTestDistance + source.disableDepthTestDistance, ); }); diff --git a/packages/engine/Specs/DataSources/LabelVisualizerSpec.js b/packages/engine/Specs/DataSources/LabelVisualizerSpec.js index d256deb1825d..2c47034ebcd2 100644 --- a/packages/engine/Specs/DataSources/LabelVisualizerSpec.js +++ b/packages/engine/Specs/DataSources/LabelVisualizerSpec.js @@ -87,7 +87,7 @@ describe( const testObject = entityCollection.getOrCreateEntity("test"); testObject.position = new ConstantProperty( - new Cartesian3(1234, 5678, 9101112) + new Cartesian3(1234, 5678, 9101112), ); visualizer.update(JulianDate.now()); expect(scene.primitives.get(0)).toBeUndefined(); @@ -112,7 +112,7 @@ describe( const testObject = entityCollection.getOrCreateEntity("test"); testObject.position = new ConstantProperty( - new Cartesian3(1234, 5678, 9101112) + new Cartesian3(1234, 5678, 9101112), ); const label = (testObject.label = new LabelGraphics()); label.show = new ConstantProperty(true); @@ -131,7 +131,7 @@ describe( const label = (testObject.label = new LabelGraphics()); testObject.position = new ConstantProperty( - new Cartesian3(1234, 5678, 9101112) + new Cartesian3(1234, 5678, 9101112), ); label.text = new ConstantProperty("a"); label.font = new ConstantProperty("sans serif"); @@ -147,11 +147,11 @@ describe( label.show = new ConstantProperty(true); label.translucencyByDistance = new ConstantProperty(new NearFarScalar()); label.pixelOffsetScaleByDistance = new ConstantProperty( - new NearFarScalar() + new NearFarScalar(), ); label.scaleByDistance = new ConstantProperty(new NearFarScalar()); label.distanceDisplayCondition = new ConstantProperty( - new DistanceDisplayCondition() + new DistanceDisplayCondition(), ); label.disableDepthTestDistance = new ConstantProperty(10.0); @@ -169,41 +169,41 @@ describe( expect(l.style).toEqual(testObject.label.style.getValue(time)); expect(l.fillColor).toEqual(testObject.label.fillColor.getValue(time)); expect(l.outlineColor).toEqual( - testObject.label.outlineColor.getValue(time) + testObject.label.outlineColor.getValue(time), ); expect(l.outlineWidth).toEqual( - testObject.label.outlineWidth.getValue(time) + testObject.label.outlineWidth.getValue(time), ); expect(l.horizontalOrigin).toEqual( - testObject.label.horizontalOrigin.getValue(time) + testObject.label.horizontalOrigin.getValue(time), ); expect(l.verticalOrigin).toEqual( - testObject.label.verticalOrigin.getValue(time) + testObject.label.verticalOrigin.getValue(time), ); expect(l.eyeOffset).toEqual(testObject.label.eyeOffset.getValue(time)); expect(l.pixelOffset).toEqual( - testObject.label.pixelOffset.getValue(time) + testObject.label.pixelOffset.getValue(time), ); expect(l.scale).toEqual(testObject.label.scale.getValue(time)); expect(l.show).toEqual(testObject.label.show.getValue(time)); expect(l.translucencyByDistance).toEqual( - testObject.label.translucencyByDistance.getValue(time) + testObject.label.translucencyByDistance.getValue(time), ); expect(l.pixelOffsetScaleByDistance).toEqual( - testObject.label.pixelOffsetScaleByDistance.getValue(time) + testObject.label.pixelOffsetScaleByDistance.getValue(time), ); expect(l.scaleByDistance).toEqual( - testObject.label.scaleByDistance.getValue(time) + testObject.label.scaleByDistance.getValue(time), ); expect(l.distanceDisplayCondition).toEqual( - testObject.label.distanceDisplayCondition.getValue(time) + testObject.label.distanceDisplayCondition.getValue(time), ); expect(l.disableDepthTestDistance).toEqual( - testObject.label.disableDepthTestDistance.getValue(time) + testObject.label.disableDepthTestDistance.getValue(time), ); testObject.position = new ConstantProperty( - new Cartesian3(5678, 1234, 1293434) + new Cartesian3(5678, 1234, 1293434), ); label.text = new ConstantProperty("b"); label.font = new ConstantProperty("serif"); @@ -219,11 +219,11 @@ describe( label.show = new ConstantProperty(true); label.translucencyByDistance = new ConstantProperty(new NearFarScalar()); label.pixelOffsetScaleByDistance = new ConstantProperty( - new NearFarScalar() + new NearFarScalar(), ); label.scaleByDistance = new ConstantProperty(new NearFarScalar()); label.distanceDisplayCondition = new ConstantProperty( - new DistanceDisplayCondition() + new DistanceDisplayCondition(), ); label.disableDepthTestDistance = new ConstantProperty(20.0); @@ -234,37 +234,37 @@ describe( expect(l.style).toEqual(testObject.label.style.getValue(time)); expect(l.fillColor).toEqual(testObject.label.fillColor.getValue(time)); expect(l.outlineColor).toEqual( - testObject.label.outlineColor.getValue(time) + testObject.label.outlineColor.getValue(time), ); expect(l.outlineWidth).toEqual( - testObject.label.outlineWidth.getValue(time) + testObject.label.outlineWidth.getValue(time), ); expect(l.horizontalOrigin).toEqual( - testObject.label.horizontalOrigin.getValue(time) + testObject.label.horizontalOrigin.getValue(time), ); expect(l.verticalOrigin).toEqual( - testObject.label.verticalOrigin.getValue(time) + testObject.label.verticalOrigin.getValue(time), ); expect(l.eyeOffset).toEqual(testObject.label.eyeOffset.getValue(time)); expect(l.pixelOffset).toEqual( - testObject.label.pixelOffset.getValue(time) + testObject.label.pixelOffset.getValue(time), ); expect(l.scale).toEqual(testObject.label.scale.getValue(time)); expect(l.show).toEqual(testObject.label.show.getValue(time)); expect(l.translucencyByDistance).toEqual( - testObject.label.translucencyByDistance.getValue(time) + testObject.label.translucencyByDistance.getValue(time), ); expect(l.pixelOffsetScaleByDistance).toEqual( - testObject.label.pixelOffsetScaleByDistance.getValue(time) + testObject.label.pixelOffsetScaleByDistance.getValue(time), ); expect(l.scaleByDistance).toEqual( - testObject.label.scaleByDistance.getValue(time) + testObject.label.scaleByDistance.getValue(time), ); expect(l.distanceDisplayCondition).toEqual( - testObject.label.distanceDisplayCondition.getValue(time) + testObject.label.distanceDisplayCondition.getValue(time), ); expect(l.disableDepthTestDistance).toEqual( - testObject.label.disableDepthTestDistance.getValue(time) + testObject.label.disableDepthTestDistance.getValue(time), ); label.show = new ConstantProperty(false); @@ -278,7 +278,7 @@ describe( const testObject = entityCollection.getOrCreateEntity("test"); testObject.position = new ConstantProperty( - new Cartesian3(1234, 5678, 9101112) + new Cartesian3(1234, 5678, 9101112), ); testObject.label = new LabelGraphics(); testObject.label.text = new ConstantProperty("a"); @@ -297,7 +297,7 @@ describe( const testObject2 = entityCollection.getOrCreateEntity("test2"); testObject2.position = new ConstantProperty( - new Cartesian3(1234, 5678, 9101112) + new Cartesian3(1234, 5678, 9101112), ); testObject2.label = new LabelGraphics(); testObject2.label.text = new ConstantProperty("b"); @@ -316,7 +316,7 @@ describe( const label = (testObject.label = new LabelGraphics()); testObject.position = new ConstantProperty( - new Cartesian3(1234, 5678, 9101112) + new Cartesian3(1234, 5678, 9101112), ); label.show = new ConstantProperty(true); label.text = new ConstantProperty("lorum ipsum"); @@ -344,7 +344,7 @@ describe( const label = (testObject.label = new LabelGraphics()); testObject.position = new ConstantProperty( - new Cartesian3(1234, 5678, 9101112) + new Cartesian3(1234, 5678, 9101112), ); label.show = new ConstantProperty(true); label.text = new ConstantProperty("lorum ipsum"); @@ -365,7 +365,7 @@ describe( const label = (testObject.label = new LabelGraphics()); testObject.position = new ConstantProperty( - new Cartesian3(1234, 5678, 9101112) + new Cartesian3(1234, 5678, 9101112), ); label.show = new ConstantProperty(true); label.text = new ConstantProperty("lorum ipsum"); @@ -407,5 +407,5 @@ describe( }).toThrowDeveloperError(); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/DataSources/ModelGraphicsSpec.js b/packages/engine/Specs/DataSources/ModelGraphicsSpec.js index 6c88b6e94086..3f49259bd9f6 100644 --- a/packages/engine/Specs/DataSources/ModelGraphicsSpec.js +++ b/packages/engine/Specs/DataSources/ModelGraphicsSpec.js @@ -82,12 +82,12 @@ describe("DataSources/ModelGraphics", function () { expect(model.minimumPixelSize.getValue()).toEqual(options.minimumPixelSize); expect(model.maximumScale.getValue()).toEqual(options.maximumScale); expect(model.incrementallyLoadTextures.getValue()).toEqual( - options.incrementallyLoadTextures + options.incrementallyLoadTextures, ); expect(model.shadows.getValue()).toEqual(options.shadows); expect(model.heightReference.getValue()).toEqual(options.heightReference); expect(model.distanceDisplayCondition.getValue()).toEqual( - options.distanceDisplayCondition + options.distanceDisplayCondition, ); expect(model.silhouetteColor.getValue()).toEqual(options.silhouetteColor); expect(model.silhouetteSize.getValue()).toEqual(options.silhouetteSize); @@ -95,27 +95,27 @@ describe("DataSources/ModelGraphics", function () { expect(model.colorBlendMode.getValue()).toEqual(options.colorBlendMode); expect(model.colorBlendAmount.getValue()).toEqual(options.colorBlendAmount); expect(model.clippingPlanes.getValue().planes).toEqual( - options.clippingPlanes.planes + options.clippingPlanes.planes, ); expect(model.customShader.getValue()).toEqual(options.customShader); expect(model.imageBasedLightingFactor.getValue()).toEqual( - options.imageBasedLightingFactor + options.imageBasedLightingFactor, ); expect(model.lightColor.getValue()).toEqual(options.lightColor); expect(model.runAnimations.getValue()).toEqual(options.runAnimations); expect(model.clampAnimations.getValue()).toEqual(options.clampAnimations); let actualNodeTransformations = model.nodeTransformations.getValue( - new JulianDate() + new JulianDate(), ); let expectedNodeTransformations = options.nodeTransformations; // by default toEqual requires constructors to match. for the purposes of this test, we only care about the structure. actualNodeTransformations = JSON.parse( - JSON.stringify(actualNodeTransformations) + JSON.stringify(actualNodeTransformations), ); expectedNodeTransformations = JSON.parse( - JSON.stringify(expectedNodeTransformations) + JSON.stringify(expectedNodeTransformations), ); expect(actualNodeTransformations).toEqual(expectedNodeTransformations); @@ -138,13 +138,13 @@ describe("DataSources/ModelGraphics", function () { source.incrementallyLoadTextures = new ConstantProperty(true); source.shadows = new ConstantProperty(ShadowMode.ENABLED); source.heightReference = new ConstantProperty( - HeightReference.CLAMP_TO_GROUND + HeightReference.CLAMP_TO_GROUND, ); source.distanceDisplayCondition = new ConstantProperty( - new DistanceDisplayCondition() + new DistanceDisplayCondition(), ); source.silhouetteColor = new ConstantProperty( - new Color(1.0, 0.0, 0.0, 1.0) + new Color(1.0, 0.0, 0.0, 1.0), ); source.silhouetteSize = new ConstantProperty(3.0); source.color = new ConstantProperty(new Color(0.0, 1.0, 0.0, 0.2)); @@ -153,7 +153,7 @@ describe("DataSources/ModelGraphics", function () { source.clippingPlanes = new ConstantProperty(new ClippingPlaneCollection()); source.customShader = new ConstantProperty(new CustomShader()); source.imageBasedLightingFactor = new ConstantProperty( - new Cartesian2(0.5, 0.5) + new Cartesian2(0.5, 0.5), ); source.lightColor = new ConstantProperty(new Color(1.0, 1.0, 0.0, 1.0)); source.runAnimations = new ConstantProperty(true); @@ -182,12 +182,12 @@ describe("DataSources/ModelGraphics", function () { expect(target.minimumPixelSize).toBe(source.minimumPixelSize); expect(target.maximumScale).toBe(source.maximumScale); expect(target.incrementallyLoadTextures).toBe( - source.incrementallyLoadTextures + source.incrementallyLoadTextures, ); expect(target.shadows).toBe(source.shadows); expect(target.heightReference).toBe(source.heightReference); expect(target.distanceDisplayCondition).toBe( - source.distanceDisplayCondition + source.distanceDisplayCondition, ); expect(target.silhouetteColor).toEqual(source.silhouetteColor); expect(target.silhouetteSize).toEqual(source.silhouetteSize); @@ -197,7 +197,7 @@ describe("DataSources/ModelGraphics", function () { expect(target.clippingPlanes).toBe(source.clippingPlanes); expect(target.customShader).toBe(source.customShader); expect(target.imageBasedLightingFactor).toBe( - source.imageBasedLightingFactor + source.imageBasedLightingFactor, ); expect(target.lightColor).toBe(source.lightColor); expect(target.runAnimations).toBe(source.runAnimations); @@ -216,10 +216,10 @@ describe("DataSources/ModelGraphics", function () { source.incrementallyLoadTextures = new ConstantProperty(true); source.shadows = new ConstantProperty(ShadowMode.ENABLED); source.heightReference = new ConstantProperty( - HeightReference.CLAMP_TO_GROUND + HeightReference.CLAMP_TO_GROUND, ); source.distanceDisplayCondition = new ConstantProperty( - new DistanceDisplayCondition() + new DistanceDisplayCondition(), ); source.silhouetteColor = new ConstantProperty(new Color()); source.silhouetteSize = new ConstantProperty(1.0); @@ -229,7 +229,7 @@ describe("DataSources/ModelGraphics", function () { source.clippingPlanes = new ConstantProperty(new ClippingPlaneCollection()); source.customShader = new ConstantProperty(new CustomShader()); source.imageBasedLightingFactor = new ConstantProperty( - new Cartesian2(0.5, 0.5) + new Cartesian2(0.5, 0.5), ); source.lightColor = new ConstantProperty(new Color(1.0, 1.0, 0.0, 1.0)); source.runAnimations = new ConstantProperty(true); @@ -250,10 +250,10 @@ describe("DataSources/ModelGraphics", function () { const incrementallyLoadTextures = new ConstantProperty(true); const shadows = new ConstantProperty(ShadowMode.ENABLED); const heightReference = new ConstantProperty( - HeightReference.CLAMP_TO_GROUND + HeightReference.CLAMP_TO_GROUND, ); const distanceDisplayCondition = new ConstantProperty( - new DistanceDisplayCondition() + new DistanceDisplayCondition(), ); const silhouetteColor = new ConstantProperty(new Color()); const silhouetteSize = new ConstantProperty(1.0); @@ -263,7 +263,7 @@ describe("DataSources/ModelGraphics", function () { const clippingPlanes = new ConstantProperty(new ClippingPlaneCollection()); const customShader = new ConstantProperty(new CustomShader()); const imageBasedLightingFactor = new ConstantProperty( - new Cartesian2(0.5, 0.5) + new Cartesian2(0.5, 0.5), ); const lightColor = new ConstantProperty(new Color(1.0, 1.0, 0.0, 1.0)); const runAnimations = new ConstantProperty(true); @@ -336,10 +336,10 @@ describe("DataSources/ModelGraphics", function () { source.incrementallyLoadTextures = new ConstantProperty(true); source.shadows = new ConstantProperty(ShadowMode.ENABLED); source.heightReference = new ConstantProperty( - HeightReference.CLAMP_TO_GROUND + HeightReference.CLAMP_TO_GROUND, ); source.distanceDisplayCondition = new ConstantProperty( - new DistanceDisplayCondition() + new DistanceDisplayCondition(), ); source.silhouetteColor = new ConstantProperty(new Color()); source.silhouetteSize = new ConstantProperty(2.0); @@ -349,7 +349,7 @@ describe("DataSources/ModelGraphics", function () { source.clippingPlanes = new ConstantProperty(new ClippingPlaneCollection()); source.customShader = new ConstantProperty(new CustomShader()); source.imageBasedLightingFactor = new ConstantProperty( - new Cartesian2(0.5, 0.5) + new Cartesian2(0.5, 0.5), ); source.lightColor = new ConstantProperty(new Color(1.0, 1.0, 0.0, 1.0)); source.runAnimations = new ConstantProperty(true); @@ -370,12 +370,12 @@ describe("DataSources/ModelGraphics", function () { expect(result.minimumPixelSize).toBe(source.minimumPixelSize); expect(result.maximumScale).toBe(source.maximumScale); expect(result.incrementallyLoadTextures).toBe( - source.incrementallyLoadTextures + source.incrementallyLoadTextures, ); expect(result.shadows).toBe(source.shadows); expect(result.heightReference).toBe(source.heightReference); expect(result.distanceDisplayCondition).toBe( - source.distanceDisplayCondition + source.distanceDisplayCondition, ); expect(result.silhouetteColor).toEqual(source.silhouetteColor); expect(result.silhouetteSize).toEqual(source.silhouetteSize); @@ -385,7 +385,7 @@ describe("DataSources/ModelGraphics", function () { expect(result.clippingPlanes).toBe(source.clippingPlanes); expect(result.customShader).toBe(source.customShader); expect(result.imageBasedLightingFactor).toBe( - source.imageBasedLightingFactor + source.imageBasedLightingFactor, ); expect(result.lightColor).toBe(source.lightColor); expect(result.runAnimations).toBe(source.runAnimations); diff --git a/packages/engine/Specs/DataSources/ModelVisualizerSpec.js b/packages/engine/Specs/DataSources/ModelVisualizerSpec.js index 18ca6a8e558a..738d0db51195 100644 --- a/packages/engine/Specs/DataSources/ModelVisualizerSpec.js +++ b/packages/engine/Specs/DataSources/ModelVisualizerSpec.js @@ -95,7 +95,7 @@ describe( it("object with no model does not create one", function () { const testObject = entityCollection.getOrCreateEntity("test"); testObject.position = new ConstantProperty( - new Cartesian3(1234, 5678, 9101112) + new Cartesian3(1234, 5678, 9101112), ); visualizer.update(JulianDate.now()); expect(scene.primitives.length).toEqual(0); @@ -119,7 +119,7 @@ describe( model.minimumPixelSize = new ConstantProperty(24.0); model.uri = new ConstantProperty(boxArticulationsUrl); model.distanceDisplayCondition = new ConstantProperty( - new DistanceDisplayCondition(10.0, 100.0) + new DistanceDisplayCondition(10.0, 100.0), ); const translation = new Cartesian3(1.0, 2.0, 3.0); @@ -143,13 +143,13 @@ describe( model.customShader = new ConstantProperty(customShader); model.imageBasedLightingFactor = new ConstantProperty( - new Cartesian2(0.5, 0.5) + new Cartesian2(0.5, 0.5), ); model.lightColor = new ConstantProperty(new Color(1.0, 1.0, 0.0, 1.0)); const testObject = entityCollection.getOrCreateEntity("test"); testObject.position = new ConstantPositionProperty( - Cartesian3.fromDegrees(1, 2, 3) + Cartesian3.fromDegrees(1, 2, 3), ); testObject.model = model; @@ -169,29 +169,29 @@ describe( expect(primitive.modelMatrix).toEqual( Transforms.eastNorthUpToFixedFrame( Cartesian3.fromDegrees(1, 2, 3), - scene.globe.ellipsoid - ) + scene.globe.ellipsoid, + ), ); expect(primitive.distanceDisplayCondition).toEqual( - new DistanceDisplayCondition(10.0, 100.0) + new DistanceDisplayCondition(10.0, 100.0), ); expect(primitive.clippingPlanes._planes.length).toEqual( - clippingPlanes._planes.length + clippingPlanes._planes.length, ); expect( Cartesian3.equals( primitive.clippingPlanes._planes[0].normal, - clippingPlanes._planes[0].normal - ) + clippingPlanes._planes[0].normal, + ), ).toBe(true); expect(primitive.clippingPlanes._planes[0].distance).toEqual( - clippingPlanes._planes[0].distance + clippingPlanes._planes[0].distance, ); expect(primitive.customShader).toEqual(customShader); expect(primitive.imageBasedLighting.imageBasedLightingFactor).toEqual( - new Cartesian2(0.5, 0.5) + new Cartesian2(0.5, 0.5), ); expect(primitive.lightColor).toEqual(new Cartesian3(1.0, 1.0, 0.0)); @@ -207,16 +207,17 @@ describe( const node = primitive.getNode("Root"); expect(node).toBeDefined(); - const transformationMatrix = Matrix4.fromTranslationQuaternionRotationScale( - translation, - rotation, - scale - ); + const transformationMatrix = + Matrix4.fromTranslationQuaternionRotationScale( + translation, + rotation, + scale, + ); Matrix4.multiplyTransformation( node.originalMatrix, transformationMatrix, - transformationMatrix + transformationMatrix, ); expect(node.matrix).toEqual(transformationMatrix); @@ -244,7 +245,7 @@ describe( const testObject = entityCollection.getOrCreateEntity("test"); testObject.position = new ConstantPositionProperty( - Cartesian3.fromDegrees(1, 2, 3) + Cartesian3.fromDegrees(1, 2, 3), ); testObject.model = model; @@ -266,22 +267,10 @@ describe( const node = primitive.getNode("Root"); const expected = [ - 0.7147690483240505, - -0.04340611926232735, - -0.0749741046529782, - 0, - -0.06188330295778636, - 0.05906797312763484, - -0.6241645867602773, - 0, - 0.03752515582279579, - 0.5366347296529127, - 0.04706410108373541, - 0, - 1, - 3, - -2, - 1, + 0.7147690483240505, -0.04340611926232735, -0.0749741046529782, 0, + -0.06188330295778636, 0.05906797312763484, -0.6241645867602773, 0, + 0.03752515582279579, 0.5366347296529127, 0.04706410108373541, 0, 1, 3, + -2, 1, ]; expect(node.matrix).toEqualEpsilon(expected, CesiumMath.EPSILON14); @@ -295,12 +284,12 @@ describe( model.uri = new ConstantProperty( new Resource({ url: boxArticulationsUrl, - }) + }), ); const testObject = entityCollection.getOrCreateEntity("test"); testObject.position = new ConstantPositionProperty( - Cartesian3.fromDegrees(1, 2, 3) + Cartesian3.fromDegrees(1, 2, 3), ); testObject.model = model; @@ -331,7 +320,7 @@ describe( const time = JulianDate.now(); const testObject = entityCollection.getOrCreateEntity("test"); testObject.position = new ConstantProperty( - new Cartesian3(5678, 1234, 1101112) + new Cartesian3(5678, 1234, 1101112), ); testObject.model = model; visualizer.update(time); @@ -355,7 +344,7 @@ describe( testObject.model = model; testObject.position = new ConstantProperty( - new Cartesian3(5678, 1234, 1101112) + new Cartesian3(5678, 1234, 1101112), ); model.uri = new ConstantProperty(boxUrl); visualizer.update(time); @@ -376,7 +365,7 @@ describe( testObject.model = model; testObject.position = new ConstantProperty( - new Cartesian3(5678, 1234, 1101112) + new Cartesian3(5678, 1234, 1101112), ); model.uri = new ConstantProperty(boxUrl); visualizer.update(time); @@ -400,7 +389,7 @@ describe( expect(state).toBe(BoundingSphereState.DONE); const expected = BoundingSphere.clone( primitive.boundingSphere, - new BoundingSphere() + new BoundingSphere(), ); expect(result).toEqual(expected); }); @@ -452,7 +441,7 @@ describe( expectedCenter.height = 10.0; expect(result.center).toEqualEpsilon( Cartographic.toCartesian(expectedCenter), - CesiumMath.EPSILON8 + CesiumMath.EPSILON8, ); }); @@ -462,7 +451,7 @@ describe( const position = Cartesian3.fromDegrees( 149.515332, -34.984799, - heightOffset + heightOffset, ); const tileset = new Cesium3DTileset({ @@ -507,7 +496,7 @@ describe( expectedCenter.height = heightOffset + 10.0; expect(result.center).toEqualEpsilon( Cartographic.toCartesian(expectedCenter), - CesiumMath.EPSILON8 + CesiumMath.EPSILON8, ); }); @@ -558,7 +547,7 @@ describe( expectedCenter.height = 10.0; expect(result.center).toEqualEpsilon( Cartographic.toCartesian(expectedCenter), - CesiumMath.EPSILON8 + CesiumMath.EPSILON8, ); }); @@ -568,7 +557,7 @@ describe( const position = Cartesian3.fromDegrees( 149.515332, -34.984799, - heightOffset + heightOffset, ); const tileset = new Cesium3DTileset({ @@ -613,7 +602,7 @@ describe( expectedCenter.height = heightOffset + 10.0; expect(result.center).toEqualEpsilon( Cartographic.toCartesian(expectedCenter), - CesiumMath.EPSILON8 + CesiumMath.EPSILON8, ); }); @@ -664,7 +653,7 @@ describe( expectedCenter.height = 20.0; expect(result.center).toEqualEpsilon( Cartographic.toCartesian(expectedCenter), - CesiumMath.EPSILON8 + CesiumMath.EPSILON8, ); }); @@ -674,7 +663,7 @@ describe( const position = Cartesian3.fromDegrees( 149.515332, -34.984799, - heightOffset + heightOffset, ); const tileset = new Cesium3DTileset({ @@ -719,7 +708,7 @@ describe( expectedCenter.height = heightOffset + 20.0; expect(result.center).toEqualEpsilon( Cartographic.toCartesian(expectedCenter), - CesiumMath.EPSILON8 + CesiumMath.EPSILON8, ); }); @@ -732,7 +721,7 @@ describe( testObject.model = model; testObject.position = new ConstantProperty( - new Cartesian3(5678, 1234, 1101112) + new Cartesian3(5678, 1234, 1101112), ); model.uri = new ConstantProperty(boxUrl); visualizer.update(time); @@ -756,7 +745,7 @@ describe( expect(state).toBe(BoundingSphereState.DONE); const expected = BoundingSphere.clone( primitive.boundingSphere, - new BoundingSphere() + new BoundingSphere(), ); expect(result).toEqual(expected); }); @@ -776,7 +765,7 @@ describe( testObject.model = model; testObject.position = new ConstantProperty( - new Cartesian3(5678, 1234, 1101112) + new Cartesian3(5678, 1234, 1101112), ); model.uri = new ConstantProperty("/path/to/incorrect/file"); visualizer.update(time); @@ -807,5 +796,5 @@ describe( }).toThrowDeveloperError(); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/DataSources/NodeTransformationPropertySpec.js b/packages/engine/Specs/DataSources/NodeTransformationPropertySpec.js index 1480f44dee7e..f0d19cc567a4 100644 --- a/packages/engine/Specs/DataSources/NodeTransformationPropertySpec.js +++ b/packages/engine/Specs/DataSources/NodeTransformationPropertySpec.js @@ -45,7 +45,7 @@ describe("DataSources/NodeTransformationProperty", function () { const property = new NodeTransformationProperty(); property.translation = new ConstantProperty(Cartesian3.UNIT_Y); property.rotation = new ConstantProperty( - new Quaternion(0.5, 0.5, 0.5, 0.5) + new Quaternion(0.5, 0.5, 0.5, 0.5), ); property.scale = new ConstantProperty(Cartesian3.UNIT_X); @@ -68,21 +68,21 @@ describe("DataSources/NodeTransformationProperty", function () { start: start, stop: stop, data: Cartesian3.UNIT_Y, - }) + }), ); property.rotation.intervals.addInterval( new TimeInterval({ start: start, stop: stop, data: new Quaternion(0.5, 0.5, 0.5, 0.5), - }) + }), ); property.scale.intervals.addInterval( new TimeInterval({ start: start, stop: stop, data: Cartesian3.UNIT_X, - }) + }), ); expect(property.isConstant).toBe(false); @@ -97,7 +97,7 @@ describe("DataSources/NodeTransformationProperty", function () { const property = new NodeTransformationProperty(); property.translation = new ConstantProperty(Cartesian3.UNIT_Y); property.rotation = new ConstantProperty( - new Quaternion(0.5, 0.5, 0.5, 0.5) + new Quaternion(0.5, 0.5, 0.5, 0.5), ); property.scale = new ConstantProperty(Cartesian3.UNIT_X); @@ -150,19 +150,19 @@ describe("DataSources/NodeTransformationProperty", function () { property, "rotation", Cartesian3.UNIT_X, - Cartesian3.ZERO + Cartesian3.ZERO, ); testDefinitionChanged( property, "translation", new Quaternion(0.5, 0.5, 0.5, 0.5), - Quaternion.ZERO + Quaternion.ZERO, ); testDefinitionChanged( property, "scale", Cartesian3.UNIT_X, - Cartesian3.ZERO + Cartesian3.ZERO, ); }); }); diff --git a/packages/engine/Specs/DataSources/PathGraphicsSpec.js b/packages/engine/Specs/DataSources/PathGraphicsSpec.js index 664fedc68a95..39a7b6c9adad 100644 --- a/packages/engine/Specs/DataSources/PathGraphicsSpec.js +++ b/packages/engine/Specs/DataSources/PathGraphicsSpec.js @@ -34,7 +34,7 @@ describe("DataSources/PathGraphics", function () { expect(path.trailTime.getValue()).toEqual(options.trailTime); expect(path.resolution.getValue()).toEqual(options.resolution); expect(path.distanceDisplayCondition.getValue()).toEqual( - options.distanceDisplayCondition + options.distanceDisplayCondition, ); }); @@ -47,7 +47,7 @@ describe("DataSources/PathGraphics", function () { source.trailTime = new ConstantProperty(1); source.resolution = new ConstantProperty(1); source.distanceDisplayCondition = new ConstantProperty( - new DistanceDisplayCondition(10.0, 20.0) + new DistanceDisplayCondition(10.0, 20.0), ); const target = new PathGraphics(); @@ -59,7 +59,7 @@ describe("DataSources/PathGraphics", function () { expect(target.trailTime).toBe(source.trailTime); expect(target.resolution).toBe(source.resolution); expect(target.distanceDisplayCondition).toBe( - source.distanceDisplayCondition + source.distanceDisplayCondition, ); }); @@ -72,7 +72,7 @@ describe("DataSources/PathGraphics", function () { source.trailTime = new ConstantProperty(1); source.resolution = new ConstantProperty(1); source.distanceDisplayCondition = new ConstantProperty( - new DistanceDisplayCondition() + new DistanceDisplayCondition(), ); const color = new ColorMaterialProperty(); @@ -82,7 +82,7 @@ describe("DataSources/PathGraphics", function () { const trailTime = new ConstantProperty(1); const resolution = new ConstantProperty(1); const distanceDisplayCondition = new ConstantProperty( - new DistanceDisplayCondition() + new DistanceDisplayCondition(), ); const target = new PathGraphics(); @@ -113,7 +113,7 @@ describe("DataSources/PathGraphics", function () { source.trailTime = new ConstantProperty(1); source.resolution = new ConstantProperty(1); source.distanceDisplayCondition = new ConstantProperty( - new DistanceDisplayCondition() + new DistanceDisplayCondition(), ); const result = source.clone(); @@ -124,7 +124,7 @@ describe("DataSources/PathGraphics", function () { expect(result.trailTime).toBe(source.trailTime); expect(result.resolution).toBe(source.resolution); expect(result.distanceDisplayCondition).toBe( - source.distanceDisplayCondition + source.distanceDisplayCondition, ); }); diff --git a/packages/engine/Specs/DataSources/PathVisualizerSpec.js b/packages/engine/Specs/DataSources/PathVisualizerSpec.js index ce9ecfff2787..0a6c1b78e4ea 100644 --- a/packages/engine/Specs/DataSources/PathVisualizerSpec.js +++ b/packages/engine/Specs/DataSources/PathVisualizerSpec.js @@ -144,12 +144,12 @@ describe( path.material = new PolylineOutlineMaterialProperty(); path.material.color = new ConstantProperty(new Color(0.8, 0.7, 0.6, 0.5)); path.material.outlineColor = new ConstantProperty( - new Color(0.1, 0.2, 0.3, 0.4) + new Color(0.1, 0.2, 0.3, 0.4), ); path.material.outlineWidth = new ConstantProperty(2.5); path.width = new ConstantProperty(12.5); path.distanceDisplayCondition = new ConstantProperty( - new DistanceDisplayCondition(10.0, 20.0) + new DistanceDisplayCondition(10.0, 20.0), ); path.leadTime = new ConstantProperty(25); path.trailTime = new ConstantProperty(10); @@ -165,39 +165,39 @@ describe( JulianDate.addSeconds( updateTime, -path.trailTime.getValue(), - new JulianDate() - ) - ) + new JulianDate(), + ), + ), ); expect(primitive.positions[1]).toEqual( - testObject.position.getValue(updateTime) + testObject.position.getValue(updateTime), ); expect(primitive.positions[2]).toEqual( testObject.position.getValue( JulianDate.addSeconds( updateTime, path.leadTime.getValue(), - new JulianDate() - ) - ) + new JulianDate(), + ), + ), ); expect(primitive.show).toEqual(testObject.path.show.getValue(updateTime)); expect(primitive.width).toEqual( - testObject.path.width.getValue(updateTime) + testObject.path.width.getValue(updateTime), ); expect(primitive.distanceDisplayCondition).toEqual( - testObject.path.distanceDisplayCondition.getValue(updateTime) + testObject.path.distanceDisplayCondition.getValue(updateTime), ); const material = primitive.material; expect(material.uniforms.color).toEqual( - testObject.path.material.color.getValue(updateTime) + testObject.path.material.color.getValue(updateTime), ); expect(material.uniforms.outlineColor).toEqual( - testObject.path.material.outlineColor.getValue(updateTime) + testObject.path.material.outlineColor.getValue(updateTime), ); expect(material.uniforms.outlineWidth).toEqual( - testObject.path.material.outlineWidth.getValue(updateTime) + testObject.path.material.outlineWidth.getValue(updateTime), ); path.show = new ConstantProperty(false); @@ -225,7 +225,7 @@ describe( path.material = new PolylineOutlineMaterialProperty(); path.material.color = new ConstantProperty(new Color(0.8, 0.7, 0.6, 0.5)); path.material.outlineColor = new ConstantProperty( - new Color(0.1, 0.2, 0.3, 0.4) + new Color(0.1, 0.2, 0.3, 0.4), ); path.material.outlineWidth = new ConstantProperty(2.5); path.width = new ConstantProperty(12.5); @@ -278,13 +278,13 @@ describe( const material = primitive.material; expect(material.uniforms.color).toEqual( - testObject.path.material.color.getValue(updateTime) + testObject.path.material.color.getValue(updateTime), ); expect(material.uniforms.glowPower).toEqual( - testObject.path.material.glowPower.getValue(updateTime) + testObject.path.material.glowPower.getValue(updateTime), ); expect(material.uniforms.taperPower).toEqual( - testObject.path.material.taperPower.getValue(updateTime) + testObject.path.material.taperPower.getValue(updateTime), ); }); @@ -361,7 +361,7 @@ describe( const inertialPolylineCollection = scene.primitives.get(0); expect(inertialPolylineCollection.length).toEqual(1); expect(inertialPolylineCollection.modelMatrix).not.toEqual( - Matrix4.IDENTITY + Matrix4.IDENTITY, ); const inertialLine = inertialPolylineCollection.get(0); @@ -498,7 +498,7 @@ describe( it("subSample works for constant properties", function () { const property = new ConstantPositionProperty( - new Cartesian3(1000, 2000, 3000) + new Cartesian3(1000, 2000, 3000), ); const start = new JulianDate(0, 0); const stop = new JulianDate(1, 0); @@ -511,14 +511,14 @@ describe( stop, updateTime, referenceFrame, - maximumStep + maximumStep, ); expect(result).toEqual([property._value]); }); it("subSample works for reference properties", function () { const property = new ConstantPositionProperty( - new Cartesian3(1000, 2000, 3000) + new Cartesian3(1000, 2000, 3000), ); const start = new JulianDate(0, 0); const stop = new JulianDate(1, 0); @@ -540,7 +540,7 @@ describe( stop, updateTime, referenceFrame, - maximumStep + maximumStep, ); expect(result).toEqual([property._value]); }); @@ -567,7 +567,7 @@ describe( updateTime, referenceFrame, maximumStep, - result + result, ); expect(result).toEqual([ property.getValue(start), @@ -585,16 +585,16 @@ describe( updateTime, referenceFrame, maximumStep, - result + result, ); expect(result).toEqual([ property.getValue(start), property.getValue( - JulianDate.addSeconds(start, expectedStep, new JulianDate()) + JulianDate.addSeconds(start, expectedStep, new JulianDate()), ), property.getValue(updateTime), property.getValue( - JulianDate.addSeconds(start, expectedStep * 2, new JulianDate()) + JulianDate.addSeconds(start, expectedStep * 2, new JulianDate()), ), property.getValue(stop), ]); @@ -610,12 +610,12 @@ describe( updateTime, referenceFrame, maximumStep, - result + result, ); expect(result).toEqual([ property.getValue(start), property.getValue( - JulianDate.addSeconds(start, expectedStep, new JulianDate()) + JulianDate.addSeconds(start, expectedStep, new JulianDate()), ), property.getValue(updateTime), property.getValue(stop), @@ -632,16 +632,16 @@ describe( updateTime, referenceFrame, maximumStep, - result + result, ); expect(result).toEqual([ property.getValue(start), property.getValue(updateTime), property.getValue( - JulianDate.addSeconds(start, expectedStep, new JulianDate()) + JulianDate.addSeconds(start, expectedStep, new JulianDate()), ), property.getValue( - JulianDate.addSeconds(start, expectedStep * 2, new JulianDate()) + JulianDate.addSeconds(start, expectedStep * 2, new JulianDate()), ), property.getValue(stop), ]); @@ -659,7 +659,7 @@ describe( start: t1, stop: t2, data: new Cartesian3(0, 0, 1), - }) + }), ); property.intervals.addInterval( new TimeInterval({ @@ -668,14 +668,14 @@ describe( isStartIncluded: false, isStopIncluded: false, data: new Cartesian3(0, 0, 2), - }) + }), ); property.intervals.addInterval( new TimeInterval({ start: t3, stop: t4, data: new Cartesian3(0, 0, 3), - }) + }), ); const updateTime = new JulianDate(1, 43200); @@ -689,7 +689,7 @@ describe( updateTime, referenceFrame, maximumStep, - result + result, ); expect(result).toEqual([ new Cartesian3(0, 0, 1), @@ -704,7 +704,7 @@ describe( updateTime, referenceFrame, maximumStep, - result + result, ); expect(result).toEqual([ new Cartesian3(0, 0, 1), @@ -719,7 +719,7 @@ describe( updateTime, referenceFrame, maximumStep, - result + result, ); expect(result).toEqual([new Cartesian3(0, 0, 1)]); @@ -730,7 +730,7 @@ describe( updateTime, referenceFrame, maximumStep, - result + result, ); expect(result).toEqual([new Cartesian3(0, 0, 3)]); }); @@ -767,22 +767,22 @@ describe( updateTime, referenceFrame, maximumStep, - result + result, ); expect(result).toEqual([ property.getValue(t1), property.getValue( - JulianDate.addSeconds(t1, maximumStep, new JulianDate()) + JulianDate.addSeconds(t1, maximumStep, new JulianDate()), ), property.getValue( - JulianDate.addSeconds(t1, maximumStep * 2, new JulianDate()) + JulianDate.addSeconds(t1, maximumStep * 2, new JulianDate()), ), property.getValue(updateTime), property.getValue( - JulianDate.addSeconds(t1, maximumStep * 3, new JulianDate()) + JulianDate.addSeconds(t1, maximumStep * 3, new JulianDate()), ), property.getValue( - JulianDate.addSeconds(t1, maximumStep * 4, new JulianDate()) + JulianDate.addSeconds(t1, maximumStep * 4, new JulianDate()), ), ]); }); @@ -801,7 +801,7 @@ describe( return innerProperty.getValueInReferenceFrame( time, referenceFrame, - result + result, ); }; @@ -835,28 +835,28 @@ describe( updateTime, referenceFrame, maximumStep, - result + result, ); expect(result).toEqual([ sampledProperty.getValue(t1), sampledProperty.getValue( - JulianDate.addSeconds(t1, maximumStep, new JulianDate()) + JulianDate.addSeconds(t1, maximumStep, new JulianDate()), ), sampledProperty.getValue( - JulianDate.addSeconds(t1, maximumStep * 2, new JulianDate()) + JulianDate.addSeconds(t1, maximumStep * 2, new JulianDate()), ), sampledProperty.getValue(updateTime), sampledProperty.getValue( - JulianDate.addSeconds(t1, maximumStep * 3, new JulianDate()) + JulianDate.addSeconds(t1, maximumStep * 3, new JulianDate()), ), sampledProperty.getValue( - JulianDate.addSeconds(t1, maximumStep * 4, new JulianDate()) + JulianDate.addSeconds(t1, maximumStep * 4, new JulianDate()), ), sampledProperty.getValue( - JulianDate.addSeconds(t1, maximumStep * 5, new JulianDate()) + JulianDate.addSeconds(t1, maximumStep * 5, new JulianDate()), ), sampledProperty.getValue( - JulianDate.addSeconds(t1, maximumStep * 6, new JulianDate()) + JulianDate.addSeconds(t1, maximumStep * 6, new JulianDate()), ), ]); }); @@ -870,7 +870,7 @@ describe( const t6 = new JulianDate(5, 0); const constantProperty = new ConstantPositionProperty( - new Cartesian3(0, 0, 1) + new Cartesian3(0, 0, 1), ); const intervalProperty = new TimeIntervalCollectionPositionProperty(); @@ -879,7 +879,7 @@ describe( start: t1, stop: t2, data: new Cartesian3(0, 0, 1), - }) + }), ); intervalProperty.intervals.addInterval( new TimeInterval({ @@ -888,14 +888,14 @@ describe( isStartIncluded: false, isStopIncluded: false, data: new Cartesian3(0, 0, 2), - }) + }), ); intervalProperty.intervals.addInterval( new TimeInterval({ start: t1, stop: t2, data: new Cartesian3(0, 0, 3), - }) + }), ); const sampledProperty = new SampledPositionProperty(); @@ -907,7 +907,7 @@ describe( const entities = new EntityCollection(); const targetEntity = entities.getOrCreateEntity("target"); targetEntity.position = new ConstantPositionProperty( - new Cartesian3(0, 0, 5) + new Cartesian3(0, 0, 5), ); const referenceProperty = new ReferenceProperty(entities, "target", [ "position", @@ -921,7 +921,7 @@ describe( start: t1, stop: t2, data: intervalProperty, - }) + }), ); property.intervals.addInterval( new TimeInterval({ @@ -930,14 +930,14 @@ describe( isStartIncluded: false, isStopIncluded: false, data: constantProperty, - }) + }), ); property.intervals.addInterval( new TimeInterval({ start: t3, stop: t4, data: sampledProperty, - }) + }), ); property.intervals.addInterval( new TimeInterval({ @@ -946,7 +946,7 @@ describe( isStartIncluded: false, isStopIncluded: true, data: referenceProperty, - }) + }), ); property.intervals.addInterval( new TimeInterval({ @@ -955,7 +955,7 @@ describe( isStartIncluded: false, isStopIncluded: true, data: scaledProperty, - }) + }), ); const updateTime = new JulianDate(0, 0); @@ -979,14 +979,14 @@ describe( updateTime, referenceFrame, maximumStep, - result + result, ); expect(result).toEqual([ intervalProperty.intervals.get(0).data, constantProperty.getValue(t1), sampledProperty.getValue(t3), sampledProperty.getValue( - JulianDate.addSeconds(t3, maximumStep, new JulianDate()) + JulianDate.addSeconds(t3, maximumStep, new JulianDate()), ), sampledProperty.getValue(t4), targetEntity.position.getValue(t5), @@ -1002,5 +1002,5 @@ describe( createCompositeTest(true); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/DataSources/PlaneGeometryUpdaterSpec.js b/packages/engine/Specs/DataSources/PlaneGeometryUpdaterSpec.js index b120f02f216b..a90e9039abaf 100644 --- a/packages/engine/Specs/DataSources/PlaneGeometryUpdaterSpec.js +++ b/packages/engine/Specs/DataSources/PlaneGeometryUpdaterSpec.js @@ -33,12 +33,12 @@ describe( function createBasicPlane() { const planeGraphics = new PlaneGraphics(); planeGraphics.plane = new ConstantProperty( - new Plane(Cartesian3.UNIT_X, 0.0) + new Plane(Cartesian3.UNIT_X, 0.0), ); planeGraphics.dimensions = new ConstantProperty(new Cartesian2(1.0, 2.0)); const entity = new Entity(); entity.position = new ConstantPositionProperty( - Cartesian3.fromDegrees(0, 0, 0) + Cartesian3.fromDegrees(0, 0, 0), ); entity.plane = planeGraphics; return entity; @@ -47,7 +47,7 @@ describe( function createDynamicPlane() { const entity = createBasicPlane(); entity.plane.plane = createDynamicProperty( - new Plane(Cartesian3.UNIT_X, 0.0) + new Plane(Cartesian3.UNIT_X, 0.0), ); entity.plane.dimensions = createDynamicProperty(new Cartesian2(1.0, 2.0)); return entity; @@ -77,7 +77,7 @@ describe( const updater = new PlaneGeometryUpdater(entity, scene); const dynamicUpdater = updater.createDynamicUpdater( new PrimitiveCollection(), - new PrimitiveCollection() + new PrimitiveCollection(), ); dynamicUpdater.update(JulianDate.now()); @@ -121,15 +121,15 @@ describe( PlaneGeometryUpdater, "plane", createBasicPlane, - getScene + getScene, ); createDynamicGeometryUpdaterSpecs( PlaneGeometryUpdater, "plane", createDynamicPlane, - getScene + getScene, ); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/DataSources/PlaneGraphicsSpec.js b/packages/engine/Specs/DataSources/PlaneGraphicsSpec.js index bdcaf48fc3b1..657decac19a2 100644 --- a/packages/engine/Specs/DataSources/PlaneGraphicsSpec.js +++ b/packages/engine/Specs/DataSources/PlaneGraphicsSpec.js @@ -50,7 +50,7 @@ describe("DataSources/PlaneGraphics", function () { expect(plane.dimensions.getValue()).toEqual(options.dimensions); expect(plane.shadows.getValue()).toEqual(options.shadows); expect(plane.distanceDisplayCondition.getValue()).toEqual( - options.distanceDisplayCondition + options.distanceDisplayCondition, ); }); @@ -66,7 +66,7 @@ describe("DataSources/PlaneGraphics", function () { source.dimensions = new ConstantProperty(); source.shadows = new ConstantProperty(ShadowMode.ENABLED); source.distanceDisplayCondition = new ConstantProperty( - new DistanceDisplayCondition(10.0, 100.0) + new DistanceDisplayCondition(10.0, 100.0), ); const target = new PlaneGraphics(); @@ -82,7 +82,7 @@ describe("DataSources/PlaneGraphics", function () { expect(target.dimensions).toBe(source.dimensions); expect(target.shadows).toBe(source.shadows); expect(target.distanceDisplayCondition).toBe( - source.distanceDisplayCondition + source.distanceDisplayCondition, ); }); @@ -150,7 +150,7 @@ describe("DataSources/PlaneGraphics", function () { expect(result.dimensions).toBe(source.dimensions); expect(result.shadows).toBe(source.shadows); expect(result.distanceDisplayCondition).toBe( - source.distanceDisplayCondition + source.distanceDisplayCondition, ); }); @@ -173,25 +173,25 @@ describe("DataSources/PlaneGraphics", function () { property, "plane", new Plane(Cartesian3.UNIT_X, 0.0), - new Plane(Cartesian3.UNIT_Z, 1.0) + new Plane(Cartesian3.UNIT_Z, 1.0), ); testDefinitionChanged( property, "dimensions", new Cartesian2(0.0, 0.0), - new Cartesian2(1.0, 1.0) + new Cartesian2(1.0, 1.0), ); testDefinitionChanged( property, "shadows", ShadowMode.ENABLED, - ShadowMode.DISABLED + ShadowMode.DISABLED, ); testDefinitionChanged( property, "distanceDisplayCondition", new DistanceDisplayCondition(), - new DistanceDisplayCondition(10.0, 100.0) + new DistanceDisplayCondition(10.0, 100.0), ); }); }); diff --git a/packages/engine/Specs/DataSources/PointGraphicsSpec.js b/packages/engine/Specs/DataSources/PointGraphicsSpec.js index 699e801e71de..7178ecc790e6 100644 --- a/packages/engine/Specs/DataSources/PointGraphicsSpec.js +++ b/packages/engine/Specs/DataSources/PointGraphicsSpec.js @@ -43,10 +43,10 @@ describe("DataSources/PointGraphics", function () { expect(point.scaleByDistance.getValue()).toEqual(options.scaleByDistance); expect(point.heightReference.getValue()).toEqual(options.heightReference); expect(point.distanceDisplayCondition.getValue()).toEqual( - options.distanceDisplayCondition + options.distanceDisplayCondition, ); expect(point.disableDepthTestDistance.getValue()).toEqual( - options.disableDepthTestDistance + options.disableDepthTestDistance, ); expect(point.splitDirection.getValue()).toEqual(options.splitDirection); }); @@ -60,10 +60,10 @@ describe("DataSources/PointGraphics", function () { source.show = new ConstantProperty(true); source.scaleByDistance = new ConstantProperty(new NearFarScalar()); source.heightReference = new ConstantProperty( - HeightReference.RELATIVE_TO_GROUND + HeightReference.RELATIVE_TO_GROUND, ); source.distanceDisplayCondition = new ConstantProperty( - new DistanceDisplayCondition(10.0, 100.0) + new DistanceDisplayCondition(10.0, 100.0), ); source.disableDepthTestDistance = new ConstantProperty(10.0); source.splitDirection = new ConstantProperty(SplitDirection.LEFT); @@ -78,10 +78,10 @@ describe("DataSources/PointGraphics", function () { expect(target.scaleByDistance).toBe(source.scaleByDistance); expect(target.heightReference).toBe(source.heightReference); expect(target.distanceDisplayCondition).toBe( - source.distanceDisplayCondition + source.distanceDisplayCondition, ); expect(target.disableDepthTestDistance).toBe( - source.disableDepthTestDistance + source.disableDepthTestDistance, ); expect(target.splitDirection).toBe(source.splitDirection); }); @@ -95,10 +95,10 @@ describe("DataSources/PointGraphics", function () { source.show = new ConstantProperty(true); source.scaleByDistance = new ConstantProperty(new NearFarScalar()); source.heightReference = new ConstantProperty( - HeightReference.RELATIVE_TO_GROUND + HeightReference.RELATIVE_TO_GROUND, ); source.distanceDisplayCondition = new ConstantProperty( - new DistanceDisplayCondition(10.0, 100.0) + new DistanceDisplayCondition(10.0, 100.0), ); source.disableDepthTestDistance = new ConstantProperty(10.0); source.splitDirection = new ConstantProperty(SplitDirection.LEFT); @@ -109,10 +109,10 @@ describe("DataSources/PointGraphics", function () { const outlineWidth = new ConstantProperty(1); const show = new ConstantProperty(true); const heightReference = new ConstantProperty( - HeightReference.CLAMP_TO_GROUND + HeightReference.CLAMP_TO_GROUND, ); const distanDisplayCondition = new ConstantProperty( - new DistanceDisplayCondition(10.0, 100.0) + new DistanceDisplayCondition(10.0, 100.0), ); const disableDepthTestDistance = new ConstantProperty(20.0); const splitDirection = new ConstantProperty(SplitDirection.RIGHT); @@ -151,10 +151,10 @@ describe("DataSources/PointGraphics", function () { source.show = new ConstantProperty(true); source.scaleByDistance = new ConstantProperty(new NearFarScalar()); source.heightReference = new ConstantProperty( - HeightReference.RELATIVE_TO_GROUND + HeightReference.RELATIVE_TO_GROUND, ); source.distanceDisplayCondition = new ConstantProperty( - new DistanceDisplayCondition(10.0, 100.0) + new DistanceDisplayCondition(10.0, 100.0), ); source.disableDepthTestDistance = new ConstantProperty(10.0); source.splitDirection = new ConstantProperty(SplitDirection.LEFT); @@ -168,10 +168,10 @@ describe("DataSources/PointGraphics", function () { expect(result.scaleByDistance).toBe(source.scaleByDistance); expect(result.heightReference).toBe(source.heightReference); expect(result.distanceDisplayCondition).toBe( - source.distanceDisplayCondition + source.distanceDisplayCondition, ); expect(result.disableDepthTestDistance).toBe( - source.disableDepthTestDistance + source.disableDepthTestDistance, ); expect(result.splitDirection).toBe(source.splitDirection); }); diff --git a/packages/engine/Specs/DataSources/PointVisualizerSpec.js b/packages/engine/Specs/DataSources/PointVisualizerSpec.js index 6f17a7e0b033..1f9577df23dc 100644 --- a/packages/engine/Specs/DataSources/PointVisualizerSpec.js +++ b/packages/engine/Specs/DataSources/PointVisualizerSpec.js @@ -117,7 +117,7 @@ describe( const testObject = entityCollection.getOrCreateEntity("test"); testObject.position = new ConstantProperty( - new Cartesian3(1234, 5678, 9101112) + new Cartesian3(1234, 5678, 9101112), ); visualizer.update(JulianDate.now()); expect(scene.primitives.length).toEqual(0); @@ -167,23 +167,23 @@ describe( expect(pointPrimitive.show).toEqual(point.show.getValue(time)); expect(pointPrimitive.position).toEqual(entity.position.getValue(time)); expect(pointPrimitive.scaleByDistance).toEqual( - point.scaleByDistance.getValue(time) + point.scaleByDistance.getValue(time), ); expect(pointPrimitive.color).toEqual(point.color.getValue(time)); expect(pointPrimitive.outlineColor).toEqual( - point.outlineColor.getValue(time) + point.outlineColor.getValue(time), ); expect(pointPrimitive.outlineWidth).toEqual( - point.outlineWidth.getValue(time) + point.outlineWidth.getValue(time), ); expect(pointPrimitive.distanceDisplayCondition).toEqual( - point.distanceDisplayCondition.getValue(time) + point.distanceDisplayCondition.getValue(time), ); expect(pointPrimitive.disableDepthTestDistance).toEqual( - point.disableDepthTestDistance.getValue(time) + point.disableDepthTestDistance.getValue(time), ); expect(pointPrimitive.splitDirection).toEqual( - point.splitDirection.getValue(time) + point.splitDirection.getValue(time), ); point.color = new Color(0.15, 0.16, 0.17, 0.18); @@ -193,7 +193,7 @@ describe( point.scaleByDistance = new NearFarScalar(25, 26, 27, 28); point.distanceDisplayCondition = new DistanceDisplayCondition( 1000.0, - 1000000.0 + 1000000.0, ); point.disableDepthTestDistance = 20.0; point.splitDirection = SplitDirection.RIGHT; @@ -203,23 +203,23 @@ describe( expect(pointPrimitive.show).toEqual(point.show.getValue(time)); expect(pointPrimitive.position).toEqual(entity.position.getValue(time)); expect(pointPrimitive.scaleByDistance).toEqual( - point.scaleByDistance.getValue(time) + point.scaleByDistance.getValue(time), ); expect(pointPrimitive.color).toEqual(point.color.getValue(time)); expect(pointPrimitive.outlineColor).toEqual( - point.outlineColor.getValue(time) + point.outlineColor.getValue(time), ); expect(pointPrimitive.outlineWidth).toEqual( - point.outlineWidth.getValue(time) + point.outlineWidth.getValue(time), ); expect(pointPrimitive.distanceDisplayCondition).toEqual( - point.distanceDisplayCondition.getValue(time) + point.distanceDisplayCondition.getValue(time), ); expect(pointPrimitive.disableDepthTestDistance).toEqual( - point.disableDepthTestDistance.getValue(time) + point.disableDepthTestDistance.getValue(time), ); expect(pointPrimitive.splitDirection).toEqual( - point.splitDirection.getValue(time) + point.splitDirection.getValue(time), ); point.show = false; @@ -260,16 +260,16 @@ describe( expect(billboard.show).toEqual(point.show.getValue(time)); expect(billboard.position).toEqual(entity.position.getValue(time)); expect(billboard.scaleByDistance).toEqual( - point.scaleByDistance.getValue(time) + point.scaleByDistance.getValue(time), ); expect(billboard.distanceDisplayCondition).toEqual( - point.distanceDisplayCondition.getValue(time) + point.distanceDisplayCondition.getValue(time), ); expect(billboard.disableDepthTestDistance).toEqual( - point.disableDepthTestDistance.getValue(time) + point.disableDepthTestDistance.getValue(time), ); expect(billboard.splitDirection).toEqual( - point.splitDirection.getValue(time) + point.splitDirection.getValue(time), ); //expect(billboard.color).toEqual(point.color.getValue(time)); //expect(billboard.outlineColor).toEqual(point.outlineColor.getValue(time)); @@ -282,7 +282,7 @@ describe( point.scaleByDistance = new NearFarScalar(25, 26, 27, 28); point.distanceDisplayCondition = new DistanceDisplayCondition( 1000.0, - 1000000.0 + 1000000.0, ); point.disableDepthTestDistance = 20.0; @@ -291,13 +291,13 @@ describe( expect(billboard.show).toEqual(point.show.getValue(time)); expect(billboard.position).toEqual(entity.position.getValue(time)); expect(billboard.scaleByDistance).toEqual( - point.scaleByDistance.getValue(time) + point.scaleByDistance.getValue(time), ); expect(billboard.distanceDisplayCondition).toEqual( - point.distanceDisplayCondition.getValue(time) + point.distanceDisplayCondition.getValue(time), ); expect(billboard.disableDepthTestDistance).toEqual( - point.disableDepthTestDistance.getValue(time) + point.disableDepthTestDistance.getValue(time), ); //expect(billboard.color).toEqual(point.color.getValue(time)); //expect(billboard.outlineColor).toEqual(point.outlineColor.getValue(time)); @@ -315,7 +315,7 @@ describe( const testObject = entityCollection.getOrCreateEntity("test"); testObject.position = new ConstantProperty( - new Cartesian3(1234, 5678, 9101112) + new Cartesian3(1234, 5678, 9101112), ); testObject.point = new PointGraphics(); testObject.point.show = new ConstantProperty(true); @@ -333,7 +333,7 @@ describe( const testObject2 = entityCollection.getOrCreateEntity("test2"); testObject2.position = new ConstantProperty( - new Cartesian3(1234, 5678, 9101112) + new Cartesian3(1234, 5678, 9101112), ); testObject2.point = new PointGraphics(); testObject2.point.show = new ConstantProperty(true); @@ -349,7 +349,7 @@ describe( const time = JulianDate.now(); testObject.position = new ConstantProperty( - new Cartesian3(1234, 5678, 9101112) + new Cartesian3(1234, 5678, 9101112), ); const point = (testObject.point = new PointGraphics()); point.show = new ConstantProperty(true); @@ -376,7 +376,7 @@ describe( const point = (testObject.point = new PointGraphics()); testObject.position = new ConstantProperty( - new Cartesian3(1234, 5678, 9101112) + new Cartesian3(1234, 5678, 9101112), ); point.show = new ConstantProperty(true); @@ -397,7 +397,7 @@ describe( const point = (testObject.point = new PointGraphics()); testObject.position = new ConstantProperty( - new Cartesian3(1234, 5678, 9101112) + new Cartesian3(1234, 5678, 9101112), ); point.show = new ConstantProperty(true); @@ -439,5 +439,5 @@ describe( }).toThrowDeveloperError(); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/DataSources/PolygonGeometryUpdaterSpec.js b/packages/engine/Specs/DataSources/PolygonGeometryUpdaterSpec.js index 7e01741214fa..8f48605dcf26 100644 --- a/packages/engine/Specs/DataSources/PolygonGeometryUpdaterSpec.js +++ b/packages/engine/Specs/DataSources/PolygonGeometryUpdaterSpec.js @@ -56,8 +56,8 @@ describe( const polygon = new PolygonGraphics(); polygon.hierarchy = new ConstantProperty( new PolygonHierarchy( - Cartesian3.fromRadiansArray([-1, -1, 1, -1, 1, 1, -1, 1]) - ) + Cartesian3.fromRadiansArray([-1, -1, 1, -1, 1, 1, -1, 1]), + ), ); polygon.height = new ConstantProperty(0); const entity = new Entity(); @@ -70,17 +70,9 @@ describe( polygon.hierarchy = new ConstantProperty( new PolygonHierarchy( Cartesian3.fromDegreesArrayHeights([ - -1.0, - 1.0, - 0.0, - -2.0, - 1.0, - 0.0, - -2.0, - 1.0, - 0.0, - ]) - ) + -1.0, 1.0, 0.0, -2.0, 1.0, 0.0, -2.0, 1.0, 0.0, + ]), + ), ); polygon.perPositionHeight = true; const entity = new Entity(); @@ -98,8 +90,8 @@ describe( const polygon = new PolygonGraphics(); polygon.hierarchy = new ConstantProperty( new PolygonHierarchy( - Cartesian3.fromRadiansArray([0, 0, 1, 0, 1, 1, 0, 1]) - ) + Cartesian3.fromRadiansArray([0, 0, 1, 0, 1, 1, 0, 1]), + ), ); const entity = new Entity(); entity.polygon = polygon; @@ -239,7 +231,7 @@ describe( const polygon = entity.polygon; polygon.outline = true; polygon.perPositionHeight = new ConstantProperty( - options.perPositionHeight + options.perPositionHeight, ); polygon.closeTop = new ConstantProperty(options.closeTop); polygon.closeBottom = new ConstantProperty(options.closeBottom); @@ -249,7 +241,7 @@ describe( polygon.granularity = new ConstantProperty(options.granularity); polygon.arcType = new ConstantProperty(options.arcType); polygon.textureCoordinates = new ConstantProperty( - options.textureCoordinates + options.textureCoordinates, ); const updater = new PolygonGeometryUpdater(entity, scene); @@ -342,10 +334,10 @@ describe( let instance; graphics.heightReference = new ConstantProperty( - HeightReference.RELATIVE_TO_GROUND + HeightReference.RELATIVE_TO_GROUND, ); graphics.extrudedHeightReference = new ConstantProperty( - HeightReference.RELATIVE_TO_GROUND + HeightReference.RELATIVE_TO_GROUND, ); updater._onEntityPropertyChanged(entity, "polygon"); instance = updater.createFillGeometryInstance(time); @@ -358,8 +350,8 @@ describe( const polygon = new PolygonGraphics(); polygon.hierarchy = createDynamicProperty( new PolygonHierarchy( - Cartesian3.fromRadiansArray([0, 0, 1, 0, 1, 1, 0, 1]) - ) + Cartesian3.fromRadiansArray([0, 0, 1, 0, 1, 1, 0, 1]), + ), ); polygon.height = createDynamicProperty(3); polygon.extrudedHeight = createDynamicProperty(2); @@ -384,7 +376,7 @@ describe( const updater = new PolygonGeometryUpdater(entity, scene); const dynamicUpdater = updater.createDynamicUpdater( new PrimitiveCollection(), - new PrimitiveCollection() + new PrimitiveCollection(), ); dynamicUpdater.update(time); @@ -394,12 +386,12 @@ describe( expect(options.height).toEqual(polygon.height.getValue()); expect(options.extrudedHeight).toEqual(polygon.extrudedHeight.getValue()); expect(options.perPositionHeight).toEqual( - polygon.perPositionHeight.getValue() + polygon.perPositionHeight.getValue(), ); expect(options.granularity).toEqual(polygon.granularity.getValue()); expect(options.stRotation).toEqual(polygon.stRotation.getValue()); expect(options.textureCoordinates).toEqual( - polygon.textureCoordinates.getValue() + polygon.textureCoordinates.getValue(), ); expect(options.closeTop).toEqual(polygon.closeTop.getValue()); expect(options.closeBottom).toEqual(polygon.closeBottom.getValue()); @@ -454,7 +446,7 @@ describe( result = Ellipsoid.WGS84.scaleToGeodeticSurface(result, result); expect(result).toEqualEpsilon( Cartesian3.fromDegrees(0.0, 0.0), - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); }); @@ -466,14 +458,14 @@ describe( PolygonGeometryUpdater, "polygon", createBasicPolygon, - getScene + getScene, ); createDynamicGeometryUpdaterSpecs( PolygonGeometryUpdater, "polygon", createDynamicPolygon, - getScene + getScene, ); createGeometryUpdaterGroundGeometrySpecs( @@ -481,8 +473,8 @@ describe( "polygon", createBasicPolygonWithoutHeight, createDynamicPolygonWithoutHeight, - getScene + getScene, ); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/DataSources/PolygonGraphicsSpec.js b/packages/engine/Specs/DataSources/PolygonGraphicsSpec.js index 232bee6b194c..4e39288e1607 100644 --- a/packages/engine/Specs/DataSources/PolygonGraphicsSpec.js +++ b/packages/engine/Specs/DataSources/PolygonGraphicsSpec.js @@ -69,7 +69,7 @@ describe("DataSources/PolygonGraphics", function () { expect(polygon.granularity.getValue()).toEqual(options.granularity); expect(polygon.stRotation.getValue()).toEqual(options.stRotation); expect(polygon.perPositionHeight.getValue()).toEqual( - options.perPositionHeight + options.perPositionHeight, ); expect(polygon.fill.getValue()).toEqual(options.fill); expect(polygon.outline.getValue()).toEqual(options.outline); @@ -79,15 +79,15 @@ describe("DataSources/PolygonGraphics", function () { expect(polygon.closeBottom.getValue()).toEqual(options.closeBottom); expect(polygon.shadows.getValue()).toEqual(options.shadows); expect(polygon.distanceDisplayCondition.getValue()).toEqual( - options.distanceDisplayCondition + options.distanceDisplayCondition, ); expect(polygon.classificationType.getValue()).toEqual( - options.classificationType + options.classificationType, ); expect(polygon.arcType.getValue()).toEqual(options.arcType); expect(polygon.zIndex.getValue()).toEqual(22); expect(polygon.textureCoordinates.getValue()).toEqual( - options.textureCoordinates + options.textureCoordinates, ); }); @@ -109,10 +109,10 @@ describe("DataSources/PolygonGraphics", function () { source.closeBottom = new ConstantProperty(); source.shadows = new ConstantProperty(ShadowMode.ENABLED); source.distanceDisplayCondition = new ConstantProperty( - new DistanceDisplayCondition() + new DistanceDisplayCondition(), ); source.classificationType = new ConstantProperty( - ClassificationType.TERRAIN + ClassificationType.TERRAIN, ); source.arcType = new ConstantProperty(ArcType.RHUMB); source.zIndex = new ConstantProperty(30); @@ -137,7 +137,7 @@ describe("DataSources/PolygonGraphics", function () { expect(target.closeBottom).toBe(source.closeBottom); expect(target.shadows).toBe(source.shadows); expect(target.distanceDisplayCondition).toBe( - source.distanceDisplayCondition + source.distanceDisplayCondition, ); expect(target.classificationType).toBe(source.classificationType); expect(target.arcType).toBe(source.arcType); @@ -255,7 +255,7 @@ describe("DataSources/PolygonGraphics", function () { expect(result.closeBottom).toBe(source.closeBottom); expect(result.shadows).toBe(source.shadows); expect(result.distanceDisplayCondition).toBe( - source.distanceDisplayCondition + source.distanceDisplayCondition, ); expect(result.classificationType).toBe(source.classificationType); expect(result.arcType).toBe(source.arcType); @@ -290,19 +290,19 @@ describe("DataSources/PolygonGraphics", function () { property, "shadows", ShadowMode.ENABLED, - ShadowMode.DISABLED + ShadowMode.DISABLED, ); testDefinitionChanged( property, "distanceDisplayCondition", new DistanceDisplayCondition(), - new DistanceDisplayCondition(10.0, 100.0) + new DistanceDisplayCondition(10.0, 100.0), ); testDefinitionChanged( property, "classificationType", ClassificationType.TERRAIN, - ClassificationType.BOTH + ClassificationType.BOTH, ); testDefinitionChanged(property, "arcType", ArcType.GEODESIC, ArcType.RHUMB); testDefinitionChanged(property, "zIndex", 54, 3); diff --git a/packages/engine/Specs/DataSources/PolylineArrowMaterialPropertySpec.js b/packages/engine/Specs/DataSources/PolylineArrowMaterialPropertySpec.js index 86cbc357d388..20e8126809a2 100644 --- a/packages/engine/Specs/DataSources/PolylineArrowMaterialPropertySpec.js +++ b/packages/engine/Specs/DataSources/PolylineArrowMaterialPropertySpec.js @@ -45,7 +45,7 @@ describe("DataSources/PolylineArrowMaterialProperty", function () { start: start, stop: stop, data: Color.BLUE, - }) + }), ); expect(property.isConstant).toBe(false); @@ -90,7 +90,7 @@ describe("DataSources/PolylineArrowMaterialProperty", function () { property, "color", property.color, - oldValue + oldValue, ); listener.calls.reset(); @@ -99,7 +99,7 @@ describe("DataSources/PolylineArrowMaterialProperty", function () { property, "color", property.color, - property.color + property.color, ); listener.calls.reset(); diff --git a/packages/engine/Specs/DataSources/PolylineDashMaterialPropertySpec.js b/packages/engine/Specs/DataSources/PolylineDashMaterialPropertySpec.js index 1e0b938b4d07..4293d01aea33 100644 --- a/packages/engine/Specs/DataSources/PolylineDashMaterialPropertySpec.js +++ b/packages/engine/Specs/DataSources/PolylineDashMaterialPropertySpec.js @@ -67,28 +67,28 @@ describe("DataSources/PolylineDashMaterialProperty", function () { start: start, stop: stop, data: Color.BLUE, - }) + }), ); property.gapColor.intervals.addInterval( new TimeInterval({ start: start, stop: stop, data: Color.YELLOW, - }) + }), ); property.dashLength.intervals.addInterval( new TimeInterval({ start: start, stop: stop, data: 10.0, - }) + }), ); property.dashPattern.intervals.addInterval( new TimeInterval({ start: start, stop: stop, data: 11.0, - }) + }), ); const result = property.getValue(start); @@ -152,7 +152,7 @@ describe("DataSources/PolylineDashMaterialProperty", function () { property, "color", property.color, - oldValue + oldValue, ); listener.calls.reset(); @@ -161,7 +161,7 @@ describe("DataSources/PolylineDashMaterialProperty", function () { property, "color", property.color, - property.color + property.color, ); listener.calls.reset(); @@ -175,7 +175,7 @@ describe("DataSources/PolylineDashMaterialProperty", function () { property, "gapColor", property.gapColor, - oldValue + oldValue, ); listener.calls.reset(); @@ -184,7 +184,7 @@ describe("DataSources/PolylineDashMaterialProperty", function () { property, "gapColor", property.gapColor, - property.gapColor + property.gapColor, ); listener.calls.reset(); @@ -198,7 +198,7 @@ describe("DataSources/PolylineDashMaterialProperty", function () { property, "dashLength", property.dashLength, - oldValue + oldValue, ); listener.calls.reset(); @@ -207,7 +207,7 @@ describe("DataSources/PolylineDashMaterialProperty", function () { property, "dashLength", property.dashLength, - property.dashLength + property.dashLength, ); listener.calls.reset(); @@ -220,7 +220,7 @@ describe("DataSources/PolylineDashMaterialProperty", function () { property, "dashPattern", property.dashPattern, - oldValue + oldValue, ); listener.calls.reset(); @@ -229,7 +229,7 @@ describe("DataSources/PolylineDashMaterialProperty", function () { property, "dashPattern", property.dashPattern, - property.dashPattern + property.dashPattern, ); listener.calls.reset(); @@ -255,7 +255,7 @@ describe("DataSources/PolylineDashMaterialProperty", function () { start: start, stop: stop, data: Color.RED, - }) + }), ); expect(property.isConstant).toBe(false); @@ -268,7 +268,7 @@ describe("DataSources/PolylineDashMaterialProperty", function () { start: start, stop: stop, data: Color.RED, - }) + }), ); expect(property.isConstant).toBe(false); property.gapColor = undefined; @@ -280,7 +280,7 @@ describe("DataSources/PolylineDashMaterialProperty", function () { start: start, stop: stop, data: 3.0, - }) + }), ); expect(property.isConstant).toBe(false); @@ -292,7 +292,7 @@ describe("DataSources/PolylineDashMaterialProperty", function () { start: start, stop: stop, data: 3.0, - }) + }), ); expect(property.isConstant).toBe(false); }); diff --git a/packages/engine/Specs/DataSources/PolylineGeometryUpdaterSpec.js b/packages/engine/Specs/DataSources/PolylineGeometryUpdaterSpec.js index cfcbba4cdccc..285941f48ea0 100644 --- a/packages/engine/Specs/DataSources/PolylineGeometryUpdaterSpec.js +++ b/packages/engine/Specs/DataSources/PolylineGeometryUpdaterSpec.js @@ -58,14 +58,7 @@ describe( const time = JulianDate.now(); const basicPositions = Cartesian3.fromRadiansArray([ - 0, - 0, - 1, - 0, - 1, - 1, - 0, - 1, + 0, 0, 1, 0, 1, 1, 0, 1, ]); function createBasicPolyline() { const polyline = new PolylineGraphics(); @@ -129,7 +122,7 @@ describe( expect(updater.isClosed).toBe(false); expect(updater.fillEnabled).toBe(true); expect(updater.fillMaterialProperty).toEqual( - new ColorMaterialProperty(Color.WHITE) + new ColorMaterialProperty(Color.WHITE), ); expect(updater.depthFailMaterialProperty).toBe(undefined); expect(updater.outlineEnabled).toBe(false); @@ -137,10 +130,10 @@ describe( expect(updater.hasConstantOutline).toBe(true); expect(updater.outlineColorProperty).toBe(undefined); expect(updater.shadowsProperty).toEqual( - new ConstantProperty(ShadowMode.DISABLED) + new ConstantProperty(ShadowMode.DISABLED), ); expect(updater.distanceDisplayConditionProperty).toEqual( - new ConstantProperty(new DistanceDisplayCondition()) + new ConstantProperty(new DistanceDisplayCondition()), ); expect(updater.isDynamic).toBe(false); expect(updater.clampToGround).toBe(false); @@ -160,7 +153,7 @@ describe( const updater = new PolylineGeometryUpdater(entity, scene); entity.polyline.depthFailMaterial = new ColorMaterialProperty(); expect(updater.depthFailMaterialProperty).toBe( - entity.polyline.depthFailMaterial + entity.polyline.depthFailMaterial, ); }); @@ -194,7 +187,7 @@ describe( start: new JulianDate(0, 0), stop: new JulianDate(10, 0), data: ArcType.NONE, - }) + }), ); const entity = createBasicPolyline(); @@ -271,8 +264,8 @@ describe( ) { expect(attributes.depthFailColor.value).toEqual( ColorGeometryInstanceAttribute.toValue( - options.depthFailMaterial.color.getValue(time) - ) + options.depthFailMaterial.color.getValue(time), + ), ); } else { expect(attributes.depthFailColor).toBeUndefined(); @@ -282,20 +275,20 @@ describe( if (options.material instanceof ColorMaterialProperty) { expect(attributes.color.value).toEqual( ColorGeometryInstanceAttribute.toValue( - options.material.color.getValue(time) - ) + options.material.color.getValue(time), + ), ); } else { expect(attributes.color).toBeUndefined(); } expect(attributes.show.value).toEqual( - ShowGeometryInstanceAttribute.toValue(options.show) + ShowGeometryInstanceAttribute.toValue(options.show), ); if (options.distanceDisplayCondition) { expect(attributes.distanceDisplayCondition.value).toEqual( DistanceDisplayConditionGeometryInstanceAttribute.toValue( - options.distanceDisplayCondition - ) + options.distanceDisplayCondition, + ), ); } } @@ -432,7 +425,7 @@ describe( start: time1, stop: time2, data: false, - }) + }), ); show.intervals.addInterval( new TimeInterval({ @@ -440,7 +433,7 @@ describe( stop: time3, isStartIncluded: false, data: true, - }) + }), ); const colorMaterial = new ColorMaterialProperty(); @@ -459,11 +452,11 @@ describe( const attributes = instance.attributes; expect(attributes.color.value).toEqual( ColorGeometryInstanceAttribute.toValue( - colorMaterial.color.getValue(time2) - ) + colorMaterial.color.getValue(time2), + ), ); expect(attributes.show.value).toEqual( - ShowGeometryInstanceAttribute.toValue(show.getValue(time2)) + ShowGeometryInstanceAttribute.toValue(show.getValue(time2)), ); }); @@ -475,7 +468,7 @@ describe( const instance = updater.createFillGeometryInstance(new JulianDate()); const attributes = instance.attributes; expect(attributes.show.value).toEqual( - ShowGeometryInstanceAttribute.toValue(false) + ShowGeometryInstanceAttribute.toValue(false), ); }); @@ -510,7 +503,7 @@ describe( const dynamicUpdater = updater.createDynamicUpdater( primitives, - scene.groundPrimitives + scene.groundPrimitives, ); expect(dynamicUpdater.isDestroyed()).toBe(false); @@ -571,7 +564,7 @@ describe( const dynamicUpdater = updater.createDynamicUpdater( scene.primitives, - groundPrimitives + groundPrimitives, ); expect(dynamicUpdater.isDestroyed()).toBe(false); expect(groundPrimitives.length).toBe(0); @@ -624,7 +617,7 @@ describe( const dynamicUpdater = updater.createDynamicUpdater( primitives, - scene.groundPrimitives + scene.groundPrimitives, ); expect(dynamicUpdater.isDestroyed()).toBe(false); expect(primitives.length).toBe(0); @@ -643,7 +636,7 @@ describe( dynamicUpdater.update(time); expect(polylineObject.positions.length).not.toEqual( - geodesicPolylinePositionsLength + geodesicPolylinePositionsLength, ); dynamicUpdater.destroy(); @@ -661,7 +654,7 @@ describe( updater.geometryChanged.addEventListener(listener); entity.polyline.positions = new ConstantProperty( - Cartesian3.fromRadiansArray([0, 0, 1, 0]) + Cartesian3.fromRadiansArray([0, 0, 1, 0]), ); expect(listener.calls.count()).toEqual(1); @@ -712,7 +705,7 @@ describe( expect(function () { return updater.createDynamicUpdater( scene.primitives, - scene.groundPrimitives + scene.groundPrimitives, ); }).toThrowDeveloperError(); updater.destroy(); @@ -749,7 +742,7 @@ describe( const updater = new PolylineGeometryUpdater(entity, scene); const dynamicUpdater = updater.createDynamicUpdater( scene.primitives, - scene.groundPrimitives + scene.groundPrimitives, ); expect(function () { dynamicUpdater.update(undefined); @@ -778,7 +771,7 @@ describe( const updater = new PolylineGeometryUpdater(entity, scene); const dynamicUpdater = updater.createDynamicUpdater( scene.primitives, - scene.groundPrimitives + scene.groundPrimitives, ); dynamicUpdater.update(time); @@ -809,7 +802,7 @@ describe( const updater = new PolylineGeometryUpdater(entity, scene); const dynamicUpdater = updater.createDynamicUpdater( scene.primitives, - scene.groundPrimitives + scene.groundPrimitives, ); dynamicUpdater.update(time); @@ -842,7 +835,7 @@ describe( const updater = new PolylineGeometryUpdater(entity, scene); const dynamicUpdater = updater.createDynamicUpdater( scene.primitives, - scene.groundPrimitives + scene.groundPrimitives, ); const result = new BoundingSphere(); @@ -862,7 +855,7 @@ describe( const updater = new PolylineGeometryUpdater(entity, scene); const dynamicUpdater = updater.createDynamicUpdater( scene.primitives, - scene.groundPrimitives + scene.groundPrimitives, ); expect(function () { @@ -884,7 +877,7 @@ describe( const updater = new PolylineGeometryUpdater(entity, scene); const dynamicUpdater = updater.createDynamicUpdater( scene.primitives, - scene.groundPrimitives + scene.groundPrimitives, ); spyOn(PolylinePipeline, "generateCartesianRhumbArc").and.callThrough(); dynamicUpdater.update(time); @@ -907,7 +900,7 @@ describe( const updater = new PolylineGeometryUpdater(entity, scene); const dynamicUpdater = updater.createDynamicUpdater( scene.primitives, - scene.groundPrimitives + scene.groundPrimitives, ); spyOn(PolylinePipeline, "generateCartesianArc").and.callThrough(); dynamicUpdater.update(time); @@ -941,5 +934,5 @@ describe( updater.destroy(); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/DataSources/PolylineGlowMaterialPropertySpec.js b/packages/engine/Specs/DataSources/PolylineGlowMaterialPropertySpec.js index cbf767d89e45..a881490466bc 100644 --- a/packages/engine/Specs/DataSources/PolylineGlowMaterialPropertySpec.js +++ b/packages/engine/Specs/DataSources/PolylineGlowMaterialPropertySpec.js @@ -66,21 +66,21 @@ describe("DataSources/PolylineGlowMaterialProperty", function () { start: start, stop: stop, data: Color.BLUE, - }) + }), ); property.glowPower.intervals.addInterval( new TimeInterval({ start: start, stop: stop, data: 0.65, - }) + }), ); property.taperPower.intervals.addInterval( new TimeInterval({ start: start, stop: stop, data: 0.55, - }) + }), ); expect(property.isConstant).toBe(false); @@ -145,7 +145,7 @@ describe("DataSources/PolylineGlowMaterialProperty", function () { property, "color", property.color, - oldValue + oldValue, ); listener.calls.reset(); @@ -154,7 +154,7 @@ describe("DataSources/PolylineGlowMaterialProperty", function () { property, "color", property.color, - property.color + property.color, ); listener.calls.reset(); diff --git a/packages/engine/Specs/DataSources/PolylineGraphicsSpec.js b/packages/engine/Specs/DataSources/PolylineGraphicsSpec.js index e40fb5da4101..f4db09ea9e8d 100644 --- a/packages/engine/Specs/DataSources/PolylineGraphicsSpec.js +++ b/packages/engine/Specs/DataSources/PolylineGraphicsSpec.js @@ -45,7 +45,7 @@ describe("DataSources/PolylineGraphics", function () { expect(polyline.material.color.getValue()).toEqual(options.material); expect(polyline.depthFailMaterial.color.getValue()).toEqual( - options.depthFailMaterial + options.depthFailMaterial, ); expect(polyline.positions.getValue()).toEqual(options.positions); expect(polyline.show.getValue()).toEqual(options.show); @@ -54,10 +54,10 @@ describe("DataSources/PolylineGraphics", function () { expect(polyline.granularity.getValue()).toEqual(options.granularity); expect(polyline.shadows.getValue()).toEqual(options.shadows); expect(polyline.distanceDisplayCondition.getValue()).toEqual( - options.distanceDisplayCondition + options.distanceDisplayCondition, ); expect(polyline.classificationType.getValue()).toEqual( - options.classificationType + options.classificationType, ); expect(polyline.arcType.getValue()).toEqual(options.arcType); expect(polyline.zIndex.getValue()).toEqual(options.zIndex); @@ -74,10 +74,10 @@ describe("DataSources/PolylineGraphics", function () { source.granularity = new ConstantProperty(); source.shadows = new ConstantProperty(ShadowMode.ENABLED); source.distanceDisplayCondition = new ConstantProperty( - new DistanceDisplayCondition() + new DistanceDisplayCondition(), ); source.classificationType = new ConstantProperty( - ClassificationType.TERRAIN + ClassificationType.TERRAIN, ); source.arcType = new ConstantProperty(ArcType.GEODESIC); source.zIndex = new ConstantProperty(); @@ -93,7 +93,7 @@ describe("DataSources/PolylineGraphics", function () { expect(target.granularity).toBe(source.granularity); expect(target.shadows).toBe(source.shadows); expect(target.distanceDisplayCondition).toBe( - source.distanceDisplayCondition + source.distanceDisplayCondition, ); expect(target.classificationType).toBe(source.classificationType); expect(target.arcType).toBe(source.arcType); @@ -182,7 +182,7 @@ describe("DataSources/PolylineGraphics", function () { expect(result.granularity).toBe(source.granularity); expect(result.shadows).toBe(source.shadows); expect(result.distanceDisplayCondition).toBe( - source.distanceDisplayCondition + source.distanceDisplayCondition, ); expect(result.classificationType).toBe(source.classificationType); expect(result.arcType).toBe(source.arcType); @@ -203,7 +203,7 @@ describe("DataSources/PolylineGraphics", function () { property, "depthFailMaterial", Color.RED, - Color.BLUE + Color.BLUE, ); testDefinitionChanged(property, "show", true, false); testDefinitionChanged(property, "positions", [], []); @@ -214,18 +214,18 @@ describe("DataSources/PolylineGraphics", function () { property, "shadows", ShadowMode.ENABLED, - ShadowMode.DISABLED + ShadowMode.DISABLED, ); testDefinitionChanged( property, "distanceDisplayCondition", new DistanceDisplayCondition(), - new DistanceDisplayCondition(10.0, 20.0) + new DistanceDisplayCondition(10.0, 20.0), ); testDefinitionChanged( property, "classificationType", - ClassificationType.TERRAIN + ClassificationType.TERRAIN, ); testDefinitionChanged(property, "arcType", ArcType.GEODESIC, ArcType.RHUMB); testDefinitionChanged(property, "zIndex", 20, 5); diff --git a/packages/engine/Specs/DataSources/PolylineOutlineMaterialPropertySpec.js b/packages/engine/Specs/DataSources/PolylineOutlineMaterialPropertySpec.js index 10448d3890c7..0094b3fba685 100644 --- a/packages/engine/Specs/DataSources/PolylineOutlineMaterialPropertySpec.js +++ b/packages/engine/Specs/DataSources/PolylineOutlineMaterialPropertySpec.js @@ -57,14 +57,14 @@ describe("DataSources/PolylineOutlineMaterialProperty", function () { start: start, stop: stop, data: Color.BLUE, - }) + }), ); property.outlineColor.intervals.addInterval( new TimeInterval({ start: start, stop: stop, data: Color.RED, - }) + }), ); const result = property.getValue(start); @@ -122,7 +122,7 @@ describe("DataSources/PolylineOutlineMaterialProperty", function () { property, "color", property.color, - oldValue + oldValue, ); listener.calls.reset(); @@ -131,7 +131,7 @@ describe("DataSources/PolylineOutlineMaterialProperty", function () { property, "color", property.color, - property.color + property.color, ); listener.calls.reset(); @@ -145,7 +145,7 @@ describe("DataSources/PolylineOutlineMaterialProperty", function () { property, "outlineColor", property.outlineColor, - oldValue + oldValue, ); listener.calls.reset(); @@ -154,7 +154,7 @@ describe("DataSources/PolylineOutlineMaterialProperty", function () { property, "outlineColor", property.outlineColor, - property.outlineColor + property.outlineColor, ); listener.calls.reset(); @@ -167,7 +167,7 @@ describe("DataSources/PolylineOutlineMaterialProperty", function () { property, "outlineWidth", property.outlineWidth, - oldValue + oldValue, ); listener.calls.reset(); @@ -176,7 +176,7 @@ describe("DataSources/PolylineOutlineMaterialProperty", function () { property, "outlineWidth", property.outlineWidth, - property.outlineWidth + property.outlineWidth, ); listener.calls.reset(); @@ -201,7 +201,7 @@ describe("DataSources/PolylineOutlineMaterialProperty", function () { start: start, stop: stop, data: Color.RED, - }) + }), ); expect(property.isConstant).toBe(false); @@ -213,7 +213,7 @@ describe("DataSources/PolylineOutlineMaterialProperty", function () { start: start, stop: stop, data: Color.BLUE, - }) + }), ); expect(property.isConstant).toBe(false); @@ -225,7 +225,7 @@ describe("DataSources/PolylineOutlineMaterialProperty", function () { start: start, stop: stop, data: 2.0, - }) + }), ); expect(property.isConstant).toBe(false); }); diff --git a/packages/engine/Specs/DataSources/PolylineVisualizerSpec.js b/packages/engine/Specs/DataSources/PolylineVisualizerSpec.js index d2453021e059..5f4ba7b32b53 100644 --- a/packages/engine/Specs/DataSources/PolylineVisualizerSpec.js +++ b/packages/engine/Specs/DataSources/PolylineVisualizerSpec.js @@ -95,10 +95,10 @@ describe( const attributes = primitive.getGeometryInstanceAttributes(entity); expect(attributes).toBeDefined(); expect(attributes.show).toEqual( - ShowGeometryInstanceAttribute.toValue(true) + ShowGeometryInstanceAttribute.toValue(true), ); expect(attributes.color).toEqual( - ColorGeometryInstanceAttribute.toValue(Color.WHITE) + ColorGeometryInstanceAttribute.toValue(Color.WHITE), ); expect(primitive.appearance).toBeInstanceOf(PolylineColorAppearance); expect(primitive.appearance.closed).toBe(false); @@ -131,7 +131,7 @@ describe( const attributes = primitive.getGeometryInstanceAttributes(entity); expect(attributes).toBeDefined(); expect(attributes.show).toEqual( - ShowGeometryInstanceAttribute.toValue(true) + ShowGeometryInstanceAttribute.toValue(true), ); expect(attributes.color).toBeUndefined(); expect(primitive.appearance).toBeInstanceOf(PolylineMaterialAppearance); @@ -170,10 +170,10 @@ describe( const attributes = primitive.getGeometryInstanceAttributes(entity); expect(attributes).toBeDefined(); expect(attributes.show).toEqual( - ShowGeometryInstanceAttribute.toValue(true) + ShowGeometryInstanceAttribute.toValue(true), ); expect(attributes.color).toEqual( - ColorGeometryInstanceAttribute.toValue(Color.WHITE) + ColorGeometryInstanceAttribute.toValue(Color.WHITE), ); expect(primitive.appearance).toBeInstanceOf(PolylineColorAppearance); expect(primitive.appearance.closed).toBe(false); @@ -244,7 +244,7 @@ describe( const entity = new Entity(); entity.position = new ConstantPositionProperty( - new Cartesian3(1234, 5678, 9101112) + new Cartesian3(1234, 5678, 9101112), ); entity.polyline = polyline; objects.add(entity); @@ -254,17 +254,17 @@ describe( const attributes = primitive.getGeometryInstanceAttributes(entity); expect(attributes).toBeDefined(); expect(attributes.show).toEqual( - ShowGeometryInstanceAttribute.toValue(true) + ShowGeometryInstanceAttribute.toValue(true), ); expect(attributes.color).toEqual( - ColorGeometryInstanceAttribute.toValue(Color.WHITE) + ColorGeometryInstanceAttribute.toValue(Color.WHITE), ); expect(attributes.depthFailColor).toEqual( - ColorGeometryInstanceAttribute.toValue(Color.WHITE) + ColorGeometryInstanceAttribute.toValue(Color.WHITE), ); expect(primitive.appearance).toBeInstanceOf(PolylineColorAppearance); expect(primitive.depthFailAppearance).toBeInstanceOf( - PolylineColorAppearance + PolylineColorAppearance, ); objects.remove(entity); @@ -289,7 +289,7 @@ describe( const entity = new Entity(); entity.position = new ConstantPositionProperty( - new Cartesian3(1234, 5678, 9101112) + new Cartesian3(1234, 5678, 9101112), ); entity.polyline = polyline; objects.add(entity); @@ -299,15 +299,15 @@ describe( const attributes = primitive.getGeometryInstanceAttributes(entity); expect(attributes).toBeDefined(); expect(attributes.show).toEqual( - ShowGeometryInstanceAttribute.toValue(true) + ShowGeometryInstanceAttribute.toValue(true), ); expect(attributes.color).toEqual( - ColorGeometryInstanceAttribute.toValue(Color.WHITE) + ColorGeometryInstanceAttribute.toValue(Color.WHITE), ); expect(attributes.depthFailColor).toBeUndefined(); expect(primitive.appearance).toBeInstanceOf(PolylineColorAppearance); expect(primitive.depthFailAppearance).toBeInstanceOf( - PolylineMaterialAppearance + PolylineMaterialAppearance, ); objects.remove(entity); @@ -332,7 +332,7 @@ describe( const entity = new Entity(); entity.position = new ConstantPositionProperty( - new Cartesian3(1234, 5678, 9101112) + new Cartesian3(1234, 5678, 9101112), ); entity.polyline = polyline; objects.add(entity); @@ -342,13 +342,13 @@ describe( const attributes = primitive.getGeometryInstanceAttributes(entity); expect(attributes).toBeDefined(); expect(attributes.show).toEqual( - ShowGeometryInstanceAttribute.toValue(true) + ShowGeometryInstanceAttribute.toValue(true), ); expect(attributes.color).toBeUndefined(); expect(attributes.depthFailColor).toBeUndefined(); expect(primitive.appearance).toBeInstanceOf(PolylineMaterialAppearance); expect(primitive.depthFailAppearance).toBeInstanceOf( - PolylineMaterialAppearance + PolylineMaterialAppearance, ); objects.remove(entity); @@ -373,7 +373,7 @@ describe( const entity = new Entity(); entity.position = new ConstantPositionProperty( - new Cartesian3(1234, 5678, 9101112) + new Cartesian3(1234, 5678, 9101112), ); entity.polyline = polyline; objects.add(entity); @@ -383,15 +383,15 @@ describe( const attributes = primitive.getGeometryInstanceAttributes(entity); expect(attributes).toBeDefined(); expect(attributes.show).toEqual( - ShowGeometryInstanceAttribute.toValue(true) + ShowGeometryInstanceAttribute.toValue(true), ); expect(attributes.color).toBeUndefined(); expect(attributes.depthFailColor).toEqual( - ColorGeometryInstanceAttribute.toValue(Color.WHITE) + ColorGeometryInstanceAttribute.toValue(Color.WHITE), ); expect(primitive.appearance).toBeInstanceOf(PolylineMaterialAppearance); expect(primitive.depthFailAppearance).toBeInstanceOf( - PolylineColorAppearance + PolylineColorAppearance, ); objects.remove(entity); @@ -437,19 +437,19 @@ describe( it("Creates and removes geometry classifying terrain", function () { return createAndRemoveGeometryWithClassificationType( - ClassificationType.TERRAIN + ClassificationType.TERRAIN, ); }); it("Creates and removes geometry classifying 3D Tiles", function () { return createAndRemoveGeometryWithClassificationType( - ClassificationType.CESIUM_3D_TILE + ClassificationType.CESIUM_3D_TILE, ); }); it("Creates and removes geometry classifying both terrain and 3D Tiles", function () { return createAndRemoveGeometryWithClassificationType( - ClassificationType.BOTH + ClassificationType.BOTH, ); }); @@ -473,10 +473,10 @@ describe( let attributes = primitive.getGeometryInstanceAttributes(entity); expect(attributes).toBeDefined(); expect(attributes.show).toEqual( - ShowGeometryInstanceAttribute.toValue(true) + ShowGeometryInstanceAttribute.toValue(true), ); expect(attributes.color).toEqual( - ColorGeometryInstanceAttribute.toValue(Color.WHITE) + ColorGeometryInstanceAttribute.toValue(Color.WHITE), ); expect(primitive.appearance).toBeInstanceOf(PolylineColorAppearance); @@ -487,11 +487,11 @@ describe( attributes = primitive.getGeometryInstanceAttributes(entity); expect(attributes).toBeDefined(); expect(attributes.show).toEqual( - ShowGeometryInstanceAttribute.toValue(true) + ShowGeometryInstanceAttribute.toValue(true), ); expect(attributes.color).toBeUndefined(); expect(primitive.appearance).toBeInstanceOf( - PolylineMaterialAppearance + PolylineMaterialAppearance, ); objects.remove(entity); @@ -589,8 +589,8 @@ describe( BoundingSphere.transform( attributes.boundingSphere, primitive.modelMatrix, - new BoundingSphere() - ) + new BoundingSphere(), + ), ); visualizer.destroy(); @@ -659,10 +659,10 @@ describe( const attributes = primitive.getGeometryInstanceAttributes(entity2); expect(attributes).toBeDefined(); expect(attributes.show).toEqual( - ShowGeometryInstanceAttribute.toValue(true) + ShowGeometryInstanceAttribute.toValue(true), ); expect(attributes.color).toEqual( - ColorGeometryInstanceAttribute.toValue(Color.BLUE) + ColorGeometryInstanceAttribute.toValue(Color.BLUE), ); expect(primitive.appearance).toBeInstanceOf(PolylineColorAppearance); @@ -686,7 +686,7 @@ describe( Cartesian3.fromDegrees(0.0, 0.000001), ], material: new ColorMaterialProperty( - createDynamicProperty(Color.BLUE) + createDynamicProperty(Color.BLUE), ), }, }); @@ -697,7 +697,7 @@ describe( const attributes = primitive.getGeometryInstanceAttributes(entity); expect(attributes).toBeDefined(); expect(attributes.show).toEqual( - ShowGeometryInstanceAttribute.toValue(true) + ShowGeometryInstanceAttribute.toValue(true), ); entity.show = false; @@ -709,7 +709,7 @@ describe( const attributes = primitive.getGeometryInstanceAttributes(entity); expect(attributes).toBeDefined(); expect(attributes.show).toEqual( - ShowGeometryInstanceAttribute.toValue(false) + ShowGeometryInstanceAttribute.toValue(false), ); entities.remove(entity); @@ -729,7 +729,7 @@ describe( Cartesian3.fromDegrees(0.0, 0.000001), ], material: new PolylineArrowMaterialProperty( - createDynamicProperty(Color.BLUE) + createDynamicProperty(Color.BLUE), ), }, }); @@ -740,7 +740,7 @@ describe( const attributes = primitive.getGeometryInstanceAttributes(entity); expect(attributes).toBeDefined(); expect(attributes.show).toEqual( - ShowGeometryInstanceAttribute.toValue(true) + ShowGeometryInstanceAttribute.toValue(true), ); entity.show = false; @@ -752,7 +752,7 @@ describe( const attributes = primitive.getGeometryInstanceAttributes(entity); expect(attributes).toBeDefined(); expect(attributes.show).toEqual( - ShowGeometryInstanceAttribute.toValue(false) + ShowGeometryInstanceAttribute.toValue(false), ); entities.remove(entity); @@ -786,10 +786,10 @@ describe( const attributes = primitive.getGeometryInstanceAttributes(entity); expect(attributes).toBeDefined(); expect(attributes.show).toEqual( - ShowGeometryInstanceAttribute.toValue(true) + ShowGeometryInstanceAttribute.toValue(true), ); expect(attributes.color).toEqual( - ColorGeometryInstanceAttribute.toValue(Color.WHITE) + ColorGeometryInstanceAttribute.toValue(Color.WHITE), ); expect(primitive.appearance).toBeInstanceOf(PolylineColorAppearance); expect(primitive.appearance.closed).toBe(false); @@ -894,5 +894,5 @@ describe( }); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/DataSources/PolylineVolumeGeometryUpdaterSpec.js b/packages/engine/Specs/DataSources/PolylineVolumeGeometryUpdaterSpec.js index e2a8541580fd..5fc0211935d1 100644 --- a/packages/engine/Specs/DataSources/PolylineVolumeGeometryUpdaterSpec.js +++ b/packages/engine/Specs/DataSources/PolylineVolumeGeometryUpdaterSpec.js @@ -43,7 +43,7 @@ describe( function createBasicPolylineVolume() { const polylineVolume = new PolylineVolumeGraphics(); polylineVolume.positions = new ConstantProperty( - Cartesian3.fromDegreesArray([0, 0, 1, 0, 1, 1, 0, 1]) + Cartesian3.fromDegreesArray([0, 0, 1, 0, 1, 1, 0, 1]), ); polylineVolume.shape = new ConstantProperty(shape); const entity = new Entity(); @@ -61,7 +61,7 @@ describe( const entity = createBasicPolylineVolume(); const updater = new PolylineVolumeGeometryUpdater(entity, scene); entity.polylineVolume.positions = createDynamicProperty( - Cartesian3.fromRadiansArray([0, 0, 1, 0, 1, 1, 0, 1]) + Cartesian3.fromRadiansArray([0, 0, 1, 0, 1, 1, 0, 1]), ); updater._onEntityPropertyChanged(entity, "polylineVolume"); @@ -95,7 +95,7 @@ describe( start: JulianDate.now(), stop: JulianDate.now(), data: CornerType.ROUNDED, - }) + }), ); updater._onEntityPropertyChanged(entity, "polylineVolume"); @@ -136,7 +136,7 @@ describe( it("dynamic updater sets properties", function () { const polylineVolume = new PolylineVolumeGraphics(); polylineVolume.positions = createDynamicProperty( - Cartesian3.fromRadiansArray([0, 0, 1, 0, 1, 1, 0, 1]) + Cartesian3.fromRadiansArray([0, 0, 1, 0, 1, 1, 0, 1]), ); polylineVolume.show = createDynamicProperty(true); polylineVolume.shape = createDynamicProperty(shape); @@ -151,18 +151,18 @@ describe( const updater = new PolylineVolumeGeometryUpdater(entity, scene); const dynamicUpdater = updater.createDynamicUpdater( new PrimitiveCollection(), - new PrimitiveCollection() + new PrimitiveCollection(), ); dynamicUpdater.update(time); const options = dynamicUpdater._options; expect(options.id).toEqual(entity); expect(options.polylinePositions).toEqual( - polylineVolume.positions.getValue() + polylineVolume.positions.getValue(), ); expect(options.shapePositions).toEqual(polylineVolume.shape.getValue()); expect(options.granularity).toEqual( - polylineVolume.granularity.getValue() + polylineVolume.granularity.getValue(), ); expect(options.cornerType).toEqual(polylineVolume.cornerType.getValue()); }); @@ -207,15 +207,15 @@ describe( PolylineVolumeGeometryUpdater, "polylineVolume", createBasicPolylineVolume, - getScene + getScene, ); createDynamicGeometryUpdaterSpecs( PolylineVolumeGeometryUpdater, "polylineVolume", createDynamicPolylineVolume, - getScene + getScene, ); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/DataSources/PolylineVolumeGraphicsSpec.js b/packages/engine/Specs/DataSources/PolylineVolumeGraphicsSpec.js index 103036b04d6e..89be9150a5f9 100644 --- a/packages/engine/Specs/DataSources/PolylineVolumeGraphicsSpec.js +++ b/packages/engine/Specs/DataSources/PolylineVolumeGraphicsSpec.js @@ -41,7 +41,7 @@ describe("DataSources/PolylineVolumeGraphics", function () { expect(polylineVolume.cornerType).toBeInstanceOf(ConstantProperty); expect(polylineVolume.shadows).toBeInstanceOf(ConstantProperty); expect(polylineVolume.distanceDisplayCondition).toBeInstanceOf( - ConstantProperty + ConstantProperty, ); expect(polylineVolume.material.color.getValue()).toEqual(options.material); @@ -52,15 +52,15 @@ describe("DataSources/PolylineVolumeGraphics", function () { expect(polylineVolume.fill.getValue()).toEqual(options.fill); expect(polylineVolume.outline.getValue()).toEqual(options.outline); expect(polylineVolume.outlineColor.getValue()).toEqual( - options.outlineColor + options.outlineColor, ); expect(polylineVolume.outlineWidth.getValue()).toEqual( - options.outlineWidth + options.outlineWidth, ); expect(polylineVolume.cornerType.getValue()).toEqual(options.cornerType); expect(polylineVolume.shadows.getValue()).toEqual(options.shadows); expect(polylineVolume.distanceDisplayCondition.getValue()).toEqual( - options.distanceDisplayCondition + options.distanceDisplayCondition, ); }); @@ -78,7 +78,7 @@ describe("DataSources/PolylineVolumeGraphics", function () { source.cornerType = new ConstantProperty(); source.shadows = new ConstantProperty(ShadowMode.ENABLED); source.distanceDisplayCondition = new ConstantProperty( - new DistanceDisplayCondition() + new DistanceDisplayCondition(), ); const target = new PolylineVolumeGraphics(); @@ -96,7 +96,7 @@ describe("DataSources/PolylineVolumeGraphics", function () { expect(target.cornerType).toBe(source.cornerType); expect(target.shadows).toBe(source.shadows); expect(target.distanceDisplayCondition).toBe( - source.distanceDisplayCondition + source.distanceDisplayCondition, ); }); @@ -174,7 +174,7 @@ describe("DataSources/PolylineVolumeGraphics", function () { expect(result.cornerType).toBe(source.cornerType); expect(result.shadows).toBe(source.shadows); expect(result.distanceDisplayCondition).toBe( - source.distanceDisplayCondition + source.distanceDisplayCondition, ); }); @@ -200,19 +200,19 @@ describe("DataSources/PolylineVolumeGraphics", function () { property, "cornerType", CornerType.BEVELED, - CornerType.MITERED + CornerType.MITERED, ); testDefinitionChanged( property, "shadows", ShadowMode.ENABLED, - ShadowMode.DISABLED + ShadowMode.DISABLED, ); testDefinitionChanged( property, "distanceDisplayCondition", new DistanceDisplayCondition(), - new DistanceDisplayCondition(10.0, 100.0) + new DistanceDisplayCondition(10.0, 100.0), ); }); }); diff --git a/packages/engine/Specs/DataSources/PositionPropertyArraySpec.js b/packages/engine/Specs/DataSources/PositionPropertyArraySpec.js index da0af5d54ce3..c90dff6d796a 100644 --- a/packages/engine/Specs/DataSources/PositionPropertyArraySpec.js +++ b/packages/engine/Specs/DataSources/PositionPropertyArraySpec.js @@ -69,7 +69,7 @@ describe("DataSources/PositionPropertyArray", function () { const property = new PositionPropertyArray(value); const result = property.getValueInReferenceFrame( time, - ReferenceFrame.INERTIAL + ReferenceFrame.INERTIAL, ); expect(result).toEqual(expected); }); diff --git a/packages/engine/Specs/DataSources/PropertyBagSpec.js b/packages/engine/Specs/DataSources/PropertyBagSpec.js index 8d5eb332d612..8a3da3e739ab 100644 --- a/packages/engine/Specs/DataSources/PropertyBagSpec.js +++ b/packages/engine/Specs/DataSources/PropertyBagSpec.js @@ -103,7 +103,7 @@ describe("DataSources/PropertyBag", function () { a: 1, b: 2, }, - createFakeProperty + createFakeProperty, ); expect(property.propertyNames).toContain("a"); diff --git a/packages/engine/Specs/DataSources/RectangleGeometryUpdaterSpec.js b/packages/engine/Specs/DataSources/RectangleGeometryUpdaterSpec.js index 551b4e52397c..88f94a0d9fb2 100644 --- a/packages/engine/Specs/DataSources/RectangleGeometryUpdaterSpec.js +++ b/packages/engine/Specs/DataSources/RectangleGeometryUpdaterSpec.js @@ -44,7 +44,7 @@ describe( const entity = new Entity(); entity.rectangle = rectangle; entity.rectangle.coordinates = new ConstantProperty( - new Rectangle(-1, -1, 1, 1) + new Rectangle(-1, -1, 1, 1), ); entity.rectangle.height = new ConstantProperty(0); return entity; @@ -61,7 +61,7 @@ describe( const entity = new Entity(); entity.rectangle = rectangle; entity.rectangle.coordinates = new ConstantProperty( - new Rectangle(0, 0, 1, 1) + new Rectangle(0, 0, 1, 1), ); return entity; } @@ -187,7 +187,7 @@ describe( const updater = new RectangleGeometryUpdater(entity, scene); const dynamicUpdater = updater.createDynamicUpdater( new PrimitiveCollection(), - new PrimitiveCollection() + new PrimitiveCollection(), ); dynamicUpdater.update(time); @@ -196,7 +196,7 @@ describe( expect(options.rectangle).toEqual(rectangle.coordinates.getValue()); expect(options.height).toEqual(rectangle.height.getValue()); expect(options.extrudedHeight).toEqual( - rectangle.extrudedHeight.getValue() + rectangle.extrudedHeight.getValue(), ); expect(options.granularity).toEqual(rectangle.granularity.getValue()); expect(options.stRotation).toEqual(rectangle.stRotation.getValue()); @@ -237,7 +237,7 @@ describe( expect(updater._computeCenter(time)).toEqualEpsilon( Cartesian3.fromDegrees(0.0, 0.0), - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); }); @@ -248,14 +248,14 @@ describe( RectangleGeometryUpdater, "rectangle", createBasicRectangle, - getScene + getScene, ); createDynamicGeometryUpdaterSpecs( RectangleGeometryUpdater, "rectangle", createDynamicRectangle, - getScene + getScene, ); createGeometryUpdaterGroundGeometrySpecs( @@ -263,8 +263,8 @@ describe( "rectangle", createBasicRectangleWithoutHeight, createDynamicRectangleWithoutHeight, - getScene + getScene, ); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/DataSources/RectangleGraphicsSpec.js b/packages/engine/Specs/DataSources/RectangleGraphicsSpec.js index bbfdfe34f0ef..75b1cce95003 100644 --- a/packages/engine/Specs/DataSources/RectangleGraphicsSpec.js +++ b/packages/engine/Specs/DataSources/RectangleGraphicsSpec.js @@ -65,10 +65,10 @@ describe("DataSources/RectangleGraphics", function () { expect(rectangle.outlineWidth.getValue()).toEqual(options.outlineWidth); expect(rectangle.shadows.getValue()).toEqual(options.shadows); expect(rectangle.distanceDisplayCondition.getValue()).toEqual( - options.distanceDisplayCondition + options.distanceDisplayCondition, ); expect(rectangle.classificationType.getValue()).toEqual( - options.classificationType + options.classificationType, ); expect(rectangle.zIndex.getValue()).toEqual(options.zIndex); }); @@ -109,7 +109,7 @@ describe("DataSources/RectangleGraphics", function () { expect(target.outlineWidth).toBe(source.outlineWidth); expect(target.shadows).toBe(source.shadows); expect(target.distanceDisplayCondition).toBe( - source.distanceDisplayCondition + source.distanceDisplayCondition, ); expect(target.classificationType).toBe(source.classificationType); expect(target.zIndex).toBe(source.zIndex); @@ -207,7 +207,7 @@ describe("DataSources/RectangleGraphics", function () { expect(result.outlineWidth).toBe(source.outlineWidth); expect(result.shadows).toBe(source.shadows); expect(result.distanceDisplayCondition).toBe( - source.distanceDisplayCondition + source.distanceDisplayCondition, ); expect(result.classificationType).toBe(source.classificationType); expect(result.zIndex).toBe(source.zIndex); @@ -228,7 +228,7 @@ describe("DataSources/RectangleGraphics", function () { property, "coordinates", new Rectangle(0, 0, 0.1, 0.1), - new Rectangle(0, 0, 1, 1) + new Rectangle(0, 0, 1, 1), ); testDefinitionChanged(property, "height", 2, 5); testDefinitionChanged(property, "extrudedHeight", 3, 4); @@ -243,19 +243,19 @@ describe("DataSources/RectangleGraphics", function () { property, "shadows", ShadowMode.ENABLED, - ShadowMode.DISABLED + ShadowMode.DISABLED, ); testDefinitionChanged( property, "distanceDisplayCondition", new DistanceDisplayCondition(), - new DistanceDisplayCondition(10.0, 100.0) + new DistanceDisplayCondition(10.0, 100.0), ); testDefinitionChanged( property, "classificationType", ClassificationType.TERRAIN, - ClassificationType.BOTH + ClassificationType.BOTH, ); testDefinitionChanged(property, "zIndex", 20, 5); }); diff --git a/packages/engine/Specs/DataSources/ReferencePropertySpec.js b/packages/engine/Specs/DataSources/ReferencePropertySpec.js index cc95f49eccea..3732e29998c8 100644 --- a/packages/engine/Specs/DataSources/ReferencePropertySpec.js +++ b/packages/engine/Specs/DataSources/ReferencePropertySpec.js @@ -33,7 +33,7 @@ describe("DataSources/ReferenceProperty", function () { const property = ReferenceProperty.fromString( collection, - "testId#foo.bar.baz" + "testId#foo.bar.baz", ); expect(property.targetCollection).toBe(collection); @@ -47,7 +47,7 @@ describe("DataSources/ReferenceProperty", function () { const propertyNames = ["propertyName", ".abc\\", "def"]; const property = ReferenceProperty.fromString( collection, - "\\#identif\\\\\\#ier\\.#propertyName.\\.abc\\\\.def" + "\\#identif\\\\\\#ier\\.#propertyName.\\.abc\\\\.def", ); expect(property.targetCollection).toBe(collection); @@ -68,7 +68,7 @@ describe("DataSources/ReferenceProperty", function () { // Basic property resolution const property = ReferenceProperty.fromString( collection, - "testId#billboard.scale" + "testId#billboard.scale", ); expect(property.referenceFrame).toBeUndefined(); expect(property.isConstant).toEqual(true); @@ -138,7 +138,7 @@ describe("DataSources/ReferenceProperty", function () { }); testObject.position = new ConstantPositionProperty( new Cartesian3(1, 2, 3), - ReferenceFrame.FIXED + ReferenceFrame.FIXED, ); const collection = new EntityCollection(); @@ -150,12 +150,12 @@ describe("DataSources/ReferenceProperty", function () { expect(property.referenceFrame).toEqual(ReferenceFrame.FIXED); expect(property.getValue(time)).toEqual(testObject.position.getValue(time)); expect( - property.getValueInReferenceFrame(time, ReferenceFrame.INERTIAL) + property.getValueInReferenceFrame(time, ReferenceFrame.INERTIAL), ).toEqual( testObject.position.getValueInReferenceFrame( time, - ReferenceFrame.INERTIAL - ) + ReferenceFrame.INERTIAL, + ), ); property = ReferenceProperty.fromString(collection, "nonExistent#position"); @@ -163,7 +163,7 @@ describe("DataSources/ReferenceProperty", function () { expect(property.referenceFrame).toBeUndefined(); expect(property.getValue(time)).toBeUndefined(); expect( - property.getValueInReferenceFrame(time, ReferenceFrame.INERTIAL) + property.getValueInReferenceFrame(time, ReferenceFrame.INERTIAL), ).toBeUndefined(); }); @@ -180,19 +180,19 @@ describe("DataSources/ReferenceProperty", function () { // Basic property resolution let property = ReferenceProperty.fromString( collection, - "testId#testMaterial" + "testId#testMaterial", ); expect(property.isConstant).toEqual(true); expect(property.getType(time)).toEqual( - testObject.testMaterial.getType(time) + testObject.testMaterial.getType(time), ); expect(property.getValue(time)).toEqual( - testObject.testMaterial.getValue(time) + testObject.testMaterial.getValue(time), ); property = ReferenceProperty.fromString( collection, - "nonExistent#testMaterial" + "nonExistent#testMaterial", ); expect(property.isConstant).toEqual(true); expect(property.referenceFrame).toBeUndefined(); @@ -205,25 +205,25 @@ describe("DataSources/ReferenceProperty", function () { const left = ReferenceProperty.fromString( entityCollection, - "objectId#foo.bar" + "objectId#foo.bar", ); let right = ReferenceProperty.fromString( entityCollection, - "objectId#foo.bar" + "objectId#foo.bar", ); expect(left.equals(right)).toEqual(true); // collection differs right = ReferenceProperty.fromString( new EntityCollection(), - "objectId#foo.bar" + "objectId#foo.bar", ); expect(left.equals(right)).toEqual(false); // target id differs right = ReferenceProperty.fromString( entityCollection, - "otherObjectId#foo.bar" + "otherObjectId#foo.bar", ); expect(left.equals(right)).toEqual(false); @@ -253,7 +253,7 @@ describe("DataSources/ReferenceProperty", function () { const property = ReferenceProperty.fromString( collection, - "testId#billboard.scale" + "testId#billboard.scale", ); expect(property.resolvedProperty).toBe(testObject.billboard.scale); @@ -271,7 +271,7 @@ describe("DataSources/ReferenceProperty", function () { const property = ReferenceProperty.fromString( collection, - "testId#billboard.scale" + "testId#billboard.scale", ); expect(property.resolvedProperty).toBeUndefined(); @@ -316,7 +316,7 @@ describe("DataSources/ReferenceProperty", function () { return new ReferenceProperty( new EntityCollection(), "objectId", - undefined + undefined, ); }).toThrowDeveloperError(); }); @@ -375,7 +375,7 @@ describe("DataSources/ReferenceProperty", function () { const property = ReferenceProperty.fromString( collection, - "testId#billboard" + "testId#billboard", ); expect(property.getValue(time)).toBeUndefined(); }); @@ -391,7 +391,7 @@ describe("DataSources/ReferenceProperty", function () { const property = ReferenceProperty.fromString( collection, - "testId#billboard.foo" + "testId#billboard.foo", ); expect(property.getValue(time)).toBeUndefined(); }); diff --git a/packages/engine/Specs/DataSources/SampledPositionPropertySpec.js b/packages/engine/Specs/DataSources/SampledPositionPropertySpec.js index 366de65df190..fea9d91a824b 100644 --- a/packages/engine/Specs/DataSources/SampledPositionPropertySpec.js +++ b/packages/engine/Specs/DataSources/SampledPositionPropertySpec.js @@ -65,7 +65,7 @@ describe("DataSources/SampledPositionProperty", function () { time, valueInertial, ReferenceFrame.INERTIAL, - ReferenceFrame.FIXED + ReferenceFrame.FIXED, ); const property = new SampledPositionProperty(ReferenceFrame.INERTIAL); property.addSample(time, valueInertial); @@ -82,7 +82,7 @@ describe("DataSources/SampledPositionProperty", function () { const result = property.getValueInReferenceFrame( time, - ReferenceFrame.INERTIAL + ReferenceFrame.INERTIAL, ); expect(result).not.toBe(value); expect(result).toEqual( @@ -90,8 +90,8 @@ describe("DataSources/SampledPositionProperty", function () { time, value, ReferenceFrame.FIXED, - ReferenceFrame.INERTIAL - ) + ReferenceFrame.INERTIAL, + ), ); }); @@ -105,7 +105,7 @@ describe("DataSources/SampledPositionProperty", function () { const result = property.getValueInReferenceFrame( time, ReferenceFrame.FIXED, - expected + expected, ); expect(result).toBe(expected); expect(expected).toEqual( @@ -113,8 +113,8 @@ describe("DataSources/SampledPositionProperty", function () { time, value, ReferenceFrame.INERTIAL, - ReferenceFrame.FIXED - ) + ReferenceFrame.FIXED, + ), ); }); @@ -126,7 +126,7 @@ describe("DataSources/SampledPositionProperty", function () { property.addSamplesPackedArray(data, epoch); expect(property.getValue(epoch)).toEqual(new Cartesian3(7, 8, 9)); expect(property.getValue(new JulianDate(0, 0.5))).toEqual( - new Cartesian3(7.5, 8.5, 9.5) + new Cartesian3(7.5, 8.5, 9.5), ); }); @@ -151,7 +151,7 @@ describe("DataSources/SampledPositionProperty", function () { expect(property.getValue(times[1])).toEqual(values[1]); expect(property.getValue(times[2])).toEqual(values[2]); expect(property.getValue(new JulianDate(0.5, 0))).toEqual( - new Cartesian3(7.5, 8.5, 9.5) + new Cartesian3(7.5, 8.5, 9.5), ); }); @@ -173,7 +173,7 @@ describe("DataSources/SampledPositionProperty", function () { expect(property.getValue(times[1])).toEqual(values[1]); expect(property.getValue(times[2])).toEqual(values[2]); expect(property.getValue(new JulianDate(0.5, 0))).toEqual( - new Cartesian3(7.5, 8.5, 9.5) + new Cartesian3(7.5, 8.5, 9.5), ); }); @@ -233,7 +233,7 @@ describe("DataSources/SampledPositionProperty", function () { new TimeInterval({ start: times[1], stop: times[2], - }) + }), ); expect(listener).toHaveBeenCalledWith(property); @@ -247,27 +247,7 @@ describe("DataSources/SampledPositionProperty", function () { it("addSamplesPackedArray works with derivatives", function () { const data = [ - 0, - 7, - 8, - 9, - 1, - 0, - 0, - 1, - 8, - 9, - 10, - 0, - 1, - 0, - 2, - 9, - 10, - 11, - 0, - 0, - 1, + 0, 7, 8, 9, 1, 0, 0, 1, 8, 9, 10, 0, 1, 0, 2, 9, 10, 11, 0, 0, 1, ]; const epoch = new JulianDate(0, 0); @@ -275,7 +255,7 @@ describe("DataSources/SampledPositionProperty", function () { property.addSamplesPackedArray(data, epoch); expect(property.getValue(epoch)).toEqual(new Cartesian3(7, 8, 9)); expect(property.getValue(new JulianDate(0, 0.5))).toEqual( - new Cartesian3(7.5, 8.5, 9.5) + new Cartesian3(7.5, 8.5, 9.5), ); }); @@ -305,7 +285,7 @@ describe("DataSources/SampledPositionProperty", function () { expect(property.getValue(times[1])).toEqual(positions[1]); expect(property.getValue(times[2])).toEqual(positions[2]); expect(property.getValue(new JulianDate(0.5, 0))).toEqual( - new Cartesian3(7.5, 8.5, 9.5) + new Cartesian3(7.5, 8.5, 9.5), ); }); @@ -332,7 +312,7 @@ describe("DataSources/SampledPositionProperty", function () { expect(property.getValue(times[1])).toEqual(positions[1]); expect(property.getValue(times[2])).toEqual(positions[2]); expect(property.getValue(new JulianDate(0.5, 0))).toEqual( - new Cartesian3(7.5, 8.5, 9.5) + new Cartesian3(7.5, 8.5, 9.5), ); }); @@ -342,7 +322,7 @@ describe("DataSources/SampledPositionProperty", function () { property.addSample( new JulianDate(0, 0), new Cartesian3(7, 8, 9), - undefined + undefined, ); }).toThrowDeveloperError(); }); @@ -435,7 +415,7 @@ describe("DataSources/SampledPositionProperty", function () { }); expect(property.getValue(epoch)).toEqual(new Cartesian3(7, 8, 9)); expect(property.getValue(new JulianDate(0, 3))).toEqual( - new Cartesian3(2, 3, 4) + new Cartesian3(2, 3, 4), ); expect(timesCalled).toEqual(1); @@ -450,7 +430,7 @@ describe("DataSources/SampledPositionProperty", function () { expect(property.getValue(time)).toEqual(value); expect( - property.getValue(JulianDate.addSeconds(time, 4, new JulianDate())) + property.getValue(JulianDate.addSeconds(time, 4, new JulianDate())), ).toBeUndefined(); }); diff --git a/packages/engine/Specs/DataSources/SampledPropertySpec.js b/packages/engine/Specs/DataSources/SampledPropertySpec.js index 8f98ee275074..3caa5d99fe6c 100644 --- a/packages/engine/Specs/DataSources/SampledPropertySpec.js +++ b/packages/engine/Specs/DataSources/SampledPropertySpec.js @@ -178,7 +178,7 @@ describe("DataSources/SampledProperty", function () { new TimeInterval({ start: times[1], stop: times[3], - }) + }), ); expect(listener).toHaveBeenCalledWith(property); @@ -201,7 +201,7 @@ describe("DataSources/SampledProperty", function () { new TimeInterval({ start: JulianDate.addSeconds(times[1], 4, new JulianDate()), stop: times[3], - }) + }), ); expect(listener).toHaveBeenCalledWith(property); @@ -219,7 +219,7 @@ describe("DataSources/SampledProperty", function () { new TimeInterval({ start: JulianDate.addSeconds(times[1], 4, new JulianDate()), stop: JulianDate.addSeconds(times[3], -4, new JulianDate()), - }) + }), ); expect(listener).toHaveBeenCalledWith(property); @@ -260,7 +260,7 @@ describe("DataSources/SampledProperty", function () { stop: times[3], isStartIncluded: false, isStopIncluded: true, - }) + }), ); expect(listener).toHaveBeenCalledWith(property); @@ -278,7 +278,7 @@ describe("DataSources/SampledProperty", function () { stop: times[3], isStartIncluded: true, isStopIncluded: false, - }) + }), ); expect(listener).toHaveBeenCalledWith(property); @@ -296,7 +296,7 @@ describe("DataSources/SampledProperty", function () { stop: times[3], isStartIncluded: false, isStopIncluded: false, - }) + }), ); expect(listener).toHaveBeenCalledWith(property); @@ -324,7 +324,7 @@ describe("DataSources/SampledProperty", function () { packedArray, startingIndex, lastIndex, - result + result, ) { for (let i = 0, len = lastIndex - startingIndex + 1; i < len; i++) { const offset = i * 2; @@ -338,7 +338,7 @@ describe("DataSources/SampledProperty", function () { sourceArray, firstIndex, lastIndex, - result + result, ) { if (!defined(result)) { result = new CustomType(); @@ -427,7 +427,7 @@ describe("DataSources/SampledProperty", function () { expect(property.getValue(time)).toEqual(value); expect( - property.getValue(JulianDate.addSeconds(time, 4, new JulianDate())) + property.getValue(JulianDate.addSeconds(time, 4, new JulianDate())), ).toBeUndefined(); }); @@ -601,51 +601,15 @@ describe("DataSources/SampledProperty", function () { { epoch: JulianDate.fromIso8601("20130205T150405.704999999999927Z"), values: [ - 0.0, - 1, - 120.0, - 2, - 240.0, - 3, - 360.0, - 4, - 480.0, - 6, - 600.0, - 8, - 720.0, - 10, - 840.0, - 12, - 960.0, - 14, - 1080.0, - 16, + 0.0, 1, 120.0, 2, 240.0, 3, 360.0, 4, 480.0, 6, 600.0, 8, 720.0, 10, + 840.0, 12, 960.0, 14, 1080.0, 16, ], }, { epoch: JulianDate.fromIso8601("20130205T151151.60499999999956Z"), values: [ - 0.0, - 5, - 120.0, - 7, - 240.0, - 9, - 360.0, - 11, - 480.0, - 13, - 600.0, - 15, - 720.0, - 17, - 840.0, - 18, - 960.0, - 19, - 1080.0, - 20, + 0.0, 5, 120.0, 7, 240.0, 9, 360.0, 11, 480.0, 13, 600.0, 15, 720.0, 17, + 840.0, 18, 960.0, 19, 1080.0, 20, ], }, ]; @@ -658,14 +622,14 @@ describe("DataSources/SampledProperty", function () { times, values, interwovenData[0].values, - 1 + 1, ); SampledProperty._mergeNewSamples( interwovenData[1].epoch, times, values, interwovenData[1].values, - 1 + 1, ); for (let i = 0; i < values.length; i++) { expect(values[i]).toBe(i + 1); @@ -759,16 +723,9 @@ describe("DataSources/SampledProperty", function () { //The remaining tests were verified with STK Components available from http://www.agi.com. it("addSample works with multiple derivatives", function () { const results = [ - 0, - -3.39969163485071, - 0.912945250727628, - -6.17439797860995, - 0.745113160479349, - -1.63963048028446, - -0.304810621102217, - 4.83619040459681, - -0.993888653923375, - 169.448966391543, + 0, -3.39969163485071, 0.912945250727628, -6.17439797860995, + 0.745113160479349, -1.63963048028446, -0.304810621102217, + 4.83619040459681, -0.993888653923375, 169.448966391543, ]; const property = new SampledProperty(Number, [Number, Number]); @@ -782,17 +739,17 @@ describe("DataSources/SampledProperty", function () { property.addSample( JulianDate.addSeconds(epoch, x, new JulianDate()), Math.sin(x), - [Math.cos(x), -Math.sin(x)] + [Math.cos(x), -Math.sin(x)], ); } let resultIndex = 0; for (let i = 0; i < 100; i += 10) { const result = property.getValue( - JulianDate.addSeconds(epoch, i, new JulianDate()) + JulianDate.addSeconds(epoch, i, new JulianDate()), ); expect(result).toEqualEpsilon( results[resultIndex++], - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); } }); @@ -893,11 +850,11 @@ describe("DataSources/SampledProperty", function () { let resultIndex = 0; for (let i = 0; i < 420; i += 20) { const result = property.getValue( - JulianDate.addSeconds(epoch, i, new JulianDate()) + JulianDate.addSeconds(epoch, i, new JulianDate()), ); expect(result).toEqualEpsilon( order1Results[resultIndex++], - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); } }); @@ -916,11 +873,11 @@ describe("DataSources/SampledProperty", function () { let resultIndex = 0; for (let i = 0; i < 420; i += 20) { const result = property.getValue( - JulianDate.addSeconds(epoch, i, new JulianDate()) + JulianDate.addSeconds(epoch, i, new JulianDate()), ); expect(result).toEqualEpsilon( order0Results[resultIndex++], - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); } }); @@ -936,11 +893,11 @@ describe("DataSources/SampledProperty", function () { let resultIndex = 0; for (let i = 0; i < 420; i += 20) { const result = property.getValue( - JulianDate.addSeconds(epoch, i, new JulianDate()) + JulianDate.addSeconds(epoch, i, new JulianDate()), ); expect(result).toEqualEpsilon( order1Results[resultIndex++], - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); } }); @@ -956,11 +913,11 @@ describe("DataSources/SampledProperty", function () { let resultIndex = 0; for (let i = 0; i < 420; i += 20) { const result = property.getValue( - JulianDate.addSeconds(epoch, i, new JulianDate()) + JulianDate.addSeconds(epoch, i, new JulianDate()), ); expect(result).toEqualEpsilon( order0Results[resultIndex++], - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); } }); @@ -983,11 +940,11 @@ describe("DataSources/SampledProperty", function () { let resultIndex = 0; for (let i = 0; i < 420; i += 20) { const result = property.getValue( - JulianDate.addSeconds(epoch, i, new JulianDate()) + JulianDate.addSeconds(epoch, i, new JulianDate()), ); expect(result).toEqualEpsilon( order1Results[resultIndex++], - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); } }); @@ -1009,11 +966,11 @@ describe("DataSources/SampledProperty", function () { let resultIndex = 0; for (let i = 0; i < 420; i += 20) { const result = property.getValue( - JulianDate.addSeconds(epoch, i, new JulianDate()) + JulianDate.addSeconds(epoch, i, new JulianDate()), ); expect(result).toEqualEpsilon( order0Results[resultIndex++], - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); } }); diff --git a/packages/engine/Specs/DataSources/StaticGeometryColorBatchSpec.js b/packages/engine/Specs/DataSources/StaticGeometryColorBatchSpec.js index 379410a2a3b8..1f543e7307f4 100644 --- a/packages/engine/Specs/DataSources/StaticGeometryColorBatchSpec.js +++ b/packages/engine/Specs/DataSources/StaticGeometryColorBatchSpec.js @@ -38,7 +38,7 @@ describe("DataSources/StaticGeometryColorBatch", function () { PerInstanceColorAppearance, undefined, false, - ShadowMode.DISABLED + ShadowMode.DISABLED, ); const entity = new Entity({ @@ -95,7 +95,7 @@ describe("DataSources/StaticGeometryColorBatch", function () { TimeInterval.fromIso8601({ iso8601: "2018-02-14T04:00:00+1100/2018-02-14T04:15:00+1100", data: Color.RED, - }) + }), ); const entity = new Entity({ availability: new TimeIntervalCollection([ @@ -117,7 +117,7 @@ describe("DataSources/StaticGeometryColorBatch", function () { PerInstanceColorAppearance, undefined, false, - ShadowMode.DISABLED + ShadowMode.DISABLED, ); const updater = new EllipseGeometryUpdater(entity, scene); @@ -153,7 +153,7 @@ describe("DataSources/StaticGeometryColorBatch", function () { TimeInterval.fromIso8601({ iso8601: "2018-02-14T04:00:00+1100/2018-02-14T04:15:00+1100", data: new DistanceDisplayCondition(1.0, 2.0), - }) + }), ); const entity = new Entity({ availability: new TimeIntervalCollection([ @@ -176,7 +176,7 @@ describe("DataSources/StaticGeometryColorBatch", function () { PerInstanceColorAppearance, undefined, false, - ShadowMode.DISABLED + ShadowMode.DISABLED, ); const updater = new EllipseGeometryUpdater(entity, scene); @@ -193,7 +193,7 @@ describe("DataSources/StaticGeometryColorBatch", function () { let attributes = primitive.getGeometryInstanceAttributes(entity); expect(attributes.distanceDisplayCondition).toEqualEpsilon( [1.0, 2.0], - CesiumMath.EPSILON6 + CesiumMath.EPSILON6, ); batch.update(outOfRangeTime); @@ -215,7 +215,7 @@ describe("DataSources/StaticGeometryColorBatch", function () { TimeInterval.fromIso8601({ iso8601: "2018-02-14T04:00:00+1100/2018-02-14T04:15:00+1100", data: true, - }) + }), ); const entity = new Entity({ availability: new TimeIntervalCollection([ @@ -237,7 +237,7 @@ describe("DataSources/StaticGeometryColorBatch", function () { PerInstanceColorAppearance, undefined, false, - ShadowMode.DISABLED + ShadowMode.DISABLED, ); const updater = new EllipseGeometryUpdater(entity, scene); @@ -271,7 +271,7 @@ describe("DataSources/StaticGeometryColorBatch", function () { PolylineColorAppearance, undefined, false, - ShadowMode.DISABLED + ShadowMode.DISABLED, ); const entity = new Entity({ @@ -323,7 +323,7 @@ describe("DataSources/StaticGeometryColorBatch", function () { TimeInterval.fromIso8601({ iso8601: "2018-02-14T04:00:00+1100/2018-02-14T04:15:00+1100", data: Color.RED, - }) + }), ); const entity = new Entity({ availability: new TimeIntervalCollection([ @@ -346,7 +346,7 @@ describe("DataSources/StaticGeometryColorBatch", function () { PolylineColorAppearance, PolylineColorAppearance, false, - ShadowMode.DISABLED + ShadowMode.DISABLED, ); const updater = new PolylineGeometryUpdater(entity, scene); @@ -380,7 +380,7 @@ describe("DataSources/StaticGeometryColorBatch", function () { PerInstanceColorAppearance, undefined, false, - ShadowMode.DISABLED + ShadowMode.DISABLED, ); function buildEntity() { @@ -448,7 +448,7 @@ describe("DataSources/StaticGeometryColorBatch", function () { PerInstanceColorAppearance, undefined, false, - ShadowMode.DISABLED + ShadowMode.DISABLED, ); function buildEntity() { diff --git a/packages/engine/Specs/DataSources/StaticGeometryPerMaterialBatchSpec.js b/packages/engine/Specs/DataSources/StaticGeometryPerMaterialBatchSpec.js index ea0933a13dfd..de2af7f170fa 100644 --- a/packages/engine/Specs/DataSources/StaticGeometryPerMaterialBatchSpec.js +++ b/packages/engine/Specs/DataSources/StaticGeometryPerMaterialBatchSpec.js @@ -48,7 +48,7 @@ describe("DataSources/StaticGeometryPerMaterialBatch", function () { MaterialAppearance, undefined, false, - ShadowMode.DISABLED + ShadowMode.DISABLED, ); const ellipse = new EllipseGraphics(); @@ -58,7 +58,7 @@ describe("DataSources/StaticGeometryPerMaterialBatch", function () { const entity = new Entity(); entity.position = new ConstantPositionProperty( - new Cartesian3(1234, 5678, 9101112) + new Cartesian3(1234, 5678, 9101112), ); entity.ellipse = ellipse; @@ -69,7 +69,7 @@ describe("DataSources/StaticGeometryPerMaterialBatch", function () { const entity2 = new Entity(); entity2.position = new ConstantPositionProperty( - new Cartesian3(1234, 5678, 9101112) + new Cartesian3(1234, 5678, 9101112), ); entity2.ellipse = ellipse2; @@ -107,7 +107,7 @@ describe("DataSources/StaticGeometryPerMaterialBatch", function () { TimeInterval.fromIso8601({ iso8601: "2018-02-14T04:00:00+1100/2018-02-14T04:15:00+1100", data: new DistanceDisplayCondition(1.0, 2.0), - }) + }), ); const entity = new Entity({ availability: new TimeIntervalCollection([ @@ -130,7 +130,7 @@ describe("DataSources/StaticGeometryPerMaterialBatch", function () { MaterialAppearance, undefined, false, - ShadowMode.DISABLED + ShadowMode.DISABLED, ); const updater = new EllipseGeometryUpdater(entity, scene); @@ -147,7 +147,7 @@ describe("DataSources/StaticGeometryPerMaterialBatch", function () { let attributes = primitive.getGeometryInstanceAttributes(entity); expect(attributes.distanceDisplayCondition).toEqualEpsilon( [1.0, 2.0], - CesiumMath.EPSILON6 + CesiumMath.EPSILON6, ); batch.update(outOfRangeTime); @@ -169,7 +169,7 @@ describe("DataSources/StaticGeometryPerMaterialBatch", function () { TimeInterval.fromIso8601({ iso8601: "2018-02-14T04:00:00+1100/2018-02-14T04:15:00+1100", data: true, - }) + }), ); const entity = new Entity({ availability: new TimeIntervalCollection([ @@ -192,7 +192,7 @@ describe("DataSources/StaticGeometryPerMaterialBatch", function () { MaterialAppearance, undefined, false, - ShadowMode.DISABLED + ShadowMode.DISABLED, ); const updater = new EllipseGeometryUpdater(entity, scene); @@ -226,7 +226,7 @@ describe("DataSources/StaticGeometryPerMaterialBatch", function () { PolylineMaterialAppearance, undefined, false, - ShadowMode.DISABLED + ShadowMode.DISABLED, ); const polyline = new PolylineGraphics(); @@ -282,7 +282,7 @@ describe("DataSources/StaticGeometryPerMaterialBatch", function () { TimeInterval.fromIso8601({ iso8601: "2018-02-14T04:00:00+1100/2018-02-14T04:15:00+1100", data: Color.RED, - }) + }), ); const entity = new Entity({ availability: new TimeIntervalCollection([ @@ -305,7 +305,7 @@ describe("DataSources/StaticGeometryPerMaterialBatch", function () { PolylineMaterialAppearance, PolylineColorAppearance, false, - ShadowMode.DISABLED + ShadowMode.DISABLED, ); const updater = new PolylineGeometryUpdater(entity, scene); @@ -339,7 +339,7 @@ describe("DataSources/StaticGeometryPerMaterialBatch", function () { MaterialAppearance, undefined, false, - ShadowMode.DISABLED + ShadowMode.DISABLED, ); function buildEntity() { @@ -415,7 +415,7 @@ describe("DataSources/StaticGeometryPerMaterialBatch", function () { MaterialAppearance, undefined, false, - ShadowMode.DISABLED + ShadowMode.DISABLED, ); function buildEntity(MaterialProperty) { @@ -481,7 +481,7 @@ describe("DataSources/StaticGeometryPerMaterialBatch", function () { MaterialAppearance, undefined, false, - ShadowMode.DISABLED + ShadowMode.DISABLED, ); function buildEntity() { diff --git a/packages/engine/Specs/DataSources/StaticGroundGeometryColorBatchSpec.js b/packages/engine/Specs/DataSources/StaticGroundGeometryColorBatchSpec.js index 24711775a350..7fcd76449690 100644 --- a/packages/engine/Specs/DataSources/StaticGroundGeometryColorBatchSpec.js +++ b/packages/engine/Specs/DataSources/StaticGroundGeometryColorBatchSpec.js @@ -45,7 +45,7 @@ describe("DataSources/StaticGroundGeometryColorBatch", function () { const batch = new StaticGroundGeometryColorBatch( scene.groundPrimitives, - ClassificationType.BOTH + ClassificationType.BOTH, ); const entity = new Entity({ position: new Cartesian3(1234, 5678, 9101112), @@ -108,7 +108,7 @@ describe("DataSources/StaticGroundGeometryColorBatch", function () { const batch = new StaticGroundGeometryColorBatch( scene.groundPrimitives, - ClassificationType.BOTH + ClassificationType.BOTH, ); const entity = new Entity({ position: new Cartesian3(1234, 5678, 9101112), @@ -151,7 +151,7 @@ describe("DataSources/StaticGroundGeometryColorBatch", function () { TimeInterval.fromIso8601({ iso8601: "2018-02-14T04:00:00+1100/2018-02-14T04:15:00+1100", data: new DistanceDisplayCondition(1.0, 2.0), - }) + }), ); const entity = new Entity({ availability: new TimeIntervalCollection([ @@ -170,7 +170,7 @@ describe("DataSources/StaticGroundGeometryColorBatch", function () { const batch = new StaticGroundGeometryColorBatch( scene.groundPrimitives, - ClassificationType.BOTH + ClassificationType.BOTH, ); const updater = new EllipseGeometryUpdater(entity, scene); @@ -187,7 +187,7 @@ describe("DataSources/StaticGroundGeometryColorBatch", function () { let attributes = primitive.getGeometryInstanceAttributes(entity); expect(attributes.distanceDisplayCondition).toEqualEpsilon( [1.0, 2.0], - CesiumMath.EPSILON6 + CesiumMath.EPSILON6, ); batch.update(outOfRangeTime); @@ -209,7 +209,7 @@ describe("DataSources/StaticGroundGeometryColorBatch", function () { TimeInterval.fromIso8601({ iso8601: "2018-02-14T04:00:00+1100/2018-02-14T04:15:00+1100", data: true, - }) + }), ); const entity = new Entity({ availability: new TimeIntervalCollection([ @@ -228,7 +228,7 @@ describe("DataSources/StaticGroundGeometryColorBatch", function () { const batch = new StaticGroundGeometryColorBatch( scene.groundPrimitives, - ClassificationType.BOTH + ClassificationType.BOTH, ); const updater = new EllipseGeometryUpdater(entity, scene); @@ -263,7 +263,7 @@ describe("DataSources/StaticGroundGeometryColorBatch", function () { const batch = new StaticGroundGeometryColorBatch( scene.groundPrimitives, - ClassificationType.BOTH + ClassificationType.BOTH, ); function renderScene() { @@ -338,7 +338,7 @@ describe("DataSources/StaticGroundGeometryColorBatch", function () { const batch = new StaticGroundGeometryColorBatch( scene.groundPrimitives, - ClassificationType.BOTH + ClassificationType.BOTH, ); function renderScene() { diff --git a/packages/engine/Specs/DataSources/StaticGroundGeometryPerMaterialBatchSpec.js b/packages/engine/Specs/DataSources/StaticGroundGeometryPerMaterialBatchSpec.js index 6f7ceb39ab53..f491e0752398 100644 --- a/packages/engine/Specs/DataSources/StaticGroundGeometryPerMaterialBatchSpec.js +++ b/packages/engine/Specs/DataSources/StaticGroundGeometryPerMaterialBatchSpec.js @@ -54,7 +54,7 @@ describe("DataSources/StaticGroundGeometryPerMaterialBatch", function () { const batch = new StaticGroundGeometryPerMaterialBatch( scene.primitives, ClassificationType.BOTH, - MaterialAppearance + MaterialAppearance, ); const ellipse = new EllipseGraphics(); @@ -121,7 +121,7 @@ describe("DataSources/StaticGroundGeometryPerMaterialBatch", function () { TimeInterval.fromIso8601({ iso8601: "2018-02-14T04:00:00+1100/2018-02-14T04:15:00+1100", data: new DistanceDisplayCondition(1.0, 2.0), - }) + }), ); const entity = new Entity({ availability: new TimeIntervalCollection([ @@ -141,7 +141,7 @@ describe("DataSources/StaticGroundGeometryPerMaterialBatch", function () { const batch = new StaticGroundGeometryPerMaterialBatch( scene.primitives, ClassificationType.BOTH, - MaterialAppearance + MaterialAppearance, ); const updater = new EllipseGeometryUpdater(entity, scene); @@ -158,7 +158,7 @@ describe("DataSources/StaticGroundGeometryPerMaterialBatch", function () { let attributes = primitive.getGeometryInstanceAttributes(entity); expect(attributes.distanceDisplayCondition).toEqualEpsilon( [1.0, 2.0], - CesiumMath.EPSILON6 + CesiumMath.EPSILON6, ); batch.update(outOfRangeTime); @@ -188,7 +188,7 @@ describe("DataSources/StaticGroundGeometryPerMaterialBatch", function () { TimeInterval.fromIso8601({ iso8601: "2018-02-14T04:00:00+1100/2018-02-14T04:15:00+1100", data: true, - }) + }), ); const entity = new Entity({ availability: new TimeIntervalCollection([ @@ -208,7 +208,7 @@ describe("DataSources/StaticGroundGeometryPerMaterialBatch", function () { const batch = new StaticGroundGeometryPerMaterialBatch( scene.primitives, ClassificationType.BOTH, - MaterialAppearance + MaterialAppearance, ); const updater = new EllipseGeometryUpdater(entity, scene); @@ -248,7 +248,7 @@ describe("DataSources/StaticGroundGeometryPerMaterialBatch", function () { const batch = new StaticGroundGeometryPerMaterialBatch( scene.primitives, ClassificationType.BOTH, - MaterialAppearance + MaterialAppearance, ); function buildEntity(x, y, z) { @@ -329,7 +329,7 @@ describe("DataSources/StaticGroundGeometryPerMaterialBatch", function () { const batch = new StaticGroundGeometryPerMaterialBatch( scene.primitives, ClassificationType.BOTH, - MaterialAppearance + MaterialAppearance, ); const ellipse = new EllipseGraphics(); @@ -381,7 +381,7 @@ describe("DataSources/StaticGroundGeometryPerMaterialBatch", function () { const batch = new StaticGroundGeometryPerMaterialBatch( scene.primitives, ClassificationType.BOTH, - MaterialAppearance + MaterialAppearance, ); const entity = new Entity({ position: new Cartesian3(1234, 5678, 9101112), @@ -434,7 +434,7 @@ describe("DataSources/StaticGroundGeometryPerMaterialBatch", function () { const batch = new StaticGroundGeometryPerMaterialBatch( scene.primitives, ClassificationType.BOTH, - MaterialAppearance + MaterialAppearance, ); function buildEntity(x, y, z) { diff --git a/packages/engine/Specs/DataSources/StaticGroundPolylinePerMaterialBatchSpec.js b/packages/engine/Specs/DataSources/StaticGroundPolylinePerMaterialBatchSpec.js index 32ade306d4fd..e3e05bc22f1b 100644 --- a/packages/engine/Specs/DataSources/StaticGroundPolylinePerMaterialBatchSpec.js +++ b/packages/engine/Specs/DataSources/StaticGroundPolylinePerMaterialBatchSpec.js @@ -56,7 +56,7 @@ describe("DataSources/StaticGroundPolylinePerMaterialBatch", function () { const polyline = new PolylineGraphics(); polyline.clampToGround = new ConstantProperty(true); polyline.positions = new ConstantProperty( - Cartesian3.fromDegreesArray([0, 0, 0.1, 0, 0.1, 0.1, 0, 0.1]) + Cartesian3.fromDegreesArray([0, 0, 0.1, 0, 0.1, 0.1, 0, 0.1]), ); return polyline; } @@ -70,7 +70,7 @@ describe("DataSources/StaticGroundPolylinePerMaterialBatch", function () { batch = new StaticGroundPolylinePerMaterialBatch( scene.groundPrimitives, ClassificationType.BOTH, - false + false, ); const polyline1 = createGroundPolyline(); @@ -125,7 +125,7 @@ describe("DataSources/StaticGroundPolylinePerMaterialBatch", function () { TimeInterval.fromIso8601({ iso8601: "2018-02-14T04:00:00+1100/2018-02-14T04:15:00+1100", data: Color.RED, - }) + }), ); const polyline = createGroundPolyline(); polyline.material = new ColorMaterialProperty(color); @@ -141,7 +141,7 @@ describe("DataSources/StaticGroundPolylinePerMaterialBatch", function () { batch = new StaticGroundPolylinePerMaterialBatch( scene.groundPrimitives, ClassificationType.BOTH, - false + false, ); const updater = new PolylineGeometryUpdater(entity, scene); @@ -181,7 +181,7 @@ describe("DataSources/StaticGroundPolylinePerMaterialBatch", function () { TimeInterval.fromIso8601({ iso8601: "2018-02-14T04:00:00+1100/2018-02-14T04:15:00+1100", data: new DistanceDisplayCondition(1.0, 2.0), - }) + }), ); const polyline = createGroundPolyline(); @@ -198,7 +198,7 @@ describe("DataSources/StaticGroundPolylinePerMaterialBatch", function () { batch = new StaticGroundPolylinePerMaterialBatch( scene.groundPrimitives, ClassificationType.BOTH, - false + false, ); const updater = new PolylineGeometryUpdater(entity, scene); @@ -215,7 +215,7 @@ describe("DataSources/StaticGroundPolylinePerMaterialBatch", function () { let attributes = primitive.getGeometryInstanceAttributes(entity); expect(attributes.distanceDisplayCondition).toEqualEpsilon( [1.0, 2.0], - CesiumMath.EPSILON6 + CesiumMath.EPSILON6, ); batch.update(outOfRangeTime); @@ -242,7 +242,7 @@ describe("DataSources/StaticGroundPolylinePerMaterialBatch", function () { TimeInterval.fromIso8601({ iso8601: "2018-02-14T04:00:00+1100/2018-02-14T04:15:00+1100", data: true, - }) + }), ); const polyline = createGroundPolyline(); polyline.show = show; @@ -257,7 +257,7 @@ describe("DataSources/StaticGroundPolylinePerMaterialBatch", function () { batch = new StaticGroundPolylinePerMaterialBatch( scene.groundPrimitives, - false + false, ); const updater = new PolylineGeometryUpdater(entity, scene); @@ -294,7 +294,7 @@ describe("DataSources/StaticGroundPolylinePerMaterialBatch", function () { batch = new StaticGroundPolylinePerMaterialBatch( scene.groundPrimitives, ClassificationType.BOTH, - false + false, ); function buildEntity() { @@ -367,7 +367,7 @@ describe("DataSources/StaticGroundPolylinePerMaterialBatch", function () { batch = new StaticGroundPolylinePerMaterialBatch( scene.groundPrimitives, ClassificationType.BOTH, - false + false, ); const polyline1 = createGroundPolyline(); polyline1.material = Color.RED; @@ -407,7 +407,7 @@ describe("DataSources/StaticGroundPolylinePerMaterialBatch", function () { batch = new StaticGroundPolylinePerMaterialBatch( scene.groundPrimitives, ClassificationType.BOTH, - false + false, ); const polyline1 = createGroundPolyline(); @@ -452,7 +452,7 @@ describe("DataSources/StaticGroundPolylinePerMaterialBatch", function () { batch = new StaticGroundPolylinePerMaterialBatch( scene.groundPrimitives, ClassificationType.BOTH, - false + false, ); const polyline1 = createGroundPolyline(); @@ -499,7 +499,7 @@ describe("DataSources/StaticGroundPolylinePerMaterialBatch", function () { batch = new StaticGroundPolylinePerMaterialBatch( scene.groundPrimitives, ClassificationType.BOTH, - false + false, ); const polyline1 = createGroundPolyline(); @@ -543,7 +543,7 @@ describe("DataSources/StaticGroundPolylinePerMaterialBatch", function () { batch = new StaticGroundPolylinePerMaterialBatch( scene.groundPrimitives, ClassificationType.BOTH, - false + false, ); function buildEntity() { diff --git a/packages/engine/Specs/DataSources/StaticOutlineGeometryBatchSpec.js b/packages/engine/Specs/DataSources/StaticOutlineGeometryBatchSpec.js index 3af4d26484ab..a71a1e04c255 100644 --- a/packages/engine/Specs/DataSources/StaticOutlineGeometryBatchSpec.js +++ b/packages/engine/Specs/DataSources/StaticOutlineGeometryBatchSpec.js @@ -33,7 +33,7 @@ describe("DataSources/StaticOutlineGeometryBatch", function () { scene.primitives, scene, false, - ShadowMode.DISABLED + ShadowMode.DISABLED, ); const entity = new Entity({ @@ -91,7 +91,7 @@ describe("DataSources/StaticOutlineGeometryBatch", function () { TimeInterval.fromIso8601({ iso8601: "2018-02-14T04:00:00+1100/2018-02-14T04:15:00+1100", data: Color.RED, - }) + }), ); const entity = new Entity({ availability: new TimeIntervalCollection([ @@ -113,7 +113,7 @@ describe("DataSources/StaticOutlineGeometryBatch", function () { scene.primitives, scene, false, - ShadowMode.DISABLED + ShadowMode.DISABLED, ); const updater = new EllipseGeometryUpdater(entity, scene); @@ -149,7 +149,7 @@ describe("DataSources/StaticOutlineGeometryBatch", function () { TimeInterval.fromIso8601({ iso8601: "2018-02-14T04:00:00+1100/2018-02-14T04:15:00+1100", data: new DistanceDisplayCondition(1.0, 2.0), - }) + }), ); const entity = new Entity({ availability: new TimeIntervalCollection([ @@ -172,7 +172,7 @@ describe("DataSources/StaticOutlineGeometryBatch", function () { scene.primitives, scene, false, - ShadowMode.DISABLED + ShadowMode.DISABLED, ); const updater = new EllipseGeometryUpdater(entity, scene); @@ -189,7 +189,7 @@ describe("DataSources/StaticOutlineGeometryBatch", function () { let attributes = primitive.getGeometryInstanceAttributes(entity); expect(attributes.distanceDisplayCondition).toEqualEpsilon( [1.0, 2.0], - CesiumMath.EPSILON6 + CesiumMath.EPSILON6, ); batch.update(outOfRangeTime); @@ -211,7 +211,7 @@ describe("DataSources/StaticOutlineGeometryBatch", function () { TimeInterval.fromIso8601({ iso8601: "2018-02-14T04:00:00+1100/2018-02-14T04:15:00+1100", data: true, - }) + }), ); const entity = new Entity({ availability: new TimeIntervalCollection([ @@ -233,7 +233,7 @@ describe("DataSources/StaticOutlineGeometryBatch", function () { scene.primitives, scene, false, - ShadowMode.DISABLED + ShadowMode.DISABLED, ); const updater = new EllipseGeometryUpdater(entity, scene); @@ -266,7 +266,7 @@ describe("DataSources/StaticOutlineGeometryBatch", function () { scene.primitives, scene, false, - ShadowMode.DISABLED + ShadowMode.DISABLED, ); function buildEntity() { @@ -335,7 +335,7 @@ describe("DataSources/StaticOutlineGeometryBatch", function () { scene.primitives, scene, false, - ShadowMode.DISABLED + ShadowMode.DISABLED, ); function buildEntity() { diff --git a/packages/engine/Specs/DataSources/StripeMaterialPropertySpec.js b/packages/engine/Specs/DataSources/StripeMaterialPropertySpec.js index 8d1f055a853b..94bdb5505fb0 100644 --- a/packages/engine/Specs/DataSources/StripeMaterialPropertySpec.js +++ b/packages/engine/Specs/DataSources/StripeMaterialPropertySpec.js @@ -83,35 +83,35 @@ describe("DataSources/StripeMaterialProperty", function () { start: start, stop: stop, data: false, - }) + }), ); property.evenColor.intervals.addInterval( new TimeInterval({ start: start, stop: stop, data: Color.RED, - }) + }), ); property.oddColor.intervals.addInterval( new TimeInterval({ start: start, stop: stop, data: Color.BLUE, - }) + }), ); property.offset.intervals.addInterval( new TimeInterval({ start: start, stop: stop, data: 10, - }) + }), ); property.repeat.intervals.addInterval( new TimeInterval({ start: start, stop: stop, data: 20, - }) + }), ); expect(property.isConstant).toBe(false); diff --git a/packages/engine/Specs/DataSources/TerrainOffsetPropertySpec.js b/packages/engine/Specs/DataSources/TerrainOffsetPropertySpec.js index 880d682978f7..8a444e67b524 100644 --- a/packages/engine/Specs/DataSources/TerrainOffsetPropertySpec.js +++ b/packages/engine/Specs/DataSources/TerrainOffsetPropertySpec.js @@ -29,7 +29,7 @@ describe("DataSources/TerrainOffsetProperty", function () { scene, position, height, - extrudedHeight + extrudedHeight, ); expect(property.isConstant).toBe(false); expect(property.getValue(time)).toEqual(Cartesian3.ZERO); @@ -46,7 +46,7 @@ describe("DataSources/TerrainOffsetProperty", function () { undefined, position, height, - extrudedHeight + extrudedHeight, ); }).toThrowDeveloperError(); }); @@ -59,7 +59,7 @@ describe("DataSources/TerrainOffsetProperty", function () { scene, undefined, height, - extrudedHeight + extrudedHeight, ); }).toThrowDeveloperError(); }); diff --git a/packages/engine/Specs/DataSources/TimeIntervalCollectionPositionPropertySpec.js b/packages/engine/Specs/DataSources/TimeIntervalCollectionPositionPropertySpec.js index ca98185ffac1..b5d3687b3fc7 100644 --- a/packages/engine/Specs/DataSources/TimeIntervalCollectionPositionPropertySpec.js +++ b/packages/engine/Specs/DataSources/TimeIntervalCollectionPositionPropertySpec.js @@ -77,7 +77,7 @@ describe("DataSources/TimeIntervalCollectionPositionProperty", function () { }); const property = new TimeIntervalCollectionPositionProperty( - ReferenceFrame.INERTIAL + ReferenceFrame.INERTIAL, ); property.intervals.addInterval(interval1); @@ -86,7 +86,7 @@ describe("DataSources/TimeIntervalCollectionPositionProperty", function () { interval1.start, valueInertial, ReferenceFrame.INERTIAL, - ReferenceFrame.FIXED + ReferenceFrame.FIXED, ); const result = property.getValue(interval1.start); @@ -107,7 +107,7 @@ describe("DataSources/TimeIntervalCollectionPositionProperty", function () { }); const property = new TimeIntervalCollectionPositionProperty( - ReferenceFrame.FIXED + ReferenceFrame.FIXED, ); property.intervals.addInterval(interval1); property.intervals.addInterval(interval2); @@ -116,14 +116,14 @@ describe("DataSources/TimeIntervalCollectionPositionProperty", function () { interval1.start, interval1.data, ReferenceFrame.FIXED, - ReferenceFrame.INERTIAL + ReferenceFrame.INERTIAL, ); const expected = new Cartesian3(); const result1 = property.getValueInReferenceFrame( interval1.start, ReferenceFrame.INERTIAL, - expected + expected, ); expect(result1).toBe(expected); expect(result1).toEqual(valueInertial); @@ -131,7 +131,7 @@ describe("DataSources/TimeIntervalCollectionPositionProperty", function () { const result2 = property.getValueInReferenceFrame( interval2.stop, ReferenceFrame.FIXED, - expected + expected, ); expect(result2).toBe(expected); expect(result2).toEqual(interval2.data); @@ -151,7 +151,7 @@ describe("DataSources/TimeIntervalCollectionPositionProperty", function () { }); const property = new TimeIntervalCollectionPositionProperty( - ReferenceFrame.FIXED + ReferenceFrame.FIXED, ); property.intervals.addInterval(interval1); property.intervals.addInterval(interval2); @@ -160,18 +160,18 @@ describe("DataSources/TimeIntervalCollectionPositionProperty", function () { interval1.start, interval1.data, ReferenceFrame.FIXED, - ReferenceFrame.INERTIAL + ReferenceFrame.INERTIAL, ); const result1 = property.getValueInReferenceFrame( interval1.start, - ReferenceFrame.INERTIAL + ReferenceFrame.INERTIAL, ); expect(result1).toEqual(valueInertial); const result2 = property.getValueInReferenceFrame( interval2.stop, - ReferenceFrame.FIXED + ReferenceFrame.FIXED, ); expect(result2).toEqual(interval2.data); }); @@ -207,10 +207,10 @@ describe("DataSources/TimeIntervalCollectionPositionProperty", function () { it("equals works for differing referenceFrames", function () { const left = new TimeIntervalCollectionPositionProperty( - ReferenceFrame.FIXED + ReferenceFrame.FIXED, ); let right = new TimeIntervalCollectionPositionProperty( - ReferenceFrame.INERTIAL + ReferenceFrame.INERTIAL, ); expect(left.equals(right)).toEqual(false); @@ -232,13 +232,13 @@ describe("DataSources/TimeIntervalCollectionPositionProperty", function () { }); const left = new TimeIntervalCollectionPositionProperty( - ReferenceFrame.FIXED + ReferenceFrame.FIXED, ); left.intervals.addInterval(interval1); left.intervals.addInterval(interval2); const right = new TimeIntervalCollectionPositionProperty( - ReferenceFrame.FIXED + ReferenceFrame.FIXED, ); right.intervals.addInterval(interval1); diff --git a/packages/engine/Specs/DataSources/VelocityOrientationPropertySpec.js b/packages/engine/Specs/DataSources/VelocityOrientationPropertySpec.js index 75228c1d99d7..ef7951711f3a 100644 --- a/packages/engine/Specs/DataSources/VelocityOrientationPropertySpec.js +++ b/packages/engine/Specs/DataSources/VelocityOrientationPropertySpec.js @@ -27,7 +27,7 @@ describe("DataSources/VelocityOrientationProperty", function () { const position = new SampledPositionProperty(); const property = new VelocityOrientationProperty( position, - Ellipsoid.UNIT_SPHERE + Ellipsoid.UNIT_SPHERE, ); expect(property.isConstant).toBe(true); expect(property.definitionChanged).toBeInstanceOf(Event); @@ -106,7 +106,7 @@ describe("DataSources/VelocityOrientationProperty", function () { const velocity = Cartesian3.subtract( values[1], values[0], - new Cartesian3() + new Cartesian3(), ); Cartesian3.normalize(velocity, velocity); @@ -117,18 +117,18 @@ describe("DataSources/VelocityOrientationProperty", function () { let matrix = Transforms.rotationMatrixFromPositionVelocity( position.getValue(times[0]), - velocity + velocity, ); expect(property.getValue(times[0])).toEqual( - Quaternion.fromRotationMatrix(matrix) + Quaternion.fromRotationMatrix(matrix), ); matrix = Transforms.rotationMatrixFromPositionVelocity( position.getValue(times[0]), - velocity + velocity, ); expect(property.getValue(times[1])).toEqual( - Quaternion.fromRotationMatrix(matrix) + Quaternion.fromRotationMatrix(matrix), ); }); @@ -141,7 +141,7 @@ describe("DataSources/VelocityOrientationProperty", function () { const velocity = Cartesian3.subtract( values[1], values[0], - new Cartesian3() + new Cartesian3(), ); Cartesian3.normalize(velocity, velocity); @@ -156,7 +156,7 @@ describe("DataSources/VelocityOrientationProperty", function () { const matrix = Transforms.rotationMatrixFromPositionVelocity( position.getValue(times[0]), - velocity + velocity, ); expect(expected).toEqual(Quaternion.fromRotationMatrix(matrix)); }); diff --git a/packages/engine/Specs/DataSources/VelocityVectorPropertySpec.js b/packages/engine/Specs/DataSources/VelocityVectorPropertySpec.js index c9d59660e9cc..4e059ecad6d0 100644 --- a/packages/engine/Specs/DataSources/VelocityVectorPropertySpec.js +++ b/packages/engine/Specs/DataSources/VelocityVectorPropertySpec.js @@ -138,11 +138,11 @@ describe("DataSources/VelocityVectorProperty", function () { const expectedVelocity = new Cartesian3(20.0, 0.0, 0.0); expect(property.getValue(times[0])).toEqualEpsilon( expectedVelocity, - CesiumMath.EPSILON13 + CesiumMath.EPSILON13, ); expect(property.getValue(times[1])).toEqualEpsilon( expectedVelocity, - CesiumMath.EPSILON13 + CesiumMath.EPSILON13, ); }); @@ -168,7 +168,7 @@ describe("DataSources/VelocityVectorProperty", function () { it("produces normalized value of undefined with constant position", function () { const position = new ConstantPositionProperty( - new Cartesian3(1.0, 2.0, 3.0) + new Cartesian3(1.0, 2.0, 3.0), ); const property = new VelocityVectorProperty(position); @@ -177,7 +177,7 @@ describe("DataSources/VelocityVectorProperty", function () { it("produces unnormalized value of zero with constant position", function () { const position = new ConstantPositionProperty( - new Cartesian3(1.0, 2.0, 3.0) + new Cartesian3(1.0, 2.0, 3.0), ); const property = new VelocityVectorProperty(position, false); diff --git a/packages/engine/Specs/DataSources/WallGeometryUpdaterSpec.js b/packages/engine/Specs/DataSources/WallGeometryUpdaterSpec.js index 28b8261e334e..dd4249ea0956 100644 --- a/packages/engine/Specs/DataSources/WallGeometryUpdaterSpec.js +++ b/packages/engine/Specs/DataSources/WallGeometryUpdaterSpec.js @@ -40,7 +40,9 @@ describe( function createBasicWall() { const wall = new WallGraphics(); wall.positions = new ConstantProperty( - Cartesian3.fromRadiansArrayHeights([0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1]) + Cartesian3.fromRadiansArrayHeights([ + 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, + ]), ); const entity = new Entity(); entity.wall = wall; @@ -79,7 +81,7 @@ describe( start: time, stop: time2, data: [], - }) + }), ); updater._onEntityPropertyChanged(entity, "wall"); @@ -95,7 +97,7 @@ describe( start: time, stop: time2, data: [], - }) + }), ); updater._onEntityPropertyChanged(entity, "wall"); @@ -147,7 +149,7 @@ describe( it("dynamic updater sets properties", function () { const wall = new WallGraphics(); wall.positions = createDynamicProperty( - Cartesian3.fromRadiansArray([0, 0, 1, 0, 1, 1, 0, 1]) + Cartesian3.fromRadiansArray([0, 0, 1, 0, 1, 1, 0, 1]), ); wall.show = createDynamicProperty(true); wall.minimumHeights = createDynamicProperty([1, 2, 3, 4]); @@ -163,7 +165,7 @@ describe( const updater = new WallGeometryUpdater(entity, scene); const dynamicUpdater = updater.createDynamicUpdater( new PrimitiveCollection(), - new PrimitiveCollection() + new PrimitiveCollection(), ); dynamicUpdater.update(time); @@ -215,15 +217,15 @@ describe( WallGeometryUpdater, "wall", createBasicWall, - getScene + getScene, ); createDynamicGeometryUpdaterSpecs( WallGeometryUpdater, "wall", createDynamicWall, - getScene + getScene, ); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/DataSources/WallGraphicsSpec.js b/packages/engine/Specs/DataSources/WallGraphicsSpec.js index 52856fef58ce..78432a7c0615 100644 --- a/packages/engine/Specs/DataSources/WallGraphicsSpec.js +++ b/packages/engine/Specs/DataSources/WallGraphicsSpec.js @@ -55,7 +55,7 @@ describe("DataSources/WallGraphics", function () { expect(wall.maximumHeights.getValue()).toEqual(options.maximumHeights); expect(wall.shadows.getValue()).toEqual(options.shadows); expect(wall.distanceDisplayCondition.getValue()).toEqual( - options.distanceDisplayCondition + options.distanceDisplayCondition, ); }); @@ -89,7 +89,7 @@ describe("DataSources/WallGraphics", function () { expect(target.maximumHeights).toBe(source.maximumHeights); expect(target.shadows).toBe(source.shadows); expect(target.distanceDisplayCondition).toBe( - source.distanceDisplayCondition + source.distanceDisplayCondition, ); }); @@ -167,7 +167,7 @@ describe("DataSources/WallGraphics", function () { expect(result.maximumHeights).toBe(source.maximumHeights); expect(result.shadows).toBe(source.shadows); expect(result.distanceDisplayCondition).toBe( - source.distanceDisplayCondition + source.distanceDisplayCondition, ); }); @@ -194,13 +194,13 @@ describe("DataSources/WallGraphics", function () { property, "shadows", ShadowMode.ENABLED, - ShadowMode.DISABLED + ShadowMode.DISABLED, ); testDefinitionChanged( property, "distanceDisplayCondition", new DistanceDisplayCondition(), - new DistanceDisplayCondition(10.0, 100.0) + new DistanceDisplayCondition(10.0, 100.0), ); }); }); diff --git a/packages/engine/Specs/DataSources/exportKmlSpec.js b/packages/engine/Specs/DataSources/exportKmlSpec.js index 61c40af56152..f6bfc44557fe 100644 --- a/packages/engine/Specs/DataSources/exportKmlSpec.js +++ b/packages/engine/Specs/DataSources/exportKmlSpec.js @@ -55,7 +55,7 @@ describe("DataSources/exportKml", function () { } else if (typeof attribute === "number") { expect(Number(nodeAttribute.value)).toEqualEpsilon( attribute, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); } else { fail(); @@ -80,7 +80,7 @@ describe("DataSources/exportKml", function () { } else if (typeof property === "number") { expect(Number(node.textContent)).toEqualEpsilon( property, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); } else if (typeof property === "boolean") { expect(Number(node.textContent)).toBe(property ? 1 : 0); @@ -100,12 +100,12 @@ describe("DataSources/exportKml", function () { const cartographic2 = Cartographic.fromDegrees( Number(values[0]), Number(values[1]), - Number(values[2]) + Number(values[2]), ); return Cartographic.equalsEpsilon( cartographic1, cartographic2, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); } @@ -511,7 +511,7 @@ describe("DataSources/exportKml", function () { fileReader.onload = function (event) { // Verify its a zip archive expect(new DataView(event.target.result).getUint32(0, false)).toBe( - 0x504b0304 + 0x504b0304, ); resolve(); }; @@ -557,13 +557,13 @@ describe("DataSources/exportKml", function () { Number(values[0]), Number(values[1]), Number(values[2]), - cartographic2 + cartographic2, ); if ( Cartographic.equalsEpsilon( cartographic1, cartographic2, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ) ) { return true; @@ -729,13 +729,13 @@ describe("DataSources/exportKml", function () { Number(values[0]), Number(values[1]), Number(values[2]), - cartographic2 + cartographic2, ); if ( Cartographic.equalsEpsilon( cartographic1, cartographic2, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ) ) { return true; @@ -866,13 +866,13 @@ describe("DataSources/exportKml", function () { Number(values[0]), Number(values[1]), Number(values[2]), - cartographic2 + cartographic2, ); if ( Cartographic.equalsEpsilon( cartographic1, cartographic2, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ) ) { return true; @@ -1203,13 +1203,13 @@ describe("DataSources/exportKml", function () { Number(values[0]), Number(values[1]), Number(values[2]), - cartographic2 + cartographic2, ); if ( Cartographic.equalsEpsilon( cartographic1, cartographic2, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ) ) { return true; diff --git a/packages/engine/Specs/Renderer/AutomaticUniformSpec.js b/packages/engine/Specs/Renderer/AutomaticUniformSpec.js index f6381a39f9ef..b994a15a43af 100644 --- a/packages/engine/Specs/Renderer/AutomaticUniformSpec.js +++ b/packages/engine/Specs/Renderer/AutomaticUniformSpec.js @@ -41,13 +41,13 @@ describe( position, direction, right, - up + up, ) { return { viewMatrix: defaultValue(view, Matrix4.clone(Matrix4.IDENTITY)), inverseViewMatrix: Matrix4.inverseTransformation( defaultValue(view, Matrix4.clone(Matrix4.IDENTITY)), - new Matrix4() + new Matrix4(), ), frustum: { near: 1.0, @@ -58,11 +58,11 @@ describe( right: 1.0, projectionMatrix: defaultValue( projection, - Matrix4.clone(Matrix4.IDENTITY) + Matrix4.clone(Matrix4.IDENTITY), ), infiniteProjectionMatrix: defaultValue( infiniteProjection, - Matrix4.clone(Matrix4.IDENTITY) + Matrix4.clone(Matrix4.IDENTITY), ), computeCullingVolume: function () { return undefined; @@ -75,7 +75,7 @@ describe( positionWC: defaultValue(position, Cartesian3.clone(Cartesian3.ZERO)), directionWC: defaultValue( direction, - Cartesian3.clone(Cartesian3.UNIT_Z) + Cartesian3.clone(Cartesian3.UNIT_Z), ), rightWC: defaultValue(right, Cartesian3.clone(Cartesian3.UNIT_X)), upWC: defaultValue(up, Cartesian3.clone(Cartesian3.UNIT_Y)), @@ -179,7 +179,7 @@ describe( 13.0, 14.0, 15.0, - 16.0 + 16.0, ); expect({ context: context, @@ -213,7 +213,7 @@ describe( 0.0, 0.0, 0.0, - 1.0 + 1.0, ); expect({ context: context, @@ -244,10 +244,10 @@ describe( 13.0, 14.0, 15.0, - 16.0 - ) - ) - ) + 16.0, + ), + ), + ), ); const fs = @@ -286,10 +286,10 @@ describe( 13.0, 14.0, 15.0, - 16.0 - ) - ) - ) + 16.0, + ), + ), + ), ); const fs = @@ -328,10 +328,10 @@ describe( 13.0, 14.0, 15.0, - 16.0 - ) - ) - ) + 16.0, + ), + ), + ), ); const fs = @@ -369,10 +369,10 @@ describe( 13.0, 14.0, 15.0, - 16.0 - ) - ) - ) + 16.0, + ), + ), + ), ); const fs = @@ -410,10 +410,10 @@ describe( 0.0, 0.0, 0.0, - 1.0 - ) - ) - ) + 1.0, + ), + ), + ), ); const fs = @@ -452,10 +452,10 @@ describe( 0.0, 0.0, 0.0, - 1.0 - ) - ) - ) + 1.0, + ), + ), + ), ); const fs = @@ -494,10 +494,10 @@ describe( 0.0, 0.0, 0.0, - 1.0 - ) - ) - ) + 1.0, + ), + ), + ), ); const fs = @@ -536,10 +536,10 @@ describe( 0.0, 0.0, 0.0, - 1.0 - ) - ) - ) + 1.0, + ), + ), + ), ); const fs = @@ -579,10 +579,10 @@ describe( 13.0, 14.0, 15.0, - 16.0 - ) - ) - ) + 16.0, + ), + ), + ), ); const fs = @@ -622,10 +622,10 @@ describe( 0.0, 0.0, 0.0, - 1.0 - ) - ) - ) + 1.0, + ), + ), + ), ); const fs = @@ -663,9 +663,9 @@ describe( 0.0, 0.0, 0.0, - 1.0 - ) - ) + 1.0, + ), + ), ); frameState.mode = SceneMode.SCENE2D; @@ -707,9 +707,9 @@ describe( 0.0, 0.0, 0.0, - 1.0 - ) - ) + 1.0, + ), + ), ); const frustum = new OrthographicFrustum(); frustum.aspectRatio = 1.0; @@ -757,10 +757,10 @@ describe( 13.0, 14.0, 15.0, - 16.0 - ) - ) - ) + 16.0, + ), + ), + ), ); const fs = @@ -799,10 +799,10 @@ describe( 0.0, 0.0, 0.0, - 1.0 - ) - ) - ) + 1.0, + ), + ), + ), ); const fs = @@ -829,7 +829,7 @@ describe( 0.0, 0.0, 0.0, - 1.0 + 1.0, ); expect({ context: context, @@ -860,10 +860,10 @@ describe( 0.0, 0.0, 0.0, - 1.0 - ) - ) - ) + 1.0, + ), + ), + ), ); const fs = @@ -890,7 +890,7 @@ describe( 0.0, 0.0, 0.0, - 1.0 + 1.0, ); expect({ context: context, @@ -921,10 +921,10 @@ describe( 0.0, 0.0, 0.0, - 1.0 - ) - ) - ) + 1.0, + ), + ), + ), ); const fs = @@ -951,7 +951,7 @@ describe( 0.0, 0.0, 0.0, - 1.0 + 1.0, ); expect({ context: context, @@ -965,8 +965,8 @@ describe( us.update( createFrameState( context, - createMockCamera(Matrix4.clone(Matrix4.IDENTITY)) - ) + createMockCamera(Matrix4.clone(Matrix4.IDENTITY)), + ), ); const fs = @@ -993,7 +993,7 @@ describe( 0.0, 0.0, 0.0, - 1.0 + 1.0, ); expect({ context: context, @@ -1007,8 +1007,8 @@ describe( us.update( createFrameState( context, - createMockCamera(Matrix4.clone(Matrix4.IDENTITY)) - ) + createMockCamera(Matrix4.clone(Matrix4.IDENTITY)), + ), ); const fs = @@ -1035,7 +1035,7 @@ describe( 0.0, 0.0, 0.0, - 1.0 + 1.0, ); expect({ context: context, @@ -1066,7 +1066,7 @@ describe( 0.0, 0.0, 0.0, - 1.0 + 1.0, ), new Matrix4( 1.0, @@ -1084,10 +1084,10 @@ describe( 0.0, 0.0, 0.0, - 1.0 - ) - ) - ) + 1.0, + ), + ), + ), ); const fs = @@ -1127,7 +1127,7 @@ describe( 0.0, 0.0, 0.0, - 1.0 + 1.0, ), new Matrix4( 1.0, @@ -1145,10 +1145,10 @@ describe( 0.0, 0.0, 0.0, - 1.0 - ) - ) - ) + 1.0, + ), + ), + ), ); const fs = @@ -1188,7 +1188,7 @@ describe( 0.0, 0.0, 0.0, - 1.0 + 1.0, ), new Matrix4( 1.0, @@ -1206,10 +1206,10 @@ describe( 0.0, 0.0, 0.0, - 1.0 - ) - ) - ) + 1.0, + ), + ), + ), ); const fs = @@ -1237,7 +1237,7 @@ describe( 0.0, 0.0, 0.0, - 1.0 + 1.0, ); expect({ context: context, @@ -1268,7 +1268,7 @@ describe( 0.0, 0.0, 0.0, - 1.0 + 1.0, ), new Matrix4( 1.0, @@ -1286,10 +1286,10 @@ describe( 0.0, 0.0, 0.0, - 1.0 - ) - ) - ) + 1.0, + ), + ), + ), ); const fs = @@ -1317,7 +1317,7 @@ describe( 0.0, 0.0, 0.0, - 1.0 + 1.0, ); expect({ context: context, @@ -1348,7 +1348,7 @@ describe( 0.0, 0.0, 0.0, - 1.0 + 1.0, ), new Matrix4( 1.0, @@ -1366,10 +1366,10 @@ describe( 0.0, 0.0, 0.0, - 1.0 - ) - ) - ) + 1.0, + ), + ), + ), ); const fs = @@ -1397,7 +1397,7 @@ describe( 0.0, 0.0, 0.0, - 1.0 + 1.0, ); expect({ context: context, @@ -1428,7 +1428,7 @@ describe( 0.0, 0.0, 0.0, - 1.0 + 1.0, ), undefined, new Matrix4( @@ -1447,10 +1447,10 @@ describe( 0.0, 0.0, 0.0, - 1.0 - ) - ) - ) + 1.0, + ), + ), + ), ); const fs = @@ -1478,7 +1478,7 @@ describe( 0.0, 0.0, 0.0, - 1.0 + 1.0, ); expect({ context: context, @@ -1512,7 +1512,7 @@ describe( 0.0, 0.0, 0.0, - 1.0 + 1.0, ); expect({ context: context, @@ -1546,7 +1546,7 @@ describe( 0.0, 0.0, 0.0, - 1.0 + 1.0, ); expect({ context: context, @@ -1580,7 +1580,7 @@ describe( 0.0, 0.0, 0.0, - 1.0 + 1.0, ); expect({ context: context, @@ -1614,7 +1614,7 @@ describe( 0.0, 0.0, 0.0, - 1.0 + 1.0, ); expect({ context: context, @@ -1632,9 +1632,9 @@ describe( undefined, undefined, undefined, - new Cartesian3(-1000.0, 0.0, 100000.0) - ) - ) + new Cartesian3(-1000.0, 0.0, 100000.0), + ), + ), ); const fs = @@ -1795,8 +1795,8 @@ describe( // Provide position and direction because the default position of (0, 0, 0) // will lead to a divide by zero when updating fog below. new Cartesian3(1.0, 0.0, 0.0), - new Cartesian3(0.0, 1.0, 0.0) - ) + new Cartesian3(0.0, 1.0, 0.0), + ), ); const fog = new Fog(); fog.density = 0.1; @@ -1825,8 +1825,8 @@ describe( // Provide position and direction because the default position of (0, 0, 0) // will lead to a divide by zero when updating fog below new Cartesian3(1.0, 0.0, 0.0), - new Cartesian3(0.0, 1.0, 0.0) - ) + new Cartesian3(0.0, 1.0, 0.0), + ), ); const fog = new Fog(); fog.minimumBrightness = 0.25; @@ -2446,5 +2446,5 @@ describe( }).contextToRender(); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Renderer/BufferSpec.js b/packages/engine/Specs/Renderer/BufferSpec.js index 666cdd8e3b1f..9f96253ebf0e 100644 --- a/packages/engine/Specs/Renderer/BufferSpec.js +++ b/packages/engine/Specs/Renderer/BufferSpec.js @@ -692,5 +692,5 @@ describe( }); } }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Renderer/BuiltinFunctionsSpec.js b/packages/engine/Specs/Renderer/BuiltinFunctionsSpec.js index c4457c832e13..0f71d8f7b20d 100644 --- a/packages/engine/Specs/Renderer/BuiltinFunctionsSpec.js +++ b/packages/engine/Specs/Renderer/BuiltinFunctionsSpec.js @@ -525,5 +525,5 @@ describe( }).contextToRender(); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Renderer/ClearSpec.js b/packages/engine/Specs/Renderer/ClearSpec.js index 4d2744841050..2a6454ab8b3c 100644 --- a/packages/engine/Specs/Renderer/ClearSpec.js +++ b/packages/engine/Specs/Renderer/ClearSpec.js @@ -117,7 +117,7 @@ describe( expect( context.readPixels({ width: -1, - }) + }), ).toEqual([0, 0, 0, 0]); }).toThrowDeveloperError(); }); @@ -127,10 +127,10 @@ describe( expect( context.readPixels({ height: -1, - }) + }), ).toEqual([0, 0, 0, 0]); }).toThrowDeveloperError(); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Renderer/ComputeCommandSpec.js b/packages/engine/Specs/Renderer/ComputeCommandSpec.js index 34dc9ec90312..51d001526e74 100644 --- a/packages/engine/Specs/Renderer/ComputeCommandSpec.js +++ b/packages/engine/Specs/Renderer/ComputeCommandSpec.js @@ -158,5 +158,5 @@ describe( expect(scene).notToRender([0, 0, 0, 255]); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Renderer/ContextSpec.js b/packages/engine/Specs/Renderer/ContextSpec.js index 7cb308cbcb8f..17a28952b240 100644 --- a/packages/engine/Specs/Renderer/ContextSpec.js +++ b/packages/engine/Specs/Renderer/ContextSpec.js @@ -41,7 +41,7 @@ describe( it("get maximumCombinedTextureImageUnits", function () { expect( - ContextLimits.maximumCombinedTextureImageUnits + ContextLimits.maximumCombinedTextureImageUnits, ).toBeGreaterThanOrEqual(8); }); @@ -51,7 +51,7 @@ describe( it("get maximumFragmentUniformVectors", function () { expect( - ContextLimits.maximumFragmentUniformVectors + ContextLimits.maximumFragmentUniformVectors, ).toBeGreaterThanOrEqual(16); }); @@ -77,13 +77,13 @@ describe( it("get maximumVertexTextureImageUnits", function () { expect( - ContextLimits.maximumVertexTextureImageUnits + ContextLimits.maximumVertexTextureImageUnits, ).toBeGreaterThanOrEqual(0); }); it("get maximumVertexUniformVectors", function () { expect(ContextLimits.maximumVertexUniformVectors).toBeGreaterThanOrEqual( - 1 + 1, ); }); @@ -188,7 +188,7 @@ describe( it("gets maximum texture filter anisotropy", function () { if (context.textureFilterAnisotropic) { expect( - ContextLimits.maximumTextureFilterAnisotropy + ContextLimits.maximumTextureFilterAnisotropy, ).toBeGreaterThanOrEqual(2); } else { expect(ContextLimits.maximumTextureFilterAnisotropy).toEqual(1); @@ -342,5 +342,5 @@ describe( } }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Renderer/CubeMapSpec.js b/packages/engine/Specs/Renderer/CubeMapSpec.js index 4c7ac6ccfeac..86a97c7c28a8 100644 --- a/packages/engine/Specs/Renderer/CubeMapSpec.js +++ b/packages/engine/Specs/Renderer/CubeMapSpec.js @@ -96,45 +96,45 @@ describe( promises.push( Resource.fetchImage("./Data/Images/Green.png").then(function (result) { greenImage = result; - }) + }), ); promises.push( Resource.fetchImage("./Data/Images/Blue.png").then(function (result) { blueImage = result; - }) + }), ); promises.push( - Resource.fetchImage("./Data/Images/BlueAlpha.png").then(function ( - result - ) { - blueAlphaImage = result; - }) + Resource.fetchImage("./Data/Images/BlueAlpha.png").then( + function (result) { + blueAlphaImage = result; + }, + ), ); promises.push( - Resource.fetchImage("./Data/Images/BlueOverRed.png").then(function ( - result - ) { - blueOverRedImage = result; - }) + Resource.fetchImage("./Data/Images/BlueOverRed.png").then( + function (result) { + blueOverRedImage = result; + }, + ), ); promises.push( - Resource.fetchImage("./Data/Images/Red16x16.png").then(function ( - result - ) { - red16x16Image = result; - }) + Resource.fetchImage("./Data/Images/Red16x16.png").then( + function (result) { + red16x16Image = result; + }, + ), ); promises.push( Resource.fetchImage("./Data/Images/Gamma.png").then(function (result) { gammaImage = result; - }) + }), ); promises.push( Resource.fetchImage("./Data/Images/CustomColorProfile.png").then( function (result) { customColorProfileImage = result; - } - ) + }, + ), ); return Promise.all(promises); @@ -173,22 +173,22 @@ describe( expect(cubeMap.pixelDatatype).toEqual(PixelDatatype.UNSIGNED_BYTE); expect(cubeMap.positiveX.pixelDatatype).toEqual( - PixelDatatype.UNSIGNED_BYTE + PixelDatatype.UNSIGNED_BYTE, ); expect(cubeMap.negativeX.pixelDatatype).toEqual( - PixelDatatype.UNSIGNED_BYTE + PixelDatatype.UNSIGNED_BYTE, ); expect(cubeMap.positiveY.pixelDatatype).toEqual( - PixelDatatype.UNSIGNED_BYTE + PixelDatatype.UNSIGNED_BYTE, ); expect(cubeMap.negativeY.pixelDatatype).toEqual( - PixelDatatype.UNSIGNED_BYTE + PixelDatatype.UNSIGNED_BYTE, ); expect(cubeMap.positiveZ.pixelDatatype).toEqual( - PixelDatatype.UNSIGNED_BYTE + PixelDatatype.UNSIGNED_BYTE, ); expect(cubeMap.negativeZ.pixelDatatype).toEqual( - PixelDatatype.UNSIGNED_BYTE + PixelDatatype.UNSIGNED_BYTE, ); }); @@ -445,7 +445,7 @@ describe( level[faceName] = { width: 2, height: 2, arrayBufferView: colorData }; return level; }, - {} + {}, ); cubeMap = new CubeMap({ @@ -464,7 +464,7 @@ describe( level[faceName] = { width: 1, height: 1, arrayBufferView: colorData }; return level; }, - {} + {}, ); cubeMap.loadMipmaps([level1]); @@ -501,7 +501,7 @@ describe( level[faceName] = { width: 2, height: 2, arrayBufferView: colorData }; return level; }, - {} + {}, ); cubeMap = new CubeMap({ @@ -520,7 +520,7 @@ describe( level[faceName] = { width: 1, height: 1, arrayBufferView: colorData }; return level; }, - {} + {}, ); cubeMap.loadMipmaps([level1]); @@ -1307,7 +1307,7 @@ describe( // Allow for some leniency with the sizeInBytes approximation expect(cubeMap.sizeInBytes).toEqualEpsilon( (16 * 16 + 8 * 8 + 4 * 4 + 2 * 2 + 1) * 4 * 6, - 10 + 10, ); }); @@ -1642,7 +1642,7 @@ describe( 0, 0, 0, - cubeMap.height + 1 + cubeMap.height + 1, ); }).toThrowDeveloperError(); }); @@ -1718,5 +1718,5 @@ describe( }).toThrowDeveloperError(); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Renderer/DrawSpec.js b/packages/engine/Specs/Renderer/DrawSpec.js index ea4a508eddc1..3d7ab36a6c02 100644 --- a/packages/engine/Specs/Renderer/DrawSpec.js +++ b/packages/engine/Specs/Renderer/DrawSpec.js @@ -584,22 +584,8 @@ describe( vertexBuffer: Buffer.createVertexBuffer({ context: context, typedArray: new Float32Array([ - -1000, - -1000, - 0, - 1, - 1000, - -1000, - 0, - 1, - -1000, - 1000, - 0, - 1, - 1000, - 1000, - 0, - 1, + -1000, -1000, 0, 1, 1000, -1000, 0, 1, -1000, 1000, 0, 1, 1000, + 1000, 0, 1, ]), usage: BufferUsage.STATIC_DRAW, }), @@ -663,22 +649,8 @@ describe( vertexBuffer: Buffer.createVertexBuffer({ context: context, typedArray: new Float32Array([ - -1000, - -1000, - 0, - 1, - 1000, - -1000, - 0, - 1, - -1000, - 1000, - 0, - 1, - 1000, - 1000, - 0, - 1, + -1000, -1000, 0, 1, 1000, -1000, 0, 1, -1000, 1000, 0, 1, 1000, + 1000, 0, 1, ]), usage: BufferUsage.STATIC_DRAW, }), @@ -744,22 +716,8 @@ describe( vertexBuffer: Buffer.createVertexBuffer({ context: context, typedArray: new Float32Array([ - -1000, - -1000, - 0, - 1, - 1000, - -1000, - 0, - 1, - -1000, - 1000, - 0, - 1, - 1000, - 1000, - 0, - 1, + -1000, -1000, 0, 1, 1000, -1000, 0, 1, -1000, 1000, 0, 1, 1000, + 1000, 0, 1, ]), usage: BufferUsage.STATIC_DRAW, }), @@ -870,14 +828,7 @@ describe( vertexBuffer: Buffer.createVertexBuffer({ context: context, typedArray: new Float32Array([ - -1000, - -1000, - 0, - 1, - 1000, - 1000, - 0, - 1, + -1000, -1000, 0, 1, 1000, 1000, 0, 1, ]), usage: BufferUsage.STATIC_DRAW, }), @@ -1043,22 +994,8 @@ describe( vertexBuffer: Buffer.createVertexBuffer({ context: context, typedArray: new Float32Array([ - -1000, - -1000, - 0, - 1, - 1000, - -1000, - 0, - 1, - -1000, - 1000, - 0, - 1, - 1000, - 1000, - 0, - 1, + -1000, -1000, 0, 1, 1000, -1000, 0, 1, -1000, 1000, 0, 1, 1000, + 1000, 0, 1, ]), usage: BufferUsage.STATIC_DRAW, }), @@ -1148,22 +1085,8 @@ describe( vertexBuffer: Buffer.createVertexBuffer({ context: context, typedArray: new Float32Array([ - -1000, - -1000, - 0, - 1, - 1000, - -1000, - 0, - 1, - -1000, - 1000, - 0, - 1, - 1000, - 1000, - 0, - 1, + -1000, -1000, 0, 1, 1000, -1000, 0, 1, -1000, 1000, 0, 1, 1000, + 1000, 0, 1, ]), usage: BufferUsage.STATIC_DRAW, }), @@ -1539,5 +1462,5 @@ describe( }); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Renderer/FramebufferManagerSpec.js b/packages/engine/Specs/Renderer/FramebufferManagerSpec.js index 12ddd6966f4d..de1d797048eb 100644 --- a/packages/engine/Specs/Renderer/FramebufferManagerSpec.js +++ b/packages/engine/Specs/Renderer/FramebufferManagerSpec.js @@ -256,7 +256,7 @@ describe( expect(renderbuffer.width).toEqual(1); expect(renderbuffer.height).toEqual(1); expect(renderbuffer.format).toEqual( - RenderbufferFormat.DEPTH_COMPONENT16 + RenderbufferFormat.DEPTH_COMPONENT16, ); } }); @@ -521,5 +521,5 @@ describe( expect(fbm.status).toEqual(fbm.framebuffer.status); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Renderer/FramebufferSpec.js b/packages/engine/Specs/Renderer/FramebufferSpec.js index c1dbe5f2c022..5826d54b0786 100644 --- a/packages/engine/Specs/Renderer/FramebufferSpec.js +++ b/packages/engine/Specs/Renderer/FramebufferSpec.js @@ -292,12 +292,11 @@ describe( }), ], }); - renderColorTexture(framebuffer, new Color(0.0, 1.0, 0.0, 1.0), [ - 0, - 255, - 0, - 255, - ]); + renderColorTexture( + framebuffer, + new Color(0.0, 1.0, 0.0, 1.0), + [0, 255, 0, 255], + ); }); it("draws to a floating-point color attachment", function () { @@ -316,12 +315,11 @@ describe( }), ], }); - renderColorTexture(framebuffer, new Color(0.5, 1.5, 2.0, 1.0), [ - 0.5, - 1.5, - 2.0, - 1.0, - ]); + renderColorTexture( + framebuffer, + new Color(0.5, 1.5, 2.0, 1.0), + [0.5, 1.5, 2.0, 1.0], + ); }); it("draws to a half floating-point color attachment", function () { @@ -340,12 +338,11 @@ describe( }), ], }); - renderColorTexture(framebuffer, new Color(0.5, 1.5, 2.0, 1.0), [ - 14336, - 15872, - 16384, - 15360, - ]); + renderColorTexture( + framebuffer, + new Color(0.5, 1.5, 2.0, 1.0), + [14336, 15872, 16384, 15360], + ); }); function renderDepthAttachment(framebuffer, texture) { @@ -456,7 +453,7 @@ describe( if (framebuffer.status === WebGLConstants.FRAMEBUFFER_COMPLETE) { expect( - renderDepthAttachment(framebuffer, framebuffer.depthTexture) + renderDepthAttachment(framebuffer, framebuffer.depthTexture), ).toEqualEpsilon([128, 128, 128, 255], 1); } } @@ -484,7 +481,7 @@ describe( if (framebuffer.status === WebGLConstants.FRAMEBUFFER_COMPLETE) { expect( - renderDepthAttachment(framebuffer, framebuffer.depthStencilTexture) + renderDepthAttachment(framebuffer, framebuffer.depthStencilTexture), ).toEqualEpsilon([128, 128, 128, 255], 1); } } @@ -748,7 +745,7 @@ describe( }), }); expect(framebuffer.status).not.toEqual( - WebGLConstants.FRAMEBUFFER_COMPLETE + WebGLConstants.FRAMEBUFFER_COMPLETE, ); }); @@ -935,7 +932,7 @@ describe( return new Framebuffer({ context: context, colorRenderbuffers: new Array( - ContextLimits.maximumColorAttachments + 1 + ContextLimits.maximumColorAttachments + 1, ), }); }).toThrowDeveloperError(); @@ -972,7 +969,7 @@ describe( expect(function () { framebuffer.getColorRenderbuffer( - ContextLimits.maximumColorAttachments + 1 + ContextLimits.maximumColorAttachments + 1, ); }).toThrowDeveloperError(); }); @@ -1032,5 +1029,5 @@ describe( }).toThrowDeveloperError(); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Renderer/MultisampleFramebufferSpec.js b/packages/engine/Specs/Renderer/MultisampleFramebufferSpec.js index faf90872bbe0..7393c123b173 100644 --- a/packages/engine/Specs/Renderer/MultisampleFramebufferSpec.js +++ b/packages/engine/Specs/Renderer/MultisampleFramebufferSpec.js @@ -332,7 +332,7 @@ describe( expect(renderAndBlitDepthAttachment(framebuffer)).toEqualEpsilon( [128, 128, 128, 255], - 1 + 1, ); }); @@ -381,5 +381,5 @@ describe( }).toThrowDeveloperError(); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Renderer/RenderStateSpec.js b/packages/engine/Specs/Renderer/RenderStateSpec.js index 4e757d3df986..afa5d42d1d41 100644 --- a/packages/engine/Specs/Renderer/RenderStateSpec.js +++ b/packages/engine/Specs/Renderer/RenderStateSpec.js @@ -108,16 +108,16 @@ describe( expect(rs.polygonOffset.units).toEqual(defaultRS.polygonOffset.units); expect(rs.scissorTest.enabled).toEqual(defaultRS.scissorTest.enabled); expect(rs.scissorTest.rectangle.x).toEqual( - defaultRS.scissorTest.rectangle.x + defaultRS.scissorTest.rectangle.x, ); expect(rs.scissorTest.rectangle.y).toEqual( - defaultRS.scissorTest.rectangle.y + defaultRS.scissorTest.rectangle.y, ); expect(rs.scissorTest.rectangle.width).toEqual( - defaultRS.scissorTest.rectangle.width + defaultRS.scissorTest.rectangle.width, ); expect(rs.scissorTest.rectangle.height).toEqual( - defaultRS.scissorTest.rectangle.height + defaultRS.scissorTest.rectangle.height, ); expect(rs.depthRange.near).toEqual(defaultRS.depthRange.near); expect(rs.depthRange.far).toEqual(defaultRS.depthRange.far); @@ -136,49 +136,49 @@ describe( expect(rs.blending.color.alpha).toEqual(defaultRS.blending.color.alpha); expect(rs.blending.equationRgb).toEqual(defaultRS.blending.equationRgb); expect(rs.blending.equationAlpha).toEqual( - defaultRS.blending.equationAlpha + defaultRS.blending.equationAlpha, ); expect(rs.blending.functionSourceRgb).toEqual( - defaultRS.blending.functionSourceRgb + defaultRS.blending.functionSourceRgb, ); expect(rs.blending.functionSourceAlpha).toEqual( - defaultRS.blending.functionSourceAlpha + defaultRS.blending.functionSourceAlpha, ); expect(rs.blending.functionDestinationRgb).toEqual( - defaultRS.blending.functionDestinationRgb + defaultRS.blending.functionDestinationRgb, ); expect(rs.blending.functionDestinationAlpha).toEqual( - defaultRS.blending.functionDestinationAlpha + defaultRS.blending.functionDestinationAlpha, ); expect(rs.stencilTest.enabled).toEqual(defaultRS.stencilTest.enabled); expect(rs.stencilTest.frontFunction).toEqual( - defaultRS.stencilTest.frontFunction + defaultRS.stencilTest.frontFunction, ); expect(rs.stencilTest.backFunction).toEqual( - defaultRS.stencilTest.backFunction + defaultRS.stencilTest.backFunction, ); expect(rs.stencilTest.reference).toEqual(defaultRS.stencilTest.reference); expect(rs.stencilTest.mask).toEqual(defaultRS.stencilTest.mask); expect(rs.stencilTest.frontOperation.fail).toEqual( - defaultRS.stencilTest.frontOperation.fail + defaultRS.stencilTest.frontOperation.fail, ); expect(rs.stencilTest.frontOperation.zFail).toEqual( - defaultRS.stencilTest.frontOperation.zFail + defaultRS.stencilTest.frontOperation.zFail, ); expect(rs.stencilTest.frontOperation.zPass).toEqual( - defaultRS.stencilTest.frontOperation.zPass + defaultRS.stencilTest.frontOperation.zPass, ); expect(rs.stencilTest.backOperation.fail).toEqual( - defaultRS.stencilTest.backOperation.fail + defaultRS.stencilTest.backOperation.fail, ); expect(rs.stencilTest.backOperation.zFail).toEqual( - defaultRS.stencilTest.backOperation.zFail + defaultRS.stencilTest.backOperation.zFail, ); expect(rs.stencilTest.backOperation.zPass).toEqual( - defaultRS.stencilTest.backOperation.zPass + defaultRS.stencilTest.backOperation.zPass, ); expect(rs.sampleCoverage.enabled).toEqual( - defaultRS.sampleCoverage.enabled + defaultRS.sampleCoverage.enabled, ); expect(rs.sampleCoverage.value).toEqual(defaultRS.sampleCoverage.value); expect(rs.sampleCoverage.invert).toEqual(defaultRS.sampleCoverage.invert); @@ -274,10 +274,10 @@ describe( expect(rs.scissorTest.rectangle.x).toEqual(r.scissorTest.rectangle.x); expect(rs.scissorTest.rectangle.y).toEqual(r.scissorTest.rectangle.y); expect(rs.scissorTest.rectangle.width).toEqual( - r.scissorTest.rectangle.width + r.scissorTest.rectangle.width, ); expect(rs.scissorTest.rectangle.height).toEqual( - r.scissorTest.rectangle.height + r.scissorTest.rectangle.height, ); expect(rs.depthRange.near).toEqual(r.depthRange.near); expect(rs.depthRange.far).toEqual(r.depthRange.far); @@ -297,16 +297,16 @@ describe( expect(rs.blending.equationRgb).toEqual(r.blending.equationRgb); expect(rs.blending.equationAlpha).toEqual(r.blending.equationAlpha); expect(rs.blending.functionSourceRgb).toEqual( - r.blending.functionSourceRgb + r.blending.functionSourceRgb, ); expect(rs.blending.functionSourceAlpha).toEqual( - r.blending.functionSourceAlpha + r.blending.functionSourceAlpha, ); expect(rs.blending.functionDestinationRgb).toEqual( - r.blending.functionDestinationRgb + r.blending.functionDestinationRgb, ); expect(rs.blending.functionDestinationAlpha).toEqual( - r.blending.functionDestinationAlpha + r.blending.functionDestinationAlpha, ); expect(rs.stencilTest.enabled).toEqual(r.stencilTest.enabled); expect(rs.stencilTest.frontFunction).toEqual(r.stencilTest.frontFunction); @@ -314,22 +314,22 @@ describe( expect(rs.stencilTest.reference).toEqual(r.stencilTest.reference); expect(rs.stencilTest.mask).toEqual(r.stencilTest.mask); expect(rs.stencilTest.frontOperation.fail).toEqual( - r.stencilTest.frontOperation.fail + r.stencilTest.frontOperation.fail, ); expect(rs.stencilTest.frontOperation.zFail).toEqual( - r.stencilTest.frontOperation.zFail + r.stencilTest.frontOperation.zFail, ); expect(rs.stencilTest.frontOperation.zPass).toEqual( - r.stencilTest.frontOperation.zPass + r.stencilTest.frontOperation.zPass, ); expect(rs.stencilTest.backOperation.fail).toEqual( - r.stencilTest.backOperation.fail + r.stencilTest.backOperation.fail, ); expect(rs.stencilTest.backOperation.zFail).toEqual( - r.stencilTest.backOperation.zFail + r.stencilTest.backOperation.zFail, ); expect(rs.stencilTest.backOperation.zPass).toEqual( - r.stencilTest.backOperation.zPass + r.stencilTest.backOperation.zPass, ); expect(rs.sampleCoverage.enabled).toEqual(r.sampleCoverage.enabled); expect(rs.sampleCoverage.value).toEqual(r.sampleCoverage.value); @@ -359,16 +359,16 @@ describe( expect(rs.polygonOffset.units).toEqual(defaultRS.polygonOffset.units); expect(rs.scissorTest.enabled).toEqual(defaultRS.scissorTest.enabled); expect(rs.scissorTest.rectangle.x).toEqual( - defaultRS.scissorTest.rectangle.x + defaultRS.scissorTest.rectangle.x, ); expect(rs.scissorTest.rectangle.y).toEqual( - defaultRS.scissorTest.rectangle.y + defaultRS.scissorTest.rectangle.y, ); expect(rs.scissorTest.rectangle.width).toEqual( - defaultRS.scissorTest.rectangle.width + defaultRS.scissorTest.rectangle.width, ); expect(rs.scissorTest.rectangle.height).toEqual( - defaultRS.scissorTest.rectangle.height + defaultRS.scissorTest.rectangle.height, ); expect(rs.depthTest.enabled).toEqual(defaultRS.depthTest.enabled); expect(rs.depthTest.func).toEqual(defaultRS.depthTest.func); @@ -385,49 +385,49 @@ describe( expect(rs.blending.color.alpha).toEqual(defaultRS.blending.color.alpha); expect(rs.blending.equationRgb).toEqual(defaultRS.blending.equationRgb); expect(rs.blending.equationAlpha).toEqual( - defaultRS.blending.equationAlpha + defaultRS.blending.equationAlpha, ); expect(rs.blending.functionSourceRgb).toEqual( - defaultRS.blending.functionSourceRgb + defaultRS.blending.functionSourceRgb, ); expect(rs.blending.functionSourceAlpha).toEqual( - defaultRS.blending.functionSourceAlpha + defaultRS.blending.functionSourceAlpha, ); expect(rs.blending.functionDestinationRgb).toEqual( - defaultRS.blending.functionDestinationRgb + defaultRS.blending.functionDestinationRgb, ); expect(rs.blending.functionDestinationAlpha).toEqual( - defaultRS.blending.functionDestinationAlpha + defaultRS.blending.functionDestinationAlpha, ); expect(rs.stencilTest.enabled).toEqual(defaultRS.stencilTest.enabled); expect(rs.stencilTest.frontFunction).toEqual( - defaultRS.stencilTest.frontFunction + defaultRS.stencilTest.frontFunction, ); expect(rs.stencilTest.backFunction).toEqual( - defaultRS.stencilTest.backFunction + defaultRS.stencilTest.backFunction, ); expect(rs.stencilTest.reference).toEqual(defaultRS.stencilTest.reference); expect(rs.stencilTest.mask).toEqual(defaultRS.stencilTest.mask); expect(rs.stencilTest.frontOperation.fail).toEqual( - defaultRS.stencilTest.frontOperation.fail + defaultRS.stencilTest.frontOperation.fail, ); expect(rs.stencilTest.frontOperation.zFail).toEqual( - defaultRS.stencilTest.frontOperation.zFail + defaultRS.stencilTest.frontOperation.zFail, ); expect(rs.stencilTest.frontOperation.zPass).toEqual( - defaultRS.stencilTest.frontOperation.zPass + defaultRS.stencilTest.frontOperation.zPass, ); expect(rs.stencilTest.backOperation.fail).toEqual( - defaultRS.stencilTest.backOperation.fail + defaultRS.stencilTest.backOperation.fail, ); expect(rs.stencilTest.backOperation.zFail).toEqual( - defaultRS.stencilTest.backOperation.zFail + defaultRS.stencilTest.backOperation.zFail, ); expect(rs.stencilTest.backOperation.zPass).toEqual( - defaultRS.stencilTest.backOperation.zPass + defaultRS.stencilTest.backOperation.zPass, ); expect(rs.sampleCoverage.enabled).toEqual( - defaultRS.sampleCoverage.enabled + defaultRS.sampleCoverage.enabled, ); expect(rs.sampleCoverage.value).toEqual(defaultRS.sampleCoverage.value); expect(rs.sampleCoverage.invert).toEqual(defaultRS.sampleCoverage.invert); @@ -889,10 +889,10 @@ describe( expect(rs.scissorTest.rectangle.x).toEqual(r.scissorTest.rectangle.x); expect(rs.scissorTest.rectangle.y).toEqual(r.scissorTest.rectangle.y); expect(rs.scissorTest.rectangle.width).toEqual( - r.scissorTest.rectangle.width + r.scissorTest.rectangle.width, ); expect(rs.scissorTest.rectangle.height).toEqual( - r.scissorTest.rectangle.height + r.scissorTest.rectangle.height, ); expect(rs.depthRange.near).toEqual(r.depthRange.near); expect(rs.depthRange.far).toEqual(r.depthRange.far); @@ -912,16 +912,16 @@ describe( expect(rs.blending.equationRgb).toEqual(r.blending.equationRgb); expect(rs.blending.equationAlpha).toEqual(r.blending.equationAlpha); expect(rs.blending.functionSourceRgb).toEqual( - r.blending.functionSourceRgb + r.blending.functionSourceRgb, ); expect(rs.blending.functionSourceAlpha).toEqual( - r.blending.functionSourceAlpha + r.blending.functionSourceAlpha, ); expect(rs.blending.functionDestinationRgb).toEqual( - r.blending.functionDestinationRgb + r.blending.functionDestinationRgb, ); expect(rs.blending.functionDestinationAlpha).toEqual( - r.blending.functionDestinationAlpha + r.blending.functionDestinationAlpha, ); expect(rs.stencilTest.enabled).toEqual(r.stencilTest.enabled); expect(rs.stencilTest.frontFunction).toEqual(r.stencilTest.frontFunction); @@ -929,27 +929,27 @@ describe( expect(rs.stencilTest.reference).toEqual(r.stencilTest.reference); expect(rs.stencilTest.mask).toEqual(r.stencilTest.mask); expect(rs.stencilTest.frontOperation.fail).toEqual( - r.stencilTest.frontOperation.fail + r.stencilTest.frontOperation.fail, ); expect(rs.stencilTest.frontOperation.zFail).toEqual( - r.stencilTest.frontOperation.zFail + r.stencilTest.frontOperation.zFail, ); expect(rs.stencilTest.frontOperation.zPass).toEqual( - r.stencilTest.frontOperation.zPass + r.stencilTest.frontOperation.zPass, ); expect(rs.stencilTest.backOperation.fail).toEqual( - r.stencilTest.backOperation.fail + r.stencilTest.backOperation.fail, ); expect(rs.stencilTest.backOperation.zFail).toEqual( - r.stencilTest.backOperation.zFail + r.stencilTest.backOperation.zFail, ); expect(rs.stencilTest.backOperation.zPass).toEqual( - r.stencilTest.backOperation.zPass + r.stencilTest.backOperation.zPass, ); expect(rs.sampleCoverage.enabled).toEqual(r.sampleCoverage.enabled); expect(rs.sampleCoverage.value).toEqual(r.sampleCoverage.value); expect(rs.sampleCoverage.invert).toEqual(r.sampleCoverage.invert); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Renderer/RenderbufferSpec.js b/packages/engine/Specs/Renderer/RenderbufferSpec.js index 83c001360641..105a1768dbe0 100644 --- a/packages/engine/Specs/Renderer/RenderbufferSpec.js +++ b/packages/engine/Specs/Renderer/RenderbufferSpec.js @@ -118,5 +118,5 @@ describe( }).toThrowDeveloperError(); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Renderer/SamplerSpec.js b/packages/engine/Specs/Renderer/SamplerSpec.js index dc5ffaf741a4..7ae117336e27 100644 --- a/packages/engine/Specs/Renderer/SamplerSpec.js +++ b/packages/engine/Specs/Renderer/SamplerSpec.js @@ -24,10 +24,10 @@ describe( expect(sampler.wrapS).toEqual(TextureWrap.CLAMP_TO_EDGE); expect(sampler.wrapT).toEqual(TextureWrap.CLAMP_TO_EDGE); expect(sampler.minificationFilter).toEqual( - TextureMinificationFilter.LINEAR + TextureMinificationFilter.LINEAR, ); expect(sampler.magnificationFilter).toEqual( - TextureMinificationFilter.LINEAR + TextureMinificationFilter.LINEAR, ); expect(sampler.maximumAnisotropy).toEqual(1.0); }); @@ -72,5 +72,5 @@ describe( }).toThrowDeveloperError(); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Renderer/ShaderBuilderSpec.js b/packages/engine/Specs/Renderer/ShaderBuilderSpec.js index 8f83492a9fd1..9e9fe00e91fb 100644 --- a/packages/engine/Specs/Renderer/ShaderBuilderSpec.js +++ b/packages/engine/Specs/Renderer/ShaderBuilderSpec.js @@ -16,7 +16,7 @@ describe( function checkVertexShader( shaderProgram, expectedDefines, - expectedSources + expectedSources, ) { // the ShaderBuilder joins the generated lines with \n // to avoid creating #line 0 at every line. We need to do the same here @@ -31,7 +31,7 @@ describe( function checkFragmentShader( shaderProgram, expectedDefines, - expectedSources + expectedSources, ) { // the ShaderBuilder joins the generated lines with \n // to avoid creating #line 0 at every line. We need to do the same here @@ -87,18 +87,18 @@ describe( shaderBuilder.addDefine( "USE_FRAGMENT_SHADING", 1, - ShaderDestination.BOTH + ShaderDestination.BOTH, ); const shaderProgram = shaderBuilder.buildShaderProgram(context); checkVertexShader( shaderProgram, ["POINT_SIZE 2", "USE_FRAGMENT_SHADING 1"], - [] + [], ); checkFragmentShader( shaderProgram, ["PI 3.1415", "USE_FRAGMENT_SHADING 1"], - [] + [], ); }); @@ -116,7 +116,7 @@ describe( return shaderBuilder.addStruct( undefined, "TestStruct", - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); }).toThrowDeveloperError(); }); @@ -127,7 +127,7 @@ describe( return shaderBuilder.addStruct( {}, "TestStruct", - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); }).toThrowDeveloperError(); }); @@ -138,7 +138,7 @@ describe( return shaderBuilder.addStruct( "testStruct", undefined, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); }).toThrowDeveloperError(); }); @@ -149,7 +149,7 @@ describe( return shaderBuilder.addStruct( "testStruct", {}, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); }).toThrowDeveloperError(); }); @@ -173,24 +173,24 @@ describe( shaderBuilder.addStruct( "structVS", "TestStruct", - ShaderDestination.VERTEX + ShaderDestination.VERTEX, ); shaderBuilder.addStruct( "structFS", "TestStruct", - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); const shaderProgram = shaderBuilder.buildShaderProgram(context); checkVertexShader( shaderProgram, [], - ["struct TestStruct", "{", " float _empty;", "};"] + ["struct TestStruct", "{", " float _empty;", "};"], ); checkFragmentShader( shaderProgram, [], - ["struct TestStruct", "{", " float _empty;", "};"] + ["struct TestStruct", "{", " float _empty;", "};"], ); }); @@ -199,7 +199,7 @@ describe( shaderBuilder.addStruct( "structVS", "TestStruct", - ShaderDestination.VERTEX + ShaderDestination.VERTEX, ); expect(function () { return shaderBuilder.addStructField(undefined, "vec3", "positionMC"); @@ -211,7 +211,7 @@ describe( shaderBuilder.addStruct( "structVS", "TestStruct", - ShaderDestination.VERTEX + ShaderDestination.VERTEX, ); expect(function () { return shaderBuilder.addStructField(-1, "vec3", "positionMC"); @@ -223,13 +223,13 @@ describe( shaderBuilder.addStruct( "structVS", "TestStruct", - ShaderDestination.VERTEX + ShaderDestination.VERTEX, ); expect(function () { return shaderBuilder.addStructField( "structVS", undefined, - "positionMC" + "positionMC", ); }).toThrowDeveloperError(); }); @@ -239,7 +239,7 @@ describe( shaderBuilder.addStruct( "structVS", "TestStruct", - ShaderDestination.VERTEX + ShaderDestination.VERTEX, ); expect(function () { return shaderBuilder.addStructField("structVS", -1, "positionMC"); @@ -251,7 +251,7 @@ describe( shaderBuilder.addStruct( "structVS", "TestStruct", - ShaderDestination.VERTEX + ShaderDestination.VERTEX, ); expect(function () { return shaderBuilder.addStructField("structVS", "vec3", undefined); @@ -263,7 +263,7 @@ describe( shaderBuilder.addStruct( "structVS", "TestStruct", - ShaderDestination.VERTEX + ShaderDestination.VERTEX, ); expect(function () { return shaderBuilder.addStructField("structVS", "vec3", -1); @@ -275,12 +275,12 @@ describe( shaderBuilder.addStruct( "structVS", "TestStruct", - ShaderDestination.VERTEX + ShaderDestination.VERTEX, ); shaderBuilder.addStruct( "structFS", "TestStruct", - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); shaderBuilder.addStructField("structVS", "vec3", "positionMC"); @@ -291,7 +291,7 @@ describe( checkVertexShader( shaderProgram, [], - ["struct TestStruct", "{", " vec3 positionMC;", "};"] + ["struct TestStruct", "{", " vec3 positionMC;", "};"], ); checkFragmentShader( shaderProgram, @@ -302,7 +302,7 @@ describe( " vec3 positionMC;", " float temperature;", "};", - ] + ], ); }); @@ -313,7 +313,7 @@ describe( return shaderBuilder.addFunction( undefined, signature, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); }).toThrowDeveloperError(); }); @@ -324,7 +324,7 @@ describe( return shaderBuilder.addFunction( {}, signature, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); }).toThrowDeveloperError(); }); @@ -335,7 +335,7 @@ describe( return shaderBuilder.addFunction( "testFunction", undefined, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); }).toThrowDeveloperError(); }); @@ -346,7 +346,7 @@ describe( return shaderBuilder.addFunction( "testFunction", -1, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); }).toThrowDeveloperError(); }); @@ -370,12 +370,12 @@ describe( shaderBuilder.addFunction( "testFunctionVS", signature, - ShaderDestination.VERTEX + ShaderDestination.VERTEX, ); shaderBuilder.addFunction( "testFunctionFS", signature, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); const shaderProgram = shaderBuilder.buildShaderProgram(context); @@ -388,7 +388,7 @@ describe( shaderBuilder.addFunction( "testFunctionVS", signature, - ShaderDestination.VERTEX + ShaderDestination.VERTEX, ); expect(function () { return shaderBuilder.addFunctionLines(undefined, "return 1.0;"); @@ -400,7 +400,7 @@ describe( shaderBuilder.addFunction( "testFunctionVS", signature, - ShaderDestination.VERTEX + ShaderDestination.VERTEX, ); expect(function () { return shaderBuilder.addFunctionLines(-1, "return 1.0;"); @@ -412,7 +412,7 @@ describe( shaderBuilder.addFunction( "testFunctionVS", signature, - ShaderDestination.VERTEX + ShaderDestination.VERTEX, ); expect(function () { return shaderBuilder.addFunctionLines("testFunctionVS", undefined); @@ -424,7 +424,7 @@ describe( shaderBuilder.addFunction( "testFunctionVS", signature, - ShaderDestination.VERTEX + ShaderDestination.VERTEX, ); expect(function () { return shaderBuilder.addFunctionLines("testFunctionVS", -1); @@ -436,12 +436,12 @@ describe( shaderBuilder.addFunction( "testFunctionVS", signature, - ShaderDestination.VERTEX + ShaderDestination.VERTEX, ); shaderBuilder.addFunction( "testFunctionFS", signature, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); shaderBuilder.addFunctionLines("testFunctionVS", [ @@ -456,12 +456,12 @@ describe( checkVertexShader( shaderProgram, [], - [signature, "{", " v_color = vec3(0.0);", " return 1.0;", "}"] + [signature, "{", " v_color = vec3(0.0);", " return 1.0;", "}"], ); checkFragmentShader( shaderProgram, [], - [signature, "{", " return 1.0 - step(0.3, radius);", "}"] + [signature, "{", " return 1.0 - step(0.3, radius);", "}"], ); }); @@ -470,12 +470,12 @@ describe( shaderBuilder.addFunction( "testFunctionVS", signature, - ShaderDestination.VERTEX + ShaderDestination.VERTEX, ); shaderBuilder.addFunction( "testFunctionFS", signature, - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); shaderBuilder.addFunctionLines("testFunctionVS", "return 1.0;"); @@ -485,12 +485,12 @@ describe( checkVertexShader( shaderProgram, [], - [signature, "{", " return 1.0;", "}"] + [signature, "{", " return 1.0;", "}"], ); checkFragmentShader( shaderProgram, [], - [signature, "{", " return 2.0;", "}"] + [signature, "{", " return 2.0;", "}"], ); }); @@ -527,24 +527,24 @@ describe( shaderBuilder.addUniform( "vec3", "u_gridDimensions", - ShaderDestination.VERTEX + ShaderDestination.VERTEX, ); shaderBuilder.addUniform( "vec2", "u_mousePosition", - ShaderDestination.FRAGMENT + ShaderDestination.FRAGMENT, ); shaderBuilder.addUniform("float", "u_time", ShaderDestination.BOTH); const shaderProgram = shaderBuilder.buildShaderProgram(context); checkVertexShader( shaderProgram, [], - ["uniform vec3 u_gridDimensions;", "uniform float u_time;"] + ["uniform vec3 u_gridDimensions;", "uniform float u_time;"], ); checkFragmentShader( shaderProgram, [], - ["uniform vec2 u_mousePosition;", "uniform float u_time;"] + ["uniform vec2 u_mousePosition;", "uniform float u_time;"], ); }); @@ -593,7 +593,7 @@ describe( const normalLocation = shaderBuilder.addAttribute("vec3", "a_normal"); const positionLocation = shaderBuilder.setPositionAttribute( "vec3", - "a_position" + "a_position", ); expect(positionLocation).toBe(0); expect(normalLocation).toBe(1); @@ -614,7 +614,7 @@ describe( const shaderBuilder = new ShaderBuilder(); const positionLocation = shaderBuilder.setPositionAttribute( "vec3", - "a_position" + "a_position", ); expect(positionLocation).toBe(0); expect(function () { @@ -724,10 +724,10 @@ describe( const expectedVaryings = ["vec2 v_uv;"]; const expectedVertexVaryings = expectedVaryings.map( - (varying) => `out ${varying}` + (varying) => `out ${varying}`, ); const expectedFragmentVaryings = expectedVaryings.map( - (varying) => `in ${varying}` + (varying) => `in ${varying}`, ); const shaderProgram = shaderBuilder.buildShaderProgram(context); @@ -837,24 +837,24 @@ describe( const expectedVaryings = ["vec2 v_uv;"]; const expectedVertexVaryings = expectedVaryings.map( - (varying) => `out ${varying}` + (varying) => `out ${varying}`, ); const expectedFragmentVaryings = expectedVaryings.map( - (varying) => `in ${varying}` + (varying) => `in ${varying}`, ); const shaderProgram = shaderBuilder.buildShaderProgram(context); checkVertexShader( shaderProgram, [], - expectedAttributes.concat(expectedVertexVaryings, vertexLines) + expectedAttributes.concat(expectedVertexVaryings, vertexLines), ); checkFragmentShader( shaderProgram, ["BLUE_TINT 0.5"], - expectedFragmentVaryings.concat(fragmentLines) + expectedFragmentVaryings.concat(fragmentLines), ); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Renderer/ShaderCacheSpec.js b/packages/engine/Specs/Renderer/ShaderCacheSpec.js index 3a71abfea11d..0636a743e4c9 100644 --- a/packages/engine/Specs/Renderer/ShaderCacheSpec.js +++ b/packages/engine/Specs/Renderer/ShaderCacheSpec.js @@ -73,11 +73,11 @@ describe( // only be called the first time a shader is created. spyOn( ShaderSource.prototype, - "createCombinedVertexShader" + "createCombinedVertexShader", ).and.callThrough(); spyOn( ShaderSource.prototype, - "createCombinedFragmentShader" + "createCombinedFragmentShader", ).and.callThrough(); const cache = new ShaderCache(context); @@ -101,10 +101,10 @@ describe( expect(cache.numberOfShaders).toEqual(1); expect( - ShaderSource.prototype.createCombinedVertexShader + ShaderSource.prototype.createCombinedVertexShader, ).toHaveBeenCalledTimes(1); expect( - ShaderSource.prototype.createCombinedFragmentShader + ShaderSource.prototype.createCombinedFragmentShader, ).toHaveBeenCalledTimes(1); sp.destroy(); @@ -138,11 +138,11 @@ describe( // only be called the first time a shader is created. spyOn( ShaderSource.prototype, - "createCombinedVertexShader" + "createCombinedVertexShader", ).and.callThrough(); spyOn( ShaderSource.prototype, - "createCombinedFragmentShader" + "createCombinedFragmentShader", ).and.callThrough(); const cache = new ShaderCache(context); @@ -162,10 +162,10 @@ describe( expect(cache.numberOfShaders).toEqual(1); expect( - ShaderSource.prototype.createCombinedVertexShader + ShaderSource.prototype.createCombinedVertexShader, ).toHaveBeenCalledTimes(1); expect( - ShaderSource.prototype.createCombinedFragmentShader + ShaderSource.prototype.createCombinedFragmentShader, ).toHaveBeenCalledTimes(1); sp.destroy(); @@ -371,5 +371,5 @@ describe( expect(cache.isDestroyed()).toEqual(false); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Renderer/ShaderDestinationSpec.js b/packages/engine/Specs/Renderer/ShaderDestinationSpec.js index b517d117eb15..bb723aebd27e 100644 --- a/packages/engine/Specs/Renderer/ShaderDestinationSpec.js +++ b/packages/engine/Specs/Renderer/ShaderDestinationSpec.js @@ -9,13 +9,13 @@ describe("Renderer/ShaderDestination", function () { it("includesVertexShader works", function () { expect( - ShaderDestination.includesVertexShader(ShaderDestination.VERTEX) + ShaderDestination.includesVertexShader(ShaderDestination.VERTEX), ).toBe(true); expect( - ShaderDestination.includesVertexShader(ShaderDestination.FRAGMENT) + ShaderDestination.includesVertexShader(ShaderDestination.FRAGMENT), ).toBe(false); expect(ShaderDestination.includesVertexShader(ShaderDestination.BOTH)).toBe( - true + true, ); }); @@ -27,13 +27,13 @@ describe("Renderer/ShaderDestination", function () { it("includesFragmentShader works", function () { expect( - ShaderDestination.includesFragmentShader(ShaderDestination.VERTEX) + ShaderDestination.includesFragmentShader(ShaderDestination.VERTEX), ).toBe(false); expect( - ShaderDestination.includesFragmentShader(ShaderDestination.FRAGMENT) + ShaderDestination.includesFragmentShader(ShaderDestination.FRAGMENT), ).toBe(true); expect( - ShaderDestination.includesFragmentShader(ShaderDestination.BOTH) + ShaderDestination.includesFragmentShader(ShaderDestination.BOTH), ).toBe(true); }); }); diff --git a/packages/engine/Specs/Renderer/ShaderProgramSpec.js b/packages/engine/Specs/Renderer/ShaderProgramSpec.js index d40ad7c34a05..9d57cc1346de 100644 --- a/packages/engine/Specs/Renderer/ShaderProgramSpec.js +++ b/packages/engine/Specs/Renderer/ShaderProgramSpec.js @@ -566,5 +566,5 @@ describe( }).toThrowDeveloperError(); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Renderer/ShaderSourceSpec.js b/packages/engine/Specs/Renderer/ShaderSourceSpec.js index 8a63340b072e..2645b15f5839 100644 --- a/packages/engine/Specs/Renderer/ShaderSourceSpec.js +++ b/packages/engine/Specs/Renderer/ShaderSourceSpec.js @@ -5,7 +5,8 @@ describe("Renderer/ShaderSource", function () { webgl2: true, }; - const fragColorDeclarationRegex = /layout\s*\(location\s*=\s*0\)\s*out\s+vec4\s+out_FragColor;/g; + const fragColorDeclarationRegex = + /layout\s*\(location\s*=\s*0\)\s*out\s+vec4\s+out_FragColor;/g; it("combines #defines", function () { const source = new ShaderSource({ @@ -108,7 +109,7 @@ describe("Renderer/ShaderSource", function () { }); expect(source.getCacheKey()).toBe( - "A,B,C:in:false:void main() { out_FragColor = vec4(1.0); }" + "A,B,C:in:false:void main() { out_FragColor = vec4(1.0); }", ); }); @@ -132,7 +133,7 @@ describe("Renderer/ShaderSource", function () { }); expect(source.getCacheKey()).toBe( - ":undefined:true:vec4 getColor() { return vec4(1.0, 0.0, 0.0, 1.0); }\nvoid main() { out_FragColor = getColor(); }" + ":undefined:true:vec4 getColor() { return vec4(1.0, 0.0, 0.0, 1.0); }\nvoid main() { out_FragColor = getColor(); }", ); }); diff --git a/packages/engine/Specs/Renderer/TextureCacheSpec.js b/packages/engine/Specs/Renderer/TextureCacheSpec.js index 162ae79b6118..e116b448f8f0 100644 --- a/packages/engine/Specs/Renderer/TextureCacheSpec.js +++ b/packages/engine/Specs/Renderer/TextureCacheSpec.js @@ -121,5 +121,5 @@ describe( expect(cache.isDestroyed()).toEqual(false); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Renderer/TextureSpec.js b/packages/engine/Specs/Renderer/TextureSpec.js index 1399d971fef2..5482c762c537 100644 --- a/packages/engine/Specs/Renderer/TextureSpec.js +++ b/packages/engine/Specs/Renderer/TextureSpec.js @@ -50,26 +50,26 @@ describe( promises.push( Resource.fetchImage("./Data/Images/Green.png").then(function (image) { greenImage = image; - }) + }), ); promises.push( Resource.fetchImage("./Data/Images/Blue.png").then(function (image) { blueImage = image; - }) + }), ); promises.push( - Resource.fetchImage("./Data/Images/BlueAlpha.png").then(function ( - image - ) { - blueAlphaImage = image; - }) + Resource.fetchImage("./Data/Images/BlueAlpha.png").then( + function (image) { + blueAlphaImage = image; + }, + ), ); promises.push( - Resource.fetchImage("./Data/Images/BlueOverRed.png").then(function ( - image - ) { - blueOverRedImage = image; - }) + Resource.fetchImage("./Data/Images/BlueOverRed.png").then( + function (image) { + blueOverRedImage = image; + }, + ), ); // Load this image as an ImageBitmap promises.push( @@ -78,14 +78,14 @@ describe( preferImageBitmap: true, }).then(function (image) { blueOverRedFlippedImage = image; - }) + }), ); promises.push( - Resource.fetchImage("./Data/Images/Red16x16.png").then(function ( - image - ) { - red16x16Image = image; - }) + Resource.fetchImage("./Data/Images/Red16x16.png").then( + function (image) { + red16x16Image = image; + }, + ), ); const resource = Resource.createIfNeeded("./Data/Images/Green4x4.ktx2"); @@ -96,14 +96,14 @@ describe( return promise.then(function (result) { greenKTX2Image = result; }); - }) + }), ); if (context.supportsBasis) { promises.push( loadKTX2("./Data/Images/Green4x4_ETC1S.ktx2").then(function (image) { greenBasisKTX2Image = image; - }) + }), ); } @@ -146,7 +146,7 @@ describe( expect(texture.sizeInBytes).toEqual( expectedWidth * expectedHeight * - PixelFormat.componentsLength(texture.pixelFormat) + PixelFormat.componentsLength(texture.pixelFormat), ); command.color = Color.WHITE; @@ -190,7 +190,7 @@ describe( expect(texture.sizeInBytes).toEqual( expectedWidth * expectedHeight * - PixelFormat.componentsLength(texture.pixelFormat) + PixelFormat.componentsLength(texture.pixelFormat), ); // Clear to white @@ -224,41 +224,41 @@ describe( const topColor = new Color(0.0, 0.0, 1.0, 1.0); let bottomColor = new Color(1.0, 0.0, 0.0, 1.0); - return Resource.supportsImageBitmapOptions().then(function ( - supportsImageBitmapOptions - ) { - if (supportsImageBitmapOptions) { - // When imageBitmapOptions is supported, flipY on texture upload is ignored. - bottomColor = topColor; - } + return Resource.supportsImageBitmapOptions().then( + function (supportsImageBitmapOptions) { + if (supportsImageBitmapOptions) { + // When imageBitmapOptions is supported, flipY on texture upload is ignored. + bottomColor = topColor; + } - texture = new Texture({ - context: context, - source: blueOverRedFlippedImage, - pixelFormat: PixelFormat.RGBA, - flipY: false, - }); + texture = new Texture({ + context: context, + source: blueOverRedFlippedImage, + pixelFormat: PixelFormat.RGBA, + flipY: false, + }); - expect({ - context: context, - fragmentShader: fs, - uniformMap: uniformMap, - }).contextToRender(topColor.toBytes()); + expect({ + context: context, + fragmentShader: fs, + uniformMap: uniformMap, + }).contextToRender(topColor.toBytes()); - // Flip the texture. - texture = new Texture({ - context: context, - source: blueOverRedFlippedImage, - pixelFormat: PixelFormat.RGBA, - flipY: true, - }); + // Flip the texture. + texture = new Texture({ + context: context, + source: blueOverRedFlippedImage, + pixelFormat: PixelFormat.RGBA, + flipY: true, + }); - expect({ - context: context, - fragmentShader: fs, - uniformMap: uniformMap, - }).contextToRender(bottomColor.toBytes()); - }); + expect({ + context: context, + fragmentShader: fs, + uniformMap: uniformMap, + }).contextToRender(bottomColor.toBytes()); + }, + ); }); it("draws the expected floating-point texture color", function () { @@ -391,14 +391,7 @@ describe( const color0 = new Color(0.2, 0.4, 0.6, 1.0); const color1 = new Color(0.1, 0.3, 0.5, 1.0); const floats = new Uint16Array([ - 12902, - 13926, - 14541, - 15360, - 11878, - 13517, - 14336, - 15360, + 12902, 13926, 14541, 15360, 11878, 13517, 14336, 15360, ]); texture = new Texture({ @@ -752,7 +745,7 @@ describe( texture.generateMipmap(); expect(texture.sizeInBytes).toEqualEpsilon( (16 * 16 + 8 * 8 + 4 * 4 + 2 * 2 + 1) * 4, - 1 + 1, ); expect({ @@ -845,7 +838,7 @@ describe( height, pixelFormat, pixelDatatype, - expectedSize + expectedSize, ) { texture = new Texture({ context: context, @@ -866,21 +859,21 @@ describe( 16, PixelFormat.DEPTH_COMPONENT, PixelDatatype.UNSIGNED_SHORT, - 256 * 2 + 256 * 2, ); expectTextureByteSize( 16, 16, PixelFormat.DEPTH_COMPONENT, PixelDatatype.UNSIGNED_INT, - 256 * 4 + 256 * 4, ); expectTextureByteSize( 16, 16, PixelFormat.DEPTH_STENCIL, PixelDatatype.UNSIGNED_INT_24_8, - 256 * 4 + 256 * 4, ); } @@ -890,35 +883,35 @@ describe( 16, PixelFormat.ALPHA, PixelDatatype.UNSIGNED_BYTE, - 256 + 256, ); expectTextureByteSize( 16, 16, PixelFormat.RGB, PixelDatatype.UNSIGNED_BYTE, - 256 * 3 + 256 * 3, ); expectTextureByteSize( 16, 16, PixelFormat.RGBA, PixelDatatype.UNSIGNED_BYTE, - 256 * 4 + 256 * 4, ); expectTextureByteSize( 16, 16, PixelFormat.LUMINANCE, PixelDatatype.UNSIGNED_BYTE, - 256 + 256, ); expectTextureByteSize( 16, 16, PixelFormat.LUMINANCE_ALPHA, PixelDatatype.UNSIGNED_BYTE, - 256 * 2 + 256 * 2, ); }); @@ -1531,5 +1524,5 @@ describe( }).toThrowDeveloperError(); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Renderer/UniformSpec.js b/packages/engine/Specs/Renderer/UniformSpec.js index a783e1a0bb38..aee94f158bae 100644 --- a/packages/engine/Specs/Renderer/UniformSpec.js +++ b/packages/engine/Specs/Renderer/UniformSpec.js @@ -369,7 +369,7 @@ describe( 13.0, 14.0, 15.0, - 16.0 + 16.0, ); }, }; @@ -798,7 +798,7 @@ describe( 13.0, 14.0, 15.0, - 16.0 + 16.0, ), new Matrix4( 11.0, @@ -816,7 +816,7 @@ describe( 113.0, 114.0, 115.0, - 116.0 + 116.0, ), ]; }, @@ -844,5 +844,5 @@ describe( }).contextToRender(); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Renderer/VertexArrayFacadeSpec.js b/packages/engine/Specs/Renderer/VertexArrayFacadeSpec.js index 4600ed72f465..56e7f6fec589 100644 --- a/packages/engine/Specs/Renderer/VertexArrayFacadeSpec.js +++ b/packages/engine/Specs/Renderer/VertexArrayFacadeSpec.js @@ -31,7 +31,7 @@ describe( usage: BufferUsage.STATIC_DRAW, }, ], - 1 + 1, ); const writer = vaf.writers[positionIndex]; @@ -42,14 +42,14 @@ describe( expect(vaf.va[0].va.getAttribute(0).vertexBuffer).toBeDefined(); expect(vaf.va[0].va.getAttribute(0).vertexBuffer.sizeInBytes).toEqual( - 1 * 3 * 4 + 1 * 3 * 4, ); expect(vaf.va[0].va.getAttribute(0).vertexBuffer.usage).toEqual( - BufferUsage.STATIC_DRAW + BufferUsage.STATIC_DRAW, ); expect(vaf.va[0].va.getAttribute(0).componentsPerAttribute).toEqual(3); expect(vaf.va[0].va.getAttribute(0).componentDatatype).toEqual( - ComponentDatatype.FLOAT + ComponentDatatype.FLOAT, ); expect(vaf.va[0].va.getAttribute(0).offsetInBytes).toEqual(0); expect(vaf.va[0].va.getAttribute(0).strideInBytes).toEqual(3 * 4); @@ -67,7 +67,7 @@ describe( usage: BufferUsage.STATIC_DRAW, }, ], - 1 + 1, ); const writer = vaf.writers[positionIndex]; @@ -81,14 +81,14 @@ describe( expect(vaf.va[0].va.getAttribute(0).vertexBuffer).toBeDefined(); expect(vaf.va[0].va.getAttribute(0).vertexBuffer.sizeInBytes).toEqual( - 2 * 3 * 4 + 2 * 3 * 4, ); expect(vaf.va[0].va.getAttribute(0).vertexBuffer.usage).toEqual( - BufferUsage.STATIC_DRAW + BufferUsage.STATIC_DRAW, ); expect(vaf.va[0].va.getAttribute(0).componentsPerAttribute).toEqual(3); expect(vaf.va[0].va.getAttribute(0).componentDatatype).toEqual( - ComponentDatatype.FLOAT + ComponentDatatype.FLOAT, ); expect(vaf.va[0].va.getAttribute(0).offsetInBytes).toEqual(0); expect(vaf.va[0].va.getAttribute(0).strideInBytes).toEqual(3 * 4); @@ -113,7 +113,7 @@ describe( usage: BufferUsage.STATIC_DRAW, }, ], - 1 + 1, ); const positionWriter = vaf.writers[positionIndex]; @@ -129,29 +129,29 @@ describe( // Position attribute expect(vaf.va[0].va.getAttribute(0).vertexBuffer).toBeDefined(); expect(vaf.va[0].va.getAttribute(0).vertexBuffer.sizeInBytes).toEqual( - 1 * (3 * 4 + 4 * 1) + 1 * (3 * 4 + 4 * 1), ); expect(vaf.va[0].va.getAttribute(0).vertexBuffer.usage).toEqual( - BufferUsage.STATIC_DRAW + BufferUsage.STATIC_DRAW, ); expect(vaf.va[0].va.getAttribute(0).componentsPerAttribute).toEqual(3); expect(vaf.va[0].va.getAttribute(0).componentDatatype).toEqual( - ComponentDatatype.FLOAT + ComponentDatatype.FLOAT, ); expect(vaf.va[0].va.getAttribute(0).offsetInBytes).toEqual(0); expect(vaf.va[0].va.getAttribute(0).strideInBytes).toEqual(3 * 4 + 4 * 1); // Color attribute expect(vaf.va[0].va.getAttribute(1).vertexBuffer).toEqual( - vaf.va[0].va.getAttribute(0).vertexBuffer + vaf.va[0].va.getAttribute(0).vertexBuffer, ); expect(vaf.va[0].va.getAttribute(1).componentsPerAttribute).toEqual(4); expect(vaf.va[0].va.getAttribute(1).componentDatatype).toEqual( - ComponentDatatype.UNSIGNED_BYTE + ComponentDatatype.UNSIGNED_BYTE, ); expect(vaf.va[0].va.getAttribute(1).offsetInBytes).toEqual(3 * 4); expect(vaf.va[0].va.getAttribute(1).strideInBytes).toEqual( - vaf.va[0].va.getAttribute(0).strideInBytes + vaf.va[0].va.getAttribute(0).strideInBytes, ); }); @@ -175,7 +175,7 @@ describe( normalize: true, }, ], - 1 + 1, ); const positionWriter = vaf.writers[positionIndex]; @@ -191,14 +191,14 @@ describe( // Position attribute expect(vaf.va[0].va.getAttribute(0).vertexBuffer).toBeDefined(); expect(vaf.va[0].va.getAttribute(0).vertexBuffer.sizeInBytes).toEqual( - 1 * (3 * 4) + 1 * (3 * 4), ); expect(vaf.va[0].va.getAttribute(0).vertexBuffer.usage).toEqual( - BufferUsage.STATIC_DRAW + BufferUsage.STATIC_DRAW, ); expect(vaf.va[0].va.getAttribute(0).componentsPerAttribute).toEqual(3); expect(vaf.va[0].va.getAttribute(0).componentDatatype).toEqual( - ComponentDatatype.FLOAT + ComponentDatatype.FLOAT, ); expect(vaf.va[0].va.getAttribute(0).offsetInBytes).toEqual(0); expect(vaf.va[0].va.getAttribute(0).strideInBytes).toEqual(3 * 4); @@ -206,14 +206,14 @@ describe( // Texture coordinate attribute expect(vaf.va[0].va.getAttribute(1).vertexBuffer).toBeDefined(); expect(vaf.va[0].va.getAttribute(1).vertexBuffer.sizeInBytes).toEqual( - 1 * (2 * 2) + 1 * (2 * 2), ); expect(vaf.va[0].va.getAttribute(1).vertexBuffer.usage).toEqual( - BufferUsage.DYNAMIC_DRAW + BufferUsage.DYNAMIC_DRAW, ); expect(vaf.va[0].va.getAttribute(1).componentsPerAttribute).toEqual(2); expect(vaf.va[0].va.getAttribute(1).componentDatatype).toEqual( - ComponentDatatype.UNSIGNED_SHORT + ComponentDatatype.UNSIGNED_SHORT, ); expect(vaf.va[0].va.getAttribute(1).offsetInBytes).toEqual(0); expect(vaf.va[0].va.getAttribute(1).strideInBytes).toEqual(2 * 2); @@ -238,7 +238,7 @@ describe( usage: BufferUsage.STREAM_DRAW, }, ], - 2 + 2, ); const positionWriter = vaf.writers[positionIndex]; @@ -268,14 +268,14 @@ describe( // Position attribute expect(vaf.va[0].va.getAttribute(1).vertexBuffer).toBeDefined(); expect(vaf.va[0].va.getAttribute(1).vertexBuffer.sizeInBytes).toEqual( - 2 * (3 * 4) + 2 * (3 * 4), ); expect(vaf.va[0].va.getAttribute(1).vertexBuffer.usage).toEqual( - BufferUsage.STATIC_DRAW + BufferUsage.STATIC_DRAW, ); expect(vaf.va[0].va.getAttribute(1).componentsPerAttribute).toEqual(3); expect(vaf.va[0].va.getAttribute(1).componentDatatype).toEqual( - ComponentDatatype.FLOAT + ComponentDatatype.FLOAT, ); expect(vaf.va[0].va.getAttribute(1).offsetInBytes).toEqual(0); expect(vaf.va[0].va.getAttribute(1).strideInBytes).toEqual(3 * 4); @@ -283,14 +283,14 @@ describe( // Temperature attribute expect(vaf.va[0].va.getAttribute(0).vertexBuffer).toBeDefined(); expect(vaf.va[0].va.getAttribute(0).vertexBuffer.sizeInBytes).toEqual( - 2 * 4 + 2 * 4, ); expect(vaf.va[0].va.getAttribute(0).vertexBuffer.usage).toEqual( - BufferUsage.STREAM_DRAW + BufferUsage.STREAM_DRAW, ); expect(vaf.va[0].va.getAttribute(0).componentsPerAttribute).toEqual(1); expect(vaf.va[0].va.getAttribute(0).componentDatatype).toEqual( - ComponentDatatype.FLOAT + ComponentDatatype.FLOAT, ); expect(vaf.va[0].va.getAttribute(0).offsetInBytes).toEqual(0); expect(vaf.va[0].va.getAttribute(0).strideInBytes).toEqual(1 * 4); @@ -308,7 +308,7 @@ describe( usage: BufferUsage.STATIC_DRAW, }, ], - 1 + 1, ); const writer = vaf.writers[positionIndex]; @@ -326,7 +326,7 @@ describe( expect(vbBeforeResize.isDestroyed()).toBe(true); expect(vaf.va[0].va.getAttribute(0).vertexBuffer).not.toBe( - vbBeforeResize + vbBeforeResize, ); }); @@ -342,7 +342,7 @@ describe( usage: BufferUsage.STATIC_DRAW, }, ], - 1 + 1, ); expect(vaf.isDestroyed()).toBe(false); }); @@ -420,7 +420,7 @@ describe( usage: BufferUsage.STATIC_DRAW, }, ], - 10 + 10, ); expect(function () { @@ -436,5 +436,5 @@ describe( }).toThrowDeveloperError(); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Renderer/VertexArrayFactorySpec.js b/packages/engine/Specs/Renderer/VertexArrayFactorySpec.js index d0042e076c39..579e735dd04b 100644 --- a/packages/engine/Specs/Renderer/VertexArrayFactorySpec.js +++ b/packages/engine/Specs/Renderer/VertexArrayFactorySpec.js @@ -82,16 +82,16 @@ describe( const position = geometry.attributes.position; expect(va.getAttribute(0).index).toEqual(0); expect(va.getAttribute(0).componentDatatype).toEqual( - position.componentDatatype + position.componentDatatype, ); expect(va.getAttribute(0).componentsPerAttribute).toEqual( - position.componentsPerAttribute + position.componentsPerAttribute, ); expect(va.getAttribute(0).offsetInBytes).toEqual(0); expect(va.getAttribute(0).strideInBytes).toEqual(0); // Tightly packed expect(va.getAttribute(0).vertexBuffer.usage).toEqual( - BufferUsage.DYNAMIC_DRAW + BufferUsage.DYNAMIC_DRAW, ); // Default }); @@ -121,19 +121,19 @@ describe( const position = geometry.attributes.position; expect(va.getAttribute(0).index).toEqual(0); expect(va.getAttribute(0).componentDatatype).toEqual( - position.componentDatatype + position.componentDatatype, ); expect(va.getAttribute(0).componentsPerAttribute).toEqual( - position.componentsPerAttribute + position.componentsPerAttribute, ); expect(va.getAttribute(0).offsetInBytes).toEqual(0); expect(va.getAttribute(0).strideInBytes).toEqual( ComponentDatatype.getSizeInBytes(position.componentDatatype) * - position.componentsPerAttribute + position.componentsPerAttribute, ); expect(va.getAttribute(0).vertexBuffer.usage).toEqual( - BufferUsage.STATIC_DRAW + BufferUsage.STATIC_DRAW, ); }); @@ -166,10 +166,10 @@ describe( const position = geometry.attributes.customPosition; expect(va.getAttribute(0).index).toEqual(0); expect(va.getAttribute(0).componentDatatype).toEqual( - position.componentDatatype + position.componentDatatype, ); expect(va.getAttribute(0).componentsPerAttribute).toEqual( - position.componentsPerAttribute + position.componentsPerAttribute, ); expect(va.getAttribute(0).offsetInBytes).toEqual(0); expect(va.getAttribute(0).strideInBytes).toEqual(0); // Tightly packed @@ -177,16 +177,16 @@ describe( const normal = geometry.attributes.customNormal; expect(va.getAttribute(1).index).toEqual(1); expect(va.getAttribute(1).componentDatatype).toEqual( - normal.componentDatatype + normal.componentDatatype, ); expect(va.getAttribute(1).componentsPerAttribute).toEqual( - normal.componentsPerAttribute + normal.componentsPerAttribute, ); expect(va.getAttribute(1).offsetInBytes).toEqual(0); expect(va.getAttribute(1).strideInBytes).toEqual(0); // Tightly packed expect(va.getAttribute(0).vertexBuffer).not.toBe( - va.getAttribute(1).vertexBuffer + va.getAttribute(1).vertexBuffer, ); }); @@ -227,29 +227,29 @@ describe( expect(va.getAttribute(0).index).toEqual(0); expect(va.getAttribute(0).componentDatatype).toEqual( - position.componentDatatype + position.componentDatatype, ); expect(va.getAttribute(0).componentsPerAttribute).toEqual( - position.componentsPerAttribute + position.componentsPerAttribute, ); expect(va.getAttribute(0).offsetInBytes).toEqual(0); expect(va.getAttribute(0).strideInBytes).toEqual(expectedStride); expect(va.getAttribute(1).index).toEqual(1); expect(va.getAttribute(1).componentDatatype).toEqual( - normal.componentDatatype + normal.componentDatatype, ); expect(va.getAttribute(1).componentsPerAttribute).toEqual( - normal.componentsPerAttribute + normal.componentsPerAttribute, ); expect(va.getAttribute(1).offsetInBytes).toEqual( ComponentDatatype.getSizeInBytes(position.componentDatatype) * - position.componentsPerAttribute + position.componentsPerAttribute, ); expect(va.getAttribute(1).strideInBytes).toEqual(expectedStride); expect(va.getAttribute(0).vertexBuffer).toBe( - va.getAttribute(1).vertexBuffer + va.getAttribute(1).vertexBuffer, ); }); @@ -290,29 +290,29 @@ describe( expect(va.getAttribute(0).index).toEqual(0); expect(va.getAttribute(0).componentDatatype).toEqual( - position.componentDatatype + position.componentDatatype, ); expect(va.getAttribute(0).componentsPerAttribute).toEqual( - position.componentsPerAttribute + position.componentsPerAttribute, ); expect(va.getAttribute(0).offsetInBytes).toEqual(0); expect(va.getAttribute(0).strideInBytes).toEqual(expectedStride); expect(va.getAttribute(1).index).toEqual(1); expect(va.getAttribute(1).componentDatatype).toEqual( - colors.componentDatatype + colors.componentDatatype, ); expect(va.getAttribute(1).componentsPerAttribute).toEqual( - colors.componentsPerAttribute + colors.componentsPerAttribute, ); expect(va.getAttribute(1).offsetInBytes).toEqual( ComponentDatatype.getSizeInBytes(position.componentDatatype) * - position.componentsPerAttribute + position.componentsPerAttribute, ); expect(va.getAttribute(1).strideInBytes).toEqual(expectedStride); expect(va.getAttribute(0).vertexBuffer).toBe( - va.getAttribute(1).vertexBuffer + va.getAttribute(1).vertexBuffer, ); }); @@ -338,9 +338,8 @@ describe( primitiveType: PrimitiveType.POINTS, }); - const attributeLocations = GeometryPipeline.createAttributeLocations( - geometry - ); + const attributeLocations = + GeometryPipeline.createAttributeLocations(geometry); const va = VertexArray.fromGeometry({ context: context, geometry: geometry, @@ -409,9 +408,8 @@ describe( primitiveType: PrimitiveType.POINTS, }); - const attributeLocations = GeometryPipeline.createAttributeLocations( - geometry - ); + const attributeLocations = + GeometryPipeline.createAttributeLocations(geometry); const va = VertexArray.fromGeometry({ context: context, geometry: geometry, @@ -494,9 +492,8 @@ describe( primitiveType: PrimitiveType.POINTS, }); - const attributeLocations = GeometryPipeline.createAttributeLocations( - geometry - ); + const attributeLocations = + GeometryPipeline.createAttributeLocations(geometry); const va = VertexArray.fromGeometry({ context: context, geometry: geometry, @@ -571,9 +568,8 @@ describe( primitiveType: PrimitiveType.POINTS, }); - const attributeLocations = GeometryPipeline.createAttributeLocations( - geometry - ); + const attributeLocations = + GeometryPipeline.createAttributeLocations(geometry); const va = VertexArray.fromGeometry({ context: context, geometry: geometry, @@ -676,7 +672,7 @@ describe( expect(va.indexBuffer).toBeDefined(); expect(va.indexBuffer.usage).toEqual(BufferUsage.DYNAMIC_DRAW); // Default expect(va.indexBuffer.indexDatatype).toEqual( - IndexDatatype.UNSIGNED_SHORT + IndexDatatype.UNSIGNED_SHORT, ); expect(va.indexBuffer.numberOfIndices).toEqual(geometry.indices.length); }); @@ -736,5 +732,5 @@ describe( }).toThrowDeveloperError(); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Renderer/VertexArraySpec.js b/packages/engine/Specs/Renderer/VertexArraySpec.js index f9dd7f36f8dc..bfc5834735e5 100644 --- a/packages/engine/Specs/Renderer/VertexArraySpec.js +++ b/packages/engine/Specs/Renderer/VertexArraySpec.js @@ -79,7 +79,7 @@ describe( expect(va.getAttribute(0).vertexBuffer).toEqual(positionBuffer); expect(va.getAttribute(0).componentsPerAttribute).toEqual(3); expect(va.getAttribute(0).componentDatatype).toEqual( - ComponentDatatype.FLOAT + ComponentDatatype.FLOAT, ); expect(va.getAttribute(0).normalize).toEqual(false); expect(va.getAttribute(0).offsetInBytes).toEqual(0); @@ -190,7 +190,7 @@ describe( expect(va.getAttribute(0).vertexBuffer).toEqual(positionBuffer); expect(va.getAttribute(0).componentsPerAttribute).toEqual(3); expect(va.getAttribute(0).componentDatatype).toEqual( - ComponentDatatype.FLOAT + ComponentDatatype.FLOAT, ); expect(va.getAttribute(0).normalize).toEqual(false); expect(va.getAttribute(0).offsetInBytes).toEqual(0); @@ -908,5 +908,5 @@ describe( contextWithoutInstancing.destroyForSpecs(); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Renderer/loadCubeMapSpec.js b/packages/engine/Specs/Renderer/loadCubeMapSpec.js index de41c7154dfa..70ee6f6ad8cd 100644 --- a/packages/engine/Specs/Renderer/loadCubeMapSpec.js +++ b/packages/engine/Specs/Renderer/loadCubeMapSpec.js @@ -292,5 +292,5 @@ describe( }).toThrowDeveloperError(); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/AppearanceSpec.js b/packages/engine/Specs/Scene/AppearanceSpec.js index 05cd5876c728..43fb29cabc60 100644 --- a/packages/engine/Specs/Scene/AppearanceSpec.js +++ b/packages/engine/Specs/Scene/AppearanceSpec.js @@ -55,7 +55,7 @@ describe("Scene/Appearance", function () { }); expect(appearance.getFragmentShaderSource().indexOf(fs)).toBeGreaterThan( - -1 + -1, ); }); diff --git a/packages/engine/Specs/Scene/ArcGisMapServerImageryProviderSpec.js b/packages/engine/Specs/Scene/ArcGisMapServerImageryProviderSpec.js index 61705dc67bfb..94000fee5b82 100644 --- a/packages/engine/Specs/Scene/ArcGisMapServerImageryProviderSpec.js +++ b/packages/engine/Specs/Scene/ArcGisMapServerImageryProviderSpec.js @@ -46,22 +46,24 @@ describe("Scene/ArcGisMapServerImageryProvider", function () { }); function stubJSONCall(baseUrl, result, withProxy, token) { - spyOn(Resource._Implementations, "loadWithXhr").and.callFake(function ( - url, - responseType, - method, - data, - headers, - deferred, - overrideMimeType - ) { - deferred.resolve(JSON.stringify(result)); - }); + spyOn(Resource._Implementations, "loadWithXhr").and.callFake( + function ( + url, + responseType, + method, + data, + headers, + deferred, + overrideMimeType, + ) { + deferred.resolve(JSON.stringify(result)); + }, + ); } it("conforms to ImageryProvider interface", function () { expect(ArcGisMapServerImageryProvider).toConformToInterface( - ImageryProvider + ImageryProvider, ); }); @@ -100,9 +102,9 @@ describe("Scene/ArcGisMapServerImageryProvider", function () { it("fromUrl throws if url is not provided", async function () { await expectAsync( - ArcGisMapServerImageryProvider.fromUrl() + ArcGisMapServerImageryProvider.fromUrl(), ).toBeRejectedWithDeveloperError( - "url is required, actual value was undefined" + "url is required, actual value was undefined", ); }); @@ -134,10 +136,10 @@ describe("Scene/ArcGisMapServerImageryProvider", function () { const baseUrl = "//tiledArcGisMapServer.invalid/"; await expectAsync( - ArcGisMapServerImageryProvider.fromUrl(baseUrl) + ArcGisMapServerImageryProvider.fromUrl(baseUrl), ).toBeRejectedWithError( RuntimeError, - "An error occurred while accessing //tiledArcGisMapServer.invalid/" + "An error occurred while accessing //tiledArcGisMapServer.invalid/", ); }); @@ -180,10 +182,10 @@ describe("Scene/ArcGisMapServerImageryProvider", function () { stubJSONCall(baseUrl, unsupportedWKIDResult); await expectAsync( - ArcGisMapServerImageryProvider.fromUrl(baseUrl) + ArcGisMapServerImageryProvider.fromUrl(baseUrl), ).toBeRejectedWithError( RuntimeError, - "An error occurred while accessing //tiledArcGisMapServer.invalid/: Tile spatial reference WKID 1234 is not supported." + "An error occurred while accessing //tiledArcGisMapServer.invalid/: Tile spatial reference WKID 1234 is not supported.", ); }); @@ -235,10 +237,10 @@ describe("Scene/ArcGisMapServerImageryProvider", function () { stubJSONCall(baseUrl, unsupportedFullExtentWKIDResult); await expectAsync( - ArcGisMapServerImageryProvider.fromUrl(baseUrl) + ArcGisMapServerImageryProvider.fromUrl(baseUrl), ).toBeRejectedWithError( RuntimeError, - "An error occurred while accessing //tiledArcGisMapServer.invalid/: fullExtent.spatialReference WKID 1234 is not supported." + "An error occurred while accessing //tiledArcGisMapServer.invalid/: fullExtent.spatialReference WKID 1234 is not supported.", ); }); @@ -254,7 +256,7 @@ describe("Scene/ArcGisMapServerImageryProvider", function () { expect(provider.tilingScheme).toBeInstanceOf(WebMercatorTilingScheme); expect(provider.credit).toBeDefined(); expect(provider.tileDiscardPolicy).toBeInstanceOf( - DiscardMissingTileImagePolicy + DiscardMissingTileImagePolicy, ); expect(provider.rectangle).toEqual(new WebMercatorTilingScheme().rectangle); expect(provider.usingPrecachedTiles).toEqual(true); @@ -263,15 +265,15 @@ describe("Scene/ArcGisMapServerImageryProvider", function () { it("fromBasemapType throws without style", async function () { await expectAsync( - ArcGisMapServerImageryProvider.fromBasemapType() + ArcGisMapServerImageryProvider.fromBasemapType(), ).toBeRejectedWithDeveloperError( - "style is required, actual value was undefined" + "style is required, actual value was undefined", ); }); it("fromBasemapType throws with unknown style", async function () { await expectAsync( - ArcGisMapServerImageryProvider.fromBasemapType("unknown") + ArcGisMapServerImageryProvider.fromBasemapType("unknown"), ).toBeRejectedWithDeveloperError("Unsupported basemap type: unknown"); }); @@ -282,7 +284,7 @@ describe("Scene/ArcGisMapServerImageryProvider", function () { ArcGisBaseMapType.SATELLITE, { token: "myToken", - } + }, ); expect(provider.url).toContain(expectedUrl); @@ -295,16 +297,16 @@ describe("Scene/ArcGisMapServerImageryProvider", function () { const expectedUrl = ArcGisMapService.defaultWorldImageryServer; stubJSONCall(expectedUrl, webMercatorResult); const provider = await ArcGisMapServerImageryProvider.fromBasemapType( - ArcGisBaseMapType.SATELLITE + ArcGisBaseMapType.SATELLITE, ); expect(provider.url).toContain(expectedUrl); expect(provider.token).toBeDefined(); expect(provider.credit.html).toContain( - "This application is using a default ArcGIS access token." + "This application is using a default ArcGIS access token.", ); expect(provider.getTileCredits(0, 0, 0)[0].html).toEqual( - "Test copyright text" + "Test copyright text", ); }); @@ -323,7 +325,7 @@ describe("Scene/ArcGisMapServerImageryProvider", function () { expect(provider.tilingScheme).toBeInstanceOf(WebMercatorTilingScheme); expect(provider.credit).toBeDefined(); expect(provider.tileDiscardPolicy).toBeInstanceOf( - DiscardMissingTileImagePolicy + DiscardMissingTileImagePolicy, ); expect(provider.rectangle).toEqual(new WebMercatorTilingScheme().rectangle); expect(provider.usingPrecachedTiles).toEqual(true); @@ -332,14 +334,14 @@ describe("Scene/ArcGisMapServerImageryProvider", function () { Resource._Implementations.createImage = function ( request, crossOrigin, - deferred + deferred, ) { const url = request.url; if (/^blob:/.test(url)) { Resource._DefaultImplementations.createImage( request, crossOrigin, - deferred + deferred, ); } else { expect(url).toEqual(getAbsoluteUri(`${baseUrl}tile/0/0/0`)); @@ -348,7 +350,7 @@ describe("Scene/ArcGisMapServerImageryProvider", function () { Resource._DefaultImplementations.createImage( new Request({ url: "Data/Images/Red16x16.png" }), crossOrigin, - deferred + deferred, ); } }; @@ -360,7 +362,7 @@ describe("Scene/ArcGisMapServerImageryProvider", function () { data, headers, deferred, - overrideMimeType + overrideMimeType, ) { expect(url).toEqual(getAbsoluteUri(`${baseUrl}tile/0/0/0`)); @@ -371,7 +373,7 @@ describe("Scene/ArcGisMapServerImageryProvider", function () { method, data, headers, - deferred + deferred, ); }; @@ -428,7 +430,7 @@ describe("Scene/ArcGisMapServerImageryProvider", function () { expect(provider.tilingScheme).toBeInstanceOf(GeographicTilingScheme); expect(provider.credit).toBeDefined(); expect(provider.tileDiscardPolicy).toBeInstanceOf( - DiscardMissingTileImagePolicy + DiscardMissingTileImagePolicy, ); expect(provider.rectangle).toEqual(new GeographicTilingScheme().rectangle); expect(provider.usingPrecachedTiles).toEqual(true); @@ -436,7 +438,7 @@ describe("Scene/ArcGisMapServerImageryProvider", function () { Resource._Implementations.createImage = function ( request, crossOrigin, - deferred + deferred, ) { const url = request.url; if (/^blob:/.test(url) || supportsImageBitmapOptions) { @@ -447,7 +449,7 @@ describe("Scene/ArcGisMapServerImageryProvider", function () { deferred, true, false, - true + true, ); } else { expect(url).toEqual(getAbsoluteUri(`${baseUrl}tile/0/0/0`)); @@ -456,7 +458,7 @@ describe("Scene/ArcGisMapServerImageryProvider", function () { Resource._DefaultImplementations.createImage( new Request({ url: "Data/Images/Red16x16.png" }), crossOrigin, - deferred + deferred, ); } }; @@ -468,7 +470,7 @@ describe("Scene/ArcGisMapServerImageryProvider", function () { data, headers, deferred, - overrideMimeType + overrideMimeType, ) { expect(url).toEqual(getAbsoluteUri(`${baseUrl}tile/0/0/0`)); @@ -479,7 +481,7 @@ describe("Scene/ArcGisMapServerImageryProvider", function () { method, data, headers, - deferred + deferred, ); }; @@ -500,7 +502,7 @@ describe("Scene/ArcGisMapServerImageryProvider", function () { expect(provider.tilingScheme).toBeInstanceOf(GeographicTilingScheme); expect(provider.credit).toBeDefined(); expect(provider.tileDiscardPolicy).toBeInstanceOf( - DiscardMissingTileImagePolicy + DiscardMissingTileImagePolicy, ); expect(provider.rectangle).toEqual(new GeographicTilingScheme().rectangle); expect(provider.usingPrecachedTiles).toEqual(true); @@ -531,7 +533,7 @@ describe("Scene/ArcGisMapServerImageryProvider", function () { Resource._Implementations.createImage = function ( request, crossOrigin, - deferred + deferred, ) { const uri = new Uri(request.url); const params = queryToObject(uri.query()); @@ -540,7 +542,7 @@ describe("Scene/ArcGisMapServerImageryProvider", function () { uriWithoutQuery.query(""); expect(uriWithoutQuery.toString()).toEqual( - getAbsoluteUri(`${baseUrl}export`) + getAbsoluteUri(`${baseUrl}export`), ); expect(params.f).toEqual("image"); @@ -554,7 +556,7 @@ describe("Scene/ArcGisMapServerImageryProvider", function () { Resource._DefaultImplementations.createImage( new Request({ url: "Data/Images/Red16x16.png" }), crossOrigin, - deferred + deferred, ); }; @@ -594,7 +596,7 @@ describe("Scene/ArcGisMapServerImageryProvider", function () { copyrightText: "Test copyright text", }, undefined, - token + token, ); const provider = await ArcGisMapServerImageryProvider.fromUrl(baseUrl, { @@ -616,7 +618,7 @@ describe("Scene/ArcGisMapServerImageryProvider", function () { expect(provider.credit).toBeDefined(); expect(provider.tileDiscardPolicy).toBeUndefined(); expect(provider.rectangle).toEqual( - Rectangle.fromDegrees(1.0, 2.0, 3.0, 4.0) + Rectangle.fromDegrees(1.0, 2.0, 3.0, 4.0), ); expect(provider.usingPrecachedTiles).toBe(false); expect(provider.enablePickFeatures).toBe(false); @@ -625,7 +627,7 @@ describe("Scene/ArcGisMapServerImageryProvider", function () { Resource._Implementations.createImage = function ( request, crossOrigin, - deferred + deferred, ) { const uri = new Uri(request.url); const params = queryToObject(uri.query()); @@ -634,7 +636,7 @@ describe("Scene/ArcGisMapServerImageryProvider", function () { uriWithoutQuery.query(""); expect(uriWithoutQuery.toString()).toEqual( - getAbsoluteUri(`${baseUrl}export`) + getAbsoluteUri(`${baseUrl}export`), ); expect(params.f).toEqual("image"); @@ -650,7 +652,7 @@ describe("Scene/ArcGisMapServerImageryProvider", function () { Resource._DefaultImplementations.createImage( new Request({ url: "Data/Images/Red16x16.png" }), crossOrigin, - deferred + deferred, ); }; @@ -672,7 +674,7 @@ describe("Scene/ArcGisMapServerImageryProvider", function () { const expectedTileUrl = getAbsoluteUri( `${baseUrl}tile/0/0/0?${objectToQuery({ token: token, - })}` + })}`, ); expect(provider.url).toEqual(baseUrl); @@ -684,7 +686,7 @@ describe("Scene/ArcGisMapServerImageryProvider", function () { expect(provider.tilingScheme).toBeInstanceOf(WebMercatorTilingScheme); expect(provider.credit).toBeDefined(); expect(provider.tileDiscardPolicy).toBeInstanceOf( - DiscardMissingTileImagePolicy + DiscardMissingTileImagePolicy, ); expect(provider.rectangle).toEqual(new WebMercatorTilingScheme().rectangle); expect(provider.usingPrecachedTiles).toEqual(true); @@ -693,7 +695,7 @@ describe("Scene/ArcGisMapServerImageryProvider", function () { Resource._Implementations.createImage = function ( request, crossOrigin, - deferred + deferred, ) { const url = request.url; if (/^blob:/.test(url) || supportsImageBitmapOptions) { @@ -704,7 +706,7 @@ describe("Scene/ArcGisMapServerImageryProvider", function () { deferred, true, false, - true + true, ); } else { expect(url).toEqual(expectedTileUrl); @@ -713,7 +715,7 @@ describe("Scene/ArcGisMapServerImageryProvider", function () { Resource._DefaultImplementations.createImage( new Request({ url: "Data/Images/Red16x16.png" }), crossOrigin, - deferred + deferred, ); } }; @@ -725,7 +727,7 @@ describe("Scene/ArcGisMapServerImageryProvider", function () { data, headers, deferred, - overrideMimeType + overrideMimeType, ) { expect(url).toEqual(expectedTileUrl); @@ -736,7 +738,7 @@ describe("Scene/ArcGisMapServerImageryProvider", function () { method, data, headers, - deferred + deferred, ); }; @@ -797,16 +799,16 @@ describe("Scene/ArcGisMapServerImageryProvider", function () { const projection = new WebMercatorProjection(); const sw = projection.unproject( - new Cartesian2(1.1148026611962173e7, -6443518.758206591) + new Cartesian2(1.1148026611962173e7, -6443518.758206591), ); const ne = projection.unproject( - new Cartesian2(1.8830976498143446e7, -265936.19697360107) + new Cartesian2(1.8830976498143446e7, -265936.19697360107), ); const rectangle = new Rectangle( sw.longitude, sw.latitude, ne.longitude, - ne.latitude + ne.latitude, ); expect(provider.rectangle).toEqual(rectangle); }); @@ -865,10 +867,10 @@ describe("Scene/ArcGisMapServerImageryProvider", function () { expect(provider.rectangle.west).toBeGreaterThanOrEqual(-Math.PI); expect(provider.rectangle.east).toBeLessThanOrEqual(Math.PI); expect(provider.rectangle.south).toBeGreaterThanOrEqual( - -WebMercatorProjection.MaximumLatitude + -WebMercatorProjection.MaximumLatitude, ); expect(provider.rectangle.north).toBeLessThanOrEqual( - WebMercatorProjection.MaximumLatitude + WebMercatorProjection.MaximumLatitude, ); }); @@ -923,7 +925,7 @@ describe("Scene/ArcGisMapServerImageryProvider", function () { expect(provider.url).toEqual(baseUrl); expect(provider.rectangle).toEqual( - Rectangle.fromDegrees(-123.4, -23.2, 100.7, 45.2) + Rectangle.fromDegrees(-123.4, -23.2, 100.7, 45.2), ); }); @@ -975,10 +977,10 @@ describe("Scene/ArcGisMapServerImageryProvider", function () { stubJSONCall(baseUrl, unknownSpatialReferenceResult); await expectAsync( - ArcGisMapServerImageryProvider.fromUrl(baseUrl) + ArcGisMapServerImageryProvider.fromUrl(baseUrl), ).toBeRejectedWithError( RuntimeError, - "An error occurred while accessing //tiledArcGisMapServer.invalid/: Tile spatial reference WKID 1234 is not supported." + "An error occurred while accessing //tiledArcGisMapServer.invalid/: Tile spatial reference WKID 1234 is not supported.", ); }); @@ -989,7 +991,7 @@ describe("Scene/ArcGisMapServerImageryProvider", function () { "made/up/map/server", { usePreCachedTilesIfAvailable: false, - } + }, ); Resource._Implementations.loadWithXhr = function ( @@ -999,7 +1001,7 @@ describe("Scene/ArcGisMapServerImageryProvider", function () { data, headers, deferred, - overrideMimeType + overrideMimeType, ) { expect(url).toContain("identify"); Resource._DefaultImplementations.loadWithXhr( @@ -1009,7 +1011,7 @@ describe("Scene/ArcGisMapServerImageryProvider", function () { data, headers, deferred, - overrideMimeType + overrideMimeType, ); }; @@ -1021,8 +1023,8 @@ describe("Scene/ArcGisMapServerImageryProvider", function () { expect(firstResult.description).toContain("Hummock Grasses"); expect(firstResult.position).toEqual( new WebMercatorProjection().unproject( - new Cartesian3(1.481682457042425e7, -2710890.117898505) - ) + new Cartesian3(1.481682457042425e7, -2710890.117898505), + ), ); }); @@ -1032,7 +1034,7 @@ describe("Scene/ArcGisMapServerImageryProvider", function () { "made/up/map/server", { usePreCachedTilesIfAvailable: false, - } + }, ); Resource._Implementations.loadWithXhr = function ( @@ -1042,7 +1044,7 @@ describe("Scene/ArcGisMapServerImageryProvider", function () { data, headers, deferred, - overrideMimeType + overrideMimeType, ) { expect(url).toContain("identify"); Resource._DefaultImplementations.loadWithXhr( @@ -1052,7 +1054,7 @@ describe("Scene/ArcGisMapServerImageryProvider", function () { data, headers, deferred, - overrideMimeType + overrideMimeType, ); }; return provider @@ -1064,7 +1066,7 @@ describe("Scene/ArcGisMapServerImageryProvider", function () { expect(firstResult).toBeInstanceOf(ImageryLayerFeatureInfo); expect(firstResult.description).toContain("Hummock Grasses"); expect(firstResult.position).toEqual( - Cartographic.fromDegrees(123.45, -34.2) + Cartographic.fromDegrees(123.45, -34.2), ); }); }); @@ -1076,7 +1078,7 @@ describe("Scene/ArcGisMapServerImageryProvider", function () { { usePreCachedTilesIfAvailable: false, enablePickFeatures: false, - } + }, ); expect(provider.pickFeatures(0, 0, 0, 0.5, 0.5)).toBeUndefined(); @@ -1089,7 +1091,7 @@ describe("Scene/ArcGisMapServerImageryProvider", function () { { usePreCachedTilesIfAvailable: false, enablePickFeatures: true, - } + }, ); provider.enablePickFeatures = false; @@ -1103,7 +1105,7 @@ describe("Scene/ArcGisMapServerImageryProvider", function () { { usePreCachedTilesIfAvailable: false, enablePickFeatures: false, - } + }, ); provider.enablePickFeatures = true; @@ -1115,7 +1117,7 @@ describe("Scene/ArcGisMapServerImageryProvider", function () { data, headers, deferred, - overrideMimeType + overrideMimeType, ) { expect(url).toContain("identify"); Resource._DefaultImplementations.loadWithXhr( @@ -1125,7 +1127,7 @@ describe("Scene/ArcGisMapServerImageryProvider", function () { data, headers, deferred, - overrideMimeType + overrideMimeType, ); }; @@ -1142,7 +1144,7 @@ describe("Scene/ArcGisMapServerImageryProvider", function () { data, headers, deferred, - overrideMimeType + overrideMimeType, ) { const uri = new Uri(url); const query = queryToObject(uri.query()); @@ -1155,7 +1157,7 @@ describe("Scene/ArcGisMapServerImageryProvider", function () { data, headers, deferred, - overrideMimeType + overrideMimeType, ); }; @@ -1164,7 +1166,7 @@ describe("Scene/ArcGisMapServerImageryProvider", function () { { usePreCachedTilesIfAvailable: false, layers: "someLayer,anotherLayerYay", - } + }, ); const pickResult = await provider.pickFeatures(0, 0, 0, 0.5, 0.5); diff --git a/packages/engine/Specs/Scene/AttributeTypeSpec.js b/packages/engine/Specs/Scene/AttributeTypeSpec.js index 8055b2e8554e..f442bf0bcc98 100644 --- a/packages/engine/Specs/Scene/AttributeTypeSpec.js +++ b/packages/engine/Specs/Scene/AttributeTypeSpec.js @@ -59,7 +59,7 @@ describe("Scene/AttributeType", function () { it("getAttributeLocationCount works", function () { expect(AttributeType.getAttributeLocationCount(AttributeType.SCALAR)).toBe( - 1 + 1, ); expect(AttributeType.getAttributeLocationCount(AttributeType.VEC2)).toBe(1); expect(AttributeType.getAttributeLocationCount(AttributeType.VEC3)).toBe(1); diff --git a/packages/engine/Specs/Scene/AxisSpec.js b/packages/engine/Specs/Scene/AxisSpec.js index f01d807ed0f4..5064e26a594c 100644 --- a/packages/engine/Specs/Scene/AxisSpec.js +++ b/packages/engine/Specs/Scene/AxisSpec.js @@ -5,7 +5,7 @@ describe("Scene/Axis", function () { const transformed = Matrix4.multiplyByVector( transformation, upAxis, - new Cartesian4() + new Cartesian4(), ); Cartesian4.normalize(transformed, transformed); expect(transformed).toEqualEpsilon(expected, CesiumMath.EPSILON1); diff --git a/packages/engine/Specs/Scene/B3dmParserSpec.js b/packages/engine/Specs/Scene/B3dmParserSpec.js index b2b6c074256f..47ca7363d9ca 100644 --- a/packages/engine/Specs/Scene/B3dmParserSpec.js +++ b/packages/engine/Specs/Scene/B3dmParserSpec.js @@ -74,7 +74,7 @@ describe( Cesium3DTilesTester.expectRenderTileset(scene, tileset); const batchTable = tileset.root.content.batchTable; expect(batchTable.featuresLength).toBe(10); - } + }, ); }); @@ -85,7 +85,7 @@ describe( Cesium3DTilesTester.expectRenderTileset(scene, tileset); const batchTable = tileset.root.content.batchTable; expect(batchTable.featuresLength).toBe(10); - } + }, ); }); @@ -94,9 +94,9 @@ describe( function (tileset) { expect(B3dmParser._deprecationWarning).toHaveBeenCalled(); Cesium3DTilesTester.expectRenderTileset(scene, tileset); - } + }, ); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/BatchTableHierarchySpec.js b/packages/engine/Specs/Scene/BatchTableHierarchySpec.js index 1fdab934e6bf..582e06e72873 100644 --- a/packages/engine/Specs/Scene/BatchTableHierarchySpec.js +++ b/packages/engine/Specs/Scene/BatchTableHierarchySpec.js @@ -290,7 +290,7 @@ describe("Scene/BatchTableHierarchy", function () { }); expect(hierarchy.getProperty(0, "items")).toBe(1); expect(hierarchy.getProperty(0, "coordinates")).toEqual( - new Cartesian2(1, 0) + new Cartesian2(1, 0), ); expect(hierarchy.getProperty(0, "boxCount")).toBe(1); @@ -300,13 +300,13 @@ describe("Scene/BatchTableHierarchy", function () { expect(hierarchy.getProperty(2, "items")).toBe(2); expect(hierarchy.getProperty(2, "coordinates")).toEqual( - new Cartesian2(1, 2) + new Cartesian2(1, 2), ); expect(hierarchy.getProperty(2, "boxCount")).not.toBeDefined(); expect(hierarchy.getProperty(3, "items")).toBe(3); expect(hierarchy.getProperty(3, "coordinates")).toEqual( - new Cartesian2(3, 2) + new Cartesian2(3, 2), ); expect(hierarchy.getProperty(3, "boxCount")).not.toBeDefined(); }); @@ -319,7 +319,7 @@ describe("Scene/BatchTableHierarchy", function () { }); expect(hierarchy.getProperty(0, "items")).toBe(1); expect(hierarchy.getProperty(0, "coordinates")).toEqual( - new Cartesian2(1, 0) + new Cartesian2(1, 0), ); expect(hierarchy.getProperty(0, "boxCount")).toBe(1); @@ -329,13 +329,13 @@ describe("Scene/BatchTableHierarchy", function () { expect(hierarchy.getProperty(2, "items")).toBe(2); expect(hierarchy.getProperty(2, "coordinates")).toEqual( - new Cartesian2(1, 2) + new Cartesian2(1, 2), ); expect(hierarchy.getProperty(2, "boxCount")).not.toBeDefined(); expect(hierarchy.getProperty(3, "items")).toBe(3); expect(hierarchy.getProperty(3, "coordinates")).toEqual( - new Cartesian2(3, 2) + new Cartesian2(3, 2), ); expect(hierarchy.getProperty(3, "boxCount")).not.toBeDefined(); }); @@ -380,7 +380,7 @@ describe("Scene/BatchTableHierarchy", function () { expect(hierarchy.getProperty(0, "items")).toBe(5); expect(hierarchy.getProperty(2, "coordinates")).toEqual( - new Cartesian2(1, 2) + new Cartesian2(1, 2), ); const position = new Cartesian2(5, 5); expect(hierarchy.setProperty(2, "coordinates", position)).toBe(true); @@ -399,7 +399,7 @@ describe("Scene/BatchTableHierarchy", function () { expect(hierarchy.getProperty(0, "items")).toBe(5); expect(hierarchy.getProperty(2, "coordinates")).toEqual( - new Cartesian2(1, 2) + new Cartesian2(1, 2), ); const position = new Cartesian2(5, 5); expect(hierarchy.setProperty(2, "coordinates", position)).toBe(true); diff --git a/packages/engine/Specs/Scene/BatchTableSpec.js b/packages/engine/Specs/Scene/BatchTableSpec.js index ea765487e13c..a2ad34141e3a 100644 --- a/packages/engine/Specs/Scene/BatchTableSpec.js +++ b/packages/engine/Specs/Scene/BatchTableSpec.js @@ -141,7 +141,7 @@ describe( 1.23456e12, -2.34567e30, 3.45678e-6, - -4.56789e-10 + -4.56789e-10, ); for (i = 0; i < batchTable.numberOfInstances; ++i) { @@ -161,7 +161,7 @@ describe( 0, Number.MAX_VALUE, Number.POSITIVE_INFINITY, - Number.NEGATIVE_INFINITY + Number.NEGATIVE_INFINITY, ); batchTable.setBatchedAttribute(3, 0, 0); batchTable.setBatchedAttribute(3, 1, color); @@ -241,7 +241,7 @@ describe( expect(uniforms.batchTexture).toBeDefined(); expect(uniforms.batchTexture()).toBeInstanceOf(Texture); expect(uniforms.batchTexture().pixelDatatype).toEqual( - PixelDatatype.UNSIGNED_BYTE + PixelDatatype.UNSIGNED_BYTE, ); expect(uniforms.batchTextureDimensions).toBeDefined(); expect(uniforms.batchTextureDimensions().x).toBeGreaterThan(0); @@ -265,7 +265,7 @@ describe( expect(uniforms.batchTexture).toBeDefined(); expect(uniforms.batchTexture()).toBeInstanceOf(Texture); expect(uniforms.batchTexture().pixelDatatype).toEqual( - PixelDatatype.FLOAT + PixelDatatype.FLOAT, ); expect(uniforms.batchTextureDimensions).toBeDefined(); expect(uniforms.batchTextureDimensions().x).toBeGreaterThan(0); @@ -278,11 +278,11 @@ describe( if (scene.context.floatingPointTexture) { expect(uniforms.batchTexture().pixelDatatype).toEqual( - PixelDatatype.FLOAT + PixelDatatype.FLOAT, ); } else { expect(uniforms.batchTexture().pixelDatatype).toEqual( - PixelDatatype.UNSIGNED_BYTE + PixelDatatype.UNSIGNED_BYTE, ); } }); @@ -293,10 +293,10 @@ describe( const shader = "void main() { gl_Position = vec4(0.0); }"; const modifiedShader = batchTable.getVertexShaderCallback()(shader); expect( - modifiedShader.indexOf(batchTable.attributes[0].functionName) + modifiedShader.indexOf(batchTable.attributes[0].functionName), ).not.toEqual(-1); expect( - modifiedShader.indexOf(batchTable.attributes[1].functionName) + modifiedShader.indexOf(batchTable.attributes[1].functionName), ).not.toEqual(-1); }); @@ -307,5 +307,5 @@ describe( expect(batchTable.isDestroyed()).toEqual(true); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/BatchTextureSpec.js b/packages/engine/Specs/Scene/BatchTextureSpec.js index 004580aebdf1..c4524980fd3b 100644 --- a/packages/engine/Specs/Scene/BatchTextureSpec.js +++ b/packages/engine/Specs/Scene/BatchTextureSpec.js @@ -257,5 +257,5 @@ describe( expect(batchTexture.getColor(0, result)).toEqual(Color.YELLOW); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/BillboardCollectionSpec.js b/packages/engine/Specs/Scene/BillboardCollectionSpec.js index 5d1b2791bc85..fb509661180d 100644 --- a/packages/engine/Specs/Scene/BillboardCollectionSpec.js +++ b/packages/engine/Specs/Scene/BillboardCollectionSpec.js @@ -47,26 +47,26 @@ describe( camera = scene.camera; return Promise.all([ - Resource.fetchImage("./Data/Images/Green2x2.png").then(function ( - result - ) { - greenImage = result; - }), - Resource.fetchImage("./Data/Images/Blue2x2.png").then(function ( - result - ) { - blueImage = result; - }), - Resource.fetchImage("./Data/Images/White2x2.png").then(function ( - result - ) { - whiteImage = result; - }), - Resource.fetchImage("./Data/Images/Blue10x10.png").then(function ( - result - ) { - largeBlueImage = result; - }), + Resource.fetchImage("./Data/Images/Green2x2.png").then( + function (result) { + greenImage = result; + }, + ), + Resource.fetchImage("./Data/Images/Blue2x2.png").then( + function (result) { + blueImage = result; + }, + ), + Resource.fetchImage("./Data/Images/White2x2.png").then( + function (result) { + whiteImage = result; + }, + ), + Resource.fetchImage("./Data/Images/Blue10x10.png").then( + function (result) { + largeBlueImage = result; + }, + ), ]); }); @@ -175,19 +175,19 @@ describe( expect(b.rotation).toEqual(1.0); expect(b.alignedAxis).toEqual(Cartesian3.UNIT_Z); expect(b.scaleByDistance).toEqual( - new NearFarScalar(1.0, 3.0, 1.0e6, 0.0) + new NearFarScalar(1.0, 3.0, 1.0e6, 0.0), ); expect(b.translucencyByDistance).toEqual( - new NearFarScalar(1.0, 1.0, 1.0e6, 0.0) + new NearFarScalar(1.0, 1.0, 1.0e6, 0.0), ); expect(b.pixelOffsetScaleByDistance).toEqual( - new NearFarScalar(1.0, 1.0, 1.0e6, 0.0) + new NearFarScalar(1.0, 1.0, 1.0e6, 0.0), ); expect(b.width).toEqual(300.0); expect(b.height).toEqual(200.0); expect(b.sizeInMeters).toEqual(true); expect(b.distanceDisplayCondition).toEqual( - new DistanceDisplayCondition(10.0, 100.0) + new DistanceDisplayCondition(10.0, 100.0), ); expect(b.disableDepthTestDistance).toEqual(10.0); expect(b.id).toEqual("id"); @@ -232,19 +232,19 @@ describe( expect(b.rotation).toEqual(1.0); expect(b.alignedAxis).toEqual(Cartesian3.UNIT_Z); expect(b.scaleByDistance).toEqual( - new NearFarScalar(1.0e6, 3.0, 1.0e8, 0.0) + new NearFarScalar(1.0e6, 3.0, 1.0e8, 0.0), ); expect(b.translucencyByDistance).toEqual( - new NearFarScalar(1.0e6, 1.0, 1.0e8, 0.0) + new NearFarScalar(1.0e6, 1.0, 1.0e8, 0.0), ); expect(b.pixelOffsetScaleByDistance).toEqual( - new NearFarScalar(1.0e6, 3.0, 1.0e8, 0.0) + new NearFarScalar(1.0e6, 3.0, 1.0e8, 0.0), ); expect(b.width).toEqual(300.0); expect(b.height).toEqual(200.0); expect(b.sizeInMeters).toEqual(true); expect(b.distanceDisplayCondition).toEqual( - new DistanceDisplayCondition(10.0, 100.0) + new DistanceDisplayCondition(10.0, 100.0), ); expect(b.disableDepthTestDistance).toEqual(10.0); expect(b.splitDirection).toEqual(SplitDirection.LEFT); @@ -1578,7 +1578,7 @@ describe( scene.renderForSpecs(); expect(b.computeScreenSpacePosition(scene)).toEqualEpsilon( new Cartesian2(0.5, 0.5), - CesiumMath.EPSILON1 + CesiumMath.EPSILON1, ); }); @@ -1592,7 +1592,7 @@ describe( expect(actual).toEqual(result); expect(result).toEqualEpsilon( new Cartesian2(0.5, 0.5), - CesiumMath.EPSILON1 + CesiumMath.EPSILON1, ); }); @@ -1604,7 +1604,7 @@ describe( scene.renderForSpecs(); expect(b.computeScreenSpacePosition(scene)).toEqualEpsilon( new Cartesian2(1, 1.0), - CesiumMath.EPSILON1 + CesiumMath.EPSILON1, ); }); @@ -1616,7 +1616,7 @@ describe( scene.renderForSpecs(); expect(b.computeScreenSpacePosition(scene)).toEqualEpsilon( new Cartesian2(0.5, 0.5), - CesiumMath.EPSILON1 + CesiumMath.EPSILON1, ); }); @@ -1629,7 +1629,7 @@ describe( scene.renderForSpecs(); expect(b.computeScreenSpacePosition(scene)).toEqualEpsilon( new Cartesian2(0.5, 0.5), - CesiumMath.EPSILON1 + CesiumMath.EPSILON1, ); }); @@ -1642,7 +1642,7 @@ describe( scene.renderForSpecs(); expect(b.computeScreenSpacePosition(scene)).toEqualEpsilon( new Cartesian2(0.5, 0.5), - CesiumMath.EPSILON1 + CesiumMath.EPSILON1, ); }); @@ -1707,7 +1707,7 @@ describe( const bbox = Billboard.getScreenSpaceBoundingBox( b, Cartesian2.ZERO, - result + result, ); expect(bbox.x).toEqual(-halfWidth); expect(bbox.y).toEqual(-halfHeight); @@ -1907,11 +1907,11 @@ describe( expected.center = new Cartesian3( 0.0, expected.center.x, - expected.center.y + expected.center.y, ); expect(actual.center).toEqualEpsilon( expected.center, - CesiumMath.EPSILON8 + CesiumMath.EPSILON8, ); expect(actual.radius).toBeGreaterThanOrEqual(expected.radius); }); @@ -1963,11 +1963,11 @@ describe( expected.center = new Cartesian3( 0.0, expected.center.x, - expected.center.y + expected.center.y, ); expect(actual.center).toEqualEpsilon( expected.center, - CesiumMath.EPSILON8 + CesiumMath.EPSILON8, ); expect(actual.radius).toBeGreaterThan(expected.radius); }); @@ -2000,16 +2000,16 @@ describe( const diff = Cartesian3.subtract( actual.center, camera.position, - new Cartesian3() + new Cartesian3(), ); const vectorProjection = Cartesian3.multiplyByScalar( camera.direction, Cartesian3.dot(diff, camera.direction), - new Cartesian3() + new Cartesian3(), ); const distance = Math.max( 0.0, - Cartesian3.magnitude(vectorProjection) - bs.radius + Cartesian3.magnitude(vectorProjection) - bs.radius, ); const pixelSize = camera.frustum.getPixelDimensions( @@ -2017,7 +2017,7 @@ describe( dimensions.y, distance, scene.pixelRatio, - new Cartesian2() + new Cartesian2(), ); bs.radius += pixelSize.y * 0.25 * Math.max(greenImage.width, greenImage.height) + @@ -2434,7 +2434,7 @@ describe( expect(scene.updateHeight).toHaveBeenCalledWith( Cartographic.fromCartesian(position), jasmine.any(Function), - HeightReference.CLAMP_TO_GROUND + HeightReference.CLAMP_TO_GROUND, ); }); @@ -2450,7 +2450,7 @@ describe( expect(scene.updateHeight).toHaveBeenCalledWith( Cartographic.fromCartesian(position), jasmine.any(Function), - HeightReference.CLAMP_TO_GROUND + HeightReference.CLAMP_TO_GROUND, ); }); @@ -2466,7 +2466,7 @@ describe( expect(scene.updateHeight).toHaveBeenCalledWith( Cartographic.fromCartesian(position), jasmine.any(Function), - HeightReference.CLAMP_TO_GROUND + HeightReference.CLAMP_TO_GROUND, ); b.heightReference = HeightReference.RELATIVE_TO_GROUND; @@ -2474,7 +2474,7 @@ describe( expect(scene.updateHeight).toHaveBeenCalledWith( Cartographic.fromCartesian(position), jasmine.any(Function), - HeightReference.RELATIVE_TO_GROUND + HeightReference.RELATIVE_TO_GROUND, ); }); @@ -2505,7 +2505,7 @@ describe( expect(scene.updateHeight).toHaveBeenCalledWith( Cartographic.fromCartesian(position), jasmine.any(Function), - HeightReference.CLAMP_TO_GROUND + HeightReference.CLAMP_TO_GROUND, ); position = b.position = Cartesian3.fromDegrees(-73.0, 40.0); @@ -2514,7 +2514,7 @@ describe( expect(scene.updateHeight).toHaveBeenCalledWith( Cartographic.fromCartesian(position), jasmine.any(Function), - HeightReference.CLAMP_TO_GROUND + HeightReference.CLAMP_TO_GROUND, ); }); @@ -2526,7 +2526,7 @@ describe( cartographic.height = height; updateCallback(cartographic); }; - } + }, ); const position = Cartesian3.fromDegrees(-72.0, 40.0); @@ -2538,14 +2538,14 @@ describe( expect(scene.updateHeight).toHaveBeenCalled(); let cartographic = scene.globe.ellipsoid.cartesianToCartographic( - b._clampedPosition + b._clampedPosition, ); expect(cartographic.height).toEqual(0.0); invokeCallback(100.0); cartographic = scene.globe.ellipsoid.cartesianToCartographic( - b._clampedPosition + b._clampedPosition, ); expect(cartographic.height).toEqualEpsilon(100.0, CesiumMath.EPSILON9); @@ -2587,14 +2587,14 @@ describe( expect(scene.updateHeight).toHaveBeenCalledWith( Cartographic.fromCartesian(position), jasmine.any(Function), - HeightReference.CLAMP_TO_GROUND + HeightReference.CLAMP_TO_GROUND, ); const terrainProvider = await CesiumTerrainProvider.fromUrl( "made/up/url", { requestVertexNormals: true, - } + }, ); scene.terrainProvider = terrainProvider; @@ -2602,7 +2602,7 @@ describe( expect(scene.updateHeight).toHaveBeenCalledWith( Cartographic.fromCartesian(position), jasmine.any(Function), - HeightReference.CLAMP_TO_GROUND + HeightReference.CLAMP_TO_GROUND, ); expect(removeCallback).toHaveBeenCalled(); }); @@ -2653,5 +2653,5 @@ describe( }); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/BingMapsImageryProviderSpec.js b/packages/engine/Specs/Scene/BingMapsImageryProviderSpec.js index 8417fdd1e640..3323376afa7d 100644 --- a/packages/engine/Specs/Scene/BingMapsImageryProviderSpec.js +++ b/packages/engine/Specs/Scene/BingMapsImageryProviderSpec.js @@ -85,12 +85,12 @@ describe("Scene/BingMapsImageryProvider", function () { function installFakeMetadataRequest(url, mapStyle, mapLayer, culture) { const baseUri = new Uri(appendForwardSlash(url)); const expectedUri = new Uri( - `REST/v1/Imagery/Metadata/${mapStyle}` + `REST/v1/Imagery/Metadata/${mapStyle}`, ).absoluteTo(baseUri); Resource._Implementations.loadAndExecuteScript = function ( url, - functionName + functionName, ) { const uri = new Uri(url); @@ -120,7 +120,7 @@ describe("Scene/BingMapsImageryProvider", function () { Resource._Implementations.createImage = function ( request, crossOrigin, - deferred + deferred, ) { const url = request.url; if (/^blob:/.test(url) || supportsImageBitmapOptions) { @@ -131,7 +131,7 @@ describe("Scene/BingMapsImageryProvider", function () { deferred, true, false, - true + true, ); } else { if (defined(expectedUrl)) { @@ -153,7 +153,7 @@ describe("Scene/BingMapsImageryProvider", function () { Resource._DefaultImplementations.createImage( new Request({ url: "Data/Images/Red16x16.png" }), crossOrigin, - deferred + deferred, ); } }; @@ -165,7 +165,7 @@ describe("Scene/BingMapsImageryProvider", function () { data, headers, deferred, - overrideMimeType + overrideMimeType, ) { if (defined(expectedUrl)) { let uri = new Uri(url); @@ -190,24 +190,24 @@ describe("Scene/BingMapsImageryProvider", function () { method, data, headers, - deferred + deferred, ); }; } it("fromUrl throws if url is not provided", async function () { await expectAsync( - BingMapsImageryProvider.fromUrl() + BingMapsImageryProvider.fromUrl(), ).toBeRejectedWithDeveloperError( - "url is required, actual value was undefined" + "url is required, actual value was undefined", ); }); it("fromUrl throws if key is not provided", async function () { await expectAsync( - BingMapsImageryProvider.fromUrl("http://fake.fake.invalid/") + BingMapsImageryProvider.fromUrl("http://fake.fake.invalid/"), ).toBeRejectedWithDeveloperError( - "options.key is required, actual value was undefined" + "options.key is required, actual value was undefined", ); }); @@ -255,7 +255,7 @@ describe("Scene/BingMapsImageryProvider", function () { // Because the style is different, a non-cached request should have happened expect(provider3._imageUrlSubdomains).not.toBe( - provider._imageUrlSubdomains + provider._imageUrlSubdomains, ); }); @@ -336,10 +336,10 @@ describe("Scene/BingMapsImageryProvider", function () { await expectAsync( BingMapsImageryProvider.fromUrl(url, { key: "", - }) + }), ).toBeRejectedWithError( RuntimeError, - new RegExp("An error occurred while accessing") + new RegExp("An error occurred while accessing"), ); }); @@ -348,12 +348,12 @@ describe("Scene/BingMapsImageryProvider", function () { const baseUri = new Uri(appendForwardSlash(url)); const expectedUri = new Uri( - `REST/v1/Imagery/Metadata/${BingMapsStyle.AERIAL}` + `REST/v1/Imagery/Metadata/${BingMapsStyle.AERIAL}`, ).absoluteTo(baseUri); Resource._Implementations.loadAndExecuteScript = function ( url, - functionName + functionName, ) { const uri = new Uri(url); const query = queryToObject(uri.query()); @@ -366,7 +366,7 @@ describe("Scene/BingMapsImageryProvider", function () { setTimeout(function () { const response = createFakeBingMapsMetadataResponse( - BingMapsStyle.AERIAL + BingMapsStyle.AERIAL, ); response.resourceSets = []; window[functionName](response); @@ -377,10 +377,10 @@ describe("Scene/BingMapsImageryProvider", function () { await expectAsync( BingMapsImageryProvider.fromUrl(url, { key: "", - }) + }), ).toBeRejectedWithError( RuntimeError, - new RegExp("metadata does not specify one resource in resourceSets") + new RegExp("metadata does not specify one resource in resourceSets"), ); }); @@ -420,7 +420,7 @@ describe("Scene/BingMapsImageryProvider", function () { expect(provider.maximumLevel).toEqual(20); expect(provider.tilingScheme).toBeInstanceOf(WebMercatorTilingScheme); expect(provider.tileDiscardPolicy).toBeInstanceOf( - DiscardEmptyTileImagePolicy + DiscardEmptyTileImagePolicy, ); expect(provider.rectangle).toEqual(new WebMercatorTilingScheme().rectangle); expect(provider.credit).toBeInstanceOf(Object); @@ -430,7 +430,7 @@ describe("Scene/BingMapsImageryProvider", function () { { g: "3031", mkt: "", - } + }, ); const image = await provider.requestImage(0, 0, 0); @@ -458,7 +458,7 @@ describe("Scene/BingMapsImageryProvider", function () { { g: "3031", mkt: "ja-jp", - } + }, ); const image = await provider.requestImage(0, 0, 0); @@ -494,7 +494,7 @@ describe("Scene/BingMapsImageryProvider", function () { Resource._Implementations.createImage = function ( request, crossOrigin, - deferred + deferred, ) { const url = request.url; if (/^blob:/.test(url)) { @@ -502,14 +502,14 @@ describe("Scene/BingMapsImageryProvider", function () { Resource._DefaultImplementations.createImage( request, crossOrigin, - deferred + deferred, ); } else if (tries === 2) { // Succeed after 2 tries Resource._DefaultImplementations.createImage( new Request({ url: "Data/Images/Red16x16.png" }), crossOrigin, - deferred + deferred, ); } else { // fail @@ -526,7 +526,7 @@ describe("Scene/BingMapsImageryProvider", function () { data, headers, deferred, - overrideMimeType + overrideMimeType, ) { if (tries === 2) { // Succeed after 2 tries @@ -536,7 +536,7 @@ describe("Scene/BingMapsImageryProvider", function () { method, data, headers, - deferred + deferred, ); } else { // fail diff --git a/packages/engine/Specs/Scene/BoundingVolumeSemanticsSpec.js b/packages/engine/Specs/Scene/BoundingVolumeSemanticsSpec.js index 011b404611e9..23858656f5f1 100644 --- a/packages/engine/Specs/Scene/BoundingVolumeSemanticsSpec.js +++ b/packages/engine/Specs/Scene/BoundingVolumeSemanticsSpec.js @@ -98,14 +98,14 @@ describe("Scene/BoundingVolumeSemantics", function () { it("throws without tileMetadata", function () { expect(function () { return BoundingVolumeSemantics.parseAllBoundingVolumeSemantics( - undefined + undefined, ); }).toThrowDeveloperError(); }); it("works if no semantics are present", function () { expect( - BoundingVolumeSemantics.parseAllBoundingVolumeSemantics(emptyMetadata) + BoundingVolumeSemantics.parseAllBoundingVolumeSemantics(emptyMetadata), ).toEqual({ tile: { boundingVolume: undefined, @@ -134,7 +134,7 @@ describe("Scene/BoundingVolumeSemantics", function () { }); expect( - BoundingVolumeSemantics.parseAllBoundingVolumeSemantics(tileMetadata) + BoundingVolumeSemantics.parseAllBoundingVolumeSemantics(tileMetadata), ).toEqual({ tile: { boundingVolume: undefined, @@ -161,7 +161,7 @@ describe("Scene/BoundingVolumeSemantics", function () { }); expect( - BoundingVolumeSemantics.parseAllBoundingVolumeSemantics(tileMetadata) + BoundingVolumeSemantics.parseAllBoundingVolumeSemantics(tileMetadata), ).toEqual({ tile: { boundingVolume: { @@ -193,7 +193,7 @@ describe("Scene/BoundingVolumeSemantics", function () { }, }); expect( - BoundingVolumeSemantics.parseAllBoundingVolumeSemantics(tileMetadata) + BoundingVolumeSemantics.parseAllBoundingVolumeSemantics(tileMetadata), ).toEqual({ tile: { boundingVolume: { @@ -218,7 +218,7 @@ describe("Scene/BoundingVolumeSemantics", function () { expect(function () { return BoundingVolumeSemantics.parseBoundingVolumeSemantic( undefined, - emptyMetadata + emptyMetadata, ); }).toThrowDeveloperError(); }); @@ -227,7 +227,7 @@ describe("Scene/BoundingVolumeSemantics", function () { expect(function () { return BoundingVolumeSemantics.parseBoundingVolumeSemantic( "TILESET", - emptyMetadata + emptyMetadata, ); }).toThrowDeveloperError(); }); @@ -236,16 +236,17 @@ describe("Scene/BoundingVolumeSemantics", function () { expect(function () { return BoundingVolumeSemantics.parseBoundingVolumeSemantic( "TILE", - undefined + undefined, ); }).toThrowDeveloperError(); }); it("returns undefined if there are no bounding volume semantics", function () { - const boundingVolume = BoundingVolumeSemantics.parseBoundingVolumeSemantic( - "TILE", - emptyMetadata - ); + const boundingVolume = + BoundingVolumeSemantics.parseBoundingVolumeSemantic( + "TILE", + emptyMetadata, + ); expect(boundingVolume).not.toBeDefined(); }); @@ -258,10 +259,11 @@ describe("Scene/BoundingVolumeSemantics", function () { }, }, }); - const boundingVolume = BoundingVolumeSemantics.parseBoundingVolumeSemantic( - "TILE", - tileMetadata - ); + const boundingVolume = + BoundingVolumeSemantics.parseBoundingVolumeSemantic( + "TILE", + tileMetadata, + ); expect(boundingVolume).toEqual({ box: boundingBox, }); @@ -276,10 +278,11 @@ describe("Scene/BoundingVolumeSemantics", function () { }, }, }); - const boundingVolume = BoundingVolumeSemantics.parseBoundingVolumeSemantic( - "CONTENT", - tileMetadata - ); + const boundingVolume = + BoundingVolumeSemantics.parseBoundingVolumeSemantic( + "CONTENT", + tileMetadata, + ); expect(boundingVolume).toEqual({ region: boundingRegion, }); @@ -294,10 +297,11 @@ describe("Scene/BoundingVolumeSemantics", function () { }, }, }); - const boundingVolume = BoundingVolumeSemantics.parseBoundingVolumeSemantic( - "TILE", - tileMetadata - ); + const boundingVolume = + BoundingVolumeSemantics.parseBoundingVolumeSemantic( + "TILE", + tileMetadata, + ); expect(boundingVolume).toEqual({ sphere: boundingSphere, }); @@ -318,7 +322,7 @@ describe("Scene/BoundingVolumeSemantics", function () { // Box is handled before region const box = BoundingVolumeSemantics.parseBoundingVolumeSemantic( "TILE", - tileMetadata + tileMetadata, ); expect(box).toEqual({ box: boundingBox, @@ -327,7 +331,7 @@ describe("Scene/BoundingVolumeSemantics", function () { // region is handled before sphere const region = BoundingVolumeSemantics.parseBoundingVolumeSemantic( "CONTENT", - tileMetadata + tileMetadata, ); expect(region).toEqual({ region: boundingRegion, @@ -340,7 +344,7 @@ describe("Scene/BoundingVolumeSemantics", function () { expect(function () { return BoundingVolumeSemantics._parseMinimumHeight( undefined, - emptyMetadata + emptyMetadata, ); }).toThrowDeveloperError(); }); @@ -349,7 +353,7 @@ describe("Scene/BoundingVolumeSemantics", function () { expect(function () { return BoundingVolumeSemantics._parseMinimumHeight( "TILESET", - emptyMetadata + emptyMetadata, ); }).toThrowDeveloperError(); }); @@ -363,7 +367,7 @@ describe("Scene/BoundingVolumeSemantics", function () { it("returns undefined if minimum height not present", function () { const height = BoundingVolumeSemantics._parseMinimumHeight( "TILE", - emptyMetadata + emptyMetadata, ); expect(height).not.toBeDefined(); }); @@ -379,7 +383,7 @@ describe("Scene/BoundingVolumeSemantics", function () { }); const height = BoundingVolumeSemantics._parseMinimumHeight( "TILE", - tileMetadata + tileMetadata, ); expect(height).toBe(minimumHeight); }); @@ -390,7 +394,7 @@ describe("Scene/BoundingVolumeSemantics", function () { expect(function () { return BoundingVolumeSemantics._parseMaximumHeight( undefined, - emptyMetadata + emptyMetadata, ); }).toThrowDeveloperError(); }); @@ -399,7 +403,7 @@ describe("Scene/BoundingVolumeSemantics", function () { expect(function () { return BoundingVolumeSemantics._parseMaximumHeight( "TILESET", - emptyMetadata + emptyMetadata, ); }).toThrowDeveloperError(); }); @@ -413,7 +417,7 @@ describe("Scene/BoundingVolumeSemantics", function () { it("returns undefined if maximum height not present", function () { const height = BoundingVolumeSemantics._parseMaximumHeight( "TILE", - emptyMetadata + emptyMetadata, ); expect(height).not.toBeDefined(); }); @@ -429,7 +433,7 @@ describe("Scene/BoundingVolumeSemantics", function () { }); const height = BoundingVolumeSemantics._parseMaximumHeight( "CONTENT", - tileMetadata + tileMetadata, ); expect(height).toBe(maximumHeight); }); diff --git a/packages/engine/Specs/Scene/BoxEmitterSpec.js b/packages/engine/Specs/Scene/BoxEmitterSpec.js index c7b42a761a96..27cefe64bd94 100644 --- a/packages/engine/Specs/Scene/BoxEmitterSpec.js +++ b/packages/engine/Specs/Scene/BoxEmitterSpec.js @@ -59,7 +59,7 @@ describe("Scene/BoxEmitter", function () { expect(particle.position.y).toBeLessThanOrEqual(emitter.dimensions.y); expect(particle.position.z).toBeLessThanOrEqual(emitter.dimensions.z); expect(particle.velocity).toEqual( - Cartesian3.normalize(particle.position, new Cartesian3()) + Cartesian3.normalize(particle.position, new Cartesian3()), ); } }); diff --git a/packages/engine/Specs/Scene/BufferLoaderSpec.js b/packages/engine/Specs/Scene/BufferLoaderSpec.js index 884ab8e001e9..0dc2ac5f9409 100644 --- a/packages/engine/Specs/Scene/BufferLoaderSpec.js +++ b/packages/engine/Specs/Scene/BufferLoaderSpec.js @@ -44,7 +44,7 @@ describe("Scene/BufferLoader", function () { await expectAsync(bufferLoader.load()).toBeRejectedWithError( RuntimeError, - "Failed to load external buffer: https://example.com/external.bin\n404 Not Found" + "Failed to load external buffer: https://example.com/external.bin\n404 Not Found", ); }); @@ -61,7 +61,7 @@ describe("Scene/BufferLoader", function () { it("loads external buffer", async function () { const fetchBuffer = spyOn( Resource.prototype, - "fetchArrayBuffer" + "fetchArrayBuffer", ).and.returnValue(Promise.resolve(arrayBuffer)); const bufferLoader = new BufferLoader({ @@ -76,7 +76,7 @@ describe("Scene/BufferLoader", function () { it("destroys buffer", async function () { spyOn(Resource.prototype, "fetchArrayBuffer").and.returnValue( - Promise.resolve(arrayBuffer) + Promise.resolve(arrayBuffer), ); const bufferLoader = new BufferLoader({ @@ -97,7 +97,7 @@ describe("Scene/BufferLoader", function () { it("handles asynchronous load after destroy", async function () { spyOn(Resource.prototype, "fetchArrayBuffer").and.returnValue( - Promise.resolve(arrayBuffer) + Promise.resolve(arrayBuffer), ); const bufferLoader = new BufferLoader({ @@ -116,7 +116,7 @@ describe("Scene/BufferLoader", function () { it("handles asynchronous error after destroy", async function () { spyOn(Resource.prototype, "fetchArrayBuffer").and.returnValue( - Promise.reject(new Error()) + Promise.reject(new Error()), ); const bufferLoader = new BufferLoader({ diff --git a/packages/engine/Specs/Scene/CameraEventAggregatorSpec.js b/packages/engine/Specs/Scene/CameraEventAggregatorSpec.js index 364c3b31e536..c418e12ef174 100644 --- a/packages/engine/Specs/Scene/CameraEventAggregatorSpec.js +++ b/packages/engine/Specs/Scene/CameraEventAggregatorSpec.js @@ -46,7 +46,7 @@ describe("Scene/CameraEventAggregator", function () { canvas, combine(options, { pointerType: "mouse", - }) + }), ); } else { DomEventSimulator.fireMouseDown(canvas, options); @@ -59,7 +59,7 @@ describe("Scene/CameraEventAggregator", function () { canvas, combine(options, { pointerType: "mouse", - }) + }), ); } else { DomEventSimulator.fireMouseUp(canvas, options); @@ -72,7 +72,7 @@ describe("Scene/CameraEventAggregator", function () { canvas, combine(options, { pointerType: "mouse", - }) + }), ); } else { DomEventSimulator.fireMouseMove(canvas, options); @@ -144,7 +144,7 @@ describe("Scene/CameraEventAggregator", function () { moveMouse(MouseButtons.RIGHT, startPosition, endPosition, true); movement = handler.getMovement( CameraEventType.RIGHT_DRAG, - KeyboardEventModifier.SHIFT + KeyboardEventModifier.SHIFT, ); expect(movement).toBeDefined(); expect(movement.startPosition).toEqual(startPosition); @@ -248,7 +248,7 @@ describe("Scene/CameraEventAggregator", function () { it("getButtonPressTime", function () { expect( - handler.getButtonPressTime(CameraEventType.LEFT_DRAG) + handler.getButtonPressTime(CameraEventType.LEFT_DRAG), ).toBeUndefined(); const options = { @@ -268,7 +268,7 @@ describe("Scene/CameraEventAggregator", function () { it("getButtonReleaseTime", function () { expect( - handler.getButtonReleaseTime(CameraEventType.LEFT_DRAG) + handler.getButtonReleaseTime(CameraEventType.LEFT_DRAG), ).toBeUndefined(); const options = { diff --git a/packages/engine/Specs/Scene/CameraFlightPathSpec.js b/packages/engine/Specs/Scene/CameraFlightPathSpec.js index a4573e7688ea..b4cd134bf356 100644 --- a/packages/engine/Specs/Scene/CameraFlightPathSpec.js +++ b/packages/engine/Specs/Scene/CameraFlightPathSpec.js @@ -101,7 +101,7 @@ describe( flight.update({ time: 0.0 }); expect(camera.position).toEqualEpsilon( startPosition, - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); expect(camera.heading).toEqualEpsilon(startHeading, CesiumMath.EPSILON12); expect(camera.pitch).toEqualEpsilon(startPitch, CesiumMath.EPSILON12); @@ -136,7 +136,7 @@ describe( flight.update({ time: 0.0 }); expect(camera.position).toEqualEpsilon( startPosition, - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); flight.update({ time: duration }); @@ -153,7 +153,7 @@ describe( camera.right = Cartesian3.cross( camera.direction, camera.up, - new Cartesian3() + new Cartesian3(), ); const startPosition = Cartesian3.clone(camera.position); @@ -162,10 +162,10 @@ describe( const destination = Cartesian3.add( startPosition, new Cartesian3(-6e5 * Math.PI, 6e5 * CesiumMath.PI_OVER_FOUR, 100.0), - new Cartesian3() + new Cartesian3(), ); const endPosition = projection.ellipsoid.cartographicToCartesian( - projection.unproject(destination) + projection.unproject(destination), ); const duration = 5.0; @@ -177,7 +177,7 @@ describe( flight.update({ time: 0.0 }); expect(camera.position).toEqualEpsilon( startPosition, - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); flight.update({ time: duration }); @@ -194,7 +194,7 @@ describe( camera.right = Cartesian3.cross( camera.direction, camera.up, - new Cartesian3() + new Cartesian3(), ); camera.frustum = createOrthographicFrustum(); @@ -205,10 +205,10 @@ describe( const destination = Cartesian3.add( startPosition, new Cartesian3(-6e6 * Math.PI, 6e6 * CesiumMath.PI_OVER_FOUR, 100.0), - new Cartesian3() + new Cartesian3(), ); const endPosition = projection.ellipsoid.cartographicToCartesian( - projection.unproject(destination) + projection.unproject(destination), ); const duration = 5.0; @@ -220,29 +220,29 @@ describe( flight.update({ time: 0.0 }); expect(camera.position).toEqualEpsilon( startPosition, - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); expect(camera.frustum.right - camera.frustum.left).toEqualEpsilon( startHeight, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); flight.update({ time: duration }); expect(camera.position.x).toEqualEpsilon( destination.x, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(camera.position.y).toEqualEpsilon( destination.y, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(camera.position.z).toEqualEpsilon( startPosition.z, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(camera.frustum.right - camera.frustum.left).toEqualEpsilon( destination.z, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); }); @@ -253,7 +253,7 @@ describe( const end = Cartesian3.multiplyByScalar( Cartesian3.normalize(start, new Cartesian3()), mag - 1000000.0, - new Cartesian3() + new Cartesian3(), ); const duration = 3.0; @@ -314,7 +314,7 @@ describe( flight.complete(); expect(scene.camera.position).toEqualEpsilon( destination, - CesiumMath.EPSILON14 + CesiumMath.EPSILON14, ); }); @@ -328,7 +328,7 @@ describe( camera.right = Cartesian3.cross( camera.direction, camera.up, - new Cartesian3() + new Cartesian3(), ); camera.frustum = createOrthographicFrustum(); camera.update(scene.mode); @@ -336,12 +336,12 @@ describe( const destination = Cartesian3.clone(camera.position); destination.z = Math.max( frustum.right - frustum.left, - frustum.top - frustum.bottom + frustum.top - frustum.bottom, ); const projection = scene.mapProjection; const endPosition = projection.ellipsoid.cartographicToCartesian( - projection.unproject(destination) + projection.unproject(destination), ); const flight = CameraFlightPath.createTween(scene, { @@ -387,7 +387,7 @@ describe( const projection = scene.mapProjection; const endPosition = projection.ellipsoid.cartographicToCartesian( - projection.unproject(camera.position) + projection.unproject(camera.position), ); const flight = CameraFlightPath.createTween(scene, { @@ -407,7 +407,7 @@ describe( camera.right = Cartesian3.cross( camera.direction, camera.up, - new Cartesian3() + new Cartesian3(), ); camera.frustum = createOrthographicFrustum(); @@ -419,10 +419,10 @@ describe( const destination = Cartesian3.add( startPosition, new Cartesian3(-6e5 * Math.PI, 6e5 * CesiumMath.PI_OVER_FOUR, 100.0), - new Cartesian3() + new Cartesian3(), ); const endPosition = projection.ellipsoid.cartographicToCartesian( - projection.unproject(destination) + projection.unproject(destination), ); const flight = CameraFlightPath.createTween(scene, { @@ -434,15 +434,15 @@ describe( flight.complete(); expect(camera.position.x).toEqualEpsilon( destination.x, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(camera.position.y).toEqualEpsilon( destination.y, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(camera.frustum.right - camera.frustum.left).toEqualEpsilon( destination.z, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); }); @@ -456,7 +456,7 @@ describe( camera.right = Cartesian3.cross( camera.direction, camera.up, - new Cartesian3() + new Cartesian3(), ); const startPosition = Cartesian3.clone(camera.position); @@ -465,10 +465,10 @@ describe( const destination = Cartesian3.add( startPosition, new Cartesian3(-6e6 * Math.PI, 6e6 * CesiumMath.PI_OVER_FOUR, 100.0), - new Cartesian3() + new Cartesian3(), ); const endPosition = projection.ellipsoid.cartographicToCartesian( - projection.unproject(destination) + projection.unproject(destination), ); const flight = CameraFlightPath.createTween(scene, { @@ -603,7 +603,7 @@ describe( flight.update({ time: duration / 2.0 }); expect(camera.pitch).toEqualEpsilon( -CesiumMath.PI_OVER_TWO, - CesiumMath.EPSILON4 + CesiumMath.EPSILON4, ); }); @@ -695,7 +695,7 @@ describe( flight.update({ time: i }); maximumHeight = Math.max( maximumHeight, - camera.positionCartographic.height + camera.positionCartographic.height, ); } @@ -717,5 +717,5 @@ describe( } }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/CameraSpec.js b/packages/engine/Specs/Scene/CameraSpec.js index 6f90f345f173..c56dccef6e45 100644 --- a/packages/engine/Specs/Scene/CameraSpec.js +++ b/packages/engine/Specs/Scene/CameraSpec.js @@ -110,7 +110,7 @@ describe("Scene/Camera", function () { 0.0, 0.0, 0.0, - 1.0 + 1.0, ); const translation = new Matrix4( 1.0, @@ -128,7 +128,7 @@ describe("Scene/Camera", function () { 0.0, 0.0, 0.0, - 1.0 + 1.0, ); const expected = Matrix4.multiply(rotation, translation, new Matrix4()); expect(viewMatrix).toEqual(expected); @@ -138,7 +138,7 @@ describe("Scene/Camera", function () { const expected = Matrix4.inverse(camera.viewMatrix, new Matrix4()); expect(expected).toEqualEpsilon( camera.inverseViewMatrix, - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); }); @@ -160,12 +160,12 @@ describe("Scene/Camera", function () { 0.0, 0.0, 0.0, - 1.0 - ) + 1.0, + ), ); const expected = Matrix4.inverseTransformation( camera.transform, - new Matrix4() + new Matrix4(), ); expect(expected).toEqual(camera.inverseTransform); }); @@ -174,42 +174,42 @@ describe("Scene/Camera", function () { camera.direction = new Cartesian3( -0.32297853365047874, 0.9461560708446421, - 0.021761351171635013 + 0.021761351171635013, ); camera.up = new Cartesian3( 0.9327219113001013, 0.31839266745173644, - -2.9874778345595487e-10 + -2.9874778345595487e-10, ); camera.right = new Cartesian3( 0.0069286549295528715, -0.020297288960790985, - 0.9853344956450351 + 0.9853344956450351, ); expect(Cartesian3.magnitude(camera.right)).not.toEqualEpsilon( 1.0, - CesiumMath.EPSILON8 + CesiumMath.EPSILON8, ); expect(Cartesian3.magnitude(camera.up)).not.toEqualEpsilon( 1.0, - CesiumMath.EPSILON8 + CesiumMath.EPSILON8, ); // Trigger updateMembers which normalizes the axes const viewMatrix = camera.viewMatrix; expect(Cartesian3.magnitude(camera.right)).toEqualEpsilon( 1.0, - CesiumMath.EPSILON8 + CesiumMath.EPSILON8, ); expect(Cartesian3.magnitude(camera.up)).toEqualEpsilon( 1.0, - CesiumMath.EPSILON8 + CesiumMath.EPSILON8, ); const inverseAffine = Matrix4.inverseTransformation( viewMatrix, - new Matrix4() + new Matrix4(), ); const inverse = Matrix4.inverse(viewMatrix, new Matrix4()); expect(inverseAffine).toEqualEpsilon(inverse, CesiumMath.EPSILON8); @@ -266,7 +266,7 @@ describe("Scene/Camera", function () { const ellipsoid = Ellipsoid.WGS84; const toFixedFrame = Transforms.eastNorthUpToFixedFrame( camera.position, - ellipsoid + ellipsoid, ); const transform = Matrix4.getMatrix3(toFixedFrame, new Matrix3()); Matrix3.transpose(transform, transform); @@ -274,7 +274,7 @@ describe("Scene/Camera", function () { let right = Matrix3.multiplyByVector( transform, camera.right, - new Cartesian3() + new Cartesian3(), ); const heading = CesiumMath.TWO_PI - CesiumMath.zeroToTwoPi(Math.atan2(right.y, right.x)); @@ -336,13 +336,13 @@ describe("Scene/Camera", function () { camera.position = Cartesian3.fromDegrees(-72.0, 40.0, 100000.0); camera.direction = Cartesian3.negate( Cartesian3.normalize(camera.position, new Cartesian3()), - new Cartesian3() + new Cartesian3(), ); camera.up = Cartesian3.clone(Cartesian3.UNIT_Z); camera.right = Cartesian3.cross( camera.direction, camera.up, - new Cartesian3() + new Cartesian3(), ); const heading = camera.heading; @@ -369,7 +369,7 @@ describe("Scene/Camera", function () { camera.right = Cartesian3.cross( camera.direction, camera.up, - new Cartesian3() + new Cartesian3(), ); const heading = camera.heading; @@ -415,7 +415,7 @@ describe("Scene/Camera", function () { expect(camera.positionCartographic).toEqual(positionCartographic); expect(camera.heading).toEqualEpsilon( CesiumMath.TWO_PI, - CesiumMath.EPSILON8 + CesiumMath.EPSILON8, ); expect(camera.up.z).toBeGreaterThan(0.0); }); @@ -431,13 +431,13 @@ describe("Scene/Camera", function () { camera.position = Cartesian3.fromDegrees(0.0, 0.0, 100000.0); camera.direction = Cartesian3.negate( Cartesian3.normalize(camera.position, new Cartesian3()), - new Cartesian3() + new Cartesian3(), ); camera.up = Cartesian3.clone(Cartesian3.UNIT_Z); camera.right = Cartesian3.cross( camera.direction, camera.up, - new Cartesian3() + new Cartesian3(), ); const positionWC = Cartesian3.clone(camera.positionWC); @@ -486,13 +486,13 @@ describe("Scene/Camera", function () { camera.position = Cartesian3.fromDegrees(-72.0, 40.0, 100000.0); camera.direction = Cartesian3.negate( Cartesian3.normalize(camera.position, new Cartesian3()), - new Cartesian3() + new Cartesian3(), ); camera.up = Cartesian3.clone(Cartesian3.UNIT_Z); camera.right = Cartesian3.cross( camera.direction, camera.up, - new Cartesian3() + new Cartesian3(), ); const pitch = camera.pitch; @@ -519,7 +519,7 @@ describe("Scene/Camera", function () { camera.right = Cartesian3.cross( camera.direction, camera.up, - new Cartesian3() + new Cartesian3(), ); const pitch = camera.pitch; @@ -543,13 +543,13 @@ describe("Scene/Camera", function () { camera.position = Cartesian3.fromDegrees(0.0, 0.0, 100000.0); camera.direction = Cartesian3.negate( Cartesian3.normalize(camera.position, new Cartesian3()), - new Cartesian3() + new Cartesian3(), ); camera.up = Cartesian3.clone(Cartesian3.UNIT_Z); camera.right = Cartesian3.cross( camera.direction, camera.up, - new Cartesian3() + new Cartesian3(), ); camera.look(camera.direction, CesiumMath.toRadians(45.0)); @@ -578,25 +578,25 @@ describe("Scene/Camera", function () { Cartesian3.multiplyByScalar( camera.position, ellipsoid.maximumRadius + 100.0, - camera.position + camera.position, ); camera.direction = new Cartesian3(-1.0, 0.0, 1.0); Cartesian3.normalize(camera.direction, camera.direction); camera.right = Cartesian3.cross( camera.direction, Cartesian3.UNIT_Z, - new Cartesian3() + new Cartesian3(), ); Cartesian3.normalize(camera.right, camera.right); camera.up = Cartesian3.cross( camera.right, camera.direction, - new Cartesian3() + new Cartesian3(), ); const toFixedFrame = Transforms.eastNorthUpToFixedFrame( camera.position, - ellipsoid + ellipsoid, ); const transform = Matrix4.getMatrix3(toFixedFrame, new Matrix3()); Matrix3.transpose(transform, transform); @@ -604,7 +604,7 @@ describe("Scene/Camera", function () { let right = Matrix3.multiplyByVector( transform, camera.right, - new Cartesian3() + new Cartesian3(), ); const roll = CesiumMath.TWO_PI - Math.atan2(right.z, right.x); @@ -646,7 +646,7 @@ describe("Scene/Camera", function () { camera.right = Cartesian3.cross( camera.direction, camera.up, - new Cartesian3() + new Cartesian3(), ); const roll = camera.roll; @@ -675,12 +675,12 @@ describe("Scene/Camera", function () { camera.right = Cartesian3.cross( camera.direction, camera.up, - new Cartesian3() + new Cartesian3(), ); const roll = camera.roll; const positionCartographic = Cartographic.clone( - camera.positionCartographic + camera.positionCartographic, ); const newRoll = CesiumMath.PI_OVER_FOUR; @@ -745,17 +745,17 @@ describe("Scene/Camera", function () { const cart = ellipsoid.cartesianToCartographic(cartesian); expect(camera.positionCartographic).toEqualEpsilon( cart, - CesiumMath.EPSILON6 + CesiumMath.EPSILON6, ); expect(camera.direction).toEqualEpsilon( Cartesian3.negate(Cartesian3.UNIT_Z, new Cartesian3()), - CesiumMath.EPSILON6 + CesiumMath.EPSILON6, ); expect(camera.up).toEqualEpsilon(Cartesian3.UNIT_Y, CesiumMath.EPSILON6); expect(camera.right).toEqualEpsilon(Cartesian3.UNIT_X, CesiumMath.EPSILON6); expect(frustum.right - frustum.left).toEqualEpsilon( cart.height, - CesiumMath.EPSILON6 + CesiumMath.EPSILON6, ); expect(frustum.top / frustum.right).toEqual(ratio); }); @@ -775,11 +775,11 @@ describe("Scene/Camera", function () { const cart = ellipsoid.cartesianToCartographic(cartesian); expect(camera.positionCartographic).toEqualEpsilon( cart, - CesiumMath.EPSILON11 + CesiumMath.EPSILON11, ); expect(camera.direction).toEqualEpsilon( Cartesian3.negate(Cartesian3.UNIT_Z, new Cartesian3()), - CesiumMath.EPSILON6 + CesiumMath.EPSILON6, ); expect(camera.up).toEqualEpsilon(Cartesian3.UNIT_Y, CesiumMath.EPSILON6); expect(camera.right).toEqualEpsilon(Cartesian3.UNIT_X, CesiumMath.EPSILON6); @@ -799,19 +799,19 @@ describe("Scene/Camera", function () { expect(camera.positionCartographic).toEqualEpsilon( ellipsoid.cartesianToCartographic(cartesian), - CesiumMath.EPSILON6 + CesiumMath.EPSILON6, ); expect(camera.direction).toEqualEpsilon( Cartesian3.normalize( Cartesian3.negate(camera.position, new Cartesian3()), - new Cartesian3() + new Cartesian3(), ), - CesiumMath.EPSILON6 + CesiumMath.EPSILON6, ); expect(camera.up).toEqualEpsilon(Cartesian3.UNIT_Z, CesiumMath.EPSILON6); expect(camera.right).toEqualEpsilon( Cartesian3.cross(camera.direction, camera.up, new Cartesian3()), - CesiumMath.EPSILON6 + CesiumMath.EPSILON6, ); }); @@ -835,11 +835,11 @@ describe("Scene/Camera", function () { const cart = ellipsoid.cartesianToCartographic(cartesian); expect(camera.positionCartographic).toEqualEpsilon( cart, - CesiumMath.EPSILON11 + CesiumMath.EPSILON11, ); expect(camera.direction).toEqualEpsilon( Cartesian3.negate(Cartesian3.UNIT_Z, new Cartesian3()), - CesiumMath.EPSILON6 + CesiumMath.EPSILON6, ); expect(camera.up).toEqualEpsilon(Cartesian3.UNIT_Y, CesiumMath.EPSILON6); expect(camera.right).toEqualEpsilon(Cartesian3.UNIT_X, CesiumMath.EPSILON6); @@ -866,19 +866,19 @@ describe("Scene/Camera", function () { const cart = ellipsoid.cartesianToCartographic(cartesian); expect(camera.positionCartographic).toEqualEpsilon( cart, - CesiumMath.EPSILON6 + CesiumMath.EPSILON6, ); expect(camera.direction).toEqualEpsilon( Cartesian3.normalize( Cartesian3.negate(camera.position, new Cartesian3()), - new Cartesian3() + new Cartesian3(), ), - CesiumMath.EPSILON6 + CesiumMath.EPSILON6, ); expect(camera.up).toEqualEpsilon(Cartesian3.UNIT_Z, CesiumMath.EPSILON6); expect(camera.right).toEqualEpsilon( Cartesian3.cross(camera.direction, camera.up, new Cartesian3()), - CesiumMath.EPSILON6 + CesiumMath.EPSILON6, ); expect(camera.frustum.width).toEqual(cart.height); }); @@ -1056,11 +1056,11 @@ describe("Scene/Camera", function () { 0.0, 0.0, 0.0, - 1.0 - ) + 1.0, + ), ); expect(camera.worldToCameraCoordinates(Cartesian4.UNIT_X)).toEqual( - Cartesian4.UNIT_Z + Cartesian4.UNIT_Z, ); }); @@ -1088,16 +1088,16 @@ describe("Scene/Camera", function () { 0.0, 0.0, 0.0, - 1.0 - ) + 1.0, + ), ); const expected = Cartesian3.add( Matrix4.getColumn(camera.inverseTransform, 3, new Cartesian4()), Cartesian3.UNIT_Z, - new Cartesian3() + new Cartesian3(), ); expect(camera.worldToCameraCoordinatesPoint(Cartesian3.UNIT_X)).toEqual( - expected + expected, ); }); @@ -1125,11 +1125,11 @@ describe("Scene/Camera", function () { 0.0, 0.0, 0.0, - 1.0 - ) + 1.0, + ), ); expect(camera.worldToCameraCoordinatesVector(Cartesian3.UNIT_X)).toEqual( - Cartesian3.UNIT_Z + Cartesian3.UNIT_Z, ); }); @@ -1157,11 +1157,11 @@ describe("Scene/Camera", function () { 0.0, 0.0, 0.0, - 1.0 - ) + 1.0, + ), ); expect(camera.cameraToWorldCoordinates(Cartesian4.UNIT_Z)).toEqual( - Cartesian4.UNIT_X + Cartesian4.UNIT_X, ); }); @@ -1189,16 +1189,16 @@ describe("Scene/Camera", function () { 0.0, 0.0, 0.0, - 1.0 - ) + 1.0, + ), ); const expected = Cartesian3.add( Cartesian3.UNIT_X, Matrix4.getColumn(camera.transform, 3, new Cartesian4()), - new Cartesian3() + new Cartesian3(), ); expect(camera.cameraToWorldCoordinatesPoint(Cartesian3.UNIT_Z)).toEqual( - expected + expected, ); }); @@ -1226,11 +1226,11 @@ describe("Scene/Camera", function () { 0.0, 0.0, 0.0, - 1.0 - ) + 1.0, + ), ); expect(camera.cameraToWorldCoordinatesVector(Cartesian3.UNIT_Z)).toEqual( - Cartesian3.UNIT_X + Cartesian3.UNIT_X, ); }); @@ -1243,12 +1243,12 @@ describe("Scene/Camera", function () { it("moves", function () { const direction = Cartesian3.normalize( new Cartesian3(1.0, 1.0, 0.0), - new Cartesian3() + new Cartesian3(), ); camera.move(direction, moveAmount); expect(camera.position).toEqualEpsilon( new Cartesian3(direction.x * moveAmount, direction.y * moveAmount, 1.0), - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); expect(camera.up).toEqual(up); expect(camera.direction).toEqual(dir); @@ -1259,7 +1259,7 @@ describe("Scene/Camera", function () { camera.moveUp(moveAmount); expect(camera.position).toEqualEpsilon( new Cartesian3(0.0, moveAmount, 1.0), - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); expect(camera.up).toEqual(up); expect(camera.direction).toEqual(dir); @@ -1270,7 +1270,7 @@ describe("Scene/Camera", function () { camera.moveDown(moveAmount); expect(camera.position).toEqualEpsilon( new Cartesian3(0.0, -moveAmount, 1.0), - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); expect(camera.up).toEqual(up); expect(camera.direction).toEqual(dir); @@ -1281,7 +1281,7 @@ describe("Scene/Camera", function () { camera.moveRight(moveAmount); expect(camera.position).toEqual( new Cartesian3(moveAmount, 0.0, 1.0), - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); expect(camera.up).toEqual(up); expect(camera.direction).toEqual(dir); @@ -1292,7 +1292,7 @@ describe("Scene/Camera", function () { camera.moveLeft(moveAmount); expect(camera.position).toEqual( new Cartesian3(-moveAmount, 0.0, 1.0), - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); expect(camera.up).toEqual(up); expect(camera.direction).toEqual(dir); @@ -1303,7 +1303,7 @@ describe("Scene/Camera", function () { camera.moveForward(moveAmount); expect(camera.position).toEqual( new Cartesian3(0.0, 0.0, 1.0 - moveAmount), - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); expect(camera.up).toEqual(up); expect(camera.direction).toEqual(dir); @@ -1314,7 +1314,7 @@ describe("Scene/Camera", function () { camera.moveBackward(moveAmount); expect(camera.position).toEqual( new Cartesian3(0.0, 0.0, 1.0 + moveAmount), - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); expect(camera.up).toEqual(up); expect(camera.direction).toEqual(dir); @@ -1381,7 +1381,7 @@ describe("Scene/Camera", function () { camera.update(SceneMode.SCENE2D); const max = scene.mapProjection.project( - new Cartographic(Math.PI, CesiumMath.toRadians(85.05112878)) + new Cartographic(Math.PI, CesiumMath.toRadians(85.05112878)), ); const factor = 1000.0; const dx = max.x * factor; @@ -1410,11 +1410,11 @@ describe("Scene/Camera", function () { expect(camera.right).toEqual(right); expect(camera.up).toEqualEpsilon( Cartesian3.negate(Cartesian3.UNIT_Y, new Cartesian3()), - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); expect(camera.direction).toEqualEpsilon( Cartesian3.UNIT_Z, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); }); @@ -1424,7 +1424,7 @@ describe("Scene/Camera", function () { expect(camera.up).toEqualEpsilon(up, CesiumMath.EPSILON15); expect(camera.direction).toEqualEpsilon( Cartesian3.negate(right, new Cartesian3()), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); expect(camera.right).toEqualEpsilon(dir, CesiumMath.EPSILON15); }); @@ -1436,7 +1436,7 @@ describe("Scene/Camera", function () { expect(camera.direction).toEqualEpsilon(right, CesiumMath.EPSILON15); expect(camera.right).toEqualEpsilon( Cartesian3.negate(dir, new Cartesian3()), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); }); @@ -1447,7 +1447,7 @@ describe("Scene/Camera", function () { expect(camera.direction).toEqualEpsilon(up, CesiumMath.EPSILON15); expect(camera.up).toEqualEpsilon( Cartesian3.negate(dir, new Cartesian3()), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); }); @@ -1457,7 +1457,7 @@ describe("Scene/Camera", function () { expect(camera.right).toEqualEpsilon(right, CesiumMath.EPSILON15); expect(camera.direction).toEqualEpsilon( Cartesian3.negate(up, new Cartesian3()), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); expect(camera.up).toEqualEpsilon(dir, CesiumMath.EPSILON15); }); @@ -1482,7 +1482,7 @@ describe("Scene/Camera", function () { expect(camera.up).toEqualEpsilon(oldCamera.up, CesiumMath.EPSILON15); expect(camera.direction).toEqualEpsilon( oldCamera.direction, - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); expect(camera.right).toEqualEpsilon(oldCamera.right, CesiumMath.EPSILON15); }); @@ -1507,7 +1507,7 @@ describe("Scene/Camera", function () { expect(camera.up).toEqualEpsilon(oldCamera.up, CesiumMath.EPSILON15); expect(camera.direction).toEqualEpsilon( oldCamera.direction, - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); expect(camera.right).toEqualEpsilon(oldCamera.right, CesiumMath.EPSILON15); }); @@ -1532,7 +1532,7 @@ describe("Scene/Camera", function () { expect(camera.up).toEqualEpsilon(oldCamera.up, CesiumMath.EPSILON15); expect(camera.direction).toEqualEpsilon( oldCamera.direction, - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); expect(camera.right).toEqualEpsilon(oldCamera.right, CesiumMath.EPSILON15); }); @@ -1557,7 +1557,7 @@ describe("Scene/Camera", function () { expect(camera.up).toEqualEpsilon(oldCamera.up, CesiumMath.EPSILON15); expect(camera.direction).toEqualEpsilon( oldCamera.direction, - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); expect(camera.right).toEqualEpsilon(oldCamera.right, CesiumMath.EPSILON15); }); @@ -1568,7 +1568,7 @@ describe("Scene/Camera", function () { expect(camera.direction).toEqualEpsilon(dir, CesiumMath.EPSILON15); expect(camera.up).toEqualEpsilon( Cartesian3.negate(right, new Cartesian3()), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); expect(camera.right).toEqualEpsilon(up, CesiumMath.EPSILON15); }); @@ -1580,7 +1580,7 @@ describe("Scene/Camera", function () { expect(camera.up).toEqualEpsilon(right, CesiumMath.EPSILON14); expect(camera.right).toEqualEpsilon( Cartesian3.negate(up, new Cartesian3()), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); }); @@ -1594,13 +1594,13 @@ describe("Scene/Camera", function () { camera.rotateUp(rotateAmount); expect(camera.up).toEqualEpsilon( Cartesian3.negate(dir, new Cartesian3()), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); expect(camera.direction).toEqualEpsilon(up, CesiumMath.EPSILON15); expect(camera.right).toEqualEpsilon(right, CesiumMath.EPSILON15); expect(camera.position).toEqualEpsilon( Cartesian3.negate(Cartesian3.UNIT_Y, new Cartesian3()), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); }); @@ -1609,13 +1609,13 @@ describe("Scene/Camera", function () { camera.rotateUp(rotateAmount); expect(camera.up).toEqualEpsilon( Cartesian3.negate(dir, new Cartesian3()), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); expect(camera.direction).toEqualEpsilon(up, CesiumMath.EPSILON15); expect(camera.right).toEqualEpsilon(right, CesiumMath.EPSILON15); expect(camera.position).toEqualEpsilon( Cartesian3.negate(Cartesian3.UNIT_Y, new Cartesian3()), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); }); @@ -1625,20 +1625,20 @@ describe("Scene/Camera", function () { camera.right = Cartesian3.cross( camera.direction, camera.up, - new Cartesian3() + new Cartesian3(), ); camera.constrainedAxis = Cartesian3.UNIT_Y; camera.rotateUp(rotateAmount); expect(camera.up).toEqualEpsilon( Cartesian3.negate(Cartesian3.UNIT_Y, new Cartesian3()), - CesiumMath.EPSILON14 + CesiumMath.EPSILON14, ); expect(camera.direction).toEqualEpsilon(right, CesiumMath.EPSILON15); expect(camera.right).toEqualEpsilon(dir, CesiumMath.EPSILON15); expect(camera.position).toEqualEpsilon( Cartesian3.negate(Cartesian3.UNIT_Y, new Cartesian3()), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); }); @@ -1647,12 +1647,12 @@ describe("Scene/Camera", function () { expect(camera.up).toEqualEpsilon(dir, CesiumMath.EPSILON15); expect(camera.direction).toEqualEpsilon( Cartesian3.negate(up, new Cartesian3()), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); expect(camera.right).toEqualEpsilon(right, CesiumMath.EPSILON15); expect(camera.position).toEqualEpsilon( Cartesian3.UNIT_Y, - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); }); @@ -1662,12 +1662,12 @@ describe("Scene/Camera", function () { expect(camera.up).toEqualEpsilon(dir, CesiumMath.EPSILON15); expect(camera.direction).toEqualEpsilon( Cartesian3.negate(up, new Cartesian3()), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); expect(camera.right).toEqualEpsilon(right, CesiumMath.EPSILON15); expect(camera.position).toEqualEpsilon( Cartesian3.UNIT_Y, - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); }); @@ -1677,7 +1677,7 @@ describe("Scene/Camera", function () { camera.right = Cartesian3.cross( camera.direction, camera.up, - new Cartesian3() + new Cartesian3(), ); camera.constrainedAxis = Cartesian3.UNIT_Y; @@ -1686,11 +1686,11 @@ describe("Scene/Camera", function () { expect(camera.direction).toEqualEpsilon(right, CesiumMath.EPSILON15); expect(camera.right).toEqualEpsilon( Cartesian3.negate(dir, new Cartesian3()), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); expect(camera.position).toEqualEpsilon( Cartesian3.UNIT_Y, - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); }); @@ -1700,11 +1700,11 @@ describe("Scene/Camera", function () { expect(camera.direction).toEqualEpsilon(right, CesiumMath.EPSILON15); expect(camera.right).toEqualEpsilon( Cartesian3.negate(dir, new Cartesian3()), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); expect(camera.position).toEqualEpsilon( Cartesian3.negate(Cartesian3.UNIT_X, new Cartesian3()), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); }); @@ -1714,15 +1714,15 @@ describe("Scene/Camera", function () { expect(camera.up).toEqualEpsilon(Cartesian3.UNIT_X, CesiumMath.EPSILON15); expect(camera.direction).toEqualEpsilon( Cartesian3.negate(Cartesian3.UNIT_Z, new Cartesian3()), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); expect(camera.right).toEqualEpsilon( Cartesian3.negate(Cartesian3.UNIT_Y, new Cartesian3()), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); expect(camera.position).toEqualEpsilon( Cartesian3.UNIT_Z, - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); }); @@ -1731,12 +1731,12 @@ describe("Scene/Camera", function () { expect(camera.up).toEqualEpsilon(up, CesiumMath.EPSILON15); expect(camera.direction).toEqualEpsilon( Cartesian3.negate(right, new Cartesian3()), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); expect(camera.right).toEqualEpsilon(dir, CesiumMath.EPSILON15); expect(camera.position).toEqualEpsilon( Cartesian3.UNIT_X, - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); }); @@ -1745,19 +1745,19 @@ describe("Scene/Camera", function () { camera.rotateRight(rotateAmount); expect(camera.up).toEqualEpsilon( Cartesian3.negate(Cartesian3.UNIT_X, new Cartesian3()), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); expect(camera.direction).toEqualEpsilon( Cartesian3.negate(Cartesian3.UNIT_Z, new Cartesian3()), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); expect(camera.right).toEqualEpsilon( Cartesian3.UNIT_Y, - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); expect(camera.position).toEqualEpsilon( Cartesian3.UNIT_Z, - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); }); @@ -1766,31 +1766,31 @@ describe("Scene/Camera", function () { new Cartesian3( Math.cos(CesiumMath.PI_OVER_FOUR), Math.sin(CesiumMath.PI_OVER_FOUR), - 0.0 + 0.0, ), - new Cartesian3() + new Cartesian3(), ); const angle = CesiumMath.PI_OVER_TWO; camera.rotate(axis, angle); expect(camera.position).toEqualEpsilon( new Cartesian3(-axis.x, axis.y, 0.0), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); expect(camera.direction).toEqualEpsilon( Cartesian3.negate( Cartesian3.normalize(camera.position, new Cartesian3()), - new Cartesian3() + new Cartesian3(), ), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); expect(camera.right).toEqualEpsilon( Cartesian3.normalize(new Cartesian3(0.5, 0.5, axis.x), new Cartesian3()), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); expect(camera.up).toEqualEpsilon( Cartesian3.cross(camera.right, camera.direction, new Cartesian3()), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); }); @@ -1799,13 +1799,13 @@ describe("Scene/Camera", function () { camera.rotateUp(Math.PI); expect(camera.up).toEqualEpsilon( Cartesian3.negate(dir, new Cartesian3()), - CesiumMath.EPSILON4 + CesiumMath.EPSILON4, ); expect(camera.direction).toEqualEpsilon(up, CesiumMath.EPSILON4); expect(camera.right).toEqualEpsilon(right, CesiumMath.EPSILON4); expect(camera.position).toEqualEpsilon( Cartesian3.negate(Cartesian3.UNIT_Y, new Cartesian3()), - CesiumMath.EPSILON4 + CesiumMath.EPSILON4, ); }); @@ -1898,7 +1898,7 @@ describe("Scene/Camera", function () { camera.update(SceneMode.SCENE2D); const max = scene.mapProjection.project( - new Cartographic(Math.PI, CesiumMath.toRadians(85.05112878)) + new Cartographic(Math.PI, CesiumMath.toRadians(85.05112878)), ); const factor = 1000.0; const dx = max.x * factor; @@ -1924,7 +1924,7 @@ describe("Scene/Camera", function () { camera.update(SceneMode.SCENE2D); const max = scene.mapProjection.project( - new Cartographic(Math.PI, CesiumMath.toRadians(85.05112878)) + new Cartographic(Math.PI, CesiumMath.toRadians(85.05112878)), ); const factor = 1000.0; const dx = max.x * factor; @@ -1938,7 +1938,7 @@ describe("Scene/Camera", function () { camera.zoomIn(zoomAmount); expect(camera.position).toEqualEpsilon( new Cartesian3(0.0, 0.0, 1.0 - zoomAmount), - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); expect(camera.up).toEqual(up); expect(camera.direction).toEqual(dir); @@ -1949,7 +1949,7 @@ describe("Scene/Camera", function () { camera.zoomOut(zoomAmount); expect(camera.position).toEqualEpsilon( new Cartesian3(0.0, 0.0, 1.0 + zoomAmount), - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); expect(camera.up).toEqual(up); expect(camera.direction).toEqual(dir); @@ -1975,35 +1975,35 @@ describe("Scene/Camera", function () { expect(tempCamera.direction).toEqualEpsilon( Cartesian3.negate( Cartesian3.normalize(offset, new Cartesian3()), - new Cartesian3() + new Cartesian3(), ), - CesiumMath.EPSILON11 + CesiumMath.EPSILON11, ); expect(tempCamera.right).toEqualEpsilon( Cartesian3.cross( tempCamera.direction, Cartesian3.UNIT_Z, - new Cartesian3() + new Cartesian3(), ), - CesiumMath.EPSILON11 + CesiumMath.EPSILON11, ); expect(tempCamera.up).toEqualEpsilon( Cartesian3.cross( tempCamera.right, tempCamera.direction, - new Cartesian3() + new Cartesian3(), ), - CesiumMath.EPSILON11 + CesiumMath.EPSILON11, ); expect(1.0 - Cartesian3.magnitude(tempCamera.direction)).toBeLessThan( - CesiumMath.EPSILON14 + CesiumMath.EPSILON14, ); expect(1.0 - Cartesian3.magnitude(tempCamera.up)).toBeLessThan( - CesiumMath.EPSILON14 + CesiumMath.EPSILON14, ); expect(1.0 - Cartesian3.magnitude(tempCamera.right)).toBeLessThan( - CesiumMath.EPSILON14 + CesiumMath.EPSILON14, ); }); @@ -2020,19 +2020,19 @@ describe("Scene/Camera", function () { expect(Cartesian3.distance(tempCamera.position, target)).toEqualEpsilon( range, - CesiumMath.EPSILON6 + CesiumMath.EPSILON6, ); expect(tempCamera.heading).toEqualEpsilon(heading, CesiumMath.EPSILON6); expect(tempCamera.pitch).toEqualEpsilon(pitch, CesiumMath.EPSILON6); expect(1.0 - Cartesian3.magnitude(tempCamera.direction)).toBeLessThan( - CesiumMath.EPSILON14 + CesiumMath.EPSILON14, ); expect(1.0 - Cartesian3.magnitude(tempCamera.up)).toBeLessThan( - CesiumMath.EPSILON14 + CesiumMath.EPSILON14, ); expect(1.0 - Cartesian3.magnitude(tempCamera.right)).toBeLessThan( - CesiumMath.EPSILON14 + CesiumMath.EPSILON14, ); }); @@ -2047,25 +2047,25 @@ describe("Scene/Camera", function () { expect(tempCamera.direction).toEqualEpsilon( Cartesian3.negate( Cartesian3.normalize(offset, new Cartesian3()), - new Cartesian3() + new Cartesian3(), ), - CesiumMath.EPSILON11 + CesiumMath.EPSILON11, ); expect(tempCamera.right).toEqualEpsilon( Cartesian3.cross( tempCamera.direction, Cartesian3.UNIT_Z, - new Cartesian3() + new Cartesian3(), ), - CesiumMath.EPSILON11 + CesiumMath.EPSILON11, ); expect(tempCamera.up).toEqualEpsilon( Cartesian3.cross( tempCamera.right, tempCamera.direction, - new Cartesian3() + new Cartesian3(), ), - CesiumMath.EPSILON11 + CesiumMath.EPSILON11, ); }); @@ -2081,25 +2081,25 @@ describe("Scene/Camera", function () { expect(tempCamera.direction).toEqualEpsilon( Cartesian3.negate( Cartesian3.normalize(offset, new Cartesian3()), - new Cartesian3() + new Cartesian3(), ), - CesiumMath.EPSILON11 + CesiumMath.EPSILON11, ); expect(tempCamera.right).toEqualEpsilon( Cartesian3.cross( tempCamera.direction, Cartesian3.UNIT_Z, - new Cartesian3() + new Cartesian3(), ), - CesiumMath.EPSILON11 + CesiumMath.EPSILON11, ); expect(tempCamera.up).toEqualEpsilon( Cartesian3.cross( tempCamera.right, tempCamera.direction, - new Cartesian3() + new Cartesian3(), ), - CesiumMath.EPSILON11 + CesiumMath.EPSILON11, ); }); @@ -2134,24 +2134,24 @@ describe("Scene/Camera", function () { expect(Cartesian2.clone(tempCamera.position)).toEqual(Cartesian2.ZERO); expect(tempCamera.direction).toEqual( - Cartesian3.negate(Cartesian3.UNIT_Z, new Cartesian3()) + Cartesian3.negate(Cartesian3.UNIT_Z, new Cartesian3()), ); expect(tempCamera.up).toEqualEpsilon( Cartesian3.normalize( Cartesian3.fromElements(-offset.x, -offset.y, 0.0), - new Cartesian3() + new Cartesian3(), ), - CesiumMath.EPSILON11 + CesiumMath.EPSILON11, ); expect(tempCamera.right).toEqualEpsilon( Cartesian3.cross(tempCamera.direction, tempCamera.up, new Cartesian3()), - CesiumMath.EPSILON11 + CesiumMath.EPSILON11, ); expect(tempCamera.frustum.right).toEqual( - Cartesian3.magnitude(offset) * 0.5 + Cartesian3.magnitude(offset) * 0.5, ); expect(tempCamera.frustum.left).toEqual( - -Cartesian3.magnitude(offset) * 0.5 + -Cartesian3.magnitude(offset) * 0.5, ); }); @@ -2179,7 +2179,7 @@ describe("Scene/Camera", function () { tempCamera.lookAtTransform(Matrix4.IDENTITY); expect(tempCamera.direction).toEqual( - Cartesian3.negate(Cartesian3.UNIT_Z, new Cartesian3()) + Cartesian3.negate(Cartesian3.UNIT_Z, new Cartesian3()), ); expect(tempCamera.heading).toEqualEpsilon(heading, CesiumMath.EPSILON6); expect(tempCamera.frustum.right).toEqual(range * 0.5); @@ -2199,7 +2199,7 @@ describe("Scene/Camera", function () { const offset = new Cartesian3(1.0, 1.0, 0.0); const transform = Transforms.eastNorthUpToFixedFrame( target, - Ellipsoid.UNIT_SPHERE + Ellipsoid.UNIT_SPHERE, ); const tempCamera = Camera.clone(camera); @@ -2209,35 +2209,35 @@ describe("Scene/Camera", function () { expect(tempCamera.direction).toEqualEpsilon( Cartesian3.negate( Cartesian3.normalize(offset, new Cartesian3()), - new Cartesian3() + new Cartesian3(), ), - CesiumMath.EPSILON11 + CesiumMath.EPSILON11, ); expect(tempCamera.right).toEqualEpsilon( Cartesian3.cross( tempCamera.direction, Cartesian3.UNIT_Z, - new Cartesian3() + new Cartesian3(), ), - CesiumMath.EPSILON11 + CesiumMath.EPSILON11, ); expect(tempCamera.up).toEqualEpsilon( Cartesian3.cross( tempCamera.right, tempCamera.direction, - new Cartesian3() + new Cartesian3(), ), - CesiumMath.EPSILON11 + CesiumMath.EPSILON11, ); expect(1.0 - Cartesian3.magnitude(tempCamera.direction)).toBeLessThan( - CesiumMath.EPSILON14 + CesiumMath.EPSILON14, ); expect(1.0 - Cartesian3.magnitude(tempCamera.up)).toBeLessThan( - CesiumMath.EPSILON14 + CesiumMath.EPSILON14, ); expect(1.0 - Cartesian3.magnitude(tempCamera.right)).toBeLessThan( - CesiumMath.EPSILON14 + CesiumMath.EPSILON14, ); }); @@ -2253,26 +2253,26 @@ describe("Scene/Camera", function () { camera.position = ellipsoid.cartographicToCartesian(cartOrigin); camera.direction = Cartesian3.negate( Cartesian3.fromCartesian4( - Matrix4.getColumn(transform, 2, new Cartesian4()) + Matrix4.getColumn(transform, 2, new Cartesian4()), ), - new Cartesian3() + new Cartesian3(), ); camera.up = Cartesian3.fromCartesian4( - Matrix4.getColumn(transform, 1, new Cartesian4(), new Matrix4()) + Matrix4.getColumn(transform, 1, new Cartesian4(), new Matrix4()), ); camera.right = Cartesian3.fromCartesian4( - Matrix4.getColumn(transform, 0, new Cartesian4()) + Matrix4.getColumn(transform, 0, new Cartesian4()), ); camera.lookAtTransform(transform); expect(camera.position).toEqualEpsilon( new Cartesian3(0.0, 0.0, height), - CesiumMath.EPSILON9 + CesiumMath.EPSILON9, ); expect(camera.direction).toEqualEpsilon( Cartesian3.negate(Cartesian3.UNIT_Z, new Cartesian3()), - CesiumMath.EPSILON9 + CesiumMath.EPSILON9, ); expect(camera.up).toEqualEpsilon(Cartesian3.UNIT_Y, CesiumMath.EPSILON9); expect(camera.right).toEqualEpsilon(Cartesian3.UNIT_X, CesiumMath.EPSILON9); @@ -2288,26 +2288,26 @@ describe("Scene/Camera", function () { const tempCamera = Camera.clone(camera); tempCamera.lookAtTransform( transform, - new HeadingPitchRange(heading, pitch, range) + new HeadingPitchRange(heading, pitch, range), ); tempCamera.lookAtTransform(Matrix4.IDENTITY); expect(Cartesian3.distance(tempCamera.position, target)).toEqualEpsilon( range, - CesiumMath.EPSILON6 + CesiumMath.EPSILON6, ); expect(tempCamera.heading).toEqualEpsilon(heading, CesiumMath.EPSILON6); expect(tempCamera.pitch).toEqualEpsilon(pitch, CesiumMath.EPSILON6); expect(1.0 - Cartesian3.magnitude(tempCamera.direction)).toBeLessThan( - CesiumMath.EPSILON14 + CesiumMath.EPSILON14, ); expect(1.0 - Cartesian3.magnitude(tempCamera.up)).toBeLessThan( - CesiumMath.EPSILON14 + CesiumMath.EPSILON14, ); expect(1.0 - Cartesian3.magnitude(tempCamera.right)).toBeLessThan( - CesiumMath.EPSILON14 + CesiumMath.EPSILON14, ); }); @@ -2331,31 +2331,31 @@ describe("Scene/Camera", function () { tempCamera.update(SceneMode.SCENE2D); const transform = Transforms.eastNorthUpToFixedFrame( - Cartesian3.fromDegrees(0.0, 0.0) + Cartesian3.fromDegrees(0.0, 0.0), ); const offset = new Cartesian3(10000.0, 10000.0, 30000.0); tempCamera.lookAtTransform(transform, offset); expect(Cartesian2.clone(tempCamera.position)).toEqual(Cartesian2.ZERO); expect(tempCamera.direction).toEqual( - Cartesian3.negate(Cartesian3.UNIT_Z, new Cartesian3()) + Cartesian3.negate(Cartesian3.UNIT_Z, new Cartesian3()), ); expect(tempCamera.up).toEqualEpsilon( Cartesian3.normalize( Cartesian3.fromElements(-offset.x, -offset.y, 0.0), - new Cartesian3() + new Cartesian3(), ), - CesiumMath.EPSILON11 + CesiumMath.EPSILON11, ); expect(tempCamera.right).toEqualEpsilon( Cartesian3.cross(tempCamera.direction, tempCamera.up, new Cartesian3()), - CesiumMath.EPSILON11 + CesiumMath.EPSILON11, ); expect(tempCamera.frustum.right).toEqual( - Cartesian3.magnitude(offset) * 0.5 + Cartesian3.magnitude(offset) * 0.5, ); expect(tempCamera.frustum.left).toEqual( - -Cartesian3.magnitude(offset) * 0.5 + -Cartesian3.magnitude(offset) * 0.5, ); }); @@ -2380,14 +2380,14 @@ describe("Scene/Camera", function () { tempCamera.lookAtTransform( transform, - new HeadingPitchRange(heading, pitch, range) + new HeadingPitchRange(heading, pitch, range), ); expect(Cartesian2.clone(tempCamera.position)).toEqual(Cartesian2.ZERO); tempCamera.lookAtTransform(Matrix4.IDENTITY); expect(tempCamera.direction).toEqual( - Cartesian3.negate(Cartesian3.UNIT_Z, new Cartesian3()) + Cartesian3.negate(Cartesian3.UNIT_Z, new Cartesian3()), ); expect(tempCamera.heading).toEqualEpsilon(heading, CesiumMath.EPSILON6); expect(tempCamera.frustum.right).toEqual(range * 0.5); @@ -2399,7 +2399,7 @@ describe("Scene/Camera", function () { const offset = new Cartesian3(1.0, 1.0, 0.0); const transform = Transforms.eastNorthUpToFixedFrame( target, - Ellipsoid.UNIT_SPHERE + Ellipsoid.UNIT_SPHERE, ); const tempCamera = Camera.clone(camera); @@ -2414,39 +2414,39 @@ describe("Scene/Camera", function () { expect(tempCamera.direction).toEqualEpsilon( Cartesian3.negate( Cartesian3.normalize(offset, new Cartesian3()), - new Cartesian3() + new Cartesian3(), ), - CesiumMath.EPSILON11 + CesiumMath.EPSILON11, ); expect(tempCamera.right).toEqualEpsilon( Cartesian3.cross( tempCamera.direction, Cartesian3.UNIT_Z, - new Cartesian3() + new Cartesian3(), ), - CesiumMath.EPSILON11 + CesiumMath.EPSILON11, ); expect(tempCamera.up).toEqualEpsilon( Cartesian3.cross( tempCamera.right, tempCamera.direction, - new Cartesian3() + new Cartesian3(), ), - CesiumMath.EPSILON11 + CesiumMath.EPSILON11, ); expect(1.0 - Cartesian3.magnitude(tempCamera.direction)).toBeLessThan( - CesiumMath.EPSILON14 + CesiumMath.EPSILON14, ); expect(1.0 - Cartesian3.magnitude(tempCamera.up)).toBeLessThan( - CesiumMath.EPSILON14 + CesiumMath.EPSILON14, ); expect(1.0 - Cartesian3.magnitude(tempCamera.right)).toBeLessThan( - CesiumMath.EPSILON14 + CesiumMath.EPSILON14, ); expect(tempCamera.frustum.width).toEqual( - Cartesian3.magnitude(tempCamera.position) + Cartesian3.magnitude(tempCamera.position), ); }); @@ -2463,21 +2463,21 @@ describe("Scene/Camera", function () { -Math.PI, -CesiumMath.PI_OVER_TWO, Math.PI, - CesiumMath.PI_OVER_TWO + CesiumMath.PI_OVER_TWO, ); camera.setView({ destination: rectangle }); expect(camera.position).toEqualEpsilon( new Cartesian3(14680290.639204923, 0.0, 0.0), - CesiumMath.EPSILON6 + CesiumMath.EPSILON6, ); expect(camera.direction).toEqualEpsilon( Cartesian3.negate(Cartesian3.UNIT_X, new Cartesian3()), - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); expect(camera.up).toEqualEpsilon(Cartesian3.UNIT_Z, CesiumMath.EPSILON10); expect(camera.right).toEqualEpsilon( Cartesian3.UNIT_Y, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); }); @@ -2486,32 +2486,32 @@ describe("Scene/Camera", function () { CesiumMath.toRadians(21.25), CesiumMath.toRadians(41.23), CesiumMath.toRadians(21.51), - CesiumMath.toRadians(41.38) + CesiumMath.toRadians(41.38), ); camera.setView({ destination: rectangle }); expect(camera.position).toEqualEpsilon( new Cartesian3(4481555.454147325, 1754498.0086281248, 4200627.581953675), - CesiumMath.EPSILON6 + CesiumMath.EPSILON6, ); expect(camera.direction).toEqualEpsilon( new Cartesian3( -0.6995046749050446, -0.27385124912628594, - -0.6600747708691498 + -0.6600747708691498, ), - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); expect(camera.up).toEqualEpsilon( new Cartesian3( -0.6146504879783901, -0.2406314209863035, - 0.7511999047271233 + 0.7511999047271233, ), - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); expect(camera.right).toEqualEpsilon( new Cartesian3(-0.36455176232452213, 0.9311831251617939, 0), - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); }); @@ -2520,32 +2520,32 @@ describe("Scene/Camera", function () { CesiumMath.toRadians(90.0), CesiumMath.toRadians(-50.0), CesiumMath.toRadians(157.0), - CesiumMath.toRadians(0.0) + CesiumMath.toRadians(0.0), ); camera.setView({ destination: rectangle }); expect(camera.position).toEqualEpsilon( new Cartesian3(-6017603.25625715, 9091606.78076493, -5075070.862292178), - CesiumMath.EPSILON6 + CesiumMath.EPSILON6, ); expect(camera.direction).toEqualEpsilon( new Cartesian3( 0.49978034145251155, -0.7550857289433265, - 0.42434084442077485 + 0.42434084442077485, ), - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); expect(camera.up).toEqualEpsilon( new Cartesian3( -0.2342094064143758, 0.35385181388649406, - 0.905502538790623 + 0.905502538790623, ), - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); expect(camera.right).toEqualEpsilon( new Cartesian3(-0.8338858220671682, -0.5519369853120581, 0), - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); }); @@ -2554,32 +2554,32 @@ describe("Scene/Camera", function () { CesiumMath.toRadians(90.0), CesiumMath.toRadians(-62.0), CesiumMath.toRadians(174.0), - CesiumMath.toRadians(-4.0) + CesiumMath.toRadians(-4.0), ); camera.setView({ destination: rectangle }); expect(camera.position).toEqualEpsilon( new Cartesian3(-7307919.685704952, 8116267.060310548, -7085995.891547672), - CesiumMath.EPSILON6 + CesiumMath.EPSILON6, ); expect(camera.direction).toEqualEpsilon( new Cartesian3( 0.5602119862713765, -0.6221784429103113, - 0.5468605998017956 + 0.5468605998017956, ), - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); expect(camera.up).toEqualEpsilon( new Cartesian3( -0.3659211647391443, 0.40639662500016843, - 0.8372236764356468 + 0.8372236764356468, ), - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); expect(camera.right).toEqualEpsilon( new Cartesian3(-0.7431448254773944, -0.6691306063588581, 0), - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); }); @@ -2588,21 +2588,21 @@ describe("Scene/Camera", function () { 0.1, -CesiumMath.PI_OVER_TWO, -0.1, - CesiumMath.PI_OVER_TWO + CesiumMath.PI_OVER_TWO, ); camera.setView({ destination: rectangle }); expect(camera.position).toEqualEpsilon( new Cartesian3(-14680290.639204923, 0.0, 0.0), - CesiumMath.EPSILON6 + CesiumMath.EPSILON6, ); expect(camera.direction).toEqualEpsilon( Cartesian3.UNIT_X, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); expect(camera.up).toEqualEpsilon(Cartesian3.UNIT_Z, CesiumMath.EPSILON10); expect(camera.right).toEqualEpsilon( Cartesian3.negate(Cartesian3.UNIT_Y, new Cartesian3()), - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); }); @@ -2620,11 +2620,11 @@ describe("Scene/Camera", function () { -CesiumMath.PI_OVER_TWO, -CesiumMath.PI_OVER_FOUR, CesiumMath.PI_OVER_TWO, - CesiumMath.PI_OVER_FOUR + CesiumMath.PI_OVER_FOUR, ); const projection = new GeographicProjection(); const edge = projection.project( - new Cartographic(CesiumMath.PI_OVER_TWO, CesiumMath.PI_OVER_FOUR) + new Cartographic(CesiumMath.PI_OVER_TWO, CesiumMath.PI_OVER_FOUR), ); const expected = Math.max(edge.x, edge.y); @@ -2654,11 +2654,11 @@ describe("Scene/Camera", function () { -CesiumMath.PI_OVER_FOUR, -CesiumMath.PI_OVER_TWO, CesiumMath.PI_OVER_FOUR, - CesiumMath.PI_OVER_TWO + CesiumMath.PI_OVER_TWO, ); const projection = new GeographicProjection(); const edge = projection.project( - new Cartographic(CesiumMath.PI_OVER_FOUR, CesiumMath.PI_OVER_TWO) + new Cartographic(CesiumMath.PI_OVER_FOUR, CesiumMath.PI_OVER_TWO), ); const expected = Math.max(edge.x, edge.y); @@ -2679,7 +2679,7 @@ describe("Scene/Camera", function () { -CesiumMath.PI_OVER_TWO, -CesiumMath.PI_OVER_TWO, CesiumMath.PI_OVER_TWO, - CesiumMath.PI_OVER_TWO + CesiumMath.PI_OVER_TWO, ); const projection = new GeographicProjection(); camera._mode = SceneMode.COLUMBUS_VIEW; @@ -2687,19 +2687,19 @@ describe("Scene/Camera", function () { camera.setView({ destination: rectangle }); expect(camera.position).toEqualEpsilon( new Cartesian3(0.0, 0.0, 23137321.67119748), - CesiumMath.EPSILON8 + CesiumMath.EPSILON8, ); expect(camera.direction).toEqualEpsilon( new Cartesian3(0.0, 0.0, -1.0), - CesiumMath.EPSILON2 + CesiumMath.EPSILON2, ); expect(camera.up).toEqualEpsilon( new Cartesian3(0.0, 1.0, 0.0), - CesiumMath.EPSILON2 + CesiumMath.EPSILON2, ); expect(camera.right).toEqualEpsilon( new Cartesian3(1.0, 0.0, 0.0), - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); }); @@ -2719,7 +2719,7 @@ describe("Scene/Camera", function () { CesiumMath.toRadians(21.25), CesiumMath.toRadians(41.23), CesiumMath.toRadians(21.51), - CesiumMath.toRadians(41.38) + CesiumMath.toRadians(41.38), ); const projection = new GeographicProjection(); @@ -2729,27 +2729,27 @@ describe("Scene/Camera", function () { expect(camera.position).toEqualEpsilon( new Cartesian3(4489090.849577177, 1757448.0638960265, 4207738.07588144), - CesiumMath.EPSILON6 + CesiumMath.EPSILON6, ); expect(camera.direction).toEqualEpsilon( new Cartesian3( -0.6995012374560863, -0.2738499033887593, - -0.6600789719506079 + -0.6600789719506079, ), - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); expect(camera.up).toEqualEpsilon( new Cartesian3( -0.6146543999545513, -0.2406329524979527, - 0.7511962132416727 + 0.7511962132416727, ), - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); expect(camera.right).toEqualEpsilon( new Cartesian3(-0.36455176232452197, 0.931183125161794, 0.0), - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); }); @@ -2769,7 +2769,7 @@ describe("Scene/Camera", function () { CesiumMath.toRadians(21.25), CesiumMath.toRadians(41.23), CesiumMath.toRadians(21.51), - CesiumMath.toRadians(41.38) + CesiumMath.toRadians(41.38), ); const projection = new GeographicProjection(); @@ -2779,16 +2779,16 @@ describe("Scene/Camera", function () { expect(camera.position).toEqualEpsilon( new Cartesian3(2380010.713160189, 4598051.567216165, 28943.06760625122), - CesiumMath.EPSILON6 + CesiumMath.EPSILON6, ); expect(camera.direction).toEqualEpsilon( new Cartesian3(0.0, 0.0, -1.0), - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); expect(camera.up).toEqualEpsilon(Cartesian3.UNIT_Y, CesiumMath.EPSILON10); expect(camera.right).toEqualEpsilon( Cartesian3.UNIT_X, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); }); @@ -2803,7 +2803,7 @@ describe("Scene/Camera", function () { -Math.PI, -CesiumMath.PI_OVER_TWO, Math.PI, - CesiumMath.PI_OVER_TWO + CesiumMath.PI_OVER_TWO, ); const position = Cartesian3.clone(camera.position); const direction = Cartesian3.clone(camera.direction); @@ -2813,7 +2813,7 @@ describe("Scene/Camera", function () { camera.getRectangleCameraCoordinates(rectangle, position); expect(position).toEqualEpsilon( new Cartesian3(14680290.639204923, 0.0, 0.0), - CesiumMath.EPSILON6 + CesiumMath.EPSILON6, ); expect(camera.direction).toEqual(direction); expect(camera.up).toEqual(up); @@ -2825,7 +2825,7 @@ describe("Scene/Camera", function () { 0.1, -CesiumMath.PI_OVER_TWO, -0.1, - CesiumMath.PI_OVER_TWO + CesiumMath.PI_OVER_TWO, ); let position = new Cartesian3(); const direction = Cartesian3.clone(camera.direction); @@ -2835,7 +2835,7 @@ describe("Scene/Camera", function () { position = camera.getRectangleCameraCoordinates(rectangle); expect(position).toEqualEpsilon( new Cartesian3(-14680290.639204923, 0.0, 0.0), - CesiumMath.EPSILON6 + CesiumMath.EPSILON6, ); expect(camera.direction).toEqual(direction); expect(camera.up).toEqual(up); @@ -2847,7 +2847,7 @@ describe("Scene/Camera", function () { -CesiumMath.PI_OVER_FOUR, -CesiumMath.PI_OVER_TWO, CesiumMath.PI_OVER_FOUR, - CesiumMath.PI_OVER_TWO + CesiumMath.PI_OVER_TWO, ); const projection = new GeographicProjection(); const cam = new Camera(scene); @@ -2878,7 +2878,7 @@ describe("Scene/Camera", function () { -CesiumMath.PI_OVER_TWO, -CesiumMath.PI_OVER_TWO, CesiumMath.PI_OVER_TWO, - CesiumMath.PI_OVER_TWO + CesiumMath.PI_OVER_TWO, ); const projection = new GeographicProjection(); camera._mode = SceneMode.COLUMBUS_VIEW; @@ -2889,7 +2889,7 @@ describe("Scene/Camera", function () { camera.position = camera.getRectangleCameraCoordinates(rectangle); expect(camera.position).toEqualEpsilon( new Cartesian3(0.0, 0.0, 23137321.67119748), - CesiumMath.EPSILON8 + CesiumMath.EPSILON8, ); expect(camera.direction).toEqual(direction); expect(camera.up).toEqual(up); @@ -2901,7 +2901,7 @@ describe("Scene/Camera", function () { -CesiumMath.PI_OVER_TWO, -CesiumMath.PI_OVER_TWO, CesiumMath.PI_OVER_TWO, - CesiumMath.PI_OVER_TWO + CesiumMath.PI_OVER_TWO, ); const projection = new GeographicProjection(); camera._mode = SceneMode.MORPHING; @@ -2940,17 +2940,17 @@ describe("Scene/Camera", function () { camera.position = Cartesian3.multiplyByScalar( Cartesian3.UNIT_X, 2.0 * maxRadii, - new Cartesian3() + new Cartesian3(), ); camera.direction = Cartesian3.normalize( Cartesian3.negate(camera.position, new Cartesian3()), - new Cartesian3() + new Cartesian3(), ); camera.up = Cartesian3.clone(Cartesian3.UNIT_Z); camera.right = Cartesian3.cross( camera.direction, camera.up, - new Cartesian3() + new Cartesian3(), ); const frustum = new PerspectiveFrustum(); @@ -2962,7 +2962,7 @@ describe("Scene/Camera", function () { const windowCoord = new Cartesian2( scene.canvas.clientWidth * 0.5, - scene.canvas.clientHeight * 0.5 + scene.canvas.clientHeight * 0.5, ); let p = camera.pickEllipsoid(windowCoord, ellipsoid); const c = ellipsoid.cartesianToCartographic(p); @@ -2994,7 +2994,7 @@ describe("Scene/Camera", function () { camera.position = new Cartesian3(0.0, 0.0, 2.0 * maxRadii); camera.direction = Cartesian3.normalize( Cartesian3.negate(camera.position, new Cartesian3()), - new Cartesian3() + new Cartesian3(), ); camera.up = Cartesian3.clone(Cartesian3.UNIT_Y); @@ -3013,7 +3013,7 @@ describe("Scene/Camera", function () { const windowCoord = new Cartesian2( scene.canvas.clientWidth * 0.5, - scene.canvas.clientHeight * 0.5 + scene.canvas.clientHeight * 0.5, ); const p = camera.pickEllipsoid(windowCoord); const c = ellipsoid.cartesianToCartographic(p); @@ -3028,7 +3028,7 @@ describe("Scene/Camera", function () { camera.position = new Cartesian3(0.0, 0.0, 2.0 * maxRadii); camera.direction = Cartesian3.normalize( Cartesian3.negate(camera.position, new Cartesian3()), - new Cartesian3() + new Cartesian3(), ); camera.up = Cartesian3.clone(Cartesian3.UNIT_Y); @@ -3047,7 +3047,7 @@ describe("Scene/Camera", function () { const windowCoord = new Cartesian2( scene.canvas.clientWidth * 0.5, - scene.canvas.clientHeight * 0.5 + 1.0 + scene.canvas.clientHeight * 0.5 + 1.0, ); let p = camera.pickEllipsoid(windowCoord); let c = ellipsoid.cartesianToCartographic(p); @@ -3070,20 +3070,20 @@ describe("Scene/Camera", function () { camera.position = Cartesian3.multiplyByScalar( Cartesian3.normalize(new Cartesian3(0.0, -1.0, 1.0), new Cartesian3()), 5.0 * maxRadii, - new Cartesian3() + new Cartesian3(), ); camera.direction = Cartesian3.normalize( Cartesian3.subtract(Cartesian3.ZERO, camera.position, new Cartesian3()), - new Cartesian3() + new Cartesian3(), ); camera.right = Cartesian3.normalize( Cartesian3.cross(camera.direction, Cartesian3.UNIT_Z, new Cartesian3()), - new Cartesian3() + new Cartesian3(), ); camera.up = Cartesian3.cross( camera.right, camera.direction, - new Cartesian3() + new Cartesian3(), ); const frustum = new PerspectiveFrustum(); @@ -3097,7 +3097,7 @@ describe("Scene/Camera", function () { const windowCoord = new Cartesian2( scene.canvas.clientWidth * 0.5, - scene.canvas.clientHeight * 0.5 + scene.canvas.clientHeight * 0.5, ); let p = camera.pickEllipsoid(windowCoord); const c = ellipsoid.cartesianToCartographic(p); @@ -3114,17 +3114,17 @@ describe("Scene/Camera", function () { camera.position = Cartesian3.multiplyByScalar( Cartesian3.UNIT_X, 2.0 * maxRadii, - new Cartesian3() + new Cartesian3(), ); camera.direction = Cartesian3.normalize( Cartesian3.negate(camera.position, new Cartesian3()), - new Cartesian3() + new Cartesian3(), ); camera.up = Cartesian3.clone(Cartesian3.UNIT_Z); camera.right = Cartesian3.cross( camera.direction, camera.up, - new Cartesian3() + new Cartesian3(), ); const frustum = new PerspectiveFrustum(); @@ -3138,7 +3138,7 @@ describe("Scene/Camera", function () { const windowCoord = new Cartesian2( scene.canvas.clientWidth * 0.5, - scene.canvas.clientHeight * 0.5 + scene.canvas.clientHeight * 0.5, ); const p = camera.pickEllipsoid(windowCoord); expect(p).toBeUndefined(); @@ -3153,7 +3153,7 @@ describe("Scene/Camera", function () { it("get pick ray returns undefined if the Scene is not fully rendered", function () { const windowCoord = new Cartesian2( scene.canvas.clientWidth / 2, - scene.canvas.clientHeight + scene.canvas.clientHeight, ); scene.canvas.clientWidth = 0; @@ -3164,7 +3164,7 @@ describe("Scene/Camera", function () { it("get pick ray perspective", function () { const windowCoord = new Cartesian2( scene.canvas.clientWidth / 2, - scene.canvas.clientHeight + scene.canvas.clientHeight, ); const ray = camera.getPickRay(windowCoord); @@ -3172,12 +3172,12 @@ describe("Scene/Camera", function () { camera.frustum.near * Math.tan(camera.frustum.fovy * 0.5); const expectedDirection = Cartesian3.normalize( new Cartesian3(0.0, -windowHeight, -1.0), - new Cartesian3() + new Cartesian3(), ); expect(ray.origin).toEqual(camera.position); expect(ray.direction).toEqualEpsilon( expectedDirection, - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); }); @@ -3195,7 +3195,7 @@ describe("Scene/Camera", function () { const windowCoord = new Cartesian2( (3.0 / 5.0) * scene.canvas.clientWidth, - (1.0 - 3.0 / 5.0) * scene.canvas.clientHeight + (1.0 - 3.0 / 5.0) * scene.canvas.clientHeight, ); const ray = camera.getPickRay(windowCoord); @@ -3203,7 +3203,7 @@ describe("Scene/Camera", function () { const expectedPosition = new Cartesian3( cameraPosition.z, cameraPosition.x + 2.0, - cameraPosition.y + 2.0 + cameraPosition.y + 2.0, ); expect(ray.origin).toEqualEpsilon(expectedPosition, CesiumMath.EPSILON14); expect(ray.direction).toEqual(camera.directionWC); @@ -3224,7 +3224,7 @@ describe("Scene/Camera", function () { const windowCoord = new Cartesian2( (3.0 / 5.0) * scene.canvas.clientWidth, - (1.0 - 3.0 / 5.0) * scene.canvas.clientHeight + (1.0 - 3.0 / 5.0) * scene.canvas.clientHeight, ); const ray = camera.getPickRay(windowCoord); @@ -3232,7 +3232,7 @@ describe("Scene/Camera", function () { const expectedPosition = new Cartesian3( cameraPosition.x + 2.0, cameraPosition.y + 2, - cameraPosition.z + cameraPosition.z, ); expect(ray.origin).toEqualEpsilon(expectedPosition, CesiumMath.EPSILON14); expect(ray.direction).toEqual(camera.directionWC); @@ -3253,7 +3253,7 @@ describe("Scene/Camera", function () { const windowCoord = new Cartesian2( (3.0 / 5.0) * scene.canvas.clientWidth, - (1.0 - 3.0 / 5.0) * scene.canvas.clientHeight + (1.0 - 3.0 / 5.0) * scene.canvas.clientHeight, ); const ray = camera.getPickRay(windowCoord); @@ -3261,7 +3261,7 @@ describe("Scene/Camera", function () { const expectedPosition = new Cartesian3( cameraPosition.z, cameraPosition.x + 2.0, - cameraPosition.y + 2 + cameraPosition.y + 2, ); expect(ray.origin).toEqualEpsilon(expectedPosition, CesiumMath.EPSILON14); expect(ray.direction).toEqual(camera.directionWC); @@ -3295,7 +3295,7 @@ describe("Scene/Camera", function () { it("gets magnitude in 3D", function () { expect(camera.getMagnitude()).toEqual( - Cartesian3.magnitude(camera.position) + Cartesian3.magnitude(camera.position), ); }); @@ -3322,7 +3322,7 @@ describe("Scene/Camera", function () { camera.update(SceneMode.SCENE2D); const max = scene.mapProjection.project( - new Cartographic(Math.PI, CesiumMath.PI_OVER_TWO) + new Cartographic(Math.PI, CesiumMath.PI_OVER_TWO), ); const factor = 1000.0; const dx = max.x * factor; @@ -3345,13 +3345,13 @@ describe("Scene/Camera", function () { camera.position = Cartesian3.multiplyByScalar( Cartesian3.UNIT_Z, maxRadii * 5.0, - new Cartesian3() + new Cartesian3(), ); camera.update(SceneMode.COLUMBUS_VIEW); const max = scene.mapProjection.project( - new Cartographic(Math.PI, CesiumMath.PI_OVER_TWO) + new Cartographic(Math.PI, CesiumMath.PI_OVER_TWO), ); const factor = 1000.0; const dx = max.x * factor; @@ -3405,11 +3405,11 @@ describe("Scene/Camera", function () { mercatorCamera.position = Cartesian3.multiplyByScalar( Cartesian3.UNIT_Z, maxRadii * 5.0, - new Cartesian3() + new Cartesian3(), ); const max = projection.project( - new Cartographic(Math.PI, CesiumMath.PI_OVER_TWO) + new Cartographic(Math.PI, CesiumMath.PI_OVER_TWO), ); const factor = 1000.0; const dx = max.x * factor; @@ -3428,11 +3428,11 @@ describe("Scene/Camera", function () { expect(mercatorCamera.position.x).toEqualEpsilon( max.x, - CesiumMath.EPSILON6 + CesiumMath.EPSILON6, ); expect(mercatorCamera.position.y).toEqualEpsilon( max.y, - CesiumMath.EPSILON6 + CesiumMath.EPSILON6, ); mercatorCamera.moveDown(dy); @@ -3447,11 +3447,11 @@ describe("Scene/Camera", function () { expect(mercatorCamera.position.x).toEqualEpsilon( -max.x, - CesiumMath.EPSILON6 + CesiumMath.EPSILON6, ); expect(mercatorCamera.position.y).toEqualEpsilon( -max.y, - CesiumMath.EPSILON6 + CesiumMath.EPSILON6, ); }); @@ -3500,7 +3500,7 @@ describe("Scene/Camera", function () { expect(passedOptions.pitchAdjustHeight).toBe(options.pitchAdjustHeight); expect(passedOptions.flyOverLongitude).toBe(options.flyOverLongitude); expect(passedOptions.flyOverLongitudeWeight).toBe( - options.flyOverLongitudeWeight + options.flyOverLongitudeWeight, ); }); @@ -3617,25 +3617,25 @@ describe("Scene/Camera", function () { new Cartesian3( 2515865.110478756, -19109892.759980734, - 13550929.353715947 + 13550929.353715947, ), - CesiumMath.EPSILON8 + CesiumMath.EPSILON8, ); expect(camera.direction).toEqualEpsilon( new Cartesian3( -0.10654051334260287, 0.8092555423939248, - -0.5777149696185906 + -0.5777149696185906, ), - CesiumMath.EPSILON8 + CesiumMath.EPSILON8, ); expect(camera.up).toEqualEpsilon( new Cartesian3( -0.07540693517283716, 0.5727725379670786, - 0.8162385765685121 + 0.8162385765685121, ), - CesiumMath.EPSILON8 + CesiumMath.EPSILON8, ); }); @@ -3649,11 +3649,11 @@ describe("Scene/Camera", function () { camera.flyHome(0); expect(camera.position).toEqualEpsilon( new Cartesian3(-9183857.990445068, 3896182.1777645755, 1.0), - CesiumMath.EPSILON8 + CesiumMath.EPSILON8, ); expect(camera.direction).toEqualEpsilon( new Cartesian3(0, 0, -1), - CesiumMath.EPSILON8 + CesiumMath.EPSILON8, ); expect(camera.up).toEqualEpsilon(Cartesian3.UNIT_Y, CesiumMath.EPSILON8); }); @@ -3669,15 +3669,15 @@ describe("Scene/Camera", function () { camera.flyHome(0); expect(camera.position).toEqualEpsilon( new Cartesian3(0, -22550119.620184112, 22550119.62018411), - CesiumMath.EPSILON8 + CesiumMath.EPSILON8, ); expect(camera.direction).toEqualEpsilon( new Cartesian3(0, sq2Over2, -sq2Over2), - CesiumMath.EPSILON8 + CesiumMath.EPSILON8, ); expect(camera.up).toEqualEpsilon( new Cartesian3(0, sq2Over2, sq2Over2), - CesiumMath.EPSILON8 + CesiumMath.EPSILON8, ); }); @@ -3686,7 +3686,7 @@ describe("Scene/Camera", function () { const sphere = new BoundingSphere( Cartesian3.fromDegrees(-117.16, 32.71, 0.0), - 10000.0 + 10000.0, ); camera.viewBoundingSphere(sphere); camera._setTransform(Matrix4.IDENTITY); @@ -3705,11 +3705,11 @@ describe("Scene/Camera", function () { const sphere = new BoundingSphere( Cartesian3.fromDegrees(-117.16, 32.71, 0.0), - 10.0 + 10.0, ); camera.viewBoundingSphere( sphere, - new HeadingPitchRange(heading, pitch, range) + new HeadingPitchRange(heading, pitch, range), ); camera._setTransform(Matrix4.IDENTITY); @@ -3729,7 +3729,7 @@ describe("Scene/Camera", function () { const sphere = new BoundingSphere( Cartesian3.fromDegrees(-117.16, 32.71, 0.0), - 10.0 + 10.0, ); camera.viewBoundingSphere(sphere, offset); camera._setTransform(Matrix4.IDENTITY); @@ -3753,7 +3753,7 @@ describe("Scene/Camera", function () { const sphere = new BoundingSphere( Cartesian3.fromDegrees(-117.16, 32.71, 0.0), - 10000.0 + 10000.0, ); camera.viewBoundingSphere(sphere); camera._setTransform(Matrix4.IDENTITY); @@ -3778,7 +3778,7 @@ describe("Scene/Camera", function () { const sphere = new BoundingSphere( Cartesian3.fromDegrees(-117.16, 32.71, 0.0), - 10000.0 + 10000.0, ); camera.viewBoundingSphere(sphere); camera._setTransform(Matrix4.IDENTITY); @@ -3813,7 +3813,7 @@ describe("Scene/Camera", function () { const sphere = new BoundingSphere( Cartesian3.fromDegrees(-117.16, 32.71, 0.0), - 100000.0 + 100000.0, ); camera.flyToBoundingSphere(sphere); @@ -3825,7 +3825,7 @@ describe("Scene/Camera", function () { const sphere = new BoundingSphere( Cartesian3.fromDegrees(-117.16, 32.71, 0.0), - 10000.0 + 10000.0, ); camera.flyToBoundingSphere(sphere, { duration: 0.0, @@ -3843,7 +3843,7 @@ describe("Scene/Camera", function () { const sphere = new BoundingSphere( Cartesian3.fromDegrees(-117.16, 32.71, 0.0), - 10.0 + 10.0, ); camera.flyToBoundingSphere(sphere, { @@ -3861,7 +3861,7 @@ describe("Scene/Camera", function () { const sphere = new BoundingSphere( Cartesian3.fromDegrees(-117.16, 32.71, 0.0), - 100000 + 100000, ); camera.flyToBoundingSphere(sphere, { @@ -3880,7 +3880,7 @@ describe("Scene/Camera", function () { const sphere = new BoundingSphere( Cartesian3.fromDegrees(-117.16, 32.71, 0.0), - 100000.0 + 100000.0, ); camera.flyToBoundingSphere(sphere, options); @@ -3923,14 +3923,14 @@ describe("Scene/Camera", function () { drawingBufferHeight, distance, scene.pixelRatio, - new Cartesian2() + new Cartesian2(), ); const expectedPixelSize = Math.max(pixelDimensions.x, pixelDimensions.y); const pixelSize = camera.getPixelSize( sphere, drawingBufferWidth, - drawingBufferHeight + drawingBufferHeight, ); expect(pixelSize).toEqual(expectedPixelSize); @@ -3975,14 +3975,14 @@ describe("Scene/Camera", function () { camera.right = Cartesian3.cross( camera.direction, camera.up, - new Cartesian3() + new Cartesian3(), ); const correctResult = new Rectangle( -0.05789100547374969, -0.04365869998457809, 0.05789100547374969, - 0.04365869998457809 + 0.04365869998457809, ); const rect = camera.computeViewRectangle(); @@ -4000,14 +4000,14 @@ describe("Scene/Camera", function () { camera.right = Cartesian3.cross( camera.direction, camera.up, - new Cartesian3() + new Cartesian3(), ); const correctResult = new Rectangle( -CesiumMath.PI, 1.4961779388065022, CesiumMath.PI, - CesiumMath.PI_OVER_TWO + CesiumMath.PI_OVER_TWO, ); const rect = camera.computeViewRectangle(); @@ -4025,14 +4025,14 @@ describe("Scene/Camera", function () { camera.right = Cartesian3.cross( camera.direction, camera.up, - new Cartesian3() + new Cartesian3(), ); const correctResult = new Rectangle( 3.0837016481160435, -0.04365869998457809, -3.0837016481160435, - 0.04365869998457809 + 0.04365869998457809, ); const rect = camera.computeViewRectangle(); @@ -4051,7 +4051,7 @@ describe("Scene/Camera", function () { camera.right = Cartesian3.cross( camera.direction, camera.up, - new Cartesian3() + new Cartesian3(), ); const rect = camera.computeViewRectangle(); @@ -4070,7 +4070,7 @@ describe("Scene/Camera", function () { camera.right = Cartesian3.cross( camera.direction, camera.up, - new Cartesian3() + new Cartesian3(), ); const rect = camera.computeViewRectangle(); @@ -4104,7 +4104,7 @@ describe("Scene/Camera", function () { expect( tweenSpy.calls .mostRecent() - .args[1].destination.equalsEpsilon(expectedDestination, 0.1) + .args[1].destination.equalsEpsilon(expectedDestination, 0.1), ).toBe(true); }); @@ -4126,7 +4126,7 @@ describe("Scene/Camera", function () { expect( tweenSpy.calls .mostRecent() - .args[1].destination.equalsEpsilon(expectedDestination, 0.1) + .args[1].destination.equalsEpsilon(expectedDestination, 0.1), ).toBe(true); }); @@ -4148,7 +4148,7 @@ describe("Scene/Camera", function () { expect( tweenSpy.calls .mostRecent() - .args[1].destination.equalsEpsilon(expectedDestination, 0.1) + .args[1].destination.equalsEpsilon(expectedDestination, 0.1), ).toBe(true); }); @@ -4178,7 +4178,7 @@ describe("Scene/Camera", function () { expect(camera.up).toEqualEpsilon(up, CesiumMath.EPSILON6); expect(camera.position).toEqualEpsilon( expectedDestination, - CesiumMath.EPSILON1 + CesiumMath.EPSILON1, ); }); @@ -4199,7 +4199,7 @@ describe("Scene/Camera", function () { expect( tweenSpy.calls .mostRecent() - .args[1].destination.equalsEpsilon(expectedDestination, 0.1) + .args[1].destination.equalsEpsilon(expectedDestination, 0.1), ).toBe(true); }); @@ -4220,7 +4220,7 @@ describe("Scene/Camera", function () { expect( tweenSpy.calls .mostRecent() - .args[1].destination.equalsEpsilon(expectedDestination, 0.1) + .args[1].destination.equalsEpsilon(expectedDestination, 0.1), ).toBe(true); }); @@ -4240,7 +4240,7 @@ describe("Scene/Camera", function () { expect( tweenSpy.calls .mostRecent() - .args[1].destination.equalsEpsilon(expectedDestination, 0.1) + .args[1].destination.equalsEpsilon(expectedDestination, 0.1), ).toBe(true); }); @@ -4298,15 +4298,15 @@ describe("Scene/Camera", function () { camera.lookAtTransform(transform); expect(Cartesian3.magnitude(camera.directionWC)).toEqualEpsilon( 1.0, - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); expect(Cartesian3.magnitude(camera.rightWC)).toEqualEpsilon( 1.0, - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); expect(Cartesian3.magnitude(camera.upWC)).toEqualEpsilon( 1.0, - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); }); @@ -4320,7 +4320,7 @@ describe("Scene/Camera", function () { camera._updateCameraChanged(); expect(camera.positionWCDeltaMagnitude).toEqualEpsilon( moveAmount, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); expect(camera.positionWCDeltaMagnitudeLastFrame).toEqual(0); @@ -4328,7 +4328,7 @@ describe("Scene/Camera", function () { expect(camera.positionWCDeltaMagnitude).toEqual(0); expect(camera.positionWCDeltaMagnitudeLastFrame).toEqualEpsilon( moveAmount, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); }); }); diff --git a/packages/engine/Specs/Scene/Cesium3DTileBatchTableSpec.js b/packages/engine/Specs/Scene/Cesium3DTileBatchTableSpec.js index c892ab3bdd64..04b4f5370fc5 100644 --- a/packages/engine/Specs/Scene/Cesium3DTileBatchTableSpec.js +++ b/packages/engine/Specs/Scene/Cesium3DTileBatchTableSpec.js @@ -240,7 +240,7 @@ xdescribe( const batchTable = new Cesium3DTileBatchTable( mockTileset, 1, - batchTableJson + batchTableJson, ); expect(batchTable.hasProperty(0, "height")).toEqual(true); expect(batchTable.hasProperty(0, "id")).toEqual(false); @@ -279,7 +279,7 @@ xdescribe( const batchTable = new Cesium3DTileBatchTable( mockTileset, 1, - batchTableJson + batchTableJson, ); const results = []; const names = batchTable.getPropertyIds(0, results); @@ -357,7 +357,7 @@ xdescribe( const batchTable = new Cesium3DTileBatchTable( mockTileset, 2, - batchTableJson + batchTableJson, ); batchTable.setProperty(0, "height", 3.0); @@ -375,7 +375,7 @@ xdescribe( const batchTable = new Cesium3DTileBatchTable( mockTileset, 2, - batchTableJson + batchTableJson, ); batchTable.setProperty(0, "info", { name: "building0_new", year: 2002 }); @@ -399,7 +399,7 @@ xdescribe( const batchTable = new Cesium3DTileBatchTable( mockTileset, 2, - batchTableJson + batchTableJson, ); batchTable.setProperty(0, "rooms", ["room1_new", "room2"]); @@ -423,7 +423,7 @@ xdescribe( mockTileset, 2, batchTableJson, - batchTableBinary + batchTableBinary, ); }).toThrowError(RuntimeError); }); @@ -441,7 +441,7 @@ xdescribe( mockTileset, 2, batchTableJson, - batchTableBinary + batchTableBinary, ); }).toThrowError(RuntimeError); }); @@ -464,78 +464,17 @@ xdescribe( const propertyVec2Binary = new Float32Array([2, 3, 4, 5]); const propertyVec3Binary = new Int32Array([6, 7, 8, 9, 10, 11]); const propertyVec4Binary = new Uint32Array([ - 12, - 13, - 14, - 15, - 16, - 17, - 18, - 19, + 12, 13, 14, 15, 16, 17, 18, 19, ]); const propertyMat2Binary = new Int16Array([ - 20, - 21, - 22, - 23, - 24, - 25, - 26, - 27, + 20, 21, 22, 23, 24, 25, 26, 27, ]); const propertyMat3Binary = new Uint16Array([ - 28, - 29, - 30, - 31, - 32, - 33, - 34, - 35, - 36, - 37, - 38, - 39, - 40, - 41, - 42, - 43, - 44, - 45, + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, ]); const propertyMat4Binary = new Uint8Array([ - 46, - 47, - 48, - 49, - 50, - 51, - 52, - 53, - 54, - 55, - 56, - 57, - 58, - 59, - 60, - 61, - 62, - 63, - 64, - 65, - 66, - 67, - 68, - 69, - 70, - 71, - 72, - 73, - 74, - 75, - 76, - 77, + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ]); const buffers = [ @@ -590,24 +529,24 @@ xdescribe( mockTileset, 2, batchTableJson, - batchTableBinary + batchTableBinary, ); expect(batchTable.getProperty(1, "propertyScalar")).toEqual(1); expect(batchTable.getProperty(1, "propertyVec2")).toEqual( - new Cartesian2(4, 5) + new Cartesian2(4, 5), ); expect(batchTable.getProperty(1, "propertyVec3")).toEqual( - new Cartesian3(9, 10, 11) + new Cartesian3(9, 10, 11), ); expect(batchTable.getProperty(1, "propertyVec4")).toEqual( - new Cartesian4(16, 17, 18, 19) + new Cartesian4(16, 17, 18, 19), ); expect(batchTable.getProperty(1, "propertyMat2")).toEqual( - new Matrix2(24, 26, 25, 27) + new Matrix2(24, 26, 25, 27), ); // Constructor is row-major, data is column major expect(batchTable.getProperty(1, "propertyMat3")).toEqual( - new Matrix3(37, 40, 43, 38, 41, 44, 39, 42, 45) + new Matrix3(37, 40, 43, 38, 41, 44, 39, 42, 45), ); // Constructor is row-major, data is column major expect(batchTable.getProperty(1, "propertyMat4")).toEqual( new Matrix4( @@ -626,8 +565,8 @@ xdescribe( 65, 69, 73, - 77 - ) + 77, + ), ); // Constructor is row-major, data is column major batchTable.setProperty(1, "propertyScalar", 2); @@ -638,7 +577,7 @@ xdescribe( batchTable.setProperty( 1, "propertyMat3", - new Matrix3(38, 41, 44, 39, 42, 45, 40, 43, 46) + new Matrix3(38, 41, 44, 39, 42, 45, 40, 43, 46), ); batchTable.setProperty( 1, @@ -659,25 +598,25 @@ xdescribe( 66, 70, 74, - 78 - ) + 78, + ), ); expect(batchTable.getProperty(1, "propertyScalar")).toEqual(2); expect(batchTable.getProperty(1, "propertyVec2")).toEqual( - new Cartesian2(5, 6) + new Cartesian2(5, 6), ); expect(batchTable.getProperty(1, "propertyVec3")).toEqual( - new Cartesian3(10, 11, 12) + new Cartesian3(10, 11, 12), ); expect(batchTable.getProperty(1, "propertyVec4")).toEqual( - new Cartesian4(17, 18, 19, 20) + new Cartesian4(17, 18, 19, 20), ); expect(batchTable.getProperty(1, "propertyMat2")).toEqual( - new Matrix2(25, 27, 26, 28) + new Matrix2(25, 27, 26, 28), ); expect(batchTable.getProperty(1, "propertyMat3")).toEqual( - new Matrix3(38, 41, 44, 39, 42, 45, 40, 43, 46) + new Matrix3(38, 41, 44, 39, 42, 45, 40, 43, 46), ); expect(batchTable.getProperty(1, "propertyMat4")).toEqual( new Matrix4( @@ -696,8 +635,8 @@ xdescribe( 66, 70, 74, - 78 - ) + 78, + ), ); }); @@ -724,7 +663,7 @@ xdescribe( }); Cesium3DTilesTester.expectRenderTileset(scene, tileset); - } + }, ); }); @@ -736,7 +675,7 @@ xdescribe( expect(content.getFeature(2).getProperty("id")).toBeUndefined(); Cesium3DTilesTester.expectRenderTileset(scene, tileset); - } + }, ); }); @@ -751,8 +690,9 @@ xdescribe( Cesium3DTilesTester.expectRenderTileset(scene, tileset); // Re-enable VTF - ContextLimits._maximumVertexTextureImageUnits = maximumVertexTextureImageUnits; - } + ContextLimits._maximumVertexTextureImageUnits = + maximumVertexTextureImageUnits; + }, ); }); @@ -765,13 +705,13 @@ xdescribe( function (tileset) { const content = tileset.root.content; expect(content.featuresLength).toBeGreaterThan( - ContextLimits._maximumTextureSize + ContextLimits._maximumTextureSize, ); Cesium3DTilesTester.expectRenderTileset(scene, tileset); // Reset maximum texture size ContextLimits._maximumTextureSize = maximumTextureSize; - } + }, ); }); @@ -784,7 +724,7 @@ xdescribe( expect(result).toBeDefined(); expect(result.primitive).toBe(tileset); }); - } + }, ); }); @@ -822,7 +762,7 @@ xdescribe( return Cesium3DTilesTester.loadTileset(scene, withoutBatchTableUrl).then( function (tileset) { expectRenderTranslucent(tileset); - } + }, ); }); @@ -835,8 +775,9 @@ xdescribe( function (tileset) { expectRenderTranslucent(tileset); // Re-enable VTF - ContextLimits._maximumVertexTextureImageUnits = maximumVertexTextureImageUnits; - } + ContextLimits._maximumVertexTextureImageUnits = + maximumVertexTextureImageUnits; + }, ); }); @@ -1113,21 +1054,21 @@ xdescribe( } function checkBatchTableHierarchy(url, multipleParents) { - return Cesium3DTilesTester.loadTileset(scene, url).then(function ( - tileset - ) { - checkHierarchyStyling(tileset); - checkHierarchyProperties(tileset, multipleParents); - }); + return Cesium3DTilesTester.loadTileset(scene, url).then( + function (tileset) { + checkHierarchyStyling(tileset); + checkHierarchyProperties(tileset, multipleParents); + }, + ); } function checkBatchTableHierarchyNoParents(url) { - return Cesium3DTilesTester.loadTileset(scene, url).then(function ( - tileset - ) { - checkHierarchyStylingNoParents(tileset); - checkHierarchyPropertiesNoParents(tileset); - }); + return Cesium3DTilesTester.loadTileset(scene, url).then( + function (tileset) { + checkHierarchyStylingNoParents(tileset); + checkHierarchyPropertiesNoParents(tileset); + }, + ); } it("renders tileset with batch table hierarchy extension", function () { @@ -1141,7 +1082,7 @@ xdescribe( it("renders tileset with batch table hierarchy with multiple parent classes", function () { return checkBatchTableHierarchy( batchTableHierarchyMultipleParentsUrl, - true + true, ); }); @@ -1157,7 +1098,7 @@ xdescribe( return checkBatchTableHierarchy(batchTableHierarchyLegacyUrl, false).then( function (tileset) { expect(Cesium3DTileBatchTable._deprecationWarning).toHaveBeenCalled(); - } + }, ); }); @@ -1172,7 +1113,7 @@ xdescribe( scene.pickForSpecs(); const batchTextureSize = batchTable._batchTexture.byteLength; expect(batchTable.batchTableByteLength).toBe(batchTextureSize); - } + }, ); }); @@ -1187,28 +1128,28 @@ xdescribe( scene.pickForSpecs(); const batchTextureSize = batchTable._batchTexture.byteLength; expect(batchTable.batchTableByteLength).toBe(batchTextureSize); - } + }, ); }); it("computes batchTableByteLength for binary batch table", function () { return Cesium3DTilesTester.loadTileset( scene, - withBatchTableBinaryUrl + withBatchTableBinaryUrl, ).then(function (tileset) { const content = tileset.root.content; const batchTable = content.batchTable; const binaryPropertiesByteLength = batchTable._binaryPropertiesByteLength; expect(batchTable.batchTableByteLength).toBe( - binaryPropertiesByteLength + binaryPropertiesByteLength, ); // The batch texture isn't created until the first pick pass scene.pickForSpecs(); const batchTextureSize = batchTable._batchTexture.byteLength; expect(batchTable.batchTableByteLength).toBe( - binaryPropertiesByteLength + batchTextureSize + binaryPropertiesByteLength + batchTextureSize, ); }); }); @@ -1216,7 +1157,7 @@ xdescribe( it("computes batchTableByteLength with a batch table hierarchy", function () { return Cesium3DTilesTester.loadTileset( scene, - batchTableHierarchyUrl + batchTableHierarchyUrl, ).then(function (tileset) { const content = tileset.root.content; const batchTable = content.batchTable; @@ -1227,7 +1168,7 @@ xdescribe( scene.pickForSpecs(); const batchTextureSize = batchTable._batchTexture.byteLength; expect(batchTable.batchTableByteLength).toBe( - hierarchySize + batchTextureSize + hierarchySize + batchTextureSize, ); }); }); @@ -1240,9 +1181,9 @@ xdescribe( expect(batchTable.isDestroyed()).toEqual(false); scene.primitives.remove(tileset); expect(batchTable.isDestroyed()).toEqual(true); - } + }, ); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/Cesium3DTileFeatureSpec.js b/packages/engine/Specs/Scene/Cesium3DTileFeatureSpec.js index aca4a2fe7a86..2f45ed8cf0d3 100644 --- a/packages/engine/Specs/Scene/Cesium3DTileFeatureSpec.js +++ b/packages/engine/Specs/Scene/Cesium3DTileFeatureSpec.js @@ -37,34 +37,34 @@ describe( -0.01, -0.01, 0.01, - 0.01 + 0.01, ); const ellipsoid = Ellipsoid.WGS84; scene.camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(tilesetRectangle)), - new Cartesian3(0.0, 0.0, 0.01) + new Cartesian3(0.0, 0.0, 0.01), ); return Cesium3DTilesTester.loadTileset( scene, vectorPolylinesWithBatchIds, { vectorKeepDecodedPositions: true, - } + }, ).then(function (tileset) { const feature = tileset.root.children[0].content.getFeature(0); const polylinePositions = feature.polylinePositions; expect(polylinePositions.length).toBe(60); expect(polylinePositions[0]).toEqualEpsilon( 6378136.806372941, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(polylinePositions[1]).toEqualEpsilon( -1113.194885441724, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(polylinePositions[2]).toEqualEpsilon( 1105.675261474196, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); }); }); @@ -104,7 +104,7 @@ describe( return Cesium3DTilesTester.loadTileset( scene, - tilesetWithMetadataUrl + tilesetWithMetadataUrl, ).then(function (result) { tileset = result; }); @@ -134,14 +134,14 @@ describe( it("getPropertyInherited returns content property by semantic", function () { const feature = new Cesium3DTileFeature(childContents["ll.b3dm"], 0); expect(feature.getPropertyInherited("HIGHLIGHT_COLOR")).toEqual( - new Cartesian4(255, 0, 0, 1.0) + new Cartesian4(255, 0, 0, 1.0), ); }); it("getPropertyInherited returns content property", function () { const feature = new Cesium3DTileFeature(childContents["ll.b3dm"], 0); expect(feature.getPropertyInherited("HIGHLIGHT_COLOR")).toEqual( - new Cartesian4(255, 0, 0, 1.0) + new Cartesian4(255, 0, 0, 1.0), ); expect(feature.getPropertyInherited("triangleCount")).toBe(15000); }); @@ -149,14 +149,14 @@ describe( it("getPropertyInherited returns tile property by semantic", function () { const feature = new Cesium3DTileFeature(childContents["ll.b3dm"], 0); expect(feature.getPropertyInherited("COLOR")).toEqual( - new Cartesian4(255, 255, 0, 1.0) + new Cartesian4(255, 255, 0, 1.0), ); }); it("getPropertyInherited returns tile property", function () { const feature = new Cesium3DTileFeature(childContents["ll.b3dm"], 0); expect(feature.getPropertyInherited("color")).toEqual( - new Cartesian4(255, 255, 0, 1.0) + new Cartesian4(255, 255, 0, 1.0), ); expect(feature.getPropertyInherited("population")).toBe(50); }); @@ -164,7 +164,7 @@ describe( it("getPropertyInherited returns default value", function () { const feature = new Cesium3DTileFeature(childContents["ll.b3dm"], 0); expect(feature.getPropertyInherited("defaultColor")).toEqual( - new Cartesian4(255, 255, 255, 255) + new Cartesian4(255, 255, 255, 255), ); }); @@ -173,7 +173,7 @@ describe( expect(feature.getPropertyInherited("averageTemperature")).toEqual(24); feature = new Cesium3DTileFeature(childContents["ur.b3dm"], 0); expect( - feature.getPropertyInherited("averageTemperature") + feature.getPropertyInherited("averageTemperature"), ).not.toBeDefined(); }); @@ -196,7 +196,7 @@ describe( it("getPropertyInherited returns tileset property by semantic", function () { const feature = new Cesium3DTileFeature(parentContent, 0); expect(feature.getPropertyInherited("DATE_ISO_8601")).toBe( - "2021-04-07" + "2021-04-07", ); expect(feature.getPropertyInherited("AUTHOR")).toBe("Cesium"); }); @@ -207,8 +207,8 @@ describe( new Cartesian3( -1.3196816996258511, 0.6988767486400521, - 45.78600543644279 - ) + 45.78600543644279, + ), ); expect(feature.getPropertyInherited("date")).toBe("2021-04-07"); expect(feature.getPropertyInherited("author")).toBe("Cesium"); @@ -220,7 +220,7 @@ describe( // content metadata is more specific than tile metadata so this returns // red not cyan expect(feature.getPropertyInherited("highlightColor")).toEqual( - new Cartesian4(255, 0, 0, 1.0) + new Cartesian4(255, 0, 0, 1.0), ); // content metadata is more specific than tileset metadata so this returns @@ -230,7 +230,7 @@ describe( // tile metadata is more specific than tileset metadata so this returns // yellow not magenta expect(feature.getPropertyInherited("color")).toEqual( - new Cartesian4(255, 255, 0, 1.0) + new Cartesian4(255, 255, 0, 1.0), ); // group metadata is more specific than tileset metadata, so this returns @@ -254,7 +254,7 @@ describe( return Cesium3DTilesTester.loadTileset( scene, - tilesetWithMetadataExtensionUrl + tilesetWithMetadataExtensionUrl, ).then(function (result) { tileset = result; }); @@ -284,14 +284,14 @@ describe( it("getPropertyInherited returns content property by semantic", function () { const feature = new Cesium3DTileFeature(childContents["ll.b3dm"], 0); expect(feature.getPropertyInherited("HIGHLIGHT_COLOR")).toEqual( - new Cartesian4(255, 0, 0, 1.0) + new Cartesian4(255, 0, 0, 1.0), ); }); it("getPropertyInherited returns content property", function () { const feature = new Cesium3DTileFeature(childContents["ll.b3dm"], 0); expect(feature.getPropertyInherited("HIGHLIGHT_COLOR")).toEqual( - new Cartesian4(255, 0, 0, 1.0) + new Cartesian4(255, 0, 0, 1.0), ); expect(feature.getPropertyInherited("triangleCount")).toBe(15000); }); @@ -299,14 +299,14 @@ describe( it("getPropertyInherited returns tile property by semantic", function () { const feature = new Cesium3DTileFeature(childContents["ll.b3dm"], 0); expect(feature.getPropertyInherited("COLOR")).toEqual( - new Cartesian4(255, 255, 0, 1.0) + new Cartesian4(255, 255, 0, 1.0), ); }); it("getPropertyInherited returns tile property", function () { const feature = new Cesium3DTileFeature(childContents["ll.b3dm"], 0); expect(feature.getPropertyInherited("color")).toEqual( - new Cartesian4(255, 255, 0, 1.0) + new Cartesian4(255, 255, 0, 1.0), ); expect(feature.getPropertyInherited("population")).toBe(50); }); @@ -314,7 +314,7 @@ describe( it("getPropertyInherited returns default value", function () { const feature = new Cesium3DTileFeature(childContents["ll.b3dm"], 0); expect(feature.getPropertyInherited("defaultColor")).toEqual( - new Cartesian4(255, 255, 255, 255) + new Cartesian4(255, 255, 255, 255), ); }); @@ -337,7 +337,7 @@ describe( it("getPropertyInherited returns tileset property by semantic", function () { const feature = new Cesium3DTileFeature(parentContent, 0); expect(feature.getPropertyInherited("DATE_ISO_8601")).toBe( - "2021-04-07" + "2021-04-07", ); expect(feature.getPropertyInherited("AUTHOR")).toBe("Cesium"); }); @@ -348,8 +348,8 @@ describe( new Cartesian3( -1.3196816996258511, 0.6988767486400521, - 45.78600543644279 - ) + 45.78600543644279, + ), ); expect(feature.getPropertyInherited("date")).toBe("2021-04-07"); expect(feature.getPropertyInherited("author")).toBe("Cesium"); @@ -361,7 +361,7 @@ describe( // content metadata is more specific than tile metadata so this returns // red not cyan expect(feature.getPropertyInherited("highlightColor")).toEqual( - new Cartesian4(255, 0, 0, 1.0) + new Cartesian4(255, 0, 0, 1.0), ); // content metadata is more specific than tileset metadata so this returns @@ -371,7 +371,7 @@ describe( // tile metadata is more specific than tileset metadata so this returns // yellow not magenta expect(feature.getPropertyInherited("color")).toEqual( - new Cartesian4(255, 255, 0, 1.0) + new Cartesian4(255, 255, 0, 1.0), ); // group metadata is more specific than tileset metadata, so this returns @@ -392,13 +392,13 @@ describe( const center = Cartesian3.fromRadians( centerLongitude, - centerLatitude + centerLatitude, ); scene.camera.lookAt(center, new HeadingPitchRange(0.0, -1.57, 15.0)); return Cesium3DTilesTester.loadTileset( scene, - tilesetWithSubtreeMetadataUrl + tilesetWithSubtreeMetadataUrl, ).then(function (result) { tilesetWithSubtree = result; }); @@ -436,7 +436,7 @@ describe( it("getPropertyInherited returns subtree property by semantic at child level", function () { const feature = new Cesium3DTileFeature( subtreeChildContents["content/1/0/0.b3dm"], - 0 + 0, ); expect(feature.getPropertyInherited("AUTHOR")).toEqual("Cesium"); }); @@ -444,7 +444,7 @@ describe( it("getPropertyInherited returns subtree property at root level", function () { const feature = new Cesium3DTileFeature( subtreeChildContents["content/1/0/0.b3dm"], - 0 + 0, ); expect(feature.getPropertyInherited("author")).toEqual("Cesium"); expect(feature.getPropertyInherited("credits")).toEqual([ @@ -463,7 +463,7 @@ describe( it("getPropertyInherited returns tile property that is shared by subtree at child level", function () { const childFeature = new Cesium3DTileFeature( subtreeChildContents["content/1/0/0.b3dm"], - 0 + 0, ); const rootFeature = new Cesium3DTileFeature(subtreeRootContent, 0); @@ -489,12 +489,12 @@ describe( const center = Cartesian3.fromRadians( centerLongitude, - centerLatitude + centerLatitude, ); scene.camera.lookAt(center, new HeadingPitchRange(0.0, -1.57, 15.0)); return Cesium3DTilesTester.loadTileset( scene, - tilesetWithImplicitContentMetadataUrl + tilesetWithImplicitContentMetadataUrl, ).then(function (result) { tilesetWithImplicitContentMetadata = result; }); @@ -518,13 +518,13 @@ describe( const rootFeature = new Cesium3DTileFeature(subtreeRootContent, 0); const childFeature = new Cesium3DTileFeature( subtreeChildContents["content/1/0/0.b3dm"], - 0 + 0, ); expect(rootFeature.getPropertyInherited("_BUILDING_HEIGHT")).toEqual( - 10 + 10, ); expect(childFeature.getPropertyInherited("_BUILDING_HEIGHT")).toEqual( - 20 + 20, ); }); @@ -532,45 +532,45 @@ describe( const rootFeature = new Cesium3DTileFeature(subtreeRootContent, 0); expect(rootFeature.getPropertyInherited("height")).toEqual(10); expect(rootFeature.getPropertyInherited("color")).toEqual( - new Cartesian3(255, 255, 255) + new Cartesian3(255, 255, 255), ); }); it("getPropertyInherited returns content property by semantic for different contents", function () { const childFeature = new Cesium3DTileFeature( subtreeChildContents["content/1/0/0.b3dm"], - 0 + 0, ); const secondChildFeature = new Cesium3DTileFeature( subtreeChildContents["content/1/1/1.b3dm"], - 0 + 0, ); expect(childFeature.getPropertyInherited("_BUILDING_HEIGHT")).toEqual( - 20 + 20, ); expect( - secondChildFeature.getPropertyInherited("_BUILDING_HEIGHT") + secondChildFeature.getPropertyInherited("_BUILDING_HEIGHT"), ).toEqual(40); }); it("getPropertyInherited returns content property for different contents", function () { const childFeature = new Cesium3DTileFeature( subtreeChildContents["content/1/0/0.b3dm"], - 0 + 0, ); const secondChildFeature = new Cesium3DTileFeature( subtreeChildContents["content/1/1/1.b3dm"], - 0 + 0, ); expect(childFeature.getPropertyInherited("height")).toEqual(20); expect(secondChildFeature.getPropertyInherited("height")).toEqual(40); expect(childFeature.getPropertyInherited("color")).toEqual( - new Cartesian3(255, 0, 0) + new Cartesian3(255, 0, 0), ); expect(secondChildFeature.getPropertyInherited("color")).toEqual( - new Cartesian3(0, 0, 255) + new Cartesian3(0, 0, 255), ); }); @@ -582,5 +582,5 @@ describe( }); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/Cesium3DTileFeatureTableSpec.js b/packages/engine/Specs/Scene/Cesium3DTileFeatureTableSpec.js index 20bf100afb6e..cb814fb32fc9 100644 --- a/packages/engine/Specs/Scene/Cesium3DTileFeatureTableSpec.js +++ b/packages/engine/Specs/Scene/Cesium3DTileFeatureTableSpec.js @@ -11,7 +11,7 @@ describe("Scene/Cesium3DTileFeatureTable", function () { const all = featureTable.getGlobalProperty( "TEST", - ComponentDatatype.UNSIGNED_BYTE + ComponentDatatype.UNSIGNED_BYTE, ); expect(all).toEqual([0, 1, 2, 3, 4, 5]); const feature = featureTable.getProperty( @@ -19,13 +19,13 @@ describe("Scene/Cesium3DTileFeatureTable", function () { ComponentDatatype.UNSIGNED_BYTE, 2, 1, - new Array(2) + new Array(2), ); expect(feature).toEqual([2, 3]); const properties = featureTable.getPropertyArray( "TEST", ComponentDatatype.UNSIGNED_BYTE, - 2 + 2, ); expect(properties).toEqual([0, 1, 2, 3, 4, 5]); }); @@ -37,7 +37,7 @@ describe("Scene/Cesium3DTileFeatureTable", function () { byteOffset: 4, }, }, - new Uint8Array([0, 0, 0, 0, 0, 1, 2, 3, 4, 5]) + new Uint8Array([0, 0, 0, 0, 0, 1, 2, 3, 4, 5]), ); featureTable.featuresLength = 3; @@ -46,7 +46,7 @@ describe("Scene/Cesium3DTileFeatureTable", function () { const all = featureTable.getGlobalProperty( "TEST", ComponentDatatype.UNSIGNED_BYTE, - 6 + 6, ); expect(all).toEqual([0, 1, 2, 3, 4, 5]); const feature = featureTable.getProperty( @@ -54,13 +54,13 @@ describe("Scene/Cesium3DTileFeatureTable", function () { ComponentDatatype.UNSIGNED_BYTE, 2, 1, - new Array(2) + new Array(2), ); expect(feature).toEqual([2, 3]); const properties = featureTable.getPropertyArray( "TEST", ComponentDatatype.UNSIGNED_BYTE, - 2 + 2, ); expect(properties).toEqual([0, 1, 2, 3, 4, 5]); }); diff --git a/packages/engine/Specs/Scene/Cesium3DTileSpec.js b/packages/engine/Specs/Scene/Cesium3DTileSpec.js index cb5270986461..48f036cef4d8 100644 --- a/packages/engine/Specs/Scene/Cesium3DTileSpec.js +++ b/packages/engine/Specs/Scene/Cesium3DTileSpec.js @@ -135,12 +135,12 @@ describe( const transformCenter = Cartesian3.fromRadians( longitude, latitude, - height + height, ); const hpr = new HeadingPitchRoll(); const transformMatrix = Transforms.headingPitchRollToFixedFrame( transformCenter, - hpr + hpr, ); return Matrix4.pack(transformMatrix, new Array(16)); } @@ -150,7 +150,7 @@ describe( mockTileset, "/some_url", tileWithBoundingSphere, - undefined + undefined, ); expect(tile.isDestroyed()).toEqual(false); tile.destroy(); @@ -165,7 +165,7 @@ describe( mockTileset, "/some_url", tileWithoutBoundingVolume, - undefined + undefined, ); }).toThrowError(RuntimeError); }); @@ -178,7 +178,7 @@ describe( mockTileset, "/some_url", tileWithoutBoundingVolume, - undefined + undefined, ); }).toThrowError(RuntimeError); }); @@ -191,7 +191,7 @@ describe( mockTileset, "/some_url", header, - undefined + undefined, ); expect(tile.refine).toBe(Cesium3DTileRefine.REPLACE); expect(Cesium3DTile._deprecationWarning).toHaveBeenCalled(); @@ -204,7 +204,7 @@ describe( mockTileset, "/some_url", header, - undefined + undefined, ); expect(tile.content).toBeDefined(); expect(tile.content).toBeInstanceOf(Empty3DTileContent); @@ -221,13 +221,13 @@ describe( mockTileset, "/some_url", tileWithBoundingSphere, - undefined + undefined, ); const child = new Cesium3DTile( mockTileset, "/some_url", geometricErrorMissing, - parent + parent, ); expect(child.geometricError).toBe(parent.geometricError); expect(child.geometricError).toBe(1); @@ -236,7 +236,7 @@ describe( mockTileset, "/some_url", geometricErrorMissing, - undefined + undefined, ); expect(tile.geometricError).toBe(mockTileset._geometricError); expect(tile.geometricError).toBe(2); @@ -250,7 +250,7 @@ describe( mockTileset, "/some_url", tileWithBoundingSphere, - undefined + undefined, ); expect(tile.boundingVolume).toBeDefined(); expect(tile.contentBoundingVolume).toBe(tile.boundingVolume); @@ -261,13 +261,13 @@ describe( mockTileset, "/some_url", tileWithBoundingSphere, - undefined + undefined, ); const radius = tileWithBoundingSphere.boundingVolume.sphere[3]; expect(tile.boundingVolume).toBeDefined(); expect(tile.boundingVolume.boundingVolume.radius).toEqual(radius); expect(tile.boundingVolume.boundingVolume.center).toEqual( - Cartesian3.ZERO + Cartesian3.ZERO, ); }); @@ -276,16 +276,16 @@ describe( mockTileset, "/some_url", tileWithContentBoundingSphere, - undefined + undefined, ); const radius = tileWithContentBoundingSphere.content.boundingVolume.sphere[3]; expect(tile.contentBoundingVolume).toBeDefined(); expect(tile.contentBoundingVolume.boundingVolume.radius).toEqual( - radius + radius, ); expect(tile.contentBoundingVolume.boundingVolume.center).toEqual( - new Cartesian3(0.0, 0.0, 1.0) + new Cartesian3(0.0, 0.0, 1.0), ); }); @@ -298,7 +298,7 @@ describe( mockTileset, "/some_url", tileWithBoundingRegion, - undefined + undefined, ); const tbr = new TileBoundingRegion({ rectangle: rectangle, @@ -316,7 +316,7 @@ describe( mockTileset, "/some_url", tileWithContentBoundingRegion, - undefined + undefined, ); expect(tile.contentBoundingVolume).toBeDefined(); const tbb = new TileBoundingRegion({ @@ -333,7 +333,7 @@ describe( mockTileset, "/some_url", tileWithBoundingBox, - undefined + undefined, ); expect(tile.boundingVolume).toBeDefined(); const center = new Cartesian3(box[0], box[1], box[2]); @@ -345,7 +345,7 @@ describe( it("does not crash for bounding box with 0 volume", function () { // Create a copy of the tile with bounding box. const tileWithBoundingBox0Volume = JSON.parse( - JSON.stringify(tileWithBoundingBox) + JSON.stringify(tileWithBoundingBox), ); // Generate all the combinations of missing axes. const boxes = []; @@ -379,7 +379,7 @@ describe( mockTileset, "/some_url", tileWithBoundingBox0Volume, - undefined + undefined, ); expect(tile.boundingVolume).toBeDefined(); const center = new Cartesian3(box[0], box[1], box[2]); @@ -395,7 +395,7 @@ describe( mockTileset, "/some_url", tileWithContentBoundingBox, - undefined + undefined, ); expect(tile.contentBoundingVolume).toBeDefined(); const center = new Cartesian3(box[0], box[1], box[2]); @@ -411,7 +411,7 @@ describe( mockTileset, "/some_url", header, - undefined + undefined, ); const boundingSphere = tile.boundingVolume.boundingVolume; const contentBoundingSphere = tile.contentBoundingVolume.boundingVolume; @@ -419,17 +419,17 @@ describe( const boundingVolumeCenter = Cartesian3.fromRadians( centerLongitude, centerLatitude, - 1.0 + 1.0, ); expect(boundingSphere.center).toEqualEpsilon( boundingVolumeCenter, - CesiumMath.EPSILON4 + CesiumMath.EPSILON4, ); expect(boundingSphere.radius).toEqual(5.0); // No change expect(contentBoundingSphere.center).toEqualEpsilon( boundingVolumeCenter, - CesiumMath.EPSILON4 + CesiumMath.EPSILON4, ); expect(contentBoundingSphere.radius).toEqual(5.0); // No change }); @@ -441,7 +441,7 @@ describe( mockTileset, "/some_url", header, - undefined + undefined, ); const boundingBox = tile.boundingVolume.boundingVolume; const contentBoundingBox = tile.contentBoundingVolume.boundingVolume; @@ -449,15 +449,15 @@ describe( const boundingVolumeCenter = Cartesian3.fromRadians( centerLongitude, centerLatitude, - 1.0 + 1.0, ); expect(boundingBox.center).toEqualEpsilon( boundingVolumeCenter, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(contentBoundingBox.center).toEqualEpsilon( boundingVolumeCenter, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); }); @@ -468,7 +468,7 @@ describe( mockTileset, "/some_url", header, - undefined + undefined, ); const boundingRegion = tile.boundingVolume; const contentBoundingRegion = tile.contentBoundingVolume; @@ -486,17 +486,17 @@ describe( mockTileset, "/some_url", header, - undefined + undefined, ); const requestVolume = tile._viewerRequestVolume.boundingVolume; const requestVolumeCenter = Cartesian3.fromRadians( centerLongitude, centerLatitude, - 1.0 + 1.0, ); expect(requestVolume.center).toEqualEpsilon( requestVolumeCenter, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); }); @@ -510,18 +510,18 @@ describe( mockTileset, "/some_url", header, - undefined + undefined, ); const boundingSphere = tile.boundingVolume.boundingVolume; // Check the original transform const boundingVolumeCenter = Cartesian3.fromRadians( centerLongitude, - centerLatitude + centerLatitude, ); expect(boundingSphere.center).toEqualEpsilon( boundingVolumeCenter, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); // Change the transform @@ -534,7 +534,7 @@ describe( const newCenter = Cartesian3.fromRadians(newLongitude, newLatitude); expect(boundingSphere.center).toEqualEpsilon( newCenter, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); }); @@ -594,28 +594,20 @@ describe( mockTileset, "/some_url", header, - undefined + undefined, ); const boundingBox = tile.boundingVolume.boundingVolume; const boundingVolumeCenter = Cartesian3.fromRadians(0.0, 0.0, 101.0); expect(boundingBox.center).toEqualEpsilon( boundingVolumeCenter, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); const boundingVolumeHalfAxes = Matrix3.fromArray([ - 0.0, - 1.0, - 0.0, - 0.0, - 0.0, - 1.0, - 2.0, - 0.0, - 0.0, + 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 2.0, 0.0, 0.0, ]); expect(boundingBox.halfAxes).toEqualEpsilon( boundingVolumeHalfAxes, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); scene.verticalExaggeration = 2.0; @@ -625,23 +617,15 @@ describe( const exaggeratedCenter = Cartesian3.fromRadians(0.0, 0.0, 202.0); expect(boundingBox.center).toEqualEpsilon( exaggeratedCenter, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); // Note orientation flip due to re-computing the box after exaggeration const exaggeratedHalfAxes = Matrix3.fromArray([ - 4.0, - 0.0, - 0.0, - 0.0, - 1.0, - 0.0, - 0.0, - 0.0, - 1.0, + 4.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, ]); expect(boundingBox.halfAxes).toEqualEpsilon( exaggeratedHalfAxes, - CesiumMath.EPSILON4 + CesiumMath.EPSILON4, ); }); @@ -650,24 +634,24 @@ describe( mockTileset, "/some_url", tileWithBoundingRegion, - undefined + undefined, ); const tileBoundingRegion = tile.boundingVolume; expect(tileBoundingRegion.minimumHeight).toEqualEpsilon( -34.0, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(tileBoundingRegion.maximumHeight).toEqualEpsilon( -30.0, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); const rectangle = Rectangle.pack( tileBoundingRegion.rectangle, - new Array(4) + new Array(4), ); expect(rectangle).toEqualEpsilon( [-1.2, -1.2, 0.0, 0.0], - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); scene.verticalExaggeration = 2.0; @@ -677,19 +661,19 @@ describe( expect(tileBoundingRegion.minimumHeight).toEqualEpsilon( -34.0, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(tileBoundingRegion.maximumHeight).toEqualEpsilon( -26.0, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); const exaggeratedRectangle = Rectangle.pack( tileBoundingRegion.rectangle, - new Array(4) + new Array(4), ); expect(exaggeratedRectangle).toEqualEpsilon( [-1.2, -1.2, 0.0, 0.0], - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); }); @@ -698,24 +682,24 @@ describe( header.transform = getTileTransform( centerLongitude, centerLatitude, - 100.0 + 100.0, ); const tile = new Cesium3DTile( mockTileset, "/some_url", header, - undefined + undefined, ); const boundingSphere = tile.boundingVolume.boundingVolume; const boundingVolumeCenter = Cartesian3.fromRadians( centerLongitude, centerLatitude, - 100.0 + 100.0, ); expect(boundingSphere.center).toEqualEpsilon( boundingVolumeCenter, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(boundingSphere.radius).toEqualEpsilon(5.0, CesiumMath.EPSILON7); @@ -726,11 +710,11 @@ describe( const exaggeratedCenter = Cartesian3.fromRadians( centerLongitude, centerLatitude, - 200.0 + 200.0, ); expect(boundingSphere.center).toEqualEpsilon( exaggeratedCenter, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(boundingSphere.radius).toEqualEpsilon(10.0, CesiumMath.EPSILON7); }); @@ -752,10 +736,10 @@ describe( mockTileset, "/some_url", tileWithBoundingRegion, - undefined + undefined, ); const passOptions = Cesium3DTilePass.getPassOptions( - Cesium3DTilePass.RENDER + Cesium3DTilePass.RENDER, ); tile.update(mockTileset, scene.frameState, passOptions); expect(tile._debugBoundingVolume).toBeDefined(); @@ -766,10 +750,10 @@ describe( mockTileset, "/some_url", tileWithBoundingBox, - undefined + undefined, ); const passOptions = Cesium3DTilePass.getPassOptions( - Cesium3DTilePass.RENDER + Cesium3DTilePass.RENDER, ); tile.update(mockTileset, scene.frameState, passOptions); expect(tile._debugBoundingVolume).toBeDefined(); @@ -780,10 +764,10 @@ describe( mockTileset, "/some_url", tileWithBoundingSphere, - undefined + undefined, ); const passOptions = Cesium3DTilePass.getPassOptions( - Cesium3DTilePass.RENDER + Cesium3DTilePass.RENDER, ); tile.update(mockTileset, scene.frameState, passOptions); expect(tile._debugBoundingVolume).toBeDefined(); @@ -794,10 +778,10 @@ describe( mockTileset, "/some_url", tileWithViewerRequestVolume, - undefined + undefined, ); const passOptions = Cesium3DTilePass.getPassOptions( - Cesium3DTilePass.RENDER + Cesium3DTilePass.RENDER, ); tile.update(mockTileset, scene.frameState, passOptions); expect(tile._debugViewerRequestVolume).toBeDefined(); @@ -809,7 +793,7 @@ describe( mockTileset, "/some_url", tileWithBoundingSphere, - undefined + undefined, ); tile1._priorityHolder = tile1; tile1._foveatedFactor = 0.0; @@ -821,7 +805,7 @@ describe( mockTileset, "/some_url", tileWithBoundingSphere, - undefined + undefined, ); tile2._priorityHolder = tile1; tile2._foveatedFactor = 1.0; // foveatedFactor (when considered for priority in certain modes) is actually 0 since its linked up to tile1 @@ -850,15 +834,15 @@ describe( CesiumMath.equalsEpsilon( tile1._priority, tile1ExpectedPriority, - CesiumMath.EPSILON2 - ) + CesiumMath.EPSILON2, + ), ).toBe(true); expect( CesiumMath.equalsEpsilon( tile2._priority, tile2ExpectedPriority, - CesiumMath.EPSILON2 - ) + CesiumMath.EPSILON2, + ), ).toBe(true); // Penalty for not being a progressive resolution @@ -880,7 +864,7 @@ describe( const header = clone(tileWithContentBoundingSphere, true); header.transform = Matrix4.pack( Matrix4.fromUniformScale(2.0), - new Array(16) + new Array(16), ); const mockTilesetScaled = clone(mockTileset, true); @@ -889,7 +873,7 @@ describe( mockTilesetScaled, "/some_url", header, - undefined + undefined, ); expect(tile._geometricError).toBe(1); @@ -898,5 +882,5 @@ describe( expect(mockTilesetScaled._scaledGeometricError).toBe(4); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/Cesium3DTileStyleSpec.js b/packages/engine/Specs/Scene/Cesium3DTileStyleSpec.js index 957d4d261457..d762d34bfbad 100644 --- a/packages/engine/Specs/Scene/Cesium3DTileStyleSpec.js +++ b/packages/engine/Specs/Scene/Cesium3DTileStyleSpec.js @@ -97,7 +97,7 @@ describe("Scene/Cesium3DTileStyle", function () { expect(style.pointOutlineWidth).toEqual(new Expression("5.0")); expect(style.labelColor).toEqual(new Expression("color('yellow')")); expect(style.labelOutlineColor).toEqual( - new Expression("color('orange')") + new Expression("color('orange')"), ); expect(style.labelOutlineWidth).toEqual(new Expression("6.0")); expect(style.font).toEqual(new Expression("'24px Helvetica'")); @@ -107,13 +107,13 @@ describe("Scene/Cesium3DTileStyle", function () { expect(style.backgroundPadding).toEqual(new Expression("vec2(1.0, 2.0)")); expect(style.backgroundEnabled).toEqual(new Expression("true")); expect(style.scaleByDistance).toEqual( - new Expression("vec4(1.0, 2.0, 3.0, 4.0)") + new Expression("vec4(1.0, 2.0, 3.0, 4.0)"), ); expect(style.translucencyByDistance).toEqual( - new Expression("vec4(5.0, 6.0, 7.0, 8.0)") + new Expression("vec4(5.0, 6.0, 7.0, 8.0)"), ); expect(style.distanceDisplayCondition).toEqual( - new Expression("vec2(3.0, 4.0)") + new Expression("vec2(3.0, 4.0)"), ); expect(style.heightOffset).toEqual(new Expression("10.0")); expect(style.anchorLineEnabled).toEqual(new Expression("true")); @@ -131,7 +131,7 @@ describe("Scene/Cesium3DTileStyle", function () { return Cesium3DTileStyle.fromUrl( new Resource({ url: styleUrl, - }) + }), ).then(function (style) { expect(style.style).toEqual({ color: "color('red')", @@ -168,7 +168,7 @@ describe("Scene/Cesium3DTileStyle", function () { expect(style.pointOutlineWidth).toEqual(new Expression("5.0")); expect(style.labelColor).toEqual(new Expression("color('yellow')")); expect(style.labelOutlineColor).toEqual( - new Expression("color('orange')") + new Expression("color('orange')"), ); expect(style.labelOutlineWidth).toEqual(new Expression("6.0")); expect(style.font).toEqual(new Expression("'24px Helvetica'")); @@ -178,13 +178,13 @@ describe("Scene/Cesium3DTileStyle", function () { expect(style.backgroundPadding).toEqual(new Expression("vec2(1.0, 2.0)")); expect(style.backgroundEnabled).toEqual(new Expression("true")); expect(style.scaleByDistance).toEqual( - new Expression("vec4(1.0, 2.0, 3.0, 4.0)") + new Expression("vec4(1.0, 2.0, 3.0, 4.0)"), ); expect(style.translucencyByDistance).toEqual( - new Expression("vec4(5.0, 6.0, 7.0, 8.0)") + new Expression("vec4(5.0, 6.0, 7.0, 8.0)"), ); expect(style.distanceDisplayCondition).toEqual( - new Expression("vec2(3.0, 4.0)") + new Expression("vec2(3.0, 4.0)"), ); expect(style.heightOffset).toEqual(new Expression("10.0")); expect(style.anchorLineEnabled).toEqual(new Expression("true")); @@ -279,7 +279,7 @@ describe("Scene/Cesium3DTileStyle", function () { const style = new Cesium3DTileStyle({ defines: defines }); style.show = "${height} * ${showFactor} >= 1000"; expect(style.show).toEqual( - new Expression("${height} * ${showFactor} >= 1000", defines) + new Expression("${height} * ${showFactor} >= 1000", defines), ); style.show = false; @@ -349,8 +349,8 @@ describe("Scene/Cesium3DTileStyle", function () { expect(style.color).toEqual( new Expression( - '(${height} * 10 >= 1000) ? rgba(0.0, 0.0, 1.0, 0.5) : color("blue")' - ) + '(${height} * 10 >= 1000) ? rgba(0.0, 0.0, 1.0, 0.5) : color("blue")', + ), ); }); @@ -417,7 +417,7 @@ describe("Scene/Cesium3DTileStyle", function () { const style = new Cesium3DTileStyle({ defines: defines }); style.color = 'color("${targetColor}")'; expect(style.color).toEqual( - new Expression('color("${targetColor}")', defines) + new Expression('color("${targetColor}")', defines), ); const jsonExp = { @@ -545,7 +545,7 @@ describe("Scene/Cesium3DTileStyle", function () { style.pointSize = "${targetPointSize} + 1.0"; expect(style.pointSize).toEqual( - new Expression("${targetPointSize} + 1.0", defines) + new Expression("${targetPointSize} + 1.0", defines), ); const jsonExp = { @@ -599,7 +599,7 @@ describe("Scene/Cesium3DTileStyle", function () { pointOutlineColor: "rgba(30, 30, 30, 0.5)", }); expect(style.pointOutlineColor).toEqual( - new Expression("rgba(30, 30, 30, 0.5)") + new Expression("rgba(30, 30, 30, 0.5)"), ); style = new Cesium3DTileStyle({ @@ -608,8 +608,8 @@ describe("Scene/Cesium3DTileStyle", function () { }); expect(style.pointOutlineColor).toEqual( new Expression( - '(${height} * 10 >= 1000) ? rgba(0.0, 0.0, 1.0, 0.5) : color("blue")' - ) + '(${height} * 10 >= 1000) ? rgba(0.0, 0.0, 1.0, 0.5) : color("blue")', + ), ); }); @@ -684,7 +684,7 @@ describe("Scene/Cesium3DTileStyle", function () { const style = new Cesium3DTileStyle({ defines: defines }); style.pointOutlineColor = 'color("${targetColor}")'; expect(style.pointOutlineColor).toEqual( - new Expression('color("${targetColor}")', defines) + new Expression('color("${targetColor}")', defines), ); const jsonExp = { @@ -696,7 +696,7 @@ describe("Scene/Cesium3DTileStyle", function () { style.pointOutlineColor = jsonExp; expect(style.pointOutlineColor).toEqual( - new ConditionsExpression(jsonExp, defines) + new ConditionsExpression(jsonExp, defines), ); }); @@ -817,7 +817,7 @@ describe("Scene/Cesium3DTileStyle", function () { style.pointOutlineWidth = "${targetPointSize} + 1.0"; expect(style.pointOutlineWidth).toEqual( - new Expression("${targetPointSize} + 1.0", defines) + new Expression("${targetPointSize} + 1.0", defines), ); const jsonExp = { @@ -829,7 +829,7 @@ describe("Scene/Cesium3DTileStyle", function () { style.pointOutlineWidth = jsonExp; expect(style.pointOutlineWidth).toEqual( - new ConditionsExpression(jsonExp, defines) + new ConditionsExpression(jsonExp, defines), ); }); @@ -880,8 +880,8 @@ describe("Scene/Cesium3DTileStyle", function () { }); expect(style.labelColor).toEqual( new Expression( - '(${height} * 10 >= 1000) ? rgba(0.0, 0.0, 1.0, 0.5) : color("blue")' - ) + '(${height} * 10 >= 1000) ? rgba(0.0, 0.0, 1.0, 0.5) : color("blue")', + ), ); }); @@ -955,7 +955,7 @@ describe("Scene/Cesium3DTileStyle", function () { const style = new Cesium3DTileStyle({ defines: defines }); style.labelColor = 'color("${targetColor}")'; expect(style.labelColor).toEqual( - new Expression('color("${targetColor}")', defines) + new Expression('color("${targetColor}")', defines), ); const jsonExp = { @@ -967,7 +967,7 @@ describe("Scene/Cesium3DTileStyle", function () { style.labelColor = jsonExp; expect(style.labelColor).toEqual( - new ConditionsExpression(jsonExp, defines) + new ConditionsExpression(jsonExp, defines), ); }); @@ -1008,7 +1008,7 @@ describe("Scene/Cesium3DTileStyle", function () { labelOutlineColor: "rgba(30, 30, 30, 0.5)", }); expect(style.labelOutlineColor).toEqual( - new Expression("rgba(30, 30, 30, 0.5)") + new Expression("rgba(30, 30, 30, 0.5)"), ); style = new Cesium3DTileStyle({ @@ -1017,8 +1017,8 @@ describe("Scene/Cesium3DTileStyle", function () { }); expect(style.labelOutlineColor).toEqual( new Expression( - '(${height} * 10 >= 1000) ? rgba(0.0, 0.0, 1.0, 0.5) : color("blue")' - ) + '(${height} * 10 >= 1000) ? rgba(0.0, 0.0, 1.0, 0.5) : color("blue")', + ), ); }); @@ -1093,7 +1093,7 @@ describe("Scene/Cesium3DTileStyle", function () { const style = new Cesium3DTileStyle({ defines: defines }); style.labelOutlineColor = 'color("${targetColor}")'; expect(style.labelOutlineColor).toEqual( - new Expression('color("${targetColor}")', defines) + new Expression('color("${targetColor}")', defines), ); const jsonExp = { @@ -1105,7 +1105,7 @@ describe("Scene/Cesium3DTileStyle", function () { style.labelOutlineColor = jsonExp; expect(style.labelOutlineColor).toEqual( - new ConditionsExpression(jsonExp, defines) + new ConditionsExpression(jsonExp, defines), ); }); @@ -1225,7 +1225,7 @@ describe("Scene/Cesium3DTileStyle", function () { style.labelOutlineWidth = "${targetLabelSize} + 1.0"; expect(style.labelOutlineWidth).toEqual( - new Expression("${targetLabelSize} + 1.0", defines) + new Expression("${targetLabelSize} + 1.0", defines), ); const jsonExp = { @@ -1237,7 +1237,7 @@ describe("Scene/Cesium3DTileStyle", function () { style.labelOutlineWidth = jsonExp; expect(style.labelOutlineWidth).toEqual( - new ConditionsExpression(jsonExp, defines) + new ConditionsExpression(jsonExp, defines), ); }); @@ -1484,7 +1484,7 @@ describe("Scene/Cesium3DTileStyle", function () { style.labelStyle = "${targetLabelStyle}"; expect(style.labelStyle).toEqual( - new Expression("${targetLabelStyle}", defines) + new Expression("${targetLabelStyle}", defines), ); const jsonExp = { @@ -1496,7 +1496,7 @@ describe("Scene/Cesium3DTileStyle", function () { style.labelStyle = jsonExp; expect(style.labelStyle).toEqual( - new ConditionsExpression(jsonExp, defines) + new ConditionsExpression(jsonExp, defines), ); }); @@ -1673,7 +1673,7 @@ describe("Scene/Cesium3DTileStyle", function () { backgroundColor: "rgba(30, 30, 30, 0.5)", }); expect(style.backgroundColor).toEqual( - new Expression("rgba(30, 30, 30, 0.5)") + new Expression("rgba(30, 30, 30, 0.5)"), ); style = new Cesium3DTileStyle({ @@ -1682,8 +1682,8 @@ describe("Scene/Cesium3DTileStyle", function () { }); expect(style.backgroundColor).toEqual( new Expression( - '(${height} * 10 >= 1000) ? rgba(0.0, 0.0, 1.0, 0.5) : color("blue")' - ) + '(${height} * 10 >= 1000) ? rgba(0.0, 0.0, 1.0, 0.5) : color("blue")', + ), ); }); @@ -1758,7 +1758,7 @@ describe("Scene/Cesium3DTileStyle", function () { const style = new Cesium3DTileStyle({ defines: defines }); style.backgroundColor = 'color("${targetColor}")'; expect(style.backgroundColor).toEqual( - new Expression('color("${targetColor}")', defines) + new Expression('color("${targetColor}")', defines), ); const jsonExp = { @@ -1770,7 +1770,7 @@ describe("Scene/Cesium3DTileStyle", function () { style.backgroundColor = jsonExp; expect(style.backgroundColor).toEqual( - new ConditionsExpression(jsonExp, defines) + new ConditionsExpression(jsonExp, defines), ); }); @@ -1818,8 +1818,8 @@ describe("Scene/Cesium3DTileStyle", function () { }); expect(style.backgroundPadding).toEqual( new Expression( - "(${height} * 10 >= 1000) ? vec2(1.0, 2.0) : vec2(3.0, 4.0)" - ) + "(${height} * 10 >= 1000) ? vec2(1.0, 2.0) : vec2(3.0, 4.0)", + ), ); }); @@ -1891,7 +1891,7 @@ describe("Scene/Cesium3DTileStyle", function () { const style = new Cesium3DTileStyle({ defines: defines }); style.backgroundPadding = 'vec2("${targetPadding}")'; expect(style.backgroundPadding).toEqual( - new Expression('vec2("${targetPadding}")', defines) + new Expression('vec2("${targetPadding}")', defines), ); const jsonExp = { @@ -1903,7 +1903,7 @@ describe("Scene/Cesium3DTileStyle", function () { style.backgroundPadding = jsonExp; expect(style.backgroundPadding).toEqual( - new ConditionsExpression(jsonExp, defines) + new ConditionsExpression(jsonExp, defines), ); }); @@ -1949,7 +1949,7 @@ describe("Scene/Cesium3DTileStyle", function () { backgroundEnabled: "${height} * 10 >= 1000", }); expect(style.backgroundEnabled).toEqual( - new Expression("${height} * 10 >= 1000") + new Expression("${height} * 10 >= 1000"), ); style = new Cesium3DTileStyle({ @@ -2025,7 +2025,7 @@ describe("Scene/Cesium3DTileStyle", function () { const style = new Cesium3DTileStyle({ defines: defines }); style.backgroundEnabled = "${height} * ${backgroundFactor} >= 1000"; expect(style.backgroundEnabled).toEqual( - new Expression("${height} * ${backgroundFactor} >= 1000", defines) + new Expression("${height} * ${backgroundFactor} >= 1000", defines), ); style.backgroundEnabled = false; @@ -2040,7 +2040,7 @@ describe("Scene/Cesium3DTileStyle", function () { style.backgroundEnabled = jsonExp; expect(style.backgroundEnabled).toEqual( - new ConditionsExpression(jsonExp, defines) + new ConditionsExpression(jsonExp, defines), ); style.backgroundEnabled = undefined; @@ -2054,7 +2054,7 @@ describe("Scene/Cesium3DTileStyle", function () { const style = new Cesium3DTileStyle({ defines: defines }); style.backgroundEnabled = "${height} * ${backgroundFactor} >= 1000"; expect(style.style.backgroundEnabled).toEqual( - "${height} * ${backgroundFactor} >= 1000" + "${height} * ${backgroundFactor} >= 1000", ); style.backgroundEnabled = false; @@ -2088,7 +2088,7 @@ describe("Scene/Cesium3DTileStyle", function () { }); expect(style.scaleByDistance).toEqual( - new Expression("vec4(1.0, 2.0, 3.0, 4.0)") + new Expression("vec4(1.0, 2.0, 3.0, 4.0)"), ); style = new Cesium3DTileStyle({ @@ -2096,7 +2096,7 @@ describe("Scene/Cesium3DTileStyle", function () { }); expect(style.scaleByDistance).toEqual( - new Expression("vec4(5.0, 6.0, 7.0, 8.0)") + new Expression("vec4(5.0, 6.0, 7.0, 8.0)"), ); style = new Cesium3DTileStyle({ @@ -2105,8 +2105,8 @@ describe("Scene/Cesium3DTileStyle", function () { }); expect(style.scaleByDistance).toEqual( new Expression( - "(${height} * 10 >= 1000) ? vec4(1.0, 2.0, 3.0, 4.0) : vec4(5.0, 6.0, 7.0, 8.0)" - ) + "(${height} * 10 >= 1000) ? vec4(1.0, 2.0, 3.0, 4.0) : vec4(5.0, 6.0, 7.0, 8.0)", + ), ); }); @@ -2179,7 +2179,7 @@ describe("Scene/Cesium3DTileStyle", function () { const style = new Cesium3DTileStyle({ defines: defines }); style.scaleByDistance = 'vec4("${targetScale}")'; expect(style.scaleByDistance).toEqual( - new Expression('vec4("${targetScale}")', defines) + new Expression('vec4("${targetScale}")', defines), ); const jsonExp = { @@ -2191,7 +2191,7 @@ describe("Scene/Cesium3DTileStyle", function () { style.scaleByDistance = jsonExp; expect(style.scaleByDistance).toEqual( - new ConditionsExpression(jsonExp, defines) + new ConditionsExpression(jsonExp, defines), ); }); @@ -2227,14 +2227,14 @@ describe("Scene/Cesium3DTileStyle", function () { distanceDisplayCondition: "vec4(1.0, 2.0, 3.0, 4.0)", }); expect(style.distanceDisplayCondition).toEqual( - new Expression("vec4(1.0, 2.0, 3.0, 4.0)") + new Expression("vec4(1.0, 2.0, 3.0, 4.0)"), ); style = new Cesium3DTileStyle({ distanceDisplayCondition: "vec4(5.0, 6.0, 7.0, 8.0)", }); expect(style.distanceDisplayCondition).toEqual( - new Expression("vec4(5.0, 6.0, 7.0, 8.0)") + new Expression("vec4(5.0, 6.0, 7.0, 8.0)"), ); style = new Cesium3DTileStyle({ @@ -2243,8 +2243,8 @@ describe("Scene/Cesium3DTileStyle", function () { }); expect(style.distanceDisplayCondition).toEqual( new Expression( - "(${height} * 10 >= 1000) ? vec4(1.0, 2.0, 3.0, 4.0) : vec4(5.0, 6.0, 7.0, 8.0)" - ) + "(${height} * 10 >= 1000) ? vec4(1.0, 2.0, 3.0, 4.0) : vec4(5.0, 6.0, 7.0, 8.0)", + ), ); }); @@ -2260,7 +2260,7 @@ describe("Scene/Cesium3DTileStyle", function () { distanceDisplayCondition: jsonExp, }); expect(style.distanceDisplayCondition).toEqual( - new ConditionsExpression(jsonExp) + new ConditionsExpression(jsonExp), ); }); @@ -2288,7 +2288,7 @@ describe("Scene/Cesium3DTileStyle", function () { const style = new Cesium3DTileStyle(); style.distanceDisplayCondition = new Expression("vec4(5.0, 6.0, 7.0, 8.0)"); expect(style.style.distanceDisplayCondition).toEqual( - "vec4(5.0, 6.0, 7.0, 8.0)" + "vec4(5.0, 6.0, 7.0, 8.0)", ); const jsonExp = { @@ -2320,7 +2320,7 @@ describe("Scene/Cesium3DTileStyle", function () { const style = new Cesium3DTileStyle({ defines: defines }); style.distanceDisplayCondition = 'vec4("${targetTranslucency}")'; expect(style.distanceDisplayCondition).toEqual( - new Expression('vec4("${targetTranslucency}")', defines) + new Expression('vec4("${targetTranslucency}")', defines), ); const jsonExp = { @@ -2332,7 +2332,7 @@ describe("Scene/Cesium3DTileStyle", function () { style.distanceDisplayCondition = jsonExp; expect(style.distanceDisplayCondition).toEqual( - new ConditionsExpression(jsonExp, defines) + new ConditionsExpression(jsonExp, defines), ); }); @@ -2343,7 +2343,7 @@ describe("Scene/Cesium3DTileStyle", function () { const style = new Cesium3DTileStyle({ defines: defines }); style.distanceDisplayCondition = 'vec4("${targetTranslucency}")'; expect(style.style.distanceDisplayCondition).toEqual( - 'vec4("${targetTranslucency}")' + 'vec4("${targetTranslucency}")', ); const jsonExp = { @@ -2456,7 +2456,7 @@ describe("Scene/Cesium3DTileStyle", function () { style.heightOffset = "${targetHeight} + 1.0"; expect(style.heightOffset).toEqual( - new Expression("${targetHeight} + 1.0", defines) + new Expression("${targetHeight} + 1.0", defines), ); const jsonExp = { @@ -2468,7 +2468,7 @@ describe("Scene/Cesium3DTileStyle", function () { style.heightOffset = jsonExp; expect(style.heightOffset).toEqual( - new ConditionsExpression(jsonExp, defines) + new ConditionsExpression(jsonExp, defines), ); }); @@ -2514,7 +2514,7 @@ describe("Scene/Cesium3DTileStyle", function () { anchorLineEnabled: "${height} * 10 >= 1000", }); expect(style.anchorLineEnabled).toEqual( - new Expression("${height} * 10 >= 1000") + new Expression("${height} * 10 >= 1000"), ); style = new Cesium3DTileStyle({ @@ -2590,7 +2590,7 @@ describe("Scene/Cesium3DTileStyle", function () { const style = new Cesium3DTileStyle({ defines: defines }); style.anchorLineEnabled = "${height} * ${anchorFactor} >= 1000"; expect(style.anchorLineEnabled).toEqual( - new Expression("${height} * ${anchorFactor} >= 1000", defines) + new Expression("${height} * ${anchorFactor} >= 1000", defines), ); style.anchorLineEnabled = false; @@ -2605,7 +2605,7 @@ describe("Scene/Cesium3DTileStyle", function () { style.anchorLineEnabled = jsonExp; expect(style.anchorLineEnabled).toEqual( - new ConditionsExpression(jsonExp, defines) + new ConditionsExpression(jsonExp, defines), ); style.anchorLineEnabled = undefined; @@ -2619,7 +2619,7 @@ describe("Scene/Cesium3DTileStyle", function () { const style = new Cesium3DTileStyle({ defines: defines }); style.anchorLineEnabled = "${height} * ${anchorFactor} >= 1000"; expect(style.style.anchorLineEnabled).toEqual( - "${height} * ${anchorFactor} >= 1000" + "${height} * ${anchorFactor} >= 1000", ); style.anchorLineEnabled = false; @@ -2657,7 +2657,7 @@ describe("Scene/Cesium3DTileStyle", function () { anchorLineColor: "rgba(30, 30, 30, 0.5)", }); expect(style.anchorLineColor).toEqual( - new Expression("rgba(30, 30, 30, 0.5)") + new Expression("rgba(30, 30, 30, 0.5)"), ); style = new Cesium3DTileStyle({ @@ -2666,8 +2666,8 @@ describe("Scene/Cesium3DTileStyle", function () { }); expect(style.anchorLineColor).toEqual( new Expression( - '(${height} * 10 >= 1000) ? rgba(0.0, 0.0, 1.0, 0.5) : color("blue")' - ) + '(${height} * 10 >= 1000) ? rgba(0.0, 0.0, 1.0, 0.5) : color("blue")', + ), ); }); @@ -2742,7 +2742,7 @@ describe("Scene/Cesium3DTileStyle", function () { const style = new Cesium3DTileStyle({ defines: defines }); style.anchorLineColor = 'color("${targetColor}")'; expect(style.anchorLineColor).toEqual( - new Expression('color("${targetColor}")', defines) + new Expression('color("${targetColor}")', defines), ); const jsonExp = { @@ -2754,7 +2754,7 @@ describe("Scene/Cesium3DTileStyle", function () { style.anchorLineColor = jsonExp; expect(style.anchorLineColor).toEqual( - new ConditionsExpression(jsonExp, defines) + new ConditionsExpression(jsonExp, defines), ); }); @@ -2928,7 +2928,7 @@ describe("Scene/Cesium3DTileStyle", function () { disableDepthTestDistance: "${height} / 10", }); expect(style.disableDepthTestDistance).toEqual( - new Expression("${height} / 10") + new Expression("${height} / 10"), ); style = new Cesium3DTileStyle({ @@ -2949,7 +2949,7 @@ describe("Scene/Cesium3DTileStyle", function () { disableDepthTestDistance: jsonExp, }); expect(style.disableDepthTestDistance).toEqual( - new ConditionsExpression(jsonExp) + new ConditionsExpression(jsonExp), ); }); @@ -3013,7 +3013,7 @@ describe("Scene/Cesium3DTileStyle", function () { style.disableDepthTestDistance = "${targetDistance} + 1.0"; expect(style.disableDepthTestDistance).toEqual( - new Expression("${targetDistance} + 1.0", defines) + new Expression("${targetDistance} + 1.0", defines), ); const jsonExp = { @@ -3025,7 +3025,7 @@ describe("Scene/Cesium3DTileStyle", function () { style.disableDepthTestDistance = jsonExp; expect(style.disableDepthTestDistance).toEqual( - new ConditionsExpression(jsonExp, defines) + new ConditionsExpression(jsonExp, defines), ); }); @@ -3118,7 +3118,7 @@ describe("Scene/Cesium3DTileStyle", function () { style.horizontalOrigin = "${targetOrigin}"; expect(style.horizontalOrigin).toEqual( - new Expression("${targetOrigin}", defines) + new Expression("${targetOrigin}", defines), ); const jsonExp = { @@ -3130,7 +3130,7 @@ describe("Scene/Cesium3DTileStyle", function () { style.horizontalOrigin = jsonExp; expect(style.horizontalOrigin).toEqual( - new ConditionsExpression(jsonExp, defines) + new ConditionsExpression(jsonExp, defines), ); }); @@ -3244,7 +3244,7 @@ describe("Scene/Cesium3DTileStyle", function () { style.verticalOrigin = "${targetOrigin}"; expect(style.verticalOrigin).toEqual( - new Expression("${targetOrigin}", defines) + new Expression("${targetOrigin}", defines), ); const jsonExp = { @@ -3256,7 +3256,7 @@ describe("Scene/Cesium3DTileStyle", function () { style.verticalOrigin = jsonExp; expect(style.verticalOrigin).toEqual( - new ConditionsExpression(jsonExp, defines) + new ConditionsExpression(jsonExp, defines), ); }); @@ -3308,7 +3308,7 @@ describe("Scene/Cesium3DTileStyle", function () { labelHorizontalOrigin: jsonExp, }); expect(style.labelHorizontalOrigin).toEqual( - new ConditionsExpression(jsonExp) + new ConditionsExpression(jsonExp), ); }); @@ -3372,7 +3372,7 @@ describe("Scene/Cesium3DTileStyle", function () { style.labelHorizontalOrigin = "${targetOrigin}"; expect(style.labelHorizontalOrigin).toEqual( - new Expression("${targetOrigin}", defines) + new Expression("${targetOrigin}", defines), ); const jsonExp = { @@ -3384,7 +3384,7 @@ describe("Scene/Cesium3DTileStyle", function () { style.labelHorizontalOrigin = jsonExp; expect(style.labelHorizontalOrigin).toEqual( - new ConditionsExpression(jsonExp, defines) + new ConditionsExpression(jsonExp, defines), ); }); @@ -3436,7 +3436,7 @@ describe("Scene/Cesium3DTileStyle", function () { labelVerticalOrigin: jsonExp, }); expect(style.labelVerticalOrigin).toEqual( - new ConditionsExpression(jsonExp) + new ConditionsExpression(jsonExp), ); }); @@ -3501,7 +3501,7 @@ describe("Scene/Cesium3DTileStyle", function () { style.labelVerticalOrigin = "${targetOrigin}"; expect(style.labelVerticalOrigin).toEqual( - new Expression("${targetOrigin}", defines) + new Expression("${targetOrigin}", defines), ); const jsonExp = { @@ -3513,7 +3513,7 @@ describe("Scene/Cesium3DTileStyle", function () { style.labelVerticalOrigin = jsonExp; expect(style.labelVerticalOrigin).toEqual( - new ConditionsExpression(jsonExp, defines) + new ConditionsExpression(jsonExp, defines), ); }); @@ -3554,7 +3554,7 @@ describe("Scene/Cesium3DTileStyle", function () { }, }); expect(style.meta.featureColor.evaluateColor(feature1)).toEqual( - Color.fromBytes(38, 255, 82) + Color.fromBytes(38, 255, 82), ); expect(style.meta.volume.evaluate(feature1)).toEqual(20 * 20 * 100); }); @@ -3631,10 +3631,10 @@ describe("Scene/Cesium3DTileStyle", function () { color: "rgba(${red}, ${green}, ${blue}, (${volume} > 100 ? 0.5 : 1.0))", }); expect(style.color.evaluateColor(feature1)).toEqual( - new Color(38 / 255, 255 / 255, 82 / 255, 0.5) + new Color(38 / 255, 255 / 255, 82 / 255, 0.5), ); expect(style.color.evaluateColor(feature2)).toEqual( - new Color(255 / 255, 30 / 255, 30 / 255, 1.0) + new Color(255 / 255, 30 / 255, 30 / 255, 1.0), ); }); @@ -3734,10 +3734,10 @@ describe("Scene/Cesium3DTileStyle", function () { expect(style.pointSize.evaluate(feature1)).toEqual(114); expect(style.pointSize.evaluate(feature2)).toEqual(44); expect(style.meta.description.evaluate(feature1)).toEqual( - "Half height is 50" + "Half height is 50", ); expect(style.meta.description.evaluate(feature2)).toEqual( - "Half height is 19" + "Half height is 19", ); }); @@ -3750,7 +3750,7 @@ describe("Scene/Cesium3DTileStyle", function () { const pointSizeFunction = style.getPointSizeShaderFunction( "getPointSize", {}, - {} + {}, ); expect(colorFunction).toBeUndefined(); expect(showFunction).toBeUndefined(); diff --git a/packages/engine/Specs/Scene/Cesium3DTilesVoxelProviderSpec.js b/packages/engine/Specs/Scene/Cesium3DTilesVoxelProviderSpec.js index 214de3d8d101..49f5ff44fdbc 100644 --- a/packages/engine/Specs/Scene/Cesium3DTilesVoxelProviderSpec.js +++ b/packages/engine/Specs/Scene/Cesium3DTilesVoxelProviderSpec.js @@ -28,7 +28,7 @@ describe("Scene/Cesium3DTilesVoxelProvider", function () { expect(provider.globalTransform).toEqual(Matrix4.IDENTITY); expect(provider.shapeTransform).toEqualEpsilon( Matrix4.fromScale(Ellipsoid.WGS84.radii), - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); expect(provider.shape).toEqual(VoxelShapeType.ELLIPSOID); expect(provider.minBounds).toEqual(new Cartesian3(0.0, 0.0, -1.0)); diff --git a/packages/engine/Specs/Scene/Cesium3DTilesetBaseTraversalSpec.js b/packages/engine/Specs/Scene/Cesium3DTilesetBaseTraversalSpec.js index 3c4782ee83c0..ceb616fb9c1d 100644 --- a/packages/engine/Specs/Scene/Cesium3DTilesetBaseTraversalSpec.js +++ b/packages/engine/Specs/Scene/Cesium3DTilesetBaseTraversalSpec.js @@ -6,7 +6,7 @@ import { describe("Scene/Cesium3DTilesetBaseTraversal", function () { it("conforms to Cesium3DTilesetTraversal interface", function () { expect(Cesium3DTilesetBaseTraversal).toConformToInterface( - Cesium3DTilesetTraversal + Cesium3DTilesetTraversal, ); }); }); diff --git a/packages/engine/Specs/Scene/Cesium3DTilesetHeatmapSpec.js b/packages/engine/Specs/Scene/Cesium3DTilesetHeatmapSpec.js index eb34b52e2cde..57815219fe30 100644 --- a/packages/engine/Specs/Scene/Cesium3DTilesetHeatmapSpec.js +++ b/packages/engine/Specs/Scene/Cesium3DTilesetHeatmapSpec.js @@ -40,7 +40,7 @@ describe("Scene/Cesium3DTilesetHeatmap", function () { const diff = new Color( Math.abs(expectedColor.red - tileColor.red), Math.abs(expectedColor.green - tileColor.green), - Math.abs(expectedColor.blue - tileColor.blue) + Math.abs(expectedColor.blue - tileColor.blue), ); const threshold = 0.11; @@ -71,13 +71,13 @@ describe("Scene/Cesium3DTilesetHeatmap", function () { JulianDate.addSeconds( referenceMinimumJulianDate, 10, - referenceMaximumJulianDate + referenceMaximumJulianDate, ); heatmap.setReferenceMinimumMaximum( referenceMinimumJulianDate, referenceMaximumJulianDate, - tilePropertyName + tilePropertyName, ); // User wants to colorize to a fixed reference. const referenceMinimum = heatmap._referenceMinimum[tilePropertyName]; const referenceMaximum = heatmap._referenceMaximum[tilePropertyName]; @@ -99,7 +99,7 @@ describe("Scene/Cesium3DTilesetHeatmap", function () { mockTileset, "/some_url", tileWithBoundingSphere, - undefined + undefined, ); tile._contentState = Cesium3DTileContentState.READY; tile.hasEmptyContent = false; diff --git a/packages/engine/Specs/Scene/Cesium3DTilesetMostDetailedTraversalSpec.js b/packages/engine/Specs/Scene/Cesium3DTilesetMostDetailedTraversalSpec.js index 364c9369df1a..bf41868f39dd 100644 --- a/packages/engine/Specs/Scene/Cesium3DTilesetMostDetailedTraversalSpec.js +++ b/packages/engine/Specs/Scene/Cesium3DTilesetMostDetailedTraversalSpec.js @@ -6,7 +6,7 @@ import { describe("Scene/Cesium3DTilesetMostDetailedTraversal", function () { it("conforms to Cesium3DTilesetTraversal interface", function () { expect(Cesium3DTilesetMostDetailedTraversal).toConformToInterface( - Cesium3DTilesetTraversal + Cesium3DTilesetTraversal, ); }); }); diff --git a/packages/engine/Specs/Scene/Cesium3DTilesetSkipTraversalSpec.js b/packages/engine/Specs/Scene/Cesium3DTilesetSkipTraversalSpec.js index bb1418cebfcf..414a52880562 100644 --- a/packages/engine/Specs/Scene/Cesium3DTilesetSkipTraversalSpec.js +++ b/packages/engine/Specs/Scene/Cesium3DTilesetSkipTraversalSpec.js @@ -6,7 +6,7 @@ import { describe("Scene/Cesium3DTilesetSkipTraversal", function () { it("conforms to Cesium3DTilesetTraversal interface", function () { expect(Cesium3DTilesetSkipTraversal).toConformToInterface( - Cesium3DTilesetTraversal + Cesium3DTilesetTraversal, ); }); }); diff --git a/packages/engine/Specs/Scene/Cesium3DTilesetSpec.js b/packages/engine/Specs/Scene/Cesium3DTilesetSpec.js index 0419ed73eb27..1377623b5161 100644 --- a/packages/engine/Specs/Scene/Cesium3DTilesetSpec.js +++ b/packages/engine/Specs/Scene/Cesium3DTilesetSpec.js @@ -241,7 +241,7 @@ describe( const center = Cartesian3.fromRadians( centerLongitude, centerLatitude, - 100 + 100, ); scene.camera.lookAt(center, new HeadingPitchRange(0.0, 1.57, 10.0)); } @@ -277,15 +277,15 @@ describe( const uri = `data:text/plain;base64,${btoa(JSON.stringify(tilesetJson))}`; await expectAsync(Cesium3DTileset.loadJson(uri)).toBeResolvedTo( - tilesetJson + tilesetJson, ); }); it("fromUrl throws without url", async function () { await expectAsync( - Cesium3DTileset.fromUrl() + Cesium3DTileset.fromUrl(), ).toBeRejectedWithDeveloperError( - "url is required, actual value was undefined" + "url is required, actual value was undefined", ); }); @@ -299,7 +299,7 @@ describe( const uri = `data:text/plain;base64,${btoa(JSON.stringify(tilesetJson))}`; await expectAsync(Cesium3DTileset.fromUrl(uri)).toBeRejectedWithError( RuntimeError, - "The tileset must be 3D Tiles version 0.0, 1.0, or 1.1" + "The tileset must be 3D Tiles version 0.0, 1.0, or 1.1", ); }); @@ -315,7 +315,7 @@ describe( const uri = `data:text/plain;base64,${btoa(JSON.stringify(tilesetJson))}`; await expectAsync(Cesium3DTileset.fromUrl(uri)).toBeRejectedWithError( RuntimeError, - "Unsupported 3D Tiles Extension: unsupported_extension" + "Unsupported 3D Tiles Extension: unsupported_extension", ); }); @@ -347,53 +347,53 @@ describe( it("fromIonAssetId throws without assetId", async function () { await expectAsync( - Cesium3DTileset.fromIonAssetId() + Cesium3DTileset.fromIonAssetId(), ).toBeRejectedWithDeveloperError( - "assetId is required, actual value was undefined" + "assetId is required, actual value was undefined", ); }); it("loads tileset JSON file", function () { - return Cesium3DTilesTester.loadTileset(scene, tilesetUrl).then(function ( - tileset - ) { - const asset = tileset.asset; - expect(asset).toBeDefined(); - expect(asset.version).toEqual("1.0"); - expect(asset.tilesetVersion).toEqual("1.2.3"); - - const properties = tileset.properties; - expect(properties).toBeDefined(); - expect(properties.id).toBeDefined(); - expect(properties.id.minimum).toEqual(0); - expect(properties.id.maximum).toEqual(9); - - expect(tileset._geometricError).toEqual(240.0); - expect(tileset.root).toBeDefined(); - expect(tileset.resource.url).toEqual(tilesetUrl); - }); + return Cesium3DTilesTester.loadTileset(scene, tilesetUrl).then( + function (tileset) { + const asset = tileset.asset; + expect(asset).toBeDefined(); + expect(asset.version).toEqual("1.0"); + expect(asset.tilesetVersion).toEqual("1.2.3"); + + const properties = tileset.properties; + expect(properties).toBeDefined(); + expect(properties.id).toBeDefined(); + expect(properties.id.minimum).toEqual(0); + expect(properties.id.maximum).toEqual(9); + + expect(tileset._geometricError).toEqual(240.0); + expect(tileset.root).toBeDefined(); + expect(tileset.resource.url).toEqual(tilesetUrl); + }, + ); }); it("loads tileset with extras", function () { - return Cesium3DTilesTester.loadTileset(scene, tilesetUrl).then(function ( - tileset - ) { - expect(tileset.extras).toEqual({ name: "Sample Tileset" }); - expect(tileset.root.extras).toBeUndefined(); - - const length = tileset.root.children.length; - let taggedChildren = 0; - for (let i = 0; i < length; ++i) { - if (defined(tileset.root.children[i].extras)) { - expect(tileset.root.children[i].extras).toEqual({ - id: "Special Tile", - }); - ++taggedChildren; + return Cesium3DTilesTester.loadTileset(scene, tilesetUrl).then( + function (tileset) { + expect(tileset.extras).toEqual({ name: "Sample Tileset" }); + expect(tileset.root.extras).toBeUndefined(); + + const length = tileset.root.children.length; + let taggedChildren = 0; + for (let i = 0; i < length; ++i) { + if (defined(tileset.root.children[i].extras)) { + expect(tileset.root.children[i].extras).toEqual({ + id: "Special Tile", + }); + ++taggedChildren; + } } - } - expect(taggedChildren).toEqual(1); - }); + expect(taggedChildren).toEqual(1); + }, + ); }); it("gets root tile", async function () { @@ -404,27 +404,27 @@ describe( it("hasExtension returns true if the tileset JSON file uses the specified extension", function () { return Cesium3DTilesTester.loadTileset( scene, - withBatchTableHierarchyUrl + withBatchTableHierarchyUrl, ).then(function (tileset) { expect(tileset.hasExtension("3DTILES_batch_table_hierarchy")).toBe( - true + true, ); expect(tileset.hasExtension("3DTILES_nonexistant_extension")).toBe( - false + false, ); }); }); it("passes version in query string to tiles", function () { - return Cesium3DTilesTester.loadTileset(scene, tilesetUrl).then(function ( - tileset - ) { - expect(tileset.root.content._resource.url).toEqual( - getAbsoluteUri( - tilesetUrl.replace("tileset.json", "parent.b3dm?v=1.2.3") - ) - ); - }); + return Cesium3DTilesTester.loadTileset(scene, tilesetUrl).then( + function (tileset) { + expect(tileset.root.content._resource.url).toEqual( + getAbsoluteUri( + tilesetUrl.replace("tileset.json", "parent.b3dm?v=1.2.3"), + ), + ); + }, + ); }); it("passes version in query string to all external resources", function () { @@ -435,7 +435,7 @@ describe( const queryParamsWithVersion = "?a=1&b=boy&v=1.2.3"; return Cesium3DTilesTester.loadTileset( scene, - tilesetWithExternalResourcesUrl + queryParams + tilesetWithExternalResourcesUrl + queryParams, ).then(function (tileset) { const calls = Resource._Implementations.loadWithXhr.calls.all(); const callsLength = calls.length; @@ -466,7 +466,7 @@ describe( // Start spying after the tileset json has been loaded spyOn(Resource.prototype, "fetchArrayBuffer").and.returnValue( - Promise.resolve(invalidMagicBuffer) + Promise.resolve(invalidMagicBuffer), ); scene.renderForSpecs(); // Request root @@ -479,7 +479,7 @@ describe( expect(failedSpy).toHaveBeenCalledWith( jasmine.objectContaining({ message: "Invalid tile content.", - }) + }), ); expect(root.contentFailed).toBeTrue(); }); @@ -507,7 +507,7 @@ describe( expect(failedSpy).toHaveBeenCalledWith( jasmine.objectContaining({ message: "404", - }) + }), ); const statistics = tileset.statistics; expect(statistics.numberOfAttemptedRequests).toBe(0); @@ -529,8 +529,8 @@ describe( Promise.resolve( Cesium3DTilesTester.generateBatchedTileBuffer({ version: 0, // Invalid version - }) - ) + }), + ), ); scene.renderForSpecs(); // Request root const root = tileset.root; @@ -543,7 +543,7 @@ describe( jasmine.objectContaining({ message: "Only Batched 3D Model version 1 is supported. Version 0 is not.", - }) + }), ); const statistics = tileset.statistics; expect(statistics.numberOfAttemptedRequests).toBe(0); @@ -553,35 +553,35 @@ describe( }); it("renders tileset", function () { - return Cesium3DTilesTester.loadTileset(scene, tilesetUrl).then(function ( - tileset - ) { - const statistics = tileset._statistics; - expect(statistics.visited).toEqual(5); - expect(statistics.numberOfCommands).toEqual(5); - }); + return Cesium3DTilesTester.loadTileset(scene, tilesetUrl).then( + function (tileset) { + const statistics = tileset._statistics; + expect(statistics.visited).toEqual(5); + expect(statistics.numberOfCommands).toEqual(5); + }, + ); }); function checkAnimation(url) { - return Cesium3DTilesTester.loadTileset(scene, url).then(function ( - tileset - ) { - const renderOptions = { - scene: scene, - time: new JulianDate(271.828), - }; + return Cesium3DTilesTester.loadTileset(scene, url).then( + function (tileset) { + const renderOptions = { + scene: scene, + time: new JulianDate(271.828), + }; - expect(renderOptions).toRenderAndCall(function (rgba) { - const commandList = scene.frameState.commandList; - const modelMatrix1 = Matrix4.clone(commandList[0].modelMatrix); - // Check that the scene changes after .5 seconds. (it animates) - renderOptions.time.secondsOfDay += 0.5; expect(renderOptions).toRenderAndCall(function (rgba) { - const modelMatrix2 = Matrix4.clone(commandList[0].modelMatrix); - expect(modelMatrix1).not.toEqual(modelMatrix2); + const commandList = scene.frameState.commandList; + const modelMatrix1 = Matrix4.clone(commandList[0].modelMatrix); + // Check that the scene changes after .5 seconds. (it animates) + renderOptions.time.secondsOfDay += 0.5; + expect(renderOptions).toRenderAndCall(function (rgba) { + const modelMatrix2 = Matrix4.clone(commandList[0].modelMatrix); + expect(modelMatrix1).not.toEqual(modelMatrix2); + }); }); - }); - }); + }, + ); } it("animates instanced tileset", function () { return checkAnimation(instancedAnimationUrl); @@ -592,15 +592,15 @@ describe( }); it("renders tileset in CV", function () { - return Cesium3DTilesTester.loadTileset(scene, tilesetUrl).then(function ( - tileset - ) { - scene.morphToColumbusView(0.0); - scene.renderForSpecs(); - const statistics = tileset._statistics; - expect(statistics.visited).toEqual(5); - expect(statistics.numberOfCommands).toEqual(5); - }); + return Cesium3DTilesTester.loadTileset(scene, tilesetUrl).then( + function (tileset) { + scene.morphToColumbusView(0.0); + scene.renderForSpecs(); + const statistics = tileset._statistics; + expect(statistics.visited).toEqual(5); + expect(statistics.numberOfCommands).toEqual(5); + }, + ); }); it("renders tileset in CV with projectTo2D option", function () { @@ -616,16 +616,16 @@ describe( }); it("renders tileset in 2D", function () { - return Cesium3DTilesTester.loadTileset(scene, tilesetUrl).then(function ( - tileset - ) { - scene.morphTo2D(0.0); - tileset.maximumScreenSpaceError = 3; - scene.renderForSpecs(); - const statistics = tileset._statistics; - expect(statistics.visited).toEqual(5); - expect(statistics.numberOfCommands).toEqual(5); - }); + return Cesium3DTilesTester.loadTileset(scene, tilesetUrl).then( + function (tileset) { + scene.morphTo2D(0.0); + tileset.maximumScreenSpaceError = 3; + scene.renderForSpecs(); + const statistics = tileset._statistics; + expect(statistics.visited).toEqual(5); + expect(statistics.numberOfCommands).toEqual(5); + }, + ); }); it("renders tileset in 2D with projectTo2D option", function () { @@ -642,16 +642,16 @@ describe( }); it("does not render during morph", function () { - return Cesium3DTilesTester.loadTileset(scene, tilesetUrl).then(function ( - tileset - ) { - const commandList = scene.frameState.commandList; - scene.renderForSpecs(); - expect(commandList.length).toBeGreaterThan(0); - scene.morphToColumbusView(1.0); - scene.renderForSpecs(); - expect(commandList.length).toBe(0); - }); + return Cesium3DTilesTester.loadTileset(scene, tilesetUrl).then( + function (tileset) { + const commandList = scene.frameState.commandList; + scene.renderForSpecs(); + expect(commandList.length).toBeGreaterThan(0); + scene.morphToColumbusView(1.0); + scene.renderForSpecs(); + expect(commandList.length).toBe(0); + }, + ); }); it("renders tileset with empty root tile", function () { @@ -660,7 +660,7 @@ describe( const statistics = tileset._statistics; expect(statistics.visited).toEqual(5); expect(statistics.numberOfCommands).toEqual(4); // Empty tile doesn't issue a command - } + }, ); }); @@ -668,7 +668,7 @@ describe( const center = Cartesian3.fromRadians( centerLongitude, centerLatitude, - 10.0 + 10.0, ); // 3 different views of the sides of the colored cube. @@ -696,7 +696,7 @@ describe( return Cesium3DTilesTester.loadTileset( scene, tilesetEastNorthUpUrl, - tilesetOptions + tilesetOptions, ).then(function (tileset) { // The east (+x) face of the cube is red scene.camera.lookAt(center, viewEast); @@ -781,7 +781,7 @@ describe( expect(statistics.numberOfPointsSelected).toEqual(0); expect(statistics.numberOfPointsLoaded).toEqual(0); expect(statistics.numberOfTrianglesSelected).toEqual(0); - } + }, ); } @@ -802,7 +802,7 @@ describe( it("verify instanced features statistics", async function () { const tileset = await Cesium3DTileset.fromUrl( instancedRedMaterialUrl, - options + options, ); scene.primitives.add(tileset); @@ -819,7 +819,7 @@ describe( it("verify tileset of tilesets features statistics", async function () { const tileset = await Cesium3DTileset.fromUrl( tilesetOfTilesetsUrl, - options + options, ); scene.primitives.add(tileset); @@ -838,7 +838,7 @@ describe( it("verify triangle statistics", async function () { const tileset = await Cesium3DTileset.fromUrl( tilesetEmptyRootUrl, - options + options, ); scene.primitives.add(tileset); @@ -850,7 +850,7 @@ describe( const tileset = await Cesium3DTileset.fromUrl( pointCloudBatchedUrl, - options + options, ); scene.primitives.add(tileset); @@ -869,37 +869,38 @@ describe( viewNothing(); - return Cesium3DTilesTester.loadTileset(scene, tilesetUrl).then(function ( - tileset - ) { - const statistics = tileset._statistics; + return Cesium3DTilesTester.loadTileset(scene, tilesetUrl).then( + function (tileset) { + const statistics = tileset._statistics; - // No tiles loaded - expect(statistics.geometryByteLength).toEqual(0); - expect(statistics.texturesByteLength).toEqual(0); - expect(statistics.batchTableByteLength).toEqual(0); + // No tiles loaded + expect(statistics.geometryByteLength).toEqual(0); + expect(statistics.texturesByteLength).toEqual(0); + expect(statistics.batchTableByteLength).toEqual(0); - viewRootOnly(); - return Cesium3DTilesTester.waitForTilesLoaded(scene, tileset).then( - function () { - // Root tile loaded - expect(statistics.geometryByteLength).toEqual( - singleTileGeometryMemory - ); - expect(statistics.texturesByteLength).toEqual( - singleTileTextureMemory - ); - expect(statistics.batchTableByteLength).toEqual(0); + viewRootOnly(); + return Cesium3DTilesTester.waitForTilesLoaded(scene, tileset).then( + function () { + // Root tile loaded + expect(statistics.geometryByteLength).toEqual( + singleTileGeometryMemory, + ); + expect(statistics.texturesByteLength).toEqual( + singleTileTextureMemory, + ); + expect(statistics.batchTableByteLength).toEqual(0); - viewAllTiles(); - return Cesium3DTilesTester.waitForTilesLoaded(scene, tileset).then( - function () { + viewAllTiles(); + return Cesium3DTilesTester.waitForTilesLoaded( + scene, + tileset, + ).then(function () { // All tiles loaded expect(statistics.geometryByteLength).toEqual( - singleTileGeometryMemory * tilesLength + singleTileGeometryMemory * tilesLength, ); expect(statistics.texturesByteLength).toEqual( - singleTileTextureMemory * tilesLength + singleTileTextureMemory * tilesLength, ); expect(statistics.batchTableByteLength).toEqual(0); @@ -907,40 +908,40 @@ describe( tileset.root.content.getFeature(0).color = Color.RED; scene.renderForSpecs(); expect(statistics.geometryByteLength).toEqual( - singleTileGeometryMemory * tilesLength + singleTileGeometryMemory * tilesLength, ); expect(statistics.texturesByteLength).toEqual( - singleTileTextureMemory * tilesLength + singleTileTextureMemory * tilesLength, ); expect(statistics.batchTableByteLength).toEqual( - singleTileBatchTextureMemory + singleTileBatchTextureMemory, ); // All tiles picked, the texture memory is now higher scene.pickForSpecs(); expect(statistics.geometryByteLength).toEqual( - singleTileGeometryMemory * tilesLength + singleTileGeometryMemory * tilesLength, ); expect(statistics.texturesByteLength).toEqual( - singleTileTextureMemory * tilesLength + singleTileTextureMemory * tilesLength, ); expect(statistics.batchTableByteLength).toEqual( singleTileBatchTextureMemory + - singleTilePickTextureMemory * tilesLength + singleTilePickTextureMemory * tilesLength, ); // Tiles are still in memory when zoomed out viewNothing(); scene.renderForSpecs(); expect(statistics.geometryByteLength).toEqual( - singleTileGeometryMemory * tilesLength + singleTileGeometryMemory * tilesLength, ); expect(statistics.texturesByteLength).toEqual( - singleTileTextureMemory * tilesLength + singleTileTextureMemory * tilesLength, ); expect(statistics.batchTableByteLength).toEqual( singleTileBatchTextureMemory + - singleTilePickTextureMemory * tilesLength + singleTilePickTextureMemory * tilesLength, ); // Trim loaded tiles, expect the memory statistics to be 0 @@ -949,11 +950,11 @@ describe( expect(statistics.geometryByteLength).toEqual(0); expect(statistics.texturesByteLength).toEqual(0); expect(statistics.batchTableByteLength).toEqual(0); - } - ); - } - ); - }); + }); + }, + ); + }, + ); }); it("verify memory usage statistics for shared resources", function () { @@ -976,7 +977,7 @@ describe( return Cesium3DTilesTester.loadTileset( scene, - tilesetWithExternalResourcesUrl + tilesetWithExternalResourcesUrl, ).then(function (tileset) { // Contents are not aware of whether their resources are shared by // other contents, so check ResourceCache. @@ -987,75 +988,75 @@ describe( }); it("does not process tileset when screen space error is not met", function () { - return Cesium3DTilesTester.loadTileset(scene, tilesetUrl).then(function ( - tileset - ) { - const statistics = tileset._statistics; - expect(statistics.visited).toEqual(5); - expect(statistics.numberOfCommands).toEqual(5); + return Cesium3DTilesTester.loadTileset(scene, tilesetUrl).then( + function (tileset) { + const statistics = tileset._statistics; + expect(statistics.visited).toEqual(5); + expect(statistics.numberOfCommands).toEqual(5); - // Set zoom far enough away to not meet sse - viewNothing(); - scene.renderForSpecs(); - expect(statistics.visited).toEqual(0); - expect(statistics.numberOfCommands).toEqual(0); - }); + // Set zoom far enough away to not meet sse + viewNothing(); + scene.renderForSpecs(); + expect(statistics.visited).toEqual(0); + expect(statistics.numberOfCommands).toEqual(0); + }, + ); }); it("does not select tiles when outside of view frustum", function () { - return Cesium3DTilesTester.loadTileset(scene, tilesetUrl).then(function ( - tileset - ) { - const statistics = tileset._statistics; - expect(statistics.visited).toEqual(5); - expect(statistics.numberOfCommands).toEqual(5); + return Cesium3DTilesTester.loadTileset(scene, tilesetUrl).then( + function (tileset) { + const statistics = tileset._statistics; + expect(statistics.visited).toEqual(5); + expect(statistics.numberOfCommands).toEqual(5); - viewSky(); + viewSky(); - scene.renderForSpecs(); - expect(statistics.visited).toEqual(0); - expect(statistics.numberOfCommands).toEqual(0); - expect( - tileset.root.visibility( - scene.frameState, - CullingVolume.MASK_INDETERMINATE - ) - ).toEqual(CullingVolume.MASK_OUTSIDE); - }); + scene.renderForSpecs(); + expect(statistics.visited).toEqual(0); + expect(statistics.numberOfCommands).toEqual(0); + expect( + tileset.root.visibility( + scene.frameState, + CullingVolume.MASK_INDETERMINATE, + ), + ).toEqual(CullingVolume.MASK_OUTSIDE); + }, + ); }); it("does not load additive tiles that are out of view", function () { viewBottomLeft(); - return Cesium3DTilesTester.loadTileset(scene, tilesetUrl).then(function ( - tileset - ) { - const statistics = tileset._statistics; - expect(statistics.numberOfTilesWithContentReady).toEqual(2); - }); + return Cesium3DTilesTester.loadTileset(scene, tilesetUrl).then( + function (tileset) { + const statistics = tileset._statistics; + expect(statistics.numberOfTilesWithContentReady).toEqual(2); + }, + ); }); it("culls with content box", function () { // Root tile has a content box that is half the extents of its box // Expect to cull root tile and three child tiles - return Cesium3DTilesTester.loadTileset(scene, tilesetUrl).then(function ( - tileset - ) { - const statistics = tileset._statistics; - expect(statistics.visited).toEqual(5); - expect(statistics.numberOfCommands).toEqual(5); + return Cesium3DTilesTester.loadTileset(scene, tilesetUrl).then( + function (tileset) { + const statistics = tileset._statistics; + expect(statistics.visited).toEqual(5); + expect(statistics.numberOfCommands).toEqual(5); - viewBottomLeft(); - scene.renderForSpecs(); - expect(statistics.visited).toEqual(2); // Visits root, but does not render it - expect(statistics.numberOfCommands).toEqual(1); - expect(tileset._selectedTiles[0]).not.toBe(tileset.root); + viewBottomLeft(); + scene.renderForSpecs(); + expect(statistics.visited).toEqual(2); // Visits root, but does not render it + expect(statistics.numberOfCommands).toEqual(1); + expect(tileset._selectedTiles[0]).not.toBe(tileset.root); - // Set contents box to undefined, and now root won't be culled - tileset.root._contentBoundingVolume = undefined; - scene.renderForSpecs(); - expect(statistics.visited).toEqual(2); - expect(statistics.numberOfCommands).toEqual(2); - }); + // Set contents box to undefined, and now root won't be culled + tileset.root._contentBoundingVolume = undefined; + scene.renderForSpecs(); + expect(statistics.visited).toEqual(2); + expect(statistics.numberOfCommands).toEqual(2); + }, + ); }); function findTileByUri(tiles, uri) { @@ -1073,32 +1074,32 @@ describe( } it("selects children in front to back order", function () { - return Cesium3DTilesTester.loadTileset(scene, tilesetUrl).then(function ( - tileset - ) { - // After moving the camera left by 1.0 and down by 0.5, the distance from the camera should be in the order: - // 1. lower left - // 2. upper left - // 3. lower right - // 4. upper right - - scene.camera.moveLeft(1.0); - scene.camera.moveDown(0.5); - scene.renderForSpecs(); - - const root = tileset.root; - const llTile = findTileByUri(root.children, "ll.b3dm"); - const lrTile = findTileByUri(root.children, "lr.b3dm"); - const urTile = findTileByUri(root.children, "ur.b3dm"); - const ulTile = findTileByUri(root.children, "ul.b3dm"); + return Cesium3DTilesTester.loadTileset(scene, tilesetUrl).then( + function (tileset) { + // After moving the camera left by 1.0 and down by 0.5, the distance from the camera should be in the order: + // 1. lower left + // 2. upper left + // 3. lower right + // 4. upper right + + scene.camera.moveLeft(1.0); + scene.camera.moveDown(0.5); + scene.renderForSpecs(); - const selectedTiles = tileset._selectedTiles; - expect(selectedTiles[0]).toBe(root); - expect(selectedTiles[1]).toBe(llTile); - expect(selectedTiles[2]).toBe(ulTile); - expect(selectedTiles[3]).toBe(lrTile); - expect(selectedTiles[4]).toBe(urTile); - }); + const root = tileset.root; + const llTile = findTileByUri(root.children, "ll.b3dm"); + const lrTile = findTileByUri(root.children, "lr.b3dm"); + const urTile = findTileByUri(root.children, "ur.b3dm"); + const ulTile = findTileByUri(root.children, "ul.b3dm"); + + const selectedTiles = tileset._selectedTiles; + expect(selectedTiles[0]).toBe(root); + expect(selectedTiles[1]).toBe(llTile); + expect(selectedTiles[2]).toBe(ulTile); + expect(selectedTiles[3]).toBe(lrTile); + expect(selectedTiles[4]).toBe(urTile); + }, + ); }); async function testDynamicScreenSpaceError(url, distance) { @@ -1166,7 +1167,7 @@ describe( const tileset = await Cesium3DTilesTester.loadTileset( scene, withTransformBoxUrl, - options + options, ); // Make sure the values match the constructor, not hard-coded defaults @@ -1190,50 +1191,50 @@ describe( it("additive refinement - selects root when sse is met", function () { viewRootOnly(); - return Cesium3DTilesTester.loadTileset(scene, tilesetUrl).then(function ( - tileset - ) { - // Meets screen space error, only root tile is rendered - const statistics = tileset._statistics; - expect(statistics.visited).toEqual(1); - expect(statistics.numberOfCommands).toEqual(1); - return Cesium3DTilesTester.waitForTilesLoaded(scene, tileset); - }); + return Cesium3DTilesTester.loadTileset(scene, tilesetUrl).then( + function (tileset) { + // Meets screen space error, only root tile is rendered + const statistics = tileset._statistics; + expect(statistics.visited).toEqual(1); + expect(statistics.numberOfCommands).toEqual(1); + return Cesium3DTilesTester.waitForTilesLoaded(scene, tileset); + }, + ); }); it("additive refinement - selects all tiles when sse is not met", function () { - return Cesium3DTilesTester.loadTileset(scene, tilesetUrl).then(function ( - tileset - ) { - // Does not meet screen space error, all tiles are visible - const statistics = tileset._statistics; - expect(statistics.visited).toEqual(5); - expect(statistics.numberOfCommands).toEqual(5); - return Cesium3DTilesTester.waitForTilesLoaded(scene, tileset); - }); + return Cesium3DTilesTester.loadTileset(scene, tilesetUrl).then( + function (tileset) { + // Does not meet screen space error, all tiles are visible + const statistics = tileset._statistics; + expect(statistics.visited).toEqual(5); + expect(statistics.numberOfCommands).toEqual(5); + return Cesium3DTilesTester.waitForTilesLoaded(scene, tileset); + }, + ); }); it("additive refinement - use parent's geometric error on child's box for early refinement", function () { - return Cesium3DTilesTester.loadTileset(scene, tilesetUrl).then(function ( - tileset - ) { - const statistics = tileset._statistics; - expect(statistics.visited).toEqual(5); - expect(statistics.numberOfCommands).toEqual(5); + return Cesium3DTilesTester.loadTileset(scene, tilesetUrl).then( + function (tileset) { + const statistics = tileset._statistics; + expect(statistics.visited).toEqual(5); + expect(statistics.numberOfCommands).toEqual(5); - // Both right tiles don't meet the SSE anymore - scene.camera.moveLeft(50.0); - scene.renderForSpecs(); - expect(statistics.visited).toEqual(3); - expect(statistics.numberOfCommands).toEqual(3); - return Cesium3DTilesTester.waitForTilesLoaded(scene, tileset); - }); + // Both right tiles don't meet the SSE anymore + scene.camera.moveLeft(50.0); + scene.renderForSpecs(); + expect(statistics.visited).toEqual(3); + expect(statistics.numberOfCommands).toEqual(3); + return Cesium3DTilesTester.waitForTilesLoaded(scene, tileset); + }, + ); }); it("additive refinement - selects tile when inside viewer request volume", function () { return Cesium3DTilesTester.loadTileset( scene, - tilesetWithViewerRequestVolumeUrl + tilesetWithViewerRequestVolumeUrl, ).then(function (tileset) { const statistics = tileset._statistics; // Force root tile to always not meet SSE since this is just checking the request volume @@ -1254,58 +1255,58 @@ describe( it("replacement refinement - selects root when sse is met", function () { viewRootOnly(); - return Cesium3DTilesTester.loadTileset(scene, tilesetUrl).then(function ( - tileset - ) { - tileset.root.refine = Cesium3DTileRefine.REPLACE; + return Cesium3DTilesTester.loadTileset(scene, tilesetUrl).then( + function (tileset) { + tileset.root.refine = Cesium3DTileRefine.REPLACE; - // Meets screen space error, only root tile is rendered - scene.renderForSpecs(); + // Meets screen space error, only root tile is rendered + scene.renderForSpecs(); - const statistics = tileset._statistics; - expect(statistics.visited).toEqual(1); - expect(statistics.numberOfCommands).toEqual(1); - return Cesium3DTilesTester.waitForTilesLoaded(scene, tileset); - }); + const statistics = tileset._statistics; + expect(statistics.visited).toEqual(1); + expect(statistics.numberOfCommands).toEqual(1); + return Cesium3DTilesTester.waitForTilesLoaded(scene, tileset); + }, + ); }); it("replacement refinement - selects children when sse is not met", function () { - return Cesium3DTilesTester.loadTileset(scene, tilesetUrl).then(function ( - tileset - ) { - tileset.root.refine = Cesium3DTileRefine.REPLACE; + return Cesium3DTilesTester.loadTileset(scene, tilesetUrl).then( + function (tileset) { + tileset.root.refine = Cesium3DTileRefine.REPLACE; - // Does not meet screen space error, child tiles replace root tile - scene.renderForSpecs(); + // Does not meet screen space error, child tiles replace root tile + scene.renderForSpecs(); - const statistics = tileset._statistics; - expect(statistics.visited).toEqual(5); // Visits root, but does not render it - expect(statistics.numberOfCommands).toEqual(4); - return Cesium3DTilesTester.waitForTilesLoaded(scene, tileset); - }); + const statistics = tileset._statistics; + expect(statistics.visited).toEqual(5); // Visits root, but does not render it + expect(statistics.numberOfCommands).toEqual(4); + return Cesium3DTilesTester.waitForTilesLoaded(scene, tileset); + }, + ); }); it("replacement refinement - selects root when sse is not met and children are not ready", function () { viewRootOnly(); - return Cesium3DTilesTester.loadTileset(scene, tilesetUrl).then(function ( - tileset - ) { - const root = tileset.root; - root.refine = Cesium3DTileRefine.REPLACE; + return Cesium3DTilesTester.loadTileset(scene, tilesetUrl).then( + function (tileset) { + const root = tileset.root; + root.refine = Cesium3DTileRefine.REPLACE; - // Set zoom to start loading child tiles - viewAllTiles(); - scene.renderForSpecs(); + // Set zoom to start loading child tiles + viewAllTiles(); + scene.renderForSpecs(); - const statistics = tileset._statistics; - // LOD skipping visits all visible - expect(statistics.visited).toEqual(5); - // no stencil clear command because only the root tile - expect(statistics.numberOfCommands).toEqual(1); - expect(statistics.numberOfPendingRequests).toEqual(4); - expect(numberOfChildrenWithoutContent(root)).toEqual(4); - return Cesium3DTilesTester.waitForTilesLoaded(scene, tileset); - }); + const statistics = tileset._statistics; + // LOD skipping visits all visible + expect(statistics.visited).toEqual(5); + // no stencil clear command because only the root tile + expect(statistics.numberOfCommands).toEqual(1); + expect(statistics.numberOfPendingRequests).toEqual(4); + expect(numberOfChildrenWithoutContent(root)).toEqual(4); + return Cesium3DTilesTester.waitForTilesLoaded(scene, tileset); + }, + ); }); it("replacement refinement - selects tile when inside viewer request volume", function () { @@ -1314,7 +1315,7 @@ describe( tilesetWithViewerRequestVolumeUrl, { skipLevelOfDetail: false, - } + }, ).then(function (tileset) { const statistics = tileset._statistics; @@ -1348,7 +1349,7 @@ describe( viewRootOnly(); return Cesium3DTilesTester.loadTileset( scene, - tilesetReplacement1Url + tilesetReplacement1Url, ).then(function (tileset) { tileset.skipLevelOfDetail = false; viewAllTiles(); @@ -1365,7 +1366,7 @@ describe( function () { scene.renderForSpecs(); expect(statistics.numberOfCommands).toEqual(4); // Render children - } + }, ); }); }); @@ -1382,7 +1383,7 @@ describe( viewRootOnly(); return Cesium3DTilesTester.loadTileset( scene, - tilesetReplacement2Url + tilesetReplacement2Url, ).then(function (tileset) { tileset.skipLevelOfDetail = false; const statistics = tileset._statistics; @@ -1396,9 +1397,9 @@ describe( return Cesium3DTilesTester.waitForTilesLoaded(scene, tileset).then( function () { expect(statistics.numberOfCommands).toEqual(2); // Renders two content tiles - } + }, ); - } + }, ); }); }); @@ -1415,7 +1416,7 @@ describe( viewRootOnly(); const tileset = await Cesium3DTilesTester.loadTileset( scene, - tilesetReplacement3Url + tilesetReplacement3Url, ); tileset.skipLevelOfDetail = false; const statistics = tileset._statistics; @@ -1455,14 +1456,14 @@ describe( }); }); - return Cesium3DTilesTester.loadTileset(scene, tilesetUrl).then(function ( - tileset - ) { - tileset.skipLevelOfDetail = false; - const statistics = tileset._statistics; - scene.renderForSpecs(); - expect(statistics.numberOfCommands).toEqual(3); - }); + return Cesium3DTilesTester.loadTileset(scene, tilesetUrl).then( + function (tileset) { + tileset.skipLevelOfDetail = false; + const statistics = tileset._statistics; + scene.renderForSpecs(); + expect(statistics.numberOfCommands).toEqual(3); + }, + ); }); it("replacement and additive refinement", function () { @@ -1475,7 +1476,7 @@ describe( const statistics = tileset._statistics; expect(statistics.visited).toEqual(7); expect(statistics.numberOfCommands).toEqual(6); - } + }, ); }); @@ -1483,12 +1484,12 @@ describe( it("does not select visible tiles with invisible children", function () { return Cesium3DTilesTester.loadTileset( scene, - tilesetReplacementWithViewerRequestVolumeUrl + tilesetReplacementWithViewerRequestVolumeUrl, ).then(function (tileset) { const center = Cartesian3.fromRadians( centerLongitude, centerLatitude, - 22.0 + 22.0, ); scene.camera.lookAt(center, new HeadingPitchRange(0.0, 1.57, 1.0)); @@ -1500,33 +1501,33 @@ describe( expect( childRoot.visibility( scene.frameState, - CullingVolume.MASK_INDETERMINATE - ) + CullingVolume.MASK_INDETERMINATE, + ), ).not.toEqual(CullingVolume.MASK_OUTSIDE); expect( childRoot.children[0].visibility( scene.frameState, - CullingVolume.MASK_INDETERMINATE - ) + CullingVolume.MASK_INDETERMINATE, + ), ).toEqual(CullingVolume.MASK_OUTSIDE); expect( childRoot.children[1].visibility( scene.frameState, - CullingVolume.MASK_INDETERMINATE - ) + CullingVolume.MASK_INDETERMINATE, + ), ).toEqual(CullingVolume.MASK_OUTSIDE); expect( childRoot.children[2].visibility( scene.frameState, - CullingVolume.MASK_INDETERMINATE - ) + CullingVolume.MASK_INDETERMINATE, + ), ).toEqual(CullingVolume.MASK_OUTSIDE); expect( childRoot.children[3].visibility( scene.frameState, - CullingVolume.MASK_INDETERMINATE - ) + CullingVolume.MASK_INDETERMINATE, + ), ).toEqual(CullingVolume.MASK_OUTSIDE); expect(tileset._selectedTiles.length).toEqual(0); @@ -1537,12 +1538,12 @@ describe( it("does not select external tileset whose root has invisible children", function () { return Cesium3DTilesTester.loadTileset( scene, - tilesetOfTilesetsUrl + tilesetOfTilesetsUrl, ).then(function (tileset) { const center = Cartesian3.fromRadians( centerLongitude, centerLatitude, - 50.0 + 50.0, ); scene.camera.lookAt(center, new HeadingPitchRange(0.0, 1.57, 1.0)); const root = tileset.root; @@ -1555,7 +1556,7 @@ describe( expect(root._visible).toBe(false); expect(externalRoot._visible).toBe(false); expect(tileset.statistics.numberOfTilesCulledWithChildrenUnion).toBe( - 1 + 1, ); }); }); @@ -1563,7 +1564,7 @@ describe( it("does not select visible tiles not meeting SSE with visible children", function () { return Cesium3DTilesTester.loadTileset( scene, - tilesetReplacementWithViewerRequestVolumeUrl + tilesetReplacementWithViewerRequestVolumeUrl, ).then(function (tileset) { const root = tileset.root; const childRoot = root.children[0]; @@ -1574,33 +1575,33 @@ describe( expect( childRoot.visibility( scene.frameState, - CullingVolume.MASK_INDETERMINATE - ) + CullingVolume.MASK_INDETERMINATE, + ), ).not.toEqual(CullingVolume.MASK_OUTSIDE); expect( childRoot.children[0].visibility( scene.frameState, - CullingVolume.MASK_INDETERMINATE - ) + CullingVolume.MASK_INDETERMINATE, + ), ).not.toEqual(CullingVolume.MASK_OUTSIDE); expect( childRoot.children[1].visibility( scene.frameState, - CullingVolume.MASK_INDETERMINATE - ) + CullingVolume.MASK_INDETERMINATE, + ), ).not.toEqual(CullingVolume.MASK_OUTSIDE); expect( childRoot.children[2].visibility( scene.frameState, - CullingVolume.MASK_INDETERMINATE - ) + CullingVolume.MASK_INDETERMINATE, + ), ).not.toEqual(CullingVolume.MASK_OUTSIDE); expect( childRoot.children[3].visibility( scene.frameState, - CullingVolume.MASK_INDETERMINATE - ) + CullingVolume.MASK_INDETERMINATE, + ), ).not.toEqual(CullingVolume.MASK_OUTSIDE); expect(isSelected(tileset, childRoot)).toBe(false); @@ -1610,7 +1611,7 @@ describe( it("does select visible tiles meeting SSE with visible children", function () { return Cesium3DTilesTester.loadTileset( scene, - tilesetReplacementWithViewerRequestVolumeUrl + tilesetReplacementWithViewerRequestVolumeUrl, ).then(function (tileset) { const root = tileset.root; const childRoot = root.children[0]; @@ -1623,37 +1624,37 @@ describe( expect( childRoot.visibility( scene.frameState, - CullingVolume.MASK_INDETERMINATE - ) + CullingVolume.MASK_INDETERMINATE, + ), ).not.toEqual(CullingVolume.MASK_OUTSIDE); expect( childRoot.children[0].visibility( scene.frameState, - CullingVolume.MASK_INDETERMINATE - ) + CullingVolume.MASK_INDETERMINATE, + ), ).not.toEqual(CullingVolume.MASK_OUTSIDE); expect( childRoot.children[1].visibility( scene.frameState, - CullingVolume.MASK_INDETERMINATE - ) + CullingVolume.MASK_INDETERMINATE, + ), ).not.toEqual(CullingVolume.MASK_OUTSIDE); expect( childRoot.children[2].visibility( scene.frameState, - CullingVolume.MASK_INDETERMINATE - ) + CullingVolume.MASK_INDETERMINATE, + ), ).not.toEqual(CullingVolume.MASK_OUTSIDE); expect( childRoot.children[3].visibility( scene.frameState, - CullingVolume.MASK_INDETERMINATE - ) + CullingVolume.MASK_INDETERMINATE, + ), ).not.toEqual(CullingVolume.MASK_OUTSIDE); expect(isSelected(tileset, childRoot)).toBe(true); - } + }, ); }); }); @@ -1665,7 +1666,7 @@ describe( tilesetReplacementWithViewerRequestVolumeUrl, { cullWithChildrenBounds: false, - } + }, ).then(function (tileset) { const root = tileset.root; const childRoot = root.children[0]; @@ -1673,33 +1674,33 @@ describe( expect( childRoot.visibility( scene.frameState, - CullingVolume.MASK_INDETERMINATE - ) + CullingVolume.MASK_INDETERMINATE, + ), ).not.toEqual(CullingVolume.MASK_OUTSIDE); expect( childRoot.children[0].visibility( scene.frameState, - CullingVolume.MASK_INDETERMINATE - ) + CullingVolume.MASK_INDETERMINATE, + ), ).not.toEqual(CullingVolume.MASK_OUTSIDE); expect( childRoot.children[1].visibility( scene.frameState, - CullingVolume.MASK_INDETERMINATE - ) + CullingVolume.MASK_INDETERMINATE, + ), ).not.toEqual(CullingVolume.MASK_OUTSIDE); expect( childRoot.children[2].visibility( scene.frameState, - CullingVolume.MASK_INDETERMINATE - ) + CullingVolume.MASK_INDETERMINATE, + ), ).not.toEqual(CullingVolume.MASK_OUTSIDE); expect( childRoot.children[3].visibility( scene.frameState, - CullingVolume.MASK_INDETERMINATE - ) + CullingVolume.MASK_INDETERMINATE, + ), ).not.toEqual(CullingVolume.MASK_OUTSIDE); expect(tileset._selectedTiles.length).toEqual(1); @@ -1710,7 +1711,7 @@ describe( it("does select visible tiles with visible children passing request volumes", function () { return Cesium3DTilesTester.loadTileset( scene, - tilesetReplacementWithViewerRequestVolumeUrl + tilesetReplacementWithViewerRequestVolumeUrl, ).then(function (tileset) { const root = tileset.root; const childRoot = root.children[0]; @@ -1722,33 +1723,33 @@ describe( expect( childRoot.visibility( scene.frameState, - CullingVolume.MASK_INDETERMINATE - ) + CullingVolume.MASK_INDETERMINATE, + ), ).not.toEqual(CullingVolume.MASK_OUTSIDE); expect( childRoot.children[0].visibility( scene.frameState, - CullingVolume.MASK_INDETERMINATE - ) + CullingVolume.MASK_INDETERMINATE, + ), ).not.toEqual(CullingVolume.MASK_OUTSIDE); expect( childRoot.children[1].visibility( scene.frameState, - CullingVolume.MASK_INDETERMINATE - ) + CullingVolume.MASK_INDETERMINATE, + ), ).not.toEqual(CullingVolume.MASK_OUTSIDE); expect( childRoot.children[2].visibility( scene.frameState, - CullingVolume.MASK_INDETERMINATE - ) + CullingVolume.MASK_INDETERMINATE, + ), ).not.toEqual(CullingVolume.MASK_OUTSIDE); expect( childRoot.children[3].visibility( scene.frameState, - CullingVolume.MASK_INDETERMINATE - ) + CullingVolume.MASK_INDETERMINATE, + ), ).not.toEqual(CullingVolume.MASK_OUTSIDE); expect(tileset._selectedTiles.length).toEqual(1); @@ -1758,7 +1759,7 @@ describe( scene.renderForSpecs(); expect(tileset._selectedTiles.length).toEqual(4); expect(isSelected(tileset, childRoot)).toBe(false); - } + }, ); }); }); @@ -1770,7 +1771,7 @@ describe( const tileset = await Cesium3DTilesTester.loadTileset( scene, - tilesetOfTilesetsUrl + tilesetOfTilesetsUrl, ); // Root points to an external tileset JSON file and has no children until it is requested const root = tileset.root; @@ -1793,7 +1794,7 @@ describe( const subtreeRoot = root.children[0]; expect(root.refine).toEqual(subtreeRoot.refine); expect(root.contentBoundingVolume.boundingVolume).toEqual( - subtreeRoot.contentBoundingVolume.boundingVolume + subtreeRoot.contentBoundingVolume.boundingVolume, ); // Check that subtree root has 4 children @@ -1812,11 +1813,11 @@ describe( let expectedUrl = `Data/Cesium3DTiles/Tilesets/TilesetOfTilesets/tileset.json?${queryParams}`; const tileset = await Cesium3DTilesTester.loadTileset( scene, - `${tilesetOfTilesetsUrl}?${queryParams}` + `${tilesetOfTilesetsUrl}?${queryParams}`, ); //Make sure tileset JSON file was requested with query parameters expect(Resource._Implementations.loadWithXhr.calls.argsFor(0)[0]).toEqual( - expectedUrl + expectedUrl, ); Resource._Implementations.loadWithXhr.calls.reset(); @@ -1831,10 +1832,10 @@ describe( }); //Make sure tileset2.json was requested with query parameters and does not use parent tilesetVersion expectedUrl = getAbsoluteUri( - `Data/Cesium3DTiles/Tilesets/TilesetOfTilesets/tileset2.json?v=1.2.3&${queryParams}` + `Data/Cesium3DTiles/Tilesets/TilesetOfTilesets/tileset2.json?v=1.2.3&${queryParams}`, ); expect(Resource._Implementations.loadWithXhr.calls.argsFor(0)[0]).toEqual( - expectedUrl + expectedUrl, ); }); @@ -1844,7 +1845,7 @@ describe( const statistics = tileset._statistics; expect(statistics.visited).toEqual(7); // Visits two tiles with tileset content, five tiles with b3dm content expect(statistics.numberOfCommands).toEqual(5); // Render the five tiles with b3dm content - } + }, ); }); @@ -1855,7 +1856,7 @@ describe( const statistics = tileset._statistics; expect(statistics.visited).toEqual(2); // Visits external tileset tile, and external tileset root expect(statistics.numberOfCommands).toEqual(1); // Renders external tileset root - } + }, ); }); @@ -1873,50 +1874,50 @@ describe( Cesium3DTilesTester.expectRender(scene, tileset, function (rgba) { expect(rgba).not.toEqual(color); }); - } + }, ); }); it("debugFreezeFrame", function () { - return Cesium3DTilesTester.loadTileset(scene, tilesetUrl).then(function ( - tileset - ) { - viewRootOnly(); - scene.renderForSpecs(); - const statistics = tileset._statistics; - expect(statistics.visited).toEqual(1); - expect(statistics.numberOfCommands).toEqual(1); + return Cesium3DTilesTester.loadTileset(scene, tilesetUrl).then( + function (tileset) { + viewRootOnly(); + scene.renderForSpecs(); + const statistics = tileset._statistics; + expect(statistics.visited).toEqual(1); + expect(statistics.numberOfCommands).toEqual(1); - tileset.debugFreezeFrame = true; - viewAllTiles(); - scene.renderForSpecs(); - expect(statistics.visited).toEqual(0); // selectTiles returns early, so no tiles are visited - expect(statistics.numberOfCommands).toEqual(1); // root tile is still in selectedTiles list - }); + tileset.debugFreezeFrame = true; + viewAllTiles(); + scene.renderForSpecs(); + expect(statistics.visited).toEqual(0); // selectTiles returns early, so no tiles are visited + expect(statistics.numberOfCommands).toEqual(1); // root tile is still in selectedTiles list + }, + ); }); function checkDebugColorizeTiles(url) { CesiumMath.setRandomNumberSeed(0); - return Cesium3DTilesTester.loadTileset(scene, url).then(function ( - tileset - ) { - // Get initial color - let color; - Cesium3DTilesTester.expectRender(scene, tileset, function (rgba) { - color = rgba; - }); + return Cesium3DTilesTester.loadTileset(scene, url).then( + function (tileset) { + // Get initial color + let color; + Cesium3DTilesTester.expectRender(scene, tileset, function (rgba) { + color = rgba; + }); - // Check for debug color - tileset.debugColorizeTiles = true; - Cesium3DTilesTester.expectRender(scene, tileset, function (rgba) { - expect(rgba).not.toEqual(color); - }); + // Check for debug color + tileset.debugColorizeTiles = true; + Cesium3DTilesTester.expectRender(scene, tileset, function (rgba) { + expect(rgba).not.toEqual(color); + }); - tileset.debugColorizeTiles = false; - Cesium3DTilesTester.expectRender(scene, tileset, function (rgba) { - expect(rgba).toEqual(color); - }); - }); + tileset.debugColorizeTiles = false; + Cesium3DTilesTester.expectRender(scene, tileset, function (rgba) { + expect(rgba).toEqual(color); + }); + }, + ); } it("debugColorizeTiles for b3dm with batch table", function () { @@ -1980,43 +1981,43 @@ describe( }); it("debugShowBoundingVolume", function () { - return Cesium3DTilesTester.loadTileset(scene, tilesetUrl).then(function ( - tileset - ) { - viewRootOnly(); - tileset.debugShowBoundingVolume = true; - scene.renderForSpecs(); - const statistics = tileset._statistics; - expect(statistics.visited).toEqual(1); - expect(statistics.numberOfCommands).toEqual(2); // Tile command + bounding volume command + return Cesium3DTilesTester.loadTileset(scene, tilesetUrl).then( + function (tileset) { + viewRootOnly(); + tileset.debugShowBoundingVolume = true; + scene.renderForSpecs(); + const statistics = tileset._statistics; + expect(statistics.visited).toEqual(1); + expect(statistics.numberOfCommands).toEqual(2); // Tile command + bounding volume command - tileset.debugShowBoundingVolume = false; - scene.renderForSpecs(); - expect(statistics.numberOfCommands).toEqual(1); - }); + tileset.debugShowBoundingVolume = false; + scene.renderForSpecs(); + expect(statistics.numberOfCommands).toEqual(1); + }, + ); }); it("debugShowContentBoundingVolume", function () { - return Cesium3DTilesTester.loadTileset(scene, tilesetUrl).then(function ( - tileset - ) { - viewRootOnly(); - tileset.debugShowContentBoundingVolume = true; - scene.renderForSpecs(); - const statistics = tileset._statistics; - expect(statistics.visited).toEqual(1); - expect(statistics.numberOfCommands).toEqual(2); // Tile command + bounding volume command + return Cesium3DTilesTester.loadTileset(scene, tilesetUrl).then( + function (tileset) { + viewRootOnly(); + tileset.debugShowContentBoundingVolume = true; + scene.renderForSpecs(); + const statistics = tileset._statistics; + expect(statistics.visited).toEqual(1); + expect(statistics.numberOfCommands).toEqual(2); // Tile command + bounding volume command - tileset.debugShowContentBoundingVolume = false; - scene.renderForSpecs(); - expect(statistics.numberOfCommands).toEqual(1); - }); + tileset.debugShowContentBoundingVolume = false; + scene.renderForSpecs(); + expect(statistics.numberOfCommands).toEqual(1); + }, + ); }); it("debugShowViewerRequestVolume", function () { return Cesium3DTilesTester.loadTileset( scene, - tilesetWithViewerRequestVolumeUrl + tilesetWithViewerRequestVolumeUrl, ).then(function (tileset) { tileset.debugShowViewerRequestVolume = true; scene.renderForSpecs(); @@ -2032,42 +2033,42 @@ describe( it("show tile debug labels with regions", function () { // tilesetUrl has bounding regions - return Cesium3DTilesTester.loadTileset(scene, tilesetUrl).then(function ( - tileset - ) { - tileset.debugShowGeometricError = true; - scene.renderForSpecs(); - expect(tileset._tileDebugLabels).toBeDefined(); - expect(tileset._tileDebugLabels.length).toEqual(5); + return Cesium3DTilesTester.loadTileset(scene, tilesetUrl).then( + function (tileset) { + tileset.debugShowGeometricError = true; + scene.renderForSpecs(); + expect(tileset._tileDebugLabels).toBeDefined(); + expect(tileset._tileDebugLabels.length).toEqual(5); - const root = tileset.root; - expect(tileset._tileDebugLabels._labels[0].text).toEqual( - `Geometric error: ${root.geometricError}` - ); - expect(tileset._tileDebugLabels._labels[1].text).toEqual( - `Geometric error: ${root.children[0].geometricError}` - ); - expect(tileset._tileDebugLabels._labels[2].text).toEqual( - `Geometric error: ${root.children[1].geometricError}` - ); - expect(tileset._tileDebugLabels._labels[3].text).toEqual( - `Geometric error: ${root.children[2].geometricError}` - ); - expect(tileset._tileDebugLabels._labels[4].text).toEqual( - `Geometric error: ${root.children[3].geometricError}` - ); + const root = tileset.root; + expect(tileset._tileDebugLabels._labels[0].text).toEqual( + `Geometric error: ${root.geometricError}`, + ); + expect(tileset._tileDebugLabels._labels[1].text).toEqual( + `Geometric error: ${root.children[0].geometricError}`, + ); + expect(tileset._tileDebugLabels._labels[2].text).toEqual( + `Geometric error: ${root.children[1].geometricError}`, + ); + expect(tileset._tileDebugLabels._labels[3].text).toEqual( + `Geometric error: ${root.children[2].geometricError}`, + ); + expect(tileset._tileDebugLabels._labels[4].text).toEqual( + `Geometric error: ${root.children[3].geometricError}`, + ); - tileset.debugShowGeometricError = false; - scene.renderForSpecs(); - expect(tileset._tileDebugLabels).not.toBeDefined(); - }); + tileset.debugShowGeometricError = false; + scene.renderForSpecs(); + expect(tileset._tileDebugLabels).not.toBeDefined(); + }, + ); }); it("show tile debug labels with boxes", function () { // tilesetWithTransformsUrl has bounding boxes return Cesium3DTilesTester.loadTileset( scene, - tilesetWithTransformsUrl + tilesetWithTransformsUrl, ).then(function (tileset) { tileset.debugShowGeometricError = true; scene.renderForSpecs(); @@ -2076,10 +2077,10 @@ describe( const root = tileset.root; expect(tileset._tileDebugLabels._labels[0].text).toEqual( - `Geometric error: ${root.geometricError}` + `Geometric error: ${root.geometricError}`, ); expect(tileset._tileDebugLabels._labels[1].text).toEqual( - `Geometric error: ${root.children[0].geometricError}` + `Geometric error: ${root.children[0].geometricError}`, ); tileset.debugShowGeometricError = false; @@ -2092,7 +2093,7 @@ describe( // tilesetWithViewerRequestVolumeUrl has bounding sphere return Cesium3DTilesTester.loadTileset( scene, - tilesetWithViewerRequestVolumeUrl + tilesetWithViewerRequestVolumeUrl, ).then(function (tileset) { tileset.debugShowGeometricError = true; scene.renderForSpecs(); @@ -2103,7 +2104,7 @@ describe( for (let i = 0; i < length; ++i) { expect(tileset._tileDebugLabels._labels[i].text).toEqual( - `Geometric error: ${tileset._selectedTiles[i].geometricError}` + `Geometric error: ${tileset._selectedTiles[i].geometricError}`, ); } @@ -2115,133 +2116,133 @@ describe( it("show tile debug labels with rendering statistics", function () { // tilesetUrl has bounding regions - return Cesium3DTilesTester.loadTileset(scene, tilesetUrl).then(function ( - tileset - ) { - tileset.debugShowRenderingStatistics = true; - viewRootOnly(); - scene.renderForSpecs(); - expect(tileset._tileDebugLabels).toBeDefined(); - expect(tileset._tileDebugLabels.length).toEqual(1); + return Cesium3DTilesTester.loadTileset(scene, tilesetUrl).then( + function (tileset) { + tileset.debugShowRenderingStatistics = true; + viewRootOnly(); + scene.renderForSpecs(); + expect(tileset._tileDebugLabels).toBeDefined(); + expect(tileset._tileDebugLabels.length).toEqual(1); - const content = tileset.root.content; - const expected = - `Commands: ${tileset.root.commandsLength}\n` + - `Triangles: ${content.trianglesLength}\n` + - `Features: ${content.featuresLength}`; + const content = tileset.root.content; + const expected = + `Commands: ${tileset.root.commandsLength}\n` + + `Triangles: ${content.trianglesLength}\n` + + `Features: ${content.featuresLength}`; - expect(tileset._tileDebugLabels._labels[0].text).toEqual(expected); + expect(tileset._tileDebugLabels._labels[0].text).toEqual(expected); - tileset.debugShowRenderingStatistics = false; - scene.renderForSpecs(); - expect(tileset._tileDebugLabels).not.toBeDefined(); - }); + tileset.debugShowRenderingStatistics = false; + scene.renderForSpecs(); + expect(tileset._tileDebugLabels).not.toBeDefined(); + }, + ); }); it("show tile debug labels with memory usage", function () { // tilesetUrl has bounding regions - return Cesium3DTilesTester.loadTileset(scene, tilesetUrl).then(function ( - tileset - ) { - tileset.debugShowMemoryUsage = true; - viewRootOnly(); - scene.renderForSpecs(); - expect(tileset._tileDebugLabels).toBeDefined(); - expect(tileset._tileDebugLabels.length).toEqual(1); + return Cesium3DTilesTester.loadTileset(scene, tilesetUrl).then( + function (tileset) { + tileset.debugShowMemoryUsage = true; + viewRootOnly(); + scene.renderForSpecs(); + expect(tileset._tileDebugLabels).toBeDefined(); + expect(tileset._tileDebugLabels.length).toEqual(1); - const expected = - "Texture Memory: 0\n" + - `Geometry Memory: ${(0.007).toLocaleString()}`; + const expected = + "Texture Memory: 0\n" + + `Geometry Memory: ${(0.007).toLocaleString()}`; - expect(tileset._tileDebugLabels._labels[0].text).toEqual(expected); + expect(tileset._tileDebugLabels._labels[0].text).toEqual(expected); - tileset.debugShowMemoryUsage = false; - scene.renderForSpecs(); - expect(tileset._tileDebugLabels).not.toBeDefined(); - }); + tileset.debugShowMemoryUsage = false; + scene.renderForSpecs(); + expect(tileset._tileDebugLabels).not.toBeDefined(); + }, + ); }); it("show tile debug labels with all statistics", function () { // tilesetUrl has bounding regions - return Cesium3DTilesTester.loadTileset(scene, tilesetUrl).then(function ( - tileset - ) { - tileset.debugShowGeometricError = true; - tileset.debugShowRenderingStatistics = true; - tileset.debugShowMemoryUsage = true; - tileset.debugShowUrl = true; - viewRootOnly(); - scene.renderForSpecs(); - expect(tileset._tileDebugLabels).toBeDefined(); + return Cesium3DTilesTester.loadTileset(scene, tilesetUrl).then( + function (tileset) { + tileset.debugShowGeometricError = true; + tileset.debugShowRenderingStatistics = true; + tileset.debugShowMemoryUsage = true; + tileset.debugShowUrl = true; + viewRootOnly(); + scene.renderForSpecs(); + expect(tileset._tileDebugLabels).toBeDefined(); - const expected = - "Geometric error: 70\n" + - "Commands: 1\n" + - "Triangles: 120\n" + - "Features: 10\n" + - "Texture Memory: 0\n" + - `Geometry Memory: ${(0.007).toLocaleString()}\n` + - "Url: parent.b3dm"; - expect(tileset._tileDebugLabels._labels[0].text).toEqual(expected); + const expected = + "Geometric error: 70\n" + + "Commands: 1\n" + + "Triangles: 120\n" + + "Features: 10\n" + + "Texture Memory: 0\n" + + `Geometry Memory: ${(0.007).toLocaleString()}\n` + + "Url: parent.b3dm"; + expect(tileset._tileDebugLabels._labels[0].text).toEqual(expected); - tileset.debugShowGeometricError = false; - tileset.debugShowRenderingStatistics = false; - tileset.debugShowMemoryUsage = false; - tileset.debugShowUrl = false; - scene.renderForSpecs(); - expect(tileset._tileDebugLabels).not.toBeDefined(); - }); + tileset.debugShowGeometricError = false; + tileset.debugShowRenderingStatistics = false; + tileset.debugShowMemoryUsage = false; + tileset.debugShowUrl = false; + scene.renderForSpecs(); + expect(tileset._tileDebugLabels).not.toBeDefined(); + }, + ); }); it("show only picked tile debug label with all stats", function () { // tilesetUrl has bounding regions - return Cesium3DTilesTester.loadTileset(scene, tilesetUrl).then(function ( - tileset - ) { - tileset.debugShowGeometricError = true; - tileset.debugShowRenderingStatistics = true; - tileset.debugShowMemoryUsage = true; - tileset.debugShowUrl = true; - tileset.debugPickedTileLabelOnly = true; + return Cesium3DTilesTester.loadTileset(scene, tilesetUrl).then( + function (tileset) { + tileset.debugShowGeometricError = true; + tileset.debugShowRenderingStatistics = true; + tileset.debugShowMemoryUsage = true; + tileset.debugShowUrl = true; + tileset.debugPickedTileLabelOnly = true; - const scratchPosition = new Cartesian3(1.0, 1.0, 1.0); - tileset.debugPickedTile = tileset.root; - tileset.debugPickPosition = scratchPosition; + const scratchPosition = new Cartesian3(1.0, 1.0, 1.0); + tileset.debugPickedTile = tileset.root; + tileset.debugPickPosition = scratchPosition; - scene.renderForSpecs(); - expect(tileset._tileDebugLabels).toBeDefined(); + scene.renderForSpecs(); + expect(tileset._tileDebugLabels).toBeDefined(); - const expected = - "Geometric error: 70\n" + - "Commands: 1\n" + - "Triangles: 120\n" + - "Features: 10\n" + - "Texture Memory: 0\n" + - `Geometry Memory: ${(0.007).toLocaleString()}\n` + - "Url: parent.b3dm"; - expect(tileset._tileDebugLabels.get(0).text).toEqual(expected); - expect(tileset._tileDebugLabels.get(0).position).toEqual( - scratchPosition - ); + const expected = + "Geometric error: 70\n" + + "Commands: 1\n" + + "Triangles: 120\n" + + "Features: 10\n" + + "Texture Memory: 0\n" + + `Geometry Memory: ${(0.007).toLocaleString()}\n` + + "Url: parent.b3dm"; + expect(tileset._tileDebugLabels.get(0).text).toEqual(expected); + expect(tileset._tileDebugLabels.get(0).position).toEqual( + scratchPosition, + ); - tileset.debugPickedTile = undefined; - scene.renderForSpecs(); - expect(tileset._tileDebugLabels.length).toEqual(0); - }); + tileset.debugPickedTile = undefined; + scene.renderForSpecs(); + expect(tileset._tileDebugLabels.length).toEqual(0); + }, + ); }); it("does not request tiles when picking", function () { viewNothing(); - return Cesium3DTilesTester.loadTileset(scene, tilesetUrl).then(function ( - tileset - ) { - viewRootOnly(); - scene.pickForSpecs(); - expect(tileset._statistics.numberOfPendingRequests).toEqual(0); - scene.renderForSpecs(); - expect(tileset._statistics.numberOfPendingRequests).toEqual(1); - return Cesium3DTilesTester.waitForTilesLoaded(scene, tileset); - }); + return Cesium3DTilesTester.loadTileset(scene, tilesetUrl).then( + function (tileset) { + viewRootOnly(); + scene.pickForSpecs(); + expect(tileset._statistics.numberOfPendingRequests).toEqual(0); + scene.renderForSpecs(); + expect(tileset._statistics.numberOfPendingRequests).toEqual(1); + return Cesium3DTilesTester.waitForTilesLoaded(scene, tileset); + }, + ); }); it("does not process tiles when picking", async function () { @@ -2297,18 +2298,18 @@ describe( const spyUpdate = jasmine.createSpy("listener"); viewNothing(); - return Cesium3DTilesTester.loadTileset(scene, tilesetUrl).then(function ( - tileset - ) { - tileset.loadProgress.addEventListener(spyUpdate); - viewRootOnly(); - return Cesium3DTilesTester.waitForTilesLoaded(scene, tileset).then( - function () { - expect(spyUpdate.calls.count()).toEqual(3); - expect(spyUpdate.calls.allArgs()).toEqual(results); - } - ); - }); + return Cesium3DTilesTester.loadTileset(scene, tilesetUrl).then( + function (tileset) { + tileset.loadProgress.addEventListener(spyUpdate); + viewRootOnly(); + return Cesium3DTilesTester.waitForTilesLoaded(scene, tileset).then( + function () { + expect(spyUpdate.calls.count()).toEqual(3); + expect(spyUpdate.calls.allArgs()).toEqual(results); + }, + ); + }, + ); }); it("tilesLoaded", async function () { @@ -2338,58 +2339,61 @@ describe( expect(spyUpdate2.calls.count()).toEqual(1); }); - it("tile visible event is raised", function () { - viewRootOnly(); - return Cesium3DTilesTester.loadTileset(scene, tilesetUrl).then(function ( - tileset - ) { - const spyUpdate = jasmine.createSpy("listener"); - tileset.tileVisible.addEventListener(spyUpdate); - scene.renderForSpecs(); - expect( - tileset.root.visibility( - scene.frameState, - CullingVolume.MASK_INDETERMINATE - ) - ).not.toEqual(CullingVolume.MASK_OUTSIDE); - expect(spyUpdate.calls.count()).toEqual(1); - expect(spyUpdate.calls.argsFor(0)[0]).toBe(tileset.root); - return Cesium3DTilesTester.waitForTilesLoaded(scene, tileset); - }); - }); - + it("tile visible event is raised", function () { + viewRootOnly(); + return Cesium3DTilesTester.loadTileset(scene, tilesetUrl).then( + function (tileset) { + const spyUpdate = jasmine.createSpy("listener"); + tileset.tileVisible.addEventListener(spyUpdate); + scene.renderForSpecs(); + expect( + tileset.root.visibility( + scene.frameState, + CullingVolume.MASK_INDETERMINATE, + ), + ).not.toEqual(CullingVolume.MASK_OUTSIDE); + expect(spyUpdate.calls.count()).toEqual(1); + expect(spyUpdate.calls.argsFor(0)[0]).toBe(tileset.root); + return Cesium3DTilesTester.waitForTilesLoaded(scene, tileset); + }, + ); + }); + it("tile load event is raised", function () { viewNothing(); - return Cesium3DTilesTester.loadTileset(scene, tilesetUrl).then(function ( - tileset - ) { - const spyUpdate = jasmine.createSpy("listener"); - tileset.tileLoad.addEventListener(spyUpdate); - tileset.cacheBytes = 0; - viewRootOnly(); - return Cesium3DTilesTester.waitForTilesLoaded(scene, tileset).then( - function () { - // Root is loaded - expect(spyUpdate.calls.count()).toEqual(1); - expect(spyUpdate.calls.argsFor(0)[0]).toBe(tileset.root); - spyUpdate.calls.reset(); + return Cesium3DTilesTester.loadTileset(scene, tilesetUrl).then( + function (tileset) { + const spyUpdate = jasmine.createSpy("listener"); + tileset.tileLoad.addEventListener(spyUpdate); + tileset.cacheBytes = 0; + viewRootOnly(); + return Cesium3DTilesTester.waitForTilesLoaded(scene, tileset).then( + function () { + // Root is loaded + expect(spyUpdate.calls.count()).toEqual(1); + expect(spyUpdate.calls.argsFor(0)[0]).toBe(tileset.root); + spyUpdate.calls.reset(); - // Unload from cache - viewNothing(); - scene.renderForSpecs(); - expect(tileset.statistics.numberOfTilesWithContentReady).toEqual(0); + // Unload from cache + viewNothing(); + scene.renderForSpecs(); + expect(tileset.statistics.numberOfTilesWithContentReady).toEqual( + 0, + ); - // Look at root again - viewRootOnly(); - return Cesium3DTilesTester.waitForTilesLoaded(scene, tileset).then( - function () { + // Look at root again + viewRootOnly(); + return Cesium3DTilesTester.waitForTilesLoaded( + scene, + tileset, + ).then(function () { expect(spyUpdate.calls.count()).toEqual(1); expect(spyUpdate.calls.argsFor(0)[0]).toBe(tileset.root); - } - ); - } - ); - }); + }); + }, + ); + }, + ); }); it("tile failed event is raised", function () { @@ -2405,10 +2409,10 @@ describe( data, headers, deferred, - overrideMimeType + overrideMimeType, ) { deferred.reject("404"); - } + }, ); tileset.tileFailed.addEventListener(spyUpdate); tileset.cacheBytes = 0; @@ -2435,18 +2439,18 @@ describe( const ray = scene.camera.getPickRay( new Cartesian2( scene.drawingBufferWidth / 2.0, - scene.drawingBufferHeight / 2.0 - ) + scene.drawingBufferHeight / 2.0, + ), ); const expected = new Cartesian3( 1215026.8094312553, -4736367.339076743, - 4081652.238842398 + 4081652.238842398, ); expect(tileset.pick(ray, scene.frameState)).toEqualEpsilon( expected, - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); }); @@ -2456,7 +2460,7 @@ describe( tilesetOfTilesetsUrl, { enablePick: !scene.frameState.context.webgl2, - } + }, ); viewRootOnly(); scene.renderForSpecs(); @@ -2464,18 +2468,18 @@ describe( const ray = scene.camera.getPickRay( new Cartesian2( scene.drawingBufferWidth / 2.0, - scene.drawingBufferHeight / 2.0 - ) + scene.drawingBufferHeight / 2.0, + ), ); const expected = new Cartesian3( 1215026.8094312553, -4736367.339076743, - 4081652.238842398 + 4081652.238842398, ); expect(tileset.pick(ray, scene.frameState)).toEqualEpsilon( expected, - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); }); @@ -2485,7 +2489,7 @@ describe( instancedUrl, { enablePick: !scene.frameState.context.webgl2, - } + }, ); viewInstances(); scene.renderForSpecs(); @@ -2493,18 +2497,18 @@ describe( const ray = scene.camera.getPickRay( new Cartesian2( scene.drawingBufferWidth / 2.0, - scene.drawingBufferHeight / 2.0 - ) + scene.drawingBufferHeight / 2.0, + ), ); const expected = new Cartesian3( 1215015.7820120894, -4736324.352446682, - 4081615.004915994 + 4081615.004915994, ); expect(tileset.pick(ray, scene.frameState)).toEqualEpsilon( expected, - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); }); @@ -2514,7 +2518,7 @@ describe( translucentUrl, { enablePick: !scene.frameState.context.webgl2, - } + }, ); viewAllTiles(); scene.renderForSpecs(); @@ -2522,18 +2526,18 @@ describe( const ray = scene.camera.getPickRay( new Cartesian2( scene.drawingBufferWidth / 2.0, - scene.drawingBufferHeight / 2.0 - ) + scene.drawingBufferHeight / 2.0, + ), ); const expected = new Cartesian3( 1215013.1035421563, -4736313.911345786, - 4081605.96109977 + 4081605.96109977, ); expect(tileset.pick(ray, scene.frameState)).toEqualEpsilon( expected, - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); }); @@ -2543,7 +2547,7 @@ describe( tilesetWithTransformsUrl, { enablePick: !scene.frameState.context.webgl2, - } + }, ); viewAllTiles(); scene.renderForSpecs(); @@ -2551,18 +2555,18 @@ describe( const ray = scene.camera.getPickRay( new Cartesian2( scene.drawingBufferWidth / 2.0, - scene.drawingBufferHeight / 2.0 - ) + scene.drawingBufferHeight / 2.0, + ), ); const expected = new Cartesian3( 1215013.1035421563, -4736313.911345786, - 4081605.96109977 + 4081605.96109977, ); expect(tileset.pick(ray, scene.frameState)).toEqualEpsilon( expected, - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); }); @@ -2572,7 +2576,7 @@ describe( pointCloudUrl, { enablePick: !scene.frameState.context.webgl2, - } + }, ); viewAllTiles(); scene.renderForSpecs(); @@ -2580,8 +2584,8 @@ describe( const ray = scene.camera.getPickRay( new Cartesian2( scene.drawingBufferWidth / 2.0, - scene.drawingBufferHeight / 2.0 - ) + scene.drawingBufferHeight / 2.0, + ), ); expect(tileset.pick(ray, scene.frameState)).toBeUndefined(); @@ -2596,7 +2600,7 @@ describe( scene.renderForSpecs(); const center = Ellipsoid.WGS84.cartesianToCartographic( - tileset.boundingSphere.center + tileset.boundingSphere.center, ); const height = tileset.getHeight(center, scene); expect(height).toEqualEpsilon(78.1558019795064, CesiumMath.EPSILON8); @@ -2612,35 +2616,35 @@ describe( scene.renderForSpecs(); const center = Ellipsoid.WGS84.cartesianToCartographic( - tileset.boundingSphere.center + tileset.boundingSphere.center, ); const height = tileset.getHeight(center, scene); expect(height).toEqualEpsilon(156.31161477299992, CesiumMath.EPSILON8); }); it("destroys", function () { - return Cesium3DTilesTester.loadTileset(scene, tilesetUrl).then(function ( - tileset - ) { - const root = tileset.root; - expect(tileset.isDestroyed()).toEqual(false); - scene.primitives.remove(tileset); - expect(tileset.isDestroyed()).toEqual(true); - - // Check that all tiles are destroyed - expect(root.isDestroyed()).toEqual(true); - expect(root.children[0].isDestroyed()).toEqual(true); - expect(root.children[1].isDestroyed()).toEqual(true); - expect(root.children[2].isDestroyed()).toEqual(true); - expect(root.children[3].isDestroyed()).toEqual(true); - }); + return Cesium3DTilesTester.loadTileset(scene, tilesetUrl).then( + function (tileset) { + const root = tileset.root; + expect(tileset.isDestroyed()).toEqual(false); + scene.primitives.remove(tileset); + expect(tileset.isDestroyed()).toEqual(true); + + // Check that all tiles are destroyed + expect(root.isDestroyed()).toEqual(true); + expect(root.children[0].isDestroyed()).toEqual(true); + expect(root.children[1].isDestroyed()).toEqual(true); + expect(root.children[2].isDestroyed()).toEqual(true); + expect(root.children[3].isDestroyed()).toEqual(true); + }, + ); }); it("destroys before external tileset JSON file finishes loading", async function () { viewNothing(); const tileset = await Cesium3DTilesTester.loadTileset( scene, - tilesetOfTilesetsUrl + tilesetOfTilesetsUrl, ); const root = tileset.root; @@ -2691,7 +2695,7 @@ describe( ibl.imageBasedLightingFactor = new Cartesian2(0.0, 0.0); expect(renderOptions).notToRender(rgba); }); - } + }, ); }); @@ -2712,7 +2716,7 @@ describe( expect(renderOptions).notToRender(rgba2); }); }); - } + }, ); }); @@ -2721,23 +2725,23 @@ describe( scene: scene, time: new JulianDate(2457522.154792), }; - return Cesium3DTilesTester.loadTileset(scene, url).then(function ( - tileset - ) { - scene.camera.setView(setViewOptions); - // In the glTF and glb tests, the back-face of the model is black, - // so the background color is set to a different color to distinguish - // between the results. - scene.backgroundColor = new Color(0.0, 0.0, 1.0, 1.0); - expect(renderOptions).toRenderAndCall(function (rgba) { - expect(rgba).toEqual([0, 0, 255, 255]); - tileset.backFaceCulling = false; - expect(renderOptions).toRenderAndCall(function (rgba2) { - expect(rgba2).not.toEqual(rgba); + return Cesium3DTilesTester.loadTileset(scene, url).then( + function (tileset) { + scene.camera.setView(setViewOptions); + // In the glTF and glb tests, the back-face of the model is black, + // so the background color is set to a different color to distinguish + // between the results. + scene.backgroundColor = new Color(0.0, 0.0, 1.0, 1.0); + expect(renderOptions).toRenderAndCall(function (rgba) { + expect(rgba).toEqual([0, 0, 255, 255]); + tileset.backFaceCulling = false; + expect(renderOptions).toRenderAndCall(function (rgba2) { + expect(rgba2).not.toEqual(rgba); + }); }); - }); - scene.backgroundColor = new Color(0.0, 0.0, 0.0, 1.0); - }); + scene.backgroundColor = new Color(0.0, 0.0, 0.0, 1.0); + }, + ); } it("renders b3dm tileset when back-face culling is disabled", function () { @@ -2745,12 +2749,12 @@ describe( destination: new Cartesian3( 1215012.6853779217, -4736313.101374343, - 4081603.4657718465 + 4081603.4657718465, ), orientation: new HeadingPitchRoll( 6.283185307179584, -0.49999825387267993, - 6.283185307179586 + 6.283185307179586, ), endTransform: Matrix4.IDENTITY, }; @@ -2763,12 +2767,12 @@ describe( destination: new Cartesian3( 1215012.6853779217, -4736313.101374343, - 4081603.4657718465 + 4081603.4657718465, ), orientation: new HeadingPitchRoll( 6.283185307179584, -0.49999825387267993, - 6.283185307179586 + 6.283185307179586, ), endTransform: Matrix4.IDENTITY, }; @@ -2781,12 +2785,12 @@ describe( destination: new Cartesian3( 1215012.6853779217, -4736313.101374343, - 4081603.4657718465 + 4081603.4657718465, ), orientation: new HeadingPitchRoll( 6.283185307179584, -0.49999825387267993, - 6.283185307179586 + 6.283185307179586, ), endTransform: Matrix4.IDENTITY, }; @@ -2799,12 +2803,12 @@ describe( destination: new Cartesian3( 1215015.8599828142, -4736324.65638894, - 4081609.967056947 + 4081609.967056947, ), orientation: new HeadingPitchRoll( 6.283185307179585, -0.5000006393986758, - 6.283185307179586 + 6.283185307179586, ), endTransform: Matrix4.IDENTITY, }; @@ -2826,7 +2830,7 @@ describe( expect(scene).toRender([0, 0, 0, 255]); tileset.style = new Cesium3DTileStyle({ show: "true" }); expect(scene).notToRender([0, 0, 0, 255]); - } + }, ); }); @@ -2843,7 +2847,7 @@ describe( tileset.style = new Cesium3DTileStyle({ show: "true" }); expect(scene).notToRender([0, 0, 0, 255]); - } + }, ); }); @@ -2860,7 +2864,7 @@ describe( // ${id} < 10 will always evaluate to true tileset.style = new Cesium3DTileStyle({ show: "${id} < 200 / 2" }); expect(scene).notToRender([0, 0, 0, 255]); - } + }, ); }); @@ -2874,7 +2878,7 @@ describe( tileset.style = new Cesium3DTileStyle({ show: "true" }); expect(scene).notToRender([0, 0, 0, 255]); - } + }, ); }); @@ -2892,7 +2896,7 @@ describe( tileset.style = new Cesium3DTileStyle({ show: "true" }); expect(scene).notToRender([0, 0, 0, 255]); - } + }, ); }); @@ -2910,7 +2914,7 @@ describe( tileset.style = new Cesium3DTileStyle({ show: "true" }); expect(scene).notToRender([0, 0, 0, 255]); - } + }, ); }); @@ -2951,7 +2955,7 @@ describe( return Cesium3DTilesTester.loadTileset(scene, withoutBatchTableUrl).then( function (tileset) { return expectColorStyle(tileset); - } + }, ); }); @@ -2959,14 +2963,14 @@ describe( return Cesium3DTilesTester.loadTileset(scene, translucentUrl).then( function (tileset) { return expectColorStyle(tileset); - } + }, ); }); it("applies color style to a tileset with translucent and opaque tiles", function () { return Cesium3DTilesTester.loadTileset( scene, - translucentOpaqueMixUrl + translucentOpaqueMixUrl, ).then(function (tileset) { return expectColorStyle(tileset); }); @@ -2976,7 +2980,7 @@ describe( return Cesium3DTilesTester.loadTileset(scene, noBatchIdsUrl).then( function (tileset) { return expectColorStyle(tileset); - } + }, ); }); @@ -2985,7 +2989,7 @@ describe( function (tileset) { viewGltfContent(); return expectColorStyle(tileset); - } + }, ); }); @@ -2994,7 +2998,7 @@ describe( function (tileset) { viewGltfContent(); return expectColorStyle(tileset); - } + }, ); }); @@ -3024,7 +3028,7 @@ describe( feature.setProperty("id", feature.getProperty("id") - 10); } expect(scene).notToRender([0, 0, 0, 255]); - } + }, ); }); @@ -3061,7 +3065,7 @@ describe( expect(feature.show).toBe(false); viewAllTiles(); expect(feature.show).toBe(false); - } + }, ); }); @@ -3074,14 +3078,14 @@ describe( scene.renderForSpecs(); expect( tileset._statisticsPerPass[Cesium3DTilePass.RENDER] - .numberOfTilesStyled + .numberOfTilesStyled, ).toBe(1); scene.pickForSpecs(); expect( tileset._statisticsPerPass[Cesium3DTilePass.PICK] - .numberOfTilesStyled + .numberOfTilesStyled, ).toBe(0); - } + }, ); }); @@ -3112,7 +3116,7 @@ describe( expect(rgba[2]).toEqual(0); expect(rgba[3]).toEqual(255); }); - } + }, ); }); @@ -3152,7 +3156,7 @@ describe( expect(rgba[2]).toBeGreaterThan(0); expect(rgba[3]).toEqual(255); }); - } + }, ); }); @@ -3169,7 +3173,7 @@ describe( scene.renderForSpecs(); expect(tileset.root.content.getFeature(0).color).toEqual(Color.WHITE); expect(tileset.root.content.getFeature(1).color).toEqual(Color.BLACK); - } + }, ); }); @@ -3195,7 +3199,7 @@ describe( scene.renderForSpecs(); expect(tileset.root.content.getFeature(0).show).toBe(true); expect(tileset.root.content.getFeature(1).show).toBe(false); - } + }, ); }); @@ -3212,7 +3216,7 @@ describe( expect(rgba[3]).toEqual(255); }); }); - } + }, ); }); @@ -3239,7 +3243,7 @@ describe( style.show._value = true; tileset.makeStyleDirty(); expect(scene).notToRender([0, 0, 0, 255]); - } + }, ); }); @@ -3266,7 +3270,7 @@ describe( expect(rgba[2]).toBe(0); expect(rgba[3]).toEqual(255); }); - } + }, ); }); @@ -3287,7 +3291,7 @@ describe( scene.renderForSpecs(); expect(statistics.numberOfTilesStyled).toBe(0); - } + }, ); }); @@ -3309,7 +3313,7 @@ describe( tileset.style = style; scene.renderForSpecs(); expect(statistics.numberOfTilesStyled).toBe(0); - } + }, ); }); @@ -3500,7 +3504,8 @@ describe( ContextLimits._maximumVertexTextureImageUnits = 0; return testColorBlendMode(colorsUrl).then(function () { // Re-enable VTF - ContextLimits._maximumVertexTextureImageUnits = maximumVertexTextureImageUnits; + ContextLimits._maximumVertexTextureImageUnits = + maximumVertexTextureImageUnits; }); }); @@ -3521,134 +3526,136 @@ describe( // Cache replacement tests it("Unload all cached tiles not required to meet SSE using cacheBytes", function () { - return Cesium3DTilesTester.loadTileset(scene, tilesetUrl).then(function ( - tileset - ) { - tileset.cacheBytes = 0; + return Cesium3DTilesTester.loadTileset(scene, tilesetUrl).then( + function (tileset) { + tileset.cacheBytes = 0; - // Render parent and four children (using additive refinement) - viewAllTiles(); - scene.renderForSpecs(); + // Render parent and four children (using additive refinement) + viewAllTiles(); + scene.renderForSpecs(); - const statistics = tileset._statistics; - expect(statistics.numberOfCommands).toEqual(5); - expect(statistics.numberOfTilesWithContentReady).toEqual(5); // Five loaded tiles - expect(tileset.totalMemoryUsageInBytes).toEqual(37200); // Specific to this tileset + const statistics = tileset._statistics; + expect(statistics.numberOfCommands).toEqual(5); + expect(statistics.numberOfTilesWithContentReady).toEqual(5); // Five loaded tiles + expect(tileset.totalMemoryUsageInBytes).toEqual(37200); // Specific to this tileset - // Zoom out so only root tile is needed to meet SSE. This unloads - // the four children since the maximum memory usage is zero. - viewRootOnly(); - scene.renderForSpecs(); + // Zoom out so only root tile is needed to meet SSE. This unloads + // the four children since the maximum memory usage is zero. + viewRootOnly(); + scene.renderForSpecs(); - expect(statistics.numberOfCommands).toEqual(1); - expect(statistics.numberOfTilesWithContentReady).toEqual(1); - expect(tileset.totalMemoryUsageInBytes).toEqual(7440); // Specific to this tileset + expect(statistics.numberOfCommands).toEqual(1); + expect(statistics.numberOfTilesWithContentReady).toEqual(1); + expect(tileset.totalMemoryUsageInBytes).toEqual(7440); // Specific to this tileset - // Zoom back in so all four children are re-requested. - viewAllTiles(); + // Zoom back in so all four children are re-requested. + viewAllTiles(); - return Cesium3DTilesTester.waitForTilesLoaded(scene, tileset).then( - function () { - expect(statistics.numberOfCommands).toEqual(5); - expect(statistics.numberOfTilesWithContentReady).toEqual(5); // Five loaded tiles - expect(tileset.totalMemoryUsageInBytes).toEqual(37200); // Specific to this tileset - } - ); - }); + return Cesium3DTilesTester.waitForTilesLoaded(scene, tileset).then( + function () { + expect(statistics.numberOfCommands).toEqual(5); + expect(statistics.numberOfTilesWithContentReady).toEqual(5); // Five loaded tiles + expect(tileset.totalMemoryUsageInBytes).toEqual(37200); // Specific to this tileset + }, + ); + }, + ); }); it("Unload some cached tiles not required to meet SSE using cacheBytes", function () { - return Cesium3DTilesTester.loadTileset(scene, tilesetUrl).then(function ( - tileset - ) { - tileset.cacheBytes = 0.025 * 1024 * 1024; // Just enough memory to allow 3 tiles to remain - // Render parent and four children (using additive refinement) - viewAllTiles(); - scene.renderForSpecs(); + return Cesium3DTilesTester.loadTileset(scene, tilesetUrl).then( + function (tileset) { + tileset.cacheBytes = 0.025 * 1024 * 1024; // Just enough memory to allow 3 tiles to remain + // Render parent and four children (using additive refinement) + viewAllTiles(); + scene.renderForSpecs(); - const statistics = tileset._statistics; - expect(statistics.numberOfCommands).toEqual(5); - expect(statistics.numberOfTilesWithContentReady).toEqual(5); // Five loaded tiles + const statistics = tileset._statistics; + expect(statistics.numberOfCommands).toEqual(5); + expect(statistics.numberOfTilesWithContentReady).toEqual(5); // Five loaded tiles - // Zoom out so only root tile is needed to meet SSE. This unloads - // two of the four children so three tiles are still loaded (the - // root and two children) since the maximum memory usage is sufficient. - viewRootOnly(); - scene.renderForSpecs(); + // Zoom out so only root tile is needed to meet SSE. This unloads + // two of the four children so three tiles are still loaded (the + // root and two children) since the maximum memory usage is sufficient. + viewRootOnly(); + scene.renderForSpecs(); - expect(statistics.numberOfCommands).toEqual(1); - expect(statistics.numberOfTilesWithContentReady).toEqual(3); + expect(statistics.numberOfCommands).toEqual(1); + expect(statistics.numberOfTilesWithContentReady).toEqual(3); - // Zoom back in so the two children are re-requested. - viewAllTiles(); + // Zoom back in so the two children are re-requested. + viewAllTiles(); - return Cesium3DTilesTester.waitForTilesLoaded(scene, tileset).then( - function () { - expect(statistics.numberOfCommands).toEqual(5); - expect(statistics.numberOfTilesWithContentReady).toEqual(5); // Five loaded tiles - } - ); - }); + return Cesium3DTilesTester.waitForTilesLoaded(scene, tileset).then( + function () { + expect(statistics.numberOfCommands).toEqual(5); + expect(statistics.numberOfTilesWithContentReady).toEqual(5); // Five loaded tiles + }, + ); + }, + ); }); it("Restrict tileset memory usage with maximumCacheOverflowBytes", function () { - return Cesium3DTilesTester.loadTileset(scene, tilesetUrl).then(function ( - tileset - ) { - tileset.cacheBytes = 0.025 * 1024 * 1024; // Just enough memory to allow 3 tiles to remain - tileset.maximumCacheOverflowBytes = 0; - expect(tileset.memoryAdjustedScreenSpaceError).toEqual(16); - - // Zoom out so only root tile is needed to meet SSE. - viewRootOnly(); - scene.renderForSpecs(); - const statistics = tileset._statistics; - expect(statistics.numberOfCommands).toEqual(1); - expect(statistics.numberOfTilesWithContentReady).toEqual(3); + return Cesium3DTilesTester.loadTileset(scene, tilesetUrl).then( + function (tileset) { + tileset.cacheBytes = 0.025 * 1024 * 1024; // Just enough memory to allow 3 tiles to remain + tileset.maximumCacheOverflowBytes = 0; + expect(tileset.memoryAdjustedScreenSpaceError).toEqual(16); - // Zoom back in and attempt to render all tiles - viewAllTiles(); + // Zoom out so only root tile is needed to meet SSE. + viewRootOnly(); + scene.renderForSpecs(); + const statistics = tileset._statistics; + expect(statistics.numberOfCommands).toEqual(1); + expect(statistics.numberOfTilesWithContentReady).toEqual(3); - return Cesium3DTilesTester.waitForTilesLoaded(scene, tileset).then( - function () { - // Only 3 tiles should have been actually loaded - expect(statistics.numberOfCommands).toEqual(3); - expect(statistics.numberOfTilesWithContentReady).toEqual(3); // Three loaded tiles - // SSE should have been adjusted higher - expect(tileset.memoryAdjustedScreenSpaceError).toBeGreaterThan(16); - } - ); - }); + // Zoom back in and attempt to render all tiles + viewAllTiles(); + + return Cesium3DTilesTester.waitForTilesLoaded(scene, tileset).then( + function () { + // Only 3 tiles should have been actually loaded + expect(statistics.numberOfCommands).toEqual(3); + expect(statistics.numberOfTilesWithContentReady).toEqual(3); // Three loaded tiles + // SSE should have been adjusted higher + expect(tileset.memoryAdjustedScreenSpaceError).toBeGreaterThan( + 16, + ); + }, + ); + }, + ); }); it("Unloads cached tiles outside of the view frustum using cacheBytes", function () { - return Cesium3DTilesTester.loadTileset(scene, tilesetUrl).then(function ( - tileset - ) { - tileset.cacheBytes = 0; + return Cesium3DTilesTester.loadTileset(scene, tilesetUrl).then( + function (tileset) { + tileset.cacheBytes = 0; - scene.renderForSpecs(); - const statistics = tileset._statistics; - expect(statistics.numberOfCommands).toEqual(5); - expect(statistics.numberOfTilesWithContentReady).toEqual(5); + scene.renderForSpecs(); + const statistics = tileset._statistics; + expect(statistics.numberOfCommands).toEqual(5); + expect(statistics.numberOfTilesWithContentReady).toEqual(5); - viewSky(); + viewSky(); - // All tiles are unloaded - scene.renderForSpecs(); - expect(statistics.numberOfCommands).toEqual(0); - expect(statistics.numberOfTilesWithContentReady).toEqual(0); + // All tiles are unloaded + scene.renderForSpecs(); + expect(statistics.numberOfCommands).toEqual(0); + expect(statistics.numberOfTilesWithContentReady).toEqual(0); - // Reset camera so all tiles are reloaded - viewAllTiles(); + // Reset camera so all tiles are reloaded + viewAllTiles(); - return Cesium3DTilesTester.waitForTilesLoaded(scene, tileset).then( - function () { - expect(statistics.numberOfCommands).toEqual(5); - expect(statistics.numberOfTilesWithContentReady).toEqual(5); - } - ); - }); + return Cesium3DTilesTester.waitForTilesLoaded(scene, tileset).then( + function () { + expect(statistics.numberOfCommands).toEqual(5); + expect(statistics.numberOfTilesWithContentReady).toEqual(5); + }, + ); + }, + ); }); it("Unloads cached tiles in a tileset with external tileset JSON file using cacheBytes", function () { @@ -3682,9 +3689,9 @@ describe( expect(statistics.numberOfTilesWithContentReady).toEqual(5); expect(cacheList.length - 1).toEqual(5); - } + }, ); - } + }, ); }); @@ -3713,9 +3720,9 @@ describe( function () { expect(statistics.numberOfCommands).toEqual(4); expect(statistics.numberOfTilesWithContentReady).toEqual(4); - } + }, ); - } + }, ); }); @@ -3728,7 +3735,7 @@ describe( // return Cesium3DTilesTester.loadTileset( scene, - tilesetReplacement1Url + tilesetReplacement1Url, ).then(function (tileset) { tileset.cacheBytes = 0; // Only root needs to be visible @@ -3755,74 +3762,74 @@ describe( function () { expect(statistics.numberOfCommands).toEqual(4); expect(statistics.numberOfTilesWithContentReady).toEqual(5); - } + }, ); }); }); it("Explicitly unloads cached tiles with trimLoadedTiles", function () { - return Cesium3DTilesTester.loadTileset(scene, tilesetUrl).then(function ( - tileset - ) { - tileset.cacheBytes = 0.05 * 1024 * 1024; + return Cesium3DTilesTester.loadTileset(scene, tilesetUrl).then( + function (tileset) { + tileset.cacheBytes = 0.05 * 1024 * 1024; - // Render parent and four children (using additive refinement) - viewAllTiles(); - scene.renderForSpecs(); + // Render parent and four children (using additive refinement) + viewAllTiles(); + scene.renderForSpecs(); - const statistics = tileset._statistics; - expect(statistics.numberOfCommands).toEqual(5); - expect(statistics.numberOfTilesWithContentReady).toEqual(5); // Five loaded tiles + const statistics = tileset._statistics; + expect(statistics.numberOfCommands).toEqual(5); + expect(statistics.numberOfTilesWithContentReady).toEqual(5); // Five loaded tiles - // Zoom out so only root tile is needed to meet SSE. The children - // are not unloaded since max number of loaded tiles is five. - viewRootOnly(); - scene.renderForSpecs(); + // Zoom out so only root tile is needed to meet SSE. The children + // are not unloaded since max number of loaded tiles is five. + viewRootOnly(); + scene.renderForSpecs(); - expect(statistics.numberOfCommands).toEqual(1); - expect(statistics.numberOfTilesWithContentReady).toEqual(5); + expect(statistics.numberOfCommands).toEqual(1); + expect(statistics.numberOfTilesWithContentReady).toEqual(5); - tileset.trimLoadedTiles(); - scene.renderForSpecs(); + tileset.trimLoadedTiles(); + scene.renderForSpecs(); - expect(statistics.numberOfCommands).toEqual(1); - expect(statistics.numberOfTilesWithContentReady).toEqual(1); - }); + expect(statistics.numberOfCommands).toEqual(1); + expect(statistics.numberOfTilesWithContentReady).toEqual(1); + }, + ); }); it("tileUnload event is raised", function () { - return Cesium3DTilesTester.loadTileset(scene, tilesetUrl).then(function ( - tileset - ) { - tileset.cacheBytes = 0; + return Cesium3DTilesTester.loadTileset(scene, tilesetUrl).then( + function (tileset) { + tileset.cacheBytes = 0; - // Render parent and four children (using additive refinement) - viewAllTiles(); - scene.renderForSpecs(); + // Render parent and four children (using additive refinement) + viewAllTiles(); + scene.renderForSpecs(); - const statistics = tileset._statistics; - expect(statistics.numberOfCommands).toEqual(5); - expect(statistics.numberOfTilesWithContentReady).toEqual(5); // Five loaded tiles + const statistics = tileset._statistics; + expect(statistics.numberOfCommands).toEqual(5); + expect(statistics.numberOfTilesWithContentReady).toEqual(5); // Five loaded tiles - // Zoom out so only root tile is needed to meet SSE. All the - // children are unloaded since max number of loaded tiles is one. - viewRootOnly(); - const spyUpdate = jasmine.createSpy("listener"); - tileset.tileUnload.addEventListener(spyUpdate); - scene.renderForSpecs(); + // Zoom out so only root tile is needed to meet SSE. All the + // children are unloaded since max number of loaded tiles is one. + viewRootOnly(); + const spyUpdate = jasmine.createSpy("listener"); + tileset.tileUnload.addEventListener(spyUpdate); + scene.renderForSpecs(); - expect( - tileset.root.visibility( - scene.frameState, - CullingVolume.MASK_INDETERMINATE - ) - ).not.toEqual(CullingVolume.MASK_OUTSIDE); - expect(spyUpdate.calls.count()).toEqual(4); - expect(spyUpdate.calls.argsFor(0)[0]).toBe(tileset.root.children[0]); - expect(spyUpdate.calls.argsFor(1)[0]).toBe(tileset.root.children[1]); - expect(spyUpdate.calls.argsFor(2)[0]).toBe(tileset.root.children[2]); - expect(spyUpdate.calls.argsFor(3)[0]).toBe(tileset.root.children[3]); - }); + expect( + tileset.root.visibility( + scene.frameState, + CullingVolume.MASK_INDETERMINATE, + ), + ).not.toEqual(CullingVolume.MASK_OUTSIDE); + expect(spyUpdate.calls.count()).toEqual(4); + expect(spyUpdate.calls.argsFor(0)[0]).toBe(tileset.root.children[0]); + expect(spyUpdate.calls.argsFor(1)[0]).toBe(tileset.root.children[1]); + expect(spyUpdate.calls.argsFor(2)[0]).toBe(tileset.root.children[2]); + expect(spyUpdate.calls.argsFor(3)[0]).toBe(tileset.root.children[3]); + }, + ); }); it("cacheBytes throws when negative", async function () { @@ -3854,7 +3861,7 @@ describe( const totalCommands = b3dmCommands + i3dmCommands; return Cesium3DTilesTester.loadTileset( scene, - tilesetWithTransformsUrl + tilesetWithTransformsUrl, ).then(function (tileset) { const statistics = tileset._statistics; const root = tileset.root; @@ -3865,7 +3872,7 @@ describe( let computedTransform = Matrix4.multiply( rootTransform, childTransform, - new Matrix4() + new Matrix4(), ); expect(statistics.numberOfCommands).toBe(totalCommands); @@ -3874,20 +3881,20 @@ describe( // Set the tileset's modelMatrix const tilesetTransform = Matrix4.fromTranslation( - new Cartesian3(0.0, 1.0, 0.0) + new Cartesian3(0.0, 1.0, 0.0), ); tileset.modelMatrix = tilesetTransform; computedTransform = Matrix4.multiply( tilesetTransform, computedTransform, - computedTransform + computedTransform, ); scene.renderForSpecs(); expect(child.computedTransform).toEqual(computedTransform); // Set the modelMatrix somewhere off screen tileset.modelMatrix = Matrix4.fromTranslation( - new Cartesian3(0.0, 100000.0, 0.0) + new Cartesian3(0.0, 100000.0, 0.0), ); scene.renderForSpecs(); expect(statistics.numberOfCommands).toBe(0); @@ -3899,7 +3906,7 @@ describe( // Do the same steps for a tile transform child.transform = Matrix4.fromTranslation( - new Cartesian3(0.0, 100000.0, 0.0) + new Cartesian3(0.0, 100000.0, 0.0), ); scene.renderForSpecs(); expect(statistics.numberOfCommands).toBe(1); @@ -3918,7 +3925,7 @@ describe( return Cesium3DTilesTester.loadTileset( scene, tilesetUrl, - skipLevelOfDetailOptions + skipLevelOfDetailOptions, ).then(function (tileset) { viewAllTiles(); scene.renderForSpecs(); @@ -3931,7 +3938,7 @@ describe( function (tileset) { expect(statistics.numberOfTilesWithContentReady).toEqual(5); expect(tileset.hasMixedContent).toBe(false); - } + }, ); }); }); @@ -3940,7 +3947,7 @@ describe( return Cesium3DTilesTester.loadTileset( scene, tilesetReplacement3Url, - skipLevelOfDetailOptions + skipLevelOfDetailOptions, ).then(function (tileset) { const statistics = tileset._statistics; @@ -3954,7 +3961,7 @@ describe( expect(tileset.hasMixedContent).toBe(true); expect(statistics.numberOfTilesWithContentReady).toEqual(2); expect( - tileset.root.children[0].children[0].children[3]._selectionDepth + tileset.root.children[0].children[0].children[3]._selectionDepth, ).toEqual(1); expect(tileset.root._selectionDepth).toEqual(0); @@ -3962,7 +3969,7 @@ describe( function (tileset) { expect(statistics.numberOfTilesWithContentReady).toEqual(5); expect(tileset.hasMixedContent).toBe(false); - } + }, ); }); }); @@ -3971,7 +3978,7 @@ describe( return Cesium3DTilesTester.loadTileset( scene, tilesetReplacement3Url, - skipLevelOfDetailOptions + skipLevelOfDetailOptions, ).then(function (tileset) { tileset.root.children[0].children[0].children[0].unloadContent(); tileset.root.children[0].children[0].children[1].unloadContent(); @@ -3990,7 +3997,7 @@ describe( return Cesium3DTilesTester.loadTileset( scene, tilesetReplacement3Url, - skipLevelOfDetailOptions + skipLevelOfDetailOptions, ).then(function (tileset) { const statistics = tileset._statistics; const root = tileset.root; @@ -4007,10 +4014,10 @@ describe( expect(isSelected(tileset, root)).toBe(true); expect(root._finalResolution).toBe(false); expect( - isSelected(tileset, root.children[0].children[0].children[3]) + isSelected(tileset, root.children[0].children[0].children[3]), ).toBe(true); expect(root.children[0].children[0].children[3]._finalResolution).toBe( - true + true, ); expect(tileset.hasMixedContent).toBe(true); @@ -4028,7 +4035,7 @@ describe( return Cesium3DTilesTester.loadTileset( scene, tilesetReplacement3Url, - skipLevelOfDetailOptions + skipLevelOfDetailOptions, ).then(function (tileset) { const statistics = tileset._statistics; const root = tileset.root; @@ -4045,16 +4052,16 @@ describe( expect(isSelected(tileset, root)).toBe(true); expect(root._finalResolution).toBe(true); expect( - isSelected(tileset, root.children[0].children[0].children[0]) + isSelected(tileset, root.children[0].children[0].children[0]), ).toBe(false); expect( - isSelected(tileset, root.children[0].children[0].children[1]) + isSelected(tileset, root.children[0].children[0].children[1]), ).toBe(false); expect( - isSelected(tileset, root.children[0].children[0].children[2]) + isSelected(tileset, root.children[0].children[0].children[2]), ).toBe(false); expect( - isSelected(tileset, root.children[0].children[0].children[3]) + isSelected(tileset, root.children[0].children[0].children[3]), ).toBe(false); expect(tileset.hasMixedContent).toBe(false); @@ -4078,11 +4085,11 @@ describe( return Cesium3DTilesTester.loadTileset( scene, tilesetReplacement3Url, - skipLevelOfDetailOptions + skipLevelOfDetailOptions, ).then(function (tileset) { const statistics = tileset._statistics; expect(statistics.numberOfCommands).toEqual( - tileset._selectedTiles.length + tileset._selectedTiles.length, ); const commandList = scene.frameState.commandList; @@ -4109,7 +4116,7 @@ describe( return Cesium3DTilesTester.waitForTilesLoaded(scene, tileset).then( function (tileset) { expect(statistics.numberOfTilesWithContentReady).toBe(5); - } + }, ); }); }); @@ -4139,9 +4146,9 @@ describe( function (tileset) { expect(!isSelected(tileset, child)); expect(isSelected(tileset, root)); - } + }, ); - } + }, ); }); }); @@ -4150,7 +4157,7 @@ describe( return Cesium3DTilesTester.loadTileset( scene, tilesetOfTilesetsUrl, - skipLevelOfDetailOptions + skipLevelOfDetailOptions, ).then(function (tileset) { const statistics = tileset._statistics; const parent = tileset.root.children[0]; @@ -4181,7 +4188,7 @@ describe( data, headers, deferred, - overrideMimeType + overrideMimeType, ) { Resource._DefaultImplementations.loadWithXhr( batchedColorsB3dmUrl, @@ -4190,9 +4197,9 @@ describe( data, headers, deferred, - overrideMimeType + overrideMimeType, ); - } + }, ); const tile = tileset.root; const statistics = tileset._statistics; @@ -4204,10 +4211,10 @@ describe( const expireDate = JulianDate.addSeconds( JulianDate.now(), 5.0, - new JulianDate() + new JulianDate(), ); expect( - JulianDate.secondsDifference(tile.expireDate, expireDate) + JulianDate.secondsDifference(tile.expireDate, expireDate), ).toEqualEpsilon(0.0, CesiumMath.EPSILON1); expect(tile.expireDuration).toBe(5.0); expect(tile.contentExpired).toBe(false); @@ -4223,7 +4230,7 @@ describe( tile.expireDate = JulianDate.addSeconds( JulianDate.now(), -1.0, - new JulianDate() + new JulianDate(), ); // Stays in the expired state until the request goes through @@ -4249,8 +4256,8 @@ describe( expect(tile._expiredContent).toBeDefined(); // Still holds onto expired content until the content state is READY // Check that url contains a query param with the timestamp - const url = Resource._Implementations.loadWithXhr.calls.first() - .args[0]; + const url = + Resource._Implementations.loadWithXhr.calls.first().args[0]; expect(url.indexOf("expired=") >= 0).toBe(true); // statistics are still the same @@ -4274,7 +4281,7 @@ describe( return Cesium3DTilesTester.waitForTilesLoaded(scene, tileset); }); - } + }, ); }); @@ -4289,33 +4296,35 @@ describe( it("tile with tileset content expires", function () { return Cesium3DTilesTester.loadTileset( scene, - tilesetSubtreeExpirationUrl + tilesetSubtreeExpirationUrl, ).then(async function (tileset) { // Intercept the request and load a subtree with one less child. Still want to make an actual request to simulate // real use cases instead of immediately returning a pre-created array buffer. - spyOn(Resource._Implementations, "loadWithXhr").and.callFake(function ( - url, - responseType, - method, - data, - headers, - deferred, - overrideMimeType - ) { - const newDeferred = defer(); - Resource._DefaultImplementations.loadWithXhr( - tilesetSubtreeUrl, + spyOn(Resource._Implementations, "loadWithXhr").and.callFake( + function ( + url, responseType, method, data, headers, - newDeferred, - overrideMimeType - ); - newDeferred.promise.then(function (arrayBuffer) { - deferred.resolve(modifySubtreeBuffer(arrayBuffer)); - }); - }); + deferred, + overrideMimeType, + ) { + const newDeferred = defer(); + Resource._DefaultImplementations.loadWithXhr( + tilesetSubtreeUrl, + responseType, + method, + data, + headers, + newDeferred, + overrideMimeType, + ); + newDeferred.promise.then(function (arrayBuffer) { + deferred.resolve(modifySubtreeBuffer(arrayBuffer)); + }); + }, + ); const subtreeRoot = tileset.root.children[0]; const subtreeChildren = subtreeRoot.children[0].children; @@ -4331,7 +4340,7 @@ describe( subtreeRoot.expireDate = JulianDate.addSeconds( JulianDate.now(), -1.0, - new JulianDate() + new JulianDate(), ); // Listen to tile unload events @@ -4367,7 +4376,7 @@ describe( it("tile expires and request fails", async function () { const tileset = await Cesium3DTilesTester.loadTileset( scene, - batchedExpirationUrl + batchedExpirationUrl, ); spyOn(Resource.prototype, "fetchArrayBuffer").and.callFake(() => { return Promise.reject(new Error("404")); @@ -4379,7 +4388,7 @@ describe( tile.expireDate = JulianDate.addSeconds( JulianDate.now(), -1.0, - new JulianDate() + new JulianDate(), ); const failedSpy = jasmine.createSpy("listenerSpy"); @@ -4396,48 +4405,48 @@ describe( expect(failedSpy).toHaveBeenCalledWith( jasmine.objectContaining({ message: "404", - }) + }), ); expect(statistics.numberOfCommands).toBe(0); expect(statistics.numberOfTilesTotal).toBe(1); }); it("tile expiration date", function () { - return Cesium3DTilesTester.loadTileset(scene, tilesetUrl).then(function ( - tileset - ) { - const tile = tileset.root; + return Cesium3DTilesTester.loadTileset(scene, tilesetUrl).then( + function (tileset) { + const tile = tileset.root; - // Trigger expiration to happen next frame - tile.expireDate = JulianDate.addSeconds( - JulianDate.now(), - -1.0, - new JulianDate() - ); + // Trigger expiration to happen next frame + tile.expireDate = JulianDate.addSeconds( + JulianDate.now(), + -1.0, + new JulianDate(), + ); - // Stays in the expired state until the request goes through - const originalMaxmimumRequests = RequestScheduler.maximumRequests; - RequestScheduler.maximumRequests = 0; // Artificially limit Request Scheduler so the request won't go through - scene.renderForSpecs(); - RequestScheduler.maximumRequests = originalMaxmimumRequests; + // Stays in the expired state until the request goes through + const originalMaxmimumRequests = RequestScheduler.maximumRequests; + RequestScheduler.maximumRequests = 0; // Artificially limit Request Scheduler so the request won't go through + scene.renderForSpecs(); + RequestScheduler.maximumRequests = originalMaxmimumRequests; - expect(tile.contentExpired).toBe(true); + expect(tile.contentExpired).toBe(true); - return pollToPromise(function () { - scene.renderForSpecs(); - return tile.contentReady; - }).then(function () { - scene.renderForSpecs(); - expect(tile._expiredContent).toBeUndefined(); - expect(tile.expireDate).toBeUndefined(); - }); - }); + return pollToPromise(function () { + scene.renderForSpecs(); + return tile.contentReady; + }).then(function () { + scene.renderForSpecs(); + expect(tile._expiredContent).toBeUndefined(); + expect(tile.expireDate).toBeUndefined(); + }); + }, + ); }); it("supports content data URIs", function () { return Cesium3DTilesTester.loadTileset( scene, - tilesetUrlWithContentUri + tilesetUrlWithContentUri, ).then(function (tileset) { const statistics = tileset._statistics; expect(statistics.visited).toEqual(1); @@ -4446,25 +4455,25 @@ describe( }); it("destroys attached ClippingPlaneCollections and ClippingPlaneCollections that have been detached", function () { - return Cesium3DTilesTester.loadTileset(scene, tilesetUrl).then(function ( - tileset - ) { - const clippingPlaneCollection1 = new ClippingPlaneCollection({ - planes: [new ClippingPlane(Cartesian3.UNIT_Z, -100000000.0)], - }); - expect(clippingPlaneCollection1.owner).not.toBeDefined(); + return Cesium3DTilesTester.loadTileset(scene, tilesetUrl).then( + function (tileset) { + const clippingPlaneCollection1 = new ClippingPlaneCollection({ + planes: [new ClippingPlane(Cartesian3.UNIT_Z, -100000000.0)], + }); + expect(clippingPlaneCollection1.owner).not.toBeDefined(); - tileset.clippingPlanes = clippingPlaneCollection1; - const clippingPlaneCollection2 = new ClippingPlaneCollection({ - planes: [new ClippingPlane(Cartesian3.UNIT_Z, -100000000.0)], - }); + tileset.clippingPlanes = clippingPlaneCollection1; + const clippingPlaneCollection2 = new ClippingPlaneCollection({ + planes: [new ClippingPlane(Cartesian3.UNIT_Z, -100000000.0)], + }); - tileset.clippingPlanes = clippingPlaneCollection2; - expect(clippingPlaneCollection1.isDestroyed()).toBe(true); + tileset.clippingPlanes = clippingPlaneCollection2; + expect(clippingPlaneCollection1.isDestroyed()).toBe(true); - scene.primitives.remove(tileset); - expect(clippingPlaneCollection2.isDestroyed()).toBe(true); - }); + scene.primitives.remove(tileset); + expect(clippingPlaneCollection2.isDestroyed()).toBe(true); + }, + ); }); it("throws a DeveloperError when given a ClippingPlaneCollection attached to another Tileset", function () { @@ -4486,110 +4495,110 @@ describe( }); it("clipping planes cull hidden tiles", function () { - return Cesium3DTilesTester.loadTileset(scene, tilesetUrl).then(function ( - tileset - ) { - let visibility = tileset.root.visibility( - scene.frameState, - CullingVolume.MASK_INSIDE - ); + return Cesium3DTilesTester.loadTileset(scene, tilesetUrl).then( + function (tileset) { + let visibility = tileset.root.visibility( + scene.frameState, + CullingVolume.MASK_INSIDE, + ); - expect(visibility).not.toBe(CullingVolume.MASK_OUTSIDE); + expect(visibility).not.toBe(CullingVolume.MASK_OUTSIDE); - const plane = new ClippingPlane(Cartesian3.UNIT_Z, -100000000.0); - tileset.clippingPlanes = new ClippingPlaneCollection({ - planes: [plane], - }); + const plane = new ClippingPlane(Cartesian3.UNIT_Z, -100000000.0); + tileset.clippingPlanes = new ClippingPlaneCollection({ + planes: [plane], + }); - visibility = tileset.root.visibility( - scene.frameState, - CullingVolume.MASK_INSIDE - ); + visibility = tileset.root.visibility( + scene.frameState, + CullingVolume.MASK_INSIDE, + ); - expect(visibility).toBe(CullingVolume.MASK_OUTSIDE); + expect(visibility).toBe(CullingVolume.MASK_OUTSIDE); - plane.distance = 0.0; - visibility = tileset.root.visibility( - scene.frameState, - CullingVolume.MASK_INSIDE - ); + plane.distance = 0.0; + visibility = tileset.root.visibility( + scene.frameState, + CullingVolume.MASK_INSIDE, + ); - expect(visibility).not.toBe(CullingVolume.MASK_OUTSIDE); - }); + expect(visibility).not.toBe(CullingVolume.MASK_OUTSIDE); + }, + ); }); it("clipping planes cull hidden content", function () { - return Cesium3DTilesTester.loadTileset(scene, tilesetUrl).then(function ( - tileset - ) { - let visibility = tileset.root.contentVisibility(scene.frameState); + return Cesium3DTilesTester.loadTileset(scene, tilesetUrl).then( + function (tileset) { + let visibility = tileset.root.contentVisibility(scene.frameState); - expect(visibility).not.toBe(Intersect.OUTSIDE); + expect(visibility).not.toBe(Intersect.OUTSIDE); - const plane = new ClippingPlane(Cartesian3.UNIT_Z, -100000000.0); - tileset.clippingPlanes = new ClippingPlaneCollection({ - planes: [plane], - }); + const plane = new ClippingPlane(Cartesian3.UNIT_Z, -100000000.0); + tileset.clippingPlanes = new ClippingPlaneCollection({ + planes: [plane], + }); - visibility = tileset.root.contentVisibility(scene.frameState); + visibility = tileset.root.contentVisibility(scene.frameState); - expect(visibility).toBe(Intersect.OUTSIDE); + expect(visibility).toBe(Intersect.OUTSIDE); - plane.distance = 0.0; - visibility = tileset.root.contentVisibility(scene.frameState); + plane.distance = 0.0; + visibility = tileset.root.contentVisibility(scene.frameState); - expect(visibility).not.toBe(Intersect.OUTSIDE); - }); + expect(visibility).not.toBe(Intersect.OUTSIDE); + }, + ); }); it("clipping planes cull tiles completely inside clipping region", function () { - return Cesium3DTilesTester.loadTileset(scene, tilesetUrl).then(function ( - tileset - ) { - const statistics = tileset._statistics; - const root = tileset.root; + return Cesium3DTilesTester.loadTileset(scene, tilesetUrl).then( + function (tileset) { + const statistics = tileset._statistics; + const root = tileset.root; - scene.renderForSpecs(); + scene.renderForSpecs(); - expect(statistics.numberOfCommands).toEqual(5); + expect(statistics.numberOfCommands).toEqual(5); - tileset.update(scene.frameState); + tileset.update(scene.frameState); - const radius = 287.0736139905632; + const radius = 287.0736139905632; - const plane = new ClippingPlane(Cartesian3.UNIT_X, radius); - tileset.clippingPlanes = new ClippingPlaneCollection({ - planes: [plane], - }); + const plane = new ClippingPlane(Cartesian3.UNIT_X, radius); + tileset.clippingPlanes = new ClippingPlaneCollection({ + planes: [plane], + }); - tileset.update(scene.frameState); - scene.renderForSpecs(); + tileset.update(scene.frameState); + scene.renderForSpecs(); - expect(statistics.numberOfCommands).toEqual(5); - expect(root._isClipped).toBe(false); + expect(statistics.numberOfCommands).toEqual(5); + expect(root._isClipped).toBe(false); - plane.distance = -1; + plane.distance = -1; - tileset.update(scene.frameState); - scene.renderForSpecs(); + tileset.update(scene.frameState); + scene.renderForSpecs(); - expect(statistics.numberOfCommands).toEqual(3); - expect(root._isClipped).toBe(true); + expect(statistics.numberOfCommands).toEqual(3); + expect(root._isClipped).toBe(true); - plane.distance = -radius; + plane.distance = -radius; - tileset.update(scene.frameState); - scene.renderForSpecs(); + tileset.update(scene.frameState); + scene.renderForSpecs(); - expect(statistics.numberOfCommands).toEqual(0); - expect(root._isClipped).toBe(true); - }); + expect(statistics.numberOfCommands).toEqual(0); + expect(root._isClipped).toBe(true); + }, + ); }); it("clipping planes cull tiles completely inside clipping region for i3dm", function () { return Cesium3DTilesTester.loadTileset( scene, - tilesetWithExternalResourcesUrl + tilesetWithExternalResourcesUrl, ).then(function (tileset) { const statistics = tileset._statistics; const root = tileset.root; @@ -4639,7 +4648,7 @@ describe( let offsetMatrix = tileset.clippingPlanesOriginMatrix; expect( - Matrix4.equals(offsetMatrix, tileset.root.computedTransform) + Matrix4.equals(offsetMatrix, tileset.root.computedTransform), ).toBe(true); return Cesium3DTilesTester.loadTileset(scene, tilesetUrl).then( @@ -4648,23 +4657,23 @@ describe( // so we want to apply east-north-up as our best guess. offsetMatrix = tileset.clippingPlanesOriginMatrix; expect( - Matrix4.equals(offsetMatrix, tileset.root.computedTransform) + Matrix4.equals(offsetMatrix, tileset.root.computedTransform), ).toBe(false); // But they have the same translation. const clippingPlanesOrigin = Matrix4.getTranslation( offsetMatrix, - new Cartesian3() + new Cartesian3(), ); expect( Cartesian3.equals( tileset.root.boundingSphere.center, - clippingPlanesOrigin - ) + clippingPlanesOrigin, + ), ).toBe(true); - } + }, ); - } + }, ); }); @@ -4673,48 +4682,41 @@ describe( function (tileset) { let offsetMatrix = Matrix4.clone( tileset.clippingPlanesOriginMatrix, - new Matrix4() + new Matrix4(), ); let boundingSphereEastNorthUp = Transforms.eastNorthUpToFixedFrame( - tileset.root.boundingSphere.center + tileset.root.boundingSphere.center, ); expect(Matrix4.equals(offsetMatrix, boundingSphereEastNorthUp)).toBe( - true + true, ); // Changing the model matrix should change the clipping planes matrix tileset.modelMatrix = Matrix4.fromTranslation( - new Cartesian3(100, 0, 0) + new Cartesian3(100, 0, 0), ); scene.renderForSpecs(); expect( - Matrix4.equals(offsetMatrix, tileset.clippingPlanesOriginMatrix) + Matrix4.equals(offsetMatrix, tileset.clippingPlanesOriginMatrix), ).toBe(false); boundingSphereEastNorthUp = Transforms.eastNorthUpToFixedFrame( - tileset.root.boundingSphere.center + tileset.root.boundingSphere.center, ); offsetMatrix = tileset.clippingPlanesOriginMatrix; expect(offsetMatrix).toEqualEpsilon( boundingSphereEastNorthUp, - CesiumMath.EPSILON3 + CesiumMath.EPSILON3, ); - } + }, ); }); describe("clippingPolygons", () => { const positions = Cartesian3.fromRadiansArray([ - -1.3194369277314022, - 0.6988062530900625, - -1.31941, - 0.69879, - -1.3193955980204217, - 0.6988091578771254, - -1.3193931220959367, - 0.698743632490865, - -1.3194358224045408, - 0.6987471965556998, + -1.3194369277314022, 0.6988062530900625, -1.31941, 0.69879, + -1.3193955980204217, 0.6988091578771254, -1.3193931220959367, + 0.698743632490865, -1.3194358224045408, 0.6987471965556998, ]); let polygon; @@ -4725,7 +4727,7 @@ describe( it("destroys attached ClippingPolygonCollections and ClippingPolygonCollections that have been detached", async function () { const tileset = await Cesium3DTilesTester.loadTileset( scene, - tilesetUrl + tilesetUrl, ); const collectionA = new ClippingPolygonCollection({ polygons: [polygon], @@ -4747,12 +4749,12 @@ describe( it("throws a DeveloperError when given a ClippingPolygonCollection attached to another tileset", async function () { const tilesetA = await Cesium3DTilesTester.loadTileset( scene, - tilesetUrl + tilesetUrl, ); const tilesetB = await Cesium3DTilesTester.loadTileset( scene, - tilesetUrl + tilesetUrl, ); const collection = new ClippingPolygonCollection({ @@ -4772,7 +4774,7 @@ describe( const tileset = await Cesium3DTilesTester.loadTileset( scene, - tilesetUrl + tilesetUrl, ); let visibility = tileset.root.contentVisibility(scene.frameState); @@ -4797,13 +4799,13 @@ describe( }); it("throws if pointCloudShading is set to undefined", function () { - return Cesium3DTilesTester.loadTileset(scene, tilesetUrl).then(function ( - tileset - ) { - expect(function () { - tileset.pointCloudShading = undefined; - }).toThrowDeveloperError(); - }); + return Cesium3DTilesTester.loadTileset(scene, tilesetUrl).then( + function (tileset) { + expect(function () { + tileset.pointCloudShading = undefined; + }).toThrowDeveloperError(); + }, + ); }); describe("updateForPass", function () { @@ -4813,7 +4815,7 @@ describe( const passCullingVolume = passCamera.frustum.computeCullingVolume( passCamera.positionWC, passCamera.directionWC, - passCamera.upWC + passCamera.upWC, ); viewNothing(); // Main camera views nothing, pass camera views all tiles @@ -4828,7 +4830,7 @@ describe( expect(tileset.statistics.selected).toBe(0); tileset.updateForPass(scene.frameState, preloadFlightPassState); expect(tileset._requestedTiles.length).toBe(5); - } + }, ); }); @@ -4846,7 +4848,7 @@ describe( function (tileset) { tileset.updateForPass(scene.frameState, renderPassState); expect(passCommandList.length).toBe(5); - } + }, ); }); @@ -4915,7 +4917,7 @@ describe( const centerCartographic = new Cartographic( -1.3196799798348215, 0.6988740001506679, - 2.4683731133709323 + 2.4683731133709323, ); const cartographics = [centerCartographic]; @@ -4924,7 +4926,7 @@ describe( return sampleHeightMostDetailed(cartographics).then(function () { expect(centerCartographic.height).toEqualEpsilon( 2.47, - CesiumMath.EPSILON1 + CesiumMath.EPSILON1, ); const statisticsMostDetailedPick = tileset._statisticsPerPass[Cesium3DTilePass.MOST_DETAILED_PICK]; @@ -4932,14 +4934,14 @@ describe( tileset._statisticsPerPass[Cesium3DTilePass.RENDER]; expect(statisticsMostDetailedPick.numberOfCommands).toBe(1); expect( - statisticsMostDetailedPick.numberOfTilesWithContentReady + statisticsMostDetailedPick.numberOfTilesWithContentReady, ).toBe(1); expect(statisticsMostDetailedPick.selected).toBe(1); expect(statisticsMostDetailedPick.visited).toBeGreaterThan(1); expect(statisticsMostDetailedPick.numberOfTilesTotal).toBe(21); expect(statisticsRender.selected).toBe(0); }); - } + }, ); }); @@ -4954,7 +4956,7 @@ describe( const centerCartographic = new Cartographic( -1.3196799798348215, 0.6988740001506679, - 2.4683731133709323 + 2.4683731133709323, ); const cartographics = [centerCartographic]; @@ -4963,7 +4965,7 @@ describe( return sampleHeightMostDetailed(cartographics).then(function () { expect(centerCartographic.height).toEqualEpsilon( 2.47, - CesiumMath.EPSILON1 + CesiumMath.EPSILON1, ); const statisticsMostDetailedPick = tileset._statisticsPerPass[Cesium3DTilePass.MOST_DETAILED_PICK]; @@ -4971,14 +4973,14 @@ describe( tileset._statisticsPerPass[Cesium3DTilePass.RENDER]; expect(statisticsMostDetailedPick.numberOfCommands).toBe(1); expect( - statisticsMostDetailedPick.numberOfTilesWithContentReady + statisticsMostDetailedPick.numberOfTilesWithContentReady, ).toBeGreaterThan(1); expect(statisticsMostDetailedPick.selected).toBe(1); expect(statisticsMostDetailedPick.visited).toBeGreaterThan(1); expect(statisticsMostDetailedPick.numberOfTilesTotal).toBe(21); expect(statisticsRender.selected).toBeGreaterThan(0); }); - } + }, ); }); @@ -5000,7 +5002,7 @@ describe( const offcenterCartographic = new Cartographic( -1.3196754112739246, 0.6988705057695633, - 2.467395745774971 + 2.467395745774971, ); const cartographics = [offcenterCartographic]; @@ -5011,17 +5013,17 @@ describe( tileset._statisticsPerPass[Cesium3DTilePass.MOST_DETAILED_PICK]; expect(offcenterCartographic.height).toEqualEpsilon( 7.407, - CesiumMath.EPSILON1 + CesiumMath.EPSILON1, ); expect(statistics.numberOfCommands).toBe(3); // One for each level of the tree expect( - statistics.numberOfTilesWithContentReady + statistics.numberOfTilesWithContentReady, ).toBeGreaterThanOrEqual(3); expect(statistics.selected).toBe(3); expect(statistics.visited).toBeGreaterThan(3); expect(statistics.numberOfTilesTotal).toBe(21); }); - } + }, ); }); @@ -5046,16 +5048,16 @@ describe( return drillPickFromRayMostDetailed(ray).then(function (results) { expect(results.length).toBe(3); expect( - results[0].object.content.url.indexOf("0_0_0.b3dm") > -1 + results[0].object.content.url.indexOf("0_0_0.b3dm") > -1, ).toBe(true); expect( - results[1].object.content.url.indexOf("1_1_1.b3dm") > -1 + results[1].object.content.url.indexOf("1_1_1.b3dm") > -1, ).toBe(true); expect( - results[2].object.content.url.indexOf("2_4_4.b3dm") > -1 + results[2].object.content.url.indexOf("2_4_4.b3dm") > -1, ).toBe(true); }); - } + }, ); }); @@ -5067,7 +5069,7 @@ describe( const centerCartographic = new Cartographic( -1.3196799798348215, 0.6988740001506679, - 2.4683731133709323 + 2.4683731133709323, ); const cartographics = [centerCartographic]; return Cesium3DTilesTester.loadTileset(scene, tilesetUniform).then( @@ -5076,10 +5078,10 @@ describe( return sampleHeightMostDetailed(cartographics).then(function () { expect(centerCartographic.height).toEqualEpsilon( 2.47, - CesiumMath.EPSILON1 + CesiumMath.EPSILON1, ); }); - } + }, ); }); @@ -5092,15 +5094,15 @@ describe( const centerCartographic = new Cartographic( -1.3196799798348215, - 0.6988740001506679 + 0.6988740001506679, ); const offcenterCartographic = new Cartographic( -1.3196754112739246, - 0.6988705057695633 + 0.6988705057695633, ); const missCartographic = new Cartographic( -1.3196096042084076, - 0.6988703290845706 + 0.6988703290845706, ); const cartographics = [ centerCartographic, @@ -5113,11 +5115,11 @@ describe( return sampleHeightMostDetailed(cartographics).then(function () { expect(centerCartographic.height).toEqualEpsilon( 2.47, - CesiumMath.EPSILON1 + CesiumMath.EPSILON1, ); expect(offcenterCartographic.height).toEqualEpsilon( 2.47, - CesiumMath.EPSILON1 + CesiumMath.EPSILON1, ); expect(missCartographic.height).toBeUndefined(); @@ -5125,7 +5127,7 @@ describe( tileset._statisticsPerPass[Cesium3DTilePass.MOST_DETAILED_PICK]; expect(statistics.numberOfTilesWithContentReady).toBe(2); }); - } + }, ); }); }); @@ -5162,7 +5164,7 @@ describe( allCancelled = allCancelled && tile._request.cancelled; } expect(allCancelled).toBe(true); - } + }, ); }); @@ -5192,7 +5194,7 @@ describe( expect(lastPriority).not.toEqual(requestedTilesInFlight[0]._priority); // Not all the same value return Cesium3DTilesTester.waitForTilesLoaded(scene, tileset); - } + }, ); }); @@ -5218,7 +5220,7 @@ describe( expect(requestedTilesInFlight[0].priorityDeferred).toBe(true); return Cesium3DTilesTester.waitForTilesLoaded(scene, tileset); - } + }, ); }); @@ -5246,12 +5248,12 @@ describe( return tileset._requestedTilesInFlight.length !== 0; }).then(function () { expect(tileset._requestedTilesInFlight[0].priorityDeferred).toBe( - true + true, ); return Cesium3DTilesTester.waitForTilesLoaded(scene, tileset); }); - } + }, ); }); @@ -5259,11 +5261,12 @@ describe( // Flight destination viewAllTiles(); scene.preloadFlightCamera = Camera.clone(scene.camera); - scene.preloadFlightCullingVolume = scene.camera.frustum.computeCullingVolume( - scene.camera.positionWC, - scene.camera.directionWC, - scene.camera.upWC - ); + scene.preloadFlightCullingVolume = + scene.camera.frustum.computeCullingVolume( + scene.camera.positionWC, + scene.camera.directionWC, + scene.camera.upWC, + ); // Reset view viewNothing(); @@ -5276,7 +5279,7 @@ describe( scene.renderForSpecs(); expect(tileset._requestedTilesInFlight.length).toBeGreaterThan(0); return Cesium3DTilesTester.waitForTilesLoaded(scene, tileset); - } + }, ); }); @@ -5288,7 +5291,7 @@ describe( viewAllTiles(); scene.renderForSpecs(); expect(tileset._requestedTilesInFlight.length).toEqual(0); // Big camera delta so no fetches should occur. - } + }, ); }); @@ -5302,7 +5305,7 @@ describe( scene.renderForSpecs(); expect(tileset._requestedTilesInFlight.length).toEqual(2); return Cesium3DTilesTester.waitForTilesLoaded(scene, tileset); - } + }, ); }); @@ -5320,14 +5323,14 @@ describe( scene.renderForSpecs(); expect(tileset.statistics.selected).toBe(selectedLength); expect(tileset.statistics.numberOfPendingRequests).toBe(0); - } + }, ); }); it("displays copyrights for all glTF content", function () { return Cesium3DTilesTester.loadTileset( scene, - gltfContentWithCopyrightUrl + gltfContentWithCopyrightUrl, ).then(function (tileset) { setZoom(10.0); scene.renderForSpecs(); @@ -5357,7 +5360,7 @@ describe( it("displays copyrights only for glTF content in view", function () { return Cesium3DTilesTester.loadTileset( scene, - gltfContentWithCopyrightUrl + gltfContentWithCopyrightUrl, ).then(function (tileset) { const creditDisplay = scene.frameState.creditDisplay; const credits = creditDisplay._currentFrameCredits.lightboxCredits; @@ -5375,10 +5378,10 @@ describe( scene.renderForSpecs(); expect(credits.values.length).toEqual(2); expect(credits.values[0].credit.html).toEqual( - "Lower Right Copyright 1" + "Lower Right Copyright 1", ); expect(credits.values[1].credit.html).toEqual( - "Lower Right Copyright 2" + "Lower Right Copyright 2", ); setZoom(10.0); @@ -5400,7 +5403,7 @@ describe( it("displays copyrights for glTF content in sorted order", function () { return Cesium3DTilesTester.loadTileset( scene, - gltfContentWithRepeatedCopyrightsUrl + gltfContentWithRepeatedCopyrightsUrl, ).then(function (tileset) { setZoom(10.0); scene.renderForSpecs(); @@ -5438,7 +5441,7 @@ describe( return Cesium3DTilesTester.loadTileset( scene, gltfContentWithCopyrightUrl, - options + options, ).then(function (tileset) { setZoom(10.0); scene.renderForSpecs(); @@ -5471,7 +5474,7 @@ describe( return Cesium3DTilesTester.loadTileset( scene, gltfContentWithCopyrightUrl, - options + options, ).then(function (tileset) { setZoom(10.0); scene.renderForSpecs(); @@ -5542,14 +5545,14 @@ describe( expect(statistics.visited).toEqual(6); // the implicit placeholder tile is not rendered expect(statistics.numberOfCommands).toEqual(5); - } + }, ); }); it("renders tileset with JSON subtree file", function () { return Cesium3DTilesTester.loadTileset( scene, - implicitTilesetWithJsonUrl + implicitTilesetWithJsonUrl, ).then(function (tileset) { const statistics = tileset._statistics; // root + implicit placeholder + 4 child tiles @@ -5567,8 +5570,8 @@ describe( expect( endsWith( implicitTile._contentResource.url, - "subtrees/0/0/0/0.subtree" - ) + "subtrees/0/0/0/0.subtree", + ), ).toEqual(true); expect(implicitTile.implicitTileset).toBeDefined(); expect(implicitTile.implicitCoordinates).toBeDefined(); @@ -5576,7 +5579,7 @@ describe( expect(implicitTile.implicitCoordinates.x).toEqual(0); expect(implicitTile.implicitCoordinates.y).toEqual(0); expect(implicitTile.implicitCoordinates.z).toEqual(0); - } + }, ); }); @@ -5589,15 +5592,15 @@ describe( expect( endsWith( implicitTile._contentResource.url, - "subtrees/0/0/0.subtree" - ) + "subtrees/0/0/0.subtree", + ), ).toEqual(true); expect(implicitTile.implicitTileset).toBeDefined(); expect(implicitTile.implicitCoordinates).toBeDefined(); expect(implicitTile.implicitCoordinates.level).toEqual(0); expect(implicitTile.implicitCoordinates.x).toEqual(0); expect(implicitTile.implicitCoordinates.y).toEqual(0); - } + }, ); }); @@ -5624,7 +5627,7 @@ describe( tileset.debugShowUrl = false; scene.renderForSpecs(); expect(tileset._tileDebugLabels).not.toBeDefined(); - } + }, ); }); }); @@ -5642,7 +5645,7 @@ describe( it("renders tileset (legacy)", function () { return Cesium3DTilesTester.loadTileset( scene, - implicitTilesetLegacyUrl + implicitTilesetLegacyUrl, ).then(function (tileset) { const statistics = tileset._statistics; // root + implicit placeholder + 4 child tiles @@ -5655,7 +5658,7 @@ describe( it("renders tileset with JSON subtree file (legacy)", function () { return Cesium3DTilesTester.loadTileset( scene, - implicitTilesetWithJsonLegacyUrl + implicitTilesetWithJsonLegacyUrl, ).then(function (tileset) { const statistics = tileset._statistics; // root + implicit placeholder + 4 child tiles @@ -5669,14 +5672,14 @@ describe( viewNothing(); return Cesium3DTilesTester.loadTileset( scene, - implicitRootLegacyUrl + implicitRootLegacyUrl, ).then(function (tileset) { const implicitTile = tileset.root; expect( endsWith( implicitTile._contentResource.url, - "subtrees/0/0/0/0.subtree" - ) + "subtrees/0/0/0/0.subtree", + ), ).toEqual(true); expect(implicitTile.implicitTileset).toBeDefined(); expect(implicitTile.implicitCoordinates).toBeDefined(); @@ -5691,15 +5694,15 @@ describe( viewNothing(); return Cesium3DTilesTester.loadTileset( scene, - implicitChildLegacyUrl + implicitChildLegacyUrl, ).then(function (tileset) { const parentTile = tileset.root; const implicitTile = parentTile.children[0]; expect( endsWith( implicitTile._contentResource.url, - "subtrees/0/0/0.subtree" - ) + "subtrees/0/0/0.subtree", + ), ).toEqual(true); expect(implicitTile.implicitTileset).toBeDefined(); expect(implicitTile.implicitCoordinates).toBeDefined(); @@ -5712,7 +5715,7 @@ describe( it("debugShowUrl works for implicit tiling (legacy)", function () { return Cesium3DTilesTester.loadTileset( scene, - implicitTilesetLegacyUrl + implicitTilesetLegacyUrl, ).then(function (tileset) { tileset.debugShowUrl = true; scene.renderForSpecs(); @@ -5752,7 +5755,7 @@ describe( expect(statistics.numberOfPendingRequests).toBe(0); expect(statistics.numberOfTilesProcessing).toBe(0); expect(statistics.numberOfTilesWithContentReady).toBe(1); - } + }, ); }); @@ -5819,8 +5822,9 @@ describe( expect(statistics.numberOfTilesProcessing).toBe(0); expect(statistics.numberOfTilesWithContentReady).toBe(0); - RequestScheduler.maximumRequestsPerServer = oldMaximumRequestsPerServer; - } + RequestScheduler.maximumRequestsPerServer = + oldMaximumRequestsPerServer; + }, ); }); @@ -5828,7 +5832,7 @@ describe( viewNothing(); const tileset = await Cesium3DTilesTester.loadTileset( scene, - multipleContentsUrl + multipleContentsUrl, ); let callCount = 0; tileset.tileFailed.addEventListener(function (event) { @@ -5873,7 +5877,7 @@ describe( it("verify multiple content statistics", async function () { const tileset = await Cesium3DTileset.fromUrl( multipleContentsUrl, - options + options, ); scene.primitives.add(tileset); @@ -5923,9 +5927,9 @@ describe( for (let i = 0; i < expected.length; i++) { expect(endsWith(uris[i], expected[i])).toBe(true); } - } + }, ); - } + }, ); }); @@ -5955,7 +5959,7 @@ describe( errorCount++; expect(endsWith(event.url, ".json")).toBe(true); expect(event.message).toEqual( - "External tilesets are disallowed inside multiple contents" + "External tilesets are disallowed inside multiple contents", ); }); scene.primitives.add(tileset); @@ -5993,7 +5997,7 @@ describe( tileset.debugShowUrl = false; scene.renderForSpecs(); expect(tileset._tileDebugLabels).not.toBeDefined(); - } + }, ); }); @@ -6008,14 +6012,14 @@ describe( const statistics = tileset._statistics; expect(statistics.visited).toEqual(1); expect(statistics.numberOfCommands).toEqual(totalCommands); - } + }, ); }); it("renders implicit tileset with multiple contents", function () { return Cesium3DTilesTester.loadTileset( scene, - implicitMultipleContentsUrl + implicitMultipleContentsUrl, ).then(function (tileset) { scene.renderForSpecs(); const statistics = tileset._statistics; @@ -6042,7 +6046,7 @@ describe( it("request statistics are updated correctly on success (legacy)", function () { return Cesium3DTilesTester.loadTileset( scene, - multipleContentsLegacyUrl + multipleContentsLegacyUrl, ).then(function (tileset) { const statistics = tileset.statistics; expect(statistics.numberOfAttemptedRequests).toBe(0); @@ -6070,7 +6074,7 @@ describe( viewNothing(); const tileset = await Cesium3DTilesTester.loadTileset( scene, - multipleContentsLegacyUrl + multipleContentsLegacyUrl, ); viewAllTiles(); scene.renderForSpecs(); @@ -6104,7 +6108,7 @@ describe( viewNothing(); return Cesium3DTilesTester.loadTileset( scene, - multipleContentsLegacyUrl + multipleContentsLegacyUrl, ).then(function (tileset) { const oldMaximumRequestsPerServer = RequestScheduler.maximumRequestsPerServer; @@ -6119,7 +6123,8 @@ describe( expect(statistics.numberOfTilesProcessing).toBe(0); expect(statistics.numberOfTilesWithContentReady).toBe(0); - RequestScheduler.maximumRequestsPerServer = oldMaximumRequestsPerServer; + RequestScheduler.maximumRequestsPerServer = + oldMaximumRequestsPerServer; }); }); @@ -6127,7 +6132,7 @@ describe( viewNothing(); const tileset = await Cesium3DTilesTester.loadTileset( scene, - multipleContentsLegacyUrl + multipleContentsLegacyUrl, ); let callCount = 0; tileset.tileFailed.addEventListener(function (event) { @@ -6171,7 +6176,7 @@ describe( it("verify multiple content statistics (legacy)", async function () { const tileset = await Cesium3DTileset.fromUrl( multipleContentsLegacyUrl, - options + options, ); scene.primitives.add(tileset); @@ -6205,7 +6210,7 @@ describe( viewNothing(); return Cesium3DTilesTester.loadTileset( scene, - multipleContentsLegacyUrl + multipleContentsLegacyUrl, ).then(function (tileset) { tileset.tileFailed.addEventListener(function (event) { uris.push(event.url); @@ -6225,7 +6230,7 @@ describe( for (let i = 0; i < expected.length; i++) { expect(endsWith(uris[i], expected[i])).toBe(true); } - } + }, ); }); }); @@ -6263,14 +6268,14 @@ describe( viewNothing(); return Cesium3DTilesTester.loadTileset( scene, - multipleContentsLegacyUrl + multipleContentsLegacyUrl, ).then(function (tileset) { let errorCount = 0; tileset.tileFailed.addEventListener(function (event) { errorCount++; expect(endsWith(event.url, ".json")).toBe(true); expect(event.message).toEqual( - "External tilesets are disallowed inside multiple contents" + "External tilesets are disallowed inside multiple contents", ); }); @@ -6280,7 +6285,7 @@ describe( return Cesium3DTilesTester.waitForTilesLoaded(scene, tileset).then( function () { expect(errorCount).toBe(2); - } + }, ); }); }); @@ -6292,7 +6297,7 @@ describe( it("debugShowUrl lists each URI (legacy)", function () { return Cesium3DTilesTester.loadTileset( scene, - multipleContentsLegacyUrl + multipleContentsLegacyUrl, ).then(function (tileset) { tileset.debugShowUrl = true; scene.renderForSpecs(); @@ -6315,7 +6320,7 @@ describe( const totalCommands = b3dmCommands + i3dmCommands; return Cesium3DTilesTester.loadTileset( scene, - multipleContentsLegacyUrl + multipleContentsLegacyUrl, ).then(function (tileset) { const statistics = tileset._statistics; expect(statistics.visited).toEqual(1); @@ -6331,7 +6336,7 @@ describe( const totalCommands = b3dmCommands + i3dmCommands; return Cesium3DTilesTester.loadTileset( scene, - multipleContentsLegacyWithContentUrl + multipleContentsLegacyWithContentUrl, ).then(function (tileset) { const statistics = tileset._statistics; expect(statistics.visited).toEqual(1); @@ -6342,7 +6347,7 @@ describe( it("renders implicit tileset with multiple contents (legacy)", function () { return Cesium3DTilesTester.loadTileset( scene, - implicitMultipleContentsLegacyUrl + implicitMultipleContentsLegacyUrl, ).then(function (tileset) { const statistics = tileset._statistics; // implicit placeholder + transcoded root + 4 child tiles @@ -6355,7 +6360,7 @@ describe( it("renders implicit tileset with multiple contents (legacy with 'content')", function () { return Cesium3DTilesTester.loadTileset( scene, - implicitMultipleContentsLegacyWithContentUrl + implicitMultipleContentsLegacyWithContentUrl, ).then(function (tileset) { const statistics = tileset._statistics; // implicit placeholder + transcoded root + 4 child tiles @@ -6370,9 +6375,7 @@ describe( author: "Cesium", date: "2021-03-23", centerCartographic: [ - -1.3196816996258511, - 0.6988767486400521, - 45.78600543644279, + -1.3196816996258511, 0.6988767486400521, 45.78600543644279, ], tileCount: 5, }; @@ -6384,7 +6387,7 @@ describe( it("featureIdLabel sets from string", function () { return Cesium3DTilesTester.loadTileset( scene, - tilesetWithFeatureIdsUrl + tilesetWithFeatureIdsUrl, ).then(function (tileset) { expect(tileset.featureIdLabel).toBe("featureId_0"); tileset.featureIdLabel = "buildings"; @@ -6395,7 +6398,7 @@ describe( it("featureIdLabel sets from integer", function () { return Cesium3DTilesTester.loadTileset( scene, - tilesetWithFeatureIdsUrl + tilesetWithFeatureIdsUrl, ).then(function (tileset) { expect(tileset.featureIdLabel).toBe("featureId_0"); tileset.featureIdLabel = 1; @@ -6406,7 +6409,7 @@ describe( it("instanceFeatureIdLabel sets from string", function () { return Cesium3DTilesTester.loadTileset( scene, - tilesetWithFeatureIdsUrl + tilesetWithFeatureIdsUrl, ).then(function (tileset) { expect(tileset.instanceFeatureIdLabel).toBe("instanceFeatureId_0"); tileset.instanceFeatureIdLabel = "perInstance"; @@ -6417,7 +6420,7 @@ describe( it("instanceFeatureIdLabel sets from integer", function () { return Cesium3DTilesTester.loadTileset( scene, - tilesetWithFeatureIdsUrl + tilesetWithFeatureIdsUrl, ).then(function (tileset) { expect(tileset.instanceFeatureIdLabel).toBe("instanceFeatureId_0"); tileset.instanceFeatureIdLabel = 1; @@ -6458,25 +6461,25 @@ describe( return tilesetMetadata.getProperty("name"); }).toThrowDeveloperError(); expect(tilesetMetadata.getProperty("author")).toBe( - tilesetProperties.author + tilesetProperties.author, ); expect(tilesetMetadata.getPropertyBySemantic("DATE_ISO_8601")).toBe( - tilesetProperties.date + tilesetProperties.date, ); expect(tilesetMetadata.getProperty("centerCartographic")).toEqual( - Cartesian3.unpack(tilesetProperties.centerCartographic) + Cartesian3.unpack(tilesetProperties.centerCartographic), ); expect(tilesetMetadata.getProperty("tileCount")).toBe( - tilesetProperties.tileCount + tilesetProperties.tileCount, ); - } + }, ); }); it("loads group metadata", function () { return Cesium3DTilesTester.loadTileset( scene, - tilesetWithGroupMetadataUrl + tilesetWithGroupMetadataUrl, ).then(function (tileset) { const metadata = tileset.metadataExtension; expect(metadata).toBeDefined(); @@ -6502,7 +6505,7 @@ describe( it("can access group metadata through contents", function () { return Cesium3DTilesTester.loadTileset( scene, - tilesetWithGroupMetadataUrl + tilesetWithGroupMetadataUrl, ).then(function (tileset) { const metadata = tileset.metadataExtension; const commercialDistrict = metadata.groups[1]; @@ -6537,14 +6540,14 @@ describe( const classes = schema.classes; expect(classes.tileset).toBeDefined(); - } + }, ); }); it("loads metadata with external schema", function () { return Cesium3DTilesTester.loadTileset( scene, - tilesetWithExternalSchemaUrl + tilesetWithExternalSchemaUrl, ).then(function (tileset) { const schema = tileset.schema; expect(schema).toBeDefined(); @@ -6557,7 +6560,7 @@ describe( it("loads explicit tileset with tile metadata", function () { return Cesium3DTilesTester.loadTileset( scene, - tilesetWithExplicitTileMetadataUrl + tilesetWithExplicitTileMetadataUrl, ).then(function (tileset) { const expected = { "parent.b3dm": { @@ -6595,12 +6598,12 @@ describe( const metadata = tile.metadata; expect(metadata.getProperty("color")).toEqual(expectedValues.color); expect(metadata.getProperty("population")).toEqual( - expectedValues.population + expectedValues.population, ); // 25 can't be represented exactly when quantized as a UINT16 expect(metadata.getProperty("areaPercentage")).toEqualEpsilon( expectedValues.areaPercentage, - CesiumMath.EPSILON2 + CesiumMath.EPSILON2, ); }); }); @@ -6611,7 +6614,7 @@ describe( // one tile is removed return Cesium3DTilesTester.loadTileset( scene, - tilesetWithImplicitTileMetadataUrl + tilesetWithImplicitTileMetadataUrl, ).then(function (tileset) { const placeholderTile = tileset.root; @@ -6654,10 +6657,10 @@ describe( expect(metadata.getProperty("color")).not.toBeDefined(); } else { expect(metadata.getProperty("quadrant")).toBe( - expectedQuadrants[index] + expectedQuadrants[index], ); expect(metadata.getProperty("color")).toEqual( - expectedColors[index] + expectedColors[index], ); } } @@ -6668,7 +6671,7 @@ describe( spyOn(findTileMetadata, "_oneTimeWarning"); return Cesium3DTilesTester.loadTileset( scene, - tilesetWithoutRootSchemaTileMetadataUrl + tilesetWithoutRootSchemaTileMetadataUrl, ).then(function (tileset) { expect(findTileMetadata._oneTimeWarning).toHaveBeenCalledTimes(5); @@ -6684,7 +6687,7 @@ describe( it("loads explicit tileset with content metadata", function () { return Cesium3DTilesTester.loadTileset( scene, - tilesetWithExplicitContentMetadataUrl + tilesetWithExplicitContentMetadataUrl, ).then(function (tileset) { const expected = { "parent.b3dm": { @@ -6717,10 +6720,10 @@ describe( const expectedValues = expected[uri]; const metadata = content.metadata; expect(metadata.getProperty("highlightColor")).toEqual( - expectedValues.highlightColor + expectedValues.highlightColor, ); expect(metadata.getProperty("author")).toEqual( - expectedValues.author + expectedValues.author, ); }); }); @@ -6731,7 +6734,7 @@ describe( // one tile is removed return Cesium3DTilesTester.loadTileset( scene, - tilesetWithImplicitContentMetadataUrl + tilesetWithImplicitContentMetadataUrl, ).then(function (tileset) { const placeholderTile = tileset.root; @@ -6773,10 +6776,10 @@ describe( expect(metadata.getProperty("color")).not.toBeDefined(); } else { expect(metadata.getProperty("height")).toBe( - expectedHeights[index] + expectedHeights[index], ); expect(metadata.getProperty("color")).toEqual( - expectedColors[index] + expectedColors[index], ); } } @@ -6787,7 +6790,7 @@ describe( spyOn(findContentMetadata, "_oneTimeWarning"); return Cesium3DTilesTester.loadTileset( scene, - tilesetWithoutRootSchemaContentMetadataUrl + tilesetWithoutRootSchemaContentMetadataUrl, ).then(function (tileset) { expect(findContentMetadata._oneTimeWarning).toHaveBeenCalledTimes(5); @@ -6804,33 +6807,33 @@ describe( it("loads explicit tileset with multiple contents with metadata", function () { return Cesium3DTilesTester.loadTileset( scene, - tilesetWithExplicitMultipleContentsMetadataUrl + tilesetWithExplicitMultipleContentsMetadataUrl, ).then(function (tileset) { const content = tileset.root.content; const batchedContent = content.innerContents[0]; const batchedContentMetadata = batchedContent.metadata; expect(batchedContentMetadata.getProperty("highlightColor")).toEqual( - new Cartesian3(0, 0, 255) + new Cartesian3(0, 0, 255), ); expect(batchedContentMetadata.getProperty("author")).toEqual( - "Cesium" + "Cesium", ); expect(batchedContentMetadata.hasProperty("numberOfInstances")).toBe( - false + false, ); const instancedContent = content.innerContents[1]; const instancedContentMetadata = instancedContent.metadata; expect( - instancedContentMetadata.getProperty("numberOfInstances") + instancedContentMetadata.getProperty("numberOfInstances"), ).toEqual(50); expect(instancedContentMetadata.getProperty("author")).toEqual( - "Sample Author" + "Sample Author", ); expect(instancedContentMetadata.hasProperty("highlightColor")).toBe( - false + false, ); }); }); @@ -6840,7 +6843,7 @@ describe( // one tile is removed return Cesium3DTilesTester.loadTileset( scene, - tilesetWithImplicitMultipleContentsMetadataUrl + tilesetWithImplicitMultipleContentsMetadataUrl, ).then(function (tileset) { const placeholderTile = tileset.root; @@ -6893,10 +6896,10 @@ describe( } expect(buildingMetadata.getProperty("height")).toBe( - expectedHeights[index] + expectedHeights[index], ); expect(buildingMetadata.getProperty("color")).toEqual( - expectedColors[index] + expectedColors[index], ); if (i === 0) { @@ -6906,7 +6909,7 @@ describe( const treeContent = tile.content.innerContents[1]; const treeMetadata = treeContent.metadata; expect(treeMetadata.getProperty("age")).toEqual( - expectedAges[index - 1] + expectedAges[index - 1], ); } }); @@ -6936,7 +6939,7 @@ describe( it("loads tileset metadata (legacy)", function () { return Cesium3DTilesTester.loadTileset( scene, - tilesetMetadataLegacyUrl + tilesetMetadataLegacyUrl, ).then(function (tileset) { const metadata = tileset.metadataExtension; expect(metadata).toBeDefined(); @@ -6946,16 +6949,16 @@ describe( return tilesetMetadata.getProperty("name"); }).toThrowDeveloperError(); expect(tilesetMetadata.getProperty("author")).toBe( - tilesetProperties.author + tilesetProperties.author, ); expect(tilesetMetadata.getPropertyBySemantic("DATE_ISO_8601")).toBe( - tilesetProperties.date + tilesetProperties.date, ); expect(tilesetMetadata.getProperty("centerCartographic")).toEqual( - Cartesian3.unpack(tilesetProperties.centerCartographic) + Cartesian3.unpack(tilesetProperties.centerCartographic), ); expect(tilesetMetadata.getProperty("tileCount")).toBe( - tilesetProperties.tileCount + tilesetProperties.tileCount, ); }); }); @@ -6963,7 +6966,7 @@ describe( it("loads group metadata (legacy)", function () { return Cesium3DTilesTester.loadTileset( scene, - tilesetWithGroupMetadataLegacyUrl + tilesetWithGroupMetadataLegacyUrl, ).then(function (tileset) { const metadata = tileset.metadataExtension; expect(metadata).toBeDefined(); @@ -6994,7 +6997,7 @@ describe( it("can access group metadata through contents (legacy)", function () { return Cesium3DTilesTester.loadTileset( scene, - tilesetWithGroupMetadataLegacyUrl + tilesetWithGroupMetadataLegacyUrl, ).then(function (tileset) { const metadata = tileset.metadataExtension; const commercialDistrict = metadata.groups[0]; @@ -7024,7 +7027,7 @@ describe( it("loads metadata with embedded schema (legacy)", function () { return Cesium3DTilesTester.loadTileset( scene, - tilesetMetadataLegacyUrl + tilesetMetadataLegacyUrl, ).then(function (tileset) { const schema = tileset.schema; expect(schema).toBeDefined(); @@ -7037,7 +7040,7 @@ describe( it("loads metadata with external schema and extension (legacy)", function () { return Cesium3DTilesTester.loadTileset( scene, - tilesetWithExternalSchemaLegacyUrl + tilesetWithExternalSchemaLegacyUrl, ).then(function (tileset) { const schema = tileset.schema; expect(schema).toBeDefined(); @@ -7050,7 +7053,7 @@ describe( it("loads explicit tileset with tile metadata (legacy)", function () { return Cesium3DTilesTester.loadTileset( scene, - tilesetWithExplicitTileMetadataLegacyUrl + tilesetWithExplicitTileMetadataLegacyUrl, ).then(function (tileset) { const expected = { "parent.b3dm": { @@ -7088,12 +7091,12 @@ describe( const metadata = tile.metadata; expect(metadata.getProperty("color")).toEqual(expectedValues.color); expect(metadata.getProperty("population")).toEqual( - expectedValues.population + expectedValues.population, ); // 25 can't be represented exactly when quantized as a UINT16 expect(metadata.getProperty("areaPercentage")).toEqualEpsilon( expectedValues.areaPercentage, - CesiumMath.EPSILON2 + CesiumMath.EPSILON2, ); }); }); @@ -7104,7 +7107,7 @@ describe( // one tile is removed return Cesium3DTilesTester.loadTileset( scene, - tilesetWithImplicitTileMetadataLegacyUrl + tilesetWithImplicitTileMetadataLegacyUrl, ).then(function (tileset) { const placeholderTile = tileset.root; @@ -7147,10 +7150,10 @@ describe( expect(metadata.getProperty("color")).not.toBeDefined(); } else { expect(metadata.getProperty("quadrant")).toBe( - expectedQuadrants[index] + expectedQuadrants[index], ); expect(metadata.getProperty("color")).toEqual( - expectedColors[index] + expectedColors[index], ); } } @@ -7160,7 +7163,7 @@ describe( it("loads explicit tileset with content metadata (legacy)", function () { return Cesium3DTilesTester.loadTileset( scene, - tilesetWithExplicitContentMetadataLegacyUrl + tilesetWithExplicitContentMetadataLegacyUrl, ).then(function (tileset) { const expected = { "parent.b3dm": { @@ -7193,10 +7196,10 @@ describe( const expectedValues = expected[uri]; const metadata = content.metadata; expect(metadata.getProperty("highlightColor")).toEqual( - expectedValues.highlightColor + expectedValues.highlightColor, ); expect(metadata.getProperty("author")).toEqual( - expectedValues.author + expectedValues.author, ); }); }); @@ -7207,7 +7210,7 @@ describe( // one tile is removed return Cesium3DTilesTester.loadTileset( scene, - tilesetWithImplicitContentMetadataLegacyUrl + tilesetWithImplicitContentMetadataLegacyUrl, ).then(function (tileset) { const placeholderTile = tileset.root; @@ -7249,10 +7252,10 @@ describe( expect(metadata.getProperty("color")).not.toBeDefined(); } else { expect(metadata.getProperty("height")).toBe( - expectedHeights[index] + expectedHeights[index], ); expect(metadata.getProperty("color")).toEqual( - expectedColors[index] + expectedColors[index], ); } } @@ -7262,33 +7265,33 @@ describe( it("loads explicit tileset with multiple contents with metadata (legacy)", function () { return Cesium3DTilesTester.loadTileset( scene, - tilesetWithExplicitMultipleContentsMetadataLegacyUrl + tilesetWithExplicitMultipleContentsMetadataLegacyUrl, ).then(function (tileset) { const content = tileset.root.content; const batchedContent = content.innerContents[0]; const batchedContentMetadata = batchedContent.metadata; expect(batchedContentMetadata.getProperty("highlightColor")).toEqual( - new Cartesian3(0, 0, 255) + new Cartesian3(0, 0, 255), ); expect(batchedContentMetadata.getProperty("author")).toEqual( - "Cesium" + "Cesium", ); expect(batchedContentMetadata.hasProperty("numberOfInstances")).toBe( - false + false, ); const instancedContent = content.innerContents[1]; const instancedContentMetadata = instancedContent.metadata; expect( - instancedContentMetadata.getProperty("numberOfInstances") + instancedContentMetadata.getProperty("numberOfInstances"), ).toEqual(50); expect(instancedContentMetadata.getProperty("author")).toEqual( - "Sample Author" + "Sample Author", ); expect(instancedContentMetadata.hasProperty("highlightColor")).toBe( - false + false, ); }); }); @@ -7298,7 +7301,7 @@ describe( // one tile is removed return Cesium3DTilesTester.loadTileset( scene, - tilesetWithImplicitMultipleContentsMetadataLegacyUrl + tilesetWithImplicitMultipleContentsMetadataLegacyUrl, ).then(function (tileset) { const placeholderTile = tileset.root; @@ -7351,10 +7354,10 @@ describe( } expect(buildingMetadata.getProperty("height")).toBe( - expectedHeights[index] + expectedHeights[index], ); expect(buildingMetadata.getProperty("color")).toEqual( - expectedColors[index] + expectedColors[index], ); if (i === 0) { @@ -7364,12 +7367,12 @@ describe( const treeContent = tile.content.innerContents[1]; const treeMetadata = treeContent.metadata; expect(treeMetadata.getProperty("age")).toEqual( - expectedAges[index - 1] + expectedAges[index - 1], ); } }); }); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/CircleEmitterSpec.js b/packages/engine/Specs/Scene/CircleEmitterSpec.js index a5ea6957b880..b556efb86b64 100644 --- a/packages/engine/Specs/Scene/CircleEmitterSpec.js +++ b/packages/engine/Specs/Scene/CircleEmitterSpec.js @@ -48,7 +48,7 @@ describe("Scene/CircleEmitter", function () { for (let i = 0; i < 1000; ++i) { emitter.emit(particle); expect(Cartesian3.magnitude(particle.position)).toBeLessThanOrEqual( - emitter.radius + emitter.radius, ); expect(particle.position.z).toEqual(0.0); expect(particle.velocity).toEqual(Cartesian3.UNIT_Z); diff --git a/packages/engine/Specs/Scene/ClassificationPrimitiveSpec.js b/packages/engine/Specs/Scene/ClassificationPrimitiveSpec.js index 903c4effd0fb..858abb93b31a 100644 --- a/packages/engine/Specs/Scene/ClassificationPrimitiveSpec.js +++ b/packages/engine/Specs/Scene/ClassificationPrimitiveSpec.js @@ -55,7 +55,7 @@ describe( }); } const depthColorAttribute = ColorGeometryInstanceAttribute.fromColor( - new Color(0.0, 0.0, 1.0, 1.0) + new Color(0.0, 0.0, 1.0, 1.0), ); depthColor = depthColorAttribute.value; return new Primitive({ @@ -117,7 +117,7 @@ describe( reusableGlobePrimitive = createPrimitive(rectangle, Pass.GLOBE); reusableTilesetPrimitive = createPrimitive( rectangle, - Pass.CESIUM_3D_TILE + Pass.CESIUM_3D_TILE, ); }); @@ -134,7 +134,7 @@ describe( globePrimitive = new MockPrimitive(reusableGlobePrimitive, Pass.GLOBE); tilesetPrimitive = new MockPrimitive( reusableTilesetPrimitive, - Pass.CESIUM_3D_TILE + Pass.CESIUM_3D_TILE, ); const center = Rectangle.center(rectangle); @@ -144,7 +144,7 @@ describe( const dimensions = new Cartesian3(1000000.0, 1000000.0, 1000000.0); const boxColorAttribute = ColorGeometryInstanceAttribute.fromColor( - new Color(1.0, 1.0, 0.0, 1.0) + new Color(1.0, 1.0, 0.0, 1.0), ); boxColor = boxColorAttribute.value; boxInstance = new GeometryInstance({ @@ -291,7 +291,7 @@ describe( primitive = scene.primitives.add( new ClassificationPrimitive({ geometryInstances: boxInstance, - }) + }), ); primitive.show = false; @@ -438,7 +438,7 @@ describe( const dimensions = new Cartesian3(500000.0, 1000000.0, 1000000.0); const boxColorAttribute = ColorGeometryInstanceAttribute.fromColor( - new Color(0.0, 1.0, 1.0, 1.0) + new Color(0.0, 1.0, 1.0, 1.0), ); const boxInstance1 = new GeometryInstance({ geometry: BoxGeometry.fromDimensions({ @@ -492,13 +492,14 @@ describe( const invertedColor = new Array(4); invertedColor[0] = Color.floatToByte( - Color.byteToFloat(depthColor[0]) * scene.invertClassificationColor.red + Color.byteToFloat(depthColor[0]) * scene.invertClassificationColor.red, ); invertedColor[1] = Color.floatToByte( - Color.byteToFloat(depthColor[1]) * scene.invertClassificationColor.green + Color.byteToFloat(depthColor[1]) * + scene.invertClassificationColor.green, ); invertedColor[2] = Color.floatToByte( - Color.byteToFloat(depthColor[2]) * scene.invertClassificationColor.blue + Color.byteToFloat(depthColor[2]) * scene.invertClassificationColor.blue, ); invertedColor[3] = 255; @@ -539,17 +540,17 @@ describe( invertedColor[0] = Color.floatToByte( Color.byteToFloat(depthColor[0]) * scene.invertClassificationColor.red * - scene.invertClassificationColor.alpha + scene.invertClassificationColor.alpha, ); invertedColor[1] = Color.floatToByte( Color.byteToFloat(depthColor[1]) * scene.invertClassificationColor.green * - scene.invertClassificationColor.alpha + scene.invertClassificationColor.alpha, ); invertedColor[2] = Color.floatToByte( Color.byteToFloat(depthColor[2]) * scene.invertClassificationColor.blue * - scene.invertClassificationColor.alpha + scene.invertClassificationColor.alpha, ); invertedColor[3] = 255; @@ -845,7 +846,7 @@ describe( const dimensions = new Cartesian3(500000.0, 1000000.0, 1000000.0); const boxColorAttribute = ColorGeometryInstanceAttribute.fromColor( - new Color(0.0, 1.0, 1.0, 1.0) + new Color(0.0, 1.0, 1.0, 1.0), ); const boxInstance1 = new GeometryInstance({ geometry: BoxGeometry.fromDimensions({ @@ -855,7 +856,7 @@ describe( id: "box1", attributes: { color: ColorGeometryInstanceAttribute.fromColor( - new Color(0.0, 1.0, 1.0, 1.0) + new Color(0.0, 1.0, 1.0, 1.0), ), }, }); @@ -872,7 +873,7 @@ describe( id: "box2", attributes: { color: ColorGeometryInstanceAttribute.fromColor( - new Color(1.0, 0.0, 1.0, 1.0) + new Color(1.0, 0.0, 1.0, 1.0), ), }, }); @@ -912,7 +913,7 @@ describe( const dimensions = new Cartesian3(500000.0, 1000000.0, 1000000.0); const boxColorAttribute = ColorGeometryInstanceAttribute.fromColor( - new Color(0.0, 1.0, 1.0, 1.0) + new Color(0.0, 1.0, 1.0, 1.0), ); const boxInstance1 = new GeometryInstance({ geometry: BoxGeometry.fromDimensions({ @@ -922,7 +923,7 @@ describe( id: "box1", attributes: { color: ColorGeometryInstanceAttribute.fromColor( - new Color(0.0, 1.0, 1.0, 1.0) + new Color(0.0, 1.0, 1.0, 1.0), ), }, }); @@ -988,7 +989,7 @@ describe( }); const boxColorAttribute = ColorGeometryInstanceAttribute.fromColor( - new Color(0.0, 1.0, 1.0, 1.0) + new Color(0.0, 1.0, 1.0, 1.0), ); expect(function () { @@ -1125,7 +1126,7 @@ describe( verifyClassificationPrimitiveRender(primitive, boxColor); expect( - primitive.getGeometryInstanceAttributes("unknown") + primitive.getGeometryInstanceAttributes("unknown"), ).not.toBeDefined(); }); @@ -1181,5 +1182,5 @@ describe( scene.primitives.destroyPrimitives = true; }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/ClippingPlaneCollectionSpec.js b/packages/engine/Specs/Scene/ClippingPlaneCollectionSpec.js index 2fb563e969d6..958eaf3bd4ce 100644 --- a/packages/engine/Specs/Scene/ClippingPlaneCollectionSpec.js +++ b/packages/engine/Specs/Scene/ClippingPlaneCollectionSpec.js @@ -33,7 +33,7 @@ describe("Scene/ClippingPlaneCollection", function () { // expect pixel1 to be the normal const normal = AttributeCompression.octDecodeFromCartesian4( pixel1, - new Cartesian3() + new Cartesian3(), ); // expect pixel2 to be the distance @@ -110,10 +110,10 @@ describe("Scene/ClippingPlaneCollection", function () { expect(clippingPlanes.contains(planes[0])).toBe(true); expect( - clippingPlanes.contains(new ClippingPlane(Cartesian3.UNIT_Y, 2.0)) + clippingPlanes.contains(new ClippingPlane(Cartesian3.UNIT_Y, 2.0)), ).toBe(true); expect( - clippingPlanes.contains(new ClippingPlane(Cartesian3.UNIT_Z, 3.0)) + clippingPlanes.contains(new ClippingPlane(Cartesian3.UNIT_Z, 3.0)), ).toBe(false); }); @@ -202,10 +202,10 @@ describe("Scene/ClippingPlaneCollection", function () { expect(sampler.wrapS).toEqual(TextureWrap.CLAMP_TO_EDGE); expect(sampler.wrapT).toEqual(TextureWrap.CLAMP_TO_EDGE); expect(sampler.minificationFilter).toEqual( - TextureMinificationFilter.NEAREST + TextureMinificationFilter.NEAREST, ); expect(sampler.magnificationFilter).toEqual( - TextureMinificationFilter.NEAREST + TextureMinificationFilter.NEAREST, ); clippingPlanes.destroy(); @@ -241,19 +241,21 @@ describe("Scene/ClippingPlaneCollection", function () { let rgba; const gl = scene.frameState.context._gl; - spyOn(gl, "texImage2D").and.callFake(function ( - target, - level, - xoffset, - yoffset, - width, - height, - format, - type, - arrayBufferView - ) { - rgba = arrayBufferView; - }); + spyOn(gl, "texImage2D").and.callFake( + function ( + target, + level, + xoffset, + yoffset, + width, + height, + format, + type, + arrayBufferView, + ) { + rgba = arrayBufferView; + }, + ); clippingPlanes.update(scene.frameState); expect(rgba).toBeDefined(); @@ -275,29 +277,29 @@ describe("Scene/ClippingPlaneCollection", function () { Cartesian3.equalsEpsilon( plane1.normal, planes[0].normal, - CesiumMath.EPSILON3 - ) + CesiumMath.EPSILON3, + ), ).toEqual(true); expect( Cartesian3.equalsEpsilon( plane2.normal, planes[1].normal, - CesiumMath.EPSILON3 - ) + CesiumMath.EPSILON3, + ), ).toEqual(true); expect( CesiumMath.equalsEpsilon( plane1.distance, planes[0].distance, - CesiumMath.EPSILON3 - ) + CesiumMath.EPSILON3, + ), ).toEqual(true); expect( CesiumMath.equalsEpsilon( plane2.distance, planes[1].distance, - CesiumMath.EPSILON3 - ) + CesiumMath.EPSILON3, + ), ).toEqual(true); clippingPlanes.destroy(); @@ -361,20 +363,22 @@ describe("Scene/ClippingPlaneCollection", function () { const gl = scene.frameState.context._gl; let copyWidth; let copyHeight; - spyOn(gl, "texSubImage2D").and.callFake(function ( - target, - level, - xoffset, - yoffset, - width, - height, - format, - type, - arrayBufferView - ) { - copyWidth = width; - copyHeight = height; - }); + spyOn(gl, "texSubImage2D").and.callFake( + function ( + target, + level, + xoffset, + yoffset, + width, + height, + format, + type, + arrayBufferView, + ) { + copyWidth = width; + copyHeight = height; + }, + ); clippingPlanes = new ClippingPlaneCollection({ planes: planes, @@ -447,10 +451,10 @@ describe("Scene/ClippingPlaneCollection", function () { expect(sampler.wrapS).toEqual(TextureWrap.CLAMP_TO_EDGE); expect(sampler.wrapT).toEqual(TextureWrap.CLAMP_TO_EDGE); expect(sampler.minificationFilter).toEqual( - TextureMinificationFilter.NEAREST + TextureMinificationFilter.NEAREST, ); expect(sampler.magnificationFilter).toEqual( - TextureMinificationFilter.NEAREST + TextureMinificationFilter.NEAREST, ); clippingPlanes.destroy(); @@ -499,19 +503,21 @@ describe("Scene/ClippingPlaneCollection", function () { let rgba; const gl = scene.frameState.context._gl; - spyOn(gl, "texImage2D").and.callFake(function ( - target, - level, - xoffset, - yoffset, - width, - height, - format, - type, - arrayBufferView - ) { - rgba = arrayBufferView; - }); + spyOn(gl, "texImage2D").and.callFake( + function ( + target, + level, + xoffset, + yoffset, + width, + height, + format, + type, + arrayBufferView, + ) { + rgba = arrayBufferView; + }, + ); clippingPlanes.update(scene.frameState); expect(rgba).toBeDefined(); @@ -528,29 +534,29 @@ describe("Scene/ClippingPlaneCollection", function () { Cartesian3.equalsEpsilon( plane1.normal, planes[0].normal, - CesiumMath.EPSILON3 - ) + CesiumMath.EPSILON3, + ), ).toEqual(true); expect( Cartesian3.equalsEpsilon( plane2.normal, planes[1].normal, - CesiumMath.EPSILON3 - ) + CesiumMath.EPSILON3, + ), ).toEqual(true); expect( CesiumMath.equalsEpsilon( plane1.distance, planes[0].distance, - CesiumMath.EPSILON3 - ) + CesiumMath.EPSILON3, + ), ).toEqual(true); expect( CesiumMath.equalsEpsilon( plane2.distance, planes[1].distance, - CesiumMath.EPSILON3 - ) + CesiumMath.EPSILON3, + ), ).toEqual(true); clippingPlanes.destroy(); @@ -627,20 +633,22 @@ describe("Scene/ClippingPlaneCollection", function () { const gl = scene.frameState.context._gl; let copyWidth; let copyHeight; - spyOn(gl, "texSubImage2D").and.callFake(function ( - target, - level, - xoffset, - yoffset, - width, - height, - format, - type, - arrayBufferView - ) { - copyWidth = width; - copyHeight = height; - }); + spyOn(gl, "texSubImage2D").and.callFake( + function ( + target, + level, + xoffset, + yoffset, + width, + height, + format, + type, + arrayBufferView, + ) { + copyWidth = width; + copyHeight = height; + }, + ); clippingPlanes = new ClippingPlaneCollection({ planes: planes, @@ -725,7 +733,7 @@ describe("Scene/ClippingPlaneCollection", function () { ClippingPlaneCollection.setOwner( clippingPlanes1, clippedObject1, - "clippingPlanes" + "clippingPlanes", ); expect(clippedObject1.clippingPlanes).toBe(clippingPlanes1); expect(clippingPlanes1._owner).toBe(clippedObject1); @@ -741,7 +749,7 @@ describe("Scene/ClippingPlaneCollection", function () { ClippingPlaneCollection.setOwner( clippingPlanes2, clippedObject1, - "clippingPlanes" + "clippingPlanes", ); expect(clippingPlanes1.isDestroyed()).toBe(true); @@ -749,7 +757,7 @@ describe("Scene/ClippingPlaneCollection", function () { ClippingPlaneCollection.setOwner( clippingPlanes2, clippedObject1, - "clippingPlanes" + "clippingPlanes", ); expect(clippingPlanes2.isDestroyed()).toBe(false); @@ -758,7 +766,7 @@ describe("Scene/ClippingPlaneCollection", function () { ClippingPlaneCollection.setOwner( clippingPlanes2, clippedObject2, - "clippingPlanes" + "clippingPlanes", ); }).toThrowDeveloperError(); }); @@ -772,40 +780,35 @@ describe("Scene/ClippingPlaneCollection", function () { clippingPlanes.unionClippingRegions = true; expect(clippingPlanes._testIntersection).not.toBe( - originalIntersectFunction + originalIntersectFunction, ); }); it("computes intersections with bounding volumes when clipping regions are combined with an intersect operation", function () { clippingPlanes = new ClippingPlaneCollection(); - let intersect = clippingPlanes.computeIntersectionWithBoundingVolume( - boundingVolume - ); + let intersect = + clippingPlanes.computeIntersectionWithBoundingVolume(boundingVolume); expect(intersect).toEqual(Intersect.INSIDE); clippingPlanes.add(new ClippingPlane(Cartesian3.UNIT_X, -2.0)); - intersect = clippingPlanes.computeIntersectionWithBoundingVolume( - boundingVolume - ); + intersect = + clippingPlanes.computeIntersectionWithBoundingVolume(boundingVolume); expect(intersect).toEqual(Intersect.OUTSIDE); clippingPlanes.add(new ClippingPlane(Cartesian3.UNIT_Y, 0.0)); - intersect = clippingPlanes.computeIntersectionWithBoundingVolume( - boundingVolume - ); + intersect = + clippingPlanes.computeIntersectionWithBoundingVolume(boundingVolume); expect(intersect).toEqual(Intersect.INTERSECTING); clippingPlanes.add(new ClippingPlane(Cartesian3.UNIT_Z, 1.0)); - intersect = clippingPlanes.computeIntersectionWithBoundingVolume( - boundingVolume - ); + intersect = + clippingPlanes.computeIntersectionWithBoundingVolume(boundingVolume); expect(intersect).toEqual(Intersect.INSIDE); clippingPlanes.add(new ClippingPlane(Cartesian3.UNIT_Z, 0.0)); - intersect = clippingPlanes.computeIntersectionWithBoundingVolume( - boundingVolume - ); + intersect = + clippingPlanes.computeIntersectionWithBoundingVolume(boundingVolume); expect(intersect).toEqual(Intersect.INSIDE); }); @@ -814,34 +817,29 @@ describe("Scene/ClippingPlaneCollection", function () { unionClippingRegions: true, }); - let intersect = clippingPlanes.computeIntersectionWithBoundingVolume( - boundingVolume - ); + let intersect = + clippingPlanes.computeIntersectionWithBoundingVolume(boundingVolume); expect(intersect).toEqual(Intersect.INSIDE); clippingPlanes.add(new ClippingPlane(Cartesian3.UNIT_Z, 1.0)); - intersect = clippingPlanes.computeIntersectionWithBoundingVolume( - boundingVolume - ); + intersect = + clippingPlanes.computeIntersectionWithBoundingVolume(boundingVolume); expect(intersect).toEqual(Intersect.INSIDE); const temp = new ClippingPlane(Cartesian3.UNIT_Y, -2.0); clippingPlanes.add(temp); - intersect = clippingPlanes.computeIntersectionWithBoundingVolume( - boundingVolume - ); + intersect = + clippingPlanes.computeIntersectionWithBoundingVolume(boundingVolume); expect(intersect).toEqual(Intersect.OUTSIDE); clippingPlanes.add(new ClippingPlane(Cartesian3.UNIT_X, 0.0)); - intersect = clippingPlanes.computeIntersectionWithBoundingVolume( - boundingVolume - ); + intersect = + clippingPlanes.computeIntersectionWithBoundingVolume(boundingVolume); expect(intersect).toEqual(Intersect.OUTSIDE); clippingPlanes.remove(temp); - intersect = clippingPlanes.computeIntersectionWithBoundingVolume( - boundingVolume - ); + intersect = + clippingPlanes.computeIntersectionWithBoundingVolume(boundingVolume); expect(intersect).toEqual(Intersect.INTERSECTING); }); @@ -850,14 +848,14 @@ describe("Scene/ClippingPlaneCollection", function () { let intersect = clippingPlanes.computeIntersectionWithBoundingVolume( boundingVolume, - transform + transform, ); expect(intersect).toEqual(Intersect.INSIDE); clippingPlanes.add(new ClippingPlane(Cartesian3.UNIT_X, -1.0)); intersect = clippingPlanes.computeIntersectionWithBoundingVolume( boundingVolume, - transform + transform, ); expect(intersect).not.toEqual(Intersect.INSIDE); }); @@ -894,7 +892,7 @@ describe("Scene/ClippingPlaneCollection", function () { const predictedResolution = ClippingPlaneCollection.getTextureResolution( clippingPlanes, scene.frameState.context, - new Cartesian2() + new Cartesian2(), ); expect(predictedResolution.x).toEqual(4); @@ -904,7 +902,7 @@ describe("Scene/ClippingPlaneCollection", function () { const actualResolution = ClippingPlaneCollection.getTextureResolution( clippingPlanes, scene.frameState.context, - new Cartesian2() + new Cartesian2(), ); expect(predictedResolution.x).toEqual(actualResolution.x); diff --git a/packages/engine/Specs/Scene/ClippingPlaneSpec.js b/packages/engine/Specs/Scene/ClippingPlaneSpec.js index fae79735ef87..658d1e1e88f5 100644 --- a/packages/engine/Specs/Scene/ClippingPlaneSpec.js +++ b/packages/engine/Specs/Scene/ClippingPlaneSpec.js @@ -65,17 +65,17 @@ describe("Scene/ClippingPlane", function () { const clippingPlane = new ClippingPlane(Cartesian3.UNIT_X, 1.0); let cloneClippingPlane = ClippingPlane.clone(clippingPlane); expect( - Cartesian3.equals(clippingPlane.normal, cloneClippingPlane.normal) + Cartesian3.equals(clippingPlane.normal, cloneClippingPlane.normal), ).toBe(true); expect(clippingPlane.distance).toEqual(cloneClippingPlane.distance); const scratchClippingPlane = new ClippingPlane(Cartesian3.UNIT_Y, 0.0); cloneClippingPlane = ClippingPlane.clone( clippingPlane, - scratchClippingPlane + scratchClippingPlane, ); expect( - Cartesian3.equals(clippingPlane.normal, cloneClippingPlane.normal) + Cartesian3.equals(clippingPlane.normal, cloneClippingPlane.normal), ).toBe(true); expect(clippingPlane.distance).toEqual(cloneClippingPlane.distance); expect(cloneClippingPlane).toBe(scratchClippingPlane); @@ -90,14 +90,14 @@ describe("Scene/ClippingPlane", function () { transform = Matrix4.multiplyByMatrix3( transform, Matrix3.fromRotationY(Math.PI), - transform + transform, ); const transformedPlane = Plane.transform(clippingPlane, transform); expect(transformedPlane.distance).toEqual(clippingPlane.distance * 2.0); expect(transformedPlane.normal.x).toEqualEpsilon( -clippingPlane.normal.x, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); expect(transformedPlane.normal.y).toEqual(clippingPlane.normal.y); expect(transformedPlane.normal.z).toEqual(-clippingPlane.normal.z); diff --git a/packages/engine/Specs/Scene/ClippingPolygonCollectionSpec.js b/packages/engine/Specs/Scene/ClippingPolygonCollectionSpec.js index 9ea882abc1f2..2e13ecb1804d 100644 --- a/packages/engine/Specs/Scene/ClippingPolygonCollectionSpec.js +++ b/packages/engine/Specs/Scene/ClippingPolygonCollectionSpec.js @@ -18,24 +18,13 @@ import createScene from "../../../../Specs/createScene.js"; describe("Scene/ClippingPolygonCollection", function () { const positions = Cartesian3.fromRadiansArray([ - -1.3194369277314022, - 0.6988062530900625, - -1.31941, - 0.69879, - -1.3193955980204217, - 0.6988091578771254, - -1.3193931220959367, - 0.698743632490865, - -1.3194358224045408, - 0.6987471965556998, + -1.3194369277314022, 0.6988062530900625, -1.31941, 0.69879, + -1.3193955980204217, 0.6988091578771254, -1.3193931220959367, + 0.698743632490865, -1.3194358224045408, 0.6987471965556998, ]); const positionsB = Cartesian3.fromRadiansArray([ - -1.3194369277314022, - 0.6988062530900625, - -1.31941, - 0.69879, - -1.3193931220959367, - 0.698743632490865, + -1.3194369277314022, 0.6988062530900625, -1.31941, 0.69879, + -1.3193931220959367, 0.698743632490865, ]); it("default constructor", function () { @@ -176,7 +165,7 @@ describe("Scene/ClippingPolygonCollection", function () { expect(() => { polygons.update(scene.frameState); }).toThrowError( - "ClippingPolygonCollections are only supported for WebGL 2." + "ClippingPolygonCollections are only supported for WebGL 2.", ); scene.destroyForSpecs(); @@ -258,19 +247,19 @@ describe("Scene/ClippingPolygonCollection", function () { expect(arrayBufferView[1]).toBe(0); // extents index expect(arrayBufferView[2]).toEqualEpsilon( 0.6969271302223206, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); // first position in spherical coordinates expect(arrayBufferView[3]).toEqualEpsilon( -1.3191630840301514, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); expect(arrayBufferView[10]).toEqualEpsilon( 0.6968677043914795, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); // last position in spherical coordinates expect(arrayBufferView[11]).toEqualEpsilon( -1.3191620111465454, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); expect(arrayBufferView[12]).toBe(0); // padding @@ -300,19 +289,19 @@ describe("Scene/ClippingPolygonCollection", function () { expect(arrayBufferView).toBeDefined(); expect(arrayBufferView[0]).toEqualEpsilon( 0.6958641409873962, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); // south expect(arrayBufferView[1]).toEqualEpsilon( -1.3201631307601929, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); // west expect(arrayBufferView[2]).toEqualEpsilon( 484.0434265136719, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); // 1 / (north - south) expect(arrayBufferView[3]).toEqualEpsilon( 489.4261779785156, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); // 1 / (east - west) expect(arrayBufferView[4]).toBe(0); // padding expect(arrayBufferView[5]).toBe(0); // padding @@ -352,19 +341,19 @@ describe("Scene/ClippingPolygonCollection", function () { expect(arrayBufferView).toBeDefined(); expect(arrayBufferView[0]).toEqualEpsilon( 0.6958641409873962, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); // south expect(arrayBufferView[1]).toEqualEpsilon( -1.3201631307601929, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); // west expect(arrayBufferView[2]).toEqualEpsilon( 484.0434265136719, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); // north - south expect(arrayBufferView[3]).toEqualEpsilon( 489.4261779785156, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); // east - west expect(arrayBufferView[4]).toBe(0); // padding expect(arrayBufferView[5]).toBe(0); // padding @@ -447,10 +436,11 @@ describe("Scene/ClippingPolygonCollection", function () { // Set this to the minimum possible value so texture sizes can be consistently tested ContextLimits._maximumTextureSize = 64; - const result = ClippingPolygonCollection.getClippingDistanceTextureResolution( - polygons, - new Cartesian2() - ); + const result = + ClippingPolygonCollection.getClippingDistanceTextureResolution( + polygons, + new Cartesian2(), + ); expect(result.x).toBe(64); expect(result.y).toBe(64); @@ -467,10 +457,11 @@ describe("Scene/ClippingPolygonCollection", function () { // Set this to the minimum possible value so texture sizes can be consistently tested ContextLimits._maximumTextureSize = 64; - const result = ClippingPolygonCollection.getClippingExtentsTextureResolution( - polygons, - new Cartesian2() - ); + const result = + ClippingPolygonCollection.getClippingExtentsTextureResolution( + polygons, + new Cartesian2(), + ); expect(result.x).toBe(1); expect(result.y).toBe(2); @@ -484,9 +475,8 @@ describe("Scene/ClippingPolygonCollection", function () { rectangle: Rectangle.fromCartesianArray(positions), }); - let intersect = polygons.computeIntersectionWithBoundingVolume( - boundingVolume - ); + let intersect = + polygons.computeIntersectionWithBoundingVolume(boundingVolume); expect(intersect).toEqual(Intersect.OUTSIDE); polygons.add(new ClippingPolygon({ positions })); @@ -496,7 +486,7 @@ describe("Scene/ClippingPolygonCollection", function () { const boundingSphere = BoundingSphere.fromPoints(positions); boundingVolume = new TileBoundingSphere( boundingSphere.center, - boundingSphere.radius + boundingSphere.radius, ); intersect = polygons.computeIntersectionWithBoundingVolume(boundingVolume); expect(intersect).toEqual(Intersect.INTERSECTING); @@ -515,9 +505,8 @@ describe("Scene/ClippingPolygonCollection", function () { rectangle: Rectangle.fromCartesianArray(positions), }); - let intersect = polygons.computeIntersectionWithBoundingVolume( - boundingVolume - ); + let intersect = + polygons.computeIntersectionWithBoundingVolume(boundingVolume); expect(intersect).toEqual(Intersect.INSIDE); polygons.add(new ClippingPolygon({ positions })); @@ -527,7 +516,7 @@ describe("Scene/ClippingPolygonCollection", function () { const boundingSphere = BoundingSphere.fromPoints(positions); boundingVolume = new TileBoundingSphere( boundingSphere.center, - boundingSphere.radius + boundingSphere.radius, ); intersect = polygons.computeIntersectionWithBoundingVolume(boundingVolume); expect(intersect).toEqual(Intersect.INTERSECTING); diff --git a/packages/engine/Specs/Scene/ClippingPolygonSpec.js b/packages/engine/Specs/Scene/ClippingPolygonSpec.js index 2519e35cb006..22c6e4abb56d 100644 --- a/packages/engine/Specs/Scene/ClippingPolygonSpec.js +++ b/packages/engine/Specs/Scene/ClippingPolygonSpec.js @@ -9,16 +9,9 @@ import { describe("Scene/ClippingPolygon", function () { it("constructs", function () { const positions = Cartesian3.fromRadiansArray([ - -1.3194369277314022, - 0.6988062530900625, - -1.31941, - 0.69879, - -1.3193955980204217, - 0.6988091578771254, - -1.3193931220959367, - 0.698743632490865, - -1.3194358224045408, - 0.6987471965556998, + -1.3194369277314022, 0.6988062530900625, -1.31941, 0.69879, + -1.3193955980204217, 0.6988091578771254, -1.3193931220959367, + 0.698743632490865, -1.3194358224045408, 0.6987471965556998, ]); const polygon = new ClippingPolygon({ @@ -37,10 +30,7 @@ describe("Scene/ClippingPolygon", function () { }).toThrowDeveloperError(); const positions = Cartesian3.fromRadiansArray([ - -1.3194369277314022, - 0.6988062530900625, - -1.31941, - 0.69879, + -1.3194369277314022, 0.6988062530900625, -1.31941, 0.69879, ]); expect(() => { @@ -53,16 +43,9 @@ describe("Scene/ClippingPolygon", function () { it("clones", function () { const positions = Cartesian3.fromRadiansArray([ - -1.3194369277314022, - 0.6988062530900625, - -1.31941, - 0.69879, - -1.3193955980204217, - 0.6988091578771254, - -1.3193931220959367, - 0.698743632490865, - -1.3194358224045408, - 0.6987471965556998, + -1.3194369277314022, 0.6988062530900625, -1.31941, 0.69879, + -1.3193955980204217, 0.6988091578771254, -1.3193931220959367, + 0.698743632490865, -1.3194358224045408, 0.6987471965556998, ]); const polygon = new ClippingPolygon({ @@ -91,16 +74,9 @@ describe("Scene/ClippingPolygon", function () { it("equals verifies equality", function () { const positions = Cartesian3.fromRadiansArray([ - -1.3194369277314022, - 0.6988062530900625, - -1.31941, - 0.69879, - -1.3193955980204217, - 0.6988091578771254, - -1.3193931220959367, - 0.698743632490865, - -1.3194358224045408, - 0.6987471965556998, + -1.3194369277314022, 0.6988062530900625, -1.31941, 0.69879, + -1.3193955980204217, 0.6988091578771254, -1.3193931220959367, + 0.698743632490865, -1.3194358224045408, 0.6987471965556998, ]); const polygonA = new ClippingPolygon({ @@ -117,16 +93,9 @@ describe("Scene/ClippingPolygon", function () { polygonB = new ClippingPolygon({ ellipsoid: Ellipsoid.MOON, positions: Cartesian3.fromRadiansArray([ - -1.3194369277314022, - 0.6988062530900625, - -1.31941, - 0.69879, - -1.3193955980204217, - 0.6988091578771254, - -1.3193931220959367, - 0.698743632490865, - -1.3194358224045408, - 0.6987471965556998, + -1.3194369277314022, 0.6988062530900625, -1.31941, 0.69879, + -1.3193955980204217, 0.6988091578771254, -1.3193931220959367, + 0.698743632490865, -1.3194358224045408, 0.6987471965556998, ]), }); @@ -142,16 +111,9 @@ describe("Scene/ClippingPolygon", function () { it("equals throws without arguments", function () { const positions = Cartesian3.fromRadiansArray([ - -1.3194369277314022, - 0.6988062530900625, - -1.31941, - 0.69879, - -1.3193955980204217, - 0.6988091578771254, - -1.3193931220959367, - 0.698743632490865, - -1.3194358224045408, - 0.6987471965556998, + -1.3194369277314022, 0.6988062530900625, -1.31941, 0.69879, + -1.3193955980204217, 0.6988091578771254, -1.3193931220959367, + 0.698743632490865, -1.3194358224045408, 0.6987471965556998, ]); const polygon = new ClippingPolygon({ @@ -168,16 +130,9 @@ describe("Scene/ClippingPolygon", function () { it("computeRectangle returns rectangle enclosing the polygon", function () { const positions = Cartesian3.fromRadiansArray([ - -1.3194369277314022, - 0.6988062530900625, - -1.31941, - 0.69879, - -1.3193955980204217, - 0.6988091578771254, - -1.3193931220959367, - 0.698743632490865, - -1.3194358224045408, - 0.6987471965556998, + -1.3194369277314022, 0.6988062530900625, -1.31941, 0.69879, + -1.3193955980204217, 0.6988091578771254, -1.3193931220959367, + 0.698743632490865, -1.3194358224045408, 0.6987471965556998, ]); const polygon = new ClippingPolygon({ @@ -188,34 +143,27 @@ describe("Scene/ClippingPolygon", function () { expect(result).toBeInstanceOf(Rectangle); expect(result.west).toEqualEpsilon( -1.3194369277314024, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); expect(result.south).toEqualEpsilon( 0.6987436324908647, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); expect(result.east).toEqualEpsilon( -1.3193931220959367, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); expect(result.north).toEqualEpsilon( 0.6988091578771254, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); }); it("computeRectangle uses result parameter", function () { const positions = Cartesian3.fromRadiansArray([ - -1.3194369277314022, - 0.6988062530900625, - -1.31941, - 0.69879, - -1.3193955980204217, - 0.6988091578771254, - -1.3193931220959367, - 0.698743632490865, - -1.3194358224045408, - 0.6987471965556998, + -1.3194369277314022, 0.6988062530900625, -1.31941, 0.69879, + -1.3193955980204217, 0.6988091578771254, -1.3193931220959367, + 0.698743632490865, -1.3194358224045408, 0.6987471965556998, ]); const polygon = new ClippingPolygon({ @@ -227,34 +175,27 @@ describe("Scene/ClippingPolygon", function () { expect(returnedValue).toBe(result); expect(result.west).toEqualEpsilon( -1.3194369277314024, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); expect(result.south).toEqualEpsilon( 0.6987436324908647, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); expect(result.east).toEqualEpsilon( -1.3193931220959367, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); expect(result.north).toEqualEpsilon( 0.6988091578771254, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); }); it("computeSphericalExtents returns rectangle enclosing the polygon defined in spherical coordinates", function () { const positions = Cartesian3.fromRadiansArray([ - -1.3194369277314022, - 0.6988062530900625, - -1.31941, - 0.69879, - -1.3193955980204217, - 0.6988091578771254, - -1.3193931220959367, - 0.698743632490865, - -1.3194358224045408, - 0.6987471965556998, + -1.3194369277314022, 0.6988062530900625, -1.31941, 0.69879, + -1.3193955980204217, 0.6988091578771254, -1.3193931220959367, + 0.698743632490865, -1.3194358224045408, 0.6987471965556998, ]); const polygon = new ClippingPolygon({ @@ -265,34 +206,27 @@ describe("Scene/ClippingPolygon", function () { expect(result).toBeInstanceOf(Rectangle); expect(result.west).toEqualEpsilon( -1.3191630776640944, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); expect(result.south).toEqualEpsilon( 0.6968641167123716, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); expect(result.east).toEqualEpsilon( -1.3191198686316543, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); expect(result.north).toEqualEpsilon( 0.6969300470954187, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); }); it("computeSphericalExtents uses result parameter", function () { const positions = Cartesian3.fromRadiansArray([ - -1.3194369277314022, - 0.6988062530900625, - -1.31941, - 0.69879, - -1.3193955980204217, - 0.6988091578771254, - -1.3193931220959367, - 0.698743632490865, - -1.3194358224045408, - 0.6987471965556998, + -1.3194369277314022, 0.6988062530900625, -1.31941, 0.69879, + -1.3193955980204217, 0.6988091578771254, -1.3193931220959367, + 0.698743632490865, -1.3194358224045408, 0.6987471965556998, ]); const polygon = new ClippingPolygon({ @@ -304,19 +238,19 @@ describe("Scene/ClippingPolygon", function () { expect(returnedValue).toBe(result); expect(result.west).toEqualEpsilon( -1.3191630776640944, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); expect(result.south).toEqualEpsilon( 0.6968641167123716, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); expect(result.east).toEqualEpsilon( -1.3191198686316543, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); expect(result.north).toEqualEpsilon( 0.6969300470954187, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); }); }); diff --git a/packages/engine/Specs/Scene/CloudCollectionSpec.js b/packages/engine/Specs/Scene/CloudCollectionSpec.js index a8283482baaa..47ec8db78506 100644 --- a/packages/engine/Specs/Scene/CloudCollectionSpec.js +++ b/packages/engine/Specs/Scene/CloudCollectionSpec.js @@ -641,5 +641,5 @@ describe( }).toThrowDeveloperError(); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/Composite3DTileContentSpec.js b/packages/engine/Specs/Scene/Composite3DTileContentSpec.js index 2dcea78122bc..42a7f7830e60 100644 --- a/packages/engine/Specs/Scene/Composite3DTileContentSpec.js +++ b/packages/engine/Specs/Scene/Composite3DTileContentSpec.js @@ -90,10 +90,10 @@ describe( version: 2, }); await expectAsync( - Cesium3DTilesTester.createContentForMockTile(arrayBuffer, "cmpt") + Cesium3DTilesTester.createContentForMockTile(arrayBuffer, "cmpt"), ).toBeRejectedWithError( RuntimeError, - "Only Composite Tile version 1 is supported. Version 2 is not." + "Only Composite Tile version 1 is supported. Version 2 is not.", ); }); @@ -106,17 +106,17 @@ describe( ], }); await expectAsync( - Cesium3DTilesTester.createContentForMockTile(arrayBuffer, "cmpt") + Cesium3DTilesTester.createContentForMockTile(arrayBuffer, "cmpt"), ).toBeRejectedWithError( RuntimeError, - "Unknown tile content type, xxxx, inside Composite tile" + "Unknown tile content type, xxxx, inside Composite tile", ); }); it("becomes ready", async function () { const tileset = await Cesium3DTilesTester.loadTileset( scene, - compositeUrl + compositeUrl, ); expect(tileset.root.contentReady).toBeTrue(); expect(tileset.root.content).toBeDefined(); @@ -134,25 +134,25 @@ describe( }); await expectAsync( - Cesium3DTilesTester.createContentForMockTile(arrayBuffer, "cmpt") + Cesium3DTilesTester.createContentForMockTile(arrayBuffer, "cmpt"), ).toBeRejectedWithError(RuntimeError); }); it("renders composite", function () { return Cesium3DTilesTester.loadTileset(scene, compositeUrl).then( - expectRenderComposite + expectRenderComposite, ); }); it("renders composite of composite", function () { return Cesium3DTilesTester.loadTileset(scene, compositeOfComposite).then( - expectRenderComposite + expectRenderComposite, ); }); it("renders multiple instanced tilesets", function () { return Cesium3DTilesTester.loadTileset(scene, compositeOfInstanced).then( - expectRenderComposite + expectRenderComposite, ); }); @@ -240,7 +240,7 @@ describe( for (let i = 0; i < innerContents.length; i++) { expect(innerContents[i].group.metadata).toBe(groupMetadata); } - } + }, ); }); @@ -255,7 +255,7 @@ describe( for (let i = 0; i < innerContents.length; i++) { expect(innerContents[i].metadata).toBe(explicitMetadata); } - } + }, ); }); @@ -270,10 +270,10 @@ describe( for (let i = 0; i < innerContents.length; i++) { expect(innerContents[i].metadata).toBe(implicitMetadata); } - } + }, ); }); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/ConditionsExpressionSpec.js b/packages/engine/Specs/Scene/ConditionsExpressionSpec.js index 43daf10cf2c8..133d6df1e7e6 100644 --- a/packages/engine/Specs/Scene/ConditionsExpressionSpec.js +++ b/packages/engine/Specs/Scene/ConditionsExpressionSpec.js @@ -62,7 +62,7 @@ describe("Scene/ConditionsExpression", function () { const expression = new ConditionsExpression( jsonExpWithDefines, defines, - result + result, ); const value = expression.evaluate(new MockFeature(101), result); expect(value).toEqual(new Cartesian4(0.0, 0.0, 1.0, 1.0)); @@ -74,7 +74,7 @@ describe("Scene/ConditionsExpression", function () { const expression = new ConditionsExpression( jsonExpWithDefines, defines, - result + result, ); const value = expression.evaluate(new MockFeature(101), result); expect(value).toEqual(Color.BLUE); @@ -108,7 +108,7 @@ describe("Scene/ConditionsExpression", function () { "getColor()", variableSubstitutionMap, {}, - "vec4" + "vec4", ); const expected = "vec4 getColor()\n" + @@ -136,7 +136,7 @@ describe("Scene/ConditionsExpression", function () { "getColor", {}, {}, - "vec4" + "vec4", ); expect(shaderFunction).toBeUndefined(); }); diff --git a/packages/engine/Specs/Scene/ConeEmitterSpec.js b/packages/engine/Specs/Scene/ConeEmitterSpec.js index f3f94dd75adb..9ae972485fc9 100644 --- a/packages/engine/Specs/Scene/ConeEmitterSpec.js +++ b/packages/engine/Specs/Scene/ConeEmitterSpec.js @@ -38,7 +38,7 @@ describe("Scene/ConeEmitter", function () { expect(particle.position).toEqual(Cartesian3.ZERO); expect(Cartesian3.magnitude(particle.velocity)).toEqualEpsilon( 1.0, - CesiumMath.EPSILON14 + CesiumMath.EPSILON14, ); // acos(dot(unit v, unit z)) <= angle diff --git a/packages/engine/Specs/Scene/ContentMetadataSpec.js b/packages/engine/Specs/Scene/ContentMetadataSpec.js index 29b05222f003..a08f776bf528 100644 --- a/packages/engine/Specs/Scene/ContentMetadataSpec.js +++ b/packages/engine/Specs/Scene/ContentMetadataSpec.js @@ -147,27 +147,23 @@ describe("Scene/ContentMetadata", function () { it("getPropertyBySemantic returns the property value", function () { expect(contentMetadata.getPropertyBySemantic("COLOR")).toEqual([ - 255, - 125, - 0, + 255, 125, 0, ]); }); it("setPropertyBySemantic sets property value", function () { expect(contentMetadata.getPropertyBySemantic("COLOR")).toEqual([ - 255, - 125, - 0, + 255, 125, 0, ]); expect(contentMetadata.setPropertyBySemantic("COLOR", [0, 0, 0])).toBe( - true + true, ); expect(contentMetadata.getPropertyBySemantic("COLOR")).toEqual([0, 0, 0]); }); it("setPropertyBySemantic returns false if the semantic doesn't exist", function () { expect(contentMetadata.setPropertyBySemantic("AUTHOR", "Test Author")).toBe( - false + false, ); }); }); diff --git a/packages/engine/Specs/Scene/CreditDisplaySpec.js b/packages/engine/Specs/Scene/CreditDisplaySpec.js index d194b9abbef7..ad5698092150 100644 --- a/packages/engine/Specs/Scene/CreditDisplaySpec.js +++ b/packages/engine/Specs/Scene/CreditDisplaySpec.js @@ -112,7 +112,7 @@ describe("Scene/CreditDisplay", function () { creditDisplay = new CreditDisplay(container); const credit = new Credit( '<a href="http://cesiumjs.org">CesiumJS.org</a>', - true + true, ); beginFrame(creditDisplay); creditDisplay.addCreditToNextFrame(credit); @@ -512,10 +512,10 @@ describe("Scene/CreditDisplay", function () { const lightboxCreditList = creditDisplay._creditList; expect(lightboxCreditList.childNodes.length).toEqual(2); expect(lightboxCreditList.childNodes[0].childNodes[0]).toEqual( - credit1.element + credit1.element, ); expect(lightboxCreditList.childNodes[1].childNodes[0]).toEqual( - credit2.element + credit2.element, ); // Show credits on screen again @@ -607,10 +607,10 @@ describe("Scene/CreditDisplay", function () { const container2 = document.createElement("div"); const creditDisplay2 = new CreditDisplay(container2); expect(creditDisplay._currentCesiumCredit).toEqual( - creditDisplay2._currentCesiumCredit + creditDisplay2._currentCesiumCredit, ); expect(creditDisplay._currentCesiumCredit).not.toBe( - creditDisplay2._currentCesiumCredit + creditDisplay2._currentCesiumCredit, ); }); } diff --git a/packages/engine/Specs/Scene/DebugAppearanceSpec.js b/packages/engine/Specs/Scene/DebugAppearanceSpec.js index a83ed298e4d6..4301b7025c18 100644 --- a/packages/engine/Specs/Scene/DebugAppearanceSpec.js +++ b/packages/engine/Specs/Scene/DebugAppearanceSpec.js @@ -71,7 +71,7 @@ describe( expect(a.attributeName).toEqual("normal"); expect(a.glslDatatype).toEqual("vec3"); expect(a.renderState).toEqual( - Appearance.getDefaultRenderState(false, false) + Appearance.getDefaultRenderState(false, false), ); expect(a.translucent).toEqual(false); expect(a.closed).toEqual(false); @@ -94,7 +94,7 @@ describe( expect(a.attributeName).toEqual("st"); expect(a.glslDatatype).toEqual("vec2"); expect(a.renderState).toEqual( - Appearance.getDefaultRenderState(false, false) + Appearance.getDefaultRenderState(false, false), ); expect(a.translucent).toEqual(false); expect(a.closed).toEqual(false); @@ -118,7 +118,7 @@ describe( expect(a.attributeName).toEqual("rotation"); expect(a.glslDatatype).toEqual("float"); expect(a.renderState).toEqual( - Appearance.getDefaultRenderState(false, false) + Appearance.getDefaultRenderState(false, false), ); expect(a.translucent).toEqual(false); expect(a.closed).toEqual(false); @@ -142,7 +142,7 @@ describe( expect(a.attributeName).toEqual("str"); expect(a.glslDatatype).toEqual("vec3"); expect(a.renderState).toEqual( - Appearance.getDefaultRenderState(false, false) + Appearance.getDefaultRenderState(false, false), ); expect(a.translucent).toEqual(false); expect(a.closed).toEqual(false); @@ -161,14 +161,14 @@ describe( expect(a.fragmentShaderSource).toBeDefined(); expect(a.fragmentShaderSource.indexOf("v_quaternion")).toBeGreaterThan( - -1 + -1, ); expect(a.material).not.toBeDefined(); expect(a.attributeName).toEqual("quaternion"); expect(a.glslDatatype).toEqual("vec4"); expect(a.renderState).toEqual( - Appearance.getDefaultRenderState(false, false) + Appearance.getDefaultRenderState(false, false), ); expect(a.translucent).toEqual(false); expect(a.closed).toEqual(false); @@ -369,5 +369,5 @@ describe( expect(scene).notToRender([0, 0, 0, 255]); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/DebugCameraPrimitiveSpec.js b/packages/engine/Specs/Scene/DebugCameraPrimitiveSpec.js index 0b84e009b4aa..824066d4887a 100644 --- a/packages/engine/Specs/Scene/DebugCameraPrimitiveSpec.js +++ b/packages/engine/Specs/Scene/DebugCameraPrimitiveSpec.js @@ -21,7 +21,7 @@ describe( scene.camera.position = new Cartesian3(0.0, 0.0, 0.0); scene.camera.direction = Cartesian3.negate( Cartesian3.UNIT_X, - new Cartesian3() + new Cartesian3(), ); scene.camera.up = Cartesian3.clone(Cartesian3.UNIT_Z); scene.camera.frustum.near = 1.0; @@ -73,7 +73,7 @@ describe( scene.primitives.add( new DebugCameraPrimitive({ camera: camera, - }) + }), ); expect(scene).notToRender([0, 0, 0, 255]); }); @@ -83,7 +83,7 @@ describe( new DebugCameraPrimitive({ camera: camera, show: false, - }) + }), ); expect(scene).toRender([0, 0, 0, 255]); }); @@ -92,7 +92,7 @@ describe( const p = scene.primitives.add( new DebugCameraPrimitive({ camera: camera, - }) + }), ); scene.renderForSpecs(); const primitive = p._outlinePrimitives[0]; @@ -105,7 +105,7 @@ describe( new DebugCameraPrimitive({ camera: camera, updateOnChange: false, - }) + }), ); scene.renderForSpecs(); const primitive = p._primitive; @@ -118,7 +118,7 @@ describe( new DebugCameraPrimitive({ camera: camera, id: "id", - }) + }), ); expect(scene).toPickAndCall(function (result) { @@ -131,12 +131,12 @@ describe( const p = scene.primitives.add( new DebugCameraPrimitive({ camera: camera, - }) + }), ); expect(p.isDestroyed()).toEqual(false); scene.primitives.remove(p); expect(p.isDestroyed()).toEqual(true); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/DebugModelMatrixPrimitiveSpec.js b/packages/engine/Specs/Scene/DebugModelMatrixPrimitiveSpec.js index a48d463439a1..1ad701b090cd 100644 --- a/packages/engine/Specs/Scene/DebugModelMatrixPrimitiveSpec.js +++ b/packages/engine/Specs/Scene/DebugModelMatrixPrimitiveSpec.js @@ -62,7 +62,7 @@ describe( scene.primitives.add( new DebugModelMatrixPrimitive({ show: false, - }) + }), ); expect(scene).toRender([0, 0, 0, 255]); }); @@ -71,7 +71,7 @@ describe( const p = scene.primitives.add( new DebugModelMatrixPrimitive({ id: "id", - }) + }), ); expect(scene).toPickAndCall(function (result) { @@ -87,5 +87,5 @@ describe( expect(p.isDestroyed()).toEqual(true); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/DeviceOrientationCameraControllerSpec.js b/packages/engine/Specs/Scene/DeviceOrientationCameraControllerSpec.js index af76fa49b6d3..c74612efa46b 100644 --- a/packages/engine/Specs/Scene/DeviceOrientationCameraControllerSpec.js +++ b/packages/engine/Specs/Scene/DeviceOrientationCameraControllerSpec.js @@ -67,12 +67,12 @@ describe("Scene/DeviceOrientationCameraController", function () { expect(camera.position).toEqual(position); expect(camera.direction).toEqualEpsilon( Cartesian3.UNIT_Y, - CesiumMath.EPSILON14 + CesiumMath.EPSILON14, ); expect(camera.up).toEqualEpsilon(up, CesiumMath.EPSILON14); expect(camera.right).toEqualEpsilon( Cartesian3.UNIT_X, - CesiumMath.EPSILON14 + CesiumMath.EPSILON14, ); }); @@ -89,7 +89,7 @@ describe("Scene/DeviceOrientationCameraController", function () { expect(camera.up).toEqualEpsilon(Cartesian3.UNIT_Y, CesiumMath.EPSILON14); expect(camera.right).toEqualEpsilon( Cartesian3.UNIT_Z, - CesiumMath.EPSILON14 + CesiumMath.EPSILON14, ); }); @@ -104,7 +104,7 @@ describe("Scene/DeviceOrientationCameraController", function () { expect(camera.position).toEqual(position); expect(camera.direction).toEqualEpsilon( Cartesian3.negate(Cartesian3.UNIT_Z, new Cartesian3()), - CesiumMath.EPSILON14 + CesiumMath.EPSILON14, ); expect(camera.up).toEqualEpsilon(Cartesian3.UNIT_X, CesiumMath.EPSILON14); expect(camera.right).toEqualEpsilon(right, CesiumMath.EPSILON14); diff --git a/packages/engine/Specs/Scene/DiscardEmptyTileImagePolicySpec.js b/packages/engine/Specs/Scene/DiscardEmptyTileImagePolicySpec.js index d7e9ec1607d0..6da45e7870a3 100644 --- a/packages/engine/Specs/Scene/DiscardEmptyTileImagePolicySpec.js +++ b/packages/engine/Specs/Scene/DiscardEmptyTileImagePolicySpec.js @@ -20,7 +20,7 @@ describe("Scene/DiscardEmptyTileImagePolicy", function () { promises.push( pollToPromise(function () { return policy.isReady(); - }) + }), ); return Promise.all(promises, function (results) { @@ -39,7 +39,7 @@ describe("Scene/DiscardEmptyTileImagePolicy", function () { promises.push( pollToPromise(function () { return policy.isReady(); - }) + }), ); return Promise.all(promises, function (results) { diff --git a/packages/engine/Specs/Scene/DiscardMissingTileImagePolicySpec.js b/packages/engine/Specs/Scene/DiscardMissingTileImagePolicySpec.js index a10642594831..804d5826e59b 100644 --- a/packages/engine/Specs/Scene/DiscardMissingTileImagePolicySpec.js +++ b/packages/engine/Specs/Scene/DiscardMissingTileImagePolicySpec.js @@ -46,27 +46,25 @@ describe("Scene/DiscardMissingTileImagePolicy", function () { const missingImageUrl = "http://some.host.invalid/missingImage.png"; spyOn(Resource, "createImageBitmapFromBlob").and.callThrough(); - spyOn(Resource._Implementations, "createImage").and.callFake(function ( - request, - crossOrigin, - deferred - ) { - const url = request.url; - if (/^blob:/.test(url)) { - Resource._DefaultImplementations.createImage( - request, - crossOrigin, - deferred - ); - } else { - expect(url).toEqual(missingImageUrl); - Resource._DefaultImplementations.createImage( - new Request({ url: "Data/Images/Red16x16.png" }), - crossOrigin, - deferred - ); - } - }); + spyOn(Resource._Implementations, "createImage").and.callFake( + function (request, crossOrigin, deferred) { + const url = request.url; + if (/^blob:/.test(url)) { + Resource._DefaultImplementations.createImage( + request, + crossOrigin, + deferred, + ); + } else { + expect(url).toEqual(missingImageUrl); + Resource._DefaultImplementations.createImage( + new Request({ url: "Data/Images/Red16x16.png" }), + crossOrigin, + deferred, + ); + } + }, + ); Resource._Implementations.loadWithXhr = function ( url, @@ -75,7 +73,7 @@ describe("Scene/DiscardMissingTileImagePolicy", function () { data, headers, deferred, - overrideMimeType + overrideMimeType, ) { expect(url).toEqual(missingImageUrl); return Resource._DefaultImplementations.loadWithXhr( @@ -84,7 +82,7 @@ describe("Scene/DiscardMissingTileImagePolicy", function () { method, data, headers, - deferred + deferred, ); }; @@ -121,7 +119,7 @@ describe("Scene/DiscardMissingTileImagePolicy", function () { promises.push( pollToPromise(function () { return policy.isReady(); - }) + }), ); return Promise.all(promises, function (results) { @@ -147,7 +145,7 @@ describe("Scene/DiscardMissingTileImagePolicy", function () { promises.push( pollToPromise(function () { return policy.isReady(); - }) + }), ); return Promise.all(promises, function (results) { @@ -171,7 +169,7 @@ describe("Scene/DiscardMissingTileImagePolicy", function () { promises.push( pollToPromise(function () { return policy.isReady(); - }) + }), ); return Promise.all(promises, function (results) { diff --git a/packages/engine/Specs/Scene/DynamicAtmosphereLightingTypeSpec.js b/packages/engine/Specs/Scene/DynamicAtmosphereLightingTypeSpec.js index 71c1802eeca8..7f1f4a555bca 100644 --- a/packages/engine/Specs/Scene/DynamicAtmosphereLightingTypeSpec.js +++ b/packages/engine/Specs/Scene/DynamicAtmosphereLightingTypeSpec.js @@ -13,19 +13,19 @@ describe("Scene/DynamicAtmosphereLightingType", function () { const globe = mockGlobe(); expect(DynamicAtmosphereLightingType.fromGlobeFlags(globe)).toBe( - DynamicAtmosphereLightingType.NONE + DynamicAtmosphereLightingType.NONE, ); globe.enableLighting = true; expect(DynamicAtmosphereLightingType.fromGlobeFlags(globe)).toBe( - DynamicAtmosphereLightingType.NONE + DynamicAtmosphereLightingType.NONE, ); globe.enableLighting = false; globe.dynamicAtmosphereLighting = true; expect(DynamicAtmosphereLightingType.fromGlobeFlags(globe)).toBe( - DynamicAtmosphereLightingType.NONE + DynamicAtmosphereLightingType.NONE, ); }); @@ -36,12 +36,12 @@ describe("Scene/DynamicAtmosphereLightingType", function () { globe.dynamicAtmosphereLightingFromSun = true; expect(DynamicAtmosphereLightingType.fromGlobeFlags(globe)).toBe( - DynamicAtmosphereLightingType.SUNLIGHT + DynamicAtmosphereLightingType.SUNLIGHT, ); globe.dynamicAtmosphereLightingFromSun = false; expect(DynamicAtmosphereLightingType.fromGlobeFlags(globe)).toBe( - DynamicAtmosphereLightingType.SCENE_LIGHT + DynamicAtmosphereLightingType.SCENE_LIGHT, ); }); }); diff --git a/packages/engine/Specs/Scene/EllipsoidPrimitiveSpec.js b/packages/engine/Specs/Scene/EllipsoidPrimitiveSpec.js index c2b7e4092bfc..0452391632c9 100644 --- a/packages/engine/Specs/Scene/EllipsoidPrimitiveSpec.js +++ b/packages/engine/Specs/Scene/EllipsoidPrimitiveSpec.js @@ -81,7 +81,7 @@ describe( it("renders with a custom modelMatrix", function () { ellipsoid.radii = new Cartesian3(0.1, 0.1, 0.1); ellipsoid.modelMatrix = Matrix4.fromScale( - new Cartesian3(10.0, 10.0, 10.0) + new Cartesian3(10.0, 10.0, 10.0), ); expect(scene).toRender([0, 0, 0, 255]); @@ -119,7 +119,7 @@ describe( new EllipsoidPrimitive({ radii: new Cartesian3(1.0, 1.0, 1.0), debugShowBoundingVolume: true, - }) + }), ); const camera = scene.camera; @@ -199,5 +199,5 @@ describe( }).toThrowDeveloperError(); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/EllipsoidSurfaceAppearanceSpec.js b/packages/engine/Specs/Scene/EllipsoidSurfaceAppearanceSpec.js index b03e26ec9477..4d0f915cb398 100644 --- a/packages/engine/Specs/Scene/EllipsoidSurfaceAppearanceSpec.js +++ b/packages/engine/Specs/Scene/EllipsoidSurfaceAppearanceSpec.js @@ -47,7 +47,7 @@ describe( expect(a.vertexShaderSource).toBeDefined(); expect(a.fragmentShaderSource).toBeDefined(); expect(a.renderState).toEqual( - Appearance.getDefaultRenderState(true, true) + Appearance.getDefaultRenderState(true, true), ); expect(a.vertexFormat).toEqual(EllipsoidSurfaceAppearance.VERTEX_FORMAT); expect(a.flat).toEqual(false); @@ -78,5 +78,5 @@ describe( expect(scene).notToRender([0, 0, 0, 255]); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/ExpressionSpec.js b/packages/engine/Specs/Scene/ExpressionSpec.js index c1f1d8c9d7be..f5bfda1ca5d3 100644 --- a/packages/engine/Specs/Scene/ExpressionSpec.js +++ b/packages/engine/Specs/Scene/ExpressionSpec.js @@ -115,7 +115,7 @@ describe("Scene/Expression", function () { expect(expression.evaluate(feature)).toEqual(""); expression = new Expression( - "abs(-${height}) + max(${height}, ${width}) + clamp(${height}, 0, 2)" + "abs(-${height}) + max(${height}, ${width}) + clamp(${height}, 0, 2)", ); expect(expression.evaluate(feature)).toEqual(22); @@ -360,82 +360,82 @@ describe("Scene/Expression", function () { it("evaluates literal color", function () { let expression = new Expression("color('#ffffff')"); expect(expression.evaluate(undefined)).toEqual( - Cartesian4.fromColor(Color.WHITE) + Cartesian4.fromColor(Color.WHITE), ); expression = new Expression("color('#00FFFF')"); expect(expression.evaluate(undefined)).toEqual( - Cartesian4.fromColor(Color.CYAN) + Cartesian4.fromColor(Color.CYAN), ); expression = new Expression("color('#fff')"); expect(expression.evaluate(undefined)).toEqual( - Cartesian4.fromColor(Color.WHITE) + Cartesian4.fromColor(Color.WHITE), ); expression = new Expression("color('#0FF')"); expect(expression.evaluate(undefined)).toEqual( - Cartesian4.fromColor(Color.CYAN) + Cartesian4.fromColor(Color.CYAN), ); expression = new Expression("color('white')"); expect(expression.evaluate(undefined)).toEqual( - Cartesian4.fromColor(Color.WHITE) + Cartesian4.fromColor(Color.WHITE), ); expression = new Expression("color('cyan')"); expect(expression.evaluate(undefined)).toEqual( - Cartesian4.fromColor(Color.CYAN) + Cartesian4.fromColor(Color.CYAN), ); expression = new Expression("color('white', 0.5)"); expect(expression.evaluate(undefined)).toEqual( - Cartesian4.fromColor(Color.fromAlpha(Color.WHITE, 0.5)) + Cartesian4.fromColor(Color.fromAlpha(Color.WHITE, 0.5)), ); expression = new Expression("rgb(255, 255, 255)"); expect(expression.evaluate(undefined)).toEqual( - Cartesian4.fromColor(Color.WHITE) + Cartesian4.fromColor(Color.WHITE), ); expression = new Expression("rgb(100, 255, 190)"); expect(expression.evaluate(undefined)).toEqual( - Cartesian4.fromColor(Color.fromBytes(100, 255, 190)) + Cartesian4.fromColor(Color.fromBytes(100, 255, 190)), ); expression = new Expression("hsl(0, 0, 1)"); expect(expression.evaluate(undefined)).toEqual( - Cartesian4.fromColor(Color.WHITE) + Cartesian4.fromColor(Color.WHITE), ); expression = new Expression("hsl(1.0, 0.6, 0.7)"); expect(expression.evaluate(undefined)).toEqual( - Cartesian4.fromColor(Color.fromHsl(1.0, 0.6, 0.7)) + Cartesian4.fromColor(Color.fromHsl(1.0, 0.6, 0.7)), ); expression = new Expression("rgba(255, 255, 255, 0.5)"); expect(expression.evaluate(undefined)).toEqual( - Cartesian4.fromColor(Color.fromAlpha(Color.WHITE, 0.5)) + Cartesian4.fromColor(Color.fromAlpha(Color.WHITE, 0.5)), ); expression = new Expression("rgba(100, 255, 190, 0.25)"); expect(expression.evaluate(undefined)).toEqual( - Cartesian4.fromColor(Color.fromBytes(100, 255, 190, 0.25 * 255)) + Cartesian4.fromColor(Color.fromBytes(100, 255, 190, 0.25 * 255)), ); expression = new Expression("hsla(0, 0, 1, 0.5)"); expect(expression.evaluate(undefined)).toEqual( - Cartesian4.fromColor(new Color(1.0, 1.0, 1.0, 0.5)) + Cartesian4.fromColor(new Color(1.0, 1.0, 1.0, 0.5)), ); expression = new Expression("hsla(1.0, 0.6, 0.7, 0.75)"); expect(expression.evaluate(undefined)).toEqual( - Cartesian4.fromColor(Color.fromHsl(1.0, 0.6, 0.7, 0.75)) + Cartesian4.fromColor(Color.fromHsl(1.0, 0.6, 0.7, 0.75)), ); expression = new Expression("color()"); expect(expression.evaluate(undefined)).toEqual( - Cartesian4.fromColor(Color.WHITE) + Cartesian4.fromColor(Color.WHITE), ); }); @@ -456,7 +456,7 @@ describe("Scene/Expression", function () { expression = new Expression("color('white', 0.5)"); expect(expression.evaluate(undefined, color)).toEqual( - new Color(1.0, 1.0, 1.0, 0.5) + new Color(1.0, 1.0, 1.0, 0.5), ); expect(color).toEqual(new Color(1.0, 1.0, 1.0, 0.5)); @@ -470,13 +470,13 @@ describe("Scene/Expression", function () { expression = new Expression("rgba(255, 0, 255, 0.5)"); expect(expression.evaluate(undefined, color)).toEqual( - new Color(1.0, 0, 1.0, 0.5) + new Color(1.0, 0, 1.0, 0.5), ); expect(color).toEqual(new Color(1.0, 0, 1.0, 0.5)); expression = new Expression("hsla(0, 0, 1, 0.5)"); expect(expression.evaluate(undefined, color)).toEqual( - new Color(1.0, 1.0, 1.0, 0.5) + new Color(1.0, 1.0, 1.0, 0.5), ); expect(color).toEqual(new Color(1.0, 1.0, 1.0, 0.5)); @@ -494,17 +494,17 @@ describe("Scene/Expression", function () { let expression = new Expression("color(${hex6})"); expect(expression.evaluate(feature)).toEqual( - Cartesian4.fromColor(Color.WHITE) + Cartesian4.fromColor(Color.WHITE), ); expression = new Expression("color(${hex3})"); expect(expression.evaluate(feature)).toEqual( - Cartesian4.fromColor(Color.WHITE) + Cartesian4.fromColor(Color.WHITE), ); expression = new Expression("color(${keyword})"); expect(expression.evaluate(feature)).toEqual( - Cartesian4.fromColor(Color.WHITE) + Cartesian4.fromColor(Color.WHITE), ); expression = new Expression("color(${keyword}, ${alpha} + 0.6)"); @@ -522,12 +522,12 @@ describe("Scene/Expression", function () { let expression = new Expression("rgb(${red}, ${green}, ${blue})"); expect(expression.evaluate(feature)).toEqual( - Cartesian4.fromColor(Color.fromBytes(100, 200, 255)) + Cartesian4.fromColor(Color.fromBytes(100, 200, 255)), ); expression = new Expression("rgb(${red}/2, ${green}/2, ${blue})"); expect(expression.evaluate(feature)).toEqual( - Cartesian4.fromColor(Color.fromBytes(50, 100, 255)) + Cartesian4.fromColor(Color.fromBytes(50, 100, 255)), ); }); @@ -539,12 +539,12 @@ describe("Scene/Expression", function () { let expression = new Expression("hsl(${h}, ${s}, ${l})"); expect(expression.evaluate(feature)).toEqual( - Cartesian4.fromColor(Color.WHITE) + Cartesian4.fromColor(Color.WHITE), ); expression = new Expression("hsl(${h} + 0.2, ${s} + 1.0, ${l} - 0.5)"); expect(expression.evaluate(feature)).toEqual( - Cartesian4.fromColor(Color.fromHsl(0.2, 1.0, 0.5)) + Cartesian4.fromColor(Color.fromHsl(0.2, 1.0, 0.5)), ); }); @@ -557,14 +557,14 @@ describe("Scene/Expression", function () { let expression = new Expression("rgba(${red}, ${green}, ${blue}, ${a})"); expect(expression.evaluate(feature)).toEqual( - Cartesian4.fromColor(Color.fromBytes(100, 200, 255, 0.3 * 255)) + Cartesian4.fromColor(Color.fromBytes(100, 200, 255, 0.3 * 255)), ); expression = new Expression( - "rgba(${red}/2, ${green}/2, ${blue}, ${a} * 2)" + "rgba(${red}/2, ${green}/2, ${blue}, ${a} * 2)", ); expect(expression.evaluate(feature)).toEqual( - Cartesian4.fromColor(Color.fromBytes(50, 100, 255, 0.6 * 255)) + Cartesian4.fromColor(Color.fromBytes(50, 100, 255, 0.6 * 255)), ); }); @@ -577,14 +577,14 @@ describe("Scene/Expression", function () { let expression = new Expression("hsla(${h}, ${s}, ${l}, ${a})"); expect(expression.evaluate(feature)).toEqual( - Cartesian4.fromColor(Color.WHITE) + Cartesian4.fromColor(Color.WHITE), ); expression = new Expression( - "hsla(${h} + 0.2, ${s} + 1.0, ${l} - 0.5, ${a} / 4)" + "hsla(${h} + 0.2, ${s} + 1.0, ${l} - 0.5, ${a} / 4)", ); expect(expression.evaluate(feature)).toEqual( - Cartesian4.fromColor(Color.fromHsl(0.2, 1.0, 0.5, 0.25)) + Cartesian4.fromColor(Color.fromHsl(0.2, 1.0, 0.5, 0.25)), ); }); @@ -596,17 +596,17 @@ describe("Scene/Expression", function () { feature.addProperty("alpha", 0.5); let expression = new Expression( - "rgba(${red}, ${green}, ${blue}, ${alpha})" + "rgba(${red}, ${green}, ${blue}, ${alpha})", ); expect(expression.evaluate(feature)).toEqual( - Cartesian4.fromColor(Color.fromBytes(100, 200, 255, 0.5 * 255)) + Cartesian4.fromColor(Color.fromBytes(100, 200, 255, 0.5 * 255)), ); expression = new Expression( - "rgba(${red}/2, ${green}/2, ${blue}, ${alpha} + 0.1)" + "rgba(${red}/2, ${green}/2, ${blue}, ${alpha} + 0.1)", ); expect(expression.evaluate(feature)).toEqual( - Cartesian4.fromColor(Color.fromBytes(50, 100, 255, 0.6 * 255)) + Cartesian4.fromColor(Color.fromBytes(50, 100, 255, 0.6 * 255)), ); }); @@ -742,32 +742,32 @@ describe("Scene/Expression", function () { it("evaluates vec3", function () { let expression = new Expression("vec3(2.0)"); expect(expression.evaluate(undefined)).toEqual( - new Cartesian3(2.0, 2.0, 2.0) + new Cartesian3(2.0, 2.0, 2.0), ); expression = new Expression("vec3(3.0, 4.0, 5.0)"); expect(expression.evaluate(undefined)).toEqual( - new Cartesian3(3.0, 4.0, 5.0) + new Cartesian3(3.0, 4.0, 5.0), ); expression = new Expression("vec3(vec2(3.0, 4.0), 5.0)"); expect(expression.evaluate(undefined)).toEqual( - new Cartesian3(3.0, 4.0, 5.0) + new Cartesian3(3.0, 4.0, 5.0), ); expression = new Expression("vec3(3.0, vec2(4.0, 5.0))"); expect(expression.evaluate(undefined)).toEqual( - new Cartesian3(3.0, 4.0, 5.0) + new Cartesian3(3.0, 4.0, 5.0), ); expression = new Expression("vec3(vec3(3.0, 4.0, 5.0))"); expect(expression.evaluate(undefined)).toEqual( - new Cartesian3(3.0, 4.0, 5.0) + new Cartesian3(3.0, 4.0, 5.0), ); expression = new Expression("vec3(vec4(3.0, 4.0, 5.0, 6.0))"); expect(expression.evaluate(undefined)).toEqual( - new Cartesian3(3.0, 4.0, 5.0) + new Cartesian3(3.0, 4.0, 5.0), ); }); @@ -808,42 +808,42 @@ describe("Scene/Expression", function () { it("evaluates vec4", function () { let expression = new Expression("vec4(2.0)"); expect(expression.evaluate(undefined)).toEqual( - new Cartesian4(2.0, 2.0, 2.0, 2.0) + new Cartesian4(2.0, 2.0, 2.0, 2.0), ); expression = new Expression("vec4(3.0, 4.0, 5.0, 6.0)"); expect(expression.evaluate(undefined)).toEqual( - new Cartesian4(3.0, 4.0, 5.0, 6.0) + new Cartesian4(3.0, 4.0, 5.0, 6.0), ); expression = new Expression("vec4(vec2(3.0, 4.0), 5.0, 6.0)"); expect(expression.evaluate(undefined)).toEqual( - new Cartesian4(3.0, 4.0, 5.0, 6.0) + new Cartesian4(3.0, 4.0, 5.0, 6.0), ); expression = new Expression("vec4(3.0, vec2(4.0, 5.0), 6.0)"); expect(expression.evaluate(undefined)).toEqual( - new Cartesian4(3.0, 4.0, 5.0, 6.0) + new Cartesian4(3.0, 4.0, 5.0, 6.0), ); expression = new Expression("vec4(3.0, 4.0, vec2(5.0, 6.0))"); expect(expression.evaluate(undefined)).toEqual( - new Cartesian4(3.0, 4.0, 5.0, 6.0) + new Cartesian4(3.0, 4.0, 5.0, 6.0), ); expression = new Expression("vec4(vec3(3.0, 4.0, 5.0), 6.0)"); expect(expression.evaluate(undefined)).toEqual( - new Cartesian4(3.0, 4.0, 5.0, 6.0) + new Cartesian4(3.0, 4.0, 5.0, 6.0), ); expression = new Expression("vec4(3.0, vec3(4.0, 5.0, 6.0))"); expect(expression.evaluate(undefined)).toEqual( - new Cartesian4(3.0, 4.0, 5.0, 6.0) + new Cartesian4(3.0, 4.0, 5.0, 6.0), ); expression = new Expression("vec4(vec4(3.0, 4.0, 5.0, 6.0))"); expect(expression.evaluate(undefined)).toEqual( - new Cartesian4(3.0, 4.0, 5.0, 6.0) + new Cartesian4(3.0, 4.0, 5.0, 6.0), ); }); @@ -889,19 +889,19 @@ describe("Scene/Expression", function () { feature.addProperty("scale", 1); const expression = new Expression( - "vec4(${height}, ${width}, ${depth}, ${scale})" + "vec4(${height}, ${width}, ${depth}, ${scale})", ); expect(expression.evaluate(feature)).toEqual( - new Cartesian4(2.0, 4.0, 3.0, 1.0) + new Cartesian4(2.0, 4.0, 3.0, 1.0), ); }); it("evaluates expression with multiple nested vectors", function () { const expression = new Expression( - "vec4(vec2(1, 2)[vec3(6, 1, 5).y], 2, vec4(1.0).w, 5)" + "vec4(vec2(1, 2)[vec3(6, 1, 5).y], 2, vec4(1.0).w, 5)", ); expect(expression.evaluate(undefined)).toEqual( - new Cartesian4(2.0, 2.0, 1.0, 5.0) + new Cartesian4(2.0, 2.0, 1.0, 5.0), ); }); @@ -1396,53 +1396,53 @@ describe("Scene/Expression", function () { it("evaluates color operations", function () { let expression = new Expression("+rgba(255, 0, 0, 1.0)"); expect(expression.evaluate(undefined)).toEqual( - Cartesian4.fromColor(Color.RED) + Cartesian4.fromColor(Color.RED), ); expression = new Expression("rgba(255, 0, 0, 0.5) + rgba(0, 0, 255, 0.5)"); expect(expression.evaluate(undefined)).toEqual( - Cartesian4.fromColor(Color.MAGENTA) + Cartesian4.fromColor(Color.MAGENTA), ); expression = new Expression("rgba(0, 255, 255, 1.0) - rgba(0, 255, 0, 0)"); expect(expression.evaluate(undefined)).toEqual( - Cartesian4.fromColor(Color.BLUE) + Cartesian4.fromColor(Color.BLUE), ); expression = new Expression( - "rgba(255, 255, 255, 1.0) * rgba(255, 0, 0, 1.0)" + "rgba(255, 255, 255, 1.0) * rgba(255, 0, 0, 1.0)", ); expect(expression.evaluate(undefined)).toEqual( - Cartesian4.fromColor(Color.RED) + Cartesian4.fromColor(Color.RED), ); expression = new Expression("rgba(255, 255, 0, 1.0) * 1.0"); expect(expression.evaluate(undefined)).toEqual( - Cartesian4.fromColor(Color.YELLOW) + Cartesian4.fromColor(Color.YELLOW), ); expression = new Expression("1 * rgba(255, 255, 0, 1.0)"); expect(expression.evaluate(undefined)).toEqual( - Cartesian4.fromColor(Color.YELLOW) + Cartesian4.fromColor(Color.YELLOW), ); expression = new Expression( - "rgba(255, 255, 255, 1.0) / rgba(255, 255, 255, 1.0)" + "rgba(255, 255, 255, 1.0) / rgba(255, 255, 255, 1.0)", ); expect(expression.evaluate(undefined)).toEqual( - Cartesian4.fromColor(Color.WHITE) + Cartesian4.fromColor(Color.WHITE), ); expression = new Expression("rgba(255, 255, 255, 1.0) / 2"); expect(expression.evaluate(undefined)).toEqual( - Cartesian4.fromColor(new Color(0.5, 0.5, 0.5, 0.5)) + Cartesian4.fromColor(new Color(0.5, 0.5, 0.5, 0.5)), ); expression = new Expression( - "rgba(255, 255, 255, 1.0) % rgba(255, 255, 255, 1.0)" + "rgba(255, 255, 255, 1.0) % rgba(255, 255, 255, 1.0)", ); expect(expression.evaluate(undefined)).toEqual( - Cartesian4.fromColor(new Color(0, 0, 0, 0)) + Cartesian4.fromColor(new Color(0, 0, 0, 0)), ); expression = new Expression("color('green') === color('green')"); @@ -1470,7 +1470,7 @@ describe("Scene/Expression", function () { expression = new Expression("-vec4(1, 2, 3, 4)"); expect(expression.evaluate(undefined)).toEqual( - new Cartesian4(-1, -2, -3, -4) + new Cartesian4(-1, -2, -3, -4), ); expression = new Expression("vec2(1, 2) + vec2(3, 4)"); @@ -1490,7 +1490,7 @@ describe("Scene/Expression", function () { expression = new Expression("vec4(1, 2, 3, 4) - vec4(3, 4, 5, 6)"); expect(expression.evaluate(undefined)).toEqual( - new Cartesian4(-2, -2, -2, -2) + new Cartesian4(-2, -2, -2, -2), ); expression = new Expression("vec2(1, 2) * vec2(3, 4)"); @@ -1513,7 +1513,7 @@ describe("Scene/Expression", function () { expression = new Expression("vec4(1, 2, 3, 4) * vec4(3, 4, 5, 6)"); expect(expression.evaluate(undefined)).toEqual( - new Cartesian4(3, 8, 15, 24) + new Cartesian4(3, 8, 15, 24), ); expression = new Expression("vec4(1, 2, 3, 4) * 3.0"); @@ -1530,22 +1530,22 @@ describe("Scene/Expression", function () { expression = new Expression("vec3(1, 2, 3) / vec3(2, 5, 3)"); expect(expression.evaluate(undefined)).toEqual( - new Cartesian3(0.5, 0.4, 1.0) + new Cartesian3(0.5, 0.4, 1.0), ); expression = new Expression("vec3(1, 2, 3) / 2.0"); expect(expression.evaluate(undefined)).toEqual( - new Cartesian3(0.5, 1.0, 1.5) + new Cartesian3(0.5, 1.0, 1.5), ); expression = new Expression("vec4(1, 2, 3, 4) / vec4(2, 5, 3, 2)"); expect(expression.evaluate(undefined)).toEqual( - new Cartesian4(0.5, 0.4, 1.0, 2.0) + new Cartesian4(0.5, 0.4, 1.0, 2.0), ); expression = new Expression("vec4(1, 2, 3, 4) / 2.0"); expect(expression.evaluate(undefined)).toEqual( - new Cartesian4(0.5, 1.0, 1.5, 2.0) + new Cartesian4(0.5, 1.0, 1.5, 2.0), ); expression = new Expression("vec2(2, 3) % vec2(3, 3)"); @@ -1732,12 +1732,12 @@ describe("Scene/Expression", function () { expression = new Expression("abs(vec3(-1.0, 1.0, 0.0))"); expect(expression.evaluate(undefined)).toEqual( - new Cartesian3(1.0, 1.0, 0.0) + new Cartesian3(1.0, 1.0, 0.0), ); expression = new Expression("abs(vec4(-1.0, 1.0, 0.0, -1.2))"); expect(expression.evaluate(undefined)).toEqual( - new Cartesian4(1.0, 1.0, 0.0, 1.2) + new Cartesian4(1.0, 1.0, 0.0, 1.2), ); }); @@ -1758,19 +1758,19 @@ describe("Scene/Expression", function () { expression = new Expression("cos(vec2(0, Math.PI))"); expect(expression.evaluate(undefined)).toEqualEpsilon( new Cartesian2(1.0, -1.0), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expression = new Expression("cos(vec3(0, Math.PI, -Math.PI))"); expect(expression.evaluate(undefined)).toEqualEpsilon( new Cartesian3(1.0, -1.0, -1.0), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expression = new Expression("cos(vec4(0, Math.PI, -Math.PI, 0))"); expect(expression.evaluate(undefined)).toEqualEpsilon( new Cartesian4(1.0, -1.0, -1.0, 1.0), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); }); @@ -1791,19 +1791,19 @@ describe("Scene/Expression", function () { expression = new Expression("sin(vec2(0, Math.PI/2))"); expect(expression.evaluate(undefined)).toEqualEpsilon( new Cartesian2(0.0, 1.0), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expression = new Expression("sin(vec3(0, Math.PI/2, -Math.PI/2))"); expect(expression.evaluate(undefined)).toEqualEpsilon( new Cartesian3(0.0, 1.0, -1.0), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expression = new Expression("sin(vec4(0, Math.PI/2, -Math.PI/2, 0))"); expect(expression.evaluate(undefined)).toEqualEpsilon( new Cartesian4(0.0, 1.0, -1.0, 0.0), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); }); @@ -1824,19 +1824,19 @@ describe("Scene/Expression", function () { expression = new Expression("tan(vec2(0, Math.PI/4))"); expect(expression.evaluate(undefined)).toEqualEpsilon( new Cartesian2(0.0, 1.0), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expression = new Expression("tan(vec3(0, Math.PI/4, Math.PI))"); expect(expression.evaluate(undefined)).toEqualEpsilon( new Cartesian3(0.0, 1.0, 0.0), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expression = new Expression("tan(vec4(0, Math.PI/4, Math.PI, -Math.PI/4))"); expect(expression.evaluate(undefined)).toEqualEpsilon( new Cartesian4(0.0, 1.0, 0.0, -1.0), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); }); @@ -1857,13 +1857,13 @@ describe("Scene/Expression", function () { expression = new Expression("acos(vec2(1, 0))"); expect(expression.evaluate(undefined)).toEqualEpsilon( new Cartesian2(0.0, CesiumMath.PI_OVER_TWO), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expression = new Expression("acos(vec3(1, 0, 1))"); expect(expression.evaluate(undefined)).toEqualEpsilon( new Cartesian3(0.0, CesiumMath.PI_OVER_TWO, 0.0, CesiumMath.PI_OVER_TWO), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expression = new Expression("acos(vec4(1, 0, 1, 0))"); @@ -1873,9 +1873,9 @@ describe("Scene/Expression", function () { CesiumMath.PI_OVER_TWO, 0.0, CesiumMath.PI_OVER_TWO, - 0.0 + 0.0, ), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); }); @@ -1896,13 +1896,13 @@ describe("Scene/Expression", function () { expression = new Expression("asin(vec2(0, 1))"); expect(expression.evaluate(undefined)).toEqualEpsilon( new Cartesian2(0.0, CesiumMath.PI_OVER_TWO), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expression = new Expression("asin(vec3(0, 1, 0))"); expect(expression.evaluate(undefined)).toEqualEpsilon( new Cartesian3(0.0, CesiumMath.PI_OVER_TWO, 0.0, CesiumMath.PI_OVER_TWO), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expression = new Expression("asin(vec4(0, 1, 0, 1))"); @@ -1912,9 +1912,9 @@ describe("Scene/Expression", function () { CesiumMath.PI_OVER_TWO, 0.0, CesiumMath.PI_OVER_TWO, - 0.0 + 0.0, ), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); }); @@ -1935,7 +1935,7 @@ describe("Scene/Expression", function () { expression = new Expression("atan(vec2(0, 1))"); expect(expression.evaluate(undefined)).toEqualEpsilon( new Cartesian2(0.0, CesiumMath.PI_OVER_FOUR), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expression = new Expression("atan(vec3(0, 1, 0))"); @@ -1944,9 +1944,9 @@ describe("Scene/Expression", function () { 0.0, CesiumMath.PI_OVER_FOUR, 0.0, - CesiumMath.PI_OVER_FOUR + CesiumMath.PI_OVER_FOUR, ), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expression = new Expression("atan(vec4(0, 1, 0, 1))"); @@ -1956,9 +1956,9 @@ describe("Scene/Expression", function () { CesiumMath.PI_OVER_FOUR, 0.0, CesiumMath.PI_OVER_FOUR, - 0.0 + 0.0, ), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); }); @@ -1976,19 +1976,19 @@ describe("Scene/Expression", function () { let expression = new Expression("radians(180)"); expect(expression.evaluate(undefined)).toEqualEpsilon( Math.PI, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); expression = new Expression("radians(vec2(180, 90))"); expect(expression.evaluate(undefined)).toEqualEpsilon( new Cartesian2(Math.PI, CesiumMath.PI_OVER_TWO), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expression = new Expression("radians(vec3(180, 90, 180))"); expect(expression.evaluate(undefined)).toEqualEpsilon( new Cartesian3(Math.PI, CesiumMath.PI_OVER_TWO, Math.PI), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expression = new Expression("radians(vec4(180, 90, 180, 90))"); @@ -1997,9 +1997,9 @@ describe("Scene/Expression", function () { Math.PI, CesiumMath.PI_OVER_TWO, Math.PI, - CesiumMath.PI_OVER_TWO + CesiumMath.PI_OVER_TWO, ), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); }); @@ -2017,29 +2017,29 @@ describe("Scene/Expression", function () { let expression = new Expression("degrees(2 * Math.PI)"); expect(expression.evaluate(undefined)).toEqualEpsilon( 360, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); expression = new Expression("degrees(vec2(2 * Math.PI, Math.PI))"); expect(expression.evaluate(undefined)).toEqualEpsilon( new Cartesian2(360, 180), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expression = new Expression( - "degrees(vec3(2 * Math.PI, Math.PI, 2 * Math.PI))" + "degrees(vec3(2 * Math.PI, Math.PI, 2 * Math.PI))", ); expect(expression.evaluate(undefined)).toEqualEpsilon( new Cartesian3(360, 180, 360), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expression = new Expression( - "degrees(vec4(2 * Math.PI, Math.PI, 2 * Math.PI, Math.PI))" + "degrees(vec4(2 * Math.PI, Math.PI, 2 * Math.PI, Math.PI))", ); expect(expression.evaluate(undefined)).toEqualEpsilon( new Cartesian4(360, 180, 360, 180), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); }); @@ -2068,12 +2068,12 @@ describe("Scene/Expression", function () { expression = new Expression("sqrt(vec3(1.0, 4.0, 9.0))"); expect(expression.evaluate(undefined)).toEqual( - new Cartesian3(1.0, 2.0, 3.0) + new Cartesian3(1.0, 2.0, 3.0), ); expression = new Expression("sqrt(vec4(1.0, 4.0, 9.0, 16.0))"); expect(expression.evaluate(undefined)).toEqual( - new Cartesian4(1.0, 2.0, 3.0, 4.0) + new Cartesian4(1.0, 2.0, 3.0, 4.0), ); }); @@ -2102,12 +2102,12 @@ describe("Scene/Expression", function () { expression = new Expression("sign(vec3(5.0, -5.0, 0.0))"); expect(expression.evaluate(undefined)).toEqual( - new Cartesian3(1.0, -1.0, 0.0) + new Cartesian3(1.0, -1.0, 0.0), ); expression = new Expression("sign(vec4(5.0, -5.0, 0.0, 1.0))"); expect(expression.evaluate(undefined)).toEqual( - new Cartesian4(1.0, -1.0, 0.0, 1.0) + new Cartesian4(1.0, -1.0, 0.0, 1.0), ); }); @@ -2136,12 +2136,12 @@ describe("Scene/Expression", function () { expression = new Expression("floor(vec3(5.5, -1.2, 0.0))"); expect(expression.evaluate(undefined)).toEqual( - new Cartesian3(5.0, -2.0, 0.0) + new Cartesian3(5.0, -2.0, 0.0), ); expression = new Expression("floor(vec4(5.5, -1.2, 0.0, -2.9))"); expect(expression.evaluate(undefined)).toEqual( - new Cartesian4(5.0, -2.0, 0.0, -3.0) + new Cartesian4(5.0, -2.0, 0.0, -3.0), ); }); @@ -2170,12 +2170,12 @@ describe("Scene/Expression", function () { expression = new Expression("ceil(vec3(5.5, -1.2, 0.0))"); expect(expression.evaluate(undefined)).toEqual( - new Cartesian3(6.0, -1.0, 0.0) + new Cartesian3(6.0, -1.0, 0.0), ); expression = new Expression("ceil(vec4(5.5, -1.2, 0.0, -2.9))"); expect(expression.evaluate(undefined)).toEqual( - new Cartesian4(6.0, -1.0, 0.0, -2.0) + new Cartesian4(6.0, -1.0, 0.0, -2.0), ); }); @@ -2204,12 +2204,12 @@ describe("Scene/Expression", function () { expression = new Expression("round(vec3(5.5, -1.2, 0.0))"); expect(expression.evaluate(undefined)).toEqual( - new Cartesian3(6.0, -1.0, 0.0) + new Cartesian3(6.0, -1.0, 0.0), ); expression = new Expression("round(vec4(5.5, -1.2, 0.0, -2.9))"); expect(expression.evaluate(undefined)).toEqual( - new Cartesian4(6.0, -1.0, 0.0, -3.0) + new Cartesian4(6.0, -1.0, 0.0, -3.0), ); }); @@ -2227,31 +2227,31 @@ describe("Scene/Expression", function () { let expression = new Expression("exp(1.0)"); expect(expression.evaluate(undefined)).toEqualEpsilon( Math.E, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); expression = new Expression("exp(0.0)"); expect(expression.evaluate(undefined)).toEqualEpsilon( 1.0, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); expression = new Expression("exp(vec2(1.0, 0.0))"); expect(expression.evaluate(undefined)).toEqualEpsilon( new Cartesian2(Math.E, 1.0), - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); expression = new Expression("exp(vec3(1.0, 0.0, 1.0))"); expect(expression.evaluate(undefined)).toEqualEpsilon( new Cartesian3(Math.E, 1.0, Math.E), - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); expression = new Expression("exp(vec4(1.0, 0.0, 1.0, 0.0))"); expect(expression.evaluate(undefined)).toEqualEpsilon( new Cartesian4(Math.E, 1.0, Math.E, 1.0), - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); }); @@ -2280,12 +2280,12 @@ describe("Scene/Expression", function () { expression = new Expression("exp2(vec3(1.0, 0.0, 2.0))"); expect(expression.evaluate(undefined)).toEqual( - new Cartesian3(2.0, 1.0, 4.0) + new Cartesian3(2.0, 1.0, 4.0), ); expression = new Expression("exp2(vec4(1.0, 0.0, 2.0, 3.0))"); expect(expression.evaluate(undefined)).toEqual( - new Cartesian4(2.0, 1.0, 4.0, 8.0) + new Cartesian4(2.0, 1.0, 4.0, 8.0), ); }); @@ -2306,7 +2306,7 @@ describe("Scene/Expression", function () { expression = new Expression("log(10.0)"); expect(expression.evaluate(undefined)).toEqualEpsilon( 2.302585092994046, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expression = new Expression("log(vec2(1.0, Math.E))"); @@ -2314,12 +2314,12 @@ describe("Scene/Expression", function () { expression = new Expression("log(vec3(1.0, Math.E, 1.0))"); expect(expression.evaluate(undefined)).toEqual( - new Cartesian3(0.0, 1.0, 0.0) + new Cartesian3(0.0, 1.0, 0.0), ); expression = new Expression("log(vec4(1.0, Math.E, 1.0, Math.E))"); expect(expression.evaluate(undefined)).toEqual( - new Cartesian4(0.0, 1.0, 0.0, 1.0) + new Cartesian4(0.0, 1.0, 0.0, 1.0), ); }); @@ -2348,13 +2348,13 @@ describe("Scene/Expression", function () { expression = new Expression("log2(vec3(1.0, 2.0, 4.0))"); expect(expression.evaluate(undefined)).toEqual( - new Cartesian3(0.0, 1.0, 2.0) + new Cartesian3(0.0, 1.0, 2.0), ); expression = new Expression("log2(vec4(1.0, 2.0, 4.0, 8.0))"); expect(expression.evaluate(undefined)).toEqualEpsilon( new Cartesian4(0.0, 1.0, 2.0, 3.0), - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); }); @@ -2383,12 +2383,12 @@ describe("Scene/Expression", function () { expression = new Expression("fract(vec3(1.0, 2.25, -2.25))"); expect(expression.evaluate(undefined)).toEqual( - new Cartesian3(0.0, 0.25, 0.75) + new Cartesian3(0.0, 0.25, 0.75), ); expression = new Expression("fract(vec4(1.0, 2.25, -2.25, 1.0))"); expect(expression.evaluate(undefined)).toEqual( - new Cartesian4(0.0, 0.25, 0.75, 0.0) + new Cartesian4(0.0, 0.25, 0.75, 0.0), ); }); @@ -2437,14 +2437,14 @@ describe("Scene/Expression", function () { let length = Math.sqrt(2 * 2 + 3 * 3 + 4 * 4); expect(expression.evaluate(undefined)).toEqualEpsilon( new Cartesian3(2.0 / length, 3.0 / length, -4.0 / length), - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); expression = new Expression("normalize(vec4(-2.0, 3.0, -4.0, 5.0))"); length = Math.sqrt(2 * 2 + 3 * 3 + 4 * 4 + 5 * 5); expect(expression.evaluate(undefined)).toEqual( new Cartesian4(-2.0 / length, 3.0 / length, -4.0 / length, 5.0 / length), - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); }); @@ -2469,27 +2469,27 @@ describe("Scene/Expression", function () { expect(expression.evaluate(undefined)).toEqual(75.0); expression = new Expression( - "clamp(vec2(50.0,50.0), vec2(0.0,75.0), 100.0)" + "clamp(vec2(50.0,50.0), vec2(0.0,75.0), 100.0)", ); expect(expression.evaluate(undefined)).toEqual(new Cartesian2(50.0, 75.0)); expression = new Expression( - "clamp(vec2(50.0,50.0), vec2(0.0,75.0), vec2(25.0,100.0))" + "clamp(vec2(50.0,50.0), vec2(0.0,75.0), vec2(25.0,100.0))", ); expect(expression.evaluate(undefined)).toEqual(new Cartesian2(25.0, 75.0)); expression = new Expression( - "clamp(vec3(50.0, 50.0, 50.0), vec3(0.0, 0.0, 75.0), vec3(100.0, 25.0, 100.0))" + "clamp(vec3(50.0, 50.0, 50.0), vec3(0.0, 0.0, 75.0), vec3(100.0, 25.0, 100.0))", ); expect(expression.evaluate(undefined)).toEqual( - new Cartesian3(50.0, 25.0, 75.0) + new Cartesian3(50.0, 25.0, 75.0), ); expression = new Expression( - "clamp(vec4(50.0, 50.0, 50.0, 100.0), vec4(0.0, 0.0, 75.0, 75.0), vec4(100.0, 25.0, 100.0, 85.0))" + "clamp(vec4(50.0, 50.0, 50.0, 100.0), vec4(0.0, 0.0, 75.0, 75.0), vec4(100.0, 25.0, 100.0, 85.0))", ); expect(expression.evaluate(undefined)).toEqual( - new Cartesian4(50.0, 25.0, 75.0, 85.0) + new Cartesian4(50.0, 25.0, 75.0, 85.0), ); }); @@ -2536,22 +2536,22 @@ describe("Scene/Expression", function () { expect(expression.evaluate(undefined)).toEqual(new Cartesian2(1.0, 2.0)); expression = new Expression( - "mix(vec2(0.0,1.0), vec2(2.0,3.0), vec2(0.5,4.0))" + "mix(vec2(0.0,1.0), vec2(2.0,3.0), vec2(0.5,4.0))", ); expect(expression.evaluate(undefined)).toEqual(new Cartesian2(1.0, 9.0)); expression = new Expression( - "mix(vec3(0.0,1.0,2.0), vec3(2.0,3.0,4.0), vec3(0.5,4.0,5.0))" + "mix(vec3(0.0,1.0,2.0), vec3(2.0,3.0,4.0), vec3(0.5,4.0,5.0))", ); expect(expression.evaluate(undefined)).toEqual( - new Cartesian3(1.0, 9.0, 12.0) + new Cartesian3(1.0, 9.0, 12.0), ); expression = new Expression( - "mix(vec4(0.0,1.0,2.0,1.5), vec4(2.0,3.0,4.0,2.5), vec4(0.5,4.0,5.0,3.5))" + "mix(vec4(0.0,1.0,2.0,1.5), vec4(2.0,3.0,4.0,2.5), vec4(0.5,4.0,5.0,3.5))", ); expect(expression.evaluate(undefined)).toEqual( - new Cartesian4(1.0, 9.0, 12.0, 5.0) + new Cartesian4(1.0, 9.0, 12.0, 5.0), ); }); @@ -2594,31 +2594,31 @@ describe("Scene/Expression", function () { let expression = new Expression("atan2(0,1)"); expect(expression.evaluate(undefined)).toEqualEpsilon( 0.0, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); expression = new Expression("atan2(1,0)"); expect(expression.evaluate(undefined)).toEqualEpsilon( 0.5 * Math.PI, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); expression = new Expression("atan2(vec2(0,1),vec2(1,0))"); expect(expression.evaluate(undefined)).toEqualEpsilon( new Cartesian2(0.0, 0.5 * Math.PI), - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); expression = new Expression("atan2(vec3(0,1,0.5),vec3(1,0,0.5))"); expect(expression.evaluate(undefined)).toEqualEpsilon( new Cartesian3(0.0, 0.5 * Math.PI, 0.25 * Math.PI), - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); expression = new Expression("atan2(vec4(0,1,0.5,1),vec4(1,0,0.5,0))"); expect(expression.evaluate(undefined)).toEqualEpsilon( new Cartesian4(0.0, 0.5 * Math.PI, 0.25 * Math.PI, 0.5 * Math.PI), - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); }); @@ -2661,12 +2661,12 @@ describe("Scene/Expression", function () { expression = new Expression("pow(vec3(5,4,3),vec3(0,2,3))"); expect(expression.evaluate(undefined)).toEqual( - new Cartesian3(1.0, 16.0, 27.0) + new Cartesian3(1.0, 16.0, 27.0), ); expression = new Expression("pow(vec4(5,4,3,2),vec4(0,2,3,5))"); expect(expression.evaluate(undefined)).toEqual( - new Cartesian4(1.0, 16.0, 27.0, 32.0) + new Cartesian4(1.0, 16.0, 27.0, 32.0), ); }); @@ -2712,12 +2712,12 @@ describe("Scene/Expression", function () { expression = new Expression("min(vec3(-1,2,1),vec3(0,1,2))"); expect(expression.evaluate(undefined)).toEqual( - new Cartesian3(-1.0, 1.0, 1.0) + new Cartesian3(-1.0, 1.0, 1.0), ); expression = new Expression("min(vec4(-1,2,1,4),vec4(0,1,2,3))"); expect(expression.evaluate(undefined)).toEqual( - new Cartesian4(-1.0, 1.0, 1.0, 3.0) + new Cartesian4(-1.0, 1.0, 1.0, 3.0), ); }); @@ -2761,7 +2761,7 @@ describe("Scene/Expression", function () { expression = new Expression("max(vec4(-1,2,1,4),vec4(0,1,2,3))"); expect(expression.evaluate(undefined)).toEqual( - new Cartesian4(0, 2.0, 2.0, 4.0) + new Cartesian4(0, 2.0, 2.0, 4.0), ); }); @@ -2795,12 +2795,12 @@ describe("Scene/Expression", function () { expect(expression.evaluate(undefined)).toEqual(1.0); expression = new Expression( - "distance(vec3(3.0, 2.0, 1.0), vec3(1.0, 0.0, 0.0))" + "distance(vec3(3.0, 2.0, 1.0), vec3(1.0, 0.0, 0.0))", ); expect(expression.evaluate(undefined)).toEqual(3.0); expression = new Expression( - "distance(vec4(5.0, 5.0, 5.0, 5.0), vec4(0.0, 0.0, 0.0, 0.0))" + "distance(vec4(5.0, 5.0, 5.0, 5.0), vec4(0.0, 0.0, 0.0, 0.0))", ); expect(expression.evaluate(undefined)).toEqual(10.0); }); @@ -2822,7 +2822,7 @@ describe("Scene/Expression", function () { expect(function () { return new Expression( - "distance(vec4(5.0, 2.0, 3.0, 1.0), vec3(4.0, 4.0, 4.0))" + "distance(vec4(5.0, 2.0, 3.0, 1.0), vec3(4.0, 4.0, 4.0))", ).evaluate(undefined); }).toThrowError(RuntimeError); }); @@ -2835,12 +2835,12 @@ describe("Scene/Expression", function () { expect(expression.evaluate(undefined)).toEqual(4.0); expression = new Expression( - "dot(vec3(1.0, 2.0, 3.0), vec3(2.0, 2.0, 1.0))" + "dot(vec3(1.0, 2.0, 3.0), vec3(2.0, 2.0, 1.0))", ); expect(expression.evaluate(undefined)).toEqual(9.0); expression = new Expression( - "dot(vec4(5.0, 5.0, 2.0, 3.0), vec4(1.0, 2.0, 1.0, 1.0))" + "dot(vec4(5.0, 5.0, 2.0, 3.0), vec4(1.0, 2.0, 1.0, 1.0))", ); expect(expression.evaluate(undefined)).toEqual(20.0); }); @@ -2862,31 +2862,31 @@ describe("Scene/Expression", function () { expect(function () { return new Expression( - "dot(vec4(5.0, 2.0, 3.0, 1.0), vec3(4.0, 4.0, 4.0))" + "dot(vec4(5.0, 2.0, 3.0, 1.0), vec3(4.0, 4.0, 4.0))", ).evaluate(undefined); }).toThrowError(RuntimeError); }); it("evaluates the cross function", function () { let expression = new Expression( - "cross(vec3(1.0, 1.0, 1.0), vec3(2.0, 2.0, 2.0))" + "cross(vec3(1.0, 1.0, 1.0), vec3(2.0, 2.0, 2.0))", ); expect(expression.evaluate(undefined)).toEqual( - new Cartesian3(0.0, 0.0, 0.0) + new Cartesian3(0.0, 0.0, 0.0), ); expression = new Expression( - "cross(vec3(-1.0, -1.0, -1.0), vec3(0.0, -2.0, -5.0))" + "cross(vec3(-1.0, -1.0, -1.0), vec3(0.0, -2.0, -5.0))", ); expect(expression.evaluate(undefined)).toEqual( - new Cartesian3(3.0, -5.0, 2.0) + new Cartesian3(3.0, -5.0, 2.0), ); expression = new Expression( - "cross(vec3(5.0, -2.0, 1.0), vec3(-2.0, -6.0, -8.0))" + "cross(vec3(5.0, -2.0, 1.0), vec3(-2.0, -6.0, -8.0))", ); expect(expression.evaluate(undefined)).toEqual( - new Cartesian3(22.0, 38.0, -34.0) + new Cartesian3(22.0, 38.0, -34.0), ); }); @@ -2897,7 +2897,7 @@ describe("Scene/Expression", function () { expect(function () { return new Expression( - "cross(vec3(0.0, 0.0, 0.0), vec3(1.0, 1.0, 1.0), vec3(2.0, 2.0, 2.0))" + "cross(vec3(0.0, 0.0, 0.0), vec3(1.0, 1.0, 1.0), vec3(2.0, 2.0, 2.0))", ); }).toThrowError(RuntimeError); }); @@ -2905,13 +2905,13 @@ describe("Scene/Expression", function () { it("throws if cross function does not take vec3 arguments", function () { expect(function () { return new Expression("cross(vec2(1.0, 2.0), vec2(3.0, 2.0)").evaluate( - undefined + undefined, ); }).toThrowError(RuntimeError); expect(function () { return new Expression( - "cross(vec4(5.0, 2.0, 3.0, 1.0), vec3(4.0, 4.0, 4.0))" + "cross(vec4(5.0, 2.0, 3.0, 1.0), vec3(4.0, 4.0, 4.0))", ).evaluate(undefined); }).toThrowError(RuntimeError); }); @@ -2924,7 +2924,7 @@ describe("Scene/Expression", function () { expect(expression.evaluate(undefined)).toEqual("second"); expression = new Expression( - "(!(1 + 2 > 3)) ? (2 > 1 ? 1 + 1 : 0) : (2 > 1 ? -1 + -1 : 0)" + "(!(1 + 2 > 3)) ? (2 > 1 ? 1 + 1 : 0) : (2 > 1 ? -1 + -1 : 0)", ); expect(expression.evaluate(undefined)).toEqual(2); }); @@ -3092,13 +3092,13 @@ describe("Scene/Expression", function () { let expression = new Expression('regExp("a")'); expect(expression.evaluate(undefined)).toEqual(/a/); expect(expression._runtimeAst._type).toEqual( - ExpressionNodeType.LITERAL_REGEX + ExpressionNodeType.LITERAL_REGEX, ); expression = new Expression('regExp("\\w")'); expect(expression.evaluate(undefined)).toEqual(/\w/); expect(expression._runtimeAst._type).toEqual( - ExpressionNodeType.LITERAL_REGEX + ExpressionNodeType.LITERAL_REGEX, ); expression = new Expression("regExp(1 + 1)"); @@ -3108,13 +3108,13 @@ describe("Scene/Expression", function () { expression = new Expression("regExp(true)"); expect(expression.evaluate(undefined)).toEqual(/true/); expect(expression._runtimeAst._type).toEqual( - ExpressionNodeType.LITERAL_REGEX + ExpressionNodeType.LITERAL_REGEX, ); expression = new Expression("regExp()"); expect(expression.evaluate(undefined)).toEqual(/(?:)/); expect(expression._runtimeAst._type).toEqual( - ExpressionNodeType.LITERAL_REGEX + ExpressionNodeType.LITERAL_REGEX, ); expression = new Expression("regExp(${pattern})"); @@ -3126,7 +3126,7 @@ describe("Scene/Expression", function () { let expression = new Expression('regExp("a", "i")'); expect(expression.evaluate(undefined)).toEqual(/a/i); expect(expression._runtimeAst._type).toEqual( - ExpressionNodeType.LITERAL_REGEX + ExpressionNodeType.LITERAL_REGEX, ); expression = new Expression('regExp("a", "m" + "g")'); @@ -3167,7 +3167,7 @@ describe("Scene/Expression", function () { expect(expression.evaluate(undefined)).toEqual(false); expression = new Expression( - 'regExp("quick\\s(brown).+?(jumps)", "ig").test("The Quick Brown Fox Jumps Over The Lazy Dog")' + 'regExp("quick\\s(brown).+?(jumps)", "ig").test("The Quick Brown Fox Jumps Over The Lazy Dog")', ); expect(expression.evaluate(undefined)).toEqual(true); @@ -3205,12 +3205,12 @@ describe("Scene/Expression", function () { expect(expression.evaluate(undefined)).toEqual(null); expression = new Expression( - 'regExp("quick\\s(b.*n).+?(jumps)", "ig").exec("The Quick Brown Fox Jumps Over The Lazy Dog")' + 'regExp("quick\\s(b.*n).+?(jumps)", "ig").exec("The Quick Brown Fox Jumps Over The Lazy Dog")', ); expect(expression.evaluate(undefined)).toEqual("Brown"); expression = new Expression( - 'regExp("(" + ${property} + ")").exec(${property})' + 'regExp("(" + ${property} + ")").exec(${property})', ); expect(expression.evaluate(feature)).toEqual("abc"); @@ -3247,7 +3247,7 @@ describe("Scene/Expression", function () { expect(expression.evaluate(undefined)).toEqual(false); expression = new Expression( - 'regExp("quick\\s(brown).+?(jumps)", "ig") =~ "The Quick Brown Fox Jumps Over The Lazy Dog"' + 'regExp("quick\\s(brown).+?(jumps)", "ig") =~ "The Quick Brown Fox Jumps Over The Lazy Dog"', ); expect(expression.evaluate(undefined)).toEqual(true); @@ -3292,7 +3292,7 @@ describe("Scene/Expression", function () { expect(expression.evaluate(undefined)).toEqual(true); expression = new Expression( - 'regExp("quick\\s(brown).+?(jumps)", "ig") !~ "The Quick Brown Fox Jumps Over The Lazy Dog"' + 'regExp("quick\\s(brown).+?(jumps)", "ig") !~ "The Quick Brown Fox Jumps Over The Lazy Dog"', ); expect(expression.evaluate(undefined)).toEqual(false); @@ -3378,7 +3378,7 @@ describe("Scene/Expression", function () { expect(expression.evaluate(undefined)).toEqual([1, 2, 3]); expression = new Expression( - '[1+2, "hello", 2 < 3, color("blue"), ${property}]' + '[1+2, "hello", 2 < 3, color("blue"), ${property}]', ); expect(expression.evaluate(feature)).toEqual([ 3, @@ -3422,7 +3422,7 @@ describe("Scene/Expression", function () { "getShow()", {}, {}, - "bool" + "bool", ); const expected = "bool getShow()\n" + "{\n" + " return true;\n" + "}\n"; expect(shaderFunction).toEqual(expected); @@ -3435,7 +3435,7 @@ describe("Scene/Expression", function () { }; const shaderExpression = expression.getShaderExpression( variableSubstitutionMap, - {} + {}, ); const expected = "a_property"; expect(shaderExpression).toEqual(expected); @@ -3448,7 +3448,7 @@ describe("Scene/Expression", function () { }; const shaderExpression = expression.getShaderExpression( variableSubstitutionMap, - {} + {}, ); const expected = "a_property"; expect(shaderExpression).toEqual(expected); @@ -3461,7 +3461,7 @@ describe("Scene/Expression", function () { }; const shaderExpression = expression.getShaderExpression( variableSubstitutionMap, - {} + {}, ); const expected = "a_property"; expect(shaderExpression).toEqual(expected); @@ -3613,7 +3613,7 @@ describe("Scene/Expression", function () { let expression = new Expression("${property[0]}"); let shaderExpression = expression.getShaderExpression( variableSubstitutionMap, - {} + {}, ); let expected = "property[0]"; expect(shaderExpression).toEqual(expected); @@ -3621,7 +3621,7 @@ describe("Scene/Expression", function () { expression = new Expression("${property[4 / 2]}"); shaderExpression = expression.getShaderExpression( variableSubstitutionMap, - {} + {}, ); expected = "property[int((4.0 / 2.0))]"; expect(shaderExpression).toEqual(expected); @@ -3688,7 +3688,7 @@ describe("Scene/Expression", function () { let expression = new Expression("color()"); let shaderExpression = expression.getShaderExpression( variableSubstitutionMap, - shaderState + shaderState, ); let expected = "vec4(1.0)"; expect(shaderExpression).toEqual(expected); @@ -3698,7 +3698,7 @@ describe("Scene/Expression", function () { expression = new Expression('color("red")'); shaderExpression = expression.getShaderExpression( variableSubstitutionMap, - shaderState + shaderState, ); expected = "vec4(vec3(1.0, 0.0, 0.0), 1.0)"; expect(shaderExpression).toEqual(expected); @@ -3708,7 +3708,7 @@ describe("Scene/Expression", function () { expression = new Expression('color("#FFF")'); shaderExpression = expression.getShaderExpression( variableSubstitutionMap, - shaderState + shaderState, ); expected = "vec4(vec3(1.0, 1.0, 1.0), 1.0)"; expect(shaderExpression).toEqual(expected); @@ -3718,7 +3718,7 @@ describe("Scene/Expression", function () { expression = new Expression('color("#FF0000")'); shaderExpression = expression.getShaderExpression( variableSubstitutionMap, - shaderState + shaderState, ); expected = "vec4(vec3(1.0, 0.0, 0.0), 1.0)"; expect(shaderExpression).toEqual(expected); @@ -3728,7 +3728,7 @@ describe("Scene/Expression", function () { expression = new Expression('color("rgb(255, 0, 0)")'); shaderExpression = expression.getShaderExpression( variableSubstitutionMap, - shaderState + shaderState, ); expected = "vec4(vec3(1.0, 0.0, 0.0), 1.0)"; expect(shaderExpression).toEqual(expected); @@ -3738,7 +3738,7 @@ describe("Scene/Expression", function () { expression = new Expression('color("red", 0.5)'); shaderExpression = expression.getShaderExpression( variableSubstitutionMap, - shaderState + shaderState, ); expected = "vec4(vec3(1.0, 0.0, 0.0), 0.5)"; expect(shaderExpression).toEqual(expected); @@ -3748,7 +3748,7 @@ describe("Scene/Expression", function () { expression = new Expression("rgb(255, 0, 0)"); shaderExpression = expression.getShaderExpression( variableSubstitutionMap, - shaderState + shaderState, ); expected = "vec4(1.0, 0.0, 0.0, 1.0)"; expect(shaderExpression).toEqual(expected); @@ -3758,7 +3758,7 @@ describe("Scene/Expression", function () { expression = new Expression("rgb(255, ${property}, 0)"); shaderExpression = expression.getShaderExpression( variableSubstitutionMap, - shaderState + shaderState, ); expected = "vec4(255.0 / 255.0, property / 255.0, 0.0 / 255.0, 1.0)"; expect(shaderExpression).toEqual(expected); @@ -3768,7 +3768,7 @@ describe("Scene/Expression", function () { expression = new Expression("rgba(255, 0, 0, 0.5)"); shaderExpression = expression.getShaderExpression( variableSubstitutionMap, - shaderState + shaderState, ); expected = "vec4(1.0, 0.0, 0.0, 0.5)"; expect(shaderExpression).toEqual(expected); @@ -3778,7 +3778,7 @@ describe("Scene/Expression", function () { expression = new Expression("rgba(255, ${property}, 0, 0.5)"); shaderExpression = expression.getShaderExpression( variableSubstitutionMap, - shaderState + shaderState, ); expected = "vec4(255.0 / 255.0, property / 255.0, 0.0 / 255.0, 0.5)"; expect(shaderExpression).toEqual(expected); @@ -3788,7 +3788,7 @@ describe("Scene/Expression", function () { expression = new Expression("hsl(1.0, 0.5, 0.5)"); shaderExpression = expression.getShaderExpression( variableSubstitutionMap, - shaderState + shaderState, ); expected = "vec4(0.75, 0.25, 0.25, 1.0)"; expect(shaderExpression).toEqual(expected); @@ -3798,7 +3798,7 @@ describe("Scene/Expression", function () { expression = new Expression("hsla(1.0, 0.5, 0.5, 0.5)"); shaderExpression = expression.getShaderExpression( variableSubstitutionMap, - shaderState + shaderState, ); expected = "vec4(0.75, 0.25, 0.25, 0.5)"; expect(shaderExpression).toEqual(expected); @@ -3808,7 +3808,7 @@ describe("Scene/Expression", function () { expression = new Expression("hsl(1.0, ${property}, 0.5)"); shaderExpression = expression.getShaderExpression( variableSubstitutionMap, - shaderState + shaderState, ); expected = "vec4(czm_HSLToRGB(vec3(1.0, property, 0.5)), 1.0)"; expect(shaderExpression).toEqual(expected); @@ -3818,7 +3818,7 @@ describe("Scene/Expression", function () { expression = new Expression("hsla(1.0, ${property}, 0.5, 0.5)"); shaderExpression = expression.getShaderExpression( variableSubstitutionMap, - shaderState + shaderState, ); expected = "vec4(czm_HSLToRGB(vec3(1.0, property, 0.5)), 0.5)"; expect(shaderExpression).toEqual(expected); @@ -3828,7 +3828,7 @@ describe("Scene/Expression", function () { it("gets shader expression for color components", function () { // .r, .g, .b, .a let expression = new Expression( - "color().r + color().g + color().b + color().a" + "color().r + color().g + color().b + color().a", ); let shaderExpression = expression.getShaderExpression({}, {}); const expected = @@ -3837,14 +3837,14 @@ describe("Scene/Expression", function () { // .x, .y, .z, .w expression = new Expression( - "color().x + color().y + color().z + color().w" + "color().x + color().y + color().z + color().w", ); shaderExpression = expression.getShaderExpression({}, {}); expect(shaderExpression).toEqual(expected); // [0], [1], [2], [3] expression = new Expression( - "color()[0] + color()[1] + color()[2] + color()[3]" + "color()[0] + color()[1] + color()[2] + color()[3]", ); shaderExpression = expression.getShaderExpression({}, {}); expect(shaderExpression).toEqual(expected); @@ -3858,30 +3858,30 @@ describe("Scene/Expression", function () { let expression = new Expression("vec4(1, 2, 3, 4)"); let shaderExpression = expression.getShaderExpression( variableSubstitutionMap, - {} + {}, ); expect(shaderExpression).toEqual("vec4(1.0, 2.0, 3.0, 4.0)"); expression = new Expression("vec4(1) + vec4(2)"); shaderExpression = expression.getShaderExpression( variableSubstitutionMap, - {} + {}, ); expect(shaderExpression).toEqual("(vec4(1.0) + vec4(2.0))"); expression = new Expression("vec4(1, ${property}, vec2(1, 2).x, 0)"); shaderExpression = expression.getShaderExpression( variableSubstitutionMap, - {} + {}, ); expect(shaderExpression).toEqual( - "vec4(1.0, property, vec2(1.0, 2.0)[0], 0.0)" + "vec4(1.0, property, vec2(1.0, 2.0)[0], 0.0)", ); expression = new Expression("vec4(vec3(2), 1.0)"); shaderExpression = expression.getShaderExpression( variableSubstitutionMap, - {} + {}, ); expect(shaderExpression).toEqual("vec4(vec3(2.0), 1.0)"); }); @@ -3889,7 +3889,7 @@ describe("Scene/Expression", function () { it("gets shader expression for vector components", function () { // .x, .y, .z, .w let expression = new Expression( - "vec4(1).x + vec4(1).y + vec4(1).z + vec4(1).w" + "vec4(1).x + vec4(1).y + vec4(1).z + vec4(1).w", ); let shaderExpression = expression.getShaderExpression({}, {}); const expected = @@ -3898,7 +3898,7 @@ describe("Scene/Expression", function () { // [0], [1], [2], [3] expression = new Expression( - "vec4(1)[0] + vec4(1)[1] + vec4(1)[2] + vec4(1)[3]" + "vec4(1)[0] + vec4(1)[1] + vec4(1)[2] + vec4(1)[3]", ); shaderExpression = expression.getShaderExpression({}, {}); expect(shaderExpression).toEqual(expected); @@ -4102,7 +4102,7 @@ describe("Scene/Expression", function () { it("gets shader expression for cross", function () { const expression = new Expression( - "cross(vec3(1.0, 1.0, 1.0), vec3(2.0, 2.0, 2.0))" + "cross(vec3(1.0, 1.0, 1.0), vec3(2.0, 2.0, 2.0))", ); const shaderExpression = expression.getShaderExpression({}, {}); const expected = "cross(vec3(1.0, 1.0, 1.0), vec3(2.0, 2.0, 2.0))"; @@ -4139,7 +4139,7 @@ describe("Scene/Expression", function () { it("gets variables", function () { const expression = new Expression( - '${feature["w"]} + ${feature.x} + ${y} + ${y} + "${z}"' + '${feature["w"]} + ${feature.x} + ${y} + ${y} + "${z}"', ); const variables = expression.getVariables(); expect(variables.sort()).toEqual(["w", "x", "y", "z"]); diff --git a/packages/engine/Specs/Scene/FrameRateMonitorSpec.js b/packages/engine/Specs/Scene/FrameRateMonitorSpec.js index aee28edae5e0..3de2f8a5b8d9 100644 --- a/packages/engine/Specs/Scene/FrameRateMonitorSpec.js +++ b/packages/engine/Specs/Scene/FrameRateMonitorSpec.js @@ -252,5 +252,5 @@ describe( expect(nominalListener).toHaveBeenCalled(); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/Geometry3DTileContentSpec.js b/packages/engine/Specs/Scene/Geometry3DTileContentSpec.js index 344dca690ce5..6516c9ee6ed3 100644 --- a/packages/engine/Specs/Scene/Geometry3DTileContentSpec.js +++ b/packages/engine/Specs/Scene/Geometry3DTileContentSpec.js @@ -106,7 +106,7 @@ describe( }); } const depthColorAttribute = ColorGeometryInstanceAttribute.fromColor( - new Color(1.0, 0.0, 0.0, 1.0) + new Color(1.0, 0.0, 0.0, 1.0), ); depthColor = depthColorAttribute.value; return new Primitive({ @@ -165,7 +165,7 @@ describe( reusableGlobePrimitive = createPrimitive(rectangle, Pass.GLOBE); reusableTilesetPrimitive = createPrimitive( rectangle, - Pass.CESIUM_3D_TILE + Pass.CESIUM_3D_TILE, ); }); @@ -180,11 +180,11 @@ describe( globePrimitive = new MockPrimitive(reusableGlobePrimitive, Pass.GLOBE); tilesetPrimitive = new MockPrimitive( reusableTilesetPrimitive, - Pass.CESIUM_3D_TILE + Pass.CESIUM_3D_TILE, ); scene.camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(tilesetRectangle)), - new Cartesian3(0.0, 0.0, 0.01) + new Cartesian3(0.0, 0.0, 0.01), ); }); @@ -233,45 +233,45 @@ describe( tilesetRectangle.west, center.latitude, center.longitude, - tilesetRectangle.north + tilesetRectangle.north, ); const urRect = new Rectangle( center.longitude, center.longitude, tilesetRectangle.east, - tilesetRectangle.north + tilesetRectangle.north, ); const llRect = new Rectangle( tilesetRectangle.west, tilesetRectangle.south, center.longitude, - center.latitude + center.latitude, ); const lrRect = new Rectangle( center.longitude, tilesetRectangle.south, tilesetRectangle.east, - center.latitude + center.latitude, ); scene.camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(ulRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expectPick(scene); scene.camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(urRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expectPick(scene); scene.camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(llRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expectPick(scene); scene.camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(lrRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expectPick(scene); } @@ -282,45 +282,45 @@ describe( tilesetRectangle.west, center.latitude, center.longitude, - tilesetRectangle.north + tilesetRectangle.north, ); const urRect = new Rectangle( center.longitude, center.longitude, tilesetRectangle.east, - tilesetRectangle.north + tilesetRectangle.north, ); const llRect = new Rectangle( tilesetRectangle.west, tilesetRectangle.south, center.longitude, - center.latitude + center.latitude, ); const lrRect = new Rectangle( center.longitude, tilesetRectangle.south, tilesetRectangle.east, - center.latitude + center.latitude, ); scene.camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(ulRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toRender(color); scene.camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(urRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toRender(color); scene.camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(llRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toRender(color); scene.camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(lrRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toRender(color); } @@ -429,7 +429,7 @@ describe( scene.primitives.add(globePrimitive); return Cesium3DTilesTester.loadTileset( scene, - geometryBoxesBatchedChildren + geometryBoxesBatchedChildren, ) .then(function (tileset) { return verifyRender(tileset, scene); @@ -454,7 +454,7 @@ describe( scene.primitives.add(globePrimitive); return Cesium3DTilesTester.loadTileset( scene, - geometryBoxesBatchedChildrenWithBatchTable + geometryBoxesBatchedChildrenWithBatchTable, ) .then(function (tileset) { return verifyRender(tileset, scene); @@ -490,7 +490,7 @@ describe( scene.primitives.add(globePrimitive); return Cesium3DTilesTester.loadTileset( scene, - geometryCylindersBatchedChildren + geometryCylindersBatchedChildren, ) .then(function (tileset) { return verifyRender(tileset, scene); @@ -504,7 +504,7 @@ describe( scene.primitives.add(globePrimitive); return Cesium3DTilesTester.loadTileset( scene, - geometryCylindersWithBatchTable + geometryCylindersWithBatchTable, ) .then(function (tileset) { return verifyRender(tileset, scene); @@ -518,7 +518,7 @@ describe( scene.primitives.add(globePrimitive); return Cesium3DTilesTester.loadTileset( scene, - geometryCylindersBatchedChildrenWithBatchTable + geometryCylindersBatchedChildrenWithBatchTable, ) .then(function (tileset) { return verifyRender(tileset, scene); @@ -532,7 +532,7 @@ describe( scene.primitives.add(globePrimitive); return Cesium3DTilesTester.loadTileset( scene, - geometryCylindersWithBatchIds + geometryCylindersWithBatchIds, ) .then(function (tileset) { return verifyRender(tileset, scene); @@ -557,7 +557,7 @@ describe( scene.primitives.add(globePrimitive); return Cesium3DTilesTester.loadTileset( scene, - geometryEllipsoidsBatchedChildren + geometryEllipsoidsBatchedChildren, ) .then(function (tileset) { return verifyRender(tileset, scene); @@ -571,7 +571,7 @@ describe( scene.primitives.add(globePrimitive); return Cesium3DTilesTester.loadTileset( scene, - geometryEllipsoidsWithBatchTable + geometryEllipsoidsWithBatchTable, ) .then(function (tileset) { return verifyRender(tileset, scene); @@ -585,7 +585,7 @@ describe( scene.primitives.add(globePrimitive); return Cesium3DTilesTester.loadTileset( scene, - geometryEllipsoidsBatchedChildrenWithBatchTable + geometryEllipsoidsBatchedChildrenWithBatchTable, ) .then(function (tileset) { return verifyRender(tileset, scene); @@ -599,7 +599,7 @@ describe( scene.primitives.add(globePrimitive); return Cesium3DTilesTester.loadTileset( scene, - geometryEllipsoidsWithBatchIds + geometryEllipsoidsWithBatchIds, ) .then(function (tileset) { return verifyRender(tileset, scene); @@ -624,7 +624,7 @@ describe( scene.primitives.add(globePrimitive); return Cesium3DTilesTester.loadTileset( scene, - geometrySpheresBatchedChildren + geometrySpheresBatchedChildren, ) .then(function (tileset) { return verifyRender(tileset, scene); @@ -638,7 +638,7 @@ describe( scene.primitives.add(globePrimitive); return Cesium3DTilesTester.loadTileset( scene, - geometrySpheresWithBatchTable + geometrySpheresWithBatchTable, ) .then(function (tileset) { return verifyRender(tileset, scene); @@ -652,7 +652,7 @@ describe( scene.primitives.add(globePrimitive); return Cesium3DTilesTester.loadTileset( scene, - geometrySpheresBatchedChildrenWithBatchTable + geometrySpheresBatchedChildrenWithBatchTable, ) .then(function (tileset) { return verifyRender(tileset, scene); @@ -710,7 +710,7 @@ describe( scene.primitives.add(globePrimitive); return Cesium3DTilesTester.loadTileset( scene, - geometryAllBatchedChildrenWithBatchTable + geometryAllBatchedChildrenWithBatchTable, ) .then(function (tileset) { return verifyRender(tileset, scene); @@ -741,30 +741,30 @@ describe( tilesetRectangle.west, center.latitude, center.longitude, - tilesetRectangle.north + tilesetRectangle.north, ); const urRect = new Rectangle( center.longitude, center.longitude, tilesetRectangle.east, - tilesetRectangle.north + tilesetRectangle.north, ); const llRect = new Rectangle( tilesetRectangle.west, tilesetRectangle.south, center.longitude, - center.latitude + center.latitude, ); const lrRect = new Rectangle( center.longitude, tilesetRectangle.south, tilesetRectangle.east, - center.latitude + center.latitude, ); scene.camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(ulRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toRenderAndCall(function (rgba) { expect(rgba).not.toEqual([0, 0, 0, 255]); @@ -772,7 +772,7 @@ describe( }); scene.camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(urRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toRenderAndCall(function (rgba) { expect(rgba).not.toEqual([0, 0, 0, 255]); @@ -780,7 +780,7 @@ describe( }); scene.camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(llRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toRenderAndCall(function (rgba) { expect(rgba).not.toEqual([0, 0, 0, 255]); @@ -788,7 +788,7 @@ describe( }); scene.camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(lrRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toRenderAndCall(function (rgba) { expect(rgba).not.toEqual([0, 0, 0, 255]); @@ -800,7 +800,7 @@ describe( it("can get features and properties", function () { return Cesium3DTilesTester.loadTileset( scene, - geometryBoxesWithBatchTable + geometryBoxesWithBatchTable, ).then(function (tileset) { const content = tileset.root.content; expect(content.featuresLength).toBe(1); @@ -813,7 +813,7 @@ describe( it("throws when calling getFeature with invalid index", function () { return Cesium3DTilesTester.loadTileset( scene, - geometryBoxesWithBatchTable + geometryBoxesWithBatchTable, ).then(function (tileset) { const content = tileset.root.content; expect(function () { @@ -833,10 +833,10 @@ describe( version: 2, }); await expectAsync( - Cesium3DTilesTester.createContentForMockTile(arrayBuffer, "geom") + Cesium3DTilesTester.createContentForMockTile(arrayBuffer, "geom"), ).toBeRejectedWithError( RuntimeError, - "Only Geometry tile version 1 is supported. Version 2 is not." + "Only Geometry tile version 1 is supported. Version 2 is not.", ); }); @@ -845,10 +845,10 @@ describe( defineFeatureTable: false, }); await expectAsync( - Cesium3DTilesTester.createContentForMockTile(arrayBuffer, "geom") + Cesium3DTilesTester.createContentForMockTile(arrayBuffer, "geom"), ).toBeRejectedWithError( RuntimeError, - "Feature table must have a byte length greater than zero" + "Feature table must have a byte length greater than zero", ); }); @@ -863,17 +863,17 @@ describe( ellipsoidBatchIds: [2], }); await expectAsync( - Cesium3DTilesTester.createContentForMockTile(arrayBuffer, "geom") + Cesium3DTilesTester.createContentForMockTile(arrayBuffer, "geom"), ).toBeRejectedWithError( RuntimeError, - "If one group of batch ids is defined, then all batch ids must be defined" + "If one group of batch ids is defined, then all batch ids must be defined", ); }); it("destroys", function () { return Cesium3DTilesTester.loadTileset( scene, - geometryBoxesWithBatchTable + geometryBoxesWithBatchTable, ).then(function (tileset) { expect(tileset.isDestroyed()).toEqual(false); scene.primitives.remove(tileset); @@ -948,7 +948,7 @@ describe( metadata: groupMetadata, }); expect(content.group.metadata).toBe(groupMetadata); - } + }, ); }); @@ -958,10 +958,10 @@ describe( const content = tileset.root.content; content.metadata = contentMetadata; expect(content.metadata).toBe(contentMetadata); - } + }, ); }); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/GeometryRenderingSpec.js b/packages/engine/Specs/Scene/GeometryRenderingSpec.js index 316131be6ef1..8afb4f78b93f 100644 --- a/packages/engine/Specs/Scene/GeometryRenderingSpec.js +++ b/packages/engine/Specs/Scene/GeometryRenderingSpec.js @@ -232,10 +232,10 @@ describe( }), modelMatrix: Matrix4.multiplyByTranslation( Transforms.eastNorthUpToFixedFrame( - Cartesian3.fromDegrees(-75.59777, 40.03883) + Cartesian3.fromDegrees(-75.59777, 40.03883), ), new Cartesian3(0.0, 0.0, 100000.0), - new Matrix4() + new Matrix4(), ), id: "box", attributes: { @@ -245,7 +245,7 @@ describe( geometry = BoxGeometry.createGeometry(instance.geometry); geometry.boundingSphereWC = BoundingSphere.transform( geometry.boundingSphere, - instance.modelMatrix + instance.modelMatrix, ); }); @@ -269,7 +269,7 @@ describe( return renderAsync(instance); }); }, - "WebGL" + "WebGL", ); describe( @@ -283,10 +283,10 @@ describe( }), modelMatrix: Matrix4.multiplyByTranslation( Transforms.eastNorthUpToFixedFrame( - Cartesian3.fromDegrees(-75.59777, 40.03883) + Cartesian3.fromDegrees(-75.59777, 40.03883), ), new Cartesian3(0.0, 0.0, 100000.0), - new Matrix4() + new Matrix4(), ), id: "plane", attributes: { @@ -296,7 +296,7 @@ describe( geometry = PlaneGeometry.createGeometry(instance.geometry); geometry.boundingSphereWC = BoundingSphere.transform( geometry.boundingSphere, - instance.modelMatrix + instance.modelMatrix, ); }); @@ -320,7 +320,7 @@ describe( return renderAsync(instance); }); }, - "WebGL" + "WebGL", ); describe( @@ -343,7 +343,7 @@ describe( geometry = CircleGeometry.createGeometry(instance.geometry); geometry.boundingSphereWC = BoundingSphere.transform( geometry.boundingSphere, - instance.modelMatrix + instance.modelMatrix, ); }); @@ -367,7 +367,7 @@ describe( return renderAsync(instance); }); }, - "WebGL" + "WebGL", ); describe("CoplanarPolygonGeometry", function () { @@ -376,18 +376,8 @@ describe( instance = new GeometryInstance({ geometry: CoplanarPolygonGeometry.fromPositions({ positions: Cartesian3.fromDegreesArrayHeights([ - 71.0, - -10.0, - 0.0, - 70.0, - 0.0, - 20000.0, - 69.0, - 0.0, - 20000.0, - 68.0, - -10.0, - 0.0, + 71.0, -10.0, 0.0, 70.0, 0.0, 20000.0, 69.0, 0.0, 20000.0, 68.0, + -10.0, 0.0, ]), vertexFormat: PerInstanceColorAppearance.FLAT_VERTEX_FORMAT, }), @@ -397,14 +387,14 @@ describe( Math.random(), Math.random(), Math.random(), - 0.5 + 0.5, ), }, }); geometry = CoplanarPolygonGeometry.createGeometry(instance.geometry); geometry.boundingSphereWC = BoundingSphere.transform( geometry.boundingSphere, - instance.modelMatrix + instance.modelMatrix, ); }); @@ -445,27 +435,27 @@ describe( modelMatrix: Matrix4.multiplyByUniformScale( Matrix4.multiplyByTranslation( Transforms.eastNorthUpToFixedFrame( - Cartesian3.fromDegrees(-90.0, 45.0) + Cartesian3.fromDegrees(-90.0, 45.0), ), new Cartesian3(0.0, 0.0, 500000.0), - new Matrix4() + new Matrix4(), ), 90000.0, - new Matrix4() + new Matrix4(), ), attributes: { color: new ColorGeometryInstanceAttribute( Math.random(), Math.random(), Math.random(), - 0.5 + 0.5, ), }, }); geometry = CylinderGeometry.createGeometry(instance.geometry); geometry.boundingSphereWC = BoundingSphere.transform( geometry.boundingSphere, - instance.modelMatrix + instance.modelMatrix, ); }); @@ -489,7 +479,7 @@ describe( return renderAsync(instance); }); }, - "WebGL" + "WebGL", ); describe( @@ -513,7 +503,7 @@ describe( geometry = EllipseGeometry.createGeometry(instance.geometry); geometry.boundingSphereWC = BoundingSphere.transform( geometry.boundingSphere, - instance.modelMatrix + instance.modelMatrix, ); }); @@ -555,7 +545,7 @@ describe( geometry = EllipseGeometry.createGeometry(rotated.geometry); geometry.boundingSphereWC = BoundingSphere.transform( geometry.boundingSphere, - instance.modelMatrix + instance.modelMatrix, ); render3D(rotated); }); @@ -578,12 +568,12 @@ describe( geometry = EllipseGeometry.createGeometry(atHeight.geometry); geometry.boundingSphereWC = BoundingSphere.transform( geometry.boundingSphere, - instance.modelMatrix + instance.modelMatrix, ); render3D(atHeight); }); }, - "WebGL" + "WebGL", ); describe( @@ -613,7 +603,7 @@ describe( geometry = EllipseGeometry.createGeometry(instance.geometry); geometry.boundingSphereWC = BoundingSphere.transform( geometry.boundingSphere, - instance.modelMatrix + instance.modelMatrix, ); }); @@ -642,14 +632,14 @@ describe( const height = (extrudedHeight - geometryHeight) * 0.5; const transform = Matrix4.multiplyByTranslation( Transforms.eastNorthUpToFixedFrame( - geometry.boundingSphere.center + geometry.boundingSphere.center, ), new Cartesian3(0.0, 0.0, height), - new Matrix4() + new Matrix4(), ); scene.camera.lookAtTransform( transform, - new Cartesian3(0.0, 0.0, geometry.boundingSphere.radius) + new Cartesian3(0.0, 0.0, geometry.boundingSphere.radius), ); scene.camera.rotateDown(CesiumMath.PI); } @@ -659,18 +649,18 @@ describe( it("renders wall", function () { function afterView() { const transform = Transforms.eastNorthUpToFixedFrame( - geometry.boundingSphere.center + geometry.boundingSphere.center, ); scene.camera.lookAtTransform( transform, - new Cartesian3(0.0, 0.0, geometry.boundingSphere.radius) + new Cartesian3(0.0, 0.0, geometry.boundingSphere.radius), ); scene.camera.rotateDown(CesiumMath.PI_OVER_TWO); } render3D(instance, afterView); }); }, - "WebGL" + "WebGL", ); describe( @@ -685,10 +675,10 @@ describe( }), modelMatrix: Matrix4.multiplyByTranslation( Transforms.eastNorthUpToFixedFrame( - Cartesian3.fromDegrees(-100, 20) + Cartesian3.fromDegrees(-100, 20), ), new Cartesian3(0.0, 0.0, 1000000.0), - new Matrix4() + new Matrix4(), ), id: "ellipsoid", attributes: { @@ -698,7 +688,7 @@ describe( geometry = EllipsoidGeometry.createGeometry(instance.geometry); geometry.boundingSphereWC = BoundingSphere.transform( geometry.boundingSphere, - instance.modelMatrix + instance.modelMatrix, ); }); @@ -722,7 +712,7 @@ describe( return renderAsync(instance); }); }, - "WebGL" + "WebGL", ); describe( @@ -737,10 +727,10 @@ describe( }), modelMatrix: Matrix4.multiplyByTranslation( Transforms.eastNorthUpToFixedFrame( - Cartesian3.fromDegrees(-100, 20) + Cartesian3.fromDegrees(-100, 20), ), new Cartesian3(0.0, 0.0, 1000000.0), - new Matrix4() + new Matrix4(), ), id: "sphere", attributes: { @@ -750,7 +740,7 @@ describe( geometry = SphereGeometry.createGeometry(instance.geometry); geometry.boundingSphereWC = BoundingSphere.transform( geometry.boundingSphere, - instance.modelMatrix + instance.modelMatrix, ); }); @@ -774,7 +764,7 @@ describe( return renderAsync(instance); }); }, - "WebGL" + "WebGL", ); describe( @@ -798,7 +788,7 @@ describe( geometry = RectangleGeometry.createGeometry(instance.geometry); geometry.boundingSphereWC = BoundingSphere.transform( geometry.boundingSphere, - instance.modelMatrix + instance.modelMatrix, ); }); @@ -837,7 +827,7 @@ describe( geometry = RectangleGeometry.createGeometry(rotated.geometry); geometry.boundingSphereWC = BoundingSphere.transform( geometry.boundingSphere, - instance.modelMatrix + instance.modelMatrix, ); render3D(rotated); }); @@ -857,7 +847,7 @@ describe( geometry = RectangleGeometry.createGeometry(rotated.geometry); geometry.boundingSphereWC = BoundingSphere.transform( geometry.boundingSphere, - instance.modelMatrix + instance.modelMatrix, ); render3D(rotated, undefined, appearance); }); @@ -877,12 +867,12 @@ describe( geometry = RectangleGeometry.createGeometry(atHeight.geometry); geometry.boundingSphereWC = BoundingSphere.transform( geometry.boundingSphere, - instance.modelMatrix + instance.modelMatrix, ); render3D(atHeight); }); }, - "WebGL" + "WebGL", ); describe( @@ -912,7 +902,7 @@ describe( geometry = RectangleGeometry.createGeometry(instance.geometry); geometry.boundingSphereWC = BoundingSphere.transform( geometry.boundingSphere, - instance.modelMatrix + instance.modelMatrix, ); }); @@ -939,11 +929,11 @@ describe( it("renders bottom", function () { function afterView() { const transform = Transforms.eastNorthUpToFixedFrame( - geometry.boundingSphereWC.center + geometry.boundingSphereWC.center, ); scene.camera.lookAtTransform( transform, - new Cartesian3(0.0, 0.0, geometry.boundingSphereWC.radius) + new Cartesian3(0.0, 0.0, geometry.boundingSphereWC.radius), ); scene.camera.rotateDown(CesiumMath.PI); } @@ -953,11 +943,11 @@ describe( it("renders north wall", function () { function afterView() { const transform = Transforms.eastNorthUpToFixedFrame( - geometry.boundingSphereWC.center + geometry.boundingSphereWC.center, ); scene.camera.lookAtTransform( transform, - new Cartesian3(0.0, 0.0, geometry.boundingSphereWC.radius) + new Cartesian3(0.0, 0.0, geometry.boundingSphereWC.radius), ); scene.camera.rotateDown(-CesiumMath.PI_OVER_TWO); } @@ -967,11 +957,11 @@ describe( it("renders south wall", function () { function afterView() { const transform = Transforms.eastNorthUpToFixedFrame( - geometry.boundingSphereWC.center + geometry.boundingSphereWC.center, ); scene.camera.lookAtTransform( transform, - new Cartesian3(0.0, 0.0, geometry.boundingSphereWC.radius) + new Cartesian3(0.0, 0.0, geometry.boundingSphereWC.radius), ); scene.camera.rotateDown(CesiumMath.PI_OVER_TWO); } @@ -981,11 +971,11 @@ describe( it("renders west wall", function () { function afterView() { const transform = Transforms.eastNorthUpToFixedFrame( - geometry.boundingSphereWC.center + geometry.boundingSphereWC.center, ); scene.camera.lookAtTransform( transform, - new Cartesian3(0.0, 0.0, geometry.boundingSphereWC.radius) + new Cartesian3(0.0, 0.0, geometry.boundingSphereWC.radius), ); scene.camera.rotateRight(-CesiumMath.PI_OVER_TWO); } @@ -995,18 +985,18 @@ describe( it("renders east wall", function () { function afterView() { const transform = Transforms.eastNorthUpToFixedFrame( - geometry.boundingSphereWC.center + geometry.boundingSphereWC.center, ); scene.camera.lookAtTransform( transform, - new Cartesian3(0.0, 0.0, geometry.boundingSphereWC.radius) + new Cartesian3(0.0, 0.0, geometry.boundingSphereWC.radius), ); scene.camera.rotateRight(CesiumMath.PI_OVER_TWO); } render3D(instance, afterView); }); }, - "WebGL" + "WebGL", ); describe( @@ -1019,14 +1009,7 @@ describe( vertexFormat: PerInstanceColorAppearance.FLAT_VERTEX_FORMAT, ellipsoid: ellipsoid, positions: Cartesian3.fromDegreesArray([ - 0.0, - 45.0, - 10.0, - 45.0, - 10.0, - 55.0, - 0.0, - 55.0, + 0.0, 45.0, 10.0, 45.0, 10.0, 55.0, 0.0, 55.0, ]), }), id: "polygon", @@ -1037,7 +1020,7 @@ describe( geometry = PolygonGeometry.createGeometry(instance.geometry); geometry.boundingSphereWC = BoundingSphere.transform( geometry.boundingSphere, - instance.modelMatrix + instance.modelMatrix, ); }); @@ -1067,14 +1050,7 @@ describe( vertexFormat: PerInstanceColorAppearance.FLAT_VERTEX_FORMAT, ellipsoid: ellipsoid, positions: Cartesian3.fromDegreesArray([ - 0.0, - 45.0, - 10.0, - 45.0, - 10.0, - 55.0, - 0.0, - 55.0, + 0.0, 45.0, 10.0, 45.0, 10.0, 55.0, 0.0, 55.0, ]), height: 3000000.0, }), @@ -1086,7 +1062,7 @@ describe( geometry = PolygonGeometry.createGeometry(atHeight.geometry); geometry.boundingSphereWC = BoundingSphere.transform( geometry.boundingSphere, - atHeight.modelMatrix + atHeight.modelMatrix, ); render3D(atHeight); }); @@ -1097,38 +1073,17 @@ describe( vertexFormat: PerInstanceColorAppearance.FLAT_VERTEX_FORMAT, polygonHierarchy: { positions: Cartesian3.fromDegreesArray([ - -109.0, - 30.0, - -95.0, - 30.0, - -95.0, - 40.0, - -109.0, - 40.0, + -109.0, 30.0, -95.0, 30.0, -95.0, 40.0, -109.0, 40.0, ]), holes: [ { positions: Cartesian3.fromDegreesArray([ - -107.0, - 31.0, - -107.0, - 39.0, - -97.0, - 39.0, - -97.0, - 31.0, + -107.0, 31.0, -107.0, 39.0, -97.0, 39.0, -97.0, 31.0, ]), holes: [ { positions: Cartesian3.fromDegreesArray([ - -106.5, - 31.5, - -97.5, - 31.5, - -97.5, - 38.5, - -106.5, - 38.5, + -106.5, 31.5, -97.5, 31.5, -97.5, 38.5, -106.5, 38.5, ]), }, ], @@ -1144,12 +1099,12 @@ describe( geometry = PolygonGeometry.createGeometry(hierarchy.geometry); geometry.boundingSphereWC = BoundingSphere.transform( geometry.boundingSphere, - hierarchy.modelMatrix + hierarchy.modelMatrix, ); render3D(hierarchy); }); }, - "WebGL" + "WebGL", ); describe( @@ -1168,14 +1123,7 @@ describe( vertexFormat: PerInstanceColorAppearance.FLAT_VERTEX_FORMAT, ellipsoid: ellipsoid, positions: Cartesian3.fromDegreesArray([ - -1.0, - -1.0, - 1.0, - -1.0, - 1.0, - 1.0, - -1.0, - 1.0, + -1.0, -1.0, 1.0, -1.0, 1.0, 1.0, -1.0, 1.0, ]), height: geometryHeight, extrudedHeight: extrudedHeight, @@ -1188,7 +1136,7 @@ describe( geometry = PolygonGeometry.createGeometry(instance.geometry); geometry.boundingSphereWC = BoundingSphere.transform( geometry.boundingSphere, - instance.modelMatrix + instance.modelMatrix, ); }); @@ -1217,14 +1165,14 @@ describe( const height = (extrudedHeight - geometryHeight) * 0.5; const transform = Matrix4.multiplyByTranslation( Transforms.eastNorthUpToFixedFrame( - geometry.boundingSphere.center + geometry.boundingSphere.center, ), new Cartesian3(0.0, 0.0, height), - new Matrix4() + new Matrix4(), ); scene.camera.lookAtTransform( transform, - new Cartesian3(0.0, 0.0, geometry.boundingSphere.radius) + new Cartesian3(0.0, 0.0, geometry.boundingSphere.radius), ); scene.camera.rotateDown(CesiumMath.PI); } @@ -1234,11 +1182,11 @@ describe( it("renders wall 1", function () { function afterView() { const transform = Transforms.eastNorthUpToFixedFrame( - geometry.boundingSphere.center + geometry.boundingSphere.center, ); scene.camera.lookAtTransform( transform, - new Cartesian3(0.0, 0.0, geometry.boundingSphere.radius) + new Cartesian3(0.0, 0.0, geometry.boundingSphere.radius), ); scene.camera.rotateUp(CesiumMath.PI_OVER_TWO); } @@ -1248,11 +1196,11 @@ describe( it("renders wall 2", function () { function afterView() { const transform = Transforms.eastNorthUpToFixedFrame( - geometry.boundingSphere.center + geometry.boundingSphere.center, ); scene.camera.lookAtTransform( transform, - new Cartesian3(0.0, 0.0, geometry.boundingSphere.radius) + new Cartesian3(0.0, 0.0, geometry.boundingSphere.radius), ); scene.camera.rotateDown(-CesiumMath.PI_OVER_TWO); } @@ -1262,11 +1210,11 @@ describe( it("renders wall 3", function () { function afterView() { const transform = Transforms.eastNorthUpToFixedFrame( - geometry.boundingSphere.center + geometry.boundingSphere.center, ); scene.camera.lookAtTransform( transform, - new Cartesian3(0.0, 0.0, geometry.boundingSphere.radius) + new Cartesian3(0.0, 0.0, geometry.boundingSphere.radius), ); scene.camera.rotateRight(-CesiumMath.PI_OVER_TWO); } @@ -1276,11 +1224,11 @@ describe( it("renders wall 4", function () { function afterView() { const transform = Transforms.eastNorthUpToFixedFrame( - geometry.boundingSphere.center + geometry.boundingSphere.center, ); scene.camera.lookAtTransform( transform, - new Cartesian3(0.0, 0.0, geometry.boundingSphere.radius) + new Cartesian3(0.0, 0.0, geometry.boundingSphere.radius), ); scene.camera.rotateRight(CesiumMath.PI_OVER_TWO); } @@ -1293,18 +1241,8 @@ describe( vertexFormat: PerInstanceColorAppearance.VERTEX_FORMAT, ellipsoid: ellipsoid, positions: Cartesian3.fromDegreesArrayHeights([ - -108.0, - -25.0, - 500000, - -100.0, - -25.0, - 500000, - -100.0, - -30.0, - 500000, - -108.0, - -30.0, - 500000, + -108.0, -25.0, 500000, -100.0, -25.0, 500000, -100.0, -30.0, + 500000, -108.0, -30.0, 500000, ]), perPositionHeight: true, extrudedHeight: 0, @@ -1317,16 +1255,16 @@ describe( geometry = PolygonGeometry.createGeometry(instance.geometry); geometry.boundingSphereWC = BoundingSphere.transform( geometry.boundingSphere, - instance.modelMatrix + instance.modelMatrix, ); function afterView() { const transform = Transforms.eastNorthUpToFixedFrame( - geometry.boundingSphereWC.center + geometry.boundingSphereWC.center, ); scene.camera.lookAtTransform( transform, - new Cartesian3(0.0, 0.0, geometry.boundingSphereWC.radius) + new Cartesian3(0.0, 0.0, geometry.boundingSphereWC.radius), ); scene.camera.rotateDown(-CesiumMath.PI_OVER_TWO); scene.camera.moveForward(geometry.boundingSphereWC.radius * 0.75); @@ -1334,7 +1272,7 @@ describe( render3D(instance, afterView); }); }, - "WebGL" + "WebGL", ); describe( @@ -1367,23 +1305,23 @@ describe( geometry = WallGeometry.createGeometry(instance.geometry); geometry.boundingSphereWC = BoundingSphere.transform( geometry.boundingSphere, - instance.modelMatrix + instance.modelMatrix, ); afterView3D = function () { const transform = Transforms.eastNorthUpToFixedFrame( - geometry.boundingSphereWC.center + geometry.boundingSphereWC.center, ); scene.camera.lookAtTransform( transform, - new Cartesian3(0.0, 0.0, geometry.boundingSphereWC.radius) + new Cartesian3(0.0, 0.0, geometry.boundingSphereWC.radius), ); scene.camera.rotateDown(-CesiumMath.PI_OVER_TWO); }; afterViewCV = function () { const transform = Transforms.eastNorthUpToFixedFrame( - geometry.boundingSphereWC.center + geometry.boundingSphereWC.center, ); Matrix4.clone(transform, scene.camera._transform); scene.camera.rotateDown(-CesiumMath.PI_OVER_TWO); @@ -1410,7 +1348,7 @@ describe( return renderAsync(instance, afterView3D); }); }, - "WebGL" + "WebGL", ); describe( @@ -1438,7 +1376,7 @@ describe( geometry = CorridorGeometry.createGeometry(instance.geometry); geometry.boundingSphereWC = BoundingSphere.transform( geometry.boundingSphere, - instance.modelMatrix + instance.modelMatrix, ); }); @@ -1479,12 +1417,12 @@ describe( geometry = CorridorGeometry.createGeometry(atHeight.geometry); geometry.boundingSphereWC = BoundingSphere.transform( geometry.boundingSphere, - atHeight.modelMatrix + atHeight.modelMatrix, ); render3D(atHeight); }); }, - "WebGL" + "WebGL", ); describe( @@ -1517,7 +1455,7 @@ describe( geometry = CorridorGeometry.createGeometry(instance.geometry); geometry.boundingSphereWC = BoundingSphere.transform( geometry.boundingSphere, - instance.modelMatrix + instance.modelMatrix, ); }); @@ -1546,14 +1484,14 @@ describe( const height = (extrudedHeight - geometryHeight) * 0.5; const transform = Matrix4.multiplyByTranslation( Transforms.eastNorthUpToFixedFrame( - geometry.boundingSphereWC.center + geometry.boundingSphereWC.center, ), new Cartesian3(0.0, 0.0, height), - new Matrix4() + new Matrix4(), ); scene.camera.lookAtTransform( transform, - new Cartesian3(0.0, 0.0, geometry.boundingSphereWC.radius) + new Cartesian3(0.0, 0.0, geometry.boundingSphereWC.radius), ); scene.camera.rotateDown(CesiumMath.PI); } @@ -1563,11 +1501,11 @@ describe( it("renders north wall", function () { function afterView() { const transform = Transforms.eastNorthUpToFixedFrame( - geometry.boundingSphereWC.center + geometry.boundingSphereWC.center, ); scene.camera.lookAtTransform( transform, - new Cartesian3(0.0, 0.0, geometry.boundingSphereWC.radius) + new Cartesian3(0.0, 0.0, geometry.boundingSphereWC.radius), ); scene.camera.rotateDown(-CesiumMath.PI_OVER_TWO); } @@ -1577,11 +1515,11 @@ describe( it("renders south wall", function () { function afterView() { const transform = Transforms.eastNorthUpToFixedFrame( - geometry.boundingSphereWC.center + geometry.boundingSphereWC.center, ); scene.camera.lookAtTransform( transform, - new Cartesian3(0.0, 0.0, geometry.boundingSphereWC.radius) + new Cartesian3(0.0, 0.0, geometry.boundingSphereWC.radius), ); scene.camera.rotateDown(CesiumMath.PI_OVER_TWO); } @@ -1591,11 +1529,11 @@ describe( it("renders west wall", function () { function afterView() { const transform = Transforms.eastNorthUpToFixedFrame( - geometry.boundingSphereWC.center + geometry.boundingSphereWC.center, ); scene.camera.lookAtTransform( transform, - new Cartesian3(0.0, 0.0, geometry.boundingSphereWC.radius) + new Cartesian3(0.0, 0.0, geometry.boundingSphereWC.radius), ); scene.camera.rotateRight(-CesiumMath.PI_OVER_TWO); } @@ -1605,18 +1543,18 @@ describe( it("renders east wall", function () { function afterView() { const transform = Transforms.eastNorthUpToFixedFrame( - geometry.boundingSphereWC.center + geometry.boundingSphereWC.center, ); scene.camera.lookAtTransform( transform, - new Cartesian3(0.0, 0.0, geometry.boundingSphereWC.radius) + new Cartesian3(0.0, 0.0, geometry.boundingSphereWC.radius), ); scene.camera.rotateRight(CesiumMath.PI_OVER_TWO); } render3D(instance, afterView); }); }, - "WebGL" + "WebGL", ); describe( @@ -1652,7 +1590,7 @@ describe( geometry = PolylineVolumeGeometry.createGeometry(instance.geometry); geometry.boundingSphereWC = BoundingSphere.transform( geometry.boundingSphere, - instance.modelMatrix + instance.modelMatrix, ); }); @@ -1681,14 +1619,14 @@ describe( const height = geometryHeight * 0.5; const transform = Matrix4.multiplyByTranslation( Transforms.eastNorthUpToFixedFrame( - geometry.boundingSphereWC.center + geometry.boundingSphereWC.center, ), new Cartesian3(0.0, 0.0, height), - new Matrix4() + new Matrix4(), ); scene.camera.lookAtTransform( transform, - new Cartesian3(0.0, 0.0, geometry.boundingSphereWC.radius) + new Cartesian3(0.0, 0.0, geometry.boundingSphereWC.radius), ); scene.camera.rotateDown(CesiumMath.PI); } @@ -1698,11 +1636,11 @@ describe( it("renders north wall", function () { function afterView() { const transform = Transforms.eastNorthUpToFixedFrame( - geometry.boundingSphereWC.center + geometry.boundingSphereWC.center, ); scene.camera.lookAtTransform( transform, - new Cartesian3(0.0, 0.0, geometry.boundingSphereWC.radius) + new Cartesian3(0.0, 0.0, geometry.boundingSphereWC.radius), ); scene.camera.rotateDown(-CesiumMath.PI_OVER_TWO); } @@ -1712,11 +1650,11 @@ describe( it("renders south wall", function () { function afterView() { const transform = Transforms.eastNorthUpToFixedFrame( - geometry.boundingSphereWC.center + geometry.boundingSphereWC.center, ); scene.camera.lookAtTransform( transform, - new Cartesian3(0.0, 0.0, geometry.boundingSphereWC.radius) + new Cartesian3(0.0, 0.0, geometry.boundingSphereWC.radius), ); scene.camera.rotateDown(CesiumMath.PI_OVER_TWO); } @@ -1726,11 +1664,11 @@ describe( it("renders west wall", function () { function afterView() { const transform = Transforms.eastNorthUpToFixedFrame( - geometry.boundingSphereWC.center + geometry.boundingSphereWC.center, ); scene.camera.lookAtTransform( transform, - new Cartesian3(0.0, 0.0, geometry.boundingSphereWC.radius) + new Cartesian3(0.0, 0.0, geometry.boundingSphereWC.radius), ); scene.camera.rotateRight(-CesiumMath.PI_OVER_TWO); } @@ -1740,18 +1678,18 @@ describe( it("renders east wall", function () { function afterView() { const transform = Transforms.eastNorthUpToFixedFrame( - geometry.boundingSphereWC.center + geometry.boundingSphereWC.center, ); scene.camera.lookAtTransform( transform, - new Cartesian3(0.0, 0.0, geometry.boundingSphereWC.radius) + new Cartesian3(0.0, 0.0, geometry.boundingSphereWC.radius), ); scene.camera.rotateRight(CesiumMath.PI_OVER_TWO); } render3D(instance, afterView); }); }, - "WebGL" + "WebGL", ); describe( @@ -1771,7 +1709,7 @@ describe( geometry = SimplePolylineGeometry.createGeometry(instance.geometry); geometry.boundingSphereWC = BoundingSphere.transform( geometry.boundingSphere, - instance.modelMatrix + instance.modelMatrix, ); }); @@ -1809,7 +1747,7 @@ describe( geometry = SimplePolylineGeometry.createGeometry(instance.geometry); geometry.boundingSphereWC = BoundingSphere.transform( geometry.boundingSphere, - instance.modelMatrix + instance.modelMatrix, ); render3D(instance); }); @@ -1829,12 +1767,12 @@ describe( geometry = SimplePolylineGeometry.createGeometry(instance.geometry); geometry.boundingSphereWC = BoundingSphere.transform( geometry.boundingSphere, - instance.modelMatrix + instance.modelMatrix, ); render3D(instance); }); }, - "WebGL" + "WebGL", ); describe( @@ -1861,7 +1799,7 @@ describe( geometry = PolylineGeometry.createGeometry(instance.geometry); geometry.boundingSphereWC = BoundingSphere.transform( geometry.boundingSphere, - instance.modelMatrix + instance.modelMatrix, ); }); @@ -1901,7 +1839,7 @@ describe( geometry = PolylineGeometry.createGeometry(instance.geometry); geometry.boundingSphereWC = BoundingSphere.transform( geometry.boundingSphere, - instance.modelMatrix + instance.modelMatrix, ); render3D(instance, undefined, appearance); }); @@ -1923,12 +1861,12 @@ describe( geometry = PolylineGeometry.createGeometry(instance.geometry); geometry.boundingSphereWC = BoundingSphere.transform( geometry.boundingSphere, - instance.modelMatrix + instance.modelMatrix, ); render3D(instance, undefined, appearance); }); }, - "WebGL" + "WebGL", ); describe("Custom geometry", function () { @@ -1944,18 +1882,8 @@ describe( componentDatatype: ComponentDatatype.DOUBLE, componentsPerAttribute: 3, values: new Float64Array([ - 1000000.0, - 0.0, - 0.0, - 1000000.0, - 1000000.0, - 0.0, - 1000000.0, - 0.0, - 1000000.0, - 1000000.0, - 1000000.0, - 1000000.0, + 1000000.0, 0.0, 0.0, 1000000.0, 1000000.0, 0.0, 1000000.0, + 0.0, 1000000.0, 1000000.0, 1000000.0, 1000000.0, ]), }), }, @@ -1964,10 +1892,10 @@ describe( }), modelMatrix: Matrix4.multiplyByTranslation( Transforms.eastNorthUpToFixedFrame( - Cartesian3.fromDegrees(0, 0) + Cartesian3.fromDegrees(0, 0), ), new Cartesian3(0.0, 0.0, 10000.0), - new Matrix4() + new Matrix4(), ), id: "customWithIndices", attributes: { @@ -1976,11 +1904,11 @@ describe( }); geometry = instance.geometry; geometry.boundingSphere = BoundingSphere.fromVertices( - instance.geometry.attributes.position.values + instance.geometry.attributes.position.values, ); geometry.boundingSphereWC = BoundingSphere.transform( geometry.boundingSphere, - instance.modelMatrix + instance.modelMatrix, ); }); @@ -2000,7 +1928,7 @@ describe( pickGeometry(instance); }); }, - "WebGL" + "WebGL", ); describe( @@ -2015,24 +1943,9 @@ describe( componentDatatype: ComponentDatatype.DOUBLE, componentsPerAttribute: 3, values: new Float64Array([ - 1000000.0, - 0.0, - 0.0, - 1000000.0, - 1000000.0, - 0.0, - 1000000.0, - 0.0, - 1000000.0, - 1000000.0, - 0.0, - 1000000.0, - 1000000.0, - 1000000.0, - 0.0, - 1000000.0, - 1000000.0, - 1000000.0, + 1000000.0, 0.0, 0.0, 1000000.0, 1000000.0, 0.0, 1000000.0, + 0.0, 1000000.0, 1000000.0, 0.0, 1000000.0, 1000000.0, + 1000000.0, 0.0, 1000000.0, 1000000.0, 1000000.0, ]), }), }, @@ -2040,10 +1953,10 @@ describe( }), modelMatrix: Matrix4.multiplyByTranslation( Transforms.eastNorthUpToFixedFrame( - Cartesian3.fromDegrees(0, 0) + Cartesian3.fromDegrees(0, 0), ), new Cartesian3(0.0, 0.0, 10000.0), - new Matrix4() + new Matrix4(), ), id: "customWithoutIndices", attributes: { @@ -2052,11 +1965,11 @@ describe( }); geometry = instance.geometry; geometry.boundingSphere = BoundingSphere.fromVertices( - instance.geometry.attributes.position.values + instance.geometry.attributes.position.values, ); geometry.boundingSphereWC = BoundingSphere.transform( geometry.boundingSphere, - instance.modelMatrix + instance.modelMatrix, ); }); @@ -2076,7 +1989,7 @@ describe( pickGeometry(instance); }); }, - "WebGL" + "WebGL", ); describe( @@ -2091,18 +2004,8 @@ describe( componentDatatype: ComponentDatatype.DOUBLE, componentsPerAttribute: 3, values: [ - 1000000.0, - 0.0, - 0.0, - 1000000.0, - 1000000.0, - 0.0, - 1000000.0, - 0.0, - 1000000.0, - 1000000.0, - 1000000.0, - 1000000.0, + 1000000.0, 0.0, 0.0, 1000000.0, 1000000.0, 0.0, 1000000.0, + 0.0, 1000000.0, 1000000.0, 1000000.0, 1000000.0, ], }), }, @@ -2111,10 +2014,10 @@ describe( }), modelMatrix: Matrix4.multiplyByTranslation( Transforms.eastNorthUpToFixedFrame( - Cartesian3.fromDegrees(0, 0) + Cartesian3.fromDegrees(0, 0), ), new Cartesian3(0.0, 0.0, 10000.0), - new Matrix4() + new Matrix4(), ), id: "customWithIndices", attributes: { @@ -2123,11 +2026,11 @@ describe( }); geometry = instance.geometry; geometry.boundingSphere = BoundingSphere.fromVertices( - instance.geometry.attributes.position.values + instance.geometry.attributes.position.values, ); geometry.boundingSphereWC = BoundingSphere.transform( geometry.boundingSphere, - instance.modelMatrix + instance.modelMatrix, ); }); @@ -2147,9 +2050,9 @@ describe( pickGeometry(instance); }); }, - "WebGL" + "WebGL", ); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/GlobeSpec.js b/packages/engine/Specs/Scene/GlobeSpec.js index af2863a7a40f..4a4d25f4ce25 100644 --- a/packages/engine/Specs/Scene/GlobeSpec.js +++ b/packages/engine/Specs/Scene/GlobeSpec.js @@ -48,7 +48,7 @@ describe( data, headers, deferred, - overrideMimeType + overrideMimeType, ) { if (url.indexOf("layer.json") >= 0) { Resource._DefaultImplementations.loadWithXhr( @@ -57,7 +57,7 @@ describe( method, data, headers, - deferred + deferred, ); } else { return oldLoad( @@ -67,7 +67,7 @@ describe( data, headers, deferred, - overrideMimeType + overrideMimeType, ); } }; @@ -75,7 +75,7 @@ describe( function returnVertexNormalTileJson() { return returnTileJson( - "Data/CesiumTerrainTileJson/VertexNormals.tile.json" + "Data/CesiumTerrainTileJson/VertexNormals.tile.json", ); } @@ -98,7 +98,7 @@ describe( const layerCollection = globe.imageryLayers; layerCollection.removeAll(); const provider = await SingleTileImageryProvider.fromUrl( - "Data/Images/Red16x16.png" + "Data/Images/Red16x16.png", ); layerCollection.addImageryProvider(provider); @@ -121,7 +121,7 @@ describe( const layerCollection = globe.imageryLayers; layerCollection.removeAll(); const provider = await SingleTileImageryProvider.fromUrl( - "Data/Images/Red16x16.png" + "Data/Images/Red16x16.png", ); layerCollection.addImageryProvider(provider); @@ -145,7 +145,7 @@ describe( const layerCollection = globe.imageryLayers; layerCollection.removeAll(); const provider = await SingleTileImageryProvider.fromUrl( - "Data/Images/Red16x16.png" + "Data/Images/Red16x16.png", ); layerCollection.addImageryProvider(provider); @@ -167,7 +167,7 @@ describe( const layerCollection = globe.imageryLayers; layerCollection.removeAll(); const provider = await SingleTileImageryProvider.fromUrl( - "Data/Images/Red16x16.png" + "Data/Images/Red16x16.png", ); layerCollection.addImageryProvider(provider); @@ -193,7 +193,7 @@ describe( const layerCollection = globe.imageryLayers; layerCollection.removeAll(); const provider = await SingleTileImageryProvider.fromUrl( - "Data/Images/Red16x16.png" + "Data/Images/Red16x16.png", ); const layer = layerCollection.addImageryProvider(provider); layerCollection.addImageryProvider(provider); @@ -232,7 +232,7 @@ describe( "made/up/url", { requestVertexNormals: true, - } + }, ); const spyListener = jasmine.createSpy("listener"); @@ -268,7 +268,7 @@ describe( "made/up/url", { requestVertexNormals: true, - } + }, ); globe.terrainProvider = terrainProvider; @@ -286,7 +286,7 @@ describe( const layerCollection = globe.imageryLayers; layerCollection.removeAll(); const imageryProvider = await SingleTileImageryProvider.fromUrl( - "Data/Images/Red16x16.png" + "Data/Images/Red16x16.png", ); layerCollection.addImageryProvider(imageryProvider); Resource._Implementations.loadWithXhr = function ( @@ -296,7 +296,7 @@ describe( data, headers, deferred, - overrideMimeType + overrideMimeType, ) { Resource._DefaultImplementations.loadWithXhr( "Data/CesiumTerrainTileJson/tile.vertexnormals.terrain", @@ -304,7 +304,7 @@ describe( method, data, headers, - deferred + deferred, ); }; @@ -314,7 +314,7 @@ describe( "made/up/url", { requestVertexNormals: true, - } + }, ); globe.terrainProvider = terrainProvider; @@ -339,7 +339,7 @@ describe( const layerCollection = globe.imageryLayers; layerCollection.removeAll(); const imageryProvider = await SingleTileImageryProvider.fromUrl( - "Data/Images/Red16x16.png" + "Data/Images/Red16x16.png", ); layerCollection.addImageryProvider(imageryProvider); Resource._Implementations.loadWithXhr = function ( @@ -349,7 +349,7 @@ describe( data, headers, deferred, - overrideMimeType + overrideMimeType, ) { Resource._DefaultImplementations.loadWithXhr( "Data/CesiumTerrainTileJson/tile.vertexnormals.terrain", @@ -357,7 +357,7 @@ describe( method, data, headers, - deferred + deferred, ); }; @@ -367,7 +367,7 @@ describe( "made/up/url", { requestVertexNormals: true, - } + }, ); globe.terrainProvider = terrainProvider; @@ -395,7 +395,7 @@ describe( const layerCollection = globe.imageryLayers; layerCollection.removeAll(); const imageryProvider = await SingleTileImageryProvider.fromUrl( - "Data/Images/Red16x16.png" + "Data/Images/Red16x16.png", ); layerCollection.addImageryProvider(imageryProvider); Resource._Implementations.loadWithXhr = function ( @@ -405,7 +405,7 @@ describe( data, headers, deferred, - overrideMimeType + overrideMimeType, ) { Resource._DefaultImplementations.loadWithXhr( "Data/CesiumTerrainTileJson/tile.vertexnormals.terrain", @@ -413,7 +413,7 @@ describe( method, data, headers, - deferred + deferred, ); }; @@ -423,7 +423,7 @@ describe( "made/up/url", { requestVertexNormals: true, - } + }, ); globe.terrainProvider = terrainProvider; @@ -445,7 +445,7 @@ describe( const layerCollection = globe.imageryLayers; layerCollection.removeAll(); const provider = await SingleTileImageryProvider.fromUrl( - "Data/Images/Blue.png" + "Data/Images/Blue.png", ); layerCollection.addImageryProvider(provider); @@ -467,7 +467,7 @@ describe( const layerCollection = globe.imageryLayers; layerCollection.removeAll(); const provider = await SingleTileImageryProvider.fromUrl( - "Data/Images/Blue.png" + "Data/Images/Blue.png", ); layerCollection.addImageryProvider(provider); @@ -489,7 +489,7 @@ describe( const layerCollection = globe.imageryLayers; layerCollection.removeAll(); const provider = await SingleTileImageryProvider.fromUrl( - "Data/Images/Blue.png" + "Data/Images/Blue.png", ); layerCollection.addImageryProvider(provider); @@ -541,7 +541,7 @@ describe( command = scene.frameState.commandList[0]; expect(command.count).toBeLessThan(indexCount); expect(command.count).toBe( - command.owner.data.renderedMesh.indexCountWithoutSkirts + command.owner.data.renderedMesh.indexCountWithoutSkirts, ); }); }); @@ -557,12 +557,12 @@ describe( destination: new Cartesian3( -524251.65918537375, -5316355.5357514685, - 3400179.253223899 + 3400179.253223899, ), orientation: new HeadingPitchRoll( 0.22779127099032603, -0.7030060668670961, - 0.0024147223687949193 + 0.0024147223687949193, ), }); @@ -583,19 +583,19 @@ describe( radius * 0.25, 0.0, radius * 2.0, - 1.0 + 1.0, ); scene.camera.setView({ destination: new Cartesian3( -524251.65918537375, -5316355.5357514685, - 3400179.253223899 + 3400179.253223899, ), orientation: new HeadingPitchRoll( 0.24245689061958142, -0.445653254172905, - 0.0024147223687949193 + 0.0024147223687949193, ), }); @@ -613,10 +613,10 @@ describe( 1.0, 0.0, 0.0, - 1.0 + 1.0, ); }).toThrowDeveloperError(); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/GlobeSurfaceTileProviderSpec.js b/packages/engine/Specs/Scene/GlobeSurfaceTileProviderSpec.js index b591e61c10c6..a108ae40c1e0 100644 --- a/packages/engine/Specs/Scene/GlobeSurfaceTileProviderSpec.js +++ b/packages/engine/Specs/Scene/GlobeSurfaceTileProviderSpec.js @@ -47,7 +47,7 @@ describe( quadtreePrimitive, minimumTiles, maximumTiles, - callback + callback, ) { let tileCount = 0; quadtreePrimitive.forEachRenderedTile(function (tile) { @@ -113,7 +113,7 @@ describe( it("conforms to QuadtreeTileProvider interface", function () { expect(GlobeSurfaceTileProvider).toConformToInterface( - QuadtreeTileProvider + QuadtreeTileProvider, ); }); @@ -138,7 +138,7 @@ describe( }); } expect( - constructWithoutImageryLayerCollection + constructWithoutImageryLayerCollection, ).toThrowDeveloperError(); }); @@ -150,11 +150,11 @@ describe( }); } expect( - constructWithoutImageryLayerCollection + constructWithoutImageryLayerCollection, ).toThrowDeveloperError(); }); }, - "WebGL" + "WebGL", ); describe( @@ -162,181 +162,202 @@ describe( function () { it("removing a layer removes it from all tiles", async function () { const provider = await SingleTileImageryProvider.fromUrl( - "Data/Images/Red16x16.png" + "Data/Images/Red16x16.png", ); const layer = scene.imageryLayers.addImageryProvider(provider); await updateUntilDone(scene.globe); // All tiles should have one or more associated images. - forEachRenderedTile(scene.globe._surface, 1, undefined, function ( - tile - ) { - expect(tile.data.imagery.length).toBeGreaterThan(0); - for (let i = 0; i < tile.data.imagery.length; ++i) { - const imagery = defaultValue( - tile.data.imagery[i].readyImagery, - tile.data.imagery[i].loadingImagery - ); - expect(imagery.imageryLayer).toEqual(layer); - } - }); + forEachRenderedTile( + scene.globe._surface, + 1, + undefined, + function (tile) { + expect(tile.data.imagery.length).toBeGreaterThan(0); + for (let i = 0; i < tile.data.imagery.length; ++i) { + const imagery = defaultValue( + tile.data.imagery[i].readyImagery, + tile.data.imagery[i].loadingImagery, + ); + expect(imagery.imageryLayer).toEqual(layer); + } + }, + ); scene.imageryLayers.remove(layer); // All associated images should be gone. - forEachRenderedTile(scene.globe._surface, 1, undefined, function ( - tile - ) { - expect(tile.data.imagery.length).toEqual(0); - }); + forEachRenderedTile( + scene.globe._surface, + 1, + undefined, + function (tile) { + expect(tile.data.imagery.length).toEqual(0); + }, + ); }); it("adding a layer adds it to all tiles after update", async function () { const provider = await SingleTileImageryProvider.fromUrl( - "Data/Images/Red16x16.png" + "Data/Images/Red16x16.png", ); scene.imageryLayers.addImageryProvider(provider); await updateUntilDone(scene.globe); const provider2 = await SingleTileImageryProvider.fromUrl( - "Data/Images/Green4x4.png" + "Data/Images/Green4x4.png", ); // Add another layer const layer2 = scene.imageryLayers.addImageryProvider(provider2); await updateUntilDone(scene.globe); // All tiles should have one or more associated images. - forEachRenderedTile(scene.globe._surface, 1, undefined, function ( - tile - ) { - expect(tile.data.imagery.length).toBeGreaterThan(0); - let hasImageFromLayer2 = false; - for (let i = 0; i < tile.data.imagery.length; ++i) { - let imageryTile = tile.data.imagery[i].readyImagery; - if (!defined(imageryTile)) { - imageryTile = tile.data.imagery[i].loadingImagery; - } - if (imageryTile.imageryLayer === layer2) { - hasImageFromLayer2 = true; + forEachRenderedTile( + scene.globe._surface, + 1, + undefined, + function (tile) { + expect(tile.data.imagery.length).toBeGreaterThan(0); + let hasImageFromLayer2 = false; + for (let i = 0; i < tile.data.imagery.length; ++i) { + let imageryTile = tile.data.imagery[i].readyImagery; + if (!defined(imageryTile)) { + imageryTile = tile.data.imagery[i].loadingImagery; + } + if (imageryTile.imageryLayer === layer2) { + hasImageFromLayer2 = true; + } } - } - expect(hasImageFromLayer2).toEqual(true); - }); + expect(hasImageFromLayer2).toEqual(true); + }, + ); }); it("moving a layer moves the corresponding TileImagery instances on every tile", async function () { const provider1 = await SingleTileImageryProvider.fromUrl( - "Data/Images/Red16x16.png" + "Data/Images/Red16x16.png", ); const layer1 = scene.imageryLayers.addImageryProvider(provider1); const provider2 = await SingleTileImageryProvider.fromUrl( - "Data/Images/Green4x4.png" + "Data/Images/Green4x4.png", ); const layer2 = scene.imageryLayers.addImageryProvider(provider2); await updateUntilDone(scene.globe); - forEachRenderedTile(scene.globe._surface, 1, undefined, function ( - tile - ) { - expect(tile.data.imagery.length).toBeGreaterThan(0); - let indexOfFirstLayer1 = tile.data.imagery.length; - let indexOfLastLayer1 = -1; - let indexOfFirstLayer2 = tile.data.imagery.length; - for (let i = 0; i < tile.data.imagery.length; ++i) { - const imagery = defaultValue( - tile.data.imagery[i].readyImagery, - tile.data.imagery[i].loadingImagery - ); - if (imagery.imageryLayer === layer1) { - indexOfFirstLayer1 = Math.min(indexOfFirstLayer1, i); - indexOfLastLayer1 = i; - } else { - expect(imagery.imageryLayer).toEqual(layer2); - indexOfFirstLayer2 = Math.min(indexOfFirstLayer2, i); + forEachRenderedTile( + scene.globe._surface, + 1, + undefined, + function (tile) { + expect(tile.data.imagery.length).toBeGreaterThan(0); + let indexOfFirstLayer1 = tile.data.imagery.length; + let indexOfLastLayer1 = -1; + let indexOfFirstLayer2 = tile.data.imagery.length; + for (let i = 0; i < tile.data.imagery.length; ++i) { + const imagery = defaultValue( + tile.data.imagery[i].readyImagery, + tile.data.imagery[i].loadingImagery, + ); + if (imagery.imageryLayer === layer1) { + indexOfFirstLayer1 = Math.min(indexOfFirstLayer1, i); + indexOfLastLayer1 = i; + } else { + expect(imagery.imageryLayer).toEqual(layer2); + indexOfFirstLayer2 = Math.min(indexOfFirstLayer2, i); + } } - } - expect(indexOfFirstLayer1).toBeLessThan(indexOfFirstLayer2); - expect(indexOfLastLayer1).toBeLessThan(indexOfFirstLayer2); - }); + expect(indexOfFirstLayer1).toBeLessThan(indexOfFirstLayer2); + expect(indexOfLastLayer1).toBeLessThan(indexOfFirstLayer2); + }, + ); scene.imageryLayers.raiseToTop(layer1); await updateUntilDone(scene.globe); - forEachRenderedTile(scene.globe._surface, 1, undefined, function ( - tile - ) { - expect(tile.data.imagery.length).toBeGreaterThan(0); - let indexOfFirstLayer2 = tile.data.imagery.length; - let indexOfLastLayer2 = -1; - let indexOfFirstLayer1 = tile.data.imagery.length; - for (let i = 0; i < tile.data.imagery.length; ++i) { - if (tile.data.imagery[i].readyImagery.imageryLayer === layer2) { - indexOfFirstLayer2 = Math.min(indexOfFirstLayer2, i); - indexOfLastLayer2 = i; - } else { - expect(tile.data.imagery[i].readyImagery.imageryLayer).toEqual( - layer1 - ); - indexOfFirstLayer1 = Math.min(indexOfFirstLayer1, i); + forEachRenderedTile( + scene.globe._surface, + 1, + undefined, + function (tile) { + expect(tile.data.imagery.length).toBeGreaterThan(0); + let indexOfFirstLayer2 = tile.data.imagery.length; + let indexOfLastLayer2 = -1; + let indexOfFirstLayer1 = tile.data.imagery.length; + for (let i = 0; i < tile.data.imagery.length; ++i) { + if (tile.data.imagery[i].readyImagery.imageryLayer === layer2) { + indexOfFirstLayer2 = Math.min(indexOfFirstLayer2, i); + indexOfLastLayer2 = i; + } else { + expect( + tile.data.imagery[i].readyImagery.imageryLayer, + ).toEqual(layer1); + indexOfFirstLayer1 = Math.min(indexOfFirstLayer1, i); + } } - } - expect(indexOfFirstLayer2).toBeLessThan(indexOfFirstLayer1); - expect(indexOfLastLayer2).toBeLessThan(indexOfFirstLayer1); - }); + expect(indexOfFirstLayer2).toBeLessThan(indexOfFirstLayer1); + expect(indexOfLastLayer2).toBeLessThan(indexOfFirstLayer1); + }, + ); }); it("adding a layer creates its skeletons only once", async function () { const provider1 = await SingleTileImageryProvider.fromUrl( - "Data/Images/Red16x16.png" + "Data/Images/Red16x16.png", ); scene.imageryLayers.addImageryProvider(provider1); await updateUntilDone(scene.globe); // Add another layer const provider2 = await SingleTileImageryProvider.fromUrl( - "Data/Images/Green4x4.png" + "Data/Images/Green4x4.png", ); const layer2 = scene.imageryLayers.addImageryProvider(provider2); await updateUntilDone(scene.globe); // All tiles should have one or more associated images. - forEachRenderedTile(scene.globe._surface, 1, undefined, function ( - tile - ) { - expect(tile.data.imagery.length).toBeGreaterThan(0); - let tilesFromLayer2 = 0; - for (let i = 0; i < tile.data.imagery.length; ++i) { - let imageryTile = tile.data.imagery[i].readyImagery; - if (!defined(imageryTile)) { - imageryTile = tile.data.imagery[i].loadingImagery; + forEachRenderedTile( + scene.globe._surface, + 1, + undefined, + function (tile) { + expect(tile.data.imagery.length).toBeGreaterThan(0); + let tilesFromLayer2 = 0; + for (let i = 0; i < tile.data.imagery.length; ++i) { + let imageryTile = tile.data.imagery[i].readyImagery; + if (!defined(imageryTile)) { + imageryTile = tile.data.imagery[i].loadingImagery; + } + if (imageryTile.imageryLayer === layer2) { + ++tilesFromLayer2; + } } - if (imageryTile.imageryLayer === layer2) { - ++tilesFromLayer2; - } - } - expect(tilesFromLayer2).toBe(1); - }); + expect(tilesFromLayer2).toBe(1); + }, + ); }); it("calling _reload adds a callback per layer per tile", async function () { const provider1 = await SingleTileImageryProvider.fromUrl( - "Data/Images/Red16x16.png" + "Data/Images/Red16x16.png", ); const layer1 = scene.imageryLayers.addImageryProvider(provider1); const provider2 = await SingleTileImageryProvider.fromUrl( - "Data/Images/Green4x4.png" + "Data/Images/Green4x4.png", ); const layer2 = scene.imageryLayers.addImageryProvider(provider2); await updateUntilDone(scene.globe); // Verify that each tile has 2 imagery objects and no loaded callbacks - forEachRenderedTile(scene.globe._surface, 1, undefined, function ( - tile - ) { - expect(tile.data.imagery.length).toBe(2); - expect(Object.keys(tile._loadedCallbacks).length).toBe(0); - }); + forEachRenderedTile( + scene.globe._surface, + 1, + undefined, + function (tile) { + expect(tile.data.imagery.length).toBe(2); + expect(Object.keys(tile._loadedCallbacks).length).toBe(0); + }, + ); // Reload each layer layer1._imageryProvider._reload(); @@ -348,37 +369,43 @@ describe( // Verify that each tile has 4 imagery objects (the old imagery and the reloaded imagery for each layer) // and also has 2 callbacks so the old imagery will be removed once loaded. - forEachRenderedTile(scene.globe._surface, 1, undefined, function ( - tile - ) { - expect(tile.data.imagery.length).toBe(4); - expect(Object.keys(tile._loadedCallbacks).length).toBe(2); - }); + forEachRenderedTile( + scene.globe._surface, + 1, + undefined, + function (tile) { + expect(tile.data.imagery.length).toBe(4); + expect(Object.keys(tile._loadedCallbacks).length).toBe(2); + }, + ); await updateUntilDone(scene.globe); // Verify the old imagery was removed and the callbacks are no longer there - forEachRenderedTile(scene.globe._surface, 1, undefined, function ( - tile - ) { - expect(tile.data.imagery.length).toBe(2); - expect(Object.keys(tile._loadedCallbacks).length).toBe(0); - }); + forEachRenderedTile( + scene.globe._surface, + 1, + undefined, + function (tile) { + expect(tile.data.imagery.length).toBe(2); + expect(Object.keys(tile._loadedCallbacks).length).toBe(0); + }, + ); }); }, - "WebGL" + "WebGL", ); it("renders in 2D geographic", async function () { expect(scene).toRender([0, 0, 0, 255]); const provider = await SingleTileImageryProvider.fromUrl( - "Data/Images/Red16x16.png" + "Data/Images/Red16x16.png", ); scene.imageryLayers.addImageryProvider(provider); switchViewMode( SceneMode.SCENE2D, - new GeographicProjection(Ellipsoid.WGS84) + new GeographicProjection(Ellipsoid.WGS84), ); await updateUntilDone(scene.globe); @@ -389,13 +416,13 @@ describe( expect(scene).toRender([0, 0, 0, 255]); const provider = await SingleTileImageryProvider.fromUrl( - "Data/Images/Red16x16.png" + "Data/Images/Red16x16.png", ); scene.imageryLayers.addImageryProvider(provider); switchViewMode( SceneMode.SCENE2D, - new WebMercatorProjection(Ellipsoid.WGS84) + new WebMercatorProjection(Ellipsoid.WGS84), ); await updateUntilDone(scene.globe); @@ -406,13 +433,13 @@ describe( expect(scene).toRender([0, 0, 0, 255]); const provider = await SingleTileImageryProvider.fromUrl( - "Data/Images/Red16x16.png" + "Data/Images/Red16x16.png", ); scene.imageryLayers.addImageryProvider(provider); switchViewMode( SceneMode.COLUMBUS_VIEW, - new GeographicProjection(Ellipsoid.WGS84) + new GeographicProjection(Ellipsoid.WGS84), ); await updateUntilDone(scene.globe); @@ -423,13 +450,13 @@ describe( expect(scene).toRender([0, 0, 0, 255]); const provider = await SingleTileImageryProvider.fromUrl( - "Data/Images/Red16x16.png" + "Data/Images/Red16x16.png", ); scene.imageryLayers.addImageryProvider(provider); switchViewMode( SceneMode.COLUMBUS_VIEW, - new WebMercatorProjection(Ellipsoid.WGS84) + new WebMercatorProjection(Ellipsoid.WGS84), ); await updateUntilDone(scene.globe); @@ -440,13 +467,13 @@ describe( expect(scene).toRender([0, 0, 0, 255]); const provider = await SingleTileImageryProvider.fromUrl( - "Data/Images/Red16x16.png" + "Data/Images/Red16x16.png", ); scene.imageryLayers.addImageryProvider(provider); switchViewMode( SceneMode.SCENE3D, - new GeographicProjection(Ellipsoid.WGS84) + new GeographicProjection(Ellipsoid.WGS84), ); await updateUntilDone(scene.globe); @@ -457,13 +484,13 @@ describe( expect(scene).toRender([0, 0, 0, 255]); const provider = await SingleTileImageryProvider.fromUrl( - "Data/Images/Red16x16.png" + "Data/Images/Red16x16.png", ); scene.imageryLayers.addImageryProvider(provider); switchViewMode( SceneMode.SCENE3D, - new GeographicProjection(Ellipsoid.WGS84) + new GeographicProjection(Ellipsoid.WGS84), ); await updateUntilDone(scene.globe); @@ -476,20 +503,20 @@ describe( expect(scene).toRenderAndCall((rgba) => (renderedRed = rgba[0])); const provider = await SingleTileImageryProvider.fromUrl( - "Data/Images/Red16x16.png" + "Data/Images/Red16x16.png", ); const layer = scene.imageryLayers.addImageryProvider(provider); await updateUntilDone(scene.globe); expect(scene).toRenderAndCall((rgba) => - expect(rgba[0]).toBeGreaterThan(renderedRed) + expect(rgba[0]).toBeGreaterThan(renderedRed), ); layer.show = false; await updateUntilDone(scene.globe); expect(scene).toRenderAndCall((rgba) => - expect(rgba[0]).toEqual(renderedRed) + expect(rgba[0]).toEqual(renderedRed), ); }); @@ -501,7 +528,7 @@ describe( "Data/Images/Red16x16.png", { credit: imageryCredit, - } + }, ); const layer = scene.imageryLayers.addImageryProvider(provider); @@ -510,13 +537,13 @@ describe( const creditDisplay = scene.frameState.creditDisplay; creditDisplay.showLightbox(); expect( - creditDisplay._currentFrameCredits.lightboxCredits.values + creditDisplay._currentFrameCredits.lightboxCredits.values, ).toContain(new CreditDisplayElement(imageryCredit)); layer.show = false; await updateUntilDone(scene.globe); expect( - creditDisplay._currentFrameCredits.lightboxCredits.values + creditDisplay._currentFrameCredits.lightboxCredits.values, ).not.toContain(new CreditDisplayElement(imageryCredit)); creditDisplay.hideLightbox(); @@ -526,14 +553,14 @@ describe( it("culls tiles in full fog", async function () { expect(scene).toRender([0, 0, 0, 255]); const provider = await SingleTileImageryProvider.fromUrl( - "Data/Images/Red16x16.png" + "Data/Images/Red16x16.png", ); scene.imageryLayers.addImageryProvider(provider); const oldFog = scene.fog; scene.fog = new Fog(); switchViewMode( SceneMode.SCENE3D, - new GeographicProjection(Ellipsoid.WGS84) + new GeographicProjection(Ellipsoid.WGS84), ); scene.camera.lookUp(1.2); // Horizon-view @@ -552,14 +579,14 @@ describe( it("culls tiles but does not render fog visuals when renderable is false", async function () { expect(scene).toRender([0, 0, 0, 255]); const provider = await SingleTileImageryProvider.fromUrl( - "Data/Images/Red16x16.png" + "Data/Images/Red16x16.png", ); scene.imageryLayers.addImageryProvider(provider); const oldFog = scene.fog; scene.fog = new Fog(); switchViewMode( SceneMode.SCENE3D, - new GeographicProjection(Ellipsoid.WGS84) + new GeographicProjection(Ellipsoid.WGS84), ); scene.camera.lookUp(1.2); // Horizon-view @@ -586,14 +613,14 @@ describe( it("culls tiles because of increased SSE", async function () { expect(scene).toRender([0, 0, 0, 255]); const provider = await SingleTileImageryProvider.fromUrl( - "Data/Images/Red16x16.png" + "Data/Images/Red16x16.png", ); scene.imageryLayers.addImageryProvider(provider); const oldFog = scene.fog; scene.fog = new Fog(); switchViewMode( SceneMode.SCENE3D, - new GeographicProjection(Ellipsoid.WGS84) + new GeographicProjection(Ellipsoid.WGS84), ); scene.camera.lookUp(1.2); // Horizon-view @@ -623,7 +650,7 @@ describe( scene.fog.enabled = false; switchViewMode( SceneMode.SCENE3D, - new GeographicProjection(Ellipsoid.WGS84) + new GeographicProjection(Ellipsoid.WGS84), ); return updateUntilDone(scene.globe).then(function () { @@ -633,12 +660,12 @@ describe( it("renders in 3D and then Columbus View", async function () { const provider = await SingleTileImageryProvider.fromUrl( - "Data/Images/Red16x16.png" + "Data/Images/Red16x16.png", ); scene.imageryLayers.addImageryProvider(provider); switchViewMode( SceneMode.SCENE3D, - new GeographicProjection(Ellipsoid.WGS84) + new GeographicProjection(Ellipsoid.WGS84), ); await updateUntilDone(scene.globe); @@ -646,7 +673,7 @@ describe( switchViewMode( SceneMode.COLUMBUS_VIEW, - new GeographicProjection(Ellipsoid.WGS84) + new GeographicProjection(Ellipsoid.WGS84), ); await updateUntilDone(scene.globe); @@ -664,7 +691,7 @@ describe( scene.imageryLayers.addImageryProvider(providerWithInvalidRootTiles); switchViewMode( SceneMode.SCENE3D, - new GeographicProjection(Ellipsoid.WGS84) + new GeographicProjection(Ellipsoid.WGS84), ); return updateUntilDone(scene.globe).then(function () { @@ -676,7 +703,7 @@ describe( expect(scene).toRender([0, 0, 0, 255]); const provider = await SingleTileImageryProvider.fromUrl( - "Data/Images/Red16x16.png" + "Data/Images/Red16x16.png", ); const layer = scene.imageryLayers.addImageryProvider(provider); @@ -692,7 +719,7 @@ describe( switchViewMode( SceneMode.SCENE3D, - new GeographicProjection(Ellipsoid.WGS84) + new GeographicProjection(Ellipsoid.WGS84), ); await updateUntilDone(scene.globe); @@ -729,14 +756,14 @@ describe( expect(scene).toRender([0, 0, 0, 255]); const provider = await SingleTileImageryProvider.fromUrl( - "Data/Images/Red16x16.png" + "Data/Images/Red16x16.png", ); const layer = scene.imageryLayers.addImageryProvider(provider); layer.cutoutRectangle = cameraDestination; switchViewMode( SceneMode.SCENE3D, - new GeographicProjection(Ellipsoid.WGS84) + new GeographicProjection(Ellipsoid.WGS84), ); let baseColor; @@ -758,13 +785,13 @@ describe( expect(scene).toRender([0, 0, 0, 255]); const provider = await SingleTileImageryProvider.fromUrl( - "Data/Images/Red16x16.png" + "Data/Images/Red16x16.png", ); const layer = scene.imageryLayers.addImageryProvider(provider); switchViewMode( SceneMode.SCENE3D, - new GeographicProjection(Ellipsoid.WGS84) + new GeographicProjection(Ellipsoid.WGS84), ); let layerColor; @@ -802,7 +829,7 @@ describe( it("skips layer with uniform alpha value of zero", async function () { const provider = await SingleTileImageryProvider.fromUrl( - "Data/Images/Red16x16.png" + "Data/Images/Red16x16.png", ); const layer = scene.imageryLayers.addImageryProvider(provider); @@ -810,7 +837,7 @@ describe( switchViewMode( SceneMode.SCENE3D, - new GeographicProjection(Ellipsoid.WGS84) + new GeographicProjection(Ellipsoid.WGS84), ); await updateUntilDone(scene.globe); @@ -837,7 +864,7 @@ describe( it("can render more imagery layers than the available texture units", async function () { const provider = await SingleTileImageryProvider.fromUrl( - "Data/Images/Red16x16.png" + "Data/Images/Red16x16.png", ); for (let i = 0; i < ContextLimits.maximumTextureImageUnits + 1; ++i) { scene.imageryLayers.addImageryProvider(provider); @@ -845,7 +872,7 @@ describe( switchViewMode( SceneMode.SCENE3D, - new GeographicProjection(Ellipsoid.WGS84) + new GeographicProjection(Ellipsoid.WGS84), ); await updateUntilDone(scene.globe); @@ -869,12 +896,12 @@ describe( // The first draw command for each tile should use a non-alpha-blending render state. expect(command.renderState.blending).not.toEqual( - renderStateWithAlphaBlending.blending + renderStateWithAlphaBlending.blending, ); } else { // Successive draw commands per tile should alpha blend. expect(command.renderState.blending).toEqual( - renderStateWithAlphaBlending.blending + renderStateWithAlphaBlending.blending, ); expect(command.uniformMap.u_initialColor().w).toEqual(0.0); } @@ -902,7 +929,7 @@ describe( "Data/Images/Red16x16.png", { credit: imageryCredit, - } + }, ); scene.imageryLayers.addImageryProvider(provider); @@ -916,7 +943,7 @@ describe( data, headers, deferred, - overrideMimeType + overrideMimeType, ) { if (defined(url.match(/\/\d+\/\d+\/\d+\.terrain/))) { Resource._DefaultImplementations.loadWithXhr( @@ -925,7 +952,7 @@ describe( method, data, headers, - deferred + deferred, ); return; } @@ -937,24 +964,24 @@ describe( data, headers, deferred, - overrideMimeType + overrideMimeType, ); }; scene.terrainProvider = await CesiumTerrainProvider.fromUrl( "Data/CesiumTerrainTileJson/QuantizedMesh.tile.json", { credit: terrainCredit, - } + }, ); await updateUntilDone(scene.globe); const creditDisplay = scene.frameState.creditDisplay; creditDisplay.showLightbox(); expect( - creditDisplay._currentFrameCredits.lightboxCredits.values + creditDisplay._currentFrameCredits.lightboxCredits.values, ).toContain(new CreditDisplayElement(imageryCredit)); expect( - creditDisplay._currentFrameCredits.lightboxCredits.values + creditDisplay._currentFrameCredits.lightboxCredits.values, ).toContain(new CreditDisplayElement(terrainCredit)); creditDisplay.hideLightbox(); }); @@ -969,7 +996,8 @@ describe( expect(replacementQueue.count).toBeGreaterThan(0); const oldTile = replacementQueue.head; - surface.tileProvider.terrainProvider = new EllipsoidTerrainProvider(); + surface.tileProvider.terrainProvider = + new EllipsoidTerrainProvider(); scene.renderForSpecs(); @@ -1020,7 +1048,7 @@ describe( expect(levelZeroTiles[1]).toBe(levelZero1); }); }, - "WebGL" + "WebGL", ); it("renders back side of globe when camera is near the poles", function () { @@ -1028,27 +1056,27 @@ describe( camera.position = new Cartesian3( 2909078.1077849553, -38935053.40234136, - -63252400.94628872 + -63252400.94628872, ); camera.direction = new Cartesian3( -0.03928753135806185, 0.44884096070717633, - 0.8927476025569903 + 0.8927476025569903, ); camera.up = new Cartesian3( 0.00002847975895320034, -0.8934368803055558, - 0.4491887577613425 + 0.4491887577613425, ); camera.right = new Cartesian3( 0.99922794650124, 0.017672942642764363, - 0.03508814656908402 + 0.03508814656908402, ); scene.cullingVolume = camera.frustum.computeCullingVolume( camera.position, camera.direction, - camera.up + camera.up, ); return updateUntilDone(scene.globe).then(function () { @@ -1068,7 +1096,7 @@ describe( switchViewMode( SceneMode.SCENE3D, - new GeographicProjection(Ellipsoid.WGS84) + new GeographicProjection(Ellipsoid.WGS84), ); return updateUntilDone(scene.globe).then(function () { @@ -1100,7 +1128,7 @@ describe( switchViewMode( SceneMode.SCENE3D, - new GeographicProjection(Ellipsoid.WGS84) + new GeographicProjection(Ellipsoid.WGS84), ); return updateUntilDone(scene.globe).then(function () { @@ -1134,7 +1162,7 @@ describe( switchViewMode( SceneMode.SCENE3D, - new GeographicProjection(Ellipsoid.WGS84) + new GeographicProjection(Ellipsoid.WGS84), ); return updateUntilDone(scene.globe).then(function () { @@ -1168,7 +1196,7 @@ describe( const globe = scene.globe; switchViewMode( SceneMode.SCENE3D, - new GeographicProjection(Ellipsoid.WGS84) + new GeographicProjection(Ellipsoid.WGS84), ); return updateUntilDone(globe).then(function () { @@ -1184,7 +1212,7 @@ describe( switchViewMode( SceneMode.SCENE3D, - new GeographicProjection(Ellipsoid.WGS84) + new GeographicProjection(Ellipsoid.WGS84), ); return updateUntilDone(globe).then(function () { @@ -1203,7 +1231,7 @@ describe( switchViewMode( SceneMode.SCENE3D, - new GeographicProjection(Ellipsoid.WGS84) + new GeographicProjection(Ellipsoid.WGS84), ); return updateUntilDone(globe).then(function () { @@ -1222,7 +1250,7 @@ describe( switchViewMode( SceneMode.SCENE3D, - new GeographicProjection(Ellipsoid.WGS84) + new GeographicProjection(Ellipsoid.WGS84), ); return updateUntilDone(globe).then(function () { @@ -1252,7 +1280,7 @@ describe( const model = scene.primitives.add( await Model.fromGltfAsync({ url: "./Data/Models/glTF-2.0/BoxTextured/glTF/BoxTextured.gltf", - }) + }), ); model.clippingPlanes = clippingPlanes; const globe = scene.globe; @@ -1264,16 +1292,9 @@ describe( describe("clippingPolygons", () => { const positions = Cartesian3.fromRadiansArray([ - -1.3194369277314022, - 0.6988062530900625, - -1.31941, - 0.69879, - -1.3193955980204217, - 0.6988091578771254, - -1.3193931220959367, - 0.698743632490865, - -1.3194358224045408, - 0.6987471965556998, + -1.3194369277314022, 0.6988062530900625, -1.31941, 0.69879, + -1.3193955980204217, 0.6988091578771254, -1.3193931220959367, + 0.698743632490865, -1.3194358224045408, 0.6987471965556998, ]); let polygon; @@ -1290,7 +1311,7 @@ describe( switchViewMode( SceneMode.SCENE3D, - new GeographicProjection(Ellipsoid.WGS84) + new GeographicProjection(Ellipsoid.WGS84), ); await updateUntilDone(scene.globe); @@ -1324,7 +1345,7 @@ describe( switchViewMode( SceneMode.SCENE3D, - new GeographicProjection(Ellipsoid.WGS84) + new GeographicProjection(Ellipsoid.WGS84), ); await updateUntilDone(scene.globe); @@ -1337,14 +1358,9 @@ describe( }); const positionsB = Cartesian3.fromDegreesArray([ - 153.033834435422932, - -27.569622925766826, - 153.033836082527984, - -27.569616899897252, - 153.033905701988772, - -27.569628939963906, - 153.033999779170614, - -27.569639093357882, + 153.033834435422932, -27.569622925766826, 153.033836082527984, + -27.569616899897252, 153.033905701988772, -27.569628939963906, + 153.033999779170614, -27.569639093357882, ]); scene.globe.clippingPolygons = new ClippingPolygonCollection({ @@ -1373,7 +1389,7 @@ describe( switchViewMode( SceneMode.SCENE3D, - new GeographicProjection(Ellipsoid.WGS84) + new GeographicProjection(Ellipsoid.WGS84), ); await updateUntilDone(globe); @@ -1394,7 +1410,7 @@ describe( switchViewMode( SceneMode.SCENE3D, - new GeographicProjection(Ellipsoid.WGS84) + new GeographicProjection(Ellipsoid.WGS84), ); await updateUntilDone(globe); @@ -1415,7 +1431,7 @@ describe( switchViewMode( SceneMode.SCENE3D, - new GeographicProjection(Ellipsoid.WGS84) + new GeographicProjection(Ellipsoid.WGS84), ); await updateUntilDone(globe); @@ -1443,7 +1459,7 @@ describe( const model = scene.primitives.add( await Model.fromGltfAsync({ url: "./Data/Models/glTF-2.0/BoxTextured/glTF/BoxTextured.gltf", - }) + }), ); model.clippingPolygons = collection; const globe = scene.globe; @@ -1458,7 +1474,7 @@ describe( expect(scene).toRender([0, 0, 0, 255]); switchViewMode( SceneMode.COLUMBUS_VIEW, - new GeographicProjection(Ellipsoid.WGS84) + new GeographicProjection(Ellipsoid.WGS84), ); let result; return updateUntilDone(scene.globe) @@ -1472,7 +1488,7 @@ describe( -2, -2, -1, - -1 + -1, ); expect(scene).notToRender(result); scene.camera.setView({ @@ -1488,14 +1504,14 @@ describe( it("cartographicLimitRectangle defaults to Rectangle.MAX_VALUE", function () { scene.globe.cartographicLimitRectangle = undefined; expect( - scene.globe.cartographicLimitRectangle.equals(Rectangle.MAX_VALUE) + scene.globe.cartographicLimitRectangle.equals(Rectangle.MAX_VALUE), ).toBe(true); }); it("cartographicLimitRectangle culls tiles outside the region", function () { switchViewMode( SceneMode.COLUMBUS_VIEW, - new GeographicProjection(Ellipsoid.WGS84) + new GeographicProjection(Ellipsoid.WGS84), ); let unculledCommandCount; return updateUntilDone(scene.globe) @@ -1505,13 +1521,13 @@ describe( -2, -2, -1, - -1 + -1, ); return updateUntilDone(scene.globe); }) .then(function () { expect(unculledCommandCount).toBeGreaterThan( - scene.frameState.commandList.length + scene.frameState.commandList.length, ); }); }); @@ -1519,7 +1535,7 @@ describe( it("cartographicLimitRectangle may cross the antimeridian", function () { switchViewMode( SceneMode.SCENE2D, - new GeographicProjection(Ellipsoid.WGS84) + new GeographicProjection(Ellipsoid.WGS84), ); let unculledCommandCount; return updateUntilDone(scene.globe) @@ -1529,13 +1545,13 @@ describe( 179, -2, -179, - -1 + -1, ); return updateUntilDone(scene.globe); }) .then(function () { expect(unculledCommandCount).toBeGreaterThan( - scene.frameState.commandList.length + scene.frameState.commandList.length, ); }); }); @@ -1543,14 +1559,14 @@ describe( it("disables skirts and enables back face culling when camera is underground", function () { switchViewMode( SceneMode.SCENE3D, - new GeographicProjection(Ellipsoid.WGS84) + new GeographicProjection(Ellipsoid.WGS84), ); return updateUntilDone(scene.globe) .then(function () { const command = scene.frameState.commandList[0]; expect(command.count).toBe( - command.owner.data.renderedMesh.indices.length + command.owner.data.renderedMesh.indices.length, ); // Has skirts expect(command.renderState.cull.enabled).toBe(true); // Has back face culling @@ -1559,12 +1575,12 @@ describe( destination: new Cartesian3( -746658.0557573901, -5644191.0002196245, - 2863585.099969967 + 2863585.099969967, ), orientation: new HeadingPitchRoll( 0.3019699121236403, 0.07316306869231592, - 0.0007089903642230055 + 0.0007089903642230055, ), }); return updateUntilDone(scene.globe); @@ -1572,7 +1588,7 @@ describe( .then(function () { const command = scene.frameState.commandList[0]; expect(command.count).toBe( - command.owner.data.renderedMesh.indexCountWithoutSkirts + command.owner.data.renderedMesh.indexCountWithoutSkirts, ); // No skirts expect(command.renderState.cull.enabled).toBe(false); // No back face culling }); @@ -1581,7 +1597,7 @@ describe( it("Detects change in vertical exaggeration", function () { switchViewMode( SceneMode.SCENE3D, - new GeographicProjection(Ellipsoid.WGS84) + new GeographicProjection(Ellipsoid.WGS84), ); scene.camera.flyHome(0.0); @@ -1589,48 +1605,58 @@ describe( scene.verticalExaggerationRelativeHeight = 0.0; return updateUntilDone(scene.globe).then(function () { - forEachRenderedTile(scene.globe._surface, 1, undefined, function ( - tile - ) { - const surfaceTile = tile.data; - const encoding = surfaceTile.mesh.encoding; - const boundingSphere = surfaceTile.tileBoundingRegion.boundingSphere; - expect(encoding.exaggeration).toEqual(1.0); - expect(encoding.hasGeodeticSurfaceNormals).toEqual(false); - expect(boundingSphere.radius).toBeLessThan(7000000.0); - }); - - scene.verticalExaggeration = 2.0; - scene.verticalExaggerationRelativeHeight = -1000000.0; - - return updateUntilDone(scene.globe).then(function () { - forEachRenderedTile(scene.globe._surface, 1, undefined, function ( - tile - ) { + forEachRenderedTile( + scene.globe._surface, + 1, + undefined, + function (tile) { const surfaceTile = tile.data; const encoding = surfaceTile.mesh.encoding; const boundingSphere = surfaceTile.tileBoundingRegion.boundingSphere; - expect(encoding.exaggeration).toEqual(2.0); - expect(encoding.hasGeodeticSurfaceNormals).toEqual(true); - expect(boundingSphere.radius).toBeGreaterThan(7000000.0); - }); + expect(encoding.exaggeration).toEqual(1.0); + expect(encoding.hasGeodeticSurfaceNormals).toEqual(false); + expect(boundingSphere.radius).toBeLessThan(7000000.0); + }, + ); - scene.verticalExaggeration = 1.0; - scene.verticalExaggerationRelativeHeight = 0.0; + scene.verticalExaggeration = 2.0; + scene.verticalExaggerationRelativeHeight = -1000000.0; - return updateUntilDone(scene.globe).then(function () { - forEachRenderedTile(scene.globe._surface, 1, undefined, function ( - tile - ) { + return updateUntilDone(scene.globe).then(function () { + forEachRenderedTile( + scene.globe._surface, + 1, + undefined, + function (tile) { const surfaceTile = tile.data; const encoding = surfaceTile.mesh.encoding; const boundingSphere = surfaceTile.tileBoundingRegion.boundingSphere; - expect(encoding.exaggeration).toEqual(1.0); - expect(encoding.hasGeodeticSurfaceNormals).toEqual(false); - expect(boundingSphere.radius).toBeLessThan(7000000.0); - }); + expect(encoding.exaggeration).toEqual(2.0); + expect(encoding.hasGeodeticSurfaceNormals).toEqual(true); + expect(boundingSphere.radius).toBeGreaterThan(7000000.0); + }, + ); + + scene.verticalExaggeration = 1.0; + scene.verticalExaggerationRelativeHeight = 0.0; + + return updateUntilDone(scene.globe).then(function () { + forEachRenderedTile( + scene.globe._surface, + 1, + undefined, + function (tile) { + const surfaceTile = tile.data; + const encoding = surfaceTile.mesh.encoding; + const boundingSphere = + surfaceTile.tileBoundingRegion.boundingSphere; + expect(encoding.exaggeration).toEqual(1.0); + expect(encoding.hasGeodeticSurfaceNormals).toEqual(false); + expect(boundingSphere.radius).toBeLessThan(7000000.0); + }, + ); }); }); }); @@ -1645,7 +1671,7 @@ describe( data, headers, deferred, - overrideMimeType + overrideMimeType, ) { if (defined(url.match(/\/\d+\/\d+\/\d+\.terrain/))) { Resource._DefaultImplementations.loadWithXhr( @@ -1654,7 +1680,7 @@ describe( method, data, headers, - deferred + deferred, ); return; } @@ -1666,14 +1692,14 @@ describe( data, headers, deferred, - overrideMimeType + overrideMimeType, ); }; scene.terrainProvider = await CesiumTerrainProvider.fromUrl( "Data/CesiumTerrainTileJson/QuantizedMesh.tile.json", { requestWaterMask: true, - } + }, ); scene.globe.showWaterEffect = false; @@ -1682,5 +1708,5 @@ describe( expect(scene.globe._surface.tileProvider.hasWaterMask).toBeTrue(); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/GlobeSurfaceTileSpec.js b/packages/engine/Specs/Scene/GlobeSurfaceTileSpec.js index 10a31d4201da..3f9f2cf6c013 100644 --- a/packages/engine/Specs/Scene/GlobeSurfaceTileSpec.js +++ b/packages/engine/Specs/Scene/GlobeSurfaceTileSpec.js @@ -45,7 +45,7 @@ describe("Scene/GlobeSurfaceTile", function () { processor = new TerrainTileProcessor( frameState, mockTerrain, - imageryLayerCollection + imageryLayerCollection, ); }); @@ -72,10 +72,10 @@ describe("Scene/GlobeSurfaceTile", function () { return processor.process([rootTile.southwestChild]).then(function () { expect(rootTile.southwestChild.state).toBe( - QuadtreeTileLoadState.LOADING + QuadtreeTileLoadState.LOADING, ); expect(rootTile.southwestChild.data.terrainState).toBe( - TerrainState.UNLOADED + TerrainState.UNLOADED, ); }); }); @@ -85,10 +85,10 @@ describe("Scene/GlobeSurfaceTile", function () { return processor.process([rootTile.southwestChild]).then(function () { expect(rootTile.southwestChild.state).toBe( - QuadtreeTileLoadState.LOADING + QuadtreeTileLoadState.LOADING, ); expect(rootTile.southwestChild.data.terrainState).toBe( - TerrainState.FAILED + TerrainState.FAILED, ); }); }); @@ -135,7 +135,7 @@ describe("Scene/GlobeSurfaceTile", function () { expect(TileProviderError.reportError.calls.count()).toBe(1); // Test that message argument is defined. expect(TileProviderError.reportError.calls.argsFor(0)[3]).toContain( - "RuntimeError: requestTileGeometry failed as requested." + "RuntimeError: requestTileGeometry failed as requested.", ); }); }); @@ -151,10 +151,10 @@ describe("Scene/GlobeSurfaceTile", function () { .process([rootTile, rootTile.southwestChild]) .then(function () { expect(rootTile.data.terrainData.wasCreatedByUpsampling()).toBe( - false + false, ); expect( - rootTile.southwestChild.data.terrainData.wasCreatedByUpsampling() + rootTile.southwestChild.data.terrainData.wasCreatedByUpsampling(), ).toBe(true); }); }); @@ -196,7 +196,7 @@ describe("Scene/GlobeSurfaceTile", function () { expect(rootTile.state).toBe(QuadtreeTileLoadState.DONE); expect(rootTile.upsampledFromParent).toBe(false); expect(rootTile.southwestChild.state).toBe( - QuadtreeTileLoadState.DONE + QuadtreeTileLoadState.DONE, ); expect(rootTile.southwestChild.upsampledFromParent).toBe(true); }); @@ -224,7 +224,7 @@ describe("Scene/GlobeSurfaceTile", function () { expect(rootTile.state).toBe(QuadtreeTileLoadState.DONE); expect(rootTile.upsampledFromParent).toBe(false); expect(rootTile.southwestChild.state).toBe( - QuadtreeTileLoadState.DONE + QuadtreeTileLoadState.DONE, ); expect(rootTile.southwestChild.upsampledFromParent).toBe(false); }); @@ -252,7 +252,7 @@ describe("Scene/GlobeSurfaceTile", function () { expect(rootTile.state).toBe(QuadtreeTileLoadState.DONE); expect(rootTile.upsampledFromParent).toBe(false); expect(rootTile.southwestChild.state).toBe( - QuadtreeTileLoadState.DONE + QuadtreeTileLoadState.DONE, ); expect(rootTile.southwestChild.upsampledFromParent).toBe(false); }); @@ -290,7 +290,7 @@ describe("Scene/GlobeSurfaceTile", function () { .process([rootTile, rootTile.southwestChild]) .then(function () { expect(rootTile.data.waterMaskTexture).toBe( - rootTile.southwestChild.data.waterMaskTexture + rootTile.southwestChild.data.waterMaskTexture, ); }); }); @@ -316,7 +316,7 @@ describe("Scene/GlobeSurfaceTile", function () { .then(function () { expect(rootTile.southwestChild.data.waterMaskTexture).toBeDefined(); expect( - rootTile.southwestChild.data.waterMaskTranslationAndScale + rootTile.southwestChild.data.waterMaskTranslationAndScale, ).toEqual(new Cartesian4(0.0, 0.0, 0.5, 0.5)); }); }); @@ -356,18 +356,17 @@ describe("Scene/GlobeSurfaceTile", function () { new Cartesian3( -5052039.459789615, 2561172.040315167, - -2936276.999965875 + -2936276.999965875, ), new Cartesian3( 0.5036332963145244, 0.6648033332898124, - 0.5517155343926082 - ) + 0.5517155343926082, + ), ); const pickResult = tile.data.pick(ray, undefined, undefined, true); - const cartographic = Ellipsoid.WGS84.cartesianToCartographic( - pickResult - ); + const cartographic = + Ellipsoid.WGS84.cartesianToCartographic(pickResult); expect(cartographic.height).toBeGreaterThan(-500.0); }); @@ -396,7 +395,7 @@ describe("Scene/GlobeSurfaceTile", function () { ray, undefined, undefined, - cullBackFaces + cullBackFaces, ); expect(pickResult.x).toBeGreaterThan(0.0); }); @@ -425,13 +424,13 @@ describe("Scene/GlobeSurfaceTile", function () { ray, undefined, undefined, - cullBackFaces + cullBackFaces, ); expect(pickResult.x).toBeGreaterThan(0.0); }); }); }, - "WebGL" + "WebGL", ); describe("eligibleForUnloading", function () { diff --git a/packages/engine/Specs/Scene/GlobeTranslucencyFramebufferSpec.js b/packages/engine/Specs/Scene/GlobeTranslucencyFramebufferSpec.js index 97b58d8bef0f..8ce1b8ad8502 100644 --- a/packages/engine/Specs/Scene/GlobeTranslucencyFramebufferSpec.js +++ b/packages/engine/Specs/Scene/GlobeTranslucencyFramebufferSpec.js @@ -54,7 +54,7 @@ describe("Scene/GlobeTranslucencyFramebuffer", function () { globeTranslucency.packedDepthFramebuffer; expect(globeTranslucency._clearCommand.framebuffer).toBe(firstFramebuffer); expect(globeTranslucency._packedDepthCommand.framebuffer).toBe( - firstPackedDepthFramebuffer + firstPackedDepthFramebuffer, ); viewport.width = 50; @@ -62,10 +62,10 @@ describe("Scene/GlobeTranslucencyFramebuffer", function () { expect(firstColorTexture.isDestroyed()).toBe(true); expect(globeTranslucency._colorTexture).not.toBe(firstColorTexture); expect(globeTranslucency._clearCommand.framebuffer).not.toBe( - firstFramebuffer + firstFramebuffer, ); expect(globeTranslucency._packedDepthCommand.framebuffer).not.toBe( - firstPackedDepthFramebuffer + firstPackedDepthFramebuffer, ); }); @@ -89,7 +89,7 @@ describe("Scene/GlobeTranslucencyFramebuffer", function () { expect(firstColorTexture.isDestroyed()).toBe(true); expect(globeTranslucency.classificationTexture).not.toBe(firstColorTexture); expect(globeTranslucency.classificationTexture.pixelDatatype).toBe( - expectedPixelDatatype + expectedPixelDatatype, ); }); diff --git a/packages/engine/Specs/Scene/GlobeTranslucencyStateSpec.js b/packages/engine/Specs/Scene/GlobeTranslucencyStateSpec.js index 61a65cd7420f..55982f57bd44 100644 --- a/packages/engine/Specs/Scene/GlobeTranslucencyStateSpec.js +++ b/packages/engine/Specs/Scene/GlobeTranslucencyStateSpec.js @@ -130,7 +130,7 @@ describe("Scene/GlobeTranslucencyState", function () { 0.0, 0.5, 1.0, - 0.75 + 0.75, ); state.update(scene); expect(frontFaceAlphaByDistance.nearValue).toBe(0.25); @@ -630,17 +630,17 @@ describe("Scene/GlobeTranslucencyState", function () { executeCommand, framebuffer, scene, - passState + passState, ); expect(executeCommand).toHaveBeenCalledWith( command.derivedCommands.globeTranslucency.opaqueBackFaceCommand, scene, context, - passState + passState, ); expect( - GlobeTranslucencyFramebuffer.prototype.clearClassification + GlobeTranslucencyFramebuffer.prototype.clearClassification, ).toHaveBeenCalled(); }); @@ -657,7 +657,7 @@ describe("Scene/GlobeTranslucencyState", function () { executeCommand, framebuffer, scene, - passState + passState, ); expect(executeCommand).not.toHaveBeenCalled(); @@ -686,9 +686,8 @@ describe("Scene/GlobeTranslucencyState", function () { const frustumCommands = new FrustumCommands(); frustumCommands.commands[Pass.GLOBE] = globeCommands; frustumCommands.indices[Pass.GLOBE] = globeCommands.length; - frustumCommands.commands[ - Pass.TERRAIN_CLASSIFICATION - ] = classificationCommands; + frustumCommands.commands[Pass.TERRAIN_CLASSIFICATION] = + classificationCommands; frustumCommands.indices[Pass.TERRAIN_CLASSIFICATION] = classificationCommands.length; @@ -697,25 +696,25 @@ describe("Scene/GlobeTranslucencyState", function () { executeCommand, framebuffer, scene, - passState + passState, ); expect(executeCommand).toHaveBeenCalledWith( classificationCommand, scene, context, - passState + passState, ); expect(executeCommand).toHaveBeenCalledWith( command.derivedCommands.globeTranslucency.depthOnlyFrontFaceCommand, scene, context, - passState + passState, ); if (context.depthTexture) { expect( - GlobeTranslucencyFramebuffer.prototype.packDepth + GlobeTranslucencyFramebuffer.prototype.packDepth, ).toHaveBeenCalled(); } }); diff --git a/packages/engine/Specs/Scene/GltfBufferViewLoaderSpec.js b/packages/engine/Specs/Scene/GltfBufferViewLoaderSpec.js index 97fb9610212e..072d77c113f4 100644 --- a/packages/engine/Specs/Scene/GltfBufferViewLoaderSpec.js +++ b/packages/engine/Specs/Scene/GltfBufferViewLoaderSpec.js @@ -92,7 +92,7 @@ describe("Scene/GltfBufferViewLoader", function () { const meshoptPositionBufferBase64 = "oAUZJkCZgAQAAAU/P8D/fn1+fX59fn1+fX7ADAAAfX4FAAhISEgAAAAFAAzMzH1+fX59zAAAAH59BQhAmYBmZgAABQzA/8B9fn1+fX59//8AAH59fn1+fX59AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP8//z8AAA=="; const meshoptPositionTypedArray = getTypedArrayFromBase64( - meshoptPositionBufferBase64 + meshoptPositionBufferBase64, ); const bufferTypedArray = new Uint8Array([1, 3, 7, 15, 31, 63, 127, 255]); @@ -169,7 +169,7 @@ describe("Scene/GltfBufferViewLoader", function () { it("load throws if buffer fails to load", async function () { spyOn(Resource.prototype, "fetchArrayBuffer").and.callFake(() => - Promise.reject(new Error("404 Not Found")) + Promise.reject(new Error("404 Not Found")), ); const bufferViewLoader = new GltfBufferViewLoader({ @@ -182,7 +182,7 @@ describe("Scene/GltfBufferViewLoader", function () { await expectAsync(bufferViewLoader.load()).toBeRejectedWithError( RuntimeError, - "Failed to load buffer view\nFailed to load external buffer: https://example.com/external.bin\n404 Not Found" + "Failed to load buffer view\nFailed to load external buffer: https://example.com/external.bin\n404 Not Found", ); }); @@ -210,7 +210,7 @@ describe("Scene/GltfBufferViewLoader", function () { it("loads buffer view for external buffer", async function () { spyOn(Resource.prototype, "fetchArrayBuffer").and.returnValue( - Promise.resolve(bufferArrayBuffer) + Promise.resolve(bufferArrayBuffer), ); const bufferViewLoader = new GltfBufferViewLoader({ @@ -228,12 +228,12 @@ describe("Scene/GltfBufferViewLoader", function () { it("destroys buffer view", async function () { spyOn(Resource.prototype, "fetchArrayBuffer").and.returnValue( - Promise.resolve(bufferArrayBuffer) + Promise.resolve(bufferArrayBuffer), ); const unloadBuffer = spyOn( BufferLoader.prototype, - "unload" + "unload", ).and.callThrough(); const bufferViewLoader = new GltfBufferViewLoader({ @@ -278,14 +278,14 @@ describe("Scene/GltfBufferViewLoader", function () { await bufferViewLoader.load(); const decodedPositionBase64 = getBase64FromTypedArray( - bufferViewLoader.typedArray + bufferViewLoader.typedArray, ); expect(decodedPositionBase64).toEqual(fallbackPositionBufferBase64); }); it("handles asynchronous load after destroy", async function () { spyOn(Resource.prototype, "fetchArrayBuffer").and.returnValue( - Promise.resolve(bufferArrayBuffer) + Promise.resolve(bufferArrayBuffer), ); const bufferViewLoader = new GltfBufferViewLoader({ @@ -308,7 +308,7 @@ describe("Scene/GltfBufferViewLoader", function () { it("handles asynchronous error after destroy", async function () { spyOn(Resource.prototype, "fetchArrayBuffer").and.callFake(() => - Promise.reject(new Error()) + Promise.reject(new Error()), ); const bufferViewLoader = new GltfBufferViewLoader({ diff --git a/packages/engine/Specs/Scene/GltfBuilder.js b/packages/engine/Specs/Scene/GltfBuilder.js index 7819df4ae663..adb10f2f1d89 100644 --- a/packages/engine/Specs/Scene/GltfBuilder.js +++ b/packages/engine/Specs/Scene/GltfBuilder.js @@ -96,11 +96,10 @@ GltfBuilder.prototype.toGltf = function () { const byteLength = bufferBuilder.viewBuilders.reduce(function ( byteLength, - viewBuilder + viewBuilder, ) { return byteLength + viewBuilder.bufferView.byteLength; - }, - 0); + }, 0); const buffer = new ArrayBuffer(byteLength); let nextStart = 0; @@ -343,9 +342,8 @@ GltfBufferBuilder.prototype.indexBuffer = function (name) { function GltfBufferViewBuilder(bufferBuilder, bufferViewIndex, componentType) { this.bufferBuilder = bufferBuilder; this.bufferViewIndex = bufferViewIndex; - this.bufferView = this.bufferBuilder.gltfBuilder.gltf.bufferViews[ - this.bufferViewIndex - ]; + this.bufferView = + this.bufferBuilder.gltfBuilder.gltf.bufferViews[this.bufferViewIndex]; this.componentType = componentType; this.elementStride = 0; this.nextOffset = 0; diff --git a/packages/engine/Specs/Scene/GltfDracoLoaderSpec.js b/packages/engine/Specs/Scene/GltfDracoLoaderSpec.js index 4d99a8c995f4..d6aada9505b2 100644 --- a/packages/engine/Specs/Scene/GltfDracoLoaderSpec.js +++ b/packages/engine/Specs/Scene/GltfDracoLoaderSpec.js @@ -215,13 +215,13 @@ describe( await expectAsync(dracoLoader.load()).toBeRejectedWithError( RuntimeError, - "Failed to load Draco\nFailed to load buffer view\nFailed to load external buffer: https://example.com/external.bin\n404 Not Found" + "Failed to load Draco\nFailed to load buffer view\nFailed to load external buffer: https://example.com/external.bin\n404 Not Found", ); }); it("process throws if draco decoding fails", async function () { spyOn(Resource.prototype, "fetchArrayBuffer").and.returnValue( - Promise.resolve(bufferArrayBuffer) + Promise.resolve(bufferArrayBuffer), ); spyOn(DracoLoader, "decodeBufferView").and.callFake(function () { @@ -240,17 +240,17 @@ describe( await dracoLoader.load(); await expectAsync( - waitForLoaderProcess(dracoLoader, scene) + waitForLoaderProcess(dracoLoader, scene), ).toBeRejectedWithError( RuntimeError, - "Failed to load Draco\nDraco decode failed" + "Failed to load Draco\nDraco decode failed", ); expect(() => loaderProcess(dracoLoader, scene)).not.toThrowError(); }); it("loads draco", async function () { spyOn(Resource.prototype, "fetchArrayBuffer").and.returnValue( - Promise.resolve(bufferArrayBuffer) + Promise.resolve(bufferArrayBuffer), ); // Simulate decodeBufferView not being ready for a few frames @@ -276,25 +276,25 @@ describe( expect(() => loaderProcess(dracoLoader, scene)).not.toThrowError(); expect(dracoLoader.decodedData.indices).toBe( - decodeDracoResults.indexArray + decodeDracoResults.indexArray, ); expect(dracoLoader.decodedData.vertexAttributes).toBe( - decodeDracoResults.attributeData + decodeDracoResults.attributeData, ); }); it("destroys draco loader", async function () { spyOn(Resource.prototype, "fetchArrayBuffer").and.returnValue( - Promise.resolve(bufferArrayBuffer) + Promise.resolve(bufferArrayBuffer), ); spyOn(DracoLoader, "decodeBufferView").and.returnValue( - Promise.resolve(decodeDracoResults) + Promise.resolve(decodeDracoResults), ); const unloadBufferView = spyOn( GltfBufferViewLoader.prototype, - "unload" + "unload", ).and.callThrough(); const dracoLoader = new GltfDracoLoader({ @@ -328,7 +328,7 @@ describe( }); spyOn(DracoLoader, "decodeBufferView").and.returnValue( - Promise.resolve(decodeDracoResults) + Promise.resolve(decodeDracoResults), ); const dracoLoader = new GltfDracoLoader({ @@ -377,7 +377,7 @@ describe( const decodeBufferView = spyOn( DracoLoader, - "decodeBufferView" + "decodeBufferView", ).and.callFake(function () { return new Promise(function (resolve, reject) { if (rejectPromise) { @@ -406,5 +406,5 @@ describe( return resolveDracoAfterDestroy(true); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/GltfImageLoaderSpec.js b/packages/engine/Specs/Scene/GltfImageLoaderSpec.js index ef1310a09c14..81cfcd325559 100644 --- a/packages/engine/Specs/Scene/GltfImageLoaderSpec.js +++ b/packages/engine/Specs/Scene/GltfImageLoaderSpec.js @@ -20,18 +20,18 @@ describe( "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO+ip1sAAAAASUVORK5CYII="; const pngBuffer = dataUriToBuffer( - "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO+ip1sAAAAASUVORK5CYII=" + "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO+ip1sAAAAASUVORK5CYII=", ); const jpgBuffer = dataUriToBuffer( - "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAP//////////////////////////////////////////////////////////////////////////////////////wAALCAABAAEBAREA/8QAJgABAAAAAAAAAAAAAAAAAAAAAxABAAAAAAAAAAAAAAAAAAAAAP/aAAgBAQAAPwBH/9k" + "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAP//////////////////////////////////////////////////////////////////////////////////////wAALCAABAAEBAREA/8QAJgABAAAAAAAAAAAAAAAAAAAAAxABAAAAAAAAAAAAAAAAAAAAAP/aAAgBAQAAPwBH/9k", ); const webpBuffer = dataUriToBuffer( - "data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA" + "data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA", ); const gifBuffer = dataUriToBuffer( - "data:image/gif;base64,R0lGODdhBAAEAIAAAP///////ywAAAAABAAEAAACBISPCQUAOw==" + "data:image/gif;base64,R0lGODdhBAAEAIAAAP///////ywAAAAABAAEAAACBISPCQUAOw==", ); let ktx2BasisBuffer; @@ -186,13 +186,13 @@ describe( await expectAsync(imageLoader.load()).toBeRejectedWithError( RuntimeError, - "Failed to load embedded image\nFailed to load buffer view\nFailed to load external buffer: https://example.com/external.bin\n404 Not Found" + "Failed to load embedded image\nFailed to load buffer view\nFailed to load external buffer: https://example.com/external.bin\n404 Not Found", ); }); it("load throws if image format is not recognized", async function () { spyOn(Resource.prototype, "fetchArrayBuffer").and.returnValue( - Promise.resolve(gifBuffer) + Promise.resolve(gifBuffer), ); const imageLoader = new GltfImageLoader({ @@ -205,7 +205,7 @@ describe( await expectAsync(imageLoader.load()).toBeRejectedWithError( RuntimeError, - "Failed to load embedded image\nImage format is not recognized" + "Failed to load embedded image\nImage format is not recognized", ); }); @@ -225,13 +225,13 @@ describe( await expectAsync(imageLoader.load()).toBeRejectedWithError( RuntimeError, - "Failed to load image: image.png\n404 Not Found" + "Failed to load image: image.png\n404 Not Found", ); }); async function loadsFromBufferView(imageBuffer) { spyOn(Resource.prototype, "fetchArrayBuffer").and.returnValue( - Promise.resolve(imageBuffer) + Promise.resolve(imageBuffer), ); const imageLoader = new GltfImageLoader({ @@ -272,7 +272,7 @@ describe( } spyOn(BufferLoader, "_fetchArrayBuffer").and.returnValue( - Promise.resolve(ktx2BasisBuffer) + Promise.resolve(ktx2BasisBuffer), ); const imageLoader = new GltfImageLoader({ @@ -297,7 +297,7 @@ describe( } spyOn(BufferLoader, "_fetchArrayBuffer").and.returnValue( - Promise.resolve(ktx2BasisMipmapBuffer) + Promise.resolve(ktx2BasisMipmapBuffer), ); const imageLoader = new GltfImageLoader({ @@ -318,7 +318,7 @@ describe( it("loads from uri", async function () { spyOn(Resource.prototype, "fetchImage").and.returnValue( - Promise.resolve(image) + Promise.resolve(image), ); const imageLoader = new GltfImageLoader({ @@ -377,12 +377,12 @@ describe( it("destroys image loader", async function () { spyOn(Resource.prototype, "fetchArrayBuffer").and.returnValue( - Promise.resolve(pngBuffer) + Promise.resolve(pngBuffer), ); const unloadBufferView = spyOn( GltfBufferViewLoader.prototype, - "unload" + "unload", ).and.callThrough(); const imageLoader = new GltfImageLoader({ @@ -415,7 +415,7 @@ describe( } else { resolve(pngBuffer); } - }) + }), ); const imageLoader = new GltfImageLoader({ @@ -447,7 +447,7 @@ describe( async function resolveImageFromTypedArrayAfterDestroy(rejectPromise) { spyOn(Resource.prototype, "fetchArrayBuffer").and.returnValue( - Promise.resolve(pngBuffer) + Promise.resolve(pngBuffer), ); spyOn(GltfImageLoader, "_loadImageFromTypedArray").and.callFake( @@ -458,7 +458,7 @@ describe( } else { resolve(image); } - }) + }), ); const imageLoader = new GltfImageLoader({ @@ -496,7 +496,7 @@ describe( } else { resolve(image); } - }) + }), ); const imageLoader = new GltfImageLoader({ @@ -526,5 +526,5 @@ describe( return resolveUriAfterDestroy(true); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/GltfIndexBufferLoaderSpec.js b/packages/engine/Specs/Scene/GltfIndexBufferLoaderSpec.js index ecd36f1209d8..18baacf9f881 100644 --- a/packages/engine/Specs/Scene/GltfIndexBufferLoaderSpec.js +++ b/packages/engine/Specs/Scene/GltfIndexBufferLoaderSpec.js @@ -20,14 +20,7 @@ describe( "Scene/GltfIndexBufferLoader", function () { const dracoBufferTypedArray = new Uint8Array([ - 1, - 3, - 7, - 15, - 31, - 63, - 127, - 255, + 1, 3, 7, 15, 31, 63, 127, 255, ]); const dracoArrayBuffer = dracoBufferTypedArray.buffer; @@ -351,7 +344,7 @@ describe( it("load throws if buffer view fails to load", async function () { spyOn(Resource.prototype, "fetchArrayBuffer").and.callFake(() => - Promise.reject(new Error("404 Not Found")) + Promise.reject(new Error("404 Not Found")), ); const indexBufferLoader = new GltfIndexBufferLoader({ @@ -365,13 +358,13 @@ describe( await expectAsync(indexBufferLoader.load()).toBeRejectedWithError( RuntimeError, - "Failed to load index buffer\nFailed to load buffer view\nFailed to load external buffer: https://example.com/external.bin\n404 Not Found" + "Failed to load index buffer\nFailed to load buffer view\nFailed to load external buffer: https://example.com/external.bin\n404 Not Found", ); }); it("process throws if draco fails to load", async function () { spyOn(Resource.prototype, "fetchArrayBuffer").and.returnValue( - Promise.resolve(dracoArrayBuffer) + Promise.resolve(dracoArrayBuffer), ); spyOn(DracoLoader, "decodeBufferView").and.callFake(function () { @@ -391,16 +384,16 @@ describe( await indexBufferLoader.load(); await expectAsync( - waitForLoaderProcess(indexBufferLoader, scene) + waitForLoaderProcess(indexBufferLoader, scene), ).toBeRejectedWithError( RuntimeError, - "Failed to load index buffer\nFailed to load Draco\nDraco decode failed" + "Failed to load index buffer\nFailed to load Draco\nDraco decode failed", ); }); it("loads from accessor into buffer", async function () { spyOn(Resource.prototype, "fetchArrayBuffer").and.returnValue( - Promise.resolve(arrayBuffer) + Promise.resolve(arrayBuffer), ); // Simulate JobScheduler not being ready for a few frames @@ -408,15 +401,14 @@ describe( let processCallsCount = 0; const jobScheduler = scene.frameState.jobScheduler; const originalJobSchedulerExecute = jobScheduler.execute; - spyOn(JobScheduler.prototype, "execute").and.callFake(function ( - job, - jobType - ) { - if (processCallsCount++ >= processCallsTotal) { - return originalJobSchedulerExecute.call(jobScheduler, job, jobType); - } - return false; - }); + spyOn(JobScheduler.prototype, "execute").and.callFake( + function (job, jobType) { + if (processCallsCount++ >= processCallsTotal) { + return originalJobSchedulerExecute.call(jobScheduler, job, jobType); + } + return false; + }, + ); const indexBufferLoader = new GltfIndexBufferLoader({ resourceCache: ResourceCache, @@ -432,17 +424,17 @@ describe( expect(() => loaderProcess(indexBufferLoader, scene)).not.toThrow(); expect(indexBufferLoader.buffer.sizeInBytes).toBe( - indicesUint16.byteLength + indicesUint16.byteLength, ); expect(indexBufferLoader.typedArray).toBeUndefined(); expect(ResourceCache.statistics.geometryByteLength).toBe( - indexBufferLoader.buffer.sizeInBytes + indexBufferLoader.buffer.sizeInBytes, ); }); it("loads from accessor as typed array", async function () { spyOn(Resource.prototype, "fetchArrayBuffer").and.returnValue( - Promise.resolve(arrayBuffer) + Promise.resolve(arrayBuffer), ); spyOn(Buffer, "createIndexBuffer").and.callThrough(); @@ -460,18 +452,18 @@ describe( await waitForLoaderProcess(indexBufferLoader, scene); expect(indexBufferLoader.typedArray.byteLength).toBe( - indicesUint16.byteLength + indicesUint16.byteLength, ); expect(indexBufferLoader.buffer).toBeUndefined(); expect(Buffer.createIndexBuffer.calls.count()).toBe(0); expect(ResourceCache.statistics.geometryByteLength).toBe( - indexBufferLoader.typedArray.byteLength + indexBufferLoader.typedArray.byteLength, ); }); it("loads from accessor as buffer and typed array", async function () { spyOn(Resource.prototype, "fetchArrayBuffer").and.returnValue( - Promise.resolve(arrayBuffer) + Promise.resolve(arrayBuffer), ); const indexBufferLoader = new GltfIndexBufferLoader({ @@ -488,19 +480,19 @@ describe( await waitForLoaderProcess(indexBufferLoader, scene); expect(indexBufferLoader.buffer.sizeInBytes).toBe( - indicesUint16.byteLength + indicesUint16.byteLength, ); expect(indexBufferLoader.typedArray.byteLength).toBe( - indicesUint16.byteLength + indicesUint16.byteLength, ); expect(ResourceCache.statistics.geometryByteLength).toBe( - 2 * indexBufferLoader.typedArray.byteLength + 2 * indexBufferLoader.typedArray.byteLength, ); }); it("creates index buffer synchronously", async function () { spyOn(Resource.prototype, "fetchArrayBuffer").and.returnValue( - Promise.resolve(arrayBuffer) + Promise.resolve(arrayBuffer), ); const indexBufferLoader = new GltfIndexBufferLoader({ @@ -517,13 +509,13 @@ describe( await waitForLoaderProcess(indexBufferLoader, scene); expect(indexBufferLoader.buffer.sizeInBytes).toBe( - indicesUint16.byteLength + indicesUint16.byteLength, ); }); async function loadIndices(accessorId, expectedByteLength) { spyOn(Resource.prototype, "fetchArrayBuffer").and.returnValue( - Promise.resolve(arrayBuffer) + Promise.resolve(arrayBuffer), ); const indexBufferLoader = new GltfIndexBufferLoader({ @@ -559,7 +551,7 @@ describe( it("loads from draco", async function () { spyOn(Resource.prototype, "fetchArrayBuffer").and.returnValue( - Promise.resolve(arrayBuffer) + Promise.resolve(arrayBuffer), ); // Simulate decodeBufferView not being ready for a few frames @@ -587,20 +579,20 @@ describe( expect(() => loaderProcess(indexBufferLoader, scene)).not.toThrow(); expect(indexBufferLoader.buffer.sizeInBytes).toBe( - decodedIndices.byteLength + decodedIndices.byteLength, ); expect(ResourceCache.statistics.geometryByteLength).toBe( - indexBufferLoader.buffer.sizeInBytes + indexBufferLoader.buffer.sizeInBytes, ); }); it("uses the decoded data's type instead of the accessor component type", async function () { spyOn(Resource.prototype, "fetchArrayBuffer").and.returnValue( - Promise.resolve(arrayBuffer) + Promise.resolve(arrayBuffer), ); spyOn(DracoLoader, "decodeBufferView").and.returnValue( - Promise.resolve(decodeDracoResults) + Promise.resolve(decodeDracoResults), ); const clonedGltf = clone(gltfDraco, true); @@ -625,17 +617,17 @@ describe( it("destroys index buffer loaded from buffer view", async function () { spyOn(Resource.prototype, "fetchArrayBuffer").and.returnValue( - Promise.resolve(arrayBuffer) + Promise.resolve(arrayBuffer), ); const unloadBufferView = spyOn( GltfBufferViewLoader.prototype, - "unload" + "unload", ).and.callThrough(); const destroyIndexBuffer = spyOn( Buffer.prototype, - "destroy" + "destroy", ).and.callThrough(); const indexBufferLoader = new GltfIndexBufferLoader({ @@ -663,21 +655,21 @@ describe( it("destroys index buffer loaded from draco", async function () { spyOn(Resource.prototype, "fetchArrayBuffer").and.returnValue( - Promise.resolve(arrayBuffer) + Promise.resolve(arrayBuffer), ); spyOn(DracoLoader, "decodeBufferView").and.returnValue( - Promise.resolve(decodeDracoResults) + Promise.resolve(decodeDracoResults), ); const unloadDraco = spyOn( GltfDracoLoader.prototype, - "unload" + "unload", ).and.callThrough(); const destroyIndexBuffer = spyOn( Buffer.prototype, - "destroy" + "destroy", ).and.callThrough(); const indexBufferLoader = new GltfIndexBufferLoader({ @@ -717,7 +709,7 @@ describe( spyOn(Resource.prototype, "fetchArrayBuffer").and.callFake(() => rejectPromise ? Promise.reject(new Error()) - : Promise.resolve(arrayBuffer) + : Promise.resolve(arrayBuffer), ); expect(indexBufferLoader.buffer).not.toBeDefined(); @@ -760,7 +752,7 @@ describe( const decodeBufferView = spyOn( DracoLoader, - "decodeBufferView" + "decodeBufferView", ).and.callFake(function () { return new Promise(function (resolve, reject) { if (rejectPromise) { @@ -775,7 +767,7 @@ describe( await indexBufferLoader.load(); // Destroy is called in mock function above await expectAsync( - waitForLoaderProcess(indexBufferLoader, scene) + waitForLoaderProcess(indexBufferLoader, scene), ).toBeResolved(); expect(decodeBufferView).toHaveBeenCalled(); // Make sure the decode actually starts @@ -791,5 +783,5 @@ describe( return resolveDracoAfterDestroy(true); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/GltfJsonLoaderSpec.js b/packages/engine/Specs/Scene/GltfJsonLoaderSpec.js index 84549d70126b..1978618855ae 100644 --- a/packages/engine/Specs/Scene/GltfJsonLoaderSpec.js +++ b/packages/engine/Specs/Scene/GltfJsonLoaderSpec.js @@ -594,7 +594,7 @@ describe("Scene/GltfJsonLoader", function () { await expectAsync(gltfJsonLoader.load()).toBeRejectedWithError( RuntimeError, - "Failed to load glTF: https://example.com/model.glb\n404 Not Found" + "Failed to load glTF: https://example.com/model.glb\n404 Not Found", ); }); @@ -605,11 +605,11 @@ describe("Scene/GltfJsonLoader", function () { }).buffer; spyOn(GltfJsonLoader.prototype, "_fetchGltf").and.returnValue( - Promise.resolve(arrayBuffer) + Promise.resolve(arrayBuffer), ); spyOn(Resource.prototype, "fetchArrayBuffer").and.returnValue( - Promise.resolve(new Float32Array([0.0, 0.0, 0.0]).buffer) + Promise.resolve(new Float32Array([0.0, 0.0, 0.0]).buffer), ); const gltfJsonLoader = new GltfJsonLoader({ @@ -620,7 +620,7 @@ describe("Scene/GltfJsonLoader", function () { await expectAsync(gltfJsonLoader.load()).toBeRejectedWithError( RuntimeError, - "Failed to load glTF: https://example.com/model.glb\nUnsupported glTF Extension: NOT_supported_extension" + "Failed to load glTF: https://example.com/model.glb\nUnsupported glTF Extension: NOT_supported_extension", ); }); @@ -628,7 +628,7 @@ describe("Scene/GltfJsonLoader", function () { const arrayBuffer = generateJsonBuffer(gltf1).buffer; spyOn(GltfJsonLoader.prototype, "_fetchGltf").and.returnValue( - Promise.resolve(arrayBuffer) + Promise.resolve(arrayBuffer), ); spyOn(Resource.prototype, "fetchArrayBuffer").and.callFake(function () { @@ -644,7 +644,7 @@ describe("Scene/GltfJsonLoader", function () { await expectAsync(gltfJsonLoader.load()).toBeRejectedWithError( RuntimeError, - "Failed to load glTF: https://example.com/model.glb\nFailed to load external buffer: https://example.com/external.bin\n404 Not Found" + "Failed to load glTF: https://example.com/model.glb\nFailed to load external buffer: https://example.com/external.bin\n404 Not Found", ); }); @@ -665,7 +665,7 @@ describe("Scene/GltfJsonLoader", function () { await expectAsync(gltfJsonLoader.load()).toBeRejectedWithError( RuntimeError, - "Failed to load glTF: https://example.com/model.glb\nFailed to load external buffer: https://example.com/external.bin\n404 Not Found" + "Failed to load glTF: https://example.com/model.glb\nFailed to load external buffer: https://example.com/external.bin\n404 Not Found", ); }); @@ -673,11 +673,11 @@ describe("Scene/GltfJsonLoader", function () { const arrayBuffer = generateJsonBuffer(gltf1).buffer; spyOn(GltfJsonLoader.prototype, "_fetchGltf").and.returnValue( - Promise.resolve(arrayBuffer) + Promise.resolve(arrayBuffer), ); spyOn(Resource.prototype, "fetchArrayBuffer").and.returnValue( - Promise.resolve(new Float32Array([0.0, 0.0, 0.0]).buffer) + Promise.resolve(new Float32Array([0.0, 0.0, 0.0]).buffer), ); const gltfJsonLoader = new GltfJsonLoader({ @@ -696,11 +696,11 @@ describe("Scene/GltfJsonLoader", function () { const arrayBuffer = generateJsonBuffer(gltf1MaterialsCommon).buffer; spyOn(GltfJsonLoader.prototype, "_fetchGltf").and.returnValue( - Promise.resolve(arrayBuffer) + Promise.resolve(arrayBuffer), ); spyOn(Resource.prototype, "fetchArrayBuffer").and.returnValue( - Promise.resolve(new Float32Array([0.0, 0.0, 0.0]).buffer) + Promise.resolve(new Float32Array([0.0, 0.0, 0.0]).buffer), ); const gltfJsonLoader = new GltfJsonLoader({ @@ -734,7 +734,7 @@ describe("Scene/GltfJsonLoader", function () { const arrayBuffer = createGlb1(gltf1Binary).buffer; spyOn(GltfJsonLoader.prototype, "_fetchGltf").and.returnValue( - Promise.resolve(arrayBuffer) + Promise.resolve(arrayBuffer), ); const gltfJsonLoader = new GltfJsonLoader({ @@ -761,7 +761,7 @@ describe("Scene/GltfJsonLoader", function () { const arrayBuffer = generateJsonBuffer(gltf1DataUri).buffer; spyOn(GltfJsonLoader.prototype, "_fetchGltf").and.returnValue( - Promise.resolve(arrayBuffer) + Promise.resolve(arrayBuffer), ); const gltfJsonLoader = new GltfJsonLoader({ @@ -779,11 +779,11 @@ describe("Scene/GltfJsonLoader", function () { const arrayBuffer = generateJsonBuffer(gltf2).buffer; spyOn(GltfJsonLoader.prototype, "_fetchGltf").and.returnValue( - Promise.resolve(arrayBuffer) + Promise.resolve(arrayBuffer), ); spyOn(Resource.prototype, "fetchArrayBuffer").and.returnValue( - Promise.resolve(new Float32Array([0.0, 0.0, 0.0]).buffer) + Promise.resolve(new Float32Array([0.0, 0.0, 0.0]).buffer), ); const gltfJsonLoader = new GltfJsonLoader({ @@ -802,11 +802,11 @@ describe("Scene/GltfJsonLoader", function () { const arrayBuffer = generateJsonBuffer(gltf2TechniquesWebgl).buffer; spyOn(GltfJsonLoader.prototype, "_fetchGltf").and.returnValue( - Promise.resolve(arrayBuffer) + Promise.resolve(arrayBuffer), ); spyOn(Resource.prototype, "fetchArrayBuffer").and.returnValue( - Promise.resolve(new Float32Array([0.0, 0.0, 0.0]).buffer) + Promise.resolve(new Float32Array([0.0, 0.0, 0.0]).buffer), ); const gltfJsonLoader = new GltfJsonLoader({ @@ -830,7 +830,7 @@ describe("Scene/GltfJsonLoader", function () { const arrayBuffer = createGlb2(gltf2Binary).buffer; spyOn(GltfJsonLoader.prototype, "_fetchGltf").and.returnValue( - Promise.resolve(arrayBuffer) + Promise.resolve(arrayBuffer), ); const gltfJsonLoader = new GltfJsonLoader({ @@ -856,7 +856,7 @@ describe("Scene/GltfJsonLoader", function () { const arrayBuffer = generateJsonBuffer(gltf2DataUri).buffer; spyOn(GltfJsonLoader.prototype, "_fetchGltf").and.returnValue( - Promise.resolve(arrayBuffer) + Promise.resolve(arrayBuffer), ); const gltfJsonLoader = new GltfJsonLoader({ @@ -897,7 +897,7 @@ describe("Scene/GltfJsonLoader", function () { const gltf = clone(gltf2, true); spyOn(Resource.prototype, "fetchArrayBuffer").and.returnValue( - Promise.resolve(new Float32Array([0.0, 0.0, 0.0]).buffer) + Promise.resolve(new Float32Array([0.0, 0.0, 0.0]).buffer), ); const gltfJsonLoader = new GltfJsonLoader({ @@ -920,12 +920,12 @@ describe("Scene/GltfJsonLoader", function () { const arrayBuffer = createGlb2(gltf2Binary).buffer; spyOn(GltfJsonLoader.prototype, "_fetchGltf").and.returnValue( - Promise.resolve(arrayBuffer) + Promise.resolve(arrayBuffer), ); const unloadBuffer = spyOn( BufferLoader.prototype, - "unload" + "unload", ).and.callThrough(); const gltfJsonLoader = new GltfJsonLoader({ @@ -949,7 +949,9 @@ describe("Scene/GltfJsonLoader", function () { async function resolvesGltfAfterDestroy(rejectPromise) { const arrayBuffer = generateJsonBuffer(gltf2).buffer; spyOn(GltfJsonLoader.prototype, "_fetchGltf").and.callFake(() => - rejectPromise ? Promise.reject(new Error()) : Promise.resolve(arrayBuffer) + rejectPromise + ? Promise.reject(new Error()) + : Promise.resolve(arrayBuffer), ); const gltfJsonLoader = new GltfJsonLoader({ @@ -977,7 +979,7 @@ describe("Scene/GltfJsonLoader", function () { async function resolvesProcessedGltfAfterDestroy(rejectPromise) { spyOn(GltfJsonLoader.prototype, "_fetchGltf").and.returnValue( - Promise.resolve(generateJsonBuffer(gltf2).buffer) + Promise.resolve(generateJsonBuffer(gltf2).buffer), ); const buffer = new Float32Array([0.0, 0.0, 0.0]).buffer; diff --git a/packages/engine/Specs/Scene/GltfLoaderSpec.js b/packages/engine/Specs/Scene/GltfLoaderSpec.js index cfcab67f19d3..8a6bae03d5c7 100644 --- a/packages/engine/Specs/Scene/GltfLoaderSpec.js +++ b/packages/engine/Specs/Scene/GltfLoaderSpec.js @@ -163,7 +163,7 @@ describe( it("load throws if glTF JSON fails to load", async function () { const error = new Error("404 Not Found"); spyOn(GltfJsonLoader.prototype, "_fetchGltf").and.returnValue( - Promise.reject(error) + Promise.reject(error), ); const gltfResource = new Resource({ @@ -178,7 +178,7 @@ describe( await expectAsync(gltfLoader.load()).toBeRejectedWithError( RuntimeError, - "Failed to load glTF\nFailed to load glTF: https://example.com/model.glb\n404 Not Found" + "Failed to load glTF\nFailed to load glTF: https://example.com/model.glb\n404 Not Found", ); }); @@ -230,7 +230,7 @@ describe( gltf = modifyFunction(gltf); spyOn(GltfJsonLoader.prototype, "_fetchGltf").and.returnValue( - Promise.resolve(generateJsonBuffer(gltf).buffer) + Promise.resolve(generateJsonBuffer(gltf).buffer), ); const gltfLoader = new GltfLoader(getOptions(gltfPath, options)); @@ -294,11 +294,11 @@ describe( const attributes = primitive.attributes; const positionAttribute = getAttribute( attributes, - VertexAttributeSemantic.POSITION + VertexAttributeSemantic.POSITION, ); const normalAttribute = getAttribute( attributes, - VertexAttributeSemantic.NORMAL + VertexAttributeSemantic.NORMAL, ); expect(positionAttribute.buffer).toBeDefined(); @@ -325,16 +325,16 @@ describe( const attributes = primitive.attributes; const positionAttribute = getAttribute( attributes, - VertexAttributeSemantic.POSITION + VertexAttributeSemantic.POSITION, ); const normalAttribute = getAttribute( attributes, - VertexAttributeSemantic.NORMAL + VertexAttributeSemantic.NORMAL, ); const texcoordAttribute = getAttribute( attributes, VertexAttributeSemantic.TEXCOORD, - 0 + 0, ); const indices = primitive.indices; @@ -370,11 +370,11 @@ describe( expect(positionAttribute.name).toBe("POSITION"); expect(positionAttribute.semantic).toBe( - VertexAttributeSemantic.POSITION + VertexAttributeSemantic.POSITION, ); expect(positionAttribute.setIndex).toBeUndefined(); expect(positionAttribute.componentDatatype).toBe( - ComponentDatatype.FLOAT + ComponentDatatype.FLOAT, ); expect(positionAttribute.type).toBe(AttributeType.VEC3); expect(positionAttribute.normalized).toBe(false); @@ -406,11 +406,11 @@ describe( expect(texcoordAttribute.name).toBe("TEXCOORD_0"); expect(texcoordAttribute.semantic).toBe( - VertexAttributeSemantic.TEXCOORD + VertexAttributeSemantic.TEXCOORD, ); expect(texcoordAttribute.setIndex).toBe(0); expect(texcoordAttribute.componentDatatype).toBe( - ComponentDatatype.FLOAT + ComponentDatatype.FLOAT, ); expect(texcoordAttribute.type).toBe(AttributeType.VEC2); expect(texcoordAttribute.normalized).toBe(false); @@ -436,7 +436,7 @@ describe( expect(texcoordAttribute.buffer.sizeInBytes).toBe(192); expect(metallicRoughness.baseColorFactor).toEqual( - new Cartesian4(1.0, 1.0, 1.0, 1.0) + new Cartesian4(1.0, 1.0, 1.0, 1.0), ); expect(metallicRoughness.metallicFactor).toBe(0.0); expect(metallicRoughness.roughnessFactor).toBe(1.0); @@ -448,10 +448,10 @@ describe( expect(sampler.wrapS).toBe(TextureWrap.REPEAT); expect(sampler.wrapT).toBe(TextureWrap.REPEAT); expect(sampler.magnificationFilter).toBe( - TextureMagnificationFilter.LINEAR + TextureMagnificationFilter.LINEAR, ); expect(sampler.minificationFilter).toBe( - TextureMinificationFilter.NEAREST_MIPMAP_LINEAR + TextureMinificationFilter.NEAREST_MIPMAP_LINEAR, ); expect(nodes.length).toBe(2); @@ -488,7 +488,7 @@ describe( const metallicRoughness = material.metallicRoughness; expect(metallicRoughness.baseColorTexture).toBeUndefined(); - } + }, ); }); @@ -511,10 +511,10 @@ describe( expect(sampler.wrapS).toBe(TextureWrap.REPEAT); expect(sampler.wrapT).toBe(TextureWrap.REPEAT); expect(sampler.magnificationFilter).toBe( - TextureMagnificationFilter.LINEAR + TextureMagnificationFilter.LINEAR, ); expect(sampler.minificationFilter).toBe( - TextureMinificationFilter.LINEAR + TextureMinificationFilter.LINEAR, ); }); } @@ -543,21 +543,21 @@ describe( const attributes = primitive.attributes; const positionAttribute = getAttribute( attributes, - VertexAttributeSemantic.POSITION + VertexAttributeSemantic.POSITION, ); const normalAttribute = getAttribute( attributes, - VertexAttributeSemantic.NORMAL + VertexAttributeSemantic.NORMAL, ); const texcoordAttribute = getAttribute( attributes, VertexAttributeSemantic.TEXCOORD, - 0 + 0, ); const colorAttribute = getAttribute( attributes, VertexAttributeSemantic.COLOR, - 0 + 0, ); expect(positionAttribute.buffer).toBeDefined(); @@ -602,7 +602,7 @@ describe( return loadModifiedGltfAndTest( boxVertexColors, undefined, - modifyGltf + modifyGltf, ).then(function (gltfLoader) { const components = gltfLoader.components; const scene = components.scene; @@ -612,21 +612,21 @@ describe( const attributes = primitive.attributes; const positionAttribute = getAttribute( attributes, - VertexAttributeSemantic.POSITION + VertexAttributeSemantic.POSITION, ); const normalAttribute = getAttribute( attributes, - VertexAttributeSemantic.NORMAL + VertexAttributeSemantic.NORMAL, ); const texcoordAttribute = getAttribute( attributes, VertexAttributeSemantic.TEXCOORD, - 0 + 0, ); const colorAttribute = getAttribute( attributes, VertexAttributeSemantic.COLOR, - 0 + 0, ); expect(positionAttribute.buffer).toBeDefined(); @@ -648,18 +648,18 @@ describe( const attributes = primitive.attributes; const positionAttribute = getAttribute( attributes, - VertexAttributeSemantic.POSITION + VertexAttributeSemantic.POSITION, ); const morphTargets = primitive.morphTargets; const morphTarget0 = morphTargets[0]; const morphTarget1 = morphTargets[1]; const morphPositions0 = getAttribute( morphTarget0.attributes, - VertexAttributeSemantic.POSITION + VertexAttributeSemantic.POSITION, ); const morphPositions1 = getAttribute( morphTarget1.attributes, - VertexAttributeSemantic.POSITION + VertexAttributeSemantic.POSITION, ); expect(morphPositions0.name).toBe("POSITION"); @@ -715,7 +715,7 @@ describe( const scene = components.scene; const rootNode = scene.nodes[0]; expect(rootNode.morphWeights).toEqual([0.0, 0.0]); - } + }, ); }); @@ -730,17 +730,17 @@ describe( const attributes = primitive.attributes; const positionAttribute = getAttribute( attributes, - VertexAttributeSemantic.POSITION + VertexAttributeSemantic.POSITION, ); const jointsAttribute = getAttribute( attributes, VertexAttributeSemantic.JOINTS, - 0 + 0, ); const weightsAttribute = getAttribute( attributes, VertexAttributeSemantic.WEIGHTS, - 0 + 0, ); expect(positionAttribute.buffer).toBeDefined(); @@ -751,7 +751,7 @@ describe( expect(jointsAttribute.semantic).toBe(VertexAttributeSemantic.JOINTS); expect(jointsAttribute.setIndex).toBe(0); expect(jointsAttribute.componentDatatype).toBe( - ComponentDatatype.UNSIGNED_SHORT + ComponentDatatype.UNSIGNED_SHORT, ); expect(jointsAttribute.type).toBe(AttributeType.VEC4); expect(jointsAttribute.normalized).toBe(false); @@ -769,7 +769,7 @@ describe( expect(weightsAttribute.semantic).toBe(VertexAttributeSemantic.WEIGHTS); expect(weightsAttribute.setIndex).toBe(0); expect(weightsAttribute.componentDatatype).toBe( - ComponentDatatype.FLOAT + ComponentDatatype.FLOAT, ); expect(weightsAttribute.type).toBe(AttributeType.VEC4); expect(weightsAttribute.normalized).toBe(false); @@ -824,7 +824,7 @@ describe( Matrix4.IDENTITY, Matrix4.IDENTITY, ]); - } + }, ); }); @@ -838,7 +838,7 @@ describe( const attributes = primitive.attributes; const positionAttribute = getAttribute( attributes, - VertexAttributeSemantic.POSITION + VertexAttributeSemantic.POSITION, ); expect(positionAttribute.buffer).toBeDefined(); @@ -866,8 +866,8 @@ describe( Quaternion.equalsEpsilon( sampler.output[i], expectedOutput[i], - CesiumMath.EPSILON3 - ) + CesiumMath.EPSILON3, + ), ).toBe(true); } @@ -876,7 +876,7 @@ describe( expect(channel.sampler).toBe(sampler); expect(channel.target.node).toBe(rootNode); expect(channel.target.path).toEqual( - ModelComponents.AnimatedPropertyType.ROTATION + ModelComponents.AnimatedPropertyType.ROTATION, ); }); }); @@ -891,7 +891,7 @@ describe( const attributes = primitive.attributes; const positionAttribute = getAttribute( attributes, - VertexAttributeSemantic.POSITION + VertexAttributeSemantic.POSITION, ); expect(positionAttribute.buffer).toBeDefined(); @@ -911,7 +911,7 @@ describe( expect(channel.sampler).toBe(sampler); expect(channel.target.node).toBe(rootNode); expect(channel.target.path).toEqual( - ModelComponents.AnimatedPropertyType.WEIGHTS + ModelComponents.AnimatedPropertyType.WEIGHTS, ); }); }); @@ -935,7 +935,7 @@ describe( expect(channel.sampler).toBe(sampler); expect(channel.target.node).toBe(nodes[0]); expect(channel.target.path).toEqual( - ModelComponents.AnimatedPropertyType.SCALE + ModelComponents.AnimatedPropertyType.SCALE, ); const cubicSplineRotation = animations[4]; @@ -952,7 +952,7 @@ describe( expect(channel.sampler).toBe(sampler); expect(channel.target.node).toBe(nodes[6]); expect(channel.target.path).toEqual( - ModelComponents.AnimatedPropertyType.ROTATION + ModelComponents.AnimatedPropertyType.ROTATION, ); const linearTranslation = animations[8]; @@ -968,7 +968,7 @@ describe( expect(channel.sampler).toBe(sampler); expect(channel.target.node).toBe(nodes[10]); expect(channel.target.path).toEqual( - ModelComponents.AnimatedPropertyType.TRANSLATION + ModelComponents.AnimatedPropertyType.TRANSLATION, ); }); }); @@ -982,13 +982,13 @@ describe( const attributes = primitive.attributes; const positionAttribute = getAttribute( attributes, - VertexAttributeSemantic.POSITION + VertexAttributeSemantic.POSITION, ); expect(positionAttribute).toBeDefined(); expect(primitive.indices).toBeDefined(); expect(primitive.indices.indexDatatype).toBe( - IndexDatatype.UNSIGNED_SHORT + IndexDatatype.UNSIGNED_SHORT, ); expect(primitive.indices.count).toBe(3); expect(primitive.indices.buffer).toBeDefined(); @@ -1011,12 +1011,12 @@ describe( const attributes = primitive.attributes; const positionAttribute = getAttribute( attributes, - VertexAttributeSemantic.POSITION + VertexAttributeSemantic.POSITION, ); expect(positionAttribute).toBeDefined(); expect(primitive.indices).toBeUndefined(); - } + }, ); }); @@ -1029,7 +1029,7 @@ describe( const attributes = primitive.attributes; const positionAttribute = getAttribute( attributes, - VertexAttributeSemantic.POSITION + VertexAttributeSemantic.POSITION, ); expect(positionAttribute).toBeDefined(); @@ -1048,20 +1048,20 @@ describe( const attributes = primitive.attributes; const positionAttribute = getAttribute( attributes, - VertexAttributeSemantic.POSITION + VertexAttributeSemantic.POSITION, ); const normalAttribute = getAttribute( attributes, - VertexAttributeSemantic.NORMAL + VertexAttributeSemantic.NORMAL, ); const tangentAttribute = getAttribute( attributes, - VertexAttributeSemantic.TANGENT + VertexAttributeSemantic.TANGENT, ); const texcoordAttribute = getAttribute( attributes, VertexAttributeSemantic.TEXCOORD, - 0 + 0, ); expect(positionAttribute).toBeDefined(); @@ -1071,7 +1071,7 @@ describe( expect(metallicRoughness.baseColorTexture.texture).toBeDefined(); expect( - metallicRoughness.metallicRoughnessTexture.texture + metallicRoughness.metallicRoughnessTexture.texture, ).toBeDefined(); expect(material.normalTexture.texture).toBeDefined(); expect(material.doubleSided).toBe(true); @@ -1106,25 +1106,25 @@ describe( const attributes = primitive.attributes; const positionAttribute = getAttribute( attributes, - VertexAttributeSemantic.POSITION + VertexAttributeSemantic.POSITION, ); const normalAttribute = getAttribute( attributes, - VertexAttributeSemantic.NORMAL + VertexAttributeSemantic.NORMAL, ); const tangentAttribute = getAttribute( attributes, - VertexAttributeSemantic.TANGENT + VertexAttributeSemantic.TANGENT, ); const texcoordAttribute0 = getAttribute( attributes, VertexAttributeSemantic.TEXCOORD, - 0 + 0, ); const texcoordAttribute1 = getAttribute( attributes, VertexAttributeSemantic.TEXCOORD, - 1 + 1, ); expect(positionAttribute).toBeDefined(); @@ -1154,7 +1154,7 @@ describe( const featureIdTexture = primitive.featureIds[0]; expect(featureIdTexture).toBeInstanceOf( - ModelComponents.FeatureIdTexture + ModelComponents.FeatureIdTexture, ); expect(featureIdTexture.featureCount).toEqual(256); expect(featureIdTexture.nullFeatureId).not.toBeDefined(); @@ -1166,7 +1166,7 @@ describe( expect(featureIdTexture.textureReader.texture.width).toBe(256); expect(featureIdTexture.textureReader.texture.height).toBe(256); expect(featureIdTexture.textureReader.texture.sampler).toBe( - Sampler.NEAREST + Sampler.NEAREST, ); const classDefinition = structuralMetadata.schema.classes.landCover; @@ -1175,7 +1175,7 @@ describe( expect(properties.name.componentType).not.toBeDefined(); expect(properties.color.type).toBe(MetadataType.VEC3); expect(properties.color.componentType).toBe( - MetadataComponentType.UINT8 + MetadataComponentType.UINT8, ); const propertyTable = structuralMetadata.getPropertyTable(0); @@ -1185,19 +1185,18 @@ describe( expect(propertyTable.class).toBe(classDefinition); expect(propertyTable.getProperty(0, "name")).toBe("Grassland"); expect(propertyTable.getProperty(0, "color")).toEqual( - new Cartesian3(118, 163, 11) + new Cartesian3(118, 163, 11), ); expect(propertyTable.getProperty(255, "name")).toBe("Building"); expect(propertyTable.getProperty(255, "color")).toEqual( - new Cartesian3(194, 194, 194) + new Cartesian3(194, 194, 194), ); const propertyTexture = structuralMetadata.getPropertyTexture(0); expect(propertyTexture.id).toEqual(0); expect(propertyTexture.name).toEqual("Vegetation"); - const vegetationProperty = propertyTexture.getProperty( - "vegetationDensity" - ); + const vegetationProperty = + propertyTexture.getProperty("vegetationDensity"); expect(vegetationProperty.textureReader.texture.width).toBe(256); expect(vegetationProperty.textureReader.texture.height).toBe(256); @@ -1220,7 +1219,7 @@ describe( const featureIdTexture = primitive.featureIds[0]; expect(featureIdTexture).toBeInstanceOf( - ModelComponents.FeatureIdTexture + ModelComponents.FeatureIdTexture, ); expect(featureIdTexture.featureCount).toEqual(256); expect(featureIdTexture.nullFeatureId).not.toBeDefined(); @@ -1232,7 +1231,7 @@ describe( expect(featureIdTexture.textureReader.texture.width).toBe(256); expect(featureIdTexture.textureReader.texture.height).toBe(256); expect(featureIdTexture.textureReader.texture.sampler).toBe( - Sampler.NEAREST + Sampler.NEAREST, ); const classDefinition = structuralMetadata.schema.classes.landCover; @@ -1241,7 +1240,7 @@ describe( expect(properties.name.componentType).not.toBeDefined(); expect(properties.color.type).toBe(MetadataType.SCALAR); expect(properties.color.componentType).toBe( - MetadataComponentType.UINT8 + MetadataComponentType.UINT8, ); expect(properties.color.arrayLength).toBe(3); @@ -1253,16 +1252,13 @@ describe( expect(propertyTable.getProperty(0, "color")).toEqual([118, 163, 11]); expect(propertyTable.getProperty(255, "name")).toBe("Building"); expect(propertyTable.getProperty(255, "color")).toEqual([ - 194, - 194, - 194, + 194, 194, 194, ]); const propertyTexture = structuralMetadata.getPropertyTexture(0); expect(propertyTexture.id).toEqual("vegetationTexture"); - const vegetationProperty = propertyTexture.getProperty( - "vegetationDensity" - ); + const vegetationProperty = + propertyTexture.getProperty("vegetationDensity"); expect(vegetationProperty.textureReader.texture.width).toBe(256); expect(vegetationProperty.textureReader.texture.height).toBe(256); @@ -1286,7 +1282,7 @@ describe( let featureIdTexture = primitive.featureIds[0]; expect(featureIdTexture).toBeInstanceOf( - ModelComponents.FeatureIdTexture + ModelComponents.FeatureIdTexture, ); expect(featureIdTexture.featureCount).toEqual(1048576); expect(featureIdTexture.nullFeatureId).not.toBeDefined(); @@ -1302,7 +1298,7 @@ describe( featureIdTexture = primitive.featureIds[1]; expect(featureIdTexture).toBeInstanceOf( - ModelComponents.FeatureIdTexture + ModelComponents.FeatureIdTexture, ); expect(featureIdTexture.featureCount).toEqual(1048576); expect(featureIdTexture.nullFeatureId).not.toBeDefined(); @@ -1316,7 +1312,7 @@ describe( featureIdTexture = primitive.featureIds[2]; expect(featureIdTexture).toBeInstanceOf( - ModelComponents.FeatureIdTexture + ModelComponents.FeatureIdTexture, ); expect(featureIdTexture.featureCount).toEqual(256); expect(featureIdTexture.nullFeatureId).not.toBeDefined(); @@ -1329,7 +1325,7 @@ describe( featureIdTexture = primitive.featureIds[3]; expect(featureIdTexture).toBeInstanceOf( - ModelComponents.FeatureIdTexture + ModelComponents.FeatureIdTexture, ); expect(featureIdTexture.featureCount).toEqual(65536); expect(featureIdTexture.nullFeatureId).not.toBeDefined(); @@ -1342,7 +1338,7 @@ describe( featureIdTexture = primitive.featureIds[4]; expect(featureIdTexture).toBeInstanceOf( - ModelComponents.FeatureIdTexture + ModelComponents.FeatureIdTexture, ); expect(featureIdTexture.featureCount).toEqual(65536); expect(featureIdTexture.nullFeatureId).not.toBeDefined(); @@ -1355,7 +1351,7 @@ describe( featureIdTexture = primitive.featureIds[5]; expect(featureIdTexture).toBeInstanceOf( - ModelComponents.FeatureIdTexture + ModelComponents.FeatureIdTexture, ); expect(featureIdTexture.featureCount).toEqual(1048576); expect(featureIdTexture.nullFeatureId).not.toBeDefined(); @@ -1368,7 +1364,7 @@ describe( featureIdTexture = primitive.featureIds[6]; expect(featureIdTexture).toBeInstanceOf( - ModelComponents.FeatureIdTexture + ModelComponents.FeatureIdTexture, ); expect(featureIdTexture.featureCount).toEqual(255); expect(featureIdTexture.nullFeatureId).toBe(10); @@ -1391,16 +1387,16 @@ describe( const attributes = primitive.attributes; const positionAttribute = getAttribute( attributes, - VertexAttributeSemantic.POSITION + VertexAttributeSemantic.POSITION, ); const normalAttribute = getAttribute( attributes, - VertexAttributeSemantic.NORMAL + VertexAttributeSemantic.NORMAL, ); const featureIdAttribute = getAttribute( attributes, VertexAttributeSemantic.FEATURE_ID, - 0 + 0, ); const structuralMetadata = components.structuralMetadata; @@ -1409,11 +1405,11 @@ describe( expect(featureIdAttribute.name).toBe("_FEATURE_ID_0"); expect(featureIdAttribute.semantic).toBe( - VertexAttributeSemantic.FEATURE_ID + VertexAttributeSemantic.FEATURE_ID, ); expect(featureIdAttribute.setIndex).toBe(0); expect(featureIdAttribute.componentDatatype).toBe( - ComponentDatatype.FLOAT + ComponentDatatype.FLOAT, ); expect(featureIdAttribute.type).toBe(AttributeType.SCALAR); expect(featureIdAttribute.normalized).toBe(false); @@ -1433,7 +1429,7 @@ describe( // feature ID via accessor const featureIdAccessor = primitive.featureIds[0]; expect(featureIdAccessor).toBeInstanceOf( - ModelComponents.FeatureIdAttribute + ModelComponents.FeatureIdAttribute, ); expect(featureIdAccessor.featureCount).toEqual(10); expect(featureIdAccessor.nullFeatureId).not.toBeDefined(); @@ -1445,7 +1441,7 @@ describe( // Default feature ID const featureIdDefault = primitive.featureIds[1]; expect(featureIdDefault).toBeInstanceOf( - ModelComponents.FeatureIdImplicitRange + ModelComponents.FeatureIdImplicitRange, ); expect(featureIdDefault.featureCount).toEqual(5); expect(featureIdDefault.nullFeatureId).not.toBeDefined(); @@ -1459,7 +1455,7 @@ describe( const classDefinition = structuralMetadata.schema.classes.building; const properties = classDefinition.properties; expect(properties.height.componentType).toBe( - MetadataComponentType.FLOAT32 + MetadataComponentType.FLOAT32, ); expect(properties.id.componentType).toBe(MetadataComponentType.INT32); @@ -1502,7 +1498,7 @@ describe( for (let i = 0; i < 10; i++) { const temperature = propertyTable.getProperty( i, - "temperatureCelsius" + "temperatureCelsius", ); expect(temperature).toBeGreaterThanOrEqual(18); expect(temperature).toBeLessThanOrEqual(24); @@ -1520,16 +1516,16 @@ describe( const attributes = primitive.attributes; const positionAttribute = getAttribute( attributes, - VertexAttributeSemantic.POSITION + VertexAttributeSemantic.POSITION, ); const normalAttribute = getAttribute( attributes, - VertexAttributeSemantic.NORMAL + VertexAttributeSemantic.NORMAL, ); const featureIdAttribute = getAttribute( attributes, VertexAttributeSemantic.FEATURE_ID, - 0 + 0, ); const structuralMetadata = components.structuralMetadata; @@ -1538,11 +1534,11 @@ describe( expect(featureIdAttribute.name).toBe("_FEATURE_ID_0"); expect(featureIdAttribute.semantic).toBe( - VertexAttributeSemantic.FEATURE_ID + VertexAttributeSemantic.FEATURE_ID, ); expect(featureIdAttribute.setIndex).toBe(0); expect(featureIdAttribute.componentDatatype).toBe( - ComponentDatatype.FLOAT + ComponentDatatype.FLOAT, ); expect(featureIdAttribute.type).toBe(AttributeType.SCALAR); expect(featureIdAttribute.normalized).toBe(false); @@ -1562,7 +1558,7 @@ describe( // feature ID via accessor const featureIdAccessor = primitive.featureIds[0]; expect(featureIdAccessor).toBeInstanceOf( - ModelComponents.FeatureIdAttribute + ModelComponents.FeatureIdAttribute, ); expect(featureIdAccessor.featureCount).toEqual(10); expect(featureIdAccessor.nullFeatureId).not.toBeDefined(); @@ -1574,7 +1570,7 @@ describe( // feature ID range const featureIdDefault = primitive.featureIds[1]; expect(featureIdDefault).toBeInstanceOf( - ModelComponents.FeatureIdImplicitRange + ModelComponents.FeatureIdImplicitRange, ); expect(featureIdDefault.featureCount).toEqual(10); expect(featureIdDefault.nullFeatureId).not.toBeDefined(); @@ -1588,7 +1584,7 @@ describe( const classDefinition = structuralMetadata.schema.classes.building; const properties = classDefinition.properties; expect(properties.height.componentType).toBe( - MetadataComponentType.FLOAT32 + MetadataComponentType.FLOAT32, ); expect(properties.id.componentType).toBe(MetadataComponentType.INT32); @@ -1621,12 +1617,12 @@ describe( const attributes = primitive.attributes; const positionAttribute = getAttribute( attributes, - VertexAttributeSemantic.POSITION + VertexAttributeSemantic.POSITION, ); const featureIdAttribute = getAttribute( attributes, VertexAttributeSemantic.FEATURE_ID, - 0 + 0, ); const structuralMetadata = components.structuralMetadata; @@ -1640,7 +1636,7 @@ describe( const featureIdAttributeMapping0 = primitive.featureIds[0]; expect(featureIdAttributeMapping0).toBeInstanceOf( - ModelComponents.FeatureIdImplicitRange + ModelComponents.FeatureIdImplicitRange, ); expect(featureIdAttributeMapping0.featureCount).toEqual(1000); expect(featureIdAttributeMapping0.nullFeatureId).not.toBeDefined(); @@ -1652,7 +1648,7 @@ describe( const featureIdAttributeMapping1 = primitive.featureIds[1]; expect(featureIdAttributeMapping1).toBeInstanceOf( - ModelComponents.FeatureIdAttribute + ModelComponents.FeatureIdAttribute, ); expect(featureIdAttributeMapping1.featureCount).toEqual(3); expect(featureIdAttributeMapping1.nullFeatureId).not.toBeDefined(); @@ -1664,14 +1660,14 @@ describe( const weatherClass = structuralMetadata.schema.classes.weather; const weatherProperties = weatherClass.properties; expect(weatherProperties.airTemperature.componentType).toBe( - MetadataComponentType.FLOAT32 + MetadataComponentType.FLOAT32, ); expect(weatherProperties.airPressure.componentType).toBe( - MetadataComponentType.FLOAT32 + MetadataComponentType.FLOAT32, ); expect(weatherProperties.windVelocity.type).toBe(MetadataType.VEC3); expect(weatherProperties.windVelocity.componentType).toBe( - MetadataComponentType.FLOAT32 + MetadataComponentType.FLOAT32, ); const townClass = structuralMetadata.schema.classes.town; @@ -1680,7 +1676,7 @@ describe( expect(townProperties.name.componentCount).not.toBeDefined(); expect(townProperties.population.type).toBe(MetadataType.SCALAR); expect(townProperties.population.componentType).toBe( - MetadataComponentType.UINT16 + MetadataComponentType.UINT16, ); const weatherTable = structuralMetadata.getPropertyTable(1); @@ -1689,22 +1685,22 @@ describe( expect(weatherTable.count).toBe(1000); expect(weatherTable.class).toBe(weatherClass); expect(weatherTable.getProperty(0, "airTemperature")).toBe( - 22.120203018188477 + 22.120203018188477, ); expect(weatherTable.getProperty(0, "airPressure")).toBe( - 1.170711874961853 + 1.170711874961853, ); expect(weatherTable.getProperty(0, "windVelocity")).toEqual( - new Cartesian3(1, 0.2964223027229309, 0.23619766533374786) + new Cartesian3(1, 0.2964223027229309, 0.23619766533374786), ); expect(weatherTable.getProperty(999, "airTemperature")).toBe( - 24.308320999145508 + 24.308320999145508, ); expect(weatherTable.getProperty(999, "airPressure")).toBe( - 1.1136815547943115 + 1.1136815547943115, ); expect(weatherTable.getProperty(999, "windVelocity")).toEqual( - new Cartesian3(1, 0.07490774989128113, 0.0022833053953945637) + new Cartesian3(1, 0.07490774989128113, 0.0022833053953945637), ); const townTable = structuralMetadata.getPropertyTable(0); @@ -1730,12 +1726,12 @@ describe( const attributes = primitive.attributes; const positionAttribute = getAttribute( attributes, - VertexAttributeSemantic.POSITION + VertexAttributeSemantic.POSITION, ); const featureIdAttribute = getAttribute( attributes, VertexAttributeSemantic.FEATURE_ID, - 0 + 0, ); const structuralMetadata = components.structuralMetadata; @@ -1749,7 +1745,7 @@ describe( const featureIdAttributeMapping0 = primitive.featureIds[0]; expect(featureIdAttributeMapping0).toBeInstanceOf( - ModelComponents.FeatureIdImplicitRange + ModelComponents.FeatureIdImplicitRange, ); expect(featureIdAttributeMapping0.featureCount).toEqual(1000); expect(featureIdAttributeMapping0.nullFeatureId).not.toBeDefined(); @@ -1761,7 +1757,7 @@ describe( const featureIdAttributeMapping1 = primitive.featureIds[1]; expect(featureIdAttributeMapping1).toBeInstanceOf( - ModelComponents.FeatureIdAttribute + ModelComponents.FeatureIdAttribute, ); expect(featureIdAttributeMapping1.featureCount).toEqual(3); expect(featureIdAttributeMapping1.nullFeatureId).not.toBeDefined(); @@ -1773,14 +1769,14 @@ describe( const weatherClass = structuralMetadata.schema.classes.weather; const weatherProperties = weatherClass.properties; expect(weatherProperties.airTemperature.componentType).toBe( - MetadataComponentType.FLOAT32 + MetadataComponentType.FLOAT32, ); expect(weatherProperties.airPressure.componentType).toBe( - MetadataComponentType.FLOAT32 + MetadataComponentType.FLOAT32, ); expect(weatherProperties.windVelocity.type).toBe(MetadataType.SCALAR); expect(weatherProperties.windVelocity.componentType).toBe( - MetadataComponentType.FLOAT32 + MetadataComponentType.FLOAT32, ); expect(weatherProperties.windVelocity.arrayLength).toBe(3); @@ -1790,7 +1786,7 @@ describe( expect(townProperties.name.componentType).not.toBeDefined(); expect(townProperties.population.type).toBe(MetadataType.SCALAR); expect(townProperties.population.componentType).toBe( - MetadataComponentType.UINT16 + MetadataComponentType.UINT16, ); const weatherTable = structuralMetadata.getPropertyTable(1); @@ -1798,26 +1794,22 @@ describe( expect(weatherTable.count).toBe(1000); expect(weatherTable.class).toBe(weatherClass); expect(weatherTable.getProperty(0, "airTemperature")).toBe( - 22.120203018188477 + 22.120203018188477, ); expect(weatherTable.getProperty(0, "airPressure")).toBe( - 1.170711874961853 + 1.170711874961853, ); expect(weatherTable.getProperty(0, "windVelocity")).toEqual([ - 1, - 0.2964223027229309, - 0.23619766533374786, + 1, 0.2964223027229309, 0.23619766533374786, ]); expect(weatherTable.getProperty(999, "airTemperature")).toBe( - 24.308320999145508 + 24.308320999145508, ); expect(weatherTable.getProperty(999, "airPressure")).toBe( - 1.1136815547943115 + 1.1136815547943115, ); expect(weatherTable.getProperty(999, "windVelocity")).toEqual([ - 1, - 0.07490774989128113, - 0.0022833053953945637, + 1, 0.07490774989128113, 0.0022833053953945637, ]); const townTable = structuralMetadata.getPropertyTable(0); @@ -1834,130 +1826,128 @@ describe( }); it("loads PointCloudWithPropertyAttributes", function () { - return loadGltf(pointCloudWithPropertyAttributes).then(function ( - gltfLoader - ) { - const components = gltfLoader.components; - const scene = components.scene; - const rootNode = scene.nodes[0]; - const primitive = rootNode.primitives[0]; - const attributes = primitive.attributes; - const positionAttribute = getAttribute( - attributes, - VertexAttributeSemantic.POSITION - ); - const color0Attribute = getAttribute( - attributes, - VertexAttributeSemantic.COLOR, - 0 - ); - // custom attributes don't have a VertexAttributeSemantic - const circleTAttribute = getAttributeByName(attributes, "_CIRCLE_T"); - const featureId0Attribute = getAttribute( - attributes, - VertexAttributeSemantic.FEATURE_ID, - 0 - ); - const featureId1Attribute = getAttribute( - attributes, - VertexAttributeSemantic.FEATURE_ID, - 1 - ); - const structuralMetadata = components.structuralMetadata; - - expect(primitive.primitiveType).toBe(PrimitiveType.POINTS); + return loadGltf(pointCloudWithPropertyAttributes).then( + function (gltfLoader) { + const components = gltfLoader.components; + const scene = components.scene; + const rootNode = scene.nodes[0]; + const primitive = rootNode.primitives[0]; + const attributes = primitive.attributes; + const positionAttribute = getAttribute( + attributes, + VertexAttributeSemantic.POSITION, + ); + const color0Attribute = getAttribute( + attributes, + VertexAttributeSemantic.COLOR, + 0, + ); + // custom attributes don't have a VertexAttributeSemantic + const circleTAttribute = getAttributeByName(attributes, "_CIRCLE_T"); + const featureId0Attribute = getAttribute( + attributes, + VertexAttributeSemantic.FEATURE_ID, + 0, + ); + const featureId1Attribute = getAttribute( + attributes, + VertexAttributeSemantic.FEATURE_ID, + 1, + ); + const structuralMetadata = components.structuralMetadata; - expect(positionAttribute).toBeDefined(); - expect(color0Attribute).toBeDefined(); - expect(circleTAttribute).toBeDefined(); - expect(featureId0Attribute).toBeDefined(); - expect(featureId1Attribute).toBeDefined(); + expect(primitive.primitiveType).toBe(PrimitiveType.POINTS); - expect(primitive.featureIds.length).toBe(2); - expect(primitive.propertyTextureIds.length).toBe(0); - expect(primitive.propertyAttributeIds).toEqual([0]); - - const featureIdAttribute0 = primitive.featureIds[0]; - expect(featureIdAttribute0).toBeInstanceOf( - ModelComponents.FeatureIdAttribute - ); - expect(featureIdAttribute0.featureCount).toEqual(30); - expect(featureIdAttribute0.nullFeatureId).not.toBeDefined(); - expect(featureIdAttribute0.propertyTableId).not.toBeDefined(); - expect(featureIdAttribute0.setIndex).toBe(0); - expect(featureIdAttribute0.label).toBe("iteration"); - expect(featureIdAttribute0.positionalLabel).toBe("featureId_0"); - - const featureIdAttribute1 = primitive.featureIds[1]; - expect(featureIdAttribute1).toBeInstanceOf( - ModelComponents.FeatureIdAttribute - ); - expect(featureIdAttribute1.featureCount).toEqual(20); - expect(featureIdAttribute1.nullFeatureId).not.toBeDefined(); - expect(featureIdAttribute1.propertyTableId).not.toBeDefined(); - expect(featureIdAttribute1.setIndex).toBe(1); - expect(featureIdAttribute1.label).toBe("pointId"); - expect(featureIdAttribute1.positionalLabel).toBe("featureId_1"); - - const torusClass = structuralMetadata.schema.classes.torus; - const torusProperties = torusClass.properties; - const circleT = torusProperties.circleT; - expect(circleT.type).toBe(MetadataType.SCALAR); - expect(circleT.componentType).toBe(MetadataComponentType.FLOAT32); - - const iteration = torusProperties.iteration; - expect(iteration.type).toBe(MetadataType.SCALAR); - expect(iteration.componentType).toBe(MetadataComponentType.FLOAT32); - - const pointId = torusProperties.pointId; - expect(pointId.type).toBe(MetadataType.SCALAR); - expect(pointId.componentType).toBe(MetadataComponentType.FLOAT32); + expect(positionAttribute).toBeDefined(); + expect(color0Attribute).toBeDefined(); + expect(circleTAttribute).toBeDefined(); + expect(featureId0Attribute).toBeDefined(); + expect(featureId1Attribute).toBeDefined(); + + expect(primitive.featureIds.length).toBe(2); + expect(primitive.propertyTextureIds.length).toBe(0); + expect(primitive.propertyAttributeIds).toEqual([0]); + + const featureIdAttribute0 = primitive.featureIds[0]; + expect(featureIdAttribute0).toBeInstanceOf( + ModelComponents.FeatureIdAttribute, + ); + expect(featureIdAttribute0.featureCount).toEqual(30); + expect(featureIdAttribute0.nullFeatureId).not.toBeDefined(); + expect(featureIdAttribute0.propertyTableId).not.toBeDefined(); + expect(featureIdAttribute0.setIndex).toBe(0); + expect(featureIdAttribute0.label).toBe("iteration"); + expect(featureIdAttribute0.positionalLabel).toBe("featureId_0"); + + const featureIdAttribute1 = primitive.featureIds[1]; + expect(featureIdAttribute1).toBeInstanceOf( + ModelComponents.FeatureIdAttribute, + ); + expect(featureIdAttribute1.featureCount).toEqual(20); + expect(featureIdAttribute1.nullFeatureId).not.toBeDefined(); + expect(featureIdAttribute1.propertyTableId).not.toBeDefined(); + expect(featureIdAttribute1.setIndex).toBe(1); + expect(featureIdAttribute1.label).toBe("pointId"); + expect(featureIdAttribute1.positionalLabel).toBe("featureId_1"); + + const torusClass = structuralMetadata.schema.classes.torus; + const torusProperties = torusClass.properties; + const circleT = torusProperties.circleT; + expect(circleT.type).toBe(MetadataType.SCALAR); + expect(circleT.componentType).toBe(MetadataComponentType.FLOAT32); + + const iteration = torusProperties.iteration; + expect(iteration.type).toBe(MetadataType.SCALAR); + expect(iteration.componentType).toBe(MetadataComponentType.FLOAT32); + + const pointId = torusProperties.pointId; + expect(pointId.type).toBe(MetadataType.SCALAR); + expect(pointId.componentType).toBe(MetadataComponentType.FLOAT32); + + const propertyAttribute = structuralMetadata.getPropertyAttribute(0); + expect(propertyAttribute.id).toBe(0); + expect(propertyAttribute.name).not.toBeDefined(); + expect(propertyAttribute.class).toBe(torusClass); + expect(propertyAttribute.getProperty("circleT").attribute).toBe( + "_CIRCLE_T", + ); + expect(propertyAttribute.getProperty("iteration").attribute).toBe( + "_FEATURE_ID_0", + ); + expect(propertyAttribute.getProperty("pointId").attribute).toBe( + "_FEATURE_ID_1", + ); - const propertyAttribute = structuralMetadata.getPropertyAttribute(0); - expect(propertyAttribute.id).toBe(0); - expect(propertyAttribute.name).not.toBeDefined(); - expect(propertyAttribute.class).toBe(torusClass); - expect(propertyAttribute.getProperty("circleT").attribute).toBe( - "_CIRCLE_T" - ); - expect(propertyAttribute.getProperty("iteration").attribute).toBe( - "_FEATURE_ID_0" - ); - expect(propertyAttribute.getProperty("pointId").attribute).toBe( - "_FEATURE_ID_1" - ); - - // A few more properties were added to test offset/scale - const toroidalNormalized = propertyAttribute.getProperty( - "toroidalNormalized" - ); - expect(toroidalNormalized.attribute).toBe("_FEATURE_ID_0"); - expect(toroidalNormalized.hasValueTransform).toBe(true); - expect(toroidalNormalized.offset).toBe(0); - expect(toroidalNormalized.scale).toBe(0.034482758620689655); - - const poloidalNormalized = propertyAttribute.getProperty( - "poloidalNormalized" - ); - expect(poloidalNormalized.attribute).toBe("_FEATURE_ID_1"); - expect(poloidalNormalized.hasValueTransform).toBe(true); - expect(poloidalNormalized.offset).toBe(0); - expect(poloidalNormalized.scale).toBe(0.05263157894736842); - - // These two properties have offset/scale in both the class definition - // and the property attribute. The latter should be used. - const toroidalAngle = propertyAttribute.getProperty("toroidalAngle"); - expect(toroidalAngle.attribute).toBe("_FEATURE_ID_0"); - expect(toroidalAngle.hasValueTransform).toBe(true); - expect(toroidalAngle.offset).toBe(0); - expect(toroidalAngle.scale).toBe(0.21666156231653746); - - const poloidalAngle = propertyAttribute.getProperty("poloidalAngle"); - expect(poloidalAngle.attribute).toBe("_FEATURE_ID_1"); - expect(poloidalAngle.hasValueTransform).toBe(true); - expect(poloidalAngle.offset).toBe(-3.141592653589793); - expect(poloidalAngle.scale).toBe(0.3306939635357677); - }); + // A few more properties were added to test offset/scale + const toroidalNormalized = + propertyAttribute.getProperty("toroidalNormalized"); + expect(toroidalNormalized.attribute).toBe("_FEATURE_ID_0"); + expect(toroidalNormalized.hasValueTransform).toBe(true); + expect(toroidalNormalized.offset).toBe(0); + expect(toroidalNormalized.scale).toBe(0.034482758620689655); + + const poloidalNormalized = + propertyAttribute.getProperty("poloidalNormalized"); + expect(poloidalNormalized.attribute).toBe("_FEATURE_ID_1"); + expect(poloidalNormalized.hasValueTransform).toBe(true); + expect(poloidalNormalized.offset).toBe(0); + expect(poloidalNormalized.scale).toBe(0.05263157894736842); + + // These two properties have offset/scale in both the class definition + // and the property attribute. The latter should be used. + const toroidalAngle = propertyAttribute.getProperty("toroidalAngle"); + expect(toroidalAngle.attribute).toBe("_FEATURE_ID_0"); + expect(toroidalAngle.hasValueTransform).toBe(true); + expect(toroidalAngle.offset).toBe(0); + expect(toroidalAngle.scale).toBe(0.21666156231653746); + + const poloidalAngle = propertyAttribute.getProperty("poloidalAngle"); + expect(poloidalAngle.attribute).toBe("_FEATURE_ID_1"); + expect(poloidalAngle.hasValueTransform).toBe(true); + expect(poloidalAngle.offset).toBe(-3.141592653589793); + expect(poloidalAngle.scale).toBe(0.3306939635357677); + }, + ); }); it("loads BoxTexturedWithPropertyAttributes", function () { @@ -1971,24 +1961,24 @@ describe( const attributes = primitive.attributes; const positionAttribute = getAttribute( attributes, - VertexAttributeSemantic.POSITION + VertexAttributeSemantic.POSITION, ); const normalAttribute = getAttribute( attributes, - VertexAttributeSemantic.NORMAL + VertexAttributeSemantic.NORMAL, ); const texcoordAttribute = getAttribute( attributes, VertexAttributeSemantic.TEXCOORD, - 0 + 0, ); const warpMatrixAttribute = getAttributeByName( attributes, - "_WARP_MATRIX" + "_WARP_MATRIX", ); const temperaturesAttribute = getAttributeByName( attributes, - "_TEMPERATURES" + "_TEMPERATURES", ); const indices = primitive.indices; @@ -2000,11 +1990,11 @@ describe( expect(positionAttribute.name).toBe("POSITION"); expect(positionAttribute.semantic).toBe( - VertexAttributeSemantic.POSITION + VertexAttributeSemantic.POSITION, ); expect(positionAttribute.setIndex).toBeUndefined(); expect(positionAttribute.componentDatatype).toBe( - ComponentDatatype.FLOAT + ComponentDatatype.FLOAT, ); expect(positionAttribute.type).toBe(AttributeType.VEC3); expect(positionAttribute.normalized).toBe(false); @@ -2036,11 +2026,11 @@ describe( expect(texcoordAttribute.name).toBe("TEXCOORD_0"); expect(texcoordAttribute.semantic).toBe( - VertexAttributeSemantic.TEXCOORD + VertexAttributeSemantic.TEXCOORD, ); expect(texcoordAttribute.setIndex).toBe(0); expect(texcoordAttribute.componentDatatype).toBe( - ComponentDatatype.FLOAT + ComponentDatatype.FLOAT, ); expect(texcoordAttribute.type).toBe(AttributeType.VEC2); expect(texcoordAttribute.normalized).toBe(false); @@ -2058,7 +2048,7 @@ describe( expect(warpMatrixAttribute.semantic).toBeUndefined(); expect(warpMatrixAttribute.setIndex).toBeUndefined(); expect(warpMatrixAttribute.componentDatatype).toBe( - ComponentDatatype.FLOAT + ComponentDatatype.FLOAT, ); expect(warpMatrixAttribute.type).toBe(AttributeType.MAT2); expect(warpMatrixAttribute.normalized).toBe(false); @@ -2076,7 +2066,7 @@ describe( expect(temperaturesAttribute.semantic).toBeUndefined(); expect(temperaturesAttribute.setIndex).toBeUndefined(); expect(temperaturesAttribute.componentDatatype).toBe( - ComponentDatatype.UNSIGNED_SHORT + ComponentDatatype.UNSIGNED_SHORT, ); expect(temperaturesAttribute.type).toBe(AttributeType.VEC2); expect(temperaturesAttribute.normalized).toBe(true); @@ -2102,7 +2092,7 @@ describe( expect(texcoordAttribute.buffer.sizeInBytes).toBe(192); expect(metallicRoughness.baseColorFactor).toEqual( - new Cartesian4(1.0, 1.0, 1.0, 1.0) + new Cartesian4(1.0, 1.0, 1.0, 1.0), ); expect(metallicRoughness.metallicFactor).toBe(0.0); expect(metallicRoughness.roughnessFactor).toBe(1.0); @@ -2114,10 +2104,10 @@ describe( expect(sampler.wrapS).toBe(TextureWrap.REPEAT); expect(sampler.wrapT).toBe(TextureWrap.REPEAT); expect(sampler.magnificationFilter).toBe( - TextureMagnificationFilter.LINEAR + TextureMagnificationFilter.LINEAR, ); expect(sampler.minificationFilter).toBe( - TextureMinificationFilter.NEAREST_MIPMAP_LINEAR + TextureMinificationFilter.NEAREST_MIPMAP_LINEAR, ); expect(nodes.length).toBe(2); @@ -2130,7 +2120,7 @@ describe( const warpMatrixProperty = boxProperties.warpMatrix; expect(warpMatrixProperty.type).toBe(MetadataType.MAT2); expect(warpMatrixProperty.componentType).toBe( - MetadataComponentType.FLOAT32 + MetadataComponentType.FLOAT32, ); expect(warpMatrixProperty.hasValueTransform).toBe(false); @@ -2138,21 +2128,18 @@ describe( boxProperties.transformedWarpMatrix; expect(transformedWarpMatrixProperty.type).toBe(MetadataType.MAT2); expect(transformedWarpMatrixProperty.componentType).toBe( - MetadataComponentType.FLOAT32 + MetadataComponentType.FLOAT32, ); expect(transformedWarpMatrixProperty.hasValueTransform).toBe(true); expect(transformedWarpMatrixProperty.offset).toEqual([ - 0.5, - 0.5, - 0.5, - 0.5, + 0.5, 0.5, 0.5, 0.5, ]); expect(transformedWarpMatrixProperty.scale).toEqual([2, 2, 2, 2]); const temperaturesProperty = boxProperties.temperatures; expect(temperaturesProperty.type).toBe(MetadataType.VEC2); expect(temperaturesProperty.componentType).toBe( - MetadataComponentType.UINT16 + MetadataComponentType.UINT16, ); expect(temperaturesProperty.normalized).toBe(true); expect(temperaturesProperty.hasValueTransform).toBe(true); @@ -2169,12 +2156,12 @@ describe( expect(warpMatrix.hasValueTransform).toBe(false); const transformedWarpMatrix = propertyAttribute.getProperty( - "transformedWarpMatrix" + "transformedWarpMatrix", ); expect(transformedWarpMatrix.attribute).toBe("_WARP_MATRIX"); expect(transformedWarpMatrix.hasValueTransform).toBe(true); expect(transformedWarpMatrix.offset).toEqual( - new Matrix2(0.5, 0.5, 0.5, 0.5) + new Matrix2(0.5, 0.5, 0.5, 0.5), ); expect(transformedWarpMatrix.scale).toEqual(new Matrix2(2, 2, 2, 2)); @@ -2204,7 +2191,7 @@ describe( const interleaved = defaultValue(options.interleaved, false); const instancingDisabled = defaultValue( options.instancingDisabled, - false + false, ); const components = loader.components; @@ -2214,40 +2201,40 @@ describe( const attributes = primitive.attributes; const positionAttribute = getAttribute( attributes, - VertexAttributeSemantic.POSITION + VertexAttributeSemantic.POSITION, ); const normalAttribute = getAttribute( attributes, - VertexAttributeSemantic.NORMAL + VertexAttributeSemantic.NORMAL, ); const instances = rootNode.instances; const instancedAttributes = instances.attributes; const translationAttribute = getAttribute( instancedAttributes, - InstanceAttributeSemantic.TRANSLATION + InstanceAttributeSemantic.TRANSLATION, ); const rotationAttribute = getAttribute( instancedAttributes, - InstanceAttributeSemantic.ROTATION + InstanceAttributeSemantic.ROTATION, ); const scaleAttribute = getAttribute( instancedAttributes, - InstanceAttributeSemantic.SCALE + InstanceAttributeSemantic.SCALE, ); const featureIdAttribute = getAttribute( instancedAttributes, InstanceAttributeSemantic.FEATURE_ID, - 0 + 0, ); expect(positionAttribute).toBeDefined(); expect(normalAttribute).toBeDefined(); expect(translationAttribute.semantic).toBe( - InstanceAttributeSemantic.TRANSLATION + InstanceAttributeSemantic.TRANSLATION, ); expect(translationAttribute.componentDatatype).toBe( - ComponentDatatype.FLOAT + ComponentDatatype.FLOAT, ); expect(translationAttribute.type).toBe(AttributeType.VEC3); expect(translationAttribute.normalized).toBe(false); @@ -2257,17 +2244,17 @@ describe( expect(translationAttribute.constant).toEqual(Cartesian3.ZERO); expect(translationAttribute.quantization).toBeUndefined(); expect(translationAttribute.typedArray).toEqual( - new Float32Array([-2, 2, 0, -2, -2, 0, 2, -2, 0, 2, 2, 0]) + new Float32Array([-2, 2, 0, -2, -2, 0, 2, -2, 0, 2, 2, 0]), ); expect(translationAttribute.buffer).toBeUndefined(); expect(translationAttribute.byteOffset).toBe(0); expect(translationAttribute.byteStride).toBeUndefined(); expect(rotationAttribute.semantic).toBe( - InstanceAttributeSemantic.ROTATION + InstanceAttributeSemantic.ROTATION, ); expect(rotationAttribute.componentDatatype).toBe( - ComponentDatatype.FLOAT + ComponentDatatype.FLOAT, ); expect(rotationAttribute.type).toBe(AttributeType.VEC4); expect(rotationAttribute.normalized).toBe(false); @@ -2283,7 +2270,7 @@ describe( 0.3535534143447876, 0.3535534143447876, 0.1464466005563736, 0.8535534143447876, 0.46193981170654297, 0.19134169816970825, 0.46193981170654297, 0.7325378060340881, 0.5319756865501404, 0.022260000929236412, 0.43967971205711365, 0.7233173847198486, - ]) + ]), ); expect(rotationAttribute.buffer).toBeUndefined(); expect(rotationAttribute.byteOffset).toBe(0); @@ -2305,7 +2292,7 @@ describe( 1, 1, 0.5, 0.75, 0.20000000298023224, 0.5, 0.800000011920929, 0.6000000238418579, 0.8999999761581421, - ]) + ]), ); expect(scaleAttribute.buffer).toBeUndefined(); expect(scaleAttribute.byteOffset).toBe(0); @@ -2313,7 +2300,7 @@ describe( expect(featureIdAttribute.setIndex).toBe(0); expect(featureIdAttribute.componentDatatype).toBe( - ComponentDatatype.FLOAT + ComponentDatatype.FLOAT, ); expect(featureIdAttribute.type).toBe(AttributeType.SCALAR); expect(featureIdAttribute.normalized).toBe(false); @@ -2326,7 +2313,7 @@ describe( // if instancing is disabled. if (instancingDisabled) { expect(featureIdAttribute.typedArray).toEqual( - new Float32Array([0, 0, 1, 1]) + new Float32Array([0, 0, 1, 1]), ); expect(featureIdAttribute.buffer).toBeUndefined(); } else { @@ -2358,7 +2345,7 @@ describe( const featureIdAttributeMapping0 = instances.featureIds[0]; expect(featureIdAttributeMapping0).toBeInstanceOf( - ModelComponents.FeatureIdImplicitRange + ModelComponents.FeatureIdImplicitRange, ); expect(featureIdAttributeMapping0.featureCount).toEqual(4); expect(featureIdAttributeMapping0.nullFeatureId).not.toBeDefined(); @@ -2367,12 +2354,12 @@ describe( expect(featureIdAttributeMapping0.repeat).toBe(1); expect(featureIdAttributeMapping0.label).toBe("perInstance"); expect(featureIdAttributeMapping0.positionalLabel).toBe( - "instanceFeatureId_0" + "instanceFeatureId_0", ); const featureIdAttributeMapping1 = instances.featureIds[1]; expect(featureIdAttributeMapping1).toBeInstanceOf( - ModelComponents.FeatureIdAttribute + ModelComponents.FeatureIdAttribute, ); expect(featureIdAttributeMapping1.featureCount).toEqual(2); expect(featureIdAttributeMapping1.nullFeatureId).not.toBeDefined(); @@ -2380,7 +2367,7 @@ describe( expect(featureIdAttributeMapping1.setIndex).toBe(0); expect(featureIdAttributeMapping1.label).toBe("section"); expect(featureIdAttributeMapping1.positionalLabel).toBe( - "instanceFeatureId_1" + "instanceFeatureId_1", ); const boxClass = structuralMetadata.schema.classes.box; @@ -2388,7 +2375,7 @@ describe( expect(boxProperties.name.type).toBe(MetadataType.STRING); expect(boxProperties.name.componentType).not.toBeDefined(); expect(boxProperties.volume.componentType).toBe( - MetadataComponentType.FLOAT32 + MetadataComponentType.FLOAT32, ); const sectionClass = structuralMetadata.schema.classes.section; @@ -2397,7 +2384,7 @@ describe( expect(sectionProperties.name.componentType).not.toBeDefined(); expect(sectionProperties.id.type).toBe(MetadataType.SCALAR); expect(sectionProperties.id.componentType).toBe( - MetadataComponentType.UINT16 + MetadataComponentType.UINT16, ); const boxTable = structuralMetadata.getPropertyTable(0); @@ -2436,7 +2423,7 @@ describe( const featureIdAttributeMapping0 = instances.featureIds[0]; expect(featureIdAttributeMapping0).toBeInstanceOf( - ModelComponents.FeatureIdImplicitRange + ModelComponents.FeatureIdImplicitRange, ); expect(featureIdAttributeMapping0.featureCount).toEqual(4); expect(featureIdAttributeMapping0.nullFeatureId).not.toBeDefined(); @@ -2445,12 +2432,12 @@ describe( expect(featureIdAttributeMapping0.repeat).toBe(1); expect(featureIdAttributeMapping0.label).not.toBeDefined(); expect(featureIdAttributeMapping0.positionalLabel).toBe( - "instanceFeatureId_0" + "instanceFeatureId_0", ); const featureIdAttributeMapping1 = instances.featureIds[1]; expect(featureIdAttributeMapping1).toBeInstanceOf( - ModelComponents.FeatureIdAttribute + ModelComponents.FeatureIdAttribute, ); expect(featureIdAttributeMapping1.featureCount).toEqual(2); expect(featureIdAttributeMapping1.nullFeatureId).not.toBeDefined(); @@ -2458,7 +2445,7 @@ describe( expect(featureIdAttributeMapping1.setIndex).toBe(0); expect(featureIdAttributeMapping1.label).not.toBeDefined(); expect(featureIdAttributeMapping1.positionalLabel).toBe( - "instanceFeatureId_1" + "instanceFeatureId_1", ); const boxClass = structuralMetadata.schema.classes.box; @@ -2466,7 +2453,7 @@ describe( expect(boxProperties.name.type).toBe(MetadataType.STRING); expect(boxProperties.name.componentType).not.toBeDefined(); expect(boxProperties.volume.componentType).toBe( - MetadataComponentType.FLOAT32 + MetadataComponentType.FLOAT32, ); const sectionClass = structuralMetadata.schema.classes.section; @@ -2475,7 +2462,7 @@ describe( expect(sectionProperties.name.componentType).not.toBeDefined(); expect(sectionProperties.id.type).toBe(MetadataType.SCALAR); expect(sectionProperties.id.componentType).toBe( - MetadataComponentType.UINT16 + MetadataComponentType.UINT16, ); const boxTable = structuralMetadata.getPropertyTable(0); @@ -2537,7 +2524,7 @@ describe( return loadModifiedGltfAndTest( boxInstanced, undefined, - modifyGltf + modifyGltf, ).then(function (gltfLoader) { const components = gltfLoader.components; const scene = components.scene; @@ -2547,7 +2534,7 @@ describe( const featureIdAttribute = getAttribute( instancedAttributes, InstanceAttributeSemantic.FEATURE_ID, - 0 + 0, ); expect(featureIdAttribute.buffer).toBeUndefined(); @@ -2568,21 +2555,21 @@ describe( const options = { scene: sceneWithNoInstancing, }; - return loadGltf(boxInstancedInterleaved, options).then(function ( - gltfLoader - ) { - verifyBoxInstancedAttributes(gltfLoader, { - interleaved: true, - instancingDisabled: true, - }); - }); + return loadGltf(boxInstancedInterleaved, options).then( + function (gltfLoader) { + verifyBoxInstancedAttributes(gltfLoader, { + interleaved: true, + instancingDisabled: true, + }); + }, + ); }); function verifyBoxInstancedTranslation( loader, expectMinMax, expectBufferDefined, - expectTypedArrayDefined + expectTypedArrayDefined, ) { const components = loader.components; const scene = components.scene; @@ -2591,27 +2578,27 @@ describe( const attributes = primitive.attributes; const positionAttribute = getAttribute( attributes, - VertexAttributeSemantic.POSITION + VertexAttributeSemantic.POSITION, ); const normalAttribute = getAttribute( attributes, - VertexAttributeSemantic.NORMAL + VertexAttributeSemantic.NORMAL, ); const instances = rootNode.instances; const instancedAttributes = instances.attributes; const translationAttribute = getAttribute( instancedAttributes, - InstanceAttributeSemantic.TRANSLATION + InstanceAttributeSemantic.TRANSLATION, ); expect(positionAttribute).toBeDefined(); expect(normalAttribute).toBeDefined(); expect(translationAttribute.semantic).toBe( - InstanceAttributeSemantic.TRANSLATION + InstanceAttributeSemantic.TRANSLATION, ); expect(translationAttribute.componentDatatype).toBe( - ComponentDatatype.FLOAT + ComponentDatatype.FLOAT, ); expect(translationAttribute.type).toBe(AttributeType.VEC3); expect(translationAttribute.normalized).toBe(false); @@ -2630,7 +2617,7 @@ describe( if (expectTypedArrayDefined) { expect(translationAttribute.typedArray).toEqual( - new Float32Array([-2, 2, 0, -2, -2, 0, 2, -2, 0, 2, 2, 0]) + new Float32Array([-2, 2, 0, -2, -2, 0, 2, -2, 0, 2, 2, 0]), ); } else { expect(translationAttribute.typedArray).toBeUndefined(); @@ -2661,7 +2648,7 @@ describe( gltfLoader, expectMinMax, expectBufferDefined, - expectTypedArrayDefined + expectTypedArrayDefined, ); }); }); @@ -2670,39 +2657,39 @@ describe( const options = { scene: sceneWithNoInstancing, }; - return loadGltf(boxInstancedTranslation, options).then(function ( - gltfLoader - ) { - const expectMinMax = false; - const expectBufferDefined = false; - const expectTypedArrayDefined = true; - - verifyBoxInstancedTranslation( - gltfLoader, - expectMinMax, - expectBufferDefined, - expectTypedArrayDefined - ); - }); + return loadGltf(boxInstancedTranslation, options).then( + function (gltfLoader) { + const expectMinMax = false; + const expectBufferDefined = false; + const expectTypedArrayDefined = true; + + verifyBoxInstancedTranslation( + gltfLoader, + expectMinMax, + expectBufferDefined, + expectTypedArrayDefined, + ); + }, + ); }); it("loads BoxInstancedTranslationWithMinMax", function () { - return loadGltf(boxInstancedTranslationMinMax).then(function ( - gltfLoader - ) { - // The translation accessor does have a min/max, so it only needs to - // load the buffer. - const expectMinMax = true; - const expectBufferDefined = true; - const expectTypedArrayDefined = false; - - verifyBoxInstancedTranslation( - gltfLoader, - expectMinMax, - expectBufferDefined, - expectTypedArrayDefined - ); - }); + return loadGltf(boxInstancedTranslationMinMax).then( + function (gltfLoader) { + // The translation accessor does have a min/max, so it only needs to + // load the buffer. + const expectMinMax = true; + const expectBufferDefined = true; + const expectTypedArrayDefined = false; + + verifyBoxInstancedTranslation( + gltfLoader, + expectMinMax, + expectBufferDefined, + expectTypedArrayDefined, + ); + }, + ); }); }); @@ -2716,16 +2703,16 @@ describe( const attributes = primitive.attributes; const positionAttribute = getAttribute( attributes, - VertexAttributeSemantic.POSITION + VertexAttributeSemantic.POSITION, ); const normalAttribute = getAttribute( attributes, - VertexAttributeSemantic.NORMAL + VertexAttributeSemantic.NORMAL, ); const texcoordAttribute = getAttribute( attributes, VertexAttributeSemantic.TEXCOORD, - 0 + 0, ); const positionQuantization = positionAttribute.quantization; const normalQuantization = normalAttribute.quantization; @@ -2735,11 +2722,11 @@ describe( expect(positionAttribute.name).toBe("POSITION"); expect(positionAttribute.semantic).toBe( - VertexAttributeSemantic.POSITION + VertexAttributeSemantic.POSITION, ); expect(positionAttribute.setIndex).toBeUndefined(); expect(positionAttribute.componentDatatype).toBe( - ComponentDatatype.FLOAT + ComponentDatatype.FLOAT, ); expect(positionAttribute.type).toBe(AttributeType.VEC3); expect(positionAttribute.normalized).toBe(false); @@ -2748,15 +2735,15 @@ describe( new Cartesian3( -69.37933953401223, 9.848530453475558, - -61.40903695222513 - ) + -61.40903695222513, + ), ); expect(positionAttribute.max).toEqual( new Cartesian3( 96.26074059602396, 164.09024489374352, - 54.029730459044615 - ) + 54.029730459044615, + ), ); expect(positionAttribute.constant).toEqual(Cartesian3.ZERO); expect(positionAttribute.typedArray).toBeUndefined(); @@ -2765,24 +2752,24 @@ describe( expect(positionAttribute.byteStride).toBeUndefined(); expect(positionQuantization.octEncoded).toBe(false); expect(positionQuantization.normalizationRange).toEqual( - new Cartesian3(2047, 2047, 2047) + new Cartesian3(2047, 2047, 2047), ); expect(positionQuantization.quantizedVolumeOffset).toEqual( new Cartesian3( -69.29850006103516, 9.929369926452637, - -61.32819747924805 - ) + -61.32819747924805, + ), ); expect(positionQuantization.quantizedVolumeDimensions).toEqual( new Cartesian3( 165.4783935546875, 165.4783935546875, - 165.4783935546875 - ) + 165.4783935546875, + ), ); expect(positionQuantization.componentDatatype).toBe( - ComponentDatatype.UNSIGNED_SHORT + ComponentDatatype.UNSIGNED_SHORT, ); expect(positionQuantization.type).toBe(AttributeType.VEC3); @@ -2797,15 +2784,15 @@ describe( new Cartesian3( -1.0069254898557476, -1.0078414940366558, - -1.007673468543034 - ) + -1.007673468543034, + ), ); expect(normalAttribute.max).toEqual( new Cartesian3( 1.0083384775647932, 1.007422473383885, - 1.0075904988775068 - ) + 1.0075904988775068, + ), ); expect(normalAttribute.constant).toEqual(Cartesian3.ZERO); expect(normalAttribute.typedArray).toBeUndefined(); @@ -2817,26 +2804,26 @@ describe( expect(normalQuantization.quantizedVolumeOffset).toBeUndefined(); expect(normalQuantization.quantizedVolumeDimensions).toBeUndefined(); expect(normalQuantization.componentDatatype).toBe( - ComponentDatatype.UNSIGNED_BYTE + ComponentDatatype.UNSIGNED_BYTE, ); expect(normalQuantization.type).toBe(AttributeType.VEC2); expect(texcoordAttribute.name).toBe("TEXCOORD_0"); expect(texcoordAttribute.semantic).toBe( - VertexAttributeSemantic.TEXCOORD + VertexAttributeSemantic.TEXCOORD, ); expect(texcoordAttribute.setIndex).toBe(0); expect(texcoordAttribute.componentDatatype).toBe( - ComponentDatatype.FLOAT + ComponentDatatype.FLOAT, ); expect(texcoordAttribute.type).toBe(AttributeType.VEC2); expect(texcoordAttribute.normalized).toBe(false); expect(texcoordAttribute.count).toBe(2399); expect(texcoordAttribute.min).toEqual( - new Cartesian2(0.025470511450678954, 0.019024537339121947) + new Cartesian2(0.025470511450678954, 0.019024537339121947), ); expect(texcoordAttribute.max).toEqual( - new Cartesian2(0.9846059706495423, 0.9809754626608782) + new Cartesian2(0.9846059706495423, 0.9809754626608782), ); expect(texcoordAttribute.constant).toEqual(Cartesian2.ZERO); expect(texcoordAttribute.typedArray).toBeUndefined(); @@ -2845,16 +2832,16 @@ describe( expect(texcoordAttribute.byteStride).toBeUndefined(); expect(texcoordQuantization.octEncoded).toBe(false); expect(texcoordQuantization.normalizationRange).toEqual( - new Cartesian2(1023, 1023) + new Cartesian2(1023, 1023), ); expect(texcoordQuantization.quantizedVolumeOffset).toEqual( - new Cartesian2(0.026409000158309937, 0.01996302604675293) + new Cartesian2(0.026409000158309937, 0.01996302604675293), ); expect(texcoordQuantization.quantizedVolumeDimensions).toEqual( - new Cartesian2(0.9600739479064941, 0.9600739479064941) + new Cartesian2(0.9600739479064941, 0.9600739479064941), ); expect(texcoordQuantization.componentDatatype).toBe( - ComponentDatatype.UNSIGNED_SHORT + ComponentDatatype.UNSIGNED_SHORT, ); expect(texcoordQuantization.type).toBe(AttributeType.VEC2); @@ -2881,16 +2868,16 @@ describe( const attributes = primitive.attributes; const positionAttribute = getAttribute( attributes, - VertexAttributeSemantic.POSITION + VertexAttributeSemantic.POSITION, ); const normalAttribute = getAttribute( attributes, - VertexAttributeSemantic.NORMAL + VertexAttributeSemantic.NORMAL, ); const texcoordAttribute = getAttribute( attributes, VertexAttributeSemantic.TEXCOORD, - 0 + 0, ); expect(positionAttribute.quantization).toBeDefined(); @@ -2917,14 +2904,14 @@ describe( expect(material.emissiveTexture.texture.width).toBe(256); expect(specularGlossiness.diffuseTexture.texture.width).toBe(256); expect(specularGlossiness.specularGlossinessTexture.texture.width).toBe( - 256 + 256, ); expect(specularGlossiness.diffuseFactor).toEqual( - new Cartesian4(1.0, 1.0, 1.0, 1.0) + new Cartesian4(1.0, 1.0, 1.0, 1.0), ); expect(specularGlossiness.specularFactor).toEqual( - new Cartesian3(1.0, 1.0, 1.0) + new Cartesian3(1.0, 1.0, 1.0), ); expect(specularGlossiness.glossinessFactor).toBe(0.5); @@ -2994,7 +2981,7 @@ describe( const uniformScaleStage = stages[6]; expect(uniformScaleStage.name).toEqual("Size"); expect(uniformScaleStage.type).toEqual( - ArticulationStageType.UNIFORMSCALE + ArticulationStageType.UNIFORMSCALE, ); expect(uniformScaleStage.minimumValue).toEqual(0.0); expect(uniformScaleStage.maximumValue).toEqual(1.0); @@ -3027,7 +3014,7 @@ describe( return loadGltf(boxCesiumRtc).then(function (gltfLoader) { const components = gltfLoader.components; const expectedTransform = Matrix4.fromTranslation( - new Cartesian3(6378137, 0, 0) + new Cartesian3(6378137, 0, 0), ); expect(components.transform).toEqual(expectedTransform); }); @@ -3041,11 +3028,11 @@ describe( const attributes = primitive.attributes; const positionAttribute = getAttribute( attributes, - VertexAttributeSemantic.POSITION + VertexAttributeSemantic.POSITION, ); const normalAttribute = getAttribute( attributes, - VertexAttributeSemantic.NORMAL + VertexAttributeSemantic.NORMAL, ); expect(positionAttribute.buffer).toBeDefined(); @@ -3058,7 +3045,7 @@ describe( const dequantizedValue = 127 / 255.0; expect(positionAttribute.min).toEqual(new Cartesian3(0.0, 0.0, 0.0)); expect(positionAttribute.max).toEqual( - new Cartesian3(dequantizedValue, dequantizedValue, dequantizedValue) + new Cartesian3(dequantizedValue, dequantizedValue, dequantizedValue), ); expect(normalAttribute.buffer).toBeDefined(); @@ -3077,25 +3064,25 @@ describe( const attributes = primitive.attributes; const positionAttribute = getAttribute( attributes, - VertexAttributeSemantic.POSITION + VertexAttributeSemantic.POSITION, ); const normalAttribute = getAttribute( attributes, - VertexAttributeSemantic.NORMAL + VertexAttributeSemantic.NORMAL, ); const scalarAttribute = getAttributeByName(attributes, "_SCALAR_TEST"); const positionQuantization = positionAttribute.quantization; expect(positionQuantization).toBeDefined(); expect(positionQuantization.quantizedVolumeOffset).toEqual( - new Cartesian3(-0.5, -0.5, -0.5) + new Cartesian3(-0.5, -0.5, -0.5), ); expect(positionQuantization.quantizedVolumeStepSize).toEqual( new Cartesian3( 0.000015259021896696422, 0.000015259021896696422, - 0.000015259021896696422 - ) + 0.000015259021896696422, + ), ); expect(positionAttribute.min).toEqual(new Cartesian3(-0.5, -0.5, -0.5)); expect(positionAttribute.max).toEqual(new Cartesian3(0.5, 0.5, 0.5)); @@ -3103,14 +3090,14 @@ describe( const normalQuantization = normalAttribute.quantization; expect(normalQuantization).toBeDefined(); expect(normalQuantization.quantizedVolumeOffset).toEqual( - new Cartesian3(-1.0, -1.0, -1.0) + new Cartesian3(-1.0, -1.0, -1.0), ); expect(normalQuantization.quantizedVolumeStepSize).toEqual( new Cartesian3( 0.000030518043793392844, 0.000030518043793392844, - 0.000030518043793392844 - ) + 0.000030518043793392844, + ), ); const scalarQuantization = scalarAttribute.quantization; @@ -3131,13 +3118,13 @@ describe( const attributes = primitive.attributes; const positionAttribute = getAttribute( attributes, - VertexAttributeSemantic.POSITION + VertexAttributeSemantic.POSITION, ); expect(positionAttribute).toBeDefined(); expect(primitive.indices).toBeDefined(); expect(primitive.indices.indexDatatype).toBe( - IndexDatatype.UNSIGNED_SHORT + IndexDatatype.UNSIGNED_SHORT, ); expect(primitive.indices.count).toBe(3); expect(primitive.indices.buffer).toBeDefined(); @@ -3161,14 +3148,14 @@ describe( gltfLoaders[0].destroy(); gltfLoaders[1].destroy(); - } + }, ); }); it("releases glTF JSON after parse", function () { const destroyGltfJsonLoader = spyOn( GltfJsonLoader.prototype, - "destroy" + "destroy", ).and.callThrough(); const options = { @@ -3183,7 +3170,7 @@ describe( it("releases glTF JSON after unload", function () { const destroyGltfJsonLoader = spyOn( GltfJsonLoader.prototype, - "destroy" + "destroy", ).and.callThrough(); const options = { @@ -3200,7 +3187,7 @@ describe( it("creates GPU resources asynchronously", function () { const jobSchedulerExecute = spyOn( JobScheduler.prototype, - "execute" + "execute", ).and.callThrough(); const options = { @@ -3215,7 +3202,7 @@ describe( it("creates GPU resources synchronously", function () { const jobSchedulerExecute = spyOn( JobScheduler.prototype, - "execute" + "execute", ).and.callThrough(); const options = { @@ -3271,22 +3258,22 @@ describe( it("destroys glTF loader", function () { const destroyStructuralMetadataLoader = spyOn( GltfStructuralMetadataLoader.prototype, - "destroy" + "destroy", ).and.callThrough(); const destroyVertexBufferLoader = spyOn( GltfVertexBufferLoader.prototype, - "destroy" + "destroy", ).and.callThrough(); const destroyIndexBufferLoader = spyOn( GltfIndexBufferLoader.prototype, - "destroy" + "destroy", ).and.callThrough(); const destroyTextureLoader = spyOn( GltfTextureLoader.prototype, - "destroy" + "destroy", ).and.callThrough(); return loadGltf(microcosm).then(function (gltfLoader) { @@ -3312,17 +3299,17 @@ describe( const destroyVertexBufferLoader = spyOn( GltfVertexBufferLoader.prototype, - "destroy" + "destroy", ).and.callThrough(); const destroyIndexBufferLoader = spyOn( GltfIndexBufferLoader.prototype, - "destroy" + "destroy", ).and.callThrough(); const destroyTextureLoader = spyOn( GltfTextureLoader.prototype, - "destroy" + "destroy", ).and.callThrough(); const options = { @@ -3334,10 +3321,10 @@ describe( await gltfLoader.load(); await expectAsync( - waitForLoaderProcess(gltfLoader, scene) + waitForLoaderProcess(gltfLoader, scene), ).toBeRejectedWithError( RuntimeError, - "Failed to load glTF\nFailed to load texture\nFailed to load image: CesiumLogoFlat.png\n404 Not Found" + "Failed to load glTF\nFailed to load texture\nFailed to load image: CesiumLogoFlat.png\n404 Not Found", ); expect(destroyVertexBufferLoader.calls.count()).toBe(2); @@ -3361,7 +3348,7 @@ describe( } }); spyOn(GltfJsonLoader.prototype, "_fetchGltf").and.returnValue( - fetchPromise + fetchPromise, ); const gltfUri = "https://example.com/model.glb"; @@ -3420,13 +3407,13 @@ describe( const attributes = primitive.attributes; const positionAttribute = getAttribute( attributes, - VertexAttributeSemantic.POSITION + VertexAttributeSemantic.POSITION, ); expect(positionAttribute).toBeDefined(); expect(primitive.indices).toBeDefined(); expect(primitive.indices.indexDatatype).toBe( - IndexDatatype.UNSIGNED_SHORT + IndexDatatype.UNSIGNED_SHORT, ); expect(primitive.indices.count).toBe(3); expect(primitive.indices.typedArray).toBeDefined(); @@ -3449,13 +3436,13 @@ describe( const attributes = primitive.attributes; const positionAttribute = getAttribute( attributes, - VertexAttributeSemantic.POSITION + VertexAttributeSemantic.POSITION, ); expect(positionAttribute).toBeDefined(); expect(primitive.indices).toBeDefined(); expect(primitive.indices.indexDatatype).toBe( - IndexDatatype.UNSIGNED_SHORT + IndexDatatype.UNSIGNED_SHORT, ); expect(primitive.indices.count).toBe(3); expect(primitive.indices.typedArray).not.toBeDefined(); @@ -3481,11 +3468,11 @@ describe( const attributes = primitive.attributes; const positionAttribute = getAttribute( attributes, - VertexAttributeSemantic.POSITION + VertexAttributeSemantic.POSITION, ); const normalAttribute = getAttribute( attributes, - VertexAttributeSemantic.NORMAL + VertexAttributeSemantic.NORMAL, ); expect(positionAttribute.buffer).toBeUndefined(); @@ -3510,50 +3497,50 @@ describe( loadAttributesAsTypedArray: true, }; - return loadGltf(boxInstancedTranslationMinMax, options).then(function ( - gltfLoader - ) { - const components = gltfLoader.components; - const scene = components.scene; - const rootNode = scene.nodes[0]; - const primitive = rootNode.primitives[0]; - const attributes = primitive.attributes; - const positionAttribute = getAttribute( - attributes, - VertexAttributeSemantic.POSITION - ); - const normalAttribute = getAttribute( - attributes, - VertexAttributeSemantic.NORMAL - ); - const instances = rootNode.instances; - const instancedAttributes = instances.attributes; - const translationAttribute = getAttribute( - instancedAttributes, - InstanceAttributeSemantic.TRANSLATION - ); - - expect(positionAttribute).toBeDefined(); - expect(normalAttribute).toBeDefined(); - - expect(translationAttribute.semantic).toBe( - InstanceAttributeSemantic.TRANSLATION - ); - expect(translationAttribute.componentDatatype).toBe( - ComponentDatatype.FLOAT - ); - expect(translationAttribute.type).toBe(AttributeType.VEC3); - expect(translationAttribute.normalized).toBe(false); - expect(translationAttribute.count).toBe(4); - expect(translationAttribute.min).toEqual(new Cartesian3(-2, -2, 0)); - expect(translationAttribute.max).toEqual(new Cartesian3(2, 2, 0)); - expect(translationAttribute.constant).toEqual(Cartesian3.ZERO); - expect(translationAttribute.quantization).toBeUndefined(); - expect(translationAttribute.typedArray).toBeDefined(); - expect(translationAttribute.buffer).toBeUndefined(); - expect(translationAttribute.byteOffset).toBe(0); - expect(translationAttribute.byteStride).toBeUndefined(); - }); + return loadGltf(boxInstancedTranslationMinMax, options).then( + function (gltfLoader) { + const components = gltfLoader.components; + const scene = components.scene; + const rootNode = scene.nodes[0]; + const primitive = rootNode.primitives[0]; + const attributes = primitive.attributes; + const positionAttribute = getAttribute( + attributes, + VertexAttributeSemantic.POSITION, + ); + const normalAttribute = getAttribute( + attributes, + VertexAttributeSemantic.NORMAL, + ); + const instances = rootNode.instances; + const instancedAttributes = instances.attributes; + const translationAttribute = getAttribute( + instancedAttributes, + InstanceAttributeSemantic.TRANSLATION, + ); + + expect(positionAttribute).toBeDefined(); + expect(normalAttribute).toBeDefined(); + + expect(translationAttribute.semantic).toBe( + InstanceAttributeSemantic.TRANSLATION, + ); + expect(translationAttribute.componentDatatype).toBe( + ComponentDatatype.FLOAT, + ); + expect(translationAttribute.type).toBe(AttributeType.VEC3); + expect(translationAttribute.normalized).toBe(false); + expect(translationAttribute.count).toBe(4); + expect(translationAttribute.min).toEqual(new Cartesian3(-2, -2, 0)); + expect(translationAttribute.max).toEqual(new Cartesian3(2, 2, 0)); + expect(translationAttribute.constant).toEqual(Cartesian3.ZERO); + expect(translationAttribute.quantization).toBeUndefined(); + expect(translationAttribute.typedArray).toBeDefined(); + expect(translationAttribute.buffer).toBeUndefined(); + expect(translationAttribute.byteOffset).toBe(0); + expect(translationAttribute.byteStride).toBeUndefined(); + }, + ); }); }); @@ -3572,11 +3559,11 @@ describe( const attributes = primitive.attributes; const positionAttribute = getAttribute( attributes, - VertexAttributeSemantic.POSITION + VertexAttributeSemantic.POSITION, ); const normalAttribute = getAttribute( attributes, - VertexAttributeSemantic.NORMAL + VertexAttributeSemantic.NORMAL, ); expect(positionAttribute.buffer).toBeDefined(); @@ -3610,7 +3597,7 @@ describe( // attribute to be loaded as a typed array. const positionAttribute = getAttribute( attributes, - VertexAttributeSemantic.POSITION + VertexAttributeSemantic.POSITION, ); expect(positionAttribute.buffer).toBeDefined(); expect(positionAttribute.typedArray).toBeUndefined(); @@ -3634,21 +3621,21 @@ describe( const instancedAttributes = instances.attributes; const translationAttribute = getAttribute( instancedAttributes, - InstanceAttributeSemantic.TRANSLATION + InstanceAttributeSemantic.TRANSLATION, ); expect(translationAttribute.typedArray).toBeDefined(); expect(translationAttribute.buffer).toBeUndefined(); const rotationAttribute = getAttribute( instancedAttributes, - InstanceAttributeSemantic.ROTATION + InstanceAttributeSemantic.ROTATION, ); expect(rotationAttribute.typedArray).toBeDefined(); expect(rotationAttribute.buffer).toBeUndefined(); const scaleAttribute = getAttribute( instancedAttributes, - InstanceAttributeSemantic.SCALE + InstanceAttributeSemantic.SCALE, ); expect(scaleAttribute.typedArray).toBeDefined(); expect(scaleAttribute.buffer).toBeUndefined(); @@ -3656,7 +3643,7 @@ describe( const featureIdAttribute = getAttribute( instancedAttributes, InstanceAttributeSemantic.FEATURE_ID, - 0 + 0, ); expect(featureIdAttribute.typedArray).toBeUndefined(); expect(featureIdAttribute.buffer).toBeDefined(); @@ -3668,51 +3655,51 @@ describe( loadAttributesFor2D: true, }; - return loadGltf(boxInstancedTranslation, options).then(function ( - gltfLoader - ) { - // Since the translation attribute has no min / max readily defined, - // it will load in as a typed array in addition to a buffer in order - // to find these bounds at runtime. - const components = gltfLoader.components; - const scene = components.scene; - const rootNode = scene.nodes[0]; - const primitive = rootNode.primitives[0]; - const attributes = primitive.attributes; - const positionAttribute = getAttribute( - attributes, - VertexAttributeSemantic.POSITION - ); - const normalAttribute = getAttribute( - attributes, - VertexAttributeSemantic.NORMAL - ); - const instances = rootNode.instances; - const instancedAttributes = instances.attributes; - const translationAttribute = getAttribute( - instancedAttributes, - InstanceAttributeSemantic.TRANSLATION - ); - - expect(positionAttribute).toBeDefined(); - expect(normalAttribute).toBeDefined(); - - expect(translationAttribute.semantic).toBe( - InstanceAttributeSemantic.TRANSLATION - ); - expect(translationAttribute.componentDatatype).toBe( - ComponentDatatype.FLOAT - ); - expect(translationAttribute.type).toBe(AttributeType.VEC3); - expect(translationAttribute.normalized).toBe(false); - expect(translationAttribute.count).toBe(4); - expect(translationAttribute.constant).toEqual(Cartesian3.ZERO); - expect(translationAttribute.quantization).toBeUndefined(); - expect(translationAttribute.typedArray).toBeDefined(); - expect(translationAttribute.buffer).toBeDefined(); - expect(translationAttribute.byteOffset).toBe(0); - expect(translationAttribute.byteStride).toBe(12); - }); + return loadGltf(boxInstancedTranslation, options).then( + function (gltfLoader) { + // Since the translation attribute has no min / max readily defined, + // it will load in as a typed array in addition to a buffer in order + // to find these bounds at runtime. + const components = gltfLoader.components; + const scene = components.scene; + const rootNode = scene.nodes[0]; + const primitive = rootNode.primitives[0]; + const attributes = primitive.attributes; + const positionAttribute = getAttribute( + attributes, + VertexAttributeSemantic.POSITION, + ); + const normalAttribute = getAttribute( + attributes, + VertexAttributeSemantic.NORMAL, + ); + const instances = rootNode.instances; + const instancedAttributes = instances.attributes; + const translationAttribute = getAttribute( + instancedAttributes, + InstanceAttributeSemantic.TRANSLATION, + ); + + expect(positionAttribute).toBeDefined(); + expect(normalAttribute).toBeDefined(); + + expect(translationAttribute.semantic).toBe( + InstanceAttributeSemantic.TRANSLATION, + ); + expect(translationAttribute.componentDatatype).toBe( + ComponentDatatype.FLOAT, + ); + expect(translationAttribute.type).toBe(AttributeType.VEC3); + expect(translationAttribute.normalized).toBe(false); + expect(translationAttribute.count).toBe(4); + expect(translationAttribute.constant).toEqual(Cartesian3.ZERO); + expect(translationAttribute.quantization).toBeUndefined(); + expect(translationAttribute.typedArray).toBeDefined(); + expect(translationAttribute.buffer).toBeDefined(); + expect(translationAttribute.byteOffset).toBe(0); + expect(translationAttribute.byteStride).toBe(12); + }, + ); }); it("loads instanced translation with min/max as buffer and typed array for 2D", function () { @@ -3720,52 +3707,52 @@ describe( loadAttributesFor2D: true, }; - return loadGltf(boxInstancedTranslationMinMax, options).then(function ( - gltfLoader - ) { - // Typed arrays are necessary for 2D projection, so this should load - // both a buffer and a typed array for the attribute. - const components = gltfLoader.components; - const scene = components.scene; - const rootNode = scene.nodes[0]; - const primitive = rootNode.primitives[0]; - const attributes = primitive.attributes; - const positionAttribute = getAttribute( - attributes, - VertexAttributeSemantic.POSITION - ); - const normalAttribute = getAttribute( - attributes, - VertexAttributeSemantic.NORMAL - ); - const instances = rootNode.instances; - const instancedAttributes = instances.attributes; - const translationAttribute = getAttribute( - instancedAttributes, - InstanceAttributeSemantic.TRANSLATION - ); - - expect(positionAttribute).toBeDefined(); - expect(normalAttribute).toBeDefined(); - - expect(translationAttribute.semantic).toBe( - InstanceAttributeSemantic.TRANSLATION - ); - expect(translationAttribute.componentDatatype).toBe( - ComponentDatatype.FLOAT - ); - expect(translationAttribute.type).toBe(AttributeType.VEC3); - expect(translationAttribute.normalized).toBe(false); - expect(translationAttribute.count).toBe(4); - expect(translationAttribute.min).toEqual(new Cartesian3(-2, -2, 0)); - expect(translationAttribute.max).toEqual(new Cartesian3(2, 2, 0)); - expect(translationAttribute.constant).toEqual(Cartesian3.ZERO); - expect(translationAttribute.quantization).toBeUndefined(); - expect(translationAttribute.typedArray).toBeDefined(); - expect(translationAttribute.buffer).toBeDefined(); - expect(translationAttribute.byteOffset).toBe(0); - expect(translationAttribute.byteStride).toBe(12); - }); + return loadGltf(boxInstancedTranslationMinMax, options).then( + function (gltfLoader) { + // Typed arrays are necessary for 2D projection, so this should load + // both a buffer and a typed array for the attribute. + const components = gltfLoader.components; + const scene = components.scene; + const rootNode = scene.nodes[0]; + const primitive = rootNode.primitives[0]; + const attributes = primitive.attributes; + const positionAttribute = getAttribute( + attributes, + VertexAttributeSemantic.POSITION, + ); + const normalAttribute = getAttribute( + attributes, + VertexAttributeSemantic.NORMAL, + ); + const instances = rootNode.instances; + const instancedAttributes = instances.attributes; + const translationAttribute = getAttribute( + instancedAttributes, + InstanceAttributeSemantic.TRANSLATION, + ); + + expect(positionAttribute).toBeDefined(); + expect(normalAttribute).toBeDefined(); + + expect(translationAttribute.semantic).toBe( + InstanceAttributeSemantic.TRANSLATION, + ); + expect(translationAttribute.componentDatatype).toBe( + ComponentDatatype.FLOAT, + ); + expect(translationAttribute.type).toBe(AttributeType.VEC3); + expect(translationAttribute.normalized).toBe(false); + expect(translationAttribute.count).toBe(4); + expect(translationAttribute.min).toEqual(new Cartesian3(-2, -2, 0)); + expect(translationAttribute.max).toEqual(new Cartesian3(2, 2, 0)); + expect(translationAttribute.constant).toEqual(Cartesian3.ZERO); + expect(translationAttribute.quantization).toBeUndefined(); + expect(translationAttribute.typedArray).toBeDefined(); + expect(translationAttribute.buffer).toBeDefined(); + expect(translationAttribute.byteOffset).toBe(0); + expect(translationAttribute.byteStride).toBe(12); + }, + ); }); }); @@ -3784,21 +3771,21 @@ describe( const attributes = primitive.attributes; const positionAttribute = getAttribute( attributes, - VertexAttributeSemantic.POSITION + VertexAttributeSemantic.POSITION, ); const normalAttribute = getAttribute( attributes, - VertexAttributeSemantic.NORMAL + VertexAttributeSemantic.NORMAL, ); const texcoordAttribute = getAttribute( attributes, VertexAttributeSemantic.TEXCOORD, - 0 + 0, ); const colorAttribute = getAttribute( attributes, VertexAttributeSemantic.COLOR, - 0 + 0, ); expect(positionAttribute).toBeDefined(); @@ -3825,16 +3812,16 @@ describe( const attributes = primitive.attributes; const positionAttribute = getAttribute( attributes, - VertexAttributeSemantic.POSITION + VertexAttributeSemantic.POSITION, ); const normalAttribute = getAttribute( attributes, - VertexAttributeSemantic.NORMAL + VertexAttributeSemantic.NORMAL, ); const featureIdAttribute = getAttribute( attributes, VertexAttributeSemantic.FEATURE_ID, - 0 + 0, ); expect(positionAttribute).toBeDefined(); @@ -3846,7 +3833,7 @@ describe( expect(featureIdAttribute.name).toBe("_FEATURE_ID_0"); expect(featureIdAttribute.semantic).toBe( - VertexAttributeSemantic.FEATURE_ID + VertexAttributeSemantic.FEATURE_ID, ); expect(featureIdAttribute.setIndex).toBe(0); expect(featureIdAttribute.buffer).toBeDefined(); @@ -3871,7 +3858,7 @@ describe( const attributes = primitive.attributes; const positionAttribute = getAttribute( attributes, - VertexAttributeSemantic.POSITION + VertexAttributeSemantic.POSITION, ); expect(positionAttribute).toBeDefined(); expect(positionAttribute.buffer).toBeDefined(); @@ -3898,17 +3885,17 @@ describe( const attributes = primitive.attributes; const positionAttribute = getAttribute( attributes, - VertexAttributeSemantic.POSITION + VertexAttributeSemantic.POSITION, ); const jointsAttribute = getAttribute( attributes, VertexAttributeSemantic.JOINTS, - 0 + 0, ); const weightsAttribute = getAttribute( attributes, VertexAttributeSemantic.WEIGHTS, - 0 + 0, ); expect(positionAttribute).toBeDefined(); @@ -3935,7 +3922,7 @@ describe( const attributes = primitive.attributes; const positionAttribute = getAttribute( attributes, - VertexAttributeSemantic.POSITION + VertexAttributeSemantic.POSITION, ); expect(positionAttribute).toBeDefined(); @@ -3959,20 +3946,20 @@ describe( const attributes = primitive.attributes; const positionAttribute = getAttribute( attributes, - VertexAttributeSemantic.POSITION + VertexAttributeSemantic.POSITION, ); const normalAttribute = getAttribute( attributes, - VertexAttributeSemantic.NORMAL + VertexAttributeSemantic.NORMAL, ); const tangentAttribute = getAttribute( attributes, - VertexAttributeSemantic.TANGENT + VertexAttributeSemantic.TANGENT, ); const texcoordAttribute = getAttribute( attributes, VertexAttributeSemantic.TEXCOORD, - 0 + 0, ); expect(positionAttribute).toBeDefined(); @@ -3991,10 +3978,10 @@ describe( }; await expectAsync( - loadGltf(boxInstanced, options) + loadGltf(boxInstanced, options), ).toBeRejectedWithError( RuntimeError, - "Failed to load glTF\nModels with the EXT_mesh_gpu_instancing extension cannot be used for classification." + "Failed to load glTF\nModels with the EXT_mesh_gpu_instancing extension cannot be used for classification.", ); }); @@ -4004,10 +3991,10 @@ describe( }; await expectAsync( - loadGltf(pointCloudWithPropertyAttributes, options) + loadGltf(pointCloudWithPropertyAttributes, options), ).toBeRejectedWithError( RuntimeError, - "Failed to load glTF\nOnly triangle meshes can be used for classification." + "Failed to load glTF\nOnly triangle meshes can be used for classification.", ); }); }); @@ -4022,16 +4009,16 @@ describe( const attributes = primitive.attributes; const positionAttribute = getAttribute( attributes, - VertexAttributeSemantic.POSITION + VertexAttributeSemantic.POSITION, ); const normalAttribute = getAttribute( attributes, - VertexAttributeSemantic.NORMAL + VertexAttributeSemantic.NORMAL, ); const texCoordAttribute = getAttribute( attributes, VertexAttributeSemantic.TEXCOORD, - 0 + 0, ); expect(positionAttribute).toBeDefined(); @@ -4056,92 +4043,92 @@ describe( }); it("loads model with CESIUM_primitive_outline with shared vertices", function () { - return loadGltf(boxWithPrimitiveOutlineSharedVertices).then(function ( - gltfLoader - ) { - const components = gltfLoader.components; - const scene = components.scene; - const [rootNode] = scene.nodes; - const [primitive] = rootNode.primitives; - - const attributes = primitive.attributes; - const positionAttribute = getAttribute( - attributes, - VertexAttributeSemantic.POSITION - ); - const normalAttribute = getAttribute( - attributes, - VertexAttributeSemantic.NORMAL - ); - const texCoordAttribute = getAttribute( - attributes, - VertexAttributeSemantic.TEXCOORD, - 0 - ); + return loadGltf(boxWithPrimitiveOutlineSharedVertices).then( + function (gltfLoader) { + const components = gltfLoader.components; + const scene = components.scene; + const [rootNode] = scene.nodes; + const [primitive] = rootNode.primitives; - expect(positionAttribute).toBeDefined(); - expect(normalAttribute).not.toBeDefined(); - expect(texCoordAttribute).not.toBeDefined(); + const attributes = primitive.attributes; + const positionAttribute = getAttribute( + attributes, + VertexAttributeSemantic.POSITION, + ); + const normalAttribute = getAttribute( + attributes, + VertexAttributeSemantic.NORMAL, + ); + const texCoordAttribute = getAttribute( + attributes, + VertexAttributeSemantic.TEXCOORD, + 0, + ); - const indices = primitive.indices; - expect(indices).toBeDefined(); - expect(indices.buffer).toBeDefined(); - expect(indices.typedArray).not.toBeDefined(); - expect(indices.count).toBe(36); + expect(positionAttribute).toBeDefined(); + expect(normalAttribute).not.toBeDefined(); + expect(texCoordAttribute).not.toBeDefined(); - const outlineCoordinates = primitive.outlineCoordinates; - expect(outlineCoordinates).toBeDefined(); - expect(outlineCoordinates.name).toBe("_OUTLINE_COORDINATES"); - // the model originally had 8 vertices, but some are duplicated - // when generating outlines - expect(outlineCoordinates.count).toBe(16); - expect(outlineCoordinates.semantic).not.toBeDefined(); - expect(outlineCoordinates.type).toBe(AttributeType.VEC3); - expect(outlineCoordinates.buffer).toBeDefined(); - expect(outlineCoordinates.typedArray).not.toBeDefined(); - }); + const indices = primitive.indices; + expect(indices).toBeDefined(); + expect(indices.buffer).toBeDefined(); + expect(indices.typedArray).not.toBeDefined(); + expect(indices.count).toBe(36); + + const outlineCoordinates = primitive.outlineCoordinates; + expect(outlineCoordinates).toBeDefined(); + expect(outlineCoordinates.name).toBe("_OUTLINE_COORDINATES"); + // the model originally had 8 vertices, but some are duplicated + // when generating outlines + expect(outlineCoordinates.count).toBe(16); + expect(outlineCoordinates.semantic).not.toBeDefined(); + expect(outlineCoordinates.type).toBe(AttributeType.VEC3); + expect(outlineCoordinates.buffer).toBeDefined(); + expect(outlineCoordinates.typedArray).not.toBeDefined(); + }, + ); }); it("does not load CESIUM_primitive_outline if loadPrimitiveOutline is false", function () { const options = { loadPrimitiveOutline: false, }; - return loadGltf(boxWithPrimitiveOutline, options).then(function ( - gltfLoader - ) { - const components = gltfLoader.components; - const scene = components.scene; - const [rootNode] = scene.nodes; - const [primitive] = rootNode.primitives; + return loadGltf(boxWithPrimitiveOutline, options).then( + function (gltfLoader) { + const components = gltfLoader.components; + const scene = components.scene; + const [rootNode] = scene.nodes; + const [primitive] = rootNode.primitives; - const attributes = primitive.attributes; - const positionAttribute = getAttribute( - attributes, - VertexAttributeSemantic.POSITION - ); - const normalAttribute = getAttribute( - attributes, - VertexAttributeSemantic.NORMAL - ); - const texCoordAttribute = getAttribute( - attributes, - VertexAttributeSemantic.TEXCOORD, - 0 - ); + const attributes = primitive.attributes; + const positionAttribute = getAttribute( + attributes, + VertexAttributeSemantic.POSITION, + ); + const normalAttribute = getAttribute( + attributes, + VertexAttributeSemantic.NORMAL, + ); + const texCoordAttribute = getAttribute( + attributes, + VertexAttributeSemantic.TEXCOORD, + 0, + ); - expect(positionAttribute).toBeDefined(); - expect(normalAttribute).toBeDefined(); - expect(texCoordAttribute).toBeDefined(); + expect(positionAttribute).toBeDefined(); + expect(normalAttribute).toBeDefined(); + expect(texCoordAttribute).toBeDefined(); - const indices = primitive.indices; - expect(indices).toBeDefined(); - expect(indices.buffer).toBeDefined(); - expect(indices.typedArray).not.toBeDefined(); - expect(indices.count).toBe(36); + const indices = primitive.indices; + expect(indices).toBeDefined(); + expect(indices.buffer).toBeDefined(); + expect(indices.typedArray).not.toBeDefined(); + expect(indices.count).toBe(36); - const outlineCoordinates = primitive.outlineCoordinates; - expect(outlineCoordinates).not.toBeDefined(); - }); + const outlineCoordinates = primitive.outlineCoordinates; + expect(outlineCoordinates).not.toBeDefined(); + }, + ); }); it("loads model with KHR_materials_specular extension", async function () { @@ -4152,7 +4139,7 @@ describe( expect(material.specular.specularFactor).toEqual(0.7); expect(material.specular.specularTexture.texture.width).toBe(256); expect(material.specular.specularColorFactor).toEqual( - Cartesian3.fromElements(50, 0, 0) + Cartesian3.fromElements(50, 0, 0), ); expect(material.specular.specularTexture.texture.width).toBe(256); }); @@ -4161,11 +4148,8 @@ describe( const gltfLoader = await loadGltf(anisotropyTestData); const { material } = gltfLoader.components.nodes[1].primitives[0]; - const { - anisotropyStrength, - anisotropyRotation, - anisotropyTexture, - } = material.anisotropy; + const { anisotropyStrength, anisotropyRotation, anisotropyTexture } = + material.anisotropy; expect(anisotropyStrength).toBe(0.5); expect(anisotropyRotation).toBe(0.349065850398866); @@ -4211,5 +4195,5 @@ describe( }); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/GltfLoaderUtilSpec.js b/packages/engine/Specs/Scene/GltfLoaderUtilSpec.js index dd30771963ef..bef2cf665012 100644 --- a/packages/engine/Specs/Scene/GltfLoaderUtilSpec.js +++ b/packages/engine/Specs/Scene/GltfLoaderUtilSpec.js @@ -173,7 +173,7 @@ describe( expect(sampler.wrapT).toBe(TextureWrap.REPEAT); expect(sampler.minificationFilter).toBe(TextureMinificationFilter.LINEAR); expect(sampler.magnificationFilter).toBe( - TextureMagnificationFilter.LINEAR + TextureMagnificationFilter.LINEAR, ); }); @@ -203,10 +203,10 @@ describe( expect(sampler.wrapS).toBe(TextureWrap.REPEAT); expect(sampler.wrapT).toBe(TextureWrap.REPEAT); expect(sampler.minificationFilter).toBe( - TextureMinificationFilter.NEAREST + TextureMinificationFilter.NEAREST, ); expect(sampler.magnificationFilter).toBe( - TextureMagnificationFilter.LINEAR + TextureMagnificationFilter.LINEAR, ); }); @@ -237,7 +237,7 @@ describe( expect(sampler.wrapT).toBe(TextureWrap.REPEAT); expect(sampler.minificationFilter).toBe(TextureMinificationFilter.LINEAR); expect(sampler.magnificationFilter).toBe( - TextureMagnificationFilter.LINEAR + TextureMagnificationFilter.LINEAR, ); }); @@ -284,7 +284,7 @@ describe( expect(sampler.wrapT).toBe(TextureWrap.REPEAT); expect(sampler.minificationFilter).toBe(TextureMinificationFilter.LINEAR); expect(sampler.magnificationFilter).toBe( - TextureMagnificationFilter.LINEAR + TextureMagnificationFilter.LINEAR, ); }); @@ -402,5 +402,5 @@ describe( }).toThrowDeveloperError(); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/GltfStructuralMetadataLoaderSpec.js b/packages/engine/Specs/Scene/GltfStructuralMetadataLoaderSpec.js index 6901bbdf1657..abbc32ae0f9d 100644 --- a/packages/engine/Specs/Scene/GltfStructuralMetadataLoaderSpec.js +++ b/packages/engine/Specs/Scene/GltfStructuralMetadataLoaderSpec.js @@ -258,7 +258,7 @@ describe( }); spyOn(Resource.prototype, "fetchImage").and.returnValue( - Promise.resolve(image) + Promise.resolve(image), ); const structuralMetadataLoader = new GltfStructuralMetadataLoader({ @@ -272,13 +272,13 @@ describe( await expectAsync(structuralMetadataLoader.load()).toBeRejectedWithError( RuntimeError, - "Failed to load structural metadata\nFailed to load buffer view\nFailed to load external buffer: https://example.com/external.bin\n404 Not Found" + "Failed to load structural metadata\nFailed to load buffer view\nFailed to load external buffer: https://example.com/external.bin\n404 Not Found", ); }); it("load throws if texture fails to load", async function () { spyOn(Resource.prototype, "fetchArrayBuffer").and.returnValue( - Promise.resolve(buffer) + Promise.resolve(buffer), ); spyOn(Resource.prototype, "fetchImage").and.callFake(function () { @@ -297,17 +297,17 @@ describe( await expectAsync(structuralMetadataLoader.load()).toBeRejectedWithError( RuntimeError, - "Failed to load structural metadata\nFailed to load texture\nFailed to load image: map.png\n404 Not Found" + "Failed to load structural metadata\nFailed to load texture\nFailed to load image: map.png\n404 Not Found", ); }); it("load throws if external schema fails to load", async function () { spyOn(Resource.prototype, "fetchArrayBuffer").and.returnValue( - Promise.resolve(buffer) + Promise.resolve(buffer), ); spyOn(Resource.prototype, "fetchImage").and.returnValue( - Promise.resolve(image) + Promise.resolve(image), ); spyOn(Resource.prototype, "fetchJson").and.callFake(function () { @@ -326,17 +326,17 @@ describe( await expectAsync(structuralMetadataLoader.load()).toBeRejectedWithError( RuntimeError, - "Failed to load structural metadata\nFailed to load schema: https://example.com/schema.json\n404 Not Found" + "Failed to load structural metadata\nFailed to load schema: https://example.com/schema.json\n404 Not Found", ); }); it("loads structural metadata", async function () { spyOn(Resource.prototype, "fetchArrayBuffer").and.returnValue( - Promise.resolve(buffer) + Promise.resolve(buffer), ); spyOn(Resource.prototype, "fetchImage").and.returnValue( - Promise.resolve(image) + Promise.resolve(image), ); const structuralMetadataLoader = new GltfStructuralMetadataLoader({ @@ -351,7 +351,7 @@ describe( await structuralMetadataLoader.load(); await waitForLoaderProcess(structuralMetadataLoader, scene); expect(() => - loaderProcess(structuralMetadataLoader, scene) + loaderProcess(structuralMetadataLoader, scene), ).not.toThrow(); const structuralMetadata = structuralMetadataLoader.structuralMetadata; @@ -380,13 +380,13 @@ describe( expect(colorProperty.textureReader.texture.width).toBe(1); expect(colorProperty.textureReader.texture.height).toBe(1); expect(colorProperty.textureReader.texture).toBe( - intensityProperty.textureReader.texture + intensityProperty.textureReader.texture, ); expect(vegetationProperty.textureReader.texture.width).toBe(1); expect(vegetationProperty.textureReader.texture.height).toBe(1); expect(vegetationProperty.textureReader.texture).not.toBe( - colorProperty.textureReader.texture + colorProperty.textureReader.texture, ); expect(Object.keys(structuralMetadata.schema.classes).sort()).toEqual([ @@ -399,15 +399,15 @@ describe( it("loads structural metadata with external schema", async function () { spyOn(Resource.prototype, "fetchArrayBuffer").and.returnValue( - Promise.resolve(buffer) + Promise.resolve(buffer), ); spyOn(Resource.prototype, "fetchImage").and.returnValue( - Promise.resolve(image) + Promise.resolve(image), ); spyOn(Resource.prototype, "fetchJson").and.returnValue( - Promise.resolve(schemaJson) + Promise.resolve(schemaJson), ); const structuralMetadataLoader = new GltfStructuralMetadataLoader({ @@ -433,30 +433,30 @@ describe( it("destroys structural metadata", async function () { spyOn(Resource.prototype, "fetchArrayBuffer").and.returnValue( - Promise.resolve(buffer) + Promise.resolve(buffer), ); spyOn(Resource.prototype, "fetchImage").and.returnValue( - Promise.resolve(image) + Promise.resolve(image), ); spyOn(Resource.prototype, "fetchJson").and.returnValue( - Promise.resolve(schemaJson) + Promise.resolve(schemaJson), ); const destroyBufferView = spyOn( GltfBufferViewLoader.prototype, - "destroy" + "destroy", ).and.callThrough(); const destroyTexture = spyOn( GltfTextureLoader.prototype, - "destroy" + "destroy", ).and.callThrough(); const destroySchema = spyOn( MetadataSchemaLoader.prototype, - "destroy" + "destroy", ).and.callThrough(); const structuralMetadataLoader = new GltfStructuralMetadataLoader({ @@ -486,28 +486,28 @@ describe( async function resolveAfterDestroy(rejectPromise) { spyOn(Resource.prototype, "fetchArrayBuffer").and.returnValue( - Promise.resolve(buffer) + Promise.resolve(buffer), ); spyOn(Resource.prototype, "fetchImage").and.returnValue( - Promise.resolve(image) + Promise.resolve(image), ); spyOn(Resource.prototype, "fetchJson").and.callFake(() => rejectPromise ? Promise.reject(new Error("")) - : Promise.resolve(schemaJson) + : Promise.resolve(schemaJson), ); const destroyBufferView = spyOn( GltfBufferViewLoader.prototype, - "destroy" + "destroy", ).and.callThrough(); const destroyTexture = spyOn( GltfTextureLoader.prototype, - "destroy" + "destroy", ).and.callThrough(); const destroySchema = spyOn( MetadataSchemaLoader.prototype, - "destroy" + "destroy", ).and.callThrough(); const structuralMetadataLoader = new GltfStructuralMetadataLoader({ @@ -539,5 +539,5 @@ describe( return resolveAfterDestroy(true); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/GltfTextureLoaderSpec.js b/packages/engine/Specs/Scene/GltfTextureLoaderSpec.js index 0845aca115ab..b6414a5f6182 100644 --- a/packages/engine/Specs/Scene/GltfTextureLoaderSpec.js +++ b/packages/engine/Specs/Scene/GltfTextureLoaderSpec.js @@ -235,7 +235,7 @@ describe( it("load throws if image fails to load", async function () { spyOn(Resource.prototype, "fetchImage").and.callFake(() => - Promise.reject(new Error("404 Not Found")) + Promise.reject(new Error("404 Not Found")), ); const textureLoader = new GltfTextureLoader({ @@ -249,13 +249,13 @@ describe( await expectAsync(textureLoader.load()).toBeRejectedWithError( RuntimeError, - "Failed to load texture\nFailed to load image: image.png\n404 Not Found" + "Failed to load texture\nFailed to load image: image.png\n404 Not Found", ); }); it("loads texture", async function () { spyOn(Resource.prototype, "fetchImage").and.returnValue( - Promise.resolve(image) + Promise.resolve(image), ); // Simulate JobScheduler not being ready for a few frames @@ -263,15 +263,14 @@ describe( let processCallsCount = 0; const jobScheduler = scene.frameState.jobScheduler; const originalJobSchedulerExecute = jobScheduler.execute; - spyOn(JobScheduler.prototype, "execute").and.callFake(function ( - job, - jobType - ) { - if (processCallsCount++ >= processCallsTotal) { - return originalJobSchedulerExecute.call(jobScheduler, job, jobType); - } - return false; - }); + spyOn(JobScheduler.prototype, "execute").and.callFake( + function (job, jobType) { + if (processCallsCount++ >= processCallsTotal) { + return originalJobSchedulerExecute.call(jobScheduler, job, jobType); + } + return false; + }, + ); const textureLoader = new GltfTextureLoader({ resourceCache: ResourceCache, @@ -291,13 +290,13 @@ describe( expect(textureLoader.texture.width).toBe(1); expect(textureLoader.texture.height).toBe(1); expect(ResourceCache.statistics.texturesByteLength).toBe( - textureLoader.texture.sizeInBytes + textureLoader.texture.sizeInBytes, ); }); it("creates texture synchronously", async function () { spyOn(Resource.prototype, "fetchImage").and.returnValue( - Promise.resolve(image) + Promise.resolve(image), ); const textureLoader = new GltfTextureLoader({ @@ -404,18 +403,18 @@ describe( compressedTextureNoMipmap: true, }); expect(textureLoader.texture.sampler.minificationFilter).toBe( - TextureMinificationFilter.NEAREST + TextureMinificationFilter.NEAREST, ); }); it("generates mipmap if sampler requires it", async function () { spyOn(Resource.prototype, "fetchImage").and.returnValue( - Promise.resolve(image) + Promise.resolve(image), ); const generateMipmap = spyOn( Texture.prototype, - "generateMipmap" + "generateMipmap", ).and.callThrough(); const textureLoader = new GltfTextureLoader({ @@ -437,7 +436,7 @@ describe( it("generates power-of-two texture if sampler requires it", async function () { spyOn(Resource.prototype, "fetchImage").and.returnValue( - Promise.resolve(imageNpot) + Promise.resolve(imageNpot), ); const textureLoader = new GltfTextureLoader({ @@ -458,7 +457,7 @@ describe( it("does not generate power-of-two texture if sampler does not require it", async function () { spyOn(Resource.prototype, "fetchImage").and.returnValue( - Promise.resolve(imageNpot) + Promise.resolve(imageNpot), ); const textureLoader = new GltfTextureLoader({ @@ -479,17 +478,17 @@ describe( it("destroys texture loader", async function () { spyOn(Resource.prototype, "fetchImage").and.returnValue( - Promise.resolve(image) + Promise.resolve(image), ); const unloadImage = spyOn( GltfImageLoader.prototype, - "unload" + "unload", ).and.callThrough(); const destroyTexture = spyOn( Texture.prototype, - "destroy" + "destroy", ).and.callThrough(); const textureLoader = new GltfTextureLoader({ @@ -525,7 +524,7 @@ describe( } else { resolve(image); } - }) + }), ); const textureLoader = new GltfTextureLoader({ @@ -555,5 +554,5 @@ describe( return resolveImageAfterDestroy(true); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/GltfVertexBufferLoaderSpec.js b/packages/engine/Specs/Scene/GltfVertexBufferLoaderSpec.js index 8351e05d96dc..9e6670d5f5b2 100644 --- a/packages/engine/Specs/Scene/GltfVertexBufferLoaderSpec.js +++ b/packages/engine/Specs/Scene/GltfVertexBufferLoaderSpec.js @@ -20,14 +20,7 @@ describe( "Scene/GltfVertexBufferLoader", function () { const dracoBufferTypedArray = new Uint8Array([ - 1, - 3, - 7, - 15, - 31, - 63, - 127, - 255, + 1, 3, 7, 15, 31, 63, 127, 255, ]); const dracoArrayBuffer = dracoBufferTypedArray.buffer; @@ -354,7 +347,7 @@ describe( it("load throws if buffer view fails to load", async function () { spyOn(Resource.prototype, "fetchArrayBuffer").and.callFake(() => - Promise.reject(new Error("404 Not Found")) + Promise.reject(new Error("404 Not Found")), ); const vertexBufferLoader = new GltfVertexBufferLoader({ @@ -368,13 +361,13 @@ describe( await expectAsync(vertexBufferLoader.load()).toBeRejectedWithError( RuntimeError, - "Failed to load vertex buffer\nFailed to load buffer view\nFailed to load external buffer: https://example.com/external.bin\n404 Not Found" + "Failed to load vertex buffer\nFailed to load buffer view\nFailed to load external buffer: https://example.com/external.bin\n404 Not Found", ); }); it("process throws if draco fails to load", async function () { spyOn(Resource.prototype, "fetchArrayBuffer").and.returnValue( - Promise.resolve(dracoArrayBuffer) + Promise.resolve(dracoArrayBuffer), ); spyOn(DracoLoader, "decodeBufferView").and.callFake(function () { @@ -395,16 +388,16 @@ describe( await vertexBufferLoader.load(); await expectAsync( - waitForLoaderProcess(vertexBufferLoader, scene) + waitForLoaderProcess(vertexBufferLoader, scene), ).toBeRejectedWithError( RuntimeError, - "Failed to load vertex buffer\nFailed to load Draco\nDraco decode failed" + "Failed to load vertex buffer\nFailed to load Draco\nDraco decode failed", ); }); it("loads as buffer", async function () { spyOn(Resource.prototype, "fetchArrayBuffer").and.returnValue( - Promise.resolve(arrayBuffer) + Promise.resolve(arrayBuffer), ); // Simulate JobScheduler not being ready for a few frames @@ -412,15 +405,14 @@ describe( let processCallsCount = 0; const jobScheduler = scene.frameState.jobScheduler; const originalJobSchedulerExecute = jobScheduler.execute; - spyOn(JobScheduler.prototype, "execute").and.callFake(function ( - job, - jobType - ) { - if (processCallsCount++ >= processCallsTotal) { - return originalJobSchedulerExecute.call(jobScheduler, job, jobType); - } - return false; - }); + spyOn(JobScheduler.prototype, "execute").and.callFake( + function (job, jobType) { + if (processCallsCount++ >= processCallsTotal) { + return originalJobSchedulerExecute.call(jobScheduler, job, jobType); + } + return false; + }, + ); const vertexBufferLoader = new GltfVertexBufferLoader({ resourceCache: ResourceCache, @@ -439,13 +431,13 @@ describe( expect(vertexBufferLoader.buffer.sizeInBytes).toBe(positions.byteLength); expect(vertexBufferLoader.typedArray).toBeUndefined(); expect(ResourceCache.statistics.geometryByteLength).toBe( - vertexBufferLoader.buffer.sizeInBytes + vertexBufferLoader.buffer.sizeInBytes, ); }); it("loads as typed array", async function () { spyOn(Resource.prototype, "fetchArrayBuffer").and.returnValue( - Promise.resolve(arrayBuffer) + Promise.resolve(arrayBuffer), ); spyOn(Buffer, "createVertexBuffer").and.callThrough(); @@ -465,19 +457,19 @@ describe( expect(() => loaderProcess(vertexBufferLoader, scene)).not.toThrowError(); expect(vertexBufferLoader.typedArray.byteLength).toBe( - positions.byteLength + positions.byteLength, ); expect(vertexBufferLoader.buffer).toBeUndefined(); expect(Buffer.createVertexBuffer.calls.count()).toBe(0); expect(ResourceCache.statistics.geometryByteLength).toBe( - vertexBufferLoader.typedArray.byteLength + vertexBufferLoader.typedArray.byteLength, ); }); it("loads as both buffer and typed array", async function () { spyOn(Resource.prototype, "fetchArrayBuffer").and.returnValue( - Promise.resolve(arrayBuffer) + Promise.resolve(arrayBuffer), ); // Simulate JobScheduler not being ready for a few frames @@ -485,15 +477,14 @@ describe( let processCallsCount = 0; const jobScheduler = scene.frameState.jobScheduler; const originalJobSchedulerExecute = jobScheduler.execute; - spyOn(JobScheduler.prototype, "execute").and.callFake(function ( - job, - jobType - ) { - if (processCallsCount++ >= processCallsTotal) { - return originalJobSchedulerExecute.call(jobScheduler, job, jobType); - } - return false; - }); + spyOn(JobScheduler.prototype, "execute").and.callFake( + function (job, jobType) { + if (processCallsCount++ >= processCallsTotal) { + return originalJobSchedulerExecute.call(jobScheduler, job, jobType); + } + return false; + }, + ); const vertexBufferLoader = new GltfVertexBufferLoader({ resourceCache: ResourceCache, @@ -512,7 +503,7 @@ describe( expect(() => loaderProcess(vertexBufferLoader, scene)).not.toThrowError(); expect(vertexBufferLoader.buffer.sizeInBytes).toBe(positions.byteLength); expect(vertexBufferLoader.typedArray.byteLength).toBe( - positions.byteLength + positions.byteLength, ); const totalSize = vertexBufferLoader.typedArray.byteLength + @@ -522,7 +513,7 @@ describe( it("creates vertex buffer synchronously", async function () { spyOn(Resource.prototype, "fetchArrayBuffer").and.returnValue( - Promise.resolve(arrayBuffer) + Promise.resolve(arrayBuffer), ); const vertexBufferLoader = new GltfVertexBufferLoader({ @@ -544,7 +535,7 @@ describe( it("loads positions from draco", async function () { spyOn(Resource.prototype, "fetchArrayBuffer").and.returnValue( - Promise.resolve(arrayBuffer) + Promise.resolve(arrayBuffer), ); // Simulate decodeBufferView not being ready for a few frames @@ -573,31 +564,31 @@ describe( expect(() => loaderProcess(vertexBufferLoader, scene)).not.toThrowError(); expect(vertexBufferLoader.buffer.sizeInBytes).toBe( - decodedPositions.byteLength + decodedPositions.byteLength, ); expect(vertexBufferLoader.typedArray).toBeUndefined(); const quantization = vertexBufferLoader.quantization; expect(quantization.octEncoded).toBe(false); expect(quantization.quantizedVolumeOffset).toEqual( - new Cartesian3(-1.0, -1.0, -1.0) + new Cartesian3(-1.0, -1.0, -1.0), ); expect(quantization.quantizedVolumeDimensions).toEqual( - new Cartesian3(2.0, 2.0, 2.0) + new Cartesian3(2.0, 2.0, 2.0), ); expect(quantization.normalizationRange).toEqual( - new Cartesian3(16383, 16383, 16383) + new Cartesian3(16383, 16383, 16383), ); expect(quantization.componentDatatype).toBe( - ComponentDatatype.UNSIGNED_SHORT + ComponentDatatype.UNSIGNED_SHORT, ); expect(ResourceCache.statistics.geometryByteLength).toBe( - vertexBufferLoader.buffer.sizeInBytes + vertexBufferLoader.buffer.sizeInBytes, ); }); it("loads normals from draco", async function () { spyOn(Resource.prototype, "fetchArrayBuffer").and.returnValue( - Promise.resolve(arrayBuffer) + Promise.resolve(arrayBuffer), ); spyOn(DracoLoader, "decodeBufferView").and.callFake(function () { @@ -619,7 +610,7 @@ describe( await waitForLoaderProcess(vertexBufferLoader, scene); expect(vertexBufferLoader.buffer.sizeInBytes).toBe( - decodedNormals.byteLength + decodedNormals.byteLength, ); const quantization = vertexBufferLoader.quantization; @@ -629,23 +620,23 @@ describe( expect(quantization.quantizedVolumeDimensions).toBeUndefined(); expect(quantization.normalizationRange).toBe(1023); expect(quantization.componentDatatype).toBe( - ComponentDatatype.UNSIGNED_BYTE + ComponentDatatype.UNSIGNED_BYTE, ); }); it("destroys vertex buffer loaded from buffer view", async function () { spyOn(Resource.prototype, "fetchArrayBuffer").and.returnValue( - Promise.resolve(arrayBuffer) + Promise.resolve(arrayBuffer), ); const unloadBufferView = spyOn( GltfBufferViewLoader.prototype, - "unload" + "unload", ).and.callThrough(); const destroyVertexBuffer = spyOn( Buffer.prototype, - "destroy" + "destroy", ).and.callThrough(); const vertexBufferLoader = new GltfVertexBufferLoader({ @@ -673,21 +664,21 @@ describe( it("destroys vertex buffer loaded from draco", async function () { spyOn(Resource.prototype, "fetchArrayBuffer").and.returnValue( - Promise.resolve(arrayBuffer) + Promise.resolve(arrayBuffer), ); spyOn(DracoLoader, "decodeBufferView").and.returnValue( - Promise.resolve(decodeDracoResults) + Promise.resolve(decodeDracoResults), ); const unloadDraco = spyOn( GltfDracoLoader.prototype, - "unload" + "unload", ).and.callThrough(); const destroyVertexBuffer = spyOn( Buffer.prototype, - "destroy" + "destroy", ).and.callThrough(); const vertexBufferLoader = new GltfVertexBufferLoader({ @@ -719,7 +710,7 @@ describe( spyOn(Resource.prototype, "fetchArrayBuffer").and.callFake(() => rejectPromise ? Promise.reject(new Error()) - : Promise.resolve(arrayBuffer) + : Promise.resolve(arrayBuffer), ); const vertexBufferLoader = new GltfVertexBufferLoader({ @@ -773,7 +764,7 @@ describe( const decodeBufferView = spyOn( DracoLoader, - "decodeBufferView" + "decodeBufferView", ).and.callFake(function () { return new Promise(function (resolve, reject) { setTimeout(function () { @@ -790,7 +781,7 @@ describe( await vertexBufferLoader.load(); // Destroy happens in mock function above await expectAsync( - waitForLoaderProcess(vertexBufferLoader, scene) + waitForLoaderProcess(vertexBufferLoader, scene), ).toBeResolved(); expect(decodeBufferView).toHaveBeenCalled(); // Make sure the decode actually starts @@ -806,5 +797,5 @@ describe( return resolveDracoAfterDestroy(true); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/GoogleEarthEnterpriseImageryProviderSpec.js b/packages/engine/Specs/Scene/GoogleEarthEnterpriseImageryProviderSpec.js index 6a476a32a0a6..416514c4a68e 100644 --- a/packages/engine/Specs/Scene/GoogleEarthEnterpriseImageryProviderSpec.js +++ b/packages/engine/Specs/Scene/GoogleEarthEnterpriseImageryProviderSpec.js @@ -49,39 +49,39 @@ describe("Scene/GoogleEarthEnterpriseImageryProvider", function () { it("conforms to ImageryProvider interface", function () { expect(GoogleEarthEnterpriseImageryProvider).toConformToInterface( - ImageryProvider + ImageryProvider, ); }); function installMockGetQuadTreePacket() { spyOn( GoogleEarthEnterpriseMetadata.prototype, - "getQuadTreePacket" + "getQuadTreePacket", ).and.callFake(function (quadKey, version) { quadKey = defaultValue(quadKey, ""); this._tileInfo[`${quadKey}0`] = new GoogleEarthEnterpriseTileInformation( 0xff, 1, 1, - 1 + 1, ); this._tileInfo[`${quadKey}1`] = new GoogleEarthEnterpriseTileInformation( 0xff, 1, 1, - 1 + 1, ); this._tileInfo[`${quadKey}2`] = new GoogleEarthEnterpriseTileInformation( 0xff, 1, 1, - 1 + 1, ); this._tileInfo[`${quadKey}3`] = new GoogleEarthEnterpriseTileInformation( 0xff, 1, 1, - 1 + 1, ); return Promise.resolve(); @@ -92,7 +92,7 @@ describe("Scene/GoogleEarthEnterpriseImageryProvider", function () { Resource._Implementations.createImage = function ( request, crossOrigin, - deferred + deferred, ) { let url = request.url; if (/^blob:/.test(url) || supportsImageBitmapOptions) { @@ -103,7 +103,7 @@ describe("Scene/GoogleEarthEnterpriseImageryProvider", function () { deferred, true, false, - true + true, ); } else { if (proxy) { @@ -117,7 +117,7 @@ describe("Scene/GoogleEarthEnterpriseImageryProvider", function () { Resource._DefaultImplementations.createImage( new Request({ url: "Data/Images/Red16x16.png" }), crossOrigin, - deferred + deferred, ); } }; @@ -129,7 +129,7 @@ describe("Scene/GoogleEarthEnterpriseImageryProvider", function () { data, headers, deferred, - overrideMimeType + overrideMimeType, ) { if (defined(expectedUrl) && !/^blob:/.test(url)) { if (proxy) { @@ -147,14 +147,14 @@ describe("Scene/GoogleEarthEnterpriseImageryProvider", function () { method, data, headers, - deferred + deferred, ); }; } it("fromMetadata throws without metadata", function () { expect(() => - GoogleEarthEnterpriseImageryProvider.fromMetadata() + GoogleEarthEnterpriseImageryProvider.fromMetadata(), ).toThrowDeveloperError(""); }); @@ -168,10 +168,10 @@ describe("Scene/GoogleEarthEnterpriseImageryProvider", function () { metadata.imageryPresent = false; expect(() => - GoogleEarthEnterpriseImageryProvider.fromMetadata(metadata) + GoogleEarthEnterpriseImageryProvider.fromMetadata(metadata), ).toThrowError( RuntimeError, - "The server made/up/url/ doesn't have imagery" + "The server made/up/url/ doesn't have imagery", ); }); @@ -180,12 +180,11 @@ describe("Scene/GoogleEarthEnterpriseImageryProvider", function () { const url = "http://fake.fake.invalid"; const metadata = await GoogleEarthEnterpriseMetadata.fromUrl(url); - imageryProvider = GoogleEarthEnterpriseImageryProvider.fromMetadata( - metadata - ); + imageryProvider = + GoogleEarthEnterpriseImageryProvider.fromMetadata(metadata); expect(imageryProvider).toBeInstanceOf( - GoogleEarthEnterpriseImageryProvider + GoogleEarthEnterpriseImageryProvider, ); }); @@ -194,9 +193,8 @@ describe("Scene/GoogleEarthEnterpriseImageryProvider", function () { const url = "http://fake.fake.invalid"; const metadata = await GoogleEarthEnterpriseMetadata.fromUrl(url); - imageryProvider = GoogleEarthEnterpriseImageryProvider.fromMetadata( - metadata - ); + imageryProvider = + GoogleEarthEnterpriseImageryProvider.fromMetadata(metadata); expect(typeof imageryProvider.hasAlphaChannel).toBe("boolean"); expect(imageryProvider.hasAlphaChannel).toBe(false); @@ -207,9 +205,8 @@ describe("Scene/GoogleEarthEnterpriseImageryProvider", function () { const url = "http://fake.fake.invalid/"; const metadata = await GoogleEarthEnterpriseMetadata.fromUrl(url); - imageryProvider = GoogleEarthEnterpriseImageryProvider.fromMetadata( - metadata - ); + imageryProvider = + GoogleEarthEnterpriseImageryProvider.fromMetadata(metadata); expect(imageryProvider.url).toEqual(url); @@ -219,10 +216,10 @@ describe("Scene/GoogleEarthEnterpriseImageryProvider", function () { expect(imageryProvider.tilingScheme).toBeInstanceOf(GeographicTilingScheme); // Defaults to custom tile policy expect(imageryProvider.tileDiscardPolicy).not.toBeInstanceOf( - DiscardMissingTileImagePolicy + DiscardMissingTileImagePolicy, ); expect(imageryProvider.rectangle).toEqual( - new Rectangle(-Math.PI, -Math.PI, Math.PI, Math.PI) + new Rectangle(-Math.PI, -Math.PI, Math.PI, Math.PI), ); expect(imageryProvider.credit).toBeUndefined(); @@ -237,9 +234,8 @@ describe("Scene/GoogleEarthEnterpriseImageryProvider", function () { const url = "http://foo.bar.invalid"; const metadata = await GoogleEarthEnterpriseMetadata.fromUrl(url); - imageryProvider = GoogleEarthEnterpriseImageryProvider.fromMetadata( - metadata - ); + imageryProvider = + GoogleEarthEnterpriseImageryProvider.fromMetadata(metadata); const layer = new ImageryLayer(imageryProvider); let tries = 0; @@ -261,7 +257,7 @@ describe("Scene/GoogleEarthEnterpriseImageryProvider", function () { data, headers, deferred, - overrideMimeType + overrideMimeType, ) { if (tries === 2) { // Succeed after 2 tries @@ -271,7 +267,7 @@ describe("Scene/GoogleEarthEnterpriseImageryProvider", function () { method, data, headers, - deferred + deferred, ); } else { // fail diff --git a/packages/engine/Specs/Scene/GoogleEarthEnterpriseMapsProviderSpec.js b/packages/engine/Specs/Scene/GoogleEarthEnterpriseMapsProviderSpec.js index 43791beaf69d..987fdde44c41 100644 --- a/packages/engine/Specs/Scene/GoogleEarthEnterpriseMapsProviderSpec.js +++ b/packages/engine/Specs/Scene/GoogleEarthEnterpriseMapsProviderSpec.js @@ -28,19 +28,19 @@ describe("Scene/GoogleEarthEnterpriseMapsProvider", function () { it("conforms to ImageryProvider interface", function () { expect(GoogleEarthEnterpriseMapsProvider).toConformToInterface( - ImageryProvider + ImageryProvider, ); }); it("fromUrl throws without url", async function () { await expectAsync( - GoogleEarthEnterpriseMapsProvider.fromUrl(undefined, 1234) + GoogleEarthEnterpriseMapsProvider.fromUrl(undefined, 1234), ).toBeRejectedWithDeveloperError(); }); it("fromUrl throws without channel", async function () { await expectAsync( - GoogleEarthEnterpriseMapsProvider.fromUrl("url", undefined) + GoogleEarthEnterpriseMapsProvider.fromUrl("url", undefined), ).toBeRejectedWithDeveloperError(); }); @@ -56,7 +56,7 @@ describe("Scene/GoogleEarthEnterpriseMapsProvider", function () { data, headers, deferred, - overrideMimeType + overrideMimeType, ) { Resource._DefaultImplementations.loadWithXhr( "Data/GoogleEarthEnterpriseMapsProvider/good.json", @@ -64,7 +64,7 @@ describe("Scene/GoogleEarthEnterpriseMapsProvider", function () { method, data, headers, - deferred + deferred, ); }; @@ -73,7 +73,7 @@ describe("Scene/GoogleEarthEnterpriseMapsProvider", function () { channel, { path: path, - } + }, ); expect(provider).toBeInstanceOf(GoogleEarthEnterpriseMapsProvider); @@ -91,7 +91,7 @@ describe("Scene/GoogleEarthEnterpriseMapsProvider", function () { data, headers, deferred, - overrideMimeType + overrideMimeType, ) { Resource._DefaultImplementations.loadWithXhr( "Data/GoogleEarthEnterpriseMapsProvider/good.json", @@ -99,7 +99,7 @@ describe("Scene/GoogleEarthEnterpriseMapsProvider", function () { method, data, headers, - deferred + deferred, ); }; @@ -110,7 +110,7 @@ describe("Scene/GoogleEarthEnterpriseMapsProvider", function () { const provider = await GoogleEarthEnterpriseMapsProvider.fromUrl( resource, channel, - { path: path } + { path: path }, ); expect(provider).toBeInstanceOf(GoogleEarthEnterpriseMapsProvider); @@ -119,10 +119,10 @@ describe("Scene/GoogleEarthEnterpriseMapsProvider", function () { it("fromUrl throws with invalid url", async function () { const url = "http://invalid.localhost"; await expectAsync( - GoogleEarthEnterpriseMapsProvider.fromUrl(url, 1234) + GoogleEarthEnterpriseMapsProvider.fromUrl(url, 1234), ).toBeRejectedWithError( RuntimeError, - new RegExp("An error occurred while accessing") + new RegExp("An error occurred while accessing"), ); }); @@ -134,7 +134,7 @@ describe("Scene/GoogleEarthEnterpriseMapsProvider", function () { data, headers, deferred, - overrideMimeType + overrideMimeType, ) { Resource._DefaultImplementations.loadWithXhr( "Data/GoogleEarthEnterpriseMapsProvider/bad_channel.json", @@ -142,16 +142,16 @@ describe("Scene/GoogleEarthEnterpriseMapsProvider", function () { method, data, headers, - deferred + deferred, ); }; const url = "http://invalid.localhost"; await expectAsync( - GoogleEarthEnterpriseMapsProvider.fromUrl(url, 1235) + GoogleEarthEnterpriseMapsProvider.fromUrl(url, 1235), ).toBeRejectedWithError( RuntimeError, - new RegExp("Could not find layer with channel \\(id\\) of 1235") + new RegExp("Could not find layer with channel \\(id\\) of 1235"), ); }); @@ -163,7 +163,7 @@ describe("Scene/GoogleEarthEnterpriseMapsProvider", function () { data, headers, deferred, - overrideMimeType + overrideMimeType, ) { Resource._DefaultImplementations.loadWithXhr( "Data/GoogleEarthEnterpriseMapsProvider/bad_version.json", @@ -171,16 +171,16 @@ describe("Scene/GoogleEarthEnterpriseMapsProvider", function () { method, data, headers, - deferred + deferred, ); }; const url = "http://invalid.localhost"; await expectAsync( - GoogleEarthEnterpriseMapsProvider.fromUrl(url, 1234) + GoogleEarthEnterpriseMapsProvider.fromUrl(url, 1234), ).toBeRejectedWithError( RuntimeError, - new RegExp("Could not find a version in channel \\(id\\) 1234") + new RegExp("Could not find a version in channel \\(id\\) 1234"), ); }); @@ -192,7 +192,7 @@ describe("Scene/GoogleEarthEnterpriseMapsProvider", function () { data, headers, deferred, - overrideMimeType + overrideMimeType, ) { Resource._DefaultImplementations.loadWithXhr( "Data/GoogleEarthEnterpriseMapsProvider/bad_projection.json", @@ -200,16 +200,16 @@ describe("Scene/GoogleEarthEnterpriseMapsProvider", function () { method, data, headers, - deferred + deferred, ); }; const url = "http://invalid.localhost"; await expectAsync( - GoogleEarthEnterpriseMapsProvider.fromUrl(url, 1234) + GoogleEarthEnterpriseMapsProvider.fromUrl(url, 1234), ).toBeRejectedWithError( RuntimeError, - new RegExp("Unsupported projection asdf") + new RegExp("Unsupported projection asdf"), ); }); @@ -225,7 +225,7 @@ describe("Scene/GoogleEarthEnterpriseMapsProvider", function () { data, headers, deferred, - overrideMimeType + overrideMimeType, ) { Resource._DefaultImplementations.loadWithXhr( "Data/GoogleEarthEnterpriseMapsProvider/good.json", @@ -233,7 +233,7 @@ describe("Scene/GoogleEarthEnterpriseMapsProvider", function () { method, data, headers, - deferred + deferred, ); }; @@ -242,7 +242,7 @@ describe("Scene/GoogleEarthEnterpriseMapsProvider", function () { channel, { path: path, - } + }, ); expect(typeof provider.hasAlphaChannel).toBe("boolean"); @@ -261,7 +261,7 @@ describe("Scene/GoogleEarthEnterpriseMapsProvider", function () { data, headers, deferred, - overrideMimeType + overrideMimeType, ) { Resource._DefaultImplementations.loadWithXhr( "Data/GoogleEarthEnterpriseMapsProvider/good.json", @@ -269,7 +269,7 @@ describe("Scene/GoogleEarthEnterpriseMapsProvider", function () { method, data, headers, - deferred + deferred, ); }; @@ -278,7 +278,7 @@ describe("Scene/GoogleEarthEnterpriseMapsProvider", function () { channel, { path: path, - } + }, ); expect(provider.url).toEqual(url); @@ -297,7 +297,7 @@ describe("Scene/GoogleEarthEnterpriseMapsProvider", function () { Resource._Implementations.createImage = function ( request, crossOrigin, - deferred + deferred, ) { const url = request.url; if (/^blob:/.test(url) || supportsImageBitmapOptions) { @@ -308,18 +308,18 @@ describe("Scene/GoogleEarthEnterpriseMapsProvider", function () { deferred, true, false, - true + true, ); } else { expect(url).toEqual( - "http://example.invalid/query?request=ImageryMaps&channel=1234&version=1&x=0&y=0&z=1" + "http://example.invalid/query?request=ImageryMaps&channel=1234&version=1&x=0&y=0&z=1", ); // Just return any old image. Resource._DefaultImplementations.createImage( new Request({ url: "Data/Images/Red16x16.png" }), crossOrigin, - deferred + deferred, ); } }; @@ -331,10 +331,10 @@ describe("Scene/GoogleEarthEnterpriseMapsProvider", function () { data, headers, deferred, - overrideMimeType + overrideMimeType, ) { expect(url).toEqual( - "http://example.invalid/query?request=ImageryMaps&channel=1234&version=1&x=0&y=0&z=1" + "http://example.invalid/query?request=ImageryMaps&channel=1234&version=1&x=0&y=0&z=1", ); // Just return any old image. @@ -344,7 +344,7 @@ describe("Scene/GoogleEarthEnterpriseMapsProvider", function () { method, data, headers, - deferred + deferred, ); }; @@ -366,7 +366,7 @@ describe("Scene/GoogleEarthEnterpriseMapsProvider", function () { data, headers, deferred, - overrideMimeType + overrideMimeType, ) { return deferred.resolve( "{\n" + @@ -392,13 +392,13 @@ describe("Scene/GoogleEarthEnterpriseMapsProvider", function () { "],\n" + 'serverUrl: "https://example.invalid",\n' + "useGoogleLayers: false\n" + - "}" + "}", ); }; const provider = await GoogleEarthEnterpriseMapsProvider.fromUrl( url, - channel + channel, ); expect(provider.url).toEqual(url); @@ -415,7 +415,7 @@ describe("Scene/GoogleEarthEnterpriseMapsProvider", function () { data, headers, deferred, - overrideMimeType + overrideMimeType, ) { return deferred.resolve( JSON.stringify({ @@ -432,13 +432,13 @@ describe("Scene/GoogleEarthEnterpriseMapsProvider", function () { ], serverUrl: "https://example.invalid", useGoogleLayers: false, - }) + }), ); }; const provider = await GoogleEarthEnterpriseMapsProvider.fromUrl( "http://example.invalid", - 1234 + 1234, ); expect(provider.tilingScheme).toBeInstanceOf(WebMercatorTilingScheme); @@ -453,7 +453,7 @@ describe("Scene/GoogleEarthEnterpriseMapsProvider", function () { data, headers, deferred, - overrideMimeType + overrideMimeType, ) { return deferred.resolve( JSON.stringify({ @@ -471,13 +471,13 @@ describe("Scene/GoogleEarthEnterpriseMapsProvider", function () { projection: "mercator", serverUrl: "https://example.invalid", useGoogleLayers: false, - }) + }), ); }; const provider = await GoogleEarthEnterpriseMapsProvider.fromUrl( "http://example.invalid", - 1234 + 1234, ); expect(provider.tilingScheme).toBeInstanceOf(WebMercatorTilingScheme); @@ -492,7 +492,7 @@ describe("Scene/GoogleEarthEnterpriseMapsProvider", function () { data, headers, deferred, - overrideMimeType + overrideMimeType, ) { return deferred.resolve( JSON.stringify({ @@ -510,18 +510,18 @@ describe("Scene/GoogleEarthEnterpriseMapsProvider", function () { projection: "flat", serverUrl: "https://example.invalid", useGoogleLayers: false, - }) + }), ); }; const provider = await GoogleEarthEnterpriseMapsProvider.fromUrl( "http://example.invalid", - 1234 + 1234, ); expect(provider.tilingScheme).toBeInstanceOf(GeographicTilingScheme); expect(provider.rectangle).toEqual( - new Rectangle(-Math.PI, -Math.PI, Math.PI, Math.PI) + new Rectangle(-Math.PI, -Math.PI, Math.PI, Math.PI), ); }); }); diff --git a/packages/engine/Specs/Scene/GridImageryProviderSpec.js b/packages/engine/Specs/Scene/GridImageryProviderSpec.js index c2236aea20ac..745249679cd3 100644 --- a/packages/engine/Specs/Scene/GridImageryProviderSpec.js +++ b/packages/engine/Specs/Scene/GridImageryProviderSpec.js @@ -33,11 +33,11 @@ describe("Scene/GridImageryProvider", function () { expect(provider.tileDiscardPolicy).toBeUndefined(); expect(provider.rectangle).toEqual(new GeographicTilingScheme().rectangle); - return Promise.resolve(provider.requestImage(0, 0, 0)).then(function ( - image - ) { - expect(image).toBeDefined(); - }); + return Promise.resolve(provider.requestImage(0, 0, 0)).then( + function (image) { + expect(image).toBeDefined(); + }, + ); }); it("uses alternate tiling scheme if provided", function () { diff --git a/packages/engine/Specs/Scene/GroundPolylinePrimitiveSpec.js b/packages/engine/Specs/Scene/GroundPolylinePrimitiveSpec.js index e7e7347483e8..8d71a98f6bb9 100644 --- a/packages/engine/Specs/Scene/GroundPolylinePrimitiveSpec.js +++ b/packages/engine/Specs/Scene/GroundPolylinePrimitiveSpec.js @@ -105,9 +105,8 @@ describe( scene.camera.frustum.near = 0.1; scene.camera.frustum.far = 10000000000.0; - const depthpolylineColorAttribute = ColorGeometryInstanceAttribute.fromColor( - new Color(0.0, 0.0, 1.0, 1.0) - ); + const depthpolylineColorAttribute = + ColorGeometryInstanceAttribute.fromColor(new Color(0.0, 0.0, 1.0, 1.0)); depthColor = depthpolylineColorAttribute.value; const primitive = new Primitive({ geometryInstances: new GeometryInstance({ @@ -131,7 +130,7 @@ describe( depthRectanglePrimitive = new MockGlobePrimitive(primitive); polylineColorAttribute = ColorGeometryInstanceAttribute.fromColor( - new Color(0.0, 1.0, 1.0, 1.0) + new Color(0.0, 1.0, 1.0, 1.0), ); polylineColor = polylineColorAttribute.value; groundPolylineInstance = new GeometryInstance({ @@ -165,7 +164,7 @@ describe( groundPolylinePrimitive = new GroundPolylinePrimitive(); expect(groundPolylinePrimitive.geometryInstances).not.toBeDefined(); expect(groundPolylinePrimitive.appearance).toBeInstanceOf( - PolylineMaterialAppearance + PolylineMaterialAppearance, ); expect(groundPolylinePrimitive.show).toEqual(true); expect(groundPolylinePrimitive.interleave).toEqual(false); @@ -191,7 +190,7 @@ describe( }); expect(groundPolylinePrimitive.geometryInstances).toEqual( - geometryInstances + geometryInstances, ); expect(groundPolylinePrimitive.show).toEqual(false); expect(groundPolylinePrimitive.interleave).toEqual(true); @@ -307,7 +306,7 @@ describe( groundPolylinePrimitive = scene.groundPrimitives.add( new GroundPolylinePrimitive({ geometryInstances: groundPolylineInstance, - }) + }), ); groundPolylinePrimitive.show = false; @@ -356,7 +355,7 @@ describe( function verifyGroundPolylinePrimitiveRender( lookPosition, primitive, - color + color, ) { scene.camera.lookAt(lookPosition, Cartesian3.UNIT_Z); @@ -388,7 +387,7 @@ describe( verifyGroundPolylinePrimitiveRender( lookPosition, groundPolylinePrimitive, - polylineColor + polylineColor, ); }); @@ -407,7 +406,7 @@ describe( verifyGroundPolylinePrimitiveRender( lookPosition, groundPolylinePrimitive, - polylineColor + polylineColor, ); }); @@ -426,7 +425,7 @@ describe( verifyGroundPolylinePrimitiveRender( lookPosition, groundPolylinePrimitive, - polylineColor + polylineColor, ); }); @@ -488,7 +487,7 @@ describe( id: "polyline on terrain", attributes: { color: ColorGeometryInstanceAttribute.fromColor( - new Color(1.0, 1.0, 1.0, 0.5) + new Color(1.0, 1.0, 1.0, 0.5), ), }, }); @@ -504,7 +503,7 @@ describe( id: "polyline on terrain", attributes: { color: ColorGeometryInstanceAttribute.fromColor( - new Color(1.0, 1.0, 1.0, 0.5) + new Color(1.0, 1.0, 1.0, 0.5), ), }, }); @@ -518,7 +517,7 @@ describe( verifyGroundPolylinePrimitiveRender( lookPosition, groundPolylinePrimitive, - [192, 192, 255, 255] + [192, 192, 255, 255], ); }); @@ -582,11 +581,11 @@ describe( verifyGroundPolylinePrimitiveRender( lookPosition, groundPolylinePrimitive, - polylineColor + polylineColor, ); const attributes = groundPolylinePrimitive.getGeometryInstanceAttributes( - "polyline on terrain" + "polyline on terrain", ); expect(attributes.color).toBeDefined(); }); @@ -605,7 +604,7 @@ describe( verifyGroundPolylinePrimitiveRender( lookPosition, groundPolylinePrimitive, - polylineColor + polylineColor, ); // Remove so it can be re-added, but don't destroy. @@ -615,7 +614,7 @@ describe( const newColor = [255, 255, 255, 255]; const attributes = groundPolylinePrimitive.getGeometryInstanceAttributes( - "polyline on terrain" + "polyline on terrain", ); expect(attributes.color).toBeDefined(); attributes.color = newColor; @@ -623,7 +622,7 @@ describe( verifyGroundPolylinePrimitiveRender( lookPosition, groundPolylinePrimitive, - newColor + newColor, ); }); @@ -641,7 +640,7 @@ describe( verifyGroundPolylinePrimitiveRender( lookPositionOffset, groundPolylinePrimitive, - polylineColor + polylineColor, ); scene.groundPrimitives.destroyPrimitives = false; @@ -649,7 +648,7 @@ describe( scene.groundPrimitives.destroyPrimitives = true; const attributes = groundPolylinePrimitive.getGeometryInstanceAttributes( - "polyline on terrain" + "polyline on terrain", ); expect(attributes.width).toBeDefined(); attributes.width = [0]; @@ -657,7 +656,7 @@ describe( verifyGroundPolylinePrimitiveRender( lookPositionOffset, groundPolylinePrimitive, - depthColor + depthColor, ); }); @@ -666,9 +665,8 @@ describe( return; } - groundPolylineInstance.attributes.show = new ShowGeometryInstanceAttribute( - true - ); + groundPolylineInstance.attributes.show = + new ShowGeometryInstanceAttribute(true); groundPolylinePrimitive = new GroundPolylinePrimitive({ geometryInstances: groundPolylineInstance, @@ -679,7 +677,7 @@ describe( verifyGroundPolylinePrimitiveRender( lookPosition, groundPolylinePrimitive, - polylineColor + polylineColor, ); scene.groundPrimitives.destroyPrimitives = false; @@ -687,7 +685,7 @@ describe( scene.groundPrimitives.destroyPrimitives = true; const attributes = groundPolylinePrimitive.getGeometryInstanceAttributes( - "polyline on terrain" + "polyline on terrain", ); expect(attributes.show).toBeDefined(); attributes.show = [0]; @@ -695,7 +693,7 @@ describe( verifyGroundPolylinePrimitiveRender( lookPosition, groundPolylinePrimitive, - depthColor + depthColor, ); }); @@ -721,10 +719,8 @@ describe( }), id: "polyline on terrain", attributes: { - distanceDisplayCondition: new DistanceDisplayConditionGeometryInstanceAttribute( - near, - far - ), + distanceDisplayCondition: + new DistanceDisplayConditionGeometryInstanceAttribute(near, far), color: polylineColorAttribute, }, }); @@ -739,15 +735,16 @@ describe( scene.camera.lookAt(lookPosition, Cartesian3.UNIT_Z); scene.renderForSpecs(); - const boundingSphere = groundPolylinePrimitive.getGeometryInstanceAttributes( - "polyline on terrain" - ).boundingSphere; + const boundingSphere = + groundPolylinePrimitive.getGeometryInstanceAttributes( + "polyline on terrain", + ).boundingSphere; const center = boundingSphere.center; const radius = boundingSphere.radius; scene.camera.lookAt( center, - new HeadingPitchRange(0.0, -CesiumMath.PI_OVER_TWO, radius) + new HeadingPitchRange(0.0, -CesiumMath.PI_OVER_TWO, radius), ); expect(scene).toRenderAndCall(function (rgba) { expect(coordinateOfPixelColor(rgba, depthColor)).toBeDefined(); @@ -755,7 +752,11 @@ describe( scene.camera.lookAt( center, - new HeadingPitchRange(0.0, -CesiumMath.PI_OVER_TWO, radius + near + 1.0) + new HeadingPitchRange( + 0.0, + -CesiumMath.PI_OVER_TWO, + radius + near + 1.0, + ), ); expect(scene).toRenderAndCall(function (rgba) { expect(coordinateOfPixelColor(rgba, depthColor)).toBeUndefined(); @@ -763,7 +764,7 @@ describe( scene.camera.lookAt( center, - new HeadingPitchRange(0.0, -CesiumMath.PI_OVER_TWO, radius + far + 1.0) + new HeadingPitchRange(0.0, -CesiumMath.PI_OVER_TWO, radius + far + 1.0), ); expect(scene).toRenderAndCall(function (rgba) { expect(coordinateOfPixelColor(rgba, depthColor)).toBeDefined(); @@ -775,9 +776,8 @@ describe( return; } - groundPolylineInstance.attributes.show = new ShowGeometryInstanceAttribute( - true - ); + groundPolylineInstance.attributes.show = + new ShowGeometryInstanceAttribute(true); groundPolylinePrimitive = new GroundPolylinePrimitive({ geometryInstances: groundPolylineInstance, @@ -788,14 +788,14 @@ describe( verifyGroundPolylinePrimitiveRender( lookPosition, groundPolylinePrimitive, - polylineColor + polylineColor, ); const attributes = groundPolylinePrimitive.getGeometryInstanceAttributes( - "polyline on terrain" + "polyline on terrain", ); const attributes2 = groundPolylinePrimitive.getGeometryInstanceAttributes( - "polyline on terrain" + "polyline on terrain", ); expect(attributes).toBe(attributes2); }); @@ -814,7 +814,7 @@ describe( const polylineColorCoordinate = verifyGroundPolylinePrimitiveRender( lookPosition, groundPolylinePrimitive, - polylineColor + polylineColor, ); expect(scene).toPickAndCall(function (result) { @@ -837,7 +837,7 @@ describe( const polylineColorCoordinate = verifyGroundPolylinePrimitiveRender( lookPosition, groundPolylinePrimitive, - polylineColor + polylineColor, ); expect(scene).toPickAndCall(function (result) { @@ -860,7 +860,7 @@ describe( const polylineColorCoordinate = verifyGroundPolylinePrimitiveRender( lookPosition, groundPolylinePrimitive, - polylineColor + polylineColor, ); scene.camera.lookAt(lookPosition, Cartesian3.UNIT_Z); @@ -933,7 +933,7 @@ describe( verifyGroundPolylinePrimitiveRender( lookPosition, groundPolylinePrimitive, - polylineColor + polylineColor, ); expect(scene).toPickAndCall(function (result) { @@ -959,7 +959,7 @@ describe( verifyGroundPolylinePrimitiveRender( lookPosition, groundPolylinePrimitive, - polylineColor + polylineColor, ); }).toThrowDeveloperError(); }); @@ -978,11 +978,11 @@ describe( verifyGroundPolylinePrimitiveRender( lookPosition, groundPolylinePrimitive, - polylineColor + polylineColor, ); const attributes = groundPolylinePrimitive.getGeometryInstanceAttributes( - "polyline on terrain" + "polyline on terrain", ); expect(function () { @@ -1008,9 +1008,10 @@ describe( scene.renderForSpecs(); return groundPolylinePrimitive.ready; }).then(function () { - const attributes = groundPolylinePrimitive.getGeometryInstanceAttributes( - "polyline on terrain" - ); + const attributes = + groundPolylinePrimitive.getGeometryInstanceAttributes( + "polyline on terrain", + ); expect(function () { attributes.color = undefined; }).toThrowDeveloperError(); @@ -1031,7 +1032,7 @@ describe( verifyGroundPolylinePrimitiveRender( lookPosition, groundPolylinePrimitive, - polylineColor + polylineColor, ); expect(function () { @@ -1087,7 +1088,7 @@ describe( verifyGroundPolylinePrimitiveRender( lookPosition, groundPolylinePrimitive, - polylineColor + polylineColor, ); }); }); @@ -1140,5 +1141,5 @@ describe( ApproximateTerrainHeights._terrainHeights = terrainHeights; }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/GroundPrimitiveSpec.js b/packages/engine/Specs/Scene/GroundPrimitiveSpec.js index 1fffa328d6fb..1c77f26b5245 100644 --- a/packages/engine/Specs/Scene/GroundPrimitiveSpec.js +++ b/packages/engine/Specs/Scene/GroundPrimitiveSpec.js @@ -59,7 +59,7 @@ describe( }); } const depthColorAttribute = ColorGeometryInstanceAttribute.fromColor( - new Color(0.0, 0.0, 1.0, 1.0) + new Color(0.0, 0.0, 1.0, 1.0), ); depthColor = depthColorAttribute.value; return new Primitive({ @@ -124,12 +124,12 @@ describe( -180 + CesiumMath.EPSILON4, -90 + CesiumMath.EPSILON4, 180 - CesiumMath.EPSILON4, - 90 - CesiumMath.EPSILON4 + 90 - CesiumMath.EPSILON4, ); reusableGlobePrimitive = createPrimitive(bigRectangle, Pass.GLOBE); reusableTilesetPrimitive = createPrimitive( bigRectangle, - Pass.CESIUM_3D_TILE + Pass.CESIUM_3D_TILE, ); return GroundPrimitive.initializeTerrainHeights(); @@ -153,11 +153,11 @@ describe( globePrimitive = new MockPrimitive(reusableGlobePrimitive, Pass.GLOBE); tilesetPrimitive = new MockPrimitive( reusableTilesetPrimitive, - Pass.CESIUM_3D_TILE + Pass.CESIUM_3D_TILE, ); const rectColorAttribute = ColorGeometryInstanceAttribute.fromColor( - new Color(1.0, 1.0, 0.0, 1.0) + new Color(1.0, 1.0, 0.0, 1.0), ); rectColor = rectColorAttribute.value; rectangleInstance = new GeometryInstance({ @@ -335,7 +335,7 @@ describe( geometryInstances: rectangleInstance, asynchronous: false, show: false, - }) + }), ); await pollToPromise(() => { @@ -434,7 +434,7 @@ describe( } const rectColorAttribute = ColorGeometryInstanceAttribute.fromColor( - new Color(1.0, 1.0, 0.0, 1.0) + new Color(1.0, 1.0, 0.0, 1.0), ); const bigIdlRectangle = Rectangle.fromDegrees(176.0, 30.0, -176.0, 34.0); const bigIdlRectangleInstance = new GeometryInstance({ @@ -471,13 +471,13 @@ describe( } const rectColorAttribute = ColorGeometryInstanceAttribute.fromColor( - new Color(1.0, 1.0, 0.0, 1.0) + new Color(1.0, 1.0, 0.0, 1.0), ); const smallIdlRectangle = Rectangle.fromDegrees( 179.6, 30.0, -179.6, - 30.9 + 30.9, ); const smallIdlRectangleInstance = new GeometryInstance({ geometry: new RectangleGeometry({ @@ -549,15 +549,15 @@ describe( -180 + CesiumMath.EPSILON4, -90 + CesiumMath.EPSILON4, 180 - CesiumMath.EPSILON4, - 90 - CesiumMath.EPSILON4 + 90 - CesiumMath.EPSILON4, ); largeSceneReusableGlobePrimitive = createPrimitive( bigRectangle, - Pass.GLOBE + Pass.GLOBE, ); largeSceneReusableTilesetPrimitive = createPrimitive( bigRectangle, - Pass.CESIUM_3D_TILE + Pass.CESIUM_3D_TILE, ); }); afterAll(function () { @@ -578,11 +578,11 @@ describe( const largeSceneGlobePrimitive = new MockPrimitive( largeSceneReusableGlobePrimitive, - Pass.GLOBE + Pass.GLOBE, ); const largeSceneTilesetPrimitive = new MockPrimitive( largeSceneReusableTilesetPrimitive, - Pass.CESIUM_3D_TILE + Pass.CESIUM_3D_TILE, ); largeScene.primitives.add(largeSceneGlobePrimitive); @@ -626,7 +626,7 @@ describe( } const rectColorAttribute = ColorGeometryInstanceAttribute.fromColor( - new Color(0.0, 1.0, 1.0, 1.0) + new Color(0.0, 1.0, 1.0, 1.0), ); const rectangleInstance1 = new GeometryInstance({ geometry: new RectangleGeometry({ @@ -635,7 +635,7 @@ describe( rectangle.west, rectangle.south, rectangle.east, - (rectangle.north + rectangle.south) * 0.5 + (rectangle.north + rectangle.south) * 0.5, ), }), id: "rectangle1", @@ -650,7 +650,7 @@ describe( rectangle.west, (rectangle.north + rectangle.south) * 0.5, rectangle.east, - rectangle.north + rectangle.north, ), }), id: "rectangle2", @@ -685,7 +685,7 @@ describe( west, south, west + radians, - south + radians + south + radians, ); const smallRectanglePrimitive = new GroundPrimitive({ geometryInstances: new GeometryInstance({ @@ -706,7 +706,7 @@ describe( verifyLargerScene( smallRectanglePrimitive, [255, 255, 255, 255], - smallRectangle + smallRectangle, ); }); @@ -728,7 +728,7 @@ describe( west, south, west + radians, - south + radians + south + radians, ); const largeRectanglePrimitive = new GroundPrimitive({ geometryInstances: new GeometryInstance({ @@ -749,7 +749,7 @@ describe( verifyLargerScene( largeRectanglePrimitive, [255, 255, 255, 255], - largeRectangle + largeRectangle, ); }); @@ -784,7 +784,7 @@ describe( verifyLargerScene( largeRectanglePrimitive, [255, 255, 255, 255], - largeRectangle + largeRectangle, ); }); }); @@ -798,7 +798,7 @@ describe( scene.invertClassificationColor = new Color(0.25, 0.25, 0.25, 1.0); rectangleInstance.attributes.show = new ShowGeometryInstanceAttribute( - true + true, ); primitive = new GroundPrimitive({ @@ -810,13 +810,14 @@ describe( const invertedColor = new Array(4); invertedColor[0] = Color.floatToByte( - Color.byteToFloat(depthColor[0]) * scene.invertClassificationColor.red + Color.byteToFloat(depthColor[0]) * scene.invertClassificationColor.red, ); invertedColor[1] = Color.floatToByte( - Color.byteToFloat(depthColor[1]) * scene.invertClassificationColor.green + Color.byteToFloat(depthColor[1]) * + scene.invertClassificationColor.green, ); invertedColor[2] = Color.floatToByte( - Color.byteToFloat(depthColor[2]) * scene.invertClassificationColor.blue + Color.byteToFloat(depthColor[2]) * scene.invertClassificationColor.blue, ); invertedColor[3] = 255; @@ -845,7 +846,7 @@ describe( scene.invertClassificationColor = new Color(0.25, 0.25, 0.25, 0.25); rectangleInstance.attributes.show = new ShowGeometryInstanceAttribute( - true + true, ); primitive = new GroundPrimitive({ @@ -859,17 +860,17 @@ describe( invertedColor[0] = Color.floatToByte( Color.byteToFloat(depthColor[0]) * scene.invertClassificationColor.red * - scene.invertClassificationColor.alpha + scene.invertClassificationColor.alpha, ); invertedColor[1] = Color.floatToByte( Color.byteToFloat(depthColor[1]) * scene.invertClassificationColor.green * - scene.invertClassificationColor.alpha + scene.invertClassificationColor.alpha, ); invertedColor[2] = Color.floatToByte( Color.byteToFloat(depthColor[2]) * scene.invertClassificationColor.blue * - scene.invertClassificationColor.alpha + scene.invertClassificationColor.alpha, ); invertedColor[3] = 255; @@ -977,7 +978,7 @@ describe( } rectangleInstance.attributes.show = new ShowGeometryInstanceAttribute( - true + true, ); primitive = new GroundPrimitive({ @@ -1016,7 +1017,7 @@ describe( const rect = Rectangle.fromDegrees(-1.0, -1.0, 1.0, 1.0); const rectColorAttribute = ColorGeometryInstanceAttribute.fromColor( - new Color(1.0, 1.0, 0.0, 1.0) + new Color(1.0, 1.0, 0.0, 1.0), ); const rectInstance = new GeometryInstance({ geometry: new RectangleGeometry({ @@ -1026,10 +1027,8 @@ describe( id: "rect", attributes: { color: rectColorAttribute, - distanceDisplayCondition: new DistanceDisplayConditionGeometryInstanceAttribute( - near, - far - ), + distanceDisplayCondition: + new DistanceDisplayConditionGeometryInstanceAttribute(near, far), }, }); @@ -1043,26 +1042,30 @@ describe( scene.camera.setView({ destination: rect }); scene.renderForSpecs(); - const boundingSphere = primitive.getGeometryInstanceAttributes("rect") - .boundingSphere; + const boundingSphere = + primitive.getGeometryInstanceAttributes("rect").boundingSphere; const center = boundingSphere.center; const radius = boundingSphere.radius; scene.camera.lookAt( center, - new HeadingPitchRange(0.0, -CesiumMath.PI_OVER_TWO, radius) + new HeadingPitchRange(0.0, -CesiumMath.PI_OVER_TWO, radius), ); expect(scene).toRender([0, 0, 255, 255]); scene.camera.lookAt( center, - new HeadingPitchRange(0.0, -CesiumMath.PI_OVER_TWO, radius + near + 1.0) + new HeadingPitchRange( + 0.0, + -CesiumMath.PI_OVER_TWO, + radius + near + 1.0, + ), ); expect(scene).notToRender([0, 0, 255, 255]); scene.camera.lookAt( center, - new HeadingPitchRange(0.0, -CesiumMath.PI_OVER_TWO, radius + far + 1.0) + new HeadingPitchRange(0.0, -CesiumMath.PI_OVER_TWO, radius + far + 1.0), ); expect(scene).toRender([0, 0, 255, 255]); }); @@ -1254,7 +1257,7 @@ describe( }); let rectColorAttribute = ColorGeometryInstanceAttribute.fromColor( - new Color(0.0, 1.0, 1.0, 1.0) + new Color(0.0, 1.0, 1.0, 1.0), ); const rectangleInstance1 = new GeometryInstance({ geometry: new RectangleGeometry({ @@ -1263,7 +1266,7 @@ describe( rectangle.west, rectangle.south, rectangle.east, - (rectangle.north + rectangle.south) * 0.5 + (rectangle.north + rectangle.south) * 0.5, ), }), id: "rectangle1", @@ -1272,7 +1275,7 @@ describe( }, }); rectColorAttribute = ColorGeometryInstanceAttribute.fromColor( - new Color(1.0, 1.0, 0.0, 1.0) + new Color(1.0, 1.0, 0.0, 1.0), ); const rectangleInstance2 = new GeometryInstance({ geometry: new RectangleGeometry({ @@ -1281,7 +1284,7 @@ describe( rectangle.west, (rectangle.north + rectangle.south) * 0.5, rectangle.east, - rectangle.north + rectangle.north, ), }), id: "rectangle2", @@ -1306,7 +1309,7 @@ describe( } const rectColorAttribute = ColorGeometryInstanceAttribute.fromColor( - new Color(0.0, 1.0, 1.0, 1.0) + new Color(0.0, 1.0, 1.0, 1.0), ); const rectangleInstance1 = new GeometryInstance({ geometry: new RectangleGeometry({ @@ -1315,7 +1318,7 @@ describe( rectangle.west, rectangle.south, rectangle.east, - (rectangle.north + rectangle.south) * 0.5 + (rectangle.north + rectangle.south) * 0.5, ), }), id: "rectangle1", @@ -1330,7 +1333,7 @@ describe( rectangle.west, (rectangle.north + rectangle.south) * 0.5, rectangle.east, - rectangle.north + rectangle.north, ), }), id: "rectangle2", @@ -1430,7 +1433,7 @@ describe( verifyGroundPrimitiveRender(primitive, rectColor); expect( - primitive.getGeometryInstanceAttributes("unknown") + primitive.getGeometryInstanceAttributes("unknown"), ).not.toBeDefined(); }); @@ -1511,5 +1514,5 @@ describe( ApproximateTerrainHeights._terrainHeights = terrainHeights; }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/GroupMetadataSpec.js b/packages/engine/Specs/Scene/GroupMetadataSpec.js index c5f3cd9cfcc7..883a28517d29 100644 --- a/packages/engine/Specs/Scene/GroupMetadataSpec.js +++ b/packages/engine/Specs/Scene/GroupMetadataSpec.js @@ -58,7 +58,7 @@ describe("Scene/GroupMetadata", function () { expect(groupMetadata.extras).toBe(extras); expect(groupMetadata.extensions).toBe(extensions); expect(groupMetadata.getProperty("position")).toEqual( - Cartesian3.unpack(properties.position) + Cartesian3.unpack(properties.position), ); }); diff --git a/packages/engine/Specs/Scene/HeightmapTessellatorSpec.js b/packages/engine/Specs/Scene/HeightmapTessellatorSpec.js index 06835f4d42a9..b773fa271203 100644 --- a/packages/engine/Specs/Scene/HeightmapTessellatorSpec.js +++ b/packages/engine/Specs/Scene/HeightmapTessellatorSpec.js @@ -102,18 +102,18 @@ describe("Scene/HeightmapTessellator", function () { vertices, heightmap, ellipsoid, - skirtHeight + skirtHeight, ) { let latitude = CesiumMath.lerp( nativeRectangle.north, nativeRectangle.south, - j / (height - 1) + j / (height - 1), ); latitude = CesiumMath.toRadians(latitude); let longitude = CesiumMath.lerp( nativeRectangle.west, nativeRectangle.east, - i / (width - 1) + i / (width - 1), ); longitude = CesiumMath.toRadians(longitude); @@ -133,18 +133,18 @@ describe("Scene/HeightmapTessellator", function () { const vertexPosition = new Cartesian3( vertices[index], vertices[index + 1], - vertices[index + 2] + vertices[index + 2], ); expect(vertexPosition).toEqualEpsilon(expectedVertexPosition, 1.0); expect(vertices[index + 3]).toEqual(heightSample); expect(vertices[index + 4]).toEqualEpsilon( i / (width - 1), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(vertices[index + 5]).toEqualEpsilon( 1.0 - j / (height - 1), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); } @@ -160,18 +160,18 @@ describe("Scene/HeightmapTessellator", function () { heightmap, ellipsoid, skirtHeight, - encoding + encoding, ) { let latitude = CesiumMath.lerp( nativeRectangle.north, nativeRectangle.south, - j / (height - 1) + j / (height - 1), ); latitude = CesiumMath.toRadians(latitude); let longitude = CesiumMath.lerp( nativeRectangle.west, nativeRectangle.east, - i / (width - 1) + i / (width - 1), ); longitude = CesiumMath.toRadians(longitude); @@ -189,7 +189,7 @@ describe("Scene/HeightmapTessellator", function () { expect(encoding.decodePosition(vertices, index)).toEqualEpsilon( expectedVertexPosition, - 1.0 + 1.0, ); } @@ -211,7 +211,7 @@ describe("Scene/HeightmapTessellator", function () { CesiumMath.toRadians(10.0), CesiumMath.toRadians(30.0), CesiumMath.toRadians(20.0), - CesiumMath.toRadians(40.0) + CesiumMath.toRadians(40.0), ), }; const results = HeightmapTessellator.computeVertices(options); @@ -235,7 +235,7 @@ describe("Scene/HeightmapTessellator", function () { vertices, options.heightmap, ellipsoid, - options.skirtHeight + options.skirtHeight, ); } } @@ -278,7 +278,7 @@ describe("Scene/HeightmapTessellator", function () { vertices, options.heightmap, ellipsoid, - options.skirtHeight + options.skirtHeight, ); } } @@ -298,7 +298,7 @@ describe("Scene/HeightmapTessellator", function () { vertices, options.heightmap, ellipsoid, - options.skirtHeight + options.skirtHeight, ); } @@ -315,7 +315,7 @@ describe("Scene/HeightmapTessellator", function () { vertices, options.heightmap, ellipsoid, - options.skirtHeight + options.skirtHeight, ); } @@ -332,7 +332,7 @@ describe("Scene/HeightmapTessellator", function () { vertices, options.heightmap, ellipsoid, - options.skirtHeight + options.skirtHeight, ); } @@ -349,7 +349,7 @@ describe("Scene/HeightmapTessellator", function () { vertices, options.heightmap, ellipsoid, - options.skirtHeight + options.skirtHeight, ); } }); @@ -392,7 +392,7 @@ describe("Scene/HeightmapTessellator", function () { options.heightmap, ellipsoid, options.skirtHeight, - results.encoding + results.encoding, ); } } @@ -413,7 +413,7 @@ describe("Scene/HeightmapTessellator", function () { options.heightmap, ellipsoid, options.skirtHeight, - results.encoding + results.encoding, ); } @@ -431,7 +431,7 @@ describe("Scene/HeightmapTessellator", function () { options.heightmap, ellipsoid, options.skirtHeight, - results.encoding + results.encoding, ); } @@ -449,7 +449,7 @@ describe("Scene/HeightmapTessellator", function () { options.heightmap, ellipsoid, options.skirtHeight, - results.encoding + results.encoding, ); } @@ -467,7 +467,7 @@ describe("Scene/HeightmapTessellator", function () { options.heightmap, ellipsoid, options.skirtHeight, - results.encoding + results.encoding, ); } }); @@ -496,23 +496,23 @@ describe("Scene/HeightmapTessellator", function () { const nativeRectangle = options.nativeRectangle; const geographicSouthwest = projection.unproject( - new Cartesian2(nativeRectangle.west, nativeRectangle.south) + new Cartesian2(nativeRectangle.west, nativeRectangle.south), ); const geographicNortheast = projection.unproject( - new Cartesian2(nativeRectangle.east, nativeRectangle.north) + new Cartesian2(nativeRectangle.east, nativeRectangle.north), ); for (let j = 0; j < height; ++j) { const y = CesiumMath.lerp( nativeRectangle.north, nativeRectangle.south, - j / (height - 1) + j / (height - 1), ); for (let i = 0; i < width; ++i) { const x = CesiumMath.lerp( nativeRectangle.west, nativeRectangle.east, - i / (width - 1) + i / (width - 1), ); const latLon = projection.unproject(new Cartesian2(x, y)); @@ -531,7 +531,7 @@ describe("Scene/HeightmapTessellator", function () { const vertexPosition = new Cartesian3( vertices[index], vertices[index + 1], - vertices[index + 2] + vertices[index + 2], ); const expectedU = @@ -545,11 +545,11 @@ describe("Scene/HeightmapTessellator", function () { expect(vertices[index + 3]).toEqual(heightSample); expect(vertices[index + 4]).toEqualEpsilon( expectedU, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(vertices[index + 5]).toEqualEpsilon( expectedV, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); } } @@ -560,33 +560,9 @@ describe("Scene/HeightmapTessellator", function () { const height = 3; const options = { heightmap: [ - 1.0, - 2.0, - 100.0, - 3.0, - 4.0, - 100.0, - 5.0, - 6.0, - 100.0, - 7.0, - 8.0, - 100.0, - 9.0, - 10.0, - 100.0, - 11.0, - 12.0, - 100.0, - 13.0, - 14.0, - 100.0, - 15.0, - 16.0, - 100.0, - 17.0, - 18.0, - 100.0, + 1.0, 2.0, 100.0, 3.0, 4.0, 100.0, 5.0, 6.0, 100.0, 7.0, 8.0, 100.0, 9.0, + 10.0, 100.0, 11.0, 12.0, 100.0, 13.0, 14.0, 100.0, 15.0, 16.0, 100.0, + 17.0, 18.0, 100.0, ], width: width, height: height, @@ -601,7 +577,7 @@ describe("Scene/HeightmapTessellator", function () { CesiumMath.toRadians(10.0), CesiumMath.toRadians(30.0), CesiumMath.toRadians(20.0), - CesiumMath.toRadians(40.0) + CesiumMath.toRadians(40.0), ), structure: { stride: 3, @@ -619,14 +595,14 @@ describe("Scene/HeightmapTessellator", function () { let latitude = CesiumMath.lerp( nativeRectangle.north, nativeRectangle.south, - j / (height - 1) + j / (height - 1), ); latitude = CesiumMath.toRadians(latitude); for (let i = 0; i < width; ++i) { let longitude = CesiumMath.lerp( nativeRectangle.west, nativeRectangle.east, - i / (width - 1) + i / (width - 1), ); longitude = CesiumMath.toRadians(longitude); @@ -645,18 +621,18 @@ describe("Scene/HeightmapTessellator", function () { const vertexPosition = new Cartesian3( vertices[index], vertices[index + 1], - vertices[index + 2] + vertices[index + 2], ); expect(vertexPosition).toEqualEpsilon(expectedVertexPosition, 1.0); expect(vertices[index + 3]).toEqual(heightSample); expect(vertices[index + 4]).toEqualEpsilon( i / (width - 1), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(vertices[index + 5]).toEqualEpsilon( 1.0 - j / (height - 1), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); } } @@ -667,33 +643,9 @@ describe("Scene/HeightmapTessellator", function () { const height = 3; const options = { heightmap: [ - 1.0, - 2.0, - 100.0, - 3.0, - 4.0, - 100.0, - 5.0, - 6.0, - 100.0, - 7.0, - 8.0, - 100.0, - 9.0, - 10.0, - 100.0, - 11.0, - 12.0, - 100.0, - 13.0, - 14.0, - 100.0, - 15.0, - 16.0, - 100.0, - 17.0, - 18.0, - 100.0, + 1.0, 2.0, 100.0, 3.0, 4.0, 100.0, 5.0, 6.0, 100.0, 7.0, 8.0, 100.0, 9.0, + 10.0, 100.0, 11.0, 12.0, 100.0, 13.0, 14.0, 100.0, 15.0, 16.0, 100.0, + 17.0, 18.0, 100.0, ], width: width, height: height, @@ -708,7 +660,7 @@ describe("Scene/HeightmapTessellator", function () { CesiumMath.toRadians(10.0), CesiumMath.toRadians(30.0), CesiumMath.toRadians(20.0), - CesiumMath.toRadians(40.0) + CesiumMath.toRadians(40.0), ), structure: { stride: 3, @@ -727,14 +679,14 @@ describe("Scene/HeightmapTessellator", function () { let latitude = CesiumMath.lerp( nativeRectangle.north, nativeRectangle.south, - j / (height - 1) + j / (height - 1), ); latitude = CesiumMath.toRadians(latitude); for (let i = 0; i < width; ++i) { let longitude = CesiumMath.lerp( nativeRectangle.west, nativeRectangle.east, - i / (width - 1) + i / (width - 1), ); longitude = CesiumMath.toRadians(longitude); @@ -753,18 +705,18 @@ describe("Scene/HeightmapTessellator", function () { const vertexPosition = new Cartesian3( vertices[index], vertices[index + 1], - vertices[index + 2] + vertices[index + 2], ); expect(vertexPosition).toEqualEpsilon(expectedVertexPosition, 1.0); expect(vertices[index + 3]).toEqual(heightSample); expect(vertices[index + 4]).toEqualEpsilon( i / (width - 1), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(vertices[index + 5]).toEqualEpsilon( 1.0 - j / (height - 1), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); } } diff --git a/packages/engine/Specs/Scene/I3SDataProviderSpec.js b/packages/engine/Specs/Scene/I3SDataProviderSpec.js index f1f1989d0bd4..52efa9ea37d2 100644 --- a/packages/engine/Specs/Scene/I3SDataProviderSpec.js +++ b/packages/engine/Specs/Scene/I3SDataProviderSpec.js @@ -289,7 +289,7 @@ describe("Scene/I3SDataProvider", function () { it("constructs I3SDataProvider with options", async function () { spyOn(Resource.prototype, "fetchJson").and.returnValue( - Promise.resolve(mockProviderData) + Promise.resolve(mockProviderData), ); spyOn(Cesium3DTileset, "fromUrl").and.callFake(async () => { const tileset = new Cesium3DTileset(); @@ -298,7 +298,7 @@ describe("Scene/I3SDataProvider", function () { }); const testProvider = await I3SDataProvider.fromUrl( "mockProviderUrl", - i3sOptions + i3sOptions, ); expect(testProvider.name).toEqual("testProvider"); @@ -328,7 +328,7 @@ describe("Scene/I3SDataProvider", function () { }); const testProvider = await I3SDataProvider.fromUrl( "mockProviderUrl", - i3sOptions + i3sOptions, ); expect(testProvider.name).toEqual("testProvider"); @@ -345,45 +345,45 @@ describe("Scene/I3SDataProvider", function () { expect(testProvider.sublayers[0].sublayers.length).toEqual(2); expect(testProvider.sublayers[0].sublayers[0].name).toEqual("Cat1"); expect(testProvider.sublayers[0].sublayers[0]._parent.name).toEqual( - "Full Model" + "Full Model", ); expect(testProvider.sublayers[0].sublayers[0]._parent.modelName).toEqual( - "FullModel" + "FullModel", ); expect(testProvider.sublayers[0].sublayers[1].name).toEqual("Cat2"); expect(testProvider.sublayers[0].sublayers[1]._parent.name).toEqual( - "Full Model" + "Full Model", ); expect(testProvider.sublayers[0].sublayers[1]._parent.modelName).toEqual( - "FullModel" + "FullModel", ); expect(testProvider.sublayers[0].sublayers[0].sublayers.length).toEqual(3); expect(testProvider.sublayers[0].sublayers[0].sublayers[0].name).toEqual( - "SubCat1" + "SubCat1", ); expect( - testProvider.sublayers[0].sublayers[0].sublayers[0].visibility + testProvider.sublayers[0].sublayers[0].sublayers[0].visibility, ).toEqual(false); expect( - testProvider.sublayers[0].sublayers[0].sublayers[0]._parent.name + testProvider.sublayers[0].sublayers[0].sublayers[0]._parent.name, ).toEqual("Cat1"); expect(testProvider.sublayers[0].sublayers[0].sublayers[1].name).toEqual( - "SubCat2" + "SubCat2", ); expect( - testProvider.sublayers[0].sublayers[0].sublayers[1].visibility + testProvider.sublayers[0].sublayers[0].sublayers[1].visibility, ).toEqual(true); expect( - testProvider.sublayers[0].sublayers[0].sublayers[1]._parent.name + testProvider.sublayers[0].sublayers[0].sublayers[1]._parent.name, ).toEqual("Cat1"); expect(testProvider.sublayers[0].sublayers[0].sublayers[2].name).toEqual( - "SubCat3" + "SubCat3", ); expect( - testProvider.sublayers[0].sublayers[0].sublayers[2].visibility + testProvider.sublayers[0].sublayers[0].sublayers[2].visibility, ).toEqual(true); expect( - testProvider.sublayers[0].sublayers[0].sublayers[2]._parent.name + testProvider.sublayers[0].sublayers[0].sublayers[2]._parent.name, ).toEqual("Cat1"); expect(testProvider.sublayers[0].sublayers[1].sublayers.length).toEqual(0); }); @@ -395,7 +395,7 @@ describe("Scene/I3SDataProvider", function () { layers: [mockLayerDataTextured], }; spyOn(Resource.prototype, "fetchJson").and.returnValue( - Promise.resolve(providerData) + Promise.resolve(providerData), ); spyOn(Cesium3DTileset, "fromUrl").and.callFake(async () => { const tileset = new Cesium3DTileset(); @@ -414,7 +414,7 @@ describe("Scene/I3SDataProvider", function () { it("default options for I3SDataProvider without textured layers", async function () { spyOn(Resource.prototype, "fetchJson").and.returnValue( - Promise.resolve(mockProviderData) + Promise.resolve(mockProviderData), ); spyOn(Cesium3DTileset, "fromUrl").and.callFake(async () => { const tileset = new Cesium3DTileset(); @@ -433,7 +433,7 @@ describe("Scene/I3SDataProvider", function () { it("manual options for I3SDataProvider without textured layers", async function () { spyOn(Resource.prototype, "fetchJson").and.returnValue( - Promise.resolve(mockProviderData) + Promise.resolve(mockProviderData), ); spyOn(Cesium3DTileset, "fromUrl").and.callFake(async () => { const tileset = new Cesium3DTileset(); @@ -526,7 +526,7 @@ describe("Scene/I3SDataProvider", function () { it("constructs I3SDataProvider with BSL without sublayers and statistics", async function () { spyOn(Resource.prototype, "fetchJson").and.returnValue( - Promise.resolve(mockBSLProviderData2) + Promise.resolve(mockBSLProviderData2), ); spyOn(Cesium3DTileset, "fromUrl").and.callFake(async () => { const tileset = new Cesium3DTileset(); @@ -535,7 +535,7 @@ describe("Scene/I3SDataProvider", function () { }); const testProvider = await I3SDataProvider.fromUrl( "mockProviderUrl", - i3sOptions + i3sOptions, ); expect(testProvider.sublayers.length).toEqual(0); @@ -544,7 +544,7 @@ describe("Scene/I3SDataProvider", function () { it("wraps update", async function () { spyOn(Resource.prototype, "fetchJson").and.returnValue( - Promise.resolve(mockProviderData) + Promise.resolve(mockProviderData), ); spyOn(Cesium3DTileset, "fromUrl").and.callFake(async () => { const tileset = new Cesium3DTileset(); @@ -563,16 +563,16 @@ describe("Scene/I3SDataProvider", function () { testProvider.update(frameState); expect(testProvider._layers[0]._tileset.update).toHaveBeenCalledWith( - frameState + frameState, ); expect(testProvider._layers[1]._tileset.update).toHaveBeenCalledWith( - frameState + frameState, ); }); it("wraps prePassesUpdate", async function () { spyOn(Resource.prototype, "fetchJson").and.returnValue( - Promise.resolve(mockProviderData) + Promise.resolve(mockProviderData), ); spyOn(Cesium3DTileset, "fromUrl").and.callFake(async () => { const tileset = new Cesium3DTileset(); @@ -591,16 +591,16 @@ describe("Scene/I3SDataProvider", function () { testProvider.prePassesUpdate(frameState); expect( - testProvider._layers[0]._tileset.prePassesUpdate + testProvider._layers[0]._tileset.prePassesUpdate, ).toHaveBeenCalledWith(frameState); expect( - testProvider._layers[1]._tileset.prePassesUpdate + testProvider._layers[1]._tileset.prePassesUpdate, ).toHaveBeenCalledWith(frameState); }); it("wraps postPassesUpdate", async function () { spyOn(Resource.prototype, "fetchJson").and.returnValue( - Promise.resolve(mockProviderData) + Promise.resolve(mockProviderData), ); spyOn(Cesium3DTileset, "fromUrl").and.callFake(async () => { const tileset = new Cesium3DTileset(); @@ -619,16 +619,16 @@ describe("Scene/I3SDataProvider", function () { testProvider.postPassesUpdate(frameState); expect( - testProvider._layers[0]._tileset.postPassesUpdate + testProvider._layers[0]._tileset.postPassesUpdate, ).toHaveBeenCalledWith(frameState); expect( - testProvider._layers[1]._tileset.postPassesUpdate + testProvider._layers[1]._tileset.postPassesUpdate, ).toHaveBeenCalledWith(frameState); }); it("wraps updateForPass", async function () { spyOn(Resource.prototype, "fetchJson").and.returnValue( - Promise.resolve(mockProviderData) + Promise.resolve(mockProviderData), ); spyOn(Cesium3DTileset, "fromUrl").and.callFake(async () => { const tileset = new Cesium3DTileset(); @@ -649,11 +649,11 @@ describe("Scene/I3SDataProvider", function () { expect(testProvider._layers[0]._tileset.updateForPass).toHaveBeenCalledWith( frameState, - passState + passState, ); expect(testProvider._layers[1]._tileset.updateForPass).toHaveBeenCalledWith( frameState, - passState + passState, ); }); @@ -668,7 +668,7 @@ describe("Scene/I3SDataProvider", function () { }); const testProvider = await I3SDataProvider.fromUrl( "mockProviderUrl", - i3sOptions + i3sOptions, ); // Function should not be called for tilesets that are not yet ready @@ -683,7 +683,7 @@ describe("Scene/I3SDataProvider", function () { it("isDestroyed returns false for new provider", async function () { spyOn(Resource.prototype, "fetchJson").and.returnValue( - Promise.resolve(mockProviderData) + Promise.resolve(mockProviderData), ); spyOn(Cesium3DTileset, "fromUrl").and.callFake(async () => { const tileset = new Cesium3DTileset(); @@ -700,7 +700,7 @@ describe("Scene/I3SDataProvider", function () { it("destroys provider", async function () { spyOn(Resource.prototype, "fetchJson").and.returnValue( - Promise.resolve(mockProviderData) + Promise.resolve(mockProviderData), ); spyOn(Cesium3DTileset, "fromUrl").and.callFake(async () => { const tileset = new Cesium3DTileset(); @@ -727,7 +727,7 @@ describe("Scene/I3SDataProvider", function () { const mockBinaryResponse = new ArrayBuffer(1); spyOn(Resource.prototype, "fetchJson").and.returnValue( - Promise.resolve(mockProviderData) + Promise.resolve(mockProviderData), ); spyOn(Cesium3DTileset, "fromUrl").and.callFake(async () => { const tileset = new Cesium3DTileset(); @@ -739,7 +739,7 @@ describe("Scene/I3SDataProvider", function () { }); spyOn(Resource.prototype, "fetchArrayBuffer").and.returnValue( - Promise.resolve(mockBinaryResponse) + Promise.resolve(mockBinaryResponse), ); const resource = Resource.createIfNeeded("mockBinaryUri"); @@ -751,7 +751,7 @@ describe("Scene/I3SDataProvider", function () { it("loads binary with invalid uri", async function () { spyOn(Resource.prototype, "fetchJson").and.returnValue( - Promise.resolve(mockProviderData) + Promise.resolve(mockProviderData), ); spyOn(Cesium3DTileset, "fromUrl").and.callFake(async () => { const tileset = new Cesium3DTileset(); @@ -775,13 +775,13 @@ describe("Scene/I3SDataProvider", function () { it("fromUrl throws without url ", async function () { await expectAsync( - I3SDataProvider.fromUrl() + I3SDataProvider.fromUrl(), ).toBeRejectedWithDeveloperError(); }); it("loads json", async function () { spyOn(Resource.prototype, "fetchJson").and.returnValue( - Promise.resolve(mockProviderData) + Promise.resolve(mockProviderData), ); spyOn(Cesium3DTileset, "fromUrl").and.callFake(async () => { const tileset = new Cesium3DTileset(); @@ -817,13 +817,13 @@ describe("Scene/I3SDataProvider", function () { }; spyOn(Resource.prototype, "fetchJson").and.returnValue( - Promise.resolve(mockErrorResponse) + Promise.resolve(mockErrorResponse), ); const resource = Resource.createIfNeeded("mockJsonUri"); await expectAsync(I3SDataProvider.loadJson(resource)).toBeRejectedWithError( RuntimeError, - mockErrorResponse.error + mockErrorResponse.error, ); }); @@ -833,19 +833,19 @@ describe("Scene/I3SDataProvider", function () { }; spyOn(Resource.prototype, "fetchJson").and.returnValue( - Promise.resolve(mockErrorResponse) + Promise.resolve(mockErrorResponse), ); const resource = Resource.createIfNeeded("mockJsonUri"); await expectAsync(I3SDataProvider.loadJson(resource)).toBeRejectedWithError( RuntimeError, - mockErrorResponse.error + mockErrorResponse.error, ); }); it("loads geoid data", async function () { spyOn(Resource.prototype, "fetchJson").and.returnValue( - Promise.resolve(mockProviderDataWithLargeExtent) + Promise.resolve(mockProviderDataWithLargeExtent), ); spyOn(Cesium3DTileset, "fromUrl").and.callFake(async () => { const tileset = new Cesium3DTileset(); @@ -862,20 +862,20 @@ describe("Scene/I3SDataProvider", function () { expect(testProvider._geoidDataList[0].height).toEqual(2); expect(testProvider._geoidDataList[0].width).toEqual(2); expect(testProvider._geoidDataList[0].buffer).toEqual( - new Float32Array([0, 1, 2, 3]) + new Float32Array([0, 1, 2, 3]), ); expect(testProvider._geoidDataList[1].height).toEqual(2); expect(testProvider._geoidDataList[1].width).toEqual(2); expect(testProvider._geoidDataList[1].buffer).toEqual( - new Float32Array([4, 5, 6, 7]) + new Float32Array([4, 5, 6, 7]), ); }); }); it("loadGeoidData resolves when no geoid provider is given", async function () { spyOn(Resource.prototype, "fetchJson").and.returnValue( - Promise.resolve(mockProviderData) + Promise.resolve(mockProviderData), ); spyOn(Cesium3DTileset, "fromUrl").and.callFake(async () => { const tileset = new Cesium3DTileset(); @@ -896,7 +896,7 @@ describe("Scene/I3SDataProvider", function () { const mockExtent2 = Rectangle.fromDegrees(3, 1, 4, 3); spyOn(Resource.prototype, "fetchJson").and.returnValue( - Promise.resolve(mockProviderData) + Promise.resolve(mockProviderData), ); spyOn(Cesium3DTileset, "fromUrl").and.callFake(async () => { const tileset = new Cesium3DTileset(); @@ -938,7 +938,7 @@ describe("Scene/I3SDataProvider", function () { expect(testProvider.layers.length).toEqual(2); expect(testProvider.layers[0].rootNode.tile).toBeDefined(); expect(testProvider.layers[0].rootNode.tile.i3sNode).toEqual( - testProvider.layers[0].rootNode + testProvider.layers[0].rootNode, ); // Expect geoid data to have been loaded @@ -946,7 +946,7 @@ describe("Scene/I3SDataProvider", function () { expect(testProvider._geoidDataList[0].height).toEqual(2); expect(testProvider._geoidDataList[0].width).toEqual(2); expect(testProvider._geoidDataList[0].buffer).toEqual( - new Float32Array([4, 5, 6, 7]) + new Float32Array([4, 5, 6, 7]), ); }); @@ -966,14 +966,14 @@ describe("Scene/I3SDataProvider", function () { { name: "testProvider", geoidTiledTerrainProvider: mockGeoidProvider, - } + }, ); // Layers have been populated and root node is loaded expect(testProvider.layers.length).toEqual(1); expect(testProvider.layers[0].rootNode.tile).toBeDefined(); expect(testProvider.layers[0].rootNode.tile.i3sNode).toEqual( - testProvider.layers[0].rootNode + testProvider.layers[0].rootNode, ); // Expect geoid data to have been loaded @@ -981,7 +981,7 @@ describe("Scene/I3SDataProvider", function () { expect(testProvider._geoidDataList[0].height).toEqual(2); expect(testProvider._geoidDataList[0].width).toEqual(2); expect(testProvider._geoidDataList[0].buffer).toEqual( - new Float32Array([4, 5, 6, 7]) + new Float32Array([4, 5, 6, 7]), ); }); @@ -1008,30 +1008,30 @@ describe("Scene/I3SDataProvider", function () { }); const testProvider = await I3SDataProvider.fromUrl( "mockProviderUrl", - i3sOptions + i3sOptions, ); expect(testProvider.sublayers[0].sublayers[0].sublayers[0].name).toEqual( - "SubCat1" + "SubCat1", ); expect( - testProvider.sublayers[0].sublayers[0].sublayers[0].visibility + testProvider.sublayers[0].sublayers[0].sublayers[0].visibility, ).toEqual(false); const spy = spyOn( testProvider.sublayers[0].sublayers[0].sublayers[0]._i3sLayers[0], - "_updateVisibility" + "_updateVisibility", ); testProvider.sublayers[0].sublayers[0].sublayers[0].visibility = false; expect( - testProvider.sublayers[0].sublayers[0].sublayers[0].visibility + testProvider.sublayers[0].sublayers[0].sublayers[0].visibility, ).toEqual(false); expect(spy).not.toHaveBeenCalled(); testProvider.sublayers[0].sublayers[0].sublayers[0].visibility = true; expect( - testProvider.sublayers[0].sublayers[0].sublayers[0].visibility + testProvider.sublayers[0].sublayers[0].sublayers[0].visibility, ).toEqual(true); expect(spy).toHaveBeenCalled(); }); @@ -1059,7 +1059,7 @@ describe("Scene/I3SDataProvider", function () { }); const testProvider = await I3SDataProvider.fromUrl( "mockProviderUrl/layers/0/", - i3sOptions + i3sOptions, ); const sublayers = testProvider.sublayers; @@ -1113,16 +1113,16 @@ describe("Scene/I3SDataProvider", function () { }); const testProvider = await I3SDataProvider.fromUrl( "mockProviderUrl", - i3sOptions + i3sOptions, ); expect( testProvider._attributeStatistics[0].resource.url.includes( - `${mockBuildingLayerData.statisticsHRef}/?` - ) + `${mockBuildingLayerData.statisticsHRef}/?`, + ), ).toEqual(true); expect(testProvider._attributeStatistics[0].data).toEqual( - mockStatisticsData + mockStatisticsData, ); const attributes = testProvider.getAttributeNames(); @@ -1137,7 +1137,7 @@ describe("Scene/I3SDataProvider", function () { expect(noValues).toEqual([]); const notExistingValues = testProvider.getAttributeValues( - "notExistingAttribute" + "notExistingAttribute", ); expect(notExistingValues).toEqual([]); }); diff --git a/packages/engine/Specs/Scene/I3SDecoderSpec.js b/packages/engine/Specs/Scene/I3SDecoderSpec.js index feeec5984ae6..52e3c3b6788f 100644 --- a/packages/engine/Specs/Scene/I3SDecoderSpec.js +++ b/packages/engine/Specs/Scene/I3SDecoderSpec.js @@ -53,22 +53,22 @@ describe("Scene/I3SDecoder", function () { it("throws with no default geometry schema", async function () { await expectAsync( - I3SDecoder.decode("mockUrl") + I3SDecoder.decode("mockUrl"), ).toBeRejectedWithDeveloperError(); }); it("throws with no geometry data", async function () { await expectAsync( - I3SDecoder.decode("mockUrl", defaultGeometrySchema) + I3SDecoder.decode("mockUrl", defaultGeometrySchema), ).toBeRejectedWithDeveloperError(); }); it("throws if not initialized", async function () { spyOn(TaskProcessor.prototype, "initWebAssemblyModule").and.returnValue( - Promise.resolve(false) + Promise.resolve(false), ); await expectAsync( - I3SDecoder.decode("mockUrl", defaultGeometrySchema, geometryDataObb) + I3SDecoder.decode("mockUrl", defaultGeometrySchema, geometryDataObb), ).toBeRejectedWithError(RuntimeError); }); @@ -76,7 +76,7 @@ describe("Scene/I3SDecoder", function () { const result = await I3SDecoder.decode( "mockUrl", defaultGeometrySchema, - geometryDataObb + geometryDataObb, ); expect(result).toBeDefined(); expect(result.meshData).toBeDefined(); @@ -98,7 +98,7 @@ describe("Scene/I3SDecoder", function () { const result = await I3SDecoder.decode( "mockUrl", defaultGeometrySchema, - geometryDataMbs + geometryDataMbs, ); expect(result).toBeDefined(); expect(result.meshData).toBeDefined(); @@ -121,7 +121,7 @@ describe("Scene/I3SDecoder", function () { "mockUrl", defaultGeometrySchema, geometryDataMbs, - featureData + featureData, ); expect(result).toBeDefined(); expect(result.meshData).toBeDefined(); diff --git a/packages/engine/Specs/Scene/I3SFieldSpec.js b/packages/engine/Specs/Scene/I3SFieldSpec.js index e74abfd4cae8..2d1031b287d9 100644 --- a/packages/engine/Specs/Scene/I3SFieldSpec.js +++ b/packages/engine/Specs/Scene/I3SFieldSpec.js @@ -10,7 +10,7 @@ import { describe("Scene/I3SField", function () { async function createMockProvider(url, layerData, geoidDataList) { spyOn(Resource.prototype, "fetchJson").and.returnValue( - Promise.resolve(layerData) + Promise.resolve(layerData), ); spyOn(Cesium3DTileset, "fromUrl").and.callFake(async () => { const tileset = new Cesium3DTileset(); @@ -28,7 +28,7 @@ describe("Scene/I3SField", function () { const provider = await createMockProvider( providerUrl, layerData, - geoidDataList + geoidDataList, ); const mockI3SLayer = provider.layers[0]; mockI3SLayer._geometryDefinitions = [ @@ -181,20 +181,20 @@ describe("Scene/I3SField", function () { it("create field for root node loaded from uri", async function () { const mockI3SLayerWithoutNodePages = await createMockLayer( "mockProviderUrl", - layerDataWithoutNodePages + layerDataWithoutNodePages, ); const rootNode = new I3SNode(mockI3SLayerWithoutNodePages, "mockUrl", true); const field = new I3SField(rootNode, { key: "test_key" }); expect( - field.resource.url.includes("mockUrl/attributes/test_key/0?") + field.resource.url.includes("mockUrl/attributes/test_key/0?"), ).toEqual(true); }); it("get field values", async function () { const mockI3SLayerWithoutNodePages = await createMockLayer( "mockProviderUrl", - layerDataWithoutNodePages + layerDataWithoutNodePages, ); const rootNode = new I3SNode(mockI3SLayerWithoutNodePages, "mockUrl", true); @@ -211,7 +211,7 @@ describe("Scene/I3SField", function () { it("get body offset for objectIds", async function () { const mockI3SLayerWithoutNodePages = await createMockLayer( "mockProviderUrl", - layerDataWithoutNodePages + layerDataWithoutNodePages, ); const rootNode = new I3SNode(mockI3SLayerWithoutNodePages, "mockUrl", true); @@ -225,7 +225,7 @@ describe("Scene/I3SField", function () { it("get body offset for unsupported property", async function () { const mockI3SLayerWithoutNodePages = await createMockLayer( "mockProviderUrl", - layerDataWithoutNodePages + layerDataWithoutNodePages, ); const rootNode = new I3SNode(mockI3SLayerWithoutNodePages, "mockUrl", true); @@ -239,7 +239,7 @@ describe("Scene/I3SField", function () { it("validate field header with invalid attribute buffer size", async function () { const mockI3SLayerWithoutNodePages = await createMockLayer( "mockProviderUrl", - layerDataWithoutNodePages + layerDataWithoutNodePages, ); const rootNode = new I3SNode(mockI3SLayerWithoutNodePages, "mockUrl", true); @@ -254,7 +254,7 @@ describe("Scene/I3SField", function () { it("validate field body with empty header", async function () { const mockI3SLayerWithoutNodePages = await createMockLayer( "mockProviderUrl", - layerDataWithoutNodePages + layerDataWithoutNodePages, ); const rootNode = new I3SNode(mockI3SLayerWithoutNodePages, "mockUrl", true); @@ -269,7 +269,7 @@ describe("Scene/I3SField", function () { it("validate field body with invalid attribute buffer", async function () { const mockI3SLayerWithoutNodePages = await createMockLayer( "mockProviderUrl", - layerDataWithoutNodePages + layerDataWithoutNodePages, ); const rootNode = new I3SNode(mockI3SLayerWithoutNodePages, "mockUrl", true); @@ -287,7 +287,7 @@ describe("Scene/I3SField", function () { it("validate field body with invalid offset", async function () { const mockI3SLayerWithoutNodePages = await createMockLayer( "mockProviderUrl", - layerDataWithoutNodePages + layerDataWithoutNodePages, ); const rootNode = new I3SNode(mockI3SLayerWithoutNodePages, "mockUrl", true); @@ -302,7 +302,7 @@ describe("Scene/I3SField", function () { it("validate field body with missing property", async function () { const mockI3SLayerWithoutNodePages = await createMockLayer( "mockProviderUrl", - layerDataWithoutNodePages + layerDataWithoutNodePages, ); const rootNode = new I3SNode(mockI3SLayerWithoutNodePages, "mockUrl", true); @@ -317,7 +317,7 @@ describe("Scene/I3SField", function () { it("load field with unavailable resource", async function () { const mockI3SLayerWithoutNodePages = await createMockLayer( "mockProviderUrl", - layerDataWithoutNodePages + layerDataWithoutNodePages, ); const spy = spyOn(Resource.prototype, "fetchArrayBuffer"); spy.and.callFake(function () { @@ -343,11 +343,11 @@ describe("Scene/I3SField", function () { it("load field with invalid header", async function () { const mockI3SLayerWithoutNodePages = await createMockLayer( "mockProviderUrl", - layerDataWithoutNodePages + layerDataWithoutNodePages, ); spyOn( mockI3SLayerWithoutNodePages._dataProvider, - "_loadBinary" + "_loadBinary", ).and.callFake(function () { return Promise.resolve(new ArrayBuffer(1)); }); @@ -364,11 +364,11 @@ describe("Scene/I3SField", function () { it("load field with invalid body", async function () { const mockI3SLayerWithoutNodePages = await createMockLayer( "mockProviderUrl", - layerDataWithoutNodePages + layerDataWithoutNodePages, ); spyOn( mockI3SLayerWithoutNodePages._dataProvider, - "_loadBinary" + "_loadBinary", ).and.callFake(function () { return Promise.resolve(new ArrayBuffer(1)); }); @@ -386,12 +386,12 @@ describe("Scene/I3SField", function () { it("load field with valid buffer", async function () { const mockI3SLayerWithoutNodePages = await createMockLayer( "mockProviderUrl", - layerDataWithoutNodePages + layerDataWithoutNodePages, ); const text = "Pass"; spyOn( mockI3SLayerWithoutNodePages._dataProvider, - "_loadBinary" + "_loadBinary", ).and.callFake(function () { const buffer = new ArrayBuffer(text.length + 3); const view = new Uint8Array(buffer); diff --git a/packages/engine/Specs/Scene/I3SLayerSpec.js b/packages/engine/Specs/Scene/I3SLayerSpec.js index c5832c28f3ba..41aab81626af 100644 --- a/packages/engine/Specs/Scene/I3SLayerSpec.js +++ b/packages/engine/Specs/Scene/I3SLayerSpec.js @@ -115,7 +115,7 @@ describe("Scene/I3SLayer", function () { async function createMockI3SProvider(layerData, options) { spyOn(I3SDataProvider, "loadJson").and.returnValue( - Promise.resolve(layerData) + Promise.resolve(layerData), ); spyOn(Cesium3DTileset, "fromUrl").and.callFake(async (url, options) => { const tileset = new Cesium3DTileset(options); @@ -125,17 +125,17 @@ describe("Scene/I3SLayer", function () { }); const mockI3SProvider = await I3SDataProvider.fromUrl( "mockProviderUrl?testQuery=test", - options + options, ); spyOn(I3SDataProvider.prototype, "loadGeoidData").and.returnValue( - Promise.resolve() + Promise.resolve(), ); return mockI3SProvider; } it("constructs I3SLayer from url", async function () { spyOn(I3SLayer.prototype, "_loadNodePage").and.returnValue( - Promise.resolve(nodePageResult) + Promise.resolve(nodePageResult), ); const mockI3SProvider = await createMockI3SProvider(layerData); @@ -202,14 +202,14 @@ describe("Scene/I3SLayer", function () { it("constructs I3SLayer from id", async function () { spyOn(I3SLayer.prototype, "_loadNodePage").and.returnValue( - Promise.resolve(nodePageResult) + Promise.resolve(nodePageResult), ); const mockI3SProvider = await createMockI3SProvider(layerData2); const testLayer = new I3SLayer( mockI3SProvider, layerData2, - mockI3SProvider + mockI3SProvider, ); expect(testLayer.data).toEqual(layerData2); @@ -237,7 +237,7 @@ describe("Scene/I3SLayer", function () { it("constructs I3SLayer from single layer url", async function () { spyOn(I3SLayer.prototype, "_loadNodePage").and.returnValue( - Promise.resolve(nodePageResult) + Promise.resolve(nodePageResult), ); const mockI3SProvider = await createMockI3SProvider(layerData2); @@ -253,7 +253,7 @@ describe("Scene/I3SLayer", function () { it("loads root node", async function () { spyOn(Resource.prototype, "fetchJson").and.returnValue( - Promise.resolve(nodePageResult) + Promise.resolve(nodePageResult), ); const mockI3SProvider = await createMockI3SProvider(layerData); @@ -261,14 +261,14 @@ describe("Scene/I3SLayer", function () { expect(testLayer.rootNode).toBeDefined(); expect(testLayer.rootNode.data.index).toEqual(rootNodePageEntry.index); expect(testLayer.rootNode.data.children).toEqual( - rootNodePageEntry.children + rootNodePageEntry.children, ); expect(testLayer.rootNode.data.obb).toEqual(rootNodePageEntry.obb); }); it("creates 3d tileset", async function () { spyOn(I3SLayer.prototype, "_loadNodePage").and.returnValue( - Promise.resolve(nodePageResult) + Promise.resolve(nodePageResult), ); const mockI3SProvider = await createMockI3SProvider(layerData); @@ -288,7 +288,7 @@ describe("Scene/I3SLayer", function () { maximumScreenSpaceError: 8, }; spyOn(I3SLayer.prototype, "_loadNodePage").and.returnValue( - Promise.resolve(nodePageResult) + Promise.resolve(nodePageResult), ); await createMockI3SProvider(layerData, { @@ -296,13 +296,13 @@ describe("Scene/I3SLayer", function () { }); expect(Cesium3DTileset.fromUrl).toHaveBeenCalledWith( jasmine.any(String), - cesium3dTilesetOptions + cesium3dTilesetOptions, ); }); it("load i3s layer rejects unsupported spatial reference", async function () { spyOn(I3SLayer.prototype, "_loadNodePage").and.returnValue( - Promise.resolve(nodePageResult) + Promise.resolve(nodePageResult), ); const invalidLayerData = { layerType: "3DObject", @@ -319,16 +319,16 @@ describe("Scene/I3SLayer", function () { spatialReference: { wkid: 3857 }, }; await expectAsync( - createMockI3SProvider(invalidLayerData) + createMockI3SProvider(invalidLayerData), ).toBeRejectedWithError( RuntimeError, - `Unsupported spatial reference: ${invalidLayerData.spatialReference.wkid}` + `Unsupported spatial reference: ${invalidLayerData.spatialReference.wkid}`, ); }); it("creates 3d tileset with outline color from symbology", async function () { spyOn(I3SLayer.prototype, "_loadNodePage").and.returnValue( - Promise.resolve(nodePageResult) + Promise.resolve(nodePageResult), ); const mockI3SProvider = await createMockI3SProvider(layerData2, { @@ -349,7 +349,7 @@ describe("Scene/I3SLayer", function () { outlineColor: new Color(0.5, 0.5, 0.5, 0.5), }; spyOn(I3SLayer.prototype, "_loadNodePage").and.returnValue( - Promise.resolve(nodePageResult) + Promise.resolve(nodePageResult), ); const mockI3SProvider = await createMockI3SProvider(layerData2, { diff --git a/packages/engine/Specs/Scene/I3SNodeSpec.js b/packages/engine/Specs/Scene/I3SNodeSpec.js index f7cc79df1263..8cdf6e51e6a2 100644 --- a/packages/engine/Specs/Scene/I3SNodeSpec.js +++ b/packages/engine/Specs/Scene/I3SNodeSpec.js @@ -30,11 +30,11 @@ describe("Scene/I3SNode", function () { -20037508.342787e7, -20037508.342787e7, 20037508.342787e7, - 20037508.342787e7 + 20037508.342787e7, ), offset: 0, projection: new WebMercatorProjection( - new Ellipsoid(6378137, 6378137, 6356752.314245179) + new Ellipsoid(6378137, 6378137, 6356752.314245179), ), projectionType: "WebMercator", scale: 1, @@ -370,7 +370,7 @@ describe("Scene/I3SNode", function () { async function createMockProvider(url, layerData, geoidDataList, options) { spyOn(Resource.prototype, "fetchJson").and.returnValue( - Promise.resolve(layerData) + Promise.resolve(layerData), ); spyOn(Cesium3DTileset, "fromUrl").and.callFake(async () => { const tileset = new Cesium3DTileset(); @@ -387,13 +387,13 @@ describe("Scene/I3SNode", function () { providerUrl, layerData, geoidDataList, - options + options, ) { const provider = await createMockProvider( providerUrl, layerData, geoidDataList, - options + options, ); const mockI3SLayer = provider.layers[0]; mockI3SLayer._geometryDefinitions = [ @@ -420,15 +420,15 @@ describe("Scene/I3SNode", function () { it("constructs nodes", async function () { const mockI3SLayerWithoutNodePages = await createMockLayer( "mockProviderUrl", - layerDataWithoutNodePages + layerDataWithoutNodePages, ); const rootNode = new I3SNode( mockI3SLayerWithoutNodePages, "mockRootUrl", - true + true, ); expect(rootNode.resource.url).toContain( - "mockProviderUrl/mockLayerUrl/mockRootUrl/" + "mockProviderUrl/mockLayerUrl/mockRootUrl/", ); expect(rootNode.parent).toEqual(mockI3SLayerWithoutNodePages); expect(rootNode.layer).toEqual(mockI3SLayerWithoutNodePages); @@ -444,74 +444,23 @@ describe("Scene/I3SNode", function () { const customAttributes = { cartesianCenter: Ellipsoid.WGS84.cartographicToCartesian( - new Cartographic(-90, 45, 0) + new Cartographic(-90, 45, 0), ), featureIndex: new Uint32Array([0, 0, 1, 1]), positions: new Float32Array([ - -20, - -20, - 0, - 20, - 0, - 0, - -20, - 0, - 0, - -20, - -20, - 0, - 20, - -20, - 0, - 20, - 0, - 0, - -20, - 0, - 0, - 20, - 20, - 0, - -20, - 20, - 0, - -20, - 0, - 0, - 20, - 0, - 0, - 20, - 20, - 0, + -20, -20, 0, 20, 0, 0, -20, 0, 0, -20, -20, 0, 20, -20, 0, 20, 0, 0, -20, + 0, 0, 20, 20, 0, -20, 20, 0, -20, 0, 0, 20, 0, 0, 20, 20, 0, ]), parentRotation: [1, 0, 0, 0, 1, 0, 0, 0, 1], }; const customAttributesIndexed = { cartesianCenter: Ellipsoid.WGS84.cartographicToCartesian( - new Cartographic(-90, 45, 0) + new Cartographic(-90, 45, 0), ), featureIndex: new Uint32Array([0, 0, 1, 1]), indices: new Uint32Array([0, 1, 2, 0, 3, 1, 2, 4, 5, 2, 1, 4]), positions: new Float32Array([ - -20, - -20, - 0, - 20, - 0, - 0, - -20, - 0, - 0, - 20, - -20, - 0, - 20, - 20, - 0, - -20, - 20, - 0, + -20, -20, 0, 20, 0, 0, -20, 0, 0, 20, -20, 0, 20, 20, 0, -20, 20, 0, ]), parentRotation: [1, 0, 0, 0, 1, 0, 0, 0, 1], }; @@ -521,25 +470,25 @@ describe("Scene/I3SNode", function () { const intersectPoint = new Cartesian3( -19 + customAttributes.cartesianCenter.x, -19 + customAttributes.cartesianCenter.y, - 0 + customAttributes.cartesianCenter.z + 0 + customAttributes.cartesianCenter.z, ); // On triangle edge const borderPoint = new Cartesian3( 20 + customAttributes.cartesianCenter.x, 15 + customAttributes.cartesianCenter.y, - 0 + customAttributes.cartesianCenter.z + 0 + customAttributes.cartesianCenter.z, ); // Above triangle const floatingIntersectPoint = new Cartesian3( -19 + customAttributes.cartesianCenter.x, 19 + customAttributes.cartesianCenter.y, - 2 + customAttributes.cartesianCenter.z + 2 + customAttributes.cartesianCenter.z, ); // No intersection const noIntersectPoint = new Cartesian3( -21 + customAttributes.cartesianCenter.x, -21 + customAttributes.cartesianCenter.y, - 0 + customAttributes.cartesianCenter.z + 0 + customAttributes.cartesianCenter.z, ); const i3sGeometryData = { @@ -634,12 +583,12 @@ describe("Scene/I3SNode", function () { it("loads root node from uri", async function () { const mockI3SLayerWithoutNodePages = await createMockLayer( "mockProviderUrl", - layerDataWithoutNodePages + layerDataWithoutNodePages, ); const rootNode = new I3SNode(mockI3SLayerWithoutNodePages, "mockUrl", true); const spy = spyOn(I3SDataProvider, "loadJson").and.returnValue( - Promise.resolve(rootNodeWithChildren) + Promise.resolve(rootNodeWithChildren), ); return rootNode.load().then(function () { @@ -651,12 +600,12 @@ describe("Scene/I3SNode", function () { it("loads child node from uri", async function () { const mockI3SLayerWithoutNodePages = await createMockLayer( "mockProviderUrl", - layerDataWithoutNodePages + layerDataWithoutNodePages, ); const rootNode = new I3SNode(mockI3SLayerWithoutNodePages, "mockUrl", true); const childNode = new I3SNode(rootNode, "mockUrlChild", false); const spy = spyOn(I3SDataProvider, "loadJson").and.returnValue( - Promise.resolve(nodeWithContent) + Promise.resolve(nodeWithContent), ); return rootNode @@ -674,12 +623,12 @@ describe("Scene/I3SNode", function () { it("loads root from node pages", async function () { spyOn(I3SLayer.prototype, "_loadNodePage").and.returnValue( - Promise.resolve(nodeData) + Promise.resolve(nodeData), ); const mockI3SLayerWithNodePages = await createMockLayer( "mockProviderUrl?testQuery=test", - layerData + layerData, ); const rootNode = new I3SNode(mockI3SLayerWithNodePages, 0, true); @@ -691,12 +640,12 @@ describe("Scene/I3SNode", function () { it("loads node from node pages", async function () { spyOn(I3SLayer.prototype, "_loadNodePage").and.returnValue( - Promise.resolve(nodeData) + Promise.resolve(nodeData), ); const mockI3SLayerWithNodePages = await createMockLayer( "mockProviderUrl?testQuery=test", - layerData + layerData, ); const rootNode = new I3SNode(mockI3SLayerWithNodePages, 0, true); const childNode = new I3SNode(rootNode, 1, false); @@ -714,13 +663,13 @@ describe("Scene/I3SNode", function () { it("loads node with geoid conversion", async function () { spyOn(I3SLayer.prototype, "_loadNodePage").and.returnValue( - Promise.resolve(nodeData) + Promise.resolve(nodeData), ); const mockI3SLayerGeoid = await createMockLayer( "mockProviderUrl?testQuery=test", layerData, - geoidDataList + geoidDataList, ); const rootNode = new I3SNode(mockI3SLayerGeoid, 0, true); const childNode = new I3SNode(rootNode, 1, false); @@ -737,42 +686,41 @@ describe("Scene/I3SNode", function () { const nodeOrigin = new Cartesian3( childNode._globalTransform[3], childNode._globalTransform[7], - childNode._globalTransform[11] - ); - const cartographicOrigin = Ellipsoid.WGS84.cartesianToCartographic( - nodeOrigin + childNode._globalTransform[11], ); + const cartographicOrigin = + Ellipsoid.WGS84.cartesianToCartographic(nodeOrigin); const expectedHeight = 10; const expectedPosition = new Cartographic( CesiumMath.toRadians(-90), CesiumMath.toRadians(45), - expectedHeight + expectedHeight, ); expect(cartographicOrigin.longitude).toBeCloseTo( expectedPosition.longitude, - -3 + -3, ); expect(cartographicOrigin.latitude).toBeCloseTo( expectedPosition.latitude, - -3 + -3, ); expect(cartographicOrigin.height).toBeCloseTo( expectedPosition.height, - -3 + -3, ); }); }); it("loads children", async function () { spyOn(I3SLayer.prototype, "_loadNodePage").and.returnValue( - Promise.resolve(nodeData) + Promise.resolve(nodeData), ); const mockI3SLayerWithNodePages = await createMockLayer( "mockProviderUrl?testQuery=test", - layerData + layerData, ); const rootNode = new I3SNode(mockI3SLayerWithNodePages, 0, true); @@ -800,12 +748,12 @@ describe("Scene/I3SNode", function () { it("loads children for leaf node", async function () { spyOn(I3SLayer.prototype, "_loadNodePage").and.returnValue( - Promise.resolve(nodeData) + Promise.resolve(nodeData), ); const mockI3SLayerWithNodePages = await createMockLayer( "mockProviderUrl?testQuery=test", - layerData + layerData, ); const nodeWithoutChildren = new I3SNode(mockI3SLayerWithNodePages, 1, true); @@ -822,49 +770,49 @@ describe("Scene/I3SNode", function () { it("loads not existing fields", async function () { spyOn(I3SLayer.prototype, "_loadNodePage").and.returnValue( - Promise.resolve(nodeData) + Promise.resolve(nodeData), ); const mockI3SLayerWithNodePages = await createMockLayer( "mockProviderUrl?testQuery=test", - layerData + layerData, ); const rootNode = new I3SNode(mockI3SLayerWithNodePages, 1, true); - spyOn(rootNode._dataProvider, "_loadBinary").and.callFake(function ( - resource - ) { - return new Promise(function (resolve, reject) { - let resultBuffer = ""; - if (resource.url.includes("f_0/") || resource.url.includes("f_1/")) { - resultBuffer = int8AttrBufferBase64; - } else if ( - resource.url.includes("f_2/") || - resource.url.includes("f_3/") - ) { - resultBuffer = int16AttrBufferBase64; - } else if ( - resource.url.includes("f_4/") || - resource.url.includes("f_5/") || - resource.url.includes("f_6/") - ) { - resultBuffer = int32AttrBufferBase64; - } else if ( - resource.url.includes("f_7/") || - resource.url.includes("f_8/") - ) { - resultBuffer = int64AttrBufferBase64; - } else if (resource.url.includes("f_9/")) { - resultBuffer = float32AttrBufferBase64; - } else if (resource.url.includes("f_10/")) { - resultBuffer = float64AttrBufferBase64; - } else if (resource.url.includes("f_11/")) { - resultBuffer = stringAttrBufferBase64; - } + spyOn(rootNode._dataProvider, "_loadBinary").and.callFake( + function (resource) { + return new Promise(function (resolve, reject) { + let resultBuffer = ""; + if (resource.url.includes("f_0/") || resource.url.includes("f_1/")) { + resultBuffer = int8AttrBufferBase64; + } else if ( + resource.url.includes("f_2/") || + resource.url.includes("f_3/") + ) { + resultBuffer = int16AttrBufferBase64; + } else if ( + resource.url.includes("f_4/") || + resource.url.includes("f_5/") || + resource.url.includes("f_6/") + ) { + resultBuffer = int32AttrBufferBase64; + } else if ( + resource.url.includes("f_7/") || + resource.url.includes("f_8/") + ) { + resultBuffer = int64AttrBufferBase64; + } else if (resource.url.includes("f_9/")) { + resultBuffer = float32AttrBufferBase64; + } else if (resource.url.includes("f_10/")) { + resultBuffer = float64AttrBufferBase64; + } else if (resource.url.includes("f_11/")) { + resultBuffer = stringAttrBufferBase64; + } - resolve(base64ToArrayBuffer(resultBuffer)); - }); - }); + resolve(base64ToArrayBuffer(resultBuffer)); + }); + }, + ); return rootNode .load() @@ -874,10 +822,10 @@ describe("Scene/I3SNode", function () { .then(function () { expect(rootNode.fields.testInt8.name).toEqual("testInt8"); expect(rootNode.fields.testInt8.resource.url).toContain( - "mockProviderUrl/mockLayerUrl/nodes/1/attributes/f_1/0" + "mockProviderUrl/mockLayerUrl/nodes/1/attributes/f_1/0", ); expect( - rootNode.fields.testInt8.resource.queryParameters.testQuery + rootNode.fields.testInt8.resource.queryParameters.testQuery, ).toEqual("test"); expect(rootNode.fields.testInt8.header.count).toEqual(2); @@ -897,7 +845,7 @@ describe("Scene/I3SNode", function () { expect(rootNode.fields.testString.header.count).toEqual(2); expect( - rootNode.fields.testString.header.attributeValuesByteCount + rootNode.fields.testString.header.attributeValuesByteCount, ).toEqual(16); const featureFields0 = rootNode.getFieldsForFeature(0); @@ -926,11 +874,11 @@ describe("Scene/I3SNode", function () { it("loads existing fields", async function () { spyOn(I3SLayer.prototype, "_loadNodePage").and.returnValue( - Promise.resolve(nodeData) + Promise.resolve(nodeData), ); spyOn(I3SField.prototype, "load").and.returnValue( - Promise.resolve({ mockResult: "success" }) + Promise.resolve({ mockResult: "success" }), ); const mockLayerData = clone(layerData, true); @@ -938,7 +886,7 @@ describe("Scene/I3SNode", function () { const mockI3SLayerWithNodePages = await createMockLayer( "mockProviderUrl?testQuery=test", - mockLayerData + mockLayerData, ); const rootNode = new I3SNode(mockI3SLayerWithNodePages, 1, true); rootNode._data = { @@ -955,7 +903,7 @@ describe("Scene/I3SNode", function () { it("loads existing fields without storageInfo", async function () { spyOn(I3SLayer.prototype, "_loadNodePage").and.returnValue( - Promise.resolve(nodeData) + Promise.resolve(nodeData), ); const mockLayerData = clone(layerData, true); @@ -963,7 +911,7 @@ describe("Scene/I3SNode", function () { const mockI3SLayerWithNodePages = await createMockLayer( "mockProviderUrl?testQuery=test", - mockLayerData + mockLayerData, ); const rootNode = new I3SNode(mockI3SLayerWithNodePages, 1, true); @@ -974,11 +922,11 @@ describe("Scene/I3SNode", function () { it("loads existing field", async function () { spyOn(I3SLayer.prototype, "_loadNodePage").and.returnValue( - Promise.resolve(nodeData) + Promise.resolve(nodeData), ); spyOn(I3SField.prototype, "load").and.returnValue( - Promise.resolve({ mockResult: "success" }) + Promise.resolve({ mockResult: "success" }), ); const mockLayerData = clone(layerData, true); @@ -986,7 +934,7 @@ describe("Scene/I3SNode", function () { const mockI3SLayerWithNodePages = await createMockLayer( "mockProviderUrl?testQuery=test", - mockLayerData + mockLayerData, ); const rootNode = new I3SNode(mockI3SLayerWithNodePages, 1, true); rootNode._data = { @@ -1003,7 +951,7 @@ describe("Scene/I3SNode", function () { it("loads not existing field without storageInfo for the layer", async function () { spyOn(I3SLayer.prototype, "_loadNodePage").and.returnValue( - Promise.resolve(nodeData) + Promise.resolve(nodeData), ); const mockLayerData = clone(layerData, true); @@ -1011,7 +959,7 @@ describe("Scene/I3SNode", function () { const mockI3SLayerWithNodePages = await createMockLayer( "mockProviderUrl?testQuery=test", - mockLayerData + mockLayerData, ); const rootNode = new I3SNode(mockI3SLayerWithNodePages, 1, true); @@ -1022,7 +970,7 @@ describe("Scene/I3SNode", function () { it("loads not existing field without storageInfo for the field", async function () { spyOn(I3SLayer.prototype, "_loadNodePage").and.returnValue( - Promise.resolve(nodeData) + Promise.resolve(nodeData), ); const mockLayerData = clone(layerData, true); @@ -1030,7 +978,7 @@ describe("Scene/I3SNode", function () { const mockI3SLayerWithNodePages = await createMockLayer( "mockProviderUrl?testQuery=test", - mockLayerData + mockLayerData, ); const rootNode = new I3SNode(mockI3SLayerWithNodePages, 1, true); @@ -1041,17 +989,17 @@ describe("Scene/I3SNode", function () { it("loads geometry from node pages", async function () { spyOn(I3SLayer.prototype, "_loadNodePage").and.returnValue( - Promise.resolve(nodeData) + Promise.resolve(nodeData), ); const mockI3SLayerWithNodePages = await createMockLayer( "mockProviderUrl?testQuery=test", - layerData + layerData, ); const nodeWithMesh = new I3SNode(mockI3SLayerWithNodePages, 1, true); spyOn(nodeWithMesh._dataProvider, "_loadBinary").and.returnValue( - Promise.resolve(new ArrayBuffer()) + Promise.resolve(new ArrayBuffer()), ); return nodeWithMesh @@ -1063,18 +1011,18 @@ describe("Scene/I3SNode", function () { expect(nodeWithMesh.geometryData.length).toEqual(1); expect(nodeWithMesh.geometryData[0].resource.url).toContain( - "mockProviderUrl/mockLayerUrl/nodes/1/geometries/1" + "mockProviderUrl/mockLayerUrl/nodes/1/geometries/1", ); expect( - nodeWithMesh.geometryData[0].resource.queryParameters.testQuery + nodeWithMesh.geometryData[0].resource.queryParameters.testQuery, ).toEqual("test"); //Expect geometry 1 to have been picked because geometry 0 didn't have all the required properties expect(nodeWithMesh._dataProvider._loadBinary).toHaveBeenCalledWith( - nodeWithMesh.geometryData[0].resource + nodeWithMesh.geometryData[0].resource, ); expect(nodeWithMesh.geometryData[0]._geometryBufferInfo.index).toEqual( - 1 + 1, ); expect(nodeWithMesh.geometryData[0]._geometryDefinitions).toBeDefined(); @@ -1086,19 +1034,19 @@ describe("Scene/I3SNode", function () { it("loads geometry from url", async function () { const mockI3SLayerWithoutNodePages = await createMockLayer( "mockProviderUrl", - layerDataWithoutNodePages + layerDataWithoutNodePages, ); const nodeWithMesh = new I3SNode( mockI3SLayerWithoutNodePages, "mockNodeUrl", - true + true, ); spyOn(I3SDataProvider, "loadJson").and.returnValue( - Promise.resolve(nodeWithContent) + Promise.resolve(nodeWithContent), ); spyOn(nodeWithMesh._dataProvider, "_loadBinary").and.returnValue( - Promise.resolve(new ArrayBuffer()) + Promise.resolve(new ArrayBuffer()), ); return nodeWithMesh @@ -1110,10 +1058,10 @@ describe("Scene/I3SNode", function () { expect(nodeWithMesh.geometryData.length).toEqual(1); expect(nodeWithMesh.geometryData[0].resource.url).toContain( - "mockProviderUrl/mockLayerUrl/mockNodeUrl/mockGeometryDataUrl" + "mockProviderUrl/mockLayerUrl/mockNodeUrl/mockGeometryDataUrl", ); expect(nodeWithMesh._dataProvider._loadBinary).toHaveBeenCalledWith( - nodeWithMesh.geometryData[0].resource + nodeWithMesh.geometryData[0].resource, ); //Expect data to match the empty data returned by our spy @@ -1123,12 +1071,12 @@ describe("Scene/I3SNode", function () { it("loads not existing geometry", async function () { spyOn(I3SLayer.prototype, "_loadNodePage").and.returnValue( - Promise.resolve(nodeData) + Promise.resolve(nodeData), ); const mockI3SLayerWithNodePages = await createMockLayer( "mockProviderUrl?testQuery=test", - layerData + layerData, ); const rootNode = new I3SNode(mockI3SLayerWithNodePages, 1, true); rootNode._data = {}; @@ -1140,21 +1088,21 @@ describe("Scene/I3SNode", function () { it("generate geometry from node pages", async function () { spyOn(I3SLayer.prototype, "_loadNodePage").and.returnValue( - Promise.resolve(nodeData) + Promise.resolve(nodeData), ); const mockI3SLayerWithNodePages = await createMockLayer( "mockProviderUrl?testQuery=test", - layerData + layerData, ); const nodeWithTexturedMesh = new I3SNode( mockI3SLayerWithNodePages, 1, - true + true, ); spyOn(nodeWithTexturedMesh._dataProvider, "_loadBinary").and.returnValue( - Promise.resolve(new ArrayBuffer()) + Promise.resolve(new ArrayBuffer()), ); return nodeWithTexturedMesh @@ -1169,7 +1117,7 @@ describe("Scene/I3SNode", function () { i3sGeometryData.meshData.meshes, i3sGeometryData.meshData.buffers, i3sGeometryData.meshData.bufferViews, - i3sGeometryData.meshData.accessors + i3sGeometryData.meshData.accessors, ); expect(rawGltf.scene).toEqual(0); @@ -1179,7 +1127,7 @@ describe("Scene/I3SNode", function () { expect(rawGltf.meshes).toEqual(i3sGeometryData.meshData.meshes); expect(rawGltf.buffers).toEqual(i3sGeometryData.meshData.buffers); expect(rawGltf.bufferViews).toEqual( - i3sGeometryData.meshData.bufferViews + i3sGeometryData.meshData.bufferViews, ); expect(rawGltf.accessors).toEqual(i3sGeometryData.meshData.accessors); @@ -1192,21 +1140,21 @@ describe("Scene/I3SNode", function () { it("generate geometry from node pages with transparent material", async function () { spyOn(I3SLayer.prototype, "_loadNodePage").and.returnValue( - Promise.resolve(nodeData) + Promise.resolve(nodeData), ); const mockI3SLayerWithNodePages = await createMockLayer( "mockProviderUrl?testQuery=test", - layerData + layerData, ); const nodeWithTexturedMesh = new I3SNode( mockI3SLayerWithNodePages, 1, - true + true, ); spyOn(nodeWithTexturedMesh._dataProvider, "_loadBinary").and.returnValue( - Promise.resolve(new ArrayBuffer()) + Promise.resolve(new ArrayBuffer()), ); return nodeWithTexturedMesh @@ -1234,26 +1182,26 @@ describe("Scene/I3SNode", function () { transparentI3sGeometryData.meshData.meshes, transparentI3sGeometryData.meshData.buffers, transparentI3sGeometryData.meshData.bufferViews, - transparentI3sGeometryData.meshData.accessors + transparentI3sGeometryData.meshData.accessors, ); expect(rawGltf.scene).toEqual(0); expect(rawGltf.scenes.length).toEqual(1); expect(rawGltf.nodes).toEqual( - transparentI3sGeometryData.meshData.nodes + transparentI3sGeometryData.meshData.nodes, ); expect(rawGltf.meshes).toEqual( - transparentI3sGeometryData.meshData.meshes + transparentI3sGeometryData.meshData.meshes, ); expect(rawGltf.buffers).toEqual( - transparentI3sGeometryData.meshData.buffers + transparentI3sGeometryData.meshData.buffers, ); expect(rawGltf.bufferViews).toEqual( - transparentI3sGeometryData.meshData.bufferViews + transparentI3sGeometryData.meshData.bufferViews, ); expect(rawGltf.accessors).toEqual( - transparentI3sGeometryData.meshData.accessors + transparentI3sGeometryData.meshData.accessors, ); expect(rawGltf.textures).toEqual([]); @@ -1262,7 +1210,7 @@ describe("Scene/I3SNode", function () { expect(rawGltf.materials[0].alphaMode).toEqual("BLEND"); expect(rawGltf.materials[0].emissiveFactor).toEqual([0, 0, 0]); expect( - rawGltf.materials[0].pbrMetallicRoughness.baseColorFactor + rawGltf.materials[0].pbrMetallicRoughness.baseColorFactor, ).toEqual([1, 1, 1, 1]); expect(rawGltf.materials[1].alphaMode).toBeUndefined(); }); @@ -1270,23 +1218,23 @@ describe("Scene/I3SNode", function () { it("generate geometry from node pages with transparent material when alpha mode is defined", async function () { spyOn(I3SLayer.prototype, "_loadNodePage").and.returnValue( - Promise.resolve(nodeData) + Promise.resolve(nodeData), ); const mockI3SLayerWithNodePages = await createMockLayer( "mockProviderUrl?testQuery=test", - layerData + layerData, ); mockI3SLayerWithNodePages._data.materialDefinitions[0].alphaMode = "blend"; mockI3SLayerWithNodePages._data.materialDefinitions[1].alphaMode = "blend"; const nodeWithTexturedMesh = new I3SNode( mockI3SLayerWithNodePages, 1, - true + true, ); spyOn(nodeWithTexturedMesh._dataProvider, "_loadBinary").and.returnValue( - Promise.resolve(new ArrayBuffer()) + Promise.resolve(new ArrayBuffer()), ); return nodeWithTexturedMesh @@ -1314,26 +1262,26 @@ describe("Scene/I3SNode", function () { transparentI3sGeometryData.meshData.meshes, transparentI3sGeometryData.meshData.buffers, transparentI3sGeometryData.meshData.bufferViews, - transparentI3sGeometryData.meshData.accessors + transparentI3sGeometryData.meshData.accessors, ); expect(rawGltf.scene).toEqual(0); expect(rawGltf.scenes.length).toEqual(1); expect(rawGltf.nodes).toEqual( - transparentI3sGeometryData.meshData.nodes + transparentI3sGeometryData.meshData.nodes, ); expect(rawGltf.meshes).toEqual( - transparentI3sGeometryData.meshData.meshes + transparentI3sGeometryData.meshData.meshes, ); expect(rawGltf.buffers).toEqual( - transparentI3sGeometryData.meshData.buffers + transparentI3sGeometryData.meshData.buffers, ); expect(rawGltf.bufferViews).toEqual( - transparentI3sGeometryData.meshData.bufferViews + transparentI3sGeometryData.meshData.bufferViews, ); expect(rawGltf.accessors).toEqual( - transparentI3sGeometryData.meshData.accessors + transparentI3sGeometryData.meshData.accessors, ); expect(rawGltf.textures).toEqual([]); @@ -1346,21 +1294,21 @@ describe("Scene/I3SNode", function () { it("generate geometry from node pages without material", async function () { spyOn(I3SLayer.prototype, "_loadNodePage").and.returnValue( - Promise.resolve(nodeData) + Promise.resolve(nodeData), ); const mockI3SLayerWithNodePages = await createMockLayer( "mockProviderUrl?testQuery=test", - layerData + layerData, ); const nodeWithTexturedMesh = new I3SNode( mockI3SLayerWithNodePages, 1, - true + true, ); spyOn(nodeWithTexturedMesh._dataProvider, "_loadBinary").and.returnValue( - Promise.resolve(new ArrayBuffer()) + Promise.resolve(new ArrayBuffer()), ); return nodeWithTexturedMesh @@ -1377,7 +1325,7 @@ describe("Scene/I3SNode", function () { copyI3sGeometryData.meshData.meshes, copyI3sGeometryData.meshData.buffers, copyI3sGeometryData.meshData.bufferViews, - copyI3sGeometryData.meshData.accessors + copyI3sGeometryData.meshData.accessors, ); expect(rawGltf.scene).toEqual(0); @@ -1387,10 +1335,10 @@ describe("Scene/I3SNode", function () { expect(rawGltf.meshes).toEqual(copyI3sGeometryData.meshData.meshes); expect(rawGltf.buffers).toEqual(copyI3sGeometryData.meshData.buffers); expect(rawGltf.bufferViews).toEqual( - copyI3sGeometryData.meshData.bufferViews + copyI3sGeometryData.meshData.bufferViews, ); expect(rawGltf.accessors).toEqual( - copyI3sGeometryData.meshData.accessors + copyI3sGeometryData.meshData.accessors, ); expect(rawGltf.textures).toEqual([]); @@ -1402,21 +1350,21 @@ describe("Scene/I3SNode", function () { it("generate textured geometry from node pages", async function () { spyOn(I3SLayer.prototype, "_loadNodePage").and.returnValue( - Promise.resolve(nodeData) + Promise.resolve(nodeData), ); const mockI3SLayerWithNodePages = await createMockLayer( "mockProviderUrl?testQuery=test", - layerData + layerData, ); const nodeWithTexturedMesh = new I3SNode( mockI3SLayerWithNodePages, 2, - true + true, ); spyOn(nodeWithTexturedMesh._dataProvider, "_loadBinary").and.returnValue( - Promise.resolve(new ArrayBuffer()) + Promise.resolve(new ArrayBuffer()), ); return nodeWithTexturedMesh @@ -1431,7 +1379,7 @@ describe("Scene/I3SNode", function () { i3sGeometryData.meshData.meshes, i3sGeometryData.meshData.buffers, i3sGeometryData.meshData.bufferViews, - i3sGeometryData.meshData.accessors + i3sGeometryData.meshData.accessors, ); expect(rawGltf.textures).toBeDefined(); @@ -1445,7 +1393,7 @@ describe("Scene/I3SNode", function () { expect(rawGltf.images).toBeDefined(); expect(rawGltf.images.length).toEqual(1); expect(rawGltf.images[0].uri).toContain( - "mockProviderUrl/mockLayerUrl/nodes/2/textures/1?testQuery=test" + "mockProviderUrl/mockLayerUrl/nodes/2/textures/1?testQuery=test", ); }); }); @@ -1453,19 +1401,19 @@ describe("Scene/I3SNode", function () { it("generate textured geometry from url", async function () { const mockI3SLayerWithoutNodePages = await createMockLayer( "mockProviderUrl", - layerDataWithoutNodePages + layerDataWithoutNodePages, ); const nodeWithTexturedMesh = new I3SNode( mockI3SLayerWithoutNodePages, "mockNodeUrl", - true + true, ); spyOn(I3SDataProvider, "loadJson").and.returnValue( - Promise.resolve(nodeWithTexturedContent) + Promise.resolve(nodeWithTexturedContent), ); spyOn(nodeWithTexturedMesh._dataProvider, "_loadBinary").and.returnValue( - Promise.resolve(new ArrayBuffer()) + Promise.resolve(new ArrayBuffer()), ); return nodeWithTexturedMesh @@ -1480,7 +1428,7 @@ describe("Scene/I3SNode", function () { i3sGeometryData.meshData.meshes, i3sGeometryData.meshData.buffers, i3sGeometryData.meshData.bufferViews, - i3sGeometryData.meshData.accessors + i3sGeometryData.meshData.accessors, ); expect(rawGltf.textures).toBeDefined(); @@ -1494,19 +1442,19 @@ describe("Scene/I3SNode", function () { expect(rawGltf.images).toBeDefined(); expect(rawGltf.images.length).toEqual(1); expect(rawGltf.images[0].uri).toContain( - "mockProviderUrl/mockLayerUrl/mockNodeUrl/mockTextureDataUrl" + "mockProviderUrl/mockLayerUrl/mockNodeUrl/mockTextureDataUrl", ); }); }); it("load geometry rejects invalid url", async function () { spyOn(I3SLayer.prototype, "_loadNodePage").and.returnValue( - Promise.resolve(nodeData) + Promise.resolve(nodeData), ); const mockI3SLayerWithNodePages = await createMockLayer( "mockProviderUrl?testQuery=test", - layerData + layerData, ); const nodeWithMesh = new I3SNode(mockI3SLayerWithNodePages, 1, true); @@ -1526,36 +1474,36 @@ describe("Scene/I3SNode", function () { it("loads feature data from uri", async function () { const mockI3SLayerWithoutNodePages = await createMockLayer( "mockProviderUrl", - layerDataWithoutNodePages + layerDataWithoutNodePages, ); const nodeWithMesh = new I3SNode( mockI3SLayerWithoutNodePages, "mockNodeUrl", - true + true, ); - const spy = spyOn(I3SDataProvider, "loadJson").and.callFake(function ( - resource - ) { - if ( - resource - .getUrlComponent() - .endsWith( - "mockProviderUrl/mockLayerUrl/mockNodeUrl/mockFeatureDataUrl" - ) - ) { - return Promise.resolve({ featureData: [], geometryData: [] }); - } - if ( - resource - .getUrlComponent() - .endsWith("mockProviderUrl/mockLayerUrl/mockNodeUrl/") - ) { - return Promise.resolve(nodeWithContent); - } + const spy = spyOn(I3SDataProvider, "loadJson").and.callFake( + function (resource) { + if ( + resource + .getUrlComponent() + .endsWith( + "mockProviderUrl/mockLayerUrl/mockNodeUrl/mockFeatureDataUrl", + ) + ) { + return Promise.resolve({ featureData: [], geometryData: [] }); + } + if ( + resource + .getUrlComponent() + .endsWith("mockProviderUrl/mockLayerUrl/mockNodeUrl/") + ) { + return Promise.resolve(nodeWithContent); + } - return Promise.reject("invalid i3s node"); - }); + return Promise.reject("invalid i3s node"); + }, + ); return nodeWithMesh .load() @@ -1565,7 +1513,7 @@ describe("Scene/I3SNode", function () { .then(function (result) { expect(nodeWithMesh.featureData.length).toEqual(1); expect(nodeWithMesh.featureData[0].resource.url).toContain( - "mockProviderUrl/mockLayerUrl/mockNodeUrl/mockFeatureDataUrl" + "mockProviderUrl/mockLayerUrl/mockNodeUrl/mockFeatureDataUrl", ); expect(nodeWithMesh.featureData[0].data.featureData).toEqual([]); expect(nodeWithMesh.featureData[0].data.geometryData).toEqual([]); @@ -1576,12 +1524,12 @@ describe("Scene/I3SNode", function () { it("loads feature data from node pages", async function () { spyOn(I3SLayer.prototype, "_loadNodePage").and.returnValue( - Promise.resolve(nodeData) + Promise.resolve(nodeData), ); const mockI3SLayerWithNodePages = await createMockLayer( "mockProviderUrl?testQuery=test", - layerData + layerData, ); const nodeWithMesh = new I3SNode(mockI3SLayerWithNodePages, 1, true); @@ -1600,12 +1548,12 @@ describe("Scene/I3SNode", function () { it("load feature data rejects invalid url", async function () { const mockI3SLayerWithoutNodePages = await createMockLayer( "mockProviderUrl", - layerDataWithoutNodePages + layerDataWithoutNodePages, ); const nodeWithMesh = new I3SNode( mockI3SLayerWithoutNodePages, "mockNodeUrl", - true + true, ); spyOn(I3SDataProvider, "loadJson").and.callFake(function (resource) { @@ -1613,7 +1561,7 @@ describe("Scene/I3SNode", function () { resource .getUrlComponent() .endsWith( - "mockProviderUrl/mockLayerUrl/mockNodeUrl/mockFeatureDataUrl" + "mockProviderUrl/mockLayerUrl/mockNodeUrl/mockFeatureDataUrl", ) ) { return Promise.reject({ statusCode: 404 }); @@ -1635,22 +1583,22 @@ describe("Scene/I3SNode", function () { it("creates 3d tile content", async function () { spyOn(I3SLayer.prototype, "_loadNodePage").and.returnValue( - Promise.resolve(nodeData) + Promise.resolve(nodeData), ); const mockI3SLayerWithNodePages = await createMockLayer( "mockProviderUrl?testQuery=test", - layerData + layerData, ); const rootNode = new I3SNode(mockI3SLayerWithNodePages, 0, true); const nodeWithMesh = new I3SNode(rootNode, 1, false); spyOn(nodeWithMesh._dataProvider, "_loadBinary").and.returnValue( - Promise.resolve(new ArrayBuffer()) + Promise.resolve(new ArrayBuffer()), ); spyOn(nodeWithMesh, "_loadFeatureData").and.returnValue(Promise.all([])); spyOn(I3SDecoder, "decode").and.returnValue( - Promise.resolve(i3sGeometryData) + Promise.resolve(i3sGeometryData), ); await rootNode.load(); @@ -1660,12 +1608,12 @@ describe("Scene/I3SNode", function () { expect(nodeWithMesh.tile).toBeDefined(); expect(I3SDecoder.decode).toHaveBeenCalledWith( jasmine.stringContaining( - "mockProviderUrl/mockLayerUrl/nodes/1/geometries/1/?testQuery=test" + "mockProviderUrl/mockLayerUrl/nodes/1/geometries/1/?testQuery=test", ), jasmine.any(Object), jasmine.any(I3SGeometry), undefined, - undefined + undefined, ); //Test fetching the blob url that was created @@ -1694,17 +1642,17 @@ describe("Scene/I3SNode", function () { it("picks closest point in geometry", async function () { spyOn(I3SLayer.prototype, "_loadNodePage").and.returnValue( - Promise.resolve(nodeData) + Promise.resolve(nodeData), ); const mockI3SLayerWithNodePages = await createMockLayer( "mockProviderUrl?testQuery=test", - layerData + layerData, ); const nodeWithMesh = new I3SNode(mockI3SLayerWithNodePages, 1, true); spyOn(nodeWithMesh._dataProvider, "_loadBinary").and.returnValue( - Promise.resolve(new ArrayBuffer()) + Promise.resolve(new ArrayBuffer()), ); return nodeWithMesh @@ -1721,46 +1669,46 @@ describe("Scene/I3SNode", function () { geometryData.getClosestPointIndexOnTriangle( intersectPoint.x, intersectPoint.y, - intersectPoint.z - ).index + intersectPoint.z, + ).index, ).toEqual(0); expect( geometryData.getClosestPointIndexOnTriangle( borderPoint.x, borderPoint.y, - borderPoint.z - ).index + borderPoint.z, + ).index, ).toEqual(11); expect( geometryData.getClosestPointIndexOnTriangle( floatingIntersectPoint.x, floatingIntersectPoint.y, - floatingIntersectPoint.z - ).index + floatingIntersectPoint.z, + ).index, ).toEqual(8); expect( geometryData.getClosestPointIndexOnTriangle( noIntersectPoint.x, noIntersectPoint.y, - noIntersectPoint.z - ).index + noIntersectPoint.z, + ).index, ).toEqual(-1); }); }); it("picks closest point in indexed geometry", async function () { spyOn(I3SLayer.prototype, "_loadNodePage").and.returnValue( - Promise.resolve(nodeData) + Promise.resolve(nodeData), ); const mockI3SLayerWithNodePages = await createMockLayer( "mockProviderUrl?testQuery=test", - layerData + layerData, ); const nodeWithMesh = new I3SNode(mockI3SLayerWithNodePages, 1, true); spyOn(nodeWithMesh._dataProvider, "_loadBinary").and.returnValue( - Promise.resolve(new ArrayBuffer()) + Promise.resolve(new ArrayBuffer()), ); return nodeWithMesh @@ -1777,41 +1725,41 @@ describe("Scene/I3SNode", function () { geometryData.getClosestPointIndexOnTriangle( intersectPoint.x, intersectPoint.y, - intersectPoint.z - ).index + intersectPoint.z, + ).index, ).toEqual(0); expect( geometryData.getClosestPointIndexOnTriangle( borderPoint.x, borderPoint.y, - borderPoint.z - ).index + borderPoint.z, + ).index, ).toEqual(4); expect( geometryData.getClosestPointIndexOnTriangle( floatingIntersectPoint.x, floatingIntersectPoint.y, - floatingIntersectPoint.z - ).index + floatingIntersectPoint.z, + ).index, ).toEqual(5); expect( geometryData.getClosestPointIndexOnTriangle( noIntersectPoint.x, noIntersectPoint.y, - noIntersectPoint.z - ).index + noIntersectPoint.z, + ).index, ).toEqual(-1); }); }); it("requests content", async function () { spyOn(I3SLayer.prototype, "_loadNodePage").and.returnValue( - Promise.resolve(nodeData) + Promise.resolve(nodeData), ); const mockI3SLayerWithNodePages = await createMockLayer( "mockProviderUrl?testQuery=test", - layerData + layerData, ); const rootNode = new I3SNode(mockI3SLayerWithNodePages, 0, true); const childNode = new I3SNode(rootNode, 1, false); @@ -1836,12 +1784,12 @@ describe("Scene/I3SNode", function () { it("requests content without url", async function () { spyOn(I3SLayer.prototype, "_loadNodePage").and.returnValue( - Promise.resolve(nodeData) + Promise.resolve(nodeData), ); const mockI3SLayerWithNodePages = await createMockLayer( "mockProviderUrl?testQuery=test", - layerData + layerData, ); const rootNode = new I3SNode(mockI3SLayerWithNodePages, 0, true); const childNode = new I3SNode(rootNode, 1, false); @@ -1866,7 +1814,7 @@ describe("Scene/I3SNode", function () { it("can filter by attributes", async function () { spyOn(I3SLayer.prototype, "_loadNodePage").and.returnValue( - Promise.resolve(nodeData) + Promise.resolve(nodeData), ); spyOn(I3SField.prototype, "load").and.callFake(function () { @@ -1876,7 +1824,7 @@ describe("Scene/I3SNode", function () { const mockI3SLayerWithNodePages = await createMockLayer( "mockProviderUrl?testQuery=test", - layerData + layerData, ); const rootNode = new I3SNode(mockI3SLayerWithNodePages, 0, true); const childNode = new I3SNode(rootNode, 1, false); @@ -1919,7 +1867,7 @@ describe("Scene/I3SNode", function () { function () { childNode._tile._content = content; return Promise.resolve(content); - } + }, ); return childNode.tile.requestContent(); }) @@ -1938,7 +1886,7 @@ describe("Scene/I3SNode", function () { it("can filter by not existing attributes", async function () { spyOn(I3SLayer.prototype, "_loadNodePage").and.returnValue( - Promise.resolve(nodeData) + Promise.resolve(nodeData), ); spyOn(I3SField.prototype, "load").and.callFake(function () { @@ -1948,7 +1896,7 @@ describe("Scene/I3SNode", function () { const mockI3SLayerWithNodePages = await createMockLayer( "mockProviderUrl?testQuery=test", - layerData + layerData, ); const rootNode = new I3SNode(mockI3SLayerWithNodePages, 0, true); const childNode = new I3SNode(rootNode, 1, false); @@ -1994,7 +1942,7 @@ describe("Scene/I3SNode", function () { it("filtering by attributes can handle filters without values", async function () { spyOn(I3SLayer.prototype, "_loadNodePage").and.returnValue( - Promise.resolve(nodeData) + Promise.resolve(nodeData), ); spyOn(I3SField.prototype, "load").and.callFake(function () { @@ -2004,7 +1952,7 @@ describe("Scene/I3SNode", function () { const mockI3SLayerWithNodePages = await createMockLayer( "mockProviderUrl?testQuery=test", - layerData + layerData, ); const rootNode = new I3SNode(mockI3SLayerWithNodePages, 0, true); const childNode = new I3SNode(rootNode, 1, false); @@ -2050,12 +1998,12 @@ describe("Scene/I3SNode", function () { it("filtering by attributes can handle content with zero features length", async function () { spyOn(I3SLayer.prototype, "_loadNodePage").and.returnValue( - Promise.resolve(nodeData) + Promise.resolve(nodeData), ); const mockI3SLayerWithNodePages = await createMockLayer( "mockProviderUrl?testQuery=test", - layerData + layerData, ); const rootNode = new I3SNode(mockI3SLayerWithNodePages, 0, true); const childNode = new I3SNode(rootNode, 1, false); @@ -2100,14 +2048,14 @@ describe("Scene/I3SNode", function () { it("filtering by attributes without filters", async function () { spyOn(I3SLayer.prototype, "_loadNodePage").and.returnValue( - Promise.resolve(nodeData) + Promise.resolve(nodeData), ); spyOn(I3SField.prototype, "load").and.returnValue(Promise.resolve()); const mockI3SLayerWithNodePages = await createMockLayer( "mockProviderUrl?testQuery=test", - layerData + layerData, ); const rootNode = new I3SNode(mockI3SLayerWithNodePages, 0, true); const childNode = new I3SNode(rootNode, 1, false); @@ -2151,14 +2099,14 @@ describe("Scene/I3SNode", function () { it("filtering by attributes can handle fields without values", async function () { spyOn(I3SLayer.prototype, "_loadNodePage").and.returnValue( - Promise.resolve(nodeData) + Promise.resolve(nodeData), ); spyOn(I3SField.prototype, "load").and.returnValue(Promise.resolve()); const mockI3SLayerWithNodePages = await createMockLayer( "mockProviderUrl?testQuery=test", - layerData + layerData, ); const rootNode = new I3SNode(mockI3SLayerWithNodePages, 0, true); const childNode = new I3SNode(rootNode, 1, false); @@ -2214,14 +2162,14 @@ describe("Scene/I3SNode", function () { const i3sFeature = new I3SFeature(i3sNode, "testNode"); expect( i3sFeature._resource.url.endsWith( - `nodes/${attributeResource.url}/testNode` - ) + `nodes/${attributeResource.url}/testNode`, + ), ).toEqual(true); }); it("can clear node geometry data", async function () { spyOn(I3SLayer.prototype, "_loadNodePage").and.returnValue( - Promise.resolve(nodeData) + Promise.resolve(nodeData), ); spyOn(I3SField.prototype, "load").and.callFake(function () { @@ -2231,7 +2179,7 @@ describe("Scene/I3SNode", function () { const mockI3SLayerWithNodePages = await createMockLayer( "mockProviderUrl?testQuery=test", - layerData + layerData, ); const rootNode = new I3SNode(mockI3SLayerWithNodePages, 0, true); return rootNode.load().then(function () { @@ -2243,7 +2191,7 @@ describe("Scene/I3SNode", function () { it("creates 3d tile content with symbology", async function () { spyOn(I3SLayer.prototype, "_loadNodePage").and.returnValue( - Promise.resolve(nodeData) + Promise.resolve(nodeData), ); const mockI3SLayerWithNodePages = await createMockLayer( @@ -2252,17 +2200,17 @@ describe("Scene/I3SNode", function () { undefined, { applySymbology: true, - } + }, ); const rootNode = new I3SNode(mockI3SLayerWithNodePages, 0, true); const nodeWithMesh = new I3SNode(rootNode, 1, false); spyOn(nodeWithMesh._dataProvider, "_loadBinary").and.returnValue( - Promise.resolve(new ArrayBuffer()) + Promise.resolve(new ArrayBuffer()), ); spyOn(nodeWithMesh, "_loadFeatureData").and.returnValue(Promise.all([])); spyOn(I3SDecoder, "decode").and.returnValue( - Promise.resolve(i3sGeometryData) + Promise.resolve(i3sGeometryData), ); await rootNode.load(); @@ -2273,12 +2221,12 @@ describe("Scene/I3SNode", function () { expect(I3SDecoder.decode).toHaveBeenCalledTimes(2); expect(I3SDecoder.decode).toHaveBeenCalledWith( jasmine.stringContaining( - "mockProviderUrl/mockLayerUrl/nodes/1/geometries/1/?testQuery=test" + "mockProviderUrl/mockLayerUrl/nodes/1/geometries/1/?testQuery=test", ), jasmine.any(Object), jasmine.any(I3SGeometry), undefined, - jasmine.any(Object) + jasmine.any(Object), ); }); @@ -2289,23 +2237,23 @@ describe("Scene/I3SNode", function () { undefined, { applySymbology: true, - } + }, ); const nodeWithMesh = new I3SNode( mockI3SLayerWithoutNodePages, "mockNodeUrl", - true + true, ); spyOn(I3SDataProvider, "loadJson").and.returnValue( - Promise.resolve(nodeWithContent) + Promise.resolve(nodeWithContent), ); spyOn(nodeWithMesh._dataProvider, "_loadBinary").and.returnValue( - Promise.resolve(new ArrayBuffer()) + Promise.resolve(new ArrayBuffer()), ); spyOn(nodeWithMesh, "_loadFeatureData").and.returnValue(Promise.all([])); spyOn(I3SDecoder, "decode").and.returnValue( - Promise.resolve(i3sGeometryData) + Promise.resolve(i3sGeometryData), ); await nodeWithMesh.load(); @@ -2313,12 +2261,12 @@ describe("Scene/I3SNode", function () { expect(I3SDecoder.decode).toHaveBeenCalledWith( jasmine.stringContaining( - "mockProviderUrl/mockLayerUrl/mockNodeUrl/mockGeometryDataUrl?testQuery=test" + "mockProviderUrl/mockLayerUrl/mockNodeUrl/mockGeometryDataUrl?testQuery=test", ), jasmine.any(Object), jasmine.any(I3SGeometry), undefined, - jasmine.any(Object) + jasmine.any(Object), ); }); }); diff --git a/packages/engine/Specs/Scene/I3dmParserSpec.js b/packages/engine/Specs/Scene/I3dmParserSpec.js index e749db4fbca0..4e4d9f905760 100644 --- a/packages/engine/Specs/Scene/I3dmParserSpec.js +++ b/packages/engine/Specs/Scene/I3dmParserSpec.js @@ -112,5 +112,5 @@ describe( expect(getStringFromTypedArray(results.gltf)).toEqual(gltfUri); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/ImageBasedLightingSpec.js b/packages/engine/Specs/Scene/ImageBasedLightingSpec.js index 159d92a2a7a0..a129dd4ce0da 100644 --- a/packages/engine/Specs/Scene/ImageBasedLightingSpec.js +++ b/packages/engine/Specs/Scene/ImageBasedLightingSpec.js @@ -19,8 +19,8 @@ describe("Scene/ImageBasedLighting", function () { expect( Cartesian2.equals( imageBasedLighting.imageBasedLightingFactor, - new Cartesian2(1.0, 1.0) - ) + new Cartesian2(1.0, 1.0), + ), ).toBe(true); expect(imageBasedLighting.luminanceAtZenith).toEqual(0.2); expect(imageBasedLighting.sphericalHarmonicCoefficients).toBeUndefined(); @@ -73,14 +73,14 @@ describe("Scene/ImageBasedLighting", function () { expect( Cartesian2.equals( imageBasedLighting.imageBasedLightingFactor, - new Cartesian2(1.0, 1.0) - ) + new Cartesian2(1.0, 1.0), + ), ).toBe(true); expect( Cartesian2.equals( imageBasedLighting._previousImageBasedLightingFactor, - Cartesian2.ZERO - ) + Cartesian2.ZERO, + ), ).toBe(true); }); @@ -101,7 +101,7 @@ describe("Scene/ImageBasedLighting", function () { imageBasedLighting.sphericalHarmonicCoefficients = undefined; expect(imageBasedLighting.sphericalHarmonicCoefficients).toBeUndefined(); expect(imageBasedLighting._previousSphericalHarmonicCoefficients).toBe( - testCoefficients + testCoefficients, ); }); diff --git a/packages/engine/Specs/Scene/ImageryLayerCollectionSpec.js b/packages/engine/Specs/Scene/ImageryLayerCollectionSpec.js index 426ecf48a0ba..88a81e2fa6ac 100644 --- a/packages/engine/Specs/Scene/ImageryLayerCollectionSpec.js +++ b/packages/engine/Specs/Scene/ImageryLayerCollectionSpec.js @@ -308,12 +308,12 @@ describe( const ellipsoid = Ellipsoid.WGS84; camera.lookAt( new Cartesian3(ellipsoid.maximumRadius, 0.0, 0.0), - new Cartesian3(0.0, 0.0, 100.0) + new Cartesian3(0.0, 0.0, 100.0), ); const ray = new Ray( camera.position, - Cartesian3.negate(camera.direction, new Cartesian3()) + Cartesian3.negate(camera.direction, new Cartesian3()), ); const imagery = scene.imageryLayers.pickImageryLayers(ray, scene); expect(imagery).toBeUndefined(); @@ -323,7 +323,7 @@ describe( const ellipsoid = Ellipsoid.WGS84; camera.lookAt( new Cartesian3(ellipsoid.maximumRadius, 0.0, 0.0), - new Cartesian3(0.0, 0.0, 100.0) + new Cartesian3(0.0, 0.0, 100.0), ); const ray = new Ray(camera.position, camera.direction); @@ -335,7 +335,7 @@ describe( const ellipsoid = Ellipsoid.WGS84; camera.lookAt( new Cartesian3(ellipsoid.maximumRadius, 0.0, 0.0), - new Cartesian3(0.0, 0.0, 100.0) + new Cartesian3(0.0, 0.0, 100.0), ); camera.lookAtTransform(Matrix4.IDENTITY); return updateUntilDone(globe, scene).then(function () { @@ -366,7 +366,7 @@ describe( const ellipsoid = Ellipsoid.WGS84; camera.lookAt( new Cartesian3(ellipsoid.maximumRadius, 0.0, 0.0), - new Cartesian3(0.0, 0.0, 100.0) + new Cartesian3(0.0, 0.0, 100.0), ); camera.lookAtTransform(Matrix4.IDENTITY); return updateUntilDone(globe, scene).then(function () { @@ -414,7 +414,7 @@ describe( const ellipsoid = Ellipsoid.WGS84; camera.lookAt( new Cartesian3(ellipsoid.maximumRadius, 0.0, 0.0), - new Cartesian3(0.0, 0.0, 100.0) + new Cartesian3(0.0, 0.0, 100.0), ); camera.lookAtTransform(Matrix4.IDENTITY); return updateUntilDone(globe, scene).then(function () { @@ -454,16 +454,16 @@ describe( const ellipsoid = Ellipsoid.WGS84; camera.lookAt( new Cartesian3(ellipsoid.maximumRadius, 0.0, 0.0), - new Cartesian3(0.0, 0.0, 100.0) + new Cartesian3(0.0, 0.0, 100.0), ); const ray = new Ray( camera.position, - Cartesian3.negate(camera.direction, new Cartesian3()) + Cartesian3.negate(camera.direction, new Cartesian3()), ); const featuresPromise = scene.imageryLayers.pickImageryLayerFeatures( ray, - scene + scene, ); expect(featuresPromise).toBeUndefined(); }); @@ -472,13 +472,13 @@ describe( const ellipsoid = Ellipsoid.WGS84; camera.lookAt( new Cartesian3(ellipsoid.maximumRadius, 0.0, 0.0), - new Cartesian3(0.0, 0.0, 100.0) + new Cartesian3(0.0, 0.0, 100.0), ); const ray = new Ray(camera.position, camera.direction); const featuresPromise = scene.imageryLayers.pickImageryLayerFeatures( ray, - scene + scene, ); expect(featuresPromise).toBeUndefined(); }); @@ -505,13 +505,13 @@ describe( const ellipsoid = Ellipsoid.WGS84; camera.lookAt( new Cartesian3(ellipsoid.maximumRadius, 0.0, 0.0), - new Cartesian3(0.0, 0.0, 100.0) + new Cartesian3(0.0, 0.0, 100.0), ); const ray = new Ray(camera.position, camera.direction); const featuresPromise = scene.imageryLayers.pickImageryLayerFeatures( ray, - scene + scene, ); expect(featuresPromise).toBeUndefined(); }); @@ -543,13 +543,13 @@ describe( const ellipsoid = Ellipsoid.WGS84; camera.lookAt( new Cartesian3(ellipsoid.maximumRadius, 0.0, 0.0), - new Cartesian3(0.0, 0.0, 100.0) + new Cartesian3(0.0, 0.0, 100.0), ); const ray = new Ray(camera.position, camera.direction); const featuresPromise = scene.imageryLayers.pickImageryLayerFeatures( ray, - scene + scene, ); expect(featuresPromise).toBeUndefined(); }); @@ -588,14 +588,14 @@ describe( const ellipsoid = Ellipsoid.WGS84; camera.lookAt( new Cartesian3(ellipsoid.maximumRadius, 0.0, 0.0), - new Cartesian3(0.0, 0.0, 100.0) + new Cartesian3(0.0, 0.0, 100.0), ); camera.lookAtTransform(Matrix4.IDENTITY); const ray = new Ray(camera.position, camera.direction); const featuresPromise = scene.imageryLayers.pickImageryLayerFeatures( ray, - scene + scene, ); expect(featuresPromise).toBeDefined(); @@ -670,14 +670,14 @@ describe( const ellipsoid = Ellipsoid.WGS84; camera.lookAt( new Cartesian3(ellipsoid.maximumRadius, 0.0, 0.0), - new Cartesian3(0.0, 0.0, 100.0) + new Cartesian3(0.0, 0.0, 100.0), ); camera.lookAtTransform(Matrix4.IDENTITY); const ray = new Ray(camera.position, camera.direction); const featuresPromise = scene.imageryLayers.pickImageryLayerFeatures( ray, - scene + scene, ); expect(featuresPromise).toBeDefined(); @@ -700,7 +700,7 @@ describe( -Math.PI, -WebMercatorProjection.MaximumLatitude, Math.PI, - WebMercatorProjection.MaximumLatitude + WebMercatorProjection.MaximumLatitude, ), tileWidth: 256, tileHeight: 256, @@ -739,7 +739,7 @@ describe( const ray = new Ray(camera.position, camera.direction); const featuresPromise = scene.imageryLayers.pickImageryLayerFeatures( ray, - scene + scene, ); expect(featuresPromise).toBeDefined(); @@ -753,5 +753,5 @@ describe( }); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/ImageryLayerSpec.js b/packages/engine/Specs/Scene/ImageryLayerSpec.js index 1ee0381faf21..5ec56fae243d 100644 --- a/packages/engine/Specs/Scene/ImageryLayerSpec.js +++ b/packages/engine/Specs/Scene/ImageryLayerSpec.js @@ -78,13 +78,13 @@ describe( it("fromProviderAsync throws without provider promise", function () { expect(() => ImageryLayer.fromProviderAsync()).toThrowDeveloperError( - "expected" + "expected", ); }); it("readyEvent is raised when asynchronous provider become ready", async function () { const providerPromise = SingleTileImageryProvider.fromUrl( - "Data/Images/Red16x16.png" + "Data/Images/Red16x16.png", ); const layer = ImageryLayer.fromProviderAsync(providerPromise); expect(layer.ready).toBe(false); @@ -118,12 +118,12 @@ describe( Resource._Implementations.createImage = function ( request, crossOrigin, - deferred + deferred, ) { Resource._DefaultImplementations.createImage( new Request({ url: "Data/Images/Red16x16.png" }), crossOrigin, - deferred + deferred, ); }; @@ -134,7 +134,7 @@ describe( data, headers, deferred, - overrideMimeType + overrideMimeType, ) { Resource._DefaultImplementations.loadWithXhr( "Data/Images/Red16x16.png", @@ -142,7 +142,7 @@ describe( method, data, headers, - deferred + deferred, ); }; @@ -174,7 +174,7 @@ describe( async function createWebMercatorProvider() { Resource._Implementations.loadAndExecuteScript = function ( url, - functionName + functionName, ) { window[functionName]({ authenticationResultCode: "ValidCredentials", @@ -213,12 +213,12 @@ describe( Resource._Implementations.createImage = function ( request, crossOrigin, - deferred + deferred, ) { Resource._DefaultImplementations.createImage( new Request({ url: "Data/Images/Red16x16.png" }), crossOrigin, - deferred + deferred, ); }; @@ -229,7 +229,7 @@ describe( data, headers, deferred, - overrideMimeType + overrideMimeType, ) { Resource._DefaultImplementations.loadWithXhr( "Data/Images/Red16x16.png", @@ -237,7 +237,7 @@ describe( method, data, headers, - deferred + deferred, ); }; @@ -275,10 +275,10 @@ describe( expect(imagery.texture).toBeDefined(); expect(imagery.texture.sampler).toBeDefined(); expect(imagery.texture.sampler.minificationFilter).toEqual( - TextureMinificationFilter.LINEAR_MIPMAP_LINEAR + TextureMinificationFilter.LINEAR_MIPMAP_LINEAR, ); expect(imagery.texture.sampler.magnificationFilter).toEqual( - TextureMinificationFilter.LINEAR + TextureMinificationFilter.LINEAR, ); expect(textureBeforeReprojection).not.toEqual(imagery.texture); imagery.releaseReference(); @@ -356,10 +356,10 @@ describe( expect(imagery.texture).toBeDefined(); expect(imagery.texture.sampler).toBeDefined(); expect(imagery.texture.sampler.minificationFilter).toEqual( - TextureMinificationFilter.LINEAR_MIPMAP_LINEAR + TextureMinificationFilter.LINEAR_MIPMAP_LINEAR, ); expect(imagery.texture.sampler.magnificationFilter).toEqual( - TextureMinificationFilter.LINEAR + TextureMinificationFilter.LINEAR, ); expect(textureBeforeReprojection).not.toEqual(imagery.texture); imagery.releaseReference(); @@ -373,12 +373,12 @@ describe( Resource._Implementations.createImage = function ( request, crossOrigin, - deferred + deferred, ) { Resource._DefaultImplementations.createImage( new Request({ url: "Data/Images/Red256x256.png" }), crossOrigin, - deferred + deferred, ); }; @@ -390,7 +390,7 @@ describe( 13.39657249732205, 52.49127999816725, 13.42722986993895, - 52.50998943590507 + 52.50998943590507, ), }); const layer = new ImageryLayer(provider); @@ -418,10 +418,10 @@ describe( expect(imagery.texture).toBeDefined(); expect(imagery.texture.sampler).toBeDefined(); expect(imagery.texture.sampler.minificationFilter).toEqual( - TextureMinificationFilter.LINEAR_MIPMAP_LINEAR + TextureMinificationFilter.LINEAR_MIPMAP_LINEAR, ); expect(imagery.texture.sampler.magnificationFilter).toEqual( - TextureMinificationFilter.LINEAR + TextureMinificationFilter.LINEAR, ); expect(imagery.texture).toBe(imagery.textureWebMercator); imagery.releaseReference(); @@ -457,7 +457,7 @@ describe( it("basic properties work as expected", async function () { const provider = await SingleTileImageryProvider.fromUrl( - "Data/Images/Red16x16.png" + "Data/Images/Red16x16.png", ); const rectangle = new Rectangle(0.1, 0.2, 0.3, 0.4); @@ -472,16 +472,16 @@ describe( it("allows setting texture filter properties", async function () { const provider = await SingleTileImageryProvider.fromUrl( - "Data/Images/Red16x16.png" + "Data/Images/Red16x16.png", ); // expect default LINEAR let layer = new ImageryLayer(provider); expect(layer.minificationFilter).toEqual( - TextureMinificationFilter.LINEAR + TextureMinificationFilter.LINEAR, ); expect(layer.magnificationFilter).toEqual( - TextureMagnificationFilter.LINEAR + TextureMagnificationFilter.LINEAR, ); layer.destroy(); @@ -491,10 +491,10 @@ describe( magnificationFilter: TextureMagnificationFilter.NEAREST, }); expect(layer.minificationFilter).toEqual( - TextureMinificationFilter.NEAREST + TextureMinificationFilter.NEAREST, ); expect(layer.magnificationFilter).toEqual( - TextureMagnificationFilter.NEAREST + TextureMagnificationFilter.NEAREST, ); const imagery = new Imagery(layer, 0, 0, 0); @@ -508,10 +508,10 @@ describe( layer._createTexture(scene.context, imagery); const sampler = imagery.texture.sampler; expect(sampler.minificationFilter).toEqual( - TextureMinificationFilter.NEAREST + TextureMinificationFilter.NEAREST, ); expect(sampler.magnificationFilter).toEqual( - TextureMinificationFilter.NEAREST + TextureMinificationFilter.NEAREST, ); imagery.releaseReference(); layer.destroy(); @@ -529,7 +529,7 @@ describe( { usePreCachedTilesIfAvailable: false, tileDiscardPolicy: new NeverTileDiscardPolicy(), - } + }, ); let errorRaised = false; @@ -555,7 +555,7 @@ describe( "Data/Images/Green4x4.png", { rectangle: providerRectangle, - } + }, ); const layerRectangle = Rectangle.fromDegrees(7.2, 60.9, 9.0, 61.7); @@ -564,22 +564,21 @@ describe( }); expect(layer.getImageryRectangle()).toEqual( - Rectangle.intersection(providerRectangle, layerRectangle) + Rectangle.intersection(providerRectangle, layerRectangle), ); }); describe("createTileImagerySkeletons", function () { it("handles a base layer that does not cover the entire globe", async function () { - const provider = await TileMapServiceImageryProvider.fromUrl( - "Data/TMS/SmallArea" - ); + const provider = + await TileMapServiceImageryProvider.fromUrl("Data/TMS/SmallArea"); const layers = new ImageryLayerCollection(); const layer = layers.addImageryProvider(provider); const terrainProvider = new EllipsoidTerrainProvider(); const tiles = QuadtreeTile.createLevelZeroTiles( - terrainProvider.tilingScheme + terrainProvider.tilingScheme, ); tiles[0].data = new GlobeSurfaceTile(); tiles[1].data = new GlobeSurfaceTile(); @@ -614,18 +613,17 @@ describe( // triggers an exception (use of an undefined reference). const wholeWorldProvider = await SingleTileImageryProvider.fromUrl( - "Data/Images/Blue.png" - ); - const provider = await TileMapServiceImageryProvider.fromUrl( - "Data/TMS/SmallArea" + "Data/Images/Blue.png", ); + const provider = + await TileMapServiceImageryProvider.fromUrl("Data/TMS/SmallArea"); const layers = new ImageryLayerCollection(); const wholeWorldLayer = layers.addImageryProvider(wholeWorldProvider); const terrainProvider = new EllipsoidTerrainProvider(); let tiles = QuadtreeTile.createLevelZeroTiles( - terrainProvider.tilingScheme + terrainProvider.tilingScheme, ); tiles[0].data = new GlobeSurfaceTile(); tiles[1].data = new GlobeSurfaceTile(); @@ -657,11 +655,10 @@ describe( it("handles a non-base layer that does not cover the entire globe", async function () { const baseProvider = await SingleTileImageryProvider.fromUrl( - "Data/Images/Green4x4.png" - ); - const provider = await TileMapServiceImageryProvider.fromUrl( - "Data/TMS/SmallArea" + "Data/Images/Green4x4.png", ); + const provider = + await TileMapServiceImageryProvider.fromUrl("Data/TMS/SmallArea"); const layers = new ImageryLayerCollection(); layers.addImageryProvider(baseProvider); @@ -669,7 +666,7 @@ describe( const terrainProvider = new EllipsoidTerrainProvider(); const tiles = QuadtreeTile.createLevelZeroTiles( - terrainProvider.tilingScheme + terrainProvider.tilingScheme, ); tiles[0].data = new GlobeSurfaceTile(); tiles[1].data = new GlobeSurfaceTile(); @@ -681,52 +678,52 @@ describe( // And the imagery should not cover it completely. expect(tiles[0].data.imagery.length).toBe(4); expect(tiles[0].data.imagery[0].textureCoordinateRectangle.x).not.toBe( - 0.0 + 0.0, ); expect(tiles[0].data.imagery[0].textureCoordinateRectangle.y).not.toBe( - 0.0 + 0.0, ); expect(tiles[0].data.imagery[0].textureCoordinateRectangle.z).not.toBe( - 1.0 + 1.0, ); expect(tiles[0].data.imagery[0].textureCoordinateRectangle.w).not.toBe( - 1.0 + 1.0, ); expect(tiles[0].data.imagery[1].textureCoordinateRectangle.x).not.toBe( - 0.0 + 0.0, ); expect(tiles[0].data.imagery[1].textureCoordinateRectangle.y).not.toBe( - 0.0 + 0.0, ); expect(tiles[0].data.imagery[1].textureCoordinateRectangle.z).not.toBe( - 1.0 + 1.0, ); expect(tiles[0].data.imagery[1].textureCoordinateRectangle.w).not.toBe( - 1.0 + 1.0, ); expect(tiles[0].data.imagery[2].textureCoordinateRectangle.x).not.toBe( - 0.0 + 0.0, ); expect(tiles[0].data.imagery[2].textureCoordinateRectangle.y).not.toBe( - 0.0 + 0.0, ); expect(tiles[0].data.imagery[2].textureCoordinateRectangle.z).not.toBe( - 1.0 + 1.0, ); expect(tiles[0].data.imagery[2].textureCoordinateRectangle.w).not.toBe( - 1.0 + 1.0, ); expect(tiles[0].data.imagery[3].textureCoordinateRectangle.x).not.toBe( - 0.0 + 0.0, ); expect(tiles[0].data.imagery[3].textureCoordinateRectangle.y).not.toBe( - 0.0 + 0.0, ); expect(tiles[0].data.imagery[3].textureCoordinateRectangle.z).not.toBe( - 1.0 + 1.0, ); expect(tiles[0].data.imagery[3].textureCoordinateRectangle.w).not.toBe( - 1.0 + 1.0, ); expect(tiles[1].data.imagery.length).toBe(0); @@ -734,7 +731,7 @@ describe( it("honors the minimumTerrainLevel and maximumTerrainLevel properties", async function () { const provider = await SingleTileImageryProvider.fromUrl( - "Data/Images/Green4x4.png" + "Data/Images/Green4x4.png", ); const layer = new ImageryLayer(provider, { @@ -748,7 +745,7 @@ describe( const terrainProvider = new EllipsoidTerrainProvider(); const level0 = QuadtreeTile.createLevelZeroTiles( - terrainProvider.tilingScheme + terrainProvider.tilingScheme, ); const level1 = level0[0].children; const level2 = level1[0].children; @@ -784,7 +781,7 @@ describe( it("honors limited extent of non-base ImageryLayer", async function () { const provider = await SingleTileImageryProvider.fromUrl( - "Data/Images/Green4x4.png" + "Data/Images/Green4x4.png", ); const layer = new ImageryLayer(provider, { @@ -793,7 +790,7 @@ describe( const layers = new ImageryLayerCollection(); const provider2 = await SingleTileImageryProvider.fromUrl( - "Data/Images/Red16x16.png" + "Data/Images/Red16x16.png", ); layers.addImageryProvider(provider2); layers.add(layer); @@ -801,7 +798,7 @@ describe( const terrainProvider = new EllipsoidTerrainProvider(); const tiles = QuadtreeTile.createLevelZeroTiles( - terrainProvider.tilingScheme + terrainProvider.tilingScheme, ); tiles[0].data = new GlobeSurfaceTile(); tiles[1].data = new GlobeSurfaceTile(); @@ -824,5 +821,5 @@ describe( }); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/Implicit3DTileContentSpec.js b/packages/engine/Specs/Scene/Implicit3DTileContentSpec.js index b48e080ced12..1f743ef08afc 100644 --- a/packages/engine/Specs/Scene/Implicit3DTileContentSpec.js +++ b/packages/engine/Specs/Scene/Implicit3DTileContentSpec.js @@ -131,7 +131,7 @@ describe( implicitTileset = new ImplicitTileset( tilesetResource, tileJson, - metadataSchema + metadataSchema, ); rootCoordinates = new ImplicitTileCoordinates({ @@ -184,7 +184,7 @@ describe( mockTileset, mockPlaceholderTile, tilesetResource, - quadtreeJson + quadtreeJson, ); const expectedChildrenCounts = [4, 0, 0, 0, 0]; const tiles = []; @@ -204,7 +204,7 @@ describe( tilesetResource, undefined, quadtreeBuffer, - 0 + 0, ); const expectedChildrenCounts = [2, 4, 0, 0, 0, 0, 4, 0, 0, 0, 0]; const tiles = []; @@ -224,7 +224,7 @@ describe( tilesetResource, undefined, quadtreeBuffer, - 0 + 0, ); const expectedCoordinates = [ [0, 0, 0], @@ -269,7 +269,7 @@ describe( tilesetResource, undefined, quadtreeBuffer, - 0 + 0, ); const refine = implicitTileset.refine === "ADD" @@ -287,13 +287,13 @@ describe( rootBoundingVolume, parentCoordinates.level, parentCoordinates.x, - parentCoordinates.y + parentCoordinates.y, ); const childBox = Implicit3DTileContent._deriveBoundingBox( rootBoundingVolume, childCoordinates.level, childCoordinates.x, - childCoordinates.y + childCoordinates.y, ); const subtreeRootTile = mockPlaceholderTile.children[0]; @@ -322,7 +322,7 @@ describe( tilesetResource, undefined, quadtreeBuffer, - 0 + 0, ); expect(mockPlaceholderTile.children.length).toEqual(1); }); @@ -334,7 +334,7 @@ describe( tilesetResource, undefined, quadtreeBuffer, - 0 + 0, ); const tiles = []; const subtreeRootTile = mockPlaceholderTile.children[0]; @@ -351,7 +351,7 @@ describe( tilesetResource, undefined, quadtreeBuffer, - 0 + 0, ); expect(mockPlaceholderTile.children[0].extras).toEqual(tileJson.extras); }); @@ -363,7 +363,7 @@ describe( tilesetResource, undefined, quadtreeBuffer, - 0 + 0, ); expect(mockPlaceholderTile.implicitSubtree).not.toBeDefined(); @@ -385,7 +385,7 @@ describe( tilesetResource, undefined, quadtreeBuffer, - 0 + 0, ); expect(mockPlaceholderTile.implicitSubtree).not.toBeDefined(); @@ -405,7 +405,7 @@ describe( tilesetResource, undefined, quadtreeBuffer, - 0 + 0, ); const subtree = content._implicitSubtree; expect(content.isDestroyed()).toBe(false); @@ -423,7 +423,7 @@ describe( tilesetResource, undefined, quadtreeBuffer, - 0 + 0, ); expect(content.featurePropertiesDirty).toBe(false); @@ -446,7 +446,7 @@ describe( tilesetResource, undefined, quadtreeBuffer, - 0 + 0, ); expect(content.url).toBe("https://example.com/0/0/0.subtree"); }); @@ -458,7 +458,7 @@ describe( tilesetResource, undefined, quadtreeBuffer, - 0 + 0, ); const expectedCoordinates = [ [0, 0, 0], @@ -498,7 +498,7 @@ describe( tilesetResource, undefined, quadtreeBuffer, - 0 + 0, ); const expectedCoordinates = [ [2, 0, 0], @@ -530,7 +530,7 @@ describe( }); const placeholderTile = tiles[i]; expect(placeholderTile._contentResource.url).toEqual( - expectedResource.url + expectedResource.url, ); expect(placeholderTile.implicitTileset).toBeDefined(); expect(placeholderTile.implicitCoordinates).toBeDefined(); @@ -548,7 +548,7 @@ describe( tilesetResource, undefined, quadtreeBuffer, - 0 + 0, ); const refine = implicitTileset.refine === "ADD" @@ -569,7 +569,7 @@ describe( tilesetResource, undefined, quadtreeBuffer, - 0 + 0, ); const rootGeometricError = implicitTileset.geometricError; const subtreeRootTile = mockPlaceholderTile.children[0]; @@ -578,7 +578,7 @@ describe( for (let i = 0; i < tiles.length; i++) { const level = tiles[i].implicitCoordinates.level; expect(tiles[i].geometricError).toEqual( - rootGeometricError / Math.pow(2, level) + rootGeometricError / Math.pow(2, level), ); } }); @@ -590,7 +590,7 @@ describe( tilesetResource, undefined, quadtreeBuffer, - 0 + 0, ); const expectedCoordinates = [ [0, 0, 0], @@ -624,7 +624,7 @@ describe( rootBoundingVolume, coordinates[0], coordinates[1], - coordinates[2] + coordinates[2], ); expect(childBox).toEqual(expectedBounds); } @@ -637,11 +637,11 @@ describe( tilesetResource, undefined, quadtreeBuffer, - 0 + 0, ); const subtreeRootTile = mockPlaceholderTile.children[0]; expect(subtreeRootTile.computedTransform).toEqual( - mockPlaceholderTile.transform + mockPlaceholderTile.transform, ); }); @@ -654,7 +654,7 @@ describe( maximumHeight: 10, }; const simpleBoundingVolumeS2Cell = new TileBoundingS2Cell( - simpleBoundingVolumeS2 + simpleBoundingVolumeS2, ); const implicitTilesetS2 = { boundingVolume: { @@ -718,7 +718,7 @@ describe( 0, 0, 0, - 0 + 0, ); expect(result).toEqual(implicitTilesetS2.boundingVolume); expect(result).not.toBe(implicitTilesetS2.boundingVolume); @@ -780,7 +780,7 @@ describe( 1, 0, 0, - 0 + 0, ); expect(result0).toEqual({ extensions: { @@ -794,7 +794,7 @@ describe( 1, 0, 0, - 0 + 0, ); expect(result1).toEqual({ extensions: { @@ -893,7 +893,7 @@ describe( eastDegrees, northDegrees, minimumHeight, - maximumHeight + maximumHeight, ) { return [ CesiumMath.toRadians(westDegrees), @@ -941,7 +941,7 @@ describe( it("a single content is transcoded as a regular tile", function () { return Cesium3DTilesTester.loadTileset( scene, - implicitMultipleContentsUrl + implicitMultipleContentsUrl, ).then(function (tileset) { // The root tile of this tileset only has one available content const transcodedRoot = tileset.root.children[0]; @@ -957,7 +957,7 @@ describe( it("multiple contents are transcoded to a tile", function () { return Cesium3DTilesTester.loadTileset( scene, - implicitMultipleContentsUrl + implicitMultipleContentsUrl, ).then(function (tileset) { const childTiles = tileset.root.children[0].children; for (let i = 0; i < childTiles.length; i++) { @@ -983,7 +983,7 @@ describe( it("a single content is transcoded as a regular tile (legacy)", function () { return Cesium3DTilesTester.loadTileset( scene, - implicitMultipleContentsLegacyUrl + implicitMultipleContentsLegacyUrl, ).then(function (tileset) { // The root tile of this tileset only has one available content const transcodedRoot = tileset.root.children[0]; @@ -999,7 +999,7 @@ describe( it("a single content is transcoded as a regular tile (legacy with 'content')", function () { return Cesium3DTilesTester.loadTileset( scene, - implicitMultipleContentsLegacyWithContentUrl + implicitMultipleContentsLegacyWithContentUrl, ).then(function (tileset) { // The root tile of this tileset only has one available content const transcodedRoot = tileset.root.children[0]; @@ -1015,7 +1015,7 @@ describe( it("multiple contents are transcoded to a tile (legacy)", function () { return Cesium3DTilesTester.loadTileset( scene, - implicitMultipleContentsLegacyUrl + implicitMultipleContentsLegacyUrl, ).then(function (tileset) { const childTiles = tileset.root.children[0].children; for (let i = 0; i < childTiles.length; i++) { @@ -1032,7 +1032,7 @@ describe( it("multiple contents are transcoded to a tile (legacy with 'content')", function () { return Cesium3DTilesTester.loadTileset( scene, - implicitMultipleContentsLegacyWithContentUrl + implicitMultipleContentsLegacyWithContentUrl, ).then(function (tileset) { const childTiles = tileset.root.children[0].children; for (let i = 0; i < childTiles.length; i++) { @@ -1077,7 +1077,7 @@ describe( return Cesium3DTilesTester.loadTileset( scene, - implicitMultipleContentsLegacyUrl + implicitMultipleContentsLegacyUrl, ).then(function (tileset) { // the placeholder tile does not have any extensions. const placeholderTile = tileset.root; @@ -1100,7 +1100,7 @@ describe( const childTileHeader = childTile._header; expect(childTileHeader.extensions["3DTILES_extension"]).toEqual( - otherExtension + otherExtension, ); const innerContentHeaders = childTileHeader.contents; @@ -1181,14 +1181,14 @@ describe( metadata: groupMetadata, }); expect(content.group.metadata).toBe(groupMetadata); - } + }, ); }); it("group metadata gets transcoded correctly", function () { return Cesium3DTilesTester.loadTileset( scene, - implicitGroupMetadataUrl + implicitGroupMetadataUrl, ).then(function (tileset) { const placeholderTile = tileset.root; const subtreeRootTile = placeholderTile.children[0]; @@ -1198,13 +1198,13 @@ describe( const groups = tileset.metadataExtension.groups; const ground = groups[0]; expect(ground.getProperty("color")).toEqual( - new Cartesian3(120, 68, 32) + new Cartesian3(120, 68, 32), ); expect(ground.getProperty("priority")).toBe(0); const sky = groups[1]; expect(sky.getProperty("color")).toEqual( - new Cartesian3(206, 237, 242) + new Cartesian3(206, 237, 242), ); expect(sky.getProperty("priority")).toBe(1); @@ -1225,7 +1225,7 @@ describe( it("assigning content metadata throws", function () { return Cesium3DTilesTester.loadTileset( scene, - implicitContentMetadataUrl + implicitContentMetadataUrl, ).then(function (tileset) { expect(function () { const placeholderTile = tileset.root; @@ -1238,7 +1238,7 @@ describe( it("content metadata gets transcoded correctly", function () { return Cesium3DTilesTester.loadTileset( scene, - implicitContentMetadataUrl + implicitContentMetadataUrl, ).then(function (tileset) { const expectedHeights = [10, 20, 0, 30, 40]; const expectedColors = [ @@ -1266,10 +1266,10 @@ describe( expect(metadata.getProperty("color")).not.toBeDefined(); } else { expect(metadata.getProperty("height")).toBe( - expectedHeights[index] + expectedHeights[index], ); expect(metadata.getProperty("color")).toEqual( - expectedColors[index] + expectedColors[index], ); } } @@ -1279,7 +1279,7 @@ describe( it("multiple content metadata views get transcoded correctly", function () { return Cesium3DTilesTester.loadTileset( scene, - implicitMultipleContentsMetadataUrl + implicitMultipleContentsMetadataUrl, ).then(function (tileset) { const expectedHeights = [10, 20, 30, 40, 50]; const expectedColors = [ @@ -1313,10 +1313,10 @@ describe( } expect(buildingMetadata.getProperty("height")).toBe( - expectedHeights[index] + expectedHeights[index], ); expect(buildingMetadata.getProperty("color")).toEqual( - expectedColors[index] + expectedColors[index], ); if (i === 0) { @@ -1326,7 +1326,7 @@ describe( const treeContent = tile.content.innerContents[1]; const treeMetadata = treeContent.metadata; expect(treeMetadata.getProperty("age")).toEqual( - expectedAges[index - 1] + expectedAges[index - 1], ); } }); @@ -1343,7 +1343,7 @@ describe( viewCartographicOrigin(10000); return Cesium3DTilesTester.loadTileset( scene, - implicitHeightSemanticsUrl + implicitHeightSemanticsUrl, ).then(function (tileset) { const placeholderTile = tileset.root; const subtreeRootTile = placeholderTile.children[0]; @@ -1369,7 +1369,7 @@ describe( viewCartographicOrigin(10000); return Cesium3DTilesTester.loadTileset( scene, - implicitS2HeightSemanticsUrl + implicitS2HeightSemanticsUrl, ).then(function (tileset) { const placeholderTile = tileset.root; const subtreeRootTile = placeholderTile.children[0]; @@ -1428,7 +1428,7 @@ describe( viewCartographicOrigin(cameraHeight); return Cesium3DTilesTester.loadTileset( scene, - implicitHeightSemanticsUrl + implicitHeightSemanticsUrl, ).then(function (tileset) { const placeholderTile = tileset.root; const subtreeRootTile = placeholderTile.children[0]; @@ -1452,14 +1452,14 @@ describe( viewCartographicOrigin(124000); return Cesium3DTilesTester.loadTileset( scene, - implicitTileBoundingVolumeSemanticsUrl + implicitTileBoundingVolumeSemanticsUrl, ).then(function (tileset) { const placeholderTile = tileset.root.children[0]; const subtreeRootTile = placeholderTile.children[0]; const rootHalfWidth = 2048; expect(getHalfWidth(subtreeRootTile.boundingVolume)).toBe( - rootHalfWidth + rootHalfWidth, ); for (let level = 1; level < 4; level++) { @@ -1482,7 +1482,7 @@ describe( viewCartographicOrigin(10000); return Cesium3DTilesTester.loadTileset( scene, - implicitHeightAndSphereSemanticsUrl + implicitHeightAndSphereSemanticsUrl, ).then(function (tileset) { const placeholderTile = tileset.root; const subtreeRootTile = placeholderTile.children[0]; @@ -1511,7 +1511,7 @@ describe( viewCartographicOrigin(10000); return Cesium3DTilesTester.loadTileset( scene, - implicitHeightAndRegionSemanticsUrl + implicitHeightAndRegionSemanticsUrl, ).then(function (tileset) { const placeholderTile = tileset.root; const subtreeRootTile = placeholderTile.children[0]; @@ -1548,7 +1548,7 @@ describe( viewCartographicOrigin(124000); return Cesium3DTilesTester.loadTileset( scene, - implicitContentBoundingVolumeSemanticsUrl + implicitContentBoundingVolumeSemanticsUrl, ).then(function (tileset) { const placeholderTile = tileset.root.children[0]; const subtreeRootTile = placeholderTile.children[0]; @@ -1560,7 +1560,7 @@ describe( gatherTilesPreorder(subtreeRootTile, 0, 3, tiles); tiles.forEach(function (tile) { expect( - tile.contentBoundingVolume instanceof TileBoundingSphere + tile.contentBoundingVolume instanceof TileBoundingSphere, ).toBe(true); expect(tile.contentBoundingVolume).not.toBe(tile.boundingVolume); }); @@ -1571,7 +1571,7 @@ describe( viewCartographicOrigin(10000); return Cesium3DTilesTester.loadTileset( scene, - implicitContentHeightSemanticsUrl + implicitContentHeightSemanticsUrl, ).then(function (tileset) { const placeholderTile = tileset.root; const subtreeRootTile = placeholderTile.children[0]; @@ -1598,7 +1598,7 @@ describe( viewCartographicOrigin(10000); return Cesium3DTilesTester.loadTileset( scene, - implicitContentHeightAndRegionSemanticsUrl + implicitContentHeightAndRegionSemanticsUrl, ).then(function (tileset) { const placeholderTile = tileset.root; const subtreeRootTile = placeholderTile.children[0]; @@ -1635,7 +1635,7 @@ describe( viewCartographicOrigin(10000); return Cesium3DTilesTester.loadTileset( scene, - implicitGeometricErrorSemanticsUrl + implicitGeometricErrorSemanticsUrl, ).then(function (tileset) { const placeholderTile = tileset.root; const subtreeRootTile = placeholderTile.children[0]; @@ -1687,7 +1687,7 @@ describe( it("group metadata gets transcoded correctly (legacy)", function () { return Cesium3DTilesTester.loadTileset( scene, - implicitGroupMetadataLegacyUrl + implicitGroupMetadataLegacyUrl, ).then(function (tileset) { const placeholderTile = tileset.root; const subtreeRootTile = placeholderTile.children[0]; @@ -1697,13 +1697,13 @@ describe( const groups = tileset.metadataExtension.groups; const ground = groups[0]; expect(ground.getProperty("color")).toEqual( - new Cartesian3(120, 68, 32) + new Cartesian3(120, 68, 32), ); expect(ground.getProperty("priority")).toBe(0); const sky = groups[1]; expect(sky.getProperty("color")).toEqual( - new Cartesian3(206, 237, 242) + new Cartesian3(206, 237, 242), ); expect(sky.getProperty("priority")).toBe(1); @@ -1724,7 +1724,7 @@ describe( it("content metadata gets transcoded correctly (legacy)", function () { return Cesium3DTilesTester.loadTileset( scene, - implicitContentMetadataLegacyUrl + implicitContentMetadataLegacyUrl, ).then(function (tileset) { const expectedHeights = [10, 20, 0, 30, 40]; const expectedColors = [ @@ -1752,10 +1752,10 @@ describe( expect(metadata.getProperty("color")).not.toBeDefined(); } else { expect(metadata.getProperty("height")).toBe( - expectedHeights[index] + expectedHeights[index], ); expect(metadata.getProperty("color")).toEqual( - expectedColors[index] + expectedColors[index], ); } } @@ -1765,7 +1765,7 @@ describe( it("multiple content metadata views get transcoded correctly (legacy)", function () { return Cesium3DTilesTester.loadTileset( scene, - implicitMultipleContentsMetadataLegacyUrl + implicitMultipleContentsMetadataLegacyUrl, ).then(function (tileset) { const expectedHeights = [10, 20, 30, 40, 50]; const expectedColors = [ @@ -1799,10 +1799,10 @@ describe( } expect(buildingMetadata.getProperty("height")).toBe( - expectedHeights[index] + expectedHeights[index], ); expect(buildingMetadata.getProperty("color")).toEqual( - expectedColors[index] + expectedColors[index], ); if (i === 0) { @@ -1812,7 +1812,7 @@ describe( const treeContent = tile.content.innerContents[1]; const treeMetadata = treeContent.metadata; expect(treeMetadata.getProperty("age")).toEqual( - expectedAges[index - 1] + expectedAges[index - 1], ); } }); @@ -1829,7 +1829,7 @@ describe( viewCartographicOrigin(10000); return Cesium3DTilesTester.loadTileset( scene, - implicitHeightSemanticsLegacyUrl + implicitHeightSemanticsLegacyUrl, ).then(function (tileset) { const placeholderTile = tileset.root; const subtreeRootTile = placeholderTile.children[0]; @@ -1855,7 +1855,7 @@ describe( viewCartographicOrigin(10000); return Cesium3DTilesTester.loadTileset( scene, - implicitS2HeightSemanticsLegacyUrl + implicitS2HeightSemanticsLegacyUrl, ).then(function (tileset) { const placeholderTile = tileset.root; const subtreeRootTile = placeholderTile.children[0]; @@ -1914,7 +1914,7 @@ describe( viewCartographicOrigin(cameraHeight); return Cesium3DTilesTester.loadTileset( scene, - implicitHeightSemanticsLegacyUrl + implicitHeightSemanticsLegacyUrl, ).then(function (tileset) { const placeholderTile = tileset.root; const subtreeRootTile = placeholderTile.children[0]; @@ -1938,14 +1938,14 @@ describe( viewCartographicOrigin(124000); return Cesium3DTilesTester.loadTileset( scene, - implicitTileBoundingVolumeSemanticsLegacyUrl + implicitTileBoundingVolumeSemanticsLegacyUrl, ).then(function (tileset) { const placeholderTile = tileset.root.children[0]; const subtreeRootTile = placeholderTile.children[0]; const rootHalfWidth = 2048; expect(getHalfWidth(subtreeRootTile.boundingVolume)).toBe( - rootHalfWidth + rootHalfWidth, ); for (let level = 1; level < 4; level++) { @@ -1968,7 +1968,7 @@ describe( viewCartographicOrigin(10000); return Cesium3DTilesTester.loadTileset( scene, - implicitHeightAndSphereSemanticsLegacyUrl + implicitHeightAndSphereSemanticsLegacyUrl, ).then(function (tileset) { const placeholderTile = tileset.root; const subtreeRootTile = placeholderTile.children[0]; @@ -1997,7 +1997,7 @@ describe( viewCartographicOrigin(10000); return Cesium3DTilesTester.loadTileset( scene, - implicitHeightAndRegionSemanticsLegacyUrl + implicitHeightAndRegionSemanticsLegacyUrl, ).then(function (tileset) { const placeholderTile = tileset.root; const subtreeRootTile = placeholderTile.children[0]; @@ -2034,7 +2034,7 @@ describe( viewCartographicOrigin(124000); return Cesium3DTilesTester.loadTileset( scene, - implicitContentBoundingVolumeSemanticsLegacyUrl + implicitContentBoundingVolumeSemanticsLegacyUrl, ).then(function (tileset) { const placeholderTile = tileset.root.children[0]; const subtreeRootTile = placeholderTile.children[0]; @@ -2046,7 +2046,7 @@ describe( gatherTilesPreorder(subtreeRootTile, 0, 3, tiles); tiles.forEach(function (tile) { expect( - tile.contentBoundingVolume instanceof TileBoundingSphere + tile.contentBoundingVolume instanceof TileBoundingSphere, ).toBe(true); expect(tile.contentBoundingVolume).not.toBe(tile.boundingVolume); }); @@ -2057,7 +2057,7 @@ describe( viewCartographicOrigin(10000); return Cesium3DTilesTester.loadTileset( scene, - implicitContentHeightSemanticsLegacyUrl + implicitContentHeightSemanticsLegacyUrl, ).then(function (tileset) { const placeholderTile = tileset.root; const subtreeRootTile = placeholderTile.children[0]; @@ -2084,7 +2084,7 @@ describe( viewCartographicOrigin(10000); return Cesium3DTilesTester.loadTileset( scene, - implicitContentHeightAndRegionSemanticsLegacyUrl + implicitContentHeightAndRegionSemanticsLegacyUrl, ).then(function (tileset) { const placeholderTile = tileset.root; const subtreeRootTile = placeholderTile.children[0]; @@ -2121,7 +2121,7 @@ describe( viewCartographicOrigin(10000); return Cesium3DTilesTester.loadTileset( scene, - implicitGeometricErrorSemanticsLegacyUrl + implicitGeometricErrorSemanticsLegacyUrl, ).then(function (tileset) { const placeholderTile = tileset.root; const subtreeRootTile = placeholderTile.children[0]; @@ -2144,5 +2144,5 @@ describe( }); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/ImplicitMetadataViewSpec.js b/packages/engine/Specs/Scene/ImplicitMetadataViewSpec.js index 089d3a3de96e..8df69ce9626a 100644 --- a/packages/engine/Specs/Scene/ImplicitMetadataViewSpec.js +++ b/packages/engine/Specs/Scene/ImplicitMetadataViewSpec.js @@ -205,7 +205,7 @@ describe("Scene/ImplicitMetadataView", function () { metadataQuadtree = new ImplicitTileset( tilesetResource, implicitQuadtreeJson, - metadataSchema + metadataSchema, ); rootCoordinates = new ImplicitTileCoordinates({ @@ -231,16 +231,15 @@ describe("Scene/ImplicitMetadataView", function () { let secondTreeView; beforeEach(async function () { - const results = ImplicitTilingTester.generateSubtreeBuffers( - subtreeDescription - ); + const results = + ImplicitTilingTester.generateSubtreeBuffers(subtreeDescription); subtree = await ImplicitSubtree.fromSubtreeJson( subtreeResource, undefined, results.subtreeBuffer, metadataQuadtree, - rootCoordinates + rootCoordinates, ); tileView = new ImplicitMetadataView({ @@ -419,7 +418,7 @@ describe("Scene/ImplicitMetadataView", function () { it("getProperty returns the property value for the metadata table", function () { expect(tileView.getProperty("highlightColor")).toEqual( - new Cartesian3(255, 0, 0) + new Cartesian3(255, 0, 0), ); expect(tileView.getProperty("buildingCount")).toBe(100); @@ -432,10 +431,10 @@ describe("Scene/ImplicitMetadataView", function () { it("getProperty returns the correct value for metadata table views that point to the same table", function () { expect(tileView.getProperty("highlightColor")).toEqual( - new Cartesian3(255, 0, 0) + new Cartesian3(255, 0, 0), ); expect(secondTileView.getProperty("highlightColor")).toEqual( - new Cartesian3(255, 255, 0) + new Cartesian3(255, 255, 0), ); expect(buildingView.getProperty("buildingType")).toEqual("Residential"); @@ -500,17 +499,17 @@ describe("Scene/ImplicitMetadataView", function () { it("getPropertyBySemantic returns undefined when there's no property with the given semantic", function () { expect(tileView.getPropertyBySemantic("_AREA")).not.toBeDefined(); expect( - buildingView.getPropertyBySemantic("_HIGHLIGHT_COLOR") + buildingView.getPropertyBySemantic("_HIGHLIGHT_COLOR"), ).not.toBeDefined(); expect(treeView.getPropertyBySemantic("_BUILDING_TYPE")).not.toBeDefined(); }); it("getPropertyBySemantic returns the property value", function () { expect(tileView.getPropertyBySemantic("_HIGHLIGHT_COLOR")).toEqual( - new Cartesian3(255, 0, 0) + new Cartesian3(255, 0, 0), ); expect(buildingView.getPropertyBySemantic("_BUILDING_TYPE")).toEqual( - "Residential" + "Residential", ); expect(treeView.getPropertyBySemantic("_TREE_SPECIES")).toEqual("Oak"); }); @@ -522,52 +521,52 @@ describe("Scene/ImplicitMetadataView", function () { it("getPropertyBySemantic returns correct values for metadata table views that point to the same table", function () { expect(tileView.getPropertyBySemantic("_HIGHLIGHT_COLOR")).toEqual( - new Cartesian3(255, 0, 0) + new Cartesian3(255, 0, 0), ); expect(secondTileView.getPropertyBySemantic("_HIGHLIGHT_COLOR")).toEqual( - new Cartesian3(255, 255, 0) + new Cartesian3(255, 255, 0), ); expect(buildingView.getPropertyBySemantic("_BUILDING_TYPE")).toEqual( - "Residential" + "Residential", ); expect(secondBuildingView.getPropertyBySemantic("_BUILDING_TYPE")).toEqual( - "Commercial" + "Commercial", ); expect(treeView.getPropertyBySemantic("_TREE_SPECIES")).toEqual("Oak"); expect(secondTreeView.getPropertyBySemantic("_TREE_SPECIES")).toEqual( - "Pine" + "Pine", ); }); it("setPropertyBySemantic sets property value", function () { expect(tileView.getPropertyBySemantic("_HIGHLIGHT_COLOR")).toEqual( - new Cartesian3(255, 0, 0) + new Cartesian3(255, 0, 0), ); expect( tileView.setPropertyBySemantic( "_HIGHLIGHT_COLOR", - new Cartesian3(0, 0, 0) - ) + new Cartesian3(0, 0, 0), + ), ).toBe(true); expect(tileView.getPropertyBySemantic("_HIGHLIGHT_COLOR")).toEqual( - new Cartesian3(0, 0, 0) + new Cartesian3(0, 0, 0), ); expect(buildingView.getPropertyBySemantic("_BUILDING_TYPE")).toEqual( - "Residential" + "Residential", ); expect(buildingView.setPropertyBySemantic("_BUILDING_TYPE", "Other")).toBe( - true + true, ); expect(buildingView.getPropertyBySemantic("_BUILDING_TYPE")).toEqual( - "Other" + "Other", ); expect(treeView.getPropertyBySemantic("_TREE_SPECIES")).toEqual("Oak"); expect(treeView.setPropertyBySemantic("_TREE_SPECIES", "Chestnut")).toBe( - true + true, ); expect(treeView.getPropertyBySemantic("_TREE_SPECIES")).toEqual("Chestnut"); }); @@ -584,41 +583,41 @@ describe("Scene/ImplicitMetadataView", function () { it("setPropertyBySemantic sets the correct value for metadata table views that point to the same table", function () { expect(tileView.getPropertyBySemantic("_HIGHLIGHT_COLOR")).toEqual( - new Cartesian3(255, 0, 0) + new Cartesian3(255, 0, 0), ); expect( tileView.setPropertyBySemantic( "_HIGHLIGHT_COLOR", - new Cartesian3(0, 0, 0) - ) + new Cartesian3(0, 0, 0), + ), ).toBe(true); expect(tileView.getPropertyBySemantic("_HIGHLIGHT_COLOR")).toEqual( - new Cartesian3(0, 0, 0) + new Cartesian3(0, 0, 0), ); expect(secondTileView.getPropertyBySemantic("_HIGHLIGHT_COLOR")).toEqual( - new Cartesian3(255, 255, 0) + new Cartesian3(255, 255, 0), ); expect(buildingView.getPropertyBySemantic("_BUILDING_TYPE")).toEqual( - "Residential" + "Residential", ); expect(buildingView.setPropertyBySemantic("_BUILDING_TYPE", "Other")).toBe( - true + true, ); expect(buildingView.getPropertyBySemantic("_BUILDING_TYPE")).toEqual( - "Other" + "Other", ); expect(secondBuildingView.getPropertyBySemantic("_BUILDING_TYPE")).toEqual( - "Commercial" + "Commercial", ); expect(treeView.getPropertyBySemantic("_TREE_SPECIES")).toEqual("Oak"); expect(treeView.setPropertyBySemantic("_TREE_SPECIES", "Chestnut")).toBe( - true + true, ); expect(treeView.getPropertyBySemantic("_TREE_SPECIES")).toEqual("Chestnut"); expect(secondTreeView.getPropertyBySemantic("_TREE_SPECIES")).toEqual( - "Pine" + "Pine", ); }); @@ -627,14 +626,14 @@ describe("Scene/ImplicitMetadataView", function () { expect( buildingView.setPropertyBySemantic( "_HIGHLIGHT_COLOR", - new Cartesian3(255, 0, 0) - ) + new Cartesian3(255, 0, 0), + ), ).toBe(false); expect( treeView.setPropertyBySemantic( "_HIGHLIGHT_COLOR", - new Cartesian3(255, 0, 0) - ) + new Cartesian3(255, 0, 0), + ), ).toBe(false); }); }); diff --git a/packages/engine/Specs/Scene/ImplicitSubdivisionSchemeSpec.js b/packages/engine/Specs/Scene/ImplicitSubdivisionSchemeSpec.js index b1198d03251d..43983838d177 100644 --- a/packages/engine/Specs/Scene/ImplicitSubdivisionSchemeSpec.js +++ b/packages/engine/Specs/Scene/ImplicitSubdivisionSchemeSpec.js @@ -10,7 +10,7 @@ describe("Scene/ImplicitSubdivisionScheme", function () { for (let i = 0; i < treeTypes.length; i++) { expect(ImplicitSubdivisionScheme.getBranchingFactor(treeTypes[i])).toBe( - branchingFactors[i] + branchingFactors[i], ); } }); diff --git a/packages/engine/Specs/Scene/ImplicitSubtreeCacheSpec.js b/packages/engine/Specs/Scene/ImplicitSubtreeCacheSpec.js index 9cfafaac261a..8a2ac96aa031 100644 --- a/packages/engine/Specs/Scene/ImplicitSubtreeCacheSpec.js +++ b/packages/engine/Specs/Scene/ImplicitSubtreeCacheSpec.js @@ -55,7 +55,7 @@ describe("Scene/ImplicitSubtreeCache", function () { implicitOctree = new ImplicitTileset( tilesetResource, implicitOctreeJson, - metadataSchema + metadataSchema, ); }); @@ -80,7 +80,7 @@ describe("Scene/ImplicitSubtreeCache", function () { subtreeConstantJson, undefined, implicitOctree, - octreeCoordinates + octreeCoordinates, ); cache.addSubtree(subtree); expect(cache._subtreeRequestCounter).toBe(1); @@ -101,7 +101,7 @@ describe("Scene/ImplicitSubtreeCache", function () { subtreeConstantJson, undefined, implicitOctree, - octreeCoordinates + octreeCoordinates, ); expect(() => cache.addSubtree(subtree)).toThrowDeveloperError(); }); @@ -123,17 +123,17 @@ describe("Scene/ImplicitSubtreeCache", function () { await Promise.all( octreeCoordArray.map(async (octreeCoord) => { const octreeCoordinates = new ImplicitTileCoordinates( - Object.assign({}, octreeCoordParams, octreeCoord) + Object.assign({}, octreeCoordParams, octreeCoord), ); const subtree = await ImplicitSubtree.fromSubtreeJson( subtreeResource, subtreeConstantJson, undefined, implicitOctree, - octreeCoordinates + octreeCoordinates, ); cache.addSubtree(subtree); - }) + }), ); expect(cache._subtreeRequestCounter).toBe(4); expect(cache._queue.length).toBe(3); diff --git a/packages/engine/Specs/Scene/ImplicitSubtreeSpec.js b/packages/engine/Specs/Scene/ImplicitSubtreeSpec.js index 7e275c53ae28..9843af4215ad 100644 --- a/packages/engine/Specs/Scene/ImplicitSubtreeSpec.js +++ b/packages/engine/Specs/Scene/ImplicitSubtreeSpec.js @@ -32,7 +32,7 @@ describe("Scene/ImplicitSubtree", function () { const expectedAvailability = availabilityToBooleanArray(availability); for (let i = 0; i < availability.lengthBits; i++) { expect(subtree.tileIsAvailableAtIndex(i)).toEqual( - expectedAvailability[i] + expectedAvailability[i], ); // same as above, but using coordinates expect( @@ -40,9 +40,9 @@ describe("Scene/ImplicitSubtree", function () { ImplicitTileCoordinates.fromTileIndex( subtree.implicitCoordinates.subdivisionScheme, subtree.implicitCoordinates.subtreeLevels, - i - ) - ) + i, + ), + ), ).toEqual(expectedAvailability[i]); } } @@ -53,7 +53,7 @@ describe("Scene/ImplicitSubtree", function () { const expectedAvailability = availabilityToBooleanArray(availability); for (let j = 0; j < availability.lengthBits; j++) { expect(subtree.contentIsAvailableAtIndex(j, i)).toEqual( - expectedAvailability[j] + expectedAvailability[j], ); // same as above, but using coordinates expect( @@ -61,10 +61,10 @@ describe("Scene/ImplicitSubtree", function () { ImplicitTileCoordinates.fromTileIndex( subtree.implicitCoordinates.subdivisionScheme, subtree.implicitCoordinates.subtreeLevels, - j + j, ), - i - ) + i, + ), ).toEqual(expectedAvailability[j]); } } @@ -74,7 +74,7 @@ describe("Scene/ImplicitSubtree", function () { const expectedAvailability = availabilityToBooleanArray(availability); for (let i = 0; i < availability.lengthBits; i++) { expect(subtree.childSubtreeIsAvailableAtIndex(i)).toEqual( - expectedAvailability[i] + expectedAvailability[i], ); // same as above, but using coordinates expect( @@ -83,9 +83,9 @@ describe("Scene/ImplicitSubtree", function () { subtree.implicitCoordinates.subdivisionScheme, subtree.implicitCoordinates.subtreeLevels, subtree.implicitCoordinates.subtreeLevels, - i - ) - ) + i, + ), + ), ).toEqual(expectedAvailability[i]); } } @@ -217,7 +217,7 @@ describe("Scene/ImplicitSubtree", function () { implicitQuadtree = new ImplicitTileset( tilesetResource, implicitQuadtreeJson, - metadataSchema + metadataSchema, ); quadtreeCoordinates = new ImplicitTileCoordinates({ @@ -231,7 +231,7 @@ describe("Scene/ImplicitSubtree", function () { implicitOctree = new ImplicitTileset( tilesetResource, implicitOctreeJson, - metadataSchema + metadataSchema, ); octreeCoordinates = new ImplicitTileCoordinates({ @@ -249,7 +249,7 @@ describe("Scene/ImplicitSubtree", function () { return new ImplicitSubtree( undefined, implicitQuadtree, - quadtreeCoordinates + quadtreeCoordinates, ); }).toThrowDeveloperError(); }); @@ -259,7 +259,7 @@ describe("Scene/ImplicitSubtree", function () { return new ImplicitSubtree( subtreeResource, undefined, - quadtreeCoordinates + quadtreeCoordinates, ); }).toThrowDeveloperError(); }); @@ -272,18 +272,18 @@ describe("Scene/ImplicitSubtree", function () { it("sets the implicit coordinates of the subtree's root", async function () { const results = ImplicitTilingTester.generateSubtreeBuffers( - internalQuadtreeDescription + internalQuadtreeDescription, ); const subtree = await ImplicitSubtree.fromSubtreeJson( subtreeResource, undefined, results.subtreeBuffer, implicitQuadtree, - quadtreeCoordinates + quadtreeCoordinates, ); expect(subtree.implicitCoordinates.isEqual(quadtreeCoordinates)).toEqual( - true + true, ); }); @@ -294,33 +294,33 @@ describe("Scene/ImplicitSubtree", function () { undefined, undefined, implicitQuadtree, - quadtreeCoordinates - ) + quadtreeCoordinates, + ), ).toBeRejectedWithDeveloperError(); }); it("gets availability from internal buffer", async function () { const results = ImplicitTilingTester.generateSubtreeBuffers( - internalQuadtreeDescription + internalQuadtreeDescription, ); const subtree = await ImplicitSubtree.fromSubtreeJson( subtreeResource, undefined, results.subtreeBuffer, implicitQuadtree, - quadtreeCoordinates + quadtreeCoordinates, ); expectTileAvailability( subtree, - internalQuadtreeDescription.tileAvailability + internalQuadtreeDescription.tileAvailability, ); expectContentAvailability( subtree, - internalQuadtreeDescription.contentAvailability + internalQuadtreeDescription.contentAvailability, ); expectChildSubtreeAvailability( subtree, - internalQuadtreeDescription.childSubtreeAvailability + internalQuadtreeDescription.childSubtreeAvailability, ); }); @@ -344,24 +344,23 @@ describe("Scene/ImplicitSubtree", function () { isInternal: false, }, }; - const results = ImplicitTilingTester.generateSubtreeBuffers( - subtreeDescription - ); + const results = + ImplicitTilingTester.generateSubtreeBuffers(subtreeDescription); const fetchExternal = spyOn(ResourceCache, "get").and.callFake( - fakeResourceLoader(results.externalBuffer) + fakeResourceLoader(results.externalBuffer), ); const subtree = await ImplicitSubtree.fromSubtreeJson( subtreeResource, undefined, results.subtreeBuffer, implicitQuadtree, - quadtreeCoordinates + quadtreeCoordinates, ); expectTileAvailability(subtree, subtreeDescription.tileAvailability); expectContentAvailability(subtree, subtreeDescription.contentAvailability); expectChildSubtreeAvailability( subtree, - subtreeDescription.childSubtreeAvailability + subtreeDescription.childSubtreeAvailability, ); expect(fetchExternal.calls.count()).toEqual(1); @@ -373,20 +372,20 @@ describe("Scene/ImplicitSubtree", function () { subtreeConstantJson, undefined, implicitQuadtree, - quadtreeCoordinates + quadtreeCoordinates, ); expectTileAvailability( subtree, - constantQuadtreeDescription.tileAvailability + constantQuadtreeDescription.tileAvailability, ); expectContentAvailability( subtree, - constantQuadtreeDescription.contentAvailability + constantQuadtreeDescription.contentAvailability, ); expectChildSubtreeAvailability( subtree, - constantQuadtreeDescription.childSubtreeAvailability + constantQuadtreeDescription.childSubtreeAvailability, ); }); @@ -415,7 +414,7 @@ describe("Scene/ImplicitSubtree", function () { const results = ImplicitTilingTester.generateSubtreeBuffers(description); const fetchExternal = spyOn(ResourceCache, "get").and.callFake( - fakeResourceLoader(results.externalBuffer) + fakeResourceLoader(results.externalBuffer), ); const subtree = await ImplicitSubtree.fromSubtreeJson( @@ -423,14 +422,14 @@ describe("Scene/ImplicitSubtree", function () { results.subtreeJson, undefined, implicitQuadtree, - quadtreeCoordinates + quadtreeCoordinates, ); expectTileAvailability(subtree, description.tileAvailability); expectContentAvailability(subtree, description.contentAvailability); expectChildSubtreeAvailability( subtree, - description.childSubtreeAvailability + description.childSubtreeAvailability, ); expect(fetchExternal.calls.count()).toEqual(1); @@ -448,20 +447,20 @@ describe("Scene/ImplicitSubtree", function () { undefined, results.subtreeBuffer, implicitQuadtree, - quadtreeCoordinates + quadtreeCoordinates, ); expectTileAvailability( subtree, - internalQuadtreeDescription.tileAvailability + internalQuadtreeDescription.tileAvailability, ); expectContentAvailability( subtree, - internalQuadtreeDescription.contentAvailability + internalQuadtreeDescription.contentAvailability, ); expectChildSubtreeAvailability( subtree, - internalQuadtreeDescription.childSubtreeAvailability + internalQuadtreeDescription.childSubtreeAvailability, ); }); @@ -486,14 +485,13 @@ describe("Scene/ImplicitSubtree", function () { }, }; - const results = ImplicitTilingTester.generateSubtreeBuffers( - subtreeDescription - ); + const results = + ImplicitTilingTester.generateSubtreeBuffers(subtreeDescription); // Put the subtree buffer in a larger buffer so the byteOffset is not 0 const paddingLength = 8; const biggerBuffer = new Uint8Array( - results.subtreeBuffer.length + paddingLength + results.subtreeBuffer.length + paddingLength, ); biggerBuffer.set(results.subtreeBuffer, paddingLength); const subtreeView = new Uint8Array(biggerBuffer.buffer, paddingLength); @@ -503,13 +501,13 @@ describe("Scene/ImplicitSubtree", function () { undefined, subtreeView, implicitQuadtree, - quadtreeCoordinates + quadtreeCoordinates, ); expectTileAvailability(subtree, subtreeDescription.tileAvailability); expectContentAvailability(subtree, subtreeDescription.contentAvailability); expectChildSubtreeAvailability( subtree, - subtreeDescription.childSubtreeAvailability + subtreeDescription.childSubtreeAvailability, ); }); @@ -534,25 +532,24 @@ describe("Scene/ImplicitSubtree", function () { isInternal: false, }, }; - const results = ImplicitTilingTester.generateSubtreeBuffers( - subtreeDescription - ); + const results = + ImplicitTilingTester.generateSubtreeBuffers(subtreeDescription); const fetchExternal = spyOn(ResourceCache, "get").and.callFake( - fakeResourceLoader(results.externalBuffer) + fakeResourceLoader(results.externalBuffer), ); const subtree = await ImplicitSubtree.fromSubtreeJson( subtreeResource, undefined, results.subtreeBuffer, implicitQuadtree, - quadtreeCoordinates + quadtreeCoordinates, ); expectTileAvailability(subtree, subtreeDescription.tileAvailability); expectContentAvailability(subtree, subtreeDescription.contentAvailability); expectChildSubtreeAvailability( subtree, - subtreeDescription.childSubtreeAvailability + subtreeDescription.childSubtreeAvailability, ); expect(fetchExternal.calls.count()).toEqual(1); }); @@ -577,19 +574,18 @@ describe("Scene/ImplicitSubtree", function () { isInternal: false, }, }; - const results = ImplicitTilingTester.generateSubtreeBuffers( - subtreeDescription - ); + const results = + ImplicitTilingTester.generateSubtreeBuffers(subtreeDescription); const fetchExternal = spyOn(ResourceCache, "get").and.callFake( - fakeResourceLoader(results.externalBuffer) + fakeResourceLoader(results.externalBuffer), ); await ImplicitSubtree.fromSubtreeJson( subtreeResource, undefined, results.subtreeBuffer, implicitQuadtree, - quadtreeCoordinates + quadtreeCoordinates, ); expect(fetchExternal.calls.count()).toEqual(1); }); @@ -619,20 +615,19 @@ describe("Scene/ImplicitSubtree", function () { isInternal: false, }, }; - const results = ImplicitTilingTester.generateSubtreeBuffers( - subtreeDescription - ); + const results = + ImplicitTilingTester.generateSubtreeBuffers(subtreeDescription); const fetchExternal = spyOn( Resource.prototype, - "fetchArrayBuffer" + "fetchArrayBuffer", ).and.returnValue(Promise.resolve(results.externalBuffer)); await ImplicitSubtree.fromSubtreeJson( subtreeResource, undefined, results.subtreeBuffer, implicitQuadtree, - quadtreeCoordinates + quadtreeCoordinates, ); expect(fetchExternal).not.toHaveBeenCalled(); }); @@ -656,22 +651,21 @@ describe("Scene/ImplicitSubtree", function () { isInternal: true, }; - const results = ImplicitTilingTester.generateSubtreeBuffers( - subtreeDescription - ); + const results = + ImplicitTilingTester.generateSubtreeBuffers(subtreeDescription); const subtree = await ImplicitSubtree.fromSubtreeJson( subtreeResource, undefined, results.subtreeBuffer, implicitQuadtree, - quadtreeCoordinates + quadtreeCoordinates, ); expectTileAvailability(subtree, subtreeDescription.tileAvailability); expectContentAvailability(subtree, expectedContentAvailability); expectChildSubtreeAvailability( subtree, - subtreeDescription.childSubtreeAvailability + subtreeDescription.childSubtreeAvailability, ); }); @@ -696,21 +690,20 @@ describe("Scene/ImplicitSubtree", function () { }, }; - const results = ImplicitTilingTester.generateSubtreeBuffers( - subtreeDescription - ); + const results = + ImplicitTilingTester.generateSubtreeBuffers(subtreeDescription); const subtree = await ImplicitSubtree.fromSubtreeJson( subtreeResource, undefined, results.subtreeBuffer, implicitQuadtree, - quadtreeCoordinates + quadtreeCoordinates, ); expectTileAvailability(subtree, subtreeDescription.tileAvailability); expectContentAvailability(subtree, subtreeDescription.contentAvailability); expectChildSubtreeAvailability( subtree, - subtreeDescription.childSubtreeAvailability + subtreeDescription.childSubtreeAvailability, ); }); @@ -734,15 +727,14 @@ describe("Scene/ImplicitSubtree", function () { isInternal: true, }, }; - const results = ImplicitTilingTester.generateSubtreeBuffers( - subtreeDescription - ); + const results = + ImplicitTilingTester.generateSubtreeBuffers(subtreeDescription); const subtree = await ImplicitSubtree.fromSubtreeJson( subtreeResource, undefined, results.subtreeBuffer, implicitOctree, - octreeCoordinates + octreeCoordinates, ); expect(subtree.getLevelOffset(2)).toEqual(9); @@ -768,9 +760,8 @@ describe("Scene/ImplicitSubtree", function () { isInternal: true, }, }; - const results = ImplicitTilingTester.generateSubtreeBuffers( - subtreeDescription - ); + const results = + ImplicitTilingTester.generateSubtreeBuffers(subtreeDescription); const deeperQuadtreeCoordinates = new ImplicitTileCoordinates({ subdivisionScheme: implicitQuadtree.subdivisionScheme, @@ -785,7 +776,7 @@ describe("Scene/ImplicitSubtree", function () { undefined, results.subtreeBuffer, implicitQuadtree, - deeperQuadtreeCoordinates + deeperQuadtreeCoordinates, ); expect(function () { @@ -830,9 +821,8 @@ describe("Scene/ImplicitSubtree", function () { isInternal: true, }, }; - const results = ImplicitTilingTester.generateSubtreeBuffers( - subtreeDescription - ); + const results = + ImplicitTilingTester.generateSubtreeBuffers(subtreeDescription); const subtreeCoordinates = new ImplicitTileCoordinates({ subdivisionScheme: implicitQuadtree.subdivisionScheme, subtreeLevels: implicitQuadtree.subtreeLevels, @@ -845,7 +835,7 @@ describe("Scene/ImplicitSubtree", function () { undefined, results.subtreeBuffer, implicitQuadtree, - subtreeCoordinates + subtreeCoordinates, ); // level offset: 1, morton index: 0, so tile index is 1 + 0 = 1 @@ -860,11 +850,11 @@ describe("Scene/ImplicitSubtree", function () { expect(indexFull).toBe(1); expect(subtree.tileIsAvailableAtIndex(indexFull)).toEqual(true); expect( - subtree.tileIsAvailableAtCoordinates(implicitCoordinatesFull) + subtree.tileIsAvailableAtCoordinates(implicitCoordinatesFull), ).toEqual(true); expect(subtree.contentIsAvailableAtIndex(indexFull)).toEqual(true); expect( - subtree.contentIsAvailableAtCoordinates(implicitCoordinatesFull) + subtree.contentIsAvailableAtCoordinates(implicitCoordinatesFull), ).toEqual(true); // level offset: 1, morton index: 3, so tile index is 1 + 3 = 4 @@ -879,11 +869,11 @@ describe("Scene/ImplicitSubtree", function () { expect(indexEmpty).toBe(4); expect(subtree.tileIsAvailableAtIndex(indexEmpty)).toEqual(false); expect( - subtree.tileIsAvailableAtCoordinates(implicitCoordinatesEmpty) + subtree.tileIsAvailableAtCoordinates(implicitCoordinatesEmpty), ).toEqual(false); expect(subtree.contentIsAvailableAtIndex(indexEmpty)).toEqual(false); expect( - subtree.contentIsAvailableAtCoordinates(implicitCoordinatesEmpty) + subtree.contentIsAvailableAtCoordinates(implicitCoordinatesEmpty), ).toEqual(false); }); @@ -907,9 +897,8 @@ describe("Scene/ImplicitSubtree", function () { isInternal: true, }, }; - const results = ImplicitTilingTester.generateSubtreeBuffers( - subtreeDescription - ); + const results = + ImplicitTilingTester.generateSubtreeBuffers(subtreeDescription); const deeperQuadtreeCoordinates = new ImplicitTileCoordinates({ subdivisionScheme: implicitQuadtree.subdivisionScheme, subtreeLevels: implicitQuadtree.subtreeLevels, @@ -922,7 +911,7 @@ describe("Scene/ImplicitSubtree", function () { undefined, results.subtreeBuffer, implicitQuadtree, - deeperQuadtreeCoordinates + deeperQuadtreeCoordinates, ); expect(function () { @@ -967,9 +956,8 @@ describe("Scene/ImplicitSubtree", function () { isInternal: true, }, }; - const results = ImplicitTilingTester.generateSubtreeBuffers( - subtreeDescription - ); + const results = + ImplicitTilingTester.generateSubtreeBuffers(subtreeDescription); const subtreeCoordinates = new ImplicitTileCoordinates({ subdivisionScheme: implicitQuadtree.subdivisionScheme, subtreeLevels: implicitQuadtree.subtreeLevels, @@ -982,7 +970,7 @@ describe("Scene/ImplicitSubtree", function () { undefined, results.subtreeBuffer, implicitQuadtree, - subtreeCoordinates + subtreeCoordinates, ); const implicitCoordinatesFull = new ImplicitTileCoordinates({ @@ -998,7 +986,7 @@ describe("Scene/ImplicitSubtree", function () { expect(indexFull).toBe(0); expect(subtree.childSubtreeIsAvailableAtIndex(indexFull)).toEqual(true); expect( - subtree.childSubtreeIsAvailableAtCoordinates(implicitCoordinatesFull) + subtree.childSubtreeIsAvailableAtCoordinates(implicitCoordinatesFull), ).toEqual(true); const implicitCoordinatesEmpty = new ImplicitTileCoordinates({ @@ -1014,7 +1002,7 @@ describe("Scene/ImplicitSubtree", function () { expect(indexEmpty).toBe(3); expect(subtree.childSubtreeIsAvailableAtIndex(indexEmpty)).toEqual(false); expect( - subtree.childSubtreeIsAvailableAtCoordinates(implicitCoordinatesEmpty) + subtree.childSubtreeIsAvailableAtCoordinates(implicitCoordinatesEmpty), ).toEqual(false); }); @@ -1038,15 +1026,14 @@ describe("Scene/ImplicitSubtree", function () { isInternal: true, }, }; - const results = ImplicitTilingTester.generateSubtreeBuffers( - subtreeDescription - ); + const results = + ImplicitTilingTester.generateSubtreeBuffers(subtreeDescription); const subtree = await ImplicitSubtree.fromSubtreeJson( subtreeResource, undefined, results.subtreeBuffer, implicitOctree, - octreeCoordinates + octreeCoordinates, ); // 341 = 0b101010101 @@ -1075,21 +1062,20 @@ describe("Scene/ImplicitSubtree", function () { }, }; - const results = ImplicitTilingTester.generateSubtreeBuffers( - subtreeDescription - ); + const results = + ImplicitTilingTester.generateSubtreeBuffers(subtreeDescription); const subtree = await ImplicitSubtree.fromSubtreeJson( subtreeResource, undefined, results.subtreeBuffer, implicitOctree, - octreeCoordinates + octreeCoordinates, ); expectTileAvailability(subtree, subtreeDescription.tileAvailability); expectContentAvailability(subtree, subtreeDescription.contentAvailability); expectChildSubtreeAvailability( subtree, - subtreeDescription.childSubtreeAvailability + subtreeDescription.childSubtreeAvailability, ); }); @@ -1117,20 +1103,20 @@ describe("Scene/ImplicitSubtree", function () { const constantOnly = true; const results = ImplicitTilingTester.generateSubtreeBuffers( subtreeDescription, - constantOnly + constantOnly, ); const subtree = await ImplicitSubtree.fromSubtreeJson( subtreeResource, undefined, results.subtreeBuffer, implicitOctree, - octreeCoordinates + octreeCoordinates, ); expectTileAvailability(subtree, subtreeDescription.tileAvailability); expectContentAvailability(subtree, subtreeDescription.contentAvailability); expectChildSubtreeAvailability( subtree, - subtreeDescription.childSubtreeAvailability + subtreeDescription.childSubtreeAvailability, ); }); @@ -1154,11 +1140,10 @@ describe("Scene/ImplicitSubtree", function () { isInternal: false, }, }; - const results = ImplicitTilingTester.generateSubtreeBuffers( - subtreeDescription - ); + const results = + ImplicitTilingTester.generateSubtreeBuffers(subtreeDescription); spyOn(ResourceCache, "get").and.callFake( - fakeResourceLoader(results.externalBuffer) + fakeResourceLoader(results.externalBuffer), ); const unload = spyOn(ResourceCache, "unload"); const subtree = await ImplicitSubtree.fromSubtreeJson( @@ -1166,7 +1151,7 @@ describe("Scene/ImplicitSubtree", function () { undefined, results.subtreeBuffer, implicitQuadtree, - quadtreeCoordinates + quadtreeCoordinates, ); const bufferLoader = subtree._bufferLoader; expect(bufferLoader).toBeDefined(); @@ -1208,7 +1193,7 @@ describe("Scene/ImplicitSubtree", function () { multipleContentsQuadtree = new ImplicitTileset( tilesetResource, tileJson, - metadataSchema + metadataSchema, ); multipleContentsCoordinates = new ImplicitTileCoordinates({ @@ -1245,15 +1230,14 @@ describe("Scene/ImplicitSubtree", function () { isInternal: true, }, }; - const results = ImplicitTilingTester.generateSubtreeBuffers( - subtreeDescription - ); + const results = + ImplicitTilingTester.generateSubtreeBuffers(subtreeDescription); const subtree = await ImplicitSubtree.fromSubtreeJson( subtreeResource, undefined, results.subtreeBuffer, multipleContentsQuadtree, - multipleContentsCoordinates + multipleContentsCoordinates, ); const outOfBounds = 100; @@ -1288,11 +1272,10 @@ describe("Scene/ImplicitSubtree", function () { }, }; - const results = ImplicitTilingTester.generateSubtreeBuffers( - subtreeDescription - ); + const results = + ImplicitTilingTester.generateSubtreeBuffers(subtreeDescription); const fetchExternal = spyOn(ResourceCache, "get").and.callFake( - fakeResourceLoader(results.externalBuffer) + fakeResourceLoader(results.externalBuffer), ); const subtree = await ImplicitSubtree.fromSubtreeJson( @@ -1300,14 +1283,14 @@ describe("Scene/ImplicitSubtree", function () { undefined, results.subtreeBuffer, multipleContentsQuadtree, - multipleContentsCoordinates + multipleContentsCoordinates, ); expect(fetchExternal).toHaveBeenCalled(); expectTileAvailability(subtree, subtreeDescription.tileAvailability); expectContentAvailability( subtree, - subtreeDescription.contentAvailability + subtreeDescription.contentAvailability, ); }); @@ -1338,11 +1321,10 @@ describe("Scene/ImplicitSubtree", function () { useLegacySchema: true, }; - const results = ImplicitTilingTester.generateSubtreeBuffers( - subtreeDescription - ); + const results = + ImplicitTilingTester.generateSubtreeBuffers(subtreeDescription); const fetchExternal = spyOn(ResourceCache, "get").and.callFake( - fakeResourceLoader(results.externalBuffer) + fakeResourceLoader(results.externalBuffer), ); const subtree = await ImplicitSubtree.fromSubtreeJson( @@ -1350,14 +1332,14 @@ describe("Scene/ImplicitSubtree", function () { undefined, results.subtreeBuffer, multipleContentsQuadtree, - multipleContentsCoordinates + multipleContentsCoordinates, ); expect(fetchExternal).toHaveBeenCalled(); expectTileAvailability(subtree, subtreeDescription.tileAvailability); expectContentAvailability( subtree, - subtreeDescription.contentAvailability + subtreeDescription.contentAvailability, ); }); }); @@ -1518,31 +1500,31 @@ describe("Scene/ImplicitSubtree", function () { subtreeMetadataSchema = MetadataSchema.fromJson(subtreeSchema); buildingMetadataSchema = MetadataSchema.fromJson(buildingSchema); multipleContentsMetadataSchema = MetadataSchema.fromJson( - multipleContentsSchema + multipleContentsSchema, ); tileMetadataQuadtree = new ImplicitTileset( tilesetResource, implicitQuadtreeJson, - tileMetadataSchema + tileMetadataSchema, ); subtreeMetadataQuadtree = new ImplicitTileset( tilesetResource, implicitQuadtreeJson, - subtreeMetadataSchema + subtreeMetadataSchema, ); buildingMetadataQuadtree = new ImplicitTileset( tilesetResource, implicitQuadtreeJson, - buildingMetadataSchema + buildingMetadataSchema, ); multipleContentsMetadataQuadtree = new ImplicitTileset( tilesetResource, implicitQuadtreeJson, - multipleContentsMetadataSchema + multipleContentsMetadataSchema, ); }); @@ -1571,7 +1553,7 @@ describe("Scene/ImplicitSubtree", function () { metadataSubtreeJson, undefined, subtreeMetadataQuadtree, - quadtreeCoordinates + quadtreeCoordinates, ); const metadata = subtree.metadata; @@ -1610,18 +1592,17 @@ describe("Scene/ImplicitSubtree", function () { }, }; - const results = ImplicitTilingTester.generateSubtreeBuffers( - subtreeDescription - ); + const results = + ImplicitTilingTester.generateSubtreeBuffers(subtreeDescription); const fetchExternal = spyOn(ResourceCache, "get").and.callFake( - fakeResourceLoader(results.externalBuffer) + fakeResourceLoader(results.externalBuffer), ); const subtree = await ImplicitSubtree.fromSubtreeJson( subtreeResource, undefined, results.subtreeBuffer, tileMetadataQuadtree, - quadtreeCoordinates + quadtreeCoordinates, ); expect(fetchExternal).not.toHaveBeenCalled(); @@ -1632,10 +1613,10 @@ describe("Scene/ImplicitSubtree", function () { for (let i = 0; i < buildingCounts.length; i++) { expect(metadataTable.getProperty(i, "highlightColor")).toEqual( - Cartesian3.unpack(highlightColors[i]) + Cartesian3.unpack(highlightColors[i]), ); expect(metadataTable.getProperty(i, "buildingCount")).toBe( - buildingCounts[i] + buildingCounts[i], ); } }); @@ -1666,18 +1647,17 @@ describe("Scene/ImplicitSubtree", function () { }, }; - const results = ImplicitTilingTester.generateSubtreeBuffers( - subtreeDescription - ); + const results = + ImplicitTilingTester.generateSubtreeBuffers(subtreeDescription); const fetchExternal = spyOn(ResourceCache, "get").and.callFake( - fakeResourceLoader(results.externalBuffer) + fakeResourceLoader(results.externalBuffer), ); const subtree = await ImplicitSubtree.fromSubtreeJson( subtreeResource, undefined, results.subtreeBuffer, tileMetadataQuadtree, - quadtreeCoordinates + quadtreeCoordinates, ); expect(fetchExternal).toHaveBeenCalled(); @@ -1688,10 +1668,10 @@ describe("Scene/ImplicitSubtree", function () { for (let i = 0; i < buildingCounts.length; i++) { expect(metadataTable.getProperty(i, "highlightColor")).toEqual( - Cartesian3.unpack(highlightColors[i]) + Cartesian3.unpack(highlightColors[i]), ); expect(metadataTable.getProperty(i, "buildingCount")).toBe( - buildingCounts[i] + buildingCounts[i], ); } }); @@ -1722,18 +1702,17 @@ describe("Scene/ImplicitSubtree", function () { }, }; - const results = ImplicitTilingTester.generateSubtreeBuffers( - subtreeDescription - ); + const results = + ImplicitTilingTester.generateSubtreeBuffers(subtreeDescription); const fetchExternal = spyOn(ResourceCache, "get").and.callFake( - fakeResourceLoader(results.externalBuffer) + fakeResourceLoader(results.externalBuffer), ); const subtree = await ImplicitSubtree.fromSubtreeJson( subtreeResource, undefined, results.subtreeBuffer, buildingMetadataQuadtree, - quadtreeCoordinates + quadtreeCoordinates, ); expect(fetchExternal).not.toHaveBeenCalled(); @@ -1747,10 +1726,10 @@ describe("Scene/ImplicitSubtree", function () { for (let i = 0; i < buildingHeights.length; i++) { expect(metadataTable.getProperty(i, "height")).toEqual( - buildingHeights[i] + buildingHeights[i], ); expect(metadataTable.getProperty(i, "buildingType")).toBe( - buildingTypes[i] + buildingTypes[i], ); } }); @@ -1781,18 +1760,17 @@ describe("Scene/ImplicitSubtree", function () { }, }; - const results = ImplicitTilingTester.generateSubtreeBuffers( - subtreeDescription - ); + const results = + ImplicitTilingTester.generateSubtreeBuffers(subtreeDescription); const fetchExternal = spyOn(ResourceCache, "get").and.callFake( - fakeResourceLoader(results.externalBuffer) + fakeResourceLoader(results.externalBuffer), ); const subtree = await ImplicitSubtree.fromSubtreeJson( subtreeResource, undefined, results.subtreeBuffer, buildingMetadataQuadtree, - quadtreeCoordinates + quadtreeCoordinates, ); expect(fetchExternal).toHaveBeenCalled(); @@ -1806,10 +1784,10 @@ describe("Scene/ImplicitSubtree", function () { for (let i = 0; i < buildingHeights.length; i++) { expect(metadataTable.getProperty(i, "height")).toEqual( - buildingHeights[i] + buildingHeights[i], ); expect(metadataTable.getProperty(i, "buildingType")).toBe( - buildingTypes[i] + buildingTypes[i], ); } }); @@ -1845,18 +1823,17 @@ describe("Scene/ImplicitSubtree", function () { }, }; - const results = ImplicitTilingTester.generateSubtreeBuffers( - subtreeDescription - ); + const results = + ImplicitTilingTester.generateSubtreeBuffers(subtreeDescription); const fetchExternal = spyOn(ResourceCache, "get").and.callFake( - fakeResourceLoader(results.externalBuffer) + fakeResourceLoader(results.externalBuffer), ); const subtree = await ImplicitSubtree.fromSubtreeJson( subtreeResource, undefined, results.subtreeBuffer, multipleContentsMetadataQuadtree, - quadtreeCoordinates + quadtreeCoordinates, ); expect(fetchExternal).not.toHaveBeenCalled(); @@ -1870,10 +1847,10 @@ describe("Scene/ImplicitSubtree", function () { for (let i = 0; i < buildingHeights.length; i++) { expect(buildingMetadataTable.getProperty(i, "height")).toEqual( - buildingHeights[i] + buildingHeights[i], ); expect(buildingMetadataTable.getProperty(i, "buildingType")).toBe( - buildingTypes[i] + buildingTypes[i], ); } @@ -1883,10 +1860,10 @@ describe("Scene/ImplicitSubtree", function () { for (let i = 0; i < treeHeights.length; i++) { expect(treeMetadataTable.getProperty(i, "height")).toEqual( - treeHeights[i] + treeHeights[i], ); expect(treeMetadataTable.getProperty(i, "species")).toBe( - treeSpecies[i] + treeSpecies[i], ); } }); @@ -1922,18 +1899,17 @@ describe("Scene/ImplicitSubtree", function () { }, }; - const results = ImplicitTilingTester.generateSubtreeBuffers( - subtreeDescription - ); + const results = + ImplicitTilingTester.generateSubtreeBuffers(subtreeDescription); const fetchExternal = spyOn(ResourceCache, "get").and.callFake( - fakeResourceLoader(results.externalBuffer) + fakeResourceLoader(results.externalBuffer), ); const subtree = await ImplicitSubtree.fromSubtreeJson( subtreeResource, undefined, results.subtreeBuffer, multipleContentsMetadataQuadtree, - quadtreeCoordinates + quadtreeCoordinates, ); expect(fetchExternal).toHaveBeenCalled(); @@ -1947,10 +1923,10 @@ describe("Scene/ImplicitSubtree", function () { for (let i = 0; i < buildingHeights.length; i++) { expect(buildingMetadataTable.getProperty(i, "height")).toEqual( - buildingHeights[i] + buildingHeights[i], ); expect(buildingMetadataTable.getProperty(i, "buildingType")).toBe( - buildingTypes[i] + buildingTypes[i], ); } @@ -1960,10 +1936,10 @@ describe("Scene/ImplicitSubtree", function () { for (let i = 0; i < treeHeights.length; i++) { expect(treeMetadataTable.getProperty(i, "height")).toEqual( - treeHeights[i] + treeHeights[i], ); expect(treeMetadataTable.getProperty(i, "species")).toBe( - treeSpecies[i] + treeSpecies[i], ); } }); @@ -1994,12 +1970,11 @@ describe("Scene/ImplicitSubtree", function () { }, }; - const results = ImplicitTilingTester.generateSubtreeBuffers( - subtreeDescription - ); + const results = + ImplicitTilingTester.generateSubtreeBuffers(subtreeDescription); const fetchExternal = spyOn(ResourceCache, "get").and.callFake( - fakeResourceLoader(results.externalBuffer) + fakeResourceLoader(results.externalBuffer), ); const subtree = await ImplicitSubtree.fromSubtreeJson( @@ -2007,17 +1982,17 @@ describe("Scene/ImplicitSubtree", function () { undefined, results.subtreeBuffer, tileMetadataQuadtree, - quadtreeCoordinates + quadtreeCoordinates, ); expect(fetchExternal).not.toHaveBeenCalled(); const metadataView = subtree.getTileMetadataView(quadtreeCoordinates); expect(metadataView).toBeDefined(); expect(metadataView.getProperty("highlightColor")).toEqual( - Cartesian3.unpack(highlightColors[0]) + Cartesian3.unpack(highlightColors[0]), ); expect(metadataView.getProperty("buildingCount")).toEqual( - buildingCounts[0] + buildingCounts[0], ); }); @@ -2047,12 +2022,11 @@ describe("Scene/ImplicitSubtree", function () { }, }; - const results = ImplicitTilingTester.generateSubtreeBuffers( - subtreeDescription - ); + const results = + ImplicitTilingTester.generateSubtreeBuffers(subtreeDescription); const fetchExternal = spyOn(ResourceCache, "get").and.callFake( - fakeResourceLoader(results.externalBuffer) + fakeResourceLoader(results.externalBuffer), ); const subtree = await ImplicitSubtree.fromSubtreeJson( @@ -2060,7 +2034,7 @@ describe("Scene/ImplicitSubtree", function () { undefined, results.subtreeBuffer, tileMetadataQuadtree, - quadtreeCoordinates + quadtreeCoordinates, ); expect(fetchExternal).not.toHaveBeenCalled(); @@ -2103,12 +2077,11 @@ describe("Scene/ImplicitSubtree", function () { }, }; - const results = ImplicitTilingTester.generateSubtreeBuffers( - subtreeDescription - ); + const results = + ImplicitTilingTester.generateSubtreeBuffers(subtreeDescription); const fetchExternal = spyOn(ResourceCache, "get").and.callFake( - fakeResourceLoader(results.externalBuffer) + fakeResourceLoader(results.externalBuffer), ); const subtree = await ImplicitSubtree.fromSubtreeJson( @@ -2116,18 +2089,18 @@ describe("Scene/ImplicitSubtree", function () { undefined, results.subtreeBuffer, buildingMetadataQuadtree, - quadtreeCoordinates + quadtreeCoordinates, ); expect(fetchExternal).not.toHaveBeenCalled(); const metadataView = subtree.getContentMetadataView( quadtreeCoordinates, - 0 + 0, ); expect(metadataView).toBeDefined(); expect(metadataView.getProperty("height")).toEqual(buildingHeights[0]); expect(metadataView.getProperty("buildingType")).toEqual( - buildingTypes[0] + buildingTypes[0], ); }); @@ -2157,12 +2130,11 @@ describe("Scene/ImplicitSubtree", function () { }, }; - const results = ImplicitTilingTester.generateSubtreeBuffers( - subtreeDescription - ); + const results = + ImplicitTilingTester.generateSubtreeBuffers(subtreeDescription); const fetchExternal = spyOn(ResourceCache, "get").and.callFake( - fakeResourceLoader(results.externalBuffer) + fakeResourceLoader(results.externalBuffer), ); const subtree = await ImplicitSubtree.fromSubtreeJson( @@ -2170,7 +2142,7 @@ describe("Scene/ImplicitSubtree", function () { undefined, results.subtreeBuffer, buildingMetadataQuadtree, - quadtreeCoordinates + quadtreeCoordinates, ); expect(fetchExternal).not.toHaveBeenCalled(); @@ -2218,12 +2190,11 @@ describe("Scene/ImplicitSubtree", function () { }, }; - const results = ImplicitTilingTester.generateSubtreeBuffers( - subtreeDescription - ); + const results = + ImplicitTilingTester.generateSubtreeBuffers(subtreeDescription); const fetchExternal = spyOn(ResourceCache, "get").and.callFake( - fakeResourceLoader(results.externalBuffer) + fakeResourceLoader(results.externalBuffer), ); const subtree = await ImplicitSubtree.fromSubtreeJson( @@ -2231,7 +2202,7 @@ describe("Scene/ImplicitSubtree", function () { undefined, results.subtreeBuffer, multipleContentsMetadataQuadtree, - quadtreeCoordinates + quadtreeCoordinates, ); expect(fetchExternal).not.toHaveBeenCalled(); @@ -2245,14 +2216,14 @@ describe("Scene/ImplicitSubtree", function () { const buildingMetadataView = subtree.getContentMetadataView( coordinates, - 0 + 0, ); expect(buildingMetadataView).toBeDefined(); expect(buildingMetadataView.getProperty("height")).toEqual( - buildingHeights[2] + buildingHeights[2], ); expect(buildingMetadataView.getProperty("buildingType")).toEqual( - buildingTypes[2] + buildingTypes[2], ); const treeMetadataView = subtree.getContentMetadataView(coordinates, 1); @@ -2292,12 +2263,11 @@ describe("Scene/ImplicitSubtree", function () { }, }; - const results = ImplicitTilingTester.generateSubtreeBuffers( - subtreeDescription - ); + const results = + ImplicitTilingTester.generateSubtreeBuffers(subtreeDescription); const fetchExternal = spyOn(ResourceCache, "get").and.callFake( - fakeResourceLoader(results.externalBuffer) + fakeResourceLoader(results.externalBuffer), ); const subtree = await ImplicitSubtree.fromSubtreeJson( @@ -2305,7 +2275,7 @@ describe("Scene/ImplicitSubtree", function () { undefined, results.subtreeBuffer, multipleContentsMetadataQuadtree, - quadtreeCoordinates + quadtreeCoordinates, ); expect(fetchExternal).not.toHaveBeenCalled(); @@ -2319,13 +2289,13 @@ describe("Scene/ImplicitSubtree", function () { const buildingMetadataView = subtree.getContentMetadataView( coordinates, - 0 + 0, ); expect(buildingMetadataView).not.toBeDefined(); const treeMetadataView = subtree.getContentMetadataView( quadtreeCoordinates, - 1 + 1, ); expect(treeMetadataView).not.toBeDefined(); }); @@ -2357,18 +2327,17 @@ describe("Scene/ImplicitSubtree", function () { useLegacySchema: true, }; - const results = ImplicitTilingTester.generateSubtreeBuffers( - subtreeDescription - ); + const results = + ImplicitTilingTester.generateSubtreeBuffers(subtreeDescription); const fetchExternal = spyOn(ResourceCache, "get").and.callFake( - fakeResourceLoader(results.externalBuffer) + fakeResourceLoader(results.externalBuffer), ); const subtree = await ImplicitSubtree.fromSubtreeJson( subtreeResource, undefined, results.subtreeBuffer, buildingMetadataQuadtree, - quadtreeCoordinates + quadtreeCoordinates, ); expect(fetchExternal).not.toHaveBeenCalled(); @@ -2382,10 +2351,10 @@ describe("Scene/ImplicitSubtree", function () { for (let i = 0; i < buildingHeights.length; i++) { expect(metadataTable.getProperty(i, "height")).toEqual( - buildingHeights[i] + buildingHeights[i], ); expect(metadataTable.getProperty(i, "buildingType")).toBe( - buildingTypes[i] + buildingTypes[i], ); } }); @@ -2417,18 +2386,17 @@ describe("Scene/ImplicitSubtree", function () { }, }; - const results = ImplicitTilingTester.generateSubtreeBuffers( - subtreeDescription - ); + const results = + ImplicitTilingTester.generateSubtreeBuffers(subtreeDescription); const fetchExternal = spyOn(ResourceCache, "get").and.callFake( - fakeResourceLoader(results.externalBuffer) + fakeResourceLoader(results.externalBuffer), ); const subtree = await ImplicitSubtree.fromSubtreeJson( subtreeResource, undefined, results.subtreeBuffer, tileMetadataQuadtree, - quadtreeCoordinates + quadtreeCoordinates, ); expect(fetchExternal).not.toHaveBeenCalled(); @@ -2439,10 +2407,10 @@ describe("Scene/ImplicitSubtree", function () { for (let i = 0; i < buildingCounts.length; i++) { expect(metadataTable.getProperty(i, "highlightColor")).toEqual( - Cartesian3.unpack(highlightColors[i]) + Cartesian3.unpack(highlightColors[i]), ); expect(metadataTable.getProperty(i, "buildingCount")).toBe( - buildingCounts[i] + buildingCounts[i], ); } }); @@ -2494,15 +2462,14 @@ describe("Scene/ImplicitSubtree", function () { }, }; - const results = ImplicitTilingTester.generateSubtreeBuffers( - subtreeDescription - ); + const results = + ImplicitTilingTester.generateSubtreeBuffers(subtreeDescription); const subtree = await ImplicitSubtree.fromSubtreeJson( subtreeResource, undefined, results.subtreeBuffer, tileMetadataQuadtree, - quadtreeCoordinates + quadtreeCoordinates, ); expect(subtree._tileJumpBuffer).toEqual(new Uint8Array([0, 0, 0, 1, 2])); @@ -2512,10 +2479,10 @@ describe("Scene/ImplicitSubtree", function () { for (let i = 0; i < buildingCounts.length; i++) { expect(metadataTable.getProperty(i, "highlightColor")).toEqual( - Cartesian3.unpack(highlightColors[i]) + Cartesian3.unpack(highlightColors[i]), ); expect(metadataTable.getProperty(i, "buildingCount")).toBe( - buildingCounts[i] + buildingCounts[i], ); } }); @@ -2549,16 +2516,15 @@ describe("Scene/ImplicitSubtree", function () { }, }; - const results = ImplicitTilingTester.generateSubtreeBuffers( - subtreeDescription - ); + const results = + ImplicitTilingTester.generateSubtreeBuffers(subtreeDescription); const subtree = await ImplicitSubtree.fromSubtreeJson( subtreeResource, undefined, results.subtreeBuffer, buildingMetadataQuadtree, - quadtreeCoordinates + quadtreeCoordinates, ); const jumpBuffer = subtree._contentJumpBuffers[0]; @@ -2574,10 +2540,10 @@ describe("Scene/ImplicitSubtree", function () { for (let i = 0; i < buildingHeightsTruncated.length; i++) { expect(metadataTable.getProperty(i, "height")).toEqual( - buildingHeightsTruncated[i] + buildingHeightsTruncated[i], ); expect(metadataTable.getProperty(i, "buildingType")).toBe( - buildingTypesTruncated[i] + buildingTypesTruncated[i], ); } }); @@ -2619,16 +2585,15 @@ describe("Scene/ImplicitSubtree", function () { }, }; - const results = ImplicitTilingTester.generateSubtreeBuffers( - subtreeDescription - ); + const results = + ImplicitTilingTester.generateSubtreeBuffers(subtreeDescription); const subtree = await ImplicitSubtree.fromSubtreeJson( subtreeResource, undefined, results.subtreeBuffer, multipleContentsMetadataQuadtree, - quadtreeCoordinates + quadtreeCoordinates, ); const buildingJumpBuffer = subtree._contentJumpBuffers[0]; @@ -2647,10 +2612,10 @@ describe("Scene/ImplicitSubtree", function () { for (let i = 0; i < buildingHeightsTruncated.length; i++) { expect(buildingMetadataTable.getProperty(i, "height")).toEqual( - buildingHeightsTruncated[i] + buildingHeightsTruncated[i], ); expect(buildingMetadataTable.getProperty(i, "buildingType")).toBe( - buildingTypesTruncated[i] + buildingTypesTruncated[i], ); } @@ -2660,10 +2625,10 @@ describe("Scene/ImplicitSubtree", function () { for (let i = 0; i < treeHeightsTruncated.length; i++) { expect(treeMetadataTable.getProperty(i, "height")).toEqual( - treeHeightsTruncated[i] + treeHeightsTruncated[i], ); expect(treeMetadataTable.getProperty(i, "species")).toBe( - treeSpeciesTruncated[i] + treeSpeciesTruncated[i], ); } }); @@ -2748,18 +2713,17 @@ describe("Scene/ImplicitSubtree", function () { const arrayQuadtree = new ImplicitTileset( tilesetResource, implicitQuadtreeJson, - metadataSchema + metadataSchema, ); - const results = ImplicitTilingTester.generateSubtreeBuffers( - subtreeDescription - ); + const results = + ImplicitTilingTester.generateSubtreeBuffers(subtreeDescription); const subtree = await ImplicitSubtree.fromSubtreeJson( subtreeResource, undefined, results.subtreeBuffer, arrayQuadtree, - quadtreeCoordinates + quadtreeCoordinates, ); const metadataTable = subtree.tileMetadataTable; expect(metadataTable).toBeDefined(); @@ -2767,13 +2731,13 @@ describe("Scene/ImplicitSubtree", function () { for (let i = 0; i < buildingCounts.length; i++) { expect(metadataTable.getProperty(i, "stringProperty")).toBe( - stringValues[i] + stringValues[i], ); expect(metadataTable.getProperty(i, "arrayProperty")).toEqual( - arrayValues[i] + arrayValues[i], ); expect(metadataTable.getProperty(i, "arrayOfStringProperty")).toEqual( - stringArrayValues[i] + stringArrayValues[i], ); } }); @@ -2859,18 +2823,17 @@ describe("Scene/ImplicitSubtree", function () { const arrayQuadtree = new ImplicitTileset( tilesetResource, implicitQuadtreeJson, - metadataSchema + metadataSchema, ); - const results = ImplicitTilingTester.generateSubtreeBuffers( - subtreeDescription - ); + const results = + ImplicitTilingTester.generateSubtreeBuffers(subtreeDescription); const subtree = await ImplicitSubtree.fromSubtreeJson( subtreeResource, undefined, results.subtreeBuffer, arrayQuadtree, - quadtreeCoordinates + quadtreeCoordinates, ); const metadataTable = subtree.tileMetadataTable; expect(metadataTable).toBeDefined(); @@ -2878,13 +2841,13 @@ describe("Scene/ImplicitSubtree", function () { for (let i = 0; i < buildingCounts.length; i++) { expect(metadataTable.getProperty(i, "stringProperty")).toBe( - stringValues[i] + stringValues[i], ); expect(metadataTable.getProperty(i, "arrayProperty")).toEqual( - arrayValues[i] + arrayValues[i], ); expect(metadataTable.getProperty(i, "arrayOfStringProperty")).toEqual( - stringArrayValues[i] + stringArrayValues[i], ); } }); diff --git a/packages/engine/Specs/Scene/ImplicitTileCoordinatesSpec.js b/packages/engine/Specs/Scene/ImplicitTileCoordinatesSpec.js index 30d5c1e04f83..5f941647832a 100644 --- a/packages/engine/Specs/Scene/ImplicitTileCoordinatesSpec.js +++ b/packages/engine/Specs/Scene/ImplicitTileCoordinatesSpec.js @@ -53,7 +53,7 @@ describe("Scene/ImplicitTileCoordinates", function () { }); expect(coordinates.subdivisionScheme).toEqual( - ImplicitSubdivisionScheme.QUADTREE + ImplicitSubdivisionScheme.QUADTREE, ); expect(coordinates.level).toEqual(4); expect(coordinates.x).toEqual(3); @@ -72,7 +72,7 @@ describe("Scene/ImplicitTileCoordinates", function () { }); expect(coordinates.subdivisionScheme).toEqual( - ImplicitSubdivisionScheme.OCTREE + ImplicitSubdivisionScheme.OCTREE, ); expect(coordinates.level).toEqual(4); expect(coordinates.x).toEqual(3); @@ -128,7 +128,7 @@ describe("Scene/ImplicitTileCoordinates", function () { // mismatched subdivisionScheme expect(function () { return quadtreeCoordinates(0, 0, 0).getDescendantCoordinates( - octreeCoordinates(0, 0, 0, 0) + octreeCoordinates(0, 0, 0, 0), ); }).toThrowDeveloperError(); @@ -140,7 +140,7 @@ describe("Scene/ImplicitTileCoordinates", function () { 0, 0, 0, - subtreeLevelsA + subtreeLevelsA, ).getDescendantCoordinates(quadtreeCoordinates(0, 0, 0, subtreeLevelsB)); }).toThrowDeveloperError(); }); @@ -149,19 +149,19 @@ describe("Scene/ImplicitTileCoordinates", function () { expect( quadtreeCoordinates(0, 0, 0) .getDescendantCoordinates(quadtreeCoordinates(0, 0, 0)) - .isEqual(quadtreeCoordinates(0, 0, 0)) + .isEqual(quadtreeCoordinates(0, 0, 0)), ).toEqual(true); expect( quadtreeCoordinates(0, 0, 0) .getDescendantCoordinates(quadtreeCoordinates(1, 1, 1)) - .isEqual(quadtreeCoordinates(1, 1, 1)) + .isEqual(quadtreeCoordinates(1, 1, 1)), ).toEqual(true); expect( quadtreeCoordinates(1, 1, 1) .getDescendantCoordinates(quadtreeCoordinates(2, 3, 3)) - .isEqual(quadtreeCoordinates(3, 7, 7)) + .isEqual(quadtreeCoordinates(3, 7, 7)), ).toEqual(true); }); @@ -169,19 +169,19 @@ describe("Scene/ImplicitTileCoordinates", function () { expect( octreeCoordinates(0, 0, 0, 0) .getDescendantCoordinates(octreeCoordinates(0, 0, 0, 0)) - .isEqual(octreeCoordinates(0, 0, 0, 0)) + .isEqual(octreeCoordinates(0, 0, 0, 0)), ).toEqual(true); expect( octreeCoordinates(0, 0, 0, 0) .getDescendantCoordinates(octreeCoordinates(1, 1, 1, 1)) - .isEqual(octreeCoordinates(1, 1, 1, 1)) + .isEqual(octreeCoordinates(1, 1, 1, 1)), ).toEqual(true); expect( octreeCoordinates(1, 1, 1, 1) .getDescendantCoordinates(octreeCoordinates(2, 3, 3, 3)) - .isEqual(octreeCoordinates(3, 7, 7, 7)) + .isEqual(octreeCoordinates(3, 7, 7, 7)), ).toEqual(true); }); @@ -206,31 +206,31 @@ describe("Scene/ImplicitTileCoordinates", function () { expect( quadtreeCoordinates(0, 0, 0) .getAncestorCoordinates(0) - .isEqual(quadtreeCoordinates(0, 0, 0)) + .isEqual(quadtreeCoordinates(0, 0, 0)), ).toEqual(true); expect( quadtreeCoordinates(1, 0, 0) .getAncestorCoordinates(1) - .isEqual(quadtreeCoordinates(0, 0, 0)) + .isEqual(quadtreeCoordinates(0, 0, 0)), ).toEqual(true); expect( quadtreeCoordinates(1, 1, 1) .getAncestorCoordinates(1) - .isEqual(quadtreeCoordinates(0, 0, 0)) + .isEqual(quadtreeCoordinates(0, 0, 0)), ).toEqual(true); expect( quadtreeCoordinates(2, 3, 3) .getAncestorCoordinates(1) - .isEqual(quadtreeCoordinates(1, 1, 1)) + .isEqual(quadtreeCoordinates(1, 1, 1)), ).toEqual(true); expect( quadtreeCoordinates(2, 3, 3) .getAncestorCoordinates(2) - .isEqual(quadtreeCoordinates(0, 0, 0)) + .isEqual(quadtreeCoordinates(0, 0, 0)), ).toEqual(true); }); @@ -238,31 +238,31 @@ describe("Scene/ImplicitTileCoordinates", function () { expect( octreeCoordinates(0, 0, 0, 0) .getAncestorCoordinates(0) - .isEqual(octreeCoordinates(0, 0, 0, 0)) + .isEqual(octreeCoordinates(0, 0, 0, 0)), ).toEqual(true); expect( octreeCoordinates(1, 0, 0, 0) .getAncestorCoordinates(1) - .isEqual(octreeCoordinates(0, 0, 0, 0)) + .isEqual(octreeCoordinates(0, 0, 0, 0)), ).toEqual(true); expect( octreeCoordinates(1, 1, 1, 1) .getAncestorCoordinates(1) - .isEqual(octreeCoordinates(0, 0, 0, 0)) + .isEqual(octreeCoordinates(0, 0, 0, 0)), ).toEqual(true); expect( octreeCoordinates(2, 3, 3, 3) .getAncestorCoordinates(1) - .isEqual(octreeCoordinates(1, 1, 1, 1)) + .isEqual(octreeCoordinates(1, 1, 1, 1)), ).toEqual(true); expect( octreeCoordinates(2, 3, 3, 3) .getAncestorCoordinates(2) - .isEqual(octreeCoordinates(0, 0, 0, 0)) + .isEqual(octreeCoordinates(0, 0, 0, 0)), ).toEqual(true); }); @@ -275,21 +275,21 @@ describe("Scene/ImplicitTileCoordinates", function () { // descendant is above ancestor expect(function () { return quadtreeCoordinates(1, 0, 0).getOffsetCoordinates( - quadtreeCoordinates(0, 0, 0) + quadtreeCoordinates(0, 0, 0), ); }).toThrowDeveloperError(); // descendant is not actually a descendant expect(function () { return quadtreeCoordinates(1, 0, 0).getOffsetCoordinates( - quadtreeCoordinates(2, 3, 3) + quadtreeCoordinates(2, 3, 3), ); }).toThrowDeveloperError(); // mismatched subdivisionScheme expect(function () { return quadtreeCoordinates(0, 0, 0).getOffsetCoordinates( - octreeCoordinates(0, 0, 0, 0) + octreeCoordinates(0, 0, 0, 0), ); }).toThrowDeveloperError(); @@ -298,7 +298,7 @@ describe("Scene/ImplicitTileCoordinates", function () { const subtreeLevelsA = 2; const subtreeLevelsB = 3; return quadtreeCoordinates(0, 0, 0, subtreeLevelsA).getOffsetCoordinates( - quadtreeCoordinates(0, 0, 0, subtreeLevelsB) + quadtreeCoordinates(0, 0, 0, subtreeLevelsB), ); }).toThrowDeveloperError(); }); @@ -307,25 +307,25 @@ describe("Scene/ImplicitTileCoordinates", function () { expect( quadtreeCoordinates(0, 0, 0) .getOffsetCoordinates(quadtreeCoordinates(0, 0, 0)) - .isEqual(quadtreeCoordinates(0, 0, 0)) + .isEqual(quadtreeCoordinates(0, 0, 0)), ).toEqual(true); expect( quadtreeCoordinates(0, 0, 0) .getOffsetCoordinates(quadtreeCoordinates(1, 1, 1)) - .isEqual(quadtreeCoordinates(1, 1, 1)) + .isEqual(quadtreeCoordinates(1, 1, 1)), ).toEqual(true); expect( quadtreeCoordinates(0, 0, 0) .getOffsetCoordinates(quadtreeCoordinates(2, 3, 3)) - .isEqual(quadtreeCoordinates(2, 3, 3)) + .isEqual(quadtreeCoordinates(2, 3, 3)), ).toEqual(true); expect( quadtreeCoordinates(1, 1, 1) .getOffsetCoordinates(quadtreeCoordinates(2, 2, 2)) - .isEqual(quadtreeCoordinates(1, 0, 0)) + .isEqual(quadtreeCoordinates(1, 0, 0)), ).toEqual(true); }); @@ -333,25 +333,25 @@ describe("Scene/ImplicitTileCoordinates", function () { expect( octreeCoordinates(0, 0, 0, 0) .getOffsetCoordinates(octreeCoordinates(0, 0, 0, 0)) - .isEqual(octreeCoordinates(0, 0, 0, 0)) + .isEqual(octreeCoordinates(0, 0, 0, 0)), ).toEqual(true); expect( octreeCoordinates(0, 0, 0, 0) .getOffsetCoordinates(octreeCoordinates(1, 1, 1, 1)) - .isEqual(octreeCoordinates(1, 1, 1, 1)) + .isEqual(octreeCoordinates(1, 1, 1, 1)), ).toEqual(true); expect( octreeCoordinates(0, 0, 0, 0) .getOffsetCoordinates(octreeCoordinates(2, 3, 3, 3)) - .isEqual(octreeCoordinates(2, 3, 3, 3)) + .isEqual(octreeCoordinates(2, 3, 3, 3)), ).toEqual(true); expect( octreeCoordinates(1, 1, 1, 1) .getOffsetCoordinates(octreeCoordinates(2, 2, 2, 2)) - .isEqual(octreeCoordinates(1, 0, 0, 0)) + .isEqual(octreeCoordinates(1, 0, 0, 0)), ).toEqual(true); }); @@ -372,19 +372,19 @@ describe("Scene/ImplicitTileCoordinates", function () { const coordinates = quadtreeCoordinates(1, 0, 0); expect( - coordinates.getChildCoordinates(0).isEqual(quadtreeCoordinates(2, 0, 0)) + coordinates.getChildCoordinates(0).isEqual(quadtreeCoordinates(2, 0, 0)), ).toEqual(true); expect( - coordinates.getChildCoordinates(1).isEqual(quadtreeCoordinates(2, 1, 0)) + coordinates.getChildCoordinates(1).isEqual(quadtreeCoordinates(2, 1, 0)), ).toEqual(true); expect( - coordinates.getChildCoordinates(2).isEqual(quadtreeCoordinates(2, 0, 1)) + coordinates.getChildCoordinates(2).isEqual(quadtreeCoordinates(2, 0, 1)), ).toEqual(true); expect( - coordinates.getChildCoordinates(3).isEqual(quadtreeCoordinates(2, 1, 1)) + coordinates.getChildCoordinates(3).isEqual(quadtreeCoordinates(2, 1, 1)), ).toEqual(true); }); @@ -392,35 +392,35 @@ describe("Scene/ImplicitTileCoordinates", function () { const coordinates = octreeCoordinates(1, 0, 1, 1); expect( - coordinates.getChildCoordinates(0).isEqual(octreeCoordinates(2, 0, 2, 2)) + coordinates.getChildCoordinates(0).isEqual(octreeCoordinates(2, 0, 2, 2)), ).toEqual(true); expect( - coordinates.getChildCoordinates(1).isEqual(octreeCoordinates(2, 1, 2, 2)) + coordinates.getChildCoordinates(1).isEqual(octreeCoordinates(2, 1, 2, 2)), ).toEqual(true); expect( - coordinates.getChildCoordinates(2).isEqual(octreeCoordinates(2, 0, 3, 2)) + coordinates.getChildCoordinates(2).isEqual(octreeCoordinates(2, 0, 3, 2)), ).toEqual(true); expect( - coordinates.getChildCoordinates(3).isEqual(octreeCoordinates(2, 1, 3, 2)) + coordinates.getChildCoordinates(3).isEqual(octreeCoordinates(2, 1, 3, 2)), ).toEqual(true); expect( - coordinates.getChildCoordinates(4).isEqual(octreeCoordinates(2, 0, 2, 3)) + coordinates.getChildCoordinates(4).isEqual(octreeCoordinates(2, 0, 2, 3)), ).toEqual(true); expect( - coordinates.getChildCoordinates(5).isEqual(octreeCoordinates(2, 1, 2, 3)) + coordinates.getChildCoordinates(5).isEqual(octreeCoordinates(2, 1, 2, 3)), ).toEqual(true); expect( - coordinates.getChildCoordinates(6).isEqual(octreeCoordinates(2, 0, 3, 3)) + coordinates.getChildCoordinates(6).isEqual(octreeCoordinates(2, 0, 3, 3)), ).toEqual(true); expect( - coordinates.getChildCoordinates(7).isEqual(octreeCoordinates(2, 1, 3, 3)) + coordinates.getChildCoordinates(7).isEqual(octreeCoordinates(2, 1, 3, 3)), ).toEqual(true); }); @@ -428,25 +428,25 @@ describe("Scene/ImplicitTileCoordinates", function () { expect( quadtreeCoordinates(0, 0, 0) .getSubtreeCoordinates() - .isEqual(quadtreeCoordinates(0, 0, 0)) + .isEqual(quadtreeCoordinates(0, 0, 0)), ).toEqual(true); expect( quadtreeCoordinates(1, 1, 1) .getSubtreeCoordinates() - .isEqual(quadtreeCoordinates(0, 0, 0)) + .isEqual(quadtreeCoordinates(0, 0, 0)), ).toEqual(true); expect( quadtreeCoordinates(2, 3, 3) .getSubtreeCoordinates() - .isEqual(quadtreeCoordinates(2, 3, 3)) + .isEqual(quadtreeCoordinates(2, 3, 3)), ).toEqual(true); expect( quadtreeCoordinates(3, 7, 7) .getSubtreeCoordinates() - .isEqual(quadtreeCoordinates(2, 3, 3)) + .isEqual(quadtreeCoordinates(2, 3, 3)), ).toEqual(true); }); @@ -454,25 +454,25 @@ describe("Scene/ImplicitTileCoordinates", function () { expect( octreeCoordinates(0, 0, 0, 0) .getSubtreeCoordinates() - .isEqual(octreeCoordinates(0, 0, 0, 0)) + .isEqual(octreeCoordinates(0, 0, 0, 0)), ).toEqual(true); expect( octreeCoordinates(1, 1, 1, 1) .getSubtreeCoordinates() - .isEqual(octreeCoordinates(0, 0, 0, 0)) + .isEqual(octreeCoordinates(0, 0, 0, 0)), ).toEqual(true); expect( octreeCoordinates(2, 3, 3, 3) .getSubtreeCoordinates() - .isEqual(octreeCoordinates(2, 3, 3, 3)) + .isEqual(octreeCoordinates(2, 3, 3, 3)), ).toEqual(true); expect( octreeCoordinates(3, 7, 7, 7) .getSubtreeCoordinates() - .isEqual(octreeCoordinates(2, 3, 3, 3)) + .isEqual(octreeCoordinates(2, 3, 3, 3)), ).toEqual(true); }); @@ -492,31 +492,31 @@ describe("Scene/ImplicitTileCoordinates", function () { expect( quadtreeCoordinates(2, 0, 0) .getParentSubtreeCoordinates() - .isEqual(quadtreeCoordinates(0, 0, 0)) + .isEqual(quadtreeCoordinates(0, 0, 0)), ).toEqual(true); expect( quadtreeCoordinates(2, 3, 3) .getParentSubtreeCoordinates() - .isEqual(quadtreeCoordinates(0, 0, 0)) + .isEqual(quadtreeCoordinates(0, 0, 0)), ).toEqual(true); expect( quadtreeCoordinates(3, 7, 7) .getParentSubtreeCoordinates() - .isEqual(quadtreeCoordinates(0, 0, 0)) + .isEqual(quadtreeCoordinates(0, 0, 0)), ).toEqual(true); expect( quadtreeCoordinates(4, 0, 0) .getParentSubtreeCoordinates() - .isEqual(quadtreeCoordinates(2, 0, 0)) + .isEqual(quadtreeCoordinates(2, 0, 0)), ).toEqual(true); expect( quadtreeCoordinates(4, 15, 15) .getParentSubtreeCoordinates() - .isEqual(quadtreeCoordinates(2, 3, 3)) + .isEqual(quadtreeCoordinates(2, 3, 3)), ).toEqual(true); }); @@ -524,31 +524,31 @@ describe("Scene/ImplicitTileCoordinates", function () { expect( octreeCoordinates(2, 0, 0, 0) .getParentSubtreeCoordinates() - .isEqual(octreeCoordinates(0, 0, 0, 0)) + .isEqual(octreeCoordinates(0, 0, 0, 0)), ).toEqual(true); expect( octreeCoordinates(2, 3, 3, 3) .getParentSubtreeCoordinates() - .isEqual(octreeCoordinates(0, 0, 0, 0)) + .isEqual(octreeCoordinates(0, 0, 0, 0)), ).toEqual(true); expect( octreeCoordinates(3, 7, 7, 7) .getParentSubtreeCoordinates() - .isEqual(octreeCoordinates(0, 0, 0, 0)) + .isEqual(octreeCoordinates(0, 0, 0, 0)), ).toEqual(true); expect( octreeCoordinates(4, 0, 0, 0) .getParentSubtreeCoordinates() - .isEqual(octreeCoordinates(2, 0, 0, 0)) + .isEqual(octreeCoordinates(2, 0, 0, 0)), ).toEqual(true); expect( octreeCoordinates(4, 15, 15, 15) .getParentSubtreeCoordinates() - .isEqual(octreeCoordinates(2, 3, 3, 3)) + .isEqual(octreeCoordinates(2, 3, 3, 3)), ).toEqual(true); }); @@ -561,7 +561,7 @@ describe("Scene/ImplicitTileCoordinates", function () { // mismatched subdivisionScheme expect(function () { return quadtreeCoordinates(0, 0, 0).isAncestor( - octreeCoordinates(0, 0, 0, 0) + octreeCoordinates(0, 0, 0, 0), ); }).toThrowDeveloperError(); @@ -570,7 +570,7 @@ describe("Scene/ImplicitTileCoordinates", function () { const subtreeLevelsA = 2; const subtreeLevelsB = 3; return quadtreeCoordinates(0, 0, 0, subtreeLevelsA).isAncestor( - quadtreeCoordinates(0, 0, 0, subtreeLevelsB) + quadtreeCoordinates(0, 0, 0, subtreeLevelsB), ); }).toThrowDeveloperError(); }); @@ -578,54 +578,54 @@ describe("Scene/ImplicitTileCoordinates", function () { it("isAncestor works as expected for quadtree", function () { // cannot be ancestor of itself expect( - quadtreeCoordinates(0, 0, 0).isAncestor(quadtreeCoordinates(0, 0, 0)) + quadtreeCoordinates(0, 0, 0).isAncestor(quadtreeCoordinates(0, 0, 0)), ).toEqual(false); // ancestor one level above expect( - quadtreeCoordinates(0, 0, 0).isAncestor(quadtreeCoordinates(1, 1, 1)) + quadtreeCoordinates(0, 0, 0).isAncestor(quadtreeCoordinates(1, 1, 1)), ).toEqual(true); // cannot be descendant expect( - quadtreeCoordinates(1, 1, 1).isAncestor(quadtreeCoordinates(0, 0, 0)) + quadtreeCoordinates(1, 1, 1).isAncestor(quadtreeCoordinates(0, 0, 0)), ).toEqual(false); // works with bigger divide expect( - quadtreeCoordinates(0, 0, 0).isAncestor(quadtreeCoordinates(3, 7, 7)) + quadtreeCoordinates(0, 0, 0).isAncestor(quadtreeCoordinates(3, 7, 7)), ).toEqual(true); // higher up in the tree but not an ancestor expect( - quadtreeCoordinates(1, 0, 0).isAncestor(quadtreeCoordinates(2, 3, 3)) + quadtreeCoordinates(1, 0, 0).isAncestor(quadtreeCoordinates(2, 3, 3)), ).toEqual(false); }); it("isAncestor works as expected for octree", function () { // cannot be ancestor of itself expect( - octreeCoordinates(0, 0, 0, 0).isAncestor(octreeCoordinates(0, 0, 0, 0)) + octreeCoordinates(0, 0, 0, 0).isAncestor(octreeCoordinates(0, 0, 0, 0)), ).toEqual(false); // ancestor one level above expect( - octreeCoordinates(0, 0, 0, 0).isAncestor(octreeCoordinates(1, 1, 1, 1)) + octreeCoordinates(0, 0, 0, 0).isAncestor(octreeCoordinates(1, 1, 1, 1)), ).toEqual(true); // cannot be descendant expect( - octreeCoordinates(1, 1, 1, 1).isAncestor(octreeCoordinates(0, 0, 0, 0)) + octreeCoordinates(1, 1, 1, 1).isAncestor(octreeCoordinates(0, 0, 0, 0)), ).toEqual(false); // works with bigger divide expect( - octreeCoordinates(0, 0, 0, 0).isAncestor(octreeCoordinates(3, 7, 7, 7)) + octreeCoordinates(0, 0, 0, 0).isAncestor(octreeCoordinates(3, 7, 7, 7)), ).toEqual(true); // higher up in the tree but not an ancestor expect( - octreeCoordinates(1, 0, 0, 0).isAncestor(octreeCoordinates(2, 3, 3, 3)) + octreeCoordinates(1, 0, 0, 0).isAncestor(octreeCoordinates(2, 3, 3, 3)), ).toEqual(false); }); @@ -639,32 +639,32 @@ describe("Scene/ImplicitTileCoordinates", function () { it("isEqual works as expected for quadtree", function () { // same expect( - octreeCoordinates(0, 0, 0, 0).isEqual(octreeCoordinates(0, 0, 0, 0)) + octreeCoordinates(0, 0, 0, 0).isEqual(octreeCoordinates(0, 0, 0, 0)), ).toEqual(true); // different level expect( - octreeCoordinates(0, 0, 0, 0).isEqual(octreeCoordinates(1, 0, 0, 0)) + octreeCoordinates(0, 0, 0, 0).isEqual(octreeCoordinates(1, 0, 0, 0)), ).toEqual(false); // different X expect( - octreeCoordinates(1, 0, 0, 0).isEqual(octreeCoordinates(1, 1, 0, 0)) + octreeCoordinates(1, 0, 0, 0).isEqual(octreeCoordinates(1, 1, 0, 0)), ).toEqual(false); // different Y expect( - octreeCoordinates(1, 0, 0, 0).isEqual(octreeCoordinates(1, 0, 1, 0)) + octreeCoordinates(1, 0, 0, 0).isEqual(octreeCoordinates(1, 0, 1, 0)), ).toEqual(false); // different Z expect( - octreeCoordinates(1, 0, 0, 0).isEqual(octreeCoordinates(1, 0, 0, 1)) + octreeCoordinates(1, 0, 0, 0).isEqual(octreeCoordinates(1, 0, 0, 1)), ).toEqual(false); // mismatched subdivisionScheme expect( - quadtreeCoordinates(0, 0, 0).isEqual(octreeCoordinates(0, 0, 0, 0)) + quadtreeCoordinates(0, 0, 0).isEqual(octreeCoordinates(0, 0, 0, 0)), ).toEqual(false); // mismatched subtreeLevels @@ -672,8 +672,8 @@ describe("Scene/ImplicitTileCoordinates", function () { const subtreeLevelsB = 3; expect( quadtreeCoordinates(0, 0, 0, subtreeLevelsA).isEqual( - quadtreeCoordinates(0, 0, 0, subtreeLevelsB) - ) + quadtreeCoordinates(0, 0, 0, subtreeLevelsB), + ), ).toEqual(false); }); @@ -736,11 +736,11 @@ describe("Scene/ImplicitTileCoordinates", function () { ImplicitSubdivisionScheme.QUADTREE, subtreeLevels, 3, - 42 + 42, ); expect( - coordinates.isEqual(quadtreeCoordinates(3, 0, 7, subtreeLevels)) + coordinates.isEqual(quadtreeCoordinates(3, 0, 7, subtreeLevels)), ).toEqual(true); }); @@ -753,11 +753,11 @@ describe("Scene/ImplicitTileCoordinates", function () { ImplicitSubdivisionScheme.OCTREE, subtreeLevels, 2, - 43 + 43, ); expect( - coordinates.isEqual(octreeCoordinates(2, 3, 1, 2, subtreeLevels)) + coordinates.isEqual(octreeCoordinates(2, 3, 1, 2, subtreeLevels)), ).toEqual(true); }); @@ -793,11 +793,11 @@ describe("Scene/ImplicitTileCoordinates", function () { const coordinates = ImplicitTileCoordinates.fromTileIndex( ImplicitSubdivisionScheme.QUADTREE, subtreeLevels, - 63 + 63, ); expect( - coordinates.isEqual(quadtreeCoordinates(3, 0, 7, subtreeLevels)) + coordinates.isEqual(quadtreeCoordinates(3, 0, 7, subtreeLevels)), ).toEqual(true); }); @@ -812,18 +812,18 @@ describe("Scene/ImplicitTileCoordinates", function () { const coordinates = ImplicitTileCoordinates.fromTileIndex( ImplicitSubdivisionScheme.OCTREE, subtreeLevels, - 52 + 52, ); expect( - coordinates.isEqual(octreeCoordinates(2, 3, 1, 2, subtreeLevels)) + coordinates.isEqual(octreeCoordinates(2, 3, 1, 2, subtreeLevels)), ).toEqual(true); }); it("getTemplateValues works as expected for quadtree", function () { const subtreeLevels = 6; expect( - quadtreeCoordinates(4, 3, 2, subtreeLevels).getTemplateValues() + quadtreeCoordinates(4, 3, 2, subtreeLevels).getTemplateValues(), ).toEqual({ level: 4, x: 3, @@ -835,7 +835,7 @@ describe("Scene/ImplicitTileCoordinates", function () { const subtreeLevels = 6; expect( - octreeCoordinates(4, 3, 2, 1, subtreeLevels).getTemplateValues() + octreeCoordinates(4, 3, 2, 1, subtreeLevels).getTemplateValues(), ).toEqual({ level: 4, x: 3, diff --git a/packages/engine/Specs/Scene/ImplicitTilesetSpec.js b/packages/engine/Specs/Scene/ImplicitTilesetSpec.js index 9050f117205d..45684b9170db 100644 --- a/packages/engine/Specs/Scene/ImplicitTilesetSpec.js +++ b/packages/engine/Specs/Scene/ImplicitTilesetSpec.js @@ -76,16 +76,16 @@ describe("Scene/ImplicitTileset", function () { const implicitTileset = new ImplicitTileset( baseResource, implicitTileJson, - metadataSchema + metadataSchema, ); expect(implicitTileset.metadataSchema).toBeUndefined(); expect(implicitTileset.subtreeLevels).toEqual(3); expect(implicitTileset.availableLevels).toEqual(5); expect(implicitTileset.subdivisionScheme).toEqual( - ImplicitSubdivisionScheme.QUADTREE + ImplicitSubdivisionScheme.QUADTREE, ); expect(implicitTileset.boundingVolume).toEqual( - implicitTileJson.boundingVolume + implicitTileJson.boundingVolume, ); expect(implicitTileset.refine).toEqual(implicitTileJson.refine); expect(implicitTileset.geometricError).toEqual(500); @@ -98,7 +98,7 @@ describe("Scene/ImplicitTileset", function () { const implicitTileset = new ImplicitTileset( baseResource, implicitTileJson, - metadataSchema + metadataSchema, ); const deep = true; const expected = clone(implicitTileJson, deep); @@ -117,7 +117,7 @@ describe("Scene/ImplicitTileset", function () { const implicitTileset = new ImplicitTileset( baseResource, withExtensions, - metadataSchema + metadataSchema, ); const expected = clone(withExtensions, deep); delete expected.content; @@ -130,7 +130,7 @@ describe("Scene/ImplicitTileset", function () { const implicitTileset = new ImplicitTileset( baseResource, implicitTileJson, - metadataSchema + metadataSchema, ); expect(implicitTileset.contentHeaders[0]).toEqual(implicitTileJson.content); }); @@ -142,7 +142,7 @@ describe("Scene/ImplicitTileset", function () { const implicitTileset = new ImplicitTileset( baseResource, noContentJson, - metadataSchema + metadataSchema, ); expect(implicitTileset.contentUriTemplates).toEqual([]); }); @@ -165,7 +165,7 @@ describe("Scene/ImplicitTileset", function () { const implicitTileset = new ImplicitTileset( baseResource, tileJson, - metadataSchema + metadataSchema, ); const implicitTilesetS2 = implicitTileset.boundingVolume.extensions["3DTILES_bounding_volume_S2"]; @@ -193,16 +193,16 @@ describe("Scene/ImplicitTileset", function () { const implicitTileset = new ImplicitTileset( baseResource, implicitTileLegacyJson, - metadataSchema + metadataSchema, ); expect(implicitTileset.metadataSchema).toBeUndefined(); expect(implicitTileset.subtreeLevels).toEqual(3); expect(implicitTileset.availableLevels).toEqual(5); expect(implicitTileset.subdivisionScheme).toEqual( - ImplicitSubdivisionScheme.QUADTREE + ImplicitSubdivisionScheme.QUADTREE, ); expect(implicitTileset.boundingVolume).toEqual( - implicitTileJson.boundingVolume + implicitTileJson.boundingVolume, ); expect(implicitTileset.refine).toEqual(implicitTileJson.refine); expect(implicitTileset.geometricError).toEqual(500); @@ -215,7 +215,7 @@ describe("Scene/ImplicitTileset", function () { const implicitTileset = new ImplicitTileset( baseResource, implicitTileLegacyJson, - metadataSchema + metadataSchema, ); expect(implicitTileset.availableLevels).toEqual(5); }); @@ -225,7 +225,7 @@ describe("Scene/ImplicitTileset", function () { const implicitTileset = new ImplicitTileset( baseResource, implicitTileLegacyJson, - metadataSchema + metadataSchema, ); const deep = true; const expected = clone(implicitTileLegacyJson, deep); @@ -243,7 +243,7 @@ describe("Scene/ImplicitTileset", function () { const implicitTileset = new ImplicitTileset( baseResource, withExtensions, - metadataSchema + metadataSchema, ); const expected = clone(withExtensions, deep); delete expected.content; @@ -256,10 +256,10 @@ describe("Scene/ImplicitTileset", function () { const implicitTileset = new ImplicitTileset( baseResource, implicitTileLegacyJson, - metadataSchema + metadataSchema, ); expect(implicitTileset.contentHeaders[0]).toEqual( - implicitTileJson.content + implicitTileJson.content, ); }); @@ -270,7 +270,7 @@ describe("Scene/ImplicitTileset", function () { const implicitTileset = new ImplicitTileset( baseResource, noContentJson, - metadataSchema + metadataSchema, ); expect(implicitTileset.contentUriTemplates).toEqual([]); }); @@ -326,7 +326,7 @@ describe("Scene/ImplicitTileset", function () { const implicitTileset = new ImplicitTileset( baseResource, multipleContentTile, - metadataSchema + metadataSchema, ); expect(implicitTileset.contentUriTemplates).toEqual([ new Resource({ url: b3dmPattern }), @@ -351,7 +351,7 @@ describe("Scene/ImplicitTileset", function () { const implicitTileset = new ImplicitTileset( baseResource, withProperties, - metadataSchema + metadataSchema, ); for (i = 0; i < implicitTileset.contentHeaders.length; i++) { expect(implicitTileset.contentHeaders[i]).toEqual(contents[i]); @@ -363,7 +363,7 @@ describe("Scene/ImplicitTileset", function () { const implicitTileset = new ImplicitTileset( baseResource, multipleContentTile, - metadataSchema + metadataSchema, ); expect(implicitTileset.tileHeader.extensions).not.toBeDefined(); }); @@ -406,7 +406,7 @@ describe("Scene/ImplicitTileset", function () { const implicitTileset = new ImplicitTileset( baseResource, multipleContentLegacyTile, - metadataSchema + metadataSchema, ); expect(implicitTileset.contentUriTemplates).toEqual([ new Resource({ url: b3dmPattern }), @@ -432,7 +432,7 @@ describe("Scene/ImplicitTileset", function () { const implicitTileset = new ImplicitTileset( baseResource, withProperties, - metadataSchema + metadataSchema, ); for (i = 0; i < implicitTileset.contentHeaders.length; i++) { expect(implicitTileset.contentHeaders[i]).toEqual(contents[i]); @@ -460,7 +460,7 @@ describe("Scene/ImplicitTileset", function () { const implicitTileset = new ImplicitTileset( baseResource, implicitTileJson, - metadataSchema + metadataSchema, ); expect(implicitTileset.metadataSchema).toBeDefined(); diff --git a/packages/engine/Specs/Scene/InstanceAttributeSemanticSpec.js b/packages/engine/Specs/Scene/InstanceAttributeSemanticSpec.js index 51b70891d303..1311f00be47f 100644 --- a/packages/engine/Specs/Scene/InstanceAttributeSemanticSpec.js +++ b/packages/engine/Specs/Scene/InstanceAttributeSemanticSpec.js @@ -24,8 +24,8 @@ describe("Scene/InstanceAttributeSemantic", function () { expect( InstanceAttributeSemantic.fromGltfSemantic( gltfSemantics[i], - expectedSemantics[i] - ) + expectedSemantics[i], + ), ).toBe(expectedSemantics[i]); } }); diff --git a/packages/engine/Specs/Scene/IonImageryProviderSpec.js b/packages/engine/Specs/Scene/IonImageryProviderSpec.js index abde504d9040..4b8a589ac020 100644 --- a/packages/engine/Specs/Scene/IonImageryProviderSpec.js +++ b/packages/engine/Specs/Scene/IonImageryProviderSpec.js @@ -30,21 +30,21 @@ describe("Scene/IonImageryProvider", function () { const options = {}; const endpointResource = IonResource._createEndpointResource( assetId, - options + options, ); spyOn(IonResource, "_createEndpointResource").and.returnValue( - endpointResource + endpointResource, ); spyOn(endpointResource, "fetchJson").and.returnValue( - Promise.resolve(endpointData) + Promise.resolve(endpointData), ); const provider = await IonImageryProvider.fromAssetId(assetId, options); expect(IonResource._createEndpointResource).toHaveBeenCalledWith( assetId, - options + options, ); return provider; } @@ -60,7 +60,7 @@ describe("Scene/IonImageryProvider", function () { it("fromAssetId throws without assetId", async function () { await expectAsync( - IonImageryProvider.fromAssetId() + IonImageryProvider.fromAssetId(), ).toBeRejectedWithDeveloperError(); }); @@ -71,10 +71,10 @@ describe("Scene/IonImageryProvider", function () { url: "http://test.invalid/layer", accessToken: "not_really_a_refresh_token", attributions: [], - }) + }), ).toBeRejectedWithError( RuntimeError, - "Cesium ion asset 12335 is not an imagery asset." + "Cesium ion asset 12335 is not an imagery asset.", ); }); @@ -85,10 +85,10 @@ describe("Scene/IonImageryProvider", function () { externalType: "TUBELCANE", options: { url: "http://test.invalid/layer" }, attributions: [], - }) + }), ).toBeRejectedWithError( RuntimeError, - "Unrecognized Cesium ion imagery type: TUBELCANE" + "Unrecognized Cesium ion imagery type: TUBELCANE", ); }); @@ -97,7 +97,7 @@ describe("Scene/IonImageryProvider", function () { expect(provider).toBeInstanceOf(IonImageryProvider); expect(provider.errorEvent).toBeDefined(); expect(provider._imageryProvider).toBeInstanceOf( - UrlTemplateImageryProvider + UrlTemplateImageryProvider, ); }); @@ -116,13 +116,13 @@ describe("Scene/IonImageryProvider", function () { }; const endpointResource = IonResource._createEndpointResource( assetId, - options + options, ); spyOn(IonResource, "_createEndpointResource").and.returnValue( - endpointResource + endpointResource, ); spyOn(endpointResource, "fetchJson").and.returnValue( - Promise.resolve(endpointData) + Promise.resolve(endpointData), ); expect(endpointResource.fetchJson.calls.count()).toBe(0); @@ -155,19 +155,19 @@ describe("Scene/IonImageryProvider", function () { const image = new Image(); const request = {}; spyOn(internalProvider, "requestImage").and.returnValue( - Promise.resolve(image) + Promise.resolve(image), ); let result = await provider.requestImage(1, 2, 3, request); expect(internalProvider.requestImage).toHaveBeenCalledWith( 1, 2, 3, - request + request, ); expect(result).toBe(image); const info = {}; spyOn(internalProvider, "pickFeatures").and.returnValue( - Promise.resolve(info) + Promise.resolve(info), ); result = await provider.pickFeatures(1, 2, 3, 4, 5); expect(internalProvider.pickFeatures).toHaveBeenCalledWith(1, 2, 3, 4, 5); @@ -209,23 +209,25 @@ describe("Scene/IonImageryProvider", function () { } it("createImageryProvider works with ARCGIS_MAPSERVER", function () { - spyOn(Resource._Implementations, "loadWithXhr").and.callFake(function ( - url, - responseType, - method, - data, - headers, - deferred, - overrideMimeType - ) { - deferred.resolve( - JSON.stringify({ imageUrl: "", imageUrlSubdomains: [], zoomMax: 0 }) - ); - }); + spyOn(Resource._Implementations, "loadWithXhr").and.callFake( + function ( + url, + responseType, + method, + data, + headers, + deferred, + overrideMimeType, + ) { + deferred.resolve( + JSON.stringify({ imageUrl: "", imageUrlSubdomains: [], zoomMax: 0 }), + ); + }, + ); return testExternalImagery( "ARCGIS_MAPSERVER", { url: "http://test.invalid" }, - ArcGisMapServerImageryProvider + ArcGisMapServerImageryProvider, ); }); @@ -239,32 +241,34 @@ describe("Scene/IonImageryProvider", function () { }, ], }); - } + }, ); return testExternalImagery( "BING", { url: "http://test.invalid", key: "" }, - BingMapsImageryProvider + BingMapsImageryProvider, ); }); it("createImageryProvider works with GOOGLE_EARTH", function () { - spyOn(Resource._Implementations, "loadWithXhr").and.callFake(function ( - url, - responseType, - method, - data, - headers, - deferred, - overrideMimeType - ) { - deferred.resolve(JSON.stringify({ layers: [{ id: 0, version: "" }] })); - }); + spyOn(Resource._Implementations, "loadWithXhr").and.callFake( + function ( + url, + responseType, + method, + data, + headers, + deferred, + overrideMimeType, + ) { + deferred.resolve(JSON.stringify({ layers: [{ id: 0, version: "" }] })); + }, + ); return testExternalImagery( "GOOGLE_EARTH", { url: "http://test.invalid", channel: 0 }, - GoogleEarthEnterpriseMapsProvider + GoogleEarthEnterpriseMapsProvider, ); }); @@ -272,26 +276,24 @@ describe("Scene/IonImageryProvider", function () { return testExternalImagery( "MAPBOX", { accessToken: "test-token", url: "http://test.invalid", mapId: 1 }, - MapboxImageryProvider + MapboxImageryProvider, ); }); it("createImageryProvider works with SINGLE_TILE", function () { - spyOn(Resource._Implementations, "createImage").and.callFake(function ( - request, - crossOrigin, - deferred - ) { - deferred.resolve({ - height: 16, - width: 16, - }); - }); + spyOn(Resource._Implementations, "createImage").and.callFake( + function (request, crossOrigin, deferred) { + deferred.resolve({ + height: 16, + width: 16, + }); + }, + ); return testExternalImagery( "SINGLE_TILE", { url: "http://test.invalid" }, - SingleTileImageryProvider + SingleTileImageryProvider, ); }); @@ -299,7 +301,7 @@ describe("Scene/IonImageryProvider", function () { return testExternalImagery( "TMS", { url: "http://test.invalid" }, - UrlTemplateImageryProvider + UrlTemplateImageryProvider, ); }); @@ -307,7 +309,7 @@ describe("Scene/IonImageryProvider", function () { return testExternalImagery( "URL_TEMPLATE", { url: "http://test.invalid" }, - UrlTemplateImageryProvider + UrlTemplateImageryProvider, ); }); @@ -315,7 +317,7 @@ describe("Scene/IonImageryProvider", function () { return testExternalImagery( "WMS", { url: "http://test.invalid", layers: [] }, - WebMapServiceImageryProvider + WebMapServiceImageryProvider, ); }); @@ -323,7 +325,7 @@ describe("Scene/IonImageryProvider", function () { return testExternalImagery( "WMTS", { url: "http://test.invalid", layer: "", style: "", tileMatrixSetID: 1 }, - WebMapTileServiceImageryProvider + WebMapTileServiceImageryProvider, ); }); }); diff --git a/packages/engine/Specs/Scene/KeyframeNodeSpec.js b/packages/engine/Specs/Scene/KeyframeNodeSpec.js index 9b6d39b99647..ef8c86607285 100644 --- a/packages/engine/Specs/Scene/KeyframeNodeSpec.js +++ b/packages/engine/Specs/Scene/KeyframeNodeSpec.js @@ -25,7 +25,7 @@ describe("Scene/KeyframeNode", function () { keyframeNode2.priority = 2; const comparison = KeyframeNode.priorityComparator( keyframeNode1, - keyframeNode2 + keyframeNode2, ); expect(comparison).toBe(-1); }); @@ -37,7 +37,7 @@ describe("Scene/KeyframeNode", function () { const keyframeNode2 = new KeyframeNode(dummySpatialNode, keyframe2); const comparison = KeyframeNode.searchComparator( keyframeNode1, - keyframeNode2 + keyframeNode2, ); expect(comparison).toBe(6); }); diff --git a/packages/engine/Specs/Scene/LabelCollectionSpec.js b/packages/engine/Specs/Scene/LabelCollectionSpec.js index 352e8fcfd822..3f163690e81e 100644 --- a/packages/engine/Specs/Scene/LabelCollectionSpec.js +++ b/packages/engine/Specs/Scene/LabelCollectionSpec.js @@ -70,7 +70,7 @@ describe( expect(label.outlineWidth).toEqual(1); expect(label.showBackground).toEqual(false); expect(label.backgroundColor).toEqual( - new Color(0.165, 0.165, 0.165, 0.8) + new Color(0.165, 0.165, 0.165, 0.8), ); expect(label.backgroundPadding).toEqual(new Cartesian2(7, 5)); expect(label.style).toEqual(LabelStyle.FILL); @@ -121,7 +121,7 @@ describe( const scaleByDistance = new NearFarScalar(1.0e4, 1.0, 1.0e6, 0.0); const distanceDisplayCondition = new DistanceDisplayCondition( 10.0, - 100.0 + 100.0, ); const disableDepthTestDistance = 10.0; const label = labels.add({ @@ -312,9 +312,8 @@ describe( // render until all labels have been updated return pollToPromise(function () { scene.renderForSpecs(); - const backgroundBillboard = labels._backgroundBillboardCollection.get( - 0 - ); + const backgroundBillboard = + labels._backgroundBillboardCollection.get(0); return ( (!defined(backgroundBillboard) || backgroundBillboard.ready) && labels._labelsToUpdate.length === 0 @@ -1109,7 +1108,7 @@ describe( scene.renderForSpecs(); expect(label.computeScreenSpacePosition(scene)).toEqualEpsilon( new Cartesian2(0.5, 0.5), - CesiumMath.EPSILON1 + CesiumMath.EPSILON1, ); }); @@ -1125,7 +1124,7 @@ describe( expect(actual).toEqual(result); expect(result).toEqualEpsilon( new Cartesian2(0.5, 0.5), - CesiumMath.EPSILON1 + CesiumMath.EPSILON1, ); }); @@ -1139,7 +1138,7 @@ describe( scene.renderForSpecs(); expect(label.computeScreenSpacePosition(scene)).toEqualEpsilon( new Cartesian2(1.0, 1.0), - CesiumMath.EPSILON1 + CesiumMath.EPSILON1, ); }); @@ -1153,7 +1152,7 @@ describe( scene.renderForSpecs(); expect(label.computeScreenSpacePosition(scene)).toEqualEpsilon( new Cartesian2(0.5, 0.5), - CesiumMath.EPSILON1 + CesiumMath.EPSILON1, ); }); @@ -1167,7 +1166,7 @@ describe( return allLabelsReady().then(function () { const bbox = Label.getScreenSpaceBoundingBox( label, - Cartesian2.ZERO + Cartesian2.ZERO, ); expect(bbox.x).toBeDefined(); expect(bbox.y).toBeDefined(); @@ -1190,7 +1189,7 @@ describe( const bbox = Label.getScreenSpaceBoundingBox( label, Cartesian2.ZERO, - result + result, ); expect(bbox.x).toBeDefined(); expect(bbox.y).toBeDefined(); @@ -1214,7 +1213,7 @@ describe( return allLabelsReady().then(function () { const bbox = Label.getScreenSpaceBoundingBox( label, - Cartesian2.ZERO + Cartesian2.ZERO, ); expect(bbox.y).toBeGreaterThan(bbox.height * -0.9); expect(bbox.y).toBeLessThan(bbox.height * -0.3); @@ -1233,7 +1232,7 @@ describe( return allLabelsReady().then(function () { const bbox = Label.getScreenSpaceBoundingBox( label, - Cartesian2.ZERO + Cartesian2.ZERO, ); expect(bbox.y).toBeLessThan(5); expect(bbox.y).toBeGreaterThan(-5); @@ -1252,7 +1251,7 @@ describe( return allLabelsReady().then(function () { const bbox = Label.getScreenSpaceBoundingBox( label, - Cartesian2.ZERO + Cartesian2.ZERO, ); expect(bbox.y).toBeLessThan(bbox.height * -0.8); expect(bbox.y).toBeGreaterThan(bbox.height * -1.2); @@ -1388,14 +1387,14 @@ describe( function getGlyphBillboardVertexTranslate(label, index) { return Cartesian2.clone( label._glyphs[index].billboard._translate, - new Cartesian2() + new Cartesian2(), ); } function getBackgroundBillboardVertexTranslate(label) { return Cartesian2.clone( label._backgroundBillboard._translate, - new Cartesian2() + new Cartesian2(), ); } @@ -1460,10 +1459,10 @@ describe( expect(billboard.scale).toEqual(label.scale * label._relativeSize); expect(billboard.id).toEqual(label.id); expect(billboard.translucencyByDistance).toEqual( - label.translucencyByDistance + label.translucencyByDistance, ); expect(billboard.pixelOffsetScaleByDistance).toEqual( - label.pixelOffsetScaleByDistance + label.pixelOffsetScaleByDistance, ); expect(billboard.scaleByDistance).toEqual(label.scaleByDistance); @@ -1487,7 +1486,7 @@ describe( 1.0e4, 1.0, 1.0e6, - 0.0 + 0.0, ), scaleByDistance: new NearFarScalar(1.0e4, 1.0, 1.0e6, 0.0), showBackground: true, @@ -1597,7 +1596,7 @@ describe( getGlyphBillboards().forEach(function (billboard) { expect(billboard.translucencyByDistance).toEqual( - label.translucencyByDistance + label.translucencyByDistance, ); }); }); @@ -1610,7 +1609,7 @@ describe( getGlyphBillboards().forEach(function (billboard) { expect(billboard.pixelOffsetScaleByDistance).toEqual( - label.pixelOffsetScaleByDistance + label.pixelOffsetScaleByDistance, ); }); }); @@ -1634,7 +1633,7 @@ describe( getGlyphBillboards().forEach(function (billboard) { expect(billboard.translucencyByDistance).toEqual( - label.translucencyByDistance + label.translucencyByDistance, ); }); }); @@ -1647,7 +1646,7 @@ describe( getGlyphBillboards().forEach(function (billboard) { expect(billboard.pixelOffsetScaleByDistance).toEqual( - label.pixelOffsetScaleByDistance + label.pixelOffsetScaleByDistance, ); }); }); @@ -1690,13 +1689,13 @@ describe( // X offset should be unchanged expect(getGlyphBillboardVertexTranslate(label, 0).x).toEqual( - offset0.x + offset0.x, ); expect(getGlyphBillboardVertexTranslate(label, 1).x).toEqual( - offset1.x + offset1.x, ); expect(getGlyphBillboardVertexTranslate(label, 2).x).toEqual( - offset2.x + offset2.x, ); label.verticalOrigin = VerticalOrigin.BOTTOM; @@ -1704,13 +1703,13 @@ describe( // X offset should be unchanged expect(getGlyphBillboardVertexTranslate(label, 0).x).toEqual( - offset0.x + offset0.x, ); expect(getGlyphBillboardVertexTranslate(label, 1).x).toEqual( - offset1.x + offset1.x, ); expect(getGlyphBillboardVertexTranslate(label, 2).x).toEqual( - offset2.x + offset2.x, ); }); }); @@ -1734,30 +1733,30 @@ describe( // horizontal origin LEFT should increase X offset compared to CENTER expect( - getGlyphBillboardVertexTranslate(label, 0).x + getGlyphBillboardVertexTranslate(label, 0).x, ).toBeGreaterThan(offset0.x); expect( - getGlyphBillboardVertexTranslate(label, 1).x + getGlyphBillboardVertexTranslate(label, 1).x, ).toBeGreaterThan(offset1.x); expect( - getGlyphBillboardVertexTranslate(label, 2).x + getGlyphBillboardVertexTranslate(label, 2).x, ).toBeGreaterThan(offset2.x); expect( - getBackgroundBillboardVertexTranslate(label).x + getBackgroundBillboardVertexTranslate(label).x, ).toBeGreaterThan(offsetBack.x); // Y offset should be unchanged expect(getGlyphBillboardVertexTranslate(label, 0).y).toEqual( - offset0.y + offset0.y, ); expect(getGlyphBillboardVertexTranslate(label, 1).y).toEqual( - offset1.y + offset1.y, ); expect(getGlyphBillboardVertexTranslate(label, 2).y).toEqual( - offset2.y + offset2.y, ); expect(getBackgroundBillboardVertexTranslate(label).y).toEqual( - offsetBack.y + offsetBack.y, ); label.horizontalOrigin = HorizontalOrigin.RIGHT; @@ -1765,30 +1764,30 @@ describe( // horizontal origin RIGHT should decrease X offset compared to CENTER expect(getGlyphBillboardVertexTranslate(label, 0).x).toBeLessThan( - offset0.x + offset0.x, ); expect(getGlyphBillboardVertexTranslate(label, 1).x).toBeLessThan( - offset1.x + offset1.x, ); expect(getGlyphBillboardVertexTranslate(label, 2).x).toBeLessThan( - offset2.x + offset2.x, ); expect(getBackgroundBillboardVertexTranslate(label).x).toBeLessThan( - offsetBack.x + offsetBack.x, ); // Y offset should be unchanged expect(getGlyphBillboardVertexTranslate(label, 0).y).toEqual( - offset0.y + offset0.y, ); expect(getGlyphBillboardVertexTranslate(label, 1).y).toEqual( - offset1.y + offset1.y, ); expect(getGlyphBillboardVertexTranslate(label, 2).y).toEqual( - offset2.y + offset2.y, ); expect(getBackgroundBillboardVertexTranslate(label).y).toEqual( - offsetBack.y + offsetBack.y, ); }); }); @@ -1811,22 +1810,22 @@ describe( // scaling by 2 should double X and Y offset expect(getGlyphBillboardVertexTranslate(label, 0).x).toEqual( - 2 * offset0.x + 2 * offset0.x, ); expect(getGlyphBillboardVertexTranslate(label, 0).y).toEqual( - 2 * offset0.y + 2 * offset0.y, ); expect(getGlyphBillboardVertexTranslate(label, 1).x).toEqual( - 2 * offset1.x + 2 * offset1.x, ); expect(getGlyphBillboardVertexTranslate(label, 1).y).toEqual( - 2 * offset1.y + 2 * offset1.y, ); expect(getGlyphBillboardVertexTranslate(label, 2).x).toEqual( - 2 * offset2.x + 2 * offset2.x, ); expect(getGlyphBillboardVertexTranslate(label, 2).y).toEqual( - 2 * offset2.y + 2 * offset2.y, ); // store the offsets when vertically centered at scale 2 @@ -1842,24 +1841,24 @@ describe( // horizontal origin LEFT should increase X offset compared to CENTER expect( - getGlyphBillboardVertexTranslate(label, 0).x + getGlyphBillboardVertexTranslate(label, 0).x, ).toBeGreaterThan(offset0.x); expect( - getGlyphBillboardVertexTranslate(label, 1).x + getGlyphBillboardVertexTranslate(label, 1).x, ).toBeGreaterThan(offset1.x); expect( - getGlyphBillboardVertexTranslate(label, 2).x + getGlyphBillboardVertexTranslate(label, 2).x, ).toBeGreaterThan(offset2.x); // Y offset should be unchanged expect(getGlyphBillboardVertexTranslate(label, 0).y).toEqual( - offset0.y + offset0.y, ); expect(getGlyphBillboardVertexTranslate(label, 1).y).toEqual( - offset1.y + offset1.y, ); expect(getGlyphBillboardVertexTranslate(label, 2).y).toEqual( - offset2.y + offset2.y, ); label.horizontalOrigin = HorizontalOrigin.RIGHT; @@ -1867,24 +1866,24 @@ describe( // horizontal origin RIGHT should decrease X offset compared to CENTER expect(getGlyphBillboardVertexTranslate(label, 0).x).toBeLessThan( - offset0.x + offset0.x, ); expect(getGlyphBillboardVertexTranslate(label, 1).x).toBeLessThan( - offset1.x + offset1.x, ); expect(getGlyphBillboardVertexTranslate(label, 2).x).toBeLessThan( - offset2.x + offset2.x, ); // Y offset should be unchanged expect(getGlyphBillboardVertexTranslate(label, 0).y).toEqual( - offset0.y + offset0.y, ); expect(getGlyphBillboardVertexTranslate(label, 1).y).toEqual( - offset1.y + offset1.y, ); expect(getGlyphBillboardVertexTranslate(label, 2).y).toEqual( - offset2.y + offset2.y, ); }); }); @@ -1956,22 +1955,22 @@ describe( // reducing font size should reduce absolute value of both X and Y offset expect( - Math.abs(getGlyphBillboardVertexTranslate(label, 0).x) + Math.abs(getGlyphBillboardVertexTranslate(label, 0).x), ).toBeLessThanOrEqual(Math.abs(offset0.x)); expect( - Math.abs(getGlyphBillboardVertexTranslate(label, 0).y) + Math.abs(getGlyphBillboardVertexTranslate(label, 0).y), ).toBeLessThanOrEqual(Math.abs(offset0.y)); expect( - Math.abs(getGlyphBillboardVertexTranslate(label, 1).x) + Math.abs(getGlyphBillboardVertexTranslate(label, 1).x), ).toBeLessThanOrEqual(Math.abs(offset1.x)); expect( - Math.abs(getGlyphBillboardVertexTranslate(label, 1).y) + Math.abs(getGlyphBillboardVertexTranslate(label, 1).y), ).toBeLessThanOrEqual(Math.abs(offset1.y)); expect( - Math.abs(getGlyphBillboardVertexTranslate(label, 2).x) + Math.abs(getGlyphBillboardVertexTranslate(label, 2).x), ).toBeLessThanOrEqual(Math.abs(offset2.x)); expect( - Math.abs(getGlyphBillboardVertexTranslate(label, 2).y) + Math.abs(getGlyphBillboardVertexTranslate(label, 2).y), ).toBeLessThanOrEqual(Math.abs(offset2.y)); }); }); @@ -2001,13 +2000,13 @@ describe( return allLabelsReady().then(function () { expect(getGlyphBillboardVertexTranslate(one, 0)).toEqual( - getGlyphBillboardVertexTranslate(two, 0) + getGlyphBillboardVertexTranslate(two, 0), ); expect(getGlyphBillboardVertexTranslate(one, 1)).toEqual( - getGlyphBillboardVertexTranslate(two, 1) + getGlyphBillboardVertexTranslate(two, 1), ); expect(getGlyphBillboardVertexTranslate(one, 2)).toEqual( - getGlyphBillboardVertexTranslate(two, 2) + getGlyphBillboardVertexTranslate(two, 2), ); }); }); @@ -2090,14 +2089,14 @@ describe( return allLabelsReady().then(function () { const originalBbox = Label.getScreenSpaceBoundingBox( label, - Cartesian2.ZERO + Cartesian2.ZERO, ); label.text = "apl\napl\napl"; scene.renderForSpecs(); const newlinesBbox = Label.getScreenSpaceBoundingBox( label, - Cartesian2.ZERO + Cartesian2.ZERO, ); expect(newlinesBbox.width).toBeLessThan(originalBbox.width); @@ -2127,7 +2126,7 @@ describe( }); }); }, - "WebGL" + "WebGL", ); describe("right to left detection", function () { @@ -2323,14 +2322,15 @@ describe( expected.center = new Cartesian3( 0.0, expected.center.x, - expected.center.y + expected.center.y, ); expect(actual.center).toEqualEpsilon( expected.center, - CesiumMath.EPSILON8 + CesiumMath.EPSILON8, ); expect(actual.radius).toBeGreaterThanOrEqual(expected.radius); - scene.screenSpaceCameraController.enableCollisionDetection = originalEnableCollisionDetection; + scene.screenSpaceCameraController.enableCollisionDetection = + originalEnableCollisionDetection; }); }); @@ -2363,11 +2363,11 @@ describe( expected.center = new Cartesian3( 0.0, expected.center.x, - expected.center.y + expected.center.y, ); expect(actual.center).toEqualEpsilon( expected.center, - CesiumMath.EPSILON8 + CesiumMath.EPSILON8, ); expect(actual.radius).toBeGreaterThan(expected.radius); }); @@ -2599,7 +2599,7 @@ describe( expect(scene.updateHeight).toHaveBeenCalledWith( Cartographic.fromCartesian(position), jasmine.any(Function), - HeightReference.CLAMP_TO_GROUND + HeightReference.CLAMP_TO_GROUND, ); }); @@ -2615,7 +2615,7 @@ describe( expect(scene.updateHeight).toHaveBeenCalledWith( Cartographic.fromCartesian(position), jasmine.any(Function), - HeightReference.CLAMP_TO_GROUND + HeightReference.CLAMP_TO_GROUND, ); }); @@ -2631,7 +2631,7 @@ describe( expect(scene.updateHeight).toHaveBeenCalledWith( Cartographic.fromCartesian(position), jasmine.any(Function), - HeightReference.CLAMP_TO_GROUND + HeightReference.CLAMP_TO_GROUND, ); l.heightReference = HeightReference.RELATIVE_TO_GROUND; @@ -2639,7 +2639,7 @@ describe( expect(scene.updateHeight).toHaveBeenCalledWith( Cartographic.fromCartesian(position), jasmine.any(Function), - HeightReference.RELATIVE_TO_GROUND + HeightReference.RELATIVE_TO_GROUND, ); }); @@ -2671,7 +2671,7 @@ describe( expect(scene.updateHeight).toHaveBeenCalledWith( Cartographic.fromCartesian(position), jasmine.any(Function), - HeightReference.CLAMP_TO_GROUND + HeightReference.CLAMP_TO_GROUND, ); position = l.position = Cartesian3.fromDegrees(-73.0, 40.0); @@ -2680,7 +2680,7 @@ describe( expect(scene.updateHeight).toHaveBeenCalledWith( Cartographic.fromCartesian(position), jasmine.any(Function), - HeightReference.CLAMP_TO_GROUND + HeightReference.CLAMP_TO_GROUND, ); }); @@ -2692,7 +2692,7 @@ describe( cartographic.height = height; updateCallback(cartographic); }; - } + }, ); const position = Cartesian3.fromDegrees(-72.0, 40.0); @@ -2703,14 +2703,14 @@ describe( expect(scene.updateHeight).toHaveBeenCalled(); let cartographic = scene.globe.ellipsoid.cartesianToCartographic( - l._clampedPosition + l._clampedPosition, ); expect(cartographic.height).toEqual(0.0); invokeCallback(100.0); cartographic = scene.globe.ellipsoid.cartesianToCartographic( - l._clampedPosition + l._clampedPosition, ); expect(cartographic.height).toEqualEpsilon(100.0, CesiumMath.EPSILON9); }); @@ -2746,11 +2746,11 @@ describe( labelsWithHeight.remove(l); expect(spy).toHaveBeenCalled(); expect( - labelsWithHeight._spareBillboards[0]._removeCallbackFunc + labelsWithHeight._spareBillboards[0]._removeCallbackFunc, ).toBeUndefined(); }); }); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/MapboxImageryProviderSpec.js b/packages/engine/Specs/Scene/MapboxImageryProviderSpec.js index 201da71b3e65..cba4f0aebf7f 100644 --- a/packages/engine/Specs/Scene/MapboxImageryProviderSpec.js +++ b/packages/engine/Specs/Scene/MapboxImageryProviderSpec.js @@ -51,20 +51,18 @@ describe("Scene/MapboxImageryProvider", function () { mapId: "test-id", }); - spyOn(Resource._Implementations, "createImage").and.callFake(function ( - request, - crossOrigin, - deferred - ) { - expect(request.url).not.toContain("//"); - - // Just return any old image. - Resource._DefaultImplementations.createImage( - new Request({ url: "Data/Images/Red16x16.png" }), - crossOrigin, - deferred - ); - }); + spyOn(Resource._Implementations, "createImage").and.callFake( + function (request, crossOrigin, deferred) { + expect(request.url).not.toContain("//"); + + // Just return any old image. + Resource._DefaultImplementations.createImage( + new Request({ url: "Data/Images/Red16x16.png" }), + crossOrigin, + deferred, + ); + }, + ); return provider.requestImage(0, 0, 0).then(function (image) { expect(Resource._Implementations.createImage).toHaveBeenCalled(); @@ -79,20 +77,18 @@ describe("Scene/MapboxImageryProvider", function () { mapId: "test-id", }); - spyOn(Resource._Implementations, "createImage").and.callFake(function ( - request, - crossOrigin, - deferred - ) { - expect(request.url).toContain("made/up/mapbox/server/"); - - // Just return any old image. - Resource._DefaultImplementations.createImage( - new Request({ url: "Data/Images/Red16x16.png" }), - crossOrigin, - deferred - ); - }); + spyOn(Resource._Implementations, "createImage").and.callFake( + function (request, crossOrigin, deferred) { + expect(request.url).toContain("made/up/mapbox/server/"); + + // Just return any old image. + Resource._DefaultImplementations.createImage( + new Request({ url: "Data/Images/Red16x16.png" }), + crossOrigin, + deferred, + ); + }, + ); return provider.requestImage(0, 0, 0).then(function (image) { expect(Resource._Implementations.createImage).toHaveBeenCalled(); @@ -108,7 +104,7 @@ describe("Scene/MapboxImageryProvider", function () { }); expect(provider.url).toEqual( - "made/up/mapbox/server/test-id/{z}/{x}/{y}.png?access_token=test-token" + "made/up/mapbox/server/test-id/{z}/{x}/{y}.png?access_token=test-token", ); expect(provider.tileWidth).toEqual(256); expect(provider.tileHeight).toEqual(256); @@ -116,18 +112,16 @@ describe("Scene/MapboxImageryProvider", function () { expect(provider.tilingScheme).toBeInstanceOf(WebMercatorTilingScheme); expect(provider.rectangle).toEqual(new WebMercatorTilingScheme().rectangle); - spyOn(Resource._Implementations, "createImage").and.callFake(function ( - request, - crossOrigin, - deferred - ) { - // Just return any old image. - Resource._DefaultImplementations.createImage( - new Request({ url: "Data/Images/Red16x16.png" }), - crossOrigin, - deferred - ); - }); + spyOn(Resource._Implementations, "createImage").and.callFake( + function (request, crossOrigin, deferred) { + // Just return any old image. + Resource._DefaultImplementations.createImage( + new Request({ url: "Data/Images/Red16x16.png" }), + crossOrigin, + deferred, + ); + }, + ); return provider.requestImage(0, 0, 0).then(function (image) { expect(Resource._Implementations.createImage).toHaveBeenCalled(); @@ -151,20 +145,18 @@ describe("Scene/MapboxImageryProvider", function () { expect(provider.rectangle).toEqualEpsilon(rectangle, CesiumMath.EPSILON14); expect(provider.tileDiscardPolicy).toBeUndefined(); - spyOn(Resource._Implementations, "createImage").and.callFake(function ( - request, - crossOrigin, - deferred - ) { - expect(request.url).toContain("/0/0/0"); - - // Just return any old image. - Resource._DefaultImplementations.createImage( - new Request({ url: "Data/Images/Red16x16.png" }), - crossOrigin, - deferred - ); - }); + spyOn(Resource._Implementations, "createImage").and.callFake( + function (request, crossOrigin, deferred) { + expect(request.url).toContain("/0/0/0"); + + // Just return any old image. + Resource._DefaultImplementations.createImage( + new Request({ url: "Data/Images/Red16x16.png" }), + crossOrigin, + deferred, + ); + }, + ); return provider.requestImage(0, 0, 0).then(function (image) { expect(Resource._Implementations.createImage).toHaveBeenCalled(); @@ -236,14 +228,14 @@ describe("Scene/MapboxImageryProvider", function () { Resource._Implementations.createImage = function ( request, crossOrigin, - deferred + deferred, ) { if (tries === 2) { // Succeed after 2 tries Resource._DefaultImplementations.createImage( new Request({ url: "Data/Images/Red16x16.png" }), crossOrigin, - deferred + deferred, ); } else { // fail @@ -275,24 +267,22 @@ describe("Scene/MapboxImageryProvider", function () { format: "@2x.png", }); - spyOn(Resource._Implementations, "createImage").and.callFake(function ( - request, - crossOrigin, - deferred - ) { - expect( - /made\/up\/mapbox\/server\/test-id\/0\/0\/0@2x\.png\?access_token=/.test( - request.url - ) - ).toBe(true); - - // Just return any old image. - Resource._DefaultImplementations.createImage( - new Request({ url: "Data/Images/Red16x16.png" }), - crossOrigin, - deferred - ); - }); + spyOn(Resource._Implementations, "createImage").and.callFake( + function (request, crossOrigin, deferred) { + expect( + /made\/up\/mapbox\/server\/test-id\/0\/0\/0@2x\.png\?access_token=/.test( + request.url, + ), + ).toBe(true); + + // Just return any old image. + Resource._DefaultImplementations.createImage( + new Request({ url: "Data/Images/Red16x16.png" }), + crossOrigin, + deferred, + ); + }, + ); return provider.requestImage(0, 0, 0).then(function (image) { expect(Resource._Implementations.createImage).toHaveBeenCalled(); @@ -307,24 +297,22 @@ describe("Scene/MapboxImageryProvider", function () { format: "png", }); - spyOn(Resource._Implementations, "createImage").and.callFake(function ( - request, - crossOrigin, - deferred - ) { - expect( - /made\/up\/mapbox\/server\/test-id\/0\/0\/0\.png\?access_token=/.test( - request.url - ) - ).toBe(true); - - // Just return any old image. - Resource._DefaultImplementations.createImage( - new Request({ url: "Data/Images/Red16x16.png" }), - crossOrigin, - deferred - ); - }); + spyOn(Resource._Implementations, "createImage").and.callFake( + function (request, crossOrigin, deferred) { + expect( + /made\/up\/mapbox\/server\/test-id\/0\/0\/0\.png\?access_token=/.test( + request.url, + ), + ).toBe(true); + + // Just return any old image. + Resource._DefaultImplementations.createImage( + new Request({ url: "Data/Images/Red16x16.png" }), + crossOrigin, + deferred, + ); + }, + ); return provider.requestImage(0, 0, 0).then(function (image) { expect(Resource._Implementations.createImage).toHaveBeenCalled(); diff --git a/packages/engine/Specs/Scene/MapboxStyleImageryProviderSpec.js b/packages/engine/Specs/Scene/MapboxStyleImageryProviderSpec.js index a44d3c25c3e2..2bd1728922d8 100644 --- a/packages/engine/Specs/Scene/MapboxStyleImageryProviderSpec.js +++ b/packages/engine/Specs/Scene/MapboxStyleImageryProviderSpec.js @@ -51,20 +51,18 @@ describe("Scene/MapboxStyleImageryProvider", function () { styleId: "test-id", }); - spyOn(Resource._Implementations, "createImage").and.callFake(function ( - request, - crossOrigin, - deferred - ) { - expect(request.url).not.toContain("//"); - - // Just return any old image. - Resource._DefaultImplementations.createImage( - new Request({ url: "Data/Images/Red16x16.png" }), - crossOrigin, - deferred - ); - }); + spyOn(Resource._Implementations, "createImage").and.callFake( + function (request, crossOrigin, deferred) { + expect(request.url).not.toContain("//"); + + // Just return any old image. + Resource._DefaultImplementations.createImage( + new Request({ url: "Data/Images/Red16x16.png" }), + crossOrigin, + deferred, + ); + }, + ); return provider.requestImage(0, 0, 0).then(function (image) { expect(Resource._Implementations.createImage).toHaveBeenCalled(); @@ -79,20 +77,18 @@ describe("Scene/MapboxStyleImageryProvider", function () { styleId: "test-id", }); - spyOn(Resource._Implementations, "createImage").and.callFake(function ( - request, - crossOrigin, - deferred - ) { - expect(request.url).toContain("made/up/mapbox/server/"); - - // Just return any old image. - Resource._DefaultImplementations.createImage( - new Request({ url: "Data/Images/Red16x16.png" }), - crossOrigin, - deferred - ); - }); + spyOn(Resource._Implementations, "createImage").and.callFake( + function (request, crossOrigin, deferred) { + expect(request.url).toContain("made/up/mapbox/server/"); + + // Just return any old image. + Resource._DefaultImplementations.createImage( + new Request({ url: "Data/Images/Red16x16.png" }), + crossOrigin, + deferred, + ); + }, + ); return provider.requestImage(0, 0, 0).then(function (image) { expect(Resource._Implementations.createImage).toHaveBeenCalled(); @@ -108,7 +104,7 @@ describe("Scene/MapboxStyleImageryProvider", function () { }); expect(provider.url).toEqual( - "made/up/mapbox/server/mapbox/test-id/tiles/512/{z}/{x}/{y}?access_token=test-token" + "made/up/mapbox/server/mapbox/test-id/tiles/512/{z}/{x}/{y}?access_token=test-token", ); expect(provider.tileWidth).toEqual(256); expect(provider.tileHeight).toEqual(256); @@ -116,18 +112,16 @@ describe("Scene/MapboxStyleImageryProvider", function () { expect(provider.tilingScheme).toBeInstanceOf(WebMercatorTilingScheme); expect(provider.rectangle).toEqual(new WebMercatorTilingScheme().rectangle); - spyOn(Resource._Implementations, "createImage").and.callFake(function ( - request, - crossOrigin, - deferred - ) { - // Just return any old image. - Resource._DefaultImplementations.createImage( - new Request({ url: "Data/Images/Red16x16.png" }), - crossOrigin, - deferred - ); - }); + spyOn(Resource._Implementations, "createImage").and.callFake( + function (request, crossOrigin, deferred) { + // Just return any old image. + Resource._DefaultImplementations.createImage( + new Request({ url: "Data/Images/Red16x16.png" }), + crossOrigin, + deferred, + ); + }, + ); return provider.requestImage(0, 0, 0).then(function (image) { expect(Resource._Implementations.createImage).toHaveBeenCalled(); @@ -151,20 +145,18 @@ describe("Scene/MapboxStyleImageryProvider", function () { expect(provider.rectangle).toEqualEpsilon(rectangle, CesiumMath.EPSILON14); expect(provider.tileDiscardPolicy).toBeUndefined(); - spyOn(Resource._Implementations, "createImage").and.callFake(function ( - request, - crossOrigin, - deferred - ) { - expect(request.url).toContain("/0/0/0"); - - // Just return any old image. - Resource._DefaultImplementations.createImage( - new Request({ url: "Data/Images/Red16x16.png" }), - crossOrigin, - deferred - ); - }); + spyOn(Resource._Implementations, "createImage").and.callFake( + function (request, crossOrigin, deferred) { + expect(request.url).toContain("/0/0/0"); + + // Just return any old image. + Resource._DefaultImplementations.createImage( + new Request({ url: "Data/Images/Red16x16.png" }), + crossOrigin, + deferred, + ); + }, + ); return provider.requestImage(0, 0, 0).then(function (image) { expect(Resource._Implementations.createImage).toHaveBeenCalled(); @@ -236,14 +228,14 @@ describe("Scene/MapboxStyleImageryProvider", function () { Resource._Implementations.createImage = function ( request, crossOrigin, - deferred + deferred, ) { if (tries === 2) { // Succeed after 2 tries Resource._DefaultImplementations.createImage( new Request({ url: "Data/Images/Red16x16.png" }), crossOrigin, - deferred + deferred, ); } else { // fail @@ -274,20 +266,18 @@ describe("Scene/MapboxStyleImageryProvider", function () { styleId: "test-id", }); - spyOn(Resource._Implementations, "createImage").and.callFake(function ( - request, - crossOrigin, - deferred - ) { - expect(request.url).toContain("http://fake.map.com"); - - // Just return any old image. - Resource._DefaultImplementations.createImage( - new Request({ url: "Data/Images/Red16x16.png" }), - crossOrigin, - deferred - ); - }); + spyOn(Resource._Implementations, "createImage").and.callFake( + function (request, crossOrigin, deferred) { + expect(request.url).toContain("http://fake.map.com"); + + // Just return any old image. + Resource._DefaultImplementations.createImage( + new Request({ url: "Data/Images/Red16x16.png" }), + crossOrigin, + deferred, + ); + }, + ); return provider.requestImage(0, 0, 0); }); @@ -299,22 +289,20 @@ describe("Scene/MapboxStyleImageryProvider", function () { username: "fakeUsername", }); - spyOn(Resource._Implementations, "createImage").and.callFake(function ( - request, - crossOrigin, - deferred - ) { - expect(request.url).toContain( - "https://api.mapbox.com/styles/v1/fakeUsername" - ); - - // Just return any old image. - Resource._DefaultImplementations.createImage( - new Request({ url: "Data/Images/Red16x16.png" }), - crossOrigin, - deferred - ); - }); + spyOn(Resource._Implementations, "createImage").and.callFake( + function (request, crossOrigin, deferred) { + expect(request.url).toContain( + "https://api.mapbox.com/styles/v1/fakeUsername", + ); + + // Just return any old image. + Resource._DefaultImplementations.createImage( + new Request({ url: "Data/Images/Red16x16.png" }), + crossOrigin, + deferred, + ); + }, + ); return provider.requestImage(0, 0, 0); }); @@ -326,22 +314,20 @@ describe("Scene/MapboxStyleImageryProvider", function () { tilesize: 256, }); - spyOn(Resource._Implementations, "createImage").and.callFake(function ( - request, - crossOrigin, - deferred - ) { - expect(request.url).toContain( - "https://api.mapbox.com/styles/v1/mapbox/test-id/tiles/256" - ); - - // Just return any old image. - Resource._DefaultImplementations.createImage( - new Request({ url: "Data/Images/Red16x16.png" }), - crossOrigin, - deferred - ); - }); + spyOn(Resource._Implementations, "createImage").and.callFake( + function (request, crossOrigin, deferred) { + expect(request.url).toContain( + "https://api.mapbox.com/styles/v1/mapbox/test-id/tiles/256", + ); + + // Just return any old image. + Resource._DefaultImplementations.createImage( + new Request({ url: "Data/Images/Red16x16.png" }), + crossOrigin, + deferred, + ); + }, + ); return provider.requestImage(0, 0, 0); }); @@ -353,22 +339,20 @@ describe("Scene/MapboxStyleImageryProvider", function () { scaleFactor: true, }); - spyOn(Resource._Implementations, "createImage").and.callFake(function ( - request, - crossOrigin, - deferred - ) { - expect(request.url).toContain( - "https://api.mapbox.com/styles/v1/mapbox/test-id/tiles/512/0/0/0@2x" - ); - - // Just return any old image. - Resource._DefaultImplementations.createImage( - new Request({ url: "Data/Images/Red16x16.png" }), - crossOrigin, - deferred - ); - }); + spyOn(Resource._Implementations, "createImage").and.callFake( + function (request, crossOrigin, deferred) { + expect(request.url).toContain( + "https://api.mapbox.com/styles/v1/mapbox/test-id/tiles/512/0/0/0@2x", + ); + + // Just return any old image. + Resource._DefaultImplementations.createImage( + new Request({ url: "Data/Images/Red16x16.png" }), + crossOrigin, + deferred, + ); + }, + ); return provider.requestImage(0, 0, 0); }); diff --git a/packages/engine/Specs/Scene/MaterialAppearanceSpec.js b/packages/engine/Specs/Scene/MaterialAppearanceSpec.js index 014322fe88d0..bad1a970b4c4 100644 --- a/packages/engine/Specs/Scene/MaterialAppearanceSpec.js +++ b/packages/engine/Specs/Scene/MaterialAppearanceSpec.js @@ -40,7 +40,7 @@ describe( function createPrimitive(vertexFormat) { vertexFormat = defaultValue( vertexFormat, - MaterialAppearance.MaterialSupport.ALL.vertexFormat + MaterialAppearance.MaterialSupport.ALL.vertexFormat, ); primitive = new Primitive({ geometryInstances: new GeometryInstance({ @@ -60,21 +60,21 @@ describe( const a = new MaterialAppearance(); expect(a.materialSupport).toEqual( - MaterialAppearance.MaterialSupport.TEXTURED + MaterialAppearance.MaterialSupport.TEXTURED, ); expect(a.material).toBeDefined(); expect(a.material.type).toEqual(Material.ColorType); expect(a.vertexShaderSource).toEqual( - MaterialAppearance.MaterialSupport.TEXTURED.vertexShaderSource + MaterialAppearance.MaterialSupport.TEXTURED.vertexShaderSource, ); expect(a.fragmentShaderSource).toEqual( - MaterialAppearance.MaterialSupport.TEXTURED.fragmentShaderSource + MaterialAppearance.MaterialSupport.TEXTURED.fragmentShaderSource, ); expect(a.renderState).toEqual( - Appearance.getDefaultRenderState(true, false) + Appearance.getDefaultRenderState(true, false), ); expect(a.vertexFormat).toEqual( - MaterialAppearance.MaterialSupport.TEXTURED.vertexFormat + MaterialAppearance.MaterialSupport.TEXTURED.vertexFormat, ); expect(a.flat).toEqual(false); expect(a.faceForward).toEqual(true); @@ -129,5 +129,5 @@ describe( expect(scene).notToRender(backgroundColor); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/MaterialSpec.js b/packages/engine/Specs/Scene/MaterialSpec.js index 53b0148ca38a..9b940ef30994 100644 --- a/packages/engine/Specs/Scene/MaterialSpec.js +++ b/packages/engine/Specs/Scene/MaterialSpec.js @@ -38,7 +38,7 @@ describe( backgroundColor[1], backgroundColor[2], backgroundColor[3], - scene.backgroundColor + scene.backgroundColor, ); scene.primitives.destroyPrimitives = false; scene.camera.setView({ destination: rectangle }); @@ -71,7 +71,7 @@ describe( polyline = polylines.add({ positions: Cartesian3.fromDegreesArray( [-50.0, 0.0, 50.0, 0.0], - Ellipsoid.WGS84 + Ellipsoid.WGS84, ), width: 5.0, }); @@ -494,22 +494,8 @@ describe( fabric: { uniforms: { value: [ - 0.5, - 0.5, - 0.5, - 0.5, - 0.5, - 0.5, - 0.5, - 0.5, - 0.5, - 0.5, - 0.5, - 0.5, - 0.5, - 0.5, - 0.5, - 0.5, + 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, + 0.5, 0.5, 0.5, ], }, components: { @@ -1063,5 +1049,5 @@ describe( material.destroy(); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/MegatextureSpec.js b/packages/engine/Specs/Scene/MegatextureSpec.js index 9074e86898cf..1e191000f158 100644 --- a/packages/engine/Specs/Scene/MegatextureSpec.js +++ b/packages/engine/Specs/Scene/MegatextureSpec.js @@ -22,7 +22,7 @@ describe("Scene/Megatexture", function () { dimensions, channelCount, componentType, - textureMemoryByteLength / 2 + textureMemoryByteLength / 2, ); }).toThrowError(RuntimeError); @@ -31,7 +31,7 @@ describe("Scene/Megatexture", function () { dimensions, channelCount, componentType, - textureMemoryByteLength + textureMemoryByteLength, ); expect(megatexture.channelCount).toBe(channelCount); expect(megatexture.componentType).toBe(componentType); @@ -52,7 +52,7 @@ describe("Scene/Megatexture", function () { scene.context, dimensions, channelCount, - componentType + componentType, ); const data = new Uint16Array(tileSize); @@ -78,7 +78,7 @@ describe("Scene/Megatexture", function () { dimensions, channelCount, componentType, - textureMemoryByteLength + textureMemoryByteLength, ); const data = new Float32Array(tileSize); @@ -108,7 +108,7 @@ describe("Scene/Megatexture", function () { dimensions, channelCount, componentType, - textureMemoryByteLength + textureMemoryByteLength, ); expect(megatexture.occupiedCount).toBe(0); @@ -160,8 +160,8 @@ describe("Scene/Megatexture", function () { tileCount, dimensions, channelCount, - componentType - ) + componentType, + ), ).toBe(textureMemoryByteLength); }); @@ -182,7 +182,7 @@ describe("Scene/Megatexture", function () { dimensions, channelCount, componentType, - textureMemoryByteLength + textureMemoryByteLength, ); expect(megatexture.maximumTileCount).toBe(4); diff --git a/packages/engine/Specs/Scene/MetadataClassPropertySpec.js b/packages/engine/Specs/Scene/MetadataClassPropertySpec.js index 7e79fb403d0d..4f2f2ca37129 100644 --- a/packages/engine/Specs/Scene/MetadataClassPropertySpec.js +++ b/packages/engine/Specs/Scene/MetadataClassPropertySpec.js @@ -460,15 +460,7 @@ describe("Scene/MetadataClassProperty", function () { const isNested = false; expect(property.expandConstant(1, isNested)).toEqual([ - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, ]); property = MetadataClassProperty.fromJson({ @@ -482,24 +474,7 @@ describe("Scene/MetadataClassProperty", function () { }); expect(property.expandConstant(1, isNested)).toEqual([ - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ]); }); @@ -854,7 +829,7 @@ describe("Scene/MetadataClassProperty", function () { const value = scalarValues[propertyId][i]; const normalizedValue = property.normalize(value); expect(normalizedValue).toEqual( - normalizedScalarValues[propertyId][i] + normalizedScalarValues[propertyId][i], ); } } @@ -894,7 +869,7 @@ describe("Scene/MetadataClassProperty", function () { const value = arrayValues[propertyId][i]; const normalizedValue = property.normalize(clone(value, true)); expect(normalizedValue).toEqual( - normalizedArrayValues[propertyId][i] + normalizedArrayValues[propertyId][i], ); } } @@ -930,7 +905,7 @@ describe("Scene/MetadataClassProperty", function () { const value = vectorValues[propertyId][i]; const normalizedValue = property.normalize(clone(value, true)); expect(normalizedValue).toEqual( - normalizedVectorValues[propertyId][i] + normalizedVectorValues[propertyId][i], ); } } @@ -966,7 +941,7 @@ describe("Scene/MetadataClassProperty", function () { const value = arrayOfVectorValues[propertyId][i]; const normalizedValue = property.normalize(clone(value, true)); expect(normalizedValue).toEqual( - normalizedArrayOfVectorValues[propertyId][i] + normalizedArrayOfVectorValues[propertyId][i], ); } } @@ -1438,7 +1413,7 @@ describe("Scene/MetadataClassProperty", function () { const value = scalarValues[propertyId][i]; const transformedValue = property.applyValueTransform(value); expect(transformedValue).toEqual( - transformedScalarValues[propertyId][i] + transformedScalarValues[propertyId][i], ); } } @@ -1483,7 +1458,7 @@ describe("Scene/MetadataClassProperty", function () { it("value transformations are no-ops for identity transformations", function () { const valueTransformInPlace = spyOn( MetadataClassProperty, - "valueTransformInPlace" + "valueTransformInPlace", ); const property = MetadataClassProperty.fromJson({ id: "identityTransform", @@ -1509,10 +1484,10 @@ describe("Scene/MetadataClassProperty", function () { for (let i = 0; i < length; ++i) { const value = arrayValues[propertyId][i]; const transformedValue = property.applyValueTransform( - clone(value, true) + clone(value, true), ); expect(transformedValue).toEqual( - transformedArrayValues[propertyId][i] + transformedArrayValues[propertyId][i], ); } } @@ -1530,7 +1505,7 @@ describe("Scene/MetadataClassProperty", function () { for (let i = 0; i < length; ++i) { const transformedValue = transformedArrayValues[propertyId][i]; const value = property.unapplyValueTransform( - clone(transformedValue, true) + clone(transformedValue, true), ); expect(value).toEqual(arrayValues[propertyId][i]); } @@ -1541,7 +1516,7 @@ describe("Scene/MetadataClassProperty", function () { it("value transforms do not transform variable length arrays", function () { const valueTransformInPlace = spyOn( MetadataClassProperty, - "valueTransformInPlace" + "valueTransformInPlace", ); const property = MetadataClassProperty.fromJson({ @@ -1559,7 +1534,7 @@ describe("Scene/MetadataClassProperty", function () { const values = [-1.0, 0.0, 5.0, 4.0]; expect(property.applyValueTransform(clone(values, true))).toEqual(values); expect(property.unapplyValueTransform(clone(values, true))).toEqual( - values + values, ); expect(valueTransformInPlace).not.toHaveBeenCalled(); @@ -1576,10 +1551,10 @@ describe("Scene/MetadataClassProperty", function () { for (let i = 0; i < length; ++i) { const value = vectorValues[propertyId][i]; const transformedValue = property.applyValueTransform( - clone(value, true) + clone(value, true), ); expect(transformedValue).toEqual( - transformedVectorValues[propertyId][i] + transformedVectorValues[propertyId][i], ); } } @@ -1597,7 +1572,7 @@ describe("Scene/MetadataClassProperty", function () { for (let i = 0; i < length; ++i) { const transformedValue = transformedVectorValues[propertyId][i]; const value = property.unapplyValueTransform( - clone(transformedValue, true) + clone(transformedValue, true), ); expect(value).toEqual(vectorValues[propertyId][i]); } @@ -1616,10 +1591,10 @@ describe("Scene/MetadataClassProperty", function () { for (let i = 0; i < length; ++i) { const value = arrayOfVectorValues[propertyId][i]; const transformedValue = property.applyValueTransform( - clone(value, true) + clone(value, true), ); expect(transformedValue).toEqual( - transformedArrayOfVectorValues[propertyId][i] + transformedArrayOfVectorValues[propertyId][i], ); } } @@ -1638,7 +1613,7 @@ describe("Scene/MetadataClassProperty", function () { const transformedValue = transformedArrayOfVectorValues[propertyId][i]; const value = property.unapplyValueTransform( - clone(transformedValue, true) + clone(transformedValue, true), ); expect(value).toEqual(arrayOfVectorValues[propertyId][i]); } @@ -2622,7 +2597,7 @@ describe("Scene/MetadataClassProperty", function () { new Cartesian3(1.0, 2.0, 3.0), new Cartesian3(4.0, 5.0, 6.0), new Cartesian3(7.0, 8.0, 9.0), - ]) + ]), ).toBeUndefined(); }); @@ -2642,7 +2617,7 @@ describe("Scene/MetadataClassProperty", function () { new Matrix3(1, 0, 0, 0, 1, 0, 0, 0, 1), new Matrix3(2, 0, 0, 0, 2, 0, 0, 0, 2), new Matrix3(3, 0, 0, 0, 3, 0, 0, 0, 3), - ]) + ]), ).toBeUndefined(); }); @@ -2657,7 +2632,7 @@ describe("Scene/MetadataClassProperty", function () { }); expect(property.validate(undefined)).toBe( - "required property must have a value" + "required property must have a value", ); }); @@ -2699,7 +2674,7 @@ describe("Scene/MetadataClassProperty", function () { }); expect(property.validate(8.0)).toBe( - "componentType STRING is incompatible with vector type VEC2" + "componentType STRING is incompatible with vector type VEC2", ); }); @@ -2713,7 +2688,7 @@ describe("Scene/MetadataClassProperty", function () { }); expect(property.validate(8.0)).toBe( - "componentType INT64 is incompatible with matrix type MAT3" + "componentType INT64 is incompatible with matrix type MAT3", ); }); @@ -2793,7 +2768,7 @@ describe("Scene/MetadataClassProperty", function () { }); expect(property.validate([1.0, 2.0])).toBe( - "Array length does not match property.arrayLength" + "Array length does not match property.arrayLength", ); }); @@ -2830,10 +2805,10 @@ describe("Scene/MetadataClassProperty", function () { }); expect(property.validate("INVALID")).toBe( - "value INVALID is not a valid enum name for myEnum" + "value INVALID is not a valid enum name for myEnum", ); expect(property.validate(0)).toBe( - "value 0 is not a valid enum name for myEnum" + "value 0 is not a valid enum name for myEnum", ); }); @@ -2860,7 +2835,7 @@ describe("Scene/MetadataClassProperty", function () { }, }); expect(property.validate({})).toBe( - `value [object Object] does not match type ${types[i]}` + `value [object Object] does not match type ${types[i]}`, ); } }); @@ -2873,7 +2848,7 @@ describe("Scene/MetadataClassProperty", function () { }, }); expect(property.validate({})).toBe( - `value [object Object] does not match type BOOLEAN` + `value [object Object] does not match type BOOLEAN`, ); }); @@ -2885,7 +2860,7 @@ describe("Scene/MetadataClassProperty", function () { }, }); expect(property.validate({})).toBe( - `value [object Object] does not match type STRING` + `value [object Object] does not match type STRING`, ); }); @@ -2924,7 +2899,7 @@ describe("Scene/MetadataClassProperty", function () { }); for (let i = 0; i < values.length; ++i) { expect(property.validate(values[i])).toBe( - `value ${values[i]} is out of range for type ${type}` + `value ${values[i]} is out of range for type ${type}`, ); } } @@ -2965,7 +2940,7 @@ describe("Scene/MetadataClassProperty", function () { }); for (let i = 0; i < nonFiniteValues.length; ++i) { expect(property.validate(nonFiniteValues[i])).toBe( - `value ${nonFiniteValues[i]} of type ${type} must be finite` + `value ${nonFiniteValues[i]} of type ${type} must be finite`, ); } } @@ -3007,7 +2982,7 @@ describe("Scene/MetadataClassProperty", function () { }); for (let i = 0; i < values.length; ++i) { expect(property.validate(values)).toBe( - `value ${values[0]} is out of range for type ${componentType}` + `value ${values[0]} is out of range for type ${componentType}`, ); } } @@ -3034,16 +3009,16 @@ describe("Scene/MetadataClassProperty", function () { }); expect(propertyInt8.validate(-1.1)).toBe( - "value -1.1 is out of range for type INT8 (normalized)" + "value -1.1 is out of range for type INT8 (normalized)", ); expect(propertyInt8.validate(1.1)).toBe( - "value 1.1 is out of range for type INT8 (normalized)" + "value 1.1 is out of range for type INT8 (normalized)", ); expect(propertyUint8.validate(-0.1)).toBe( - "value -0.1 is out of range for type UINT8 (normalized)" + "value -0.1 is out of range for type UINT8 (normalized)", ); expect(propertyUint8.validate(1.1)).toBe( - "value 1.1 is out of range for type UINT8 (normalized)" + "value 1.1 is out of range for type UINT8 (normalized)", ); }); @@ -3056,7 +3031,7 @@ describe("Scene/MetadataClassProperty", function () { value, offset, scale, - MetadataComponentType.applyValueTransform + MetadataComponentType.applyValueTransform, ); expect(result).toBe(3); @@ -3070,7 +3045,7 @@ describe("Scene/MetadataClassProperty", function () { value, offset, scale, - MetadataComponentType.applyValueTransform + MetadataComponentType.applyValueTransform, ); expect(result).toEqual([3, 4, 5]); }); @@ -3095,7 +3070,7 @@ describe("Scene/MetadataClassProperty", function () { values, offset, scale, - MetadataComponentType.applyValueTransform + MetadataComponentType.applyValueTransform, ); expect(result).toEqual([ [3, 4, 5], diff --git a/packages/engine/Specs/Scene/MetadataComponentTypeSpec.js b/packages/engine/Specs/Scene/MetadataComponentTypeSpec.js index 3bb720dff7e1..025792cccabb 100644 --- a/packages/engine/Specs/Scene/MetadataComponentTypeSpec.js +++ b/packages/engine/Specs/Scene/MetadataComponentTypeSpec.js @@ -7,40 +7,40 @@ import { describe("Scene/MetadataComponentType", function () { it("getMinimum", function () { expect(MetadataComponentType.getMinimum(MetadataComponentType.INT8)).toBe( - -128 + -128, ); expect(MetadataComponentType.getMinimum(MetadataComponentType.UINT8)).toBe( - 0 + 0, ); expect(MetadataComponentType.getMinimum(MetadataComponentType.INT16)).toBe( - -32768 + -32768, ); expect(MetadataComponentType.getMinimum(MetadataComponentType.UINT16)).toBe( - 0 + 0, ); expect(MetadataComponentType.getMinimum(MetadataComponentType.INT32)).toBe( - -2147483648 + -2147483648, ); expect(MetadataComponentType.getMinimum(MetadataComponentType.UINT32)).toBe( - 0 + 0, ); expect( - MetadataComponentType.getMinimum(MetadataComponentType.FLOAT32) + MetadataComponentType.getMinimum(MetadataComponentType.FLOAT32), ).toBe(-340282346638528859811704183484516925440.0); expect( - MetadataComponentType.getMinimum(MetadataComponentType.FLOAT64) + MetadataComponentType.getMinimum(MetadataComponentType.FLOAT64), ).toBe(-Number.MAX_VALUE); if (FeatureDetection.supportsBigInt()) { expect( - MetadataComponentType.getMinimum(MetadataComponentType.INT64) + MetadataComponentType.getMinimum(MetadataComponentType.INT64), ).toBe( - BigInt("-9223372036854775808") // eslint-disable-line + BigInt("-9223372036854775808"), // eslint-disable-line ); expect( - MetadataComponentType.getMinimum(MetadataComponentType.UINT64) + MetadataComponentType.getMinimum(MetadataComponentType.UINT64), ).toBe( - BigInt(0) // eslint-disable-line + BigInt(0), // eslint-disable-line ); } }); @@ -48,14 +48,14 @@ describe("Scene/MetadataComponentType", function () { it("getMinimum returns approximate number for INT64 when BigInt is not supported", function () { spyOn(FeatureDetection, "supportsBigInt").and.returnValue(false); expect(MetadataComponentType.getMinimum(MetadataComponentType.INT64)).toBe( - -Math.pow(2, 63) + -Math.pow(2, 63), ); }); it("getMinimum returns number for UINT64 when BigInt is not supported", function () { spyOn(FeatureDetection, "supportsBigInt").and.returnValue(false); expect(MetadataComponentType.getMinimum(MetadataComponentType.UINT64)).toBe( - 0 + 0, ); }); @@ -73,40 +73,40 @@ describe("Scene/MetadataComponentType", function () { it("getMaximum", function () { expect(MetadataComponentType.getMaximum(MetadataComponentType.INT8)).toBe( - 127 + 127, ); expect(MetadataComponentType.getMaximum(MetadataComponentType.UINT8)).toBe( - 255 + 255, ); expect(MetadataComponentType.getMaximum(MetadataComponentType.INT16)).toBe( - 32767 + 32767, ); expect(MetadataComponentType.getMaximum(MetadataComponentType.UINT16)).toBe( - 65535 + 65535, ); expect(MetadataComponentType.getMaximum(MetadataComponentType.INT32)).toBe( - 2147483647 + 2147483647, ); expect(MetadataComponentType.getMaximum(MetadataComponentType.UINT32)).toBe( - 4294967295 + 4294967295, ); expect( - MetadataComponentType.getMaximum(MetadataComponentType.FLOAT32) + MetadataComponentType.getMaximum(MetadataComponentType.FLOAT32), ).toBe(340282346638528859811704183484516925440.0); expect( - MetadataComponentType.getMaximum(MetadataComponentType.FLOAT64) + MetadataComponentType.getMaximum(MetadataComponentType.FLOAT64), ).toBe(Number.MAX_VALUE); if (FeatureDetection.supportsBigInt()) { expect( - MetadataComponentType.getMaximum(MetadataComponentType.INT64) + MetadataComponentType.getMaximum(MetadataComponentType.INT64), ).toBe( - BigInt("9223372036854775807") // eslint-disable-line + BigInt("9223372036854775807"), // eslint-disable-line ); expect( - MetadataComponentType.getMaximum(MetadataComponentType.UINT64) + MetadataComponentType.getMaximum(MetadataComponentType.UINT64), ).toBe( - BigInt("18446744073709551615") // eslint-disable-line + BigInt("18446744073709551615"), // eslint-disable-line ); } }); @@ -114,14 +114,14 @@ describe("Scene/MetadataComponentType", function () { it("getMaximum returns approximate number for INT64 when BigInt is not supported", function () { spyOn(FeatureDetection, "supportsBigInt").and.returnValue(false); expect(MetadataComponentType.getMaximum(MetadataComponentType.INT64)).toBe( - Math.pow(2, 63) - 1 + Math.pow(2, 63) - 1, ); }); it("getMaximum returns approximate number for UINT64 when BigInt is not supported", function () { spyOn(FeatureDetection, "supportsBigInt").and.returnValue(false); expect(MetadataComponentType.getMaximum(MetadataComponentType.UINT64)).toBe( - Math.pow(2, 64) - 1 + Math.pow(2, 64) - 1, ); }); @@ -139,34 +139,34 @@ describe("Scene/MetadataComponentType", function () { it("isIntegerType", function () { expect( - MetadataComponentType.isIntegerType(MetadataComponentType.INT8) + MetadataComponentType.isIntegerType(MetadataComponentType.INT8), ).toBe(true); expect( - MetadataComponentType.isIntegerType(MetadataComponentType.UINT8) + MetadataComponentType.isIntegerType(MetadataComponentType.UINT8), ).toBe(true); expect( - MetadataComponentType.isIntegerType(MetadataComponentType.INT16) + MetadataComponentType.isIntegerType(MetadataComponentType.INT16), ).toBe(true); expect( - MetadataComponentType.isIntegerType(MetadataComponentType.UINT16) + MetadataComponentType.isIntegerType(MetadataComponentType.UINT16), ).toBe(true); expect( - MetadataComponentType.isIntegerType(MetadataComponentType.INT32) + MetadataComponentType.isIntegerType(MetadataComponentType.INT32), ).toBe(true); expect( - MetadataComponentType.isIntegerType(MetadataComponentType.UINT32) + MetadataComponentType.isIntegerType(MetadataComponentType.UINT32), ).toBe(true); expect( - MetadataComponentType.isIntegerType(MetadataComponentType.INT64) + MetadataComponentType.isIntegerType(MetadataComponentType.INT64), ).toBe(true); expect( - MetadataComponentType.isIntegerType(MetadataComponentType.UINT64) + MetadataComponentType.isIntegerType(MetadataComponentType.UINT64), ).toBe(true); expect( - MetadataComponentType.isIntegerType(MetadataComponentType.FLOAT32) + MetadataComponentType.isIntegerType(MetadataComponentType.FLOAT32), ).toBe(false); expect( - MetadataComponentType.isIntegerType(MetadataComponentType.FLOAT64) + MetadataComponentType.isIntegerType(MetadataComponentType.FLOAT64), ).toBe(false); }); @@ -178,34 +178,38 @@ describe("Scene/MetadataComponentType", function () { it("isUnsignedIntegerType", function () { expect( - MetadataComponentType.isUnsignedIntegerType(MetadataComponentType.INT8) + MetadataComponentType.isUnsignedIntegerType(MetadataComponentType.INT8), ).toBe(false); expect( - MetadataComponentType.isUnsignedIntegerType(MetadataComponentType.UINT8) + MetadataComponentType.isUnsignedIntegerType(MetadataComponentType.UINT8), ).toBe(true); expect( - MetadataComponentType.isUnsignedIntegerType(MetadataComponentType.INT16) + MetadataComponentType.isUnsignedIntegerType(MetadataComponentType.INT16), ).toBe(false); expect( - MetadataComponentType.isUnsignedIntegerType(MetadataComponentType.UINT16) + MetadataComponentType.isUnsignedIntegerType(MetadataComponentType.UINT16), ).toBe(true); expect( - MetadataComponentType.isUnsignedIntegerType(MetadataComponentType.INT32) + MetadataComponentType.isUnsignedIntegerType(MetadataComponentType.INT32), ).toBe(false); expect( - MetadataComponentType.isUnsignedIntegerType(MetadataComponentType.UINT32) + MetadataComponentType.isUnsignedIntegerType(MetadataComponentType.UINT32), ).toBe(true); expect( - MetadataComponentType.isUnsignedIntegerType(MetadataComponentType.INT64) + MetadataComponentType.isUnsignedIntegerType(MetadataComponentType.INT64), ).toBe(false); expect( - MetadataComponentType.isUnsignedIntegerType(MetadataComponentType.UINT64) + MetadataComponentType.isUnsignedIntegerType(MetadataComponentType.UINT64), ).toBe(true); expect( - MetadataComponentType.isUnsignedIntegerType(MetadataComponentType.FLOAT32) + MetadataComponentType.isUnsignedIntegerType( + MetadataComponentType.FLOAT32, + ), ).toBe(false); expect( - MetadataComponentType.isUnsignedIntegerType(MetadataComponentType.FLOAT64) + MetadataComponentType.isUnsignedIntegerType( + MetadataComponentType.FLOAT64, + ), ).toBe(false); }); @@ -271,7 +275,7 @@ describe("Scene/MetadataComponentType", function () { for (let j = 0; j < values.length; ++j) { const result = MetadataComponentType.normalize( values[j], - MetadataComponentType.INT64 + MetadataComponentType.INT64, ); expect(result).toBe(expectedResults[j]); } @@ -289,7 +293,7 @@ describe("Scene/MetadataComponentType", function () { for (let j = 0; j < values.length; ++j) { const result = MetadataComponentType.normalize( values[j], - MetadataComponentType.UINT64 + MetadataComponentType.UINT64, ); expect(result).toBe(expectedResults[j]); } @@ -381,7 +385,7 @@ describe("Scene/MetadataComponentType", function () { for (let i = 0; i < values.length; ++i) { const result = MetadataComponentType.unnormalize( values[i], - MetadataComponentType.INT64 + MetadataComponentType.INT64, ); expect(result).toBe(expectedResults[i]); } @@ -406,7 +410,7 @@ describe("Scene/MetadataComponentType", function () { for (let i = 0; i < values.length; ++i) { const result = MetadataComponentType.unnormalize( values[i], - MetadataComponentType.UINT64 + MetadataComponentType.UINT64, ); expect(result).toBe(expectedResults[i]); } @@ -414,16 +418,16 @@ describe("Scene/MetadataComponentType", function () { it("unnormalize clamps values outside the range", function () { expect( - MetadataComponentType.unnormalize(-1.1, MetadataComponentType.INT8) + MetadataComponentType.unnormalize(-1.1, MetadataComponentType.INT8), ).toBe(-127); expect( - MetadataComponentType.unnormalize(-0.1, MetadataComponentType.UINT8) + MetadataComponentType.unnormalize(-0.1, MetadataComponentType.UINT8), ).toBe(0); expect( - MetadataComponentType.unnormalize(1.1, MetadataComponentType.INT8) + MetadataComponentType.unnormalize(1.1, MetadataComponentType.INT8), ).toBe(127); expect( - MetadataComponentType.unnormalize(1.1, MetadataComponentType.UINT8) + MetadataComponentType.unnormalize(1.1, MetadataComponentType.UINT8), ).toBe(255); }); @@ -447,34 +451,34 @@ describe("Scene/MetadataComponentType", function () { it("getSizeInBytes", function () { expect( - MetadataComponentType.getSizeInBytes(MetadataComponentType.INT8) + MetadataComponentType.getSizeInBytes(MetadataComponentType.INT8), ).toBe(1); expect( - MetadataComponentType.getSizeInBytes(MetadataComponentType.UINT8) + MetadataComponentType.getSizeInBytes(MetadataComponentType.UINT8), ).toBe(1); expect( - MetadataComponentType.getSizeInBytes(MetadataComponentType.INT16) + MetadataComponentType.getSizeInBytes(MetadataComponentType.INT16), ).toBe(2); expect( - MetadataComponentType.getSizeInBytes(MetadataComponentType.UINT16) + MetadataComponentType.getSizeInBytes(MetadataComponentType.UINT16), ).toBe(2); expect( - MetadataComponentType.getSizeInBytes(MetadataComponentType.INT32) + MetadataComponentType.getSizeInBytes(MetadataComponentType.INT32), ).toBe(4); expect( - MetadataComponentType.getSizeInBytes(MetadataComponentType.UINT32) + MetadataComponentType.getSizeInBytes(MetadataComponentType.UINT32), ).toBe(4); expect( - MetadataComponentType.getSizeInBytes(MetadataComponentType.INT64) + MetadataComponentType.getSizeInBytes(MetadataComponentType.INT64), ).toBe(8); expect( - MetadataComponentType.getSizeInBytes(MetadataComponentType.UINT64) + MetadataComponentType.getSizeInBytes(MetadataComponentType.UINT64), ).toBe(8); expect( - MetadataComponentType.getSizeInBytes(MetadataComponentType.FLOAT32) + MetadataComponentType.getSizeInBytes(MetadataComponentType.FLOAT32), ).toBe(4); expect( - MetadataComponentType.getSizeInBytes(MetadataComponentType.FLOAT64) + MetadataComponentType.getSizeInBytes(MetadataComponentType.FLOAT64), ).toBe(8); }); @@ -492,34 +496,34 @@ describe("Scene/MetadataComponentType", function () { it("fromComponentDatatype", function () { expect( - MetadataComponentType.fromComponentDatatype(ComponentDatatype.BYTE) + MetadataComponentType.fromComponentDatatype(ComponentDatatype.BYTE), ).toBe(MetadataComponentType.INT8); expect( MetadataComponentType.fromComponentDatatype( - ComponentDatatype.UNSIGNED_BYTE - ) + ComponentDatatype.UNSIGNED_BYTE, + ), ).toBe(MetadataComponentType.UINT8); expect( - MetadataComponentType.fromComponentDatatype(ComponentDatatype.SHORT) + MetadataComponentType.fromComponentDatatype(ComponentDatatype.SHORT), ).toBe(MetadataComponentType.INT16); expect( MetadataComponentType.fromComponentDatatype( - ComponentDatatype.UNSIGNED_SHORT - ) + ComponentDatatype.UNSIGNED_SHORT, + ), ).toBe(MetadataComponentType.UINT16); expect( - MetadataComponentType.fromComponentDatatype(ComponentDatatype.INT) + MetadataComponentType.fromComponentDatatype(ComponentDatatype.INT), ).toBe(MetadataComponentType.INT32); expect( MetadataComponentType.fromComponentDatatype( - ComponentDatatype.UNSIGNED_INT - ) + ComponentDatatype.UNSIGNED_INT, + ), ).toBe(MetadataComponentType.UINT32); expect( - MetadataComponentType.fromComponentDatatype(ComponentDatatype.FLOAT) + MetadataComponentType.fromComponentDatatype(ComponentDatatype.FLOAT), ).toBe(MetadataComponentType.FLOAT32); expect( - MetadataComponentType.fromComponentDatatype(ComponentDatatype.DOUBLE) + MetadataComponentType.fromComponentDatatype(ComponentDatatype.DOUBLE), ).toBe(MetadataComponentType.FLOAT64); }); @@ -531,40 +535,40 @@ describe("Scene/MetadataComponentType", function () { it("toComponentDatatype", function () { expect( - MetadataComponentType.toComponentDatatype(MetadataComponentType.INT8) + MetadataComponentType.toComponentDatatype(MetadataComponentType.INT8), ).toBe(ComponentDatatype.BYTE); expect( - MetadataComponentType.toComponentDatatype(MetadataComponentType.UINT8) + MetadataComponentType.toComponentDatatype(MetadataComponentType.UINT8), ).toBe(ComponentDatatype.UNSIGNED_BYTE); expect( - MetadataComponentType.toComponentDatatype(MetadataComponentType.INT16) + MetadataComponentType.toComponentDatatype(MetadataComponentType.INT16), ).toBe(ComponentDatatype.SHORT); expect( - MetadataComponentType.toComponentDatatype(MetadataComponentType.UINT16) + MetadataComponentType.toComponentDatatype(MetadataComponentType.UINT16), ).toBe(ComponentDatatype.UNSIGNED_SHORT); expect( - MetadataComponentType.toComponentDatatype(MetadataComponentType.INT32) + MetadataComponentType.toComponentDatatype(MetadataComponentType.INT32), ).toBe(ComponentDatatype.INT); expect( - MetadataComponentType.toComponentDatatype(MetadataComponentType.UINT32) + MetadataComponentType.toComponentDatatype(MetadataComponentType.UINT32), ).toBe(ComponentDatatype.UNSIGNED_INT); expect( - MetadataComponentType.toComponentDatatype(MetadataComponentType.FLOAT32) + MetadataComponentType.toComponentDatatype(MetadataComponentType.FLOAT32), ).toBe(ComponentDatatype.FLOAT); expect( - MetadataComponentType.toComponentDatatype(MetadataComponentType.FLOAT64) + MetadataComponentType.toComponentDatatype(MetadataComponentType.FLOAT64), ).toBe(ComponentDatatype.DOUBLE); }); it("toComponentDatatype returns undefined for INT64", function () { expect( - MetadataComponentType.toComponentDatatype(MetadataComponentType.INT64) + MetadataComponentType.toComponentDatatype(MetadataComponentType.INT64), ).toBeUndefined(); }); it("toComponentDatatype returns undefined for UINT64", function () { expect( - MetadataComponentType.toComponentDatatype(MetadataComponentType.UINT64) + MetadataComponentType.toComponentDatatype(MetadataComponentType.UINT64), ).toBeUndefined(); }); diff --git a/packages/engine/Specs/Scene/MetadataEntitySpec.js b/packages/engine/Specs/Scene/MetadataEntitySpec.js index eb87dd915744..a8bb15476fb0 100644 --- a/packages/engine/Specs/Scene/MetadataEntitySpec.js +++ b/packages/engine/Specs/Scene/MetadataEntitySpec.js @@ -200,25 +200,25 @@ describe("Scene/MetadataEntity", function () { it("hasProperty returns false when there are no properties", function () { expect( - MetadataEntity.hasProperty("name", {}, classWithNoPropertiesDefinition) + MetadataEntity.hasProperty("name", {}, classWithNoPropertiesDefinition), ).toBe(false); }); it("hasProperty returns false when there's no property with the given property ID", function () { expect( - MetadataEntity.hasProperty("volume", properties, classDefinition) + MetadataEntity.hasProperty("volume", properties, classDefinition), ).toBe(false); }); it("hasProperty returns true when there's a property with the given property ID", function () { expect( - MetadataEntity.hasProperty("name", properties, classDefinition) + MetadataEntity.hasProperty("name", properties, classDefinition), ).toBe(true); }); it("hasProperty returns true when the class has a default value for a missing property", function () { expect( - MetadataEntity.hasProperty("height", properties, classDefinition) + MetadataEntity.hasProperty("height", properties, classDefinition), ).toBe(true); }); @@ -245,8 +245,8 @@ describe("Scene/MetadataEntity", function () { MetadataEntity.hasPropertyBySemantic( "NAME", {}, - classWithNoPropertiesDefinition - ) + classWithNoPropertiesDefinition, + ), ).toBe(false); }); @@ -255,20 +255,20 @@ describe("Scene/MetadataEntity", function () { MetadataEntity.hasPropertyBySemantic( "VOLUME", properties, - classDefinition - ) + classDefinition, + ), ).toBe(false); }); it("hasPropertyBySemantic returns true when there's a property with the given property ID", function () { expect( - MetadataEntity.hasPropertyBySemantic("NAME", properties, classDefinition) + MetadataEntity.hasPropertyBySemantic("NAME", properties, classDefinition), ).toBe(true); }); it("hasPropertyBySemantic returns true when the class has a default value for a missing property", function () { expect( - MetadataEntity.hasPropertyBySemantic("NAME", properties, classDefinition) + MetadataEntity.hasPropertyBySemantic("NAME", properties, classDefinition), ).toBe(true); }); @@ -277,7 +277,7 @@ describe("Scene/MetadataEntity", function () { MetadataEntity.hasPropertyBySemantic( undefined, properties, - classDefinition + classDefinition, ); }).toThrowDeveloperError(); }); @@ -296,14 +296,14 @@ describe("Scene/MetadataEntity", function () { it("getPropertyIds returns empty array when there are no properties", function () { expect( - MetadataEntity.getPropertyIds({}, classWithNoPropertiesDefinition).length + MetadataEntity.getPropertyIds({}, classWithNoPropertiesDefinition).length, ).toBe(0); }); it("getPropertyIds returns array of property IDs", function () { // Includes height which has a default value expect( - MetadataEntity.getPropertyIds(properties, classDefinition).sort() + MetadataEntity.getPropertyIds(properties, classDefinition).sort(), ).toEqual([ "axisColors", "height", @@ -319,7 +319,7 @@ describe("Scene/MetadataEntity", function () { const returnedResults = MetadataEntity.getPropertyIds( properties, classDefinition, - results + results, ); expect(results).toBe(returnedResults); @@ -356,14 +356,14 @@ describe("Scene/MetadataEntity", function () { const value = MetadataEntity.getProperty( "position", properties, - classDefinition + classDefinition, ); expect(value).toEqual(properties.position); }); it("getProperty returns the default value when the property is missing", function () { expect( - MetadataEntity.getProperty("height", properties, classDefinition) + MetadataEntity.getProperty("height", properties, classDefinition), ).toBe(10.0); }); @@ -372,71 +372,71 @@ describe("Scene/MetadataEntity", function () { MetadataEntity.getProperty( "noDefault", noDataProperties, - classWithNoDataValues - ) + classWithNoDataValues, + ), ).not.toBeDefined(); expect( MetadataEntity.getProperty( "hasDefault", noDataProperties, - classWithNoDataValues - ) + classWithNoDataValues, + ), ).toBe(100); expect( MetadataEntity.getProperty( "noDefaultVector", noDataProperties, - classWithNoDataValues - ) + classWithNoDataValues, + ), ).not.toBeDefined(); expect( MetadataEntity.getProperty( "hasDefaultVector", noDataProperties, - classWithNoDataValues - ) + classWithNoDataValues, + ), ).toEqual(new Cartesian2(100.0, 100.0)); expect( MetadataEntity.getProperty( "noDefaultArray", noDataProperties, - classWithNoDataValues - ) + classWithNoDataValues, + ), ).not.toBeDefined(); expect( MetadataEntity.getProperty( "hasDefaultArray", noDataProperties, - classWithNoDataValues - ) + classWithNoDataValues, + ), ).toEqual([1, 1, 1]); expect( MetadataEntity.getProperty( "noDefaultArrayOfVector", noDataProperties, - classWithNoDataValues - ) + classWithNoDataValues, + ), ).not.toBeDefined(); expect( MetadataEntity.getProperty( "hasDefaultArrayOfVector", noDataProperties, - classWithNoDataValues - ) + classWithNoDataValues, + ), ).toEqual([new Cartesian2(1.0, 1.0), new Cartesian2(1.0, 1.0)]); }); it("handles offset and scale", function () { expect( - MetadataEntity.getProperty("temperature", properties, classDefinition) + MetadataEntity.getProperty("temperature", properties, classDefinition), ).toEqual(32); expect( MetadataEntity.getProperty( "temperatureArray", properties, - classDefinition - ) + classDefinition, + ), ).toEqual([32, 212, 212, 32]); }); @@ -460,7 +460,7 @@ describe("Scene/MetadataEntity", function () { it("getProperty handles arrays of vectors correctly", function () { expect( - MetadataEntity.getProperty("axisColors", properties, classDefinition) + MetadataEntity.getProperty("axisColors", properties, classDefinition), ).toEqual([ new Cartesian3(1, 0, 0), new Cartesian3(0, 1, 0), @@ -470,7 +470,7 @@ describe("Scene/MetadataEntity", function () { it("setProperty returns false if property doesn't exist", function () { expect( - MetadataEntity.setProperty("volume", 100.0, properties, classDefinition) + MetadataEntity.setProperty("volume", 100.0, properties, classDefinition), ).toBe(false); }); @@ -481,13 +481,13 @@ describe("Scene/MetadataEntity", function () { "position", position, properties, - classDefinition - ) + classDefinition, + ), ).toBe(true); const retrievedPosition = MetadataEntity.getProperty( "position", properties, - classDefinition + classDefinition, ); expect(retrievedPosition).toEqual(position); expect(retrievedPosition).not.toBe(position); // The value is cloned @@ -504,13 +504,13 @@ describe("Scene/MetadataEntity", function () { "axisColors", axisColors, properties, - classDefinition - ) + classDefinition, + ), ).toBe(true); const retrievedPosition = MetadataEntity.getProperty( "axisColors", properties, - classDefinition + classDefinition, ); expect(retrievedPosition).toEqual(axisColors); expect(retrievedPosition).not.toBe(axisColors); // The value is cloned @@ -518,13 +518,18 @@ describe("Scene/MetadataEntity", function () { it("handles offset and scale", function () { expect( - MetadataEntity.setProperty("temperature", 70, properties, classDefinition) + MetadataEntity.setProperty( + "temperature", + 70, + properties, + classDefinition, + ), ).toBe(true); // There is some expected loss of precision due to storing as a UINT8 // so the result is not 0 expect( - MetadataEntity.getProperty("temperature", properties, classDefinition) + MetadataEntity.getProperty("temperature", properties, classDefinition), ).toEqualEpsilon(70.11764705882354, CesiumMath.EPSILON15); const values = [32, 32, 32, 32]; @@ -533,14 +538,14 @@ describe("Scene/MetadataEntity", function () { "temperatureArray", values, properties, - classDefinition - ) + classDefinition, + ), ).toBe(true); const result = MetadataEntity.getProperty( "temperatureArray", properties, - classDefinition + classDefinition, ); expect(result).toEqual(values); expect(result).not.toBe(values); // value should be cloned @@ -552,7 +557,7 @@ describe("Scene/MetadataEntity", function () { undefined, "Building B", properties, - classDefinition + classDefinition, ); }).toThrowDeveloperError(); }); @@ -563,7 +568,7 @@ describe("Scene/MetadataEntity", function () { "name", undefined, properties, - classDefinition + classDefinition, ); }).toThrowDeveloperError(); }); @@ -574,7 +579,7 @@ describe("Scene/MetadataEntity", function () { "name", "Building B", undefined, - classDefinition + classDefinition, ); }).toThrowDeveloperError(); }); @@ -590,14 +595,14 @@ describe("Scene/MetadataEntity", function () { MetadataEntity.getPropertyBySemantic( "HEIGHT", properties, - classDefinition - ) + classDefinition, + ), ).toBeUndefined(); }); it("getPropertyBySemantic returns the property value", function () { expect( - MetadataEntity.getPropertyBySemantic("NAME", properties, classDefinition) + MetadataEntity.getPropertyBySemantic("NAME", properties, classDefinition), ).toBe("Building A"); }); @@ -606,7 +611,7 @@ describe("Scene/MetadataEntity", function () { MetadataEntity.getPropertyBySemantic( undefined, properties, - classDefinition + classDefinition, ); }).toThrowDeveloperError(); }); @@ -629,11 +634,11 @@ describe("Scene/MetadataEntity", function () { "NAME", "Building B", properties, - classDefinition - ) + classDefinition, + ), ).toBe(true); expect( - MetadataEntity.getProperty("name", properties, classDefinition) + MetadataEntity.getProperty("name", properties, classDefinition), ).toBe("Building B"); }); @@ -643,8 +648,8 @@ describe("Scene/MetadataEntity", function () { "HEIGHT", 20.0, properties, - classDefinition - ) + classDefinition, + ), ).toBe(false); }); @@ -654,7 +659,7 @@ describe("Scene/MetadataEntity", function () { undefined, "Building B", properties, - classDefinition + classDefinition, ); }).toThrowDeveloperError(); }); @@ -665,7 +670,7 @@ describe("Scene/MetadataEntity", function () { "NAME", undefined, properties, - classDefinition + classDefinition, ); }).toThrowDeveloperError(); }); @@ -676,7 +681,7 @@ describe("Scene/MetadataEntity", function () { "NAME", "Building B", undefined, - classDefinition + classDefinition, ); }).toThrowDeveloperError(); }); @@ -687,7 +692,7 @@ describe("Scene/MetadataEntity", function () { "NAME", "Building B", properties, - undefined + undefined, ); }).toThrowDeveloperError(); }); diff --git a/packages/engine/Specs/Scene/MetadataSchemaLoaderSpec.js b/packages/engine/Specs/Scene/MetadataSchemaLoaderSpec.js index 9c14c187e943..4ead1809dc3f 100644 --- a/packages/engine/Specs/Scene/MetadataSchemaLoaderSpec.js +++ b/packages/engine/Specs/Scene/MetadataSchemaLoaderSpec.js @@ -74,7 +74,7 @@ describe("Scene/MetadataSchemaLoader", function () { await expectAsync(schemaLoader.load()).toBeRejectedWithError( RuntimeError, - "Failed to load schema: https://example.com/schema.json\n404 Not Found" + "Failed to load schema: https://example.com/schema.json\n404 Not Found", ); }); @@ -96,7 +96,7 @@ describe("Scene/MetadataSchemaLoader", function () { it("loads external schema", async function () { const fetchJson = spyOn(Resource.prototype, "fetchJson").and.returnValue( - Promise.resolve(schemaJson) + Promise.resolve(schemaJson), ); const schemaLoader = new MetadataSchemaLoader({ @@ -119,7 +119,7 @@ describe("Scene/MetadataSchemaLoader", function () { it("destroys schema", async function () { spyOn(Resource.prototype, "fetchJson").and.returnValue( - Promise.resolve(schemaJson) + Promise.resolve(schemaJson), ); const schemaLoader = new MetadataSchemaLoader({ @@ -140,7 +140,7 @@ describe("Scene/MetadataSchemaLoader", function () { async function resolveJsonAfterDestroy(rejectPromise) { spyOn(Resource.prototype, "fetchJson").and.callFake(() => - rejectPromise ? Promise.reject(new Error()) : Promise.resolve(schemaJson) + rejectPromise ? Promise.reject(new Error()) : Promise.resolve(schemaJson), ); const schemaLoader = new MetadataSchemaLoader({ diff --git a/packages/engine/Specs/Scene/MetadataTablePropertySpec.js b/packages/engine/Specs/Scene/MetadataTablePropertySpec.js index a6ddddbb5ace..1d64a16bc1d0 100644 --- a/packages/engine/Specs/Scene/MetadataTablePropertySpec.js +++ b/packages/engine/Specs/Scene/MetadataTablePropertySpec.js @@ -111,10 +111,10 @@ describe("Scene/MetadataTableProperty", function () { expect(property.extras).toBe(extras); expect(property.extensions).toBe(extensions); expect(property._stringOffsets._componentType).toBe( - MetadataComponentType.UINT16 + MetadataComponentType.UINT16, ); expect(property._arrayOffsets._componentType).toBe( - MetadataComponentType.UINT8 + MetadataComponentType.UINT8, ); expect(property.get(0)).toEqual(["a", "bb", "ccc"]); expect(property.get(1)).toEqual(["dddd", "eeeee"]); @@ -163,10 +163,10 @@ describe("Scene/MetadataTableProperty", function () { expect(property.extras).toBe(extras); expect(property.extensions).toBe(extensions); expect(property._stringOffsets._componentType).toBe( - MetadataComponentType.UINT16 + MetadataComponentType.UINT16, ); expect(property._arrayOffsets._componentType).toBe( - MetadataComponentType.UINT16 + MetadataComponentType.UINT16, ); expect(property.get(0)).toEqual(["a", "bb", "ccc"]); expect(property.get(1)).toEqual(["dddd", "eeeee"]); @@ -377,13 +377,8 @@ describe("Scene/MetadataTableProperty", function () { if (disableBigInt64ArraySupport && disableBigIntSupport) { // Precision loss is expected if INT64 is converted to JS numbers expectedValues = [ - -9223372036854776000, - -4611686018427388000, - -10, - 0, - 10, - 4611686018427388000, - 9223372036854776000, + -9223372036854776000, -4611686018427388000, -10, 0, 10, + 4611686018427388000, 9223372036854776000, ]; } diff --git a/packages/engine/Specs/Scene/MetadataTableSpec.js b/packages/engine/Specs/Scene/MetadataTableSpec.js index 9cb1721620f0..77f5ec24b80f 100644 --- a/packages/engine/Specs/Scene/MetadataTableSpec.js +++ b/packages/engine/Specs/Scene/MetadataTableSpec.js @@ -59,10 +59,10 @@ describe("Scene/MetadataTable", function () { expect(metadataTable.count).toBe(2); expect(metadataTable.getPropertyIds().sort()).toEqual( - expectedPropertyNames + expectedPropertyNames, ); expect(Object.keys(metadataTable.class.properties).sort()).toEqual( - expectedPropertyNames + expectedPropertyNames, ); const heightSize = 2 * 4; // two floats @@ -523,13 +523,13 @@ describe("Scene/MetadataTable", function () { const length = valuesToSet.length; for (let i = 0; i < length; ++i) { expect(metadataTable.setProperty(i, "propertyInt8", valuesToSet[i])).toBe( - true + true, ); let value = metadataTable.getProperty(i, "propertyInt8"); expect(value).toEqual(valuesToSet[i]); // Test setting / getting again expect(metadataTable.setProperty(i, "propertyInt8", valuesToSet[i])).toBe( - true + true, ); value = metadataTable.getProperty(i, "propertyInt8"); expect(value).toEqual(valuesToSet[i]); @@ -914,7 +914,7 @@ describe("Scene/MetadataTable", function () { const expectedTypedArray = new Float32Array([1.0, 2.0]); expect(metadataTable.getPropertyTypedArray("height")).toEqual( - expectedTypedArray + expectedTypedArray, ); }); @@ -968,7 +968,7 @@ describe("Scene/MetadataTable", function () { const expectedTypedArray = new Float32Array([1.0, 2.0]); expect(metadataTable.getPropertyTypedArrayBySemantic("HEIGHT")).toEqual( - expectedTypedArray + expectedTypedArray, ); }); @@ -989,7 +989,7 @@ describe("Scene/MetadataTable", function () { }); expect( - metadataTable.getPropertyTypedArrayBySemantic("HEIGHT") + metadataTable.getPropertyTypedArrayBySemantic("HEIGHT"), ).toBeUndefined(); }); diff --git a/packages/engine/Specs/Scene/Model/AlphaPipelineStageSpec.js b/packages/engine/Specs/Scene/Model/AlphaPipelineStageSpec.js index 120bf89679ad..de6ed67e7d2d 100644 --- a/packages/engine/Specs/Scene/Model/AlphaPipelineStageSpec.js +++ b/packages/engine/Specs/Scene/Model/AlphaPipelineStageSpec.js @@ -35,7 +35,7 @@ describe( AlphaPipelineStage.process( renderResources, mockPrimitive, - mockFrameState + mockFrameState, ); expect(renderResources.alphaOptions.pass).toBe(mockModel.opaquePass); }); @@ -50,7 +50,7 @@ describe( AlphaPipelineStage.process( renderResources, mockPrimitive, - mockFrameState + mockFrameState, ); const renderStateOptions = renderResources.renderStateOptions; @@ -69,7 +69,7 @@ describe( AlphaPipelineStage.process( renderResources, mockPrimitive, - mockFrameState + mockFrameState, ); const shaderBuilder = renderResources.shaderBuilder; @@ -82,5 +82,5 @@ describe( expect(renderResources.uniformMap.u_alphaCutoff()).toBe(cutoff); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/Model/AtmospherePipelineStageSpec.js b/packages/engine/Specs/Scene/Model/AtmospherePipelineStageSpec.js index 753fbcbcb5e8..02a065f4365d 100644 --- a/packages/engine/Specs/Scene/Model/AtmospherePipelineStageSpec.js +++ b/packages/engine/Specs/Scene/Model/AtmospherePipelineStageSpec.js @@ -27,7 +27,7 @@ describe( url: boxTexturedGlbUrl, modelMatrix: Transforms.eastNorthUpToFixedFrame(center), }, - scene + scene, ); }); @@ -85,7 +85,7 @@ describe( const frameState = scene.frameState; frameState.camera.position = Cartesian3.clone( model.boundingSphere.center, - frameState.camera.position + frameState.camera.position, ); scene.renderForSpecs(); @@ -116,5 +116,5 @@ describe( expect(uniformMap.u_isInFog()).toBe(true); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/Model/B3dmLoaderSpec.js b/packages/engine/Specs/Scene/Model/B3dmLoaderSpec.js index 7933375ca4b1..9267f6a15df6 100644 --- a/packages/engine/Specs/Scene/Model/B3dmLoaderSpec.js +++ b/packages/engine/Specs/Scene/Model/B3dmLoaderSpec.js @@ -76,7 +76,7 @@ describe( async function expectLoadError(arrayBuffer) { const resource = new Resource("http://example.com/test.b3dm"); await expectAsync( - loadB3dmArrayBuffer(resource, arrayBuffer) + loadB3dmArrayBuffer(resource, arrayBuffer), ).toBeRejectedWithError(RuntimeError); } @@ -138,7 +138,7 @@ describe( expect(propertyTable.count).toEqual(10); expect(loader.components.transform).toEqual( - Matrix4.fromTranslation(new Cartesian3(0.1, 0.2, 0.3)) + Matrix4.fromTranslation(new Cartesian3(0.1, 0.2, 0.3)), ); }); }); @@ -170,7 +170,7 @@ describe( it("destroys b3dm loader", function () { const unloadGltfLoader = spyOn( GltfLoader.prototype, - "unload" + "unload", ).and.callThrough(); return loadB3dm(withBatchTableUrl).then(function (loader) { @@ -186,5 +186,5 @@ describe( }); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/Model/BatchTexturePipelineStageSpec.js b/packages/engine/Specs/Scene/Model/BatchTexturePipelineStageSpec.js index fc9e95c69f56..71d50413c106 100644 --- a/packages/engine/Specs/Scene/Model/BatchTexturePipelineStageSpec.js +++ b/packages/engine/Specs/Scene/Model/BatchTexturePipelineStageSpec.js @@ -72,7 +72,7 @@ describe("Scene/Model/BatchTexturePipelineStage", function () { verifyBatchTextureShaders(renderResources.shaderBuilder); verifyBatchTextureUniforms( renderResources.model.featureTables[0], - renderResources.uniformMap + renderResources.uniformMap, ); }); }); diff --git a/packages/engine/Specs/Scene/Model/CPUStylingPipelineStageSpec.js b/packages/engine/Specs/Scene/Model/CPUStylingPipelineStageSpec.js index 63fb2545ce9c..ad73f3aa26c8 100644 --- a/packages/engine/Specs/Scene/Model/CPUStylingPipelineStageSpec.js +++ b/packages/engine/Specs/Scene/Model/CPUStylingPipelineStageSpec.js @@ -51,7 +51,7 @@ describe("Scene/Model/CPUStylingPipelineStage", function () { renderResources.model.colorBlendMode = ColorBlendMode.MIX; const colorBlend = ColorBlendMode.getColorBlend( renderResources.model.colorBlendMode, - renderResources.model.colorBlendAmount + renderResources.model.colorBlendAmount, ); CPUStylingPipelineStage.process(renderResources); diff --git a/packages/engine/Specs/Scene/Model/ClassificationModelDrawCommandSpec.js b/packages/engine/Specs/Scene/Model/ClassificationModelDrawCommandSpec.js index 6df7bf6333e6..adfa295c7948 100644 --- a/packages/engine/Specs/Scene/Model/ClassificationModelDrawCommandSpec.js +++ b/packages/engine/Specs/Scene/Model/ClassificationModelDrawCommandSpec.js @@ -78,12 +78,12 @@ describe( options.boundingVolume = BoundingSphere.transform( boundingSphere, options.modelMatrix, - boundingSphere + boundingSphere, ); options.renderState = defaultValue( options.renderState, - RenderState.fromCache() + RenderState.fromCache(), ); options.pass = Pass.OPAQUE; @@ -96,7 +96,7 @@ describe( command, expectedPass, expectedStencilFunction, - testForPicking + testForPicking, ) { testForPicking = defaultValue(testForPicking, false); @@ -136,7 +136,7 @@ describe( }; expect(renderState.stencilTest).toEqual(expectedStencilTest); expect(renderState.stencilMask).toEqual( - StencilConstants.CLASSIFICATION_MASK + StencilConstants.CLASSIFICATION_MASK, ); expect(renderState.depthTest).toEqual({ @@ -150,7 +150,7 @@ describe( // that is not in BlendingState.PRE_MULTIPLIED_ALPHA_BLEND. const expectedColorCommandBlending = clone( BlendingState.PRE_MULTIPLIED_ALPHA_BLEND, - true + true, ); expectedColorCommandBlending.color = noColor; @@ -192,7 +192,7 @@ describe( expect(renderState.stencilTest).toEqual(expectedStencilTest); expect(renderState.stencilMask).toEqual( - StencilConstants.CLASSIFICATION_MASK + StencilConstants.CLASSIFICATION_MASK, ); expect(renderState.depthTest.enabled).toEqual(false); expect(renderState.depthMask).toEqual(false); @@ -215,7 +215,7 @@ describe( commandList, expectedPass, expectedStencilFunction, - testForPicking + testForPicking, ) { const batchLengths = drawCommand.batchLengths; const batchOffsets = drawCommand.batchOffsets; @@ -233,7 +233,7 @@ describe( stencilDepthCommand, expectedPass, expectedStencilFunction, - testForPicking + testForPicking, ); const colorCommand = commandList[i * 2 + 1]; @@ -275,7 +275,7 @@ describe( expect(drawCommand.command).toBe(command); expect(drawCommand.runtimePrimitive).toBe( - renderResources.runtimePrimitive + renderResources.runtimePrimitive, ); expect(drawCommand.model).toBe(renderResources.model); @@ -294,7 +294,7 @@ describe( drawCommand, commandList, expectedPass, - expectedStencilFunction + expectedStencilFunction, ); expect(drawCommand._commandList3DTiles.length).toBe(0); @@ -316,7 +316,7 @@ describe( expect(drawCommand.command).toBe(command); expect(drawCommand.runtimePrimitive).toBe( - renderResources.runtimePrimitive + renderResources.runtimePrimitive, ); expect(drawCommand.model).toBe(renderResources.model); @@ -324,7 +324,7 @@ describe( expect(drawCommand.boundingVolume).toBe(command.boundingVolume); expect(drawCommand.classificationType).toBe( - ClassificationType.CESIUM_3D_TILE + ClassificationType.CESIUM_3D_TILE, ); expect(drawCommand._classifiesTerrain).toBe(false); expect(drawCommand._classifies3DTiles).toBe(true); @@ -337,7 +337,7 @@ describe( drawCommand, commandList, expectedPass, - expectedStencilFunction + expectedStencilFunction, ); expect(drawCommand._commandListTerrain.length).toBe(0); @@ -359,7 +359,7 @@ describe( expect(drawCommand.command).toBe(command); expect(drawCommand.runtimePrimitive).toBe( - renderResources.runtimePrimitive + renderResources.runtimePrimitive, ); expect(drawCommand.model).toBe(renderResources.model); @@ -378,7 +378,7 @@ describe( drawCommand, commandList, expectedPass, - expectedStencilFunction + expectedStencilFunction, ); commandList = drawCommand._commandList3DTiles; @@ -389,7 +389,7 @@ describe( drawCommand, commandList, expectedPass, - expectedStencilFunction + expectedStencilFunction, ); expect(drawCommand._commandListIgnoreShow.length).toBe(0); @@ -411,7 +411,7 @@ describe( expect(drawCommand.command).toBe(command); expect(drawCommand.runtimePrimitive).toBe( - renderResources.runtimePrimitive + renderResources.runtimePrimitive, ); expect(drawCommand.model).toBe(renderResources.model); @@ -470,7 +470,7 @@ describe( commandList, expectedPass, expectedStencilFunction, - testForPicking + testForPicking, ); expect(drawCommand._commandListTerrain.length).toBe(6); @@ -496,7 +496,7 @@ describe( }); expect(drawCommand.classificationType).toBe( - ClassificationType.CESIUM_3D_TILE + ClassificationType.CESIUM_3D_TILE, ); expect(drawCommand._classifiesTerrain).toBe(false); expect(drawCommand._classifies3DTiles).toBe(true); @@ -512,7 +512,7 @@ describe( commandList, expectedPass, expectedStencilFunction, - testForPicking + testForPicking, ); expect(drawCommand._commandList3DTiles.length).toBe(6); @@ -551,7 +551,7 @@ describe( commandList, expectedPass, expectedStencilFunction, - testForPicking + testForPicking, ); commandList = drawCommand._commandList3DTilesPicking; @@ -563,7 +563,7 @@ describe( commandList, expectedPass, expectedStencilFunction, - testForPicking + testForPicking, ); expect(drawCommand._commandListTerrain.length).toBe(6); @@ -623,7 +623,7 @@ describe( drawCommand, commandListTerrain, expectedPass, - expectedStencilFunction + expectedStencilFunction, ); const commandList3DTiles = commandList.slice(6, 12); @@ -634,7 +634,7 @@ describe( drawCommand, commandList3DTiles, expectedPass, - expectedStencilFunction + expectedStencilFunction, ); }); @@ -662,7 +662,7 @@ describe( drawCommand, commandListTerrain, expectedPass, - expectedStencilFunction + expectedStencilFunction, ); const commandList3DTiles = commandList.slice(6, 12); @@ -673,7 +673,7 @@ describe( drawCommand, commandList3DTiles, expectedPass, - expectedStencilFunction + expectedStencilFunction, ); }); @@ -705,7 +705,7 @@ describe( commandListTerrain, expectedPass, expectedStencilFunction, - testForPicking + testForPicking, ); const commandList3DTiles = commandList.slice(6, 12); @@ -717,7 +717,7 @@ describe( commandList3DTiles, expectedPass, expectedStencilFunction, - testForPicking + testForPicking, ); }); @@ -740,7 +740,7 @@ describe( mockFrameStateWithInvertedClassification.commandList; drawCommand.pushCommands( mockFrameStateWithInvertedClassification, - commandList + commandList, ); expect(commandList.length).toBe(9); @@ -752,7 +752,7 @@ describe( drawCommand, commandList3DTiles, expectedPass, - expectedStencilFunction + expectedStencilFunction, ); const length = commandListIgnoreShow.length; @@ -767,7 +767,7 @@ describe( verifyStencilDepthCommand( ignoreShowCommand, expectedPass, - expectedStencilFunction + expectedStencilFunction, ); } }); @@ -791,7 +791,7 @@ describe( mockFrameStateWithInvertedClassification.commandList; drawCommand.pushCommands( mockFrameStateWithInvertedClassification, - commandList + commandList, ); expect(commandList.length).toBe(6); @@ -837,5 +837,5 @@ describe( } }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/Model/ClassificationPipelineStageSpec.js b/packages/engine/Specs/Scene/Model/ClassificationPipelineStageSpec.js index dc30239df431..d62b7184c13c 100644 --- a/packages/engine/Specs/Scene/Model/ClassificationPipelineStageSpec.js +++ b/packages/engine/Specs/Scene/Model/ClassificationPipelineStageSpec.js @@ -73,7 +73,7 @@ describe("Scene/Model/ClassificationPipelineStage", function () { ClassificationPipelineStage.process( renderResources, primitive, - mockFrameState + mockFrameState, ); }).toThrowError(RuntimeError); }); @@ -87,7 +87,7 @@ describe("Scene/Model/ClassificationPipelineStage", function () { ClassificationPipelineStage.process( renderResources, primitive, - mockFrameState + mockFrameState, ); const shaderBuilder = renderResources.shaderBuilder; @@ -109,7 +109,7 @@ describe("Scene/Model/ClassificationPipelineStage", function () { ClassificationPipelineStage.process( renderResources, primitive, - mockFrameState + mockFrameState, ); const runtimePrimitive = renderResources.runtimePrimitive; @@ -129,7 +129,7 @@ describe("Scene/Model/ClassificationPipelineStage", function () { ClassificationPipelineStage.process( renderResources, primitive, - mockFrameState + mockFrameState, ); const runtimePrimitive = renderResources.runtimePrimitive; @@ -149,7 +149,7 @@ describe("Scene/Model/ClassificationPipelineStage", function () { ClassificationPipelineStage.process( renderResources, primitive, - mockFrameState + mockFrameState, ); const runtimePrimitive = renderResources.runtimePrimitive; @@ -180,7 +180,7 @@ describe("Scene/Model/ClassificationPipelineStage", function () { ClassificationPipelineStage.process( renderResources, primitive, - mockFrameState + mockFrameState, ); const runtimePrimitive = renderResources.runtimePrimitive; @@ -204,7 +204,7 @@ describe("Scene/Model/ClassificationPipelineStage", function () { ClassificationPipelineStage.process( renderResources, primitive, - mockFrameState + mockFrameState, ); const batchLengths = runtimePrimitive.batchLengths; diff --git a/packages/engine/Specs/Scene/Model/CustomShaderPipelineStageSpec.js b/packages/engine/Specs/Scene/Model/CustomShaderPipelineStageSpec.js index cf674eee8c16..a2e8a6797800 100644 --- a/packages/engine/Specs/Scene/Model/CustomShaderPipelineStageSpec.js +++ b/packages/engine/Specs/Scene/Model/CustomShaderPipelineStageSpec.js @@ -168,7 +168,7 @@ describe("Scene/Model/CustomShaderPipelineStage", function () { CustomShaderPipelineStage.process(renderResources, primitive); expect(renderResources.lightingOptions.lightingModel).toBe( - LightingModel.PBR + LightingModel.PBR, ); }); @@ -237,7 +237,7 @@ describe("Scene/Model/CustomShaderPipelineStage", function () { expect(renderResources.alphaOptions.pass).toBe(Pass.TRANSLUCENT); expect(renderResources.lightingOptions.lightingModel).toBe( - LightingModel.PBR + LightingModel.PBR, ); // the shader code proper gets optimized out @@ -273,13 +273,13 @@ describe("Scene/Model/CustomShaderPipelineStage", function () { shaderBuilder, CustomShaderPipelineStage.STRUCT_ID_ATTRIBUTES_VS, CustomShaderPipelineStage.STRUCT_NAME_ATTRIBUTES, - [" vec3 positionMC;", " vec3 normalMC;", " vec2 texCoord_0;"] + [" vec3 positionMC;", " vec3 normalMC;", " vec2 texCoord_0;"], ); ShaderBuilderTester.expectHasFragmentStruct( shaderBuilder, CustomShaderPipelineStage.STRUCT_ID_ATTRIBUTES_FS, CustomShaderPipelineStage.STRUCT_NAME_ATTRIBUTES, - [" vec3 positionMC;", " vec3 normalEC;", " vec2 texCoord_0;"] + [" vec3 positionMC;", " vec3 normalEC;", " vec2 texCoord_0;"], ); ShaderBuilderTester.expectHasVertexStruct( @@ -292,7 +292,7 @@ describe("Scene/Model/CustomShaderPipelineStage", function () { " Metadata metadata;", " MetadataClass metadataClass;", " MetadataStatistics metadataStatistics;", - ] + ], ); ShaderBuilderTester.expectHasFragmentStruct( shaderBuilder, @@ -304,7 +304,7 @@ describe("Scene/Model/CustomShaderPipelineStage", function () { " Metadata metadata;", " MetadataClass metadataClass;", " MetadataStatistics metadataStatistics;", - ] + ], ); ShaderBuilderTester.expectHasVertexFunctionUnordered( @@ -315,7 +315,7 @@ describe("Scene/Model/CustomShaderPipelineStage", function () { " vsInput.attributes.positionMC = attributes.positionMC;", " vsInput.attributes.normalMC = attributes.normalMC;", " vsInput.attributes.texCoord_0 = attributes.texCoord_0;", - ] + ], ); ShaderBuilderTester.expectHasFragmentFunctionUnordered( shaderBuilder, @@ -325,7 +325,7 @@ describe("Scene/Model/CustomShaderPipelineStage", function () { " fsInput.attributes.positionMC = attributes.positionMC;", " fsInput.attributes.normalEC = attributes.normalEC;", " fsInput.attributes.texCoord_0 = attributes.texCoord_0;", - ] + ], ); }); @@ -351,20 +351,20 @@ describe("Scene/Model/CustomShaderPipelineStage", function () { CustomShaderPipelineStage.process( renderResources, - primitiveWithCustomAttributes + primitiveWithCustomAttributes, ); ShaderBuilderTester.expectHasVertexStruct( shaderBuilder, CustomShaderPipelineStage.STRUCT_ID_ATTRIBUTES_VS, CustomShaderPipelineStage.STRUCT_NAME_ATTRIBUTES, - [" vec3 positionMC;", " float temperature;"] + [" vec3 positionMC;", " float temperature;"], ); ShaderBuilderTester.expectHasFragmentStruct( shaderBuilder, CustomShaderPipelineStage.STRUCT_ID_ATTRIBUTES_FS, CustomShaderPipelineStage.STRUCT_NAME_ATTRIBUTES, - [" vec3 positionMC;", " float temperature;"] + [" vec3 positionMC;", " float temperature;"], ); ShaderBuilderTester.expectHasVertexStruct( @@ -377,7 +377,7 @@ describe("Scene/Model/CustomShaderPipelineStage", function () { " Metadata metadata;", " MetadataClass metadataClass;", " MetadataStatistics metadataStatistics;", - ] + ], ); ShaderBuilderTester.expectHasFragmentStruct( shaderBuilder, @@ -389,7 +389,7 @@ describe("Scene/Model/CustomShaderPipelineStage", function () { " Metadata metadata;", " MetadataClass metadataClass;", " MetadataStatistics metadataStatistics;", - ] + ], ); ShaderBuilderTester.expectHasVertexFunctionUnordered( @@ -399,7 +399,7 @@ describe("Scene/Model/CustomShaderPipelineStage", function () { [ " vsInput.attributes.positionMC = attributes.positionMC;", " vsInput.attributes.temperature = attributes.temperature;", - ] + ], ); ShaderBuilderTester.expectHasFragmentFunctionUnordered( shaderBuilder, @@ -408,7 +408,7 @@ describe("Scene/Model/CustomShaderPipelineStage", function () { [ " fsInput.attributes.positionMC = attributes.positionMC;", " fsInput.attributes.temperature = attributes.temperature;", - ] + ], ); }); @@ -437,20 +437,20 @@ describe("Scene/Model/CustomShaderPipelineStage", function () { CustomShaderPipelineStage.process( renderResources, - primitiveWithColorAttributes + primitiveWithColorAttributes, ); ShaderBuilderTester.expectHasVertexStruct( shaderBuilder, CustomShaderPipelineStage.STRUCT_ID_ATTRIBUTES_VS, CustomShaderPipelineStage.STRUCT_NAME_ATTRIBUTES, - [" vec4 color_0;", " vec4 color_1;"] + [" vec4 color_0;", " vec4 color_1;"], ); ShaderBuilderTester.expectHasFragmentStruct( shaderBuilder, CustomShaderPipelineStage.STRUCT_ID_ATTRIBUTES_FS, CustomShaderPipelineStage.STRUCT_NAME_ATTRIBUTES, - [" vec4 color_0;", " vec4 color_1;"] + [" vec4 color_0;", " vec4 color_1;"], ); ShaderBuilderTester.expectHasVertexStruct( @@ -463,7 +463,7 @@ describe("Scene/Model/CustomShaderPipelineStage", function () { " Metadata metadata;", " MetadataClass metadataClass;", " MetadataStatistics metadataStatistics;", - ] + ], ); ShaderBuilderTester.expectHasFragmentStruct( shaderBuilder, @@ -475,7 +475,7 @@ describe("Scene/Model/CustomShaderPipelineStage", function () { " Metadata metadata;", " MetadataClass metadataClass;", " MetadataStatistics metadataStatistics;", - ] + ], ); ShaderBuilderTester.expectHasVertexFunctionUnordered( @@ -485,7 +485,7 @@ describe("Scene/Model/CustomShaderPipelineStage", function () { [ " vsInput.attributes.color_0 = attributes.color_0;", " vsInput.attributes.color_1 = attributes.color_1;", - ] + ], ); ShaderBuilderTester.expectHasFragmentFunctionUnordered( shaderBuilder, @@ -494,7 +494,7 @@ describe("Scene/Model/CustomShaderPipelineStage", function () { [ " fsInput.attributes.color_0 = attributes.color_0;", " fsInput.attributes.color_1 = attributes.color_1;", - ] + ], ); }); @@ -520,20 +520,20 @@ describe("Scene/Model/CustomShaderPipelineStage", function () { CustomShaderPipelineStage.process( renderResources, - primitiveWithCustomAttributes + primitiveWithCustomAttributes, ); ShaderBuilderTester.expectHasVertexStruct( shaderBuilder, CustomShaderPipelineStage.STRUCT_ID_ATTRIBUTES_VS, CustomShaderPipelineStage.STRUCT_NAME_ATTRIBUTES, - [" vec3 positionMC;"] + [" vec3 positionMC;"], ); ShaderBuilderTester.expectHasFragmentStruct( shaderBuilder, CustomShaderPipelineStage.STRUCT_ID_ATTRIBUTES_FS, CustomShaderPipelineStage.STRUCT_NAME_ATTRIBUTES, - [" float temperature;"] + [" float temperature;"], ); ShaderBuilderTester.expectHasVertexStruct( @@ -546,7 +546,7 @@ describe("Scene/Model/CustomShaderPipelineStage", function () { " Metadata metadata;", " MetadataClass metadataClass;", " MetadataStatistics metadataStatistics;", - ] + ], ); ShaderBuilderTester.expectHasFragmentStruct( shaderBuilder, @@ -558,20 +558,20 @@ describe("Scene/Model/CustomShaderPipelineStage", function () { " Metadata metadata;", " MetadataClass metadataClass;", " MetadataStatistics metadataStatistics;", - ] + ], ); ShaderBuilderTester.expectHasVertexFunctionUnordered( shaderBuilder, CustomShaderPipelineStage.FUNCTION_ID_INITIALIZE_INPUT_STRUCT_VS, CustomShaderPipelineStage.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_VS, - [" vsInput.attributes.positionMC = attributes.positionMC;"] + [" vsInput.attributes.positionMC = attributes.positionMC;"], ); ShaderBuilderTester.expectHasFragmentFunctionUnordered( shaderBuilder, CustomShaderPipelineStage.FUNCTION_ID_INITIALIZE_INPUT_STRUCT_FS, CustomShaderPipelineStage.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_FS, - [" fsInput.attributes.temperature = attributes.temperature;"] + [" fsInput.attributes.temperature = attributes.temperature;"], ); }); @@ -619,7 +619,7 @@ describe("Scene/Model/CustomShaderPipelineStage", function () { " Metadata metadata;", " MetadataClass metadataClass;", " MetadataStatistics metadataStatistics;", - ] + ], ); }); @@ -654,13 +654,13 @@ describe("Scene/Model/CustomShaderPipelineStage", function () { shaderBuilder, CustomShaderPipelineStage.STRUCT_ID_ATTRIBUTES_VS, CustomShaderPipelineStage.STRUCT_NAME_ATTRIBUTES, - [] + [], ); ShaderBuilderTester.expectHasFragmentStruct( shaderBuilder, CustomShaderPipelineStage.STRUCT_ID_ATTRIBUTES_FS, CustomShaderPipelineStage.STRUCT_NAME_ATTRIBUTES, - [" vec3 positionMC;", " vec3 positionWC;", " vec3 positionEC;"] + [" vec3 positionMC;", " vec3 positionWC;", " vec3 positionEC;"], ); ShaderBuilderTester.expectHasVertexStruct( @@ -673,7 +673,7 @@ describe("Scene/Model/CustomShaderPipelineStage", function () { " Metadata metadata;", " MetadataClass metadataClass;", " MetadataStatistics metadataStatistics;", - ] + ], ); ShaderBuilderTester.expectHasFragmentStruct( shaderBuilder, @@ -685,14 +685,14 @@ describe("Scene/Model/CustomShaderPipelineStage", function () { " Metadata metadata;", " MetadataClass metadataClass;", " MetadataStatistics metadataStatistics;", - ] + ], ); ShaderBuilderTester.expectHasVertexFunctionUnordered( shaderBuilder, CustomShaderPipelineStage.FUNCTION_ID_INITIALIZE_INPUT_STRUCT_VS, CustomShaderPipelineStage.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_VS, - [] + [], ); ShaderBuilderTester.expectHasFragmentFunctionUnordered( shaderBuilder, @@ -702,7 +702,7 @@ describe("Scene/Model/CustomShaderPipelineStage", function () { " fsInput.attributes.positionMC = attributes.positionMC;", " fsInput.attributes.positionWC = attributes.positionWC;", " fsInput.attributes.positionEC = attributes.positionEC;", - ] + ], ); }); @@ -730,13 +730,13 @@ describe("Scene/Model/CustomShaderPipelineStage", function () { shaderBuilder, CustomShaderPipelineStage.STRUCT_ID_ATTRIBUTES_VS, CustomShaderPipelineStage.STRUCT_NAME_ATTRIBUTES, - [" vec2 texCoord_1;"] + [" vec2 texCoord_1;"], ); ShaderBuilderTester.expectHasFragmentStruct( shaderBuilder, CustomShaderPipelineStage.STRUCT_ID_ATTRIBUTES_FS, CustomShaderPipelineStage.STRUCT_NAME_ATTRIBUTES, - [" vec3 tangentEC;"] + [" vec3 tangentEC;"], ); ShaderBuilderTester.expectHasVertexStruct( @@ -749,7 +749,7 @@ describe("Scene/Model/CustomShaderPipelineStage", function () { " Metadata metadata;", " MetadataClass metadataClass;", " MetadataStatistics metadataStatistics;", - ] + ], ); ShaderBuilderTester.expectHasFragmentStruct( shaderBuilder, @@ -761,20 +761,20 @@ describe("Scene/Model/CustomShaderPipelineStage", function () { " Metadata metadata;", " MetadataClass metadataClass;", " MetadataStatistics metadataStatistics;", - ] + ], ); ShaderBuilderTester.expectHasVertexFunctionUnordered( shaderBuilder, CustomShaderPipelineStage.FUNCTION_ID_INITIALIZE_INPUT_STRUCT_VS, CustomShaderPipelineStage.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_VS, - [" vsInput.attributes.texCoord_1 = vec2(0.0);"] + [" vsInput.attributes.texCoord_1 = vec2(0.0);"], ); ShaderBuilderTester.expectHasFragmentFunctionUnordered( shaderBuilder, CustomShaderPipelineStage.FUNCTION_ID_INITIALIZE_INPUT_STRUCT_FS, CustomShaderPipelineStage.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_FS, - [" fsInput.attributes.tangentEC = vec3(1.0, 0.0, 0.0);"] + [" fsInput.attributes.tangentEC = vec3(1.0, 0.0, 0.0);"], ); }); @@ -825,7 +825,7 @@ describe("Scene/Model/CustomShaderPipelineStage", function () { ShaderBuilderTester.expectVertexLinesEqual(shaderBuilder, []); ShaderBuilderTester.expectFragmentLinesContains( shaderBuilder, - emptyFragmentShader + emptyFragmentShader, ); }); @@ -845,7 +845,7 @@ describe("Scene/Model/CustomShaderPipelineStage", function () { ShaderBuilderTester.expectVertexLinesContains( shaderBuilder, - emptyVertexShader + emptyVertexShader, ); ShaderBuilderTester.expectFragmentLinesEqual(shaderBuilder, []); }); @@ -890,7 +890,7 @@ describe("Scene/Model/CustomShaderPipelineStage", function () { shaderBuilder, CustomShaderPipelineStage.STRUCT_ID_ATTRIBUTES_FS, CustomShaderPipelineStage.STRUCT_NAME_ATTRIBUTES, - [" vec3 positionWC;"] + [" vec3 positionWC;"], ); ShaderBuilderTester.expectHasFragmentStruct( @@ -903,7 +903,7 @@ describe("Scene/Model/CustomShaderPipelineStage", function () { " Metadata metadata;", " MetadataClass metadataClass;", " MetadataStatistics metadataStatistics;", - ] + ], ); expect(shaderBuilder._vertexShaderParts.functionIds).toEqual([]); @@ -911,7 +911,7 @@ describe("Scene/Model/CustomShaderPipelineStage", function () { shaderBuilder, CustomShaderPipelineStage.FUNCTION_ID_INITIALIZE_INPUT_STRUCT_FS, CustomShaderPipelineStage.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_FS, - [" fsInput.attributes.positionWC = attributes.positionWC;"] + [" fsInput.attributes.positionWC = attributes.positionWC;"], ); }); }); diff --git a/packages/engine/Specs/Scene/Model/CustomShaderSpec.js b/packages/engine/Specs/Scene/Model/CustomShaderSpec.js index 669b4ab404a5..03c8b3698168 100644 --- a/packages/engine/Specs/Scene/Model/CustomShaderSpec.js +++ b/packages/engine/Specs/Scene/Model/CustomShaderSpec.js @@ -25,7 +25,7 @@ describe("Scene/Model/CustomShader", function () { expect(customShader.mode).toBe(CustomShaderMode.MODIFY_MATERIAL); expect(customShader.lightingModel).not.toBeDefined(); expect(customShader.translucencyMode).toBe( - CustomShaderTranslucencyMode.INHERIT + CustomShaderTranslucencyMode.INHERIT, ); expect(customShader.uniforms).toEqual({}); expect(customShader.varyings).toEqual({}); @@ -46,7 +46,7 @@ describe("Scene/Model/CustomShader", function () { expect(customShader.mode).toBe(CustomShaderMode.REPLACE_MATERIAL); expect(customShader.lightingModel).toBe(LightingModel.PBR); expect(customShader.translucencyMode).toBe( - CustomShaderTranslucencyMode.TRANSLUCENT + CustomShaderTranslucencyMode.TRANSLUCENT, ); expect(customShader.uniforms).toEqual({}); expect(customShader.varyings).toEqual({}); @@ -225,7 +225,7 @@ describe("Scene/Model/CustomShader", function () { expect(customShader.usedVariablesVertex).toEqual(expectedVertexVariables); expect(customShader.usedVariablesFragment).toEqual( - expectedFragmentVariables + expectedFragmentVariables, ); }); @@ -408,13 +408,13 @@ describe("Scene/Model/CustomShader", function () { expect(customShader.uniformMap.u_blue).toBeDefined(); expect(customShader.uniformMap.u_blue()).not.toBeDefined(); - return waitForTextureLoad(customShader, "u_blue").then(function ( - texture - ) { - expect(customShader.uniformMap.u_blue()).toBe(texture); - expect(texture.width).toBe(2); - expect(texture.height).toBe(2); - }); + return waitForTextureLoad(customShader, "u_blue").then( + function (texture) { + expect(customShader.uniformMap.u_blue()).toBe(texture); + expect(texture.width).toBe(2); + expect(texture.height).toBe(2); + }, + ); }); it("can change texture uniform value", function () { @@ -432,28 +432,28 @@ describe("Scene/Model/CustomShader", function () { }); shaders.push(customShader); - return waitForTextureLoad(customShader, "u_testTexture").then(function ( - blueTexture - ) { - expect(customShader.uniformMap.u_testTexture()).toBe(blueTexture); - expect(blueTexture.width).toBe(2); - expect(blueTexture.height).toBe(2); - customShader.setUniform( - "u_testTexture", - new TextureUniform({ - url: greenUrl, - }) - ); - return waitForTextureLoad(customShader, "u_testTexture").then( - function (greenTexture) { - expect(customShader.uniformMap.u_testTexture()).toBe( - greenTexture - ); - expect(greenTexture.width).toBe(1); - expect(greenTexture.height).toBe(4); - } - ); - }); + return waitForTextureLoad(customShader, "u_testTexture").then( + function (blueTexture) { + expect(customShader.uniformMap.u_testTexture()).toBe(blueTexture); + expect(blueTexture.width).toBe(2); + expect(blueTexture.height).toBe(2); + customShader.setUniform( + "u_testTexture", + new TextureUniform({ + url: greenUrl, + }), + ); + return waitForTextureLoad(customShader, "u_testTexture").then( + function (greenTexture) { + expect(customShader.uniformMap.u_testTexture()).toBe( + greenTexture, + ); + expect(greenTexture.width).toBe(1); + expect(greenTexture.height).toBe(4); + }, + ); + }, + ); }); it("destroys", function () { @@ -471,19 +471,19 @@ describe("Scene/Model/CustomShader", function () { }); shaders.push(customShader); - return waitForTextureLoad(customShader, "u_blue").then(function ( - texture - ) { - expect(customShader.isDestroyed()).toBe(false); - expect(texture.isDestroyed()).toBe(false); + return waitForTextureLoad(customShader, "u_blue").then( + function (texture) { + expect(customShader.isDestroyed()).toBe(false); + expect(texture.isDestroyed()).toBe(false); - customShader.destroy(); + customShader.destroy(); - expect(customShader.isDestroyed()).toBe(true); - expect(texture.isDestroyed()).toBe(true); - }); + expect(customShader.isDestroyed()).toBe(true); + expect(texture.isDestroyed()).toBe(true); + }, + ); }); }, - "WebGL" + "WebGL", ); }); diff --git a/packages/engine/Specs/Scene/Model/DequantizationPipelineStageSpec.js b/packages/engine/Specs/Scene/Model/DequantizationPipelineStageSpec.js index c8eed6be5bd5..47cef0858305 100644 --- a/packages/engine/Specs/Scene/Model/DequantizationPipelineStageSpec.js +++ b/packages/engine/Specs/Scene/Model/DequantizationPipelineStageSpec.js @@ -96,7 +96,7 @@ describe( [ " attributes.normalMC = czm_octDecode(a_quantized_normalMC, model_normalizationRange_normalMC).zxy;", " attributes.positionMC = model_quantizedVolumeOffset_positionMC + a_quantized_positionMC * model_quantizedVolumeStepSize_positionMC;", - ] + ], ); ShaderBuilderTester.expectHasFragmentDefines(shaderBuilder, []); ShaderBuilderTester.expectHasFragmentFunctionIds(shaderBuilder, []); @@ -125,9 +125,11 @@ describe( const uniformValues = { normalRange: uniformMap.model_normalizationRange_normalMC(), positionOffset: uniformMap.model_quantizedVolumeOffset_positionMC(), - positionStepSize: uniformMap.model_quantizedVolumeStepSize_positionMC(), + positionStepSize: + uniformMap.model_quantizedVolumeStepSize_positionMC(), texCoordOffset: uniformMap.model_quantizedVolumeOffset_texCoord_0(), - texCoordStepSize: uniformMap.model_quantizedVolumeStepSize_texCoord_0(), + texCoordStepSize: + uniformMap.model_quantizedVolumeStepSize_texCoord_0(), }; const expected = { @@ -135,20 +137,20 @@ describe( positionOffset: new Cartesian3( -2.430910110473633, 0.2667999863624573, - -1.3960000276565552 + -1.3960000276565552, ), positionStepSize: new Cartesian3( 0.0002971928118058615, 0.0002971928118058615, - 0.0002971928118058615 + 0.0002971928118058615, ), texCoordOffset: new Cartesian2( 0.0029563899151980877, - 0.015672028064727783 + 0.015672028064727783, ), texCoordStepSize: new Cartesian2( 0.0002397004064622816, - 0.0002397004064622816 + 0.0002397004064622816, ), }; @@ -180,9 +182,11 @@ describe( const uniformValues = { normalRange: uniformMap.model_normalizationRange_normalMC(), texCoordOffset: uniformMap.model_quantizedVolumeOffset_texCoord_0(), - texCoordStepSize: uniformMap.model_quantizedVolumeStepSize_texCoord_0(), + texCoordStepSize: + uniformMap.model_quantizedVolumeStepSize_texCoord_0(), positionOffset: uniformMap.model_quantizedVolumeOffset_positionMC(), - positionStepSize: uniformMap.model_quantizedVolumeStepSize_positionMC(), + positionStepSize: + uniformMap.model_quantizedVolumeStepSize_positionMC(), colorOffset: uniformMap.model_quantizedVolumeOffset_color_0(), colorStepSize: uniformMap.model_quantizedVolumeStepSize_color_0(), }; @@ -193,24 +197,24 @@ describe( positionStepSize: new Cartesian3( 0.00006103888176768602, 0.00006103888176768602, - 0.00006103888176768602 + 0.00006103888176768602, ), texCoordOffset: new Cartesian2(0, 0), texCoordStepSize: new Cartesian2( 0.0002442002442002442, - 0.0002442002442002442 + 0.0002442002442002442, ), colorOffset: new Cartesian4( 4.908018991223173e-10, 0.0006933663971722126, 0.000028382812160998583, - 0 + 0, ), colorStepSize: new Cartesian4( 0.00392145689795999, 0.00392145689795999, 0.00392145689795999, - 1 + 1, ), }; @@ -240,22 +244,24 @@ describe( const uniformValues = { texCoordOffset: uniformMap.model_quantizedVolumeOffset_texCoord_0(), - texCoordStepSize: uniformMap.model_quantizedVolumeStepSize_texCoord_0(), + texCoordStepSize: + uniformMap.model_quantizedVolumeStepSize_texCoord_0(), positionOffset: uniformMap.model_quantizedVolumeOffset_positionMC(), - positionStepSize: uniformMap.model_quantizedVolumeStepSize_positionMC(), + positionStepSize: + uniformMap.model_quantizedVolumeStepSize_positionMC(), }; const expected = { texCoordOffset: new Cartesian2(0, 0), texCoordStepSize: new Cartesian2( 0.0002442002442002442, - 0.0002442002442002442 + 0.0002442002442002442, ), positionOffset: new Cartesian3(-0.5, -0.5, -0.5), positionStepSize: new Cartesian3( 0.00006103888176768602, 0.00006103888176768602, - 0.00006103888176768602 + 0.00006103888176768602, ), }; @@ -284,12 +290,12 @@ describe( shaderBuilder, DequantizationPipelineStage.FUNCTION_ID_DEQUANTIZATION_STAGE_VS, DequantizationPipelineStage.FUNCTION_SIGNATURE_DEQUANTIZATION_STAGE_VS, - [] + [], ); ShaderBuilderTester.expectHasFragmentDefines(shaderBuilder, []); ShaderBuilderTester.expectHasFragmentFunctionIds(shaderBuilder, []); }); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/Model/FeatureIdPipelineStageSpec.js b/packages/engine/Specs/Scene/Model/FeatureIdPipelineStageSpec.js index 889c6e5c2eca..91a653a3a154 100644 --- a/packages/engine/Specs/Scene/Model/FeatureIdPipelineStageSpec.js +++ b/packages/engine/Specs/Scene/Model/FeatureIdPipelineStageSpec.js @@ -115,31 +115,31 @@ describe( shaderBuilder, FeatureIdPipelineStage.STRUCT_ID_FEATURE_IDS_VS, FeatureIdPipelineStage.STRUCT_NAME_FEATURE_IDS, - [] + [], ); ShaderBuilderTester.expectHasFragmentStruct( shaderBuilder, FeatureIdPipelineStage.STRUCT_ID_FEATURE_IDS_FS, FeatureIdPipelineStage.STRUCT_NAME_FEATURE_IDS, - [] + [], ); ShaderBuilderTester.expectHasVertexFunctionUnordered( shaderBuilder, FeatureIdPipelineStage.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS, FeatureIdPipelineStage.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS, - [] + [], ); ShaderBuilderTester.expectHasFragmentFunctionUnordered( shaderBuilder, FeatureIdPipelineStage.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS, FeatureIdPipelineStage.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS, - [] + [], ); ShaderBuilderTester.expectHasVertexFunctionUnordered( shaderBuilder, FeatureIdPipelineStage.FUNCTION_ID_SET_FEATURE_ID_VARYINGS, FeatureIdPipelineStage.FUNCTION_SIGNATURE_SET_FEATURE_ID_VARYINGS, - [] + [], ); ShaderBuilderTester.expectHasVertexDefines(shaderBuilder, []); ShaderBuilderTester.expectHasFragmentDefines(shaderBuilder, []); @@ -187,7 +187,7 @@ describe( " int featureId_1;", " int perPoint;", " int town;", - ] + ], ); ShaderBuilderTester.expectHasFragmentStruct( shaderBuilder, @@ -198,7 +198,7 @@ describe( " int featureId_1;", " int perPoint;", " int town;", - ] + ], ); ShaderBuilderTester.expectHasVertexFunctionUnordered( shaderBuilder, @@ -207,7 +207,7 @@ describe( [ " featureIds.featureId_0 = int(czm_round(a_implicit_featureId_0));", " featureIds.featureId_1 = int(czm_round(attributes.featureId_0));", - ] + ], ); ShaderBuilderTester.expectHasFragmentFunctionUnordered( shaderBuilder, @@ -216,7 +216,7 @@ describe( [ " featureIds.featureId_0 = int(czm_round(v_implicit_featureId_0));", " featureIds.featureId_1 = int(czm_round(attributes.featureId_0));", - ] + ], ); ShaderBuilderTester.expectHasVertexFunctionUnordered( shaderBuilder, @@ -225,7 +225,7 @@ describe( [ " featureIds.perPoint = featureIds.featureId_0;", " featureIds.town = featureIds.featureId_1;", - ] + ], ); ShaderBuilderTester.expectHasFragmentFunctionUnordered( shaderBuilder, @@ -234,13 +234,13 @@ describe( [ " featureIds.perPoint = featureIds.featureId_0;", " featureIds.town = featureIds.featureId_1;", - ] + ], ); ShaderBuilderTester.expectHasVertexFunctionUnordered( shaderBuilder, FeatureIdPipelineStage.FUNCTION_ID_SET_FEATURE_ID_VARYINGS, FeatureIdPipelineStage.FUNCTION_SIGNATURE_SET_FEATURE_ID_VARYINGS, - [" v_implicit_featureId_0 = a_implicit_featureId_0;"] + [" v_implicit_featureId_0 = a_implicit_featureId_0;"], ); ShaderBuilderTester.expectHasVertexDefines(shaderBuilder, []); ShaderBuilderTester.expectHasFragmentDefines(shaderBuilder, []); @@ -273,7 +273,7 @@ describe( expect(implicitAttribute.normalize).toBe(false); expect(implicitAttribute.componentsPerAttribute).toBe(1); expect(implicitAttribute.componentDatatype).toBe( - ComponentDatatype.FLOAT + ComponentDatatype.FLOAT, ); expect(implicitAttribute.strideInBytes).toBe(4); expect(implicitAttribute.offsetInBytes).toBe(0); @@ -309,7 +309,7 @@ describe( " int featureId_1;", " int buildings;", " int defaultIdsTest;", - ] + ], ); ShaderBuilderTester.expectHasFragmentStruct( shaderBuilder, @@ -320,7 +320,7 @@ describe( " int featureId_1;", " int buildings;", " int defaultIdsTest;", - ] + ], ); ShaderBuilderTester.expectHasVertexFunctionUnordered( shaderBuilder, @@ -329,7 +329,7 @@ describe( [ " featureIds.featureId_0 = int(czm_round(attributes.featureId_0));", " featureIds.featureId_1 = int(czm_round(a_implicit_featureId_1));", - ] + ], ); ShaderBuilderTester.expectHasFragmentFunctionUnordered( shaderBuilder, @@ -338,7 +338,7 @@ describe( [ " featureIds.featureId_0 = int(czm_round(attributes.featureId_0));", " featureIds.featureId_1 = int(czm_round(v_implicit_featureId_1));", - ] + ], ); ShaderBuilderTester.expectHasVertexFunctionUnordered( shaderBuilder, @@ -347,7 +347,7 @@ describe( [ " featureIds.buildings = featureIds.featureId_0;", " featureIds.defaultIdsTest = featureIds.featureId_1;", - ] + ], ); ShaderBuilderTester.expectHasFragmentFunctionUnordered( shaderBuilder, @@ -356,13 +356,13 @@ describe( [ " featureIds.buildings = featureIds.featureId_0;", " featureIds.defaultIdsTest = featureIds.featureId_1;", - ] + ], ); ShaderBuilderTester.expectHasVertexFunctionUnordered( shaderBuilder, FeatureIdPipelineStage.FUNCTION_ID_SET_FEATURE_ID_VARYINGS, FeatureIdPipelineStage.FUNCTION_SIGNATURE_SET_FEATURE_ID_VARYINGS, - [" v_implicit_featureId_1 = a_implicit_featureId_1;"] + [" v_implicit_featureId_1 = a_implicit_featureId_1;"], ); ShaderBuilderTester.expectHasVertexDefines(shaderBuilder, []); ShaderBuilderTester.expectHasFragmentDefines(shaderBuilder, []); @@ -395,7 +395,7 @@ describe( expect(implicitAttribute.normalize).toBe(false); expect(implicitAttribute.componentsPerAttribute).toBe(1); expect(implicitAttribute.componentDatatype).toBe( - ComponentDatatype.FLOAT + ComponentDatatype.FLOAT, ); expect(implicitAttribute.strideInBytes).toBe(4); expect(implicitAttribute.offsetInBytes).toBe(0); @@ -426,19 +426,19 @@ describe( shaderBuilder, FeatureIdPipelineStage.STRUCT_ID_FEATURE_IDS_VS, FeatureIdPipelineStage.STRUCT_NAME_FEATURE_IDS, - [] + [], ); ShaderBuilderTester.expectHasFragmentStruct( shaderBuilder, FeatureIdPipelineStage.STRUCT_ID_FEATURE_IDS_FS, FeatureIdPipelineStage.STRUCT_NAME_FEATURE_IDS, - [" int featureId_0;", " int landCover;"] + [" int featureId_0;", " int landCover;"], ); ShaderBuilderTester.expectHasVertexFunctionUnordered( shaderBuilder, FeatureIdPipelineStage.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS, FeatureIdPipelineStage.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS, - [] + [], ); ShaderBuilderTester.expectHasFragmentFunctionUnordered( shaderBuilder, @@ -446,25 +446,25 @@ describe( FeatureIdPipelineStage.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS, [ " featureIds.featureId_0 = czm_unpackUint(texture(u_featureIdTexture_0, v_texCoord_0).r);", - ] + ], ); ShaderBuilderTester.expectHasVertexFunctionUnordered( shaderBuilder, FeatureIdPipelineStage.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS, FeatureIdPipelineStage.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES, - [] + [], ); ShaderBuilderTester.expectHasFragmentFunctionUnordered( shaderBuilder, FeatureIdPipelineStage.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS, FeatureIdPipelineStage.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES, - [" featureIds.landCover = featureIds.featureId_0;"] + [" featureIds.landCover = featureIds.featureId_0;"], ); ShaderBuilderTester.expectHasVertexFunctionUnordered( shaderBuilder, FeatureIdPipelineStage.FUNCTION_ID_SET_FEATURE_ID_VARYINGS, FeatureIdPipelineStage.FUNCTION_SIGNATURE_SET_FEATURE_ID_VARYINGS, - [] + [], ); ShaderBuilderTester.expectHasVertexDefines(shaderBuilder, []); ShaderBuilderTester.expectHasFragmentDefines(shaderBuilder, []); @@ -488,14 +488,14 @@ describe( expect(uniformMap.u_featureIdTexture_0).toBeDefined(); const featureIdTexture = primitive.featureIds[0]; expect(uniformMap.u_featureIdTexture_0()).toBe( - featureIdTexture.textureReader.texture + featureIdTexture.textureReader.texture, ); }); }); it("adds feature ID texture transforms to the shader", async function () { const gltfLoader = await loadGltf( - featureIdTextureWithTextureTransformUrl + featureIdTextureWithTextureTransformUrl, ); const components = gltfLoader.components; const node = components.nodes[0]; @@ -510,19 +510,19 @@ describe( shaderBuilder, FeatureIdPipelineStage.STRUCT_ID_FEATURE_IDS_VS, FeatureIdPipelineStage.STRUCT_NAME_FEATURE_IDS, - [] + [], ); ShaderBuilderTester.expectHasFragmentStruct( shaderBuilder, FeatureIdPipelineStage.STRUCT_ID_FEATURE_IDS_FS, FeatureIdPipelineStage.STRUCT_NAME_FEATURE_IDS, - [" int featureId_0;"] + [" int featureId_0;"], ); ShaderBuilderTester.expectHasVertexFunctionUnordered( shaderBuilder, FeatureIdPipelineStage.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS, FeatureIdPipelineStage.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS, - [] + [], ); ShaderBuilderTester.expectHasFragmentFunctionUnordered( shaderBuilder, @@ -530,19 +530,19 @@ describe( FeatureIdPipelineStage.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS, [ " featureIds.featureId_0 = czm_unpackUint(texture(u_featureIdTexture_0, vec2(u_featureIdTexture_0Transform * vec3(v_texCoord_0, 1.0))).r);", - ] + ], ); ShaderBuilderTester.expectHasVertexFunctionUnordered( shaderBuilder, FeatureIdPipelineStage.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS, FeatureIdPipelineStage.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES, - [] + [], ); ShaderBuilderTester.expectHasVertexFunctionUnordered( shaderBuilder, FeatureIdPipelineStage.FUNCTION_ID_SET_FEATURE_ID_VARYINGS, FeatureIdPipelineStage.FUNCTION_SIGNATURE_SET_FEATURE_ID_VARYINGS, - [] + [], ); ShaderBuilderTester.expectHasVertexDefines(shaderBuilder, []); ShaderBuilderTester.expectHasFragmentDefines(shaderBuilder, []); @@ -567,7 +567,7 @@ describe( expect(uniformMap.u_featureIdTexture_0).toBeDefined(); const featureIdTexture = primitive.featureIds[0]; expect(uniformMap.u_featureIdTexture_0()).toBe( - featureIdTexture.textureReader.texture + featureIdTexture.textureReader.texture, ); }); @@ -586,7 +586,7 @@ describe( shaderBuilder, FeatureIdPipelineStage.STRUCT_ID_FEATURE_IDS_VS, FeatureIdPipelineStage.STRUCT_NAME_FEATURE_IDS, - [] + [], ); ShaderBuilderTester.expectHasFragmentStruct( shaderBuilder, @@ -607,13 +607,13 @@ describe( " int idsGR;", " int idsAGBB;", " int idsGWithNull;", - ] + ], ); ShaderBuilderTester.expectHasVertexFunctionUnordered( shaderBuilder, FeatureIdPipelineStage.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS, FeatureIdPipelineStage.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS, - [] + [], ); ShaderBuilderTester.expectHasFragmentFunctionUnordered( shaderBuilder, @@ -627,13 +627,13 @@ describe( " featureIds.featureId_4 = czm_unpackUint(texture(u_featureIdTexture_4, v_texCoord_0).gr);", " featureIds.featureId_5 = czm_unpackUint(texture(u_featureIdTexture_5, v_texCoord_0).agbb);", " featureIds.featureId_6 = czm_unpackUint(texture(u_featureIdTexture_6, v_texCoord_0).g);", - ] + ], ); ShaderBuilderTester.expectHasVertexFunctionUnordered( shaderBuilder, FeatureIdPipelineStage.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS, FeatureIdPipelineStage.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES, - [] + [], ); ShaderBuilderTester.expectHasFragmentFunctionUnordered( shaderBuilder, @@ -647,13 +647,13 @@ describe( " featureIds.idsGR = featureIds.featureId_4;", " featureIds.idsAGBB = featureIds.featureId_5;", " featureIds.idsGWithNull = featureIds.featureId_6;", - ] + ], ); ShaderBuilderTester.expectHasVertexFunctionUnordered( shaderBuilder, FeatureIdPipelineStage.FUNCTION_ID_SET_FEATURE_ID_VARYINGS, FeatureIdPipelineStage.FUNCTION_SIGNATURE_SET_FEATURE_ID_VARYINGS, - [] + [], ); ShaderBuilderTester.expectHasVertexDefines(shaderBuilder, []); ShaderBuilderTester.expectHasFragmentDefines(shaderBuilder, []); @@ -713,7 +713,7 @@ describe( " int instanceFeatureId_1;", " int perInstance;", " int section;", - ] + ], ); ShaderBuilderTester.expectHasFragmentStruct( shaderBuilder, @@ -724,7 +724,7 @@ describe( " int instanceFeatureId_1;", " int perInstance;", " int section;", - ] + ], ); ShaderBuilderTester.expectHasVertexFunctionUnordered( shaderBuilder, @@ -733,7 +733,7 @@ describe( [ " featureIds.instanceFeatureId_0 = int(czm_round(a_implicit_instanceFeatureId_0));", " featureIds.instanceFeatureId_1 = int(czm_round(a_instanceFeatureId_0));", - ] + ], ); ShaderBuilderTester.expectHasFragmentFunctionUnordered( shaderBuilder, @@ -742,7 +742,7 @@ describe( [ " featureIds.instanceFeatureId_0 = int(czm_round(v_implicit_instanceFeatureId_0));", " featureIds.instanceFeatureId_1 = int(czm_round(v_instanceFeatureId_0));", - ] + ], ); ShaderBuilderTester.expectHasVertexFunctionUnordered( shaderBuilder, @@ -751,7 +751,7 @@ describe( [ " featureIds.perInstance = featureIds.instanceFeatureId_0;", " featureIds.section = featureIds.instanceFeatureId_1;", - ] + ], ); ShaderBuilderTester.expectHasFragmentFunctionUnordered( shaderBuilder, @@ -760,7 +760,7 @@ describe( [ " featureIds.perInstance = featureIds.instanceFeatureId_0;", " featureIds.section = featureIds.instanceFeatureId_1;", - ] + ], ); ShaderBuilderTester.expectHasVertexFunctionUnordered( shaderBuilder, @@ -769,7 +769,7 @@ describe( [ " v_instanceFeatureId_0 = a_instanceFeatureId_0;", " v_implicit_instanceFeatureId_0 = a_implicit_instanceFeatureId_0;", - ] + ], ); ShaderBuilderTester.expectHasVertexDefines(shaderBuilder, []); ShaderBuilderTester.expectHasFragmentDefines(shaderBuilder, []); @@ -803,7 +803,7 @@ describe( expect(implicitAttribute.normalize).toBe(false); expect(implicitAttribute.componentsPerAttribute).toBe(1); expect(implicitAttribute.componentDatatype).toBe( - ComponentDatatype.FLOAT + ComponentDatatype.FLOAT, ); expect(implicitAttribute.strideInBytes).toBe(4); expect(implicitAttribute.offsetInBytes).toBe(0); @@ -817,5 +817,5 @@ describe( }); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/Model/GeoJsonLoaderSpec.js b/packages/engine/Specs/Scene/Model/GeoJsonLoaderSpec.js index adb5ca1b8bd1..5edd68d8acdf 100644 --- a/packages/engine/Specs/Scene/Model/GeoJsonLoaderSpec.js +++ b/packages/engine/Specs/Scene/Model/GeoJsonLoaderSpec.js @@ -93,12 +93,12 @@ describe( const attributes = primitive.attributes; const positionAttribute = getAttribute( attributes, - VertexAttributeSemantic.POSITION + VertexAttributeSemantic.POSITION, ); const featureIdAttribute = getAttribute( attributes, VertexAttributeSemantic.FEATURE_ID, - 0 + 0, ); const indices = primitive.indices; const material = primitive.material; @@ -109,7 +109,7 @@ describe( expect(positionAttribute.buffer).toBeDefined(); expect(positionAttribute.buffer.sizeInBytes).toBe( - expected.vertexCount * 3 * 4 + expected.vertexCount * 3 * 4, ); expect(positionAttribute.count).toBe(expected.vertexCount); expect(positionAttribute.min).toBeDefined(); @@ -117,7 +117,7 @@ describe( expect(featureIdAttribute.buffer).toBeDefined(); expect(featureIdAttribute.buffer.sizeInBytes).toBe( - expected.vertexCount * 4 + expected.vertexCount * 4, ); expect(featureIdAttribute.count).toBe(expected.vertexCount); @@ -252,5 +252,5 @@ describe( }); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/Model/GeometryPipelineStageSpec.js b/packages/engine/Specs/Scene/Model/GeometryPipelineStageSpec.js index cc34a4795f4b..57d9e3794a1f 100644 --- a/packages/engine/Specs/Scene/Model/GeometryPipelineStageSpec.js +++ b/packages/engine/Specs/Scene/Model/GeometryPipelineStageSpec.js @@ -111,13 +111,13 @@ describe( shaderBuilder, SelectedFeatureIdPipelineStage.STRUCT_ID_SELECTED_FEATURE, SelectedFeatureIdPipelineStage.STRUCT_NAME_SELECTED_FEATURE, - [] + [], ); ShaderBuilderTester.expectHasFragmentStruct( shaderBuilder, SelectedFeatureIdPipelineStage.STRUCT_ID_SELECTED_FEATURE, SelectedFeatureIdPipelineStage.STRUCT_NAME_SELECTED_FEATURE, - [] + [], ); } @@ -167,7 +167,7 @@ describe( GeometryPipelineStage.process( renderResources, positionOnlyPrimitive, - scene.frameState + scene.frameState, ); const shaderBuilder = renderResources.shaderBuilder; @@ -179,7 +179,7 @@ describe( expect(positionAttribute.vertexBuffer).toBeDefined(); expect(positionAttribute.componentsPerAttribute).toEqual(3); expect(positionAttribute.componentDatatype).toEqual( - ComponentDatatype.FLOAT + ComponentDatatype.FLOAT, ); expect(positionAttribute.offsetInBytes).toBe(0); expect(positionAttribute.strideInBytes).toBe(12); @@ -188,31 +188,35 @@ describe( shaderBuilder, GeometryPipelineStage.STRUCT_ID_PROCESSED_ATTRIBUTES_VS, GeometryPipelineStage.STRUCT_NAME_PROCESSED_ATTRIBUTES, - [" vec3 positionMC;"] + [" vec3 positionMC;"], ); ShaderBuilderTester.expectHasFragmentStruct( shaderBuilder, GeometryPipelineStage.STRUCT_ID_PROCESSED_ATTRIBUTES_FS, GeometryPipelineStage.STRUCT_NAME_PROCESSED_ATTRIBUTES, - [" vec3 positionMC;", " vec3 positionWC;", " vec3 positionEC;"] + [ + " vec3 positionMC;", + " vec3 positionWC;", + " vec3 positionEC;", + ], ); ShaderBuilderTester.expectHasVertexFunctionUnordered( shaderBuilder, GeometryPipelineStage.FUNCTION_ID_INITIALIZE_ATTRIBUTES, GeometryPipelineStage.FUNCTION_SIGNATURE_INITIALIZE_ATTRIBUTES, - [" attributes.positionMC = a_positionMC;"] + [" attributes.positionMC = a_positionMC;"], ); ShaderBuilderTester.expectHasVertexFunctionUnordered( shaderBuilder, GeometryPipelineStage.FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS, GeometryPipelineStage.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS, - [] + [], ); ShaderBuilderTester.expectHasFragmentFunctionUnordered( shaderBuilder, GeometryPipelineStage.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS, GeometryPipelineStage.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS, - [] + [], ); ShaderBuilderTester.expectHasVaryings(shaderBuilder, [ "vec3 v_positionEC;", @@ -224,7 +228,7 @@ describe( ShaderBuilderTester.expectHasAttributes( shaderBuilder, "in vec3 a_positionMC;", - [] + [], ); verifyFeatureStruct(shaderBuilder); }); @@ -238,7 +242,7 @@ describe( GeometryPipelineStage.process( renderResources, primitive, - scene.frameState + scene.frameState, ); const shaderBuilder = renderResources.shaderBuilder; @@ -251,7 +255,7 @@ describe( expect(normalAttribute.vertexBuffer).toBeDefined(); expect(normalAttribute.componentsPerAttribute).toEqual(3); expect(normalAttribute.componentDatatype).toEqual( - ComponentDatatype.FLOAT + ComponentDatatype.FLOAT, ); expect(normalAttribute.offsetInBytes).toBe(0); expect(normalAttribute.strideInBytes).toBe(12); @@ -261,7 +265,7 @@ describe( expect(positionAttribute.vertexBuffer).toBeDefined(); expect(positionAttribute.componentsPerAttribute).toEqual(3); expect(positionAttribute.componentDatatype).toEqual( - ComponentDatatype.FLOAT + ComponentDatatype.FLOAT, ); expect(positionAttribute.offsetInBytes).toBe(288); expect(positionAttribute.strideInBytes).toBe(12); @@ -271,7 +275,7 @@ describe( expect(texCoord0Attribute.vertexBuffer).toBeDefined(); expect(texCoord0Attribute.componentsPerAttribute).toEqual(2); expect(texCoord0Attribute.componentDatatype).toEqual( - ComponentDatatype.FLOAT + ComponentDatatype.FLOAT, ); expect(texCoord0Attribute.offsetInBytes).toBe(0); expect(texCoord0Attribute.strideInBytes).toBe(8); @@ -280,7 +284,11 @@ describe( shaderBuilder, GeometryPipelineStage.STRUCT_ID_PROCESSED_ATTRIBUTES_VS, GeometryPipelineStage.STRUCT_NAME_PROCESSED_ATTRIBUTES, - [" vec3 positionMC;", " vec3 normalMC;", " vec2 texCoord_0;"] + [ + " vec3 positionMC;", + " vec3 normalMC;", + " vec2 texCoord_0;", + ], ); ShaderBuilderTester.expectHasFragmentStruct( shaderBuilder, @@ -292,7 +300,7 @@ describe( " vec3 positionEC;", " vec3 normalEC;", " vec2 texCoord_0;", - ] + ], ); ShaderBuilderTester.expectHasVertexFunctionUnordered( shaderBuilder, @@ -302,19 +310,19 @@ describe( " attributes.positionMC = a_positionMC;", " attributes.normalMC = a_normalMC;", " attributes.texCoord_0 = a_texCoord_0;", - ] + ], ); ShaderBuilderTester.expectHasVertexFunctionUnordered( shaderBuilder, GeometryPipelineStage.FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS, GeometryPipelineStage.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS, - [" v_texCoord_0 = attributes.texCoord_0;"] + [" v_texCoord_0 = attributes.texCoord_0;"], ); ShaderBuilderTester.expectHasFragmentFunctionUnordered( shaderBuilder, GeometryPipelineStage.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS, GeometryPipelineStage.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS, - [" attributes.texCoord_0 = v_texCoord_0;"] + [" attributes.texCoord_0 = v_texCoord_0;"], ); ShaderBuilderTester.expectHasVaryings(shaderBuilder, [ "vec3 v_normalEC;", @@ -334,7 +342,7 @@ describe( ShaderBuilderTester.expectHasAttributes( shaderBuilder, "in vec3 a_positionMC;", - ["in vec3 a_normalMC;", "in vec2 a_texCoord_0;"] + ["in vec3 a_normalMC;", "in vec2 a_texCoord_0;"], ); verifyFeatureStruct(shaderBuilder); }); @@ -353,7 +361,7 @@ describe( GeometryPipelineStage.process( renderResources, primitive, - scene2D.frameState + scene2D.frameState, ); const shaderBuilder = renderResources.shaderBuilder; @@ -369,7 +377,7 @@ describe( expect(positionAttribute.vertexBuffer).toBeDefined(); expect(positionAttribute.componentsPerAttribute).toEqual(3); expect(positionAttribute.componentDatatype).toEqual( - ComponentDatatype.FLOAT + ComponentDatatype.FLOAT, ); expect(positionAttribute.offsetInBytes).toBe(288); expect(positionAttribute.strideInBytes).toBe(12); @@ -377,11 +385,11 @@ describe( const position2DAttribute = attributes[2]; expect(position2DAttribute.index).toEqual(2); expect(position2DAttribute.vertexBuffer).toBe( - runtimePrimitive.positionBuffer2D + runtimePrimitive.positionBuffer2D, ); expect(position2DAttribute.componentsPerAttribute).toEqual(3); expect(position2DAttribute.componentDatatype).toEqual( - ComponentDatatype.FLOAT + ComponentDatatype.FLOAT, ); expect(position2DAttribute.offsetInBytes).toBe(0); expect(position2DAttribute.strideInBytes).toBeUndefined(); @@ -398,7 +406,7 @@ describe( " vec3 position2D;", " vec3 normalMC;", " vec2 texCoord_0;", - ] + ], ); ShaderBuilderTester.expectHasVertexFunctionUnordered( shaderBuilder, @@ -409,7 +417,7 @@ describe( " attributes.position2D = a_position2D;", " attributes.normalMC = a_normalMC;", " attributes.texCoord_0 = a_texCoord_0;", - ] + ], ); ShaderBuilderTester.expectHasVertexDefines(shaderBuilder, [ "HAS_NORMALS", @@ -422,7 +430,7 @@ describe( "in vec3 a_position2D;", "in vec3 a_normalMC;", "in vec2 a_texCoord_0;", - ] + ], ); verifyFeatureStruct(shaderBuilder); }); @@ -437,7 +445,7 @@ describe( GeometryPipelineStage.process( renderResources, primitive, - scene.frameState + scene.frameState, ); const shaderBuilder = renderResources.shaderBuilder; @@ -450,7 +458,7 @@ describe( expect(texCoord0Attribute.vertexBuffer).toBeDefined(); expect(texCoord0Attribute.componentsPerAttribute).toEqual(2); expect(texCoord0Attribute.componentDatatype).toEqual( - ComponentDatatype.FLOAT + ComponentDatatype.FLOAT, ); expect(texCoord0Attribute.offsetInBytes).toBe(0); expect(texCoord0Attribute.strideInBytes).toBe(8); @@ -460,7 +468,7 @@ describe( expect(normalAttribute.vertexBuffer).toBeDefined(); expect(normalAttribute.componentsPerAttribute).toEqual(3); expect(normalAttribute.componentDatatype).toEqual( - ComponentDatatype.FLOAT + ComponentDatatype.FLOAT, ); expect(normalAttribute.offsetInBytes).toBe(0); expect(normalAttribute.strideInBytes).toBe(12); @@ -470,7 +478,7 @@ describe( expect(tangentAttribute.vertexBuffer).toBeDefined(); expect(tangentAttribute.componentsPerAttribute).toEqual(4); expect(tangentAttribute.componentDatatype).toEqual( - ComponentDatatype.FLOAT + ComponentDatatype.FLOAT, ); expect(tangentAttribute.offsetInBytes).toBe(0); expect(tangentAttribute.strideInBytes).toBe(16); @@ -480,7 +488,7 @@ describe( expect(positionAttribute.vertexBuffer).toBeDefined(); expect(positionAttribute.componentsPerAttribute).toEqual(3); expect(positionAttribute.componentDatatype).toEqual( - ComponentDatatype.FLOAT + ComponentDatatype.FLOAT, ); expect(positionAttribute.offsetInBytes).toBe(0); expect(positionAttribute.strideInBytes).toBe(12); @@ -496,7 +504,7 @@ describe( " float tangentSignMC;", " vec3 bitangentMC;", " vec2 texCoord_0;", - ] + ], ); ShaderBuilderTester.expectHasFragmentStruct( shaderBuilder, @@ -510,7 +518,7 @@ describe( " vec3 tangentEC;", " vec3 bitangentEC;", " vec2 texCoord_0;", - ] + ], ); ShaderBuilderTester.expectHasVertexFunctionUnordered( shaderBuilder, @@ -522,19 +530,19 @@ describe( " attributes.tangentMC = a_tangentMC.xyz;", " attributes.tangentSignMC = a_tangentMC.w;", " attributes.texCoord_0 = a_texCoord_0;", - ] + ], ); ShaderBuilderTester.expectHasVertexFunctionUnordered( shaderBuilder, GeometryPipelineStage.FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS, GeometryPipelineStage.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS, - [" v_texCoord_0 = attributes.texCoord_0;"] + [" v_texCoord_0 = attributes.texCoord_0;"], ); ShaderBuilderTester.expectHasFragmentFunctionUnordered( shaderBuilder, GeometryPipelineStage.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS, GeometryPipelineStage.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS, - [" attributes.texCoord_0 = v_texCoord_0;"] + [" attributes.texCoord_0 = v_texCoord_0;"], ); ShaderBuilderTester.expectHasVaryings(shaderBuilder, [ "vec3 v_normalEC;", @@ -564,7 +572,7 @@ describe( "in vec3 a_normalMC;", "in vec4 a_tangentMC;", "in vec2 a_texCoord_0;", - ] + ], ); verifyFeatureStruct(shaderBuilder); }); @@ -579,7 +587,7 @@ describe( GeometryPipelineStage.process( renderResources, primitive, - scene.frameState + scene.frameState, ); const shaderBuilder = renderResources.shaderBuilder; @@ -592,7 +600,7 @@ describe( expect(positionAttribute.vertexBuffer).toBeDefined(); expect(positionAttribute.componentsPerAttribute).toEqual(3); expect(positionAttribute.componentDatatype).toEqual( - ComponentDatatype.FLOAT + ComponentDatatype.FLOAT, ); const texCoord0Attribute = attributes[1]; @@ -600,7 +608,7 @@ describe( expect(texCoord0Attribute.vertexBuffer).toBeDefined(); expect(texCoord0Attribute.componentsPerAttribute).toEqual(2); expect(texCoord0Attribute.componentDatatype).toEqual( - ComponentDatatype.FLOAT + ComponentDatatype.FLOAT, ); expect(texCoord0Attribute.offsetInBytes).toBe(0); expect(texCoord0Attribute.strideInBytes).toBe(8); @@ -610,7 +618,7 @@ describe( expect(texCoord1Attribute.vertexBuffer).toBeDefined(); expect(texCoord1Attribute.componentsPerAttribute).toEqual(2); expect(texCoord1Attribute.componentDatatype).toEqual( - ComponentDatatype.FLOAT + ComponentDatatype.FLOAT, ); expect(texCoord1Attribute.offsetInBytes).toBe(0); expect(texCoord1Attribute.strideInBytes).toBe(8); @@ -623,7 +631,7 @@ describe( " vec3 positionMC;", " vec2 texCoord_0;", " vec2 texCoord_1;", - ] + ], ); ShaderBuilderTester.expectHasFragmentStruct( shaderBuilder, @@ -635,7 +643,7 @@ describe( " vec3 positionEC;", " vec2 texCoord_0;", " vec2 texCoord_1;", - ] + ], ); ShaderBuilderTester.expectHasVertexFunctionUnordered( shaderBuilder, @@ -645,7 +653,7 @@ describe( " attributes.positionMC = a_positionMC;", " attributes.texCoord_0 = a_texCoord_0;", " attributes.texCoord_1 = a_texCoord_1;", - ] + ], ); ShaderBuilderTester.expectHasVertexFunctionUnordered( shaderBuilder, @@ -654,7 +662,7 @@ describe( [ " v_texCoord_0 = attributes.texCoord_0;", " v_texCoord_1 = attributes.texCoord_1;", - ] + ], ); ShaderBuilderTester.expectHasFragmentFunctionUnordered( shaderBuilder, @@ -663,7 +671,7 @@ describe( [ " attributes.texCoord_0 = v_texCoord_0;", " attributes.texCoord_1 = v_texCoord_1;", - ] + ], ); ShaderBuilderTester.expectHasVaryings(shaderBuilder, [ "vec2 v_texCoord_0;", @@ -683,7 +691,7 @@ describe( ShaderBuilderTester.expectHasAttributes( shaderBuilder, "in vec3 a_positionMC;", - ["in vec2 a_texCoord_0;", "in vec2 a_texCoord_1;"] + ["in vec2 a_texCoord_0;", "in vec2 a_texCoord_1;"], ); verifyFeatureStruct(shaderBuilder); }); @@ -698,7 +706,7 @@ describe( GeometryPipelineStage.process( renderResources, primitive, - scene.frameState + scene.frameState, ); const shaderBuilder = renderResources.shaderBuilder; @@ -711,7 +719,7 @@ describe( expect(color0Attribute.vertexBuffer).toBeDefined(); expect(color0Attribute.componentsPerAttribute).toEqual(4); expect(color0Attribute.componentDatatype).toEqual( - ComponentDatatype.FLOAT + ComponentDatatype.FLOAT, ); expect(color0Attribute.offsetInBytes).toBe(0); expect(color0Attribute.strideInBytes).toBe(16); @@ -721,7 +729,7 @@ describe( expect(normalAttribute.vertexBuffer).toBeDefined(); expect(normalAttribute.componentsPerAttribute).toEqual(3); expect(normalAttribute.componentDatatype).toEqual( - ComponentDatatype.FLOAT + ComponentDatatype.FLOAT, ); expect(normalAttribute.offsetInBytes).toBe(0); expect(normalAttribute.strideInBytes).toBe(12); @@ -731,7 +739,7 @@ describe( expect(positionAttribute.vertexBuffer).toBeDefined(); expect(positionAttribute.componentsPerAttribute).toEqual(3); expect(positionAttribute.componentDatatype).toEqual( - ComponentDatatype.FLOAT + ComponentDatatype.FLOAT, ); expect(positionAttribute.offsetInBytes).toBe(0); expect(positionAttribute.strideInBytes).toBe(12); @@ -741,7 +749,7 @@ describe( expect(texCoord0Attribute.vertexBuffer).toBeDefined(); expect(texCoord0Attribute.componentsPerAttribute).toEqual(2); expect(texCoord0Attribute.componentDatatype).toEqual( - ComponentDatatype.FLOAT + ComponentDatatype.FLOAT, ); expect(texCoord0Attribute.offsetInBytes).toBe(0); expect(texCoord0Attribute.strideInBytes).toBe(8); @@ -755,7 +763,7 @@ describe( " vec3 normalMC;", " vec4 color_0;", " vec2 texCoord_0;", - ] + ], ); ShaderBuilderTester.expectHasFragmentStruct( shaderBuilder, @@ -768,7 +776,7 @@ describe( " vec3 normalEC;", " vec4 color_0;", " vec2 texCoord_0;", - ] + ], ); ShaderBuilderTester.expectHasVertexFunctionUnordered( shaderBuilder, @@ -779,7 +787,7 @@ describe( " attributes.normalMC = a_normalMC;", " attributes.color_0 = a_color_0;", " attributes.texCoord_0 = a_texCoord_0;", - ] + ], ); ShaderBuilderTester.expectHasVertexFunctionUnordered( shaderBuilder, @@ -788,7 +796,7 @@ describe( [ " v_color_0 = attributes.color_0;", " v_texCoord_0 = attributes.texCoord_0;", - ] + ], ); ShaderBuilderTester.expectHasFragmentFunctionUnordered( shaderBuilder, @@ -797,7 +805,7 @@ describe( [ " attributes.color_0 = v_color_0;", " attributes.texCoord_0 = v_texCoord_0;", - ] + ], ); ShaderBuilderTester.expectHasVaryings(shaderBuilder, [ "vec3 v_normalEC;", @@ -820,7 +828,11 @@ describe( ShaderBuilderTester.expectHasAttributes( shaderBuilder, "in vec3 a_positionMC;", - ["in vec3 a_normalMC;", "in vec4 a_color_0;", "in vec2 a_texCoord_0;"] + [ + "in vec3 a_normalMC;", + "in vec4 a_color_0;", + "in vec2 a_texCoord_0;", + ], ); verifyFeatureStruct(shaderBuilder); }); @@ -835,7 +847,7 @@ describe( GeometryPipelineStage.process( renderResources, primitive, - scene.frameState + scene.frameState, ); const shaderBuilder = renderResources.shaderBuilder; @@ -848,7 +860,7 @@ describe( expect(positionAttribute.vertexBuffer).toBeDefined(); expect(positionAttribute.componentsPerAttribute).toEqual(3); expect(positionAttribute.componentDatatype).toEqual( - ComponentDatatype.FLOAT + ComponentDatatype.FLOAT, ); expect(positionAttribute.offsetInBytes).toBe(0); expect(positionAttribute.strideInBytes).toBe(24); @@ -858,7 +870,7 @@ describe( expect(color0Attribute.vertexBuffer).toBeDefined(); expect(color0Attribute.componentsPerAttribute).toEqual(3); expect(color0Attribute.componentDatatype).toEqual( - ComponentDatatype.FLOAT + ComponentDatatype.FLOAT, ); expect(color0Attribute.offsetInBytes).toBe(12); expect(color0Attribute.strideInBytes).toBe(24); @@ -867,7 +879,7 @@ describe( shaderBuilder, GeometryPipelineStage.STRUCT_ID_PROCESSED_ATTRIBUTES_VS, GeometryPipelineStage.STRUCT_NAME_PROCESSED_ATTRIBUTES, - [" vec3 positionMC;", " vec4 color_0;"] + [" vec3 positionMC;", " vec4 color_0;"], ); ShaderBuilderTester.expectHasFragmentStruct( shaderBuilder, @@ -878,7 +890,7 @@ describe( " vec3 positionWC;", " vec3 positionEC;", " vec4 color_0;", - ] + ], ); ShaderBuilderTester.expectHasVertexFunctionUnordered( shaderBuilder, @@ -887,19 +899,19 @@ describe( [ " attributes.positionMC = a_positionMC;", " attributes.color_0 = a_color_0;", - ] + ], ); ShaderBuilderTester.expectHasVertexFunctionUnordered( shaderBuilder, GeometryPipelineStage.FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS, GeometryPipelineStage.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS, - [" v_color_0 = attributes.color_0;"] + [" v_color_0 = attributes.color_0;"], ); ShaderBuilderTester.expectHasFragmentFunctionUnordered( shaderBuilder, GeometryPipelineStage.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS, GeometryPipelineStage.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS, - [" attributes.color_0 = v_color_0;"] + [" attributes.color_0 = v_color_0;"], ); ShaderBuilderTester.expectHasVaryings(shaderBuilder, [ "vec4 v_color_0;", @@ -918,7 +930,7 @@ describe( ShaderBuilderTester.expectHasAttributes( shaderBuilder, "in vec3 a_positionMC;", - ["in vec4 a_color_0;"] + ["in vec4 a_color_0;"], ); verifyFeatureStruct(shaderBuilder); }); @@ -930,7 +942,7 @@ describe( GeometryPipelineStage.process( renderResources, customAttributePrimitive, - scene.frameState + scene.frameState, ); const shaderBuilder = renderResources.shaderBuilder; @@ -943,7 +955,7 @@ describe( expect(positionAttribute.vertexBuffer).toBeDefined(); expect(positionAttribute.componentsPerAttribute).toEqual(3); expect(positionAttribute.componentDatatype).toEqual( - ComponentDatatype.FLOAT + ComponentDatatype.FLOAT, ); expect(positionAttribute.offsetInBytes).toBe(0); expect(positionAttribute.strideInBytes).toBe(12); @@ -953,7 +965,7 @@ describe( expect(customAttribute.vertexBuffer).toBeDefined(); expect(customAttribute.componentsPerAttribute).toEqual(2); expect(customAttribute.componentDatatype).toEqual( - ComponentDatatype.UNSIGNED_SHORT + ComponentDatatype.UNSIGNED_SHORT, ); expect(customAttribute.offsetInBytes).toBe(0); expect(customAttribute.strideInBytes).toBe(4); @@ -962,7 +974,7 @@ describe( shaderBuilder, GeometryPipelineStage.STRUCT_ID_PROCESSED_ATTRIBUTES_VS, GeometryPipelineStage.STRUCT_NAME_PROCESSED_ATTRIBUTES, - [" vec3 positionMC;", " vec2 temperature;"] + [" vec3 positionMC;", " vec2 temperature;"], ); ShaderBuilderTester.expectHasFragmentStruct( shaderBuilder, @@ -973,7 +985,7 @@ describe( " vec3 positionWC;", " vec3 positionEC;", " vec2 temperature;", - ] + ], ); ShaderBuilderTester.expectHasVertexFunctionUnordered( shaderBuilder, @@ -982,19 +994,19 @@ describe( [ " attributes.positionMC = a_positionMC;", " attributes.temperature = a_temperature;", - ] + ], ); ShaderBuilderTester.expectHasVertexFunctionUnordered( shaderBuilder, GeometryPipelineStage.FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS, GeometryPipelineStage.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS, - [" v_temperature = attributes.temperature;"] + [" v_temperature = attributes.temperature;"], ); ShaderBuilderTester.expectHasFragmentFunctionUnordered( shaderBuilder, GeometryPipelineStage.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS, GeometryPipelineStage.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS, - [" attributes.temperature = v_temperature;"] + [" attributes.temperature = v_temperature;"], ); ShaderBuilderTester.expectHasVaryings(shaderBuilder, [ "vec2 v_temperature;", @@ -1005,7 +1017,7 @@ describe( ShaderBuilderTester.expectHasAttributes( shaderBuilder, "in vec3 a_positionMC;", - ["in vec2 a_temperature;"] + ["in vec2 a_temperature;"], ); verifyFeatureStruct(shaderBuilder); }); @@ -1019,7 +1031,7 @@ describe( GeometryPipelineStage.process( renderResources, primitive, - scene.frameState + scene.frameState, ); const shaderBuilder = renderResources.shaderBuilder; @@ -1032,7 +1044,7 @@ describe( expect(positionAttribute.vertexBuffer).toBeDefined(); expect(positionAttribute.componentsPerAttribute).toEqual(3); expect(positionAttribute.componentDatatype).toEqual( - ComponentDatatype.FLOAT + ComponentDatatype.FLOAT, ); expect(positionAttribute.offsetInBytes).toBe(0); expect(positionAttribute.strideInBytes).toBe(12); @@ -1042,7 +1054,7 @@ describe( expect(normalAttribute.vertexBuffer).toBeDefined(); expect(normalAttribute.componentsPerAttribute).toEqual(3); expect(normalAttribute.componentDatatype).toEqual( - ComponentDatatype.FLOAT + ComponentDatatype.FLOAT, ); expect(normalAttribute.offsetInBytes).toBe(0); expect(normalAttribute.strideInBytes).toBe(12); @@ -1052,7 +1064,7 @@ describe( expect(featureId0Attribute.vertexBuffer).toBeDefined(); expect(featureId0Attribute.componentsPerAttribute).toEqual(1); expect(featureId0Attribute.componentDatatype).toEqual( - ComponentDatatype.FLOAT + ComponentDatatype.FLOAT, ); expect(featureId0Attribute.offsetInBytes).toBe(0); expect(featureId0Attribute.strideInBytes).toBe(4); @@ -1065,7 +1077,7 @@ describe( " vec3 positionMC;", " vec3 normalMC;", " float featureId_0;", - ] + ], ); ShaderBuilderTester.expectHasFragmentStruct( shaderBuilder, @@ -1077,7 +1089,7 @@ describe( " vec3 positionEC;", " vec3 normalEC;", " float featureId_0;", - ] + ], ); ShaderBuilderTester.expectHasVertexFunctionUnordered( shaderBuilder, @@ -1087,12 +1099,12 @@ describe( " attributes.positionMC = a_positionMC;", " attributes.normalMC = a_normalMC;", " attributes.featureId_0 = a_featureId_0;", - ] + ], ); ShaderBuilderTester.expectHasAttributes( shaderBuilder, "in vec3 a_positionMC;", - ["in float a_featureId_0;", "in vec3 a_normalMC;"] + ["in float a_featureId_0;", "in vec3 a_normalMC;"], ); ShaderBuilderTester.expectHasVertexDefines(shaderBuilder, [ "HAS_FEATURE_ID_0", @@ -1115,7 +1127,7 @@ describe( GeometryPipelineStage.process( renderResources, primitive, - scene.frameState + scene.frameState, ); const shaderBuilder = renderResources.shaderBuilder; @@ -1128,7 +1140,7 @@ describe( expect(positionAttribute.vertexBuffer).toBeDefined(); expect(positionAttribute.componentsPerAttribute).toEqual(3); expect(positionAttribute.componentDatatype).toEqual( - ComponentDatatype.FLOAT + ComponentDatatype.FLOAT, ); expect(positionAttribute.offsetInBytes).toBe(0); expect(positionAttribute.strideInBytes).toBe(12); @@ -1138,7 +1150,7 @@ describe( expect(featureId0Attribute.vertexBuffer).toBeDefined(); expect(featureId0Attribute.componentsPerAttribute).toEqual(1); expect(featureId0Attribute.componentDatatype).toEqual( - ComponentDatatype.FLOAT + ComponentDatatype.FLOAT, ); expect(featureId0Attribute.offsetInBytes).toBe(0); expect(featureId0Attribute.strideInBytes).toBe(4); @@ -1147,7 +1159,7 @@ describe( shaderBuilder, GeometryPipelineStage.STRUCT_ID_PROCESSED_ATTRIBUTES_VS, GeometryPipelineStage.STRUCT_NAME_PROCESSED_ATTRIBUTES, - [" vec3 positionMC;", " float featureId_0;"] + [" vec3 positionMC;", " float featureId_0;"], ); ShaderBuilderTester.expectHasFragmentStruct( shaderBuilder, @@ -1158,7 +1170,7 @@ describe( " vec3 positionWC;", " vec3 positionEC;", " float featureId_0;", - ] + ], ); ShaderBuilderTester.expectHasVertexFunctionUnordered( shaderBuilder, @@ -1167,12 +1179,12 @@ describe( [ " attributes.positionMC = a_positionMC;", " attributes.featureId_0 = a_featureId_0;", - ] + ], ); ShaderBuilderTester.expectHasAttributes( shaderBuilder, "in vec3 a_positionMC;", - ["in float a_featureId_0;"] + ["in float a_featureId_0;"], ); ShaderBuilderTester.expectHasVertexDefines(shaderBuilder, [ "HAS_FEATURE_ID_0", @@ -1195,7 +1207,7 @@ describe( GeometryPipelineStage.process( renderResources, primitive, - scene.frameState + scene.frameState, ); const shaderBuilder = renderResources.shaderBuilder; @@ -1208,7 +1220,7 @@ describe( expect(normalAttribute.vertexBuffer).toBeDefined(); expect(normalAttribute.componentsPerAttribute).toEqual(2); expect(normalAttribute.componentDatatype).toEqual( - ComponentDatatype.UNSIGNED_SHORT + ComponentDatatype.UNSIGNED_SHORT, ); expect(normalAttribute.offsetInBytes).toBe(0); expect(normalAttribute.strideInBytes).not.toBeDefined(); @@ -1218,7 +1230,7 @@ describe( expect(positionAttribute.vertexBuffer).toBeDefined(); expect(positionAttribute.componentsPerAttribute).toEqual(3); expect(positionAttribute.componentDatatype).toEqual( - ComponentDatatype.UNSIGNED_SHORT + ComponentDatatype.UNSIGNED_SHORT, ); expect(positionAttribute.offsetInBytes).toBe(0); expect(positionAttribute.strideInBytes).not.toBeDefined(); @@ -1228,7 +1240,7 @@ describe( expect(texCoord0Attribute.vertexBuffer).toBeDefined(); expect(texCoord0Attribute.componentsPerAttribute).toEqual(2); expect(texCoord0Attribute.componentDatatype).toEqual( - ComponentDatatype.UNSIGNED_SHORT + ComponentDatatype.UNSIGNED_SHORT, ); expect(texCoord0Attribute.offsetInBytes).toBe(0); expect(texCoord0Attribute.strideInBytes).not.toBeDefined(); @@ -1237,7 +1249,11 @@ describe( shaderBuilder, GeometryPipelineStage.STRUCT_ID_PROCESSED_ATTRIBUTES_VS, GeometryPipelineStage.STRUCT_NAME_PROCESSED_ATTRIBUTES, - [" vec3 positionMC;", " vec3 normalMC;", " vec2 texCoord_0;"] + [ + " vec3 positionMC;", + " vec3 normalMC;", + " vec2 texCoord_0;", + ], ); ShaderBuilderTester.expectHasFragmentStruct( shaderBuilder, @@ -1249,19 +1265,19 @@ describe( " vec3 positionEC;", " vec3 normalEC;", " vec2 texCoord_0;", - ] + ], ); // Initialization is skipped for dequantized attributes ShaderBuilderTester.expectHasVertexFunctionUnordered( shaderBuilder, GeometryPipelineStage.FUNCTION_ID_INITIALIZE_ATTRIBUTES, GeometryPipelineStage.FUNCTION_SIGNATURE_INITIALIZE_ATTRIBUTES, - [] + [], ); ShaderBuilderTester.expectHasAttributes( shaderBuilder, "in vec3 a_quantized_positionMC;", - ["in vec2 a_quantized_normalMC;", "in vec2 a_quantized_texCoord_0;"] + ["in vec2 a_quantized_normalMC;", "in vec2 a_quantized_texCoord_0;"], ); ShaderBuilderTester.expectHasVertexDefines(shaderBuilder, [ "HAS_NORMALS", @@ -1285,7 +1301,7 @@ describe( GeometryPipelineStage.process( renderResources, primitive, - scene.frameState + scene.frameState, ); const shaderBuilder = renderResources.shaderBuilder; @@ -1298,7 +1314,7 @@ describe( expect(positionAttribute.vertexBuffer).toBeDefined(); expect(positionAttribute.componentsPerAttribute).toEqual(3); expect(positionAttribute.componentDatatype).toEqual( - ComponentDatatype.UNSIGNED_SHORT + ComponentDatatype.UNSIGNED_SHORT, ); expect(positionAttribute.offsetInBytes).toBe(0); expect(positionAttribute.strideInBytes).not.toBeDefined(); @@ -1308,7 +1324,7 @@ describe( expect(normalAttribute.vertexBuffer).toBeDefined(); expect(normalAttribute.componentsPerAttribute).toEqual(2); expect(normalAttribute.componentDatatype).toEqual( - ComponentDatatype.UNSIGNED_BYTE + ComponentDatatype.UNSIGNED_BYTE, ); expect(normalAttribute.offsetInBytes).toBe(0); expect(normalAttribute.strideInBytes).not.toBeDefined(); @@ -1318,7 +1334,7 @@ describe( expect(tangentAttribute.vertexBuffer).toBeDefined(); expect(tangentAttribute.componentsPerAttribute).toEqual(4); expect(tangentAttribute.componentDatatype).toEqual( - ComponentDatatype.FLOAT + ComponentDatatype.FLOAT, ); expect(normalAttribute.offsetInBytes).toBe(0); expect(normalAttribute.strideInBytes).not.toBeDefined(); @@ -1328,7 +1344,7 @@ describe( expect(texCoord0Attribute.vertexBuffer).toBeDefined(); expect(texCoord0Attribute.componentsPerAttribute).toEqual(2); expect(texCoord0Attribute.componentDatatype).toEqual( - ComponentDatatype.UNSIGNED_SHORT + ComponentDatatype.UNSIGNED_SHORT, ); expect(texCoord0Attribute.offsetInBytes).toBe(0); expect(texCoord0Attribute.strideInBytes).not.toBeDefined(); @@ -1344,7 +1360,7 @@ describe( " float tangentSignMC;", " vec3 bitangentMC;", " vec2 texCoord_0;", - ] + ], ); ShaderBuilderTester.expectHasFragmentStruct( shaderBuilder, @@ -1358,7 +1374,7 @@ describe( " vec3 tangentEC;", " vec3 bitangentEC;", " vec2 texCoord_0;", - ] + ], ); // Initialization is skipped for dequantized attributes ShaderBuilderTester.expectHasVertexFunctionUnordered( @@ -1368,7 +1384,7 @@ describe( [ " attributes.tangentMC = a_tangentMC.xyz;", " attributes.tangentSignMC = a_tangentMC.w;", - ] + ], ); ShaderBuilderTester.expectHasAttributes( shaderBuilder, @@ -1377,7 +1393,7 @@ describe( "in vec2 a_quantized_normalMC;", "in vec2 a_quantized_texCoord_0;", "in vec4 a_tangentMC;", - ] + ], ); ShaderBuilderTester.expectHasVertexDefines(shaderBuilder, [ "HAS_BITANGENTS", @@ -1406,7 +1422,7 @@ describe( GeometryPipelineStage.process( renderResources, primitive, - scene2D.frameState + scene2D.frameState, ); const shaderBuilder = renderResources.shaderBuilder; @@ -1419,7 +1435,7 @@ describe( expect(normalAttribute.vertexBuffer).toBeDefined(); expect(normalAttribute.componentsPerAttribute).toEqual(2); expect(normalAttribute.componentDatatype).toEqual( - ComponentDatatype.UNSIGNED_SHORT + ComponentDatatype.UNSIGNED_SHORT, ); expect(normalAttribute.offsetInBytes).toBe(0); expect(normalAttribute.strideInBytes).not.toBeDefined(); @@ -1429,7 +1445,7 @@ describe( expect(positionAttribute.vertexBuffer).toBeDefined(); expect(positionAttribute.componentsPerAttribute).toEqual(3); expect(positionAttribute.componentDatatype).toEqual( - ComponentDatatype.UNSIGNED_SHORT + ComponentDatatype.UNSIGNED_SHORT, ); expect(positionAttribute.offsetInBytes).toBe(0); expect(positionAttribute.strideInBytes).not.toBeDefined(); @@ -1439,7 +1455,7 @@ describe( expect(positionAttribute2D.vertexBuffer).toBeDefined(); expect(positionAttribute2D.componentsPerAttribute).toEqual(3); expect(positionAttribute2D.componentDatatype).toEqual( - ComponentDatatype.FLOAT + ComponentDatatype.FLOAT, ); expect(positionAttribute2D.offsetInBytes).toBe(0); expect(positionAttribute2D.strideInBytes).not.toBeDefined(); @@ -1449,7 +1465,7 @@ describe( expect(texCoord0Attribute.vertexBuffer).toBeDefined(); expect(texCoord0Attribute.componentsPerAttribute).toEqual(2); expect(texCoord0Attribute.componentDatatype).toEqual( - ComponentDatatype.UNSIGNED_SHORT + ComponentDatatype.UNSIGNED_SHORT, ); expect(texCoord0Attribute.offsetInBytes).toBe(0); expect(texCoord0Attribute.strideInBytes).not.toBeDefined(); @@ -1463,7 +1479,7 @@ describe( " vec3 position2D;", " vec3 normalMC;", " vec2 texCoord_0;", - ] + ], ); ShaderBuilderTester.expectHasFragmentStruct( shaderBuilder, @@ -1475,7 +1491,7 @@ describe( " vec3 positionEC;", " vec3 normalEC;", " vec2 texCoord_0;", - ] + ], ); // While initialization is skipped for dequantized attributes, @@ -1484,7 +1500,7 @@ describe( shaderBuilder, GeometryPipelineStage.FUNCTION_ID_INITIALIZE_ATTRIBUTES, GeometryPipelineStage.FUNCTION_SIGNATURE_INITIALIZE_ATTRIBUTES, - [" attributes.position2D = a_position2D;"] + [" attributes.position2D = a_position2D;"], ); ShaderBuilderTester.expectHasAttributes( shaderBuilder, @@ -1493,7 +1509,7 @@ describe( "in vec3 a_position2D;", "in vec2 a_quantized_normalMC;", "in vec2 a_quantized_texCoord_0;", - ] + ], ); ShaderBuilderTester.expectHasVertexDefines(shaderBuilder, [ "HAS_NORMALS", @@ -1507,171 +1523,171 @@ describe( }); it("processes model with matrix attributes", function () { - return loadGltf(boxTexturedWithPropertyAttributes).then(function ( - gltfLoader - ) { - const components = gltfLoader.components; - const primitive = components.nodes[1].primitives[0]; - const renderResources = mockRenderResources(primitive); - - GeometryPipelineStage.process( - renderResources, - primitive, - scene.frameState - ); - - const shaderBuilder = renderResources.shaderBuilder; - const attributes = renderResources.attributes; - - expect(attributes.length).toEqual(6); - - const normalAttribute = attributes[0]; - expect(normalAttribute.index).toEqual(1); - expect(normalAttribute.vertexBuffer).toBeDefined(); - expect(normalAttribute.componentsPerAttribute).toEqual(3); - expect(normalAttribute.componentDatatype).toEqual( - ComponentDatatype.FLOAT - ); - expect(normalAttribute.offsetInBytes).toBe(0); - expect(normalAttribute.strideInBytes).toBe(12); - - const positionAttribute = attributes[1]; - expect(positionAttribute.index).toEqual(0); - expect(positionAttribute.vertexBuffer).toBeDefined(); - expect(positionAttribute.componentsPerAttribute).toEqual(3); - expect(positionAttribute.componentDatatype).toEqual( - ComponentDatatype.FLOAT - ); - expect(positionAttribute.offsetInBytes).toBe(288); - expect(positionAttribute.strideInBytes).toBe(12); - - const texCoord0Attribute = attributes[2]; - expect(texCoord0Attribute.index).toEqual(2); - expect(texCoord0Attribute.vertexBuffer).toBeDefined(); - expect(texCoord0Attribute.componentsPerAttribute).toEqual(2); - expect(texCoord0Attribute.componentDatatype).toEqual( - ComponentDatatype.FLOAT - ); - expect(texCoord0Attribute.offsetInBytes).toBe(0); - expect(texCoord0Attribute.strideInBytes).toBe(8); - - const warpMatrixAttribute = attributes[3]; - expect(warpMatrixAttribute.index).toEqual(3); - expect(warpMatrixAttribute.vertexBuffer).toBeDefined(); - expect(warpMatrixAttribute.componentsPerAttribute).toEqual(2); - expect(warpMatrixAttribute.componentDatatype).toEqual( - ComponentDatatype.FLOAT - ); - expect(warpMatrixAttribute.offsetInBytes).toBe(0); - expect(warpMatrixAttribute.strideInBytes).toBe(16); - - const warpMatrixAttributePart2 = attributes[4]; - expect(warpMatrixAttributePart2.index).toEqual(4); - expect(warpMatrixAttributePart2.vertexBuffer).toBeDefined(); - expect(warpMatrixAttributePart2.componentsPerAttribute).toEqual(2); - expect(warpMatrixAttributePart2.componentDatatype).toEqual( - ComponentDatatype.FLOAT - ); - expect(warpMatrixAttributePart2.offsetInBytes).toBe(8); - expect(warpMatrixAttributePart2.strideInBytes).toBe(16); - - const temperaturesAttribute = attributes[5]; - expect(temperaturesAttribute.index).toEqual(5); - expect(temperaturesAttribute.vertexBuffer).toBeDefined(); - expect(temperaturesAttribute.componentsPerAttribute).toEqual(2); - expect(temperaturesAttribute.componentDatatype).toEqual( - ComponentDatatype.UNSIGNED_SHORT - ); - expect(temperaturesAttribute.offsetInBytes).toBe(0); - expect(temperaturesAttribute.strideInBytes).toBe(4); - - ShaderBuilderTester.expectHasVertexStruct( - shaderBuilder, - GeometryPipelineStage.STRUCT_ID_PROCESSED_ATTRIBUTES_VS, - GeometryPipelineStage.STRUCT_NAME_PROCESSED_ATTRIBUTES, - [ - " vec3 positionMC;", - " vec3 normalMC;", - " vec2 texCoord_0;", - " mat2 warp_matrix;", - " vec2 temperatures;", - ] - ); - ShaderBuilderTester.expectHasFragmentStruct( - shaderBuilder, - GeometryPipelineStage.STRUCT_ID_PROCESSED_ATTRIBUTES_FS, - GeometryPipelineStage.STRUCT_NAME_PROCESSED_ATTRIBUTES, - [ - " vec3 positionMC;", - " vec3 positionWC;", - " vec3 positionEC;", - " vec3 normalEC;", - " vec2 texCoord_0;", - " mat2 warp_matrix;", - " vec2 temperatures;", - ] - ); - ShaderBuilderTester.expectHasVertexFunctionUnordered( - shaderBuilder, - GeometryPipelineStage.FUNCTION_ID_INITIALIZE_ATTRIBUTES, - GeometryPipelineStage.FUNCTION_SIGNATURE_INITIALIZE_ATTRIBUTES, - [ - " attributes.positionMC = a_positionMC;", - " attributes.normalMC = a_normalMC;", - " attributes.texCoord_0 = a_texCoord_0;", - " attributes.warp_matrix = a_warp_matrix;", - " attributes.temperatures = a_temperatures;", - ] - ); - ShaderBuilderTester.expectHasVertexFunctionUnordered( - shaderBuilder, - GeometryPipelineStage.FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS, - GeometryPipelineStage.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS, - [ - " v_texCoord_0 = attributes.texCoord_0;", - " v_warp_matrix = attributes.warp_matrix;", - " v_temperatures = attributes.temperatures;", - ] - ); - ShaderBuilderTester.expectHasFragmentFunctionUnordered( - shaderBuilder, - GeometryPipelineStage.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS, - GeometryPipelineStage.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS, - [ - " attributes.texCoord_0 = v_texCoord_0;", - " attributes.warp_matrix = v_warp_matrix;", - " attributes.temperatures = v_temperatures;", - ] - ); - ShaderBuilderTester.expectHasVaryings(shaderBuilder, [ - "vec3 v_normalEC;", - "vec2 v_texCoord_0;", - "vec3 v_positionEC;", - "vec3 v_positionMC;", - "vec3 v_positionWC;", - "mat2 v_warp_matrix;", - "vec2 v_temperatures;", - ]); - ShaderBuilderTester.expectHasVertexDefines(shaderBuilder, [ - "HAS_NORMALS", - "HAS_TEXCOORD_0", - ]); - ShaderBuilderTester.expectHasFragmentDefines(shaderBuilder, [ - "HAS_NORMALS", - "HAS_TEXCOORD_0", - ]); - ShaderBuilderTester.expectHasAttributes( - shaderBuilder, - "in vec3 a_positionMC;", - [ - "in vec3 a_normalMC;", - "in vec2 a_texCoord_0;", - "in mat2 a_warp_matrix;", - "in vec2 a_temperatures;", - ] - ); - verifyFeatureStruct(shaderBuilder); - }); + return loadGltf(boxTexturedWithPropertyAttributes).then( + function (gltfLoader) { + const components = gltfLoader.components; + const primitive = components.nodes[1].primitives[0]; + const renderResources = mockRenderResources(primitive); + + GeometryPipelineStage.process( + renderResources, + primitive, + scene.frameState, + ); + + const shaderBuilder = renderResources.shaderBuilder; + const attributes = renderResources.attributes; + + expect(attributes.length).toEqual(6); + + const normalAttribute = attributes[0]; + expect(normalAttribute.index).toEqual(1); + expect(normalAttribute.vertexBuffer).toBeDefined(); + expect(normalAttribute.componentsPerAttribute).toEqual(3); + expect(normalAttribute.componentDatatype).toEqual( + ComponentDatatype.FLOAT, + ); + expect(normalAttribute.offsetInBytes).toBe(0); + expect(normalAttribute.strideInBytes).toBe(12); + + const positionAttribute = attributes[1]; + expect(positionAttribute.index).toEqual(0); + expect(positionAttribute.vertexBuffer).toBeDefined(); + expect(positionAttribute.componentsPerAttribute).toEqual(3); + expect(positionAttribute.componentDatatype).toEqual( + ComponentDatatype.FLOAT, + ); + expect(positionAttribute.offsetInBytes).toBe(288); + expect(positionAttribute.strideInBytes).toBe(12); + + const texCoord0Attribute = attributes[2]; + expect(texCoord0Attribute.index).toEqual(2); + expect(texCoord0Attribute.vertexBuffer).toBeDefined(); + expect(texCoord0Attribute.componentsPerAttribute).toEqual(2); + expect(texCoord0Attribute.componentDatatype).toEqual( + ComponentDatatype.FLOAT, + ); + expect(texCoord0Attribute.offsetInBytes).toBe(0); + expect(texCoord0Attribute.strideInBytes).toBe(8); + + const warpMatrixAttribute = attributes[3]; + expect(warpMatrixAttribute.index).toEqual(3); + expect(warpMatrixAttribute.vertexBuffer).toBeDefined(); + expect(warpMatrixAttribute.componentsPerAttribute).toEqual(2); + expect(warpMatrixAttribute.componentDatatype).toEqual( + ComponentDatatype.FLOAT, + ); + expect(warpMatrixAttribute.offsetInBytes).toBe(0); + expect(warpMatrixAttribute.strideInBytes).toBe(16); + + const warpMatrixAttributePart2 = attributes[4]; + expect(warpMatrixAttributePart2.index).toEqual(4); + expect(warpMatrixAttributePart2.vertexBuffer).toBeDefined(); + expect(warpMatrixAttributePart2.componentsPerAttribute).toEqual(2); + expect(warpMatrixAttributePart2.componentDatatype).toEqual( + ComponentDatatype.FLOAT, + ); + expect(warpMatrixAttributePart2.offsetInBytes).toBe(8); + expect(warpMatrixAttributePart2.strideInBytes).toBe(16); + + const temperaturesAttribute = attributes[5]; + expect(temperaturesAttribute.index).toEqual(5); + expect(temperaturesAttribute.vertexBuffer).toBeDefined(); + expect(temperaturesAttribute.componentsPerAttribute).toEqual(2); + expect(temperaturesAttribute.componentDatatype).toEqual( + ComponentDatatype.UNSIGNED_SHORT, + ); + expect(temperaturesAttribute.offsetInBytes).toBe(0); + expect(temperaturesAttribute.strideInBytes).toBe(4); + + ShaderBuilderTester.expectHasVertexStruct( + shaderBuilder, + GeometryPipelineStage.STRUCT_ID_PROCESSED_ATTRIBUTES_VS, + GeometryPipelineStage.STRUCT_NAME_PROCESSED_ATTRIBUTES, + [ + " vec3 positionMC;", + " vec3 normalMC;", + " vec2 texCoord_0;", + " mat2 warp_matrix;", + " vec2 temperatures;", + ], + ); + ShaderBuilderTester.expectHasFragmentStruct( + shaderBuilder, + GeometryPipelineStage.STRUCT_ID_PROCESSED_ATTRIBUTES_FS, + GeometryPipelineStage.STRUCT_NAME_PROCESSED_ATTRIBUTES, + [ + " vec3 positionMC;", + " vec3 positionWC;", + " vec3 positionEC;", + " vec3 normalEC;", + " vec2 texCoord_0;", + " mat2 warp_matrix;", + " vec2 temperatures;", + ], + ); + ShaderBuilderTester.expectHasVertexFunctionUnordered( + shaderBuilder, + GeometryPipelineStage.FUNCTION_ID_INITIALIZE_ATTRIBUTES, + GeometryPipelineStage.FUNCTION_SIGNATURE_INITIALIZE_ATTRIBUTES, + [ + " attributes.positionMC = a_positionMC;", + " attributes.normalMC = a_normalMC;", + " attributes.texCoord_0 = a_texCoord_0;", + " attributes.warp_matrix = a_warp_matrix;", + " attributes.temperatures = a_temperatures;", + ], + ); + ShaderBuilderTester.expectHasVertexFunctionUnordered( + shaderBuilder, + GeometryPipelineStage.FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS, + GeometryPipelineStage.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS, + [ + " v_texCoord_0 = attributes.texCoord_0;", + " v_warp_matrix = attributes.warp_matrix;", + " v_temperatures = attributes.temperatures;", + ], + ); + ShaderBuilderTester.expectHasFragmentFunctionUnordered( + shaderBuilder, + GeometryPipelineStage.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS, + GeometryPipelineStage.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS, + [ + " attributes.texCoord_0 = v_texCoord_0;", + " attributes.warp_matrix = v_warp_matrix;", + " attributes.temperatures = v_temperatures;", + ], + ); + ShaderBuilderTester.expectHasVaryings(shaderBuilder, [ + "vec3 v_normalEC;", + "vec2 v_texCoord_0;", + "vec3 v_positionEC;", + "vec3 v_positionMC;", + "vec3 v_positionWC;", + "mat2 v_warp_matrix;", + "vec2 v_temperatures;", + ]); + ShaderBuilderTester.expectHasVertexDefines(shaderBuilder, [ + "HAS_NORMALS", + "HAS_TEXCOORD_0", + ]); + ShaderBuilderTester.expectHasFragmentDefines(shaderBuilder, [ + "HAS_NORMALS", + "HAS_TEXCOORD_0", + ]); + ShaderBuilderTester.expectHasAttributes( + shaderBuilder, + "in vec3 a_positionMC;", + [ + "in vec3 a_normalMC;", + "in vec2 a_texCoord_0;", + "in mat2 a_warp_matrix;", + "in vec2 a_temperatures;", + ], + ); + verifyFeatureStruct(shaderBuilder); + }, + ); }); it("processes POSITION attribute for instanced model for 2D", function () { @@ -1687,7 +1703,7 @@ describe( GeometryPipelineStage.process( renderResources, primitive, - scene2D.frameState + scene2D.frameState, ); const shaderBuilder = renderResources.shaderBuilder; @@ -1703,7 +1719,7 @@ describe( expect(positionAttribute.vertexBuffer).toBeDefined(); expect(positionAttribute.componentsPerAttribute).toEqual(3); expect(positionAttribute.componentDatatype).toEqual( - ComponentDatatype.FLOAT + ComponentDatatype.FLOAT, ); expect(positionAttribute.offsetInBytes).toBe(0); expect(positionAttribute.strideInBytes).toBe(12); @@ -1714,7 +1730,11 @@ describe( shaderBuilder, GeometryPipelineStage.STRUCT_ID_PROCESSED_ATTRIBUTES_VS, GeometryPipelineStage.STRUCT_NAME_PROCESSED_ATTRIBUTES, - [" vec3 positionMC;", " vec3 position2D;", " vec3 normalMC;"] + [ + " vec3 positionMC;", + " vec3 position2D;", + " vec3 normalMC;", + ], ); ShaderBuilderTester.expectHasVertexFunctionUnordered( shaderBuilder, @@ -1723,7 +1743,7 @@ describe( [ " attributes.positionMC = a_positionMC;", " attributes.normalMC = a_normalMC;", - ] + ], ); ShaderBuilderTester.expectHasVertexDefines(shaderBuilder, [ "HAS_NORMALS", @@ -1731,11 +1751,11 @@ describe( ShaderBuilderTester.expectHasAttributes( shaderBuilder, "in vec3 a_positionMC;", - ["in vec3 a_normalMC;"] + ["in vec3 a_normalMC;"], ); verifyFeatureStruct(shaderBuilder); }); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/Model/I3dmLoaderSpec.js b/packages/engine/Specs/Scene/Model/I3dmLoaderSpec.js index a23fae09288c..7237c8ae1dc3 100644 --- a/packages/engine/Specs/Scene/Model/I3dmLoaderSpec.js +++ b/packages/engine/Specs/Scene/Model/I3dmLoaderSpec.js @@ -88,7 +88,7 @@ describe( async function expectLoadError(arrayBuffer) { const resource = Resource.createIfNeeded( - "http://example.com/content.i3dm" + "http://example.com/content.i3dm", ); const loader = new I3dmLoader({ i3dmResource: resource, @@ -99,7 +99,7 @@ describe( (async () => { await loader.load(); await waitForLoaderProcess(loader, scene); - })() + })(), ).toBeRejectedWithError(RuntimeError); } @@ -127,7 +127,7 @@ describe( for (let j = 0; j < attributesLength; j++) { const attribute = node.instances.attributes[j]; expect(expectedSemantics.indexOf(attribute.semantic) > -1).toEqual( - true + true, ); expect(attribute.count).toEqual(instancesLength); @@ -174,7 +174,7 @@ describe( InstanceAttributeSemantic.ROTATION, InstanceAttributeSemantic.FEATURE_ID, ], - 25 + 25, ); }); }); @@ -188,7 +188,7 @@ describe( InstanceAttributeSemantic.ROTATION, InstanceAttributeSemantic.FEATURE_ID, ], - 25 + 25, ); }); }); @@ -202,7 +202,7 @@ describe( InstanceAttributeSemantic.ROTATION, InstanceAttributeSemantic.FEATURE_ID, ], - 25 + 25, ); }); }); @@ -216,7 +216,7 @@ describe( InstanceAttributeSemantic.ROTATION, InstanceAttributeSemantic.FEATURE_ID, ], - 25 + 25, ); }); }); @@ -230,7 +230,7 @@ describe( InstanceAttributeSemantic.ROTATION, InstanceAttributeSemantic.FEATURE_ID, ], - 25 + 25, ); }); }); @@ -244,7 +244,7 @@ describe( InstanceAttributeSemantic.ROTATION, InstanceAttributeSemantic.FEATURE_ID, ], - 25 + 25, ); }); }); @@ -259,7 +259,7 @@ describe( InstanceAttributeSemantic.SCALE, InstanceAttributeSemantic.FEATURE_ID, ], - 25 + 25, ); }); }); @@ -274,7 +274,7 @@ describe( InstanceAttributeSemantic.SCALE, InstanceAttributeSemantic.FEATURE_ID, ], - 25 + 25, ); }); }); @@ -288,7 +288,7 @@ describe( InstanceAttributeSemantic.ROTATION, InstanceAttributeSemantic.FEATURE_ID, ], - 25 + 25, ); const transform = loader.components.transform; @@ -311,7 +311,7 @@ describe( InstanceAttributeSemantic.ROTATION, InstanceAttributeSemantic.FEATURE_ID, ], - 25 + 25, ); const transform = loader.components.transform; @@ -334,7 +334,7 @@ describe( InstanceAttributeSemantic.ROTATION, InstanceAttributeSemantic.FEATURE_ID, ], - 25 + 25, ); const transform = loader.components.transform; @@ -350,19 +350,19 @@ describe( }); it("loads InstancedQuantizedOct32POrientationUrl", function () { - return loadI3dm(instancedQuantizedOct32POrientationUrl).then(function ( - loader - ) { - verifyInstances( - loader, - [ - InstanceAttributeSemantic.TRANSLATION, - InstanceAttributeSemantic.ROTATION, - InstanceAttributeSemantic.FEATURE_ID, - ], - 25 - ); - }); + return loadI3dm(instancedQuantizedOct32POrientationUrl).then( + function (loader) { + verifyInstances( + loader, + [ + InstanceAttributeSemantic.TRANSLATION, + InstanceAttributeSemantic.ROTATION, + InstanceAttributeSemantic.FEATURE_ID, + ], + 25, + ); + }, + ); }); it("loads InstancedWithTransformUrl", function () { @@ -373,7 +373,7 @@ describe( InstanceAttributeSemantic.TRANSLATION, InstanceAttributeSemantic.FEATURE_ID, ], - 25 + 25, ); }); }); @@ -387,7 +387,7 @@ describe( InstanceAttributeSemantic.ROTATION, InstanceAttributeSemantic.FEATURE_ID, ], - 25 + 25, ); }); }); @@ -401,7 +401,7 @@ describe( InstanceAttributeSemantic.ROTATION, InstanceAttributeSemantic.FEATURE_ID, ], - 25 + 25, ); }); }); @@ -433,5 +433,5 @@ describe( await expectLoadError(arrayBuffer); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/Model/ImageBasedLightingPipelineStageSpec.js b/packages/engine/Specs/Scene/Model/ImageBasedLightingPipelineStageSpec.js index cc2c3bf9ce1f..9c3f32e422ed 100644 --- a/packages/engine/Specs/Scene/Model/ImageBasedLightingPipelineStageSpec.js +++ b/packages/engine/Specs/Scene/Model/ImageBasedLightingPipelineStageSpec.js @@ -35,7 +35,7 @@ describe("Scene/Model/ImageBasedLightingPipelineStage", function () { ImageBasedLightingPipelineStage.process( renderResources, mockModel, - mockFrameState + mockFrameState, ); ShaderBuilderTester.expectHasFragmentDefines(shaderBuilder, [ @@ -56,19 +56,19 @@ describe("Scene/Model/ImageBasedLightingPipelineStage", function () { expect( Cartesian2.equals( uniformMap.model_iblFactor(), - imageBasedLighting.imageBasedLightingFactor - ) + imageBasedLighting.imageBasedLightingFactor, + ), ).toBe(true); expect( Matrix3.equals( uniformMap.model_iblReferenceFrameMatrix(), - mockModel._iblReferenceFrameMatrix - ) + mockModel._iblReferenceFrameMatrix, + ), ).toBe(true); expect(uniformMap.model_luminanceAtZenith()).toEqual( - imageBasedLighting.luminanceAtZenith + imageBasedLighting.luminanceAtZenith, ); }); @@ -106,7 +106,7 @@ describe("Scene/Model/ImageBasedLightingPipelineStage", function () { ImageBasedLightingPipelineStage.process( renderResources, mockModel, - mockFrameState + mockFrameState, ); ShaderBuilderTester.expectHasFragmentDefines(shaderBuilder, [ @@ -124,19 +124,19 @@ describe("Scene/Model/ImageBasedLightingPipelineStage", function () { expect( Cartesian2.equals( uniformMap.model_iblFactor(), - imageBasedLighting.imageBasedLightingFactor - ) + imageBasedLighting.imageBasedLightingFactor, + ), ).toBe(true); expect( Matrix3.equals( uniformMap.model_iblReferenceFrameMatrix(), - mockModel._iblReferenceFrameMatrix - ) + mockModel._iblReferenceFrameMatrix, + ), ).toBe(true); expect(uniformMap.model_sphericalHarmonicCoefficients()).toBe( - testCoefficients + testCoefficients, ); }); @@ -169,7 +169,7 @@ describe("Scene/Model/ImageBasedLightingPipelineStage", function () { ImageBasedLightingPipelineStage.process( renderResources, mockModel, - mockFrameState + mockFrameState, ); ShaderBuilderTester.expectHasFragmentDefines(shaderBuilder, [ @@ -188,15 +188,15 @@ describe("Scene/Model/ImageBasedLightingPipelineStage", function () { expect( Cartesian2.equals( uniformMap.model_iblFactor(), - imageBasedLighting.imageBasedLightingFactor - ) + imageBasedLighting.imageBasedLightingFactor, + ), ).toBe(true); expect( Matrix3.equals( uniformMap.model_iblReferenceFrameMatrix(), - mockModel._iblReferenceFrameMatrix - ) + mockModel._iblReferenceFrameMatrix, + ), ).toBe(true); expect(uniformMap.model_specularEnvironmentMaps()).toBeDefined(); diff --git a/packages/engine/Specs/Scene/Model/InstancingPipelineStageSpec.js b/packages/engine/Specs/Scene/Model/InstancingPipelineStageSpec.js index bc739a877da7..73077d44a515 100644 --- a/packages/engine/Specs/Scene/Model/InstancingPipelineStageSpec.js +++ b/packages/engine/Specs/Scene/Model/InstancingPipelineStageSpec.js @@ -144,7 +144,7 @@ describe( async function loadI3dm(i3dmPath) { const arrayBuffer = await Resource.fetchArrayBuffer(i3dmPath); const i3dmLoader = new I3dmLoader( - getI3dmOptions(i3dmPath, { arrayBuffer: arrayBuffer }) + getI3dmOptions(i3dmPath, { arrayBuffer: arrayBuffer }), ); gltfLoaders.push(i3dmLoader); await i3dmLoader.load(); @@ -170,17 +170,17 @@ describe( InstancingPipelineStage.process( renderResources, node, - scene.frameState + scene.frameState, ); expect(renderResources.attributes.length).toBe(4); const runtimeNode = renderResources.runtimeNode; expect(runtimeNode.instancingTranslationMin).toEqual( - new Cartesian3(-2, -2, 0) + new Cartesian3(-2, -2, 0), ); expect(runtimeNode.instancingTranslationMax).toEqual( - new Cartesian3(2, 2, 0) + new Cartesian3(2, 2, 0), ); // Ensure that the max / min are only computed once by checking if @@ -188,56 +188,56 @@ describe( InstancingPipelineStage.process( renderResources, node, - scene.frameState + scene.frameState, ); expect(runtimeNode.instancingTranslationMin).toEqual( - new Cartesian3(-2, -2, 0) + new Cartesian3(-2, -2, 0), ); expect(runtimeNode.instancingTranslationMax).toEqual( - new Cartesian3(2, 2, 0) + new Cartesian3(2, 2, 0), ); }); }); it("sets instancing TRANSLATION min and max from attributes", function () { - return loadGltf(boxInstancedTranslationMinMax).then(function ( - gltfLoader - ) { - const components = gltfLoader.components; - const node = components.nodes[0]; - const renderResources = mockRenderResources(node); - - InstancingPipelineStage.process( - renderResources, - node, - scene.frameState - ); + return loadGltf(boxInstancedTranslationMinMax).then( + function (gltfLoader) { + const components = gltfLoader.components; + const node = components.nodes[0]; + const renderResources = mockRenderResources(node); + + InstancingPipelineStage.process( + renderResources, + node, + scene.frameState, + ); - expect(renderResources.attributes.length).toBe(1); + expect(renderResources.attributes.length).toBe(1); - const runtimeNode = renderResources.runtimeNode; - expect(runtimeNode.instancingTranslationMax).toEqual( - new Cartesian3(2, 2, 0) - ); - expect(runtimeNode.instancingTranslationMin).toEqual( - new Cartesian3(-2, -2, 0) - ); + const runtimeNode = renderResources.runtimeNode; + expect(runtimeNode.instancingTranslationMax).toEqual( + new Cartesian3(2, 2, 0), + ); + expect(runtimeNode.instancingTranslationMin).toEqual( + new Cartesian3(-2, -2, 0), + ); - // Ensure that the max / min are still defined after the stage is re-run. - InstancingPipelineStage.process( - renderResources, - node, - scene.frameState - ); + // Ensure that the max / min are still defined after the stage is re-run. + InstancingPipelineStage.process( + renderResources, + node, + scene.frameState, + ); - expect(runtimeNode.instancingTranslationMin).toEqual( - new Cartesian3(-2, -2, 0) - ); - expect(runtimeNode.instancingTranslationMax).toEqual( - new Cartesian3(2, 2, 0) - ); - }); + expect(runtimeNode.instancingTranslationMin).toEqual( + new Cartesian3(-2, -2, 0), + ); + expect(runtimeNode.instancingTranslationMax).toEqual( + new Cartesian3(2, 2, 0), + ); + }, + ); }); it("creates instancing matrices vertex attributes when ROTATION is present", function () { @@ -252,7 +252,7 @@ describe( InstancingPipelineStage.process( renderResources, node, - scene.frameState + scene.frameState, ); expect(renderResources.attributes.length).toBe(4); @@ -295,7 +295,7 @@ describe( InstancingPipelineStage.process( renderResources, node, - scene2D.frameState + scene2D.frameState, ); expect(renderResources.attributes.length).toBe(7); @@ -332,12 +332,12 @@ describe( const translationMatrix = Matrix4.fromTranslation( runtimeNode.instancingReferencePoint2D, - scratchMatrix4 + scratchMatrix4, ); const expectedMatrix = Matrix4.multiplyTransformation( scene2D.context.uniformState.view, translationMatrix, - scratchMatrix4 + scratchMatrix4, ); const uniformMap = renderResources.uniformMap; expect(uniformMap.u_modelView2D()).toEqual(expectedMatrix); @@ -357,71 +357,33 @@ describe( const renderResources = mockRenderResources(node); const expectedTransformsTypedArray = new Float32Array([ - 0.5999999642372131, - 0, - 0, - -2, - 0, - 0.4949747323989868, - -0.7071067094802856, - 2, - 0, - 0.49497467279434204, - 0.7071067690849304, - 0, - 0.7071068286895752, - 4.174155421310388e-8, - 0.3535534143447876, - -2, - 0.5, - 0.7071068286895752, - -0.2500000298023224, - -2, - -0.5000000596046448, - 0.7071068286895752, - 0.25, - 0, - 0.375, - -0.10000001639127731, - 0.3535534143447876, - 2, - 0.6401650905609131, - 0.029289301484823227, - -0.2500000298023224, - -2, - 0.10983504354953766, - 0.1707106977701187, - 0.25, - 0, - 0.4898979365825653, - -0.3674234449863434, - 0.44999992847442627, - 2, - 0.5277916193008423, - 0.028420301154255867, - -0.6749999523162842, - 2, - 0.3484765887260437, - 0.4734894633293152, - 0.3897113800048828, - 0, + 0.5999999642372131, 0, 0, -2, 0, 0.4949747323989868, + -0.7071067094802856, 2, 0, 0.49497467279434204, 0.7071067690849304, 0, + 0.7071068286895752, 4.174155421310388e-8, 0.3535534143447876, -2, 0.5, + 0.7071068286895752, -0.2500000298023224, -2, -0.5000000596046448, + 0.7071068286895752, 0.25, 0, 0.375, -0.10000001639127731, + 0.3535534143447876, 2, 0.6401650905609131, 0.029289301484823227, + -0.2500000298023224, -2, 0.10983504354953766, 0.1707106977701187, + 0.25, 0, 0.4898979365825653, -0.3674234449863434, 0.44999992847442627, + 2, 0.5277916193008423, 0.028420301154255867, -0.6749999523162842, 2, + 0.3484765887260437, 0.4734894633293152, 0.3897113800048828, 0, ]); - const transforms = InstancingPipelineStage._getInstanceTransformsAsMatrices( - node.instances, - node.instances.attributes[0].count, - renderResources - ); - const transformsTypedArray = InstancingPipelineStage._transformsToTypedArray( - transforms - ); + const transforms = + InstancingPipelineStage._getInstanceTransformsAsMatrices( + node.instances, + node.instances.attributes[0].count, + renderResources, + ); + const transformsTypedArray = + InstancingPipelineStage._transformsToTypedArray(transforms); expect(transformsTypedArray.length).toEqual( - expectedTransformsTypedArray.length + expectedTransformsTypedArray.length, ); for (let i = 0; i < expectedTransformsTypedArray.length; i++) { expect(transformsTypedArray[i]).toEqualEpsilon( expectedTransformsTypedArray[i], - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); } }); @@ -433,96 +395,85 @@ describe( return; } - return loadGltf(instancedWithNormalizedRotation).then(function ( - gltfLoader - ) { - const components = gltfLoader.components; - const node = components.nodes[0]; - const renderResources = mockRenderResources(node); - - // Check that the first two matrices are dequantized correctly. The - // first matrix is the identity matrix, and the second matrix has a - // slight translation, rotation and scale. - const secondMatrixComponents = [ - 1.1007905724243354, - 0.07140440309598281, - -0.1331359457080602, - 0, - -0.04344372372420601, - 1.0874251248973055, - 0.22401538735190446, - 0, - 0.1446942006095891, - -0.21672946758564085, - 1.0801183172918447, - 0, - 1.1111111640930176, - 1.1111111640930176, - 1.1111111640930176, - 1, - ]; - const expectedTransforms = [ - Matrix4.IDENTITY, - Matrix4.unpack(secondMatrixComponents), - ]; - - const transforms = InstancingPipelineStage._getInstanceTransformsAsMatrices( - node.instances, - node.instances.attributes[0].count, - renderResources - ); - - expect(transforms.length).toBe(10); - - const length = expectedTransforms.length; - for (let i = 0; i < length; i++) { - expect(transforms[i]).toEqualEpsilon( - expectedTransforms[i], - CesiumMath.EPSILON10 - ); - } - }); + return loadGltf(instancedWithNormalizedRotation).then( + function (gltfLoader) { + const components = gltfLoader.components; + const node = components.nodes[0]; + const renderResources = mockRenderResources(node); + + // Check that the first two matrices are dequantized correctly. The + // first matrix is the identity matrix, and the second matrix has a + // slight translation, rotation and scale. + const secondMatrixComponents = [ + 1.1007905724243354, 0.07140440309598281, -0.1331359457080602, 0, + -0.04344372372420601, 1.0874251248973055, 0.22401538735190446, 0, + 0.1446942006095891, -0.21672946758564085, 1.0801183172918447, 0, + 1.1111111640930176, 1.1111111640930176, 1.1111111640930176, 1, + ]; + const expectedTransforms = [ + Matrix4.IDENTITY, + Matrix4.unpack(secondMatrixComponents), + ]; + + const transforms = + InstancingPipelineStage._getInstanceTransformsAsMatrices( + node.instances, + node.instances.attributes[0].count, + renderResources, + ); + + expect(transforms.length).toBe(10); + + const length = expectedTransforms.length; + for (let i = 0; i < length; i++) { + expect(transforms[i]).toEqualEpsilon( + expectedTransforms[i], + CesiumMath.EPSILON10, + ); + } + }, + ); }); it("creates TRANSLATION vertex attributes with min/max present", function () { - return loadGltf(boxInstancedTranslationMinMax).then(function ( - gltfLoader - ) { - const components = gltfLoader.components; - const node = components.nodes[0]; - const renderResources = mockRenderResources(node); - - scene.renderForSpecs(); - InstancingPipelineStage.process( - renderResources, - node, - scene.frameState - ); - - expect(renderResources.attributes.length).toBe(1); - - const shaderBuilder = renderResources.shaderBuilder; - ShaderBuilderTester.expectHasVertexDefines(shaderBuilder, [ - "HAS_INSTANCING", - "HAS_INSTANCE_TRANSLATION", - ]); - ShaderBuilderTester.expectHasFragmentDefines(shaderBuilder, [ - "HAS_INSTANCING", - "HAS_INSTANCE_TRANSLATION", - ]); - - ShaderBuilderTester.expectHasAttributes(shaderBuilder, undefined, [ - "in vec3 a_instanceTranslation;", - ]); - - // No additional buffer was created. - expect(renderResources.model._pipelineResources.length).toEqual(0); - expect(renderResources.model._modelResources.length).toEqual(0); + return loadGltf(boxInstancedTranslationMinMax).then( + function (gltfLoader) { + const components = gltfLoader.components; + const node = components.nodes[0]; + const renderResources = mockRenderResources(node); + + scene.renderForSpecs(); + InstancingPipelineStage.process( + renderResources, + node, + scene.frameState, + ); - // Attributes with buffers already loaded in will be counted - // in NodeStatisticsPipelineStage. - expect(renderResources.model.statistics.geometryByteLength).toBe(0); - }); + expect(renderResources.attributes.length).toBe(1); + + const shaderBuilder = renderResources.shaderBuilder; + ShaderBuilderTester.expectHasVertexDefines(shaderBuilder, [ + "HAS_INSTANCING", + "HAS_INSTANCE_TRANSLATION", + ]); + ShaderBuilderTester.expectHasFragmentDefines(shaderBuilder, [ + "HAS_INSTANCING", + "HAS_INSTANCE_TRANSLATION", + ]); + + ShaderBuilderTester.expectHasAttributes(shaderBuilder, undefined, [ + "in vec3 a_instanceTranslation;", + ]); + + // No additional buffer was created. + expect(renderResources.model._pipelineResources.length).toEqual(0); + expect(renderResources.model._modelResources.length).toEqual(0); + + // Attributes with buffers already loaded in will be counted + // in NodeStatisticsPipelineStage. + expect(renderResources.model.statistics.geometryByteLength).toBe(0); + }, + ); }); it("creates TRANSLATION vertex attributes without min/max present", function () { @@ -536,14 +487,14 @@ describe( InstancingPipelineStage.process( renderResources, node, - scene.frameState + scene.frameState, ); expect(renderResources.attributes.length).toBe(1); const translationAttribute = ModelUtility.getAttributeBySemantic( instances, - InstanceAttributeSemantic.TRANSLATION + InstanceAttributeSemantic.TRANSLATION, ); // Expect the typed array to be unloaded. expect(translationAttribute.typedArray).toBeUndefined(); @@ -591,14 +542,14 @@ describe( InstancingPipelineStage.process( renderResources, node, - scene2D.frameState + scene2D.frameState, ); expect(renderResources.attributes.length).toBe(2); const translationAttribute = ModelUtility.getAttributeBySemantic( instances, - InstanceAttributeSemantic.TRANSLATION + InstanceAttributeSemantic.TRANSLATION, ); // Expect the typed array to be unloaded. expect(translationAttribute.typedArray).toBeUndefined(); @@ -627,12 +578,12 @@ describe( const translationMatrix = Matrix4.fromTranslation( runtimeNode.instancingReferencePoint2D, - scratchMatrix4 + scratchMatrix4, ); const expectedMatrix = Matrix4.multiplyTransformation( scene2D.context.uniformState.view, translationMatrix, - scratchMatrix4 + scratchMatrix4, ); const uniformMap = renderResources.uniformMap; expect(uniformMap.u_modelView2D()).toEqual(expectedMatrix); @@ -662,14 +613,14 @@ describe( axisCorrectionMatrix: ModelUtility.getAxisCorrectionMatrix( Axis.Y, Axis.Z, - new Matrix4() + new Matrix4(), ), }, }, uniformMap: {}, runtimeNode: { computedTransform: Matrix4.fromTranslation( - new Cartesian3(0.0, 2.0, 0.0) + new Cartesian3(0.0, 2.0, 0.0), ), }, }; @@ -690,7 +641,7 @@ describe( InstancingPipelineStage.process( renderResources, node, - scene.frameState + scene.frameState, ); ShaderBuilderTester.expectHasVertexDefines(shaderBuilder, [ @@ -722,18 +673,18 @@ describe( let expectedModelView = Matrix4.multiplyTransformation( view, modelMatrix, - new Matrix4() + new Matrix4(), ); expectedModelView = Matrix4.multiplyTransformation( expectedModelView, rtcTransform, - expectedModelView + expectedModelView, ); const uniformMap = renderResources.uniformMap; expect(uniformMap.u_instance_modifiedModelView()).toEqualEpsilon( expectedModelView, - CesiumMath.EPSILON8 + CesiumMath.EPSILON8, ); // The second part of the matrix. @@ -744,11 +695,11 @@ describe( const expectedNodeTransform = Matrix4.multiplyTransformation( axisCorrection, computedTransform, - new Matrix4() + new Matrix4(), ); expect(uniformMap.u_instance_nodeTransform()).toEqualEpsilon( expectedNodeTransform, - CesiumMath.EPSILON8 + CesiumMath.EPSILON8, ); // The matrix transforms buffer will be counted by NodeStatisticsPipelineStage. @@ -756,5 +707,5 @@ describe( }); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/Model/MaterialPipelineStageSpec.js b/packages/engine/Specs/Scene/Model/MaterialPipelineStageSpec.js index f7dd44fefae7..128eef15b282 100644 --- a/packages/engine/Specs/Scene/Model/MaterialPipelineStageSpec.js +++ b/packages/engine/Specs/Scene/Model/MaterialPipelineStageSpec.js @@ -251,7 +251,7 @@ describe( const material = primitive.material; material.emissiveFactor = Cartesian3.clone( - ModelComponents.Material.DEFAULT_EMISSIVE_FACTOR + ModelComponents.Material.DEFAULT_EMISSIVE_FACTOR, ); const metallicRoughness = material.metallicRoughness; @@ -471,15 +471,12 @@ describe( "USE_METALLIC_ROUGHNESS", ]); - const { - anisotropyStrength, - anisotropyRotation, - anisotropyTexture, - } = primitive.material.anisotropy; + const { anisotropyStrength, anisotropyRotation, anisotropyTexture } = + primitive.material.anisotropy; const expectedAnisotropy = Cartesian3.fromElements( Math.cos(anisotropyRotation), Math.sin(anisotropyRotation), - anisotropyStrength + anisotropyStrength, ); const expectedUniforms = { u_anisotropy: expectedAnisotropy, @@ -835,7 +832,7 @@ describe( uniformMap, textureReader, "u_testTexture", - "TEST" + "TEST", ); ShaderBuilderTester.expectHasVertexDefines(shaderBuilder, []); @@ -867,7 +864,7 @@ describe( textureReader, "u_testTexture", "TEST", - mockFrameState.context.defaultTexture + mockFrameState.context.defaultTexture, ); ShaderBuilderTester.expectHasVertexDefines(shaderBuilder, []); @@ -902,7 +899,7 @@ describe( textureReader, "u_testTexture", "TEST", - mockFrameState.context.defaultTexture + mockFrameState.context.defaultTexture, ); expectUniformMap(uniformMap, { @@ -910,5 +907,5 @@ describe( }); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/Model/MetadataPipelineStageSpec.js b/packages/engine/Specs/Scene/Model/MetadataPipelineStageSpec.js index 8600d2edef03..a873646d0dab 100644 --- a/packages/engine/Specs/Scene/Model/MetadataPipelineStageSpec.js +++ b/packages/engine/Specs/Scene/Model/MetadataPipelineStageSpec.js @@ -95,13 +95,13 @@ describe( shaderBuilder, structName, structName, - structFields + structFields, ); ShaderBuilderTester.expectHasFragmentStruct( shaderBuilder, structName, structName, - structFields + structFields, ); } } @@ -121,31 +121,31 @@ describe( shaderBuilder, MetadataPipelineStage.STRUCT_ID_METADATA_VS, MetadataPipelineStage.STRUCT_NAME_METADATA, - [] + [], ); ShaderBuilderTester.expectHasFragmentStruct( shaderBuilder, MetadataPipelineStage.STRUCT_ID_METADATA_FS, MetadataPipelineStage.STRUCT_NAME_METADATA, - [] + [], ); ShaderBuilderTester.expectHasVertexFunctionUnordered( shaderBuilder, MetadataPipelineStage.FUNCTION_ID_INITIALIZE_METADATA_VS, MetadataPipelineStage.FUNCTION_SIGNATURE_INITIALIZE_METADATA, - [] + [], ); ShaderBuilderTester.expectHasFragmentFunctionUnordered( shaderBuilder, MetadataPipelineStage.FUNCTION_ID_INITIALIZE_METADATA_FS, MetadataPipelineStage.FUNCTION_SIGNATURE_INITIALIZE_METADATA, - [] + [], ); ShaderBuilderTester.expectHasVertexFunctionUnordered( shaderBuilder, MetadataPipelineStage.FUNCTION_ID_SET_METADATA_VARYINGS, MetadataPipelineStage.FUNCTION_SIGNATURE_SET_METADATA_VARYINGS, - [] + [], ); ShaderBuilderTester.expectHasVertexUniforms(shaderBuilder, []); ShaderBuilderTester.expectHasFragmentUniforms(shaderBuilder, []); @@ -155,120 +155,120 @@ describe( }); it("Adds property attributes to the shader", function () { - return loadGltf(pointCloudWithPropertyAttributes).then(function ( - gltfLoader - ) { - const components = gltfLoader.components; - const node = components.nodes[0]; - const primitive = node.primitives[0]; - const frameState = scene.frameState; - const renderResources = mockRenderResources(components); - - MetadataPipelineStage.process(renderResources, primitive, frameState); - - const shaderBuilder = renderResources.shaderBuilder; - - const metadataTypes = ["float"]; - checkMetadataClassStructs(shaderBuilder, metadataTypes); - - ShaderBuilderTester.expectHasVertexStruct( - shaderBuilder, - MetadataPipelineStage.STRUCT_ID_METADATA_VS, - MetadataPipelineStage.STRUCT_NAME_METADATA, - [ - " float circleT;", - " float iteration;", - " float pointId;", - " float toroidalNormalized;", - " float poloidalNormalized;", - " float toroidalAngle;", - " float poloidalAngle;", - ] - ); - ShaderBuilderTester.expectHasFragmentStruct( - shaderBuilder, - MetadataPipelineStage.STRUCT_ID_METADATA_FS, - MetadataPipelineStage.STRUCT_NAME_METADATA, - [ - " float circleT;", - " float iteration;", - " float pointId;", - " float toroidalNormalized;", - " float poloidalNormalized;", - " float toroidalAngle;", - " float poloidalAngle;", - ] - ); - ShaderBuilderTester.expectHasVertexFunctionUnordered( - shaderBuilder, - MetadataPipelineStage.FUNCTION_ID_INITIALIZE_METADATA_VS, - MetadataPipelineStage.FUNCTION_SIGNATURE_INITIALIZE_METADATA, - [ - " metadata.circleT = attributes.circle_t;", - " metadata.iteration = attributes.featureId_0;", - " metadata.pointId = attributes.featureId_1;", - " metadata.toroidalNormalized = czm_valueTransform(u_toroidalNormalized_offset, u_toroidalNormalized_scale, attributes.featureId_0);", - " metadata.poloidalNormalized = czm_valueTransform(u_poloidalNormalized_offset, u_poloidalNormalized_scale, attributes.featureId_1);", - " metadata.toroidalAngle = czm_valueTransform(u_toroidalAngle_offset, u_toroidalAngle_scale, attributes.featureId_0);", - " metadata.poloidalAngle = czm_valueTransform(u_poloidalAngle_offset, u_poloidalAngle_scale, attributes.featureId_1);", - ] - ); - ShaderBuilderTester.expectHasFragmentFunctionUnordered( - shaderBuilder, - MetadataPipelineStage.FUNCTION_ID_INITIALIZE_METADATA_FS, - MetadataPipelineStage.FUNCTION_SIGNATURE_INITIALIZE_METADATA, - [ - " metadata.circleT = attributes.circle_t;", - " metadata.iteration = attributes.featureId_0;", - " metadata.pointId = attributes.featureId_1;", - " metadata.toroidalNormalized = czm_valueTransform(u_toroidalNormalized_offset, u_toroidalNormalized_scale, attributes.featureId_0);", - " metadata.poloidalNormalized = czm_valueTransform(u_poloidalNormalized_offset, u_poloidalNormalized_scale, attributes.featureId_1);", - " metadata.toroidalAngle = czm_valueTransform(u_toroidalAngle_offset, u_toroidalAngle_scale, attributes.featureId_0);", - " metadata.poloidalAngle = czm_valueTransform(u_poloidalAngle_offset, u_poloidalAngle_scale, attributes.featureId_1);", - ] - ); - ShaderBuilderTester.expectHasVertexFunctionUnordered( - shaderBuilder, - MetadataPipelineStage.FUNCTION_ID_SET_METADATA_VARYINGS, - MetadataPipelineStage.FUNCTION_SIGNATURE_SET_METADATA_VARYINGS, - [] - ); - ShaderBuilderTester.expectHasVertexUniforms(shaderBuilder, [ - "uniform float u_toroidalNormalized_offset;", - "uniform float u_toroidalNormalized_scale;", - "uniform float u_poloidalNormalized_offset;", - "uniform float u_poloidalNormalized_scale;", - "uniform float u_toroidalAngle_offset;", - "uniform float u_toroidalAngle_scale;", - "uniform float u_poloidalAngle_offset;", - "uniform float u_poloidalAngle_scale;", - ]); - ShaderBuilderTester.expectHasFragmentUniforms(shaderBuilder, [ - "uniform float u_toroidalNormalized_offset;", - "uniform float u_toroidalNormalized_scale;", - "uniform float u_poloidalNormalized_offset;", - "uniform float u_poloidalNormalized_scale;", - "uniform float u_toroidalAngle_offset;", - "uniform float u_toroidalAngle_scale;", - "uniform float u_poloidalAngle_offset;", - "uniform float u_poloidalAngle_scale;", - ]); - - // The offsets and scales should be exactly as they appear in the glTF - const uniformMap = renderResources.uniformMap; - expect(uniformMap.u_toroidalNormalized_offset()).toBe(0); - expect(uniformMap.u_toroidalNormalized_scale()).toBe( - 0.034482758620689655 - ); - expect(uniformMap.u_poloidalNormalized_offset()).toBe(0); - expect(uniformMap.u_poloidalNormalized_scale()).toBe( - 0.05263157894736842 - ); - expect(uniformMap.u_toroidalAngle_offset()).toBe(0); - expect(uniformMap.u_toroidalAngle_scale()).toBe(0.21666156231653746); - expect(uniformMap.u_poloidalAngle_offset()).toBe(-3.141592653589793); - expect(uniformMap.u_poloidalAngle_scale()).toBe(0.3306939635357677); - }); + return loadGltf(pointCloudWithPropertyAttributes).then( + function (gltfLoader) { + const components = gltfLoader.components; + const node = components.nodes[0]; + const primitive = node.primitives[0]; + const frameState = scene.frameState; + const renderResources = mockRenderResources(components); + + MetadataPipelineStage.process(renderResources, primitive, frameState); + + const shaderBuilder = renderResources.shaderBuilder; + + const metadataTypes = ["float"]; + checkMetadataClassStructs(shaderBuilder, metadataTypes); + + ShaderBuilderTester.expectHasVertexStruct( + shaderBuilder, + MetadataPipelineStage.STRUCT_ID_METADATA_VS, + MetadataPipelineStage.STRUCT_NAME_METADATA, + [ + " float circleT;", + " float iteration;", + " float pointId;", + " float toroidalNormalized;", + " float poloidalNormalized;", + " float toroidalAngle;", + " float poloidalAngle;", + ], + ); + ShaderBuilderTester.expectHasFragmentStruct( + shaderBuilder, + MetadataPipelineStage.STRUCT_ID_METADATA_FS, + MetadataPipelineStage.STRUCT_NAME_METADATA, + [ + " float circleT;", + " float iteration;", + " float pointId;", + " float toroidalNormalized;", + " float poloidalNormalized;", + " float toroidalAngle;", + " float poloidalAngle;", + ], + ); + ShaderBuilderTester.expectHasVertexFunctionUnordered( + shaderBuilder, + MetadataPipelineStage.FUNCTION_ID_INITIALIZE_METADATA_VS, + MetadataPipelineStage.FUNCTION_SIGNATURE_INITIALIZE_METADATA, + [ + " metadata.circleT = attributes.circle_t;", + " metadata.iteration = attributes.featureId_0;", + " metadata.pointId = attributes.featureId_1;", + " metadata.toroidalNormalized = czm_valueTransform(u_toroidalNormalized_offset, u_toroidalNormalized_scale, attributes.featureId_0);", + " metadata.poloidalNormalized = czm_valueTransform(u_poloidalNormalized_offset, u_poloidalNormalized_scale, attributes.featureId_1);", + " metadata.toroidalAngle = czm_valueTransform(u_toroidalAngle_offset, u_toroidalAngle_scale, attributes.featureId_0);", + " metadata.poloidalAngle = czm_valueTransform(u_poloidalAngle_offset, u_poloidalAngle_scale, attributes.featureId_1);", + ], + ); + ShaderBuilderTester.expectHasFragmentFunctionUnordered( + shaderBuilder, + MetadataPipelineStage.FUNCTION_ID_INITIALIZE_METADATA_FS, + MetadataPipelineStage.FUNCTION_SIGNATURE_INITIALIZE_METADATA, + [ + " metadata.circleT = attributes.circle_t;", + " metadata.iteration = attributes.featureId_0;", + " metadata.pointId = attributes.featureId_1;", + " metadata.toroidalNormalized = czm_valueTransform(u_toroidalNormalized_offset, u_toroidalNormalized_scale, attributes.featureId_0);", + " metadata.poloidalNormalized = czm_valueTransform(u_poloidalNormalized_offset, u_poloidalNormalized_scale, attributes.featureId_1);", + " metadata.toroidalAngle = czm_valueTransform(u_toroidalAngle_offset, u_toroidalAngle_scale, attributes.featureId_0);", + " metadata.poloidalAngle = czm_valueTransform(u_poloidalAngle_offset, u_poloidalAngle_scale, attributes.featureId_1);", + ], + ); + ShaderBuilderTester.expectHasVertexFunctionUnordered( + shaderBuilder, + MetadataPipelineStage.FUNCTION_ID_SET_METADATA_VARYINGS, + MetadataPipelineStage.FUNCTION_SIGNATURE_SET_METADATA_VARYINGS, + [], + ); + ShaderBuilderTester.expectHasVertexUniforms(shaderBuilder, [ + "uniform float u_toroidalNormalized_offset;", + "uniform float u_toroidalNormalized_scale;", + "uniform float u_poloidalNormalized_offset;", + "uniform float u_poloidalNormalized_scale;", + "uniform float u_toroidalAngle_offset;", + "uniform float u_toroidalAngle_scale;", + "uniform float u_poloidalAngle_offset;", + "uniform float u_poloidalAngle_scale;", + ]); + ShaderBuilderTester.expectHasFragmentUniforms(shaderBuilder, [ + "uniform float u_toroidalNormalized_offset;", + "uniform float u_toroidalNormalized_scale;", + "uniform float u_poloidalNormalized_offset;", + "uniform float u_poloidalNormalized_scale;", + "uniform float u_toroidalAngle_offset;", + "uniform float u_toroidalAngle_scale;", + "uniform float u_poloidalAngle_offset;", + "uniform float u_poloidalAngle_scale;", + ]); + + // The offsets and scales should be exactly as they appear in the glTF + const uniformMap = renderResources.uniformMap; + expect(uniformMap.u_toroidalNormalized_offset()).toBe(0); + expect(uniformMap.u_toroidalNormalized_scale()).toBe( + 0.034482758620689655, + ); + expect(uniformMap.u_poloidalNormalized_offset()).toBe(0); + expect(uniformMap.u_poloidalNormalized_scale()).toBe( + 0.05263157894736842, + ); + expect(uniformMap.u_toroidalAngle_offset()).toBe(0); + expect(uniformMap.u_toroidalAngle_scale()).toBe(0.21666156231653746); + expect(uniformMap.u_poloidalAngle_offset()).toBe(-3.141592653589793); + expect(uniformMap.u_poloidalAngle_scale()).toBe(0.3306939635357677); + }, + ); }); it("Adds property textures to the shader", function () { @@ -290,7 +290,7 @@ describe( shaderBuilder, MetadataPipelineStage.STRUCT_ID_METADATA_VS, MetadataPipelineStage.STRUCT_NAME_METADATA, - [] + [], ); ShaderBuilderTester.expectHasFragmentStruct( shaderBuilder, @@ -300,13 +300,13 @@ describe( " float insulation;", " int insideTemperature;", " int outsideTemperature;", - ] + ], ); ShaderBuilderTester.expectHasVertexFunctionUnordered( shaderBuilder, MetadataPipelineStage.FUNCTION_ID_INITIALIZE_METADATA_VS, MetadataPipelineStage.FUNCTION_SIGNATURE_INITIALIZE_METADATA, - [] + [], ); ShaderBuilderTester.expectHasFragmentFunctionUnordered( shaderBuilder, @@ -317,13 +317,13 @@ describe( " metadata.insideTemperature = int(255.0 * texture(u_propertyTexture_1, attributes.texCoord_0).r);", " metadata.outsideTemperature = int(255.0 * texture(u_propertyTexture_1, attributes.texCoord_0).g);", " metadataClass.insulation.defaultValue = float(1);", - ] + ], ); ShaderBuilderTester.expectHasVertexFunctionUnordered( shaderBuilder, MetadataPipelineStage.FUNCTION_ID_SET_METADATA_VARYINGS, MetadataPipelineStage.FUNCTION_SIGNATURE_SET_METADATA_VARYINGS, - [] + [], ); ShaderBuilderTester.expectHasVertexUniforms(shaderBuilder, []); ShaderBuilderTester.expectHasFragmentUniforms(shaderBuilder, [ @@ -337,7 +337,7 @@ describe( const uniformMap = renderResources.uniformMap; expect(uniformMap.u_propertyTexture_1()).toBe( - texture1.textureReader.texture + texture1.textureReader.texture, ); }); }); @@ -361,25 +361,25 @@ describe( shaderBuilder, MetadataPipelineStage.STRUCT_ID_METADATA_VS, MetadataPipelineStage.STRUCT_NAME_METADATA, - [] + [], ); ShaderBuilderTester.expectHasFragmentStruct( shaderBuilder, MetadataPipelineStage.STRUCT_ID_METADATA_FS, MetadataPipelineStage.STRUCT_NAME_METADATA, - [" float exampleProperty;"] + [" float exampleProperty;"], ); ShaderBuilderTester.expectHasVertexFunctionUnordered( shaderBuilder, MetadataPipelineStage.FUNCTION_ID_INITIALIZE_METADATA_VS, MetadataPipelineStage.FUNCTION_SIGNATURE_INITIALIZE_METADATA, - [] + [], ); ShaderBuilderTester.expectHasVertexFunctionUnordered( shaderBuilder, MetadataPipelineStage.FUNCTION_ID_SET_METADATA_VARYINGS, MetadataPipelineStage.FUNCTION_SIGNATURE_SET_METADATA_VARYINGS, - [] + [], ); ShaderBuilderTester.expectHasVertexUniforms(shaderBuilder, []); ShaderBuilderTester.expectHasFragmentUniforms(shaderBuilder, [ @@ -394,115 +394,115 @@ describe( const uniformMap = renderResources.uniformMap; expect(uniformMap.u_propertyTexture_0()).toBe( - texture1.textureReader.texture + texture1.textureReader.texture, ); }); it("Handles property textures with vector values", function () { - return loadGltf(propertyTextureWithVectorProperties).then(function ( - gltfLoader - ) { - const components = gltfLoader.components; - const node = components.nodes[0]; - const primitive = node.primitives[0]; - const frameState = scene.frameState; - const renderResources = mockRenderResources(components); - - MetadataPipelineStage.process(renderResources, primitive, frameState); - - const shaderBuilder = renderResources.shaderBuilder; - - const metadataTypes = ["vec2", "int", "ivec3", "vec3"]; - checkMetadataClassStructs(shaderBuilder, metadataTypes); - - ShaderBuilderTester.expectHasVertexStruct( - shaderBuilder, - MetadataPipelineStage.STRUCT_ID_METADATA_VS, - MetadataPipelineStage.STRUCT_NAME_METADATA, - [] - ); - ShaderBuilderTester.expectHasFragmentStruct( - shaderBuilder, - MetadataPipelineStage.STRUCT_ID_METADATA_FS, - MetadataPipelineStage.STRUCT_NAME_METADATA, - [ - " vec2 vec2Property;", - " int uint8Property;", - " ivec3 uint8vec3Property;", - " vec3 arrayProperty;", - " vec2 valueTransformProperty;", - ] - ); - - // Check for the MetadataClass struct, containing the specific fields - // required by this test dataset - ShaderBuilderTester.expectHasFragmentStruct( - shaderBuilder, - MetadataPipelineStage.STRUCT_ID_METADATA_CLASS_FS, - MetadataPipelineStage.STRUCT_NAME_METADATA_CLASS, - [ - " vec2MetadataClass vec2Property;", - " intMetadataClass uint8Property;", - " ivec3MetadataClass uint8vec3Property;", - " vec3MetadataClass arrayProperty;", - " vec2MetadataClass valueTransformProperty;", - ] - ); - - ShaderBuilderTester.expectHasVertexFunctionUnordered( - shaderBuilder, - MetadataPipelineStage.FUNCTION_ID_INITIALIZE_METADATA_VS, - MetadataPipelineStage.FUNCTION_SIGNATURE_INITIALIZE_METADATA, - [] - ); - - // Check that the correct values are assigned to the metadata and metadataClass structs - ShaderBuilderTester.expectHasFragmentFunctionUnordered( - shaderBuilder, - MetadataPipelineStage.FUNCTION_ID_INITIALIZE_METADATA_FS, - MetadataPipelineStage.FUNCTION_SIGNATURE_INITIALIZE_METADATA, - [ - " metadata.vec2Property = texture(u_propertyTexture_1, attributes.texCoord_0).gb;", - " metadata.uint8Property = int(255.0 * texture(u_propertyTexture_1, attributes.texCoord_0).r);", - " metadata.uint8vec3Property = ivec3(255.0 * texture(u_propertyTexture_1, attributes.texCoord_0).rgb);", - " metadata.arrayProperty = texture(u_propertyTexture_1, attributes.texCoord_0).rgb;", - " metadata.valueTransformProperty = czm_valueTransform(u_valueTransformProperty_offset, u_valueTransformProperty_scale, texture(u_propertyTexture_1, attributes.texCoord_0).rg);", - " metadataClass.uint8vec3Property.defaultValue = ivec3(255,0,0);", - " metadataClass.uint8vec3Property.maxValue = ivec3(30,17,50);", - " metadataClass.uint8vec3Property.minValue = ivec3(10,10,10);", - " metadataClass.uint8vec3Property.noData = ivec3(19,13,50);", - ] - ); - ShaderBuilderTester.expectHasVertexFunctionUnordered( - shaderBuilder, - MetadataPipelineStage.FUNCTION_ID_SET_METADATA_VARYINGS, - MetadataPipelineStage.FUNCTION_SIGNATURE_SET_METADATA_VARYINGS, - [] - ); - ShaderBuilderTester.expectHasVertexUniforms(shaderBuilder, []); - ShaderBuilderTester.expectHasFragmentUniforms(shaderBuilder, [ - "uniform sampler2D u_propertyTexture_1;", - "uniform vec2 u_valueTransformProperty_offset;", - "uniform vec2 u_valueTransformProperty_scale;", - ]); - - // everything shares the same texture. - const structuralMetadata = renderResources.model.structuralMetadata; - const propertyTexture1 = structuralMetadata.getPropertyTexture(0); - const texture1 = propertyTexture1.getProperty("arrayProperty"); - - const uniformMap = renderResources.uniformMap; - expect(uniformMap.u_propertyTexture_1()).toBe( - texture1.textureReader.texture - ); - - expect(uniformMap.u_valueTransformProperty_offset()).toEqual( - new Cartesian2(1, 1) - ); - expect(uniformMap.u_valueTransformProperty_scale()).toEqual( - new Cartesian2(2, 2) - ); - }); + return loadGltf(propertyTextureWithVectorProperties).then( + function (gltfLoader) { + const components = gltfLoader.components; + const node = components.nodes[0]; + const primitive = node.primitives[0]; + const frameState = scene.frameState; + const renderResources = mockRenderResources(components); + + MetadataPipelineStage.process(renderResources, primitive, frameState); + + const shaderBuilder = renderResources.shaderBuilder; + + const metadataTypes = ["vec2", "int", "ivec3", "vec3"]; + checkMetadataClassStructs(shaderBuilder, metadataTypes); + + ShaderBuilderTester.expectHasVertexStruct( + shaderBuilder, + MetadataPipelineStage.STRUCT_ID_METADATA_VS, + MetadataPipelineStage.STRUCT_NAME_METADATA, + [], + ); + ShaderBuilderTester.expectHasFragmentStruct( + shaderBuilder, + MetadataPipelineStage.STRUCT_ID_METADATA_FS, + MetadataPipelineStage.STRUCT_NAME_METADATA, + [ + " vec2 vec2Property;", + " int uint8Property;", + " ivec3 uint8vec3Property;", + " vec3 arrayProperty;", + " vec2 valueTransformProperty;", + ], + ); + + // Check for the MetadataClass struct, containing the specific fields + // required by this test dataset + ShaderBuilderTester.expectHasFragmentStruct( + shaderBuilder, + MetadataPipelineStage.STRUCT_ID_METADATA_CLASS_FS, + MetadataPipelineStage.STRUCT_NAME_METADATA_CLASS, + [ + " vec2MetadataClass vec2Property;", + " intMetadataClass uint8Property;", + " ivec3MetadataClass uint8vec3Property;", + " vec3MetadataClass arrayProperty;", + " vec2MetadataClass valueTransformProperty;", + ], + ); + + ShaderBuilderTester.expectHasVertexFunctionUnordered( + shaderBuilder, + MetadataPipelineStage.FUNCTION_ID_INITIALIZE_METADATA_VS, + MetadataPipelineStage.FUNCTION_SIGNATURE_INITIALIZE_METADATA, + [], + ); + + // Check that the correct values are assigned to the metadata and metadataClass structs + ShaderBuilderTester.expectHasFragmentFunctionUnordered( + shaderBuilder, + MetadataPipelineStage.FUNCTION_ID_INITIALIZE_METADATA_FS, + MetadataPipelineStage.FUNCTION_SIGNATURE_INITIALIZE_METADATA, + [ + " metadata.vec2Property = texture(u_propertyTexture_1, attributes.texCoord_0).gb;", + " metadata.uint8Property = int(255.0 * texture(u_propertyTexture_1, attributes.texCoord_0).r);", + " metadata.uint8vec3Property = ivec3(255.0 * texture(u_propertyTexture_1, attributes.texCoord_0).rgb);", + " metadata.arrayProperty = texture(u_propertyTexture_1, attributes.texCoord_0).rgb;", + " metadata.valueTransformProperty = czm_valueTransform(u_valueTransformProperty_offset, u_valueTransformProperty_scale, texture(u_propertyTexture_1, attributes.texCoord_0).rg);", + " metadataClass.uint8vec3Property.defaultValue = ivec3(255,0,0);", + " metadataClass.uint8vec3Property.maxValue = ivec3(30,17,50);", + " metadataClass.uint8vec3Property.minValue = ivec3(10,10,10);", + " metadataClass.uint8vec3Property.noData = ivec3(19,13,50);", + ], + ); + ShaderBuilderTester.expectHasVertexFunctionUnordered( + shaderBuilder, + MetadataPipelineStage.FUNCTION_ID_SET_METADATA_VARYINGS, + MetadataPipelineStage.FUNCTION_SIGNATURE_SET_METADATA_VARYINGS, + [], + ); + ShaderBuilderTester.expectHasVertexUniforms(shaderBuilder, []); + ShaderBuilderTester.expectHasFragmentUniforms(shaderBuilder, [ + "uniform sampler2D u_propertyTexture_1;", + "uniform vec2 u_valueTransformProperty_offset;", + "uniform vec2 u_valueTransformProperty_scale;", + ]); + + // everything shares the same texture. + const structuralMetadata = renderResources.model.structuralMetadata; + const propertyTexture1 = structuralMetadata.getPropertyTexture(0); + const texture1 = propertyTexture1.getProperty("arrayProperty"); + + const uniformMap = renderResources.uniformMap; + expect(uniformMap.u_propertyTexture_1()).toBe( + texture1.textureReader.texture, + ); + + expect(uniformMap.u_valueTransformProperty_offset()).toEqual( + new Cartesian2(1, 1), + ); + expect(uniformMap.u_valueTransformProperty_scale()).toEqual( + new Cartesian2(2, 2), + ); + }, + ); }); it("Handles a tileset with metadata statistics", function () { @@ -517,7 +517,7 @@ describe( return Cesium3DTilesTester.loadTileset( scene, tilesetWithMetadataStatistics, - tilesetOptions + tilesetOptions, ).then(function (tileset) { expect(tileset).toBeDefined(); expect(tileset.tilesLoaded).toBe(true); @@ -562,13 +562,13 @@ describe( shaderBuilder, structName, structName, - structFields + structFields, ); ShaderBuilderTester.expectHasFragmentStruct( shaderBuilder, structName, structName, - structFields + structFields, ); // Check main metadata, metadataClass, metadataStatistics structs @@ -580,13 +580,13 @@ describe( shaderBuilder, MetadataPipelineStage.STRUCT_ID_METADATA_VS, MetadataPipelineStage.STRUCT_NAME_METADATA, - metadataFields + metadataFields, ); ShaderBuilderTester.expectHasFragmentStruct( shaderBuilder, MetadataPipelineStage.STRUCT_ID_METADATA_FS, MetadataPipelineStage.STRUCT_NAME_METADATA, - metadataFields + metadataFields, ); const metadataClassFields = [ @@ -597,13 +597,13 @@ describe( shaderBuilder, MetadataPipelineStage.STRUCT_ID_METADATA_CLASS_VS, MetadataPipelineStage.STRUCT_NAME_METADATA_CLASS, - metadataClassFields + metadataClassFields, ); ShaderBuilderTester.expectHasFragmentStruct( shaderBuilder, MetadataPipelineStage.STRUCT_ID_METADATA_CLASS_FS, MetadataPipelineStage.STRUCT_NAME_METADATA_CLASS, - metadataClassFields + metadataClassFields, ); const metadataStatisticsFields = [ @@ -613,13 +613,13 @@ describe( shaderBuilder, MetadataPipelineStage.STRUCT_ID_METADATA_STATISTICS_VS, MetadataPipelineStage.STRUCT_NAME_METADATA_STATISTICS, - metadataStatisticsFields + metadataStatisticsFields, ); ShaderBuilderTester.expectHasFragmentStruct( shaderBuilder, MetadataPipelineStage.STRUCT_ID_METADATA_STATISTICS_FS, MetadataPipelineStage.STRUCT_NAME_METADATA_STATISTICS, - metadataStatisticsFields + metadataStatisticsFields, ); // Check that the correct values are set in the initializeMetadata function @@ -638,16 +638,16 @@ describe( renderResources.shaderBuilder, MetadataPipelineStage.FUNCTION_ID_INITIALIZE_METADATA_VS, MetadataPipelineStage.FUNCTION_SIGNATURE_INITIALIZE_METADATA, - assignments + assignments, ); ShaderBuilderTester.expectHasFragmentFunctionUnordered( renderResources.shaderBuilder, MetadataPipelineStage.FUNCTION_ID_INITIALIZE_METADATA_FS, MetadataPipelineStage.FUNCTION_SIGNATURE_INITIALIZE_METADATA, - assignments + assignments, ); }); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/Model/Model3DTileContentSpec.js b/packages/engine/Specs/Scene/Model/Model3DTileContentSpec.js index 1aa9a724e95c..289dc253d350 100644 --- a/packages/engine/Specs/Scene/Model/Model3DTileContentSpec.js +++ b/packages/engine/Specs/Scene/Model/Model3DTileContentSpec.js @@ -160,11 +160,11 @@ describe( }); function rendersGeoJson(url) { - return Cesium3DTilesTester.loadTileset(scene, url).then(function ( - tileset - ) { - Cesium3DTilesTester.expectRender(scene, tileset); - }); + return Cesium3DTilesTester.loadTileset(scene, url).then( + function (tileset) { + Cesium3DTilesTester.expectRender(scene, tileset); + }, + ); } it("renders GeoJSON MultiPolygon", function () { @@ -201,31 +201,31 @@ describe( function picksGeoJson(url, hasProperties, expectedFeatureId) { expectedFeatureId = defaultValue(expectedFeatureId, 0); - return Cesium3DTilesTester.loadTileset(scene, url).then(function ( - tileset - ) { - const content = tileset.root.content; - tileset.show = false; - expect(scene).toPickPrimitive(undefined); - tileset.show = true; - expect(scene).toPickAndCall(function (result) { - expect(result).toBeDefined(); - expect(result.primitive).toBe(tileset); - expect(result.content).toBe(content); - const featureId = result.featureId; - expect(featureId).toBe(expectedFeatureId); - const feature = content.getFeature(featureId); - expect(feature).toBeDefined(); - - if (hasProperties) { - expect(feature.getProperty("name")).toBe("UL"); - expect(feature.getProperty("code")).toBe(12); - } else { - expect(feature.getProperty("name")).toBeUndefined(); - expect(feature.getProperty("code")).toBeUndefined(); - } - }); - }); + return Cesium3DTilesTester.loadTileset(scene, url).then( + function (tileset) { + const content = tileset.root.content; + tileset.show = false; + expect(scene).toPickPrimitive(undefined); + tileset.show = true; + expect(scene).toPickAndCall(function (result) { + expect(result).toBeDefined(); + expect(result.primitive).toBe(tileset); + expect(result.content).toBe(content); + const featureId = result.featureId; + expect(featureId).toBe(expectedFeatureId); + const feature = content.getFeature(featureId); + expect(feature).toBeDefined(); + + if (hasProperties) { + expect(feature.getProperty("name")).toBe("UL"); + expect(feature.getProperty("code")).toBe(12); + } else { + expect(feature.getProperty("name")).toBeUndefined(); + expect(feature.getProperty("code")).toBeUndefined(); + } + }); + }, + ); } it("picks GeoJSON MultiPolygon", function () { @@ -270,14 +270,14 @@ describe( return Cesium3DTilesTester.loadTileset(scene, withBatchTableUrl).then( function (tileset) { Cesium3DTilesTester.expectRenderTileset(scene, tileset); - } + }, ); }); it("renders b3dm with a binary batch table", function () { return Cesium3DTilesTester.loadTileset( scene, - withBatchTableBinaryUrl + withBatchTableBinaryUrl, ).then(function (tileset) { Cesium3DTilesTester.expectRenderTileset(scene, tileset); }); @@ -286,7 +286,7 @@ describe( it("renders b3dm content without batch table", function () { return Cesium3DTilesTester.loadTileset( scene, - withoutBatchTableUrl + withoutBatchTableUrl, ).then(function (tileset) { Cesium3DTilesTester.expectRenderTileset(scene, tileset); }); @@ -296,14 +296,14 @@ describe( return Cesium3DTilesTester.loadTileset(scene, noBatchIdsUrl).then( function (tileset) { Cesium3DTilesTester.expectRender(scene, tileset); - } + }, ); }); it("picks from b3dm", function () { return Cesium3DTilesTester.loadTileset( scene, - withoutBatchTableUrl + withoutBatchTableUrl, ).then(function (tileset) { const content = tileset.root.content; tileset.show = false; @@ -325,14 +325,14 @@ describe( return Cesium3DTilesTester.loadTileset(scene, translucentUrl).then( function (tileset) { Cesium3DTilesTester.expectRenderTileset(scene, tileset); - } + }, ); }); it("renders with a mix of opaque and translucent features", function () { return Cesium3DTilesTester.loadTileset( scene, - translucentOpaqueMixUrl + translucentOpaqueMixUrl, ).then(function (tileset) { Cesium3DTilesTester.expectRenderTileset(scene, tileset); }); @@ -342,38 +342,38 @@ describe( return Cesium3DTilesTester.loadTileset(scene, texturedUrl).then( function (tileset) { Cesium3DTilesTester.expectRender(scene, tileset); - } + }, ); }); function expectRenderWithTransform(url) { setCamera(centerLongitude, centerLatitude, 15.0); - return Cesium3DTilesTester.loadTileset(scene, url).then(function ( - tileset - ) { - Cesium3DTilesTester.expectRenderTileset(scene, tileset); + return Cesium3DTilesTester.loadTileset(scene, url).then( + function (tileset) { + Cesium3DTilesTester.expectRenderTileset(scene, tileset); - const newLongitude = -1.31962; - const newLatitude = 0.698874; - const newCenter = Cartesian3.fromRadians( - newLongitude, - newLatitude, - 0.0 - ); - const newHPR = new HeadingPitchRoll(); - const newTransform = Transforms.headingPitchRollToFixedFrame( - newCenter, - newHPR - ); + const newLongitude = -1.31962; + const newLatitude = 0.698874; + const newCenter = Cartesian3.fromRadians( + newLongitude, + newLatitude, + 0.0, + ); + const newHPR = new HeadingPitchRoll(); + const newTransform = Transforms.headingPitchRollToFixedFrame( + newCenter, + newHPR, + ); - // Update tile transform - tileset.root.transform = newTransform; - scene.renderForSpecs(); + // Update tile transform + tileset.root.transform = newTransform; + scene.renderForSpecs(); - // Move the camera to the new location - setCamera(newLongitude, newLatitude, 15.0); - Cesium3DTilesTester.expectRenderTileset(scene, tileset); - }); + // Move the camera to the new location + setCamera(newLongitude, newLatitude, 15.0); + Cesium3DTilesTester.expectRenderTileset(scene, tileset); + }, + ); } it("renders with a tile transform and box bounding volume", function () { @@ -405,7 +405,7 @@ describe( expect(content.hasProperty(featureId, "id")).toBe(true); expect(content.getFeature(featureId)).toBeDefined(); }); - } + }, ); }); @@ -417,7 +417,7 @@ describe( expect(content.innerContents).toBeUndefined(); expect(content.hasProperty(0, "id")).toBe(true); expect(content.getFeature(0)).toBeDefined(); - } + }, ); }); @@ -450,7 +450,7 @@ describe( expect(content.geometryByteLength).toEqual(geometryByteLength); expect(content.texturesByteLength).toEqual(texturesByteLength); expect(content.batchTableByteLength).toEqual( - batchTexturesByteLength + batchTexturesByteLength, ); // Pick the tile and expect the texture memory to increase @@ -458,9 +458,9 @@ describe( expect(content.geometryByteLength).toEqual(geometryByteLength); expect(content.texturesByteLength).toEqual(texturesByteLength); expect(content.batchTableByteLength).toEqual( - batchTexturesByteLength + pickTexturesByteLength + batchTexturesByteLength + pickTexturesByteLength, ); - } + }, ); }); @@ -472,7 +472,7 @@ describe( creditDisplay._currentFrameCredits.lightboxCredits.values; expect(credits.length).toEqual(1); expect(credits[0].credit.html).toEqual("Sample Copyright"); - } + }, ); }); @@ -525,7 +525,7 @@ describe( it("renders i3dm content", function () { return Cesium3DTilesTester.loadTileset( scene, - instancedWithBatchTableUrl + instancedWithBatchTableUrl, ).then(function (tileset) { Cesium3DTilesTester.expectRender(scene, tileset); }); @@ -534,7 +534,7 @@ describe( it("renders with external gltf", function () { return Cesium3DTilesTester.loadTileset( scene, - instancedExternalGltfUrl + instancedExternalGltfUrl, ).then(function (tileset) { Cesium3DTilesTester.expectRenderTileset(scene, tileset); }); @@ -543,7 +543,7 @@ describe( it("renders without normals", function () { return Cesium3DTilesTester.loadTileset( scene, - instancedWithoutNormalsUrl + instancedWithoutNormalsUrl, ).then(function (tileset) { Cesium3DTilesTester.expectRenderTileset(scene, tileset); }); @@ -552,7 +552,7 @@ describe( it("renders with batch table", function () { return Cesium3DTilesTester.loadTileset( scene, - instancedWithBatchTableUrl + instancedWithBatchTableUrl, ).then(function (tileset) { Cesium3DTilesTester.expectRenderTileset(scene, tileset); }); @@ -561,7 +561,7 @@ describe( it("renders without batch table", function () { return Cesium3DTilesTester.loadTileset( scene, - instancedWithoutBatchTableUrl + instancedWithoutBatchTableUrl, ).then(function (tileset) { Cesium3DTilesTester.expectRenderTileset(scene, tileset); }); @@ -570,7 +570,7 @@ describe( it("renders with batch ids", function () { return Cesium3DTilesTester.loadTileset( scene, - instancedWithBatchIdsUrl + instancedWithBatchIdsUrl, ).then(function (tileset) { Cesium3DTilesTester.expectRenderTileset(scene, tileset); }); @@ -579,7 +579,7 @@ describe( it("renders with textures", function () { return Cesium3DTilesTester.loadTileset( scene, - instancedTexturedUrl + instancedTexturedUrl, ).then(function (tileset) { Cesium3DTilesTester.expectRenderTileset(scene, tileset); }); @@ -588,7 +588,7 @@ describe( it("gets memory usage", function () { return Cesium3DTilesTester.loadTileset( scene, - instancedTexturedUrl + instancedTexturedUrl, ).then(function (tileset) { const content = tileset.root.content; @@ -625,7 +625,7 @@ describe( expect(content.geometryByteLength).toEqual(geometryByteLength); expect(content.texturesByteLength).toEqual(texturesByteLength); expect(content.batchTableByteLength).toEqual( - batchTexturesByteLength + pickTexturesByteLength + batchTexturesByteLength + pickTexturesByteLength, ); }); }); @@ -633,7 +633,7 @@ describe( it("picks from i3dm batch table", function () { return Cesium3DTilesTester.loadTileset( scene, - instancedWithBatchTableUrl + instancedWithBatchTableUrl, ).then(function (tileset) { const content = tileset.root.content; tileset.show = false; @@ -667,7 +667,7 @@ describe( return Cesium3DTilesTester.loadTileset(scene, pointCloudRGBAUrl).then( function (tileset) { Cesium3DTilesTester.expectRender(scene, tileset); - } + }, ); }); @@ -685,7 +685,7 @@ describe( expect(rgba[0]).toBeGreaterThan(rgba[1]); expect(rgba[0]).toBeGreaterThan(rgba[2]); }); - } + }, ); }); @@ -693,14 +693,14 @@ describe( return Cesium3DTilesTester.loadTileset(scene, pointCloudWGS84Url).then( function (tileset) { Cesium3DTilesTester.expectRender(scene, tileset); - } + }, ); }); it("renders point cloud with batch table", function () { return Cesium3DTilesTester.loadTileset( scene, - pointCloudBatchedUrl + pointCloudBatchedUrl, ).then(function (tileset) { Cesium3DTilesTester.expectRender(scene, tileset); }); @@ -709,7 +709,7 @@ describe( it("renders point cloud with per-point properties", function () { return Cesium3DTilesTester.loadTileset( scene, - pointCloudWithPerPointPropertiesUrl + pointCloudWithPerPointPropertiesUrl, ).then(function (tileset) { Cesium3DTilesTester.expectRender(scene, tileset); }); @@ -727,14 +727,14 @@ describe( expect(renderOptions).notToRender(color); tileset.debugColorizeTiles = false; expect(renderOptions).toRender(color); - } + }, ); }); it("renders pnts with color style", function () { return Cesium3DTilesTester.loadTileset( scene, - pointCloudWithPerPointPropertiesUrl + pointCloudWithPerPointPropertiesUrl, ).then(function (tileset) { // Verify render without style Cesium3DTilesTester.expectRender(scene, tileset); @@ -767,7 +767,7 @@ describe( it("renders pnts with show style", function () { return Cesium3DTilesTester.loadTileset( scene, - pointCloudWithPerPointPropertiesUrl + pointCloudWithPerPointPropertiesUrl, ).then(function (tileset) { // Verify render without style Cesium3DTilesTester.expectRender(scene, tileset); @@ -793,7 +793,7 @@ describe( it("renders pnts with point size style", function () { return Cesium3DTilesTester.loadTileset( scene, - pointCloudWithPerPointPropertiesUrl + pointCloudWithPerPointPropertiesUrl, ).then(function (tileset) { // Verify render without style Cesium3DTilesTester.expectRender(scene, tileset); @@ -816,7 +816,7 @@ describe( it("renders pnts with style using point cloud semantics", function () { return Cesium3DTilesTester.loadTileset( scene, - pointCloudWithPerPointPropertiesUrl + pointCloudWithPerPointPropertiesUrl, ).then(function (tileset) { // Verify render without style Cesium3DTilesTester.expectRender(scene, tileset); @@ -852,7 +852,7 @@ describe( it("renders pnts with style using point cloud properties", function () { return Cesium3DTilesTester.loadTileset( scene, - pointCloudWithPerPointPropertiesUrl + pointCloudWithPerPointPropertiesUrl, ).then(function (tileset) { // Verify render without style Cesium3DTilesTester.expectRender(scene, tileset); @@ -877,7 +877,7 @@ describe( it("renders pnts with style using point cloud properties (unicode)", function () { return Cesium3DTilesTester.loadTileset( scene, - pointCloudWithUnicodePropertyIdsUrl + pointCloudWithUnicodePropertyIdsUrl, ).then(function (tileset) { // Verify render without style Cesium3DTilesTester.expectRender(scene, tileset); @@ -903,7 +903,7 @@ describe( it("renders pnts with style and normals", function () { return Cesium3DTilesTester.loadTileset( scene, - pointCloudNormalsUrl + pointCloudNormalsUrl, ).then(function (tileset) { // Verify render without style Cesium3DTilesTester.expectRender(scene, tileset); @@ -930,7 +930,7 @@ describe( it("throws if style references the NORMAL semantic for pnts without normals", function () { return Cesium3DTilesTester.loadTileset( scene, - pointCloudWithPerPointPropertiesUrl + pointCloudWithPerPointPropertiesUrl, ).then(function (tileset) { // Verify render without style Cesium3DTilesTester.expectRender(scene, tileset); @@ -957,14 +957,14 @@ describe( expect(result.primitive).toBe(tileset); expect(result.content).toBe(content); }); - } + }, ); }); it("picks based on batchId", function () { return Cesium3DTilesTester.loadTileset( scene, - pointCloudBatchedUrl + pointCloudBatchedUrl, ).then(function (tileset) { // Get the original color let color; @@ -1001,14 +1001,14 @@ describe( expect(function () { return content.getFeature(0); }).toThrowDeveloperError(); - } + }, ); }); it("batched point cloud works", function () { return Cesium3DTilesTester.loadTileset( scene, - pointCloudBatchedUrl + pointCloudBatchedUrl, ).then(function (tileset) { const content = tileset.root.content; expect(content.featuresLength).toBe(8); @@ -1023,7 +1023,7 @@ describe( // table will be created. return Cesium3DTilesTester.loadTileset( scene, - pointCloudWithPerPointPropertiesUrl + pointCloudWithPerPointPropertiesUrl, ).then(function (tileset) { const content = tileset.root.content; expect(content.featuresLength).toBe(0); @@ -1039,7 +1039,7 @@ describe( return Cesium3DTilesTester.loadTileset( scene, - pointCloudBatchedUrl + pointCloudBatchedUrl, ).then(function (tileset) { // Get the number of picked sections with back face culling on let pickedCountCulling = 0; @@ -1070,7 +1070,7 @@ describe( Cesium3DTilesTester.loadTileset(scene, pointCloudNormalsUrl), Cesium3DTilesTester.loadTileset( scene, - pointCloudQuantizedOctEncodedUrl + pointCloudQuantizedOctEncodedUrl, ), ]; @@ -1087,7 +1087,7 @@ describe( for (let i = 0; i < length; ++i) { const content = tilesets[i].root.content; expect(content.geometryByteLength).toEqual( - expectedGeometryMemory[i] + expectedGeometryMemory[i], ); expect(content.texturesByteLength).toEqual(0); } @@ -1098,7 +1098,7 @@ describe( setCamera(centerLongitude, centerLatitude, 25.0); return Cesium3DTilesTester.loadTileset( scene, - instancedWithBatchTableUrl + instancedWithBatchTableUrl, ).then(function (tileset) { const content = tileset.root.content; tileset.show = false; @@ -1119,7 +1119,7 @@ describe( it("gets memory usage for batch point cloud", function () { return Cesium3DTilesTester.loadTileset( scene, - pointCloudBatchedUrl + pointCloudBatchedUrl, ).then(function (tileset) { const content = tileset.root.content; @@ -1147,7 +1147,7 @@ describe( expect(content.geometryByteLength).toEqual(pointCloudGeometryMemory); expect(content.texturesByteLength).toEqual(0); expect(content.batchTableByteLength).toEqual( - binaryPropertyMemory + batchTexturesByteLength + binaryPropertyMemory + batchTexturesByteLength, ); // Pick the tile and expect the texture memory to increase @@ -1157,7 +1157,7 @@ describe( expect(content.batchTableByteLength).toEqual( binaryPropertyMemory + batchTexturesByteLength + - pickTexturesByteLength + pickTexturesByteLength, ); }); }); @@ -1174,7 +1174,7 @@ describe( const center = new Cartesian3.fromRadians( centerLongitude, centerLatitude, - 5.0 + 5.0, ); scene.camera.lookAt(center, new HeadingPitchRange(0.0, -1.57, 5.0)); scene.postProcessStages.fxaa.enabled = false; @@ -1182,7 +1182,7 @@ describe( return Cesium3DTilesTester.loadTileset( scene, - pointCloudNoColorUrl + pointCloudNoColorUrl, ).then(function (tileset) { tileset.pointCloudShading.eyeDomeLighting = false; tileset.root.refine = Cesium3DTileRefine.REPLACE; @@ -1281,7 +1281,7 @@ describe( it("becomes ready with glb", async function () { const tileset = await Cesium3DTilesTester.loadTileset( scene, - glbContentUrl + glbContentUrl, ); expect(tileset.root.contentReady).toBeTrue(); expect(tileset.root.content).toBeDefined(); @@ -1290,7 +1290,7 @@ describe( it("becomes ready with glTF", async function () { const tileset = await Cesium3DTilesTester.loadTileset( scene, - gltfContentUrl + gltfContentUrl, ); expect(tileset.root.contentReady).toBeTrue(); expect(tileset.root.content).toBeDefined(); @@ -1300,14 +1300,14 @@ describe( return Cesium3DTilesTester.loadTileset(scene, glbContentUrl).then( function (tileset) { Cesium3DTilesTester.expectRender(scene, tileset); - } + }, ); }); it("renders glTF content", function () { return Cesium3DTilesTester.loadTileset( scene, - buildingsMetadataUrl + buildingsMetadataUrl, ).then(function (tileset) { Cesium3DTilesTester.expectRender(scene, tileset); }); @@ -1320,14 +1320,14 @@ describe( expect(function () { content.getFeature(0); }).toThrowDeveloperError(); - } + }, ); }); it("throws when calling getFeature with invalid index", function () { return Cesium3DTilesTester.loadTileset( scene, - buildingsMetadataUrl + buildingsMetadataUrl, ).then(function (tileset) { const content = tileset.root.content; expect(function () { @@ -1360,14 +1360,14 @@ describe( return content.getFeature(0); }).toThrowDeveloperError(); }); - } + }, ); }); it("picks from glTF feature table", function () { return Cesium3DTilesTester.loadTileset( scene, - buildingsMetadataUrl + buildingsMetadataUrl, ).then(function (tileset) { const content = tileset.root.content; tileset.show = false; @@ -1404,7 +1404,7 @@ describe( return Cesium3DTilesTester.loadTileset( scene, noBatchIdsUrl, - tilesetOptions + tilesetOptions, ).then(function (tileset) { // expectRender() renders twice, first with tileset.show = false, // then with tileset.show = true. @@ -1423,7 +1423,7 @@ describe( return Cesium3DTilesTester.loadTileset( scene, noBatchIdsUrl, - tilesetOptions + tilesetOptions, ).then(function (tileset) { // expectRenderBlank() renders twice, first with tileset.show = false, // then with tileset.show = true. @@ -1448,7 +1448,7 @@ describe( const content = tile.content; const model = content._model; const passOptions = Cesium3DTilePass.getPassOptions( - Cesium3DTilePass.RENDER + Cesium3DTilePass.RENDER, ); expect(model.clippingPlanes).toBeUndefined(); @@ -1467,7 +1467,7 @@ describe( tile.update(tileset, scene.frameState, passOptions); expect(model.clippingPlanes).toBeUndefined(); - } + }, ); }); @@ -1477,7 +1477,7 @@ describe( const tile = tileset.root; const model = tile.content._model; const passOptions = Cesium3DTilePass.getPassOptions( - Cesium3DTilePass.RENDER + Cesium3DTilePass.RENDER, ); expect(model.clippingPlanes).toBeUndefined(); @@ -1501,7 +1501,7 @@ describe( tile.update(tileset, scene.frameState, passOptions); expect(model.clippingPlanes).toBe(tileset.clippingPlanes); - } + }, ); }); @@ -1511,7 +1511,7 @@ describe( const tile = tileset.root; const model = tile.content._model; const passOptions = Cesium3DTilePass.getPassOptions( - Cesium3DTilePass.RENDER + Cesium3DTilePass.RENDER, ); expect(model.clippingPlanes).toBeUndefined(); @@ -1534,7 +1534,7 @@ describe( tile.update(tileset, scene.frameState, passOptions); expect(model.resetDrawCommands.calls.count()).toBe(2); - } + }, ); }); @@ -1556,7 +1556,7 @@ describe( clipPlane.distance = 5.0; expect(scene).toRender(color); - } + }, ); }); @@ -1572,14 +1572,14 @@ describe( tileset.clippingPlanes = new ClippingPlaneCollection({ planes: [clipPlane], modelMatrix: Transforms.eastNorthUpToFixedFrame( - tileset.boundingSphere.center + tileset.boundingSphere.center, ), edgeWidth: 20.0, edgeColor: Color.RED, }); expect(scene).notToRender(color); - } + }, ); }); @@ -1587,7 +1587,7 @@ describe( // Force uint8 mode - there's a slight rendering difference between // float and packed uint8 clipping planes for this test due to the small context spyOn(ClippingPlaneCollection, "useFloatTexture").and.returnValue( - false + false, ); return Cesium3DTilesTester.loadTileset(scene, withBatchTableUrl).then( function (tileset) { @@ -1602,7 +1602,7 @@ describe( new ClippingPlane(Cartesian3.UNIT_X, 0.0), ], modelMatrix: Transforms.eastNorthUpToFixedFrame( - tileset.boundingSphere.center + tileset.boundingSphere.center, ), unionClippingRegions: true, }); @@ -1612,7 +1612,7 @@ describe( tileset.clippingPlanes.unionClippingRegions = false; expect(scene).toRender(color); - } + }, ); }); @@ -1634,7 +1634,7 @@ describe( new ClippingPlane(Cartesian3.UNIT_X, 1.0), ], modelMatrix: Transforms.eastNorthUpToFixedFrame( - tileset.boundingSphere.center + tileset.boundingSphere.center, ), unionClippingRegions: true, }); @@ -1644,7 +1644,7 @@ describe( tileset.clippingPlanes.unionClippingRegions = false; expect(scene).toRender(color); - } + }, ); }); }); @@ -1673,7 +1673,7 @@ describe( const tileset = await Cesium3DTilesTester.loadTileset( scene, - withBatchTableUrl + withBatchTableUrl, ); let color; expect(scene).toRenderAndCall(function (rgba) { @@ -1712,7 +1712,7 @@ describe( } const depthColorAttribute = ColorGeometryInstanceAttribute.fromColor( - new Color(0.0, 0.0, 0.0, 1.0) + new Color(0.0, 0.0, 0.0, 1.0), ); return new Primitive({ @@ -1769,7 +1769,7 @@ describe( scene = createScene(); const translation = Ellipsoid.WGS84.geodeticSurfaceNormalCartographic( - new Cartographic(centerLongitude, centerLatitude) + new Cartographic(centerLongitude, centerLatitude), ); Cartesian3.multiplyByScalar(translation, -5.0, translation); modelMatrix = Matrix4.fromTranslation(translation); @@ -1779,12 +1779,12 @@ describe( centerLongitude - offset, centerLatitude - offset, centerLongitude + offset, - centerLatitude + offset + centerLatitude + offset, ); reusableGlobePrimitive = createPrimitive(rectangle, Pass.GLOBE); reusableTilesetPrimitive = createPrimitive( rectangle, - Pass.CESIUM_3D_TILE + Pass.CESIUM_3D_TILE, ); }); @@ -1796,7 +1796,7 @@ describe( globePrimitive = new MockPrimitive(reusableGlobePrimitive, Pass.GLOBE); tilesetPrimitive = new MockPrimitive( reusableTilesetPrimitive, - Pass.CESIUM_3D_TILE + Pass.CESIUM_3D_TILE, ); scene.primitives.add(globePrimitive); @@ -1936,7 +1936,7 @@ describe( it("assigns group metadata", function () { return Cesium3DTilesTester.loadTileset( scene, - withoutBatchTableUrl + withoutBatchTableUrl, ).then(function (tileset) { const content = tileset.root.content; content.group = new Cesium3DContentGroup({ metadata: groupMetadata }); @@ -1947,7 +1947,7 @@ describe( it("assigns metadata", function () { return Cesium3DTilesTester.loadTileset( scene, - withoutBatchTableUrl + withoutBatchTableUrl, ).then(function (tileset) { const content = tileset.root.content; content.metadata = contentMetadata; @@ -1956,5 +1956,5 @@ describe( }); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/Model/ModelAnimationChannelSpec.js b/packages/engine/Specs/Scene/Model/ModelAnimationChannelSpec.js index 20070d210ee7..b03ffb438fd1 100644 --- a/packages/engine/Specs/Scene/Model/ModelAnimationChannelSpec.js +++ b/packages/engine/Specs/Scene/Model/ModelAnimationChannelSpec.js @@ -128,7 +128,7 @@ describe("Scene/Model/ModelAnimationChannel", function () { const mockChannel = createMockChannel( mockNode, mockSampler, - AnimatedPropertyType.TRANSLATION + AnimatedPropertyType.TRANSLATION, ); const runtimeChannel = new ModelAnimationChannel({ @@ -154,7 +154,7 @@ describe("Scene/Model/ModelAnimationChannel", function () { const mockChannel = createMockChannel( mockNode, mockSampler, - AnimatedPropertyType.TRANSLATION + AnimatedPropertyType.TRANSLATION, ); const runtimeChannel = new ModelAnimationChannel({ @@ -180,7 +180,7 @@ describe("Scene/Model/ModelAnimationChannel", function () { const mockChannel = createMockChannel( mockNode, mockSampler, - AnimatedPropertyType.ROTATION + AnimatedPropertyType.ROTATION, ); const runtimeChannel = new ModelAnimationChannel({ @@ -206,7 +206,7 @@ describe("Scene/Model/ModelAnimationChannel", function () { const mockChannel = createMockChannel( mockNode, mockSampler, - AnimatedPropertyType.SCALE + AnimatedPropertyType.SCALE, ); const runtimeChannel = new ModelAnimationChannel({ @@ -247,7 +247,7 @@ describe("Scene/Model/ModelAnimationChannel", function () { const mockChannel = createMockChannel( mockNode, mockSampler, - AnimatedPropertyType.TRANSLATION + AnimatedPropertyType.TRANSLATION, ); const runtimeChannel = new ModelAnimationChannel({ @@ -285,7 +285,7 @@ describe("Scene/Model/ModelAnimationChannel", function () { const mockChannel = createMockChannel( mockNode, mockSampler, - AnimatedPropertyType.WEIGHTS + AnimatedPropertyType.WEIGHTS, ); const runtimeChannel = new ModelAnimationChannel({ @@ -324,7 +324,7 @@ describe("Scene/Model/ModelAnimationChannel", function () { const mockChannel = createMockChannel( mockNode, mockSampler, - AnimatedPropertyType.WEIGHTS + AnimatedPropertyType.WEIGHTS, ); const runtimeChannel = new ModelAnimationChannel({ @@ -361,7 +361,7 @@ describe("Scene/Model/ModelAnimationChannel", function () { const mockChannel = createMockChannel( mockNode, mockSampler, - AnimatedPropertyType.TRANSLATION + AnimatedPropertyType.TRANSLATION, ); const runtimeChannel = new ModelAnimationChannel({ @@ -379,7 +379,7 @@ describe("Scene/Model/ModelAnimationChannel", function () { runtimeChannel.animate(time); expect(runtimeNode.translation).toEqual(expected); expect(runtimeNode.transform).toEqual( - Matrix4.fromTranslation(expected, scratchTransform) + Matrix4.fromTranslation(expected, scratchTransform), ); time = (times[1] + times[2]) / 2.0; @@ -387,13 +387,13 @@ describe("Scene/Model/ModelAnimationChannel", function () { translationPoints[1], translationPoints[2], 0.5, - expected + expected, ); runtimeChannel.animate(time); expect(runtimeNode.translation).toEqual(expected); expect(runtimeNode.transform).toEqual( - Matrix4.fromTranslation(expected, scratchTransform) + Matrix4.fromTranslation(expected, scratchTransform), ); }); @@ -407,7 +407,7 @@ describe("Scene/Model/ModelAnimationChannel", function () { const mockChannel = createMockChannel( mockNode, mockSampler, - AnimatedPropertyType.ROTATION + AnimatedPropertyType.ROTATION, ); const runtimeChannel = new ModelAnimationChannel({ @@ -428,8 +428,8 @@ describe("Scene/Model/ModelAnimationChannel", function () { expect( runtimeNode.transform.equalsEpsilon( Matrix4.fromRotation(expectedMatrix, scratchTransform), - CesiumMath.EPSILON6 - ) + CesiumMath.EPSILON6, + ), ).toBe(true); time = (times[1] + times[2]) / 2.0; @@ -437,19 +437,19 @@ describe("Scene/Model/ModelAnimationChannel", function () { rotationPoints[1], rotationPoints[2], 0.5, - expected + expected, ); expectedMatrix = Matrix3.fromQuaternion(expected, expectedMatrix); runtimeChannel.animate(time); expect( - runtimeNode.rotation.equalsEpsilon(expected, CesiumMath.EPSILON6) + runtimeNode.rotation.equalsEpsilon(expected, CesiumMath.EPSILON6), ).toEqual(true); expect( runtimeNode.transform.equalsEpsilon( Matrix4.fromRotation(expectedMatrix, scratchTransform), - CesiumMath.EPSILON6 - ) + CesiumMath.EPSILON6, + ), ); }); @@ -463,7 +463,7 @@ describe("Scene/Model/ModelAnimationChannel", function () { const mockChannel = createMockChannel( mockNode, mockSampler, - AnimatedPropertyType.SCALE + AnimatedPropertyType.SCALE, ); const runtimeChannel = new ModelAnimationChannel({ @@ -482,7 +482,7 @@ describe("Scene/Model/ModelAnimationChannel", function () { runtimeChannel.animate(time); expect(runtimeNode.scale).toEqual(expected); expect(runtimeNode.transform).toEqual( - Matrix4.fromScale(expected, scratchTransform) + Matrix4.fromScale(expected, scratchTransform), ); time = (times[1] + times[2]) / 2.0; @@ -491,7 +491,7 @@ describe("Scene/Model/ModelAnimationChannel", function () { runtimeChannel.animate(time); expect(runtimeNode.scale).toEqual(expected); expect(runtimeNode.transform).toEqual( - Matrix4.fromScale(expected, scratchTransform) + Matrix4.fromScale(expected, scratchTransform), ); }); @@ -507,7 +507,7 @@ describe("Scene/Model/ModelAnimationChannel", function () { const mockChannel = createMockChannel( mockNode, mockSampler, - AnimatedPropertyType.WEIGHTS + AnimatedPropertyType.WEIGHTS, ); const runtimeChannel = new ModelAnimationChannel({ @@ -543,7 +543,7 @@ describe("Scene/Model/ModelAnimationChannel", function () { const mockChannel = createMockChannel( mockNode, mockSampler, - AnimatedPropertyType.TRANSLATION + AnimatedPropertyType.TRANSLATION, ); const runtimeChannel = new ModelAnimationChannel({ @@ -561,7 +561,7 @@ describe("Scene/Model/ModelAnimationChannel", function () { runtimeChannel.animate(time); expect(runtimeNode.translation).toEqual(expected); expect(runtimeNode.transform).toEqual( - Matrix4.fromTranslation(expected, scratchTransform) + Matrix4.fromTranslation(expected, scratchTransform), ); time = -10.0; @@ -570,7 +570,7 @@ describe("Scene/Model/ModelAnimationChannel", function () { runtimeChannel.animate(time); expect(runtimeNode.translation).toEqual(expected); expect(runtimeNode.transform).toEqual( - Matrix4.fromTranslation(expected, scratchTransform) + Matrix4.fromTranslation(expected, scratchTransform), ); }); @@ -584,7 +584,7 @@ describe("Scene/Model/ModelAnimationChannel", function () { const mockChannel = createMockChannel( mockNode, mockSampler, - AnimatedPropertyType.TRANSLATION + AnimatedPropertyType.TRANSLATION, ); const wrappedRuntimeAnimation = { @@ -608,7 +608,7 @@ describe("Scene/Model/ModelAnimationChannel", function () { runtimeChannel.animate(time); expect(runtimeNode.translation).toEqual(expected); expect(runtimeNode.transform).toEqual( - Matrix4.fromTranslation(expected, scratchTransform) + Matrix4.fromTranslation(expected, scratchTransform), ); time = -0.5; @@ -617,7 +617,7 @@ describe("Scene/Model/ModelAnimationChannel", function () { runtimeChannel.animate(time); expect(runtimeNode.translation).toEqual(expected); expect(runtimeNode.transform).toEqual( - Matrix4.fromTranslation(expected, scratchTransform) + Matrix4.fromTranslation(expected, scratchTransform), ); }); @@ -631,7 +631,7 @@ describe("Scene/Model/ModelAnimationChannel", function () { const mockChannel = createMockChannel( mockNode, mockSampler, - AnimatedPropertyType.TRANSLATION + AnimatedPropertyType.TRANSLATION, ); const runtimeChannel = new ModelAnimationChannel({ diff --git a/packages/engine/Specs/Scene/Model/ModelAnimationCollectionSpec.js b/packages/engine/Specs/Scene/Model/ModelAnimationCollectionSpec.js index cc938fab9721..b6c1f392a4e6 100644 --- a/packages/engine/Specs/Scene/Model/ModelAnimationCollectionSpec.js +++ b/packages/engine/Specs/Scene/Model/ModelAnimationCollectionSpec.js @@ -19,7 +19,7 @@ describe( "./Data/Models/glTF-2.0/InterpolationTest/glTF-Binary/InterpolationTest.glb"; const defaultDate = JulianDate.fromDate( - new Date("January 1, 2014 12:00:00 UTC") + new Date("January 1, 2014 12:00:00 UTC"), ); const scratchJulianDate = new JulianDate(); let scene; @@ -42,7 +42,7 @@ describe( { gltf: animatedTriangleUrl, }, - scene + scene, ).then(function (model) { const animationCollection = model.activeAnimations; expect(animationCollection).toBeDefined(); @@ -68,7 +68,7 @@ describe( { gltf: animatedTriangleUrl, }, - scene + scene, ).then(function (model) { expect(function () { model.activeAnimations.add({}); @@ -81,7 +81,7 @@ describe( { gltf: animatedTriangleUrl, }, - scene + scene, ).then(function (model) { expect(function () { model.activeAnimations.add({ @@ -96,7 +96,7 @@ describe( { gltf: animatedTriangleUrl, }, - scene + scene, ).then(function (model) { expect(function () { model.activeAnimations.add({ @@ -111,7 +111,7 @@ describe( { gltf: animatedTriangleUrl, }, - scene + scene, ).then(function (model) { expect(function () { model.activeAnimations.add({ @@ -127,7 +127,7 @@ describe( { gltf: animatedTriangleUrl, }, - scene + scene, ).then(function (model) { const runtimeAnimation = model.activeAnimations.add({ name: "Sample Animation", @@ -137,7 +137,7 @@ describe( expect(animationCollection.length).toBe(1); expect(runtimeAnimation).toBe( - animationCollection._runtimeAnimations[0] + animationCollection._runtimeAnimations[0], ); expect(runtimeAnimation.startTime).toBeUndefined(); expect(runtimeAnimation.delay).toBe(0.0); @@ -154,7 +154,7 @@ describe( { gltf: animatedTriangleUrl, }, - scene + scene, ).then(function (model) { const runtimeAnimation = model.activeAnimations.add({ index: 0, @@ -164,7 +164,7 @@ describe( expect(animationCollection.length).toBe(1); expect(runtimeAnimation).toBe( - animationCollection._runtimeAnimations[0] + animationCollection._runtimeAnimations[0], ); expect(runtimeAnimation.startTime).toBeUndefined(); expect(runtimeAnimation.delay).toBe(0.0); @@ -181,16 +181,16 @@ describe( { gltf: animatedTriangleUrl, }, - scene + scene, ).then(function (model) { const options = { index: 0, startTime: JulianDate.fromDate( - new Date("January 1, 2014 12:00:00 UTC") + new Date("January 1, 2014 12:00:00 UTC"), ), delay: 5.0, stopTime: JulianDate.fromDate( - new Date("January 1, 2014 12:01:30 UTC") + new Date("January 1, 2014 12:01:30 UTC"), ), multiplier: 0.5, reverse: true, @@ -203,7 +203,7 @@ describe( expect(animationCollection.length).toBe(1); expect(runtimeAnimation).toBe( - animationCollection._runtimeAnimations[0] + animationCollection._runtimeAnimations[0], ); expect(runtimeAnimation.startTime).toEqual(options.startTime); expect(runtimeAnimation.delay).toBe(5.0); @@ -230,7 +230,7 @@ describe( { gltf: interpolationTestUrl, }, - scene + scene, ).then(function (model) { expect(function () { model.activeAnimations.addAll({ @@ -245,7 +245,7 @@ describe( { gltf: interpolationTestUrl, }, - scene + scene, ).then(function (model) { const runtimeAnimations = model.activeAnimations.addAll(); @@ -256,7 +256,7 @@ describe( for (let i = 0; i < length; i++) { const runtimeAnimation = runtimeAnimations[i]; expect(runtimeAnimation).toBe( - animationCollection._runtimeAnimations[i] + animationCollection._runtimeAnimations[i], ); expect(runtimeAnimation.startTime).toBeUndefined(); expect(runtimeAnimation.delay).toBe(0.0); @@ -274,15 +274,15 @@ describe( { gltf: interpolationTestUrl, }, - scene + scene, ).then(function (model) { const options = { startTime: JulianDate.fromDate( - new Date("January 1, 2014 12:00:00 UTC") + new Date("January 1, 2014 12:00:00 UTC"), ), delay: 5.0, stopTime: JulianDate.fromDate( - new Date("January 1, 2014 12:01:30 UTC") + new Date("January 1, 2014 12:01:30 UTC"), ), multiplier: 0.5, reverse: true, @@ -298,7 +298,7 @@ describe( for (let i = 0; i < length; i++) { const runtimeAnimation = runtimeAnimations[i]; expect(runtimeAnimation).toBe( - animationCollection._runtimeAnimations[i] + animationCollection._runtimeAnimations[i], ); expect(runtimeAnimation.startTime).toEqual(options.startTime); expect(runtimeAnimation.delay).toBe(5.0); @@ -316,7 +316,7 @@ describe( { gltf: animatedTriangleUrl, }, - scene + scene, ).then(function (model) { const animationCollection = model.activeAnimations; animationCollection.add({ index: 0 }); @@ -329,13 +329,13 @@ describe( { gltf: animatedTriangleUrl, }, - scene + scene, ).then(function (firstModel) { return loadAndZoomToModelAsync( { gltf: animatedTriangleUrl, }, - scene + scene, ).then(function (secondModel) { const firstCollection = firstModel.activeAnimations; const animation = firstCollection.add({ index: 0 }); @@ -350,7 +350,7 @@ describe( { gltf: animatedTriangleUrl, }, - scene + scene, ).then(function (model) { const animationCollection = model.activeAnimations; const animation = animationCollection.add({ index: 0 }); @@ -363,7 +363,7 @@ describe( { gltf: animatedTriangleUrl, }, - scene + scene, ).then(function (model) { const animationCollection = model.activeAnimations; animationCollection.add({ index: 0 }); @@ -378,7 +378,7 @@ describe( { gltf: animatedTriangleUrl, }, - scene + scene, ).then(function (model) { const animationCollection = model.activeAnimations; animationCollection.add({ index: 0 }); @@ -393,7 +393,7 @@ describe( { gltf: interpolationTestUrl, }, - scene + scene, ).then(function (model) { const animationCollection = model.activeAnimations; const animation = animationCollection.add({ index: 3 }); @@ -406,7 +406,7 @@ describe( { gltf: animatedTriangleUrl, }, - scene + scene, ).then(function (model) { const animationCollection = model.activeAnimations; animationCollection.add({ index: 0 }); @@ -419,13 +419,13 @@ describe( { gltf: animatedTriangleUrl, }, - scene + scene, ).then(function (firstModel) { return loadAndZoomToModelAsync( { gltf: animatedTriangleUrl, }, - scene + scene, ).then(function (secondModel) { const firstCollection = firstModel.activeAnimations; const animation = firstCollection.add({ index: 0 }); @@ -440,7 +440,7 @@ describe( { gltf: interpolationTestUrl, }, - scene + scene, ).then(function (model) { const animationCollection = model.activeAnimations; const animationToRemove = animationCollection.add({ index: 0 }); @@ -460,7 +460,7 @@ describe( { gltf: interpolationTestUrl, }, - scene + scene, ).then(function (model) { const animationCollection = model.activeAnimations; animationCollection.addAll(); @@ -475,7 +475,7 @@ describe( { gltf: interpolationTestUrl, }, - scene + scene, ).then(function (model) { const animationCollection = model.activeAnimations; expect(animationCollection.length).toBe(0); @@ -488,7 +488,7 @@ describe( { gltf: animatedTriangleUrl, }, - scene + scene, ).then(function (model) { let time = defaultDate; const animations = model.activeAnimations; @@ -516,7 +516,7 @@ describe( time = JulianDate.addSeconds(time, 1.0, scratchJulianDate); return stopped; }, - { timeout: 10000 } + { timeout: 10000 }, ).then(function () { expect(spyStart).toHaveBeenCalledWith(model, animation); @@ -540,7 +540,7 @@ describe( { gltf: animatedTriangleUrl, }, - scene + scene, ).then(function (model) { const time = defaultDate; const animationCollection = model.activeAnimations; @@ -553,10 +553,10 @@ describe( scene.renderForSpecs(time); scene.renderForSpecs( - JulianDate.addSeconds(time, 1.0, scratchJulianDate) + JulianDate.addSeconds(time, 1.0, scratchJulianDate), ); scene.renderForSpecs( - JulianDate.addSeconds(time, 2.0, scratchJulianDate) + JulianDate.addSeconds(time, 2.0, scratchJulianDate), ); expect(spyUpdate.calls.count()).toEqual(3); @@ -572,7 +572,7 @@ describe( { gltf: animatedTriangleUrl, }, - scene + scene, ).then(function (model) { const time = defaultDate; const animationCollection = model.activeAnimations; @@ -587,7 +587,7 @@ describe( scene.renderForSpecs(time); // Does not fire start event scene.renderForSpecs( - JulianDate.addSeconds(time, 1.0, scratchJulianDate) + JulianDate.addSeconds(time, 1.0, scratchJulianDate), ); expect(spyStart.calls.count()).toEqual(1); @@ -599,7 +599,7 @@ describe( { gltf: animatedTriangleUrl, }, - scene + scene, ).then(function (model) { const time = defaultDate; const animationCollection = model.activeAnimations; @@ -612,10 +612,10 @@ describe( animation.update.addEventListener(spyUpdate); scene.renderForSpecs( - JulianDate.addSeconds(time, -2.0, scratchJulianDate) + JulianDate.addSeconds(time, -2.0, scratchJulianDate), ); scene.renderForSpecs( - JulianDate.addSeconds(time, -1.0, scratchJulianDate) + JulianDate.addSeconds(time, -1.0, scratchJulianDate), ); scene.renderForSpecs(time); @@ -629,10 +629,10 @@ describe( { gltf: animatedTriangleUrl, }, - scene + scene, ).then(function (model) { const time = JulianDate.fromDate( - new Date("January 1, 2014 12:00:00 UTC") + new Date("January 1, 2014 12:00:00 UTC"), ); const endDate = new Date("January 1, 2014 12:00:00 UTC"); endDate.setMilliseconds(500); @@ -650,10 +650,10 @@ describe( scene.renderForSpecs(time); scene.renderForSpecs( - JulianDate.addSeconds(time, 0.5, scratchJulianDate) + JulianDate.addSeconds(time, 0.5, scratchJulianDate), ); scene.renderForSpecs( - JulianDate.addSeconds(time, 1.0, scratchJulianDate) + JulianDate.addSeconds(time, 1.0, scratchJulianDate), ); expect(spyUpdate.calls.count()).toEqual(3); @@ -668,7 +668,7 @@ describe( { gltf: animatedTriangleUrl, }, - scene + scene, ).then(function (model) { const time = defaultDate; const animationCollection = model.activeAnimations; @@ -686,34 +686,34 @@ describe( scene.renderForSpecs(time); animationTime = 0.1; scene.renderForSpecs( - JulianDate.addSeconds(time, 1.0, scratchJulianDate) + JulianDate.addSeconds(time, 1.0, scratchJulianDate), ); // no update because animationTime didn't change scene.renderForSpecs( - JulianDate.addSeconds(time, 2.0, scratchJulianDate) + JulianDate.addSeconds(time, 2.0, scratchJulianDate), ); animationTime = 0.2; // no update because scene time didn't change scene.renderForSpecs( - JulianDate.addSeconds(time, 2.0, scratchJulianDate) + JulianDate.addSeconds(time, 2.0, scratchJulianDate), ); animationTime = 0.3; scene.renderForSpecs( - JulianDate.addSeconds(time, 3.0, scratchJulianDate) + JulianDate.addSeconds(time, 3.0, scratchJulianDate), ); expect(spyUpdate.calls.count()).toEqual(3); expect(spyUpdate.calls.argsFor(0)[2]).toEqualEpsilon( 0.0, - CesiumMath.EPSILON14 + CesiumMath.EPSILON14, ); expect(spyUpdate.calls.argsFor(1)[2]).toEqualEpsilon( 0.1, - CesiumMath.EPSILON14 + CesiumMath.EPSILON14, ); expect(spyUpdate.calls.argsFor(2)[2]).toEqualEpsilon( 0.3, - CesiumMath.EPSILON14 + CesiumMath.EPSILON14, ); }); }); @@ -723,7 +723,7 @@ describe( { gltf: animatedTriangleUrl, }, - scene + scene, ).then(function (model) { const time = defaultDate; const animationCollection = model.activeAnimations; @@ -750,15 +750,15 @@ describe( expect(spyUpdate.calls.count()).toEqual(3); expect(spyUpdate.calls.argsFor(0)[2]).toEqualEpsilon( 0.0, - CesiumMath.EPSILON14 + CesiumMath.EPSILON14, ); expect(spyUpdate.calls.argsFor(1)[2]).toEqualEpsilon( 0.1, - CesiumMath.EPSILON14 + CesiumMath.EPSILON14, ); expect(spyUpdate.calls.argsFor(2)[2]).toEqualEpsilon( 0.3, - CesiumMath.EPSILON14 + CesiumMath.EPSILON14, ); }); }); @@ -768,7 +768,7 @@ describe( { gltf: animatedTriangleUrl, }, - scene + scene, ).then(function (model) { const time = defaultDate; const animationCollection = model.activeAnimations; @@ -783,10 +783,10 @@ describe( scene.renderForSpecs(time); scene.renderForSpecs( - JulianDate.addSeconds(time, 1.0, scratchJulianDate) + JulianDate.addSeconds(time, 1.0, scratchJulianDate), ); scene.renderForSpecs( - JulianDate.addSeconds(time, 2.0, scratchJulianDate) + JulianDate.addSeconds(time, 2.0, scratchJulianDate), ); expect(spyUpdate.calls.count()).toEqual(3); @@ -801,7 +801,7 @@ describe( { gltf: animatedTriangleUrl, }, - scene + scene, ).then(function (model) { const time = defaultDate; const animationCollection = model.activeAnimations; @@ -816,10 +816,10 @@ describe( scene.renderForSpecs(time); scene.renderForSpecs( - JulianDate.addSeconds(time, 0.5, scratchJulianDate) + JulianDate.addSeconds(time, 0.5, scratchJulianDate), ); scene.renderForSpecs( - JulianDate.addSeconds(time, 1.0, scratchJulianDate) + JulianDate.addSeconds(time, 1.0, scratchJulianDate), ); expect(spyUpdate.calls.count()).toEqual(3); @@ -834,7 +834,7 @@ describe( { gltf: animatedTriangleUrl, }, - scene + scene, ).then(function (model) { const time = defaultDate; const animationCollection = model.activeAnimations; @@ -849,13 +849,13 @@ describe( scene.renderForSpecs(time); scene.renderForSpecs( - JulianDate.addSeconds(time, 0.5, scratchJulianDate) + JulianDate.addSeconds(time, 0.5, scratchJulianDate), ); scene.renderForSpecs( - JulianDate.addSeconds(time, 1.0, scratchJulianDate) + JulianDate.addSeconds(time, 1.0, scratchJulianDate), ); scene.renderForSpecs( - JulianDate.addSeconds(time, 1.5, scratchJulianDate) + JulianDate.addSeconds(time, 1.5, scratchJulianDate), ); expect(spyUpdate.calls.count()).toEqual(4); @@ -871,7 +871,7 @@ describe( { gltf: animatedTriangleUrl, }, - scene + scene, ).then(function (model) { const time = defaultDate; const animationCollection = model.activeAnimations; @@ -886,16 +886,16 @@ describe( scene.renderForSpecs(time); scene.renderForSpecs( - JulianDate.addSeconds(time, 0.5, scratchJulianDate) + JulianDate.addSeconds(time, 0.5, scratchJulianDate), ); scene.renderForSpecs( - JulianDate.addSeconds(time, 1.0, scratchJulianDate) + JulianDate.addSeconds(time, 1.0, scratchJulianDate), ); scene.renderForSpecs( - JulianDate.addSeconds(time, 1.5, scratchJulianDate) + JulianDate.addSeconds(time, 1.5, scratchJulianDate), ); scene.renderForSpecs( - JulianDate.addSeconds(time, 2.0, scratchJulianDate) + JulianDate.addSeconds(time, 2.0, scratchJulianDate), ); expect(spyUpdate.calls.count()).toEqual(5); @@ -907,5 +907,5 @@ describe( }); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/Model/ModelAnimationSpec.js b/packages/engine/Specs/Scene/Model/ModelAnimationSpec.js index 12d2b936b02a..045d5d33c025 100644 --- a/packages/engine/Specs/Scene/Model/ModelAnimationSpec.js +++ b/packages/engine/Specs/Scene/Model/ModelAnimationSpec.js @@ -84,12 +84,12 @@ describe("Scene/Model/ModelAnimation", function () { createMockChannel( mockNode, mockTranslationSampler, - AnimatedPropertyType.TRANSLATION + AnimatedPropertyType.TRANSLATION, ), createMockChannel( mockNode, mockRotationSampler, - AnimatedPropertyType.ROTATION + AnimatedPropertyType.ROTATION, ), ], name: "Sample Animation", @@ -98,7 +98,7 @@ describe("Scene/Model/ModelAnimation", function () { const runtimeAnimation = new ModelAnimation( mockModel, mockAnimation, - emptyOptions + emptyOptions, ); expect(runtimeAnimation.animation).toBe(mockAnimation); @@ -128,12 +128,12 @@ describe("Scene/Model/ModelAnimation", function () { createMockChannel( mockNode, mockTranslationSampler, - AnimatedPropertyType.TRANSLATION + AnimatedPropertyType.TRANSLATION, ), createMockChannel( mockNode, mockRotationSampler, - AnimatedPropertyType.ROTATION + AnimatedPropertyType.ROTATION, ), ], name: "Sample Animation", @@ -152,7 +152,7 @@ describe("Scene/Model/ModelAnimation", function () { const runtimeAnimation = new ModelAnimation( mockModel, mockAnimation, - options + options, ); expect(runtimeAnimation.animation).toBe(mockAnimation); @@ -182,7 +182,7 @@ describe("Scene/Model/ModelAnimation", function () { createMockChannel( mockNode, mockTranslationSampler, - AnimatedPropertyType.TRANSLATION + AnimatedPropertyType.TRANSLATION, ), { sampler: mockRotationSampler, @@ -195,7 +195,7 @@ describe("Scene/Model/ModelAnimation", function () { const runtimeAnimation = new ModelAnimation( mockModel, mockAnimation, - emptyOptions + emptyOptions, ); expect(runtimeAnimation.animation).toBe(mockAnimation); @@ -216,12 +216,12 @@ describe("Scene/Model/ModelAnimation", function () { createMockChannel( mockNode, mockTranslationSampler, - AnimatedPropertyType.TRANSLATION + AnimatedPropertyType.TRANSLATION, ), createMockChannel( mockNode, mockRotationSampler, - AnimatedPropertyType.ROTATION + AnimatedPropertyType.ROTATION, ), ], name: "Sample Animation", @@ -230,7 +230,7 @@ describe("Scene/Model/ModelAnimation", function () { const runtimeAnimation = new ModelAnimation( mockModel, mockAnimation, - emptyOptions + emptyOptions, ); expect(runtimeNode.translation).toEqual(Cartesian3.ZERO); @@ -245,7 +245,7 @@ describe("Scene/Model/ModelAnimation", function () { expect(runtimeNode.translation).toEqual(new Cartesian3(4.0, 5.0, 6.0)); expect(runtimeNode.rotation).toEqual( - new Quaternion(0.0, 0.0, 0.707, -0.707) + new Quaternion(0.0, 0.0, 0.707, -0.707), ); }); }); diff --git a/packages/engine/Specs/Scene/Model/ModelArticulationSpec.js b/packages/engine/Specs/Scene/Model/ModelArticulationSpec.js index 4cc07a260bd3..804d78bec6e3 100644 --- a/packages/engine/Specs/Scene/Model/ModelArticulationSpec.js +++ b/packages/engine/Specs/Scene/Model/ModelArticulationSpec.js @@ -195,7 +195,7 @@ describe("Scene/Model/ModelArticulation", function () { const transform = Matrix4.fromTranslation( new Cartesian3(1.0, 2.0, 3.0), - new Matrix4() + new Matrix4(), ); const node = mockRuntimeNode(transform); @@ -216,7 +216,7 @@ describe("Scene/Model/ModelArticulation", function () { const transform = Matrix4.fromTranslation( new Cartesian3(1.0, 2.0, 3.0), - new Matrix4() + new Matrix4(), ); const node = mockRuntimeNode(transform); @@ -226,7 +226,7 @@ describe("Scene/Model/ModelArticulation", function () { let expectedMatrix = Matrix4.fromTranslation( new Cartesian3(50.0, 0.0, 0.0), - new Matrix4() + new Matrix4(), ); const rotation = CesiumMath.toRadians(180.0); @@ -235,19 +235,19 @@ describe("Scene/Model/ModelArticulation", function () { expectedMatrix = Matrix4.multiplyByMatrix3( expectedMatrix, expectedRotation, - expectedMatrix + expectedMatrix, ); expectedMatrix = Matrix4.multiplyByUniformScale( expectedMatrix, 0.5, - expectedMatrix + expectedMatrix, ); expectedMatrix = Matrix4.multiplyTransformation( transform, expectedMatrix, - expectedMatrix + expectedMatrix, ); runtimeArticulation.apply(); diff --git a/packages/engine/Specs/Scene/Model/ModelArticulationStageSpec.js b/packages/engine/Specs/Scene/Model/ModelArticulationStageSpec.js index 13e8be131b3d..490e94330f9a 100644 --- a/packages/engine/Specs/Scene/Model/ModelArticulationStageSpec.js +++ b/packages/engine/Specs/Scene/Model/ModelArticulationStageSpec.js @@ -157,11 +157,11 @@ describe("Scene/Model/ModelArticulationStage", function () { 50.0, 0.0, 0.0, - scratchCartesian3 + scratchCartesian3, ); const expectedMatrix = Matrix4.fromTranslation( expectedTranslation, - scratchExpectedMatrix + scratchExpectedMatrix, ); let resultMatrix = Matrix4.clone(Matrix4.IDENTITY, scratchResultMatrix); @@ -191,11 +191,11 @@ describe("Scene/Model/ModelArticulationStage", function () { 0.0, 50.0, 0.0, - scratchCartesian3 + scratchCartesian3, ); const expectedMatrix = Matrix4.fromTranslation( expectedTranslation, - scratchExpectedMatrix + scratchExpectedMatrix, ); let resultMatrix = Matrix4.clone(Matrix4.IDENTITY, scratchResultMatrix); @@ -225,11 +225,11 @@ describe("Scene/Model/ModelArticulationStage", function () { 0.0, 0.0, 50.0, - scratchCartesian3 + scratchCartesian3, ); const expectedMatrix = Matrix4.fromTranslation( expectedTranslation, - scratchExpectedMatrix + scratchExpectedMatrix, ); let resultMatrix = Matrix4.clone(Matrix4.IDENTITY, scratchResultMatrix); @@ -258,7 +258,7 @@ describe("Scene/Model/ModelArticulationStage", function () { const expectedRotation = Matrix3.fromRotationX(value, scratchMatrix3); const expectedMatrix = Matrix4.fromRotation( expectedRotation, - scratchExpectedMatrix + scratchExpectedMatrix, ); let resultMatrix = Matrix4.clone(Matrix4.IDENTITY, scratchResultMatrix); @@ -288,7 +288,7 @@ describe("Scene/Model/ModelArticulationStage", function () { const expectedRotation = Matrix3.fromRotationY(value, scratchMatrix3); const expectedMatrix = Matrix4.fromRotation( expectedRotation, - scratchExpectedMatrix + scratchExpectedMatrix, ); let resultMatrix = Matrix4.clone(Matrix4.IDENTITY, scratchResultMatrix); @@ -318,7 +318,7 @@ describe("Scene/Model/ModelArticulationStage", function () { const expectedRotation = Matrix3.fromRotationZ(value, scratchMatrix3); const expectedMatrix = Matrix4.fromRotation( expectedRotation, - scratchExpectedMatrix + scratchExpectedMatrix, ); let resultMatrix = Matrix4.clone(Matrix4.IDENTITY, scratchResultMatrix); @@ -348,11 +348,11 @@ describe("Scene/Model/ModelArticulationStage", function () { 0.5, 1.0, 1.0, - scratchCartesian3 + scratchCartesian3, ); const expectedMatrix = Matrix4.fromScale( expectedScale, - scratchExpectedMatrix + scratchExpectedMatrix, ); let resultMatrix = Matrix4.clone(Matrix4.IDENTITY, scratchResultMatrix); @@ -382,11 +382,11 @@ describe("Scene/Model/ModelArticulationStage", function () { 1.0, 0.5, 1.0, - scratchCartesian3 + scratchCartesian3, ); const expectedMatrix = Matrix4.fromScale( expectedScale, - scratchExpectedMatrix + scratchExpectedMatrix, ); let resultMatrix = Matrix4.clone(Matrix4.IDENTITY, scratchResultMatrix); @@ -416,11 +416,11 @@ describe("Scene/Model/ModelArticulationStage", function () { 1.0, 1.0, 0.5, - scratchCartesian3 + scratchCartesian3, ); const expectedMatrix = Matrix4.fromScale( expectedScale, - scratchExpectedMatrix + scratchExpectedMatrix, ); let resultMatrix = Matrix4.clone(Matrix4.IDENTITY, scratchResultMatrix); diff --git a/packages/engine/Specs/Scene/Model/ModelClippingPlanesPipelineStageSpec.js b/packages/engine/Specs/Scene/Model/ModelClippingPlanesPipelineStageSpec.js index 734a88a3b433..d51edda0f504 100644 --- a/packages/engine/Specs/Scene/Model/ModelClippingPlanesPipelineStageSpec.js +++ b/packages/engine/Specs/Scene/Model/ModelClippingPlanesPipelineStageSpec.js @@ -45,7 +45,7 @@ describe("Scene/Model/ModelClippingPlanesPipelineStage", function () { ModelClippingPlanesPipelineStage.process( renderResources, mockModel, - mockFrameState + mockFrameState, ); ShaderBuilderTester.expectHasFragmentDefines(shaderBuilder, [ @@ -69,17 +69,17 @@ describe("Scene/Model/ModelClippingPlanesPipelineStage", function () { edgeColor.r, edgeColor.g, edgeColor.b, - clippingPlanes.edgeWidth + clippingPlanes.edgeWidth, ); expect( - Color.equals(uniformMap.model_clippingPlanesEdgeStyle(), expectedStyle) + Color.equals(uniformMap.model_clippingPlanesEdgeStyle(), expectedStyle), ).toBe(true); expect( Matrix4.equals( uniformMap.model_clippingPlanesMatrix(), - mockModel._clippingPlanesMatrix - ) + mockModel._clippingPlanesMatrix, + ), ).toBe(true); ShaderBuilderTester.expectFragmentLinesEqual(shaderBuilder, [ @@ -108,7 +108,7 @@ describe("Scene/Model/ModelClippingPlanesPipelineStage", function () { ModelClippingPlanesPipelineStage.process( renderResources, mockModel, - mockFrameState + mockFrameState, ); ShaderBuilderTester.expectHasFragmentDefines(shaderBuilder, [ @@ -146,7 +146,7 @@ describe("Scene/Model/ModelClippingPlanesPipelineStage", function () { ModelClippingPlanesPipelineStage.process( renderResources, mockModel, - mockFrameState + mockFrameState, ); ShaderBuilderTester.expectHasFragmentDefines(shaderBuilder, [ diff --git a/packages/engine/Specs/Scene/Model/ModelClippingPolygonsPipelineStageSpec.js b/packages/engine/Specs/Scene/Model/ModelClippingPolygonsPipelineStageSpec.js index 756d865e8688..964c0990130c 100644 --- a/packages/engine/Specs/Scene/Model/ModelClippingPolygonsPipelineStageSpec.js +++ b/packages/engine/Specs/Scene/Model/ModelClippingPolygonsPipelineStageSpec.js @@ -14,12 +14,8 @@ import createContext from "../../../../../Specs/createContext.js"; describe("Scene/Model/ModelClippingPolygonsPipelineStage", function () { const positions = Cartesian3.fromRadiansArray([ - -1.3194369277314022, - 0.6988062530900625, - -1.31941, - 0.69879, - -1.3193931220959367, - 0.698743632490865, + -1.3194369277314022, 0.6988062530900625, -1.31941, 0.69879, + -1.3193931220959367, 0.698743632490865, ]); let polygon, clippingPolygons, context, model; @@ -69,7 +65,7 @@ describe("Scene/Model/ModelClippingPolygonsPipelineStage", function () { ModelClippingPolygonsPipelineStage.process( renderResources, model, - mockFrameState + mockFrameState, ); ShaderBuilderTester.expectHasVertexDefines(shaderBuilder, [ @@ -132,7 +128,7 @@ describe("Scene/Model/ModelClippingPolygonsPipelineStage", function () { ModelClippingPolygonsPipelineStage.process( renderResources, model, - mockFrameState + mockFrameState, ); ShaderBuilderTester.expectHasVertexDefines(shaderBuilder, [ diff --git a/packages/engine/Specs/Scene/Model/ModelColorPipelineStageSpec.js b/packages/engine/Specs/Scene/Model/ModelColorPipelineStageSpec.js index d68bec1590c9..4d1ac96a7d19 100644 --- a/packages/engine/Specs/Scene/Model/ModelColorPipelineStageSpec.js +++ b/packages/engine/Specs/Scene/Model/ModelColorPipelineStageSpec.js @@ -50,8 +50,8 @@ describe( expect(uniformMap.model_colorBlend()).toEqual( ColorBlendMode.getColorBlend( mockModel.colorBlendMode, - mockModel.colorBlendAmount - ) + mockModel.colorBlendAmount, + ), ); }); @@ -82,8 +82,8 @@ describe( expect(uniformMap.model_colorBlend()).toEqual( ColorBlendMode.getColorBlend( mockModel.colorBlendMode, - mockModel.colorBlendAmount - ) + mockModel.colorBlendAmount, + ), ); }); @@ -110,5 +110,5 @@ describe( }); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/Model/ModelDrawCommandSpec.js b/packages/engine/Specs/Scene/Model/ModelDrawCommandSpec.js index 6e86f1b0f1b6..565e227470e5 100644 --- a/packages/engine/Specs/Scene/Model/ModelDrawCommandSpec.js +++ b/packages/engine/Specs/Scene/Model/ModelDrawCommandSpec.js @@ -119,14 +119,14 @@ describe( const boundingSphereTransform2D = defaultValue( options.boundingSphereTransform2D, - Matrix4.IDENTITY + Matrix4.IDENTITY, ); const sceneGraph = resources.model.sceneGraph; sceneGraph._boundingSphere2D = BoundingSphere.transform( sceneGraph._boundingSphere2D, boundingSphereTransform2D, - sceneGraph._boundingSphere2D + sceneGraph._boundingSphere2D, ); return resources; @@ -137,14 +137,14 @@ describe( options.modelMatrix = defaultValue( options.modelMatrix, - Matrix4.clone(Matrix4.IDENTITY) + Matrix4.clone(Matrix4.IDENTITY), ); const boundingSphere = new BoundingSphere(Cartesian3.ZERO, 1.0); options.boundingVolume = BoundingSphere.transform( boundingSphere, options.modelMatrix, - boundingSphere + boundingSphere, ); options.renderState = defaultValue( @@ -154,7 +154,7 @@ describe( enabled: true, func: DepthFunction.LESS_OR_EQUAL, }, - }) + }), ); options.pass = defaultValue(options.pass, Pass.OPAQUE); @@ -165,13 +165,13 @@ describe( const idlMatrix = Matrix4.fromTranslation( Cartesian3.fromDegrees(180, 0), - new Matrix4() + new Matrix4(), ); const idlMatrix2D = Transforms.basisTo2D( mockFrameState2D.mapProjection, idlMatrix, - idlMatrix + idlMatrix, ); // Creates a ModelDrawCommand with the specified derived commands. @@ -208,7 +208,7 @@ describe( if (derive2D) { drawCommand.pushCommands( mockFrameState2D, - mockFrameState2D.commandList + mockFrameState2D.commandList, ); mockFrameState2D.commandList.length = 0; } @@ -239,7 +239,7 @@ describe( // Verify if the skip level of detail commands are defined / undefined. const skipLevelOfDetailDefined = defaultValue( expected.skipLevelOfDetail, - false + false, ); const skipLodBackfaceCommand = drawCommand._skipLodBackfaceCommand; const skipLodStencilCommand = drawCommand._skipLodStencilCommand; @@ -257,11 +257,11 @@ describe( function verifyDerivedCommandUpdateFlags(derivedCommand, expected) { expect(derivedCommand.updateShadows).toEqual(expected.updateShadows); expect(derivedCommand.updateBackFaceCulling).toEqual( - expected.updateBackFaceCulling + expected.updateBackFaceCulling, ); expect(derivedCommand.updateCullFace).toEqual(expected.updateCullFace); expect(derivedCommand.updateDebugShowBoundingVolume).toEqual( - expected.updateDebugShowBoundingVolume + expected.updateDebugShowBoundingVolume, ); } @@ -298,7 +298,7 @@ describe( expect(drawCommand.command).toBe(command); expect(drawCommand.runtimePrimitive).toBe( - renderResources.runtimePrimitive + renderResources.runtimePrimitive, ); expect(drawCommand.model).toBe(renderResources.model); @@ -379,7 +379,7 @@ describe( function verifySilhouetteModelDerivedCommand( derivedCommand, stencilReference, - modelIsInvisible + modelIsInvisible, ) { const command = derivedCommand.command; const renderState = command.renderState; @@ -420,7 +420,7 @@ describe( function verifySilhouetteColorDerivedCommand( derivedCommand, stencilReference, - silhouetteIsTranslucent + silhouetteIsTranslucent, ) { const command = derivedCommand.command; const renderState = command.renderState; @@ -467,7 +467,7 @@ describe( drawCommand, modelIsTranslucent, modelIsInvisible, - silhouetteIsTranslucent + silhouetteIsTranslucent, ) { const command = drawCommand.command; const derivedCommands = drawCommand._derivedCommands; @@ -499,7 +499,7 @@ describe( verifySilhouetteModelDerivedCommand( silhouetteModelCommand, stencilReference, - modelIsInvisible + modelIsInvisible, ); const silhouetteColorCommand = derivedCommands[2]; @@ -516,7 +516,7 @@ describe( verifySilhouetteColorDerivedCommand( silhouetteColorCommand, stencilReference, - silhouetteIsTranslucent + silhouetteIsTranslucent, ); } @@ -540,7 +540,7 @@ describe( drawCommand, modelIsTranslucent, modelIsInvisible, - silhouetteIsTranslucent + silhouetteIsTranslucent, ); }); @@ -567,7 +567,7 @@ describe( drawCommand, modelIsTranslucent, modelIsInvisible, - silhouetteIsTranslucent + silhouetteIsTranslucent, ); }); @@ -592,7 +592,7 @@ describe( drawCommand, modelIsTranslucent, modelIsInvisible, - silhouetteIsTranslucent + silhouetteIsTranslucent, ); }); @@ -618,7 +618,7 @@ describe( drawCommand, modelIsTranslucent, modelIsInvisible, - silhouetteIsTranslucent + silhouetteIsTranslucent, ); }); }); @@ -657,19 +657,19 @@ describe( expect(stencilTest.enabled).toBe(true); expect(stencilTest.mask).toEqual(StencilConstants.SKIP_LOD_MASK); expect(stencilTest.reference).toEqual( - StencilConstants.CESIUM_3D_TILE_MASK + StencilConstants.CESIUM_3D_TILE_MASK, ); expect(stencilTest.frontFunction).toEqual( - StencilFunction.GREATER_OR_EQUAL + StencilFunction.GREATER_OR_EQUAL, ); expect(stencilTest.frontOperation.zPass).toEqual( - StencilOperation.REPLACE + StencilOperation.REPLACE, ); expect(stencilTest.backFunction).toEqual( - StencilFunction.GREATER_OR_EQUAL + StencilFunction.GREATER_OR_EQUAL, ); expect(stencilTest.backOperation.zPass).toEqual( - StencilOperation.REPLACE + StencilOperation.REPLACE, ); const expectedStencilMask = @@ -928,7 +928,7 @@ describe( drawCommand.pushCommands( mockFrameState2D, - mockFrameState2D.commandList + mockFrameState2D.commandList, ); const originalCommand2D = originalCommand.derivedCommand2D; @@ -940,7 +940,7 @@ describe( expect(originalDrawCommand.modelMatrix).toBe(drawCommand._modelMatrix); expect(originalDrawCommand2D.modelMatrix).toBe( - drawCommand._modelMatrix2D + drawCommand._modelMatrix2D, ); const commandList = mockFrameState2D.commandList; @@ -971,7 +971,7 @@ describe( drawCommand.pushCommands( mockFrameState2D, - mockFrameState2D.commandList + mockFrameState2D.commandList, ); const originalCommand2D = originalCommand.derivedCommand2D; @@ -988,10 +988,10 @@ describe( const translucentDrawCommand2D = translucentCommand2D.command; expect(translucentDrawCommand.modelMatrix).toBe( - drawCommand._modelMatrix + drawCommand._modelMatrix, ); expect(translucentDrawCommand2D.modelMatrix).toBe( - drawCommand._modelMatrix2D + drawCommand._modelMatrix2D, ); const commandList = mockFrameState2D.commandList; @@ -1025,7 +1025,7 @@ describe( drawCommand.pushCommands( mockFrameState2D, - mockFrameState2D.commandList + mockFrameState2D.commandList, ); const silhouetteModelCommand2D = @@ -1078,7 +1078,7 @@ describe( drawCommand.pushCommands( mockFrameState2D, - mockFrameState2D.commandList + mockFrameState2D.commandList, ); const skipLodBackfaceCommand2D = @@ -1094,14 +1094,14 @@ describe( const backfaceDrawCommand2D = skipLodBackfaceCommand2D.command; expect(backfaceDrawCommand.modelMatrix).toBe(drawCommand._modelMatrix); expect(backfaceDrawCommand2D.modelMatrix).toBe( - drawCommand._modelMatrix2D + drawCommand._modelMatrix2D, ); const stencilDrawCommand = skipLodStencilCommand.command; const stencilDrawCommand2D = skipLodStencilCommand2D.command; expect(stencilDrawCommand.modelMatrix).toBe(drawCommand._modelMatrix); expect(stencilDrawCommand2D.modelMatrix).toBe( - drawCommand._modelMatrix2D + drawCommand._modelMatrix2D, ); const commandList = mockFrameState2D.commandList; @@ -1119,12 +1119,12 @@ describe( it("pushCommands doesn't derive 2D commands if model is not near IDL", function () { const modelMatrix = Matrix4.fromTranslation( Cartesian3.fromDegrees(100, 250), - scratchModelMatrix + scratchModelMatrix, ); const modelMatrix2D = Transforms.basisTo2D( mockFrameState2D.mapProjection, modelMatrix, - modelMatrix + modelMatrix, ); const renderResources = mockRenderResources({ boundingSphereTransform2D: modelMatrix2D, @@ -1142,7 +1142,7 @@ describe( drawCommand.pushCommands( mockFrameState2D, - mockFrameState2D.commandList + mockFrameState2D.commandList, ); // The 2D command should not be derived. @@ -1167,22 +1167,22 @@ describe( const translation = Matrix4.getTranslation( idlMatrix2D, - scratchTranslation + scratchTranslation, ); drawCommand.pushCommands( mockFrameState2D, - mockFrameState2D.commandList + mockFrameState2D.commandList, ); const expectedModelMatrix = computeExpected2DMatrix( idlMatrix2D, - mockFrameState2D + mockFrameState2D, ); const expectedTranslation = Matrix4.getTranslation( expectedModelMatrix, - scratchExpectedTranslation + scratchExpectedTranslation, ); const originalCommand = drawCommand._originalCommand; @@ -1198,7 +1198,7 @@ describe( expect(translucentDrawCommand.modelMatrix).toEqual(idlMatrix2D); expect(originalDrawCommand.boundingVolume.center).toEqual(translation); expect(translucentDrawCommand.boundingVolume.center).toEqual( - translation + translation, ); const originalDrawCommand2D = originalCommand2D.command; @@ -1206,13 +1206,13 @@ describe( expect(originalDrawCommand2D.modelMatrix).toEqual(expectedModelMatrix); expect(translucentDrawCommand2D.modelMatrix).toEqual( - expectedModelMatrix + expectedModelMatrix, ); expect(originalDrawCommand2D.boundingVolume.center).toEqual( - expectedTranslation + expectedTranslation, ); expect(translucentDrawCommand2D.boundingVolume.center).toEqual( - expectedTranslation + expectedTranslation, ); }); }); @@ -1267,7 +1267,7 @@ describe( const silhouetteCommands = []; drawCommand.pushSilhouetteCommands( mockFrameState2D, - silhouetteCommands + silhouetteCommands, ); expect(silhouetteCommands.length).toEqual(2); expect(silhouetteCommands[0]).toBe(colorDrawCommand); @@ -1293,7 +1293,7 @@ describe( const translation = Cartesian3.fromDegrees(100, 25); const modelMatrix = Matrix4.fromTranslation( translation, - scratchModelMatrix + scratchModelMatrix, ); drawCommand.modelMatrix = modelMatrix; @@ -1316,17 +1316,17 @@ describe( let modelMatrix2D = Matrix4.fromTranslation( Cartesian3.fromDegrees(100, 25), - scratchModelMatrix + scratchModelMatrix, ); modelMatrix2D = Transforms.basisTo2D( mockFrameState2D.mapProjection, modelMatrix2D, - modelMatrix2D + modelMatrix2D, ); const translation = Matrix4.getTranslation( modelMatrix2D, - scratchTranslation + scratchTranslation, ); drawCommand.modelMatrix = modelMatrix2D; @@ -1343,16 +1343,16 @@ describe( // Update the model matrix for the 2D commands drawCommand.pushCommands( mockFrameState2D, - mockFrameState2D.commandList + mockFrameState2D.commandList, ); const expectedModelMatrix = computeExpected2DMatrix( modelMatrix2D, - mockFrameState2D + mockFrameState2D, ); const expectedTranslation = Matrix4.getTranslation( expectedModelMatrix, - scratchExpectedTranslation + scratchExpectedTranslation, ); // The second half of the derived command list contains 2D commands. @@ -1710,7 +1710,7 @@ describe( } expect(command.debugShowBoundingVolume).toBe( - updateDebugShowBoundingVolume + updateDebugShowBoundingVolume, ); } }); @@ -1741,11 +1741,11 @@ describe( } expect(command.debugShowBoundingVolume).toBe( - updateDebugShowBoundingVolume + updateDebugShowBoundingVolume, ); } }); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/Model/ModelFeatureTableSpec.js b/packages/engine/Specs/Scene/Model/ModelFeatureTableSpec.js index ee195d8ce093..d16cd5128f5a 100644 --- a/packages/engine/Specs/Scene/Model/ModelFeatureTableSpec.js +++ b/packages/engine/Specs/Scene/Model/ModelFeatureTableSpec.js @@ -131,7 +131,7 @@ describe("Scene/Model/ModelFeatureTable", function () { for (let i = 0; i < modelFeatures.length; i++) { const feature = modelFeatures[i]; expect(feature.getProperty(propertyName)).toEqual( - propertyValues[propertyName][i] + propertyValues[propertyName][i], ); } } @@ -154,7 +154,7 @@ describe("Scene/Model/ModelFeatureTable", function () { for (i = 0; i < modelFeatures.length; i++) { feature = modelFeatures[i]; expect(feature.getPropertyInherited("height")).toEqual( - propertyValues["height"][i] + propertyValues["height"][i], ); expect(feature.getPropertyInherited("_height")).toBeUndefined(); } @@ -163,7 +163,7 @@ describe("Scene/Model/ModelFeatureTable", function () { for (i = 0; i < modelFeatures.length; i++) { feature = modelFeatures[i]; expect(feature.getPropertyInherited("HEIGHT_SEMANTIC")).toEqual( - propertyValues["height"][i] + propertyValues["height"][i], ); expect(feature.getPropertyInherited("_HEIGHT_")).toBeUndefined(); } diff --git a/packages/engine/Specs/Scene/Model/ModelMatrixUpdateStageSpec.js b/packages/engine/Specs/Scene/Model/ModelMatrixUpdateStageSpec.js index 17ffae777fe4..34d699423f47 100644 --- a/packages/engine/Specs/Scene/Model/ModelMatrixUpdateStageSpec.js +++ b/packages/engine/Specs/Scene/Model/ModelMatrixUpdateStageSpec.js @@ -37,12 +37,12 @@ describe( const rotation = Quaternion.fromAxisAngle( Cartesian3.UNIT_Y, - CesiumMath.toRadians(180) + CesiumMath.toRadians(180), ); const modelMatrix = Matrix4.fromTranslationQuaternionRotationScale( new Cartesian3(10, 0, 0), rotation, - new Cartesian3(1, 1, 1) + new Cartesian3(1, 1, 1), ); let scene; @@ -138,12 +138,12 @@ describe( node.transform = Matrix4.multiplyTransformation( node.transform, transform, - new Matrix4() + new Matrix4(), ); expect(node._transformDirty).toEqual(true); expect( - Matrix4.equals(node.originalTransform, expectedOriginalTransform) + Matrix4.equals(node.originalTransform, expectedOriginalTransform), ).toBe(true); } @@ -152,7 +152,7 @@ describe( { gltf: simpleSkin, }, - scene + scene, ); scene.renderForSpecs(); @@ -168,19 +168,19 @@ describe( const expectedComputedTransform = Matrix4.multiplyTransformation( sceneGraph.computedModelMatrix, node.transform, - new Matrix4() + new Matrix4(), ); const expectedModelMatrix = Matrix4.multiplyTransformation( drawCommand.modelMatrix, transform, - new Matrix4() + new Matrix4(), ); const expectedBoundingSphere = BoundingSphere.transform( primitive.boundingSphere, expectedComputedTransform, - new BoundingSphere() + new BoundingSphere(), ); scene.renderForSpecs(); @@ -190,14 +190,14 @@ describe( Matrix4.equalsEpsilon( drawCommand.modelMatrix, expectedModelMatrix, - CesiumMath.EPSILON15 - ) + CesiumMath.EPSILON15, + ), ).toBe(true); expect( BoundingSphere.equals( drawCommand.boundingVolume, - expectedBoundingSphere - ) + expectedBoundingSphere, + ), ).toBe(true); }); @@ -206,7 +206,7 @@ describe( { gltf: simpleSkin, }, - scene + scene, ); modifyModel(model); @@ -221,23 +221,23 @@ describe( let transformedDrawCommand = getDrawCommand(transformedLeafNode); const childTransformation = Matrix4.fromTranslation( - new Cartesian3(0, 5, 0) + new Cartesian3(0, 5, 0), ); applyTransform(transformedLeafNode, childTransformation); const rootTransformation = Matrix4.fromTranslation( - new Cartesian3(12, 5, 0) + new Cartesian3(12, 5, 0), ); applyTransform(rootNode, rootTransformation); const expectedRootModelMatrix = Matrix4.multiplyTransformation( rootTransformation, rootDrawCommand.modelMatrix, - new Matrix4() + new Matrix4(), ); const expectedStaticLeafModelMatrix = Matrix4.clone( staticDrawCommand.modelMatrix, - new Matrix4() + new Matrix4(), ); const finalTransform = new Matrix4(); @@ -245,7 +245,7 @@ describe( const expectedTransformedLeafModelMatrix = Matrix4.multiplyTransformation( finalTransform, transformedDrawCommand.modelMatrix, - new Matrix4() + new Matrix4(), ); scene.renderForSpecs(); @@ -255,10 +255,10 @@ describe( expect(rootDrawCommand.modelMatrix).toEqual(expectedRootModelMatrix); expect(staticDrawCommand.modelMatrix).toEqual( - expectedStaticLeafModelMatrix + expectedStaticLeafModelMatrix, ); expect(transformedDrawCommand.modelMatrix).toEqual( - expectedTransformedLeafModelMatrix + expectedTransformedLeafModelMatrix, ); }); @@ -267,7 +267,7 @@ describe( { gltf: simpleSkin, }, - scene + scene, ); modifyModel(model); @@ -284,17 +284,17 @@ describe( const expectedRootModelMatrix = Matrix4.multiplyTransformation( modelMatrix, rootDrawCommand.modelMatrix, - new Matrix4() + new Matrix4(), ); const expectedStaticLeafModelMatrix = Matrix4.multiplyTransformation( modelMatrix, staticDrawCommand.modelMatrix, - new Matrix4() + new Matrix4(), ); const expectedTransformedLeafModelMatrix = Matrix4.multiplyTransformation( modelMatrix, transformedDrawCommand.modelMatrix, - new Matrix4() + new Matrix4(), ); model.modelMatrix = modelMatrix; @@ -306,10 +306,10 @@ describe( expect(rootDrawCommand.modelMatrix).toEqual(expectedRootModelMatrix); expect(staticDrawCommand.modelMatrix).toEqual( - expectedStaticLeafModelMatrix + expectedStaticLeafModelMatrix, ); expect(transformedDrawCommand.modelMatrix).toEqual( - expectedTransformedLeafModelMatrix + expectedTransformedLeafModelMatrix, ); }); @@ -318,7 +318,7 @@ describe( { gltf: simpleSkin, }, - scene + scene, ); modifyModel(model); @@ -328,7 +328,7 @@ describe( const scaledModelMatrix = Matrix4.multiplyByUniformScale( modelMatrix, modelScale, - new Matrix4() + new Matrix4(), ); const rootNode = getParentRootNode(model); @@ -342,17 +342,17 @@ describe( const expectedRootModelMatrix = Matrix4.multiplyTransformation( scaledModelMatrix, rootDrawCommand.modelMatrix, - new Matrix4() + new Matrix4(), ); const expectedStaticLeafModelMatrix = Matrix4.multiplyTransformation( scaledModelMatrix, staticDrawCommand.modelMatrix, - new Matrix4() + new Matrix4(), ); const expectedTransformedLeafModelMatrix = Matrix4.multiplyTransformation( scaledModelMatrix, transformedDrawCommand.modelMatrix, - new Matrix4() + new Matrix4(), ); model.modelMatrix = modelMatrix; @@ -364,10 +364,10 @@ describe( expect(rootDrawCommand.modelMatrix).toEqual(expectedRootModelMatrix); expect(staticDrawCommand.modelMatrix).toEqual( - expectedStaticLeafModelMatrix + expectedStaticLeafModelMatrix, ); expect(transformedDrawCommand.modelMatrix).toEqual( - expectedTransformedLeafModelMatrix + expectedTransformedLeafModelMatrix, ); }); @@ -376,7 +376,7 @@ describe( { gltf: simpleSkin, }, - scene + scene, ); modifyModel(model); @@ -401,5 +401,5 @@ describe( expect(childDrawCommand.cullFace).toBe(CullFace.FRONT); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/Model/ModelRenderResourcesSpec.js b/packages/engine/Specs/Scene/Model/ModelRenderResourcesSpec.js index 26c843b4c6fd..6fe8cf58d8ed 100644 --- a/packages/engine/Specs/Scene/Model/ModelRenderResourcesSpec.js +++ b/packages/engine/Specs/Scene/Model/ModelRenderResourcesSpec.js @@ -25,7 +25,7 @@ describe( enabled: true, func: DepthFunction.LESS_OR_EQUAL, }, - }) + }), ); expect(modelResources.model).toBe(mockModel); @@ -35,9 +35,9 @@ describe( expect(modelResources.hasSkipLevelOfDetail).toBe(false); ShaderBuilderTester.expectHasFragmentDefines( modelResources.shaderBuilder, - [] + [], ); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/Model/ModelRuntimeNodeSpec.js b/packages/engine/Specs/Scene/Model/ModelRuntimeNodeSpec.js index 7bf4f8a1c3b6..6f73a0ca076c 100644 --- a/packages/engine/Specs/Scene/Model/ModelRuntimeNodeSpec.js +++ b/packages/engine/Specs/Scene/Model/ModelRuntimeNodeSpec.js @@ -40,7 +40,7 @@ describe("Scene/Model/ModelRuntimeNode", function () { transform, transformToRoot, runtimeNode, - originalTransform + originalTransform, ) { originalTransform = defaultValue(originalTransform, transform); @@ -51,7 +51,7 @@ describe("Scene/Model/ModelRuntimeNode", function () { const computedTransform = Matrix4.multiplyTransformation( transformToRoot, transform, - scratchMatrix + scratchMatrix, ); expect(runtimeNode.computedTransform).toEqual(computedTransform); @@ -275,7 +275,7 @@ describe("Scene/Model/ModelRuntimeNode", function () { const translationMatrix = Matrix4.fromTranslation( translation, - scratchTransform + scratchTransform, ); expect(node.translation).toEqual(translation); @@ -305,7 +305,7 @@ describe("Scene/Model/ModelRuntimeNode", function () { const rotationMatrix3 = Matrix3.fromQuaternion(rotation, new Matrix3()); const rotationMatrix = Matrix4.fromRotation( rotationMatrix3, - scratchTransform + scratchTransform, ); expect(node.rotation).toEqual(rotation); @@ -461,7 +461,7 @@ describe("Scene/Model/ModelRuntimeNode", function () { const newTransform = Matrix4.multiplyByTranslation( Matrix4.IDENTITY, new Cartesian3(10, 0, 0), - new Matrix4() + new Matrix4(), ); node.transform = newTransform; @@ -485,7 +485,7 @@ describe("Scene/Model/ModelRuntimeNode", function () { const newTransform = Matrix4.multiplyByTranslation( Matrix4.IDENTITY, new Cartesian3(10, 0, 0), - new Matrix4() + new Matrix4(), ); node.transform = newTransform; diff --git a/packages/engine/Specs/Scene/Model/ModelSceneGraphSpec.js b/packages/engine/Specs/Scene/Model/ModelSceneGraphSpec.js index 8de1acdc3ee6..147536b015b8 100644 --- a/packages/engine/Specs/Scene/Model/ModelSceneGraphSpec.js +++ b/packages/engine/Specs/Scene/Model/ModelSceneGraphSpec.js @@ -50,7 +50,7 @@ describe( it("creates runtime nodes and runtime primitives from a model", async function () { const model = await loadAndZoomToModelAsync( { gltf: vertexColorGltfUrl }, - scene + scene, ); const sceneGraph = model._sceneGraph; const components = sceneGraph._components; @@ -75,7 +75,7 @@ describe( { gltf: buildingsMetadata, }, - scene + scene, ); model.style = style; @@ -101,7 +101,7 @@ describe( { gltf: buildingsMetadata, }, - scene + scene, ); model.style = style; @@ -131,7 +131,7 @@ describe( { gltf: buildingsMetadata, }, - scene + scene, ); model.style = style; @@ -153,7 +153,7 @@ describe( spyOn(ModelSceneGraph.prototype, "pushDrawCommands").and.callThrough(); const model = await loadAndZoomToModelAsync( { gltf: parentGltfUrl }, - scene + scene, ); const sceneGraph = model._sceneGraph; @@ -183,7 +183,7 @@ describe( it("stores runtime nodes correctly", async function () { const model = await loadAndZoomToModelAsync( { gltf: parentGltfUrl }, - scene + scene, ); const sceneGraph = model._sceneGraph; @@ -204,7 +204,7 @@ describe( upAxis: Axis.Z, forwardAxis: Axis.X, }, - scene + scene, ); const sceneGraph = model._sceneGraph; const components = sceneGraph._components; @@ -214,7 +214,7 @@ describe( expect(components.forwardAxis).toEqual(Axis.X); const parentTransform = ModelUtility.getNodeTransform( - components.nodes[0] + components.nodes[0], ); const childTransform = ModelUtility.getNodeTransform(components.nodes[1]); expect(runtimeNodes[0].transform).toEqual(parentTransform); @@ -226,7 +226,7 @@ describe( it("creates runtime skin from model", async function () { const model = await loadAndZoomToModelAsync( { gltf: simpleSkinGltfUrl }, - scene + scene, ); const sceneGraph = model._sceneGraph; @@ -258,7 +258,7 @@ describe( it("creates articulation from model", async function () { const model = await loadAndZoomToModelAsync( { gltf: boxArticulationsUrl }, - scene + scene, ); const sceneGraph = model._sceneGraph; @@ -283,7 +283,7 @@ describe( { gltf: boxArticulationsUrl, }, - scene + scene, ); const sceneGraph = model._sceneGraph; const runtimeNodes = sceneGraph._runtimeNodes; @@ -325,7 +325,7 @@ describe( color: Color.RED, gltf: parentGltfUrl, }, - scene + scene, ); expect(ModelColorPipelineStage.process).toHaveBeenCalled(); }); @@ -336,7 +336,7 @@ describe( { gltf: buildingsMetadata, }, - scene + scene, ); model.customShader = new CustomShader(); model.update(scene.frameState); @@ -351,7 +351,7 @@ describe( { gltf: buildingsMetadata, }, - scene + scene, ); model.customShader = new CustomShader(); model.update(scene.frameState); @@ -366,7 +366,7 @@ describe( { gltf: buildingsMetadata, }, - scene + scene, ); model.customShader = new CustomShader(); model.update(scene.frameState); @@ -381,7 +381,7 @@ describe( { gltf: buildingsMetadata, }, - scene + scene, ); model.customShader = new CustomShader(); model.update(scene.frameState); @@ -393,7 +393,7 @@ describe( { gltf: duckUrl, }, - scene + scene, ); const frameState = scene.frameState; const commandList = frameState.commandList; @@ -442,5 +442,5 @@ describe( }).toThrowDeveloperError(); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/Model/ModelSilhouettePipelineStageSpec.js b/packages/engine/Specs/Scene/Model/ModelSilhouettePipelineStageSpec.js index a25da3380d4b..243c07aff70c 100644 --- a/packages/engine/Specs/Scene/Model/ModelSilhouettePipelineStageSpec.js +++ b/packages/engine/Specs/Scene/Model/ModelSilhouettePipelineStageSpec.js @@ -57,7 +57,7 @@ describe("Scene/Model/ModelSilhouettePipelineStage", function () { const uniformMap = renderResources.uniformMap; expect(uniformMap.model_silhouetteColor()).toEqual( - mockModel.silhouetteColor + mockModel.silhouetteColor, ); expect(uniformMap.model_silhouetteSize()).toEqual(mockModel.silhouetteSize); expect(uniformMap.model_silhouettePass()).toBe(false); diff --git a/packages/engine/Specs/Scene/Model/ModelSpec.js b/packages/engine/Specs/Scene/Model/ModelSpec.js index 8a6386bd7c18..aa4f099a657a 100644 --- a/packages/engine/Specs/Scene/Model/ModelSpec.js +++ b/packages/engine/Specs/Scene/Model/ModelSpec.js @@ -67,7 +67,7 @@ describe( const animatedTriangleOffset = new HeadingPitchRange( CesiumMath.PI / 2.0, 0, - 2.0 + 2.0, ); const boxTexturedGltfUrl = @@ -127,14 +127,14 @@ describe( const fixedFrameTransform = Transforms.localFrameToFixedFrameGenerator( "north", - "west" + "west", ); const modelMatrix = Transforms.headingPitchRollToFixedFrame( Cartesian3.fromDegrees(-123.0744619, 44.0503706, 0), new HeadingPitchRoll(0, 0, 0), Ellipsoid.WGS84, - fixedFrameTransform + fixedFrameTransform, ); let scene; @@ -177,7 +177,7 @@ describe( const scratchBytes = []; const defaultDate = JulianDate.fromDate( - new Date("January 1, 2014 12:00:00 UTC") + new Date("January 1, 2014 12:00:00 UTC"), ); function verifyRender(model, shouldRender, options) { @@ -191,7 +191,7 @@ describe( const backgroundColor = defaultValue( options.backgroundColor, - Color.BLACK + Color.BLACK, ); const targetScene = defaultValue(options.scene, scene); @@ -245,7 +245,7 @@ describe( const expectedCount = WireframeIndexGenerator.getWireframeIndicesCount( primitiveType, - commandCounts[i] + commandCounts[i], ); expect(command.count).toEqual(expectedCount); } @@ -270,7 +270,7 @@ describe( it("fromGltfAsync throws with undefined url", async function () { await expectAsync( - Model.fromGltfAsync({}) + Model.fromGltfAsync({}), ).toBeRejectedWithDeveloperError(); }); @@ -279,7 +279,7 @@ describe( const buffer = await resource.fetchArrayBuffer(); const model = await loadAndZoomToModelAsync( { gltf: new Uint8Array(buffer) }, - scene + scene, ); expect(model.ready).toEqual(true); expect(model._sceneGraph).toBeDefined(); @@ -295,7 +295,7 @@ describe( gltf: gltf, basePath: boxTexturedGltfUrl, }, - scene + scene, ); expect(model.ready).toEqual(true); expect(model._sceneGraph).toBeDefined(); @@ -311,7 +311,7 @@ describe( gltf: gltf, basePath: microcosm, }, - scene + scene, ); expect(model.ready).toEqual(true); expect(model._sceneGraph).toBeDefined(); @@ -324,7 +324,7 @@ describe( { url: boxTexturedGltfUrl, }, - scene + scene, ); expect(model.ready).toEqual(true); expect(model._sceneGraph).toBeDefined(); @@ -342,11 +342,11 @@ describe( expect(gltf).toEqual( jasmine.objectContaining({ asset: { generator: "COLLADA2GLTF", version: "2.0" }, - }) + }), ); }, }, - scene + scene, ); expect(model.ready).toEqual(true); expect(model._sceneGraph).toBeDefined(); @@ -371,7 +371,7 @@ describe( expect(e).toBeInstanceOf(RuntimeError); expect(e.message).toContain("Failed to load texture"); expect(e.message).toContain( - "Failed to load image: non-existent-path.png" + "Failed to load image: non-existent-path.png", ); finished = true; }); @@ -397,7 +397,7 @@ describe( model.errorEvent.addEventListener((e) => { expect(e).toBeInstanceOf(RuntimeError); expect(e.message).toContain( - `Failed to load model: ${boxTexturedGltfUrl}` + `Failed to load model: ${boxTexturedGltfUrl}`, ); expect(e.message).toContain("Failed to load texture"); finished = true; @@ -424,7 +424,7 @@ describe( model.errorEvent.addEventListener((e) => { expect(e).toBeInstanceOf(RuntimeError); expect(e.message).toContain( - `Failed to load model: ${boxTexturedGltfUrl}` + `Failed to load model: ${boxTexturedGltfUrl}`, ); expect(e.message).toContain("Failed to load vertex buffer"); finished = true; @@ -439,7 +439,7 @@ describe( it("loads with asynchronous set to true", async function () { const jobSchedulerExecute = spyOn( JobScheduler.prototype, - "execute" + "execute", ).and.callThrough(); const model = await loadAndZoomToModelAsync( @@ -447,7 +447,7 @@ describe( gltf: boxTexturedGltfUrl, asynchronous: true, }, - scene + scene, ); const loader = model.loader; expect(loader._asynchronous).toBe(true); @@ -458,7 +458,7 @@ describe( it("loads with asynchronous set to false", async function () { const jobSchedulerExecute = spyOn( JobScheduler.prototype, - "execute" + "execute", ).and.callThrough(); const model = await loadAndZoomToModelAsync( @@ -466,7 +466,7 @@ describe( gltf: boxTexturedGltfUrl, asynchronous: false, }, - scene + scene, ); const loader = model.loader; expect(loader._asynchronous).toBe(false); @@ -477,7 +477,7 @@ describe( it("initializes feature table", async function () { const model = await loadAndZoomToModelAsync( { gltf: buildingsMetadata }, - scene + scene, ); expect(model.ready).toEqual(true); expect(model.featureTables).toBeDefined(); @@ -506,7 +506,7 @@ describe( { gltf: boxTexturedGlbUrl, }, - scene + scene, ); expect(model.show).toEqual(true); expect(model.modelMatrix).toEqual(Matrix4.IDENTITY); @@ -564,17 +564,17 @@ describe( gltf: gltf, basePath: triangleWithoutIndicesUrl, modelMatrix: Transforms.eastNorthUpToFixedFrame( - Cartesian3.fromDegrees(0.0, 0.0, 100.0) + Cartesian3.fromDegrees(0.0, 0.0, 100.0), ), }, - scene + scene, ); // Orient the camera so it doesn't back-face cull the triangle. const center = model.boundingSphere.center; const range = 4.0 * model.boundingSphere.radius; scene.camera.lookAt( center, - new HeadingPitchRange(-CesiumMath.PI_OVER_TWO, 0, range) + new HeadingPitchRange(-CesiumMath.PI_OVER_TWO, 0, range), ); // The triangle's diagonal edge is slightly out of frame. @@ -593,7 +593,7 @@ describe( gltf: gltf, basePath: vertexColorTestUrl, }, - scene + scene, ); const renderOptions = { scene: scene, @@ -627,10 +627,10 @@ describe( gltf: gltf, basePath: twoSidedPlaneUrl, modelMatrix: Transforms.eastNorthUpToFixedFrame( - Cartesian3.fromDegrees(0.0, 0.0, 100.0) + Cartesian3.fromDegrees(0.0, 0.0, 100.0), ), }, - scene + scene, ); const renderOptions = { scene: scene, @@ -641,7 +641,7 @@ describe( const range = 4.0 * model.boundingSphere.radius; scene.camera.lookAt( center, - new HeadingPitchRange(0, -CesiumMath.PI_OVER_TWO, range) + new HeadingPitchRange(0, -CesiumMath.PI_OVER_TWO, range), ); // The top of the double-sided plane should render brightly, since @@ -654,7 +654,7 @@ describe( scene.camera.lookAt( center, - new HeadingPitchRange(0, CesiumMath.PI_OVER_TWO, range) + new HeadingPitchRange(0, CesiumMath.PI_OVER_TWO, range), ); // The bottom of the plane should render darker than the top, since @@ -679,7 +679,7 @@ describe( gltf: gltf, basePath: emissiveTextureUrl, }, - scene + scene, ); const renderOptions = { scene: scene, @@ -710,7 +710,7 @@ describe( scale: 10.0, offset: offset, }, - scene + scene, ); verifyRender(model, true); }); @@ -723,7 +723,7 @@ describe( gltf: gltf, basePath: boxSpecularUrl, }, - scene + scene, ); verifyRender(model, true); }); @@ -736,7 +736,7 @@ describe( gltf: gltf, basePath: boxAnisotropyUrl, }, - scene + scene, ); verifyRender(model, true); }); @@ -749,14 +749,14 @@ describe( gltf: gltf, basePath: boxClearcoatUrl, }, - scene + scene, ); verifyRender(model, true); }); it("transforms property textures with KHR_texture_transform", async function () { const resource = Resource.createIfNeeded( - propertyTextureWithTextureTransformUrl + propertyTextureWithTextureTransformUrl, ); // The texture in the example model contains contains 8x8 pixels // with increasing 'red' component values [0 to 64)*3, interpreted @@ -794,7 +794,7 @@ describe( // texture is fully loaded when the model is rendered! incrementallyLoadTextures: false, }, - scene + scene, ); const renderOptions = { scene: scene, @@ -806,7 +806,7 @@ describe( scene.camera.position = new Cartesian3(0.15, 0.1, 0.1); scene.camera.direction = Cartesian3.negate( Cartesian3.UNIT_X, - new Cartesian3() + new Cartesian3(), ); scene.camera.up = Cartesian3.clone(Cartesian3.UNIT_Z); scene.camera.frustum.near = 0.01; @@ -824,7 +824,7 @@ describe( it("transforms feature ID textures with KHR_texture_transform", async function () { const resource = Resource.createIfNeeded( - featureIdTextureWithTextureTransformUrl + featureIdTextureWithTextureTransformUrl, ); // The texture in the example model contains contains 8x8 pixels // with increasing 'red' component values [0 to 64)*3. @@ -860,7 +860,7 @@ describe( // texture is fully loaded when the model is rendered! incrementallyLoadTextures: false, }, - scene + scene, ); const renderOptions = { scene: scene, @@ -873,7 +873,7 @@ describe( scene.camera.position = new Cartesian3(0.15, 0.1, 0.1); scene.camera.direction = Cartesian3.negate( Cartesian3.UNIT_X, - new Cartesian3() + new Cartesian3(), ); scene.camera.up = Cartesian3.clone(Cartesian3.UNIT_Z); scene.camera.frustum.near = 0.01; @@ -902,7 +902,7 @@ describe( basePath: morphPrimitivesTestUrl, offset: offset, }, - scene + scene, ); // The background color must be changed because the model's texture // contains black, which can confuse the test. @@ -922,7 +922,7 @@ describe( it("renders Draco-compressed model", async function () { const model = await loadAndZoomToModelAsync( { gltf: dracoCesiumManUrl }, - scene + scene, ); verifyRender(model, true); }); @@ -941,14 +941,14 @@ describe( const model = scene.primitives.add( await Model.fromGltfAsync({ url: dracoCesiumManUrl, - }) + }), ); let failed = false; model.errorEvent.addEventListener((e) => { expect(e).toBeInstanceOf(RuntimeError); expect(e.message).toContain( - `Failed to load model: ${dracoCesiumManUrl}` + `Failed to load model: ${dracoCesiumManUrl}`, ); expect(e.message).toContain("Failed to load Draco"); expect(e.message).toContain("Custom error"); @@ -960,7 +960,7 @@ describe( scene.renderForSpecs(); return failed; }, - { timeout: 10000 } + { timeout: 10000 }, ); }); @@ -970,7 +970,7 @@ describe( gltf: animatedTriangleUrl, offset: animatedTriangleOffset, }, - scene + scene, ); const animationCollection = model.activeAnimations; expect(animationCollection).toBeDefined(); @@ -989,7 +989,7 @@ describe( gltf: animatedTriangleUrl, offset: animatedTriangleOffset, }, - scene + scene, ); // Move camera so that the triangle is in view. scene.camera.moveDown(0.5); @@ -1020,7 +1020,7 @@ describe( { gltf: boxCesiumRtcUrl, }, - scene + scene, ); verifyRender(model, true); }); @@ -1028,7 +1028,7 @@ describe( it("adds animation to draco-compressed model", async function () { const model = await loadAndZoomToModelAsync( { gltf: dracoCesiumManUrl }, - scene + scene, ); verifyRender(model, true); @@ -1046,7 +1046,7 @@ describe( const offset = new HeadingPitchRange( CesiumMath.PI_OVER_TWO, -CesiumMath.PI_OVER_FOUR, - 1 + 1, ); const resource = Resource.createIfNeeded(boxInstancedNoNormalsUrl); @@ -1057,7 +1057,7 @@ describe( basePath: boxInstancedNoNormalsUrl, offset: offset, }, - scene + scene, ); const renderOptions = { zoomToModel: false, @@ -1071,7 +1071,7 @@ describe( const buffer = await resource.fetchArrayBuffer(); const model = await loadAndZoomToModelAsync( { gltf: new Uint8Array(buffer), show: false }, - scene + scene, ); expect(model.ready).toEqual(true); expect(model.show).toEqual(false); @@ -1088,7 +1088,7 @@ describe( gltf: boxTexturedGlbUrl, modelMatrix: modelMatrix, }, - scene2D + scene2D, ); expect(model.ready).toEqual(true); verifyRender(model, true, { @@ -1102,10 +1102,10 @@ describe( { gltf: boxTexturedGlbUrl, modelMatrix: Transforms.eastNorthUpToFixedFrame( - Cartesian3.fromDegrees(180.0, 0.0) + Cartesian3.fromDegrees(180.0, 0.0), ), }, - scene2D + scene2D, ); expect(model.ready).toEqual(true); verifyRender(model, true, { @@ -1114,7 +1114,7 @@ describe( }); model.modelMatrix = Transforms.eastNorthUpToFixedFrame( - Cartesian3.fromDegrees(-180.0, 0.0) + Cartesian3.fromDegrees(-180.0, 0.0), ); verifyRender(model, true, { zoomToModel: false, @@ -1128,7 +1128,7 @@ describe( gltf: boxTexturedGlbUrl, modelMatrix: modelMatrix, }, - sceneCV + sceneCV, ); expect(model.ready).toEqual(true); scene.camera.moveBackward(1.0); @@ -1144,7 +1144,7 @@ describe( gltf: boxTexturedGlbUrl, modelMatrix: modelMatrix, }, - sceneCV + sceneCV, ); expect(model.ready).toEqual(true); scene.camera.moveBackward(1.0); @@ -1168,7 +1168,7 @@ describe( projectTo2D: true, incrementallyLoadTextures: false, }, - scene2D + scene2D, ); expect(model.ready).toEqual(true); verifyRender(model, true, { @@ -1185,7 +1185,7 @@ describe( projectTo2D: true, incrementallyLoadTextures: false, }, - sceneCV + sceneCV, ); expect(model.ready).toEqual(true); sceneCV.camera.moveBackward(1.0); @@ -1202,7 +1202,7 @@ describe( modelMatrix: modelMatrix, projectTo2D: true, }, - scene + scene, ); const commandList = scene.frameState.commandList; expect(model.ready).toEqual(true); @@ -1224,7 +1224,7 @@ describe( it("applies style to model with feature table", async function () { const model = await loadAndZoomToModelAsync( { gltf: buildingsMetadata }, - scene + scene, ); // Renders without style. @@ -1247,7 +1247,7 @@ describe( }); verifyRender(model, true); expect(model._styleCommandsNeeded).toBe( - StyleCommandsNeeded.ALL_TRANSLUCENT + StyleCommandsNeeded.ALL_TRANSLUCENT, ); // Does not render with invisible color. @@ -1274,7 +1274,7 @@ describe( it("applies style to model without feature table", async function () { const model = await loadAndZoomToModelAsync( { gltf: boxTexturedGlbUrl }, - scene + scene, ); const renderOptions = { @@ -1350,7 +1350,7 @@ describe( basePath: boxTexturedGltfUrl, credit: credit, }, - scene + scene, ); scene.renderForSpecs(); const creditDisplay = scene.frameState.creditDisplay; @@ -1370,7 +1370,7 @@ describe( basePath: boxTexturedGltfUrl, credit: creditString, }, - scene + scene, ); scene.renderForSpecs(); const creditDisplay = scene.frameState.creditDisplay; @@ -1388,7 +1388,7 @@ describe( gltf: gltf, basePath: boxWithCreditsUrl, }, - scene + scene, ); const expectedCredits = [ "First Source", @@ -1415,7 +1415,7 @@ describe( basePath: boxWithCreditsUrl, credit: "User Credit", }, - scene + scene, ); model._resourceCredits = [new Credit("Resource Credit")]; const expectedCredits = [ @@ -1446,7 +1446,7 @@ describe( credit: "User Credit", showCreditsOnScreen: true, }, - scene + scene, ); const expectedCredits = [ "User Credit", @@ -1474,7 +1474,7 @@ describe( credit: "User Credit", showCreditsOnScreen: false, }, - scene + scene, ); const expectedCredits = [ "User Credit", @@ -1523,7 +1523,7 @@ describe( credit: new Credit("User Credit", false), showCreditsOnScreen: true, }, - scene + scene, ); scene.renderForSpecs(); const creditDisplay = scene.frameState.creditDisplay; @@ -1564,7 +1564,7 @@ describe( const buffer = await resource.fetchArrayBuffer(); const model = await loadAndZoomToModelAsync( { gltf: new Uint8Array(buffer), enableDebugWireframe: true }, - sceneWithWebgl1 + sceneWithWebgl1, ); verifyDebugWireframe(model, PrimitiveType.TRIANGLES); }); @@ -1574,7 +1574,7 @@ describe( const buffer = await resource.fetchArrayBuffer(); const model = await loadAndZoomToModelAsync( { gltf: new Uint8Array(buffer), enableDebugWireframe: false }, - sceneWithWebgl1 + sceneWithWebgl1, ); const commandList = scene.frameState.commandList; const commandCounts = []; @@ -1604,7 +1604,7 @@ describe( const buffer = await resource.fetchArrayBuffer(); const model = await loadAndZoomToModelAsync( { gltf: new Uint8Array(buffer) }, - scene + scene, ); verifyDebugWireframe(model, PrimitiveType.TRIANGLES, { scene: scene, @@ -1614,7 +1614,7 @@ describe( it("debugWireframe works for model without indices", async function () { const model = await loadAndZoomToModelAsync( { gltf: triangleWithoutIndicesUrl, enableDebugWireframe: true }, - scene + scene, ); verifyDebugWireframe(model, PrimitiveType.TRIANGLES, { hasIndices: false, @@ -1624,7 +1624,7 @@ describe( it("debugWireframe works for model with triangle strip", async function () { const model = await loadAndZoomToModelAsync( { gltf: triangleStripUrl, enableDebugWireframe: true }, - scene + scene, ); verifyDebugWireframe(model, PrimitiveType.TRIANGLE_STRIP); }); @@ -1632,7 +1632,7 @@ describe( it("debugWireframe works for model with triangle fan", async function () { const model = await loadAndZoomToModelAsync( { gltf: triangleFanUrl, enableDebugWireframe: true }, - scene + scene, ); verifyDebugWireframe(model, PrimitiveType.TRIANGLE_FAN); }); @@ -1640,7 +1640,7 @@ describe( it("debugWireframe ignores points", async function () { const model = await loadAndZoomToModelAsync( { gltf: pointCloudUrl, enableDebugWireframe: true }, - scene + scene, ); scene.renderForSpecs(); const commandList = scene.frameState.commandList; @@ -1664,7 +1664,7 @@ describe( const buffer = await resource.fetchArrayBuffer(); const model = await loadAndZoomToModelAsync( { gltf: new Uint8Array(buffer), debugShowBoundingVolume: true }, - scene + scene, ); scene.renderForSpecs(); const commandList = scene.frameState.commandList; @@ -1694,14 +1694,14 @@ describe( const buffer = await resource.fetchArrayBuffer(); const model = await loadAndZoomToModelAsync( { gltf: new Uint8Array(buffer) }, - scene + scene, ); const boundingSphere = model.boundingSphere; expect(boundingSphere).toBeDefined(); expect(boundingSphere.center).toEqual(new Cartesian3()); expect(boundingSphere.radius).toEqualEpsilon( 0.8660254037844386, - CesiumMath.EPSILON8 + CesiumMath.EPSILON8, ); }); @@ -1715,11 +1715,11 @@ describe( expect(boundingSphere).toBeDefined(); expect(boundingSphere.center).toEqualEpsilon( new Cartesian3(0.0320296511054039, 0, 0.7249599695205688), - CesiumMath.EPSILON3 + CesiumMath.EPSILON3, ); expect(boundingSphere.radius).toEqualEpsilon( 0.9484635280120018, - CesiumMath.EPSILON3 + CesiumMath.EPSILON3, ); }); @@ -1728,7 +1728,7 @@ describe( { gltf: boxCesiumRtcUrl, }, - scene + scene, ); const boundingSphere = model.boundingSphere; expect(boundingSphere).toBeDefined(); @@ -1738,7 +1738,7 @@ describe( it("boundingSphere updates bounding sphere when invoked", async function () { const model = await loadAndZoomToModelAsync( { gltf: boxTexturedGlbUrl }, - scene + scene, ); const expectedRadius = 0.8660254037844386; const translation = new Cartesian3(10, 0, 0); @@ -1752,7 +1752,7 @@ describe( expect(boundingSphere.center).toEqual(translation); expect(boundingSphere.radius).toEqualEpsilon( 2.0 * expectedRadius, - CesiumMath.EPSILON8 + CesiumMath.EPSILON8, ); }); }); @@ -1773,7 +1773,7 @@ describe( gltf: new Uint8Array(buffer), imageBasedLighting: imageBasedLighting, }, - scene + scene, ); await pollToPromise(function () { scene.render(); @@ -1790,11 +1790,11 @@ describe( const expectedIblTransform = Matrix3.multiply( yUpToZUp, viewRotation, - new Matrix3() + new Matrix3(), ); expect(model._iblReferenceFrameMatrix).toEqualEpsilon( expectedIblTransform, - CesiumMath.EPSILON14 + CesiumMath.EPSILON14, ); }); }); @@ -1811,7 +1811,7 @@ describe( offset: offset, id: boxTexturedGlbUrl, }, - scene + scene, ); expect(model.id).toBe(boxTexturedGlbUrl); @@ -1830,7 +1830,7 @@ describe( gltf: boxTexturedGlbUrl, offset: offset, }, - scene + scene, ); expect(model.id).toBeUndefined(); @@ -1862,7 +1862,7 @@ describe( gltf: boxTexturedGlbUrl, offset: offset, }, - scene + scene, ); expect(scene).toPickAndCall(function (result) { expect(result.primitive).toBeInstanceOf(Model); @@ -1886,7 +1886,7 @@ describe( offset: offset, id: boxTexturedGlbUrl, }, - scene + scene, ); expect(scene).toPickAndCall(function (result) { expect(result.primitive).toBeInstanceOf(Model); @@ -1911,7 +1911,7 @@ describe( offset: offset, id: boxTexturedGlbUrl, }, - scene + scene, ); expect(scene).toPickAndCall(function (result) { expect(result.primitive).toBeInstanceOf(Model); @@ -1943,7 +1943,7 @@ describe( allowPicking: false, offset: offset, }, - scene + scene, ); expect(scene).toPickAndCall(function (result) { expect(result).toBeUndefined(); @@ -1965,7 +1965,7 @@ describe( gltf: boxTexturedGlbUrl, offset: offset, }, - scene + scene, ); model.show = false; expect(scene).toPickAndCall(function (result) { @@ -1978,7 +1978,7 @@ describe( function setFeaturesWithOpacity( featureTable, opaqueFeaturesLength, - translucentFeaturesLength + translucentFeaturesLength, ) { for (let i = 0; i < opaqueFeaturesLength; i++) { const feature = featureTable.getFeature(i); @@ -1999,7 +1999,7 @@ describe( { gltf: buildingsMetadata, }, - scene + scene, ); const featureTable = model.featureTables[model.featureTableId]; @@ -2008,7 +2008,7 @@ describe( scene.renderForSpecs(); expect(featureTable.styleCommandsNeededDirty).toEqual(false); expect(featureTable._styleCommandsNeeded).toEqual( - StyleCommandsNeeded.ALL_OPAQUE + StyleCommandsNeeded.ALL_OPAQUE, ); // Set some features to translucent. @@ -2016,7 +2016,7 @@ describe( scene.renderForSpecs(); expect(featureTable.styleCommandsNeededDirty).toEqual(true); expect(featureTable._styleCommandsNeeded).toEqual( - StyleCommandsNeeded.OPAQUE_AND_TRANSLUCENT + StyleCommandsNeeded.OPAQUE_AND_TRANSLUCENT, ); // Set some more features to translucent. @@ -2024,7 +2024,7 @@ describe( scene.renderForSpecs(); expect(featureTable.styleCommandsNeededDirty).toEqual(false); expect(featureTable._styleCommandsNeeded).toEqual( - StyleCommandsNeeded.OPAQUE_AND_TRANSLUCENT + StyleCommandsNeeded.OPAQUE_AND_TRANSLUCENT, ); // Set all features to translucent. @@ -2032,7 +2032,7 @@ describe( scene.renderForSpecs(); expect(featureTable.styleCommandsNeededDirty).toEqual(true); expect(featureTable._styleCommandsNeeded).toEqual( - StyleCommandsNeeded.ALL_TRANSLUCENT + StyleCommandsNeeded.ALL_TRANSLUCENT, ); }); @@ -2045,7 +2045,7 @@ describe( gltf: boxInstanced, instanceFeatureIdLabel: "section", }, - scene + scene, ); expect(model.featureTableId).toEqual(1); }); @@ -2055,7 +2055,7 @@ describe( { gltf: microcosm, }, - scene + scene, ); expect(model.featureTableId).toEqual(0); }); @@ -2065,7 +2065,7 @@ describe( { gltf: buildingsMetadata, }, - scene + scene, ); expect(model.featureTableId).toEqual(0); }); @@ -2075,7 +2075,7 @@ describe( { gltf: buildingsMetadata, }, - scene + scene, ); expect(model.featureIdLabel).toBe("featureId_0"); model.featureIdLabel = "buildings"; @@ -2092,7 +2092,7 @@ describe( { gltf: boxInstanced, }, - scene + scene, ); expect(model.instanceFeatureIdLabel).toBe("instanceFeatureId_0"); model.instanceFeatureIdLabel = "section"; @@ -2114,7 +2114,7 @@ describe( forwardAxis: Axis.X, modelMatrix: transform, }, - scene + scene, ); const sceneGraph = model.sceneGraph; scene.renderForSpecs(); @@ -2130,11 +2130,11 @@ describe( const translation = new Cartesian3(10, 0, 0); const updateModelMatrix = spyOn( ModelSceneGraph.prototype, - "updateModelMatrix" + "updateModelMatrix", ).and.callThrough(); const model = await loadAndZoomToModelAsync( { gltf: boxTexturedGlbUrl, upAxis: Axis.Z, forwardAxis: Axis.X }, - scene + scene, ); verifyRender(model, true); const sceneGraph = model.sceneGraph; @@ -2143,7 +2143,7 @@ describe( Matrix4.multiplyTransformation( model.modelMatrix, transform, - model.modelMatrix + model.modelMatrix, ); scene.renderForSpecs(); @@ -2160,7 +2160,7 @@ describe( const translation = new Cartesian3(10, 0, 0); const model = await loadAndZoomToModelAsync( { gltf: boxTexturedGlbUrl, upAxis: Axis.Z, forwardAxis: Axis.X }, - scene + scene, ); const transform = Matrix4.fromTranslation(translation); expect(model.boundingSphere.center).toEqual(Cartesian3.ZERO); @@ -2168,7 +2168,7 @@ describe( Matrix4.multiplyTransformation( model.modelMatrix, transform, - model.modelMatrix + model.modelMatrix, ); scene.renderForSpecs(); @@ -2181,7 +2181,7 @@ describe( gltf: boxTexturedGlbUrl, modelMatrix: modelMatrix, }, - scene2D + scene2D, ); verifyRender(model, true, { zoomToModel: false, @@ -2202,7 +2202,7 @@ describe( modelMatrix: modelMatrix, projectTo2D: true, }, - scene2D + scene2D, ); expect(function () { model.modelMatrix = Matrix4.IDENTITY; @@ -2229,7 +2229,7 @@ describe( modelMatrix: Transforms.eastNorthUpToFixedFrame(position), scene: scene, }, - scene + scene, ); expect(model.heightReference).toEqual(HeightReference.CLAMP_TO_GROUND); expect(model._scene).toBe(scene); @@ -2245,7 +2245,7 @@ describe( modelMatrix: Transforms.eastNorthUpToFixedFrame(position), scene: scene, }, - scene + scene, ); expect(model.heightReference).toEqual(HeightReference.NONE); expect(model._clampedModelMatrix).toBeUndefined(); @@ -2269,14 +2269,14 @@ describe( heightReference: HeightReference.CLAMP_TO_GROUND, scene: scene, }, - scene + scene, ); expect(model.heightReference).toEqual(HeightReference.CLAMP_TO_GROUND); expect(scene.updateHeight).toHaveBeenCalledWith( Ellipsoid.WGS84.cartesianToCartographic(position), jasmine.any(Function), - HeightReference.CLAMP_TO_GROUND + HeightReference.CLAMP_TO_GROUND, ); }); @@ -2292,7 +2292,7 @@ describe( heightReference: HeightReference.NONE, scene: scene, }, - scene + scene, ); model.heightReference = HeightReference.CLAMP_TO_GROUND; @@ -2302,7 +2302,7 @@ describe( expect(scene.updateHeight).toHaveBeenCalledWith( Ellipsoid.WGS84.cartesianToCartographic(position), jasmine.any(Function), - HeightReference.CLAMP_TO_GROUND + HeightReference.CLAMP_TO_GROUND, ); }); @@ -2318,7 +2318,7 @@ describe( heightReference: HeightReference.CLAMP_TO_GROUND, scene: scene, }, - scene + scene, ); model.heightReference = HeightReference.NONE; @@ -2340,12 +2340,12 @@ describe( heightReference: HeightReference.CLAMP_TO_GROUND, scene: scene, }, - scene + scene, ); expect(scene.updateHeight).toHaveBeenCalledWith( Ellipsoid.WGS84.cartesianToCartographic(position), jasmine.any(Function), - HeightReference.CLAMP_TO_GROUND + HeightReference.CLAMP_TO_GROUND, ); model.heightReference = HeightReference.RELATIVE_TO_GROUND; @@ -2355,7 +2355,7 @@ describe( expect(scene.updateHeight).toHaveBeenCalledWith( Ellipsoid.WGS84.cartesianToCartographic(position), jasmine.any(Function), - HeightReference.RELATIVE_TO_GROUND + HeightReference.RELATIVE_TO_GROUND, ); }); @@ -2372,12 +2372,12 @@ describe( heightReference: HeightReference.CLAMP_TO_GROUND, scene: scene, }, - scene + scene, ); expect(scene.updateHeight).toHaveBeenCalledWith( Ellipsoid.WGS84.cartesianToCartographic(position), jasmine.any(Function), - HeightReference.CLAMP_TO_GROUND + HeightReference.CLAMP_TO_GROUND, ); // Modify the model matrix in place @@ -2391,7 +2391,7 @@ describe( expect(scene.updateHeight).toHaveBeenCalledWith( Ellipsoid.WGS84.cartesianToCartographic(position), jasmine.any(Function), - HeightReference.CLAMP_TO_GROUND + HeightReference.CLAMP_TO_GROUND, ); }); @@ -2408,12 +2408,12 @@ describe( heightReference: HeightReference.CLAMP_TO_GROUND, scene: scene, }, - scene + scene, ); expect(scene.updateHeight).toHaveBeenCalledWith( Ellipsoid.WGS84.cartesianToCartographic(position), jasmine.any(Function), - HeightReference.CLAMP_TO_GROUND + HeightReference.CLAMP_TO_GROUND, ); position = Cartesian3.fromDegrees(-73.0, 40.0); @@ -2427,7 +2427,7 @@ describe( expect(scene.updateHeight).toHaveBeenCalledWith( Ellipsoid.WGS84.cartesianToCartographic(position), jasmine.any(Function), - HeightReference.CLAMP_TO_GROUND + HeightReference.CLAMP_TO_GROUND, ); }); @@ -2439,19 +2439,19 @@ describe( cartographic.height = height; updateCallback(cartographic); }; - } + }, ); const model = await loadAndZoomToModelAsync( { gltf: boxTexturedGltfUrl, modelMatrix: Transforms.eastNorthUpToFixedFrame( - Cartesian3.fromDegrees(-72.0, 40.0) + Cartesian3.fromDegrees(-72.0, 40.0), ), heightReference: HeightReference.CLAMP_TO_GROUND, scene: scene, }, - scene + scene, ); invokeCallback(100.0); @@ -2467,12 +2467,12 @@ describe( { gltf: boxTexturedGltfUrl, modelMatrix: Transforms.eastNorthUpToFixedFrame( - Cartesian3.fromDegrees(-72.0, 40.0) + Cartesian3.fromDegrees(-72.0, 40.0), ), heightReference: HeightReference.CLAMP_TO_GROUND, scene: scene, }, - scene + scene, ); expect(model._heightDirty).toBe(false); const terrainProvider = new CesiumTerrainProvider({ @@ -2491,15 +2491,15 @@ describe( { gltf: boxTexturedGltfUrl, modelMatrix: Transforms.eastNorthUpToFixedFrame( - Cartesian3.fromDegrees(-72.0, 40.0) + Cartesian3.fromDegrees(-72.0, 40.0), ), heightReference: HeightReference.CLAMP_TO_GROUND, scene: undefined, }, - scene - ) + scene, + ), ).toBeRejectedWithDeveloperError( - "Height reference is not supported without a scene." + "Height reference is not supported without a scene.", ); }); @@ -2508,11 +2508,11 @@ describe( { gltf: boxTexturedGltfUrl, modelMatrix: Transforms.eastNorthUpToFixedFrame( - Cartesian3.fromDegrees(-72.0, 40.0) + Cartesian3.fromDegrees(-72.0, 40.0), ), heightReference: HeightReference.NONE, }, - scene + scene, ); expect(function () { @@ -2527,13 +2527,13 @@ describe( { gltf: boxTexturedGltfUrl, modelMatrix: Transforms.eastNorthUpToFixedFrame( - Cartesian3.fromDegrees(-72.0, 40.0) + Cartesian3.fromDegrees(-72.0, 40.0), ), heightReference: HeightReference.CLAMP_TO_GROUND, scene: scene, }, - scene - ) + scene, + ), ).toBeResolved(); }); @@ -2545,12 +2545,12 @@ describe( { gltf: boxTexturedGlbUrl, modelMatrix: Transforms.eastNorthUpToFixedFrame( - Cartesian3.fromDegrees(-72.0, 40.0) + Cartesian3.fromDegrees(-72.0, 40.0), ), heightReference: HeightReference.CLAMP_TO_GROUND, scene: scene, }, - scene + scene, ); scene.primitives.remove(model); @@ -2569,7 +2569,7 @@ describe( gltf: boxTexturedGltfUrl, distanceDisplayCondition: condition, }, - scene + scene, ); verifyRender(model, false); }); @@ -2582,7 +2582,7 @@ describe( { gltf: boxTexturedGltfUrl, }, - scene + scene, ); verifyRender(model, true); @@ -2601,7 +2601,7 @@ describe( { gltf: boxTexturedGltfUrl, }, - scene + scene, ); verifyRender(model, true); @@ -2614,7 +2614,7 @@ describe( // Model distance is between near and far values, should render frameState.camera.lookAt( Cartesian3.ZERO, - new HeadingPitchRange(0.0, 0.0, (far + near) * 0.5) + new HeadingPitchRange(0.0, 0.0, (far + near) * 0.5), ); verifyRender(model, true, { zoomToModel: false, @@ -2623,7 +2623,7 @@ describe( // Model distance is greater than far value, should not render frameState.camera.lookAt( Cartesian3.ZERO, - new HeadingPitchRange(0.0, 0.0, far + 10.0) + new HeadingPitchRange(0.0, 0.0, far + 10.0), ); verifyRender(model, false, { zoomToModel: false, @@ -2638,7 +2638,7 @@ describe( { gltf: boxTexturedGltfUrl, }, - scene + scene, ); expect(function () { model.distanceDisplayCondition = condition; @@ -2650,7 +2650,7 @@ describe( it("initializes with model color", async function () { const model = await loadAndZoomToModelAsync( { gltf: boxTexturedGltfUrl, color: Color.BLACK }, - scene + scene, ); verifyRender(model, false); }); @@ -2658,7 +2658,7 @@ describe( it("changing model color works", async function () { const model = await loadAndZoomToModelAsync( { gltf: boxTexturedGltfUrl }, - scene + scene, ); verifyRender(model, true); @@ -2682,7 +2682,7 @@ describe( gltf: boxTexturedGltfUrl, offset: offset, }, - scene + scene, ); const renderOptions = { scene: scene, @@ -2714,7 +2714,7 @@ describe( color: Color.fromAlpha(Color.BLACK, 0.0), offset: offset, }, - scene + scene, ); verifyRender(model, false); @@ -2764,7 +2764,7 @@ describe( color: Color.RED, colorBlendMode: ColorBlendMode.HIGHLIGHT, }, - scene + scene, ); expect(model.colorBlendMode).toEqual(ColorBlendMode.HIGHLIGHT); @@ -2785,7 +2785,7 @@ describe( color: Color.RED, colorBlendMode: ColorBlendMode.REPLACE, }, - scene + scene, ); expect(model.colorBlendMode).toEqual(ColorBlendMode.REPLACE); @@ -2806,7 +2806,7 @@ describe( color: Color.RED, colorBlendMode: ColorBlendMode.MIX, }, - scene + scene, ); expect(model.colorBlendMode).toEqual(ColorBlendMode.MIX); @@ -2827,7 +2827,7 @@ describe( color: Color.RED, colorBlendMode: ColorBlendMode.REPLACE, }, - scene + scene, ); expect(model.colorBlendMode).toEqual(ColorBlendMode.REPLACE); @@ -2869,7 +2869,7 @@ describe( colorBlendMode: ColorBlendMode.MIX, colorBlendAmount: 1.0, }, - scene + scene, ); expect(model.colorBlendAmount).toEqual(1.0); @@ -2890,7 +2890,7 @@ describe( gltf: boxTexturedGltfUrl, offset: offset, }, - scene + scene, ); const renderOptions = { scene: scene, @@ -2936,7 +2936,7 @@ describe( it("initializes with silhouette size", async function () { await loadAndZoomToModelAsync( { gltf: boxTexturedGltfUrl, silhouetteSize: 1.0 }, - scene + scene, ); const commands = scene.frameState.commandList; scene.renderForSpecs(); @@ -2950,7 +2950,7 @@ describe( it("changing silhouette size works", async function () { const model = await loadAndZoomToModelAsync( { gltf: boxTexturedGltfUrl }, - scene + scene, ); const commands = scene.frameState.commandList; scene.renderForSpecs(); @@ -2980,7 +2980,7 @@ describe( silhouetteSize: 1.0, silhouetteColor: Color.fromAlpha(Color.GREEN, 0.5), }, - scene + scene, ); const commands = scene.frameState.commandList; scene.renderForSpecs(); @@ -2994,7 +2994,7 @@ describe( it("silhouette is disabled by invisible color", async function () { const model = await loadAndZoomToModelAsync( { gltf: boxTexturedGltfUrl, silhouetteSize: 1.0 }, - scene + scene, ); const commands = scene.frameState.commandList; scene.renderForSpecs(); @@ -3018,7 +3018,7 @@ describe( silhouetteSize: 1.0, color: Color.fromAlpha(Color.WHITE, 0.0), }, - scene + scene, ); const commands = scene.frameState.commandList; scene.renderForSpecs(); @@ -3043,7 +3043,7 @@ describe( silhouetteSize: 1.0, color: Color.fromAlpha(Color.WHITE, 0.5), }, - scene + scene, ); const commands = scene.frameState.commandList; scene.renderForSpecs(); @@ -3065,7 +3065,7 @@ describe( color: Color.fromAlpha(Color.WHITE, 0.5), silhouetteColor: Color.fromAlpha(Color.RED, 0.5), }, - scene + scene, ); const commands = scene.frameState.commandList; scene.renderForSpecs(); @@ -3083,14 +3083,14 @@ describe( gltf: boxTexturedGltfUrl, silhouetteSize: 1.0, }, - scene + scene, ); await loadAndZoomToModelAsync( { gltf: boxTexturedGltfUrl, silhouetteSize: 1.0, }, - scene + scene, ); const commands = scene.frameState.commandList; scene.renderForSpecs(); @@ -3111,7 +3111,7 @@ describe( it("initializes with light color", async function () { const model = await loadAndZoomToModelAsync( { gltf: boxTexturedGltfUrl, lightColor: Cartesian3.ZERO }, - scene + scene, ); verifyRender(model, false); }); @@ -3119,7 +3119,7 @@ describe( it("changing light color works", async function () { const model = await loadAndZoomToModelAsync( { gltf: boxTexturedGltfUrl }, - scene + scene, ); model.lightColor = Cartesian3.ZERO; verifyRender(model, false); @@ -3134,7 +3134,7 @@ describe( it("light color doesn't affect unlit models", async function () { const model = await loadAndZoomToModelAsync( { gltf: boxUnlitUrl }, - scene + scene, ); const options = { zoomToModel: false, @@ -3160,7 +3160,7 @@ describe( }); const model = await loadAndZoomToModelAsync( { gltf: boxTexturedGltfUrl, imageBasedLighting: ibl }, - scene + scene, ); expect(model.imageBasedLighting).toBe(ibl); }); @@ -3168,19 +3168,19 @@ describe( it("creates default imageBasedLighting", async function () { const model = await loadAndZoomToModelAsync( { gltf: boxTexturedGltfUrl }, - scene + scene, ); const imageBasedLighting = model.imageBasedLighting; expect(imageBasedLighting).toBeDefined(); expect( Cartesian2.equals( imageBasedLighting.imageBasedLightingFactor, - new Cartesian2(1, 1) - ) + new Cartesian2(1, 1), + ), ).toBe(true); expect(imageBasedLighting.luminanceAtZenith).toBe(0.2); expect( - imageBasedLighting.sphericalHarmonicCoefficients + imageBasedLighting.sphericalHarmonicCoefficients, ).toBeUndefined(); expect(imageBasedLighting.specularEnvironmentMaps).toBeUndefined(); }); @@ -3191,7 +3191,7 @@ describe( }); const model = await loadAndZoomToModelAsync( { gltf: boxTexturedGltfUrl }, - scene + scene, ); const renderOptions = { scene: scene, @@ -3218,7 +3218,7 @@ describe( imageBasedLightingFactor: Cartesian2.ZERO, }), }, - scene + scene, ); const renderOptions = { scene: scene, @@ -3246,7 +3246,7 @@ describe( luminanceAtZenith: 0.0, }), }, - scene + scene, ); const renderOptions = { scene: scene, @@ -3273,47 +3273,47 @@ describe( const L00 = new Cartesian3( 0.692622075009195, 0.4543516001819, - 0.36910172299235 + 0.36910172299235, ); // L00, irradiance, pre-scaled base const L1_1 = new Cartesian3( 0.289407068366422, 0.16789310162658, - 0.106174907004792 + 0.106174907004792, ); // L1-1, irradiance, pre-scaled base const L10 = new Cartesian3( -0.591502034778913, -0.28152432317119, - 0.124647554708491 + 0.124647554708491, ); // L10, irradiance, pre-scaled base const L11 = new Cartesian3( 0.34945458117126, 0.163273486841657, - -0.03095643545207 + -0.03095643545207, ); // L11, irradiance, pre-scaled base const L2_2 = new Cartesian3( 0.22171176447426, 0.11771991868122, - 0.031381053430064 + 0.031381053430064, ); // L2-2, irradiance, pre-scaled base const L2_1 = new Cartesian3( -0.348955284677868, -0.187256994042823, - -0.026299717727617 + -0.026299717727617, ); // L2-1, irradiance, pre-scaled base const L20 = new Cartesian3( 0.119982671127227, 0.076784552175028, - 0.055517838847755 + 0.055517838847755, ); // L20, irradiance, pre-scaled base const L21 = new Cartesian3( -0.545546043202299, -0.279787444030397, - -0.086854000285261 + -0.086854000285261, ); // L21, irradiance, pre-scaled base const L22 = new Cartesian3( 0.160417569726332, 0.120896423762313, - 0.121102528320197 + 0.121102528320197, ); // L22, irradiance, pre-scaled base const coefficients = [L00, L1_1, L10, L11, L2_2, L2_1, L20, L21, L22]; const model = await loadAndZoomToModelAsync( @@ -3323,7 +3323,7 @@ describe( sphericalHarmonicCoefficients: coefficients, }), }, - scene + scene, ); scene.highDynamicRange = true; @@ -3358,7 +3358,7 @@ describe( specularEnvironmentMaps: url, }), }, - scene + scene, ); const ibl = model.imageBasedLighting; @@ -3396,7 +3396,7 @@ describe( gltf: boomBoxUrl, scale: 10.0, }, - scene + scene, ); expect(scene.specularEnvironmentMapsSupported).toBe(false); verifyRender(model, true); @@ -3412,7 +3412,7 @@ describe( forwardAxis: Axis.X, scale: 0.0, }, - scene + scene, ); scene.renderForSpecs(); @@ -3424,7 +3424,7 @@ describe( it("changing scale works", async function () { const updateModelMatrix = spyOn( ModelSceneGraph.prototype, - "updateModelMatrix" + "updateModelMatrix", ).and.callThrough(); const model = await loadAndZoomToModelAsync( { @@ -3432,7 +3432,7 @@ describe( upAxis: Axis.Z, forwardAxis: Axis.X, }, - scene + scene, ); verifyRender(model, true); model.scale = 0.0; @@ -3454,7 +3454,7 @@ describe( gltf: new Uint8Array(buffer), scale: 10, }, - scene + scene, ); scene.renderForSpecs(); @@ -3463,7 +3463,7 @@ describe( expect(boundingSphere.center).toEqual(Cartesian3.ZERO); expect(boundingSphere.radius).toEqualEpsilon( expectedRadius * 10.0, - CesiumMath.EPSILON3 + CesiumMath.EPSILON3, ); model.scale = 0.0; @@ -3476,7 +3476,7 @@ describe( expect(boundingSphere.center).toEqual(Cartesian3.ZERO); expect(boundingSphere.radius).toEqualEpsilon( expectedRadius, - CesiumMath.EPSILON3 + CesiumMath.EPSILON3, ); }); @@ -3488,7 +3488,7 @@ describe( gltf: new Uint8Array(buffer), scale: 10, }, - scene + scene, ); const expectedRadius = 0.866; const expectedCenter = new Cartesian3(5.0, 0.0, 0.0); @@ -3496,22 +3496,22 @@ describe( const axisCorrectionMatrix = ModelUtility.getAxisCorrectionMatrix( Axis.Y, Axis.Z, - new Matrix4() + new Matrix4(), ); Matrix4.multiplyTransformation( axisCorrectionMatrix, expectedTranslation, - expectedTranslation + expectedTranslation, ); Matrix4.getTranslation(expectedTranslation, expectedCenter); const boundingSphere = model.boundingSphere; expect(boundingSphere.center).toEqual( - Cartesian3.multiplyByScalar(expectedCenter, 10.0, new Cartesian3()) + Cartesian3.multiplyByScalar(expectedCenter, 10.0, new Cartesian3()), ); expect(boundingSphere.radius).toEqualEpsilon( expectedRadius * 10.0, - CesiumMath.EPSILON3 + CesiumMath.EPSILON3, ); model.scale = 0.0; @@ -3524,7 +3524,7 @@ describe( expect(boundingSphere.center).toEqual(expectedCenter); expect(boundingSphere.radius).toEqualEpsilon( expectedRadius, - CesiumMath.EPSILON3 + CesiumMath.EPSILON3, ); }); }); @@ -3541,7 +3541,7 @@ describe( minimumPixelSize: 1, offset: new HeadingPitchRange(0, 0, 500), }, - scene + scene, ); const renderOptions = { zoomToModel: false, @@ -3555,14 +3555,14 @@ describe( expect(model.scale).toEqual(1.0); expect(model.boundingSphere.radius).toEqualEpsilon( expectedRadius, - CesiumMath.EPSILON3 + CesiumMath.EPSILON3, ); }); it("changing minimumPixelSize works", async function () { const updateModelMatrix = spyOn( ModelSceneGraph.prototype, - "updateModelMatrix" + "updateModelMatrix", ).and.callThrough(); const model = await loadAndZoomToModelAsync( { @@ -3572,7 +3572,7 @@ describe( minimumPixelSize: 1, offset: new HeadingPitchRange(0, 0, 500), }, - scene + scene, ); const renderOptions = { zoomToModel: false, @@ -3596,7 +3596,7 @@ describe( it("changing minimumPixelSize doesn't affect bounding sphere or scale", async function () { const updateModelMatrix = spyOn( ModelSceneGraph.prototype, - "updateModelMatrix" + "updateModelMatrix", ).and.callThrough(); const model = await loadAndZoomToModelAsync( { @@ -3606,7 +3606,7 @@ describe( minimumPixelSize: 1, offset: new HeadingPitchRange(0, 0, 500), }, - scene + scene, ); const expectedRadius = 0.866; scene.renderForSpecs(); @@ -3614,7 +3614,7 @@ describe( expect(model.scale).toEqual(1.0); expect(model.boundingSphere.radius).toEqualEpsilon( expectedRadius, - CesiumMath.EPSILON3 + CesiumMath.EPSILON3, ); model.minimumPixelSize = 0.0; @@ -3623,7 +3623,7 @@ describe( expect(model.scale).toEqual(1.0); expect(model.boundingSphere.radius).toEqualEpsilon( expectedRadius, - CesiumMath.EPSILON3 + CesiumMath.EPSILON3, ); model.minimumPixelSize = 1; @@ -3632,7 +3632,7 @@ describe( expect(model.scale).toEqual(1.0); expect(model.boundingSphere.radius).toEqualEpsilon( expectedRadius, - CesiumMath.EPSILON3 + CesiumMath.EPSILON3, ); }); }); @@ -3648,7 +3648,7 @@ describe( forwardAxis: Axis.X, maximumScale: 0.0, }, - scene + scene, ); scene.renderForSpecs(); verifyRender(model, false); @@ -3659,7 +3659,7 @@ describe( it("changing maximumScale works", async function () { const updateModelMatrix = spyOn( ModelSceneGraph.prototype, - "updateModelMatrix" + "updateModelMatrix", ).and.callThrough(); const model = await loadAndZoomToModelAsync( { @@ -3668,7 +3668,7 @@ describe( forwardAxis: Axis.X, scale: 2.0, }, - scene + scene, ); scene.renderForSpecs(); verifyRender(model, true); @@ -3693,7 +3693,7 @@ describe( scale: 20, maximumScale: 10, }, - scene + scene, ); scene.renderForSpecs(); @@ -3702,7 +3702,7 @@ describe( expect(boundingSphere.center).toEqual(Cartesian3.ZERO); expect(boundingSphere.radius).toEqualEpsilon( expectedRadius * 10.0, - CesiumMath.EPSILON3 + CesiumMath.EPSILON3, ); model.maximumScale = 0.0; @@ -3715,7 +3715,7 @@ describe( expect(boundingSphere.center).toEqual(Cartesian3.ZERO); expect(boundingSphere.radius).toEqualEpsilon( expectedRadius, - CesiumMath.EPSILON3 + CesiumMath.EPSILON3, ); }); @@ -3728,7 +3728,7 @@ describe( minimumPixelSize: 1, maximumScale: 10, }, - scene + scene, ); scene.renderForSpecs(); @@ -3737,7 +3737,7 @@ describe( expect(boundingSphere.center).toEqual(Cartesian3.ZERO); expect(boundingSphere.radius).toEqualEpsilon( expectedRadius, - CesiumMath.EPSILON3 + CesiumMath.EPSILON3, ); model.maximumScale = 0.0; @@ -3750,7 +3750,7 @@ describe( expect(boundingSphere.center).toEqual(Cartesian3.ZERO); expect(boundingSphere.radius).toEqualEpsilon( expectedRadius, - CesiumMath.EPSILON3 + CesiumMath.EPSILON3, ); }); }); @@ -3760,11 +3760,11 @@ describe( { gltf: boxTexturedGltfUrl, }, - scene + scene, ); const resetDrawCommands = spyOn( model, - "resetDrawCommands" + "resetDrawCommands", ).and.callThrough(); expect(model.ready).toBe(true); @@ -3779,11 +3779,11 @@ describe( { gltf: boxTexturedGltfUrl, }, - scene + scene, ); const resetDrawCommands = spyOn( model, - "resetDrawCommands" + "resetDrawCommands", ).and.callThrough(); expect(model.ready).toBe(true); expect(model.hasVerticalExaggeration).toBe(true); @@ -3800,7 +3800,7 @@ describe( { gltf: boxTexturedGltfUrl, }, - scene + scene, ); expect(model.ready).toBe(true); model._ignoreCommands = true; @@ -3816,7 +3816,7 @@ describe( gltf: boxTexturedGltfUrl, cull: true, }, - scene + scene, ); expect(model.cull).toEqual(true); @@ -3826,7 +3826,7 @@ describe( // Commands should not be submitted when model is out of view. model.modelMatrix = Matrix4.fromTranslation( - new Cartesian3(100.0, 0.0, 0.0) + new Cartesian3(100.0, 0.0, 0.0), ); scene.renderForSpecs(); expect(scene.frustumCommandsList.length).toEqual(0); @@ -3838,7 +3838,7 @@ describe( gltf: boxTexturedGltfUrl, cull: false, }, - scene + scene, ); expect(model.cull).toEqual(false); @@ -3849,7 +3849,7 @@ describe( // Commands should still be submitted when model is out of view. model.modelMatrix = Matrix4.fromTranslation( - new Cartesian3(0.0, 100.0, 0.0) + new Cartesian3(0.0, 100.0, 0.0), ); scene.renderForSpecs(); expect(scene.frustumCommandsList.length).toEqual(length); @@ -3862,7 +3862,7 @@ describe( const boxBackFaceCullingOffset = new HeadingPitchRange( Math.PI / 2, 0, - 2.0 + 2.0, ); it("enables back-face culling", async function () { @@ -3872,7 +3872,7 @@ describe( backFaceCulling: true, offset: boxBackFaceCullingOffset, }, - scene + scene, ); verifyRender(model, false, { zoomToModel: false, @@ -3886,7 +3886,7 @@ describe( backFaceCulling: false, offset: boxBackFaceCullingOffset, }, - scene + scene, ); verifyRender(model, true, { zoomToModel: false, @@ -3900,7 +3900,7 @@ describe( backFaceCulling: true, offset: boxBackFaceCullingOffset, }, - scene + scene, ); verifyRender(model, false, { zoomToModel: false, @@ -3920,7 +3920,7 @@ describe( backFaceCulling: false, offset: boxBackFaceCullingOffset, }, - scene + scene, ); verifyRender(model, true, { zoomToModel: false, @@ -3941,7 +3941,7 @@ describe( offset: boxBackFaceCullingOffset, color: new Color(0, 0, 1.0, 0.5), }, - scene + scene, ); verifyRender(model, true, { zoomToModel: false, @@ -3967,7 +3967,7 @@ describe( gltf: boxTexturedGlbUrl, modelMatrix: Matrix4.fromUniformScale(-1.0), }, - scene + scene, ); const renderOptions = { scene: scene, @@ -4002,11 +4002,11 @@ describe( }); await loadAndZoomToModelAsync( { gltf: boxTexturedGlbUrl, clippingPlanes: clippingPlanes }, - scene + scene, ); const model = await loadAndZoomToModelAsync( { gltf: boxTexturedGlbUrl }, - scene + scene, ); expect(function () { model.clippingPlanes = clippingPlanes; @@ -4020,7 +4020,7 @@ describe( }); const model = await loadAndZoomToModelAsync( { gltf: boxTexturedGlbUrl }, - scene + scene, ); const gl = scene.frameState.context._gl; spyOn(gl, "texImage2D").and.callThrough(); @@ -4044,7 +4044,7 @@ describe( }); const model = await loadAndZoomToModelAsync( { gltf: boxTexturedGlbUrl, clippingPlanes: clippingPlanes }, - scene + scene, ); verifyRender(model, false); @@ -4056,7 +4056,7 @@ describe( const direction = Cartesian3.multiplyByScalar( Cartesian3.UNIT_X, -1, - new Cartesian3() + new Cartesian3(), ); const plane = new ClippingPlane(direction, 0.0); const clippingPlanes = new ClippingPlaneCollection({ @@ -4064,7 +4064,7 @@ describe( }); const model = await loadAndZoomToModelAsync( { gltf: boxTexturedGlbUrl }, - scene + scene, ); let modelColor; verifyRender(model, true); @@ -4092,7 +4092,7 @@ describe( }); const model = await loadAndZoomToModelAsync( { gltf: boxTexturedGlbUrl, clippingPlanes: clippingPlanes }, - scene + scene, ); verifyRender(model, false); @@ -4107,7 +4107,7 @@ describe( }); const model = await loadAndZoomToModelAsync( { gltf: boxTexturedGlbUrl, clippingPlanes: clippingPlanes }, - scene + scene, ); verifyRender(model, false); @@ -4125,7 +4125,7 @@ describe( const model = await loadAndZoomToModelAsync( { gltf: boxTexturedGlbUrl, clippingPlanes: clippingPlanes }, - scene + scene, ); verifyRender(model, false); @@ -4152,7 +4152,7 @@ describe( const model = await loadAndZoomToModelAsync( { gltf: boxTexturedGlbUrl }, - scene + scene, ); let modelColor; verifyRender(model, true); @@ -4182,7 +4182,7 @@ describe( }); const model = await loadAndZoomToModelAsync( { gltf: boxTexturedGlbUrl }, - scene + scene, ); verifyRender(model, true); @@ -4199,7 +4199,7 @@ describe( { gltf: boxTexturedGlbUrl, }, - scene + scene, ); const clippingPlanes = new ClippingPlaneCollection({ planes: [new ClippingPlane(Cartesian3.UNIT_X, 0.0)], @@ -4219,7 +4219,7 @@ describe( { gltf: boxTexturedGlbUrl, }, - scene + scene, ); const clippingPlanes = new ClippingPlaneCollection({ planes: [new ClippingPlane(Cartesian3.UNIT_X, 0.0)], @@ -4258,13 +4258,13 @@ describe( }); const modelA = await loadAndZoomToModelAsync( { gltf: boxTexturedGlbUrl }, - scene + scene, ); modelA.clippingPolygons = collection; const modelB = await loadAndZoomToModelAsync( { gltf: boxTexturedGlbUrl }, - scene + scene, ); expect(function () { @@ -4282,7 +4282,7 @@ describe( }); const model = await loadAndZoomToModelAsync( { gltf: boxTexturedGlbUrl }, - scene + scene, ); model.clippingPolygons = collection; verifyRender(model, false); @@ -4301,7 +4301,7 @@ describe( }); const model = await loadAndZoomToModelAsync( { gltf: boxTexturedGlbUrl }, - scene + scene, ); let modelColor; verifyRender(model, true); @@ -4330,7 +4330,7 @@ describe( { gltf: boxTexturedGlbUrl, }, - scene + scene, ); model.clippingPolygons = collection; verifyRender(model, true); @@ -4351,7 +4351,7 @@ describe( { gltf: boxTexturedGlbUrl, }, - scene + scene, ); model.clippingPolygons = collection; verifyRender(model, false); @@ -4365,7 +4365,7 @@ describe( { gltf: boxTexturedGlbUrl, }, - scene + scene, ); const collection = new ClippingPolygonCollection({ polygons: [polygon], @@ -4385,7 +4385,7 @@ describe( { gltf: boxTexturedGlbUrl, }, - scene + scene, ); const collection = new ClippingPolygonCollection({ polygons: [polygon], @@ -4404,7 +4404,7 @@ describe( url: boxTexturedGltfUrl, classificationType: ClassificationType.CESIUM_3D_TILE, }, - scene + scene, ); expect(model.classificationType).toBe(ClassificationType.CESIUM_3D_TILE); @@ -4416,7 +4416,7 @@ describe( it("gets triangle count", async function () { const model = await loadAndZoomToModelAsync( { gltf: boxTexturedGltfUrl }, - scene + scene, ); const statistics = model.statistics; expect(statistics.trianglesLength).toEqual(12); @@ -4425,7 +4425,7 @@ describe( it("gets point count", async function () { const model = await loadAndZoomToModelAsync( { gltf: pointCloudUrl }, - scene + scene, ); const statistics = model.statistics; expect(statistics.pointsLength).toEqual(2500); @@ -4434,7 +4434,7 @@ describe( it("gets memory usage for geometry and textures", async function () { const model = await loadAndZoomToModelAsync( { gltf: boxTexturedGltfUrl, incrementallyLoadTextures: false }, - scene + scene, ); const expectedGeometryMemory = 840; // Texture is 256*256 and then is mipmapped @@ -4448,13 +4448,13 @@ describe( it("gets memory usage for property tables", async function () { const model = await loadAndZoomToModelAsync( { gltf: buildingsMetadata }, - scene + scene, ); const expectedPropertyTableMemory = 110; const statistics = model.statistics; expect(statistics.propertyTablesByteLength).toEqual( - expectedPropertyTableMemory + expectedPropertyTableMemory, ); }); }); @@ -4475,7 +4475,7 @@ describe( { gltf: boxArticulationsUrl, }, - scene + scene, ); expect(function () { model.setArticulationStage("SampleArticulation MoveX", "bad"); @@ -4497,7 +4497,7 @@ describe( { gltf: boxArticulationsUrl, }, - scene + scene, ); verifyRender(model, true); @@ -4535,7 +4535,7 @@ describe( { gltf: boxArticulationsUrl, }, - scene + scene, ); expect(function () { model.getNode(); @@ -4547,7 +4547,7 @@ describe( { gltf: boxArticulationsUrl, }, - scene + scene, ); const node = model.getNode("I don't exist"); expect(node).toBeUndefined(); @@ -4558,7 +4558,7 @@ describe( { gltf: boxArticulationsUrl, }, - scene + scene, ); const node = model.getNode("Root"); @@ -4575,7 +4575,7 @@ describe( { gltf: boxArticulationsUrl, }, - scene + scene, ); verifyRender(model, true); const node = model.getNode("Root"); @@ -4590,7 +4590,7 @@ describe( { gltf: boxArticulationsUrl, }, - scene + scene, ); verifyRender(model, true); const node = model.getNode("Root"); @@ -4638,10 +4638,10 @@ describe( { url: boxTexturedGltfUrl, modelMatrix: Transforms.eastNorthUpToFixedFrame( - Cartesian3.fromDegrees(0, 0, 10.0) + Cartesian3.fromDegrees(0, 0, 10.0), ), }, - scene + scene, ); viewFog(scene, model); @@ -4686,10 +4686,10 @@ describe( { url: boxTexturedGltfUrl, modelMatrix: Transforms.eastNorthUpToFixedFrame( - Cartesian3.fromDegrees(0, 0, 10.0) + Cartesian3.fromDegrees(0, 0, 10.0), ), }, - scene + scene, ); // In order for fog to render, the camera needs to be @@ -4754,10 +4754,10 @@ describe( { url: boxTexturedGltfUrl, modelMatrix: Transforms.eastNorthUpToFixedFrame( - Cartesian3.fromDegrees(0, 0, 10.0) + Cartesian3.fromDegrees(0, 0, 10.0), ), }, - scene + scene, ); viewFog(scene, model); @@ -4818,10 +4818,10 @@ describe( { url: boxTexturedGltfUrl, modelMatrix: Transforms.eastNorthUpToFixedFrame( - Cartesian3.fromDegrees(0, 0, 10.0) + Cartesian3.fromDegrees(0, 0, 10.0), ), }, - scene + scene, ); viewFog(scene, model); @@ -4872,10 +4872,10 @@ describe( { url: boxTexturedGltfUrl, modelMatrix: Transforms.eastNorthUpToFixedFrame( - Cartesian3.fromDegrees(0, 0, 10.0) + Cartesian3.fromDegrees(0, 0, 10.0), ), }, - scene + scene, ); viewFog(scene, model); @@ -4945,10 +4945,10 @@ describe( { url: boxTexturedGltfUrl, modelMatrix: Transforms.eastNorthUpToFixedFrame( - Cartesian3.fromDegrees(0, 0, 10.0) + Cartesian3.fromDegrees(0, 0, 10.0), ), }, - scene + scene, ); viewFog(scene, model); @@ -4996,10 +4996,10 @@ describe( { url: boxTexturedGltfUrl, modelMatrix: Transforms.eastNorthUpToFixedFrame( - Cartesian3.fromDegrees(0, 0, 10.0) + Cartesian3.fromDegrees(0, 0, 10.0), ), }, - scene + scene, ); viewFog(scene, model); @@ -5044,19 +5044,19 @@ describe( url: boxTexturedGltfUrl, enablePick: !scene.frameState.context.webgl2, }, - scene + scene, ); const ray = scene.camera.getPickRay( new Cartesian2( scene.drawingBufferWidth / 2.0, - scene.drawingBufferHeight / 2.0 - ) + scene.drawingBufferHeight / 2.0, + ), ); const expected = new Cartesian3(0.5, 0, 0.5); expect(model.pick(ray, scene.frameState)).toEqualEpsilon( expected, - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); }); @@ -5064,7 +5064,7 @@ describe( spyOn(ShaderProgram.prototype, "destroy").and.callThrough(); const model = await loadAndZoomToModelAsync( { gltf: boxTexturedGlbUrl }, - scene + scene, ); const resources = model._pipelineResources; const loader = model._loader; @@ -5119,5 +5119,5 @@ describe( } }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/Model/ModelUtilitySpec.js b/packages/engine/Specs/Scene/Model/ModelUtilitySpec.js index f29424fc5587..daa00cf38fde 100644 --- a/packages/engine/Specs/Scene/Model/ModelUtilitySpec.js +++ b/packages/engine/Specs/Scene/Model/ModelUtilitySpec.js @@ -213,7 +213,7 @@ describe("Scene/Model/ModelUtility", function () { const minMax = ModelUtility.getPositionMinMax( mockPrimitive, new Cartesian3(-5, -5, -5), - new Cartesian3(5, 5, 5) + new Cartesian3(5, 5, 5), ); const expectedMin = new Cartesian3(-5.5, -5.5, -5.5); @@ -228,14 +228,14 @@ describe("Scene/Model/ModelUtility", function () { const expectedCombinedMatrix = Matrix4.multiplyTransformation( expectedYToZMatrix, Axis.Z_UP_TO_X_UP, - new Matrix4() + new Matrix4(), ); // If already in ECEF, this should return identity let resultMatrix = ModelUtility.getAxisCorrectionMatrix( Axis.Z, Axis.X, - new Matrix4() + new Matrix4(), ); expect(Matrix4.equals(resultMatrix, Matrix4.IDENTITY)).toBe(true); @@ -243,7 +243,7 @@ describe("Scene/Model/ModelUtility", function () { resultMatrix = ModelUtility.getAxisCorrectionMatrix( Axis.Y, Axis.Z, - new Matrix4() + new Matrix4(), ); expect(Matrix4.equals(resultMatrix, expectedCombinedMatrix)).toBe(true); @@ -251,14 +251,14 @@ describe("Scene/Model/ModelUtility", function () { resultMatrix = ModelUtility.getAxisCorrectionMatrix( Axis.Y, Axis.X, - new Matrix4() + new Matrix4(), ); expect(Matrix4.equals(resultMatrix, expectedYToZMatrix)).toBe(true); resultMatrix = ModelUtility.getAxisCorrectionMatrix( Axis.X, Axis.Y, - new Matrix4() + new Matrix4(), ); expect(Matrix4.equals(resultMatrix, expectedXToZMatrix)).toBe(true); }); @@ -276,29 +276,29 @@ describe("Scene/Model/ModelUtility", function () { expect( ModelUtility.getAttributeBySemantic( nodeIntanceAttributes, - InstanceAttributeSemantic.TRANSLATION - ) + InstanceAttributeSemantic.TRANSLATION, + ), ).toBeDefined(); expect( ModelUtility.getAttributeBySemantic( nodeIntanceAttributes, - InstanceAttributeSemantic.ROTATION - ) + InstanceAttributeSemantic.ROTATION, + ), ).toBeDefined(); expect( ModelUtility.getAttributeBySemantic( nodeIntanceAttributes, - InstanceAttributeSemantic.SCALE - ) + InstanceAttributeSemantic.SCALE, + ), ).toBeDefined(); expect( ModelUtility.getAttributeBySemantic( nodeIntanceAttributes, - InstanceAttributeSemantic.FEATURE_ID - ) + InstanceAttributeSemantic.FEATURE_ID, + ), ).toBeDefined(); expect( - ModelUtility.getAttributeBySemantic(nodeIntanceAttributes, "UNKNOWN") + ModelUtility.getAttributeBySemantic(nodeIntanceAttributes, "UNKNOWN"), ).toBeUndefined(); const primitiveAttributes = { @@ -314,37 +314,37 @@ describe("Scene/Model/ModelUtility", function () { expect( ModelUtility.getAttributeBySemantic( primitiveAttributes, - VertexAttributeSemantic.POSITION - ) + VertexAttributeSemantic.POSITION, + ), ).toBeDefined(); expect( ModelUtility.getAttributeBySemantic( primitiveAttributes, - VertexAttributeSemantic.NORMAL - ) + VertexAttributeSemantic.NORMAL, + ), ).toBeDefined(); expect( ModelUtility.getAttributeBySemantic( primitiveAttributes, - VertexAttributeSemantic.TANGENT - ) + VertexAttributeSemantic.TANGENT, + ), ).toBeDefined(); expect( ModelUtility.getAttributeBySemantic( primitiveAttributes, VertexAttributeSemantic.TEXCOORD, - 0 - ) + 0, + ), ).toBeDefined(); expect( ModelUtility.getAttributeBySemantic( primitiveAttributes, VertexAttributeSemantic.TEXCOORD, - 1 - ) + 1, + ), ).toBeDefined(); expect( - ModelUtility.getAttributeBySemantic(primitiveAttributes, "UNKNOWN") + ModelUtility.getAttributeBySemantic(primitiveAttributes, "UNKNOWN"), ).toBeUndefined(); }); @@ -352,10 +352,10 @@ describe("Scene/Model/ModelUtility", function () { const featureIds = [{ label: "perVertex" }, { label: "perFace" }]; expect(ModelUtility.getFeatureIdsByLabel(featureIds, "perVertex")).toBe( - featureIds[0] + featureIds[0], ); expect(ModelUtility.getFeatureIdsByLabel(featureIds, "perFace")).toBe( - featureIds[1] + featureIds[1], ); }); @@ -366,10 +366,10 @@ describe("Scene/Model/ModelUtility", function () { ]; expect(ModelUtility.getFeatureIdsByLabel(featureIds, "featureId_0")).toBe( - featureIds[0] + featureIds[0], ); expect(ModelUtility.getFeatureIdsByLabel(featureIds, "featureId_1")).toBe( - featureIds[1] + featureIds[1], ); }); @@ -377,7 +377,7 @@ describe("Scene/Model/ModelUtility", function () { const featureIds = [{ label: "perVertex" }, { label: "perFace" }]; expect( - ModelUtility.getFeatureIdsByLabel(featureIds, "other") + ModelUtility.getFeatureIdsByLabel(featureIds, "other"), ).not.toBeDefined(); }); diff --git a/packages/engine/Specs/Scene/Model/MorphTargetsPipelineStageSpec.js b/packages/engine/Specs/Scene/Model/MorphTargetsPipelineStageSpec.js index 82b547bd50d6..e3a9377cf475 100644 --- a/packages/engine/Specs/Scene/Model/MorphTargetsPipelineStageSpec.js +++ b/packages/engine/Specs/Scene/Model/MorphTargetsPipelineStageSpec.js @@ -63,7 +63,7 @@ describe( attribute, expectedIndex, expectedOffset, - expectedStride + expectedStride, ) { expect(attribute.index).toEqual(expectedIndex); expect(attribute.vertexBuffer).toBeDefined(); @@ -113,7 +113,7 @@ describe( positionAttribute, expectedIndex, expectedByteOffset, - expectedStride + expectedStride, ); ShaderBuilderTester.expectHasVertexFunction( @@ -124,7 +124,7 @@ describe( " vec3 morphedPosition = position;", " morphedPosition += u_morphWeights[0] * a_targetPosition_0;", " return morphedPosition;", - ] + ], ); ShaderBuilderTester.expectHasVertexDefines(shaderBuilder, [ @@ -145,7 +145,7 @@ describe( const uniformMap = renderResources.uniformMap; expect(uniformMap.u_morphWeights()).toBe( - renderResources.runtimeNode.morphWeights + renderResources.runtimeNode.morphWeights, ); }); }); @@ -186,7 +186,7 @@ describe( attribute, i + 1, expectedByteOffset, - expectedStride + expectedStride, ); } @@ -199,7 +199,7 @@ describe( " morphedPosition += u_morphWeights[0] * a_targetPosition_0;", " morphedPosition += u_morphWeights[1] * a_targetPosition_1;", " return morphedPosition;", - ] + ], ); ShaderBuilderTester.expectHasVertexFunction( @@ -211,7 +211,7 @@ describe( " morphedNormal += u_morphWeights[0] * a_targetNormal_0;", " morphedNormal += u_morphWeights[1] * a_targetNormal_1;", " return morphedNormal;", - ] + ], ); ShaderBuilderTester.expectHasVertexFunction( @@ -223,7 +223,7 @@ describe( " morphedTangent += u_morphWeights[0] * a_targetTangent_0;", " morphedTangent += u_morphWeights[1] * a_targetTangent_1;", " return morphedTangent;", - ] + ], ); ShaderBuilderTester.expectHasVertexDefines(shaderBuilder, [ @@ -249,10 +249,10 @@ describe( const uniformMap = renderResources.uniformMap; expect(uniformMap.u_morphWeights()).toBe( - renderResources.runtimeNode.morphWeights + renderResources.runtimeNode.morphWeights, ); }); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/Model/NodeRenderResourcesSpec.js b/packages/engine/Specs/Scene/Model/NodeRenderResourcesSpec.js index 2c97e91d328f..55f1d221e752 100644 --- a/packages/engine/Specs/Scene/Model/NodeRenderResourcesSpec.js +++ b/packages/engine/Specs/Scene/Model/NodeRenderResourcesSpec.js @@ -48,7 +48,7 @@ describe( const modelResources = new ModelRenderResources(mockModel); const nodeResources = new NodeRenderResources( modelResources, - runtimeNode + runtimeNode, ); const defaultRenderState = RenderState.getState( @@ -57,7 +57,7 @@ describe( enabled: true, func: DepthFunction.LESS_OR_EQUAL, }, - }) + }), ); expect(nodeResources.runtimeNode).toBe(runtimeNode); @@ -78,7 +78,7 @@ describe( const nodeResources = new NodeRenderResources( modelResources, - runtimeNode + runtimeNode, ); nodeResources.shaderBuilder.addDefine("NODE"); @@ -86,7 +86,7 @@ describe( // The node's render resources should be a clone of the model's. expect(nodeResources.renderStateOptions).not.toBe( - modelResources.renderStateOptions + modelResources.renderStateOptions, ); expect(nodeResources.renderStateOptions.cull).toEqual({ enabled: true, @@ -97,21 +97,21 @@ describe( // The node's shader builder should be a clone of the model's expect(nodeResources.shaderBuilder).not.toBe( - modelResources.shaderBuilder + modelResources.shaderBuilder, ); // The model shader must not be modified by the node... ShaderBuilderTester.expectHasFragmentDefines( modelResources.shaderBuilder, - ["MODEL"] + ["MODEL"], ); // ...but the node shader will be updated. ShaderBuilderTester.expectHasFragmentDefines( nodeResources.shaderBuilder, - ["MODEL", "NODE"] + ["MODEL", "NODE"], ); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/Model/NodeStatisticsPipelineStageSpec.js b/packages/engine/Specs/Scene/Model/NodeStatisticsPipelineStageSpec.js index d900e93dbbd8..704f92620a1d 100644 --- a/packages/engine/Specs/Scene/Model/NodeStatisticsPipelineStageSpec.js +++ b/packages/engine/Specs/Scene/Model/NodeStatisticsPipelineStageSpec.js @@ -96,47 +96,47 @@ describe( }); it("updates statistics for an instanced model", function () { - return loadGltf(boxInstancedTranslationMinMax).then(function ( - gltfLoader - ) { - const components = gltfLoader.components; - const node = components.nodes[0]; - const renderResources = mockRenderResources(components); + return loadGltf(boxInstancedTranslationMinMax).then( + function (gltfLoader) { + const components = gltfLoader.components; + const node = components.nodes[0]; + const renderResources = mockRenderResources(components); - NodeStatisticsPipelineStage.process(renderResources, node); + NodeStatisticsPipelineStage.process(renderResources, node); - const statistics = renderResources.model.statistics; + const statistics = renderResources.model.statistics; - // Model contains four translated instances: - // 4 vec3s * 3 floats/vec3 * 4 bytes/float = 48 - const expectedByteLength = 48; + // Model contains four translated instances: + // 4 vec3s * 3 floats/vec3 * 4 bytes/float = 48 + const expectedByteLength = 48; - expect(statistics.pointsLength).toBe(0); - expect(statistics.trianglesLength).toBe(0); - expect(statistics.geometryByteLength).toBe(expectedByteLength); - expect(statistics.texturesByteLength).toBe(0); - expect(statistics.propertyTablesByteLength).toBe(0); - }); + expect(statistics.pointsLength).toBe(0); + expect(statistics.trianglesLength).toBe(0); + expect(statistics.geometryByteLength).toBe(expectedByteLength); + expect(statistics.texturesByteLength).toBe(0); + expect(statistics.propertyTablesByteLength).toBe(0); + }, + ); }); it("_countInstancingAttributes counts attributes with buffers", function () { - return loadGltf(boxInstancedTranslationMinMax).then(function ( - gltfLoader - ) { - const statistics = new ModelStatistics(); - const components = gltfLoader.components; - const node = components.nodes[0]; - - NodeStatisticsPipelineStage._countInstancingAttributes( - statistics, - node.instances - ); - - // Model contains four translated instances: - // 4 instances * 3 floats * 4 bytes per float - const expectedByteLength = 4 * 12; - expect(statistics.geometryByteLength).toBe(expectedByteLength); - }); + return loadGltf(boxInstancedTranslationMinMax).then( + function (gltfLoader) { + const statistics = new ModelStatistics(); + const components = gltfLoader.components; + const node = components.nodes[0]; + + NodeStatisticsPipelineStage._countInstancingAttributes( + statistics, + node.instances, + ); + + // Model contains four translated instances: + // 4 instances * 3 floats * 4 bytes per float + const expectedByteLength = 4 * 12; + expect(statistics.geometryByteLength).toBe(expectedByteLength); + }, + ); }); it("_countInstancingAttributes does not count attributes without buffers", function () { @@ -150,7 +150,7 @@ describe( NodeStatisticsPipelineStage._countInstancingAttributes( statistics, - node.instances + node.instances, ); // 4 feature ids * 4 bytes per float @@ -172,12 +172,12 @@ describe( NodeStatisticsPipelineStage._countGeneratedBuffers( statistics, - mockRuntimeNode + mockRuntimeNode, ); const transformsBuffer = mockRuntimeNode.instancingTransformsBuffer; expect(statistics.geometryByteLength).toBe( - transformsBuffer.sizeInBytes + transformsBuffer.sizeInBytes, ); }); }); @@ -195,41 +195,41 @@ describe( NodeStatisticsPipelineStage._countGeneratedBuffers( statistics, - mockRuntimeNode + mockRuntimeNode, ); const transformsBuffer2D = mockRuntimeNode.instancingTransformsBuffer2D; expect(statistics.geometryByteLength).toBe( - transformsBuffer2D.sizeInBytes + transformsBuffer2D.sizeInBytes, ); }); }); it("_countGeneratedBuffers counts instancing translation buffer for 2D", function () { - return loadGltf(boxInstancedTranslationMinMax).then(function ( - gltfLoader - ) { - const statistics = new ModelStatistics(); - const mockRuntimeNode = { - instancingTranslationBuffer2D: { - // Model contains four translated instances: - // 4 instances * 3 floats * 4 bytes per float - sizeInBytes: 48, - }, - }; - - NodeStatisticsPipelineStage._countGeneratedBuffers( - statistics, - mockRuntimeNode - ); - - const translationBuffer2D = - mockRuntimeNode.instancingTranslationBuffer2D; - expect(statistics.geometryByteLength).toBe( - translationBuffer2D.sizeInBytes - ); - }); + return loadGltf(boxInstancedTranslationMinMax).then( + function (gltfLoader) { + const statistics = new ModelStatistics(); + const mockRuntimeNode = { + instancingTranslationBuffer2D: { + // Model contains four translated instances: + // 4 instances * 3 floats * 4 bytes per float + sizeInBytes: 48, + }, + }; + + NodeStatisticsPipelineStage._countGeneratedBuffers( + statistics, + mockRuntimeNode, + ); + + const translationBuffer2D = + mockRuntimeNode.instancingTranslationBuffer2D; + expect(statistics.geometryByteLength).toBe( + translationBuffer2D.sizeInBytes, + ); + }, + ); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/Model/PickingPipelineStageSpec.js b/packages/engine/Specs/Scene/Model/PickingPipelineStageSpec.js index 5e44cd7e1c69..e1a0a7235c96 100644 --- a/packages/engine/Specs/Scene/Model/PickingPipelineStageSpec.js +++ b/packages/engine/Specs/Scene/Model/PickingPipelineStageSpec.js @@ -121,7 +121,7 @@ describe( expect(detailPickObject.model).toEqual(model); expect(detailPickObject.node).toEqual(renderResources.runtimeNode); expect(detailPickObject.primitive).toEqual( - renderResources.runtimePrimitive + renderResources.runtimePrimitive, ); } @@ -318,7 +318,7 @@ describe( expect(renderResources.attributeIndex).toEqual(2); expect(pickIdAttribute.vertexBuffer).toBeDefined(); expect(pickIdAttribute.vertexBuffer.sizeInBytes).toEqual( - renderResources.instanceCount * 4 + renderResources.instanceCount * 4, ); expect(pickIdAttribute.instanceDivisor).toEqual(1); @@ -327,7 +327,7 @@ describe( const statistics = renderResources.model.statistics; expect(statistics.geometryByteLength).toBe( - renderResources.instanceCount * 4 + renderResources.instanceCount * 4, ); expect(renderResources.pickId).toEqual("v_pickColor"); @@ -368,10 +368,10 @@ describe( ]); expect(renderResources.pickId).toEqual( - "((selectedFeature.id < int(model_featuresLength)) ? texture(model_pickTexture, selectedFeature.st) : vec4(0.0))" + "((selectedFeature.id < int(model_featuresLength)) ? texture(model_pickTexture, selectedFeature.st) : vec4(0.0))", ); }); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/Model/PntsLoaderSpec.js b/packages/engine/Specs/Scene/Model/PntsLoaderSpec.js index 5fec3e9e9999..f3ac4d570a39 100644 --- a/packages/engine/Specs/Scene/Model/PntsLoaderSpec.js +++ b/packages/engine/Specs/Scene/Model/PntsLoaderSpec.js @@ -101,7 +101,7 @@ describe( async function expectLoadError(arrayBuffer) { await expectAsync(loadPntsArrayBuffer(arrayBuffer)).toBeRejectedWithError( - RuntimeError + RuntimeError, ); } @@ -119,7 +119,7 @@ describe( const expectedPropertyTableCount = isBatched ? 1 : 0; expect(structuralMetadata.propertyTableCount).toEqual( - expectedPropertyTableCount + expectedPropertyTableCount, ); const propertyTable = structuralMetadata.getPropertyTable(0); @@ -140,7 +140,7 @@ describe( // Check the property declaration is expected expect(property.type).toEqual(expectedProperty.type); expect(property.componentType).toEqual( - expectedProperty.componentType + expectedProperty.componentType, ); // if batched, binary properties will appear in the property table. @@ -157,12 +157,12 @@ describe( // (batched points) or the property attribute (per-point properties) if (isBatched) { expect(propertyTable.getPropertyIds(0).sort()).toEqual( - tablePropertyNames.sort() + tablePropertyNames.sort(), ); } else { const propertyAttribute = structuralMetadata.getPropertyAttribute(0); expect(Object.keys(propertyAttribute.properties).sort()).toEqual( - attributePropertyNames.sort() + attributePropertyNames.sort(), ); } } @@ -189,7 +189,7 @@ describe( const quantization = attribute.quantization; expect(quantization.componentDatatype).toBe( - ComponentDatatype.UNSIGNED_SHORT + ComponentDatatype.UNSIGNED_SHORT, ); expect(quantization.normalizationRange).toBeDefined(); expect(quantization.octEncoded).toBe(false); @@ -388,7 +388,7 @@ describe( expectNormalOctEncoded( attributes[1], ComponentDatatype.UNSIGNED_BYTE, - false + false, ); expectColorRGB(attributes[2]); }); @@ -421,7 +421,7 @@ describe( expectNormalOctEncoded( attributes[1], ComponentDatatype.UNSIGNED_BYTE, - false + false, ); expectColorRGB(attributes[2]); }); @@ -448,7 +448,7 @@ describe( componentType: MetadataComponentType.UINT16, }, }, - isBatched + isBatched, ); const primitive = components.nodes[0].primitives[0]; @@ -459,7 +459,7 @@ describe( expectNormalOctEncoded( attributes[1], ComponentDatatype.UNSIGNED_BYTE, - true + true, ); expectColorRGB(attributes[2]); }); @@ -486,7 +486,7 @@ describe( componentType: MetadataComponentType.UINT16, }, }, - isBatched + isBatched, ); const primitive = components.nodes[0].primitives[0]; @@ -520,7 +520,7 @@ describe( componentType: MetadataComponentType.UINT32, }, }, - isBatched + isBatched, ); const primitive = components.nodes[0].primitives[0]; @@ -531,7 +531,7 @@ describe( expectNormalOctEncoded( attributes[1], ComponentDatatype.UNSIGNED_BYTE, - true + true, ); expectColorRGB(attributes[2]); expectBatchId(attributes[3], ComponentDatatype.UNSIGNED_BYTE); @@ -573,7 +573,7 @@ describe( componentType: MetadataComponentType.UINT32, }, }, - isBatched + isBatched, ); const primitive = components.nodes[0].primitives[0]; @@ -632,74 +632,74 @@ describe( }); it("loads PointCloudWithPerPointProperties", function () { - return loadPnts(pointCloudWithPerPointPropertiesUrl).then(function ( - loader - ) { - const components = loader.components; - expect(components).toBeDefined(); - const isBatched = false; - expectMetadata( - components.structuralMetadata, - { - temperature: { - type: MetadataType.SCALAR, - componentType: MetadataComponentType.FLOAT32, - }, - secondaryColor: { - type: MetadataType.VEC3, - componentType: MetadataComponentType.FLOAT32, - }, - id: { - type: MetadataType.SCALAR, - componentType: MetadataComponentType.UINT16, + return loadPnts(pointCloudWithPerPointPropertiesUrl).then( + function (loader) { + const components = loader.components; + expect(components).toBeDefined(); + const isBatched = false; + expectMetadata( + components.structuralMetadata, + { + temperature: { + type: MetadataType.SCALAR, + componentType: MetadataComponentType.FLOAT32, + }, + secondaryColor: { + type: MetadataType.VEC3, + componentType: MetadataComponentType.FLOAT32, + }, + id: { + type: MetadataType.SCALAR, + componentType: MetadataComponentType.UINT16, + }, }, - }, - isBatched - ); + isBatched, + ); - const primitive = components.nodes[0].primitives[0]; - const attributes = primitive.attributes; - // 2 geometry attributes + 3 metadata attributes - expect(attributes.length).toBe(5); - expectPosition(attributes[0]); - expectColorRGB(attributes[1]); - }); + const primitive = components.nodes[0].primitives[0]; + const attributes = primitive.attributes; + // 2 geometry attributes + 3 metadata attributes + expect(attributes.length).toBe(5); + expectPosition(attributes[0]); + expectColorRGB(attributes[1]); + }, + ); }); it("loads PointCloudWithUnicodePropertyIds", function () { - return loadPnts(pointCloudWithUnicodePropertyIdsUrl).then(function ( - loader - ) { - const components = loader.components; - expect(components).toBeDefined(); - const isBatched = false; - expectMetadata( - components.structuralMetadata, - { - // Originally "temperature ℃", but sanitized for GLSL - temperature_: { - type: MetadataType.SCALAR, - componentType: MetadataComponentType.FLOAT32, - }, - secondaryColor: { - type: MetadataType.VEC3, - componentType: MetadataComponentType.FLOAT32, - }, - id: { - type: MetadataType.SCALAR, - componentType: MetadataComponentType.UINT16, + return loadPnts(pointCloudWithUnicodePropertyIdsUrl).then( + function (loader) { + const components = loader.components; + expect(components).toBeDefined(); + const isBatched = false; + expectMetadata( + components.structuralMetadata, + { + // Originally "temperature ℃", but sanitized for GLSL + temperature_: { + type: MetadataType.SCALAR, + componentType: MetadataComponentType.FLOAT32, + }, + secondaryColor: { + type: MetadataType.VEC3, + componentType: MetadataComponentType.FLOAT32, + }, + id: { + type: MetadataType.SCALAR, + componentType: MetadataComponentType.UINT16, + }, }, - }, - isBatched - ); + isBatched, + ); - const primitive = components.nodes[0].primitives[0]; - const attributes = primitive.attributes; - // 2 geometry attributes + 3 metadata attributes - expect(attributes.length).toBe(5); - expectPosition(attributes[0]); - expectColorRGB(attributes[1]); - }); + const primitive = components.nodes[0].primitives[0]; + const attributes = primitive.attributes; + // 2 geometry attributes + 3 metadata attributes + expect(attributes.length).toBe(5); + expectPosition(attributes[0]); + expectColorRGB(attributes[1]); + }, + ); }); it("loads attributes for 2D", function () { @@ -718,7 +718,7 @@ describe( expect(positionAttribute.typedArray).toBeDefined(); expectColorRGB(attributes[1]); - } + }, ); }); @@ -744,7 +744,7 @@ describe( componentType: MetadataComponentType.UINT16, }, }, - isBatched + isBatched, ); const primitive = components.nodes[0].primitives[0]; @@ -759,10 +759,10 @@ describe( expectNormalOctEncoded( attributes[1], ComponentDatatype.UNSIGNED_BYTE, - true + true, ); expectColorRGB(attributes[2]); - } + }, ); }); @@ -850,7 +850,7 @@ describe( await expectAsync(loadPnts(pointCloudDracoUrl)).toBeRejectedWithError( RuntimeError, - "Failed to load Draco pnts\nmy error" + "Failed to load Draco pnts\nmy error", ); }); @@ -866,5 +866,5 @@ describe( }); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/Model/PointCloudStylingPipelineStageSpec.js b/packages/engine/Specs/Scene/Model/PointCloudStylingPipelineStageSpec.js index d2fb924c6212..11cf22014bd7 100644 --- a/packages/engine/Specs/Scene/Model/PointCloudStylingPipelineStageSpec.js +++ b/packages/engine/Specs/Scene/Model/PointCloudStylingPipelineStageSpec.js @@ -80,7 +80,7 @@ describe( function mockPntsRenderResources(options) { const pointCloudShading = defaultValue( options.pointCloudShading, - new PointCloudShading() + new PointCloudShading(), ); const shaderBuilder = new ShaderBuilder(); const uniformMap = {}; @@ -133,7 +133,7 @@ describe( PointCloudStylingPipelineStage.process( renderResources, mockPrimitive, - scene.frameState + scene.frameState, ); ShaderBuilderTester.expectHasVertexDefines(shaderBuilder, []); @@ -170,7 +170,7 @@ describe( PointCloudStylingPipelineStage.process( renderResources, mockPrimitive, - scene.frameState + scene.frameState, ); ShaderBuilderTester.expectHasVaryings(shaderBuilder, [ @@ -193,7 +193,7 @@ describe( ShaderBuilderTester.expectVertexLinesContains( shaderBuilder, - `vec4 getColorFromStyle${functionParameterList}` + `vec4 getColorFromStyle${functionParameterList}`, ); }); @@ -217,7 +217,7 @@ describe( PointCloudStylingPipelineStage.process( renderResources, mockPrimitive, - scene.frameState + scene.frameState, ); ShaderBuilderTester.expectHasVaryings(shaderBuilder, [ @@ -240,7 +240,7 @@ describe( ShaderBuilderTester.expectVertexLinesContains( shaderBuilder, - `vec4 getColorFromStyle${functionParameterList}` + `vec4 getColorFromStyle${functionParameterList}`, ); expect(renderResources.alphaOptions.pass).toEqual(Pass.TRANSLUCENT); @@ -266,7 +266,7 @@ describe( PointCloudStylingPipelineStage.process( renderResources, mockPrimitive, - scene.frameState + scene.frameState, ); ShaderBuilderTester.expectHasVertexDefines(shaderBuilder, [ @@ -283,7 +283,7 @@ describe( ShaderBuilderTester.expectVertexLinesContains( shaderBuilder, - `float getPointSizeFromStyle${functionParameterList}` + `float getPointSizeFromStyle${functionParameterList}`, ); }); @@ -307,7 +307,7 @@ describe( PointCloudStylingPipelineStage.process( renderResources, mockPrimitive, - scene.frameState + scene.frameState, ); ShaderBuilderTester.expectHasVertexDefines(shaderBuilder, [ @@ -324,7 +324,7 @@ describe( ShaderBuilderTester.expectVertexLinesContains( shaderBuilder, - `bool getShowFromStyle${functionParameterList}` + `bool getShowFromStyle${functionParameterList}`, ); }); @@ -347,7 +347,7 @@ describe( PointCloudStylingPipelineStage.process( renderResources, mockPrimitive, - scene.frameState + scene.frameState, ); ShaderBuilderTester.expectHasVertexDefines(shaderBuilder, [ @@ -357,12 +357,12 @@ describe( ShaderBuilderTester.expectVertexLinesContains( shaderBuilder, - `bool getShowFromStyle${functionParameterList}` + `bool getShowFromStyle${functionParameterList}`, ); ShaderBuilderTester.expectVertexLinesContains( shaderBuilder, - "attributes.positionMC" + "attributes.positionMC", ); }); @@ -385,7 +385,7 @@ describe( PointCloudStylingPipelineStage.process( renderResources, mockPrimitive, - scene.frameState + scene.frameState, ); ShaderBuilderTester.expectHasVertexDefines(shaderBuilder, [ @@ -395,12 +395,12 @@ describe( ShaderBuilderTester.expectVertexLinesContains( shaderBuilder, - `vec4 getColorFromStyle${functionParameterList}` + `vec4 getColorFromStyle${functionParameterList}`, ); ShaderBuilderTester.expectVertexLinesContains( shaderBuilder, - "v_positionWC" + "v_positionWC", ); }); @@ -423,7 +423,7 @@ describe( PointCloudStylingPipelineStage.process( renderResources, mockPrimitiveWithNormals, - scene.frameState + scene.frameState, ); ShaderBuilderTester.expectHasVertexDefines(shaderBuilder, [ @@ -433,12 +433,12 @@ describe( ShaderBuilderTester.expectVertexLinesContains( shaderBuilder, - `vec4 getColorFromStyle${functionParameterList}` + `vec4 getColorFromStyle${functionParameterList}`, ); ShaderBuilderTester.expectVertexLinesContains( shaderBuilder, - "attributes.normalMC" + "attributes.normalMC", ); }); @@ -461,7 +461,7 @@ describe( PointCloudStylingPipelineStage.process( renderResources, mockPrimitive, - scene.frameState + scene.frameState, ); ShaderBuilderTester.expectHasVertexDefines(shaderBuilder, [ @@ -471,12 +471,12 @@ describe( ShaderBuilderTester.expectVertexLinesContains( shaderBuilder, - `vec4 getColorFromStyle${functionParameterList}` + `vec4 getColorFromStyle${functionParameterList}`, ); ShaderBuilderTester.expectVertexLinesContains( shaderBuilder, - "attributes.color_0" + "attributes.color_0", ); }); @@ -499,7 +499,7 @@ describe( PointCloudStylingPipelineStage.process( renderResources, mockPrimitive, - scene.frameState + scene.frameState, ); }).toThrowError(RuntimeError); }); @@ -531,7 +531,7 @@ describe( PointCloudStylingPipelineStage.process( renderResources, mockPrimitive, - scene.frameState + scene.frameState, ); ShaderBuilderTester.expectHasVertexDefines(shaderBuilder, [ @@ -542,21 +542,21 @@ describe( ShaderBuilderTester.expectVertexLinesContains( shaderBuilder, - `bool getShowFromStyle${functionParameterList}` + `bool getShowFromStyle${functionParameterList}`, ); ShaderBuilderTester.expectVertexLinesContains( shaderBuilder, - `vec4 getColorFromStyle${functionParameterList}` + `vec4 getColorFromStyle${functionParameterList}`, ); ShaderBuilderTester.expectVertexLinesContains( shaderBuilder, - "metadata.temperature" + "metadata.temperature", ); ShaderBuilderTester.expectVertexLinesContains( shaderBuilder, - "metadata.id" + "metadata.id", ); }); @@ -582,7 +582,7 @@ describe( PointCloudStylingPipelineStage.process( renderResources, mockPrimitive, - scene.frameState + scene.frameState, ); ShaderBuilderTester.expectHasVertexDefines(shaderBuilder, [ @@ -625,7 +625,7 @@ describe( PointCloudStylingPipelineStage.process( renderResources, mockPrimitive, - scene.frameState + scene.frameState, ); ShaderBuilderTester.expectHasVertexDefines(shaderBuilder, []); @@ -654,7 +654,7 @@ describe( PointCloudStylingPipelineStage.process( renderResources, mockPrimitive, - scene.frameState + scene.frameState, ); ShaderBuilderTester.expectHasVertexDefines(shaderBuilder, [ @@ -684,7 +684,7 @@ describe( PointCloudStylingPipelineStage.process( renderResources, mockPrimitive, - scene.frameState + scene.frameState, ); ShaderBuilderTester.expectHasVertexDefines(shaderBuilder, [ @@ -715,7 +715,7 @@ describe( PointCloudStylingPipelineStage.process( renderResources, mockPrimitive, - frameState + frameState, ); const attenuation = uniformMap.model_pointCloudParameters(); @@ -744,7 +744,7 @@ describe( PointCloudStylingPipelineStage.process( renderResources, mockPrimitive, - frameState + frameState, ); const attenuation = uniformMap.model_pointCloudParameters(); @@ -774,7 +774,7 @@ describe( PointCloudStylingPipelineStage.process( renderResources, mockPrimitive, - frameState + frameState, ); const attenuation = uniformMap.model_pointCloudParameters(); @@ -793,7 +793,7 @@ describe( PointCloudStylingPipelineStage.process( renderResources, mockPrimitive, - frameState + frameState, ); const attenuation = uniformMap.model_pointCloudParameters(); @@ -821,7 +821,7 @@ describe( PointCloudStylingPipelineStage.process( renderResources, mockPrimitive, - frameState + frameState, ); const attenuation = uniformMap.model_pointCloudParameters(); @@ -849,7 +849,7 @@ describe( PointCloudStylingPipelineStage.process( renderResources, mockPrimitive, - frameState + frameState, ); const attenuation = uniformMap.model_pointCloudParameters(); @@ -878,7 +878,7 @@ describe( PointCloudStylingPipelineStage.process( renderResources, mockPrimitive, - frameState + frameState, ); const attenuation = uniformMap.model_pointCloudParameters(); @@ -898,7 +898,7 @@ describe( PointCloudStylingPipelineStage.process( renderResources, mockPrimitive, - frameState + frameState, ); const attenuation = uniformMap.model_pointCloudParameters(); @@ -918,7 +918,7 @@ describe( PointCloudStylingPipelineStage.process( renderResources, mockPrimitive, - frameState + frameState, ); const attenuation = uniformMap.model_pointCloudParameters(); @@ -940,7 +940,7 @@ describe( PointCloudStylingPipelineStage.process( renderResources, mockPrimitive, - frameState + frameState, ); const attenuation = uniformMap.model_pointCloudParameters(); @@ -962,7 +962,7 @@ describe( PointCloudStylingPipelineStage.process( renderResources, mockPrimitive, - frameState + frameState, ); const attenuation = uniformMap.model_pointCloudParameters(); @@ -986,12 +986,12 @@ describe( PointCloudStylingPipelineStage.process( renderResources, mockPrimitive, - frameState + frameState, ); const attenuation = uniformMap.model_pointCloudParameters(); expect(attenuation.z).toBe(Number.POSITIVE_INFINITY); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/Model/PrimitiveLoadPlanSpec.js b/packages/engine/Specs/Scene/Model/PrimitiveLoadPlanSpec.js index 213612f94c55..30887321fc9d 100644 --- a/packages/engine/Specs/Scene/Model/PrimitiveLoadPlanSpec.js +++ b/packages/engine/Specs/Scene/Model/PrimitiveLoadPlanSpec.js @@ -44,11 +44,11 @@ describe( const loadPlan = new PrimitiveLoadPlan(primitive); loadPlan.indicesPlan = new PrimitiveLoadPlan.IndicesLoadPlan( - primitive.indices + primitive.indices, ); const [positions] = primitive.attributes; loadPlan.attributePlans.push( - new PrimitiveLoadPlan.AttributeLoadPlan(positions) + new PrimitiveLoadPlan.AttributeLoadPlan(positions), ); return loadPlan; @@ -179,10 +179,8 @@ describe( // A new attribute is created for the outline coordinates expect(loadPlan.attributePlans.length).toBe(2); - const [ - outputPositionPlan, - outlineCoordinatesPlan, - ] = loadPlan.attributePlans; + const [outputPositionPlan, outlineCoordinatesPlan] = + loadPlan.attributePlans; expect(outputPositionPlan).toBe(positionPlan); expectOutlineCoordinates(loadPlan.primitive, outlineCoordinatesPlan); @@ -214,10 +212,8 @@ describe( // A new attribute is created for the outline coordinates expect(loadPlan.attributePlans.length).toBe(2); - const [ - outputPositionPlan, - outlineCoordinatesPlan, - ] = loadPlan.attributePlans; + const [outputPositionPlan, outlineCoordinatesPlan] = + loadPlan.attributePlans; expect(outputPositionPlan).toBe(positionPlan); expectOutlineCoordinates(loadPlan.primitive, outlineCoordinatesPlan); @@ -264,10 +260,8 @@ describe( // A new attribute is created for the outline coordinates expect(loadPlan.attributePlans.length).toBe(2); - const [ - outputPositionPlan, - outlineCoordinatesPlan, - ] = loadPlan.attributePlans; + const [outputPositionPlan, outlineCoordinatesPlan] = + loadPlan.attributePlans; expect(outputPositionPlan).toBe(positionPlan); expectOutlineCoordinates(loadPlan.primitive, outlineCoordinatesPlan); @@ -297,5 +291,5 @@ describe( expect(indices.typedArray).toEqual(expectedIndices); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/Model/PrimitiveOutlineGeneratorSpec.js b/packages/engine/Specs/Scene/Model/PrimitiveOutlineGeneratorSpec.js index 1586fd4270e7..1e3a0ace79e9 100644 --- a/packages/engine/Specs/Scene/Model/PrimitiveOutlineGeneratorSpec.js +++ b/packages/engine/Specs/Scene/Model/PrimitiveOutlineGeneratorSpec.js @@ -263,7 +263,7 @@ describe( 4, 8, 11 ]); // prettier-ignore - let expectedOutlineCoordinates = new Float32Array([ + let expectedOutlineCoordinates = new Float32Array([ 0, 1, 0, 0, 1, 0, 0, 1, 0, @@ -392,15 +392,7 @@ describe( }); attribute = new Float32Array([ - 0.0, - 1.0, - 2.0, - 3.0, - 4.0, - 5.0, - 6.0, - 7.0, - 8.0, + 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, ]); result = generator.updateAttribute(attribute); expectedAttribute = new Float32Array([ @@ -511,5 +503,5 @@ describe( }); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/Model/PrimitiveOutlinePipelineStageSpec.js b/packages/engine/Specs/Scene/Model/PrimitiveOutlinePipelineStageSpec.js index fa37b883cca6..02244c9a321c 100644 --- a/packages/engine/Specs/Scene/Model/PrimitiveOutlinePipelineStageSpec.js +++ b/packages/engine/Specs/Scene/Model/PrimitiveOutlinePipelineStageSpec.js @@ -91,7 +91,7 @@ describe( PrimitiveOutlinePipelineStage.process( renderResources, primitive, - frameState + frameState, ); const context = frameState.context; @@ -135,11 +135,11 @@ describe( expect(outlineCoordinates.index).toBe(1); expect(outlineCoordinates.vertexBuffer).toBe( - primitive.outlineCoordinates.buffer + primitive.outlineCoordinates.buffer, ); expect(outlineCoordinates.componentsPerAttribute).toBe(3); expect(outlineCoordinates.componentDatatype).toBe( - ComponentDatatype.FLOAT + ComponentDatatype.FLOAT, ); expect(outlineCoordinates.offsetInBytes).toBe(0); expect(outlineCoordinates.strideInBytes).not.toBeDefined(); @@ -147,5 +147,5 @@ describe( }); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/Model/PrimitiveRenderResourcesSpec.js b/packages/engine/Specs/Scene/Model/PrimitiveRenderResourcesSpec.js index ab230b293574..740e9218f0c0 100644 --- a/packages/engine/Specs/Scene/Model/PrimitiveRenderResourcesSpec.js +++ b/packages/engine/Specs/Scene/Model/PrimitiveRenderResourcesSpec.js @@ -85,7 +85,7 @@ describe( enabled: true, func: DepthFunction.LESS_OR_EQUAL, }, - }) + }), ); let runtimePrimitive; @@ -115,7 +115,7 @@ describe( const modelResources = new ModelRenderResources(mockModel); const nodeResources = new NodeRenderResources( modelResources, - runtimeNode + runtimeNode, ); return new PrimitiveRenderResources(nodeResources, undefined); }).toThrowDeveloperError(); @@ -125,11 +125,11 @@ describe( const modelResources = new ModelRenderResources(mockModel); const nodeResources = new NodeRenderResources( modelResources, - runtimeNode + runtimeNode, ); const primitiveResources = new PrimitiveRenderResources( nodeResources, - runtimePrimitive + runtimePrimitive, ); expect(primitiveResources.runtimePrimitive).toBe(runtimePrimitive); @@ -138,25 +138,25 @@ describe( expect(primitiveResources.indices).toBe(primitive.indices); expect(primitiveResources.primitiveType).toBe(PrimitiveType.TRIANGLES); expect(primitiveResources.positionMin).toEqual( - new Cartesian3(-1, -1, -1) + new Cartesian3(-1, -1, -1), ); expect(primitiveResources.positionMax).toEqual(new Cartesian3(1, 1, 1)); // The points are in a cube from -1, -1, -1 to 1, 1, 1. The center is // (0, 0, 0). The full diagonal is 2 * sqrt(3), so half is sqrt(3) expect(primitiveResources.boundingSphere.center).toEqualEpsilon( Cartesian3.ZERO, - CesiumMath.EPSILON9 + CesiumMath.EPSILON9, ); expect(primitiveResources.boundingSphere.radius).toEqualEpsilon( Math.sqrt(3), - CesiumMath.EPSILON9 + CesiumMath.EPSILON9, ); expect(primitiveResources.uniformMap).toEqual({}); expect(primitiveResources.lightingOptions.lightingModel).toEqual( - LightingModel.UNLIT + LightingModel.UNLIT, ); expect( - RenderState.getState(primitiveResources.renderStateOptions) + RenderState.getState(primitiveResources.renderStateOptions), ).toEqual(defaultRenderState); expect(primitiveResources.hasSilhouette).toBe(false); @@ -167,36 +167,36 @@ describe( const modelResources = new ModelRenderResources(mockModel); const nodeResources = new NodeRenderResources( modelResources, - runtimeNode + runtimeNode, ); const primitiveResources = new PrimitiveRenderResources( nodeResources, - runtimePrimitiveWithoutIndices + runtimePrimitiveWithoutIndices, ); expect(primitiveResources.count).toBe(8); expect(primitiveResources.indices).not.toBeDefined(); expect(primitiveResources.primitiveType).toBe(PrimitiveType.POINTS); expect(primitiveResources.positionMin).toEqual( - new Cartesian3(-2, -2, -2) + new Cartesian3(-2, -2, -2), ); expect(primitiveResources.positionMax).toEqual(new Cartesian3(2, 2, 2)); // The points are in a cube from -2, -2, -2 to 2, 2, 2. The center is // (0, 0, 0). The full diagonal is 4 * sqrt(3), so half is 2 * sqrt(3) expect(primitiveResources.boundingSphere.center).toEqualEpsilon( Cartesian3.ZERO, - CesiumMath.EPSILON9 + CesiumMath.EPSILON9, ); expect(primitiveResources.boundingSphere.radius).toEqualEpsilon( 2.0 * Math.sqrt(3), - CesiumMath.EPSILON9 + CesiumMath.EPSILON9, ); expect(primitiveResources.uniformMap).toEqual({}); expect(primitiveResources.lightingOptions.lightingModel).toEqual( - LightingModel.UNLIT + LightingModel.UNLIT, ); expect( - RenderState.getState(primitiveResources.renderStateOptions) + RenderState.getState(primitiveResources.renderStateOptions), ).toEqual(defaultRenderState); }); @@ -211,13 +211,13 @@ describe( const nodeResources = new NodeRenderResources( modelResources, - runtimeNode + runtimeNode, ); nodeResources.shaderBuilder.addDefine("NODE"); const primitiveResources = new PrimitiveRenderResources( nodeResources, - runtimePrimitive + runtimePrimitive, ); primitiveResources.shaderBuilder.addDefine("PRIMITIVE"); @@ -225,10 +225,10 @@ describe( // The primitive's shader builder should be a clone of the node's expect(primitiveResources.shaderBuilder).not.toBe( - modelResources.shaderBuilder + modelResources.shaderBuilder, ); expect(primitiveResources.shaderBuilder).not.toBe( - modelResources.shaderBuilder + modelResources.shaderBuilder, ); // The primitive should have inherited the renderStateOptions of the model's @@ -243,15 +243,15 @@ describe( // The defines should cascade through the three levels ShaderBuilderTester.expectHasFragmentDefines( modelResources.shaderBuilder, - ["MODEL"] + ["MODEL"], ); ShaderBuilderTester.expectHasFragmentDefines( nodeResources.shaderBuilder, - ["MODEL", "NODE"] + ["MODEL", "NODE"], ); ShaderBuilderTester.expectHasFragmentDefines( primitiveResources.shaderBuilder, - ["MODEL", "NODE", "PRIMITIVE"] + ["MODEL", "NODE", "PRIMITIVE"], ); }); @@ -264,14 +264,14 @@ describe( const nodeResources = new NodeRenderResources( modelResources, - runtimeNode + runtimeNode, ); nodeResources.shaderBuilder.addDefine("NODE"); nodeResources.renderStateOptions.blending = BlendingState.ALPHA_BLEND; const primitiveResources = new PrimitiveRenderResources( nodeResources, - runtimePrimitive + runtimePrimitive, ); expect(primitiveResources.runtimeNode).toBe(runtimeNode); @@ -282,9 +282,9 @@ describe( enabled: true, }); expect(primitiveResources.renderStateOptions.blending).toEqual( - BlendingState.ALPHA_BLEND + BlendingState.ALPHA_BLEND, ); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/Model/PrimitiveStatisticsPipelineStageSpec.js b/packages/engine/Specs/Scene/Model/PrimitiveStatisticsPipelineStageSpec.js index 54c2840a8f33..92bf3249675b 100644 --- a/packages/engine/Specs/Scene/Model/PrimitiveStatisticsPipelineStageSpec.js +++ b/packages/engine/Specs/Scene/Model/PrimitiveStatisticsPipelineStageSpec.js @@ -337,7 +337,7 @@ describe( PrimitiveStatisticsPipelineStage._count2DPositions( statistics, - mockRuntimePrimitive + mockRuntimePrimitive, ); expect(statistics.geometryByteLength).toBe(0); @@ -365,7 +365,7 @@ describe( PrimitiveStatisticsPipelineStage._count2DPositions( statistics, - mockRuntimePrimitive + mockRuntimePrimitive, ); // This stage intentionally counts the GPU + CPU copies of the 2D @@ -383,7 +383,7 @@ describe( PrimitiveStatisticsPipelineStage._countMorphTargetAttributes( statistics, - primitive + primitive, ); let totalSize = 0; @@ -409,7 +409,7 @@ describe( PrimitiveStatisticsPipelineStage._countMaterialTextures( statistics, - primitive.material + primitive.material, ); expect(statistics.texturesByteLength).toBe(0); @@ -427,7 +427,7 @@ describe( PrimitiveStatisticsPipelineStage._countMaterialTextures( statistics, - primitive.material + primitive.material, ); const totalTextureSize = @@ -452,7 +452,7 @@ describe( PrimitiveStatisticsPipelineStage._countMaterialTextures( statistics, - primitive.material + primitive.material, ); const totalTextureSize = @@ -475,13 +475,13 @@ describe( PrimitiveStatisticsPipelineStage._countFeatureIdTextures( statistics, - primitive.featureIds + primitive.featureIds, ); const featureIdTexture = primitive.featureIds[0]; expect(statistics.geometryByteLength).toBe(0); expect(statistics.texturesByteLength).toBe( - featureIdTexture.textureReader.texture.sizeInBytes + featureIdTexture.textureReader.texture.sizeInBytes, ); }); }); @@ -494,7 +494,7 @@ describe( PrimitiveStatisticsPipelineStage._countBinaryMetadata( statistics, - model + model, ); expect(statistics.geometryByteLength).toBe(0); @@ -509,33 +509,33 @@ describe( PrimitiveStatisticsPipelineStage._countBinaryMetadata( statistics, - model + model, ); const structuralMetadata = model.structuralMetadata; const propertyTable = structuralMetadata.getPropertyTable(0); expect(statistics.propertyTablesByteLength).toBe( - propertyTable.byteLength + propertyTable.byteLength, ); }); }); it("_countBinaryMetadata does not update statistics for property attributes", function () { - return loadGltf(pointCloudWithPropertyAttributes).then(function ( - gltfLoader - ) { - const statistics = new ModelStatistics(); - const components = gltfLoader.components; - const model = mockModel(components); - - PrimitiveStatisticsPipelineStage._countBinaryMetadata( - statistics, - model - ); - - expect(statistics.geometryByteLength).toBe(0); - }); + return loadGltf(pointCloudWithPropertyAttributes).then( + function (gltfLoader) { + const statistics = new ModelStatistics(); + const components = gltfLoader.components; + const model = mockModel(components); + + PrimitiveStatisticsPipelineStage._countBinaryMetadata( + statistics, + model, + ); + + expect(statistics.geometryByteLength).toBe(0); + }, + ); }); it("_countBinaryMetadata updates statistics for propertyTextures", function () { @@ -546,7 +546,7 @@ describe( PrimitiveStatisticsPipelineStage._countBinaryMetadata( statistics, - model + model, ); // everything shares the same texture, so the memory is only counted @@ -560,5 +560,5 @@ describe( }); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/Model/SceneMode2DPipelineStageSpec.js b/packages/engine/Specs/Scene/Model/SceneMode2DPipelineStageSpec.js index e5998f7f031e..17ea371b8ea6 100644 --- a/packages/engine/Specs/Scene/Model/SceneMode2DPipelineStageSpec.js +++ b/packages/engine/Specs/Scene/Model/SceneMode2DPipelineStageSpec.js @@ -108,7 +108,7 @@ describe( SceneMode2DPipelineStage.process( renderResources, primitive, - scene.frameState + scene.frameState, ); const model = renderResources.model; @@ -123,7 +123,7 @@ describe( // Check that the position attribute's typed array has been unloaded. const positionAttribute = ModelUtility.getAttributeBySemantic( primitive, - VertexAttributeSemantic.POSITION + VertexAttributeSemantic.POSITION, ); expect(positionAttribute.typedArray).toBeUndefined(); @@ -135,12 +135,12 @@ describe( const translationMatrix = Matrix4.fromTranslation( runtimePrimitive.boundingSphere2D.center, - scratchMatrix + scratchMatrix, ); const expected = Matrix4.multiplyTransformation( scene.frameState.context.uniformState.view, translationMatrix, - translationMatrix + translationMatrix, ); expect(renderResources.uniformMap.u_modelView2D()).toEqual(expected); }); @@ -160,7 +160,7 @@ describe( SceneMode2DPipelineStage.process( renderResources, primitive, - scene.frameState + scene.frameState, ); const model = renderResources.model; @@ -175,7 +175,7 @@ describe( // Check that the position attribute's typed array has been unloaded. const positionAttribute = ModelUtility.getAttributeBySemantic( primitive, - VertexAttributeSemantic.POSITION + VertexAttributeSemantic.POSITION, ); expect(positionAttribute.typedArray).toBeUndefined(); @@ -186,12 +186,12 @@ describe( const translationMatrix = Matrix4.fromTranslation( runtimePrimitive.boundingSphere2D.center, - scratchMatrix + scratchMatrix, ); const expected = Matrix4.multiplyTransformation( scene.frameState.context.uniformState.view, translationMatrix, - translationMatrix + translationMatrix, ); expect(renderResources.uniformMap.u_modelView2D()).toEqual(expected); }); @@ -211,7 +211,7 @@ describe( SceneMode2DPipelineStage.process( renderResources, primitive, - scene.frameState + scene.frameState, ); // Only the 2D bounding sphere will be computed for the primitive. @@ -222,7 +222,7 @@ describe( // Check that the position attribute's typed array has been unloaded. const positionAttribute = ModelUtility.getAttributeBySemantic( primitive, - VertexAttributeSemantic.POSITION + VertexAttributeSemantic.POSITION, ); expect(positionAttribute.typedArray).toBeUndefined(); @@ -235,5 +235,5 @@ describe( }); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/Model/SelectedFeatureIdPipelineStageSpec.js b/packages/engine/Specs/Scene/Model/SelectedFeatureIdPipelineStageSpec.js index afa2f5da13d7..dae4030ca0fc 100644 --- a/packages/engine/Specs/Scene/Model/SelectedFeatureIdPipelineStageSpec.js +++ b/packages/engine/Specs/Scene/Model/SelectedFeatureIdPipelineStageSpec.js @@ -51,7 +51,7 @@ describe( shaderBuilder.addStruct( SelectedFeatureIdPipelineStage.STRUCT_ID_SELECTED_FEATURE, SelectedFeatureIdPipelineStage.STRUCT_NAME_SELECTED_FEATURE, - ShaderDestination.BOTH + ShaderDestination.BOTH, ); return shaderBuilder; } @@ -61,14 +61,14 @@ describe( shaderBuilder, SelectedFeatureIdPipelineStage.STRUCT_ID_SELECTED_FEATURE, SelectedFeatureIdPipelineStage.STRUCT_NAME_SELECTED_FEATURE, - [" int id;", " vec2 st;", " vec4 color;"] + [" int id;", " vec2 st;", " vec4 color;"], ); ShaderBuilderTester.expectHasFragmentStruct( shaderBuilder, SelectedFeatureIdPipelineStage.STRUCT_ID_SELECTED_FEATURE, SelectedFeatureIdPipelineStage.STRUCT_NAME_SELECTED_FEATURE, - [" int id;", " vec2 st;", " vec4 color;"] + [" int id;", " vec2 st;", " vec4 color;"], ); } @@ -118,7 +118,7 @@ describe( SelectedFeatureIdPipelineStage.process( renderResources, primitive, - frameState + frameState, ); expect(renderResources.hasPropertyTable).toBe(true); @@ -156,7 +156,7 @@ describe( SelectedFeatureIdPipelineStage.process( renderResources, primitive, - frameState + frameState, ); expect(renderResources.hasPropertyTable).toBe(true); @@ -187,7 +187,7 @@ describe( SelectedFeatureIdPipelineStage.process( renderResources, primitive, - frameState + frameState, ); expect(renderResources.hasPropertyTable).toBe(true); @@ -224,7 +224,7 @@ describe( SelectedFeatureIdPipelineStage.process( renderResources, primitive, - frameState + frameState, ); expect(renderResources.hasPropertyTable).toBe(true); @@ -247,5 +247,5 @@ describe( }); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/Model/SkinningPipelineStageSpec.js b/packages/engine/Specs/Scene/Model/SkinningPipelineStageSpec.js index 4449c281bfdb..f89b84b59e6e 100644 --- a/packages/engine/Specs/Scene/Model/SkinningPipelineStageSpec.js +++ b/packages/engine/Specs/Scene/Model/SkinningPipelineStageSpec.js @@ -103,7 +103,7 @@ describe( " skinnedMatrix += a_weights_0.z * u_jointMatrices[int(a_joints_0.z)];", " skinnedMatrix += a_weights_0.w * u_jointMatrices[int(a_joints_0.w)];", " return skinnedMatrix;", - ] + ], ); ShaderBuilderTester.expectVertexLinesEqual(shaderBuilder, [ _shadersSkinningStageVS, @@ -116,7 +116,7 @@ describe( const runtimeNode = renderResources.runtimeNode; const uniformMap = renderResources.uniformMap; expect(uniformMap.u_jointMatrices()).toBe( - runtimeNode.computedJointMatrices + runtimeNode.computedJointMatrices, ); }); }); @@ -160,7 +160,7 @@ describe( " skinnedMatrix += a_weights_0.z * u_jointMatrices[int(a_joints_0.z)];", " skinnedMatrix += a_weights_0.w * u_jointMatrices[int(a_joints_0.w)];", " return skinnedMatrix;", - ] + ], ); ShaderBuilderTester.expectVertexLinesEqual(shaderBuilder, [ _shadersSkinningStageVS, @@ -173,10 +173,10 @@ describe( const runtimeNode = renderResources.runtimeNode; const uniformMap = renderResources.uniformMap; expect(uniformMap.u_jointMatrices()).toBe( - runtimeNode.computedJointMatrices + runtimeNode.computedJointMatrices, ); }); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/Model/TextureManagerSpec.js b/packages/engine/Specs/Scene/Model/TextureManagerSpec.js index 2bd470f93417..e5a12e3cf69e 100644 --- a/packages/engine/Specs/Scene/Model/TextureManagerSpec.js +++ b/packages/engine/Specs/Scene/Model/TextureManagerSpec.js @@ -71,7 +71,7 @@ describe( id, new TextureUniform({ url: blueUrl, - }) + }), ); return waitForTextureLoad(textureManager, id).then(function (texture) { @@ -91,7 +91,7 @@ describe( typedArray: new Uint8Array([255, 0, 0, 255, 0, 255, 0, 255]), width: 1, height: 2, - }) + }), ); return waitForTextureLoad(textureManager, id).then(function (texture) { @@ -110,14 +110,14 @@ describe( new TextureUniform({ url: redUrl, minificationFilter: TextureMinificationFilter.LINEAR_MIPMAP_LINEAR, - }) + }), ); - return waitForTextureLoad(textureManager, id, false).then(function ( - texture - ) { - expect(texture._hasMipmap).toBe(true); - }); + return waitForTextureLoad(textureManager, id, false).then( + function (texture) { + expect(texture._hasMipmap).toBe(true); + }, + ); }); it("resizes image to power-of-two dimensions if needed", function () { @@ -130,16 +130,16 @@ describe( new TextureUniform({ url: blue10x10Url, minificationFilter: TextureMinificationFilter.LINEAR_MIPMAP_NEAREST, - }) + }), ); - return waitForTextureLoad(textureManager, id, false).then(function ( - texture - ) { - expect(texture.width).toBe(16); - expect(texture.height).toBe(16); - expect(texture._hasMipmap).toBe(true); - }); + return waitForTextureLoad(textureManager, id, false).then( + function (texture) { + expect(texture.width).toBe(16); + expect(texture.height).toBe(16); + expect(texture._hasMipmap).toBe(true); + }, + ); }); it("can resize a texture supplied as a Uint8Array", function () { @@ -180,18 +180,18 @@ describe( new TextureUniform({ url: blue10x10Url, minificationFilter: TextureMinificationFilter.NEAREST_MIPMAP_NEAREST, - }) + }), ); const webgl2 = true; - return waitForTextureLoad(textureManager, id, webgl2).then(function ( - texture - ) { - expect(texture.width).toBe(10); - expect(texture.height).toBe(10); - expect(texture._hasMipmap).toBe(true); - }); + return waitForTextureLoad(textureManager, id, webgl2).then( + function (texture) { + expect(texture.width).toBe(10); + expect(texture.height).toBe(10); + expect(texture._hasMipmap).toBe(true); + }, + ); }); it("destroys old texture before adding a new one", function () { @@ -203,31 +203,31 @@ describe( id, new TextureUniform({ url: blueUrl, - }) + }), ); - return waitForTextureLoad(textureManager, id).then(function ( - blueTexture - ) { - expect(blueTexture.width).toBe(2); - expect(blueTexture.height).toBe(2); - expect(blueTexture.isDestroyed()).toBe(false); - - textureManager.loadTexture2D( - id, - new TextureUniform({ - url: greenUrl, - }) - ); - return waitForTextureLoad(textureManager, id).then(function ( - greenTexture - ) { - expect(blueTexture.isDestroyed()).toBe(true); - expect(greenTexture.width).toBe(1); - expect(greenTexture.height).toBe(4); - expect(greenTexture.isDestroyed()).toBe(false); - }); - }); + return waitForTextureLoad(textureManager, id).then( + function (blueTexture) { + expect(blueTexture.width).toBe(2); + expect(blueTexture.height).toBe(2); + expect(blueTexture.isDestroyed()).toBe(false); + + textureManager.loadTexture2D( + id, + new TextureUniform({ + url: greenUrl, + }), + ); + return waitForTextureLoad(textureManager, id).then( + function (greenTexture) { + expect(blueTexture.isDestroyed()).toBe(true); + expect(greenTexture.width).toBe(1); + expect(greenTexture.height).toBe(4); + expect(greenTexture.isDestroyed()).toBe(false); + }, + ); + }, + ); }); it("getTexture returns undefined for unknown texture", function () { @@ -252,7 +252,7 @@ describe( id, new TextureUniform({ url: "https://example.com/not-a-texture.jpg", - }) + }), ); return waitForTextureLoad(textureManager, id) .then(function (texture) { @@ -272,7 +272,7 @@ describe( id, new TextureUniform({ url: blueUrl, - }) + }), ); return waitForTextureLoad(textureManager, id).then(function (texture) { @@ -285,5 +285,5 @@ describe( }); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/Model/TextureUniformSpec.js b/packages/engine/Specs/Scene/Model/TextureUniformSpec.js index 1cee84bf1cf0..0d8c853f3370 100644 --- a/packages/engine/Specs/Scene/Model/TextureUniformSpec.js +++ b/packages/engine/Specs/Scene/Model/TextureUniformSpec.js @@ -108,7 +108,7 @@ describe("Scene/Model/TextureUniform", function () { minificationFilter: TextureMinificationFilter.NEAREST, magnificationFilter: TextureMagnificationFilter.NEAREST, maximumAnisotropy: 2, - }) + }), ); }); diff --git a/packages/engine/Specs/Scene/Model/TilesetPipelineStageSpec.js b/packages/engine/Specs/Scene/Model/TilesetPipelineStageSpec.js index da7e17dceec3..aa17f40a821f 100644 --- a/packages/engine/Specs/Scene/Model/TilesetPipelineStageSpec.js +++ b/packages/engine/Specs/Scene/Model/TilesetPipelineStageSpec.js @@ -53,10 +53,10 @@ describe("Scene/Model/TilesetPipelineStage", function () { const renderStateOptions = renderResources.renderStateOptions; expect(renderStateOptions.stencilTest).toEqual( - StencilConstants.setCesium3DTileBit() + StencilConstants.setCesium3DTileBit(), ); expect(renderStateOptions.stencilMask).toEqual( - StencilConstants.CESIUM_3D_TILE_MASK + StencilConstants.CESIUM_3D_TILE_MASK, ); }); }); diff --git a/packages/engine/Specs/Scene/Model/VerticalExaggerationPipelineStageSpec.js b/packages/engine/Specs/Scene/Model/VerticalExaggerationPipelineStageSpec.js index 0eead95983fe..0dc90b162939 100644 --- a/packages/engine/Specs/Scene/Model/VerticalExaggerationPipelineStageSpec.js +++ b/packages/engine/Specs/Scene/Model/VerticalExaggerationPipelineStageSpec.js @@ -31,7 +31,7 @@ describe( VerticalExaggerationPipelineStage.process( renderResources, mockPrimitive, - mockFrameState + mockFrameState, ); const shaderBuilder = renderResources.shaderBuilder; @@ -46,12 +46,12 @@ describe( ]); const expectedUniform = Cartesian2.fromElements( mockFrameState.verticalExaggeration, - mockFrameState.verticalExaggerationRelativeHeight + mockFrameState.verticalExaggerationRelativeHeight, ); expect( - renderResources.uniformMap.u_verticalExaggerationAndRelativeHeight() + renderResources.uniformMap.u_verticalExaggerationAndRelativeHeight(), ).toEqual(expectedUniform); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/Model/WireframePipelineStageSpec.js b/packages/engine/Specs/Scene/Model/WireframePipelineStageSpec.js index 5cf9183b999c..9287f87ec935 100644 --- a/packages/engine/Specs/Scene/Model/WireframePipelineStageSpec.js +++ b/packages/engine/Specs/Scene/Model/WireframePipelineStageSpec.js @@ -87,23 +87,27 @@ describe( } it("adds define to shader", function () { - return loadGltf(boxTexturedBinary, sceneWithWebgl2).then(function ( - gltfLoader - ) { - const components = gltfLoader.components; - const node = components.nodes[1]; - const primitive = node.primitives[0]; - const frameState = sceneWithWebgl2.frameState; - - const renderResources = mockRenderResources(primitive); - const shaderBuilder = renderResources.shaderBuilder; - - WireframePipelineStage.process(renderResources, primitive, frameState); - - ShaderBuilderTester.expectHasFragmentDefines(shaderBuilder, [ - "HAS_WIREFRAME", - ]); - }); + return loadGltf(boxTexturedBinary, sceneWithWebgl2).then( + function (gltfLoader) { + const components = gltfLoader.components; + const node = components.nodes[1]; + const primitive = node.primitives[0]; + const frameState = sceneWithWebgl2.frameState; + + const renderResources = mockRenderResources(primitive); + const shaderBuilder = renderResources.shaderBuilder; + + WireframePipelineStage.process( + renderResources, + primitive, + frameState, + ); + + ShaderBuilderTester.expectHasFragmentDefines(shaderBuilder, [ + "HAS_WIREFRAME", + ]); + }, + ); }); it("Creates wireframe indices from buffer (WebGL 2)", function () { @@ -111,64 +115,72 @@ describe( return; } - return loadGltf(boxTexturedBinary, sceneWithWebgl2).then(function ( - gltfLoader - ) { - const components = gltfLoader.components; - const node = components.nodes[1]; - const primitive = node.primitives[0]; - const frameState = sceneWithWebgl2.frameState; - - const renderResources = mockRenderResources(primitive); - - expect(renderResources.count).toBe(36); - expect(renderResources.primitiveType).toBe(PrimitiveType.TRIANGLES); - - WireframePipelineStage.process(renderResources, primitive, frameState); - - const wireframeIndexBuffer = renderResources.wireframeIndexBuffer; - const model = renderResources.model; - expect(wireframeIndexBuffer).toBeDefined(); - expect(model._pipelineResources).toEqual([wireframeIndexBuffer]); - expect(model.statistics.geometryByteLength).toBe( - wireframeIndexBuffer.sizeInBytes - ); - expect(renderResources.primitiveType).toBe(PrimitiveType.LINES); - expect(renderResources.count).toBe(72); - }); + return loadGltf(boxTexturedBinary, sceneWithWebgl2).then( + function (gltfLoader) { + const components = gltfLoader.components; + const node = components.nodes[1]; + const primitive = node.primitives[0]; + const frameState = sceneWithWebgl2.frameState; + + const renderResources = mockRenderResources(primitive); + + expect(renderResources.count).toBe(36); + expect(renderResources.primitiveType).toBe(PrimitiveType.TRIANGLES); + + WireframePipelineStage.process( + renderResources, + primitive, + frameState, + ); + + const wireframeIndexBuffer = renderResources.wireframeIndexBuffer; + const model = renderResources.model; + expect(wireframeIndexBuffer).toBeDefined(); + expect(model._pipelineResources).toEqual([wireframeIndexBuffer]); + expect(model.statistics.geometryByteLength).toBe( + wireframeIndexBuffer.sizeInBytes, + ); + expect(renderResources.primitiveType).toBe(PrimitiveType.LINES); + expect(renderResources.count).toBe(72); + }, + ); }); it("Creates wireframe indices from typedArray (WebGL 1)", function () { const options = { loadIndicesForWireframe: true, }; - return loadGltf(boxTexturedBinary, scene, options).then(function ( - gltfLoader - ) { - const components = gltfLoader.components; - const node = components.nodes[1]; - const primitive = node.primitives[0]; - const frameState = scene.frameState; - - const renderResources = mockRenderResources(primitive); - - expect(renderResources.count).toBe(36); - expect(renderResources.primitiveType).toBe(PrimitiveType.TRIANGLES); - - WireframePipelineStage.process(renderResources, primitive, frameState); - - const wireframeIndexBuffer = renderResources.wireframeIndexBuffer; - const model = renderResources.model; - expect(wireframeIndexBuffer).toBeDefined(); - expect(model._pipelineResources).toEqual([wireframeIndexBuffer]); - expect(model.statistics.geometryByteLength).toBe( - wireframeIndexBuffer.sizeInBytes - ); - - expect(renderResources.primitiveType).toBe(PrimitiveType.LINES); - expect(renderResources.count).toBe(72); - }); + return loadGltf(boxTexturedBinary, scene, options).then( + function (gltfLoader) { + const components = gltfLoader.components; + const node = components.nodes[1]; + const primitive = node.primitives[0]; + const frameState = scene.frameState; + + const renderResources = mockRenderResources(primitive); + + expect(renderResources.count).toBe(36); + expect(renderResources.primitiveType).toBe(PrimitiveType.TRIANGLES); + + WireframePipelineStage.process( + renderResources, + primitive, + frameState, + ); + + const wireframeIndexBuffer = renderResources.wireframeIndexBuffer; + const model = renderResources.model; + expect(wireframeIndexBuffer).toBeDefined(); + expect(model._pipelineResources).toEqual([wireframeIndexBuffer]); + expect(model.statistics.geometryByteLength).toBe( + wireframeIndexBuffer.sizeInBytes, + ); + + expect(renderResources.primitiveType).toBe(PrimitiveType.LINES); + expect(renderResources.count).toBe(72); + }, + ); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/Model/loadAndZoomToModelAsync.js b/packages/engine/Specs/Scene/Model/loadAndZoomToModelAsync.js index 2c80710f8a4c..2a17f97533a4 100644 --- a/packages/engine/Specs/Scene/Model/loadAndZoomToModelAsync.js +++ b/packages/engine/Specs/Scene/Model/loadAndZoomToModelAsync.js @@ -10,7 +10,7 @@ async function loadAndZoomToModelAsync(options, scene) { scene.renderForSpecs(); return model.ready; }, - { timeout: 10000 } + { timeout: 10000 }, ); scene.camera.flyToBoundingSphere(model.boundingSphere, { diff --git a/packages/engine/Specs/Scene/Model/pickModelSpec.js b/packages/engine/Specs/Scene/Model/pickModelSpec.js index 02dc9d73d8f7..9a8ad02fab38 100644 --- a/packages/engine/Specs/Scene/Model/pickModelSpec.js +++ b/packages/engine/Specs/Scene/Model/pickModelSpec.js @@ -82,7 +82,7 @@ describe("Scene/Model/pickModel", function () { url: boxTexturedGltfUrl, enablePick: !scene.frameState.context.webgl2, }, - scene + scene, ); const ray = new Ray(); expect(pickModel(model, ray, scene.frameState)).toBeUndefined(); @@ -94,19 +94,19 @@ describe("Scene/Model/pickModel", function () { url: boxTexturedGltfUrl, enablePick: !scene.frameState.context.webgl2, }, - scene + scene, ); const ray = scene.camera.getPickRay( new Cartesian2( scene.drawingBufferWidth / 2.0, - scene.drawingBufferHeight / 2.0 - ) + scene.drawingBufferHeight / 2.0, + ), ); const expected = new Cartesian3(0.5, 0, 0.5); expect(pickModel(model, ray, scene.frameState)).toEqualEpsilon( expected, - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); }); @@ -122,19 +122,19 @@ describe("Scene/Model/pickModel", function () { url: boxTexturedGltfUrl, enablePick: true, }, - scene + scene, ); const ray = scene.camera.getPickRay( new Cartesian2( scene.drawingBufferWidth / 2.0, - scene.drawingBufferHeight / 2.0 - ) + scene.drawingBufferHeight / 2.0, + ), ); const expected = new Cartesian3(0.5, 0, 0.5); expect(pickModel(model, ray, scene.frameState)).toEqualEpsilon( expected, - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); sceneWithWebgl1.destroyForSpecs(); @@ -146,19 +146,19 @@ describe("Scene/Model/pickModel", function () { url: boxWithOffsetUrl, enablePick: !scene.frameState.context.webgl2, }, - scene + scene, ); const ray = scene.camera.getPickRay( new Cartesian2( scene.drawingBufferWidth / 2.0, - scene.drawingBufferHeight / 2.0 - ) + scene.drawingBufferHeight / 2.0, + ), ); const expected = new Cartesian3(0.0, 5.5, -0.5); expect(pickModel(model, ray, scene.frameState)).toEqualEpsilon( expected, - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); }); @@ -168,19 +168,19 @@ describe("Scene/Model/pickModel", function () { url: boxCesiumRtcUrl, enablePick: !scene.frameState.context.webgl2, }, - scene + scene, ); const ray = scene.camera.getPickRay( new Cartesian2( scene.drawingBufferWidth / 2.0, - scene.drawingBufferHeight / 2.0 - ) + scene.drawingBufferHeight / 2.0, + ), ); const expected = new Cartesian3(6378137.5, 0.0, -0.499999996649); expect(pickModel(model, ray, scene.frameState)).toEqualEpsilon( expected, - CesiumMath.EPSILON8 + CesiumMath.EPSILON8, ); }); @@ -190,19 +190,19 @@ describe("Scene/Model/pickModel", function () { url: boxWithQuantizedAttributes, enablePick: !scene.frameState.context.webgl2, }, - scene + scene, ); const ray = scene.camera.getPickRay( new Cartesian2( scene.drawingBufferWidth / 2.0, - scene.drawingBufferHeight / 2.0 - ) + scene.drawingBufferHeight / 2.0, + ), ); const expected = new Cartesian3(0.5, 0, 0.5); expect(pickModel(model, ray, scene.frameState)).toEqualEpsilon( expected, - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); }); @@ -212,19 +212,19 @@ describe("Scene/Model/pickModel", function () { url: boxWithMixedCompression, enablePick: !scene.frameState.context.webgl2, }, - scene + scene, ); const ray = scene.camera.getPickRay( new Cartesian2( scene.drawingBufferWidth / 2.0, - scene.drawingBufferHeight / 2.0 - ) + scene.drawingBufferHeight / 2.0, + ), ); const expected = new Cartesian3(1.0, 0, 1.0); expect(pickModel(model, ray, scene.frameState)).toEqualEpsilon( expected, - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); }); @@ -234,19 +234,19 @@ describe("Scene/Model/pickModel", function () { url: boxInterleaved, enablePick: !scene.frameState.context.webgl2, }, - scene + scene, ); const ray = scene.camera.getPickRay( new Cartesian2( scene.drawingBufferWidth / 2.0, - scene.drawingBufferHeight / 2.0 - ) + scene.drawingBufferHeight / 2.0, + ), ); const expected = new Cartesian3(0.5, 0, 0.5); expect(pickModel(model, ray, scene.frameState)).toEqualEpsilon( expected, - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); }); @@ -256,7 +256,7 @@ describe("Scene/Model/pickModel", function () { const offset = new HeadingPitchRange( CesiumMath.PI_OVER_TWO, -CesiumMath.PI_OVER_FOUR, - 1 + 1, ); const model = await loadAndZoomToModelAsync( @@ -265,19 +265,19 @@ describe("Scene/Model/pickModel", function () { enablePick: !scene.frameState.context.webgl2, offset, }, - scene + scene, ); const ray = scene.camera.getPickRay( new Cartesian2( scene.drawingBufferWidth / 2.0, - scene.drawingBufferHeight / 2.0 - ) + scene.drawingBufferHeight / 2.0, + ), ); const expected = new Cartesian3(0, -0.5, 0.5); expect(pickModel(model, ray, scene.frameState)).toEqualEpsilon( expected, - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); }); @@ -287,13 +287,13 @@ describe("Scene/Model/pickModel", function () { url: pointCloudUrl, enablePick: !scene.frameState.context.webgl2, }, - scene + scene, ); const ray = scene.camera.getPickRay( new Cartesian2( scene.drawingBufferWidth / 2.0, - scene.drawingBufferHeight / 2.0 - ) + scene.drawingBufferHeight / 2.0, + ), ); expect(pickModel(model, ray, scene.frameState)).toBeUndefined(); @@ -305,13 +305,13 @@ describe("Scene/Model/pickModel", function () { url: boxTexturedGltfUrl, enablePick: !scene.frameState.context.webgl2, }, - scene + scene, ); const ray = scene.camera.getPickRay( new Cartesian2( scene.drawingBufferWidth / 2.0, - scene.drawingBufferHeight / 2.0 - ) + scene.drawingBufferHeight / 2.0, + ), ); ray.origin = model.boundingSphere.center; @@ -325,13 +325,13 @@ describe("Scene/Model/pickModel", function () { enablePick: !scene.frameState.context.webgl2, backFaceCulling: false, }, - scene + scene, ); const ray = scene.camera.getPickRay( new Cartesian2( scene.drawingBufferWidth / 2.0, - scene.drawingBufferHeight / 2.0 - ) + scene.drawingBufferHeight / 2.0, + ), ); ray.origin = model.boundingSphere.center; @@ -339,11 +339,11 @@ describe("Scene/Model/pickModel", function () { const expected = new Cartesian3( -0.9999998807907355, 0, - -0.9999998807907104 + -0.9999998807907104, ); expect(pickModel(model, ray, scene.frameState)).toEqualEpsilon( expected, - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); }); @@ -353,13 +353,13 @@ describe("Scene/Model/pickModel", function () { url: boxTexturedGltfUrl, enablePick: !scene.frameState.context.webgl2, }, - scene + scene, ); const ray = scene.camera.getPickRay( new Cartesian2( scene.drawingBufferWidth / 2.0, - scene.drawingBufferHeight / 2.0 - ) + scene.drawingBufferHeight / 2.0, + ), ); const result = new Cartesian3(); @@ -371,7 +371,7 @@ describe("Scene/Model/pickModel", function () { undefined, undefined, undefined, - result + result, ); expect(result).toEqualEpsilon(expected, CesiumMath.EPSILON12); expect(returned).toBe(result); @@ -383,13 +383,13 @@ describe("Scene/Model/pickModel", function () { url: boxTexturedGltfUrl, enablePick: !scene.frameState.context.webgl2, }, - scene + scene, ); const ray = scene.camera.getPickRay( new Cartesian2( scene.drawingBufferWidth / 2.0, - scene.drawingBufferHeight / 2.0 - ) + scene.drawingBufferHeight / 2.0, + ), ); scene.frameState.mode = SceneMode.MORPHING; @@ -402,13 +402,13 @@ describe("Scene/Model/pickModel", function () { url: boxTexturedGltfUrl, enablePick: !scene.frameState.context.webgl2, }, - scene + scene, ); const ray = scene.camera.getPickRay( new Cartesian2( scene.drawingBufferWidth / 2.0, - scene.drawingBufferHeight / 2.0 - ) + scene.drawingBufferHeight / 2.0, + ), ); const expected = new Cartesian3(-65.51341504, 0, -65.51341504); @@ -418,8 +418,8 @@ describe("Scene/Model/pickModel", function () { ray, scene.frameState, 2.0, - -Ellipsoid.WGS84.minimumRadius - ) + -Ellipsoid.WGS84.minimumRadius, + ), ).toEqualEpsilon(expected, CesiumMath.EPSILON8); }); }); diff --git a/packages/engine/Specs/Scene/MoonSpec.js b/packages/engine/Specs/Scene/MoonSpec.js index 6b5f2201bec1..1da140c7caba 100644 --- a/packages/engine/Specs/Scene/MoonSpec.js +++ b/packages/engine/Specs/Scene/MoonSpec.js @@ -32,13 +32,14 @@ describe( Transforms.computeTemeToPseudoFixedMatrix(date, icrfToFixed); } - const moonPosition = Simon1994PlanetaryPositions.computeMoonPositionInEarthInertialFrame( - date - ); + const moonPosition = + Simon1994PlanetaryPositions.computeMoonPositionInEarthInertialFrame( + date, + ); Matrix3.multiplyByVector(icrfToFixed, moonPosition, moonPosition); camera.viewBoundingSphere( - new BoundingSphere(moonPosition, Ellipsoid.MOON.maximumRadius) + new BoundingSphere(moonPosition, Ellipsoid.MOON.maximumRadius), ); } @@ -80,5 +81,5 @@ describe( expect(moon.isDestroyed()).toEqual(true); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/MultifrustumSpec.js b/packages/engine/Specs/Scene/MultifrustumSpec.js index 5c417c6f4a7a..f981a3de2845 100644 --- a/packages/engine/Specs/Scene/MultifrustumSpec.js +++ b/packages/engine/Specs/Scene/MultifrustumSpec.js @@ -216,7 +216,7 @@ describe( this._rs = undefined; this._modelMatrix = Matrix4.fromTranslation( new Cartesian3(0.0, 0.0, -50000.0), - new Matrix4() + new Matrix4(), ); this.color = new Color(1.0, 1.0, 0.0, 1.0); @@ -253,18 +253,17 @@ describe( const maximum = Cartesian3.multiplyByScalar( dimensions, 0.5, - new Cartesian3() + new Cartesian3(), ); const minimum = Cartesian3.negate(maximum, new Cartesian3()); const geometry = BoxGeometry.createGeometry( new BoxGeometry({ minimum: minimum, maximum: maximum, - }) - ); - const attributeLocations = GeometryPipeline.createAttributeLocations( - geometry + }), ); + const attributeLocations = + GeometryPipeline.createAttributeLocations(geometry); this._va = VertexArray.fromGeometry({ context: frameState.context, geometry: geometry, @@ -296,7 +295,7 @@ describe( ? new BoundingSphere(Cartesian3.clone(Cartesian3.ZERO), 500000.0) : undefined, pass: Pass.OPAQUE, - }) + }), ); }; @@ -375,5 +374,5 @@ describe( }); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/Multiple3DTileContentSpec.js b/packages/engine/Specs/Scene/Multiple3DTileContentSpec.js index 7e84bd96d4e2..5682ba42c43c 100644 --- a/packages/engine/Specs/Scene/Multiple3DTileContentSpec.js +++ b/packages/engine/Specs/Scene/Multiple3DTileContentSpec.js @@ -149,7 +149,7 @@ describe( tileset, tile, tilesetResource, - contentsJson + contentsJson, ); expect(content.innerContentUrls).toEqual([ @@ -166,7 +166,7 @@ describe( tileset, tile, tilesetResource, - contentJson + contentJson, ); expect(content.innerContentUrls).toEqual([ @@ -188,7 +188,7 @@ describe( mockTileset, tile, tilesetResource, - contentsJson + contentsJson, ); spyOn(Resource.prototype, "fetchArrayBuffer").and.callFake(function () { @@ -216,7 +216,7 @@ describe( mockTileset, tile, tilesetResource, - contentsJson + contentsJson, ); RequestScheduler.maximumRequestsPerServer = 2; @@ -238,7 +238,7 @@ describe( mockTileset, tile, tilesetResource, - contentsJson + contentsJson, ); spyOn(Resource.prototype, "fetchArrayBuffer").and.callFake(function () { @@ -258,7 +258,7 @@ describe( expect(failureSpy).toHaveBeenCalledWith( jasmine.objectContaining({ message: "my error", - }) + }), ); }); @@ -274,7 +274,7 @@ describe( mockTileset, tile, tilesetResource, - contentsJson + contentsJson, ); spyOn(Resource.prototype, "fetchArrayBuffer").and.callFake(function () { @@ -295,7 +295,7 @@ describe( it("becomes ready", async function () { const tileset = await Cesium3DTilesTester.loadTileset( scene, - multipleContentsUrl + multipleContentsUrl, ); expect(tileset.root.contentReady).toBeTrue(); expect(tileset.root.content).toBeDefined(); @@ -303,21 +303,21 @@ describe( it("renders multiple contents", function () { return Cesium3DTilesTester.loadTileset(scene, multipleContentsUrl).then( - expectRenderMultipleContents + expectRenderMultipleContents, ); }); it("renders multiple contents (legacy)", function () { return Cesium3DTilesTester.loadTileset( scene, - multipleContentsLegacyUrl + multipleContentsLegacyUrl, ).then(expectRenderMultipleContents); }); it("renders multiple contents (legacy with 'content')", function () { return Cesium3DTilesTester.loadTileset( scene, - multipleContentsLegacyWithContentUrl + multipleContentsLegacyWithContentUrl, ).then(expectRenderMultipleContents); }); @@ -335,7 +335,7 @@ describe( }); }); return Cesium3DTilesTester.loadTileset(scene, multipleContentsUrl).then( - expectRenderMultipleContents + expectRenderMultipleContents, ); }); @@ -355,7 +355,7 @@ describe( }); return Cesium3DTilesTester.loadTileset( scene, - multipleContentsLegacyUrl + multipleContentsLegacyUrl, ).then(expectRenderMultipleContents); }); @@ -373,9 +373,9 @@ describe( function () { // the content should be canceled once in total expect(multipleContents._cancelCount).toBe(1); - } + }, ); - } + }, ); }); @@ -433,7 +433,7 @@ describe( function (tileset) { const content = tileset.root.content; expect(content.group).not.toBeDefined(); - } + }, ); }); @@ -446,14 +446,14 @@ describe( metadata: groupMetadata, }); }).toThrowDeveloperError(); - } + }, ); }); it("initializes group metadata for inner contents", function () { return Cesium3DTilesTester.loadTileset( scene, - withGroupMetadataUrl + withGroupMetadataUrl, ).then(function (tileset) { const multipleContents = tileset.root.content; const innerContents = multipleContents.innerContents; @@ -462,7 +462,7 @@ describe( let groupMetadata = buildingsContent.group.metadata; expect(groupMetadata).toBeDefined(); expect(groupMetadata.getProperty("color")).toEqual( - new Cartesian3(255, 127, 0) + new Cartesian3(255, 127, 0), ); expect(groupMetadata.getProperty("priority")).toBe(10); expect(groupMetadata.getProperty("isInstanced")).toBe(false); @@ -471,7 +471,7 @@ describe( groupMetadata = cubesContent.group.metadata; expect(groupMetadata).toBeDefined(); expect(groupMetadata.getProperty("color")).toEqual( - new Cartesian3(0, 255, 127) + new Cartesian3(0, 255, 127), ); expect(groupMetadata.getProperty("priority")).toBe(5); expect(groupMetadata.getProperty("isInstanced")).toBe(true); @@ -481,7 +481,7 @@ describe( it("initializes group metadata for inner contents (legacy)", function () { return Cesium3DTilesTester.loadTileset( scene, - withGroupMetadataLegacyUrl + withGroupMetadataLegacyUrl, ).then(function (tileset) { const multipleContents = tileset.root.content; const innerContents = multipleContents.innerContents; @@ -490,7 +490,7 @@ describe( let groupMetadata = buildingsContent.group.metadata; expect(groupMetadata).toBeDefined(); expect(groupMetadata.getProperty("color")).toEqual( - new Cartesian3(255, 127, 0) + new Cartesian3(255, 127, 0), ); expect(groupMetadata.getProperty("priority")).toBe(10); expect(groupMetadata.getProperty("isInstanced")).toBe(false); @@ -499,7 +499,7 @@ describe( groupMetadata = cubesContent.group.metadata; expect(groupMetadata).toBeDefined(); expect(groupMetadata.getProperty("color")).toEqual( - new Cartesian3(0, 255, 127) + new Cartesian3(0, 255, 127), ); expect(groupMetadata.getProperty("priority")).toBe(5); expect(groupMetadata.getProperty("isInstanced")).toBe(true); @@ -511,7 +511,7 @@ describe( function (tileset) { const content = tileset.root.content; expect(content.metadata).not.toBeDefined(); - } + }, ); }); @@ -522,14 +522,14 @@ describe( const content = tileset.root.content; content.metadata = {}; }).toThrowDeveloperError(); - } + }, ); }); it("initializes explicit content metadata for inner contents", function () { return Cesium3DTilesTester.loadTileset( scene, - withExplicitContentMetadataUrl + withExplicitContentMetadataUrl, ).then(function (tileset) { const multipleContents = tileset.root.content; const innerContents = multipleContents.innerContents; @@ -538,7 +538,7 @@ describe( const batchedMetadata = batchedContent.metadata; expect(batchedMetadata).toBeDefined(); expect(batchedMetadata.getProperty("highlightColor")).toEqual( - new Cartesian3(0, 0, 255) + new Cartesian3(0, 0, 255), ); expect(batchedMetadata.getProperty("author")).toEqual("Cesium"); @@ -546,10 +546,10 @@ describe( const instancedMetadata = instancedContent.metadata; expect(instancedMetadata).toBeDefined(); expect(instancedMetadata.getProperty("numberOfInstances")).toEqual( - 50 + 50, ); expect(instancedMetadata.getProperty("author")).toEqual( - "Sample Author" + "Sample Author", ); }); }); @@ -557,7 +557,7 @@ describe( it("initializes explicit content metadata for inner contents (legacy)", function () { return Cesium3DTilesTester.loadTileset( scene, - withExplicitContentMetadataLegacyUrl + withExplicitContentMetadataLegacyUrl, ).then(function (tileset) { const multipleContents = tileset.root.content; const innerContents = multipleContents.innerContents; @@ -566,7 +566,7 @@ describe( const batchedMetadata = batchedContent.metadata; expect(batchedMetadata).toBeDefined(); expect(batchedMetadata.getProperty("highlightColor")).toEqual( - new Cartesian3(0, 0, 255) + new Cartesian3(0, 0, 255), ); expect(batchedMetadata.getProperty("author")).toEqual("Cesium"); @@ -574,10 +574,10 @@ describe( const instancedMetadata = instancedContent.metadata; expect(instancedMetadata).toBeDefined(); expect(instancedMetadata.getProperty("numberOfInstances")).toEqual( - 50 + 50, ); expect(instancedMetadata.getProperty("author")).toEqual( - "Sample Author" + "Sample Author", ); }); }); @@ -585,7 +585,7 @@ describe( it("initializes implicit content metadata for inner contents", function () { return Cesium3DTilesTester.loadTileset( scene, - withImplicitContentMetadataUrl + withImplicitContentMetadataUrl, ).then(function (tileset) { const placeholderTile = tileset.root; const subtreeRootTile = placeholderTile.children[0]; @@ -601,7 +601,7 @@ describe( expect(buildingMetadata).toBeDefined(); expect(buildingMetadata.getProperty("height")).toEqual(50); expect(buildingMetadata.getProperty("color")).toEqual( - new Cartesian3(0, 0, 255) + new Cartesian3(0, 0, 255), ); const treeContent = innerContents[1]; @@ -614,7 +614,7 @@ describe( it("initializes implicit content metadata for inner contents (legacy)", function () { return Cesium3DTilesTester.loadTileset( scene, - withImplicitContentMetadataLegacyUrl + withImplicitContentMetadataLegacyUrl, ).then(function (tileset) { const placeholderTile = tileset.root; const subtreeRootTile = placeholderTile.children[0]; @@ -630,7 +630,7 @@ describe( expect(buildingMetadata).toBeDefined(); expect(buildingMetadata.getProperty("height")).toEqual(50); expect(buildingMetadata.getProperty("color")).toEqual( - new Cartesian3(0, 0, 255) + new Cartesian3(0, 0, 255), ); const treeContent = innerContents[1]; @@ -641,5 +641,5 @@ describe( }); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/OpenStreetMapImageryProviderSpec.js b/packages/engine/Specs/Scene/OpenStreetMapImageryProviderSpec.js index b097f2c020e1..238e58b117cf 100644 --- a/packages/engine/Specs/Scene/OpenStreetMapImageryProviderSpec.js +++ b/packages/engine/Specs/Scene/OpenStreetMapImageryProviderSpec.js @@ -46,20 +46,18 @@ describe("Scene/OpenStreetMapImageryProvider", function () { url: resource, }); - spyOn(Resource._Implementations, "createImage").and.callFake(function ( - request, - crossOrigin, - deferred - ) { - expect(request.url).not.toContain("//"); - - // Just return any old image. - Resource._DefaultImplementations.createImage( - new Request({ url: "Data/Images/Red16x16.png" }), - crossOrigin, - deferred - ); - }); + spyOn(Resource._Implementations, "createImage").and.callFake( + function (request, crossOrigin, deferred) { + expect(request.url).not.toContain("//"); + + // Just return any old image. + Resource._DefaultImplementations.createImage( + new Request({ url: "Data/Images/Red16x16.png" }), + crossOrigin, + deferred, + ); + }, + ); return provider.requestImage(0, 0, 0).then(function (image) { expect(Resource._Implementations.createImage).toHaveBeenCalled(); @@ -72,20 +70,18 @@ describe("Scene/OpenStreetMapImageryProvider", function () { url: "made/up/osm/server/", }); - spyOn(Resource._Implementations, "createImage").and.callFake(function ( - request, - crossOrigin, - deferred - ) { - expect(request.url).not.toContain("//"); - - // Just return any old image. - Resource._DefaultImplementations.createImage( - new Request({ url: "Data/Images/Red16x16.png" }), - crossOrigin, - deferred - ); - }); + spyOn(Resource._Implementations, "createImage").and.callFake( + function (request, crossOrigin, deferred) { + expect(request.url).not.toContain("//"); + + // Just return any old image. + Resource._DefaultImplementations.createImage( + new Request({ url: "Data/Images/Red16x16.png" }), + crossOrigin, + deferred, + ); + }, + ); return provider.requestImage(0, 0, 0).then(function (image) { expect(Resource._Implementations.createImage).toHaveBeenCalled(); @@ -98,20 +94,18 @@ describe("Scene/OpenStreetMapImageryProvider", function () { url: "made/up/osm/server", }); - spyOn(Resource._Implementations, "createImage").and.callFake(function ( - request, - crossOrigin, - deferred - ) { - expect(request.url).toContain("made/up/osm/server/"); - - // Just return any old image. - Resource._DefaultImplementations.createImage( - new Request({ url: "Data/Images/Red16x16.png" }), - crossOrigin, - deferred - ); - }); + spyOn(Resource._Implementations, "createImage").and.callFake( + function (request, crossOrigin, deferred) { + expect(request.url).toContain("made/up/osm/server/"); + + // Just return any old image. + Resource._DefaultImplementations.createImage( + new Request({ url: "Data/Images/Red16x16.png" }), + crossOrigin, + deferred, + ); + }, + ); return provider.requestImage(0, 0, 0).then(function (image) { expect(Resource._Implementations.createImage).toHaveBeenCalled(); @@ -131,18 +125,16 @@ describe("Scene/OpenStreetMapImageryProvider", function () { expect(provider.tilingScheme).toBeInstanceOf(WebMercatorTilingScheme); expect(provider.rectangle).toEqual(new WebMercatorTilingScheme().rectangle); - spyOn(Resource._Implementations, "createImage").and.callFake(function ( - request, - crossOrigin, - deferred - ) { - // Just return any old image. - Resource._DefaultImplementations.createImage( - new Request({ url: "Data/Images/Red16x16.png" }), - crossOrigin, - deferred - ); - }); + spyOn(Resource._Implementations, "createImage").and.callFake( + function (request, crossOrigin, deferred) { + // Just return any old image. + Resource._DefaultImplementations.createImage( + new Request({ url: "Data/Images/Red16x16.png" }), + crossOrigin, + deferred, + ); + }, + ); return provider.requestImage(0, 0, 0).then(function (image) { expect(Resource._Implementations.createImage).toHaveBeenCalled(); @@ -178,36 +170,34 @@ describe("Scene/OpenStreetMapImageryProvider", function () { expect(provider.tilingScheme).toBeInstanceOf(WebMercatorTilingScheme); expect(provider.rectangle.west).toBeCloseTo( rectangle.west, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); expect(provider.rectangle.south).toBeCloseTo( rectangle.south, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); expect(provider.rectangle.east).toBeCloseTo( rectangle.east, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); expect(provider.rectangle.north).toBeCloseTo( rectangle.north, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); expect(provider.tileDiscardPolicy).toBeUndefined(); - spyOn(Resource._Implementations, "createImage").and.callFake(function ( - request, - crossOrigin, - deferred - ) { - expect(request.url).toContain("/0/0/0"); - - // Just return any old image. - Resource._DefaultImplementations.createImage( - new Request({ url: "Data/Images/Red16x16.png" }), - crossOrigin, - deferred - ); - }); + spyOn(Resource._Implementations, "createImage").and.callFake( + function (request, crossOrigin, deferred) { + expect(request.url).toContain("/0/0/0"); + + // Just return any old image. + Resource._DefaultImplementations.createImage( + new Request({ url: "Data/Images/Red16x16.png" }), + crossOrigin, + deferred, + ); + }, + ); return provider.requestImage(0, 0, 0).then(function (image) { expect(Resource._Implementations.createImage).toHaveBeenCalled(); @@ -237,20 +227,18 @@ describe("Scene/OpenStreetMapImageryProvider", function () { retinaTiles: true, }); - spyOn(Resource._Implementations, "createImage").and.callFake(function ( - request, - crossOrigin, - deferred - ) { - expect(request.url).toContain("0/0/0@2x.png"); - - // Just return any old image. - Resource._DefaultImplementations.createImage( - new Request({ url: "Data/Images/Red16x16.png" }), - crossOrigin, - deferred - ); - }); + spyOn(Resource._Implementations, "createImage").and.callFake( + function (request, crossOrigin, deferred) { + expect(request.url).toContain("0/0/0@2x.png"); + + // Just return any old image. + Resource._DefaultImplementations.createImage( + new Request({ url: "Data/Images/Red16x16.png" }), + crossOrigin, + deferred, + ); + }, + ); const image = await provider.requestImage(0, 0, 0); expect(Resource._Implementations.createImage).toHaveBeenCalled(); @@ -279,14 +267,14 @@ describe("Scene/OpenStreetMapImageryProvider", function () { Resource._Implementations.createImage = function ( request, crossOrigin, - deferred + deferred, ) { if (tries === 2) { // Succeed after 2 tries Resource._DefaultImplementations.createImage( new Request({ url: "Data/Images/Red16x16.png" }), crossOrigin, - deferred + deferred, ); } else { // fail @@ -315,7 +303,7 @@ describe("Scene/OpenStreetMapImageryProvider", function () { 0.0, 0.0, CesiumMath.toRadians(1.0), - CesiumMath.toRadians(1.0) + CesiumMath.toRadians(1.0), ); expect(function () { diff --git a/packages/engine/Specs/Scene/ParticleSpec.js b/packages/engine/Specs/Scene/ParticleSpec.js index 2a7a27462337..5b25e9c092bd 100644 --- a/packages/engine/Specs/Scene/ParticleSpec.js +++ b/packages/engine/Specs/Scene/ParticleSpec.js @@ -45,7 +45,7 @@ describe("Scene/Particle", function () { const position = new Cartesian3(1.0, 2.0, 3.0); const velocity = Cartesian3.normalize( new Cartesian3(-1.0, 1.0, 1.0), - new Cartesian3() + new Cartesian3(), ); const p = new Particle({ life: 15.0, @@ -57,7 +57,7 @@ describe("Scene/Particle", function () { const expectedPosition = Cartesian3.add( p.position, Cartesian3.multiplyByScalar(p.velocity, dt, new Cartesian3()), - new Cartesian3() + new Cartesian3(), ); expect(p.update(dt)).toEqual(true); @@ -77,7 +77,7 @@ describe("Scene/Particle", function () { const position = new Cartesian3(1.0, 2.0, 3.0); const velocity = Cartesian3.normalize( new Cartesian3(-1.0, 1.0, 1.0), - new Cartesian3() + new Cartesian3(), ); const p = new Particle({ life: 15.0, @@ -90,7 +90,7 @@ describe("Scene/Particle", function () { const expectedPosition = Cartesian3.add( p.position, Cartesian3.multiplyByScalar(p.velocity, dt, new Cartesian3()), - new Cartesian3() + new Cartesian3(), ); expect(p.update(dt, forces)).toEqual(true); diff --git a/packages/engine/Specs/Scene/ParticleSystemSpec.js b/packages/engine/Specs/Scene/ParticleSystemSpec.js index 288934593706..fa38951f7125 100644 --- a/packages/engine/Specs/Scene/ParticleSystemSpec.js +++ b/packages/engine/Specs/Scene/ParticleSystemSpec.js @@ -18,11 +18,11 @@ describe("Scene/ParticleSystem", function () { beforeAll(function () { scene = createScene(); - return Resource.fetchImage("./Data/Images/Green2x2.png").then(function ( - result - ) { - greenImage = result; - }); + return Resource.fetchImage("./Data/Images/Green2x2.png").then( + function (result) { + greenImage = result; + }, + ); }); afterAll(function () { @@ -77,7 +77,7 @@ describe("Scene/ParticleSystem", function () { 15.0, 16.0, 17.0, - 18.0 + 18.0, ), startColor: Color.MAGENTA, endColor: Color.LAVENDAR_BLUSH, @@ -143,7 +143,7 @@ describe("Scene/ParticleSystem", function () { 6.0, 7.0, 8.0, - 9.0 + 9.0, ); const emitterModelMatrix = new Matrix4( 10.0, @@ -154,7 +154,7 @@ describe("Scene/ParticleSystem", function () { 15.0, 16.0, 17.0, - 18.0 + 18.0, ); const startColor = Color.MAGENTA; const endColor = Color.LAVENDAR_BLUSH; @@ -372,7 +372,7 @@ describe("Scene/ParticleSystem", function () { emitter: new CircleEmitter(1.0), emissionRate: 10000, imageSize: new Cartesian2(100, 100), - }) + }), ); scene.camera.position = new Cartesian3(0.0, 0.0, 20.0); scene.camera.direction = new Cartesian3(0.0, 0.0, -1.0); diff --git a/packages/engine/Specs/Scene/PerInstanceColorAppearanceSpec.js b/packages/engine/Specs/Scene/PerInstanceColorAppearanceSpec.js index 663913967c99..9f9e8207c87e 100644 --- a/packages/engine/Specs/Scene/PerInstanceColorAppearanceSpec.js +++ b/packages/engine/Specs/Scene/PerInstanceColorAppearanceSpec.js @@ -55,7 +55,7 @@ describe( expect(a.vertexShaderSource).toBeDefined(); expect(a.fragmentShaderSource).toBeDefined(); expect(a.renderState).toEqual( - Appearance.getDefaultRenderState(true, false) + Appearance.getDefaultRenderState(true, false), ); expect(a.vertexFormat).toEqual(PerInstanceColorAppearance.VERTEX_FORMAT); expect(a.flat).toEqual(false); @@ -86,5 +86,5 @@ describe( expect(scene).notToRender([0, 0, 0, 255]); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/PickingSpec.js b/packages/engine/Specs/Scene/PickingSpec.js index 362fb4ca53b6..42b4bdc401c7 100644 --- a/packages/engine/Specs/Scene/PickingSpec.js +++ b/packages/engine/Specs/Scene/PickingSpec.js @@ -44,13 +44,13 @@ describe( -0.0001, -0.0001, 0.0001, - 0.0001 + 0.0001, ); const offscreenRectangle = Rectangle.fromDegrees( -45.0002, -1.0002, -45.0001, - -1.0001 + -1.0001, ); let primitiveRay; let offscreenRay; @@ -145,7 +145,7 @@ describe( const tileset = await Cesium3DTilesTester.loadTileset( scene, url, - options + options, ); // The tilesets used in these tests have transforms that are not // what we want for our camera setup. Re-position the tileset @@ -243,15 +243,14 @@ describe( }); it("picks a voxel coordinate from a VoxelPrimitive", async function () { - const provider = await Cesium3DTilesVoxelProvider.fromUrl( - voxelTilesetUrl - ); + const provider = + await Cesium3DTilesVoxelProvider.fromUrl(voxelTilesetUrl); const primitive = new VoxelPrimitive({ provider }); scene.primitives.add(primitive); scene.renderForSpecs(); const voxelCoordinate = scene._picking.pickVoxelCoordinate( scene, - new Cartesian2(0, 0) + new Cartesian2(0, 0), ); expect(voxelCoordinate).toEqual(new Uint8Array(4)); }); @@ -265,11 +264,10 @@ describe( }); it("picks a voxel cell from a VoxelPrimitive", async function () { - const provider = await Cesium3DTilesVoxelProvider.fromUrl( - voxelTilesetUrl - ); + const provider = + await Cesium3DTilesVoxelProvider.fromUrl(voxelTilesetUrl); const modelMatrix = Matrix4.fromUniformScale( - Ellipsoid.WGS84.maximumRadius + Ellipsoid.WGS84.maximumRadius, ); const primitive = new VoxelPrimitive({ provider, modelMatrix }); scene.primitives.add(primitive); @@ -385,7 +383,7 @@ describe( geometryInstances: [instance1, instance2, instance3], asynchronous: false, appearance: new EllipsoidSurfaceAppearance(), - }) + }), ); expect(scene).toDrillPickAndCall(function (pickedObjects) { @@ -423,7 +421,7 @@ describe( geometryInstances: [instance1, instance2], asynchronous: false, appearance: new EllipsoidSurfaceAppearance(), - }) + }), ); expect(scene).toDrillPickAndCall(function (pickedObjects) { @@ -467,7 +465,7 @@ describe( geometryInstances: [instance1, instance2, instance3], asynchronous: false, appearance: new EllipsoidSurfaceAppearance(), - }) + }), ); expect(scene).toDrillPickAndCall(function (pickedObjects) { @@ -533,7 +531,7 @@ describe( expect(result.object).toBeUndefined(); expect(result.position).toBeDefined(); expect(result.position.x).toBeGreaterThan( - Ellipsoid.WGS84.minimumRadius + Ellipsoid.WGS84.minimumRadius, ); expect(result.position.y).toEqualEpsilon(0.0, CesiumMath.EPSILON5); expect(result.position.z).toEqualEpsilon(0.0, CesiumMath.EPSILON5); @@ -552,7 +550,7 @@ describe( const expectedPosition = Cartesian3.fromRadians(0.0, 0.0); expect(position).toEqualEpsilon( expectedPosition, - CesiumMath.EPSILON5 + CesiumMath.EPSILON5, ); } }, primitiveRay); @@ -601,7 +599,7 @@ describe( expect(result.object.primitive).toBe(rectangle1); }, primitiveRay, - [rectangle2, rectangle3, rectangle4] + [rectangle2, rectangle3, rectangle4], ); // Tests that rectangle4 does not get un-hidden @@ -623,7 +621,7 @@ describe( }, primitiveRay, [], - 0.01 + 0.01, ); }); @@ -635,7 +633,7 @@ describe( }, primitiveRay, [], - 0.1 + 0.1, ); expect(scene).toPickFromRayAndCall( function (result) { @@ -643,7 +641,7 @@ describe( }, primitiveRay, [], - 1.0 + 1.0, ); }); @@ -683,7 +681,7 @@ describe( const expectedPosition = Cartesian3.fromRadians(0.0, 0.0); expect(position).toEqualEpsilon( expectedPosition, - CesiumMath.EPSILON5 + CesiumMath.EPSILON5, ); } else { expect(position).toBeUndefined(); @@ -706,11 +704,11 @@ describe( const rectangleCenter2 = Cartesian3.fromRadians(0.0, 0.0, 1.0); expect(results[0].position).toEqualEpsilon( rectangleCenter2, - CesiumMath.EPSILON5 + CesiumMath.EPSILON5, ); expect(results[1].position).toEqualEpsilon( rectangleCenter1, - CesiumMath.EPSILON5 + CesiumMath.EPSILON5, ); } else { expect(results[0].position).toBeUndefined(); @@ -791,7 +789,7 @@ describe( geometryInstances: [instance1, instance2, instance3], asynchronous: false, appearance: new EllipsoidSurfaceAppearance(), - }) + }), ); expect(scene).toDrillPickFromRayAndCall(function (results) { @@ -829,7 +827,7 @@ describe( geometryInstances: [instance1, instance2], asynchronous: false, appearance: new EllipsoidSurfaceAppearance(), - }) + }), ); expect(scene).toDrillPickFromRayAndCall(function (results) { @@ -873,7 +871,7 @@ describe( geometryInstances: [instance1, instance2, instance3], asynchronous: false, appearance: new EllipsoidSurfaceAppearance(), - }) + }), ); expect(scene).toDrillPickFromRayAndCall(function (results) { @@ -897,7 +895,7 @@ describe( expect(results[2].object.primitive).toEqual(rectangle2); }, primitiveRay, - 3 + 3, ); }); @@ -915,7 +913,7 @@ describe( }, primitiveRay, 2, - [rectangle5, rectangle3] + [rectangle5, rectangle3], ); }); @@ -927,7 +925,7 @@ describe( }, primitiveRay, [], - 0.1 + 0.1, ); expect(scene).toDrillPickFromRayAndCall( function (result) { @@ -936,7 +934,7 @@ describe( primitiveRay, Number.POSITIVE_INFINITY, [], - 1.0 + 1.0, ); }); @@ -1038,7 +1036,7 @@ describe( expect(height).toEqualEpsilon(0.0, CesiumMath.EPSILON3); }, cartographic, - [rectangle2, rectangle3] + [rectangle2, rectangle3], ); }); @@ -1083,7 +1081,7 @@ describe( }, cartographic, [], - 0.1 + 0.1, ); expect(scene).toSampleHeightAndCall( function (height) { @@ -1091,7 +1089,7 @@ describe( }, cartographic, [], - 1.0 + 1.0, ); }); @@ -1188,7 +1186,7 @@ describe( const expectedCartesian = Cartesian3.fromRadians(0.0, 0.0); expect(cartesian).toEqualEpsilon( expectedCartesian, - CesiumMath.EPSILON5 + CesiumMath.EPSILON5, ); }, cartesian); }); @@ -1205,7 +1203,7 @@ describe( const expectedCartesian = Cartesian3.fromRadians(0.0, 0.0, 1.0); expect(cartesian).toEqualEpsilon( expectedCartesian, - CesiumMath.EPSILON5 + CesiumMath.EPSILON5, ); }, cartesian); }); @@ -1236,11 +1234,11 @@ describe( const expectedCartesian = Cartesian3.fromRadians(0.0, 0.0); expect(cartesian).toEqualEpsilon( expectedCartesian, - CesiumMath.EPSILON5 + CesiumMath.EPSILON5, ); }, cartesian, - [rectangle2, rectangle3] + [rectangle2, rectangle3], ); }); @@ -1259,7 +1257,7 @@ describe( expect(scene).toClampToHeightAndCall(function (clampedCartesian) { expect(clampedCartesian).toEqualEpsilon( cartesian, - CesiumMath.EPSILON3 + CesiumMath.EPSILON3, ); }, cartesian); @@ -1267,7 +1265,7 @@ describe( expect(scene).toClampToHeightAndCall(function (clampedCartesian) { expect(clampedCartesian).toEqualEpsilon( cartesian, - CesiumMath.EPSILON3 + CesiumMath.EPSILON3, ); }, cartesian); @@ -1290,7 +1288,7 @@ describe( }, cartesian, [], - 0.1 + 0.1, ); expect(scene).toClampToHeightAndCall( function (clampedCartesian) { @@ -1298,7 +1296,7 @@ describe( }, cartesian, [], - 1.0 + 1.0, ); }); @@ -1458,7 +1456,7 @@ describe( const objectsToExclude = [tileset]; const result = await pickFromRayMostDetailed( primitiveRay, - objectsToExclude + objectsToExclude, ); expect(result).toBeUndefined(); }); @@ -1490,7 +1488,7 @@ describe( const expectedPosition = Cartesian3.fromRadians(0.0, 0.0); expect(position).toEqualEpsilon( expectedPosition, - CesiumMath.EPSILON5 + CesiumMath.EPSILON5, ); } }); @@ -1604,7 +1602,7 @@ describe( const expectedPosition = Cartesian3.fromRadians(0.0, 0.0); expect(position).toEqualEpsilon( expectedPosition, - CesiumMath.EPSILON5 + CesiumMath.EPSILON5, ); } else { expect(position).toBeUndefined(); @@ -1630,11 +1628,11 @@ describe( const rectangleCenter2 = Cartesian3.fromRadians(0.0, 0.0, 1.0); expect(results[0].position).toEqualEpsilon( rectangleCenter2, - CesiumMath.EPSILON5 + CesiumMath.EPSILON5, ); expect(results[1].position).toEqualEpsilon( rectangleCenter1, - CesiumMath.EPSILON5 + CesiumMath.EPSILON5, ); } else { expect(results[0].position).toBeUndefined(); @@ -1726,7 +1724,7 @@ describe( geometryInstances: [instance1, instance2, instance3], asynchronous: false, appearance: new EllipsoidSurfaceAppearance(), - }) + }), ); scene.camera.setView({ destination: offscreenRectangle }); @@ -1767,7 +1765,7 @@ describe( geometryInstances: [instance1, instance2], asynchronous: false, appearance: new EllipsoidSurfaceAppearance(), - }) + }), ); scene.camera.setView({ destination: offscreenRectangle }); @@ -1814,7 +1812,7 @@ describe( geometryInstances: [instance1, instance2, instance3], asynchronous: false, appearance: new EllipsoidSurfaceAppearance(), - }) + }), ); scene.camera.setView({ destination: offscreenRectangle }); @@ -1869,14 +1867,14 @@ describe( primitiveRay, 1, [], - 0.1 + 0.1, ); expect(result1.length).toBe(0); const result2 = await drillPickFromRayMostDetailed( primitiveRay, 1, [], - 1.0 + 1.0, ); expect(result2.length).toBe(1); }); @@ -1910,9 +1908,8 @@ describe( const cartographics = [new Cartographic(0.0, 0.0)]; await createTileset(batchedTilesetUrl); - const updatedCartographics = await sampleHeightMostDetailed( - cartographics - ); + const updatedCartographics = + await sampleHeightMostDetailed(cartographics); const height = updatedCartographics[0].height; expect(height).toBeGreaterThan(0.0); expect(height).toBeLessThan(20.0); // Rough height of tile @@ -1934,9 +1931,8 @@ describe( new Cartographic(0.0002, 0.0002), ]; await createGlobe(); - const updatedCartographics = await sampleHeightMostDetailed( - cartographics - ); + const updatedCartographics = + await sampleHeightMostDetailed(cartographics); expect(updatedCartographics).toBe(cartographics); expect(updatedCartographics.length).toBe(3); let previousHeight; @@ -1960,9 +1956,8 @@ describe( const cartographics = [new Cartographic(0.0, 0.0)]; scene.camera.setView({ destination: offscreenRectangle }); await createGlobe(); - const updatedCartographics = await sampleHeightMostDetailed( - cartographics - ); + const updatedCartographics = + await sampleHeightMostDetailed(cartographics); expect(updatedCartographics[0].height).toBeUndefined(); }); @@ -1980,9 +1975,8 @@ describe( new Cartographic(-2.0, -2.0), ]; scene.camera.setView({ destination: offscreenRectangle }); - const updatedCartographics = await sampleHeightMostDetailed( - cartographics - ); + const updatedCartographics = + await sampleHeightMostDetailed(cartographics); expect(updatedCartographics[0].height).toBeDefined(); expect(updatedCartographics[1].height).toBeDefined(); expect(updatedCartographics[2].height).toBeUndefined(); // No primitive occupies this space @@ -2000,9 +1994,8 @@ describe( new Cartographic(0.0000005, 0.0000005), ]; scene.camera.setView({ destination: offscreenRectangle }); - const updatedCartographics = await sampleHeightMostDetailed( - cartographics - ); + const updatedCartographics = + await sampleHeightMostDetailed(cartographics); let previousHeight; for (let i = 0; i < 3; ++i) { const height = updatedCartographics[i].height; @@ -2020,12 +2013,11 @@ describe( createSmallRectangle(1.0); const cartographics = [new Cartographic(0.0, 0.0)]; scene.camera.setView({ destination: offscreenRectangle }); - const updatedCartographics = await sampleHeightMostDetailed( - cartographics - ); + const updatedCartographics = + await sampleHeightMostDetailed(cartographics); expect(updatedCartographics[0].height).toEqualEpsilon( 1.0, - CesiumMath.EPSILON3 + CesiumMath.EPSILON3, ); }); @@ -2046,12 +2038,12 @@ describe( scene.camera.setView({ destination: offscreenRectangle }); const updatedCartographics = await sampleHeightMostDetailed( cartographics, - [rectangle1, rectangle3] + [rectangle1, rectangle3], ); expect(updatedCartographics[0].height).toBeUndefined(); // This rectangle was excluded expect(updatedCartographics[1].height).toEqualEpsilon( 0.0, - CesiumMath.EPSILON2 + CesiumMath.EPSILON2, ); expect(updatedCartographics[2].height).toBeUndefined(); // No primitive occupies this space }); @@ -2071,18 +2063,17 @@ describe( }); scene.camera.setView({ destination: offscreenRectangle }); - let updatedCartographics = await sampleHeightMostDetailed( - cartographics - ); + let updatedCartographics = + await sampleHeightMostDetailed(cartographics); expect(updatedCartographics[0].height).toEqualEpsilon( height, - CesiumMath.EPSILON3 + CesiumMath.EPSILON3, ); point.disableDepthTestDistance = Number.POSITIVE_INFINITY; updatedCartographics = await sampleHeightMostDetailed(cartographics); expect(updatedCartographics[0].height).toEqualEpsilon( 0.0, - CesiumMath.EPSILON3 + CesiumMath.EPSILON3, ); rectangle.show = false; updatedCartographics = await sampleHeightMostDetailed(cartographics); @@ -2100,13 +2091,13 @@ describe( const updatedCartographics1 = await sampleHeightMostDetailed( cartographics1, [], - 0.1 + 0.1, ); expect(updatedCartographics1[0].height).toBeUndefined(); const updatedCartographics2 = await sampleHeightMostDetailed( cartographics2, [], - 1.0 + 1.0, ); expect(updatedCartographics2[0].height).toBeDefined(); }); @@ -2117,9 +2108,8 @@ describe( } const cartographics = []; - const updatedCartographics = await sampleHeightMostDetailed( - cartographics - ); + const updatedCartographics = + await sampleHeightMostDetailed(cartographics); expect(updatedCartographics.length).toBe(0); }); @@ -2274,7 +2264,7 @@ describe( for (let i = 0; i < 3; ++i) { expect(updatedCartesians[i]).toEqualEpsilon( expectedCartesians[i], - CesiumMath.EPSILON5 + CesiumMath.EPSILON5, ); expect(updatedCartesians[i]).not.toEqual(previousCartesian); previousCartesian = updatedCartesians[i]; @@ -2293,7 +2283,7 @@ describe( const expectedCartesian = Cartesian3.fromRadians(0.0, 0.0, 1.0); expect(updatedCartesians[0]).toEqualEpsilon( expectedCartesian, - CesiumMath.EPSILON5 + CesiumMath.EPSILON5, ); }); @@ -2317,12 +2307,12 @@ describe( rectangle3, ]); const expectedCartesian = Cartographic.toCartesian( - Rectangle.center(offscreenRectangle) + Rectangle.center(offscreenRectangle), ); expect(updatedCartesians[0]).toBeUndefined(); // This rectangle was excluded expect(updatedCartesians[1]).toEqualEpsilon( expectedCartesian, - CesiumMath.EPSILON2 + CesiumMath.EPSILON2, ); expect(updatedCartesians[2]).toBeUndefined(); // No primitive occupies this space }); @@ -2348,13 +2338,13 @@ describe( let updatedCartesians = await clampToHeightMostDetailed(cartesians1); expect(updatedCartesians[0]).toEqualEpsilon( cartesian, - CesiumMath.EPSILON3 + CesiumMath.EPSILON3, ); point.disableDepthTestDistance = Number.POSITIVE_INFINITY; updatedCartesians = await clampToHeightMostDetailed(cartesians2); expect(updatedCartesians[0]).toEqualEpsilon( cartesian, - CesiumMath.EPSILON3 + CesiumMath.EPSILON3, ); rectangle.show = false; updatedCartesians = await clampToHeightMostDetailed(cartesians3); @@ -2373,13 +2363,13 @@ describe( const clampedCartesians1 = await clampToHeightMostDetailed( cartesians1, [], - 0.1 + 0.1, ); expect(clampedCartesians1[0]).toBeUndefined(); const clampedCartesians2 = await clampToHeightMostDetailed( cartesians2, [], - 1.0 + 1.0, ); expect(clampedCartesians2[0]).toBeDefined(); }); @@ -2454,14 +2444,10 @@ describe( createSmallRectangle(0.0); const offscreenRectanglePrimitive = createRectangle( 0.0, - offscreenRectangle - ); - offscreenRectanglePrimitive.appearance.material.uniforms.color = new Color( - 1.0, - 0.0, - 0.0, - 1.0 + offscreenRectangle, ); + offscreenRectanglePrimitive.appearance.material.uniforms.color = + new Color(1.0, 0.0, 0.0, 1.0); scene.camera.setView({ destination: offscreenRectangle }); @@ -2478,18 +2464,18 @@ describe( const expectedCartesian = Cartesian3.fromRadians(0.0, 0.0); expect(cartesian).toEqualEpsilon( expectedCartesian, - CesiumMath.EPSILON5 + CesiumMath.EPSILON5, ); }, cartesian); // Call pickPosition expect(scene).toPickPositionAndCall(function (cartesian) { const expectedCartesian = Cartographic.toCartesian( - Rectangle.center(offscreenRectangle) + Rectangle.center(offscreenRectangle), ); expect(cartesian).toEqualEpsilon( expectedCartesian, - CesiumMath.EPSILON5 + CesiumMath.EPSILON5, ); }); @@ -2498,7 +2484,7 @@ describe( const expectedCartesian = Cartesian3.fromRadians(0.0, 0.0); expect(cartesian).toEqualEpsilon( expectedCartesian, - CesiumMath.EPSILON5 + CesiumMath.EPSILON5, ); }, cartesian); @@ -2510,17 +2496,13 @@ describe( const expectedCartesian = Cartesian3.fromRadians(0.0, 0.0); expect(cartesian).toEqualEpsilon( expectedCartesian, - CesiumMath.EPSILON5 + CesiumMath.EPSILON5, ); }, cartesian); // Call pickPosition on translucent primitive and returns undefined - offscreenRectanglePrimitive.appearance.material.uniforms.color = new Color( - 1.0, - 0.0, - 0.0, - 0.5 - ); + offscreenRectanglePrimitive.appearance.material.uniforms.color = + new Color(1.0, 0.0, 0.0, 0.5); scene.renderForSpecs(); expect(scene).toPickPositionAndCall(function (cartesian) { expect(cartesian).toBeUndefined(); @@ -2531,7 +2513,7 @@ describe( const expectedCartesian = Cartesian3.fromRadians(0.0, 0.0); expect(cartesian).toEqualEpsilon( expectedCartesian, - CesiumMath.EPSILON5 + CesiumMath.EPSILON5, ); }, cartesian); @@ -2540,11 +2522,11 @@ describe( scene.renderForSpecs(); expect(scene).toPickPositionAndCall(function (cartesian) { const expectedCartesian = Cartographic.toCartesian( - Rectangle.center(offscreenRectangle) + Rectangle.center(offscreenRectangle), ); expect(cartesian).toEqualEpsilon( expectedCartesian, - CesiumMath.EPSILON5 + CesiumMath.EPSILON5, ); }); @@ -2569,7 +2551,7 @@ describe( const expectedCartesian = Cartesian3.fromRadians(0.0, 0.0); expect(cartesian).toEqualEpsilon( expectedCartesian, - CesiumMath.EPSILON5 + CesiumMath.EPSILON5, ); }, cartesian); @@ -2583,5 +2565,5 @@ describe( }); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/PointCloudEyeDomeLightingSpec.js b/packages/engine/Specs/Scene/PointCloudEyeDomeLightingSpec.js index 7668c5c4d02c..ae47e5ee4d37 100644 --- a/packages/engine/Specs/Scene/PointCloudEyeDomeLightingSpec.js +++ b/packages/engine/Specs/Scene/PointCloudEyeDomeLightingSpec.js @@ -64,7 +64,7 @@ describe( scene.renderForSpecs(); const newLength = scene.frameState.commandList.length; expect(newLength).toEqual(originalLength + 2); - } + }, ); }); @@ -84,7 +84,7 @@ describe( scene.pickForSpecs(); const newLength = scene.frameState.commandList.length; expect(newLength).toEqual(originalLength); - } + }, ); }); @@ -118,9 +118,9 @@ describe( scene.renderForSpecs(); expect(scene.frameState.commandList.length).toBe(3); - } + }, ); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/PointCloudShadingSpec.js b/packages/engine/Specs/Scene/PointCloudShadingSpec.js index 134de14ba7a5..32b47597051e 100644 --- a/packages/engine/Specs/Scene/PointCloudShadingSpec.js +++ b/packages/engine/Specs/Scene/PointCloudShadingSpec.js @@ -26,18 +26,18 @@ describe("Scene/PointCloudShading", function () { pointCloudShading = new PointCloudShading(options); expect(pointCloudShading.attenuation).toEqual(false); expect(pointCloudShading.geometricErrorScale).toEqual( - options.geometricErrorScale + options.geometricErrorScale, ); expect(pointCloudShading.maximumAttenuation).toEqual( - options.maximumAttenuation + options.maximumAttenuation, ); expect(pointCloudShading.baseResolution).toEqual(options.baseResolution); expect(pointCloudShading.eyeDomeLighting).toEqual(true); expect(pointCloudShading.eyeDomeLightingStrength).toEqual( - options.eyeDomeLightingStrength + options.eyeDomeLightingStrength, ); expect(pointCloudShading.eyeDomeLightingRadius).toEqual( - options.eyeDomeLightingRadius + options.eyeDomeLightingRadius, ); expect(pointCloudShading.backFaceCulling).toEqual(options.backFaceCulling); expect(pointCloudShading.normalShading).toEqual(options.normalShading); diff --git a/packages/engine/Specs/Scene/PointPrimitiveCollectionSpec.js b/packages/engine/Specs/Scene/PointPrimitiveCollectionSpec.js index def2b35abfa9..036b44416502 100644 --- a/packages/engine/Specs/Scene/PointPrimitiveCollectionSpec.js +++ b/packages/engine/Specs/Scene/PointPrimitiveCollectionSpec.js @@ -113,13 +113,13 @@ describe( expect(p.outlineColor.alpha).toEqual(0.8); expect(p.outlineWidth).toEqual(4.0); expect(p.scaleByDistance).toEqual( - new NearFarScalar(1.0, 3.0, 1.0e6, 0.0) + new NearFarScalar(1.0, 3.0, 1.0e6, 0.0), ); expect(p.translucencyByDistance).toEqual( - new NearFarScalar(1.0, 1.0, 1.0e6, 0.0) + new NearFarScalar(1.0, 1.0, 1.0e6, 0.0), ); expect(p.distanceDisplayCondition).toEqual( - new DistanceDisplayCondition(10.0, 100.0) + new DistanceDisplayCondition(10.0, 100.0), ); expect(p.disableDepthTestDistance).toEqual(10.0); expect(p.id).toEqual("id"); @@ -153,13 +153,13 @@ describe( expect(p.outlineColor.alpha).toEqual(0.8); expect(p.outlineWidth).toEqual(4.0); expect(p.scaleByDistance).toEqual( - new NearFarScalar(1.0e6, 3.0, 1.0e8, 0.0) + new NearFarScalar(1.0e6, 3.0, 1.0e8, 0.0), ); expect(p.translucencyByDistance).toEqual( - new NearFarScalar(1.0e6, 1.0, 1.0e8, 0.0) + new NearFarScalar(1.0e6, 1.0, 1.0e8, 0.0), ); expect(p.distanceDisplayCondition).toEqual( - new DistanceDisplayCondition(10.0, 100.0) + new DistanceDisplayCondition(10.0, 100.0), ); expect(p.disableDepthTestDistance).toEqual(10.0); expect(p.splitDirection).toEqual(SplitDirection.LEFT); @@ -775,7 +775,7 @@ describe( scene.renderForSpecs(); expect(p.computeScreenSpacePosition(scene)).toEqualEpsilon( new Cartesian2(0.5, 0.5), - CesiumMath.EPSILON1 + CesiumMath.EPSILON1, ); }); @@ -789,7 +789,7 @@ describe( expect(actual).toEqual(result); expect(result).toEqualEpsilon( new Cartesian2(0.5, 0.5), - CesiumMath.EPSILON1 + CesiumMath.EPSILON1, ); }); @@ -842,7 +842,7 @@ describe( const bbox = PointPrimitive.getScreenSpaceBoundingBox( p, Cartesian2.ZERO, - result + result, ); expect(bbox.x).toEqual(-halfWidth); expect(bbox.y).toEqual(-halfHeight); @@ -940,11 +940,11 @@ describe( expected.center = new Cartesian3( 0.0, expected.center.x, - expected.center.y + expected.center.y, ); expect(actual.center).toEqualEpsilon( expected.center, - CesiumMath.EPSILON8 + CesiumMath.EPSILON8, ); expect(actual.radius).toBeGreaterThanOrEqual(expected.radius); }); @@ -980,14 +980,14 @@ describe( expected.center = new Cartesian3( 0.0, expected.center.x, - expected.center.y + expected.center.y, ); expect(actual.center).toEqualEpsilon( expected.center, - CesiumMath.EPSILON8 + CesiumMath.EPSILON8, ); expect(actual.radius).toBeGreaterThan(expected.radius); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/PolylineCollectionSpec.js b/packages/engine/Specs/Scene/PolylineCollectionSpec.js index f237f0a4aef3..85c4b026bb8b 100644 --- a/packages/engine/Specs/Scene/PolylineCollectionSpec.js +++ b/packages/engine/Specs/Scene/PolylineCollectionSpec.js @@ -77,10 +77,10 @@ describe( expect(p.width).toEqual(2); expect(p.material.uniforms.color).toEqual(material.uniforms.color); expect(p.material.uniforms.outlineColor).toEqual( - material.uniforms.outlineColor + material.uniforms.outlineColor, ); expect(p.material.uniforms.outlineWidth).toEqual( - material.uniforms.outlineWidth + material.uniforms.outlineWidth, ); expect(p.id).toEqual("id"); }); @@ -107,10 +107,10 @@ describe( expect(p.width).toEqual(2); expect(p.material.uniforms.color).toEqual(material.uniforms.color); expect(p.material.uniforms.outlineColor).toEqual( - material.uniforms.outlineColor + material.uniforms.outlineColor, ); expect(p.material.uniforms.outlineWidth).toEqual( - material.uniforms.outlineWidth + material.uniforms.outlineWidth, ); }); @@ -1276,7 +1276,7 @@ describe( x: -1000000.0, y: -1000000.0, z: 0.0, - } + }, ); } polylines.add({ @@ -1325,7 +1325,7 @@ describe( x: -1000000.0, y: -1000000.0, z: 0.0, - } + }, ); } polylines.add({ @@ -1422,20 +1422,28 @@ describe( new HeadingPitchRange( 0.0, -CesiumMath.PI_OVER_TWO, - radius + near - 10.0 - ) + radius + near - 10.0, + ), ); expect(scene).toRender([0, 0, 0, 255]); scene.camera.lookAt( center, - new HeadingPitchRange(0.0, -CesiumMath.PI_OVER_TWO, radius + near + 1.0) + new HeadingPitchRange( + 0.0, + -CesiumMath.PI_OVER_TWO, + radius + near + 1.0, + ), ); expect(scene).notToRender([0, 0, 0, 255]); scene.camera.lookAt( center, - new HeadingPitchRange(0.0, -CesiumMath.PI_OVER_TWO, radius + far + 10.0) + new HeadingPitchRange( + 0.0, + -CesiumMath.PI_OVER_TWO, + radius + far + 10.0, + ), ); expect(scene).toRender([0, 0, 0, 255]); }); @@ -1474,20 +1482,28 @@ describe( new HeadingPitchRange( 0.0, -CesiumMath.PI_OVER_TWO, - radius + near - 10.0 - ) + radius + near - 10.0, + ), ); expect(scene).toRender([0, 0, 0, 255]); scene.camera.lookAt( center, - new HeadingPitchRange(0.0, -CesiumMath.PI_OVER_TWO, radius + near + 1.0) + new HeadingPitchRange( + 0.0, + -CesiumMath.PI_OVER_TWO, + radius + near + 1.0, + ), ); expect(scene).notToRender([0, 0, 0, 255]); scene.camera.lookAt( center, - new HeadingPitchRange(0.0, -CesiumMath.PI_OVER_TWO, radius + far + 10.0) + new HeadingPitchRange( + 0.0, + -CesiumMath.PI_OVER_TWO, + radius + far + 10.0, + ), ); expect(scene).toRender([0, 0, 0, 255]); }); @@ -1505,7 +1521,7 @@ describe( x: 0.0, y: -1000000.0, z: 0.0, - } + }, ); } const p = polylines.add({ @@ -1595,7 +1611,7 @@ describe( expect(scene).toRender([0, 0, 0, 255]); polylines.modelMatrix = Matrix4.fromUniformScale( 1000000.0, - polylines.modelMatrix + polylines.modelMatrix, ); expect(scene).notToRender([0, 0, 0, 255]); }); @@ -1757,19 +1773,19 @@ describe( const boundingVolume = scene.frameState.commandList[0].boundingVolume; expect(one._boundingVolume).toEqual( - BoundingSphere.fromPoints(one.positions) + BoundingSphere.fromPoints(one.positions), ); expect(two._boundingVolume).toEqual( - BoundingSphere.fromPoints(two.positions) + BoundingSphere.fromPoints(two.positions), ); expect(three._boundingVolume).toEqual( - BoundingSphere.fromPoints(three.positions) + BoundingSphere.fromPoints(three.positions), ); expect(boundingVolume).toEqual( BoundingSphere.union( BoundingSphere.union(one._boundingVolume, two._boundingVolume), - three._boundingVolume - ) + three._boundingVolume, + ), ); }); @@ -1793,49 +1809,49 @@ describe( let i; for (i = 0; i < positions.length; ++i) { projectedPositions.push( - projection.project(ellipsoid.cartesianToCartographic(positions[i])) + projection.project(ellipsoid.cartesianToCartographic(positions[i])), ); } let bs = BoundingSphere.fromPoints(projectedPositions); bs.center = new Cartesian3(bs.center.z, bs.center.x, bs.center.y); expect(one._boundingVolume2D.center).toEqualEpsilon( bs.center, - CesiumMath.EPSILON8 + CesiumMath.EPSILON8, ); expect(one._boundingVolume2D.radius).toEqualEpsilon( bs.radius, - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); positions = two.positions; projectedPositions = []; for (i = 0; i < positions.length; ++i) { projectedPositions.push( - projection.project(ellipsoid.cartesianToCartographic(positions[i])) + projection.project(ellipsoid.cartesianToCartographic(positions[i])), ); } bs = BoundingSphere.fromPoints(projectedPositions); bs.center = new Cartesian3(bs.center.z, bs.center.x, bs.center.y); expect(two._boundingVolume2D.center).toEqualEpsilon( bs.center, - CesiumMath.EPSILON8 + CesiumMath.EPSILON8, ); expect(two._boundingVolume2D.radius).toEqualEpsilon( bs.radius, - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); const expected = BoundingSphere.union( one._boundingVolume2D, - two._boundingVolume2D + two._boundingVolume2D, ); expect(boundingVolume.center).toEqualEpsilon( expected.center, - CesiumMath.EPSILON8 + CesiumMath.EPSILON8, ); expect(boundingVolume.radius).toEqualEpsilon( expected.radius, - CesiumMath.EPSILON8 + CesiumMath.EPSILON8, ); } @@ -1886,10 +1902,10 @@ describe( scene.render(); expect(scene.frameState.commandList[0].boundingVolume).toEqual( - one._boundingVolume + one._boundingVolume, ); expect(scene.frameState.commandList[1].boundingVolume).toEqual( - two._boundingVolume + two._boundingVolume, ); }); @@ -1899,5 +1915,5 @@ describe( expect(polylines.isDestroyed()).toEqual(true); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/PolylineColorAppearanceSpec.js b/packages/engine/Specs/Scene/PolylineColorAppearanceSpec.js index 97fcc3ddb371..234a14376505 100644 --- a/packages/engine/Specs/Scene/PolylineColorAppearanceSpec.js +++ b/packages/engine/Specs/Scene/PolylineColorAppearanceSpec.js @@ -39,7 +39,7 @@ describe( expect(a.vertexShaderSource).toBeDefined(); expect(a.fragmentShaderSource).toBeDefined(); expect(a.renderState).toEqual( - Appearance.getDefaultRenderState(true, false) + Appearance.getDefaultRenderState(true, false), ); expect(a.vertexFormat).toEqual(PolylineColorAppearance.VERTEX_FORMAT); expect(a.translucent).toEqual(true); @@ -60,7 +60,7 @@ describe( }), attributes: { color: ColorGeometryInstanceAttribute.fromColor( - new Color(1.0, 1.0, 0.0, 1.0) + new Color(1.0, 1.0, 0.0, 1.0), ), }, }), @@ -76,5 +76,5 @@ describe( expect(scene).notToRender([0, 0, 0, 255]); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/PolylineMaterialAppearanceSpec.js b/packages/engine/Specs/Scene/PolylineMaterialAppearanceSpec.js index 7ffae11984dc..93200f8cd4cf 100644 --- a/packages/engine/Specs/Scene/PolylineMaterialAppearanceSpec.js +++ b/packages/engine/Specs/Scene/PolylineMaterialAppearanceSpec.js @@ -39,7 +39,7 @@ describe( expect(a.vertexShaderSource).toBeDefined(); expect(a.fragmentShaderSource).toBeDefined(); expect(a.renderState).toEqual( - Appearance.getDefaultRenderState(true, false) + Appearance.getDefaultRenderState(true, false), ); expect(a.vertexFormat).toEqual(PolylineMaterialAppearance.VERTEX_FORMAT); expect(a.translucent).toEqual(true); @@ -72,5 +72,5 @@ describe( expect(scene).notToRender([0, 0, 0, 255]); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/PostProcessStageCollectionSpec.js b/packages/engine/Specs/Scene/PostProcessStageCollectionSpec.js index 20f2260bb231..501181fccadd 100644 --- a/packages/engine/Specs/Scene/PostProcessStageCollectionSpec.js +++ b/packages/engine/Specs/Scene/PostProcessStageCollectionSpec.js @@ -47,7 +47,7 @@ describe( new PostProcessStage({ fragmentShader: "void main() { out_FragColor = vec4(1.0, 1.0, 0.0, 1.0); }", - }) + }), ); expect(scene.postProcessStages.length).toEqual(1); @@ -63,7 +63,7 @@ describe( " vec4 color = texture(colorTexture, v_textureCoordinates);\n" + " out_FragColor = vec4(color.r, 0.0, 1.0, 1.0);\n" + "}", - }) + }), ); expect(scene.postProcessStages.length).toEqual(2); @@ -87,7 +87,7 @@ describe( new PostProcessStage({ fragmentShader: "void main() { out_FragColor = vec4(1.0, 1.0, 0.0, 1.0); }", - }) + }), ); scene.renderForSpecs(); expect(scene).toRender([255, 255, 0, 255]); @@ -104,7 +104,7 @@ describe( new PostProcessStage({ fragmentShader: "void main() { out_FragColor = vec4(1.0, 1.0, 0.0, 1.0); }", - }) + }), ); const stage2 = scene.postProcessStages.add( new PostProcessStage({ @@ -115,7 +115,7 @@ describe( " vec4 color = texture(colorTexture, v_textureCoordinates);\n" + " out_FragColor = vec4(color.r, 0.0, 1.0, 1.0);\n" + "}", - }) + }), ); expect(scene.postProcessStages.length).toEqual(2); @@ -147,7 +147,7 @@ describe( new PostProcessStage({ fragmentShader: "void main() { out_FragColor = vec4(1.0, 1.0, 0.0, 1.0); }", - }) + }), ); const stage2 = scene.postProcessStages.add( new PostProcessStage({ @@ -158,7 +158,7 @@ describe( " vec4 color = texture(colorTexture, v_textureCoordinates);\n" + " out_FragColor = vec4(color.r, 0.0, 1.0, 1.0);\n" + "}", - }) + }), ); expect(scene.postProcessStages.length).toEqual(2); @@ -177,7 +177,7 @@ describe( new PostProcessStage({ fragmentShader: "void main() { out_FragColor = vec4(1.0, 1.0, 0.0, 1.0); }", - }) + }), ); expect(function () { return scene.postProcessStages.get(-1); @@ -194,7 +194,7 @@ describe( new PostProcessStage({ fragmentShader: "void main() { out_FragColor = vec4(1.0, 1.0, 0.0, 1.0); }", - }) + }), ); const stage2 = scene.postProcessStages.add( new PostProcessStage({ @@ -205,7 +205,7 @@ describe( " vec4 color = texture(colorTexture, v_textureCoordinates);\n" + " out_FragColor = vec4(color.r, 0.0, 1.0, 1.0);\n" + "}", - }) + }), ); expect(scene.postProcessStages.length).toEqual(2); @@ -230,7 +230,7 @@ describe( new PostProcessStage({ fragmentShader: "void main() { out_FragColor = vec4(1.0, 1.0, 0.0, 1.0); }", - }) + }), ); const stage2 = scene.postProcessStages.add( new PostProcessStage({ @@ -241,17 +241,17 @@ describe( " vec4 color = texture(colorTexture, v_textureCoordinates);\n" + " out_FragColor = vec4(color.r, 0.0, 1.0, 1.0);\n" + "}", - }) + }), ); expect(scene.postProcessStages.getStageByName(stage1.name)).toEqual( - stage1 + stage1, ); expect(scene.postProcessStages.getStageByName(stage2.name)).toEqual( - stage2 + stage2, ); expect( - scene.postProcessStages.getStageByName("invalid") + scene.postProcessStages.getStageByName("invalid"), ).not.toBeDefined(); }); @@ -260,7 +260,7 @@ describe( new PostProcessStage({ fragmentShader: "void main() { out_FragColor = vec4(1.0, 1.0, 0.0, 1.0); }", - }) + }), ); const stage2 = scene.postProcessStages.add( new PostProcessStage({ @@ -271,32 +271,32 @@ describe( " vec4 color = texture(colorTexture, v_textureCoordinates);\n" + " out_FragColor = vec4(color.r, 0.0, 1.0, 1.0);\n" + "}", - }) + }), ); scene.postProcessStages.fxaa.enabled = true; scene.renderForSpecs(); expect( - scene.postProcessStages.getOutputTexture(stage1.name) + scene.postProcessStages.getOutputTexture(stage1.name), ).toBeDefined(); expect( - scene.postProcessStages.getOutputTexture(stage2.name) + scene.postProcessStages.getOutputTexture(stage2.name), ).toBeDefined(); expect( scene.postProcessStages.getOutputTexture( - scene.postProcessStages.fxaa.name - ) + scene.postProcessStages.fxaa.name, + ), ).toBeDefined(); expect( scene.postProcessStages.getOutputTexture( - scene.postProcessStages.fxaa.name - ) + scene.postProcessStages.fxaa.name, + ), ).toEqual(scene.postProcessStages.getOutputTexture(stage1.name)); scene.postProcessStages.remove(stage1); expect( - scene.postProcessStages.getOutputTexture(stage1.name) + scene.postProcessStages.getOutputTexture(stage1.name), ).not.toBeDefined(); }); @@ -305,7 +305,7 @@ describe( new PostProcessStage({ fragmentShader: "void main() { out_FragColor = vec4(1.0, 0.0, 1.0, 1.0); }", - }) + }), ); scene.renderForSpecs(); expect(scene).toRender([255, 0, 255, 255]); @@ -321,7 +321,7 @@ describe( new PostProcessStage({ fragmentShader: "void main() { out_FragColor = vec4(1.0, 0.0, 1.0, 1.0); }", - }) + }), ); stage.enabled = false; @@ -339,13 +339,13 @@ describe( new PostProcessStage({ fragmentShader: "void main() { out_FragColor = vec4(1.0, 0.0, 1.0, 1.0); }", - }) + }), ); const stage = scene.postProcessStages.add( new PostProcessStage({ fragmentShader: "void main() { out_FragColor = vec4(0.0, 1.0, 1.0, 1.0); }", - }) + }), ); scene.renderForSpecs(); @@ -362,13 +362,13 @@ describe( new PostProcessStage({ fragmentShader: "void main() { out_FragColor = vec4(1.0, 0.0, 1.0, 1.0); }", - }) + }), ); const stage = scene.postProcessStages.add( new PostProcessStage({ fragmentShader: "void main() { out_FragColor = vec4(0.0, 1.0, 1.0, 1.0); }", - }) + }), ); stage.enabled = false; @@ -402,7 +402,7 @@ describe( scene.postProcessStages.tonemapper = tonemapper; const inputColorRgb = inputFragColor.map((n) => - Math.floor(Math.min(Math.max(n * 255, 0), 255)) + Math.floor(Math.min(Math.max(n * 255, 0), 255)), ); const fs = "void main() { \n" + @@ -488,28 +488,28 @@ describe( validateTonemapper( Tonemapper.MODIFIED_REINHARD, [0.5, 0.5, 0.5, 1.0], - [186, 186, 186, 255] + [186, 186, 186, 255], ); }); it("red", () => { validateTonemapper( Tonemapper.MODIFIED_REINHARD, [0.5, 0.0, 0.0, 1.0], - [186, 0, 0, 255] + [186, 0, 0, 255], ); }); it("green", () => { validateTonemapper( Tonemapper.MODIFIED_REINHARD, [0.0, 0.5, 0.0, 1.0], - [0, 186, 0, 255] + [0, 186, 0, 255], ); }); it("blue", () => { validateTonemapper( Tonemapper.MODIFIED_REINHARD, [0.0, 0.0, 0.5, 1.0], - [0, 0, 186, 255] + [0, 0, 186, 255], ); }); }); @@ -552,39 +552,35 @@ describe( describe("PBR Neutral", () => { it("white", () => { - validateTonemapper(Tonemapper.PBR_NEUTRAL, white, [ - 253, - 253, - 253, - 255, - ]); + validateTonemapper( + Tonemapper.PBR_NEUTRAL, + white, + [253, 253, 253, 255], + ); }); it("grey", () => { - validateTonemapper(Tonemapper.PBR_NEUTRAL, grey, [ - 179, - 179, - 179, - 255, - ]); + validateTonemapper( + Tonemapper.PBR_NEUTRAL, + grey, + [179, 179, 179, 255], + ); }); it("red", () => { validateTonemapper(Tonemapper.PBR_NEUTRAL, red, [253, 149, 149, 255]); }); it("green", () => { - validateTonemapper(Tonemapper.PBR_NEUTRAL, green, [ - 149, - 253, - 149, - 255, - ]); + validateTonemapper( + Tonemapper.PBR_NEUTRAL, + green, + [149, 253, 149, 255], + ); }); it("blue", () => { - validateTonemapper(Tonemapper.PBR_NEUTRAL, blue, [ - 149, - 149, - 253, - 255, - ]); + validateTonemapper( + Tonemapper.PBR_NEUTRAL, + blue, + [149, 149, 253, 255], + ); }); }); }); @@ -594,7 +590,7 @@ describe( const stage = stages.add( new PostProcessStage({ fragmentShader: "void main() { out_FragColor = vec4(1.0); }", - }) + }), ); expect(stages.isDestroyed()).toEqual(false); stages.destroy(); @@ -602,5 +598,5 @@ describe( expect(stage.isDestroyed()).toEqual(true); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/PostProcessStageCompositeSpec.js b/packages/engine/Specs/Scene/PostProcessStageCompositeSpec.js index 442373b1e412..f5df1b810c52 100644 --- a/packages/engine/Specs/Scene/PostProcessStageCompositeSpec.js +++ b/packages/engine/Specs/Scene/PostProcessStageCompositeSpec.js @@ -56,7 +56,7 @@ describe( expect(composite.enabled).toEqual(true); expect(composite.uniforms).toEqual(uniforms); expect(composite.inputPreviousStageTexture).toEqual( - inputPreviousStageTexture + inputPreviousStageTexture, ); expect(composite.length).toEqual(1); }); @@ -195,7 +195,7 @@ describe( fragmentShader: `void main() { out_FragColor = vec4(vec3(${ bgColor / 255 }), 1.0); }`, - }) + }), ); //Stage we expect to not run @@ -207,7 +207,7 @@ describe( "uniform sampler2D depthTexture; void main() { out_FragColor = vec4(1.0); }", }), ], - }) + }), ); return pollToPromise(function () { s.renderForSpecs(); @@ -244,5 +244,5 @@ describe( expect(stage2.isDestroyed()).toEqual(true); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/PostProcessStageLibrarySpec.js b/packages/engine/Specs/Scene/PostProcessStageLibrarySpec.js index 5031f55d01b0..3350a5a2eb54 100644 --- a/packages/engine/Specs/Scene/PostProcessStageLibrarySpec.js +++ b/packages/engine/Specs/Scene/PostProcessStageLibrarySpec.js @@ -40,7 +40,8 @@ describe( scene.postProcessStages.fxaa.enabled = false; scene.postProcessStages.bloom.enabled = false; - scene.postProcessStages.bloom.uniforms.brightness = originalBloomBrightness; + scene.postProcessStages.bloom.uniforms.brightness = + originalBloomBrightness; scene.postProcessStages.ambientOcclusion.enabled = false; scene.renderForSpecs(); }); @@ -65,7 +66,7 @@ describe( }); scene.postProcessStages.add( - PostProcessStageLibrary.createBlackAndWhiteStage() + PostProcessStageLibrary.createBlackAndWhiteStage(), ); scene.renderForSpecs(); expect(scene).toRenderAndCall(function (rgba) { @@ -91,10 +92,10 @@ describe( { url: boxTexturedUrl, }, - scene + scene, ).then(function (model) { const stage = scene.postProcessStages.add( - PostProcessStageLibrary.createBlackAndWhiteStage() + PostProcessStageLibrary.createBlackAndWhiteStage(), ); stage.selected = []; @@ -145,7 +146,7 @@ describe( }); scene.postProcessStages.add( - PostProcessStageLibrary.createBrightnessStage() + PostProcessStageLibrary.createBrightnessStage(), ); scene.renderForSpecs(); expect(scene).toRenderAndCall(function (rgba) { @@ -186,7 +187,7 @@ describe( }); scene.postProcessStages.add( - PostProcessStageLibrary.createNightVisionStage() + PostProcessStageLibrary.createNightVisionStage(), ); scene.renderForSpecs(); expect(scene).toRenderAndCall(function (rgba) { @@ -226,7 +227,7 @@ describe( }); scene.postProcessStages.add( - PostProcessStageLibrary.createDepthViewStage() + PostProcessStageLibrary.createDepthViewStage(), ); scene.renderForSpecs(); expect(scene).toRenderAndCall(function (rgba) { @@ -302,7 +303,7 @@ describe( const origin = Cartesian3.fromDegrees(-123.0744619, 44.0503706, 100.0); const modelMatrix = Transforms.headingPitchRollToFixedFrame( origin, - new HeadingPitchRoll() + new HeadingPitchRoll(), ); return loadAndZoomToModelAsync( @@ -312,7 +313,7 @@ describe( incrementallyLoadTextures: false, modelMatrix: modelMatrix, }, - scene + scene, ).then(function () { // The range is chosen carefully here. If it's too small and log depth // is off, the model may clip out of view. If it is too large, the @@ -334,7 +335,7 @@ describe( // Render with depth of field and compare scene.postProcessStages.add( - PostProcessStageLibrary.createDepthOfFieldStage() + PostProcessStageLibrary.createDepthOfFieldStage(), ); scene.renderForSpecs(); expect(scene).toRenderAndCall(function (rgba) { @@ -423,7 +424,7 @@ describe( const origin = Cartesian3.fromDegrees(-123.0744619, 44.0503706, 100.0); const modelMatrix = Transforms.headingPitchRollToFixedFrame( origin, - new HeadingPitchRoll() + new HeadingPitchRoll(), ); return loadAndZoomToModelAsync( @@ -433,7 +434,7 @@ describe( incrementallyLoadTextures: false, modelMatrix: modelMatrix, }, - scene + scene, ).then(function () { // The range is chosen carefully here. If it's too small and log depth // is off, the model may clip out of view. If it is too large, the @@ -495,5 +496,5 @@ describe( expect(bloom.uniforms.stepSize).toEqual(2.0); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/PostProcessStageSpec.js b/packages/engine/Specs/Scene/PostProcessStageSpec.js index f88864496f65..9d18a7d0e214 100644 --- a/packages/engine/Specs/Scene/PostProcessStageSpec.js +++ b/packages/engine/Specs/Scene/PostProcessStageSpec.js @@ -127,7 +127,7 @@ describe( new PostProcessStage({ fragmentShader: "void main() { out_FragColor = vec4(1.0, 1.0, 0.0, 1.0); }", - }) + }), ); scene.renderForSpecs(); // render one frame so the stage is ready expect(scene).toRender([255, 255, 0, 255]); @@ -142,7 +142,7 @@ describe( uniforms: { inputTexture: "./Data/Images/Green2x2.png", }, - }) + }), ); return pollToPromise(function () { scene.renderForSpecs(); @@ -178,7 +178,7 @@ describe( uniforms: { inputTexture: image, }, - }) + }), ); return pollToPromise(function () { scene.renderForSpecs(); @@ -214,14 +214,14 @@ describe( fragmentShader: `void main() { out_FragColor = vec4(vec3(${ bgColor / 255 }), 1.0); }`, - }) + }), ); const stage = s.postProcessStages.add( new PostProcessStage({ fragmentShader: "uniform sampler2D depthTexture; void main() { out_FragColor = vec4(1.0); }", - }) + }), ); return pollToPromise(function () { s.renderForSpecs(); @@ -249,7 +249,7 @@ describe( offset: offset, incrementallyLoadTextures: false, }, - scene + scene, ).then(function (model) { const fs = "uniform sampler2D colorTexture; \n" + @@ -264,7 +264,7 @@ describe( const stage = scene.postProcessStages.add( new PostProcessStage({ fragmentShader: fs, - }) + }), ); stage.selected = []; return pollToPromise(function () { @@ -289,5 +289,5 @@ describe( expect(stage.isDestroyed()).toEqual(true); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/PrimitiveCollectionSpec.js b/packages/engine/Specs/Scene/PrimitiveCollectionSpec.js index 014af1452113..2a3394e1274f 100644 --- a/packages/engine/Specs/Scene/PrimitiveCollectionSpec.js +++ b/packages/engine/Specs/Scene/PrimitiveCollectionSpec.js @@ -49,9 +49,8 @@ describe( // render until all labels have been updated return pollToPromise(function () { scene.renderForSpecs(); - const backgroundBillboard = labels._backgroundBillboardCollection.get( - 0 - ); + const backgroundBillboard = + labels._backgroundBillboardCollection.get(0); return ( (!defined(backgroundBillboard) || backgroundBillboard.ready) && labels._labelsToUpdate.length === 0 @@ -695,5 +694,5 @@ describe( p2.destroy(); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/PrimitiveCullingSpec.js b/packages/engine/Specs/Scene/PrimitiveCullingSpec.js index e9f311e4b55e..de04c8934e0c 100644 --- a/packages/engine/Specs/Scene/PrimitiveCullingSpec.js +++ b/packages/engine/Specs/Scene/PrimitiveCullingSpec.js @@ -38,11 +38,11 @@ describe( scene = createScene(); scene.primitives.destroyPrimitives = false; - return Resource.fetchImage("./Data/Images/Green.png").then(function ( - image - ) { - greenImage = image; - }); + return Resource.fetchImage("./Data/Images/Green.png").then( + function (image) { + greenImage = image; + }, + ); }); afterAll(function () { @@ -158,9 +158,8 @@ describe( // render until all labels have been updated return pollToPromise(function () { scene.renderForSpecs(); - const backgroundBillboard = labels._backgroundBillboardCollection.get( - 0 - ); + const backgroundBillboard = + labels._backgroundBillboardCollection.get(0); return ( (!defined(backgroundBillboard) || backgroundBillboard.ready) && labels._labelsToUpdate.length === 0 @@ -337,5 +336,5 @@ describe( testOcclusionCull(primitive); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/PrimitivePipelineSpec.js b/packages/engine/Specs/Scene/PrimitivePipelineSpec.js index 63465acd4b42..16b4423b747c 100644 --- a/packages/engine/Specs/Scene/PrimitivePipelineSpec.js +++ b/packages/engine/Specs/Scene/PrimitivePipelineSpec.js @@ -17,24 +17,23 @@ describe( const boxGeometry = BoxGeometry.createGeometry( BoxGeometry.fromDimensions({ dimensions: new Cartesian3(1, 2, 3), - }) + }), ); const boxGeometry2 = BoxGeometry.createGeometry( BoxGeometry.fromDimensions({ dimensions: new Cartesian3(3, 4, 7), - }) + }), ); const geometryToPack = [boxGeometry, boxGeometry2]; const transferableObjects = []; const results = PrimitivePipeline.packCreateGeometryResults( geometryToPack, - transferableObjects - ); - const unpackedGeometry = PrimitivePipeline.unpackCreateGeometryResults( - results + transferableObjects, ); + const unpackedGeometry = + PrimitivePipeline.unpackCreateGeometryResults(results); expect(transferableObjects.length).toBe(1); expect(geometryToPack).toEqual(unpackedGeometry); @@ -59,15 +58,14 @@ describe( const transferableObjects = []; const results = PrimitivePipeline.packCreateGeometryResults( geometryToPack, - transferableObjects - ); - const unpackedGeometry = PrimitivePipeline.unpackCreateGeometryResults( - results + transferableObjects, ); + const unpackedGeometry = + PrimitivePipeline.unpackCreateGeometryResults(results); expect(transferableObjects.length).toBe(1); expect(geometryToPack).toEqual(unpackedGeometry); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/PrimitiveSpec.js b/packages/engine/Specs/Scene/PrimitiveSpec.js index c218d4443153..010108e6905d 100644 --- a/packages/engine/Specs/Scene/PrimitiveSpec.js +++ b/packages/engine/Specs/Scene/PrimitiveSpec.js @@ -89,10 +89,10 @@ describe( let translation = Cartesian3.multiplyByScalar( Cartesian3.normalize( ellipsoid.cartographicToCartesian(Rectangle.center(rectangle1)), - new Cartesian3() + new Cartesian3(), ), 2.0, - new Cartesian3() + new Cartesian3(), ); rectangleInstance1 = new GeometryInstance({ geometry: new RectangleGeometry({ @@ -111,10 +111,10 @@ describe( translation = Cartesian3.multiplyByScalar( Cartesian3.normalize( ellipsoid.cartographicToCartesian(Rectangle.center(rectangle2)), - new Cartesian3() + new Cartesian3(), ), 3.0, - new Cartesian3() + new Cartesian3(), ); rectangleInstance2 = new GeometryInstance({ geometry: new RectangleGeometry({ @@ -360,14 +360,14 @@ describe( const boxModelMatrix = Matrix4.multiplyByTranslation( Transforms.eastNorthUpToFixedFrame(positionOnEllipsoid), new Cartesian3(0.0, 0.0, dimensions.z * 0.5), - new Matrix4() + new Matrix4(), ); const boxGeometry = BoxGeometry.createGeometry( BoxGeometry.fromDimensions({ vertexFormat: PerInstanceColorAppearance.VERTEX_FORMAT, dimensions: dimensions, - }) + }), ); const positions = boxGeometry.attributes.position.values; @@ -382,7 +382,7 @@ describe( BoundingSphere.transform( boxGeometry.boundingSphere, boxModelMatrix, - boxGeometry.boundingSphere + boxGeometry.boundingSphere, ); const boxGeometryInstance = new GeometryInstance({ @@ -419,10 +419,10 @@ describe( const translation = Cartesian3.multiplyByScalar( Cartesian3.normalize( ellipsoid.cartographicToCartesian(Rectangle.center(rect)), - new Cartesian3() + new Cartesian3(), ), 100.0, - new Cartesian3() + new Cartesian3(), ); const rectInstance = new GeometryInstance({ geometry: new RectangleGeometry({ @@ -457,7 +457,7 @@ describe( 1.0, 0.0, 1.0, - 1.0 + 1.0, ), }, }); @@ -485,10 +485,10 @@ describe( const translation = Cartesian3.multiplyByScalar( Cartesian3.normalize( ellipsoid.cartographicToCartesian(Rectangle.center(rect)), - new Cartesian3() + new Cartesian3(), ), 100.0, - new Cartesian3() + new Cartesian3(), ); const rectInstance = new GeometryInstance({ geometry: new RectangleGeometry({ @@ -523,7 +523,7 @@ describe( 1.0, 0.0, 1.0, - 1.0 + 1.0, ), }, }); @@ -637,7 +637,7 @@ describe( const primitiveModelMatrix = Matrix4.multiplyByTranslation( Transforms.eastNorthUpToFixedFrame(positionOnEllipsoid), new Cartesian3(0.0, 0.0, dimensions.z * 0.5), - new Matrix4() + new Matrix4(), ); const boxGeometry = BoxGeometry.fromDimensions({ @@ -664,7 +664,7 @@ describe( const expectedModelMatrix = Matrix4.multiplyTransformation( primitiveModelMatrix, instanceModelMatrix, - new Matrix4() + new Matrix4(), ); frameState.scene3DOnly = true; @@ -757,7 +757,7 @@ describe( it("does not transform to world coordinates", function () { rectangleInstance2.modelMatrix = Matrix4.clone( - rectangleInstance1.modelMatrix + rectangleInstance1.modelMatrix, ); primitive = new Primitive({ geometryInstances: [rectangleInstance1, rectangleInstance2], @@ -865,10 +865,10 @@ describe( const translation = Cartesian3.multiplyByScalar( Cartesian3.normalize( ellipsoid.cartographicToCartesian(Rectangle.center(rect)), - new Cartesian3() + new Cartesian3(), ), 2.0, - new Cartesian3() + new Cartesian3(), ); const rectInstance = new GeometryInstance({ geometry: new RectangleGeometry({ @@ -880,10 +880,8 @@ describe( id: "rect", attributes: { color: new ColorGeometryInstanceAttribute(1.0, 1.0, 0.0, 1.0), - distanceDisplayCondition: new DistanceDisplayConditionGeometryInstanceAttribute( - near, - far - ), + distanceDisplayCondition: + new DistanceDisplayConditionGeometryInstanceAttribute(near, far), }, }); @@ -897,26 +895,30 @@ describe( scene.camera.setView({ destination: rect }); scene.renderForSpecs(); - const boundingSphere = primitive.getGeometryInstanceAttributes("rect") - .boundingSphere; + const boundingSphere = + primitive.getGeometryInstanceAttributes("rect").boundingSphere; const center = boundingSphere.center; const radius = boundingSphere.radius; scene.camera.lookAt( center, - new HeadingPitchRange(0.0, -CesiumMath.PI_OVER_TWO, radius) + new HeadingPitchRange(0.0, -CesiumMath.PI_OVER_TWO, radius), ); expect(scene).toRender([0, 0, 0, 255]); scene.camera.lookAt( center, - new HeadingPitchRange(0.0, -CesiumMath.PI_OVER_TWO, radius + near + 1.0) + new HeadingPitchRange( + 0.0, + -CesiumMath.PI_OVER_TWO, + radius + near + 1.0, + ), ); expect(scene).notToRender([0, 0, 0, 255]); scene.camera.lookAt( center, - new HeadingPitchRange(0.0, -CesiumMath.PI_OVER_TWO, radius + far + 1.0) + new HeadingPitchRange(0.0, -CesiumMath.PI_OVER_TWO, radius + far + 1.0), ); expect(scene).toRender([0, 0, 0, 255]); }); @@ -937,10 +939,8 @@ describe( attributes: { color: new ColorGeometryInstanceAttribute(1.0, 1.0, 0.0, 1.0), show: new ShowGeometryInstanceAttribute(true), - distanceDisplayCondition: new DistanceDisplayConditionGeometryInstanceAttribute( - near, - far - ), + distanceDisplayCondition: + new DistanceDisplayConditionGeometryInstanceAttribute(near, far), }, }); @@ -955,8 +955,8 @@ describe( scene.frameState.scene3DOnly = true; scene.renderForSpecs(); - const boundingSphere = primitive.getGeometryInstanceAttributes("cylinder") - .boundingSphere; + const boundingSphere = + primitive.getGeometryInstanceAttributes("cylinder").boundingSphere; const center = boundingSphere.center; expect(center).toEqual(translation); }); @@ -989,8 +989,8 @@ describe( scene.frameState.scene3DOnly = true; scene.renderForSpecs(); - const boundingSphere = primitive.getGeometryInstanceAttributes("cylinder") - .boundingSphere; + const boundingSphere = + primitive.getGeometryInstanceAttributes("cylinder").boundingSphere; const center = boundingSphere.center; expect(center).toEqual(translation); }); @@ -1197,7 +1197,7 @@ describe( color: new ColorGeometryInstanceAttribute(1.0, 0.0, 1.0, 1.0), }, id: "invalid", - }) + }), ); instances.push(rectangleInstance2); @@ -1216,13 +1216,13 @@ describe( return primitive.ready; }).then(function () { expect( - primitive.getGeometryInstanceAttributes("rectangle1").boundingSphere + primitive.getGeometryInstanceAttributes("rectangle1").boundingSphere, ).toBeDefined(); expect( - primitive.getGeometryInstanceAttributes("rectangle2").boundingSphere + primitive.getGeometryInstanceAttributes("rectangle2").boundingSphere, ).toBeDefined(); expect( - primitive.getGeometryInstanceAttributes("invalid").boundingSphere + primitive.getGeometryInstanceAttributes("invalid").boundingSphere, ).not.toBeDefined(); }); }); @@ -1279,9 +1279,8 @@ describe( scene.render(); return primitive.ready; }).then(function () { - const attributes = primitive.getGeometryInstanceAttributes( - "rectangle1" - ); + const attributes = + primitive.getGeometryInstanceAttributes("rectangle1"); expect(function () { attributes.color = undefined; }).toThrowDeveloperError(); @@ -1326,7 +1325,7 @@ describe( scene.renderForSpecs(); expect( - primitive.getGeometryInstanceAttributes("unknown") + primitive.getGeometryInstanceAttributes("unknown"), ).not.toBeDefined(); }); @@ -1369,5 +1368,5 @@ describe( expect(primitive.isDestroyed()).toEqual(true); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/PropertyAttributeSpec.js b/packages/engine/Specs/Scene/PropertyAttributeSpec.js index 997316c6d720..d397f452d9b6 100644 --- a/packages/engine/Specs/Scene/PropertyAttributeSpec.js +++ b/packages/engine/Specs/Scene/PropertyAttributeSpec.js @@ -87,10 +87,10 @@ describe("Scene/PropertyAttribute", function () { it("getProperty returns property attribute property", function () { expect(propertyAttribute.getProperty("color").attribute).toBe("_COLOR"); expect(propertyAttribute.getProperty("intensity").attribute).toBe( - "_INTENSITY" + "_INTENSITY", ); expect(propertyAttribute.getProperty("pointSize").attribute).toBe( - "_POINT_SIZE" + "_POINT_SIZE", ); }); diff --git a/packages/engine/Specs/Scene/PropertyTableSpec.js b/packages/engine/Specs/Scene/PropertyTableSpec.js index eeeb6d360612..dbad6bc989a9 100644 --- a/packages/engine/Specs/Scene/PropertyTableSpec.js +++ b/packages/engine/Specs/Scene/PropertyTableSpec.js @@ -202,7 +202,7 @@ describe("Scene/PropertyTable", function () { it("getPropertyBySemantic returns the property value", function () { const propertyTable = createPropertyTable(); expect(propertyTable.getPropertyBySemantic(0, "NAME")).toEqual( - "Building A" + "Building A", ); }); @@ -216,10 +216,10 @@ describe("Scene/PropertyTable", function () { it("setPropertyBySemantic sets property value", function () { const propertyTable = createPropertyTable(); expect(propertyTable.getPropertyBySemantic(0, "NAME")).toEqual( - "Building A" + "Building A", ); expect(propertyTable.setPropertyBySemantic(0, "NAME", "Building New")).toBe( - true + true, ); }); @@ -240,7 +240,7 @@ describe("Scene/PropertyTable", function () { const expectedTypedArray = new Float32Array([10.0, 20.0, 30.0]); expect(propertyTable.getPropertyTypedArray("height")).toEqual( - expectedTypedArray + expectedTypedArray, ); }); @@ -263,7 +263,7 @@ describe("Scene/PropertyTable", function () { const expectedTypedArray = new Float32Array([10.0, 20.0, 30.0]); expect(propertyTable.getPropertyTypedArrayBySemantic("HEIGHT")).toEqual( - expectedTypedArray + expectedTypedArray, ); }); @@ -545,19 +545,19 @@ describe("Scene/PropertyTable", function () { expect(batchTable.getPropertyTypedArray("itemId")).toBeDefined(); expect(batchTable.getPropertyTypedArray("priority")).not.toBeDefined(); expect( - batchTable.getPropertyTypedArray("tireLocation") + batchTable.getPropertyTypedArray("tireLocation"), ).not.toBeDefined(); }); it("getPropertyTypedArray returns undefined when there is no metadata table", function () { expect( - batchTableJsonOnly.getPropertyTypedArray("priority") + batchTableJsonOnly.getPropertyTypedArray("priority"), ).not.toBeDefined(); }); it("getPropertyTypedArrayBySemantic returns undefined when there is no metadata table", function () { expect( - batchTableJsonOnly.getPropertyTypedArrayBySemantic("PRIORITY") + batchTableJsonOnly.getPropertyTypedArrayBySemantic("PRIORITY"), ).not.toBeDefined(); }); diff --git a/packages/engine/Specs/Scene/PropertyTexturePropertySpec.js b/packages/engine/Specs/Scene/PropertyTexturePropertySpec.js index 3fd3c2aec10c..0bdb4bc5bea5 100644 --- a/packages/engine/Specs/Scene/PropertyTexturePropertySpec.js +++ b/packages/engine/Specs/Scene/PropertyTexturePropertySpec.js @@ -373,5 +373,5 @@ describe( } }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/PropertyTextureSpec.js b/packages/engine/Specs/Scene/PropertyTextureSpec.js index ded2465c4efe..bbcbeca060da 100644 --- a/packages/engine/Specs/Scene/PropertyTextureSpec.js +++ b/packages/engine/Specs/Scene/PropertyTextureSpec.js @@ -160,5 +160,5 @@ describe( }).toThrowDeveloperError(); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/QuadtreePrimitiveSpec.js b/packages/engine/Specs/Scene/QuadtreePrimitiveSpec.js index 1a2e3fc2d3b3..0e282f7be60c 100644 --- a/packages/engine/Specs/Scene/QuadtreePrimitiveSpec.js +++ b/packages/engine/Specs/Scene/QuadtreePrimitiveSpec.js @@ -73,7 +73,7 @@ describe("Scene/QuadtreePrimitive", function () { }; frameState.cullingVolume.computeVisibility.and.returnValue( - Intersect.INTERSECTING + Intersect.INTERSECTING, ); imageryLayerCollection = new ImageryLayerCollection(); @@ -93,7 +93,7 @@ describe("Scene/QuadtreePrimitive", function () { processor = new TerrainTileProcessor( frameState, mockTerrain, - imageryLayerCollection + imageryLayerCollection, ); quadtree.render(frameState); @@ -152,7 +152,7 @@ describe("Scene/QuadtreePrimitive", function () { expect( quadtree._tilesToRender.filter(function (tile) { return tile.level === 0; - }).length + }).length, ).toBe(quadtree._tilesToRender.length); }); }); @@ -181,7 +181,7 @@ describe("Scene/QuadtreePrimitive", function () { expect( quadtree._tilesToRender.filter(function (tile) { return tile.level === 0; - }).length + }).length, ).toBe(quadtree._tilesToRender.length); // Allow the child tiles to load. @@ -192,16 +192,16 @@ describe("Scene/QuadtreePrimitive", function () { // Now child tiles should be rendered too. expect(quadtree._tilesToRender).toContain( - rootTiles[0].southwestChild + rootTiles[0].southwestChild, ); expect(quadtree._tilesToRender).toContain( - rootTiles[0].southeastChild + rootTiles[0].southeastChild, ); expect(quadtree._tilesToRender).toContain( - rootTiles[0].northwestChild + rootTiles[0].northwestChild, ); expect(quadtree._tilesToRender).toContain( - rootTiles[0].northeastChild + rootTiles[0].northeastChild, ); }); }); @@ -240,7 +240,7 @@ describe("Scene/QuadtreePrimitive", function () { quadtree, frameState, Rectangle.center(lookAtTile.rectangle), - lookAtTile.level + lookAtTile.level, ); spyOn(mockTerrain, "requestTileGeometry").and.callThrough(); @@ -306,7 +306,7 @@ describe("Scene/QuadtreePrimitive", function () { quadtree, frameState, Rectangle.center(lookAtTile.rectangle), - lookAtTile.level + lookAtTile.level, ); spyOn(mockTerrain, "requestTileGeometry").and.callThrough(); @@ -335,7 +335,7 @@ describe("Scene/QuadtreePrimitive", function () { call[1] === parent.y && call[2] === parent.level ); - })[0] + })[0], ); const lookAtArgsIndex = allArgs.indexOf( allArgs.filter(function (call) { @@ -344,7 +344,7 @@ describe("Scene/QuadtreePrimitive", function () { call[1] === lookAtTile.y && call[2] === lookAtTile.level ); - })[0] + })[0], ); expect(parentArgsIndex).toBeLessThan(lookAtArgsIndex); }); @@ -385,7 +385,7 @@ describe("Scene/QuadtreePrimitive", function () { quadtree, frameState, Rectangle.center(lookAtTile.rectangle), - lookAtTile.level + lookAtTile.level, ); spyOn(mockTerrain, "requestTileGeometry").and.callThrough(); @@ -453,7 +453,7 @@ describe("Scene/QuadtreePrimitive", function () { quadtree, frameState, Rectangle.center(lookAtTile.rectangle), - lookAtTile.level + lookAtTile.level, ); spyOn(mockTerrain, "requestTileGeometry").and.callThrough(); @@ -473,7 +473,7 @@ describe("Scene/QuadtreePrimitive", function () { quadtree, frameState, Rectangle.center(lookAtTile.rectangle), - lookAtTile.parent.level + lookAtTile.parent.level, ); // Select new tiles @@ -530,32 +530,33 @@ describe("Scene/QuadtreePrimitive", function () { const visibleTile = rootTiles[0].southwestChild.northeastChild; const notVisibleTile = rootTiles[0].southwestChild.northwestChild; - frameState.cullingVolume.computeVisibility.and.callFake(function ( - boundingVolume - ) { - if (!defined(visibleTile.data)) { - return Intersect.INTERSECTING; - } + frameState.cullingVolume.computeVisibility.and.callFake( + function (boundingVolume) { + if (!defined(visibleTile.data)) { + return Intersect.INTERSECTING; + } - if ( - boundingVolume === visibleTile.data.tileBoundingRegion.boundingVolume - ) { + if ( + boundingVolume === + visibleTile.data.tileBoundingRegion.boundingVolume + ) { + return Intersect.INTERSECTING; + } else if ( + boundingVolume === + notVisibleTile.data.tileBoundingRegion.boundingVolume + ) { + return Intersect.OUTSIDE; + } return Intersect.INTERSECTING; - } else if ( - boundingVolume === - notVisibleTile.data.tileBoundingRegion.boundingVolume - ) { - return Intersect.OUTSIDE; - } - return Intersect.INTERSECTING; - }); + }, + ); // Look down at the center of the visible tile. setCameraPosition( quadtree, frameState, Rectangle.center(visibleTile.rectangle), - visibleTile.level + visibleTile.level, ); spyOn(mockTerrain, "requestTileGeometry").and.callThrough(); @@ -571,7 +572,7 @@ describe("Scene/QuadtreePrimitive", function () { // Now treat the not-visible-tile as visible. frameState.cullingVolume.computeVisibility.and.returnValue( - Intersect.INTERSECTING + Intersect.INTERSECTING, ); // Select new tiles @@ -866,7 +867,7 @@ describe("Scene/QuadtreePrimitive", function () { const removeFunc = quadtree.updateHeight( Cartographic.fromDegrees(-72.0, 40.0), - function (position) {} + function (position) {}, ); // determine what tiles to load @@ -939,11 +940,12 @@ describe("Scene/QuadtreePrimitive", function () { tileProvider: tileProvider, }); - quadtree.updateHeight(Cartographic.fromDegrees(-72.0, 40.0), function ( - p - ) { - Cartesian3.clone(p, position); - }); + quadtree.updateHeight( + Cartographic.fromDegrees(-72.0, 40.0), + function (p) { + Cartesian3.clone(p, position); + }, + ); // determine what tiles to load quadtree.update(scene.frameState); @@ -986,10 +988,10 @@ describe("Scene/QuadtreePrimitive", function () { // The root tiles should be in the high priority load queue expect(quadtree._tileLoadQueueHigh.length).toBe(2); expect(quadtree._tileLoadQueueHigh).toContain( - quadtree._levelZeroTiles[0] + quadtree._levelZeroTiles[0], ); expect(quadtree._tileLoadQueueHigh).toContain( - quadtree._levelZeroTiles[1] + quadtree._levelZeroTiles[1], ); expect(quadtree._tileLoadQueueMedium.length).toBe(0); expect(quadtree._tileLoadQueueLow.length).toBe(0); @@ -1005,24 +1007,24 @@ describe("Scene/QuadtreePrimitive", function () { // That root tile should now load with low priority while its children should load with high. expect(quadtree._tileLoadQueueHigh.length).toBe(5); expect(quadtree._tileLoadQueueHigh).toContain( - quadtree._levelZeroTiles[1] + quadtree._levelZeroTiles[1], ); expect(quadtree._tileLoadQueueHigh).toContain( - quadtree._levelZeroTiles[0].children[0] + quadtree._levelZeroTiles[0].children[0], ); expect(quadtree._tileLoadQueueHigh).toContain( - quadtree._levelZeroTiles[0].children[1] + quadtree._levelZeroTiles[0].children[1], ); expect(quadtree._tileLoadQueueHigh).toContain( - quadtree._levelZeroTiles[0].children[2] + quadtree._levelZeroTiles[0].children[2], ); expect(quadtree._tileLoadQueueHigh).toContain( - quadtree._levelZeroTiles[0].children[3] + quadtree._levelZeroTiles[0].children[3], ); expect(quadtree._tileLoadQueueMedium.length).toBe(0); expect(quadtree._tileLoadQueueLow.length).toBe(1); expect(quadtree._tileLoadQueueLow).toContain( - quadtree._levelZeroTiles[0] + quadtree._levelZeroTiles[0], ); // Mark the children of that root tile renderable too, so we can refine it @@ -1038,36 +1040,36 @@ describe("Scene/QuadtreePrimitive", function () { expect(quadtree._tileLoadQueueHigh.length).toBe(17); // levelZeroTiles[1] plus levelZeroTiles[0]'s 16 grandchildren expect(quadtree._tileLoadQueueHigh).toContain( - quadtree._levelZeroTiles[1] + quadtree._levelZeroTiles[1], ); expect(quadtree._tileLoadQueueHigh).toContain( - quadtree._levelZeroTiles[0].children[0].children[0] + quadtree._levelZeroTiles[0].children[0].children[0], ); expect(quadtree._tileLoadQueueHigh).toContain( - quadtree._levelZeroTiles[0].children[0].children[1] + quadtree._levelZeroTiles[0].children[0].children[1], ); expect(quadtree._tileLoadQueueHigh).toContain( - quadtree._levelZeroTiles[0].children[0].children[2] + quadtree._levelZeroTiles[0].children[0].children[2], ); expect(quadtree._tileLoadQueueHigh).toContain( - quadtree._levelZeroTiles[0].children[0].children[3] + quadtree._levelZeroTiles[0].children[0].children[3], ); expect(quadtree._tileLoadQueueMedium.length).toBe(0); expect(quadtree._tileLoadQueueLow.length).toBe(5); expect(quadtree._tileLoadQueueLow).toContain( - quadtree._levelZeroTiles[0] + quadtree._levelZeroTiles[0], ); expect(quadtree._tileLoadQueueLow).toContain( - quadtree._levelZeroTiles[0].children[0] + quadtree._levelZeroTiles[0].children[0], ); expect(quadtree._tileLoadQueueLow).toContain( - quadtree._levelZeroTiles[0].children[1] + quadtree._levelZeroTiles[0].children[1], ); expect(quadtree._tileLoadQueueLow).toContain( - quadtree._levelZeroTiles[0].children[2] + quadtree._levelZeroTiles[0].children[2], ); expect(quadtree._tileLoadQueueLow).toContain( - quadtree._levelZeroTiles[0].children[3] + quadtree._levelZeroTiles[0].children[3], ); // Mark the children of levelZeroTiles[0] upsampled @@ -1084,11 +1086,11 @@ describe("Scene/QuadtreePrimitive", function () { // levelZeroTiles[0] should move to medium priority. expect(quadtree._tileLoadQueueHigh.length).toBe(1); expect(quadtree._tileLoadQueueHigh).toContain( - quadtree._levelZeroTiles[1] + quadtree._levelZeroTiles[1], ); expect(quadtree._tileLoadQueueMedium.length).toBe(1); expect(quadtree._tileLoadQueueMedium).toContain( - quadtree._levelZeroTiles[0] + quadtree._levelZeroTiles[0], ); expect(quadtree._tileLoadQueueLow.length).toBe(0); }); @@ -1148,27 +1150,27 @@ describe("Scene/QuadtreePrimitive", function () { expect(quadtree._tilesToRender[0]).toBe(east.northwestChild); expect( quadtree._tilesToRender[1] === east.southwestChild || - quadtree._tilesToRender[1] === east.northeastChild + quadtree._tilesToRender[1] === east.northeastChild, ).toBe(true); expect( quadtree._tilesToRender[2] === east.southwestChild || - quadtree._tilesToRender[2] === east.northeastChild + quadtree._tilesToRender[2] === east.northeastChild, ).toBe(true); expect(quadtree._tilesToRender[3]).toBe(east.southeastChild); expect(quadtree._tilesToRender[4]).toBe(west.northeastChild); expect( quadtree._tilesToRender[5] === west.northwestChild || - quadtree._tilesToRender[5] === west.southeastChild + quadtree._tilesToRender[5] === west.southeastChild, ).toBe(true); expect( quadtree._tilesToRender[6] === west.northwestChild || - quadtree._tilesToRender[6] === west.southeastChild + quadtree._tilesToRender[6] === west.southeastChild, ).toBe(true); expect(quadtree._tilesToRender[7]).toBe(west.southwestChild); }); }); }, - "WebGL" + "WebGL", ); // Sets the camera to look at a given cartographic position from a distance @@ -1176,9 +1178,8 @@ describe("Scene/QuadtreePrimitive", function () { // a given tile level and no further. function setCameraPosition(quadtree, frameState, position, level) { const camera = frameState.camera; - const geometricError = quadtree.tileProvider.getLevelMaximumGeometricError( - level - ); + const geometricError = + quadtree.tileProvider.getLevelMaximumGeometricError(level); const sse = quadtree.maximumScreenSpaceError * 0.8; const sseDenominator = camera.frustum.sseDenominator; const height = frameState.context.drawingBufferHeight; diff --git a/packages/engine/Specs/Scene/QuadtreeTileSpec.js b/packages/engine/Specs/Scene/QuadtreeTileSpec.js index 2e6d6c7edcb9..5a315ef2dc30 100644 --- a/packages/engine/Specs/Scene/QuadtreeTileSpec.js +++ b/packages/engine/Specs/Scene/QuadtreeTileSpec.js @@ -29,7 +29,7 @@ describe("Scene/QuadtreeTile", function () { -CesiumMath.PI_OVER_FOUR, 0.0, CesiumMath.PI_OVER_FOUR, - CesiumMath.PI_OVER_FOUR + CesiumMath.PI_OVER_FOUR, ), x: 0, y: 0, @@ -58,7 +58,7 @@ describe("Scene/QuadtreeTile", function () { const rectangle = desc.tilingScheme.tileXYToRectangle( desc.x, desc.y, - desc.level + desc.level, ); expect(tile.rectangle).toEqual(rectangle); }); @@ -365,16 +365,16 @@ describe("Scene/QuadtreeTile", function () { const southeast = tiles[3]; expect(northeast.rectangle.west).toBeGreaterThan( - northwest.rectangle.west + northwest.rectangle.west, ); expect(southeast.rectangle.west).toBeGreaterThan( - southwest.rectangle.west + southwest.rectangle.west, ); expect(northeast.rectangle.south).toBeGreaterThan( - southeast.rectangle.south + southeast.rectangle.south, ); expect(northwest.rectangle.south).toBeGreaterThan( - southwest.rectangle.south + southwest.rectangle.south, ); }); }); diff --git a/packages/engine/Specs/Scene/ResourceCacheKeySpec.js b/packages/engine/Specs/Scene/ResourceCacheKeySpec.js index 3195ee6c71e3..ef57c948ffa3 100644 --- a/packages/engine/Specs/Scene/ResourceCacheKeySpec.js +++ b/packages/engine/Specs/Scene/ResourceCacheKeySpec.js @@ -369,7 +369,7 @@ describe("ResourceCacheKey", function () { }); expect(cacheKey).toBe( - "buffer-view:https://example.com/resources/external.bin-range-0-100" + "buffer-view:https://example.com/resources/external.bin-range-0-100", ); }); @@ -440,7 +440,7 @@ describe("ResourceCacheKey", function () { }); expect(cacheKey).toBe( - "draco:https://example.com/resources/external.bin-range-0-100" + "draco:https://example.com/resources/external.bin-range-0-100", ); }); @@ -508,7 +508,7 @@ describe("ResourceCacheKey", function () { }); expect(cacheKey).toBe( - "vertex-buffer:https://example.com/resources/external.bin-range-0-40-buffer-context-01234" + "vertex-buffer:https://example.com/resources/external.bin-range-0-40-buffer-context-01234", ); }); @@ -527,7 +527,7 @@ describe("ResourceCacheKey", function () { }); expect(cacheKey).toBe( - "vertex-buffer:https://example.com/resources/external.bin-range-0-100-draco-POSITION-buffer-context-01234" + "vertex-buffer:https://example.com/resources/external.bin-range-0-100-draco-POSITION-buffer-context-01234", ); }); @@ -543,7 +543,7 @@ describe("ResourceCacheKey", function () { }); expect(cacheKey).toBe( - "vertex-buffer:https://example.com/resources/external.bin-range-0-40-dequantize-buffer-context-01234" + "vertex-buffer:https://example.com/resources/external.bin-range-0-40-dequantize-buffer-context-01234", ); }); @@ -558,7 +558,7 @@ describe("ResourceCacheKey", function () { }); expect(cacheKey).toBe( - "vertex-buffer:https://example.com/resources/external.bin-range-0-40-typed-array" + "vertex-buffer:https://example.com/resources/external.bin-range-0-40-typed-array", ); }); @@ -574,7 +574,7 @@ describe("ResourceCacheKey", function () { }); expect(cacheKey).toBe( - "vertex-buffer:https://example.com/resources/external.bin-range-0-40-buffer-context-01234-typed-array" + "vertex-buffer:https://example.com/resources/external.bin-range-0-40-buffer-context-01234-typed-array", ); }); @@ -695,7 +695,7 @@ describe("ResourceCacheKey", function () { }); expect(cacheKey).toBe( - "index-buffer:https://example.com/resources/external.bin-accessor-80-5123-SCALAR-36-buffer-context-01234" + "index-buffer:https://example.com/resources/external.bin-accessor-80-5123-SCALAR-36-buffer-context-01234", ); }); @@ -714,7 +714,7 @@ describe("ResourceCacheKey", function () { }); expect(cacheKey).toBe( - "index-buffer:https://example.com/resources/external.bin-range-0-100-draco-buffer-context-01234" + "index-buffer:https://example.com/resources/external.bin-range-0-100-draco-buffer-context-01234", ); }); @@ -729,7 +729,7 @@ describe("ResourceCacheKey", function () { }); expect(cacheKey).toBe( - "index-buffer:https://example.com/resources/external.bin-accessor-80-5123-SCALAR-36-typed-array" + "index-buffer:https://example.com/resources/external.bin-accessor-80-5123-SCALAR-36-typed-array", ); }); @@ -745,7 +745,7 @@ describe("ResourceCacheKey", function () { }); expect(cacheKey).toBe( - "index-buffer:https://example.com/resources/external.bin-accessor-80-5123-SCALAR-36-buffer-context-01234-typed-array" + "index-buffer:https://example.com/resources/external.bin-accessor-80-5123-SCALAR-36-buffer-context-01234-typed-array", ); }); @@ -835,7 +835,7 @@ describe("ResourceCacheKey", function () { }); expect(cacheKey).toBe( - "image:https://example.com/resources/external.bin-range-0-100" + "image:https://example.com/resources/external.bin-range-0-100", ); }); @@ -897,7 +897,7 @@ describe("ResourceCacheKey", function () { }); expect(cacheKey).toBe( - "texture:https://example.com/resources/image.png-sampler-10497-10497-9729-9729-context-01234" + "texture:https://example.com/resources/image.png-sampler-10497-10497-9729-9729-context-01234", ); }); @@ -915,7 +915,7 @@ describe("ResourceCacheKey", function () { }); expect(cacheKey).toBe( - "texture:https://example.com/resources/external.bin-range-0-100-sampler-33071-33648-9984-9728-context-01234" + "texture:https://example.com/resources/external.bin-range-0-100-sampler-33071-33648-9984-9728-context-01234", ); }); @@ -935,7 +935,7 @@ describe("ResourceCacheKey", function () { }); expect(cacheKey).toBe( - "texture:https://example.com/resources/image.webp-sampler-10497-10497-9729-9729-context-01234" + "texture:https://example.com/resources/image.webp-sampler-10497-10497-9729-9729-context-01234", ); }); @@ -953,7 +953,7 @@ describe("ResourceCacheKey", function () { }); expect(cacheKey).toBe( - "texture:https://example.com/resources/image.png-sampler-10497-10497-9729-9729-context-01234" + "texture:https://example.com/resources/image.png-sampler-10497-10497-9729-9729-context-01234", ); }); @@ -973,7 +973,7 @@ describe("ResourceCacheKey", function () { }); expect(cacheKey).toBe( - "texture:https://example.com/resources/image.ktx2-sampler-10497-10497-9729-9729-context-01234" + "texture:https://example.com/resources/image.ktx2-sampler-10497-10497-9729-9729-context-01234", ); }); @@ -991,7 +991,7 @@ describe("ResourceCacheKey", function () { }); expect(cacheKey).toBe( - "texture:https://example.com/resources/image.png-sampler-10497-10497-9729-9729-context-01234" + "texture:https://example.com/resources/image.png-sampler-10497-10497-9729-9729-context-01234", ); }); diff --git a/packages/engine/Specs/Scene/ResourceCacheSpec.js b/packages/engine/Specs/Scene/ResourceCacheSpec.js index aaded214a56a..bf1540d4e976 100644 --- a/packages/engine/Specs/Scene/ResourceCacheSpec.js +++ b/packages/engine/Specs/Scene/ResourceCacheSpec.js @@ -263,7 +263,7 @@ describe("ResourceCache", function () { it("destroys resource when reference count reaches 0", function () { const destroy = spyOn( MetadataSchemaLoader.prototype, - "destroy" + "destroy", ).and.callThrough(); const cacheKey = ResourceCacheKey.getSchemaCacheKey({ @@ -373,7 +373,7 @@ describe("ResourceCache", function () { expect( ResourceCache.getSchemaLoader({ schema: schemaJson, - }) + }), ).toBe(schemaLoader); expect(cacheEntry.referenceCount).toBe(2); @@ -400,7 +400,7 @@ describe("ResourceCache", function () { parentResource: bufferParentResource, bufferId: 0, typedArray: bufferTypedArray, - }) + }), ).toBe(bufferLoader); expect(cacheEntry.referenceCount).toBe(2); @@ -411,7 +411,7 @@ describe("ResourceCache", function () { ResourceCache.getEmbeddedBufferLoader({ bufferId: 0, typedArray: bufferTypedArray, - }) + }), ).toThrowDeveloperError(); }); @@ -420,7 +420,7 @@ describe("ResourceCache", function () { ResourceCache.getEmbeddedBufferLoader({ parentResource: bufferParentResource, typedArray: bufferTypedArray, - }) + }), ).toThrowDeveloperError(); }); @@ -429,7 +429,7 @@ describe("ResourceCache", function () { ResourceCache.getEmbeddedBufferLoader({ parentResource: bufferParentResource, bufferId: 0, - }) + }), ).toThrowDeveloperError(); }); @@ -449,7 +449,7 @@ describe("ResourceCache", function () { expect( ResourceCache.getExternalBufferLoader({ resource: bufferResource, - }) + }), ).toBe(bufferLoader); expect(cacheEntry.referenceCount).toBe(2); @@ -459,7 +459,7 @@ describe("ResourceCache", function () { expect(() => ResourceCache.getExternalBufferLoader({ resource: undefined, - }) + }), ).toThrowDeveloperError(); }); @@ -481,7 +481,7 @@ describe("ResourceCache", function () { ResourceCache.getGltfJsonLoader({ gltfResource: gltfResource, baseResource: gltfResource, - }) + }), ).toBe(gltfJsonLoader); expect(cacheEntry.referenceCount).toBe(2); @@ -492,7 +492,7 @@ describe("ResourceCache", function () { ResourceCache.getGltfJsonLoader({ gltfResource: undefined, baseResource: gltfResource, - }) + }), ).toThrowDeveloperError(); }); @@ -501,7 +501,7 @@ describe("ResourceCache", function () { ResourceCache.getGltfJsonLoader({ gltfResource: gltfResource, baseResource: undefined, - }) + }), ).toThrowDeveloperError(); }); @@ -530,7 +530,7 @@ describe("ResourceCache", function () { bufferViewId: 0, gltfResource: gltfResource, baseResource: gltfResource, - }) + }), ).toBe(bufferViewLoader); expect(cacheEntry.referenceCount).toBe(2); @@ -543,7 +543,7 @@ describe("ResourceCache", function () { bufferViewId: 0, gltfResource: gltfResource, baseResource: gltfResource, - }) + }), ).toThrowDeveloperError(); }); @@ -554,7 +554,7 @@ describe("ResourceCache", function () { bufferViewId: undefined, gltfResource: gltfResource, baseResource: gltfResource, - }) + }), ).toThrowDeveloperError(); }); @@ -565,7 +565,7 @@ describe("ResourceCache", function () { bufferViewId: 0, gltfResource: undefined, baseResource: gltfResource, - }) + }), ).toThrowDeveloperError(); }); @@ -576,7 +576,7 @@ describe("ResourceCache", function () { bufferViewId: 0, gltfResource: gltfResource, baseResource: undefined, - }) + }), ).toThrowDeveloperError(); }); @@ -606,7 +606,7 @@ describe("ResourceCache", function () { draco: dracoExtension, gltfResource: gltfResource, baseResource: gltfResource, - }) + }), ).toBe(dracoLoader); expect(cacheEntry.referenceCount).toBe(2); @@ -619,7 +619,7 @@ describe("ResourceCache", function () { draco: dracoExtension, gltfResource: gltfResource, baseResource: gltfResource, - }) + }), ).toThrowDeveloperError(); }); @@ -630,7 +630,7 @@ describe("ResourceCache", function () { draco: undefined, gltfResource: gltfResource, baseResource: gltfResource, - }) + }), ).toThrowDeveloperError(); }); @@ -641,7 +641,7 @@ describe("ResourceCache", function () { draco: dracoExtension, gltfResource: undefined, baseResource: gltfResource, - }) + }), ).toThrowDeveloperError(); }); @@ -652,7 +652,7 @@ describe("ResourceCache", function () { draco: dracoExtension, gltfResource: gltfResource, baseResource: undefined, - }) + }), ).toThrowDeveloperError(); }); @@ -689,7 +689,7 @@ describe("ResourceCache", function () { frameState: mockFrameState, bufferViewId: 0, loadBuffer: true, - }) + }), ).toBe(vertexBufferLoader); expect(cacheEntry.referenceCount).toBe(2); @@ -732,7 +732,7 @@ describe("ResourceCache", function () { attributeSemantic: "POSITION", accessorId: 0, loadBuffer: true, - }) + }), ).toBe(vertexBufferLoader); expect(cacheEntry.referenceCount).toBe(2); @@ -774,7 +774,7 @@ describe("ResourceCache", function () { frameState: mockFrameState, bufferViewId: 0, loadBuffer: true, - }) + }), ).toThrowDeveloperError(); }); @@ -787,7 +787,7 @@ describe("ResourceCache", function () { frameState: mockFrameState, bufferViewId: 0, loadBuffer: true, - }) + }), ).toThrowDeveloperError(); }); @@ -800,7 +800,7 @@ describe("ResourceCache", function () { frameState: mockFrameState, bufferViewId: 0, loadBuffer: true, - }) + }), ).toThrowDeveloperError(); }); @@ -813,7 +813,7 @@ describe("ResourceCache", function () { frameState: undefined, bufferViewId: 0, loadBuffer: true, - }) + }), ).toThrowDeveloperError(); }); @@ -829,7 +829,7 @@ describe("ResourceCache", function () { attributeSemantic: "POSITION", accessorId: 0, loadBuffer: true, - }) + }), ).toThrowDeveloperError(); }); @@ -841,7 +841,7 @@ describe("ResourceCache", function () { baseResource: gltfResource, frameState: mockFrameState, loadBuffer: true, - }) + }), ).toThrowDeveloperError(); }); @@ -856,7 +856,7 @@ describe("ResourceCache", function () { attributeSemantic: undefined, accessorId: 0, loadBuffer: true, - }) + }), ).toThrowDeveloperError(); }); @@ -871,7 +871,7 @@ describe("ResourceCache", function () { attributeSemantic: "POSITION", accessorId: undefined, loadBuffer: true, - }) + }), ).toThrowDeveloperError(); }); @@ -885,7 +885,7 @@ describe("ResourceCache", function () { bufferViewId: 0, loadBuffer: false, loadTypedArray: false, - }) + }), ).toThrowDeveloperError(); }); @@ -921,7 +921,7 @@ describe("ResourceCache", function () { baseResource: gltfResource, frameState: mockFrameState, loadBuffer: true, - }) + }), ).toBe(indexBufferLoader); expect(cacheEntry.referenceCount).toBe(2); @@ -962,7 +962,7 @@ describe("ResourceCache", function () { frameState: mockFrameState, draco: dracoExtension, loadBuffer: true, - }) + }), ).toBe(indexBufferLoader); expect(cacheEntry.referenceCount).toBe(2); @@ -1002,7 +1002,7 @@ describe("ResourceCache", function () { baseResource: gltfResource, frameState: mockFrameState, loadBuffer: true, - }) + }), ).toThrowDeveloperError(); }); @@ -1015,7 +1015,7 @@ describe("ResourceCache", function () { baseResource: gltfResource, frameState: mockFrameState, loadBuffer: true, - }) + }), ).toThrowDeveloperError(); }); @@ -1028,7 +1028,7 @@ describe("ResourceCache", function () { baseResource: gltfResource, frameState: mockFrameState, loadBuffer: true, - }) + }), ).toThrowDeveloperError(); }); @@ -1041,7 +1041,7 @@ describe("ResourceCache", function () { baseResource: undefined, frameState: mockFrameState, loadBuffer: true, - }) + }), ).toThrowDeveloperError(); }); @@ -1054,7 +1054,7 @@ describe("ResourceCache", function () { baseResource: gltfResource, frameState: undefined, loadBuffer: true, - }) + }), ).toThrowDeveloperError(); }); @@ -1068,7 +1068,7 @@ describe("ResourceCache", function () { frameState: mockFrameState, loadBuffer: false, loadTypedArray: false, - }) + }), ).toThrowDeveloperError(); }); @@ -1097,7 +1097,7 @@ describe("ResourceCache", function () { imageId: 0, gltfResource: gltfResource, baseResource: gltfResource, - }) + }), ).toBe(imageLoader); expect(cacheEntry.referenceCount).toBe(2); @@ -1110,7 +1110,7 @@ describe("ResourceCache", function () { imageId: 0, gltfResource: gltfResource, baseResource: gltfResource, - }) + }), ).toThrowDeveloperError(); }); @@ -1121,7 +1121,7 @@ describe("ResourceCache", function () { imageId: undefined, gltfResource: gltfResource, baseResource: gltfResource, - }) + }), ).toThrowDeveloperError(); }); @@ -1132,7 +1132,7 @@ describe("ResourceCache", function () { imageId: 0, gltfResource: undefined, baseResource: gltfResource, - }) + }), ).toThrowDeveloperError(); }); @@ -1143,7 +1143,7 @@ describe("ResourceCache", function () { imageId: 0, gltfResource: gltfResource, baseResource: undefined, - }) + }), ).toThrowDeveloperError(); }); @@ -1178,7 +1178,7 @@ describe("ResourceCache", function () { baseResource: gltfResource, frameState: mockFrameState, supportedImageFormats: new SupportedImageFormats(), - }) + }), ).toBe(textureLoader); expect(cacheEntry.referenceCount).toBe(2); @@ -1218,7 +1218,7 @@ describe("ResourceCache", function () { baseResource: gltfResource, supportedImageFormats: new SupportedImageFormats(), frameState: mockFrameState, - }) + }), ).toThrowDeveloperError(); }); @@ -1231,7 +1231,7 @@ describe("ResourceCache", function () { baseResource: gltfResource, supportedImageFormats: new SupportedImageFormats(), frameState: mockFrameState, - }) + }), ).toThrowDeveloperError(); }); @@ -1244,7 +1244,7 @@ describe("ResourceCache", function () { baseResource: gltfResource, supportedImageFormats: new SupportedImageFormats(), frameState: mockFrameState, - }) + }), ).toThrowDeveloperError(); }); @@ -1257,7 +1257,7 @@ describe("ResourceCache", function () { baseResource: undefined, supportedImageFormats: new SupportedImageFormats(), frameState: mockFrameState, - }) + }), ).toThrowDeveloperError(); }); @@ -1270,7 +1270,7 @@ describe("ResourceCache", function () { baseResource: gltfResource, supportedImageFormats: undefined, frameState: mockFrameState, - }) + }), ).toThrowDeveloperError(); }); @@ -1283,7 +1283,7 @@ describe("ResourceCache", function () { baseResource: gltfResource, supportedImageFormats: new SupportedImageFormats(), frameState: undefined, - }) + }), ).toThrowDeveloperError(); }); }); diff --git a/packages/engine/Specs/Scene/SceneSpec.js b/packages/engine/Specs/Scene/SceneSpec.js index ebc2462f28f1..e305f094ce3d 100644 --- a/packages/engine/Specs/Scene/SceneSpec.js +++ b/packages/engine/Specs/Scene/SceneSpec.js @@ -91,7 +91,7 @@ describe( data, headers, deferred, - overrideMimeType + overrideMimeType, ) { Resource._DefaultImplementations.loadWithXhr( path, @@ -99,14 +99,14 @@ describe( method, data, headers, - deferred + deferred, ); }; } function returnQuantizedMeshTileJson() { return returnTileJson( - "Data/CesiumTerrainTileJson/QuantizedMesh.tile.json" + "Data/CesiumTerrainTileJson/QuantizedMesh.tile.json", ); } @@ -136,7 +136,7 @@ describe( expect(scene.primitives).toBeInstanceOf(PrimitiveCollection); expect(scene.camera).toBeInstanceOf(Camera); expect(scene.screenSpaceCameraController).toBeInstanceOf( - ScreenSpaceCameraController + ScreenSpaceCameraController, ); expect(scene.mapProjection).toBeInstanceOf(GeographicProjection); expect(scene.frameState).toBeInstanceOf(FrameState); @@ -188,14 +188,14 @@ describe( expect(contextAttributes.stencil).toEqual(webglOptions.stencil); expect(contextAttributes.antialias).toEqual(webglOptions.antialias); expect(contextAttributes.premultipliedAlpha).toEqual( - webglOptions.premultipliedAlpha + webglOptions.premultipliedAlpha, ); expect(contextAttributes.preserveDrawingBuffer).toEqual( - webglOptions.preserveDrawingBuffer + webglOptions.preserveDrawingBuffer, ); expect(s.mapProjection).toEqual(mapProjection); expect(s._depthPlane._ellipsoidOffset).toEqual( - Number.POSITIVE_INFINITY + Number.POSITIVE_INFINITY, ); s.destroyForSpecs(); @@ -295,7 +295,7 @@ describe( const center = Cartesian3.add( scene.camera.position, scene.camera.direction, - new Cartesian3() + new Cartesian3(), ); const c = new DrawCommand({ @@ -329,16 +329,15 @@ describe( c.execute = function () {}; const originalShallowClone = DrawCommand.shallowClone; - spyOn(DrawCommand, "shallowClone").and.callFake(function ( - command, - result - ) { - result = originalShallowClone(command, result); - result.execute = function () { - result.uniformMap.debugShowCommandsColor(); - }; - return result; - }); + spyOn(DrawCommand, "shallowClone").and.callFake( + function (command, result) { + result = originalShallowClone(command, result); + result.execute = function () { + result.uniformMap.debugShowCommandsColor(); + }; + return result; + }, + ); scene.primitives.add(new CommandMockPrimitive(c)); @@ -365,7 +364,7 @@ describe( 1.0, 0.0, 0.0, - 1.0 + 1.0, ); const rectanglePrimitive2 = createRectangle(rectangle, 1000.0); @@ -373,7 +372,7 @@ describe( 0.0, 1.0, 0.0, - 0.5 + 0.5, ); const primitives = scene.primitives; @@ -403,7 +402,7 @@ describe( 1.0, 0.0, 0.0, - 1.0 + 1.0, ); const rectanglePrimitive2 = createRectangle(rectangle); @@ -411,7 +410,7 @@ describe( 0.0, 1.0, 0.0, - 0.5 + 0.5, ); const primitives = scene.primitives; @@ -441,7 +440,7 @@ describe( 1.0, 0.0, 0.0, - 0.5 + 0.5, ); const primitives = scene.primitives; @@ -504,7 +503,7 @@ describe( 1.0, 0.0, 0.0, - 1.0 + 1.0, ); const primitives = scene.primitives; @@ -565,7 +564,7 @@ describe( s.camera.up = Cartesian3.clone(Cartesian3.UNIT_Z); s.camera.direction = Cartesian3.negate( Cartesian3.normalize(s.camera.position, new Cartesian3()), - new Cartesian3() + new Cartesian3(), ); return expect(s).toRenderAndCall(function () { @@ -583,7 +582,7 @@ describe( s.camera.up = Cartesian3.clone(Cartesian3.UNIT_Z); s.camera.direction = Cartesian3.negate( Cartesian3.normalize(s.camera.position, new Cartesian3()), - new Cartesian3() + new Cartesian3(), ); return expect(s).toRenderAndCall(function () { @@ -601,7 +600,7 @@ describe( s.camera.up = Cartesian3.clone(Cartesian3.UNIT_Z); s.camera.direction = Cartesian3.negate( Cartesian3.normalize(s.camera.position, new Cartesian3()), - new Cartesian3() + new Cartesian3(), ); return expect(s).toRenderAndCall(function () { @@ -619,7 +618,7 @@ describe( s.camera.up = Cartesian3.clone(Cartesian3.UNIT_Z); s.camera.direction = Cartesian3.negate( Cartesian3.normalize(s.camera.position, new Cartesian3()), - new Cartesian3() + new Cartesian3(), ); return expect(s).toRenderAndCall(function () { @@ -637,7 +636,7 @@ describe( s.camera.up = Cartesian3.clone(Cartesian3.UNIT_Z); s.camera.direction = Cartesian3.negate( Cartesian3.normalize(s.camera.position, new Cartesian3()), - new Cartesian3() + new Cartesian3(), ); return expect(s).toRenderAndCall(function () { render(s.frameState, s.globe); @@ -654,7 +653,7 @@ describe( s.camera.up = Cartesian3.clone(Cartesian3.UNIT_Z); s.camera.direction = Cartesian3.negate( Cartesian3.normalize(s.camera.position, new Cartesian3()), - new Cartesian3() + new Cartesian3(), ); return expect(s).toRenderAndCall(function () { @@ -672,7 +671,7 @@ describe( s.camera.up = Cartesian3.clone(Cartesian3.UNIT_Z); s.camera.direction = Cartesian3.negate( Cartesian3.normalize(s.camera.position, new Cartesian3()), - new Cartesian3() + new Cartesian3(), ); return expect(s).toRenderAndCall(function () { @@ -698,7 +697,7 @@ describe( 1.0, 0.0, 0.0, - 0.5 + 0.5, ); const primitives = scene.primitives; @@ -727,7 +726,7 @@ describe( 1.0, 0.0, 0.0, - 0.5 + 0.5, ); const primitives = scene.primitives; @@ -752,7 +751,7 @@ describe( 1.0, 0.0, 0.0, - 1.0 + 1.0, ); const primitives = scene.primitives; @@ -762,7 +761,7 @@ describe( destination: new Cartesian3( Ellipsoid.WGS84.maximumRadius * Math.PI + 10000.0, 0.0, - 10.0 + 10.0, ), convert: false, }); @@ -787,7 +786,7 @@ describe( 1.0, 0.0, 0.0, - 1.0 + 1.0, ); const primitives = s.primitives; @@ -797,7 +796,7 @@ describe( destination: new Cartesian3( Ellipsoid.WGS84.maximumRadius * Math.PI, 0.0, - 10.0 + 10.0, ), convert: false, }); @@ -825,7 +824,7 @@ describe( 4.0, 0.0, 0.0, - 1.0 + 1.0, ); const primitives = scene.primitives; @@ -852,7 +851,7 @@ describe( 1.0, 0.0, 0.0, - 0.5 + 0.5, ); const primitives = scene.primitives; @@ -878,7 +877,7 @@ describe( const canvas = scene.canvas; const windowPosition = new Cartesian2( canvas.clientWidth / 2, - canvas.clientHeight / 2 + canvas.clientHeight / 2, ); expect(scene).toRenderAndCall(function () { @@ -890,7 +889,7 @@ describe( 1.0, 0.0, 0.0, - 1.0 + 1.0, ); const primitives = scene.primitives; @@ -918,7 +917,7 @@ describe( const canvas = scene.canvas; const windowPosition = new Cartesian2( canvas.clientWidth / 2, - canvas.clientHeight / 2 + canvas.clientHeight / 2, ); expect(scene).toRenderAndCall(function () { @@ -930,7 +929,7 @@ describe( 1.0, 0.0, 0.0, - 1.0 + 1.0, ); const primitives = scene.primitives; @@ -958,7 +957,7 @@ describe( const canvas = scene.canvas; const windowPosition = new Cartesian2( canvas.clientWidth / 2, - canvas.clientHeight / 2 + canvas.clientHeight / 2, ); expect(scene).toRenderAndCall(function () { @@ -970,7 +969,7 @@ describe( 1.0, 0.0, 0.0, - 1.0 + 1.0, ); const primitives = scene.primitives; @@ -998,7 +997,7 @@ describe( const canvas = scene.canvas; const windowPosition = new Cartesian2( canvas.clientWidth / 2, - canvas.clientHeight / 2 + canvas.clientHeight / 2, ); const rectanglePrimitive = createRectangle(rectangle); @@ -1006,7 +1005,7 @@ describe( 1.0, 0.0, 0.0, - 1.0 + 1.0, ); const primitives = scene.primitives; @@ -1038,17 +1037,17 @@ describe( const canvas = scene.canvas; const windowPosition = new Cartesian2( canvas.clientWidth / 2, - canvas.clientHeight / 2 + canvas.clientHeight / 2, ); const rectanglePrimitive = scene.primitives.add( - createRectangle(rectangle) + createRectangle(rectangle), ); rectanglePrimitive.appearance.material.uniforms.color = new Color( 1.0, 0.0, 0.0, - 0.5 + 0.5, ); scene.useDepthPicking = true; @@ -1076,22 +1075,22 @@ describe( const canvas = scene.canvas; const windowPosition = new Cartesian2( canvas.clientWidth / 2, - canvas.clientHeight / 2 + canvas.clientHeight / 2, ); spyOn( SceneTransforms, - "transformWindowToDrawingBuffer" + "transformWindowToDrawingBuffer", ).and.callThrough(); expect(scene).toRenderAndCall(function () { scene.pickPosition(windowPosition); expect( - SceneTransforms.transformWindowToDrawingBuffer + SceneTransforms.transformWindowToDrawingBuffer, ).toHaveBeenCalled(); scene.pickPosition(windowPosition); expect( - SceneTransforms.transformWindowToDrawingBuffer.calls.count() + SceneTransforms.transformWindowToDrawingBuffer.calls.count(), ).toEqual(1); const rectanglePrimitive = createRectangle(rectangle); @@ -1099,7 +1098,7 @@ describe( 1.0, 0.0, 0.0, - 1.0 + 1.0, ); const primitives = scene.primitives; @@ -1109,12 +1108,12 @@ describe( expect(scene).toRenderAndCall(function () { scene.pickPosition(windowPosition); expect( - SceneTransforms.transformWindowToDrawingBuffer.calls.count() + SceneTransforms.transformWindowToDrawingBuffer.calls.count(), ).toEqual(2); scene.pickPosition(windowPosition); expect( - SceneTransforms.transformWindowToDrawingBuffer.calls.count() + SceneTransforms.transformWindowToDrawingBuffer.calls.count(), ).toEqual(2); }); }); @@ -1272,7 +1271,7 @@ describe( scene.render(); scene.camera.lookLeft( - scene.camera.frustum.fov * (scene.camera.percentageChanged + 0.1) + scene.camera.frustum.fov * (scene.camera.percentageChanged + 0.1), ); scene.initializeFrame(); @@ -1296,7 +1295,7 @@ describe( scene.render(); scene.camera.twistLeft( - CesiumMath.PI * (scene.camera.percentageChanged + 0.1) + CesiumMath.PI * (scene.camera.percentageChanged + 0.1), ); scene.initializeFrame(); @@ -1317,7 +1316,7 @@ describe( scene.render(); scene.camera.twistLeft( - CesiumMath.PI * (scene.camera.percentageChanged + 0.1) + CesiumMath.PI * (scene.camera.percentageChanged + 0.1), ); scene.initializeFrame(); @@ -1339,7 +1338,7 @@ describe( scene.camera.moveUp( scene.camera.positionCartographic.height * - (scene.camera.percentageChanged + 0.1) + (scene.camera.percentageChanged + 0.1), ); scene.initializeFrame(); @@ -1364,7 +1363,7 @@ describe( scene.camera.moveLeft( scene.camera.positionCartographic.height * - (scene.camera.percentageChanged + 0.1) + (scene.camera.percentageChanged + 0.1), ); scene.initializeFrame(); @@ -1399,7 +1398,7 @@ describe( 1.0, 0.0, 0.0, - 0.5 + 0.5, ); const primitives = scene.primitives; @@ -1425,7 +1424,7 @@ describe( 1.0, 0.0, 0.0, - 0.5 + 0.5, ); const primitives = scene.primitives; @@ -1452,7 +1451,7 @@ describe( expect(SceneTransforms.worldToWindowCoordinates).toHaveBeenCalledWith( scene, mockPosition, - undefined + undefined, ); }); @@ -1465,7 +1464,7 @@ describe( expect(SceneTransforms.worldToWindowCoordinates).toHaveBeenCalledWith( scene, mockPosition, - result + result, ); }); @@ -1489,15 +1488,13 @@ describe( returnQuantizedMeshTileJson(); const globe = (scene.globe = new Globe(Ellipsoid.UNIT_SPHERE)); - scene.terrainProvider = await CesiumTerrainProvider.fromUrl( - "//terrain/tiles" - ); + scene.terrainProvider = + await CesiumTerrainProvider.fromUrl("//terrain/tiles"); expect(scene.terrainProvider).toBe(globe.terrainProvider); scene.globe = undefined; - const newProvider = await CesiumTerrainProvider.fromUrl( - "//newTerrain/tiles" - ); + const newProvider = + await CesiumTerrainProvider.fromUrl("//newTerrain/tiles"); expect(function () { scene.terrainProvider = newProvider; }).not.toThrow(); @@ -1772,7 +1769,7 @@ describe( scene.morphTo2D(1.0); scene.renderForSpecs( - JulianDate.addSeconds(lastRenderTime, 0.5, new JulianDate()) + JulianDate.addSeconds(lastRenderTime, 0.5, new JulianDate()), ); expect(scene.frameState.frameNumber).not.toEqual(lastFrameNumber); @@ -1787,7 +1784,7 @@ describe( scene.morphToColumbusView(1.0); scene.renderForSpecs( - JulianDate.addSeconds(lastRenderTime, 0.5, new JulianDate()) + JulianDate.addSeconds(lastRenderTime, 0.5, new JulianDate()), ); expect(scene.frameState.frameNumber).not.toEqual(lastFrameNumber); @@ -1802,7 +1799,7 @@ describe( scene.morphTo3D(1.0); scene.renderForSpecs( - JulianDate.addSeconds(lastRenderTime, 0.5, new JulianDate()) + JulianDate.addSeconds(lastRenderTime, 0.5, new JulianDate()), ); expect(scene.frameState.frameNumber).not.toEqual(lastFrameNumber); @@ -1820,7 +1817,7 @@ describe( const lastFrameNumber = scene.frameState.frameNumber; const lastRenderTime = JulianDate.clone( scene.lastRenderTime, - scratchTime + scratchTime, ); expect(lastRenderTime).toBeDefined(); expect(scene._renderRequested).toBe(false); @@ -1833,12 +1830,12 @@ describe( scene.maximumRenderTimeChange = 100.0; scene.renderForSpecs( - JulianDate.addSeconds(lastRenderTime, 50.0, new JulianDate()) + JulianDate.addSeconds(lastRenderTime, 50.0, new JulianDate()), ); expect(scene.frameState.frameNumber).toEqual(lastFrameNumber); scene.renderForSpecs( - JulianDate.addSeconds(lastRenderTime, 150.0, new JulianDate()) + JulianDate.addSeconds(lastRenderTime, 150.0, new JulianDate()), ); expect(scene.frameState.frameNumber).not.toEqual(lastFrameNumber); }); @@ -1849,7 +1846,7 @@ describe( const lastFrameNumber = scene.frameState.frameNumber; const lastRenderTime = JulianDate.clone( scene.lastRenderTime, - scratchTime + scratchTime, ); expect(lastRenderTime).toBeDefined(); expect(scene._renderRequested).toBe(false); @@ -1860,7 +1857,7 @@ describe( const farFuture = JulianDate.addDays( lastRenderTime, 10000, - new JulianDate() + new JulianDate(), ); scene.renderForSpecs(); @@ -1908,12 +1905,12 @@ describe( destination: new Cartesian3( -588536.1057451078, -10512475.371849751, - 6737159.100747835 + 6737159.100747835, ), orientation: new HeadingPitchRoll( 6.283185307179586, -1.5688261558859757, - 0.0 + 0.0, ), }); scene.renderForSpecs(); @@ -1923,12 +1920,12 @@ describe( destination: new Cartesian3( -5754647.167415793, 14907694.100240812, - -483807.2406259497 + -483807.2406259497, ), orientation: new HeadingPitchRoll( 6.283185307179586, -1.5698869547885104, - 0.0 + 0.0, ), }); scene.renderForSpecs(); @@ -1954,12 +1951,12 @@ describe( destination: new Cartesian3( -5754647.167415793, 14907694.100240812, - -483807.2406259497 + -483807.2406259497, ), orientation: new HeadingPitchRoll( 6.283185307179586, -1.5698869547885104, - 0.0 + 0.0, ), }); scene.renderForSpecs(); @@ -2030,12 +2027,12 @@ describe( destination: new Cartesian3( -746658.0557573901, -5644191.0002196245, - 2863585.099969967 + 2863585.099969967, ), orientation: new HeadingPitchRoll( 0.3019699121236403, 0.07316306869231592, - 0.0007089903642230055 + 0.0007089903642230055, ), }); await updateGlobeUntilDone(scene); @@ -2070,12 +2067,12 @@ describe( destination: new Cartesian3( -4643042.379120885, 4314056.579506199, - -451828.8968118975 + -451828.8968118975, ), orientation: new HeadingPitchRoll( 6.283185307179586, -0.7855491933100796, - 6.283185307179586 + 6.283185307179586, ), }); scene.morphToColumbusView(0.0); @@ -2094,7 +2091,7 @@ describe( 2.3929070618374535, -0.07149851443375346, -25000.0, - globe.ellipsoid + globe.ellipsoid, ); const radius = 10.0; @@ -2117,12 +2114,12 @@ describe( destination: new Cartesian3( -4643042.379120885, 4314056.579506199, - -451828.8968118975 + -451828.8968118975, ), orientation: new HeadingPitchRoll( 6.283185307179586, -0.7855491933100796, - 6.283185307179586 + 6.283185307179586, ), }); await updateGlobeUntilDone(scene); @@ -2139,7 +2136,7 @@ describe( 2.3929070618374535, -0.07149851443375346, -25000.0, - globe.ellipsoid + globe.ellipsoid, ); const radius = 10.0; @@ -2174,18 +2171,18 @@ describe( destination: new Cartesian3( 2838477.9315700866, -4939120.816857662, - 1978094.4576285738 + 1978094.4576285738, ), orientation: new HeadingPitchRoll( 5.955798516387474, -1.0556025616093283, - 0.39098563693868016 + 0.39098563693868016, ), }); await updateGlobeUntilDone(scene); const time = JulianDate.fromIso8601( - "2020-04-25T03:07:26.04924034334544558Z" + "2020-04-25T03:07:26.04924034334544558Z", ); globe.translucency.enabled = true; globe.translucency.frontFaceAlpha = 0.5; @@ -2205,12 +2202,12 @@ describe( destination: new Cartesian3( 2764681.3022502237, -20999839.371941473, - 14894754.464869803 + 14894754.464869803, ), orientation: new HeadingPitchRoll( 6.283185307179586, -1.5687983447998315, - 0 + 0, ), }); @@ -2239,12 +2236,12 @@ describe( destination: new Cartesian3( -557278.4840232887, -6744284.200717078, - 2794079.461722868 + 2794079.461722868, ), orientation: new HeadingPitchRoll( 6.283185307179586, -1.5687983448015541, - 0 + 0, ), }); @@ -2255,7 +2252,7 @@ describe( }), attributes: { color: ColorGeometryInstanceAttribute.fromColor( - new Color(1.0, 0.0, 0.0, 0.5) + new Color(1.0, 0.0, 0.0, 0.5), ), }, }); @@ -2267,7 +2264,7 @@ describe( closed: true, }), asynchronous: false, - }) + }), ); await updateGlobeUntilDone(scene); @@ -2287,12 +2284,12 @@ describe( destination: new Cartesian3( -557278.4840232887, -6744284.200717078, - 2794079.461722868 + 2794079.461722868, ), orientation: new HeadingPitchRoll( 6.283185307179586, -1.5687983448015541, - 0 + 0, ), }); @@ -2303,7 +2300,7 @@ describe( }), attributes: { color: ColorGeometryInstanceAttribute.fromColor( - new Color(1.0, 0.0, 0.0, 0.5) + new Color(1.0, 0.0, 0.0, 0.5), ), }, }); @@ -2315,7 +2312,7 @@ describe( closed: true, }), asynchronous: false, - }) + }), ); await updateGlobeUntilDone(scene); @@ -2370,5 +2367,5 @@ describe( }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/SceneTransformsSpec.js b/packages/engine/Specs/Scene/SceneTransformsSpec.js index 180a57ed4451..a9a09c190ec5 100644 --- a/packages/engine/Specs/Scene/SceneTransformsSpec.js +++ b/packages/engine/Specs/Scene/SceneTransformsSpec.js @@ -53,7 +53,7 @@ describe( it("returns correct window position in 3D", function () { const ellipsoid = Ellipsoid.WGS84; const positionCartographic = ellipsoid.cartesianToCartographic( - scene.camera.position + scene.camera.position, ); positionCartographic.height = 0.0; const position = ellipsoid.cartographicToCartesian(positionCartographic); @@ -63,7 +63,7 @@ describe( const windowCoordinates = SceneTransforms.worldToWindowCoordinates( scene, - position + position, ); expect(windowCoordinates.x).toEqualEpsilon(0.5, CesiumMath.EPSILON2); expect(windowCoordinates.y).toEqualEpsilon(0.5, CesiumMath.EPSILON2); @@ -72,7 +72,7 @@ describe( it("returns correct drawing buffer position in 3D", function () { const ellipsoid = Ellipsoid.WGS84; const positionCartographic = ellipsoid.cartesianToCartographic( - scene.camera.position + scene.camera.position, ); positionCartographic.height = 0.0; const position = ellipsoid.cartographicToCartesian(positionCartographic); @@ -80,24 +80,22 @@ describe( // Update scene state scene.renderForSpecs(); - const drawingBufferCoordinates = SceneTransforms.worldToDrawingBufferCoordinates( - scene, - position - ); + const drawingBufferCoordinates = + SceneTransforms.worldToDrawingBufferCoordinates(scene, position); expect(drawingBufferCoordinates.x).toEqualEpsilon( 0.5, - CesiumMath.EPSILON2 + CesiumMath.EPSILON2, ); expect(drawingBufferCoordinates.y).toEqualEpsilon( 0.5, - CesiumMath.EPSILON2 + CesiumMath.EPSILON2, ); }); it("returns undefined for window position behind camera in 3D", function () { const ellipsoid = Ellipsoid.WGS84; const positionCartographic = ellipsoid.cartesianToCartographic( - scene.camera.position + scene.camera.position, ); positionCartographic.height *= 1.1; const position = ellipsoid.cartographicToCartesian(positionCartographic); @@ -107,7 +105,7 @@ describe( const windowCoordinates = SceneTransforms.worldToWindowCoordinates( scene, - position + position, ); expect(windowCoordinates).not.toBeDefined(); }); @@ -115,7 +113,7 @@ describe( it("returns undefined for drawing buffer position behind camera in 3D", function () { const ellipsoid = Ellipsoid.WGS84; const positionCartographic = ellipsoid.cartesianToCartographic( - scene.camera.position + scene.camera.position, ); positionCartographic.height *= 1.1; const position = ellipsoid.cartographicToCartesian(positionCartographic); @@ -123,10 +121,8 @@ describe( // Update scene state scene.renderForSpecs(); - const drawingBufferCoordinates = SceneTransforms.worldToDrawingBufferCoordinates( - scene, - position - ); + const drawingBufferCoordinates = + SceneTransforms.worldToDrawingBufferCoordinates(scene, position); expect(drawingBufferCoordinates).not.toBeDefined(); }); @@ -140,11 +136,11 @@ describe( const windowCoordinates = SceneTransforms.worldToWindowCoordinates( scene, - position + position, ); expect(windowCoordinates).toEqualEpsilon( actualWindowCoordinates, - CesiumMath.EPSILON2 + CesiumMath.EPSILON2, ); }); @@ -155,16 +151,14 @@ describe( const actualDrawingBufferCoordinates = new Cartesian2(0.5, 0.5); const position = scene.camera.pickEllipsoid( - actualDrawingBufferCoordinates + actualDrawingBufferCoordinates, ); - const drawingBufferCoordinates = SceneTransforms.worldToDrawingBufferCoordinates( - scene, - position - ); + const drawingBufferCoordinates = + SceneTransforms.worldToDrawingBufferCoordinates(scene, position); expect(drawingBufferCoordinates).toEqualEpsilon( actualDrawingBufferCoordinates, - CesiumMath.EPSILON2 + CesiumMath.EPSILON2, ); }); @@ -179,12 +173,12 @@ describe( Cartesian3.multiplyByScalar( scene.camera.direction, -1, - scene.camera.direction + scene.camera.direction, ); const windowCoordinates = SceneTransforms.worldToWindowCoordinates( scene, - position + position, ); expect(windowCoordinates).not.toBeDefined(); }); @@ -200,13 +194,11 @@ describe( Cartesian3.multiplyByScalar( scene.camera.direction, -1, - scene.camera.direction + scene.camera.direction, ); - const drawingBufferCoordinates = SceneTransforms.worldToDrawingBufferCoordinates( - scene, - position - ); + const drawingBufferCoordinates = + SceneTransforms.worldToDrawingBufferCoordinates(scene, position); expect(drawingBufferCoordinates).not.toBeDefined(); }); @@ -216,7 +208,7 @@ describe( -0.000001, -0.000001, 0.000001, - 0.000001 + 0.000001, ), }); @@ -227,7 +219,7 @@ describe( const position = Cartesian3.fromDegrees(0, 0); const windowCoordinates = SceneTransforms.worldToWindowCoordinates( scene, - position + position, ); expect(windowCoordinates.x).toBeGreaterThan(0.0); @@ -251,14 +243,14 @@ describe( -0.000001, -0.000001, 0.000001, - 0.000001 + 0.000001, ), }); const position = Cartesian3.fromDegrees(0, 0); const windowCoordinates = SceneTransforms.worldToWindowCoordinates( scene, - position + position, ); expect(windowCoordinates.x).toBeGreaterThan(0.0); @@ -274,7 +266,7 @@ describe( -0.000001, -0.000001, 0.000001, - 0.000001 + 0.000001, ), }); @@ -283,10 +275,8 @@ describe( scene.renderForSpecs(); const position = Cartesian3.fromDegrees(0, 0); - const drawingBufferCoordinates = SceneTransforms.worldToDrawingBufferCoordinates( - scene, - position - ); + const drawingBufferCoordinates = + SceneTransforms.worldToDrawingBufferCoordinates(scene, position); expect(drawingBufferCoordinates.x).toBeGreaterThan(0.0); expect(drawingBufferCoordinates.y).toBeGreaterThan(0.0); @@ -308,11 +298,11 @@ describe( const position = Cartesian3.fromDegrees(-80, 25); const windowCoordinates = SceneTransforms.worldToWindowCoordinates( scene, - position + position, ); expect(windowCoordinates).toBeDefined(); scene.destroyForSpecs(); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/ScreenSpaceCameraControllerSpec.js b/packages/engine/Specs/Scene/ScreenSpaceCameraControllerSpec.js index d5367349c33a..593ca54b10f9 100644 --- a/packages/engine/Specs/Scene/ScreenSpaceCameraControllerSpec.js +++ b/packages/engine/Specs/Scene/ScreenSpaceCameraControllerSpec.js @@ -77,7 +77,7 @@ describe("Scene/ScreenSpaceCameraController", function () { const offset = Cartesian3.multiplyByScalar( Cartesian3.normalize(new Cartesian3(0.0, -2.0, 1.0), new Cartesian3()), 2.5 * maxRadii, - new Cartesian3() + new Cartesian3(), ); camera = createCamera({ @@ -112,7 +112,7 @@ describe("Scene/ScreenSpaceCameraController", function () { canvas, combine(options, { pointerType: "mouse", - }) + }), ); } else { DomEventSimulator.fireMouseDown(canvas, options); @@ -125,7 +125,7 @@ describe("Scene/ScreenSpaceCameraController", function () { canvas, combine(options, { pointerType: "mouse", - }) + }), ); } else { DomEventSimulator.fireMouseUp(document, options); @@ -138,7 +138,7 @@ describe("Scene/ScreenSpaceCameraController", function () { canvas, combine(options, { pointerType: "mouse", - }) + }), ); } else { DomEventSimulator.fireMouseMove(document, options); @@ -151,14 +151,14 @@ describe("Scene/ScreenSpaceCameraController", function () { canvas, combine({ deltaY: -wheelDelta, - }) + }), ); } else if (document.onmousewheel !== undefined) { DomEventSimulator.fireMouseWheel( canvas, combine({ wheelDelta: wheelDelta, - }) + }), ); } } @@ -250,7 +250,7 @@ describe("Scene/ScreenSpaceCameraController", function () { camera.right = Cartesian3.cross( camera.direction, camera.up, - new Cartesian3() + new Cartesian3(), ); } @@ -277,7 +277,7 @@ describe("Scene/ScreenSpaceCameraController", function () { camera.setView({ destination: Camera.DEFAULT_VIEW_RECTANGLE }); const positionCart = Ellipsoid.WGS84.cartesianToCartographic( - camera.position + camera.position, ); positionCart.height = -100.0; camera.position = Ellipsoid.WGS84.cartographicToCartesian(positionCart); @@ -299,11 +299,11 @@ describe("Scene/ScreenSpaceCameraController", function () { const position = Cartesian3.clone(camera.position); const startPosition = new Cartesian2( canvas.clientWidth / 2, - canvas.clientHeight / 2 + canvas.clientHeight / 2, ); const endPosition = new Cartesian2( canvas.clientWidth / 4, - canvas.clientHeight / 2 + canvas.clientHeight / 2, ); moveMouse(MouseButtons.LEFT, startPosition, endPosition); @@ -318,11 +318,11 @@ describe("Scene/ScreenSpaceCameraController", function () { const position = Cartesian3.clone(camera.position); const startPosition = new Cartesian2( canvas.clientWidth / 4, - canvas.clientHeight / 2 + canvas.clientHeight / 2, ); const endPosition = new Cartesian2( canvas.clientWidth / 2, - canvas.clientHeight / 2 + canvas.clientHeight / 2, ); moveMouse(MouseButtons.LEFT, startPosition, endPosition); @@ -337,11 +337,11 @@ describe("Scene/ScreenSpaceCameraController", function () { const position = Cartesian3.clone(camera.position); const startPosition = new Cartesian2( canvas.clientWidth / 2, - canvas.clientHeight / 2 + canvas.clientHeight / 2, ); const endPosition = new Cartesian2( canvas.clientWidth / 2, - canvas.clientHeight / 4 + canvas.clientHeight / 4, ); moveMouse(MouseButtons.LEFT, startPosition, endPosition); @@ -356,11 +356,11 @@ describe("Scene/ScreenSpaceCameraController", function () { const position = Cartesian3.clone(camera.position); const startPosition = new Cartesian2( canvas.clientWidth / 2, - canvas.clientHeight / 4 + canvas.clientHeight / 4, ); const endPosition = new Cartesian2( canvas.clientWidth / 2, - canvas.clientHeight / 2 + canvas.clientHeight / 2, ); moveMouse(MouseButtons.LEFT, startPosition, endPosition); @@ -375,11 +375,11 @@ describe("Scene/ScreenSpaceCameraController", function () { const position = Cartesian3.clone(camera.position); const startPosition = new Cartesian2( canvas.clientWidth / 2, - canvas.clientHeight / 4 + canvas.clientHeight / 4, ); const endPosition = new Cartesian2( canvas.clientWidth / 2, - canvas.clientHeight / 2 + canvas.clientHeight / 2, ); camera.up = Cartesian3.negate(Cartesian3.UNIT_X, new Cartesian3()); @@ -398,11 +398,11 @@ describe("Scene/ScreenSpaceCameraController", function () { const frustumDiff = camera.frustum.right - camera.frustum.left; const startPosition = new Cartesian2( canvas.clientWidth / 2, - canvas.clientHeight / 4 + canvas.clientHeight / 4, ); const endPosition = new Cartesian2( canvas.clientWidth / 2, - canvas.clientHeight / 2 + canvas.clientHeight / 2, ); moveMouse(MouseButtons.RIGHT, startPosition, endPosition); @@ -411,7 +411,7 @@ describe("Scene/ScreenSpaceCameraController", function () { expect(position.y).toEqual(camera.position.y); expect(position.z).toEqual(camera.position.z); expect(frustumDiff).toBeGreaterThan( - camera.frustum.right - camera.frustum.left + camera.frustum.right - camera.frustum.left, ); }); @@ -428,11 +428,11 @@ describe("Scene/ScreenSpaceCameraController", function () { const frustumDiff = frustum.right - frustum.left; const startPosition = new Cartesian2( canvas.clientWidth / 2, - canvas.clientHeight / 2 + canvas.clientHeight / 2, ); const endPosition = new Cartesian2( canvas.clientWidth / 2, - canvas.clientHeight / 4 + canvas.clientHeight / 4, ); moveMouse(MouseButtons.RIGHT, startPosition, endPosition); @@ -441,7 +441,7 @@ describe("Scene/ScreenSpaceCameraController", function () { expect(position.y).toEqual(camera.position.y); expect(position.z).toEqual(camera.position.z); expect(frustumDiff).toBeLessThan( - camera.frustum.right - camera.frustum.left + camera.frustum.right - camera.frustum.left, ); }); @@ -456,7 +456,7 @@ describe("Scene/ScreenSpaceCameraController", function () { expect(position.y).toEqual(camera.position.y); expect(position.z).toEqual(camera.position.z); expect(frustumDiff).toBeGreaterThan( - camera.frustum.right - camera.frustum.left + camera.frustum.right - camera.frustum.left, ); }); @@ -478,7 +478,7 @@ describe("Scene/ScreenSpaceCameraController", function () { expect(position.y).toEqual(camera.position.y); expect(position.z).toEqual(camera.position.z); expect(frustumDiff).toBeLessThan( - camera.frustum.right - camera.frustum.left + camera.frustum.right - camera.frustum.left, ); }); @@ -495,11 +495,11 @@ describe("Scene/ScreenSpaceCameraController", function () { const frustumDiff = camera.frustum.right - camera.frustum.left; const startPosition = new Cartesian2( canvas.clientWidth / 2, - canvas.clientHeight / 4 + canvas.clientHeight / 4, ); const endPosition = new Cartesian2( canvas.clientWidth / 2, - canvas.clientHeight / 2 + canvas.clientHeight / 2, ); moveMouse(MouseButtons.RIGHT, startPosition, endPosition); @@ -508,7 +508,7 @@ describe("Scene/ScreenSpaceCameraController", function () { expect(position.y).toEqual(camera.position.y); expect(position.z).toEqual(camera.position.z); expect(frustumDiff).toBeGreaterThan( - camera.frustum.right - camera.frustum.left + camera.frustum.right - camera.frustum.left, ); }); @@ -518,11 +518,11 @@ describe("Scene/ScreenSpaceCameraController", function () { const frustumDiff = camera.frustum.right - camera.frustum.left; const startPosition = new Cartesian2( canvas.clientWidth / 2, - canvas.clientHeight / 2 + canvas.clientHeight / 2, ); const endPosition = new Cartesian2( canvas.clientWidth / 2, - canvas.clientHeight / 2 + canvas.clientHeight / 2, ); moveMouse(MouseButtons.RIGHT, startPosition, endPosition); @@ -547,11 +547,11 @@ describe("Scene/ScreenSpaceCameraController", function () { const frustumDiff = camera.frustum.right - camera.frustum.left; const startPosition = new Cartesian2( canvas.clientWidth / 2, - canvas.clientHeight / 4 + canvas.clientHeight / 4, ); const endPosition = new Cartesian2( canvas.clientWidth / 2, - canvas.clientHeight / 2 + canvas.clientHeight / 2, ); moveMouse(MouseButtons.RIGHT, startPosition, endPosition); @@ -579,7 +579,7 @@ describe("Scene/ScreenSpaceCameraController", function () { const startPosition = new Cartesian2( canvas.clientWidth / 2, - canvas.clientHeight + canvas.clientHeight, ); const endPosition = new Cartesian2(canvas.clientWidth / 2, 0); @@ -587,12 +587,12 @@ describe("Scene/ScreenSpaceCameraController", function () { updateController(); expect(camera.frustum.right).toEqualEpsilon( maxZoom * 0.5, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); expect(camera.frustum.left).toEqual(-camera.frustum.right); expect(camera.frustum.top).toEqualEpsilon( maxZoom * 0.25, - CesiumMath.EPSILON10 + CesiumMath.EPSILON10, ); expect(camera.frustum.bottom).toEqual(-camera.frustum.top); }); @@ -604,11 +604,11 @@ describe("Scene/ScreenSpaceCameraController", function () { const position = Cartesian3.clone(camera.position); const startPosition = new Cartesian2( canvas.clientWidth / 4, - canvas.clientHeight / 2 + canvas.clientHeight / 2, ); const endPosition = new Cartesian2( canvas.clientWidth / 2, - canvas.clientHeight / 4 + canvas.clientHeight / 4, ); moveMouse(MouseButtons.MIDDLE, startPosition, endPosition); @@ -619,15 +619,15 @@ describe("Scene/ScreenSpaceCameraController", function () { expect(camera.direction).toEqualEpsilon( Cartesian3.negate(Cartesian3.UNIT_Z, new Cartesian3()), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); expect(camera.up).toEqualEpsilon( Cartesian3.negate(Cartesian3.UNIT_X, new Cartesian3()), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); expect(camera.right).toEqualEpsilon( Cartesian3.UNIT_Y, - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); }); @@ -638,11 +638,11 @@ describe("Scene/ScreenSpaceCameraController", function () { const position = Cartesian3.clone(camera.position); const startPosition = new Cartesian2( canvas.clientWidth / 2, - canvas.clientHeight / 4 + canvas.clientHeight / 4, ); const endPosition = new Cartesian2( canvas.clientWidth / 4, - canvas.clientHeight / 2 + canvas.clientHeight / 2, ); moveMouse(MouseButtons.MIDDLE, startPosition, endPosition); @@ -653,12 +653,12 @@ describe("Scene/ScreenSpaceCameraController", function () { expect(camera.direction).toEqualEpsilon( Cartesian3.negate(Cartesian3.UNIT_Z, new Cartesian3()), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); expect(camera.up).toEqualEpsilon(Cartesian3.UNIT_X, CesiumMath.EPSILON15); expect(camera.right).toEqualEpsilon( Cartesian3.negate(Cartesian3.UNIT_Y, new Cartesian3()), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); }); @@ -669,11 +669,11 @@ describe("Scene/ScreenSpaceCameraController", function () { const position = Cartesian3.clone(camera.position); const startPosition = new Cartesian2( (3 * canvas.clientWidth) / 4, - (3 * canvas.clientHeight) / 4 + (3 * canvas.clientHeight) / 4, ); const endPosition = new Cartesian2( canvas.clientWidth / 4, - (3 * canvas.clientHeight) / 4 + (3 * canvas.clientHeight) / 4, ); moveMouse(MouseButtons.MIDDLE, startPosition, endPosition); @@ -684,15 +684,15 @@ describe("Scene/ScreenSpaceCameraController", function () { expect(camera.direction).toEqualEpsilon( Cartesian3.negate(Cartesian3.UNIT_Z, new Cartesian3()), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); expect(camera.up).toEqualEpsilon( Cartesian3.negate(Cartesian3.UNIT_X, new Cartesian3()), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); expect(camera.right).toEqualEpsilon( Cartesian3.UNIT_Y, - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); }); @@ -701,11 +701,11 @@ describe("Scene/ScreenSpaceCameraController", function () { const position = Cartesian3.clone(camera.position); const startPosition = new Cartesian2( canvas.clientWidth / 2, - canvas.clientHeight / 2 + canvas.clientHeight / 2, ); const endPosition = new Cartesian2( canvas.clientWidth / 4, - canvas.clientHeight / 2 + canvas.clientHeight / 2, ); moveMouse(MouseButtons.LEFT, startPosition, endPosition); @@ -720,11 +720,11 @@ describe("Scene/ScreenSpaceCameraController", function () { const position = Cartesian3.clone(camera.position); const startPosition = new Cartesian2( canvas.clientWidth / 4, - canvas.clientHeight / 2 + canvas.clientHeight / 2, ); const endPosition = new Cartesian2( canvas.clientWidth / 2, - canvas.clientHeight / 2 + canvas.clientHeight / 2, ); moveMouse(MouseButtons.LEFT, startPosition, endPosition); @@ -739,11 +739,11 @@ describe("Scene/ScreenSpaceCameraController", function () { const position = Cartesian3.clone(camera.position); const startPosition = new Cartesian2( canvas.clientWidth / 2, - canvas.clientHeight / 2 + canvas.clientHeight / 2, ); const endPosition = new Cartesian2( canvas.clientWidth / 2, - canvas.clientHeight / 4 + canvas.clientHeight / 4, ); moveMouse(MouseButtons.LEFT, startPosition, endPosition); @@ -758,11 +758,11 @@ describe("Scene/ScreenSpaceCameraController", function () { const position = Cartesian3.clone(camera.position); const startPosition = new Cartesian2( canvas.clientWidth / 2, - canvas.clientHeight / 4 + canvas.clientHeight / 4, ); const endPosition = new Cartesian2( canvas.clientWidth / 2, - canvas.clientHeight / 2 + canvas.clientHeight / 2, ); moveMouse(MouseButtons.LEFT, startPosition, endPosition); @@ -778,11 +778,11 @@ describe("Scene/ScreenSpaceCameraController", function () { const position = Cartesian3.clone(camera.position); const startPosition = new Cartesian2( canvas.clientWidth / 2, - canvas.clientHeight / 4 + canvas.clientHeight / 4, ); const endPosition = new Cartesian2( canvas.clientWidth / 2, - canvas.clientHeight / 2 + canvas.clientHeight / 2, ); moveMouse(MouseButtons.LEFT, startPosition, endPosition); @@ -797,24 +797,24 @@ describe("Scene/ScreenSpaceCameraController", function () { const position = Cartesian3.clone(camera.position); const startPosition = new Cartesian2( canvas.clientWidth / 2, - canvas.clientHeight / 2 + canvas.clientHeight / 2, ); const endPosition = new Cartesian2( canvas.clientWidth / 2, - canvas.clientHeight / 4 + canvas.clientHeight / 4, ); moveMouse(MouseButtons.LEFT, startPosition, endPosition, true); updateController(); expect(camera.position).toEqual(position); expect( - Cartesian3.cross(camera.direction, camera.up, new Cartesian3()) + Cartesian3.cross(camera.direction, camera.up, new Cartesian3()), ).toEqualEpsilon(camera.right, CesiumMath.EPSILON12); expect( - Cartesian3.cross(camera.up, camera.right, new Cartesian3()) + Cartesian3.cross(camera.up, camera.right, new Cartesian3()), ).toEqualEpsilon(camera.direction, CesiumMath.EPSILON12); expect( - Cartesian3.cross(camera.right, camera.direction, new Cartesian3()) + Cartesian3.cross(camera.right, camera.direction, new Cartesian3()), ).toEqualEpsilon(camera.up, CesiumMath.EPSILON12); }); @@ -823,11 +823,11 @@ describe("Scene/ScreenSpaceCameraController", function () { const position = Cartesian3.clone(camera.position); const startPosition = new Cartesian2( canvas.clientWidth / 2, - canvas.clientHeight / 4 + canvas.clientHeight / 4, ); const endPosition = new Cartesian2( canvas.clientWidth / 2, - canvas.clientHeight / 2 + canvas.clientHeight / 2, ); moveMouse(MouseButtons.RIGHT, startPosition, endPosition); @@ -842,11 +842,11 @@ describe("Scene/ScreenSpaceCameraController", function () { const position = Cartesian3.clone(camera.position); const startPosition = new Cartesian2( canvas.clientWidth / 2, - canvas.clientHeight / 2 + canvas.clientHeight / 2, ); const endPosition = new Cartesian2( canvas.clientWidth / 2, - canvas.clientHeight / 4 + canvas.clientHeight / 4, ); moveMouse(MouseButtons.RIGHT, startPosition, endPosition); @@ -884,11 +884,11 @@ describe("Scene/ScreenSpaceCameraController", function () { const position = Cartesian3.clone(camera.position); const startPosition = new Cartesian2( canvas.clientWidth / 2, - canvas.clientHeight / 4 + canvas.clientHeight / 4, ); const endPosition = new Cartesian2( canvas.clientWidth / 2, - canvas.clientHeight / 2 + canvas.clientHeight / 2, ); moveMouse(MouseButtons.RIGHT, startPosition, endPosition); @@ -900,11 +900,11 @@ describe("Scene/ScreenSpaceCameraController", function () { setUpCV(); const startPosition = new Cartesian2( canvas.clientWidth / 2, - canvas.clientHeight / 2 + canvas.clientHeight / 2, ); const endPosition = new Cartesian2( (3 * canvas.clientWidth) / 8, - (3 * canvas.clientHeight) / 8 + (3 * canvas.clientHeight) / 8, ); camera.position.y = -100.0; @@ -914,15 +914,15 @@ describe("Scene/ScreenSpaceCameraController", function () { expect( Cartesian3.dot( Cartesian3.normalize(camera.position, new Cartesian3()), - Cartesian3.UNIT_Z - ) + Cartesian3.UNIT_Z, + ), ).toBeGreaterThan(0.0); expect(Cartesian3.dot(camera.direction, Cartesian3.UNIT_Z)).toBeLessThan( - 0.0 + 0.0, ); expect(Cartesian3.dot(camera.up, Cartesian3.UNIT_Z)).toBeGreaterThan(0.0); expect(Cartesian3.dot(camera.right, Cartesian3.UNIT_Z)).toBeLessThan( - CesiumMath.EPSILON6 + CesiumMath.EPSILON6, ); }); @@ -932,14 +932,14 @@ describe("Scene/ScreenSpaceCameraController", function () { const origin = Cartesian3.fromDegrees(-72.0, 40.0); camera.lookAtTransform( Transforms.eastNorthUpToFixedFrame(origin), - new Cartesian3(1.0, 0.0, 0.0) + new Cartesian3(1.0, 0.0, 0.0), ); const position = Cartesian3.clone(camera.position); const startPosition = new Cartesian2(0, 0); const endPosition = new Cartesian2( canvas.clientWidth / 4, - canvas.clientHeight / 4 + canvas.clientHeight / 4, ); moveMouse(MouseButtons.LEFT, startPosition, endPosition); @@ -949,15 +949,15 @@ describe("Scene/ScreenSpaceCameraController", function () { expect(camera.direction).toEqualEpsilon( Cartesian3.normalize( Cartesian3.negate(camera.position, new Cartesian3()), - new Cartesian3() + new Cartesian3(), ), - CesiumMath.EPSILON14 + CesiumMath.EPSILON14, ); expect( - Cartesian3.cross(camera.direction, camera.up, new Cartesian3()) + Cartesian3.cross(camera.direction, camera.up, new Cartesian3()), ).toEqualEpsilon(camera.right, CesiumMath.EPSILON14); expect( - Cartesian3.cross(camera.right, camera.direction, new Cartesian3()) + Cartesian3.cross(camera.right, camera.direction, new Cartesian3()), ).toEqualEpsilon(camera.up, CesiumMath.EPSILON14); }); @@ -968,11 +968,11 @@ describe("Scene/ScreenSpaceCameraController", function () { const position = Cartesian3.clone(camera.position); const startPosition = new Cartesian2( canvas.clientWidth / 2, - canvas.clientHeight / 2 + canvas.clientHeight / 2, ); const endPosition = new Cartesian2( (3 * canvas.clientWidth) / 8, - (3 * canvas.clientHeight) / 8 + (3 * canvas.clientHeight) / 8, ); moveMouse(MouseButtons.MIDDLE, startPosition, endPosition); @@ -989,11 +989,11 @@ describe("Scene/ScreenSpaceCameraController", function () { const position = Cartesian3.clone(camera.position); const startPosition = new Cartesian2( canvas.clientWidth / 2, - canvas.clientHeight / 4 + canvas.clientHeight / 4, ); const endPosition = new Cartesian2( canvas.clientWidth / 2, - canvas.clientHeight / 2 + canvas.clientHeight / 2, ); moveMouse(MouseButtons.RIGHT, startPosition, endPosition); @@ -1024,7 +1024,7 @@ describe("Scene/ScreenSpaceCameraController", function () { const startPosition = new Cartesian2(0, canvas.clientHeight / 2); const endPosition = new Cartesian2( 4.0 * canvas.clientWidth, - canvas.clientHeight / 2 + canvas.clientHeight / 2, ); moveMouse(MouseButtons.LEFT, startPosition, endPosition); @@ -1041,11 +1041,11 @@ describe("Scene/ScreenSpaceCameraController", function () { const position = Cartesian3.clone(camera.position); const startPosition = new Cartesian2( canvas.clientWidth / 2, - canvas.clientHeight / 2 + canvas.clientHeight / 2, ); const endPosition = new Cartesian2( (3 * canvas.clientWidth) / 8, - (3 * canvas.clientHeight) / 8 + (3 * canvas.clientHeight) / 8, ); moveMouse(MouseButtons.LEFT, startPosition, endPosition); @@ -1055,15 +1055,15 @@ describe("Scene/ScreenSpaceCameraController", function () { expect(camera.direction).toEqualEpsilon( Cartesian3.normalize( Cartesian3.negate(camera.position, new Cartesian3()), - new Cartesian3() + new Cartesian3(), ), - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); expect( - Cartesian3.cross(camera.direction, camera.up, new Cartesian3()) + Cartesian3.cross(camera.direction, camera.up, new Cartesian3()), ).toEqualEpsilon(camera.right, CesiumMath.EPSILON12); expect( - Cartesian3.cross(camera.right, camera.direction, new Cartesian3()) + Cartesian3.cross(camera.right, camera.direction, new Cartesian3()), ).toEqualEpsilon(camera.up, CesiumMath.EPSILON12); }); @@ -1072,11 +1072,11 @@ describe("Scene/ScreenSpaceCameraController", function () { const position = Cartesian3.clone(camera.position); const startPosition = new Cartesian2( canvas.clientWidth / 2, - canvas.clientHeight / 2 + canvas.clientHeight / 2, ); const endPosition = new Cartesian2( (3 * canvas.clientWidth) / 8, - canvas.clientHeight / 2 + canvas.clientHeight / 2, ); camera.constrainedAxis = Cartesian3.clone(Cartesian3.UNIT_Z); @@ -1087,15 +1087,15 @@ describe("Scene/ScreenSpaceCameraController", function () { expect(camera.direction).toEqualEpsilon( Cartesian3.normalize( Cartesian3.negate(camera.position, new Cartesian3()), - new Cartesian3() + new Cartesian3(), ), - CesiumMath.EPSILON14 + CesiumMath.EPSILON14, ); expect( - Cartesian3.cross(camera.direction, camera.up, new Cartesian3()) + Cartesian3.cross(camera.direction, camera.up, new Cartesian3()), ).toEqualEpsilon(camera.right, CesiumMath.EPSILON14); expect( - Cartesian3.cross(camera.right, camera.direction, new Cartesian3()) + Cartesian3.cross(camera.right, camera.direction, new Cartesian3()), ).toEqualEpsilon(camera.up, CesiumMath.EPSILON14); }); @@ -1107,11 +1107,11 @@ describe("Scene/ScreenSpaceCameraController", function () { const startPosition = new Cartesian2( canvas.clientWidth / 2, - canvas.clientHeight / 2 + canvas.clientHeight / 2, ); const endPosition = new Cartesian2( (3 * canvas.clientWidth) / 8, - (3 * canvas.clientHeight) / 8 + (3 * canvas.clientHeight) / 8, ); moveMouse(MouseButtons.LEFT, startPosition, endPosition); @@ -1127,7 +1127,7 @@ describe("Scene/ScreenSpaceCameraController", function () { const startPosition = new Cartesian2(0, 0); const endPosition = new Cartesian2( canvas.clientWidth / 4, - canvas.clientHeight / 4 + canvas.clientHeight / 4, ); moveMouse(MouseButtons.LEFT, startPosition, endPosition); @@ -1137,15 +1137,15 @@ describe("Scene/ScreenSpaceCameraController", function () { expect(camera.direction).toEqualEpsilon( Cartesian3.normalize( Cartesian3.negate(camera.position, new Cartesian3()), - new Cartesian3() + new Cartesian3(), ), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); expect( - Cartesian3.cross(camera.direction, camera.up, new Cartesian3()) + Cartesian3.cross(camera.direction, camera.up, new Cartesian3()), ).toEqualEpsilon(camera.right, CesiumMath.EPSILON15); expect( - Cartesian3.cross(camera.right, camera.direction, new Cartesian3()) + Cartesian3.cross(camera.right, camera.direction, new Cartesian3()), ).toEqualEpsilon(camera.up, CesiumMath.EPSILON15); }); @@ -1163,16 +1163,16 @@ describe("Scene/ScreenSpaceCameraController", function () { expect(camera.position.z).toEqualEpsilon( Cartesian3.magnitude(camera.position), - CesiumMath.EPSILON1 + CesiumMath.EPSILON1, ); expect(camera.direction).toEqualEpsilon( Cartesian3.negate(axis, new Cartesian3()), - CesiumMath.EPSILON4 + CesiumMath.EPSILON4, ); expect(Cartesian3.dot(camera.up, axis)).toBeLessThan(CesiumMath.EPSILON2); expect(camera.right).toEqualEpsilon( Cartesian3.cross(camera.direction, camera.up, new Cartesian3()), - CesiumMath.EPSILON4 + CesiumMath.EPSILON4, ); }); @@ -1181,17 +1181,17 @@ describe("Scene/ScreenSpaceCameraController", function () { const position = Cartesian3.clone(camera.position); const startPosition = new Cartesian2( canvas.clientWidth / 2, - canvas.clientHeight / 4 + canvas.clientHeight / 4, ); const endPosition = new Cartesian2( canvas.clientWidth / 2, - canvas.clientHeight / 2 + canvas.clientHeight / 2, ); moveMouse(MouseButtons.RIGHT, startPosition, endPosition); updateController(); expect(Cartesian3.magnitude(position)).toBeGreaterThan( - Cartesian3.magnitude(camera.position) + Cartesian3.magnitude(camera.position), ); }); @@ -1222,7 +1222,7 @@ describe("Scene/ScreenSpaceCameraController", function () { updateController(); expect(Cartesian3.magnitude(position)).toBeGreaterThan( - Cartesian3.magnitude(camera.position) + Cartesian3.magnitude(camera.position), ); }); @@ -1255,7 +1255,7 @@ describe("Scene/ScreenSpaceCameraController", function () { updateController(); expect(Cartesian3.magnitude(position)).toBeGreaterThan( - Cartesian3.magnitude(camera.position) + Cartesian3.magnitude(camera.position), ); }); @@ -1278,7 +1278,7 @@ describe("Scene/ScreenSpaceCameraController", function () { moveMouse(MouseButtons.RIGHT, startPosition, endPosition); updateController(); expect(Cartesian3.magnitude(position)).toBeGreaterThan( - Cartesian3.magnitude(camera.position) + Cartesian3.magnitude(camera.position), ); }); @@ -1287,17 +1287,17 @@ describe("Scene/ScreenSpaceCameraController", function () { const position = Cartesian3.clone(camera.position); const startPosition = new Cartesian2( canvas.clientWidth / 2, - canvas.clientHeight / 2 + canvas.clientHeight / 2, ); const endPosition = new Cartesian2( canvas.clientWidth / 2, - canvas.clientHeight / 4 + canvas.clientHeight / 4, ); moveMouse(MouseButtons.RIGHT, startPosition, endPosition); updateController(); expect(Cartesian3.magnitude(position)).toBeLessThan( - Cartesian3.magnitude(camera.position) + Cartesian3.magnitude(camera.position), ); }); @@ -1305,7 +1305,7 @@ describe("Scene/ScreenSpaceCameraController", function () { setUp3D(); const positionCart = Ellipsoid.WGS84.cartesianToCartographic( - camera.position + camera.position, ); positionCart.height = 0.0; camera.position = Ellipsoid.WGS84.cartographicToCartesian(positionCart); @@ -1316,15 +1316,16 @@ describe("Scene/ScreenSpaceCameraController", function () { const startPosition = new Cartesian2( canvas.clientWidth / 2, - canvas.clientHeight * 50 + canvas.clientHeight * 50, ); const endPosition = new Cartesian2(canvas.clientWidth / 2, 0); moveMouse(MouseButtons.RIGHT, startPosition, endPosition); updateController(); - const height = Ellipsoid.WGS84.cartesianToCartographic(camera.position) - .height; + const height = Ellipsoid.WGS84.cartesianToCartographic( + camera.position, + ).height; expect(height).toEqualEpsilon(maxDist, CesiumMath.EPSILON2); }); @@ -1338,7 +1339,7 @@ describe("Scene/ScreenSpaceCameraController", function () { simulateMouseWheel(120); updateController(); expect(Cartesian3.magnitude(position)).toBeGreaterThan( - Cartesian3.magnitude(camera.position) + Cartesian3.magnitude(camera.position), ); expect(camera.heading).toBeCloseTo(heading, 10); expect(camera.pitch).toBeCloseTo(pitch, 10); @@ -1355,7 +1356,7 @@ describe("Scene/ScreenSpaceCameraController", function () { simulateMouseWheel(-120); updateController(); expect(Cartesian3.magnitude(position)).toBeLessThan( - Cartesian3.magnitude(camera.position) + Cartesian3.magnitude(camera.position), ); expect(camera.heading).toBeCloseTo(heading, 10); expect(camera.pitch).toBeCloseTo(pitch, 10); @@ -1378,17 +1379,17 @@ describe("Scene/ScreenSpaceCameraController", function () { const frustumWidth = camera.frustum.width; const startPosition = new Cartesian2( canvas.clientWidth / 2, - canvas.clientHeight / 4 + canvas.clientHeight / 4, ); const endPosition = new Cartesian2( canvas.clientWidth / 2, - canvas.clientHeight / 2 + canvas.clientHeight / 2, ); moveMouse(MouseButtons.RIGHT, startPosition, endPosition); updateController(); expect(Cartesian3.magnitude(position)).toBeGreaterThan( - Cartesian3.magnitude(camera.position) + Cartesian3.magnitude(camera.position), ); expect(frustumWidth).toBeGreaterThan(camera.frustum.width); }); @@ -1409,17 +1410,17 @@ describe("Scene/ScreenSpaceCameraController", function () { const frustumWidth = camera.frustum.width; const startPosition = new Cartesian2( canvas.clientWidth / 2, - canvas.clientHeight / 2 + canvas.clientHeight / 2, ); const endPosition = new Cartesian2( canvas.clientWidth / 2, - canvas.clientHeight / 4 + canvas.clientHeight / 4, ); moveMouse(MouseButtons.RIGHT, startPosition, endPosition); updateController(); expect(Cartesian3.magnitude(position)).toBeLessThan( - Cartesian3.magnitude(camera.position) + Cartesian3.magnitude(camera.position), ); expect(frustumWidth).toBeLessThan(camera.frustum.width); }); @@ -1432,11 +1433,11 @@ describe("Scene/ScreenSpaceCameraController", function () { const startPosition = new Cartesian2( canvas.clientWidth / 2, - canvas.clientHeight / 4 + canvas.clientHeight / 4, ); const endPosition = new Cartesian2( canvas.clientWidth / 2, - canvas.clientHeight / 2 + canvas.clientHeight / 2, ); moveMouse(MouseButtons.RIGHT, startPosition, endPosition); @@ -1444,7 +1445,7 @@ describe("Scene/ScreenSpaceCameraController", function () { const vector = Cartesian3.subtract( camera.position, position, - new Cartesian3() + new Cartesian3(), ); const normalizedVector = Cartesian3.normalize(vector, vector); @@ -1457,11 +1458,11 @@ describe("Scene/ScreenSpaceCameraController", function () { const position = Cartesian3.clone(camera.position); const startPosition = new Cartesian2( canvas.clientWidth / 2, - canvas.clientHeight / 2 + canvas.clientHeight / 2, ); const endPosition = new Cartesian2( canvas.clientWidth / 2, - canvas.clientHeight / 4 + canvas.clientHeight / 4, ); moveMouse(MouseButtons.MIDDLE, startPosition, endPosition); @@ -1470,15 +1471,15 @@ describe("Scene/ScreenSpaceCameraController", function () { expect(camera.direction).not.toEqualEpsilon( Cartesian3.normalize( Cartesian3.negate(camera.position, new Cartesian3()), - new Cartesian3() + new Cartesian3(), ), - CesiumMath.EPSILON14 + CesiumMath.EPSILON14, ); expect( - Cartesian3.cross(camera.direction, camera.up, new Cartesian3()) + Cartesian3.cross(camera.direction, camera.up, new Cartesian3()), ).toEqualEpsilon(camera.right, CesiumMath.EPSILON14); expect( - Cartesian3.cross(camera.right, camera.direction, new Cartesian3()) + Cartesian3.cross(camera.right, camera.direction, new Cartesian3()), ).toEqualEpsilon(camera.up, CesiumMath.EPSILON14); const ray = new Ray(camera.positionWC, camera.directionWC); @@ -1491,11 +1492,11 @@ describe("Scene/ScreenSpaceCameraController", function () { const position = Cartesian3.clone(camera.position); const startPosition = new Cartesian2( canvas.clientWidth / 2, - canvas.clientHeight / 2 + canvas.clientHeight / 2, ); const endPosition = new Cartesian2( canvas.clientWidth / 2, - (3 * canvas.clientHeight) / 4 + (3 * canvas.clientHeight) / 4, ); moveMouse(MouseButtons.MIDDLE, startPosition, endPosition); @@ -1504,15 +1505,15 @@ describe("Scene/ScreenSpaceCameraController", function () { expect(camera.direction).toEqualEpsilon( Cartesian3.normalize( Cartesian3.negate(camera.position, new Cartesian3()), - new Cartesian3() + new Cartesian3(), ), - CesiumMath.EPSILON15 + CesiumMath.EPSILON15, ); expect( - Cartesian3.cross(camera.direction, camera.up, new Cartesian3()) + Cartesian3.cross(camera.direction, camera.up, new Cartesian3()), ).toEqualEpsilon(camera.right, CesiumMath.EPSILON14); expect( - Cartesian3.cross(camera.right, camera.direction, new Cartesian3()) + Cartesian3.cross(camera.right, camera.direction, new Cartesian3()), ).toEqualEpsilon(camera.up, CesiumMath.EPSILON15); }); @@ -1520,28 +1521,29 @@ describe("Scene/ScreenSpaceCameraController", function () { setUp3D(); const positionCart = Ellipsoid.WGS84.cartesianToCartographic( - camera.position + camera.position, ); positionCart.height = controller.minimumZoomDistance; camera.position = Ellipsoid.WGS84.cartographicToCartesian(positionCart); const startPosition = new Cartesian2( canvas.clientWidth / 2, - canvas.clientHeight + canvas.clientHeight, ); const endPosition = new Cartesian2(canvas.clientWidth / 2, 0); moveMouse(MouseButtons.MIDDLE, startPosition, endPosition); updateController(); - const height = Ellipsoid.WGS84.cartesianToCartographic(camera.position) - .height; + const height = Ellipsoid.WGS84.cartesianToCartographic( + camera.position, + ).height; expect(height).toBeLessThan(controller.minimumZoomDistance + 10.0); expect( - Cartesian3.cross(camera.direction, camera.up, new Cartesian3()) + Cartesian3.cross(camera.direction, camera.up, new Cartesian3()), ).toEqualEpsilon(camera.right, CesiumMath.EPSILON14); expect( - Cartesian3.cross(camera.right, camera.direction, new Cartesian3()) + Cartesian3.cross(camera.right, camera.direction, new Cartesian3()), ).toEqualEpsilon(camera.up, CesiumMath.EPSILON14); }); @@ -1553,11 +1555,11 @@ describe("Scene/ScreenSpaceCameraController", function () { const startPosition = new Cartesian2( canvas.clientWidth / 2, - canvas.clientHeight / 2 + canvas.clientHeight / 2, ); const endPosition = new Cartesian2( canvas.clientWidth / 2, - canvas.clientHeight / 4 + canvas.clientHeight / 4, ); moveMouse(MouseButtons.MIDDLE, startPosition, endPosition); @@ -1571,11 +1573,11 @@ describe("Scene/ScreenSpaceCameraController", function () { const position = Cartesian3.clone(camera.position); const startPosition = new Cartesian2( canvas.clientWidth / 2, - canvas.clientHeight / 2 + canvas.clientHeight / 2, ); const endPosition = new Cartesian2( canvas.clientWidth / 2, - canvas.clientHeight / 4 + canvas.clientHeight / 4, ); moveMouse(MouseButtons.LEFT, startPosition, endPosition, true); @@ -1584,17 +1586,17 @@ describe("Scene/ScreenSpaceCameraController", function () { expect(camera.direction).not.toEqual( Cartesian3.normalize( Cartesian3.negate(camera.position, new Cartesian3()), - new Cartesian3() - ) + new Cartesian3(), + ), ); expect( - Cartesian3.cross(camera.direction, camera.up, new Cartesian3()) + Cartesian3.cross(camera.direction, camera.up, new Cartesian3()), ).toEqualEpsilon(camera.right, CesiumMath.EPSILON12); expect( - Cartesian3.cross(camera.up, camera.right, new Cartesian3()) + Cartesian3.cross(camera.up, camera.right, new Cartesian3()), ).toEqualEpsilon(camera.direction, CesiumMath.EPSILON12); expect( - Cartesian3.cross(camera.right, camera.direction, new Cartesian3()) + Cartesian3.cross(camera.right, camera.direction, new Cartesian3()), ).toEqualEpsilon(camera.up, CesiumMath.EPSILON12); }); @@ -1603,17 +1605,17 @@ describe("Scene/ScreenSpaceCameraController", function () { camera.position = new Cartesian3( 0.0, 2.0 * Ellipsoid.WGS84.maximumRadius, - 0.0 + 0.0, ); camera.direction = Cartesian3.normalize( Cartesian3.negate(camera.position, new Cartesian3()), - new Cartesian3() + new Cartesian3(), ); camera.up = Cartesian3.clone(Cartesian3.UNIT_X); camera.right = Cartesian3.cross( camera.direction, camera.up, - new Cartesian3() + new Cartesian3(), ); const axis = Cartesian3.clone(Cartesian3.UNIT_X); @@ -1621,11 +1623,11 @@ describe("Scene/ScreenSpaceCameraController", function () { const startPosition = new Cartesian2( canvas.clientWidth / 2, - canvas.clientHeight / 4 + canvas.clientHeight / 4, ); const endPosition = new Cartesian2( canvas.clientWidth / 2, - canvas.clientHeight / 2 + canvas.clientHeight / 2, ); moveMouse(MouseButtons.LEFT, startPosition, endPosition); @@ -1634,20 +1636,20 @@ describe("Scene/ScreenSpaceCameraController", function () { expect(camera.direction).toEqualEpsilon( Cartesian3.normalize( Cartesian3.negate(camera.position, new Cartesian3()), - new Cartesian3() + new Cartesian3(), ), - CesiumMath.EPSILON14 + CesiumMath.EPSILON14, ); expect(camera.right).toEqualEpsilon( Cartesian3.normalize( Cartesian3.cross(axis, camera.position, new Cartesian3()), - new Cartesian3() + new Cartesian3(), ), - CesiumMath.EPSILON14 + CesiumMath.EPSILON14, ); expect(camera.up).toEqualEpsilon( Cartesian3.cross(camera.right, camera.direction, new Cartesian3()), - CesiumMath.EPSILON14 + CesiumMath.EPSILON14, ); }); @@ -1656,17 +1658,17 @@ describe("Scene/ScreenSpaceCameraController", function () { camera.position = new Cartesian3( 0.0, 2.0 * Ellipsoid.WGS84.maximumRadius, - 0.0 + 0.0, ); camera.direction = Cartesian3.negate( Cartesian3.normalize(camera.position, new Cartesian3()), - new Cartesian3() + new Cartesian3(), ); camera.up = Cartesian3.clone(Cartesian3.UNIT_X); camera.right = Cartesian3.cross( camera.direction, camera.up, - new Cartesian3() + new Cartesian3(), ); const axis = Cartesian3.clone(Cartesian3.UNIT_Z); @@ -1674,30 +1676,30 @@ describe("Scene/ScreenSpaceCameraController", function () { const startPosition = new Cartesian2( canvas.clientWidth * 0.5, - canvas.clientHeight * 0.25 + canvas.clientHeight * 0.25, ); const endPosition = new Cartesian2( canvas.clientWidth * 0.5, - canvas.clientHeight * 0.75 + canvas.clientHeight * 0.75, ); moveMouse(MouseButtons.LEFT, startPosition, endPosition); updateController(); expect(Cartesian3.dot(camera.position, axis)).toBeLessThan( - CesiumMath.EPSILON2 + CesiumMath.EPSILON2, ); expect(camera.direction).toEqualEpsilon( Cartesian3.negate( Cartesian3.normalize(camera.position, new Cartesian3()), - new Cartesian3() + new Cartesian3(), ), - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); expect(camera.right).toEqualEpsilon(axis, CesiumMath.EPSILON12); expect(camera.up).toEqualEpsilon( Cartesian3.cross(camera.right, camera.direction, new Cartesian3()), - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); }); @@ -1736,11 +1738,11 @@ describe("Scene/ScreenSpaceCameraController", function () { const position = Cartesian3.clone(camera.position); const startPosition = new Cartesian2( canvas.clientWidth / 2, - canvas.clientHeight / 4 + canvas.clientHeight / 4, ); const endPosition = new Cartesian2( canvas.clientWidth / 2, - canvas.clientHeight / 2 + canvas.clientHeight / 2, ); moveMouse(MouseButtons.RIGHT, startPosition, endPosition); @@ -1758,18 +1760,18 @@ describe("Scene/ScreenSpaceCameraController", function () { let position = Cartesian3.clone(camera.position); const startPosition = new Cartesian2( canvas.clientWidth / 2, - canvas.clientHeight / 4 + canvas.clientHeight / 4, ); const endPosition = new Cartesian2( canvas.clientWidth / 2, - canvas.clientHeight / 2 + canvas.clientHeight / 2, ); controller.zoomEventTypes = CameraEventType.LEFT_DRAG; moveMouse(MouseButtons.LEFT, startPosition, endPosition); updateController(); expect(Cartesian3.magnitude(camera.position)).toBeLessThan( - Cartesian3.magnitude(position) + Cartesian3.magnitude(position), ); position = Cartesian3.clone(camera.position); @@ -1780,7 +1782,7 @@ describe("Scene/ScreenSpaceCameraController", function () { moveMouse(MouseButtons.LEFT, endPosition, startPosition, true); updateController(); expect(Cartesian3.magnitude(camera.position)).toBeGreaterThan( - Cartesian3.magnitude(position) + Cartesian3.magnitude(position), ); position = Cartesian3.clone(camera.position); @@ -1794,14 +1796,14 @@ describe("Scene/ScreenSpaceCameraController", function () { moveMouse(MouseButtons.MIDDLE, startPosition, endPosition); updateController(); expect(Cartesian3.magnitude(camera.position)).toBeLessThan( - Cartesian3.magnitude(position) + Cartesian3.magnitude(position), ); position = Cartesian3.clone(camera.position); moveMouse(MouseButtons.LEFT, endPosition, startPosition, true); updateController(); expect(Cartesian3.magnitude(camera.position)).toBeGreaterThan( - Cartesian3.magnitude(position) + Cartesian3.magnitude(position), ); }); @@ -1818,11 +1820,11 @@ describe("Scene/ScreenSpaceCameraController", function () { // Trigger terrain adjustment with a small mouse movement const startPosition = new Cartesian2( canvas.clientWidth / 2, - canvas.clientHeight / 4 + canvas.clientHeight / 4, ); const endPosition = new Cartesian2( canvas.clientWidth / 2, - canvas.clientHeight / 2 + canvas.clientHeight / 2, ); moveMouse(MouseButtons.RIGHT, startPosition, endPosition); @@ -1830,7 +1832,7 @@ describe("Scene/ScreenSpaceCameraController", function () { expect(camera.positionCartographic.height).toEqualEpsilon( controller.minimumZoomDistance, - CesiumMath.EPSILON5 + CesiumMath.EPSILON5, ); }); @@ -1847,11 +1849,11 @@ describe("Scene/ScreenSpaceCameraController", function () { // Trigger terrain adjustment with a small mouse movement const startPosition = new Cartesian2( canvas.clientWidth / 2, - canvas.clientHeight / 4 + canvas.clientHeight / 4, ); const endPosition = new Cartesian2( canvas.clientWidth / 2, - canvas.clientHeight / 2 + canvas.clientHeight / 2, ); moveMouse(MouseButtons.RIGHT, startPosition, endPosition); @@ -1859,7 +1861,7 @@ describe("Scene/ScreenSpaceCameraController", function () { expect(camera.position.z).toEqualEpsilon( controller.minimumZoomDistance, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); }); @@ -1877,18 +1879,18 @@ describe("Scene/ScreenSpaceCameraController", function () { // Trigger terrain adjustment with a small mouse movement const startPosition = new Cartesian2( canvas.clientWidth / 2, - canvas.clientHeight / 4 + canvas.clientHeight / 4, ); const endPosition = new Cartesian2( canvas.clientWidth / 2, - canvas.clientHeight / 2 + canvas.clientHeight / 2, ); moveMouse(MouseButtons.RIGHT, startPosition, endPosition); updateController(); expect(camera.positionCartographic.height).toBeLessThan( - controller.minimumZoomDistance + controller.minimumZoomDistance, ); }); @@ -1906,11 +1908,11 @@ describe("Scene/ScreenSpaceCameraController", function () { // Trigger terrain adjustment with a small mouse movement const startPosition = new Cartesian2( canvas.clientWidth / 2, - canvas.clientHeight / 4 + canvas.clientHeight / 4, ); const endPosition = new Cartesian2( canvas.clientWidth / 2, - canvas.clientHeight / 2 + canvas.clientHeight / 2, ); moveMouse(MouseButtons.RIGHT, startPosition, endPosition); @@ -1927,24 +1929,24 @@ describe("Scene/ScreenSpaceCameraController", function () { camera.lookAt( Cartesian3.fromDegrees(-72.0, 40.0, 1.0), - new Cartesian3(1.0, 1.0, -10.0) + new Cartesian3(1.0, 1.0, -10.0), ); // Trigger terrain adjustment with a small mouse movement const startPosition = new Cartesian2( canvas.clientWidth / 2, - canvas.clientHeight / 4 + canvas.clientHeight / 4, ); const endPosition = new Cartesian2( canvas.clientWidth / 2, - canvas.clientHeight / 2 + canvas.clientHeight / 2, ); moveMouse(MouseButtons.RIGHT, startPosition, endPosition); updateController(); expect(camera.positionCartographic.height).toBeGreaterThanOrEqual( - controller.minimumZoomDistance + controller.minimumZoomDistance, ); }); @@ -1956,17 +1958,17 @@ describe("Scene/ScreenSpaceCameraController", function () { camera.lookAt( Cartesian3.fromDegrees(-72.0, 40.0, 1.0), - new Cartesian3(1.0, 1.0, -10.0) + new Cartesian3(1.0, 1.0, -10.0), ); // Trigger terrain adjustment with a small mouse movement const startPosition = new Cartesian2( canvas.clientWidth / 2, - canvas.clientHeight / 4 + canvas.clientHeight / 4, ); const endPosition = new Cartesian2( canvas.clientWidth / 2, - canvas.clientHeight / 2 + canvas.clientHeight / 2, ); moveMouse(MouseButtons.RIGHT, startPosition, endPosition); @@ -1974,7 +1976,7 @@ describe("Scene/ScreenSpaceCameraController", function () { expect(camera.positionWC.x).toEqualEpsilon( controller.minimumZoomDistance, - CesiumMath.EPSILON8 + CesiumMath.EPSILON8, ); }); diff --git a/packages/engine/Specs/Scene/ShadowMapSpec.js b/packages/engine/Specs/Scene/ShadowMapSpec.js index 762791743a0d..00d862e26af7 100644 --- a/packages/engine/Specs/Scene/ShadowMapSpec.js +++ b/packages/engine/Specs/Scene/ShadowMapSpec.js @@ -84,11 +84,11 @@ describe( const boxOrigin = new Cartesian3.fromRadians( longitude, latitude, - boxHeight + boxHeight, ); const boxTransform = Transforms.headingPitchRollToFixedFrame( boxOrigin, - new HeadingPitchRoll() + new HeadingPitchRoll(), ); const boxScale = 0.5; @@ -99,21 +99,21 @@ describe( const floorOrigin = new Cartesian3.fromRadians( longitude, latitude, - floorHeight + floorHeight, ); const floorTransform = Transforms.headingPitchRollToFixedFrame( floorOrigin, - new HeadingPitchRoll() + new HeadingPitchRoll(), ); const roomOrigin = new Cartesian3.fromRadians( longitude, latitude, - height + height, ); const roomTransform = Transforms.headingPitchRollToFixedFrame( roomOrigin, - new HeadingPitchRoll() + new HeadingPitchRoll(), ); const modelPromises = []; @@ -125,7 +125,7 @@ describe( show: false, }).then(function (model) { box = model; - }) + }), ); modelPromises.push( loadModel({ @@ -135,7 +135,7 @@ describe( show: false, }).then(function (model) { boxTranslucent = model; - }) + }), ); modelPromises.push( loadModel({ @@ -145,7 +145,7 @@ describe( show: false, }).then(function (model) { boxPointLights = model; - }) + }), ); modelPromises.push( loadModel({ @@ -156,7 +156,7 @@ describe( show: false, }).then(function (model) { boxCutout = model; - }) + }), ); modelPromises.push( loadModel({ @@ -165,7 +165,7 @@ describe( show: false, }).then(function (model) { boxNoNormals = model; - }) + }), ); modelPromises.push( loadModel({ @@ -175,7 +175,7 @@ describe( show: false, }).then(function (model) { floor = model; - }) + }), ); modelPromises.push( loadModel({ @@ -185,7 +185,7 @@ describe( show: false, }).then(function (model) { floorTranslucent = model; - }) + }), ); modelPromises.push( loadModel({ @@ -195,7 +195,7 @@ describe( show: false, }).then(function (model) { room = model; - }) + }), ); primitiveBox = createPrimitive(boxTransform, 0.5, Color.RED); @@ -203,7 +203,7 @@ describe( primitiveBoxTranslucent = createPrimitive( boxTransform, 0.5, - Color.RED.withAlpha(0.5) + Color.RED.withAlpha(0.5), ); primitiveFloor = createPrimitive(floorTransform, 2.0, Color.RED); primitiveFloorRTC = createPrimitiveRTC(floorTransform, 2.0, Color.RED); @@ -231,7 +231,7 @@ describe( asynchronous: false, show: false, shadows: ShadowMode.ENABLED, - }) + }), ); } @@ -240,7 +240,7 @@ describe( BoxGeometry.fromDimensions({ vertexFormat: PerInstanceColorAppearance.VERTEX_FORMAT, dimensions: new Cartesian3(size, size, size), - }) + }), ); const positions = boxGeometry.attributes.position.values; @@ -255,7 +255,7 @@ describe( BoundingSphere.transform( boxGeometry.boundingSphere, transform, - boxGeometry.boundingSphere + boxGeometry.boundingSphere, ); const boxGeometryInstance = new GeometryInstance({ @@ -276,7 +276,7 @@ describe( rtcCenter: boxGeometry.boundingSphere.center, show: false, shadows: ShadowMode.ENABLED, - }) + }), ); } @@ -288,7 +288,7 @@ describe( scene.render(); return model.ready; }, - { timeout: 10000 } + { timeout: 10000 }, ); return model; } @@ -328,7 +328,7 @@ describe( const center = new Cartesian3.fromRadians(longitude, latitude, height); scene.camera.lookAt( center, - new HeadingPitchRange(0.0, CesiumMath.toRadians(-70.0), 5.0) + new HeadingPitchRange(0.0, CesiumMath.toRadians(-70.0), 5.0), ); // Create light camera pointing straight down @@ -345,7 +345,7 @@ describe( const center = new Cartesian3.fromRadians(longitude, latitude, height); scene.camera.lookAt( center, - new HeadingPitchRange(0.0, CesiumMath.toRadians(-70.0), 5.0) + new HeadingPitchRange(0.0, CesiumMath.toRadians(-70.0), 5.0), ); // Create light camera pointing straight down @@ -363,7 +363,7 @@ describe( const center = new Cartesian3.fromRadians(longitude, latitude, height); scene.camera.lookAt( center, - new HeadingPitchRange(0.0, CesiumMath.toRadians(-70.0), 5.0) + new HeadingPitchRange(0.0, CesiumMath.toRadians(-70.0), 5.0), ); const frustum = new OrthographicOffCenterFrustum(); @@ -390,7 +390,7 @@ describe( const center = new Cartesian3.fromRadians(longitude, latitude, height); scene.camera.lookAt( center, - new HeadingPitchRange(0.0, CesiumMath.toRadians(-70.0), 5.0) + new HeadingPitchRange(0.0, CesiumMath.toRadians(-70.0), 5.0), ); const lightCamera = new Camera(scene); @@ -411,7 +411,7 @@ describe( const center = new Cartesian3.fromRadians(longitude, latitude, height); scene.camera.lookAt( center, - new HeadingPitchRange(0.0, CesiumMath.toRadians(-70.0), 5.0) + new HeadingPitchRange(0.0, CesiumMath.toRadians(-70.0), 5.0), ); const lightCamera = new Camera(scene); @@ -625,7 +625,7 @@ describe( const center = new Cartesian3.fromRadians(longitude, latitude, height); scene.camera.lookAt( center, - new HeadingPitchRange(0.0, CesiumMath.toRadians(-70.0), 5.0) + new HeadingPitchRange(0.0, CesiumMath.toRadians(-70.0), 5.0), ); // Create light camera that is angled horizontally @@ -640,7 +640,7 @@ describe( // Instead of the default flat tile, add a ridge that will cast shadows spyOn( EllipsoidTerrainProvider.prototype, - "requestTileGeometry" + "requestTileGeometry", ).and.callFake(function () { const width = 16; const height = 16; @@ -689,7 +689,7 @@ describe( const center = new Cartesian3.fromRadians(longitude, latitude, height); scene.camera.lookAt( center, - new HeadingPitchRange(0.0, CesiumMath.toRadians(-70.0), 5.0) + new HeadingPitchRange(0.0, CesiumMath.toRadians(-70.0), 5.0), ); // Create light camera pointing straight down @@ -726,7 +726,7 @@ describe( const center = new Cartesian3.fromRadians(longitude, latitude, height); scene.camera.lookAt( center, - new HeadingPitchRange(0.0, CesiumMath.toRadians(-90.0), 2.0) + new HeadingPitchRange(0.0, CesiumMath.toRadians(-90.0), 2.0), ); // Use the default shadow map which uses the sun as a light source @@ -783,18 +783,18 @@ describe( const lightDirectionAbove = new Cartesian3( -0.22562675028973597, 0.8893549458095356, - -0.3976686433675793 + -0.3976686433675793, ); // Light pointing straight above const lightDirectionAngle = new Cartesian3( 0.14370705890272903, 0.9062077731227641, - -0.3976628636840613 + -0.3976628636840613, ); // Light at an angle const center = new Cartesian3.fromRadians(longitude, latitude, height); scene.camera.lookAt( center, - new HeadingPitchRange(0.0, CesiumMath.toRadians(-90.0), 2.0) + new HeadingPitchRange(0.0, CesiumMath.toRadians(-90.0), 2.0), ); // Use the default shadow map which uses the scene's light source @@ -903,7 +903,7 @@ describe( for (let i = 0; i < 6; ++i) { boxPointLights.modelMatrix = Transforms.headingPitchRollToFixedFrame( origins[i], - new HeadingPitchRoll() + new HeadingPitchRoll(), ); scene.render(); // Model is pre-loaded, render one frame to update the model matrix @@ -1028,7 +1028,7 @@ describe( const center = new Cartesian3.fromRadians(longitude, latitude, height); scene.camera.lookAt( center, - new HeadingPitchRange(0.0, CesiumMath.toRadians(-70.0), 5.0) + new HeadingPitchRange(0.0, CesiumMath.toRadians(-70.0), 5.0), ); // Create light camera pointing straight down @@ -1094,19 +1094,19 @@ describe( if (depthFramebufferSupported(sceneWithWebgl1)) { expect(sceneWithWebgl1.shadowMap._usesDepthTexture).toBe(true); expect( - sceneWithWebgl1.shadowMap._shadowMapTexture.pixelFormat + sceneWithWebgl1.shadowMap._shadowMapTexture.pixelFormat, ).toEqual(PixelFormat.DEPTH_STENCIL); } else { // Depth texture extension is supported, but it fails to create create a depth-only FBO expect(sceneWithWebgl1.shadowMap._usesDepthTexture).toBe(false); expect( - sceneWithWebgl1.shadowMap._shadowMapTexture.pixelFormat + sceneWithWebgl1.shadowMap._shadowMapTexture.pixelFormat, ).toEqual(PixelFormat.RGBA); } } }, undefined, - sceneWithWebgl1 + sceneWithWebgl1, ); sceneWithWebgl1.shadowMap = @@ -1124,11 +1124,11 @@ describe( function (rgba) { expect(sceneWithWebgl1.shadowMap._usesDepthTexture).toBe(false); expect( - sceneWithWebgl1.shadowMap._shadowMapTexture.pixelFormat + sceneWithWebgl1.shadowMap._shadowMapTexture.pixelFormat, ).toEqual(PixelFormat.RGBA); }, undefined, - sceneWithWebgl1 + sceneWithWebgl1, ); sceneWithWebgl1.destroyForSpecs(); @@ -1146,7 +1146,7 @@ describe( const center = new Cartesian3.fromRadians(longitude, latitude, 200000); scene.camera.lookAt( center, - new HeadingPitchRange(0.0, CesiumMath.toRadians(-70.0), 5.0) + new HeadingPitchRange(0.0, CesiumMath.toRadians(-70.0), 5.0), ); renderAndCall(function (rgba) { @@ -1161,7 +1161,7 @@ describe( const center = new Cartesian3.fromRadians(longitude, latitude, height); scene.camera.lookAt( center, - new HeadingPitchRange(0.0, CesiumMath.toRadians(-70.0), 5.0) + new HeadingPitchRange(0.0, CesiumMath.toRadians(-70.0), 5.0), ); // Create light camera pointing straight down @@ -1316,8 +1316,8 @@ describe( if (defined(owner) && owner instanceof Model) { expect( drawCommand.shaderProgram._fragmentShaderText.indexOf( - "czm_shadow" - ) !== -1 + "czm_shadow", + ) !== -1, ).toBe(true); } } @@ -1334,8 +1334,8 @@ describe( if (defined(owner) && owner instanceof Model) { expect( drawCommand.shaderProgram._fragmentShaderText.indexOf( - "czm_shadow" - ) !== -1 + "czm_shadow", + ) !== -1, ).toBe(false); } } @@ -1345,11 +1345,11 @@ describe( it("Model updates derived commands when the shadow map is dirty", function () { const spy1 = spyOn( ShadowMap, - "createReceiveDerivedCommand" + "createReceiveDerivedCommand", ).and.callThrough(); const spy2 = spyOn( ShadowMap, - "createCastDerivedCommand" + "createCastDerivedCommand", ).and.callThrough(); box.show = true; @@ -1477,5 +1477,5 @@ describe( scene.shadowMap = undefined; }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/ShadowVolumeAppearanceSpec.js b/packages/engine/Specs/Scene/ShadowVolumeAppearanceSpec.js index 8eba7af6b61f..060940e59475 100644 --- a/packages/engine/Specs/Scene/ShadowVolumeAppearanceSpec.js +++ b/packages/engine/Specs/Scene/ShadowVolumeAppearanceSpec.js @@ -31,24 +31,26 @@ describe("Scene/ShadowVolumeAppearance", function () { const largeTestRectangle = Rectangle.fromDegrees(-45.0, -45.0, 45.0, 45.0); const smallTestRectangle = Rectangle.fromDegrees(-0.1, -0.1, 0.1, 0.1); - const largeRectangleAttributes = ShadowVolumeAppearance.getSphericalExtentGeometryInstanceAttributes( - largeTestRectangle, - [0, 0, 0, 1, 1, 0], - unitSphereEllipsoid, - projection - ); - const smallRectangleAttributes = ShadowVolumeAppearance.getPlanarTextureCoordinateAttributes( - smallTestRectangle, - [0, 0, 0, 1, 1, 0], - unitSphereEllipsoid, - projection - ); + const largeRectangleAttributes = + ShadowVolumeAppearance.getSphericalExtentGeometryInstanceAttributes( + largeTestRectangle, + [0, 0, 0, 1, 1, 0], + unitSphereEllipsoid, + projection, + ); + const smallRectangleAttributes = + ShadowVolumeAppearance.getPlanarTextureCoordinateAttributes( + smallTestRectangle, + [0, 0, 0, 1, 1, 0], + unitSphereEllipsoid, + projection, + ); const perInstanceColorMaterialAppearance = new PerInstanceColorAppearance(); const flatPerInstanceColorMaterialAppearance = new PerInstanceColorAppearance( { flat: true, - } + }, ); const textureMaterialAppearance = new MaterialAppearance({ @@ -81,13 +83,13 @@ describe("Scene/ShadowVolumeAppearance", function () { const eastMostCartesian = projection.project(eastMostCartographic); let encoded = EncodedCartesian3.encode( eastMostCartesian.x, - longitudeExtentsEncodeScratch + longitudeExtentsEncodeScratch, ); const eastMostYhighDefine = `EAST_MOST_X_HIGH ${encoded.high.toFixed( - `${encoded.high}`.length + 1 + `${encoded.high}`.length + 1, )}`; const eastMostYlowDefine = `EAST_MOST_X_LOW ${encoded.low.toFixed( - `${encoded.low}`.length + 1 + `${encoded.low}`.length + 1, )}`; const westMostCartographic = new Cartographic(); @@ -97,13 +99,13 @@ describe("Scene/ShadowVolumeAppearance", function () { const westMostCartesian = projection.project(westMostCartographic); encoded = EncodedCartesian3.encode( westMostCartesian.x, - longitudeExtentsEncodeScratch + longitudeExtentsEncodeScratch, ); const westMostYhighDefine = `WEST_MOST_X_HIGH ${encoded.high.toFixed( - `${encoded.high}`.length + 1 + `${encoded.high}`.length + 1, )}`; const westMostYlowDefine = `WEST_MOST_X_LOW ${encoded.low.toFixed( - `${encoded.low}`.length + 1 + `${encoded.low}`.length + 1, )}`; it("provides attributes for computing texture coordinates from Spherical extents", function () { @@ -116,24 +118,24 @@ describe("Scene/ShadowVolumeAppearance", function () { let value = sphericalExtents.value; expect(value[0]).toEqualEpsilon( -CesiumMath.PI_OVER_FOUR, - CesiumMath.EPSILON4 + CesiumMath.EPSILON4, ); expect(value[1]).toEqualEpsilon( -CesiumMath.PI_OVER_FOUR, - CesiumMath.EPSILON4 + CesiumMath.EPSILON4, ); expect(value[2]).toEqualEpsilon( 1.0 / CesiumMath.PI_OVER_TWO, - CesiumMath.EPSILON4 + CesiumMath.EPSILON4, ); expect(value[3]).toEqualEpsilon( 1.0 / CesiumMath.PI_OVER_TWO, - CesiumMath.EPSILON4 + CesiumMath.EPSILON4, ); const longitudeRotation = attributes.longitudeRotation; expect(longitudeRotation.componentDatatype).toEqual( - ComponentDatatype.FLOAT + ComponentDatatype.FLOAT, ); expect(longitudeRotation.componentsPerAttribute).toEqual(1); expect(longitudeRotation.normalize).toEqual(false); @@ -167,46 +169,46 @@ describe("Scene/ShadowVolumeAppearance", function () { expect(southWest_HIGH.value[2]).toEqualEpsilon(0.0, CesiumMath.EPSILON7); expect(southWest_LOW.value[0]).toBeGreaterThan( - Math.cos(CesiumMath.toRadians(0.2)) + Math.cos(CesiumMath.toRadians(0.2)), ); // Expect eastward and northward to be unit-direction vectors in the ENU coordinate system at the rectangle center const smallRectangleCenter = Cartographic.toCartesian( Rectangle.center(smallTestRectangle), - unitSphereEllipsoid + unitSphereEllipsoid, ); const enuMatrix = Transforms.eastNorthUpToFixedFrame( smallRectangleCenter, - unitSphereEllipsoid + unitSphereEllipsoid, ); const inverseEnu = Matrix4.inverse(enuMatrix, new Matrix4()); let eastwardENU = Matrix4.multiplyByPointAsVector( inverseEnu, Cartesian3.fromArray(eastward.value), - new Cartesian3() + new Cartesian3(), ); eastwardENU = Cartesian3.normalize(eastwardENU, eastwardENU); expect( Cartesian3.equalsEpsilon( eastwardENU, Cartesian3.UNIT_X, - CesiumMath.EPSILON7 - ) + CesiumMath.EPSILON7, + ), ).toBe(true); let northwardENU = Matrix4.multiplyByPointAsVector( inverseEnu, Cartesian3.fromArray(northward.value), - new Cartesian3() + new Cartesian3(), ); northwardENU = Cartesian3.normalize(northwardENU, northwardENU); expect( Cartesian3.equalsEpsilon( northwardENU, Cartesian3.UNIT_Y, - CesiumMath.EPSILON7 - ) + CesiumMath.EPSILON7, + ), ).toBe(true); }); @@ -234,19 +236,19 @@ describe("Scene/ShadowVolumeAppearance", function () { let lowValue = planes2D_LOW.value; expect(lowValue[0]).toEqualEpsilon( southwestCartesian.x, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(lowValue[1]).toEqualEpsilon( southwestCartesian.y, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(lowValue[2]).toEqualEpsilon( -southwestCartesian.y, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(lowValue[3]).toEqualEpsilon( -southwestCartesian.x, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); // Small case @@ -262,31 +264,32 @@ describe("Scene/ShadowVolumeAppearance", function () { lowValue = smallRectangleAttributes.planes2D_LOW.value; expect(lowValue[0]).toEqualEpsilon( southwestCartesian.x, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(lowValue[1]).toEqualEpsilon( southwestCartesian.y, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(lowValue[2]).toEqualEpsilon( -southwestCartesian.y, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(lowValue[3]).toEqualEpsilon( -southwestCartesian.x, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); }); it("provides attributes for rotating texture coordinates", function () { // 90 degree rotation of a square, so "max" in Y direction is (0,0), "max" in X direction is (1,1) - const attributes = ShadowVolumeAppearance.getPlanarTextureCoordinateAttributes( - smallTestRectangle, - [1, 0, 0, 0, 1, 1], - unitSphereEllipsoid, - projection, - 0.0 - ); + const attributes = + ShadowVolumeAppearance.getPlanarTextureCoordinateAttributes( + smallTestRectangle, + [1, 0, 0, 0, 1, 1], + unitSphereEllipsoid, + projection, + 0.0, + ); const uMaxVmax = attributes.uMaxVmax; const uvMinAndExtents = attributes.uvMinAndExtents; @@ -315,35 +318,35 @@ describe("Scene/ShadowVolumeAppearance", function () { it("checks for spherical extent attributes", function () { expect( ShadowVolumeAppearance.hasAttributesForSphericalExtents( - smallRectangleAttributes - ) + smallRectangleAttributes, + ), ).toBe(false); expect( ShadowVolumeAppearance.hasAttributesForSphericalExtents( - largeRectangleAttributes - ) + largeRectangleAttributes, + ), ).toBe(true); }); it("checks for planar texture coordinate attributes", function () { expect( ShadowVolumeAppearance.hasAttributesForTextureCoordinatePlanes( - smallRectangleAttributes - ) + smallRectangleAttributes, + ), ).toBe(true); expect( ShadowVolumeAppearance.hasAttributesForTextureCoordinatePlanes( - largeRectangleAttributes - ) + largeRectangleAttributes, + ), ).toBe(false); }); it("checks if a rectangle should use spherical texture coordinates", function () { expect( - ShadowVolumeAppearance.shouldUseSphericalCoordinates(smallTestRectangle) + ShadowVolumeAppearance.shouldUseSphericalCoordinates(smallTestRectangle), ).toBe(false); expect( - ShadowVolumeAppearance.shouldUseSphericalCoordinates(largeTestRectangle) + ShadowVolumeAppearance.shouldUseSphericalCoordinates(largeTestRectangle), ).toBe(true); }); @@ -352,13 +355,13 @@ describe("Scene/ShadowVolumeAppearance", function () { const sphericalTexturedAppearance = new ShadowVolumeAppearance( true, false, - textureMaterialAppearance + textureMaterialAppearance, ); let shaderSource = sphericalTexturedAppearance.createVertexShader( [], testVs, false, - projection + projection, ); let defines = shaderSource.defines; expect(defines.length).toEqual(2); @@ -370,7 +373,7 @@ describe("Scene/ShadowVolumeAppearance", function () { [], testVs, true, - projection + projection, ); defines = shaderSource.defines; expect(defines.length).toEqual(6); @@ -386,13 +389,13 @@ describe("Scene/ShadowVolumeAppearance", function () { const sphericalUnculledColorAppearance = new ShadowVolumeAppearance( false, false, - perInstanceColorMaterialAppearance + perInstanceColorMaterialAppearance, ); shaderSource = sphericalUnculledColorAppearance.createVertexShader( [], testVs, false, - projection + projection, ); defines = shaderSource.defines; expect(defines.length).toEqual(1); @@ -403,7 +406,7 @@ describe("Scene/ShadowVolumeAppearance", function () { [], testVs, true, - projection + projection, ); defines = shaderSource.defines; expect(defines.length).toEqual(5); @@ -419,13 +422,13 @@ describe("Scene/ShadowVolumeAppearance", function () { const planarTexturedAppearance = new ShadowVolumeAppearance( false, true, - textureMaterialAppearance + textureMaterialAppearance, ); shaderSource = planarTexturedAppearance.createVertexShader( [], testVs, false, - projection + projection, ); defines = shaderSource.defines; expect(defines.indexOf("TEXTURE_COORDINATES")).not.toEqual(-1); @@ -435,7 +438,7 @@ describe("Scene/ShadowVolumeAppearance", function () { [], testVs, true, - projection + projection, ); defines = shaderSource.defines; expect(defines.indexOf("TEXTURE_COORDINATES")).not.toEqual(-1); @@ -454,13 +457,13 @@ describe("Scene/ShadowVolumeAppearance", function () { const sphericalTexturedAppearance = new ShadowVolumeAppearance( true, false, - textureMaterialAppearance + textureMaterialAppearance, ); let shaderSource = sphericalTexturedAppearance.createPickVertexShader( [], testVs, false, - projection + projection, ); let defines = shaderSource.defines; expect(defines.length).toEqual(2); @@ -472,7 +475,7 @@ describe("Scene/ShadowVolumeAppearance", function () { [], testVs, true, - projection + projection, ); defines = shaderSource.defines; expect(defines.length).toEqual(6); @@ -488,13 +491,13 @@ describe("Scene/ShadowVolumeAppearance", function () { const sphericalUnculledColorAppearance = new ShadowVolumeAppearance( false, false, - perInstanceColorMaterialAppearance + perInstanceColorMaterialAppearance, ); shaderSource = sphericalUnculledColorAppearance.createPickVertexShader( [], testVs, false, - projection + projection, ); defines = shaderSource.defines; expect(defines.length).toEqual(0); @@ -504,7 +507,7 @@ describe("Scene/ShadowVolumeAppearance", function () { [], testVs, true, - projection + projection, ); defines = shaderSource.defines; @@ -519,13 +522,13 @@ describe("Scene/ShadowVolumeAppearance", function () { const planarTexturedAppearance = new ShadowVolumeAppearance( false, true, - textureMaterialAppearance + textureMaterialAppearance, ); shaderSource = planarTexturedAppearance.createPickVertexShader( [], testVs, false, - projection + projection, ); defines = shaderSource.defines; expect(defines.length).toEqual(0); @@ -534,7 +537,7 @@ describe("Scene/ShadowVolumeAppearance", function () { [], testVs, true, - projection + projection, ); defines = shaderSource.defines; @@ -551,7 +554,7 @@ describe("Scene/ShadowVolumeAppearance", function () { const sphericalTexturedAppearance = new ShadowVolumeAppearance( true, false, - textureMaterialAppearance + textureMaterialAppearance, ); let shaderSource = sphericalTexturedAppearance.createFragmentShader(false); let defines = shaderSource.defines; @@ -588,7 +591,7 @@ describe("Scene/ShadowVolumeAppearance", function () { const planarColorAppearance = new ShadowVolumeAppearance( true, true, - perInstanceColorMaterialAppearance + perInstanceColorMaterialAppearance, ); shaderSource = planarColorAppearance.createFragmentShader(false); defines = shaderSource.defines; @@ -616,7 +619,7 @@ describe("Scene/ShadowVolumeAppearance", function () { const flatSphericalTexturedAppearance = new ShadowVolumeAppearance( true, false, - flatTextureMaterialAppearance + flatTextureMaterialAppearance, ); shaderSource = flatSphericalTexturedAppearance.createFragmentShader(false); defines = shaderSource.defines; @@ -635,7 +638,7 @@ describe("Scene/ShadowVolumeAppearance", function () { const flatSphericalColorAppearance = new ShadowVolumeAppearance( false, false, - flatPerInstanceColorMaterialAppearance + flatPerInstanceColorMaterialAppearance, ); shaderSource = flatSphericalColorAppearance.createFragmentShader(false); defines = shaderSource.defines; diff --git a/packages/engine/Specs/Scene/SingleTileImageryProviderSpec.js b/packages/engine/Specs/Scene/SingleTileImageryProviderSpec.js index 41205f38c341..f1cc95c6848f 100644 --- a/packages/engine/Specs/Scene/SingleTileImageryProviderSpec.js +++ b/packages/engine/Specs/Scene/SingleTileImageryProviderSpec.js @@ -34,7 +34,7 @@ describe("Scene/SingleTileImageryProvider", function () { new SingleTileImageryProvider({ url: "Data/Images/Red16x16.png", tileWidth: 16, - }) + }), ).toThrowDeveloperError(); expect( @@ -42,19 +42,19 @@ describe("Scene/SingleTileImageryProvider", function () { new SingleTileImageryProvider({ url: "Data/Images/Red16x16.png", tileHeight: 16, - }) + }), ).toThrowDeveloperError(); }); it("fromUrl throws without url", async function () { await expectAsync( - SingleTileImageryProvider.fromUrl() + SingleTileImageryProvider.fromUrl(), ).toBeRejectedWithDeveloperError(); }); it("fromUrl resolves to created provider", async function () { const provider = await SingleTileImageryProvider.fromUrl( - "Data/Images/Red16x16.png" + "Data/Images/Red16x16.png", ); expect(provider).toBeInstanceOf(SingleTileImageryProvider); }); @@ -70,16 +70,16 @@ describe("Scene/SingleTileImageryProvider", function () { it("fromUrl throws on failed request", async function () { await expectAsync( - SingleTileImageryProvider.fromUrl("invalid.image.url") + SingleTileImageryProvider.fromUrl("invalid.image.url"), ).toBeRejectedWithError( RuntimeError, - "Failed to load image invalid.image.url" + "Failed to load image invalid.image.url", ); }); it("returns valid value for hasAlphaChannel", async function () { const provider = await SingleTileImageryProvider.fromUrl( - "Data/Images/Red16x16.png" + "Data/Images/Red16x16.png", ); expect(typeof provider.hasAlphaChannel).toBe("boolean"); @@ -112,7 +112,7 @@ describe("Scene/SingleTileImageryProvider", function () { "Data/Images/Red16x16.png", { ellipsoid: ellipsoid, - } + }, ); expect(provider.tilingScheme.ellipsoid).toEqual(ellipsoid); @@ -121,19 +121,17 @@ describe("Scene/SingleTileImageryProvider", function () { it("requests the single image immediately upon construction", async function () { const imageUrl = "Data/Images/Red16x16.png"; - spyOn(Resource._Implementations, "createImage").and.callFake(function ( - request, - crossOrigin, - deferred - ) { - const url = request.url; - expect(url).toEqual(imageUrl); - Resource._DefaultImplementations.createImage( - request, - crossOrigin, - deferred - ); - }); + spyOn(Resource._Implementations, "createImage").and.callFake( + function (request, crossOrigin, deferred) { + const url = request.url; + expect(url).toEqual(imageUrl); + Resource._DefaultImplementations.createImage( + request, + crossOrigin, + deferred, + ); + }, + ); const provider = await SingleTileImageryProvider.fromUrl(imageUrl); @@ -146,19 +144,17 @@ describe("Scene/SingleTileImageryProvider", function () { it("lazy loads image when constructed with tile height and tile width", async function () { const imageUrl = "Data/Images/Red16x16.png"; - spyOn(Resource._Implementations, "createImage").and.callFake(function ( - request, - crossOrigin, - deferred - ) { - const url = request.url; - expect(url).toEqual(imageUrl); - Resource._DefaultImplementations.createImage( - request, - crossOrigin, - deferred - ); - }); + spyOn(Resource._Implementations, "createImage").and.callFake( + function (request, crossOrigin, deferred) { + const url = request.url; + expect(url).toEqual(imageUrl); + Resource._DefaultImplementations.createImage( + request, + crossOrigin, + deferred, + ); + }, + ); const provider = new SingleTileImageryProvider({ url: imageUrl, @@ -175,7 +171,7 @@ describe("Scene/SingleTileImageryProvider", function () { it("turns the supplied credit into a logo", async function () { const provider = await SingleTileImageryProvider.fromUrl( - "Data/Images/Red16x16.png" + "Data/Images/Red16x16.png", ); expect(provider.credit).toBeUndefined(); @@ -184,7 +180,7 @@ describe("Scene/SingleTileImageryProvider", function () { "Data/Images/Red16x16.png", { credit: "Thanks to our awesome made up source of this imagery!", - } + }, ); expect(providerWithCredit.credit).toBeDefined(); @@ -211,14 +207,14 @@ describe("Scene/SingleTileImageryProvider", function () { Resource._Implementations.createImage = function ( request, crossOrigin, - deferred + deferred, ) { if (tries === 2) { // Succeed after 2 tries Resource._DefaultImplementations.createImage( new Request({ url: "Data/Images/Red16x16.png" }), crossOrigin, - deferred + deferred, ); } else { // fail diff --git a/packages/engine/Specs/Scene/SkyAtmosphereSpec.js b/packages/engine/Specs/Scene/SkyAtmosphereSpec.js index 71a215cff6cb..6f0622a80d15 100644 --- a/packages/engine/Specs/Scene/SkyAtmosphereSpec.js +++ b/packages/engine/Specs/Scene/SkyAtmosphereSpec.js @@ -172,5 +172,5 @@ describe( expect(s.isDestroyed()).toEqual(true); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/SkyBoxSpec.js b/packages/engine/Specs/Scene/SkyBoxSpec.js index 435fff1d6b17..4db7c8702d18 100644 --- a/packages/engine/Specs/Scene/SkyBoxSpec.js +++ b/packages/engine/Specs/Scene/SkyBoxSpec.js @@ -12,11 +12,11 @@ describe( beforeAll(function () { scene = createScene(); - return Resource.fetchImage("./Data/Images/Blue.png").then(function ( - image - ) { - loadedImage = image; - }); + return Resource.fetchImage("./Data/Images/Blue.png").then( + function (image) { + loadedImage = image; + }, + ); }); afterAll(function () { @@ -356,5 +356,5 @@ describe( }).toThrowDeveloperError(); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/SpecularEnvironmentCubeMapSpec.js b/packages/engine/Specs/Scene/SpecularEnvironmentCubeMapSpec.js index 23d3fe118284..1d23d2acc5fa 100644 --- a/packages/engine/Specs/Scene/SpecularEnvironmentCubeMapSpec.js +++ b/packages/engine/Specs/Scene/SpecularEnvironmentCubeMapSpec.js @@ -178,11 +178,14 @@ describe( const direction = directions[key]; const expectedColor = directionalColors[mipLevel][key]; - sampleCubeMap(cubeMap, direction, mipLevel, function ( - cubeMapColor - ) { - expect(cubeMapColor).toEqualEpsilon(expectedColor, 1); - }); + sampleCubeMap( + cubeMap, + direction, + mipLevel, + function (cubeMapColor) { + expect(cubeMapColor).toEqualEpsilon(expectedColor, 1); + }, + ); } } } @@ -239,5 +242,5 @@ describe( return promise; }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/SphereEmitterSpec.js b/packages/engine/Specs/Scene/SphereEmitterSpec.js index 7b050fecc814..122605274517 100644 --- a/packages/engine/Specs/Scene/SphereEmitterSpec.js +++ b/packages/engine/Specs/Scene/SphereEmitterSpec.js @@ -48,10 +48,10 @@ describe("Scene/SphereEmitter", function () { for (let i = 0; i < 1000; ++i) { emitter.emit(particle); expect(Cartesian3.magnitude(particle.position)).toBeLessThanOrEqual( - emitter.radius + emitter.radius, ); expect(particle.velocity).toEqual( - Cartesian3.normalize(particle.position, new Cartesian3()) + Cartesian3.normalize(particle.position, new Cartesian3()), ); } }); diff --git a/packages/engine/Specs/Scene/StructuralMetadataSpec.js b/packages/engine/Specs/Scene/StructuralMetadataSpec.js index 1b396273f39b..d1853327fa84 100644 --- a/packages/engine/Specs/Scene/StructuralMetadataSpec.js +++ b/packages/engine/Specs/Scene/StructuralMetadataSpec.js @@ -195,10 +195,10 @@ describe("Scene/StructuralMetadata", function () { expect(propertyAttribute.class).toBe(pointsClass); expect(propertyAttribute.getProperty("color").attribute).toBe("_COLOR"); expect(propertyAttribute.getProperty("intensity").attribute).toBe( - "_INTENSITY" + "_INTENSITY", ); expect(propertyAttribute.getProperty("pointSize").attribute).toBe( - "_POINT_SIZE" + "_POINT_SIZE", ); expect(metadata.propertyTablesByteLength).toBe(0); diff --git a/packages/engine/Specs/Scene/SunSpec.js b/packages/engine/Specs/Scene/SunSpec.js index caa9fd397934..9637568d61e4 100644 --- a/packages/engine/Specs/Scene/SunSpec.js +++ b/packages/engine/Specs/Scene/SunSpec.js @@ -112,5 +112,5 @@ describe( expect(sun.isDestroyed()).toEqual(true); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/TerrainFillMeshSpec.js b/packages/engine/Specs/Scene/TerrainFillMeshSpec.js index cf3589dd19af..9726006d3c12 100644 --- a/packages/engine/Specs/Scene/TerrainFillMeshSpec.js +++ b/packages/engine/Specs/Scene/TerrainFillMeshSpec.js @@ -70,7 +70,7 @@ describe("Scene/TerrainFillMesh", function () { }; frameState.cullingVolume.computeVisibility.and.returnValue( - Intersect.INTERSECTING + Intersect.INTERSECTING, ); imageryLayerCollection = new ImageryLayerCollection(); @@ -90,7 +90,7 @@ describe("Scene/TerrainFillMesh", function () { processor = new TerrainTileProcessor( frameState, mockTerrain, - imageryLayerCollection + imageryLayerCollection, ); processor.mockWebGL(); @@ -115,18 +115,10 @@ describe("Scene/TerrainFillMesh", function () { height: 3, createdByUpsampling: false, buffer: new Float32Array([ - 15.0, - 16.0, - 17.0, - 22.0, - 23.0, - 24.0, - 29.0, - 30.0, - 31.0, + 15.0, 16.0, 17.0, 22.0, 23.0, 24.0, 29.0, 30.0, 31.0, ]), }), - west + west, ) .createMeshWillSucceed(west); @@ -137,18 +129,10 @@ describe("Scene/TerrainFillMesh", function () { height: 3, createdByUpsampling: false, buffer: new Float32Array([ - 31.0, - 32.0, - 33.0, - 38.0, - 39.0, - 40.0, - 45.0, - 46.0, - 47.0, + 31.0, 32.0, 33.0, 38.0, 39.0, 40.0, 45.0, 46.0, 47.0, ]), }), - south + south, ) .createMeshWillSucceed(south); @@ -159,18 +143,10 @@ describe("Scene/TerrainFillMesh", function () { height: 3, createdByUpsampling: false, buffer: new Float32Array([ - 19.0, - 20.0, - 21.0, - 26.0, - 27.0, - 28.0, - 33.0, - 34.0, - 35.0, + 19.0, 20.0, 21.0, 26.0, 27.0, 28.0, 33.0, 34.0, 35.0, ]), }), - east + east, ) .createMeshWillSucceed(east); @@ -181,18 +157,10 @@ describe("Scene/TerrainFillMesh", function () { height: 3, createdByUpsampling: false, buffer: new Float32Array([ - 3.0, - 4.0, - 5.0, - 10.0, - 11.0, - 12.0, - 17.0, - 18.0, - 19.0, + 3.0, 4.0, 5.0, 10.0, 11.0, 12.0, 17.0, 18.0, 19.0, ]), }), - north + north, ) .createMeshWillSucceed(north); @@ -203,18 +171,10 @@ describe("Scene/TerrainFillMesh", function () { height: 3, createdByUpsampling: false, buffer: new Float32Array([ - 29.0, - 30.0, - 31.0, - 36.0, - 37.0, - 38.0, - 43.0, - 44.0, - 45.0, + 29.0, 30.0, 31.0, 36.0, 37.0, 38.0, 43.0, 44.0, 45.0, ]), }), - southwest + southwest, ) .createMeshWillSucceed(southwest); @@ -225,18 +185,10 @@ describe("Scene/TerrainFillMesh", function () { height: 3, createdByUpsampling: false, buffer: new Float32Array([ - 33.0, - 34.0, - 35.0, - 40.0, - 41.0, - 42.0, - 47.0, - 48.0, - 49.0, + 33.0, 34.0, 35.0, 40.0, 41.0, 42.0, 47.0, 48.0, 49.0, ]), }), - southeast + southeast, ) .createMeshWillSucceed(southeast); @@ -247,18 +199,10 @@ describe("Scene/TerrainFillMesh", function () { height: 3, createdByUpsampling: false, buffer: new Float32Array([ - 1.0, - 2.0, - 3.0, - 8.0, - 9.0, - 10.0, - 15.0, - 16.0, - 17.0, + 1.0, 2.0, 3.0, 8.0, 9.0, 10.0, 15.0, 16.0, 17.0, ]), }), - northwest + northwest, ) .createMeshWillSucceed(northwest); @@ -269,18 +213,10 @@ describe("Scene/TerrainFillMesh", function () { height: 3, createdByUpsampling: false, buffer: new Float32Array([ - 5.0, - 6.0, - 7.0, - 12.0, - 13.0, - 14.0, - 19.0, - 20.0, - 21.0, + 5.0, 6.0, 7.0, 12.0, 13.0, 14.0, 19.0, 20.0, 21.0, ]), }), - northeast + northeast, ) .createMeshWillSucceed(northeast); }); @@ -415,24 +351,24 @@ describe("Scene/TerrainFillMesh", function () { expect(ne.northwestMesh).toBeUndefined(); expect( - sw.eastTiles[0] === centerSE || se.westTiles[0] === centerSW + sw.eastTiles[0] === centerSE || se.westTiles[0] === centerSW, ).toBe(true); expect( - nw.eastTiles[0] === centerNE || ne.westTiles[0] === centerNW + nw.eastTiles[0] === centerNE || ne.westTiles[0] === centerNW, ).toBe(true); expect( - sw.northTiles[0] === centerNW || nw.southTiles[0] === centerSW + sw.northTiles[0] === centerNW || nw.southTiles[0] === centerSW, ).toBe(true); expect( - se.northTiles[0] === centerNE || ne.southTiles[0] === centerSE + se.northTiles[0] === centerNE || ne.southTiles[0] === centerSE, ).toBe(true); expect( - sw.northeastTile === centerNE || ne.southwestTile === centerSW + sw.northeastTile === centerNE || ne.southwestTile === centerSW, ).toBe(true); expect( - nw.southeastTile === centerSE || se.northwestTile === centerNW + nw.southeastTile === centerSE || se.northwestTile === centerNW, ).toBe(true); }); }); @@ -556,7 +492,7 @@ describe("Scene/TerrainFillMesh", function () { it("adjusts existing fill tiles when an adjacent fill tile changes", function () { const dontLoad = [east, south, southeast]; dontLoad.forEach( - mockTerrain.requestTileGeometryWillDefer.bind(mockTerrain) + mockTerrain.requestTileGeometryWillDefer.bind(mockTerrain), ); const tiles = [ @@ -602,22 +538,22 @@ describe("Scene/TerrainFillMesh", function () { expectVertexCount(southeast.data.fill, 5); expect(getHeight(center.data.fill, 1.0, 0.0)).toBe( - getHeight(southeast.data.fill, 0.0, 1.0) + getHeight(southeast.data.fill, 0.0, 1.0), ); expect(getHeight(center.data.fill, 1.0, 0.0)).toBe( - getHeight(south.data.fill, 1.0, 1.0) + getHeight(south.data.fill, 1.0, 1.0), ); expect(getHeight(center.data.fill, 1.0, 0.0)).toBe( - getHeight(east.data.fill, 0.0, 0.0) + getHeight(east.data.fill, 0.0, 0.0), ); expect(getHeight(center.data.fill, 1.0, 1.0)).toBe( - getHeight(east.data.fill, 0.0, 1.0) + getHeight(east.data.fill, 0.0, 1.0), ); expect(getHeight(east.data.fill, 1.0, 0.0)).toBe( - getHeight(southeast.data.fill, 1.0, 1.0) + getHeight(southeast.data.fill, 1.0, 1.0), ); expect(getHeight(south.data.fill, 1.0, 0.0)).toBe( - getHeight(southeast.data.fill, 0.0, 0.0) + getHeight(southeast.data.fill, 0.0, 0.0), ); // Now load the south tile. @@ -628,18 +564,10 @@ describe("Scene/TerrainFillMesh", function () { height: 3, createdByUpsampling: false, buffer: new Float32Array([ - 31.0, - 32.0, - 33.0, - 38.0, - 39.0, - 40.0, - 45.0, - 46.0, - 47.0, + 31.0, 32.0, 33.0, 38.0, 39.0, 40.0, 45.0, 46.0, 47.0, ]), }), - south + south, ) .createMeshWillSucceed(south); @@ -675,7 +603,7 @@ describe("Scene/TerrainFillMesh", function () { expectVertex(southeast.data.fill, 0.0, 1.0, 33.0); expect(getHeight(east.data.fill, 1.0, 0.0)).toBe( - getHeight(southeast.data.fill, 1.0, 1.0) + getHeight(southeast.data.fill, 1.0, 1.0), ); }); }); @@ -905,13 +833,13 @@ describe("Scene/TerrainFillMesh", function () { fillSW, 1.0, 1.0, - ((31.0 + 32.0) / 2 + (31.0 + 24.0) / 2) / 2 + ((31.0 + 32.0) / 2 + (31.0 + 24.0) / 2) / 2, ); expectVertex( fillSW, 0.5, 0.5, - ((31.0 + 32.0) / 2 + (31.0 + 24.0) / 2) / 2 + ((31.0 + 32.0) / 2 + (31.0 + 24.0) / 2) / 2, ); expectVertexCount(fillSE, 5); @@ -921,7 +849,7 @@ describe("Scene/TerrainFillMesh", function () { fillSE, 0.0, 1.0, - ((32.0 + 33.0) / 2 + (33.0 + 26.0) / 2) / 2 + ((32.0 + 33.0) / 2 + (33.0 + 26.0) / 2) / 2, ); expectVertex(fillSE, 1.0, 1.0, (33.0 + 26.0) / 2); expectVertex(fillSE, 0.5, 0.5, (33.0 + (33.0 + 26.0) / 2) / 2); @@ -932,7 +860,7 @@ describe("Scene/TerrainFillMesh", function () { fillNW, 1.0, 0.0, - ((17.0 + 18.0) / 2 + (17.0 + 24.0) / 2) / 2 + ((17.0 + 18.0) / 2 + (17.0 + 24.0) / 2) / 2, ); expectVertex(fillNW, 0.0, 1.0, 17.0); expectVertex(fillNW, 1.0, 1.0, (17.0 + 18.0) / 2); @@ -943,7 +871,7 @@ describe("Scene/TerrainFillMesh", function () { fillNE, 0.0, 0.0, - ((19.0 + 26.0) / 2 + (18.0 + 19.0) / 2) / 2 + ((19.0 + 26.0) / 2 + (18.0 + 19.0) / 2) / 2, ); expectVertex(fillNE, 1.0, 0.0, (19.0 + 26.0) / 2); expectVertex(fillNE, 0.0, 1.0, (18.0 + 19.0) / 2); @@ -952,7 +880,7 @@ describe("Scene/TerrainFillMesh", function () { fillNE, 0.5, 0.5, - ((18.0 + 19.0) / 2 + (19.0 + 26.0) / 2) / 2 + ((18.0 + 19.0) / 2 + (19.0 + 26.0) / 2) / 2, ); }); }); @@ -975,7 +903,7 @@ describe("Scene/TerrainFillMesh", function () { createdByUpsampling: false, buffer: new Float32Array([1.0, 1.0, 1.5, 1.5]), }), - westN + westN, ) .createMeshWillSucceed(westN); @@ -987,7 +915,7 @@ describe("Scene/TerrainFillMesh", function () { createdByUpsampling: false, buffer: new Float32Array([1.5, 1.5, 2.0, 2.0]), }), - westS + westS, ) .createMeshWillSucceed(westS); @@ -999,7 +927,7 @@ describe("Scene/TerrainFillMesh", function () { createdByUpsampling: false, buffer: new Float32Array([3.0, 3.0, 3.5, 3.5]), }), - eastN + eastN, ) .createMeshWillSucceed(eastN); @@ -1011,7 +939,7 @@ describe("Scene/TerrainFillMesh", function () { createdByUpsampling: false, buffer: new Float32Array([3.5, 3.5, 4.0, 4.0]), }), - eastS + eastS, ) .createMeshWillSucceed(eastS); @@ -1023,7 +951,7 @@ describe("Scene/TerrainFillMesh", function () { createdByUpsampling: false, buffer: new Float32Array([5.0, 5.5, 5.0, 5.5]), }), - northW + northW, ) .createMeshWillSucceed(northW); @@ -1035,7 +963,7 @@ describe("Scene/TerrainFillMesh", function () { createdByUpsampling: false, buffer: new Float32Array([5.5, 6.0, 6.5, 6.0]), }), - northE + northE, ) .createMeshWillSucceed(northE); @@ -1047,7 +975,7 @@ describe("Scene/TerrainFillMesh", function () { createdByUpsampling: false, buffer: new Float32Array([7.0, 7.5, 7.0, 7.5]), }), - southW + southW, ) .createMeshWillSucceed(southW); @@ -1059,7 +987,7 @@ describe("Scene/TerrainFillMesh", function () { createdByUpsampling: false, buffer: new Float32Array([7.5, 8.0, 7.5, 8.0]), }), - southE + southE, ) .createMeshWillSucceed(southE); @@ -1131,18 +1059,10 @@ describe("Scene/TerrainFillMesh", function () { height: 3, createdByUpsampling: false, buffer: new Float32Array([ - 1.0, - 2.0, - 3.0, - 4.0, - 5.0, - 6.0, - 7.0, - 8.0, - 9.0, + 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, ]), }), - westernHemisphere + westernHemisphere, ) .createMeshWillSucceed(westernHemisphere); @@ -1150,7 +1070,7 @@ describe("Scene/TerrainFillMesh", function () { .process([westernHemisphere, easternHemisphere]) .then(function () { const fill = (easternHemisphere.data.fill = new TerrainFillMesh( - easternHemisphere + easternHemisphere, )); fill.eastTiles.push(westernHemisphere); @@ -1173,18 +1093,10 @@ describe("Scene/TerrainFillMesh", function () { height: 3, createdByUpsampling: false, buffer: new Float32Array([ - 10.0, - 11.0, - 12.0, - 13.0, - 14.0, - 15.0, - 16.0, - 17.0, - 18.0, + 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, ]), }), - easternHemisphere + easternHemisphere, ) .createMeshWillSucceed(easternHemisphere); mockTerrain.requestTileGeometryWillDefer(westernHemisphere); @@ -1193,7 +1105,7 @@ describe("Scene/TerrainFillMesh", function () { .process([westernHemisphere, easternHemisphere]) .then(function () { const fill = (westernHemisphere.data.fill = new TerrainFillMesh( - westernHemisphere + westernHemisphere, )); fill.westTiles.push(easternHemisphere); @@ -1226,13 +1138,13 @@ describe("Scene/TerrainFillMesh", function () { const tc = encoding.decodeTextureCoordinates( vertices, i, - textureCoordinateScratch + textureCoordinateScratch, ); const vertexHeight = encoding.decodeHeight(vertices, i); const vertexPosition = encoding.decodePosition( vertices, i, - positionScratch + positionScratch, ); if ( Math.abs(u - tc.x) < 1e-5 && @@ -1245,7 +1157,7 @@ describe("Scene/TerrainFillMesh", function () { latitude, vertexHeight, undefined, - expectedPositionScratch + expectedPositionScratch, ); expect(vertexPosition).toEqualEpsilon(expectedPosition, 1); return vertexHeight; diff --git a/packages/engine/Specs/Scene/TextureAtlasSpec.js b/packages/engine/Specs/Scene/TextureAtlasSpec.js index 5b93cc1eca42..4d67dc7f3fd0 100644 --- a/packages/engine/Specs/Scene/TextureAtlasSpec.js +++ b/packages/engine/Specs/Scene/TextureAtlasSpec.js @@ -37,34 +37,34 @@ describe( greenImage = image; greenGuid = createGuid(); }), - Resource.fetchImage("./Data/Images/Green1x4.png").then(function ( - image - ) { - tallGreenImage = image; - tallGreenGuid = createGuid(); - }), + Resource.fetchImage("./Data/Images/Green1x4.png").then( + function (image) { + tallGreenImage = image; + tallGreenGuid = createGuid(); + }, + ), Resource.fetchImage("./Data/Images/Blue.png").then(function (image) { blueImage = image; blueGuid = createGuid(); }), - Resource.fetchImage("./Data/Images/Red16x16.png").then(function ( - image - ) { - bigRedImage = image; - bigRedGuid = createGuid(); - }), - Resource.fetchImage("./Data/Images/Blue10x10.png").then(function ( - image - ) { - bigBlueImage = image; - bigBlueGuid = createGuid(); - }), - Resource.fetchImage("./Data/Images/Green4x4.png").then(function ( - image - ) { - bigGreenImage = image; - bigGreenGuid = createGuid(); - }), + Resource.fetchImage("./Data/Images/Red16x16.png").then( + function (image) { + bigRedImage = image; + bigRedGuid = createGuid(); + }, + ), + Resource.fetchImage("./Data/Images/Blue10x10.png").then( + function (image) { + bigBlueImage = image; + bigBlueGuid = createGuid(); + }, + ), + Resource.fetchImage("./Data/Images/Green4x4.png").then( + function (image) { + bigGreenImage = image; + bigGreenGuid = createGuid(); + }, + ), ]); }); @@ -331,53 +331,53 @@ describe( expect(c0.y).toEqualEpsilon(2.0 / atlasHeight, CesiumMath.EPSILON16); expect(c0.width).toEqualEpsilon( greenImage.width / atlasWidth, - CesiumMath.EPSILON16 + CesiumMath.EPSILON16, ); expect(c0.height).toEqualEpsilon( greenImage.height / atlasHeight, - CesiumMath.EPSILON16 + CesiumMath.EPSILON16, ); expect(c1.x).toEqualEpsilon( (greenImage.width + 2 * atlas.borderWidthInPixels) / atlasWidth, - CesiumMath.EPSILON16 + CesiumMath.EPSILON16, ); expect(c1.y).toEqualEpsilon(2.0 / atlasHeight, CesiumMath.EPSILON16); expect(c1.width).toEqualEpsilon( blueImage.width / atlasWidth, - CesiumMath.EPSILON16 + CesiumMath.EPSILON16, ); expect(c1.height).toEqualEpsilon( blueImage.width / atlasHeight, - CesiumMath.EPSILON16 + CesiumMath.EPSILON16, ); expect(c2.x).toEqualEpsilon(2.0 / atlasWidth, CesiumMath.EPSILON16); expect(c2.y).toEqualEpsilon( (bigRedImage.height + atlas.borderWidthInPixels) / atlasHeight, - CesiumMath.EPSILON16 + CesiumMath.EPSILON16, ); expect(c2.width).toEqualEpsilon( bigRedImage.width / atlasWidth, - CesiumMath.EPSILON16 + CesiumMath.EPSILON16, ); expect(c2.height).toEqualEpsilon( bigRedImage.height / atlasHeight, - CesiumMath.EPSILON16 + CesiumMath.EPSILON16, ); expect(c3.x).toEqualEpsilon(2.0 / atlasWidth, CesiumMath.EPSILON16); expect(c3.y).toEqualEpsilon( (greenImage.height + 2 * atlas.borderWidthInPixels) / atlasHeight, - CesiumMath.EPSILON16 + CesiumMath.EPSILON16, ); expect(c3.width).toEqualEpsilon( bigBlueImage.width / atlasWidth, - CesiumMath.EPSILON16 + CesiumMath.EPSILON16, ); expect(c3.height).toEqualEpsilon( bigBlueImage.height / atlasHeight, - CesiumMath.EPSILON16 + CesiumMath.EPSILON16, ); }); @@ -553,10 +553,10 @@ describe( expect(texture.height).toEqual(atlasHeight); expect(coordinates[greenIndex].x).toEqual( - atlas.borderWidthInPixels / atlasWidth + atlas.borderWidthInPixels / atlasWidth, ); expect(coordinates[greenIndex].y).toEqual( - atlas.borderWidthInPixels / atlasHeight + atlas.borderWidthInPixels / atlasHeight, ); expect(coordinates[greenIndex].width).toEqual(1.0 / atlasWidth); expect(coordinates[greenIndex].height).toEqual(1.0 / atlasHeight); @@ -610,10 +610,10 @@ describe( expect(coordinates[index].x).toEqual(0.0 / atlasWidth); expect(coordinates[index].y).toEqual(0.0 / atlasHeight); expect(coordinates[index].width).toEqual( - tallGreenImage.width / atlasWidth + tallGreenImage.width / atlasWidth, ); expect(coordinates[index].height).toEqual( - tallGreenImage.height / atlasHeight + tallGreenImage.height / atlasHeight, ); }); }); @@ -700,19 +700,19 @@ describe( const index1 = await atlas.addSubRegion( greenGuid, - new BoundingRectangle(0.0, 0.0, 0.5, 0.5) + new BoundingRectangle(0.0, 0.0, 0.5, 0.5), ); const index2 = await atlas.addSubRegion( greenGuid, - new BoundingRectangle(0.0, 0.5, 0.5, 0.5) + new BoundingRectangle(0.0, 0.5, 0.5, 0.5), ); const index3 = await atlas.addSubRegion( greenGuid, - new BoundingRectangle(0.5, 0.0, 0.5, 0.5) + new BoundingRectangle(0.5, 0.0, 0.5, 0.5), ); const index4 = await atlas.addSubRegion( greenGuid, - new BoundingRectangle(0.5, 0.5, 0.5, 0.5) + new BoundingRectangle(0.5, 0.5, 0.5, 0.5), ); expect(atlas.numberOfImages).toEqual(5); @@ -755,19 +755,19 @@ describe( const index1 = await atlas.addSubRegion( greenGuid, - new BoundingRectangle(0.0, 0.0, 0.5, 0.5) + new BoundingRectangle(0.0, 0.0, 0.5, 0.5), ); const index2 = await atlas.addSubRegion( greenGuid, - new BoundingRectangle(0.0, 0.5, 0.5, 0.5) + new BoundingRectangle(0.0, 0.5, 0.5, 0.5), ); const index3 = await atlas.addSubRegion( greenGuid, - new BoundingRectangle(0.5, 0.0, 0.5, 0.5) + new BoundingRectangle(0.5, 0.0, 0.5, 0.5), ); const index4 = await atlas.addSubRegion( greenGuid, - new BoundingRectangle(0.5, 0.5, 0.5, 0.5) + new BoundingRectangle(0.5, 0.5, 0.5, 0.5), ); expect(atlas.numberOfImages).toEqual(5); @@ -914,5 +914,5 @@ describe( }).toThrowDeveloperError(); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/TileBoundingRegionSpec.js b/packages/engine/Specs/Scene/TileBoundingRegionSpec.js index 92beba6e486f..99f0a8e6c101 100644 --- a/packages/engine/Specs/Scene/TileBoundingRegionSpec.js +++ b/packages/engine/Specs/Scene/TileBoundingRegionSpec.js @@ -22,7 +22,7 @@ describe("Scene/TileBoundingRegion", function () { regionBox[0], regionBox[1], regionBox[2], - regionBox[3] + regionBox[3], ); const tileBoundingRegion = new TileBoundingRegion({ maximumHeight: boundingVolumeRegion[5], @@ -92,7 +92,7 @@ describe("Scene/TileBoundingRegion", function () { camera.position = Cartesian3.fromRadians( regionBox[0] + CesiumMath.EPSILON6, regionBox[1], - 0 + 0, ); expect(tileBoundingRegion.distanceToCamera(frameState)).toEqual(0.0); }); @@ -101,7 +101,7 @@ describe("Scene/TileBoundingRegion", function () { camera.position = Cartesian3.fromRadians(regionBox[0], regionBox[1], 2.0); expect(tileBoundingRegion.distanceToCamera(frameState)).toEqualEpsilon( 1.0, - CesiumMath.EPSILON6 + CesiumMath.EPSILON6, ); }); @@ -122,7 +122,7 @@ describe("Scene/TileBoundingRegion", function () { camera.position = Cartesian3.fromRadians(0.0, 0.0, 20.0); expect(tile.distanceToCamera(frameState)).toEqualEpsilon( 10.0, - CesiumMath.EPSILON3 + CesiumMath.EPSILON3, ); // Inside rectangle, below height @@ -133,29 +133,29 @@ describe("Scene/TileBoundingRegion", function () { camera.position = Cartesian3.fromRadians( west - offset, south - offset, - 0.0 + 0.0, ); const southwestPosition = Cartesian3.fromRadians(west, south); let expectedDistance = Cartesian3.distance( camera.position, - southwestPosition + southwestPosition, ); expect(tile.distanceToCamera(frameState)).toEqualEpsilon( expectedDistance, - CesiumMath.EPSILON1 + CesiumMath.EPSILON1, ); // From northeast camera.position = Cartesian3.fromRadians( east + offset, north + offset, - 0.0 + 0.0, ); const northeastPosition = Cartesian3.fromRadians(east, north); expectedDistance = Cartesian3.distance(camera.position, northeastPosition); expect(tile.distanceToCamera(frameState)).toEqualEpsilon( expectedDistance, - CesiumMath.EPSILON1 + CesiumMath.EPSILON1, ); }); @@ -168,7 +168,7 @@ describe("Scene/TileBoundingRegion", function () { const cameraPositionCartographic = new Cartographic( (rectangle.west + rectangle.east) * 0.5, rectangle.south, - 0.0 + 0.0, ); cameraPositionCartographic.south -= CesiumMath.EPSILON8; @@ -181,10 +181,10 @@ describe("Scene/TileBoundingRegion", function () { camera.position = ellipsoid.cartographicToCartesian( cameraPositionCartographic, - new Cartesian3() + new Cartesian3(), ); expect(tile.distanceToCamera(frameState)).toBeLessThan( - CesiumMath.EPSILON8 * ellipsoid.maximumRadius + CesiumMath.EPSILON8 * ellipsoid.maximumRadius, ); }); @@ -197,7 +197,7 @@ describe("Scene/TileBoundingRegion", function () { const cameraPositionCartographic = new Cartographic( (rectangle.west + rectangle.east) * 0.5, rectangle.north, - 0.0 + 0.0, ); cameraPositionCartographic.north += CesiumMath.EPSILON8; @@ -210,10 +210,10 @@ describe("Scene/TileBoundingRegion", function () { camera.position = ellipsoid.cartographicToCartesian( cameraPositionCartographic, - new Cartesian3() + new Cartesian3(), ); expect(tile.distanceToCamera(frameState)).toBeLessThan( - CesiumMath.EPSILON8 * ellipsoid.maximumRadius + CesiumMath.EPSILON8 * ellipsoid.maximumRadius, ); }); @@ -244,16 +244,16 @@ describe("Scene/TileBoundingRegion", function () { const distance2D = Cartesian2.distance(southwest2D, position2D); const height = Ellipsoid.WGS84.radii.x; const expectedDistance = Math.sqrt( - distance2D * distance2D + height * height + distance2D * distance2D + height * height, ); camera.position = Cartesian3.fromRadians( position3D.longitude, - position3D.latitude + position3D.latitude, ); expect(tile.distanceToCamera(frameState)).toEqualEpsilon( expectedDistance, - 10.0 + 10.0, ); }); @@ -279,11 +279,11 @@ describe("Scene/TileBoundingRegion", function () { Cartesian3.normalize(Cartesian3.fromRadians(0.0, 0.0, 1.0), normal); const distanceFromCenter = Cartesian3.distance( new Cartesian3(0.0, 0.0, 0.0), - Cartesian3.fromRadians(0.0, 0.0, 0.0) + Cartesian3.fromRadians(0.0, 0.0, 0.0), ); const plane = new Plane(normal, -distanceFromCenter); expect(tileBoundingRegion.intersectPlane(plane)).toEqual( - Intersect.INTERSECTING + Intersect.INTERSECTING, ); }); }); diff --git a/packages/engine/Specs/Scene/TileBoundingS2CellSpec.js b/packages/engine/Specs/Scene/TileBoundingS2CellSpec.js index 61f0d8f20f1b..54f955f3fef8 100644 --- a/packages/engine/Specs/Scene/TileBoundingS2CellSpec.js +++ b/packages/engine/Specs/Scene/TileBoundingS2CellSpec.js @@ -82,30 +82,30 @@ describe("Scene/TileBoundingS2Cell", function () { // Test against the top plane. const topPlane = Plane.clone( tileS2Cell._boundingPlanes[0], - topPlaneScratch + topPlaneScratch, ); topPlane.distance -= testDistance; camera.position = Plane.projectPointOntoPlane(topPlane, tileS2Cell.center); expect(tileS2Cell.distanceToCamera(frameState)).toEqualEpsilon( testDistance, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); // Test against the first side plane. const sidePlane0 = Plane.clone( tileS2Cell._boundingPlanes[2], - sidePlane0Scratch + sidePlane0Scratch, ); const edgeOne = Cartesian3.midpoint( tileS2Cell._vertices[0], tileS2Cell._vertices[1], - edgeOneScratch + edgeOneScratch, ); const edgeTwo = Cartesian3.midpoint( tileS2Cell._vertices[4], tileS2Cell._vertices[5], - edgeTwoScratch + edgeTwoScratch, ); const faceCenter = Cartesian3.midpoint(edgeOne, edgeTwo, faceCenterScratch); @@ -114,7 +114,7 @@ describe("Scene/TileBoundingS2Cell", function () { camera.position = Plane.projectPointOntoPlane(sidePlane0, faceCenter); expect(tileS2Cell.distanceToCamera(frameState)).toEqualEpsilon( testDistance, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); }); @@ -127,38 +127,38 @@ describe("Scene/TileBoundingS2Cell", function () { camera.position = Cartesian3.midpoint( tileS2Cell._vertices[0], tileS2Cell._vertices[1], - edgeMidpointScratch + edgeMidpointScratch, ); camera.position.z -= testDistance; expect(tileS2Cell.distanceToCamera(frameState)).toEqualEpsilon( testDistance, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); // Test with first and second side planes. camera.position = Cartesian3.midpoint( tileS2Cell._vertices[0], tileS2Cell._vertices[4], - edgeMidpointScratch + edgeMidpointScratch, ); camera.position.x -= 1; camera.position.z -= 1; expect(tileS2Cell.distanceToCamera(frameState)).toEqualEpsilon( Math.SQRT2, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); // Test with bottom plane and second side plane. Handles the obtuse dihedral angle case. camera.position = Cartesian3.midpoint( tileS2Cell._vertices[5], tileS2Cell._vertices[6], - edgeMidpointScratch + edgeMidpointScratch, ); camera.position.x -= 10000; camera.position.y -= 1; expect(tileS2Cell.distanceToCamera(frameState)).toEqualEpsilon( 10000, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); }); @@ -171,7 +171,7 @@ describe("Scene/TileBoundingS2Cell", function () { camera.position.z += 1; expect(tileS2Cell.distanceToCamera(frameState)).toEqualEpsilon( Math.sqrt(3), - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); }); @@ -180,7 +180,7 @@ describe("Scene/TileBoundingS2Cell", function () { camera.position = new Cartesian3(-Ellipsoid.WGS84.maximumRadius, 0, 0); expect(tileS2Cell.distanceToCamera(frameState)).toEqualEpsilon( Ellipsoid.WGS84.maximumRadius + tileS2Cell._boundingPlanes[1].distance, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); }); @@ -203,7 +203,7 @@ describe("Scene/TileBoundingS2Cell", function () { it("intersects plane", function () { expect(tileS2Cell.intersectPlane(Plane.ORIGIN_ZX_PLANE)).toEqual( - Intersect.INTERSECTING + Intersect.INTERSECTING, ); const outsidePlane = Plane.clone(Plane.ORIGIN_YZ_PLANE); @@ -211,7 +211,7 @@ describe("Scene/TileBoundingS2Cell", function () { expect(tileS2Cell.intersectPlane(outsidePlane)).toEqual(Intersect.OUTSIDE); expect(tileS2Cell.intersectPlane(Plane.ORIGIN_YZ_PLANE)).toEqual( - Intersect.INSIDE + Intersect.INSIDE, ); }); }); diff --git a/packages/engine/Specs/Scene/TileBoundingSphereSpec.js b/packages/engine/Specs/Scene/TileBoundingSphereSpec.js index 32c87cb0078f..02cf2668b452 100644 --- a/packages/engine/Specs/Scene/TileBoundingSphereSpec.js +++ b/packages/engine/Specs/Scene/TileBoundingSphereSpec.js @@ -12,7 +12,7 @@ import createFrameState from "../../../../Specs/createFrameState.js"; describe("Scene/TileBoundingSphere", function () { const tileBoundingSphere = new TileBoundingSphere( new Cartesian3(0.0, 0.0, 0.0), - 1.0 + 1.0, ); const frameState = createFrameState(); @@ -64,7 +64,7 @@ describe("Scene/TileBoundingSphere", function () { const normal = new Cartesian3(0.0, 0.0, 1.0); const plane = new Plane(normal, CesiumMath.EPSILON6); expect(tileBoundingSphere.intersectPlane(plane)).toEqual( - Intersect.INTERSECTING + Intersect.INTERSECTING, ); }); }); diff --git a/packages/engine/Specs/Scene/TileCoordinatesImageryProviderSpec.js b/packages/engine/Specs/Scene/TileCoordinatesImageryProviderSpec.js index b4af4378078b..60e793aa9990 100644 --- a/packages/engine/Specs/Scene/TileCoordinatesImageryProviderSpec.js +++ b/packages/engine/Specs/Scene/TileCoordinatesImageryProviderSpec.js @@ -9,7 +9,7 @@ import { describe("Scene/TileCoordinatesImageryProvider", function () { it("conforms to ImageryProvider interface", function () { expect(TileCoordinatesImageryProvider).toConformToInterface( - ImageryProvider + ImageryProvider, ); }); @@ -37,11 +37,11 @@ describe("Scene/TileCoordinatesImageryProvider", function () { expect(provider.tileDiscardPolicy).toBeUndefined(); expect(provider.rectangle).toEqual(new GeographicTilingScheme().rectangle); - return Promise.resolve(provider.requestImage(0, 0, 0)).then(function ( - image - ) { - expect(image).toBeDefined(); - }); + return Promise.resolve(provider.requestImage(0, 0, 0)).then( + function (image) { + expect(image).toBeDefined(); + }, + ); }); it("uses alternate tiling scheme if provided", function () { diff --git a/packages/engine/Specs/Scene/TileMapServiceImageryProviderSpec.js b/packages/engine/Specs/Scene/TileMapServiceImageryProviderSpec.js index 72494dceb68c..0e766f18b399 100644 --- a/packages/engine/Specs/Scene/TileMapServiceImageryProviderSpec.js +++ b/packages/engine/Specs/Scene/TileMapServiceImageryProviderSpec.js @@ -47,7 +47,7 @@ describe("Scene/TileMapServiceImageryProvider", function () { data, headers, deferred, - overrideMimeType + overrideMimeType, ) { // We can't resolve the promise immediately, because then the error would be raised // before we could subscribe to it. This a problem particular to tests. @@ -67,7 +67,7 @@ describe("Scene/TileMapServiceImageryProvider", function () { data, headers, deferred, - overrideMimeType + overrideMimeType, ) { // We can't resolve the promise immediately, because then the error would be raised // before we could subscribe to it. This a problem particular to tests. @@ -97,14 +97,14 @@ describe("Scene/TileMapServiceImageryProvider", function () { it("fromUrl throws without url", async function () { await expectAsync( - TileMapServiceImageryProvider.fromUrl() + TileMapServiceImageryProvider.fromUrl(), ).toBeRejectedWithDeveloperError(); }); it("fromUrl resolves to created provider", async function () { patchRequestScheduler(validSampleXmlString); const provider = await TileMapServiceImageryProvider.fromUrl( - "made/up/tms/server/" + "made/up/tms/server/", ); expect(provider).toBeInstanceOf(TileMapServiceImageryProvider); }); @@ -135,12 +135,12 @@ describe("Scene/TileMapServiceImageryProvider", function () { "</TileMap>"; patchRequestScheduler(xmlString); await expectAsync( - TileMapServiceImageryProvider.fromUrl("made/up/tms/server") + TileMapServiceImageryProvider.fromUrl("made/up/tms/server"), ).toBeRejectedWithError( RuntimeError, new RegExp( - "made/up/tms/server/tilemapresource.xml specifies an unsupported profile attribute, foobar." - ) + "made/up/tms/server/tilemapresource.xml specifies an unsupported profile attribute, foobar.", + ), ); }); @@ -159,17 +159,17 @@ describe("Scene/TileMapServiceImageryProvider", function () { "</TileMap>"; patchRequestScheduler(xmlString); await expectAsync( - TileMapServiceImageryProvider.fromUrl("made/up/tms/server") + TileMapServiceImageryProvider.fromUrl("made/up/tms/server"), ).toBeRejectedWithError( RuntimeError, - new RegExp("Unable to find expected tilesets or bbox attributes") + new RegExp("Unable to find expected tilesets or bbox attributes"), ); }); it("returns valid value for hasAlphaChannel", async function () { patchRequestScheduler(validSampleXmlString); const provider = await TileMapServiceImageryProvider.fromUrl( - "made/up/tms/server/" + "made/up/tms/server/", ); expect(typeof provider.hasAlphaChannel).toBe("boolean"); @@ -180,20 +180,18 @@ describe("Scene/TileMapServiceImageryProvider", function () { const baseUrl = "made/up/tms/server/"; const provider = await TileMapServiceImageryProvider.fromUrl(baseUrl); - spyOn(Resource._Implementations, "createImage").and.callFake(function ( - request, - crossOrigin, - deferred - ) { - expect(request.url).toStartWith(getAbsoluteUri(baseUrl)); - - // Just return any old image. - Resource._DefaultImplementations.createImage( - new Request({ url: "Data/Images/Red16x16.png" }), - crossOrigin, - deferred - ); - }); + spyOn(Resource._Implementations, "createImage").and.callFake( + function (request, crossOrigin, deferred) { + expect(request.url).toStartWith(getAbsoluteUri(baseUrl)); + + // Just return any old image. + Resource._DefaultImplementations.createImage( + new Request({ url: "Data/Images/Red16x16.png" }), + crossOrigin, + deferred, + ); + }, + ); const image = await provider.requestImage(0, 0, 0); expect(Resource._Implementations.createImage).toHaveBeenCalled(); @@ -203,23 +201,21 @@ describe("Scene/TileMapServiceImageryProvider", function () { it("supports no slash at the end of the URL", async function () { patchRequestScheduler(validSampleXmlString); const provider = await TileMapServiceImageryProvider.fromUrl( - "http://made/up/tms/server" + "http://made/up/tms/server", ); - spyOn(Resource._Implementations, "createImage").and.callFake(function ( - request, - crossOrigin, - deferred - ) { - expect(request.url).toContain("made/up/tms/server/"); - - // Just return any old image. - Resource._DefaultImplementations.createImage( - new Request({ url: "Data/Images/Red16x16.png" }), - crossOrigin, - deferred - ); - }); + spyOn(Resource._Implementations, "createImage").and.callFake( + function (request, crossOrigin, deferred) { + expect(request.url).toContain("made/up/tms/server/"); + + // Just return any old image. + Resource._DefaultImplementations.createImage( + new Request({ url: "Data/Images/Red16x16.png" }), + crossOrigin, + deferred, + ); + }, + ); const image = await provider.requestImage(0, 0, 0); expect(Resource._Implementations.createImage).toHaveBeenCalled(); @@ -230,23 +226,21 @@ describe("Scene/TileMapServiceImageryProvider", function () { patchRequestScheduler(validSampleXmlString); const baseUrl = "made/up/tms/server/"; const provider = await TileMapServiceImageryProvider.fromUrl( - `${baseUrl}?a=some&b=query` + `${baseUrl}?a=some&b=query`, ); - spyOn(Resource._Implementations, "createImage").and.callFake(function ( - request, - crossOrigin, - deferred - ) { - expect(request.url).toStartWith(getAbsoluteUri(baseUrl)); - expect(request.url).toContain("?a=some&b=query"); - // Just return any old image. - Resource._DefaultImplementations.createImage( - new Request({ url: "Data/Images/Red16x16.png" }), - crossOrigin, - deferred - ); - }); + spyOn(Resource._Implementations, "createImage").and.callFake( + function (request, crossOrigin, deferred) { + expect(request.url).toStartWith(getAbsoluteUri(baseUrl)); + expect(request.url).toContain("?a=some&b=query"); + // Just return any old image. + Resource._DefaultImplementations.createImage( + new Request({ url: "Data/Images/Red16x16.png" }), + crossOrigin, + deferred, + ); + }, + ); const image = await provider.requestImage(0, 0, 0); expect(Resource._Implementations.createImage).toHaveBeenCalled(); @@ -256,7 +250,7 @@ describe("Scene/TileMapServiceImageryProvider", function () { it("requestImage returns a promise for an image and loads it for cross-origin use", async function () { patchRequestScheduler(validSampleXmlString); const provider = await TileMapServiceImageryProvider.fromUrl( - "made/up/tms/server/" + "made/up/tms/server/", ); // check some details about the tilemapresource.xml so we know we got parsed/configured properly @@ -267,18 +261,16 @@ describe("Scene/TileMapServiceImageryProvider", function () { expect(provider.tileWidth).toEqual(256); expect(provider.tileHeight).toEqual(256); - spyOn(Resource._Implementations, "createImage").and.callFake(function ( - request, - crossOrigin, - deferred - ) { - // Just return any old image. - Resource._DefaultImplementations.createImage( - new Request({ url: "Data/Images/Red16x16.png" }), - crossOrigin, - deferred - ); - }); + spyOn(Resource._Implementations, "createImage").and.callFake( + function (request, crossOrigin, deferred) { + // Just return any old image. + Resource._DefaultImplementations.createImage( + new Request({ url: "Data/Images/Red16x16.png" }), + crossOrigin, + deferred, + ); + }, + ); const image = await provider.requestImage(0, 0, 0); expect(Resource._Implementations.createImage).toHaveBeenCalled(); @@ -288,7 +280,7 @@ describe("Scene/TileMapServiceImageryProvider", function () { it("when no credit is supplied, the provider has no logo", async function () { patchRequestScheduler(validSampleXmlString); const provider = await TileMapServiceImageryProvider.fromUrl( - "made/up/tms/server/" + "made/up/tms/server/", ); expect(provider.credit).toBeUndefined(); }); @@ -299,28 +291,30 @@ describe("Scene/TileMapServiceImageryProvider", function () { "made/up/gms/server", { credit: "Thanks to our awesome made up source of this imagery!", - } + }, ); expect(provider.credit).toBeDefined(); }); it("resource request takes a query string", async function () { /*eslint-disable no-unused-vars*/ - spyOn(Resource._Implementations, "loadWithXhr").and.callFake(function ( - url, - responseType, - method, - data, - headers, - deferred, - overrideMimeType - ) { - expect(/\?query=1$/.test(url)).toEqual(true); - deferred.reject(new RequestErrorEvent(404)); //since the TMS server doesn't exist (and doesn't need too) we can just reject here. - }); + spyOn(Resource._Implementations, "loadWithXhr").and.callFake( + function ( + url, + responseType, + method, + data, + headers, + deferred, + overrideMimeType, + ) { + expect(/\?query=1$/.test(url)).toEqual(true); + deferred.reject(new RequestErrorEvent(404)); //since the TMS server doesn't exist (and doesn't need too) we can just reject here. + }, + ); const provider = await TileMapServiceImageryProvider.fromUrl( - "http://server.invalid?query=1" + "http://server.invalid?query=1", ); }); @@ -332,7 +326,7 @@ describe("Scene/TileMapServiceImageryProvider", function () { "made/up/tms/server", { rectangle: rectangle, - } + }, ); // check some values coming from tilemapresource.xml @@ -343,36 +337,34 @@ describe("Scene/TileMapServiceImageryProvider", function () { // check our rectangle from the constructor is correctly used expect(provider.rectangle.west).toEqualEpsilon( rectangle.west, - CesiumMath.EPSILON14 + CesiumMath.EPSILON14, ); expect(provider.rectangle.east).toEqualEpsilon( rectangle.east, - CesiumMath.EPSILON14 + CesiumMath.EPSILON14, ); expect(provider.rectangle.north).toEqualEpsilon( rectangle.north, - CesiumMath.EPSILON14 + CesiumMath.EPSILON14, ); expect(provider.rectangle.south).toEqualEpsilon( rectangle.south, - CesiumMath.EPSILON14 + CesiumMath.EPSILON14, ); expect(provider.tileDiscardPolicy).toBeUndefined(); - spyOn(Resource._Implementations, "createImage").and.callFake(function ( - request, - crossOrigin, - deferred - ) { - expect(request.url).toContain("/0/0/0"); - - // Just return any old image. - Resource._DefaultImplementations.createImage( - new Request({ url: "Data/Images/Red16x16.png" }), - crossOrigin, - deferred - ); - }); + spyOn(Resource._Implementations, "createImage").and.callFake( + function (request, crossOrigin, deferred) { + expect(request.url).toContain("/0/0/0"); + + // Just return any old image. + Resource._DefaultImplementations.createImage( + new Request({ url: "Data/Images/Red16x16.png" }), + crossOrigin, + deferred, + ); + }, + ); const image = await provider.requestImage(0, 0, 0); expect(Resource._Implementations.createImage).toHaveBeenCalled(); @@ -385,7 +377,7 @@ describe("Scene/TileMapServiceImageryProvider", function () { "made/up/tms/server", { maximumLevel: 5, - } + }, ); expect(provider.maximumLevel).toEqual(5); @@ -393,9 +385,8 @@ describe("Scene/TileMapServiceImageryProvider", function () { it("raises error event when image cannot be loaded", async function () { patchRequestScheduler(validSampleXmlString); - const provider = await TileMapServiceImageryProvider.fromUrl( - "made/up/tms/server" - ); + const provider = + await TileMapServiceImageryProvider.fromUrl("made/up/tms/server"); const layer = new ImageryLayer(provider); @@ -414,14 +405,14 @@ describe("Scene/TileMapServiceImageryProvider", function () { Resource._Implementations.createImage = function ( request, crossOrigin, - deferred + deferred, ) { if (tries === 2) { // Succeed after 2 tries Resource._DefaultImplementations.createImage( new Request({ url: "Data/Images/Red16x16.png" }), crossOrigin, - deferred + deferred, ); } else { // fail @@ -459,37 +450,36 @@ describe("Scene/TileMapServiceImageryProvider", function () { " </TileSets>" + "</TileMap>"; patchRequestScheduler(xmlString); - const provider = await TileMapServiceImageryProvider.fromUrl( - "made/up/tms/server" - ); + const provider = + await TileMapServiceImageryProvider.fromUrl("made/up/tms/server"); expect(provider.rectangle.west).toEqualEpsilon( CesiumMath.toRadians(-180.0), - CesiumMath.EPSILON14 + CesiumMath.EPSILON14, ); expect(provider.rectangle.west).toBeGreaterThanOrEqual( - provider.tilingScheme.rectangle.west + provider.tilingScheme.rectangle.west, ); expect(provider.rectangle.east).toEqualEpsilon( CesiumMath.toRadians(180.0), - CesiumMath.EPSILON14 + CesiumMath.EPSILON14, ); expect(provider.rectangle.east).toBeLessThanOrEqual( - provider.tilingScheme.rectangle.east + provider.tilingScheme.rectangle.east, ); expect(provider.rectangle.south).toEqualEpsilon( -WebMercatorProjection.MaximumLatitude, - CesiumMath.EPSILON14 + CesiumMath.EPSILON14, ); expect(provider.rectangle.south).toBeGreaterThanOrEqual( - provider.tilingScheme.rectangle.south + provider.tilingScheme.rectangle.south, ); expect(provider.rectangle.north).toEqualEpsilon( WebMercatorProjection.MaximumLatitude, - CesiumMath.EPSILON14 + CesiumMath.EPSILON14, ); expect(provider.rectangle.north).toBeLessThanOrEqual( - provider.tilingScheme.rectangle.north + provider.tilingScheme.rectangle.north, ); }); @@ -509,9 +499,8 @@ describe("Scene/TileMapServiceImageryProvider", function () { "</TileMap>"; patchRequestScheduler(xmlString); - const provider = await TileMapServiceImageryProvider.fromUrl( - "made/up/tms/server" - ); + const provider = + await TileMapServiceImageryProvider.fromUrl("made/up/tms/server"); expect(provider.maximumLevel).toBe(8); expect(provider.minimumLevel).toBe(7); @@ -533,9 +522,8 @@ describe("Scene/TileMapServiceImageryProvider", function () { "</TileMap>"; patchRequestScheduler(xmlString); - const provider = await TileMapServiceImageryProvider.fromUrl( - "made/up/tms/server" - ); + const provider = + await TileMapServiceImageryProvider.fromUrl("made/up/tms/server"); expect(provider.maximumLevel).toBe(8); expect(provider.minimumLevel).toBe(0); @@ -557,9 +545,8 @@ describe("Scene/TileMapServiceImageryProvider", function () { "</Tilemap>"; patchRequestScheduler(xmlString); - const provider = await TileMapServiceImageryProvider.fromUrl( - "made/up/tms/server" - ); + const provider = + await TileMapServiceImageryProvider.fromUrl("made/up/tms/server"); expect(provider.maximumLevel).toBe(8); expect(provider.minimumLevel).toBe(7); @@ -581,28 +568,27 @@ describe("Scene/TileMapServiceImageryProvider", function () { "</TileMap>"; patchRequestScheduler(xmlString); - const provider = await TileMapServiceImageryProvider.fromUrl( - "made/up/tms/server" - ); + const provider = + await TileMapServiceImageryProvider.fromUrl("made/up/tms/server"); expect(provider.tilingScheme).toBeInstanceOf(WebMercatorTilingScheme); expect(provider.tilingScheme.projection).toBeInstanceOf( - WebMercatorProjection + WebMercatorProjection, ); const projection = provider.tilingScheme.projection; const expectedSW = projection.unproject( - new Cartesian2(-11877789.667642293, 1707163.7595205167) + new Cartesian2(-11877789.667642293, 1707163.7595205167), ); const expectedNE = projection.unproject( - new Cartesian2(-4696205.4540757351, 7952627.0736533012) + new Cartesian2(-4696205.4540757351, 7952627.0736533012), ); expect(provider.rectangle.west).toEqual(expectedSW.longitude); expect(provider.rectangle.south).toEqual(expectedSW.latitude); expect(provider.rectangle.east).toBeCloseTo( expectedNE.longitude, - CesiumMath.EPSILON14 + CesiumMath.EPSILON14, ); expect(provider.rectangle.north).toEqual(expectedNE.latitude); }); @@ -623,13 +609,12 @@ describe("Scene/TileMapServiceImageryProvider", function () { "</TileMap>"; patchRequestScheduler(xmlString); - const provider = await TileMapServiceImageryProvider.fromUrl( - "made/up/tms/server" - ); + const provider = + await TileMapServiceImageryProvider.fromUrl("made/up/tms/server"); expect(provider.tilingScheme).toBeInstanceOf(GeographicTilingScheme); expect(provider.tilingScheme.projection).toBeInstanceOf( - GeographicProjection + GeographicProjection, ); const expectedSW = Cartographic.fromDegrees(-123.0, -10.0); @@ -637,12 +622,12 @@ describe("Scene/TileMapServiceImageryProvider", function () { expect(provider.rectangle.west).toBeCloseTo( expectedSW.longitude, - CesiumMath.EPSILON14 + CesiumMath.EPSILON14, ); expect(provider.rectangle.south).toEqual(expectedSW.latitude); expect(provider.rectangle.east).toBeCloseTo( expectedNE.longitude, - CesiumMath.EPSILON14 + CesiumMath.EPSILON14, ); expect(provider.rectangle.north).toEqual(expectedNE.latitude); }); @@ -667,12 +652,12 @@ describe("Scene/TileMapServiceImageryProvider", function () { "made/up/tms/server", { flipXY: true, - } + }, ); expect(provider.tilingScheme).toBeInstanceOf(WebMercatorTilingScheme); expect(provider.tilingScheme.projection).toBeInstanceOf( - WebMercatorProjection + WebMercatorProjection, ); const expectedSW = Cartographic.fromDegrees(-123.0, -10.0); @@ -680,12 +665,12 @@ describe("Scene/TileMapServiceImageryProvider", function () { expect(provider.rectangle.west).toBeCloseTo( expectedSW.longitude, - CesiumMath.EPSILON14 + CesiumMath.EPSILON14, ); expect(provider.rectangle.south).toEqual(expectedSW.latitude); expect(provider.rectangle.east).toBeCloseTo( expectedNE.longitude, - CesiumMath.EPSILON14 + CesiumMath.EPSILON14, ); expect(provider.rectangle.north).toEqual(expectedNE.latitude); }); @@ -710,12 +695,12 @@ describe("Scene/TileMapServiceImageryProvider", function () { "made/up/tms/server", { flipXY: true, - } + }, ); expect(provider.tilingScheme).toBeInstanceOf(GeographicTilingScheme); expect(provider.tilingScheme.projection).toBeInstanceOf( - GeographicProjection + GeographicProjection, ); const expectedSW = Cartographic.fromDegrees(-123.0, -10.0); @@ -723,12 +708,12 @@ describe("Scene/TileMapServiceImageryProvider", function () { expect(provider.rectangle.west).toBeCloseTo( expectedSW.longitude, - CesiumMath.EPSILON14 + CesiumMath.EPSILON14, ); expect(provider.rectangle.south).toEqual(expectedSW.latitude); expect(provider.rectangle.east).toBeCloseTo( expectedNE.longitude, - CesiumMath.EPSILON14 + CesiumMath.EPSILON14, ); expect(provider.rectangle.north).toEqual(expectedNE.latitude); }); @@ -739,7 +724,7 @@ describe("Scene/TileMapServiceImageryProvider", function () { "made/up/tms/server", { minimumLevel: 10, - } + }, ); // we expect that our minimum detail level was forced to 0, even though we requested 10. @@ -761,9 +746,9 @@ describe("Scene/TileMapServiceImageryProvider", function () { CesiumMath.toRadians(131.020889), CesiumMath.toRadians(-25.35473), CesiumMath.toRadians(131.054363), - CesiumMath.toRadians(-25.335803) + CesiumMath.toRadians(-25.335803), ), - } + }, ); // we expect that our minimum detail level remains at 12, which is quite high, but that's okay diff --git a/packages/engine/Specs/Scene/TileMetadataSpec.js b/packages/engine/Specs/Scene/TileMetadataSpec.js index ccfd5cfae0cb..249e7de0419c 100644 --- a/packages/engine/Specs/Scene/TileMetadataSpec.js +++ b/packages/engine/Specs/Scene/TileMetadataSpec.js @@ -144,31 +144,25 @@ describe("Scene/TileMetadata", function () { it("getPropertyBySemantic returns undefined when there's no property with the given semantic", function () { expect( - tileMetadata.getPropertyBySemantic("HORIZON_OCCLUSION_POINT") + tileMetadata.getPropertyBySemantic("HORIZON_OCCLUSION_POINT"), ).not.toBeDefined(); }); it("getPropertyBySemantic returns the property value", function () { expect(tileMetadata.getPropertyBySemantic("COLOR")).toEqual([ - 1.0, - 0.5, - 0.0, + 1.0, 0.5, 0.0, ]); }); it("setPropertyBySemantic sets property value", function () { expect(tileMetadata.getPropertyBySemantic("COLOR")).toEqual([ - 1.0, - 0.5, - 0.0, + 1.0, 0.5, 0.0, ]); expect(tileMetadata.setPropertyBySemantic("COLOR", [0.0, 0.0, 0.0])).toBe( - true + true, ); expect(tileMetadata.getPropertyBySemantic("COLOR")).toEqual([ - 0.0, - 0.0, - 0.0, + 0.0, 0.0, 0.0, ]); }); diff --git a/packages/engine/Specs/Scene/TileOrientedBoundingBoxSpec.js b/packages/engine/Specs/Scene/TileOrientedBoundingBoxSpec.js index 91ad1dbfc720..463cb2548489 100644 --- a/packages/engine/Specs/Scene/TileOrientedBoundingBoxSpec.js +++ b/packages/engine/Specs/Scene/TileOrientedBoundingBoxSpec.js @@ -14,7 +14,7 @@ describe("Scene/TileOrientedBoundingBox", function () { const center = new Cartesian3(0.0, 0.0, 0.0); const halfAxes = Matrix3.fromScale( new Cartesian3(0.5, 0.5, 0.5), - new Matrix3() + new Matrix3(), ); const tileBoundingVolume = new TileOrientedBoundingBox(center, halfAxes); @@ -62,7 +62,7 @@ describe("Scene/TileOrientedBoundingBox", function () { expect(tileBoundingVolume.distanceToCamera(frameState)).not.toEqual(0.0); frameState.camera.position = new Cartesian3(100.5, 100.5, 100.5); expect(tileBoundingVolume.distanceToCamera(frameState)).toEqual( - Math.sqrt(30000.0) + Math.sqrt(30000.0), ); }); @@ -70,11 +70,11 @@ describe("Scene/TileOrientedBoundingBox", function () { frameState.camera.position = new Cartesian3( 2170456.713380141, -36351235.19646463, - 28403328.27058654 + 28403328.27058654, ); expect(tileBoundingVolume.distanceToCamera(frameState)).toEqualEpsilon( 46183029.05370139, - CesiumMath.EPSILON6 + CesiumMath.EPSILON6, ); }); @@ -87,15 +87,15 @@ describe("Scene/TileOrientedBoundingBox", function () { it("intersects plane", function () { let plane = new Plane(Cartesian3.UNIT_X, 0.0); expect(tileBoundingVolume.intersectPlane(plane)).toEqual( - Intersect.INTERSECTING + Intersect.INTERSECTING, ); plane = new Plane(Cartesian3.UNIT_X, 0.5 - CesiumMath.EPSILON6); expect(tileBoundingVolume.intersectPlane(plane)).toEqual( - Intersect.INTERSECTING + Intersect.INTERSECTING, ); plane = new Plane(Cartesian3.UNIT_X, -0.5 + CesiumMath.EPSILON6); expect(tileBoundingVolume.intersectPlane(plane)).toEqual( - Intersect.INTERSECTING + Intersect.INTERSECTING, ); }); diff --git a/packages/engine/Specs/Scene/Tileset3DTileContentSpec.js b/packages/engine/Specs/Scene/Tileset3DTileContentSpec.js index f161f7dbe494..4f3ac5e47abe 100644 --- a/packages/engine/Specs/Scene/Tileset3DTileContentSpec.js +++ b/packages/engine/Specs/Scene/Tileset3DTileContentSpec.js @@ -38,7 +38,7 @@ describe( it("becomes ready", async function () { const tileset = await Cesium3DTilesTester.loadTileset( scene, - tilesetOfTilesetsUrl + tilesetOfTilesetsUrl, ); expect(tileset.root.contentReady).toBeTrue(); expect(tileset.root.content).toBeDefined(); @@ -66,7 +66,7 @@ describe( expect(content.batchTable).toBeUndefined(); expect(content.hasProperty(0, "name")).toBe(false); expect(content.getFeature(0)).toBeUndefined(); - } + }, ); }); @@ -132,7 +132,7 @@ describe( it("assigns group metadata", function () { return Cesium3DTilesTester.loadTileset( scene, - tilesetOfTilesetsUrl + tilesetOfTilesetsUrl, ).then(function (tileset) { const content = tileset.root.content; content.group = new Cesium3DContentGroup({ metadata: groupMetadata }); @@ -143,7 +143,7 @@ describe( it("assigns metadata", function () { return Cesium3DTilesTester.loadTileset( scene, - tilesetOfTilesetsUrl + tilesetOfTilesetsUrl, ).then(function (tileset) { const content = tileset.root.content; content.metadata = contentMetadata; @@ -152,5 +152,5 @@ describe( }); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/TilesetMetadataSpec.js b/packages/engine/Specs/Scene/TilesetMetadataSpec.js index 6fdfdd92cb55..ad164a4c3937 100644 --- a/packages/engine/Specs/Scene/TilesetMetadataSpec.js +++ b/packages/engine/Specs/Scene/TilesetMetadataSpec.js @@ -48,7 +48,7 @@ describe("Scene/TilesetMetadata", function () { expect(tilesetMetadata.extras).toBe(extras); expect(tilesetMetadata.extensions).toBe(extensions); expect(tilesetMetadata.getProperty("neighborhoods")).toEqual( - properties.neighborhoods + properties.neighborhoods, ); }); diff --git a/packages/engine/Specs/Scene/TimeDynamicImagerySpec.js b/packages/engine/Specs/Scene/TimeDynamicImagerySpec.js index 08e08d9a34ef..96697a41448e 100644 --- a/packages/engine/Specs/Scene/TimeDynamicImagerySpec.js +++ b/packages/engine/Specs/Scene/TimeDynamicImagerySpec.js @@ -84,7 +84,7 @@ describe("Scene/TimeDynamicImagery", function () { expect(timeDynamicImagery._clock).toBe(options.clock); expect(timeDynamicImagery._times).toBe(options.times); expect(timeDynamicImagery._requestImageFunction).toBe( - options.requestImageFunction + options.requestImageFunction, ); expect(timeDynamicImagery._reloadFunction).toBe(options.reloadFunction); expect(timeDynamicImagery._currentIntervalIndex).toEqual(0); @@ -159,7 +159,7 @@ describe("Scene/TimeDynamicImagery", function () { 1, 2, request, - times.get(1) + times.get(1), ); expect(timeDynamicImagery._tileCache[1]["0-1-2"]).toBeDefined(); expect(options.reloadFunction).not.toHaveBeenCalled(); @@ -191,7 +191,7 @@ describe("Scene/TimeDynamicImagery", function () { 1, 2, request, - times.get(1) + times.get(1), ); expect(timeDynamicImagery._tileCache[1]["0-1-2"]).toBeDefined(); expect(options.reloadFunction).not.toHaveBeenCalled(); @@ -226,10 +226,10 @@ describe("Scene/TimeDynamicImagery", function () { } expect(timeDynamicImagery._tilesRequestedForInterval.length).toEqual( - count + count, ); expect( - timeDynamicImagery._tilesRequestedForInterval[count - 1].key + timeDynamicImagery._tilesRequestedForInterval[count - 1].key, ).toEqual(`${x}-${y}-${level}`); } } diff --git a/packages/engine/Specs/Scene/TimeDynamicPointCloudSpec.js b/packages/engine/Specs/Scene/TimeDynamicPointCloudSpec.js index e7861ac54faa..d43be3ed576e 100644 --- a/packages/engine/Specs/Scene/TimeDynamicPointCloudSpec.js +++ b/packages/engine/Specs/Scene/TimeDynamicPointCloudSpec.js @@ -33,7 +33,7 @@ describe( const center = new Cartesian3( 1215012.8828876738, -4736313.051199594, - 4081605.22126042 + 4081605.22126042, ); const clock = new Clock({ @@ -52,94 +52,34 @@ describe( const transforms = [ Matrix4.fromColumnMajorArray([ - 0.968635634376879, - 0.24848542777253735, - 0, - 0, - -0.15986460794399626, - 0.6231776137472074, - 0.7655670897127491, - 0, - 0.190232265775849, - -0.7415555636019701, - 0.6433560687121489, - 0, - 1215012.8828876738, - -4736313.051199594, - 4081605.22126042, - 1, + 0.968635634376879, 0.24848542777253735, 0, 0, -0.15986460794399626, + 0.6231776137472074, 0.7655670897127491, 0, 0.190232265775849, + -0.7415555636019701, 0.6433560687121489, 0, 1215012.8828876738, + -4736313.051199594, 4081605.22126042, 1, ]), Matrix4.fromColumnMajorArray([ - 0.968634888916237, - 0.24848833367832227, - 0, - 0, - -0.1598664774761181, - 0.6231771341505793, - 0.7655670897127493, - 0, - 0.19023449044168372, - -0.7415549929018358, - 0.6433560687121489, - 0, - 1215027.0918213597, - -4736309.406139632, - 4081605.22126042, - 1, + 0.968634888916237, 0.24848833367832227, 0, 0, -0.1598664774761181, + 0.6231771341505793, 0.7655670897127493, 0, 0.19023449044168372, + -0.7415549929018358, 0.6433560687121489, 0, 1215027.0918213597, + -4736309.406139632, 4081605.22126042, 1, ]), Matrix4.fromColumnMajorArray([ - 0.9686341434468771, - 0.24849123958187078, - 0, - 0, - -0.1598683470068011, - 0.6231766545483426, - 0.7655670897127493, - 0, - 0.19023671510580634, - -0.7415544221950274, - 0.6433560687121489, - 0, - 1215041.3007441103, - -4736305.761037043, - 4081605.22126042, - 1, + 0.9686341434468771, 0.24849123958187078, 0, 0, -0.1598683470068011, + 0.6231766545483426, 0.7655670897127493, 0, 0.19023671510580634, + -0.7415544221950274, 0.6433560687121489, 0, 1215041.3007441103, + -4736305.761037043, 4081605.22126042, 1, ]), Matrix4.fromColumnMajorArray([ - 0.9686333979687994, - 0.24849414548318288, - 0, - 0, - -0.15987021653604533, - 0.6231761749404972, - 0.7655670897127491, - 0, - 0.19023893976821685, - -0.7415538514815451, - 0.6433560687121489, - 0, - 1215055.5096559257, - -4736302.115891827, - 4081605.22126042, - 1, + 0.9686333979687994, 0.24849414548318288, 0, 0, -0.15987021653604533, + 0.6231761749404972, 0.7655670897127491, 0, 0.19023893976821685, + -0.7415538514815451, 0.6433560687121489, 0, 1215055.5096559257, + -4736302.115891827, 4081605.22126042, 1, ]), Matrix4.fromColumnMajorArray([ - 0.9686326524820043, - 0.2484970513822586, - 0, - 0, - -0.15987208606385075, - 0.6231756953270434, - 0.7655670897127492, - 0, - 0.19024116442891523, - -0.7415532807613887, - 0.6433560687121489, - 0, - 1215069.7185568055, - -4736298.470703985, - 4081605.22126042, - 1, + 0.9686326524820043, 0.2484970513822586, 0, 0, -0.15987208606385075, + 0.6231756953270434, 0.7655670897127492, 0, 0.19024116442891523, + -0.7415532807613887, 0.6433560687121489, 0, 1215069.7185568055, + -4736298.470703985, 4081605.22126042, 1, ]), ]; @@ -321,7 +261,7 @@ describe( const boundingSphereFrame1 = pointCloud.boundingSphere; expect(boundingSphereFrame1).toBeDefined(); expect( - BoundingSphere.equals(boundingSphereFrame0, boundingSphereFrame1) + BoundingSphere.equals(boundingSphereFrame0, boundingSphereFrame1), ).toBe(false); }); }); @@ -376,7 +316,7 @@ describe( const frames = pointCloud._frames; const framesLength = frames.length; expect(pointCloud.totalMemoryUsageInBytes).toBe( - singleFrameMemoryUsage * framesLength + singleFrameMemoryUsage * framesLength, ); pointCloud.maximumMemoryUsage = 0; @@ -398,7 +338,7 @@ describe( // The loaded frame is the only one loaded return loadFrame(pointCloud, 1).then(function () { expect(pointCloud.totalMemoryUsageInBytes).toBe( - singleFrameMemoryUsage + singleFrameMemoryUsage, ); expect(frames[0]).toBeUndefined(); expect(frames[1].ready).toBe(true); @@ -493,7 +433,7 @@ describe( it("sets clipping planes", function () { const modelMatrix = new Transforms.headingPitchRollToFixedFrame( center, - new HeadingPitchRoll(0, 0, 0) + new HeadingPitchRoll(0, 0, 0), ); const clippingPlanesX = new ClippingPlaneCollection({ modelMatrix: modelMatrix, @@ -600,7 +540,7 @@ describe( clock.currentTime = JulianDate.addSeconds( dates[0], -10.0, - new JulianDate() + new JulianDate(), ); scene.renderForSpecs(); expect(scene.frameState.commandList.length).toBe(0); @@ -612,7 +552,7 @@ describe( clock.currentTime = JulianDate.addSeconds( dates[5], 10.0, - new JulianDate() + new JulianDate(), ); scene.renderForSpecs(); expect(scene.frameState.commandList.length).toBe(0); @@ -773,23 +713,25 @@ describe( it("frame failed event is raised from request failure", function () { const pointCloud = createTimeDynamicPointCloud(); let frameRejectedCount = 0; - spyOn(Resource._Implementations, "loadWithXhr").and.callFake(function ( - request, - responseType, - method, - data, - headers, - deferred, - overrideMimeType - ) { - if (request.toString().includes("PointCloudTimeDynamic")) { - deferred.reject("404"); - // Allow the promise a frame to resolve - deferred.promise.catch(function () { - frameRejectedCount++; - }); - } - }); + spyOn(Resource._Implementations, "loadWithXhr").and.callFake( + function ( + request, + responseType, + method, + data, + headers, + deferred, + overrideMimeType, + ) { + if (request.toString().includes("PointCloudTimeDynamic")) { + deferred.reject("404"); + // Allow the promise a frame to resolve + deferred.promise.catch(function () { + frameRejectedCount++; + }); + } + }, + ); const spyUpdate = jasmine.createSpy("listener"); pointCloud.frameFailed.addEventListener(spyUpdate); @@ -855,7 +797,7 @@ describe( clock.currentTime = JulianDate.addSeconds( dates[0], -10.0, - new JulianDate() + new JulianDate(), ); scene.renderForSpecs(); expect(spyFrameChanged.calls.count()).toBe(6); @@ -878,5 +820,5 @@ describe( }); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/TranslucentTileClassificationSpec.js b/packages/engine/Specs/Scene/TranslucentTileClassificationSpec.js index c10b5048d032..ea6e62ce4e4a 100644 --- a/packages/engine/Specs/Scene/TranslucentTileClassificationSpec.js +++ b/packages/engine/Specs/Scene/TranslucentTileClassificationSpec.js @@ -82,7 +82,8 @@ describe( for (let i = startLength; i < commandList.length; ++i) { const command = commandList[i]; command.pass = this._pass; - command.depthForTranslucentClassification = this._depthForTranslucentClassification; + command.depthForTranslucentClassification = + this._depthForTranslucentClassification; this.commands.push(command); } }; @@ -118,7 +119,7 @@ describe( }), attributes: { color: ColorGeometryInstanceAttribute.fromColor( - new Color(0.0, 0.0, 1.0, 0.5) + new Color(0.0, 0.0, 1.0, 0.5), ), }, }), @@ -149,7 +150,7 @@ describe( groundPolylinePrimitive = new SpecPrimitive( primitive, - Pass.CESIUM_3D_TILE_CLASSIFICATION + Pass.CESIUM_3D_TILE_CLASSIFICATION, ); scene.groundPrimitives.add(groundPolylinePrimitive); }); @@ -187,37 +188,37 @@ describe( function expectResources(translucentTileClassification, toBeDefined) { expect( defined( - translucentTileClassification._drawClassificationFBO.framebuffer - ) + translucentTileClassification._drawClassificationFBO.framebuffer, + ), ).toBe(toBeDefined); expect(defined(translucentTileClassification._packFBO.framebuffer)).toBe( - toBeDefined + toBeDefined, ); expect( - defined(translucentTileClassification._opaqueDepthStencilTexture) + defined(translucentTileClassification._opaqueDepthStencilTexture), ).toBe(toBeDefined); expect( defined( - translucentTileClassification._drawClassificationFBO.getColorTexture() - ) + translucentTileClassification._drawClassificationFBO.getColorTexture(), + ), ).toBe(toBeDefined); expect( - defined(translucentTileClassification._translucentDepthStencilTexture) + defined(translucentTileClassification._translucentDepthStencilTexture), ).toBe(toBeDefined); expect( - defined(translucentTileClassification._packFBO.getColorTexture()) + defined(translucentTileClassification._packFBO.getColorTexture()), ).toBe(toBeDefined); expect(defined(translucentTileClassification._packDepthCommand)).toBe( - toBeDefined + toBeDefined, ); expect(defined(translucentTileClassification._accumulateCommand)).toBe( - toBeDefined + toBeDefined, ); expect(defined(translucentTileClassification._compositeCommand)).toBe( - toBeDefined + toBeDefined, ); expect(defined(translucentTileClassification._copyCommand)).toBe( - toBeDefined + toBeDefined, ); } @@ -233,7 +234,7 @@ describe( executeCommand, passState, translucentPrimitive.commands, - undefined + undefined, ); expectResources(translucentTileClassification, false); @@ -243,7 +244,7 @@ describe( it("creates resources on demand", function () { const translucentTileClassification = new TranslucentTileClassification( - context + context, ); if (!translucentTileClassification.isSupported()) { return; // don't fail because of lack of support @@ -258,7 +259,7 @@ describe( executeCommand, passState, [], - globeDepthFramebuffer.depthStencilTexture + globeDepthFramebuffer.depthStencilTexture, ); expectResources(translucentTileClassification, false); @@ -268,7 +269,7 @@ describe( executeCommand, passState, translucentPrimitive.commands, - globeDepthFramebuffer.depthStencilTexture + globeDepthFramebuffer.depthStencilTexture, ); expectResources(translucentTileClassification, true); @@ -288,7 +289,7 @@ describe( it("draws translucent commands into a buffer for depth", function () { const translucentTileClassification = new TranslucentTileClassification( - context + context, ); if (!translucentTileClassification.isSupported()) { return; // don't fail because of lack of support @@ -302,7 +303,7 @@ describe( executeCommand, passState, translucentPrimitive.commands, - globeDepthFramebuffer.depthStencilTexture + globeDepthFramebuffer.depthStencilTexture, ); expect(translucentTileClassification.hasTranslucentDepth).toBe(true); @@ -315,7 +316,7 @@ describe( it("draws classification commands into a buffer", function () { const translucentTileClassification = new TranslucentTileClassification( - context + context, ); if (!translucentTileClassification.isSupported()) { return; // don't fail because of lack of support @@ -327,7 +328,7 @@ describe( executeCommand, passState, translucentPrimitive.commands, - globeDepthFramebuffer.depthStencilTexture + globeDepthFramebuffer.depthStencilTexture, ); const drawClassificationFBO = @@ -346,7 +347,7 @@ describe( scene, executeCommand, passState, - frustumCommands + frustumCommands, ); const postClassifyPixels = readPixels(drawClassificationFBO); @@ -357,7 +358,7 @@ describe( it("draws classification commands into a separate accumulation buffer for multifrustum", function () { const translucentTileClassification = new TranslucentTileClassification( - context + context, ); if (!translucentTileClassification.isSupported()) { return; // don't fail because of lack of support @@ -369,7 +370,7 @@ describe( executeCommand, passState, translucentPrimitive.commands, - globeDepthFramebuffer.depthStencilTexture + globeDepthFramebuffer.depthStencilTexture, ); const accumulationFBO = @@ -389,7 +390,7 @@ describe( scene, executeCommand, passState, - frustumCommands + frustumCommands, ); expect(readPixels(accumulationFBO)).toEqual([0, 0, 0, 0]); @@ -399,13 +400,13 @@ describe( executeCommand, passState, translucentPrimitive.commands, - globeDepthFramebuffer.depthStencilTexture + globeDepthFramebuffer.depthStencilTexture, ); translucentTileClassification.executeClassificationCommands( scene, executeCommand, passState, - frustumCommands + frustumCommands, ); const secondFrustumAccumulation = accumulationFBO; @@ -427,7 +428,7 @@ describe( it("does not draw classification commands if there is no translucent depth", function () { const translucentTileClassification = new TranslucentTileClassification( - context + context, ); if (!translucentTileClassification.isSupported()) { return; // don't fail because of lack of support @@ -442,7 +443,7 @@ describe( executeCommand, passState, [], - globeDepthFramebuffer.depthStencilTexture + globeDepthFramebuffer.depthStencilTexture, ); const preClassifyPixels = readPixels(drawClassificationFBO); @@ -459,7 +460,7 @@ describe( scene, executeCommand, passState, - frustumCommands + frustumCommands, ); const postClassifyPixels = readPixels(drawClassificationFBO); @@ -470,7 +471,7 @@ describe( it("composites classification into a buffer", function () { const translucentTileClassification = new TranslucentTileClassification( - context + context, ); if (!translucentTileClassification.isSupported()) { return; // don't fail because of lack of support @@ -496,7 +497,7 @@ describe( executeCommand, passState, translucentPrimitive.commands, - globeDepthFramebuffer.depthStencilTexture + globeDepthFramebuffer.depthStencilTexture, ); const frustumCommands = { @@ -511,12 +512,12 @@ describe( scene, executeCommand, passState, - frustumCommands + frustumCommands, ); const preCompositePixels = readPixels(targetColorFBO); const pixelsToComposite = readPixels( - translucentTileClassification._drawClassificationFBO.framebuffer + translucentTileClassification._drawClassificationFBO.framebuffer, ); const framebuffer = passState.framebuffer; @@ -543,7 +544,7 @@ describe( it("composites from an accumulation texture when there are multiple frustums", function () { const translucentTileClassification = new TranslucentTileClassification( - context + context, ); if (!translucentTileClassification.isSupported()) { return; // don't fail because of lack of support @@ -577,7 +578,7 @@ describe( executeCommand, passState, translucentPrimitive.commands, - globeDepthFramebuffer.depthStencilTexture + globeDepthFramebuffer.depthStencilTexture, ); const frustumCommands = { @@ -594,7 +595,7 @@ describe( scene, executeCommand, passState, - frustumCommands + frustumCommands, ); // Second Frustum @@ -603,14 +604,14 @@ describe( executeCommand, passState, translucentPrimitive.commands, - globeDepthFramebuffer.depthStencilTexture + globeDepthFramebuffer.depthStencilTexture, ); translucentTileClassification.executeClassificationCommands( scene, executeCommand, passState, - frustumCommands + frustumCommands, ); const framebuffer = passState.framebuffer; @@ -636,7 +637,7 @@ describe( it("does not composite classification if there is no translucent depth", function () { const translucentTileClassification = new TranslucentTileClassification( - context + context, ); if (!translucentTileClassification.isSupported()) { return; // don't fail because of lack of support @@ -662,7 +663,7 @@ describe( executeCommand, passState, [], - globeDepthFramebuffer.depthStencilTexture + globeDepthFramebuffer.depthStencilTexture, ); const frustumCommands = { @@ -677,7 +678,7 @@ describe( scene, executeCommand, passState, - frustumCommands + frustumCommands, ); const preCompositePixels = readPixels(targetColorFBO); @@ -696,7 +697,7 @@ describe( it("clears the classification buffer", function () { const translucentTileClassification = new TranslucentTileClassification( - context + context, ); if (!translucentTileClassification.isSupported()) { return; // don't fail because of lack of support @@ -708,7 +709,7 @@ describe( executeCommand, passState, translucentPrimitive.commands, - globeDepthFramebuffer.depthStencilTexture + globeDepthFramebuffer.depthStencilTexture, ); const drawClassificationFBO = @@ -727,7 +728,7 @@ describe( scene, executeCommand, passState, - frustumCommands + frustumCommands, ); const postClassifyPixels = readPixels(drawClassificationFBO); @@ -744,7 +745,7 @@ describe( it("does not clear the classification buffer if there is no translucent depth", function () { const translucentTileClassification = new TranslucentTileClassification( - context + context, ); if (!translucentTileClassification.isSupported()) { return; // don't fail because of lack of support @@ -755,10 +756,10 @@ describe( translucentTileClassification.execute(scene, passState); expect( - translucentTileClassification._clearColorCommand.execute + translucentTileClassification._clearColorCommand.execute, ).not.toHaveBeenCalled(); translucentTileClassification.destroy(); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/TweenCollectionSpec.js b/packages/engine/Specs/Scene/TweenCollectionSpec.js index db639dbcec62..57850a44648d 100644 --- a/packages/engine/Specs/Scene/TweenCollectionSpec.js +++ b/packages/engine/Specs/Scene/TweenCollectionSpec.js @@ -401,5 +401,5 @@ describe( }).toThrowDeveloperError(); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/UrlTemplateImageryProviderSpec.js b/packages/engine/Specs/Scene/UrlTemplateImageryProviderSpec.js index a7e6e2a3761b..1e52aa3b70ef 100644 --- a/packages/engine/Specs/Scene/UrlTemplateImageryProviderSpec.js +++ b/packages/engine/Specs/Scene/UrlTemplateImageryProviderSpec.js @@ -60,18 +60,16 @@ describe("Scene/UrlTemplateImageryProvider", function () { expect(provider.tilingScheme).toBeInstanceOf(WebMercatorTilingScheme); expect(provider.rectangle).toEqual(new WebMercatorTilingScheme().rectangle); - spyOn(Resource._Implementations, "createImage").and.callFake(function ( - request, - crossOrigin, - deferred - ) { - // Just return any old image. - Resource._DefaultImplementations.createImage( - new Request({ url: "Data/Images/Red16x16.png" }), - crossOrigin, - deferred - ); - }); + spyOn(Resource._Implementations, "createImage").and.callFake( + function (request, crossOrigin, deferred) { + // Just return any old image. + Resource._DefaultImplementations.createImage( + new Request({ url: "Data/Images/Red16x16.png" }), + crossOrigin, + deferred, + ); + }, + ); return provider.requestImage(0, 0, 0).then(function (image) { expect(Resource._Implementations.createImage).toHaveBeenCalled(); @@ -109,20 +107,18 @@ describe("Scene/UrlTemplateImageryProvider", function () { expect(provider.rectangle).toEqualEpsilon(rectangle, CesiumMath.EPSILON14); expect(provider.tileDiscardPolicy).toBeUndefined(); - spyOn(Resource._Implementations, "createImage").and.callFake(function ( - request, - crossOrigin, - deferred - ) { - expect(request.url).toContain("/0/0/0"); + spyOn(Resource._Implementations, "createImage").and.callFake( + function (request, crossOrigin, deferred) { + expect(request.url).toContain("/0/0/0"); - // Just return any old image. - Resource._DefaultImplementations.createImage( - new Request({ url: "Data/Images/Red16x16.png" }), - crossOrigin, - deferred - ); - }); + // Just return any old image. + Resource._DefaultImplementations.createImage( + new Request({ url: "Data/Images/Red16x16.png" }), + crossOrigin, + deferred, + ); + }, + ); return provider.requestImage(0, 0, 0).then(function (image) { expect(Resource._Implementations.createImage).toHaveBeenCalled(); @@ -163,14 +159,14 @@ describe("Scene/UrlTemplateImageryProvider", function () { Resource._Implementations.createImage = function ( request, crossOrigin, - deferred + deferred, ) { if (tries === 2) { // Succeed after 2 tries Resource._DefaultImplementations.createImage( new Request({ url: "Data/Images/Red16x16.png" }), crossOrigin, - deferred + deferred, ); } else { // fail @@ -196,26 +192,23 @@ describe("Scene/UrlTemplateImageryProvider", function () { it("evaluation of pattern X Y reverseX reverseY Z reverseZ", function () { const provider = new UrlTemplateImageryProvider({ - url: - "made/up/tms/server/{z}/{reverseZ}/{reverseY}/{y}/{reverseX}/{x}.PNG", + url: "made/up/tms/server/{z}/{reverseZ}/{reverseY}/{y}/{reverseX}/{x}.PNG", tilingScheme: new GeographicTilingScheme(), maximumLevel: 6, }); - spyOn(Resource._Implementations, "createImage").and.callFake(function ( - request, - crossOrigin, - deferred - ) { - expect(request.url).toEqual("made/up/tms/server/2/3/2/1/4/3.PNG"); + spyOn(Resource._Implementations, "createImage").and.callFake( + function (request, crossOrigin, deferred) { + expect(request.url).toEqual("made/up/tms/server/2/3/2/1/4/3.PNG"); - // Just return any old image. - Resource._DefaultImplementations.createImage( - new Request({ url: "Data/Images/Red16x16.png" }), - crossOrigin, - deferred - ); - }); + // Just return any old image. + Resource._DefaultImplementations.createImage( + new Request({ url: "Data/Images/Red16x16.png" }), + crossOrigin, + deferred, + ); + }, + ); return provider.requestImage(3, 1, 2).then(function (image) { expect(Resource._Implementations.createImage).toHaveBeenCalled(); @@ -225,8 +218,7 @@ describe("Scene/UrlTemplateImageryProvider", function () { it("evaluation of schema zero padding for X Y Z as 0000", function () { const provider = new UrlTemplateImageryProvider({ - url: - "made/up/tms/server/{z}/{reverseZ}/{reverseY}/{y}/{reverseX}/{x}.PNG", + url: "made/up/tms/server/{z}/{reverseZ}/{reverseY}/{y}/{reverseX}/{x}.PNG", urlSchemeZeroPadding: { "{x}": "0000", "{y}": "0000", @@ -236,22 +228,20 @@ describe("Scene/UrlTemplateImageryProvider", function () { maximumLevel: 6, }); - spyOn(Resource._Implementations, "createImage").and.callFake(function ( - request, - crossOrigin, - deferred - ) { - expect(request.url).toEqual( - "made/up/tms/server/0002/3/2/0001/4/0003.PNG" - ); + spyOn(Resource._Implementations, "createImage").and.callFake( + function (request, crossOrigin, deferred) { + expect(request.url).toEqual( + "made/up/tms/server/0002/3/2/0001/4/0003.PNG", + ); - // Just return any old image. - Resource._DefaultImplementations.createImage( - new Request({ url: "Data/Images/Red16x16.png" }), - crossOrigin, - deferred - ); - }); + // Just return any old image. + Resource._DefaultImplementations.createImage( + new Request({ url: "Data/Images/Red16x16.png" }), + crossOrigin, + deferred, + ); + }, + ); return provider.requestImage(3, 1, 2).then(function (image) { expect(Resource._Implementations.createImage).toHaveBeenCalled(); @@ -261,8 +251,7 @@ describe("Scene/UrlTemplateImageryProvider", function () { it("evaluation of schema zero padding for reverseX reverseY reverseZ as 0000", function () { const provider = new UrlTemplateImageryProvider({ - url: - "made/up/tms/server/{z}/{reverseZ}/{reverseY}/{y}/{reverseX}/{x}.PNG", + url: "made/up/tms/server/{z}/{reverseZ}/{reverseY}/{y}/{reverseX}/{x}.PNG", urlSchemeZeroPadding: { "{reverseX}": "0000", "{reverseY}": "0000", @@ -272,22 +261,20 @@ describe("Scene/UrlTemplateImageryProvider", function () { maximumLevel: 6, }); - spyOn(Resource._Implementations, "createImage").and.callFake(function ( - request, - crossOrigin, - deferred - ) { - expect(request.url).toEqual( - "made/up/tms/server/2/0003/0002/1/0004/3.PNG" - ); + spyOn(Resource._Implementations, "createImage").and.callFake( + function (request, crossOrigin, deferred) { + expect(request.url).toEqual( + "made/up/tms/server/2/0003/0002/1/0004/3.PNG", + ); - // Just return any old image. - Resource._DefaultImplementations.createImage( - new Request({ url: "Data/Images/Red16x16.png" }), - crossOrigin, - deferred - ); - }); + // Just return any old image. + Resource._DefaultImplementations.createImage( + new Request({ url: "Data/Images/Red16x16.png" }), + crossOrigin, + deferred, + ); + }, + ); return provider.requestImage(3, 1, 2).then(function (image) { expect(Resource._Implementations.createImage).toHaveBeenCalled(); @@ -297,8 +284,7 @@ describe("Scene/UrlTemplateImageryProvider", function () { it("evaluation of schema zero padding for x y z as 0000 and large x and y", function () { const provider = new UrlTemplateImageryProvider({ - url: - "made/up/tms/server/{z}/{reverseZ}/{reverseY}/{y}/{reverseX}/{x}.PNG", + url: "made/up/tms/server/{z}/{reverseZ}/{reverseY}/{y}/{reverseX}/{x}.PNG", urlSchemeZeroPadding: { "{x}": "0000", "{y}": "0000", @@ -308,22 +294,20 @@ describe("Scene/UrlTemplateImageryProvider", function () { maximumLevel: 6, }); - spyOn(Resource._Implementations, "createImage").and.callFake(function ( - request, - crossOrigin, - deferred - ) { - expect(request.url).toEqual( - "made/up/tms/server/0005/0/21/0010/51/0012.PNG" - ); + spyOn(Resource._Implementations, "createImage").and.callFake( + function (request, crossOrigin, deferred) { + expect(request.url).toEqual( + "made/up/tms/server/0005/0/21/0010/51/0012.PNG", + ); - // Just return any old image. - Resource._DefaultImplementations.createImage( - new Request({ url: "Data/Images/Red16x16.png" }), - crossOrigin, - deferred - ); - }); + // Just return any old image. + Resource._DefaultImplementations.createImage( + new Request({ url: "Data/Images/Red16x16.png" }), + crossOrigin, + deferred, + ); + }, + ); return provider.requestImage(12, 10, 5).then(function (image) { expect(Resource._Implementations.createImage).toHaveBeenCalled(); @@ -337,20 +321,18 @@ describe("Scene/UrlTemplateImageryProvider", function () { tilingScheme: new GeographicTilingScheme(), }); - spyOn(Resource._Implementations, "createImage").and.callFake(function ( - request, - crossOrigin, - deferred - ) { - expect(request.url).toEqualEpsilon(45.0, CesiumMath.EPSILON11); + spyOn(Resource._Implementations, "createImage").and.callFake( + function (request, crossOrigin, deferred) { + expect(request.url).toEqualEpsilon(45.0, CesiumMath.EPSILON11); - // Just return any old image. - Resource._DefaultImplementations.createImage( - new Request({ url: "Data/Images/Red16x16.png" }), - crossOrigin, - deferred - ); - }); + // Just return any old image. + Resource._DefaultImplementations.createImage( + new Request({ url: "Data/Images/Red16x16.png" }), + crossOrigin, + deferred, + ); + }, + ); return provider.requestImage(3, 1, 2).then(function (image) { expect(Resource._Implementations.createImage).toHaveBeenCalled(); @@ -364,20 +346,18 @@ describe("Scene/UrlTemplateImageryProvider", function () { tilingScheme: new GeographicTilingScheme(), }); - spyOn(Resource._Implementations, "createImage").and.callFake(function ( - request, - crossOrigin, - deferred - ) { - expect(request.url).toEqualEpsilon(0.0, CesiumMath.EPSILON11); + spyOn(Resource._Implementations, "createImage").and.callFake( + function (request, crossOrigin, deferred) { + expect(request.url).toEqualEpsilon(0.0, CesiumMath.EPSILON11); - // Just return any old image. - Resource._DefaultImplementations.createImage( - new Request({ url: "Data/Images/Red16x16.png" }), - crossOrigin, - deferred - ); - }); + // Just return any old image. + Resource._DefaultImplementations.createImage( + new Request({ url: "Data/Images/Red16x16.png" }), + crossOrigin, + deferred, + ); + }, + ); return provider.requestImage(3, 1, 2).then(function (image) { expect(Resource._Implementations.createImage).toHaveBeenCalled(); @@ -391,20 +371,18 @@ describe("Scene/UrlTemplateImageryProvider", function () { tilingScheme: new GeographicTilingScheme(), }); - spyOn(Resource._Implementations, "createImage").and.callFake(function ( - request, - crossOrigin, - deferred - ) { - expect(request.url).toEqualEpsilon(0.0, CesiumMath.EPSILON11); + spyOn(Resource._Implementations, "createImage").and.callFake( + function (request, crossOrigin, deferred) { + expect(request.url).toEqualEpsilon(0.0, CesiumMath.EPSILON11); - // Just return any old image. - Resource._DefaultImplementations.createImage( - new Request({ url: "Data/Images/Red16x16.png" }), - crossOrigin, - deferred - ); - }); + // Just return any old image. + Resource._DefaultImplementations.createImage( + new Request({ url: "Data/Images/Red16x16.png" }), + crossOrigin, + deferred, + ); + }, + ); return provider.requestImage(3, 1, 2).then(function (image) { expect(Resource._Implementations.createImage).toHaveBeenCalled(); @@ -418,20 +396,18 @@ describe("Scene/UrlTemplateImageryProvider", function () { tilingScheme: new GeographicTilingScheme(), }); - spyOn(Resource._Implementations, "createImage").and.callFake(function ( - request, - crossOrigin, - deferred - ) { - expect(request.url).toEqualEpsilon(-45.0, CesiumMath.EPSILON11); + spyOn(Resource._Implementations, "createImage").and.callFake( + function (request, crossOrigin, deferred) { + expect(request.url).toEqualEpsilon(-45.0, CesiumMath.EPSILON11); - // Just return any old image. - Resource._DefaultImplementations.createImage( - new Request({ url: "Data/Images/Red16x16.png" }), - crossOrigin, - deferred - ); - }); + // Just return any old image. + Resource._DefaultImplementations.createImage( + new Request({ url: "Data/Images/Red16x16.png" }), + crossOrigin, + deferred, + ); + }, + ); return provider.requestImage(3, 1, 2).then(function (image) { expect(Resource._Implementations.createImage).toHaveBeenCalled(); @@ -445,23 +421,21 @@ describe("Scene/UrlTemplateImageryProvider", function () { tilingScheme: new WebMercatorTilingScheme(), }); - spyOn(Resource._Implementations, "createImage").and.callFake(function ( - request, - crossOrigin, - deferred - ) { - expect(request.url).toEqualEpsilon( - (Math.PI * Ellipsoid.WGS84.maximumRadius) / 2.0, - CesiumMath.EPSILON11 - ); + spyOn(Resource._Implementations, "createImage").and.callFake( + function (request, crossOrigin, deferred) { + expect(request.url).toEqualEpsilon( + (Math.PI * Ellipsoid.WGS84.maximumRadius) / 2.0, + CesiumMath.EPSILON11, + ); - // Just return any old image. - Resource._DefaultImplementations.createImage( - new Request({ url: "Data/Images/Red16x16.png" }), - crossOrigin, - deferred - ); - }); + // Just return any old image. + Resource._DefaultImplementations.createImage( + new Request({ url: "Data/Images/Red16x16.png" }), + crossOrigin, + deferred, + ); + }, + ); return provider.requestImage(3, 1, 2).then(function (image) { expect(Resource._Implementations.createImage).toHaveBeenCalled(); @@ -474,23 +448,21 @@ describe("Scene/UrlTemplateImageryProvider", function () { url: "{southProjected}", }); - spyOn(Resource._Implementations, "createImage").and.callFake(function ( - request, - crossOrigin, - deferred - ) { - expect(request.url).toEqualEpsilon( - (Math.PI * Ellipsoid.WGS84.maximumRadius) / 2.0, - CesiumMath.EPSILON11 - ); + spyOn(Resource._Implementations, "createImage").and.callFake( + function (request, crossOrigin, deferred) { + expect(request.url).toEqualEpsilon( + (Math.PI * Ellipsoid.WGS84.maximumRadius) / 2.0, + CesiumMath.EPSILON11, + ); - // Just return any old image. - Resource._DefaultImplementations.createImage( - new Request({ url: "Data/Images/Red16x16.png" }), - crossOrigin, - deferred - ); - }); + // Just return any old image. + Resource._DefaultImplementations.createImage( + new Request({ url: "Data/Images/Red16x16.png" }), + crossOrigin, + deferred, + ); + }, + ); return provider.requestImage(3, 0, 2).then(function (image) { expect(Resource._Implementations.createImage).toHaveBeenCalled(); @@ -503,23 +475,21 @@ describe("Scene/UrlTemplateImageryProvider", function () { url: "{eastProjected}", }); - spyOn(Resource._Implementations, "createImage").and.callFake(function ( - request, - crossOrigin, - deferred - ) { - expect(request.url).toEqualEpsilon( - (-Math.PI * Ellipsoid.WGS84.maximumRadius) / 2.0, - CesiumMath.EPSILON11 - ); + spyOn(Resource._Implementations, "createImage").and.callFake( + function (request, crossOrigin, deferred) { + expect(request.url).toEqualEpsilon( + (-Math.PI * Ellipsoid.WGS84.maximumRadius) / 2.0, + CesiumMath.EPSILON11, + ); - // Just return any old image. - Resource._DefaultImplementations.createImage( - new Request({ url: "Data/Images/Red16x16.png" }), - crossOrigin, - deferred - ); - }); + // Just return any old image. + Resource._DefaultImplementations.createImage( + new Request({ url: "Data/Images/Red16x16.png" }), + crossOrigin, + deferred, + ); + }, + ); return provider.requestImage(0, 1, 2).then(function (image) { expect(Resource._Implementations.createImage).toHaveBeenCalled(); @@ -532,23 +502,21 @@ describe("Scene/UrlTemplateImageryProvider", function () { url: "{westProjected}", }); - spyOn(Resource._Implementations, "createImage").and.callFake(function ( - request, - crossOrigin, - deferred - ) { - expect(request.url).toEqualEpsilon( - (-Math.PI * Ellipsoid.WGS84.maximumRadius) / 2.0, - CesiumMath.EPSILON11 - ); + spyOn(Resource._Implementations, "createImage").and.callFake( + function (request, crossOrigin, deferred) { + expect(request.url).toEqualEpsilon( + (-Math.PI * Ellipsoid.WGS84.maximumRadius) / 2.0, + CesiumMath.EPSILON11, + ); - // Just return any old image. - Resource._DefaultImplementations.createImage( - new Request({ url: "Data/Images/Red16x16.png" }), - crossOrigin, - deferred - ); - }); + // Just return any old image. + Resource._DefaultImplementations.createImage( + new Request({ url: "Data/Images/Red16x16.png" }), + crossOrigin, + deferred, + ); + }, + ); return provider.requestImage(1, 1, 2).then(function (image) { expect(Resource._Implementations.createImage).toHaveBeenCalled(); @@ -558,32 +526,31 @@ describe("Scene/UrlTemplateImageryProvider", function () { it("evaluates multiple coordinate patterns", function () { const provider = new UrlTemplateImageryProvider({ - url: - "{westDegrees} {westProjected} {southProjected} {southDegrees} {eastProjected} {eastDegrees} {northDegrees} {northProjected}", - }); + url: "{westDegrees} {westProjected} {southProjected} {southDegrees} {eastProjected} {eastDegrees} {northDegrees} {northProjected}", + }); + + spyOn(Resource._Implementations, "createImage").and.callFake( + function (request, crossOrigin, deferred) { + expect(request.url).toEqual( + `-90 ${(-Math.PI * Ellipsoid.WGS84.maximumRadius) / 2.0} ` + + `0 ` + + `0 ` + + `0 ` + + `0 ${CesiumMath.toDegrees( + WebMercatorProjection.mercatorAngleToGeodeticLatitude( + Math.PI / 2, + ), + )} ${(Math.PI * Ellipsoid.WGS84.maximumRadius) / 2.0}`, + ); - spyOn(Resource._Implementations, "createImage").and.callFake(function ( - request, - crossOrigin, - deferred - ) { - expect(request.url).toEqual( - `-90 ${(-Math.PI * Ellipsoid.WGS84.maximumRadius) / 2.0} ` + - `0 ` + - `0 ` + - `0 ` + - `0 ${CesiumMath.toDegrees( - WebMercatorProjection.mercatorAngleToGeodeticLatitude(Math.PI / 2) - )} ${(Math.PI * Ellipsoid.WGS84.maximumRadius) / 2.0}` - ); - - // Just return any old image. - Resource._DefaultImplementations.createImage( - new Request({ url: "Data/Images/Red16x16.png" }), - crossOrigin, - deferred - ); - }); + // Just return any old image. + Resource._DefaultImplementations.createImage( + new Request({ url: "Data/Images/Red16x16.png" }), + crossOrigin, + deferred, + ); + }, + ); return provider.requestImage(1, 1, 2).then(function (image) { expect(Resource._Implementations.createImage).toHaveBeenCalled(); @@ -596,20 +563,18 @@ describe("Scene/UrlTemplateImageryProvider", function () { url: "{s}", }); - spyOn(Resource._Implementations, "createImage").and.callFake(function ( - request, - crossOrigin, - deferred - ) { - expect(["a", "b", "c"].indexOf(request.url)).toBeGreaterThanOrEqual(0); + spyOn(Resource._Implementations, "createImage").and.callFake( + function (request, crossOrigin, deferred) { + expect(["a", "b", "c"].indexOf(request.url)).toBeGreaterThanOrEqual(0); - // Just return any old image. - Resource._DefaultImplementations.createImage( - new Request({ url: "Data/Images/Red16x16.png" }), - crossOrigin, - deferred - ); - }); + // Just return any old image. + Resource._DefaultImplementations.createImage( + new Request({ url: "Data/Images/Red16x16.png" }), + crossOrigin, + deferred, + ); + }, + ); return provider.requestImage(3, 1, 2).then(function (image) { expect(Resource._Implementations.createImage).toHaveBeenCalled(); @@ -623,20 +588,18 @@ describe("Scene/UrlTemplateImageryProvider", function () { subdomains: "123", }); - spyOn(Resource._Implementations, "createImage").and.callFake(function ( - request, - crossOrigin, - deferred - ) { - expect(["1", "2", "3"].indexOf(request.url)).toBeGreaterThanOrEqual(0); + spyOn(Resource._Implementations, "createImage").and.callFake( + function (request, crossOrigin, deferred) { + expect(["1", "2", "3"].indexOf(request.url)).toBeGreaterThanOrEqual(0); - // Just return any old image. - Resource._DefaultImplementations.createImage( - new Request({ url: "Data/Images/Red16x16.png" }), - crossOrigin, - deferred - ); - }); + // Just return any old image. + Resource._DefaultImplementations.createImage( + new Request({ url: "Data/Images/Red16x16.png" }), + crossOrigin, + deferred, + ); + }, + ); return provider.requestImage(3, 1, 2).then(function (image) { expect(Resource._Implementations.createImage).toHaveBeenCalled(); @@ -650,20 +613,18 @@ describe("Scene/UrlTemplateImageryProvider", function () { subdomains: ["foo", "bar"], }); - spyOn(Resource._Implementations, "createImage").and.callFake(function ( - request, - crossOrigin, - deferred - ) { - expect(["foo", "bar"].indexOf(request.url)).toBeGreaterThanOrEqual(0); + spyOn(Resource._Implementations, "createImage").and.callFake( + function (request, crossOrigin, deferred) { + expect(["foo", "bar"].indexOf(request.url)).toBeGreaterThanOrEqual(0); - // Just return any old image. - Resource._DefaultImplementations.createImage( - new Request({ url: "Data/Images/Red16x16.png" }), - crossOrigin, - deferred - ); - }); + // Just return any old image. + Resource._DefaultImplementations.createImage( + new Request({ url: "Data/Images/Red16x16.png" }), + crossOrigin, + deferred, + ); + }, + ); return provider.requestImage(3, 1, 2).then(function (image) { expect(Resource._Implementations.createImage).toHaveBeenCalled(); @@ -686,20 +647,18 @@ describe("Scene/UrlTemplateImageryProvider", function () { }, }); - spyOn(Resource._Implementations, "createImage").and.callFake(function ( - request, - crossOrigin, - deferred - ) { - expect(request.url).toEqual("made/up/tms/server/foo/bar/2/1/3.PNG"); + spyOn(Resource._Implementations, "createImage").and.callFake( + function (request, crossOrigin, deferred) { + expect(request.url).toEqual("made/up/tms/server/foo/bar/2/1/3.PNG"); - // Just return any old image. - Resource._DefaultImplementations.createImage( - new Request({ url: "Data/Images/Red16x16.png" }), - crossOrigin, - deferred - ); - }); + // Just return any old image. + Resource._DefaultImplementations.createImage( + new Request({ url: "Data/Images/Red16x16.png" }), + crossOrigin, + deferred, + ); + }, + ); return provider.requestImage(3, 1, 2).then(function (image) { expect(Resource._Implementations.createImage).toHaveBeenCalled(); diff --git a/packages/engine/Specs/Scene/Vector3DTileClampedPolylinesSpec.js b/packages/engine/Specs/Scene/Vector3DTileClampedPolylinesSpec.js index 0e6ca02f10d1..c5e071e372d2 100644 --- a/packages/engine/Specs/Scene/Vector3DTileClampedPolylinesSpec.js +++ b/packages/engine/Specs/Scene/Vector3DTileClampedPolylinesSpec.js @@ -65,9 +65,8 @@ describe( beforeEach(function () { rectangle = Rectangle.fromDegrees(-40.0, -40.0, 40.0, 40.0); - const depthpolylineColorAttribute = ColorGeometryInstanceAttribute.fromColor( - new Color(0.0, 0.0, 1.0, 1.0) - ); + const depthpolylineColorAttribute = + ColorGeometryInstanceAttribute.fromColor(new Color(0.0, 0.0, 1.0, 1.0)); const primitive = new Primitive({ geometryInstances: new GeometryInstance({ geometry: new RectangleGeometry({ @@ -98,7 +97,7 @@ describe( xit("renders clamped polylines", function () { scene.camera.lookAt( Cartesian3.fromDegrees(0.0, 0.0, 1.5), - new Cartesian3(0.0, 0.0, 1.0) + new Cartesian3(0.0, 0.0, 1.0), ); return Cesium3DTilesTester.loadTileset(scene, vectorPolylines, { classificationType: ClassificationType.TERRAIN, @@ -115,7 +114,7 @@ describe( xit("picks a clamped polyline", function () { scene.camera.lookAt( Cartesian3.fromDegrees(0.0, 0.0, 1.5), - new Cartesian3(0.0, 0.0, 1.0) + new Cartesian3(0.0, 0.0, 1.0), ); return Cesium3DTilesTester.loadTileset(scene, vectorPolylines, { classificationType: ClassificationType.TERRAIN, @@ -138,5 +137,5 @@ describe( expect(polylines.isDestroyed()).toEqual(true); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/Vector3DTileContentSpec.js b/packages/engine/Specs/Scene/Vector3DTileContentSpec.js index 4106b41aa0ed..22581023dd11 100644 --- a/packages/engine/Specs/Scene/Vector3DTileContentSpec.js +++ b/packages/engine/Specs/Scene/Vector3DTileContentSpec.js @@ -83,7 +83,7 @@ describe( } const depthColorAttribute = ColorGeometryInstanceAttribute.fromColor( - new Color(1.0, 0.0, 0.0, 1.0) + new Color(1.0, 0.0, 0.0, 1.0), ); depthColor = depthColorAttribute.value; return new Primitive({ @@ -117,25 +117,25 @@ describe( tilesetRectangle.west, center.latitude, center.longitude, - tilesetRectangle.north + tilesetRectangle.north, ); const urRect = new Rectangle( center.longitude, center.longitude, tilesetRectangle.east, - tilesetRectangle.north + tilesetRectangle.north, ); const lrRect = new Rectangle( center.longitude, tilesetRectangle.south, tilesetRectangle.east, - center.latitude + center.latitude, ); const llRect = new Rectangle( tilesetRectangle.west, tilesetRectangle.south, center.longitude, - center.latitude + center.latitude, ); return [ulRect, urRect, lrRect, llRect]; } @@ -160,14 +160,14 @@ describe( globeMockPrimitive = new MockPrimitive(globePrimitive, Pass.GLOBE); tilesetMockPrimitive = new MockPrimitive( tilesetPrimitive, - Pass.CESIUM_3D_TILE + Pass.CESIUM_3D_TILE, ); // Add the globe mock primitive to the scene. scene.primitives.add(globeMockPrimitive); scene.camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(tilesetRectangle)), - new Cartesian3(0.0, 0.0, 0.01) + new Cartesian3(0.0, 0.0, 0.01), ); }); @@ -198,30 +198,29 @@ describe( it("renders points", () => { return Cesium3DTilesTester.loadTileset( scene, - vectorTilePointsTileset + vectorTilePointsTileset, ).then((tileset) => { // Subdivide the rectangle into 4, and look at the center of each sub-rectangle. - const [ulRect, urRect, lrRect, llRect] = subdivideRectangle( - tilesetRectangle - ); + const [ulRect, urRect, lrRect, llRect] = + subdivideRectangle(tilesetRectangle); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(ulRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toRender(whitePixel); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(urRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toRender(whitePixel); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(lrRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toRender(whitePixel); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(llRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toRender(whitePixel); }); @@ -230,14 +229,13 @@ describe( it("picks points", () => { return Cesium3DTilesTester.loadTileset( scene, - vectorTilePointsTileset + vectorTilePointsTileset, ).then((tileset) => { - const [ulRect, urRect, lrRect, llRect] = subdivideRectangle( - tilesetRectangle - ); + const [ulRect, urRect, lrRect, llRect] = + subdivideRectangle(tilesetRectangle); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(ulRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toPickAndCall((result) => { expect(result).toBeDefined(); @@ -245,7 +243,7 @@ describe( }); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(urRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toPickAndCall((result) => { expect(result).toBeDefined(); @@ -253,7 +251,7 @@ describe( }); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(lrRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toPickAndCall((result) => { expect(result).toBeDefined(); @@ -261,7 +259,7 @@ describe( }); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(llRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toPickAndCall((result) => { expect(result).toBeDefined(); @@ -273,12 +271,11 @@ describe( it("styles points for show", () => { return Cesium3DTilesTester.loadTileset( scene, - vectorTilePointsTileset + vectorTilePointsTileset, ).then((tileset) => { // Subdivide the rectangle into 4, and look at the center of each sub-rectangle. - const [ulRect, urRect, lrRect, llRect] = subdivideRectangle( - tilesetRectangle - ); + const [ulRect, urRect, lrRect, llRect] = + subdivideRectangle(tilesetRectangle); // Set show to true. @@ -287,22 +284,22 @@ describe( }); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(ulRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toRender(whitePixel); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(urRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toRender(whitePixel); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(lrRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toRender(whitePixel); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(llRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toRender(whitePixel); @@ -311,22 +308,22 @@ describe( tileset.style = undefined; camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(ulRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toRender(whitePixel); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(urRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toRender(whitePixel); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(lrRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toRender(whitePixel); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(llRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toRender(whitePixel); }); @@ -335,12 +332,11 @@ describe( it("styles points for color", () => { return Cesium3DTilesTester.loadTileset( scene, - vectorTilePointsTileset + vectorTilePointsTileset, ).then((tileset) => { // Subdivide the rectangle into 4, and look at the center of each sub-rectangle. - const [ulRect, urRect, lrRect, llRect] = subdivideRectangle( - tilesetRectangle - ); + const [ulRect, urRect, lrRect, llRect] = + subdivideRectangle(tilesetRectangle); return new Promise((resolve) => { tileset.style = new Cesium3DTileStyle({ @@ -353,22 +349,22 @@ describe( }).then(() => { camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(ulRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toRender(blackPixel); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(urRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toRender(blackPixel); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(lrRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toRender(blackPixel); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(llRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toRender(blackPixel); @@ -377,22 +373,22 @@ describe( tileset.style = undefined; camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(ulRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toRender(whitePixel); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(urRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toRender(whitePixel); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(lrRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toRender(whitePixel); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(llRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toRender(whitePixel); }); @@ -402,30 +398,29 @@ describe( it("renders batched points with batch ids", () => { return Cesium3DTilesTester.loadTileset( scene, - vectorTilePointsWithBatchIdsTileset + vectorTilePointsWithBatchIdsTileset, ).then((tileset) => { // Subdivide the rectangle into 4, and look at the center of each sub-rectangle. - const [ulRect, urRect, lrRect, llRect] = subdivideRectangle( - tilesetRectangle - ); + const [ulRect, urRect, lrRect, llRect] = + subdivideRectangle(tilesetRectangle); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(ulRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toRender(whitePixel); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(urRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toRender(whitePixel); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(lrRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toRender(whitePixel); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(llRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toRender(whitePixel); }); @@ -434,15 +429,14 @@ describe( it("picks batched points with batch ids", () => { return Cesium3DTilesTester.loadTileset( scene, - vectorTilePointsWithBatchIdsTileset + vectorTilePointsWithBatchIdsTileset, ).then((tileset) => { // Subdivide the rectangle into 4, and look at the center of each sub-rectangle. - const [ulRect, urRect, lrRect, llRect] = subdivideRectangle( - tilesetRectangle - ); + const [ulRect, urRect, lrRect, llRect] = + subdivideRectangle(tilesetRectangle); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(ulRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toPickAndCall((result) => { expect(result).toBeDefined(); @@ -451,7 +445,7 @@ describe( }); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(urRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toPickAndCall((result) => { expect(result).toBeDefined(); @@ -460,7 +454,7 @@ describe( }); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(lrRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toPickAndCall((result) => { expect(result).toBeDefined(); @@ -469,7 +463,7 @@ describe( }); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(llRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toPickAndCall((result) => { expect(result).toBeDefined(); @@ -482,30 +476,29 @@ describe( it("renders batched points with batch table", () => { return Cesium3DTilesTester.loadTileset( scene, - vectorTilePointsWithBatchTableTileset + vectorTilePointsWithBatchTableTileset, ).then((tileset) => { // Subdivide the rectangle into 4, and look at the center of each sub-rectangle. - const [ulRect, urRect, lrRect, llRect] = subdivideRectangle( - tilesetRectangle - ); + const [ulRect, urRect, lrRect, llRect] = + subdivideRectangle(tilesetRectangle); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(ulRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toRender(whitePixel); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(urRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toRender(whitePixel); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(lrRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toRender(whitePixel); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(llRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toRender(whitePixel); }); @@ -514,15 +507,14 @@ describe( it("picks batched points with batch table", () => { return Cesium3DTilesTester.loadTileset( scene, - vectorTilePointsWithBatchTableTileset + vectorTilePointsWithBatchTableTileset, ).then((tileset) => { // Subdivide the rectangle into 4, and look at the center of each sub-rectangle. - const [ulRect, urRect, lrRect, llRect] = subdivideRectangle( - tilesetRectangle - ); + const [ulRect, urRect, lrRect, llRect] = + subdivideRectangle(tilesetRectangle); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(ulRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toPickAndCall((result) => { expect(result).toBeDefined(); @@ -531,7 +523,7 @@ describe( }); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(urRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toPickAndCall((result) => { expect(result).toBeDefined(); @@ -540,7 +532,7 @@ describe( }); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(lrRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toPickAndCall((result) => { expect(result).toBeDefined(); @@ -549,7 +541,7 @@ describe( }); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(llRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toPickAndCall((result) => { expect(result).toBeDefined(); @@ -562,30 +554,29 @@ describe( it("renders batched points with children", () => { return Cesium3DTilesTester.loadTileset( scene, - vectorTilePointsBatchedChildrenTileset + vectorTilePointsBatchedChildrenTileset, ).then((tileset) => { // Subdivide the rectangle into 4, and look at the center of each sub-rectangle. - const [ulRect, urRect, lrRect, llRect] = subdivideRectangle( - tilesetRectangle - ); + const [ulRect, urRect, lrRect, llRect] = + subdivideRectangle(tilesetRectangle); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(ulRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toRender(whitePixel); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(urRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toRender(whitePixel); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(lrRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toRender(whitePixel); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(llRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toRender(whitePixel); }); @@ -594,30 +585,29 @@ describe( it("renders batched polygons with children with batch table", () => { return Cesium3DTilesTester.loadTileset( scene, - vectorTilePointsBatchedChildrenWithBatchTableTileset + vectorTilePointsBatchedChildrenWithBatchTableTileset, ).then((tileset) => { // Subdivide the rectangle into 4, and look at the center of each sub-rectangle. - const [ulRect, urRect, lrRect, llRect] = subdivideRectangle( - tilesetRectangle - ); + const [ulRect, urRect, lrRect, llRect] = + subdivideRectangle(tilesetRectangle); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(ulRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toRender(whitePixel); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(urRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toRender(whitePixel); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(lrRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toRender(whitePixel); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(llRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toRender(whitePixel); }); @@ -637,30 +627,29 @@ describe( it("renders polygons", () => { return Cesium3DTilesTester.loadTileset( scene, - vectorTilePolygonsTileset + vectorTilePolygonsTileset, ).then((tileset) => { // Subdivide the rectangle into 4, and look at the center of each sub-rectangle. - const [ulRect, urRect, lrRect, llRect] = subdivideRectangle( - tilesetRectangle - ); + const [ulRect, urRect, lrRect, llRect] = + subdivideRectangle(tilesetRectangle); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(ulRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toRender(whitePixel); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(urRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toRender(whitePixel); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(lrRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toRender(whitePixel); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(llRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toRender(whitePixel); }); @@ -669,13 +658,13 @@ describe( it("picks polygons", () => { return Cesium3DTilesTester.loadTileset( scene, - vectorTilePolygonsTileset + vectorTilePolygonsTileset, ).then((tileset) => { camera.lookAt( ellipsoid.cartographicToCartesian( - Rectangle.center(tilesetRectangle) + Rectangle.center(tilesetRectangle), ), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toPickAndCall((result) => { expect(result).toBeDefined(); @@ -687,12 +676,11 @@ describe( it("styles polygons for show", () => { return Cesium3DTilesTester.loadTileset( scene, - vectorTilePolygonsTileset + vectorTilePolygonsTileset, ).then((tileset) => { // Subdivide the rectangle into 4, and look at the center of each sub-rectangle. - const [ulRect, urRect, lrRect, llRect] = subdivideRectangle( - tilesetRectangle - ); + const [ulRect, urRect, lrRect, llRect] = + subdivideRectangle(tilesetRectangle); // Set show to false. @@ -701,22 +689,22 @@ describe( }); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(ulRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toRender([255.0, 0.0, 0.0, 255.0]); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(urRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toRender([255.0, 0.0, 0.0, 255.0]); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(lrRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toRender([255.0, 0.0, 0.0, 255.0]); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(llRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toRender([255.0, 0.0, 0.0, 255.0]); @@ -727,22 +715,22 @@ describe( }); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(ulRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toRender(whitePixel); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(urRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toRender(whitePixel); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(lrRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toRender(whitePixel); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(llRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toRender(whitePixel); @@ -751,22 +739,22 @@ describe( tileset.style = undefined; camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(ulRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toRender(whitePixel); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(urRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toRender(whitePixel); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(lrRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toRender(whitePixel); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(llRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toRender(whitePixel); }); @@ -775,12 +763,11 @@ describe( it("styles polygons for color", () => { return Cesium3DTilesTester.loadTileset( scene, - vectorTilePolygonsTileset + vectorTilePolygonsTileset, ).then((tileset) => { // Subdivide the rectangle into 4, and look at the center of each sub-rectangle. - const [ulRect, urRect, lrRect, llRect] = subdivideRectangle( - tilesetRectangle - ); + const [ulRect, urRect, lrRect, llRect] = + subdivideRectangle(tilesetRectangle); // Set color to black. @@ -789,22 +776,22 @@ describe( }); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(ulRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toRender(blackPixel); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(urRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toRender(blackPixel); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(lrRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toRender(blackPixel); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(llRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toRender(blackPixel); @@ -813,22 +800,22 @@ describe( tileset.style = undefined; camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(ulRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toRender(whitePixel); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(urRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toRender(whitePixel); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(lrRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toRender(whitePixel); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(llRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toRender(whitePixel); }); @@ -841,13 +828,13 @@ describe( vectorTilePolygonsTileset, { classificationType: ClassificationType.CESIUM_3D_TILE, - } + }, ).then((tileset) => { camera.lookAt( ellipsoid.cartographicToCartesian( - Rectangle.center(tilesetRectangle) + Rectangle.center(tilesetRectangle), ), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); globeMockPrimitive.show = false; @@ -867,13 +854,13 @@ describe( vectorTilePolygonsTileset, { classificationType: ClassificationType.TERRAIN, - } + }, ).then((tileset) => { camera.lookAt( ellipsoid.cartographicToCartesian( - Rectangle.center(tilesetRectangle) + Rectangle.center(tilesetRectangle), ), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); globeMockPrimitive.show = false; @@ -893,13 +880,13 @@ describe( vectorTilePolygonsTileset, { classificationType: ClassificationType.BOTH, - } + }, ).then((tileset) => { camera.lookAt( ellipsoid.cartographicToCartesian( - Rectangle.center(tilesetRectangle) + Rectangle.center(tilesetRectangle), ), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); globeMockPrimitive.show = false; @@ -915,30 +902,29 @@ describe( it("renders batched polygons with batch ids", () => { return Cesium3DTilesTester.loadTileset( scene, - vectorTilePolygonsWithBatchIdsTileset + vectorTilePolygonsWithBatchIdsTileset, ).then((tileset) => { // Subdivide the rectangle into 4, and look at the center of each sub-rectangle. - const [ulRect, urRect, lrRect, llRect] = subdivideRectangle( - tilesetRectangle - ); + const [ulRect, urRect, lrRect, llRect] = + subdivideRectangle(tilesetRectangle); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(ulRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toRender(whitePixel); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(urRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toRender(whitePixel); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(lrRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toRender(whitePixel); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(llRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toRender(whitePixel); }); @@ -947,15 +933,14 @@ describe( it("picks batched polygons with batch ids", () => { return Cesium3DTilesTester.loadTileset( scene, - vectorTilePolygonsWithBatchIdsTileset + vectorTilePolygonsWithBatchIdsTileset, ).then((tileset) => { // Subdivide the rectangle into 4, and look at the center of each sub-rectangle. - const [ulRect, urRect, lrRect, llRect] = subdivideRectangle( - tilesetRectangle - ); + const [ulRect, urRect, lrRect, llRect] = + subdivideRectangle(tilesetRectangle); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(ulRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toPickAndCall((result) => { expect(result).toBeDefined(); @@ -964,7 +949,7 @@ describe( }); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(urRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toPickAndCall((result) => { expect(result).toBeDefined(); @@ -973,7 +958,7 @@ describe( }); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(lrRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toPickAndCall((result) => { expect(result).toBeDefined(); @@ -982,7 +967,7 @@ describe( }); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(llRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toPickAndCall((result) => { expect(result).toBeDefined(); @@ -995,30 +980,29 @@ describe( it("renders batched polygons with batch table", () => { return Cesium3DTilesTester.loadTileset( scene, - vectorTilePolygonsWithBatchTableTileset + vectorTilePolygonsWithBatchTableTileset, ).then((tileset) => { // Subdivide the rectangle into 4, and look at the center of each sub-rectangle. - const [ulRect, urRect, lrRect, llRect] = subdivideRectangle( - tilesetRectangle - ); + const [ulRect, urRect, lrRect, llRect] = + subdivideRectangle(tilesetRectangle); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(ulRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toRender(whitePixel); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(urRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toRender(whitePixel); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(lrRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toRender(whitePixel); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(llRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toRender(whitePixel); }); @@ -1027,15 +1011,14 @@ describe( it("picks batched polygons with batch table", () => { return Cesium3DTilesTester.loadTileset( scene, - vectorTilePolygonsWithBatchTableTileset + vectorTilePolygonsWithBatchTableTileset, ).then((tileset) => { // Subdivide the rectangle into 4, and look at the center of each sub-rectangle. - const [ulRect, urRect, lrRect, llRect] = subdivideRectangle( - tilesetRectangle - ); + const [ulRect, urRect, lrRect, llRect] = + subdivideRectangle(tilesetRectangle); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(ulRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toPickAndCall((result) => { expect(result).toBeDefined(); @@ -1044,7 +1027,7 @@ describe( }); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(urRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toPickAndCall((result) => { expect(result).toBeDefined(); @@ -1053,7 +1036,7 @@ describe( }); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(lrRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toPickAndCall((result) => { expect(result).toBeDefined(); @@ -1062,7 +1045,7 @@ describe( }); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(llRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toPickAndCall((result) => { expect(result).toBeDefined(); @@ -1075,30 +1058,29 @@ describe( it("renders batched polygons with children", () => { return Cesium3DTilesTester.loadTileset( scene, - vectorTilePolygonsBatchedChildrenTileset + vectorTilePolygonsBatchedChildrenTileset, ).then((tileset) => { // Subdivide the rectangle into 4, and look at the center of each sub-rectangle. - const [ulRect, urRect, lrRect, llRect] = subdivideRectangle( - tilesetRectangle - ); + const [ulRect, urRect, lrRect, llRect] = + subdivideRectangle(tilesetRectangle); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(ulRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toRender(whitePixel); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(urRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toRender(whitePixel); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(lrRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toRender(whitePixel); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(llRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toRender(whitePixel); }); @@ -1107,30 +1089,29 @@ describe( it("renders batched polygons with children with batch table", () => { return Cesium3DTilesTester.loadTileset( scene, - vectorTilePolygonsBatchedChildrenWithBatchTable + vectorTilePolygonsBatchedChildrenWithBatchTable, ).then((tileset) => { // Subdivide the rectangle into 4, and look at the center of each sub-rectangle. - const [ulRect, urRect, lrRect, llRect] = subdivideRectangle( - tilesetRectangle - ); + const [ulRect, urRect, lrRect, llRect] = + subdivideRectangle(tilesetRectangle); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(ulRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toRender(whitePixel); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(urRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toRender(whitePixel); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(lrRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toRender(whitePixel); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(llRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toRender(whitePixel); }); @@ -1152,23 +1133,22 @@ describe( it("renders polylines", () => { return Cesium3DTilesTester.loadTileset( scene, - vectorTilePolylinesTileset + vectorTilePolylinesTileset, ).then((tileset) => { - const [ulRect, urRect, lrRect, llRect] = subdivideRectangle( - tilesetRectangle - ); + const [ulRect, urRect, lrRect, llRect] = + subdivideRectangle(tilesetRectangle); const nwCorner = ellipsoid.cartographicToCartesian( - Rectangle.northwest(ulRect) + Rectangle.northwest(ulRect), ); const neCorner = ellipsoid.cartographicToCartesian( - Rectangle.northeast(urRect) + Rectangle.northeast(urRect), ); const seCorner = ellipsoid.cartographicToCartesian( - Rectangle.southeast(lrRect) + Rectangle.southeast(lrRect), ); const swCorner = ellipsoid.cartographicToCartesian( - Rectangle.southwest(llRect) + Rectangle.southwest(llRect), ); camera.lookAt(nwCorner, new Cartesian3(0.0, 0.0, 5.0)); @@ -1212,15 +1192,14 @@ describe( it("picks polylines", () => { return Cesium3DTilesTester.loadTileset( scene, - vectorTilePolylinesTileset + vectorTilePolylinesTileset, ).then((tileset) => { // Subdivide the rectangle into 4, and look at the center of each sub-rectangle. - const [ulRect, urRect, lrRect, llRect] = subdivideRectangle( - tilesetRectangle - ); + const [ulRect, urRect, lrRect, llRect] = + subdivideRectangle(tilesetRectangle); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.northwest(ulRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toPickAndCall((result) => { expect(result).toBeDefined(); @@ -1228,7 +1207,7 @@ describe( }); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.northeast(urRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toPickAndCall((result) => { expect(result).toBeDefined(); @@ -1236,7 +1215,7 @@ describe( }); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.southeast(lrRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toPickAndCall((result) => { expect(result).toBeDefined(); @@ -1244,7 +1223,7 @@ describe( }); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.southwest(llRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toPickAndCall((result) => { expect(result).toBeDefined(); @@ -1256,23 +1235,22 @@ describe( it("styles polylines for show", () => { return Cesium3DTilesTester.loadTileset( scene, - vectorTilePolylinesTileset + vectorTilePolylinesTileset, ).then((tileset) => { - const [ulRect, urRect, lrRect, llRect] = subdivideRectangle( - tilesetRectangle - ); + const [ulRect, urRect, lrRect, llRect] = + subdivideRectangle(tilesetRectangle); const nwCorner = ellipsoid.cartographicToCartesian( - Rectangle.northwest(ulRect) + Rectangle.northwest(ulRect), ); const neCorner = ellipsoid.cartographicToCartesian( - Rectangle.northeast(urRect) + Rectangle.northeast(urRect), ); const seCorner = ellipsoid.cartographicToCartesian( - Rectangle.southeast(lrRect) + Rectangle.southeast(lrRect), ); const swCorner = ellipsoid.cartographicToCartesian( - Rectangle.southwest(llRect) + Rectangle.southwest(llRect), ); // Set show to false. @@ -1380,23 +1358,22 @@ describe( it("styles polylines for color", () => { return Cesium3DTilesTester.loadTileset( scene, - vectorTilePolylinesTileset + vectorTilePolylinesTileset, ).then((tileset) => { - const [ulRect, urRect, lrRect, llRect] = subdivideRectangle( - tilesetRectangle - ); + const [ulRect, urRect, lrRect, llRect] = + subdivideRectangle(tilesetRectangle); const nwCorner = ellipsoid.cartographicToCartesian( - Rectangle.northwest(ulRect) + Rectangle.northwest(ulRect), ); const neCorner = ellipsoid.cartographicToCartesian( - Rectangle.northeast(urRect) + Rectangle.northeast(urRect), ); const seCorner = ellipsoid.cartographicToCartesian( - Rectangle.southeast(lrRect) + Rectangle.southeast(lrRect), ); const swCorner = ellipsoid.cartographicToCartesian( - Rectangle.southwest(llRect) + Rectangle.southwest(llRect), ); // Set color to black. @@ -1466,13 +1443,13 @@ describe( vectorTilePolylinesTileset, { classificationType: ClassificationType.CESIUM_3D_TILE, - } + }, ).then((tileset) => { camera.lookAt( ellipsoid.cartographicToCartesian( - Rectangle.northeast(tilesetRectangle) + Rectangle.northeast(tilesetRectangle), ), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); globeMockPrimitive.show = false; @@ -1492,13 +1469,13 @@ describe( vectorTilePolylinesTileset, { classificationType: ClassificationType.TERRAIN, - } + }, ).then((tileset) => { camera.lookAt( ellipsoid.cartographicToCartesian( - Rectangle.northeast(tilesetRectangle) + Rectangle.northeast(tilesetRectangle), ), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); globeMockPrimitive.show = false; @@ -1518,13 +1495,13 @@ describe( vectorTilePolylinesTileset, { classificationType: ClassificationType.BOTH, - } + }, ).then((tileset) => { camera.lookAt( ellipsoid.cartographicToCartesian( - Rectangle.northeast(tilesetRectangle) + Rectangle.northeast(tilesetRectangle), ), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); globeMockPrimitive.show = false; @@ -1540,24 +1517,23 @@ describe( it("renders polylines with batch ids", () => { return Cesium3DTilesTester.loadTileset( scene, - vectorTilePolylinesWithBatchIdsTileset + vectorTilePolylinesWithBatchIdsTileset, ).then((tileset) => { // Subdivide the rectangle into 4, and look at the center of each sub-rectangle. - const [ulRect, urRect, lrRect, llRect] = subdivideRectangle( - tilesetRectangle - ); + const [ulRect, urRect, lrRect, llRect] = + subdivideRectangle(tilesetRectangle); const nwCorner = ellipsoid.cartographicToCartesian( - Rectangle.northwest(ulRect) + Rectangle.northwest(ulRect), ); const neCorner = ellipsoid.cartographicToCartesian( - Rectangle.northeast(urRect) + Rectangle.northeast(urRect), ); const seCorner = ellipsoid.cartographicToCartesian( - Rectangle.southeast(lrRect) + Rectangle.southeast(lrRect), ); const swCorner = ellipsoid.cartographicToCartesian( - Rectangle.southwest(llRect) + Rectangle.southwest(llRect), ); camera.lookAt(nwCorner, new Cartesian3(0.0, 0.0, 5.0)); @@ -1601,15 +1577,14 @@ describe( it("picks polylines with batch ids", () => { return Cesium3DTilesTester.loadTileset( scene, - vectorTilePolylinesWithBatchIdsTileset + vectorTilePolylinesWithBatchIdsTileset, ).then((tileset) => { // Subdivide the rectangle into 4, and look at the center of each sub-rectangle. - const [ulRect, urRect, lrRect, llRect] = subdivideRectangle( - tilesetRectangle - ); + const [ulRect, urRect, lrRect, llRect] = + subdivideRectangle(tilesetRectangle); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.northwest(ulRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toPickAndCall((result) => { expect(result).toBeDefined(); @@ -1618,7 +1593,7 @@ describe( }); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.northeast(urRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toPickAndCall((result) => { expect(result).toBeDefined(); @@ -1627,7 +1602,7 @@ describe( }); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.southeast(lrRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toPickAndCall((result) => { expect(result).toBeDefined(); @@ -1636,7 +1611,7 @@ describe( }); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.southwest(llRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toPickAndCall((result) => { expect(result).toBeDefined(); @@ -1649,24 +1624,23 @@ describe( it("renders polylines with batch table", () => { return Cesium3DTilesTester.loadTileset( scene, - vectorTilePolylinesWithBatchTableTileset + vectorTilePolylinesWithBatchTableTileset, ).then((tileset) => { // Subdivide the rectangle into 4, and look at the center of each sub-rectangle. - const [ulRect, urRect, lrRect, llRect] = subdivideRectangle( - tilesetRectangle - ); + const [ulRect, urRect, lrRect, llRect] = + subdivideRectangle(tilesetRectangle); const nwCorner = ellipsoid.cartographicToCartesian( - Rectangle.northwest(ulRect) + Rectangle.northwest(ulRect), ); const neCorner = ellipsoid.cartographicToCartesian( - Rectangle.northeast(urRect) + Rectangle.northeast(urRect), ); const seCorner = ellipsoid.cartographicToCartesian( - Rectangle.southeast(lrRect) + Rectangle.southeast(lrRect), ); const swCorner = ellipsoid.cartographicToCartesian( - Rectangle.southwest(llRect) + Rectangle.southwest(llRect), ); camera.lookAt(nwCorner, new Cartesian3(0.0, 0.0, 5.0)); @@ -1710,15 +1684,14 @@ describe( it("picks polylines with batch table", () => { return Cesium3DTilesTester.loadTileset( scene, - vectorTilePolylinesWithBatchTableTileset + vectorTilePolylinesWithBatchTableTileset, ).then((tileset) => { // Subdivide the rectangle into 4, and look at the center of each sub-rectangle. - const [ulRect, urRect, lrRect, llRect] = subdivideRectangle( - tilesetRectangle - ); + const [ulRect, urRect, lrRect, llRect] = + subdivideRectangle(tilesetRectangle); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.northwest(ulRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toPickAndCall((result) => { expect(result).toBeDefined(); @@ -1727,7 +1700,7 @@ describe( }); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.northeast(urRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toPickAndCall((result) => { expect(result).toBeDefined(); @@ -1736,7 +1709,7 @@ describe( }); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.southeast(lrRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toPickAndCall((result) => { expect(result).toBeDefined(); @@ -1745,7 +1718,7 @@ describe( }); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.southwest(llRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toPickAndCall((result) => { expect(result).toBeDefined(); @@ -1758,15 +1731,14 @@ describe( it("renders batched polylines with children", () => { return Cesium3DTilesTester.loadTileset( scene, - vectorTilePolylinesBatchedChildrenTileset + vectorTilePolylinesBatchedChildrenTileset, ).then((tileset) => { // Subdivide the rectangle into 4, and look at the center of each sub-rectangle. - const [ulRect, urRect, lrRect, llRect] = subdivideRectangle( - tilesetRectangle - ); + const [ulRect, urRect, lrRect, llRect] = + subdivideRectangle(tilesetRectangle); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.northwest(ulRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toRenderAndCall((rgba) => { // Account for mitering at the corners. @@ -1777,7 +1749,7 @@ describe( }); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.northeast(urRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toRenderAndCall((rgba) => { // Account for mitering at the corners. @@ -1788,7 +1760,7 @@ describe( }); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.southeast(lrRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toRenderAndCall((rgba) => { // Account for mitering at the corners. @@ -1799,7 +1771,7 @@ describe( }); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.southwest(llRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toRenderAndCall((rgba) => { // Account for mitering at the corners. @@ -1814,15 +1786,14 @@ describe( it("renders batched polylines with children with batch table", () => { return Cesium3DTilesTester.loadTileset( scene, - vectorTilePolylinesBatchedChildrenWithBatchTableTileset + vectorTilePolylinesBatchedChildrenWithBatchTableTileset, ).then((tileset) => { // Subdivide the rectangle into 4, and look at the center of each sub-rectangle. - const [ulRect, urRect, lrRect, llRect] = subdivideRectangle( - tilesetRectangle - ); + const [ulRect, urRect, lrRect, llRect] = + subdivideRectangle(tilesetRectangle); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.northwest(ulRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toRenderAndCall((rgba) => { // Account for mitering at the corners. @@ -1833,7 +1804,7 @@ describe( }); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.northeast(urRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toRenderAndCall((rgba) => { // Account for mitering at the corners. @@ -1844,7 +1815,7 @@ describe( }); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.southeast(lrRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toRenderAndCall((rgba) => { // Account for mitering at the corners. @@ -1855,7 +1826,7 @@ describe( }); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.southwest(llRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toRenderAndCall((rgba) => { // Account for mitering at the corners. @@ -1874,22 +1845,22 @@ describe( vectorTilePolylinesWithBatchIdsTileset, { vectorKeepDecodedPositions: true, - } + }, ).then(function (tileset) { const content = tileset.root.content; const polylinePositions = content.getPolylinePositions(0); expect(polylinePositions.length).toBe(60); expect(polylinePositions[0]).toEqualEpsilon( 6378136.806372941, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(polylinePositions[1]).toEqualEpsilon( -1113.194885441724, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(polylinePositions[2]).toEqualEpsilon( 1105.675261474196, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); }); }); @@ -1900,7 +1871,7 @@ describe( vectorTilePolylinesBatchedChildrenTileset, { vectorKeepDecodedPositions: true, - } + }, ).then(function (tileset) { const content = tileset.root.children[0].content; expect(content.getPolylinePositions(0).length).toBe(60); @@ -1917,22 +1888,22 @@ describe( { vectorKeepDecodedPositions: true, classificationType: ClassificationType.TERRAIN, - } + }, ).then(function (tileset) { const content = tileset.root.content; const polylinePositions = content.getPolylinePositions(0); expect(polylinePositions.length).toBe(54); // duplicate positions are removed expect(polylinePositions[0]).toEqualEpsilon( 6378136.806372941, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(polylinePositions[1]).toEqualEpsilon( -1113.194885441724, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); expect(polylinePositions[2]).toEqualEpsilon( 1105.675261474196, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ); }); }); @@ -1943,7 +1914,7 @@ describe( vectorTilePolylinesWithBatchIdsTileset, { vectorKeepDecodedPositions: true, - } + }, ).then(function (tileset) { const content = tileset.root.content; const polylinePositions = content.getPolylinePositions(1); @@ -1957,7 +1928,7 @@ describe( vectorTilePolygonsWithBatchTableTileset, { vectorKeepDecodedPositions: true, - } + }, ).then(function (tileset) { const content = tileset.root.content; const polylinePositions = content.getPolylinePositions(0); @@ -1971,7 +1942,7 @@ describe( vectorTilePolylinesWithBatchIdsTileset, { vectorKeepDecodedPositions: false, - } + }, ).then(function (tileset) { const content = tileset.root.content; const polylinePositions = content.getPolylinePositions(0); @@ -1991,7 +1962,7 @@ describe( -0.02, -0.01, 0.02, - 0.01 + 0.01, ); const width = combinedTilesetRectangle.width; const step = width / 3; @@ -2004,30 +1975,30 @@ describe( west + step, south, west + step * 2, - north + north, ); const pointRect = new Rectangle( west + step * 2, south, west + step * 3, - north + north, ); it("renders", () => { return Cesium3DTilesTester.loadTileset( scene, - vectorTileCombinedTileset + vectorTileCombinedTileset, ).then((tileset) => { camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(polygonRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toRender(whitePixel); camera.lookAt( ellipsoid.cartographicToCartesian( - Rectangle.southeast(polylineRect) + Rectangle.southeast(polylineRect), ), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toRenderAndCall((rgba) => { // Account for mitering at the corners. @@ -2038,7 +2009,7 @@ describe( }); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(pointRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toRender(whitePixel); }); @@ -2047,11 +2018,11 @@ describe( it("picks", () => { return Cesium3DTilesTester.loadTileset( scene, - vectorTileCombinedTileset + vectorTileCombinedTileset, ).then((tileset) => { camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(polygonRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toPickAndCall((result) => { expect(result).toBeDefined(); @@ -2059,9 +2030,9 @@ describe( }); camera.lookAt( ellipsoid.cartographicToCartesian( - Rectangle.southeast(polylineRect) + Rectangle.southeast(polylineRect), ), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toPickAndCall((result) => { expect(result).toBeDefined(); @@ -2069,7 +2040,7 @@ describe( }); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(pointRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toPickAndCall((result) => { expect(result).toBeDefined(); @@ -2081,19 +2052,19 @@ describe( it("renders with batch ids", () => { return Cesium3DTilesTester.loadTileset( scene, - vectorTileCombinedWithBatchIdsTileset + vectorTileCombinedWithBatchIdsTileset, ).then((tileset) => { camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(polygonRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toRender(whitePixel); camera.lookAt( ellipsoid.cartographicToCartesian( - Rectangle.southeast(polylineRect) + Rectangle.southeast(polylineRect), ), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toRenderAndCall((rgba) => { // Account for mitering at the corners. @@ -2104,7 +2075,7 @@ describe( }); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(pointRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toRender(whitePixel); }); @@ -2113,11 +2084,11 @@ describe( it("picks with batch ids", () => { return Cesium3DTilesTester.loadTileset( scene, - vectorTileCombinedWithBatchIdsTileset + vectorTileCombinedWithBatchIdsTileset, ).then((tileset) => { camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(polygonRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toPickAndCall((result) => { expect(result).toBeDefined(); @@ -2126,9 +2097,9 @@ describe( }); camera.lookAt( ellipsoid.cartographicToCartesian( - Rectangle.southeast(polylineRect) + Rectangle.southeast(polylineRect), ), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toPickAndCall((result) => { expect(result).toBeDefined(); @@ -2137,7 +2108,7 @@ describe( }); camera.lookAt( ellipsoid.cartographicToCartesian(Rectangle.center(pointRect)), - new Cartesian3(0.0, 0.0, 5.0) + new Cartesian3(0.0, 0.0, 5.0), ); expect(scene).toPickAndCall((result) => { expect(result).toBeDefined(); @@ -2151,7 +2122,7 @@ describe( it("throws when calling getFeature with invalid index", function () { return Cesium3DTilesTester.loadTileset( scene, - vectorTilePolygonsWithBatchTableTileset + vectorTilePolygonsWithBatchTableTileset, ).then(function (tileset) { const content = tileset.root.content; expect(function () { @@ -2171,10 +2142,10 @@ describe( version: 2, }); await expectAsync( - Cesium3DTilesTester.createContentForMockTile(arrayBuffer, "vctr") + Cesium3DTilesTester.createContentForMockTile(arrayBuffer, "vctr"), ).toBeRejectedWithError( RuntimeError, - "Only Vector tile version 1 is supported. Version 2 is not." + "Only Vector tile version 1 is supported. Version 2 is not.", ); }); @@ -2183,10 +2154,10 @@ describe( defineFeatureTable: false, }); await expectAsync( - Cesium3DTilesTester.createContentForMockTile(arrayBuffer, "vctr") + Cesium3DTilesTester.createContentForMockTile(arrayBuffer, "vctr"), ).toBeRejectedWithError( RuntimeError, - "Feature table must have a byte length greater than zero" + "Feature table must have a byte length greater than zero", ); }); @@ -2196,10 +2167,10 @@ describe( polygonsLength: 1, }); await expectAsync( - Cesium3DTilesTester.createContentForMockTile(arrayBuffer, "vctr") + Cesium3DTilesTester.createContentForMockTile(arrayBuffer, "vctr"), ).toBeRejectedWithError( RuntimeError, - "Feature table global property: REGION must be defined" + "Feature table global property: REGION must be defined", ); }); @@ -2212,21 +2183,21 @@ describe( pointBatchIds: [0], }); await expectAsync( - Cesium3DTilesTester.createContentForMockTile(arrayBuffer, "vctr") + Cesium3DTilesTester.createContentForMockTile(arrayBuffer, "vctr"), ).toBeRejectedWithError( RuntimeError, - "If one group of batch ids is defined, then all batch ids must be defined" + "If one group of batch ids is defined, then all batch ids must be defined", ); }); it("destroys", async function () { const tileset = await Cesium3DTileset.fromUrl( - vectorTilePolygonsWithBatchTableTileset + vectorTilePolygonsWithBatchTableTileset, ); expect(tileset.isDestroyed()).toEqual(false); tileset.destroy(); expect(tileset.isDestroyed()).toEqual(true); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/Vector3DTileGeometrySpec.js b/packages/engine/Specs/Scene/Vector3DTileGeometrySpec.js index 32d9365f8e18..bce78da0c63f 100644 --- a/packages/engine/Specs/Scene/Vector3DTileGeometrySpec.js +++ b/packages/engine/Specs/Scene/Vector3DTileGeometrySpec.js @@ -69,7 +69,7 @@ describe( }); } const depthColorAttribute = ColorGeometryInstanceAttribute.fromColor( - new Color(1.0, 0.0, 0.0, 1.0) + new Color(1.0, 0.0, 0.0, 1.0), ); return new Primitive({ geometryInstances: new GeometryInstance({ @@ -127,7 +127,7 @@ describe( reusableGlobePrimitive = createPrimitive(rectangle, Pass.GLOBE); reusableTilesetPrimitive = createPrimitive( rectangle, - Pass.CESIUM_3D_TILE + Pass.CESIUM_3D_TILE, ); }); @@ -142,7 +142,7 @@ describe( globePrimitive = new MockPrimitive(reusableGlobePrimitive, Pass.GLOBE); tilesetPrimitive = new MockPrimitive( reusableTilesetPrimitive, - Pass.CESIUM_3D_TILE + Pass.CESIUM_3D_TILE, ); }); @@ -170,7 +170,7 @@ describe( function packBoxes(boxes) { const length = boxes.length; const packedBoxes = new Float32Array( - length * Vector3DTileGeometry.packedBoxLength + length * Vector3DTileGeometry.packedBoxLength, ); let offset = 0; for (let i = 0; i < length; ++i) { @@ -186,7 +186,7 @@ describe( function packCylinders(cylinders) { const length = cylinders.length; const packedCylinders = new Float32Array( - length * Vector3DTileGeometry.packedCylinderLength + length * Vector3DTileGeometry.packedCylinderLength, ); let offset = 0; for (let i = 0; i < length; ++i) { @@ -202,7 +202,7 @@ describe( function packEllipsoids(ellipsoids) { const length = ellipsoids.length; const packedEllipsoids = new Float32Array( - length * Vector3DTileGeometry.packedEllipsoidLength + length * Vector3DTileGeometry.packedEllipsoidLength, ); let offset = 0; for (let i = 0; i < length; ++i) { @@ -218,7 +218,7 @@ describe( function packSpheres(spheres) { const length = spheres.length; const packedSpheres = new Float32Array( - length * Vector3DTileGeometry.packedSphereLength + length * Vector3DTileGeometry.packedSphereLength, ); let offset = 0; for (let i = 0; i < length; ++i) { @@ -227,7 +227,7 @@ describe( Cartesian3.pack( Matrix4.getTranslation(sphere.modelMatrix, new Cartesian3()), packedSpheres, - offset + offset, ); offset += Cartesian3.packedLength; } @@ -252,8 +252,8 @@ describe( center: center, modelMatrix: modelMatrix, batchTable: batchTable, - }) - ) + }), + ), ); return loadGeometries(geometry).then(function () { scene.camera.setView({ @@ -288,8 +288,8 @@ describe( center: center, modelMatrix: modelMatrix, batchTable: batchTable, - }) - ) + }), + ), ); return loadGeometries(geometry).then(function () { let i; @@ -301,11 +301,11 @@ describe( const transform = Matrix4.multiply( modelMatrix, modelMatrices[i], - new Matrix4() + new Matrix4(), ); scene.camera.lookAtTransform( transform, - new Cartesian3(0.0, 0.0, 10.0) + new Cartesian3(0.0, 0.0, 10.0), ); batchTable.setShow(i, true); @@ -333,7 +333,7 @@ describe( const boxBatchIds = new Uint16Array([0]); const bv = new BoundingSphere( undefined, - Math.sqrt(3.0 * dimensions.x * dimensions.x) + Math.sqrt(3.0 * dimensions.x * dimensions.x), ); return verifySingleRender({ boxes: boxes, @@ -361,7 +361,7 @@ describe( const boxBatchIds = new Uint16Array([0, 1]); const bv = new BoundingSphere( undefined, - Math.sqrt(3.0 * 2.0 * dimensions.x * dimensions.x) + Math.sqrt(3.0 * 2.0 * dimensions.x * dimensions.x), ); return verifyMultipleRender(modelMatrices, { boxes: boxes, @@ -383,7 +383,7 @@ describe( const cylinderBatchIds = new Uint16Array([0]); const bv = new BoundingSphere( undefined, - Math.sqrt(radius * radius + length * length) + Math.sqrt(radius * radius + length * length), ); return verifySingleRender({ cylinders: cylinders, @@ -414,7 +414,7 @@ describe( const cylinderBatchIds = new Uint16Array([0, 1]); const bv = new BoundingSphere( undefined, - Math.sqrt(2.0 * (radius * radius + length * length)) + Math.sqrt(2.0 * (radius * radius + length * length)), ); return verifyMultipleRender(modelMatrices, { cylinders: cylinders, @@ -434,7 +434,7 @@ describe( const ellipsoidBatchIds = new Uint16Array([0]); const bv = new BoundingSphere( undefined, - Cartesian3.maximumComponent(radii) + Cartesian3.maximumComponent(radii), ); return verifySingleRender({ ellipsoids: ellipsoid, @@ -462,7 +462,7 @@ describe( const ellipsoidBatchIds = new Uint16Array([0, 1]); const bv = new BoundingSphere( undefined, - 2.0 * Cartesian3.maximumComponent(radii) + 2.0 * Cartesian3.maximumComponent(radii), ); return verifyMultipleRender(modelMatrices, { ellipsoids: ellipsoids, @@ -535,7 +535,7 @@ describe( const length = 125000.0; modelMatrices.push( Matrix4.fromTranslation(new Cartesian3(radius, 0.0, 0.0)), - Matrix4.fromTranslation(new Cartesian3(-radius, 0.0, 0.0)) + Matrix4.fromTranslation(new Cartesian3(-radius, 0.0, 0.0)), ); const cylinders = packCylinders([ { @@ -554,7 +554,7 @@ describe( const radii = new Cartesian3(125000.0, 125000.0, 125000.0); modelMatrices.push( Matrix4.fromTranslation(new Cartesian3(radii.x, 0.0, 0.0)), - Matrix4.fromTranslation(new Cartesian3(-radii.x, 0.0, 0.0)) + Matrix4.fromTranslation(new Cartesian3(-radii.x, 0.0, 0.0)), ); const ellipsoids = packEllipsoids([ { @@ -570,7 +570,7 @@ describe( modelMatrices.push( Matrix4.fromTranslation(new Cartesian3(radius, 0.0, 0.0)), - Matrix4.fromTranslation(new Cartesian3(-radius, 0.0, 0.0)) + Matrix4.fromTranslation(new Cartesian3(-radius, 0.0, 0.0)), ); const spheres = packSpheres([ { @@ -621,7 +621,7 @@ describe( let length = 125000.0; modelMatrices.push( Matrix4.fromTranslation(new Cartesian3(radius, 0.0, 0.0)), - Matrix4.fromTranslation(new Cartesian3(-radius, 0.0, 0.0)) + Matrix4.fromTranslation(new Cartesian3(-radius, 0.0, 0.0)), ); const cylinders = packCylinders([ { @@ -659,7 +659,7 @@ describe( modelMatrix: modelMatrix, batchTable: batchTable, boundingVolume: bv, - }) + }), ); geometry.forceRebatch = true; return loadGeometries(geometry).then(function () { @@ -672,11 +672,11 @@ describe( const transform = Matrix4.multiply( modelMatrix, modelMatrices[i], - new Matrix4() + new Matrix4(), ); scene.camera.lookAtTransform( transform, - new Cartesian3(0.0, 0.0, 10.0) + new Cartesian3(0.0, 0.0, 10.0), ); batchTable.setShow(i, true); @@ -709,7 +709,7 @@ describe( const bv = new BoundingSphere( center, - Cartesian3.maximumComponent(radii) + Cartesian3.maximumComponent(radii), ); const batchTable = new Cesium3DTileBatchTable(mockTileset, 1); @@ -725,18 +725,18 @@ describe( center: center, modelMatrix: modelMatrix, batchTable: batchTable, - }) + }), ); return loadGeometries(geometry).then(function () { scene.camera.lookAtTransform( modelMatrix, - new Cartesian3(0.0, 0.0, 1.0) + new Cartesian3(0.0, 0.0, 1.0), ); expect(scene).toRender([255, 255, 255, 255]); scene.camera.lookAtTransform( modelMatrix, - new Cartesian3(radii.x, 0.0, 1.0) + new Cartesian3(radii.x, 0.0, 1.0), ); expect(scene).toRender([255, 0, 0, 255]); @@ -771,7 +771,7 @@ describe( modelMatrix: modelMatrix, batchTable: batchTable, boundingVolume: new BoundingSphere(center, 1000000.0), - }) + }), ); geometry.debugWireframe = true; return loadGeometries(geometry).then(function () { @@ -804,7 +804,7 @@ describe( const bv = new BoundingSphere( center, - Cartesian3.maximumComponent(radii) + Cartesian3.maximumComponent(radii), ); const batchTable = new Cesium3DTileBatchTable(mockTileset, 1); @@ -821,12 +821,12 @@ describe( center: center, modelMatrix: modelMatrix, batchTable: batchTable, - }) + }), ); return loadGeometries(geometry).then(function () { scene.camera.lookAtTransform( modelMatrix, - new Cartesian3(0.0, 0.0, 1.0) + new Cartesian3(0.0, 0.0, 1.0), ); geometry.classificationType = ClassificationType.CESIUM_3D_TILE; @@ -880,7 +880,7 @@ describe( modelMatrix: modelMatrix, batchTable: batchTable, boundingVolume: new BoundingSphere(center, 500000.0), - }) + }), ); return loadGeometries(geometry).then(function () { scene.camera.setView({ @@ -914,5 +914,5 @@ describe( }); } }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/Vector3DTilePointsSpec.js b/packages/engine/Specs/Scene/Vector3DTilePointsSpec.js index eb701fc82367..b171cc95684b 100644 --- a/packages/engine/Specs/Scene/Vector3DTilePointsSpec.js +++ b/packages/engine/Specs/Scene/Vector3DTilePointsSpec.js @@ -70,9 +70,8 @@ describe( // render until all labels have been updated return pollToPromise(function () { scene.renderForSpecs(); - const backgroundBillboard = points._labelCollection._backgroundBillboardCollection.get( - 0 - ); + const backgroundBillboard = + points._labelCollection._backgroundBillboardCollection.get(0); return ( (!defined(backgroundBillboard) || backgroundBillboard.ready) && points._labelCollection._labelsToUpdate.length === 0 && @@ -100,7 +99,7 @@ describe( rectangle, minimumHeight, maximumHeight, - positions + positions, ) { const length = positions.length; const buffer = new Uint16Array(length * 3); @@ -145,7 +144,7 @@ describe( rectangle, minHeight, maxHeight, - cartoPositions + cartoPositions, ); const batchTable = new Cesium3DTileBatchTable(mockTileset, 1); @@ -159,7 +158,7 @@ describe( rectangle: rectangle, minimumHeight: minHeight, maximumHeight: maxHeight, - }) + }), ); return loadPoints(points) .then(function () { @@ -169,7 +168,7 @@ describe( scene.camera.lookAt( Cartesian3.fromDegrees(0.0, 0.0, 30.0), - new Cartesian3(0.0, 0.0, 50.0) + new Cartesian3(0.0, 0.0, 50.0), ); return allPrimitivesReady(points); }) @@ -192,7 +191,7 @@ describe( rectangle, minHeight, maxHeight, - cartoPositions + cartoPositions, ); const batchTable = new Cesium3DTileBatchTable(mockTileset, 5); @@ -206,7 +205,7 @@ describe( rectangle: rectangle, minimumHeight: minHeight, maximumHeight: maxHeight, - }) + }), ); const style = new Cesium3DTileStyle({ verticalOrigin: VerticalOrigin.BOTTOM, @@ -225,7 +224,7 @@ describe( .then(function () { for (let i = 0; i < cartoPositions.length; ++i) { const position = ellipsoid.cartographicToCartesian( - cartoPositions[i] + cartoPositions[i], ); scene.camera.lookAt(position, new Cartesian3(0.0, 0.0, 50.0)); expect(scene).toRenderAndCall(function (rgba) { @@ -246,7 +245,7 @@ describe( rectangle, minHeight, maxHeight, - cartoPositions + cartoPositions, ); const batchTable = new Cesium3DTileBatchTable(mockTileset, 1); @@ -259,7 +258,7 @@ describe( rectangle: rectangle, minimumHeight: minHeight, maximumHeight: maxHeight, - }) + }), ); const features = []; const getFeature = mockTileset.getFeature; @@ -267,7 +266,7 @@ describe( .then(function () { scene.camera.lookAt( Cartesian3.fromDegrees(0.0, 0.0, 10.0), - new Cartesian3(0.0, 0.0, 50.0) + new Cartesian3(0.0, 0.0, 50.0), ); points.createFeatures(mockTileset, features); @@ -305,7 +304,7 @@ describe( rectangle, minHeight, maxHeight, - cartoPositions + cartoPositions, ); const mockTilesetClone = clone(mockTileset); @@ -325,7 +324,7 @@ describe( rectangle: rectangle, minimumHeight: minHeight, maximumHeight: maxHeight, - }) + }), ); const style = new Cesium3DTileStyle({ @@ -369,41 +368,41 @@ describe( expect(feature.pointSize).toEqual(10.0); expect(feature.color).toEqual(new Color(1.0, 1.0, 0.0, 0.5)); expect(feature.pointOutlineColor).toEqual( - new Color(1.0, 1.0, 0.0, 1.0) + new Color(1.0, 1.0, 0.0, 1.0), ); expect(feature.pointOutlineWidth).toEqual(11.0 * i); expect(feature.labelColor).toEqual(new Color(1.0, 1.0, 0.0, 1.0)); expect(feature.labelOutlineColor).toEqual( - new Color(1.0, 1.0, 0.0, 0.5) + new Color(1.0, 1.0, 0.0, 0.5), ); expect(feature.labelOutlineWidth).toEqual(1.0); expect(feature.font).toEqual("30px sans-serif"); expect(feature.labelStyle).toEqual(LabelStyle.FILL_AND_OUTLINE); expect(feature.labelText).toEqual("test"); expect(feature.backgroundColor).toEqual( - new Color(1.0, 1.0, 0.0, 0.2) + new Color(1.0, 1.0, 0.0, 0.2), ); expect(feature.backgroundPadding).toEqual(new Cartesian2(10, 11)); expect(feature.backgroundEnabled).toEqual(true); expect(feature.scaleByDistance).toEqual( - new NearFarScalar(1.0e4, 1.0, 1.0e6, 0.0) + new NearFarScalar(1.0e4, 1.0, 1.0e6, 0.0), ); expect(feature.translucencyByDistance).toEqual( - new NearFarScalar(1.0e4, 1.0, 1.0e6, 0.0) + new NearFarScalar(1.0e4, 1.0, 1.0e6, 0.0), ); expect(feature.distanceDisplayCondition).toEqual( - new DistanceDisplayCondition(0.1, 1.0e6) + new DistanceDisplayCondition(0.1, 1.0e6), ); expect(feature.heightOffset).toEqual(0.0); expect(feature.anchorLineEnabled).toEqual(true); expect(feature.anchorLineColor).toEqual( - new Color(1.0, 1.0, 0.0, 1.0) + new Color(1.0, 1.0, 0.0, 1.0), ); expect(feature.disableDepthTestDistance).toEqual(1.0e6); expect(feature.horizontalOrigin).toEqual(HorizontalOrigin.CENTER); expect(feature.verticalOrigin).toEqual(VerticalOrigin.CENTER); expect(feature.labelHorizontalOrigin).toEqual( - HorizontalOrigin.RIGHT + HorizontalOrigin.RIGHT, ); expect(feature.labelVerticalOrigin).toEqual(VerticalOrigin.BOTTOM); } @@ -432,7 +431,7 @@ describe( /*[ Cesium3DTileStyle option, Cesium3DTileStyle default value, - Cesium3DTileFeature property, + Cesium3DTileFeature property, expected Cesium3DTileFeature value, expected undefined Cesium3DTileFeature value ]*/ @@ -477,13 +476,13 @@ describe( rectangle, minHeight, maxHeight, - cartoPositions + cartoPositions, ); const mockTilesetClone = clone(mockTileset); const batchTable = new Cesium3DTileBatchTable( mockTilesetClone, - testOptions.length + testOptions.length, ); mockTilesetClone.batchTable = batchTable; @@ -502,7 +501,7 @@ describe( rectangle: rectangle, minimumHeight: minHeight, maximumHeight: maxHeight, - }) + }), ); const styleOptions = {}; @@ -554,7 +553,7 @@ describe( if (defined(expectedCesium3DTileFeaturePropertyValue)) { expect(feature[cesium3DTileFeaturePropertyName]).toBeDefined(); expect(feature[cesium3DTileFeaturePropertyName]).toEqual( - expectedCesium3DTileFeaturePropertyValue + expectedCesium3DTileFeaturePropertyValue, ); } else { expect(feature[cesium3DTileFeaturePropertyName]).toBeUndefined(); @@ -576,7 +575,7 @@ describe( rectangle, minHeight, maxHeight, - cartoPositions + cartoPositions, ); const batchTable = new Cesium3DTileBatchTable(mockTileset, 1); @@ -590,7 +589,7 @@ describe( rectangle: rectangle, minimumHeight: minHeight, maximumHeight: maxHeight, - }) + }), ); const style = new Cesium3DTileStyle({ @@ -609,7 +608,7 @@ describe( scene.camera.lookAt( Cartesian3.fromDegrees(0.0, 0.0, 10.0), - new Cartesian3(0.0, 0.0, 50.0) + new Cartesian3(0.0, 0.0, 50.0), ); return pollToPromise(function () { scene.renderForSpecs(); @@ -635,7 +634,7 @@ describe( rectangle, minHeight, maxHeight, - cartoPositions + cartoPositions, ); const batchTable = new Cesium3DTileBatchTable(mockTileset, 5); @@ -649,7 +648,7 @@ describe( rectangle: rectangle, minimumHeight: minHeight, maximumHeight: maxHeight, - }) + }), ); const style = new Cesium3DTileStyle({ verticalOrigin: VerticalOrigin.BOTTOM, @@ -699,5 +698,5 @@ describe( expect(points.isDestroyed()).toEqual(true); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/Vector3DTilePolygonsSpec.js b/packages/engine/Specs/Scene/Vector3DTilePolygonsSpec.js index ef14b4d4b60c..784e3f383c5e 100644 --- a/packages/engine/Specs/Scene/Vector3DTilePolygonsSpec.js +++ b/packages/engine/Specs/Scene/Vector3DTilePolygonsSpec.js @@ -74,7 +74,7 @@ describe( }); } const depthColorAttribute = ColorGeometryInstanceAttribute.fromColor( - new Color(1.0, 0.0, 0.0, 1.0) + new Color(1.0, 0.0, 0.0, 1.0), ); return new Primitive({ geometryInstances: new GeometryInstance({ @@ -132,7 +132,7 @@ describe( reusableGlobePrimitive = createPrimitive(rectangle, Pass.GLOBE); reusableTilesetPrimitive = createPrimitive( rectangle, - Pass.CESIUM_3D_TILE + Pass.CESIUM_3D_TILE, ); }); @@ -147,7 +147,7 @@ describe( globePrimitive = new MockPrimitive(reusableGlobePrimitive, Pass.GLOBE); tilesetPrimitive = new MockPrimitive( reusableTilesetPrimitive, - Pass.CESIUM_3D_TILE + Pass.CESIUM_3D_TILE, ); }); @@ -232,7 +232,7 @@ describe( scene.primitives.add(globePrimitive); const center = ellipsoid.cartographicToCartesian( - Rectangle.center(rectangle) + Rectangle.center(rectangle), ); polygons = scene.primitives.add( new Vector3DTilePolygons( @@ -245,8 +245,8 @@ describe( batchTable: batchTable, batchIds: new Uint32Array([0]), isCartographic: true, - }) - ) + }), + ), ); return loadPolygons(polygons).then(function () { scene.camera.setView({ @@ -283,7 +283,7 @@ describe( scene.primitives.add(globePrimitive); const center = ellipsoid.cartographicToCartesian( - Rectangle.center(rectangle) + Rectangle.center(rectangle), ); polygons = scene.primitives.add( new Vector3DTilePolygons({ @@ -299,7 +299,7 @@ describe( batchTable: batchTable, batchIds: new Uint32Array([0, 1]), isCartographic: true, - }) + }), ); return loadPolygons(polygons).then(function () { scene.camera.setView({ @@ -347,7 +347,7 @@ describe( scene.primitives.add(globePrimitive); const center = ellipsoid.cartographicToCartesian( - Rectangle.center(rectangle) + Rectangle.center(rectangle), ); polygons = scene.primitives.add( new Vector3DTilePolygons({ @@ -363,7 +363,7 @@ describe( batchTable: batchTable, batchIds: new Uint32Array([0, 1]), isCartographic: true, - }) + }), ); polygons.forceRebatch = true; return loadPolygons(polygons).then(function () { @@ -412,7 +412,7 @@ describe( scene.primitives.add(globePrimitive); const center = ellipsoid.cartographicToCartesian( - Rectangle.center(rectangle) + Rectangle.center(rectangle), ); polygons = scene.primitives.add( new Vector3DTilePolygons({ @@ -430,7 +430,7 @@ describe( batchTable: batchTable, batchIds: new Uint32Array([0, 1]), isCartographic: true, - }) + }), ); polygons.forceRebatch = true; return loadPolygons(polygons).then(function () { @@ -463,7 +463,7 @@ describe( scene.primitives.add(tilesetPrimitive); const center = ellipsoid.cartographicToCartesian( - Rectangle.center(rectangle) + Rectangle.center(rectangle), ); polygons = scene.primitives.add( new Vector3DTilePolygons( @@ -476,8 +476,8 @@ describe( batchTable: batchTable, batchIds: new Uint32Array([0]), isCartographic: true, - }) - ) + }), + ), ); return loadPolygons(polygons).then(function () { scene.camera.setView({ @@ -510,7 +510,7 @@ describe( scene.primitives.add(globePrimitive); const center = ellipsoid.cartographicToCartesian( - Rectangle.center(rectangle) + Rectangle.center(rectangle), ); polygons = scene.primitives.add( new Vector3DTilePolygons( @@ -523,8 +523,8 @@ describe( batchTable: batchTable, batchIds: new Uint32Array([0]), isCartographic: true, - }) - ) + }), + ), ); polygons.debugWireframe = true; return loadPolygons(polygons).then(function () { @@ -552,7 +552,7 @@ describe( scene.primitives.add(tilesetPrimitive); const center = ellipsoid.cartographicToCartesian( - Rectangle.center(rectangle) + Rectangle.center(rectangle), ); polygons = scene.primitives.add( new Vector3DTilePolygons( @@ -565,8 +565,8 @@ describe( batchTable: batchTable, batchIds: new Uint32Array([0]), isCartographic: true, - }) - ) + }), + ), ); return loadPolygons(polygons).then(function () { scene.camera.setView({ @@ -611,7 +611,7 @@ describe( scene.primitives.add(globePrimitive); const center = ellipsoid.cartographicToCartesian( - Rectangle.center(rectangle) + Rectangle.center(rectangle), ); polygons = scene.primitives.add( new Vector3DTilePolygons( @@ -624,8 +624,8 @@ describe( batchTable: batchTable, batchIds: new Uint32Array([0]), isCartographic: true, - }) - ) + }), + ), ); polygons.debugWireframe = true; return loadPolygons(polygons).then(function () { @@ -659,5 +659,5 @@ describe( }); } }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/Vector3DTilePolylinesSpec.js b/packages/engine/Specs/Scene/Vector3DTilePolylinesSpec.js index 1ca2cffad46b..7626e6cc86d2 100644 --- a/packages/engine/Specs/Scene/Vector3DTilePolylinesSpec.js +++ b/packages/engine/Specs/Scene/Vector3DTilePolylinesSpec.js @@ -72,7 +72,7 @@ describe( rectangle, minimumHeight, maximumHeight, - positions + positions, ) { const length = positions.length; const buffer = new Uint16Array(length * 3); @@ -120,14 +120,14 @@ describe( rectangle, minHeight, maxHeight, - cartoPositions + cartoPositions, ); const batchTable = new Cesium3DTileBatchTable(mockTileset, 1); batchTable.update(mockTileset, scene.frameState); const center = ellipsoid.cartographicToCartesian( - Rectangle.center(rectangle) + Rectangle.center(rectangle), ); polylines = scene.primitives.add( @@ -143,12 +143,12 @@ describe( boundingVolume: new BoundingSphere(center, 1000000.0), batchTable: batchTable, keepDecodedPositions: false, - }) + }), ); return loadPolylines(polylines).then(function () { scene.camera.lookAt( Cartesian3.fromDegrees(0.5, 0.0, 1.5), - new Cartesian3(0.0, 0.0, 1.0) + new Cartesian3(0.0, 0.0, 1.0), ); expect(scene).toRender([255, 255, 255, 255]); }); @@ -171,14 +171,14 @@ describe( rectangle, minHeight, maxHeight, - cartoPositions + cartoPositions, ); const batchTable = new Cesium3DTileBatchTable(mockTileset, 1); batchTable.update(mockTileset, scene.frameState); const center = ellipsoid.cartographicToCartesian( - Rectangle.center(rectangle) + Rectangle.center(rectangle), ); polylines = scene.primitives.add( @@ -194,7 +194,7 @@ describe( boundingVolume: new BoundingSphere(center, 1000000.0), batchTable: batchTable, keepDecodedPositions: false, - }) + }), ); return loadPolylines(polylines).then(function () { for (let i = 0; i < cartoPositions.length; i += 2) { @@ -222,13 +222,13 @@ describe( rectangle, minHeight, maxHeight, - cartoPositions + cartoPositions, ); const batchTable = new Cesium3DTileBatchTable(mockTileset, 1); const center = ellipsoid.cartographicToCartesian( - Rectangle.center(rectangle) + Rectangle.center(rectangle), ); polylines = scene.primitives.add( @@ -244,12 +244,12 @@ describe( boundingVolume: new BoundingSphere(center, 1000000.0), batchTable: batchTable, keepDecodedPositions: false, - }) + }), ); return loadPolylines(polylines).then(function () { scene.camera.lookAt( Cartesian3.fromDegrees(0.5, 0.0, 1.5), - new Cartesian3(0.0, 0.0, 1.0) + new Cartesian3(0.0, 0.0, 1.0), ); const features = []; @@ -277,5 +277,5 @@ describe( expect(polylines.isDestroyed()).toEqual(true); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/VertexAttributeSemanticSpec.js b/packages/engine/Specs/Scene/VertexAttributeSemanticSpec.js index b400be14e290..3806abc4facd 100644 --- a/packages/engine/Specs/Scene/VertexAttributeSemanticSpec.js +++ b/packages/engine/Specs/Scene/VertexAttributeSemanticSpec.js @@ -18,7 +18,7 @@ describe("Scene/VertexAttributeSemantic", function () { const semanticsLength = semantics.length; for (let i = 0; i < semanticsLength; ++i) { expect(VertexAttributeSemantic.hasSetIndex(semantics[i])).toBe( - hasSetIndex[i] + hasSetIndex[i], ); } }); @@ -73,7 +73,7 @@ describe("Scene/VertexAttributeSemantic", function () { const semanticsLength = gltfSemantics.length; for (let i = 0; i < semanticsLength; ++i) { expect(VertexAttributeSemantic.fromGltfSemantic(gltfSemantics[i])).toBe( - expectedSemantics[i] + expectedSemantics[i], ); } }); @@ -110,7 +110,7 @@ describe("Scene/VertexAttributeSemantic", function () { const semanticsLength = pntsSemantics.length; for (let i = 0; i < semanticsLength; ++i) { expect(VertexAttributeSemantic.fromPntsSemantic(pntsSemantics[i])).toBe( - expectedSemantics[i] + expectedSemantics[i], ); } }); @@ -153,7 +153,7 @@ describe("Scene/VertexAttributeSemantic", function () { const semanticsLength = semantics.length; for (let i = 0; i < semanticsLength; ++i) { expect(VertexAttributeSemantic.getGlslType(semantics[i])).toBe( - expectedShaderTypes[i] + expectedShaderTypes[i], ); } }); @@ -196,7 +196,7 @@ describe("Scene/VertexAttributeSemantic", function () { const semanticsLength = semantics.length; for (let i = 0; i < semanticsLength; ++i) { expect(VertexAttributeSemantic.getVariableName(semantics[i])).toBe( - expectedVariableName[i] + expectedVariableName[i], ); } }); @@ -205,8 +205,8 @@ describe("Scene/VertexAttributeSemantic", function () { expect( VertexAttributeSemantic.getVariableName( VertexAttributeSemantic.FEATURE_ID, - 0 - ) + 0, + ), ).toBe("featureId_0"); }); diff --git a/packages/engine/Specs/Scene/ViewportQuadSpec.js b/packages/engine/Specs/Scene/ViewportQuadSpec.js index 64673c2fadbe..c4ed9d8d417c 100644 --- a/packages/engine/Specs/Scene/ViewportQuadSpec.js +++ b/packages/engine/Specs/Scene/ViewportQuadSpec.js @@ -18,11 +18,11 @@ describe( beforeAll(function () { scene = createScene(); - return Resource.fetchImage("./Data/Images/Red16x16.png").then(function ( - image - ) { - testImage = image; - }); + return Resource.fetchImage("./Data/Images/Red16x16.png").then( + function (image) { + testImage = image; + }, + ); }); afterAll(function () { @@ -52,7 +52,7 @@ describe( it("gets the default color", function () { expect(viewportQuad.material.uniforms.color).toEqual( - new Color(1.0, 1.0, 1.0, 1.0) + new Color(1.0, 1.0, 1.0, 1.0), ); }); @@ -110,7 +110,7 @@ describe( viewportQuad.rectangle = otherRectangle; scene.renderForSpecs(); expect(scene.frameState.commandList[0].renderState.viewport).toEqual( - otherRectangle + otherRectangle, ); }); @@ -123,5 +123,5 @@ describe( expect(vq.isDestroyed()).toEqual(true); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/VoxelBoxShapeSpec.js b/packages/engine/Specs/Scene/VoxelBoxShapeSpec.js index 339aa5ffefef..fb52f06ddd46 100644 --- a/packages/engine/Specs/Scene/VoxelBoxShapeSpec.js +++ b/packages/engine/Specs/Scene/VoxelBoxShapeSpec.js @@ -32,7 +32,7 @@ describe("Scene/VoxelBoxShape", function () { const modelMatrix = Matrix4.fromTranslationQuaternionRotationScale( translation, rotation, - scale + scale, ); const minBounds = VoxelBoxShape.DefaultMinBounds; const maxBounds = VoxelBoxShape.DefaultMaxBounds; @@ -49,22 +49,22 @@ describe("Scene/VoxelBoxShape", function () { 0.0, 0.0, scale.z, - ]) + ]), ); const expectedBoundingSphere = new BoundingSphere( translation, - Cartesian3.magnitude(scale) + Cartesian3.magnitude(scale), ); const visible = shape.update(modelMatrix, minBounds, maxBounds); expect(shape.orientedBoundingBox.center).toEqual( - expectedOrientedBoundingBox.center + expectedOrientedBoundingBox.center, ); expect(shape.orientedBoundingBox.halfAxes).toEqualEpsilon( expectedOrientedBoundingBox.halfAxes, - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); expect(shape.boundingSphere).toEqual(expectedBoundingSphere); expect(shape.boundTransform).toEqual(modelMatrix); @@ -81,7 +81,7 @@ describe("Scene/VoxelBoxShape", function () { translation, rotation, scale, - new Matrix4() + new Matrix4(), ); const minBounds = new Cartesian3(-0.75, -0.75, -0.75); const maxBounds = new Cartesian3(-0.25, -0.25, -0.25); @@ -90,7 +90,7 @@ describe("Scene/VoxelBoxShape", function () { minBounds, maxBounds, minBounds, - maxBounds + maxBounds, ); const expectedTranslation = new Cartesian3(0.0, 0.5, 1); @@ -100,15 +100,15 @@ describe("Scene/VoxelBoxShape", function () { expectedTranslation, expectedRotation, expectedScale, - new Matrix4() + new Matrix4(), ); const expectedOrientedBoundingBox = new OrientedBoundingBox( expectedTranslation, - Matrix3.fromScale(expectedScale) + Matrix3.fromScale(expectedScale), ); const expectedBoundingSphere = new BoundingSphere( expectedTranslation, - Cartesian3.magnitude(expectedScale) + Cartesian3.magnitude(expectedScale), ); expect(shape.orientedBoundingBox).toEqual(expectedOrientedBoundingBox); @@ -135,7 +135,7 @@ describe("Scene/VoxelBoxShape", function () { modelMatrix = Matrix4.fromTranslationQuaternionRotationScale( translation, rotation, - scale + scale, ); visible = shape.update(modelMatrix, minBounds, maxBounds); expect(visible).toBeTrue(); @@ -145,7 +145,7 @@ describe("Scene/VoxelBoxShape", function () { modelMatrix = Matrix4.fromTranslationQuaternionRotationScale( translation, rotation, - scale + scale, ); visible = shape.update(modelMatrix, minBounds, maxBounds); expect(visible).toBeTrue(); @@ -155,7 +155,7 @@ describe("Scene/VoxelBoxShape", function () { modelMatrix = Matrix4.fromTranslationQuaternionRotationScale( translation, rotation, - scale + scale, ); visible = shape.update(modelMatrix, minBounds, maxBounds); expect(visible).toBeTrue(); @@ -177,7 +177,7 @@ describe("Scene/VoxelBoxShape", function () { modelMatrix = Matrix4.fromTranslationQuaternionRotationScale( translation, rotation, - scale + scale, ); visible = shape.update(modelMatrix, minBounds, maxBounds); expect(visible).toBeFalse(); @@ -187,7 +187,7 @@ describe("Scene/VoxelBoxShape", function () { modelMatrix = Matrix4.fromTranslationQuaternionRotationScale( translation, rotation, - scale + scale, ); visible = shape.update(modelMatrix, minBounds, maxBounds); expect(visible).toBeFalse(); @@ -197,7 +197,7 @@ describe("Scene/VoxelBoxShape", function () { modelMatrix = Matrix4.fromTranslationQuaternionRotationScale( translation, rotation, - scale + scale, ); visible = shape.update(modelMatrix, minBounds, maxBounds); expect(visible).toBeFalse(); @@ -207,7 +207,7 @@ describe("Scene/VoxelBoxShape", function () { modelMatrix = Matrix4.fromTranslationQuaternionRotationScale( translation, rotation, - scale + scale, ); visible = shape.update(modelMatrix, minBounds, maxBounds); expect(visible).toBeFalse(); @@ -221,7 +221,7 @@ describe("Scene/VoxelBoxShape", function () { const modelMatrix = Matrix4.fromTranslationQuaternionRotationScale( translation, rotation, - scale + scale, ); let minBounds; @@ -244,12 +244,12 @@ describe("Scene/VoxelBoxShape", function () { minBounds, maxBounds, clipMinBounds, - clipMaxBounds + clipMaxBounds, ); actualScale = Matrix4.getScale(shape.boundTransform, new Cartesian3()); actualTranslation = Matrix4.getTranslation( shape.shapeTransform, - new Cartesian3() + new Cartesian3(), ); expect(visible).toBeTrue(); expect(actualScale).toEqual(expectedScale); @@ -265,12 +265,12 @@ describe("Scene/VoxelBoxShape", function () { minBounds, maxBounds, clipMinBounds, - clipMaxBounds + clipMaxBounds, ); actualScale = Matrix4.getScale(shape.boundTransform, new Cartesian3()); actualTranslation = Matrix4.getTranslation( shape.shapeTransform, - new Cartesian3() + new Cartesian3(), ); expect(visible).toBeTrue(); expect(actualScale).toEqual(expectedScale); @@ -286,12 +286,12 @@ describe("Scene/VoxelBoxShape", function () { minBounds, maxBounds, clipMinBounds, - clipMaxBounds + clipMaxBounds, ); actualScale = Matrix4.getScale(shape.boundTransform, new Cartesian3()); actualTranslation = Matrix4.getTranslation( shape.shapeTransform, - new Cartesian3() + new Cartesian3(), ); expect(visible).toBeTrue(); expect(actualScale).toEqual(expectedScale); @@ -306,7 +306,7 @@ describe("Scene/VoxelBoxShape", function () { const modelMatrix = Matrix4.fromTranslationQuaternionRotationScale( translation, rotation, - scale + scale, ); let minBounds; @@ -327,7 +327,7 @@ describe("Scene/VoxelBoxShape", function () { minBounds, maxBounds, minBounds, - maxBounds + maxBounds, ); expect(visible).toBeFalse(); @@ -352,7 +352,7 @@ describe("Scene/VoxelBoxShape", function () { const modelMatrix = Matrix4.fromTranslationQuaternionRotationScale( translation, rotation, - scale + scale, ); let visible; @@ -370,7 +370,7 @@ describe("Scene/VoxelBoxShape", function () { minBounds, maxBounds, clipMinBounds, - clipMaxBounds + clipMaxBounds, ); expect(visible).toBeFalse(); @@ -382,7 +382,7 @@ describe("Scene/VoxelBoxShape", function () { minBounds, maxBounds, clipMinBounds, - clipMaxBounds + clipMaxBounds, ); expect(visible).toBeFalse(); @@ -394,7 +394,7 @@ describe("Scene/VoxelBoxShape", function () { minBounds, maxBounds, clipMinBounds, - clipMaxBounds + clipMaxBounds, ); expect(visible).toBeFalse(); }); @@ -417,7 +417,7 @@ describe("Scene/VoxelBoxShape", function () { const modelMatrix = Matrix4.fromTranslationQuaternionRotationScale( translation, rotation, - scale + scale, ); const maxBounds = VoxelBoxShape.DefaultMaxBounds; @@ -434,7 +434,7 @@ describe("Scene/VoxelBoxShape", function () { const modelMatrix = Matrix4.fromTranslationQuaternionRotationScale( translation, rotation, - scale + scale, ); const minBounds = VoxelBoxShape.DefaultMinBounds; @@ -451,7 +451,7 @@ describe("Scene/VoxelBoxShape", function () { const modelMatrix = Matrix4.fromTranslationQuaternionRotationScale( translation, rotation, - scale + scale, ); const minBounds = VoxelBoxShape.DefaultMinBounds; const maxBounds = VoxelBoxShape.DefaultMaxBounds; @@ -466,7 +466,7 @@ describe("Scene/VoxelBoxShape", function () { tileX, tileY, tileZ, - new OrientedBoundingBox() + new OrientedBoundingBox(), ); const expectedOrientedBoundingBox = shape.orientedBoundingBox; @@ -481,7 +481,7 @@ describe("Scene/VoxelBoxShape", function () { const modelMatrix = Matrix4.fromTranslationQuaternionRotationScale( translation, rotation, - scale + scale, ); const minBounds = VoxelBoxShape.DefaultMinBounds; const maxBounds = VoxelBoxShape.DefaultMaxBounds; @@ -506,14 +506,14 @@ describe("Scene/VoxelBoxShape", function () { tileX, tileY, tileZ, - new OrientedBoundingBox() + new OrientedBoundingBox(), ); expectedTranslation = new Cartesian3(-0.5, -0.5, -0.5); expect(orientedBoundingBox).toEqual( new OrientedBoundingBox( expectedTranslation, - Matrix3.fromScale(expectedScale, new Matrix3()) - ) + Matrix3.fromScale(expectedScale, new Matrix3()), + ), ); // Child (1, 0, 0) @@ -525,14 +525,14 @@ describe("Scene/VoxelBoxShape", function () { tileX, tileY, tileZ, - new OrientedBoundingBox() + new OrientedBoundingBox(), ); expectedTranslation = new Cartesian3(+0.5, -0.5, -0.5); expect(orientedBoundingBox).toEqual( new OrientedBoundingBox( expectedTranslation, - Matrix3.fromScale(expectedScale, new Matrix3()) - ) + Matrix3.fromScale(expectedScale, new Matrix3()), + ), ); // Child (0, 1, 0) @@ -544,14 +544,14 @@ describe("Scene/VoxelBoxShape", function () { tileX, tileY, tileZ, - new OrientedBoundingBox() + new OrientedBoundingBox(), ); expectedTranslation = new Cartesian3(-0.5, +0.5, -0.5); expect(orientedBoundingBox).toEqual( new OrientedBoundingBox( expectedTranslation, - Matrix3.fromScale(expectedScale, new Matrix3()) - ) + Matrix3.fromScale(expectedScale, new Matrix3()), + ), ); // Child (0, 0, 1) @@ -563,14 +563,14 @@ describe("Scene/VoxelBoxShape", function () { tileX, tileY, tileZ, - new OrientedBoundingBox() + new OrientedBoundingBox(), ); expectedTranslation = new Cartesian3(-0.5, -0.5, +0.5); expect(orientedBoundingBox).toEqual( new OrientedBoundingBox( expectedTranslation, - Matrix3.fromScale(expectedScale, new Matrix3()) - ) + Matrix3.fromScale(expectedScale, new Matrix3()), + ), ); // Child (1, 1, 0) @@ -582,14 +582,14 @@ describe("Scene/VoxelBoxShape", function () { tileX, tileY, tileZ, - new OrientedBoundingBox() + new OrientedBoundingBox(), ); expectedTranslation = new Cartesian3(+0.5, +0.5, -0.5); expect(orientedBoundingBox).toEqual( new OrientedBoundingBox( expectedTranslation, - Matrix3.fromScale(expectedScale, new Matrix3()) - ) + Matrix3.fromScale(expectedScale, new Matrix3()), + ), ); // Child (1, 0, 1) @@ -601,14 +601,14 @@ describe("Scene/VoxelBoxShape", function () { tileX, tileY, tileZ, - new OrientedBoundingBox() + new OrientedBoundingBox(), ); expectedTranslation = new Cartesian3(+0.5, -0.5, +0.5); expect(orientedBoundingBox).toEqual( new OrientedBoundingBox( expectedTranslation, - Matrix3.fromScale(expectedScale, new Matrix3()) - ) + Matrix3.fromScale(expectedScale, new Matrix3()), + ), ); // Child (1, 1, 1) @@ -620,14 +620,14 @@ describe("Scene/VoxelBoxShape", function () { tileX, tileY, tileZ, - new OrientedBoundingBox() + new OrientedBoundingBox(), ); expectedTranslation = new Cartesian3(+0.5, +0.5, +0.5); expect(orientedBoundingBox).toEqual( new OrientedBoundingBox( expectedTranslation, - Matrix3.fromScale(expectedScale, new Matrix3()) - ) + Matrix3.fromScale(expectedScale, new Matrix3()), + ), ); }); @@ -639,7 +639,7 @@ describe("Scene/VoxelBoxShape", function () { const modelMatrix = Matrix4.fromTranslationQuaternionRotationScale( translation, rotation, - scale + scale, ); const minBounds = VoxelBoxShape.DefaultMinBounds; const maxBounds = VoxelBoxShape.DefaultMaxBounds; @@ -656,7 +656,7 @@ describe("Scene/VoxelBoxShape", function () { tileX, tileY, tileZ, - new OrientedBoundingBox() + new OrientedBoundingBox(), ); }).toThrowDeveloperError(); @@ -666,7 +666,7 @@ describe("Scene/VoxelBoxShape", function () { undefined, tileY, tileZ, - new OrientedBoundingBox() + new OrientedBoundingBox(), ); }).toThrowDeveloperError(); @@ -676,7 +676,7 @@ describe("Scene/VoxelBoxShape", function () { tileX, undefined, tileZ, - new OrientedBoundingBox() + new OrientedBoundingBox(), ); }).toThrowDeveloperError(); @@ -686,7 +686,7 @@ describe("Scene/VoxelBoxShape", function () { tileX, tileY, undefined, - new OrientedBoundingBox() + new OrientedBoundingBox(), ); }).toThrowDeveloperError(); }); @@ -699,7 +699,7 @@ describe("Scene/VoxelBoxShape", function () { const modelMatrix = Matrix4.fromTranslationQuaternionRotationScale( translation, rotation, - scale + scale, ); const minBounds = VoxelBoxShape.DefaultMinBounds; const maxBounds = VoxelBoxShape.DefaultMaxBounds; @@ -716,7 +716,7 @@ describe("Scene/VoxelBoxShape", function () { tileX, tileY, tileZ, - undefined + undefined, ); }).toThrowDeveloperError(); }); @@ -729,7 +729,7 @@ describe("Scene/VoxelBoxShape", function () { const modelMatrix = Matrix4.fromTranslationQuaternionRotationScale( translation, rotation, - scale + scale, ); const minBounds = VoxelBoxShape.DefaultMinBounds; const maxBounds = VoxelBoxShape.DefaultMaxBounds; @@ -748,7 +748,7 @@ describe("Scene/VoxelBoxShape", function () { tileZ, undefined, shape, - paddedDimensions + paddedDimensions, ); const tileUv = new Cartesian3(0.5, 0.5, 0.5); @@ -756,12 +756,12 @@ describe("Scene/VoxelBoxShape", function () { spatialNode, tileDimensions, tileUv, - new OrientedBoundingBox() + new OrientedBoundingBox(), ); const expectedCenter = new Cartesian3(0.125, 0.125, 0.125); expect(sampleBoundingBox.center).toEqual(expectedCenter); expect(sampleBoundingBox.halfAxes).toEqual( - Matrix3.fromScale(new Cartesian3(0.125, 0.125, 0.125)) + Matrix3.fromScale(new Cartesian3(0.125, 0.125, 0.125)), ); }); @@ -773,7 +773,7 @@ describe("Scene/VoxelBoxShape", function () { const modelMatrix = Matrix4.fromTranslationQuaternionRotationScale( translation, rotation, - scale + scale, ); const minBounds = VoxelBoxShape.DefaultMinBounds; const maxBounds = VoxelBoxShape.DefaultMaxBounds; @@ -792,7 +792,7 @@ describe("Scene/VoxelBoxShape", function () { tileZ, undefined, shape, - paddedDimensions + paddedDimensions, ); const tileUv = new Cartesian3(0.5, 0.5, 0.5); @@ -801,7 +801,7 @@ describe("Scene/VoxelBoxShape", function () { undefined, tileDimensions, tileUv, - new OrientedBoundingBox() + new OrientedBoundingBox(), ); }).toThrowDeveloperError(); expect(function () { @@ -809,7 +809,7 @@ describe("Scene/VoxelBoxShape", function () { spatialNode, undefined, tileUv, - new OrientedBoundingBox() + new OrientedBoundingBox(), ); }).toThrowDeveloperError(); expect(function () { @@ -817,7 +817,7 @@ describe("Scene/VoxelBoxShape", function () { spatialNode, tileDimensions, undefined, - new OrientedBoundingBox() + new OrientedBoundingBox(), ); }).toThrowDeveloperError(); expect(function () { @@ -825,7 +825,7 @@ describe("Scene/VoxelBoxShape", function () { spatialNode, tileDimensions, tileUv, - undefined + undefined, ); }).toThrowDeveloperError(); }); diff --git a/packages/engine/Specs/Scene/VoxelCellSpec.js b/packages/engine/Specs/Scene/VoxelCellSpec.js index 7ffeffb0e214..a18af60b5e2f 100644 --- a/packages/engine/Specs/Scene/VoxelCellSpec.js +++ b/packages/engine/Specs/Scene/VoxelCellSpec.js @@ -51,7 +51,7 @@ describe("Scene/VoxelCell", function () { voxelPrimitive, tileIndex, sampleIndex, - keyframeNode + keyframeNode, ); expect(voxelCell instanceof VoxelCell).toBe(true); expect(voxelCell.primitive).toBe(voxelPrimitive); @@ -68,7 +68,7 @@ describe("Scene/VoxelCell", function () { undefined, tileIndex, sampleIndex, - keyframeNode + keyframeNode, ); }).toThrowDeveloperError(); expect(function () { @@ -76,7 +76,7 @@ describe("Scene/VoxelCell", function () { voxelPrimitive, tileIndex, undefined, - keyframeNode + keyframeNode, ); }).toThrowDeveloperError(); expect(function () { @@ -84,7 +84,7 @@ describe("Scene/VoxelCell", function () { undefined, tileIndex, sampleIndex, - undefined + undefined, ); }).toThrowDeveloperError(); }); @@ -97,7 +97,7 @@ describe("Scene/VoxelCell", function () { voxelPrimitive, tileIndex, sampleIndex, - keyframeNode + keyframeNode, ); expect(voxelCell.getNames()).toEqual(["a"]); expect(voxelCell.hasProperty("a")).toBe(true); @@ -112,19 +112,19 @@ describe("Scene/VoxelCell", function () { voxelPrimitive, tileIndex, sampleIndex, - keyframeNode + keyframeNode, ); const orientedBoundingBox = voxelCell.orientedBoundingBox; expect(orientedBoundingBox instanceof OrientedBoundingBox).toBe(true); const expectedCenter = new Cartesian3(0.5, 0.5, 0.5); expect(orientedBoundingBox.center).toEqualEpsilon( expectedCenter, - CesiumMath.EPSILON6 + CesiumMath.EPSILON6, ); const expectedHalfAxes = new Matrix3.fromUniformScale(0.5); expect(orientedBoundingBox.halfAxes).toEqualEpsilon( expectedHalfAxes, - CesiumMath.EPSILON6 + CesiumMath.EPSILON6, ); }); }); diff --git a/packages/engine/Specs/Scene/VoxelCylinderShapeSpec.js b/packages/engine/Specs/Scene/VoxelCylinderShapeSpec.js index 943eb8d6b0cc..224fbc926397 100644 --- a/packages/engine/Specs/Scene/VoxelCylinderShapeSpec.js +++ b/packages/engine/Specs/Scene/VoxelCylinderShapeSpec.js @@ -31,7 +31,7 @@ describe("Scene/VoxelCylinderShape", function () { const modelMatrix = Matrix4.fromTranslationQuaternionRotationScale( translation, rotation, - scale + scale, ); const minBounds = VoxelCylinderShape.DefaultMinBounds; const maxBounds = VoxelCylinderShape.DefaultMaxBounds; @@ -50,19 +50,19 @@ describe("Scene/VoxelCylinderShape", function () { 0.0, 0.0, scale.z, - ]) + ]), ); const expectedBoundingSphere = new BoundingSphere( translation, - Cartesian3.magnitude(scale) + Cartesian3.magnitude(scale), ); expect(shape.orientedBoundingBox.center).toEqual( - expectedOrientedBoundingBox.center + expectedOrientedBoundingBox.center, ); expect(shape.orientedBoundingBox.halfAxes).toEqualEpsilon( expectedOrientedBoundingBox.halfAxes, - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); expect(shape.boundingSphere).toEqual(expectedBoundingSphere); expect(shape.boundTransform).toEqual(modelMatrix); @@ -79,7 +79,7 @@ describe("Scene/VoxelCylinderShape", function () { translation, rotation, scale, - new Matrix4() + new Matrix4(), ); // Half revolution @@ -104,50 +104,50 @@ describe("Scene/VoxelCylinderShape", function () { const expectedScale = new Cartesian3( 0.5 * (expectedMaxY - expectedMinY), 0.5 * (expectedMaxX - expectedMinX), - 0.5 * (expectedMaxZ - expectedMinZ) + 0.5 * (expectedMaxZ - expectedMinZ), ); const expectedTranslation = new Cartesian3( 0.5 * (expectedMaxX + expectedMinX), 0.5 * (expectedMaxY + expectedMinY), - 0.5 * (expectedMaxZ + expectedMinZ) + 0.5 * (expectedMaxZ + expectedMinZ), ); const expectedRotation = Matrix3.fromRotationZ(-CesiumMath.PI_OVER_TWO); const expectedHalfAxes = Matrix3.multiplyByScale( expectedRotation, expectedScale, - new Matrix3() + new Matrix3(), ); const expectedOrientedBoundingBox = new OrientedBoundingBox( expectedTranslation, - expectedHalfAxes + expectedHalfAxes, ); const expectedBoundingSphere = new BoundingSphere( expectedTranslation, - Cartesian3.magnitude(expectedScale) + Cartesian3.magnitude(expectedScale), ); const expectedBoundTransform = Matrix4.setTranslation( Matrix4.fromRotation(expectedHalfAxes), expectedTranslation, - new Matrix4() + new Matrix4(), ); expect(shape.orientedBoundingBox.center).toEqualEpsilon( expectedOrientedBoundingBox.center, - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); expect(shape.orientedBoundingBox.halfAxes).toEqualEpsilon( expectedOrientedBoundingBox.halfAxes, - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); expect(shape.boundingSphere).toEqualEpsilon( expectedBoundingSphere, - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); expect(shape.boundTransform).toEqualEpsilon( expectedBoundTransform, - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); expect(shape.shapeTransform).toEqual(modelMatrix); expect(visible).toBeTrue(); @@ -162,7 +162,7 @@ describe("Scene/VoxelCylinderShape", function () { translation, rotation, scale, - new Matrix4() + new Matrix4(), ); // Half revolution around 180th meridian @@ -173,12 +173,12 @@ describe("Scene/VoxelCylinderShape", function () { const minBounds = new Cartesian3( defaultMinBounds.x, defaultMinBounds.y, - minAngle + minAngle, ); const maxBounds = new Cartesian3( defaultMaxBounds.x, defaultMaxBounds.y, - maxAngle + maxAngle, ); const visible = shape.update(modelMatrix, minBounds, maxBounds); @@ -188,38 +188,38 @@ describe("Scene/VoxelCylinderShape", function () { const expectedHalfAxes = Matrix3.multiplyByScale( expectedRotation, expectedScale, - new Matrix3() + new Matrix3(), ); const expectedOrientedBoundingBox = new OrientedBoundingBox( expectedTranslation, - expectedHalfAxes + expectedHalfAxes, ); const expectedBoundingSphere = new BoundingSphere( expectedTranslation, - Cartesian3.magnitude(expectedScale) + Cartesian3.magnitude(expectedScale), ); const expectedBoundTransform = Matrix4.setTranslation( Matrix4.fromRotation(expectedHalfAxes), expectedTranslation, - new Matrix4() + new Matrix4(), ); expect(shape.orientedBoundingBox.center).toEqualEpsilon( expectedOrientedBoundingBox.center, - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); expect(shape.orientedBoundingBox.halfAxes).toEqualEpsilon( expectedOrientedBoundingBox.halfAxes, - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); expect(shape.boundingSphere).toEqualEpsilon( expectedBoundingSphere, - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); expect(shape.boundTransform).toEqualEpsilon( expectedBoundTransform, - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); expect(shape.shapeTransform).toEqual(modelMatrix); expect(visible).toBeTrue(); @@ -235,7 +235,7 @@ describe("Scene/VoxelCylinderShape", function () { translation, rotation, scale, - new Matrix4() + new Matrix4(), ); // Half revolution @@ -254,7 +254,7 @@ describe("Scene/VoxelCylinderShape", function () { expect(result.center.z).toEqual(3.0); expect(result.halfAxes).toEqualEpsilon( new Matrix3(0, 1.5, 0, -1.125, 0, 0, 0, 0, 2), - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); }); @@ -266,7 +266,7 @@ describe("Scene/VoxelCylinderShape", function () { const modelMatrix = Matrix4.fromTranslationQuaternionRotationScale( translation, rotation, - scale + scale, ); const minBounds = VoxelCylinderShape.DefaultMinBounds; const maxBounds = VoxelCylinderShape.DefaultMaxBounds; @@ -298,7 +298,7 @@ describe("Scene/VoxelCylinderShape", function () { const modelMatrix = Matrix4.fromTranslationQuaternionRotationScale( translation, rotation, - scale + scale, ); const minBounds = VoxelCylinderShape.DefaultMinBounds; const maxBounds = VoxelCylinderShape.DefaultMaxBounds; @@ -317,7 +317,7 @@ describe("Scene/VoxelCylinderShape", function () { tileZ, undefined, shape, - paddedDimensions + paddedDimensions, ); const tileUv = new Cartesian3(0.5, 0.5, 0.5); @@ -325,18 +325,18 @@ describe("Scene/VoxelCylinderShape", function () { spatialNode, tileDimensions, tileUv, - new OrientedBoundingBox() + new OrientedBoundingBox(), ); const centerAngle = Math.PI / 8.0; const centerRadius = 0.5434699; const expectedCenter = new Cartesian3( centerRadius * Math.cos(centerAngle), centerRadius * Math.sin(centerAngle), - 0.125 + 0.125, ); expect(sampleBoundingBox.center).toEqualEpsilon( expectedCenter, - CesiumMath.EPSILON6 + CesiumMath.EPSILON6, ); const expectedHalfAxes = new Matrix3( 0.075324, @@ -347,11 +347,11 @@ describe("Scene/VoxelCylinderShape", function () { 0.0, 0.0, 0.0, - 0.125 + 0.125, ); expect(sampleBoundingBox.halfAxes).toEqualEpsilon( expectedHalfAxes, - CesiumMath.EPSILON6 + CesiumMath.EPSILON6, ); }); @@ -363,7 +363,7 @@ describe("Scene/VoxelCylinderShape", function () { const modelMatrix = Matrix4.fromTranslationQuaternionRotationScale( translation, rotation, - scale + scale, ); const minBounds = VoxelCylinderShape.DefaultMinBounds; const maxBounds = VoxelCylinderShape.DefaultMaxBounds; @@ -382,7 +382,7 @@ describe("Scene/VoxelCylinderShape", function () { tileZ, undefined, shape, - paddedDimensions + paddedDimensions, ); const tileUv = new Cartesian3(0.5, 0.5, 0.5); @@ -391,7 +391,7 @@ describe("Scene/VoxelCylinderShape", function () { undefined, tileDimensions, tileUv, - new OrientedBoundingBox() + new OrientedBoundingBox(), ); }).toThrowDeveloperError(); expect(function () { @@ -399,7 +399,7 @@ describe("Scene/VoxelCylinderShape", function () { spatialNode, undefined, tileUv, - new OrientedBoundingBox() + new OrientedBoundingBox(), ); }).toThrowDeveloperError(); expect(function () { @@ -407,7 +407,7 @@ describe("Scene/VoxelCylinderShape", function () { spatialNode, tileDimensions, undefined, - new OrientedBoundingBox() + new OrientedBoundingBox(), ); }).toThrowDeveloperError(); expect(function () { @@ -415,7 +415,7 @@ describe("Scene/VoxelCylinderShape", function () { spatialNode, tileDimensions, tileUv, - undefined + undefined, ); }).toThrowDeveloperError(); }); diff --git a/packages/engine/Specs/Scene/VoxelEllipsoidShapeSpec.js b/packages/engine/Specs/Scene/VoxelEllipsoidShapeSpec.js index 22aeedcd5b54..bfd80ac66e58 100644 --- a/packages/engine/Specs/Scene/VoxelEllipsoidShapeSpec.js +++ b/packages/engine/Specs/Scene/VoxelEllipsoidShapeSpec.js @@ -31,18 +31,18 @@ describe("Scene/VoxelEllipsoidShape", function () { const modelMatrix = Matrix4.fromTranslationQuaternionRotationScale( translation, rotation, - scale + scale, ); const minBounds = new Cartesian3( -CesiumMath.PI, -CesiumMath.PI_OVER_TWO, - 0.0 + 0.0, ); const maxBounds = new Cartesian3( +CesiumMath.PI, +CesiumMath.PI_OVER_TWO, - 100000 + 100000, ); const maxHeight = maxBounds.z; @@ -58,35 +58,35 @@ describe("Scene/VoxelEllipsoidShape", function () { (scale.x + maxHeight) * Math.sin(angle), (scale.y + maxHeight) * Math.cos(angle), 0.0, - ]) + ]), ); const expectedBoundingSphere = BoundingSphere.fromOrientedBoundingBox( expectedOrientedBoundingBox, - new BoundingSphere() + new BoundingSphere(), ); const visible = shape.update(modelMatrix, minBounds, maxBounds); expect(shape.orientedBoundingBox.center).toEqual( - expectedOrientedBoundingBox.center + expectedOrientedBoundingBox.center, ); expect(shape.orientedBoundingBox.halfAxes).toEqualEpsilon( expectedOrientedBoundingBox.halfAxes, - CesiumMath.EPSILON9 + CesiumMath.EPSILON9, ); expect(shape.boundingSphere).toEqual(expectedBoundingSphere); expect( - Matrix4.getTranslation(shape.boundTransform, new Cartesian3()) + Matrix4.getTranslation(shape.boundTransform, new Cartesian3()), ).toEqualEpsilon(expectedOrientedBoundingBox.center, CesiumMath.EPSILON12); expect( - Matrix4.getMatrix3(shape.boundTransform, new Matrix3()) + Matrix4.getMatrix3(shape.boundTransform, new Matrix3()), ).toEqualEpsilon(expectedOrientedBoundingBox.halfAxes, CesiumMath.EPSILON9); expect( - Matrix4.getTranslation(shape.shapeTransform, new Cartesian3()) + Matrix4.getTranslation(shape.shapeTransform, new Cartesian3()), ).toEqualEpsilon(expectedOrientedBoundingBox.center, CesiumMath.EPSILON12); const expectedShapeTransform = Matrix4.fromRowMajorArray([ @@ -109,7 +109,7 @@ describe("Scene/VoxelEllipsoidShape", function () { ]); expect(shape.shapeTransform).toEqualEpsilon( expectedShapeTransform, - CesiumMath.EPSILON9 + CesiumMath.EPSILON9, ); expect(visible).toBeTrue(); }); @@ -122,18 +122,18 @@ describe("Scene/VoxelEllipsoidShape", function () { const modelMatrix = Matrix4.fromTranslationQuaternionRotationScale( translation, rotation, - scale + scale, ); const minBounds = new Cartesian3( -CesiumMath.PI, -CesiumMath.PI_OVER_TWO, - -0.5 + -0.5, ); const maxBounds = new Cartesian3( CesiumMath.PI, CesiumMath.PI_OVER_TWO, - 0.0 + 0.0, ); shape.update(modelMatrix, minBounds, maxBounds); let result = new OrientedBoundingBox(); @@ -143,7 +143,7 @@ describe("Scene/VoxelEllipsoidShape", function () { const expectedHalfAxes = new Matrix3(0, 0, 1, 1, 0, 0, 0, 1, 0); expect(result.halfAxes).toEqualEpsilon( expectedHalfAxes, - CesiumMath.EPSILON12 + CesiumMath.EPSILON12, ); }); @@ -155,7 +155,7 @@ describe("Scene/VoxelEllipsoidShape", function () { const modelMatrix = Matrix4.fromTranslationQuaternionRotationScale( translation, rotation, - scale + scale, ); const minBounds = VoxelEllipsoidShape.DefaultMinBounds; const maxBounds = VoxelEllipsoidShape.DefaultMaxBounds; @@ -187,17 +187,17 @@ describe("Scene/VoxelEllipsoidShape", function () { const modelMatrix = Matrix4.fromTranslationQuaternionRotationScale( translation, rotation, - scale + scale, ); const minBounds = new Cartesian3( -CesiumMath.PI, -CesiumMath.PI_OVER_TWO, - -1.0 + -1.0, ); const maxBounds = new Cartesian3( CesiumMath.PI, CesiumMath.PI_OVER_TWO, - 0.0 + 0.0, ); shape.update(modelMatrix, minBounds, maxBounds); @@ -214,7 +214,7 @@ describe("Scene/VoxelEllipsoidShape", function () { tileZ, undefined, shape, - paddedDimensions + paddedDimensions, ); const tileUv = new Cartesian3(0.5, 0.5, 0.5); @@ -222,7 +222,7 @@ describe("Scene/VoxelEllipsoidShape", function () { spatialNode, tileDimensions, tileUv, - new OrientedBoundingBox() + new OrientedBoundingBox(), ); const centerLongitude = Math.PI / 16.0; @@ -231,11 +231,11 @@ describe("Scene/VoxelEllipsoidShape", function () { const expectedCenter = new Cartesian3( centerRadius * Math.cos(centerLongitude) * Math.cos(centerLatitude), centerRadius * Math.sin(centerLongitude) * Math.cos(centerLatitude), - centerRadius * Math.sin(centerLatitude) + centerRadius * Math.sin(centerLatitude), ); expect(sampleBoundingBox.center).toEqualEpsilon( expectedCenter, - CesiumMath.EPSILON2 + CesiumMath.EPSILON2, ); }); @@ -247,17 +247,17 @@ describe("Scene/VoxelEllipsoidShape", function () { const modelMatrix = Matrix4.fromTranslationQuaternionRotationScale( translation, rotation, - scale + scale, ); const minBounds = new Cartesian3( -CesiumMath.PI, -CesiumMath.PI_OVER_TWO, - -1.0 + -1.0, ); const maxBounds = new Cartesian3( CesiumMath.PI, CesiumMath.PI_OVER_TWO, - 0.0 + 0.0, ); shape.update(modelMatrix, minBounds, maxBounds); @@ -274,7 +274,7 @@ describe("Scene/VoxelEllipsoidShape", function () { tileZ, undefined, shape, - paddedDimensions + paddedDimensions, ); const tileUv = new Cartesian3(0.5, 0.5, 0.5); @@ -284,7 +284,7 @@ describe("Scene/VoxelEllipsoidShape", function () { undefined, tileDimensions, tileUv, - result + result, ); }).toThrowDeveloperError(); expect(function () { @@ -292,7 +292,7 @@ describe("Scene/VoxelEllipsoidShape", function () { spatialNode, undefined, tileUv, - result + result, ); }).toThrowDeveloperError(); expect(function () { @@ -300,7 +300,7 @@ describe("Scene/VoxelEllipsoidShape", function () { spatialNode, tileDimensions, undefined, - result + result, ); }).toThrowDeveloperError(); expect(function () { @@ -308,7 +308,7 @@ describe("Scene/VoxelEllipsoidShape", function () { spatialNode, tileDimensions, tileUv, - undefined + undefined, ); }).toThrowDeveloperError(); }); diff --git a/packages/engine/Specs/Scene/VoxelPrimitiveSpec.js b/packages/engine/Specs/Scene/VoxelPrimitiveSpec.js index d41713eca959..3c55516d198b 100644 --- a/packages/engine/Specs/Scene/VoxelPrimitiveSpec.js +++ b/packages/engine/Specs/Scene/VoxelPrimitiveSpec.js @@ -22,7 +22,7 @@ describe( camera.direction = Cartesian3.fromElements(1, 1, 1); provider = await Cesium3DTilesVoxelProvider.fromUrl( - "./Data/Cesium3DTiles/Voxel/VoxelEllipsoid3DTiles/tileset.json" + "./Data/Cesium3DTiles/Voxel/VoxelEllipsoid3DTiles/tileset.json", ); return provider; }); @@ -140,7 +140,7 @@ describe( it("applies vertical exaggeration to box-shaped voxels by scaling the model matrix", async function () { const boxProvider = await Cesium3DTilesVoxelProvider.fromUrl( - "./Data/Cesium3DTiles/Voxel/VoxelBox3DTiles/tileset.json" + "./Data/Cesium3DTiles/Voxel/VoxelBox3DTiles/tileset.json", ); const primitive = new VoxelPrimitive({ provider: boxProvider }); scene.primitives.add(primitive); @@ -156,7 +156,7 @@ describe( const expectedModelMatrix = Matrix4.multiplyByScale( modelMatrix, scalar, - new Matrix4() + new Matrix4(), ); expect(primitive._exaggeratedModelMatrix).toEqual(expectedModelMatrix); }); @@ -220,5 +220,5 @@ describe( expect(primitive._traversal).toBeUndefined(); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/VoxelShapeTypeSpec.js b/packages/engine/Specs/Scene/VoxelShapeTypeSpec.js index 94762a25d0c6..965c256bcb1d 100644 --- a/packages/engine/Specs/Scene/VoxelShapeTypeSpec.js +++ b/packages/engine/Specs/Scene/VoxelShapeTypeSpec.js @@ -8,13 +8,13 @@ import { describe("Scene/VoxelShapeType", function () { it("getMinBounds works", function () { expect(VoxelShapeType.getMinBounds(VoxelShapeType.BOX)).toEqual( - VoxelBoxShape.DefaultMinBounds + VoxelBoxShape.DefaultMinBounds, ); expect(VoxelShapeType.getMinBounds(VoxelShapeType.ELLIPSOID)).toEqual( - VoxelEllipsoidShape.DefaultMinBounds + VoxelEllipsoidShape.DefaultMinBounds, ); expect(VoxelShapeType.getMinBounds(VoxelShapeType.CYLINDER)).toEqual( - VoxelCylinderShape.DefaultMinBounds + VoxelCylinderShape.DefaultMinBounds, ); }); @@ -26,13 +26,13 @@ describe("Scene/VoxelShapeType", function () { it("getMaxBounds works", function () { expect(VoxelShapeType.getMaxBounds(VoxelShapeType.BOX)).toEqual( - VoxelBoxShape.DefaultMaxBounds + VoxelBoxShape.DefaultMaxBounds, ); expect(VoxelShapeType.getMaxBounds(VoxelShapeType.ELLIPSOID)).toEqual( - VoxelEllipsoidShape.DefaultMaxBounds + VoxelEllipsoidShape.DefaultMaxBounds, ); expect(VoxelShapeType.getMaxBounds(VoxelShapeType.CYLINDER)).toEqual( - VoxelCylinderShape.DefaultMaxBounds + VoxelCylinderShape.DefaultMaxBounds, ); }); @@ -44,13 +44,13 @@ describe("Scene/VoxelShapeType", function () { it("getShapeConstructor works", function () { expect(VoxelShapeType.getShapeConstructor(VoxelShapeType.BOX)).toBe( - VoxelBoxShape + VoxelBoxShape, ); expect(VoxelShapeType.getShapeConstructor(VoxelShapeType.ELLIPSOID)).toBe( - VoxelEllipsoidShape + VoxelEllipsoidShape, ); expect(VoxelShapeType.getShapeConstructor(VoxelShapeType.CYLINDER)).toBe( - VoxelCylinderShape + VoxelCylinderShape, ); }); diff --git a/packages/engine/Specs/Scene/VoxelTraversalSpec.js b/packages/engine/Specs/Scene/VoxelTraversalSpec.js index cd61469689eb..c70e0dc1b73c 100644 --- a/packages/engine/Specs/Scene/VoxelTraversalSpec.js +++ b/packages/engine/Specs/Scene/VoxelTraversalSpec.js @@ -36,7 +36,7 @@ describe( beforeEach(async function () { scene = createScene(); provider = await Cesium3DTilesVoxelProvider.fromUrl( - "./Data/Cesium3DTiles/Voxel/VoxelEllipsoid3DTiles/tileset.json" + "./Data/Cesium3DTiles/Voxel/VoxelEllipsoid3DTiles/tileset.json", ); camera = scene.camera; @@ -55,7 +55,7 @@ describe( provider.types, provider.componentTypes, keyframeCount, - textureMemory + textureMemory, ); }); @@ -80,7 +80,7 @@ describe( shape.update( modelMatrix, VoxelEllipsoidShape.DefaultMinBounds, - VoxelEllipsoidShape.DefaultMaxBounds + VoxelEllipsoidShape.DefaultMaxBounds, ); const keyFrameLocation = 0; const recomputeBoundingVolumes = true; @@ -89,14 +89,14 @@ describe( scene.frameState, keyFrameLocation, recomputeBoundingVolumes, - pauseUpdate + pauseUpdate, ); const newOrientedBoundingBox = rootNode.orientedBoundingBox.clone(); expect( OrientedBoundingBox.equals( oldOrientedBoundingBox, - newOrientedBoundingBox - ) + newOrientedBoundingBox, + ), ).toBe(false); expect(newOrientedBoundingBox.center.equals(translation)).toBe(true); }); @@ -109,11 +109,11 @@ describe( const rootNode = traversal.rootNode; rootNode.computeScreenSpaceError( camera.positionWC, - screenSpaceErrorMultiplier + screenSpaceErrorMultiplier, ); let distanceToCamera = Math.sqrt( - rootNode.orientedBoundingBox.distanceSquaredTo(camera.positionWC) + rootNode.orientedBoundingBox.distanceSquaredTo(camera.positionWC), ); distanceToCamera = Math.max(distanceToCamera, CesiumMath.EPSILON7); const error = @@ -128,7 +128,7 @@ describe( const visibilityWhenLookingAtRoot = rootNode.visibility( scene.frameState, - visibilityPlaneMask + visibilityPlaneMask, ); expect(visibilityWhenLookingAtRoot).toBe(CullingVolume.MASK_INSIDE); // expect(traversal.isRenderable(rootNode)).toBe(true); @@ -136,7 +136,7 @@ describe( turnCameraAround(scene); const visibilityWhenLookingAway = rootNode.visibility( scene.frameState, - visibilityPlaneMask + visibilityPlaneMask, ); expect(visibilityWhenLookingAway).toBe(CullingVolume.MASK_OUTSIDE); }); @@ -156,7 +156,7 @@ describe( scene.frameState, keyFrameLocation, recomputeBoundingVolumes, - pauseUpdate + pauseUpdate, ); scene.renderForSpecs(); return traversal.megatextures[0].occupiedCount > 0; @@ -175,7 +175,7 @@ describe( scene.frameState, keyFrameLocation, recomputeBoundingVolumes, - pauseUpdate + pauseUpdate, ); scene.renderForSpecs(); return traversal.megatextures[0].occupiedCount > 0; @@ -200,7 +200,7 @@ describe( scene.frameState, keyFrameLocation, recomputeBoundingVolumes, - pauseUpdate + pauseUpdate, ); } for (let i = 0; i < 10; i++) { @@ -212,12 +212,12 @@ describe( const bottomLeftNearCorner = Cartesian3.fromElements( -0.5 - eps, -0.5 - eps, - -0.5 - eps + -0.5 - eps, ); const topRightFarCorner = Cartesian3.fromElements( 0.5 + eps, 0.5 + eps, - 0.5 + eps + 0.5 + eps, ); scene.camera.position = bottomLeftNearCorner; updateTraversalTenTimes(); @@ -245,5 +245,5 @@ describe( expect(nodeNoLongerInMegatexture).toBe(true); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/WebMapServiceImageryProviderSpec.js b/packages/engine/Specs/Scene/WebMapServiceImageryProviderSpec.js index fe750f3c4347..70835d7063b5 100644 --- a/packages/engine/Specs/Scene/WebMapServiceImageryProviderSpec.js +++ b/packages/engine/Specs/Scene/WebMapServiceImageryProviderSpec.js @@ -91,20 +91,18 @@ describe("Scene/WebMapServiceImageryProvider", function () { }, }); - spyOn(Resource._Implementations, "createImage").and.callFake(function ( - request, - crossOrigin, - deferred - ) { - const uri = new Uri(request.url); - const params = queryToObject(uri.query()); - expect(params.something).toEqual("foo"); - expect(params.another).toEqual("false"); - expect(params.version).toEqual("1.3.0"); - - // Don't need to actually load image, but satisfy the request. - deferred.resolve(true); - }); + spyOn(Resource._Implementations, "createImage").and.callFake( + function (request, crossOrigin, deferred) { + const uri = new Uri(request.url); + const params = queryToObject(uri.query()); + expect(params.something).toEqual("foo"); + expect(params.another).toEqual("false"); + expect(params.version).toEqual("1.3.0"); + + // Don't need to actually load image, but satisfy the request. + deferred.resolve(true); + }, + ); return provider.requestImage(0, 0, 0).then(function (image) { expect(Resource._Implementations.createImage).toHaveBeenCalled(); @@ -121,19 +119,17 @@ describe("Scene/WebMapServiceImageryProvider", function () { }, }); - spyOn(Resource._Implementations, "createImage").and.callFake(function ( - request, - crossOrigin, - deferred - ) { - const uri = new Uri(request.url); - const params = queryToObject(uri.query()); - expect(params.crs).toEqual("CRS:27"); - expect(params.version).toEqual("1.3.0"); + spyOn(Resource._Implementations, "createImage").and.callFake( + function (request, crossOrigin, deferred) { + const uri = new Uri(request.url); + const params = queryToObject(uri.query()); + expect(params.crs).toEqual("CRS:27"); + expect(params.version).toEqual("1.3.0"); - // Don't need to actually load image, but satisfy the request. - deferred.resolve(true); - }); + // Don't need to actually load image, but satisfy the request. + deferred.resolve(true); + }, + ); return provider.requestImage(0, 0, 0).then(function (image) { expect(Resource._Implementations.createImage).toHaveBeenCalled(); @@ -150,20 +146,18 @@ describe("Scene/WebMapServiceImageryProvider", function () { }, }); - spyOn(Resource._Implementations, "createImage").and.callFake(function ( - request, - crossOrigin, - deferred - ) { - const uri = new Uri(request.url); - const params = queryToObject(uri.query()); - expect(params.crs).toEqual("EPSG:4326"); - expect(params.version).toEqual("1.3.0"); - expect(params.bbox).toEqual("-90,-180,90,0"); + spyOn(Resource._Implementations, "createImage").and.callFake( + function (request, crossOrigin, deferred) { + const uri = new Uri(request.url); + const params = queryToObject(uri.query()); + expect(params.crs).toEqual("EPSG:4326"); + expect(params.version).toEqual("1.3.0"); + expect(params.bbox).toEqual("-90,-180,90,0"); - // Don't need to actually load image, but satisfy the request. - deferred.resolve(true); - }); + // Don't need to actually load image, but satisfy the request. + deferred.resolve(true); + }, + ); return provider.requestImage(0, 0, 0).then(function (image) { expect(Resource._Implementations.createImage).toHaveBeenCalled(); @@ -180,20 +174,18 @@ describe("Scene/WebMapServiceImageryProvider", function () { }, }); - spyOn(Resource._Implementations, "createImage").and.callFake(function ( - request, - crossOrigin, - deferred - ) { - const uri = new Uri(request.url); - const params = queryToObject(uri.query()); - expect(params.crs).toEqual("EPSG:4321"); - expect(params.version).toEqual("1.3.0"); - expect(params.bbox).toEqual("-90,-180,90,0"); + spyOn(Resource._Implementations, "createImage").and.callFake( + function (request, crossOrigin, deferred) { + const uri = new Uri(request.url); + const params = queryToObject(uri.query()); + expect(params.crs).toEqual("EPSG:4321"); + expect(params.version).toEqual("1.3.0"); + expect(params.bbox).toEqual("-90,-180,90,0"); - // Don't need to actually load image, but satisfy the request. - deferred.resolve(true); - }); + // Don't need to actually load image, but satisfy the request. + deferred.resolve(true); + }, + ); return provider.requestImage(0, 0, 0).then(function (image) { expect(Resource._Implementations.createImage).toHaveBeenCalled(); @@ -210,20 +202,18 @@ describe("Scene/WebMapServiceImageryProvider", function () { }, }); - spyOn(Resource._Implementations, "createImage").and.callFake(function ( - request, - crossOrigin, - deferred - ) { - const uri = new Uri(request.url); - const params = queryToObject(uri.query()); - expect(params.crs).toEqual("EPSG:3035"); - expect(params.version).toEqual("1.3.0"); - expect(params.bbox).toEqual("-90,-180,90,0"); + spyOn(Resource._Implementations, "createImage").and.callFake( + function (request, crossOrigin, deferred) { + const uri = new Uri(request.url); + const params = queryToObject(uri.query()); + expect(params.crs).toEqual("EPSG:3035"); + expect(params.version).toEqual("1.3.0"); + expect(params.bbox).toEqual("-90,-180,90,0"); - // Don't need to actually load image, but satisfy the request. - deferred.resolve(true); - }); + // Don't need to actually load image, but satisfy the request. + deferred.resolve(true); + }, + ); return provider.requestImage(0, 0, 0).then(function (image) { expect(Resource._Implementations.createImage).toHaveBeenCalled(); @@ -240,20 +230,18 @@ describe("Scene/WebMapServiceImageryProvider", function () { }, }); - spyOn(Resource._Implementations, "createImage").and.callFake(function ( - request, - crossOrigin, - deferred - ) { - const uri = new Uri(request.url); - const params = queryToObject(uri.query()); - expect(params.crs).toEqual("EPSG:4559"); - expect(params.version).toEqual("1.3.0"); - expect(params.bbox).toEqual("-180,-90,0,90"); + spyOn(Resource._Implementations, "createImage").and.callFake( + function (request, crossOrigin, deferred) { + const uri = new Uri(request.url); + const params = queryToObject(uri.query()); + expect(params.crs).toEqual("EPSG:4559"); + expect(params.version).toEqual("1.3.0"); + expect(params.bbox).toEqual("-180,-90,0,90"); - // Don't need to actually load image, but satisfy the request. - deferred.resolve(true); - }); + // Don't need to actually load image, but satisfy the request. + deferred.resolve(true); + }, + ); return provider.requestImage(0, 0, 0).then(function (image) { expect(Resource._Implementations.createImage).toHaveBeenCalled(); @@ -270,19 +258,17 @@ describe("Scene/WebMapServiceImageryProvider", function () { }, }); - spyOn(Resource._Implementations, "createImage").and.callFake(function ( - request, - crossOrigin, - deferred - ) { - const uri = new Uri(request.url); - const params = queryToObject(uri.query()); - expect(params.srs).toEqual("EPSG:4326"); - expect(params.version).toEqual("1.1.0"); + spyOn(Resource._Implementations, "createImage").and.callFake( + function (request, crossOrigin, deferred) { + const uri = new Uri(request.url); + const params = queryToObject(uri.query()); + expect(params.srs).toEqual("EPSG:4326"); + expect(params.version).toEqual("1.1.0"); - // Don't need to actually load image, but satisfy the request. - deferred.resolve(true); - }); + // Don't need to actually load image, but satisfy the request. + deferred.resolve(true); + }, + ); return provider.requestImage(0, 0, 0).then(function (image) { expect(Resource._Implementations.createImage).toHaveBeenCalled(); @@ -299,19 +285,17 @@ describe("Scene/WebMapServiceImageryProvider", function () { }, }); - spyOn(Resource._Implementations, "createImage").and.callFake(function ( - request, - crossOrigin, - deferred - ) { - const uri = new Uri(request.url); - const params = queryToObject(uri.query()); - expect(params.srs).toEqual("IAU2000:30118"); - expect(params.version).toEqual("1.1.0"); + spyOn(Resource._Implementations, "createImage").and.callFake( + function (request, crossOrigin, deferred) { + const uri = new Uri(request.url); + const params = queryToObject(uri.query()); + expect(params.srs).toEqual("IAU2000:30118"); + expect(params.version).toEqual("1.1.0"); - // Don't need to actually load image, but satisfy the request. - deferred.resolve(true); - }); + // Don't need to actually load image, but satisfy the request. + deferred.resolve(true); + }, + ); return provider.requestImage(0, 0, 0).then(function (image) { expect(Resource._Implementations.createImage).toHaveBeenCalled(); @@ -328,20 +312,18 @@ describe("Scene/WebMapServiceImageryProvider", function () { }, }); - spyOn(Resource._Implementations, "createImage").and.callFake(function ( - request, - crossOrigin, - deferred - ) { - const uri = new Uri(request.url); - const params = queryToObject(uri.query()); - expect(params.srs).toEqual("EPSG:4326"); - expect(params.version).toEqual("1.1.0"); - expect(params.bbox).toEqual("-180,-90,0,90"); + spyOn(Resource._Implementations, "createImage").and.callFake( + function (request, crossOrigin, deferred) { + const uri = new Uri(request.url); + const params = queryToObject(uri.query()); + expect(params.srs).toEqual("EPSG:4326"); + expect(params.version).toEqual("1.1.0"); + expect(params.bbox).toEqual("-180,-90,0,90"); - // Don't need to actually load image, but satisfy the request. - deferred.resolve(true); - }); + // Don't need to actually load image, but satisfy the request. + deferred.resolve(true); + }, + ); return provider.requestImage(0, 0, 0).then(function (image) { expect(Resource._Implementations.createImage).toHaveBeenCalled(); @@ -373,7 +355,7 @@ describe("Scene/WebMapServiceImageryProvider", function () { provider.requestImage(0, 0, 0); const url = ImageryProvider.loadImage.calls.mostRecent().args[1].url; expect(["foo", "bar"].indexOf(url.substring(0, 3))).toBeGreaterThanOrEqual( - 0 + 0, ); }); @@ -383,17 +365,15 @@ describe("Scene/WebMapServiceImageryProvider", function () { layers: "someLayer", }); - spyOn(Resource._Implementations, "createImage").and.callFake(function ( - request, - crossOrigin, - deferred - ) { - const questionMarkCount = request.url.match(/\?/g).length; - expect(questionMarkCount).toEqual(1); + spyOn(Resource._Implementations, "createImage").and.callFake( + function (request, crossOrigin, deferred) { + const questionMarkCount = request.url.match(/\?/g).length; + expect(questionMarkCount).toEqual(1); - // Don't need to actually load image, but satisfy the request. - deferred.resolve(true); - }); + // Don't need to actually load image, but satisfy the request. + deferred.resolve(true); + }, + ); return provider.requestImage(0, 0, 0).then(function (image) { expect(Resource._Implementations.createImage).toHaveBeenCalled(); @@ -406,19 +386,17 @@ describe("Scene/WebMapServiceImageryProvider", function () { layers: "someLayer", }); - spyOn(Resource._Implementations, "createImage").and.callFake(function ( - request, - crossOrigin, - deferred - ) { - const url = request.url; - const questionMarkCount = url.match(/\?/g).length; - expect(questionMarkCount).toEqual(1); - expect(url).not.toContain("&&"); + spyOn(Resource._Implementations, "createImage").and.callFake( + function (request, crossOrigin, deferred) { + const url = request.url; + const questionMarkCount = url.match(/\?/g).length; + expect(questionMarkCount).toEqual(1); + expect(url).not.toContain("&&"); - // Don't need to actually load image, but satisfy the request. - deferred.resolve(true); - }); + // Don't need to actually load image, but satisfy the request. + deferred.resolve(true); + }, + ); return provider.requestImage(0, 0, 0).then(function (image) { expect(Resource._Implementations.createImage).toHaveBeenCalled(); @@ -431,22 +409,20 @@ describe("Scene/WebMapServiceImageryProvider", function () { layers: "someLayer", }); - spyOn(Resource._Implementations, "createImage").and.callFake(function ( - request, - crossOrigin, - deferred - ) { - const url = request.url; - const questionMarkCount = url.match(/\?/g).length; - expect(questionMarkCount).toEqual(1); + spyOn(Resource._Implementations, "createImage").and.callFake( + function (request, crossOrigin, deferred) { + const url = request.url; + const questionMarkCount = url.match(/\?/g).length; + expect(questionMarkCount).toEqual(1); - const uri = new Uri(url); - const params = queryToObject(uri.query()); - expect(params.foo).toEqual("bar"); + const uri = new Uri(url); + const params = queryToObject(uri.query()); + expect(params.foo).toEqual("bar"); - // Don't need to actually load image, but satisfy the request. - deferred.resolve(true); - }); + // Don't need to actually load image, but satisfy the request. + deferred.resolve(true); + }, + ); provider.requestImage(0, 0, 0); @@ -459,19 +435,17 @@ describe("Scene/WebMapServiceImageryProvider", function () { layers: "someLayer", }); - spyOn(Resource._Implementations, "createImage").and.callFake(function ( - request, - crossOrigin, - deferred - ) { - const url = request.url; - const uri = new Uri(url); - const params = queryToObject(uri.query()); - expect(params.version).toEqual("1.1.1"); + spyOn(Resource._Implementations, "createImage").and.callFake( + function (request, crossOrigin, deferred) { + const url = request.url; + const uri = new Uri(url); + const params = queryToObject(uri.query()); + expect(params.version).toEqual("1.1.1"); - // Don't need to actually load image, but satisfy the request. - deferred.resolve(true); - }); + // Don't need to actually load image, but satisfy the request. + deferred.resolve(true); + }, + ); provider.requestImage(0, 0, 0); @@ -493,18 +467,16 @@ describe("Scene/WebMapServiceImageryProvider", function () { expect(provider.tilingScheme).toBeInstanceOf(GeographicTilingScheme); expect(provider.rectangle).toEqual(new GeographicTilingScheme().rectangle); - spyOn(Resource._Implementations, "createImage").and.callFake(function ( - request, - crossOrigin, - deferred - ) { - // Just return any old image. - Resource._DefaultImplementations.createImage( - new Request({ url: "Data/Images/Red16x16.png" }), - crossOrigin, - deferred - ); - }); + spyOn(Resource._Implementations, "createImage").and.callFake( + function (request, crossOrigin, deferred) { + // Just return any old image. + Resource._DefaultImplementations.createImage( + new Request({ url: "Data/Images/Red16x16.png" }), + crossOrigin, + deferred, + ); + }, + ); return provider.requestImage(0, 0, 0).then(function (image) { expect(Resource._Implementations.createImage).toHaveBeenCalled(); @@ -529,28 +501,26 @@ describe("Scene/WebMapServiceImageryProvider", function () { expect(provider.tilingScheme).toBeInstanceOf(WebMercatorTilingScheme); expect(provider.rectangle).toEqual(new WebMercatorTilingScheme().rectangle); - spyOn(Resource._Implementations, "createImage").and.callFake(function ( - request, - crossOrigin, - deferred - ) { - const uri = new Uri(request.url); - const params = queryToObject(uri.query()); + spyOn(Resource._Implementations, "createImage").and.callFake( + function (request, crossOrigin, deferred) { + const uri = new Uri(request.url); + const params = queryToObject(uri.query()); - expect(params.srs).toEqual("EPSG:3857"); - expect(params.version).toEqual("1.1.1"); + expect(params.srs).toEqual("EPSG:3857"); + expect(params.version).toEqual("1.1.1"); - const rect = tilingScheme.tileXYToNativeRectangle(0, 0, 0); - expect(params.bbox).toEqual( - `${rect.west},${rect.south},${rect.east},${rect.north}` - ); + const rect = tilingScheme.tileXYToNativeRectangle(0, 0, 0); + expect(params.bbox).toEqual( + `${rect.west},${rect.south},${rect.east},${rect.north}`, + ); - Resource._DefaultImplementations.createImage( - new Request({ url: "Data/Images/Red16x16.png" }), - crossOrigin, - deferred - ); - }); + Resource._DefaultImplementations.createImage( + new Request({ url: "Data/Images/Red16x16.png" }), + crossOrigin, + deferred, + ); + }, + ); return provider.requestImage(0, 0, 0).then(function (image) { expect(Resource._Implementations.createImage).toHaveBeenCalled(); @@ -578,28 +548,26 @@ describe("Scene/WebMapServiceImageryProvider", function () { expect(provider.tilingScheme).toBeInstanceOf(WebMercatorTilingScheme); expect(provider.rectangle).toEqual(new WebMercatorTilingScheme().rectangle); - spyOn(Resource._Implementations, "createImage").and.callFake(function ( - request, - crossOrigin, - deferred - ) { - const uri = new Uri(request.url); - const params = queryToObject(uri.query()); + spyOn(Resource._Implementations, "createImage").and.callFake( + function (request, crossOrigin, deferred) { + const uri = new Uri(request.url); + const params = queryToObject(uri.query()); - expect(params.crs).toEqual("EPSG:3857"); - expect(params.version).toEqual("1.3.0"); + expect(params.crs).toEqual("EPSG:3857"); + expect(params.version).toEqual("1.3.0"); - const rect = tilingScheme.tileXYToNativeRectangle(0, 0, 0); - expect(params.bbox).toEqual( - `${rect.west},${rect.south},${rect.east},${rect.north}` - ); + const rect = tilingScheme.tileXYToNativeRectangle(0, 0, 0); + expect(params.bbox).toEqual( + `${rect.west},${rect.south},${rect.east},${rect.north}`, + ); - Resource._DefaultImplementations.createImage( - new Request({ url: "Data/Images/Red16x16.png" }), - crossOrigin, - deferred - ); - }); + Resource._DefaultImplementations.createImage( + new Request({ url: "Data/Images/Red16x16.png" }), + crossOrigin, + deferred, + ); + }, + ); return provider.requestImage(0, 0, 0).then(function (image) { expect(Resource._Implementations.createImage).toHaveBeenCalled(); @@ -624,28 +592,26 @@ describe("Scene/WebMapServiceImageryProvider", function () { expect(provider.tilingScheme).toBeInstanceOf(GeographicTilingScheme); expect(provider.rectangle).toEqual(new GeographicTilingScheme().rectangle); - spyOn(Resource._Implementations, "createImage").and.callFake(function ( - request, - crossOrigin, - deferred - ) { - const uri = new Uri(request.url); - const params = queryToObject(uri.query()); + spyOn(Resource._Implementations, "createImage").and.callFake( + function (request, crossOrigin, deferred) { + const uri = new Uri(request.url); + const params = queryToObject(uri.query()); - expect(params.srs).toEqual("EPSG:4326"); - expect(params.version).toEqual("1.1.1"); + expect(params.srs).toEqual("EPSG:4326"); + expect(params.version).toEqual("1.1.1"); - const rect = tilingScheme.tileXYToNativeRectangle(0, 0, 0); - expect(params.bbox).toEqual( - `${rect.west},${rect.south},${rect.east},${rect.north}` - ); + const rect = tilingScheme.tileXYToNativeRectangle(0, 0, 0); + expect(params.bbox).toEqual( + `${rect.west},${rect.south},${rect.east},${rect.north}`, + ); - Resource._DefaultImplementations.createImage( - new Request({ url: "Data/Images/Red16x16.png" }), - crossOrigin, - deferred - ); - }); + Resource._DefaultImplementations.createImage( + new Request({ url: "Data/Images/Red16x16.png" }), + crossOrigin, + deferred, + ); + }, + ); return provider.requestImage(0, 0, 0).then(function (image) { expect(Resource._Implementations.createImage).toHaveBeenCalled(); @@ -673,28 +639,26 @@ describe("Scene/WebMapServiceImageryProvider", function () { expect(provider.tilingScheme).toBeInstanceOf(GeographicTilingScheme); expect(provider.rectangle).toEqual(new GeographicTilingScheme().rectangle); - spyOn(Resource._Implementations, "createImage").and.callFake(function ( - request, - crossOrigin, - deferred - ) { - const uri = new Uri(request.url); - const params = queryToObject(uri.query()); + spyOn(Resource._Implementations, "createImage").and.callFake( + function (request, crossOrigin, deferred) { + const uri = new Uri(request.url); + const params = queryToObject(uri.query()); - expect(params.srs).toEqual("EPSG:4326"); - expect(params.version).toEqual("1.1.0"); + expect(params.srs).toEqual("EPSG:4326"); + expect(params.version).toEqual("1.1.0"); - const rect = tilingScheme.tileXYToNativeRectangle(0, 0, 0); - expect(params.bbox).toEqual( - `${rect.west},${rect.south},${rect.east},${rect.north}` - ); + const rect = tilingScheme.tileXYToNativeRectangle(0, 0, 0); + expect(params.bbox).toEqual( + `${rect.west},${rect.south},${rect.east},${rect.north}`, + ); - Resource._DefaultImplementations.createImage( - new Request({ url: "Data/Images/Red16x16.png" }), - crossOrigin, - deferred - ); - }); + Resource._DefaultImplementations.createImage( + new Request({ url: "Data/Images/Red16x16.png" }), + crossOrigin, + deferred, + ); + }, + ); return provider.requestImage(0, 0, 0).then(function (image) { expect(Resource._Implementations.createImage).toHaveBeenCalled(); @@ -722,28 +686,26 @@ describe("Scene/WebMapServiceImageryProvider", function () { expect(provider.tilingScheme).toBeInstanceOf(GeographicTilingScheme); expect(provider.rectangle).toEqual(new GeographicTilingScheme().rectangle); - spyOn(Resource._Implementations, "createImage").and.callFake(function ( - request, - crossOrigin, - deferred - ) { - const uri = new Uri(request.url); - const params = queryToObject(uri.query()); + spyOn(Resource._Implementations, "createImage").and.callFake( + function (request, crossOrigin, deferred) { + const uri = new Uri(request.url); + const params = queryToObject(uri.query()); - expect(params.crs).toEqual("CRS:84"); - expect(params.version).toEqual("1.3.0"); + expect(params.crs).toEqual("CRS:84"); + expect(params.version).toEqual("1.3.0"); - const rect = tilingScheme.tileXYToNativeRectangle(0, 0, 0); - expect(params.bbox).toEqual( - `${rect.west},${rect.south},${rect.east},${rect.north}` - ); + const rect = tilingScheme.tileXYToNativeRectangle(0, 0, 0); + expect(params.bbox).toEqual( + `${rect.west},${rect.south},${rect.east},${rect.north}`, + ); - Resource._DefaultImplementations.createImage( - new Request({ url: "Data/Images/Red16x16.png" }), - crossOrigin, - deferred - ); - }); + Resource._DefaultImplementations.createImage( + new Request({ url: "Data/Images/Red16x16.png" }), + crossOrigin, + deferred, + ); + }, + ); return provider.requestImage(0, 0, 0).then(function (image) { expect(Resource._Implementations.createImage).toHaveBeenCalled(); @@ -771,28 +733,26 @@ describe("Scene/WebMapServiceImageryProvider", function () { expect(provider.tilingScheme).toBeInstanceOf(GeographicTilingScheme); expect(provider.rectangle).toEqual(new GeographicTilingScheme().rectangle); - spyOn(Resource._Implementations, "createImage").and.callFake(function ( - request, - crossOrigin, - deferred - ) { - const uri = new Uri(request.url); - const params = queryToObject(uri.query()); + spyOn(Resource._Implementations, "createImage").and.callFake( + function (request, crossOrigin, deferred) { + const uri = new Uri(request.url); + const params = queryToObject(uri.query()); - expect(params.crs).toEqual("CRS:84"); - expect(params.version).toEqual("1.3.1"); + expect(params.crs).toEqual("CRS:84"); + expect(params.version).toEqual("1.3.1"); - const rect = tilingScheme.tileXYToNativeRectangle(0, 0, 0); - expect(params.bbox).toEqual( - `${rect.west},${rect.south},${rect.east},${rect.north}` - ); + const rect = tilingScheme.tileXYToNativeRectangle(0, 0, 0); + expect(params.bbox).toEqual( + `${rect.west},${rect.south},${rect.east},${rect.north}`, + ); - Resource._DefaultImplementations.createImage( - new Request({ url: "Data/Images/Red16x16.png" }), - crossOrigin, - deferred - ); - }); + Resource._DefaultImplementations.createImage( + new Request({ url: "Data/Images/Red16x16.png" }), + crossOrigin, + deferred, + ); + }, + ); return provider.requestImage(0, 0, 0).then(function (image) { expect(Resource._Implementations.createImage).toHaveBeenCalled(); @@ -809,24 +769,22 @@ describe("Scene/WebMapServiceImageryProvider", function () { }, }); - spyOn(Resource._Implementations, "createImage").and.callFake(function ( - request, - crossOrigin, - deferred - ) { - const uri = new Uri(request.url); - const params = queryToObject(uri.query()); + spyOn(Resource._Implementations, "createImage").and.callFake( + function (request, crossOrigin, deferred) { + const uri = new Uri(request.url); + const params = queryToObject(uri.query()); - expect(params.format).toEqual("foo"); - expect(params.format).not.toEqual("image/jpeg"); + expect(params.format).toEqual("foo"); + expect(params.format).not.toEqual("image/jpeg"); - // Just return any old image. - Resource._DefaultImplementations.createImage( - new Request({ url: "Data/Images/Red16x16.png" }), - crossOrigin, - deferred - ); - }); + // Just return any old image. + Resource._DefaultImplementations.createImage( + new Request({ url: "Data/Images/Red16x16.png" }), + crossOrigin, + deferred, + ); + }, + ); return provider.requestImage(0, 0, 0).then(function (image) { expect(Resource._Implementations.createImage).toHaveBeenCalled(); @@ -933,14 +891,14 @@ describe("Scene/WebMapServiceImageryProvider", function () { Resource._Implementations.createImage = function ( request, crossOrigin, - deferred + deferred, ) { if (tries === 2) { // Succeed after 2 tries Resource._DefaultImplementations.createImage( new Request({ url: "Data/Images/Red16x16.png" }), crossOrigin, - deferred + deferred, ); } else { // fail @@ -978,7 +936,7 @@ describe("Scene/WebMapServiceImageryProvider", function () { data, headers, deferred, - overrideMimeType + overrideMimeType, ) { expect(url).toContain("GetFeatureInfo"); Resource._DefaultImplementations.loadWithXhr( @@ -988,7 +946,7 @@ describe("Scene/WebMapServiceImageryProvider", function () { data, headers, deferred, - overrideMimeType + overrideMimeType, ); }; @@ -1002,7 +960,7 @@ describe("Scene/WebMapServiceImageryProvider", function () { expect(firstResult.name).toBe("TOP TANK"); expect(firstResult.description).toContain("GEOSCIENCE AUSTRALIA"); expect(firstResult.position).toEqual( - Cartographic.fromDegrees(145.91299, -30.19445) + Cartographic.fromDegrees(145.91299, -30.19445), ); }); }); @@ -1020,7 +978,7 @@ describe("Scene/WebMapServiceImageryProvider", function () { data, headers, deferred, - overrideMimeType + overrideMimeType, ) { expect(url).toContain("GetFeatureInfo"); Resource._DefaultImplementations.loadWithXhr( @@ -1030,7 +988,7 @@ describe("Scene/WebMapServiceImageryProvider", function () { data, headers, deferred, - overrideMimeType + overrideMimeType, ); }; @@ -1059,7 +1017,7 @@ describe("Scene/WebMapServiceImageryProvider", function () { data, headers, deferred, - overrideMimeType + overrideMimeType, ) { expect(url).toContain("GetFeatureInfo"); Resource._DefaultImplementations.loadWithXhr( @@ -1069,7 +1027,7 @@ describe("Scene/WebMapServiceImageryProvider", function () { data, headers, deferred, - overrideMimeType + overrideMimeType, ); }; @@ -1098,7 +1056,7 @@ describe("Scene/WebMapServiceImageryProvider", function () { data, headers, deferred, - overrideMimeType + overrideMimeType, ) { expect(url).toContain("GetFeatureInfo"); Resource._DefaultImplementations.loadWithXhr( @@ -1108,7 +1066,7 @@ describe("Scene/WebMapServiceImageryProvider", function () { data, headers, deferred, - overrideMimeType + overrideMimeType, ); }; @@ -1137,7 +1095,7 @@ describe("Scene/WebMapServiceImageryProvider", function () { data, headers, deferred, - overrideMimeType + overrideMimeType, ) { expect(url).toContain("GetFeatureInfo"); Resource._DefaultImplementations.loadWithXhr( @@ -1147,7 +1105,7 @@ describe("Scene/WebMapServiceImageryProvider", function () { data, headers, deferred, - overrideMimeType + overrideMimeType, ); }; @@ -1176,7 +1134,7 @@ describe("Scene/WebMapServiceImageryProvider", function () { data, headers, deferred, - overrideMimeType + overrideMimeType, ) { expect(url).toContain("GetFeatureInfo"); Resource._DefaultImplementations.loadWithXhr( @@ -1186,7 +1144,7 @@ describe("Scene/WebMapServiceImageryProvider", function () { data, headers, deferred, - overrideMimeType + overrideMimeType, ); }; @@ -1215,7 +1173,7 @@ describe("Scene/WebMapServiceImageryProvider", function () { data, headers, deferred, - overrideMimeType + overrideMimeType, ) { expect(url).toContain("GetFeatureInfo"); Resource._DefaultImplementations.loadWithXhr( @@ -1225,7 +1183,7 @@ describe("Scene/WebMapServiceImageryProvider", function () { data, headers, deferred, - overrideMimeType + overrideMimeType, ); }; @@ -1293,7 +1251,7 @@ describe("Scene/WebMapServiceImageryProvider", function () { data, headers, deferred, - overrideMimeType + overrideMimeType, ) { expect(url).toContain("GetFeatureInfo"); expect(url).not.toContain("json"); @@ -1304,7 +1262,7 @@ describe("Scene/WebMapServiceImageryProvider", function () { data, headers, deferred, - overrideMimeType + overrideMimeType, ); }; @@ -1334,7 +1292,7 @@ describe("Scene/WebMapServiceImageryProvider", function () { data, headers, deferred, - overrideMimeType + overrideMimeType, ) { expect(url).toContain("GetFeatureInfo"); @@ -1349,7 +1307,7 @@ describe("Scene/WebMapServiceImageryProvider", function () { data, headers, deferred, - overrideMimeType + overrideMimeType, ); } }; @@ -1378,7 +1336,7 @@ describe("Scene/WebMapServiceImageryProvider", function () { data, headers, deferred, - overrideMimeType + overrideMimeType, ) { expect(url).toContain("GetFeatureInfo"); expect(url).toContain("1.1.1"); @@ -1394,7 +1352,7 @@ describe("Scene/WebMapServiceImageryProvider", function () { data, headers, deferred, - overrideMimeType + overrideMimeType, ); }; @@ -1417,7 +1375,7 @@ describe("Scene/WebMapServiceImageryProvider", function () { data, headers, deferred, - overrideMimeType + overrideMimeType, ) { expect(url).toContain("GetFeatureInfo"); expect(url).not.toContain("1.1.1"); @@ -1433,7 +1391,7 @@ describe("Scene/WebMapServiceImageryProvider", function () { data, headers, deferred, - overrideMimeType + overrideMimeType, ); }; @@ -1453,7 +1411,7 @@ describe("Scene/WebMapServiceImageryProvider", function () { data, headers, deferred, - overrideMimeType + overrideMimeType, ) { expect(url).toContain("GetFeatureInfo"); expect(url).toContain("1.1.1"); @@ -1469,7 +1427,7 @@ describe("Scene/WebMapServiceImageryProvider", function () { data, headers, deferred, - overrideMimeType + overrideMimeType, ); }; return provider.pickFeatures(0, 0, 0, 0.5, 0.5); @@ -1499,7 +1457,7 @@ describe("Scene/WebMapServiceImageryProvider", function () { data, headers, deferred, - overrideMimeType + overrideMimeType, ) { expect(url).toContain("GetFeatureInfo"); @@ -1514,7 +1472,7 @@ describe("Scene/WebMapServiceImageryProvider", function () { data, headers, deferred, - overrideMimeType + overrideMimeType, ); }; @@ -1537,7 +1495,7 @@ describe("Scene/WebMapServiceImageryProvider", function () { data, headers, deferred, - overrideMimeType + overrideMimeType, ) { expect(url).toContain("GetFeatureInfo"); if (url.indexOf(encodeURIComponent("text/html")) < 0) { @@ -1550,7 +1508,7 @@ describe("Scene/WebMapServiceImageryProvider", function () { data, headers, deferred, - overrideMimeType + overrideMimeType, ); }; @@ -1605,12 +1563,12 @@ describe("Scene/WebMapServiceImageryProvider", function () { Resource._Implementations.createImage = function ( request, crossOrigin, - deferred + deferred, ) { Resource._DefaultImplementations.createImage( new Request({ url: "Data/Images/Red16x16.png" }), crossOrigin, - deferred + deferred, ); }; @@ -1660,12 +1618,12 @@ describe("Scene/WebMapServiceImageryProvider", function () { Resource._Implementations.createImage = function ( request, crossOrigin, - deferred + deferred, ) { Resource._DefaultImplementations.createImage( new Request({ url: "Data/Images/Red16x16.png" }), crossOrigin, - deferred + deferred, ); }; @@ -1713,12 +1671,12 @@ describe("Scene/WebMapServiceImageryProvider", function () { Resource._Implementations.createImage = function ( request, crossOrigin, - deferred + deferred, ) { Resource._DefaultImplementations.createImage( new Request({ url: "Data/Images/Red16x16.png" }), crossOrigin, - deferred + deferred, ); }; @@ -1771,12 +1729,12 @@ describe("Scene/WebMapServiceImageryProvider", function () { Resource._Implementations.createImage = function ( request, crossOrigin, - deferred + deferred, ) { Resource._DefaultImplementations.createImage( new Request({ url: "Data/Images/Red16x16.png" }), crossOrigin, - deferred + deferred, ); }; diff --git a/packages/engine/Specs/Scene/WebMapTileServiceImageryProviderSpec.js b/packages/engine/Specs/Scene/WebMapTileServiceImageryProviderSpec.js index 755c238ad9f9..f16abebc577c 100644 --- a/packages/engine/Specs/Scene/WebMapTileServiceImageryProviderSpec.js +++ b/packages/engine/Specs/Scene/WebMapTileServiceImageryProviderSpec.js @@ -34,7 +34,7 @@ describe("Scene/WebMapTileServiceImageryProvider", function () { it("conforms to ImageryProvider interface", function () { expect(WebMapTileServiceImageryProvider).toConformToInterface( - ImageryProvider + ImageryProvider, ); }); @@ -190,8 +190,7 @@ describe("Scene/WebMapTileServiceImageryProvider", function () { it("generates expected tile urls from template", function () { const options = { - url: - "http://wmts.invalid/{style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.png", + url: "http://wmts.invalid/{style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.png", format: "image/png", layer: "someLayer", style: "someStyle", @@ -208,10 +207,10 @@ describe("Scene/WebMapTileServiceImageryProvider", function () { const level = 1; provider.requestImage(tilecol, tilerow, level); const uri = new Uri( - ImageryProvider.loadImage.calls.mostRecent().args[1].getUrlComponent() + ImageryProvider.loadImage.calls.mostRecent().args[1].getUrlComponent(), ); expect(uri.toString()).toEqual( - "http://wmts.invalid/someStyle/someTMS/second/5/12.png" + "http://wmts.invalid/someStyle/someTMS/second/5/12.png", ); }); @@ -339,18 +338,16 @@ describe("Scene/WebMapTileServiceImageryProvider", function () { tileMatrixSetID: "someTMS", }); - spyOn(Resource._Implementations, "createImage").and.callFake(function ( - request, - crossOrigin, - deferred - ) { - // Just return any old image. - Resource._DefaultImplementations.createImage( - new Request({ url: "Data/Images/Red16x16.png" }), - crossOrigin, - deferred - ); - }); + spyOn(Resource._Implementations, "createImage").and.callFake( + function (request, crossOrigin, deferred) { + // Just return any old image. + Resource._DefaultImplementations.createImage( + new Request({ url: "Data/Images/Red16x16.png" }), + crossOrigin, + deferred, + ); + }, + ); return provider1.requestImage(0, 0, 0).then(function (image) { return provider2.requestImage(0, 0, 0).then(function (image) { @@ -370,18 +367,16 @@ describe("Scene/WebMapTileServiceImageryProvider", function () { tileMatrixSetID: "someTMS", }); - spyOn(Resource._Implementations, "createImage").and.callFake(function ( - request, - crossOrigin, - deferred - ) { - // Just return any old image. - Resource._DefaultImplementations.createImage( - new Request({ url: "Data/Images/Red16x16.png" }), - crossOrigin, - deferred - ); - }); + spyOn(Resource._Implementations, "createImage").and.callFake( + function (request, crossOrigin, deferred) { + // Just return any old image. + Resource._DefaultImplementations.createImage( + new Request({ url: "Data/Images/Red16x16.png" }), + crossOrigin, + deferred, + ); + }, + ); return provider.requestImage(0, 0, 0).then(function (image) { expect(Resource._Implementations.createImage).toHaveBeenCalled(); @@ -414,14 +409,14 @@ describe("Scene/WebMapTileServiceImageryProvider", function () { Resource._Implementations.createImage = function ( request, crossOrigin, - deferred + deferred, ) { if (tries === 2) { // Succeed after 2 tries Resource._DefaultImplementations.createImage( new Request({ url: "Data/Images/Red16x16.png" }), crossOrigin, - deferred + deferred, ); } else { // fail @@ -471,12 +466,12 @@ describe("Scene/WebMapTileServiceImageryProvider", function () { Resource._Implementations.createImage = function ( request, crossOrigin, - deferred + deferred, ) { Resource._DefaultImplementations.createImage( new Request({ url: "Data/Images/Red16x16.png" }), crossOrigin, - deferred + deferred, ); }; @@ -527,12 +522,12 @@ describe("Scene/WebMapTileServiceImageryProvider", function () { Resource._Implementations.createImage = function ( request, crossOrigin, - deferred + deferred, ) { Resource._DefaultImplementations.createImage( new Request({ url: "Data/Images/Red16x16.png" }), crossOrigin, - deferred + deferred, ); }; @@ -580,12 +575,12 @@ describe("Scene/WebMapTileServiceImageryProvider", function () { Resource._Implementations.createImage = function ( request, crossOrigin, - deferred + deferred, ) { Resource._DefaultImplementations.createImage( new Request({ url: "Data/Images/Red16x16.png" }), crossOrigin, - deferred + deferred, ); }; @@ -625,13 +620,13 @@ describe("Scene/WebMapTileServiceImageryProvider", function () { Resource._Implementations.createImage = function ( request, crossOrigin, - deferred + deferred, ) { lastUrl = request.url; Resource._DefaultImplementations.createImage( new Request({ url: "Data/Images/Red16x16.png" }), crossOrigin, - deferred + deferred, ); }; @@ -668,13 +663,13 @@ describe("Scene/WebMapTileServiceImageryProvider", function () { Resource._Implementations.createImage = function ( request, crossOrigin, - deferred + deferred, ) { lastUrl = request.url; Resource._DefaultImplementations.createImage( new Request({ url: "Data/Images/Red16x16.png" }), crossOrigin, - deferred + deferred, ); }; diff --git a/packages/engine/Specs/Scene/buildVoxelDrawCommandsSpec.js b/packages/engine/Specs/Scene/buildVoxelDrawCommandsSpec.js index 7ba353984ca8..d1aea9c50b59 100644 --- a/packages/engine/Specs/Scene/buildVoxelDrawCommandsSpec.js +++ b/packages/engine/Specs/Scene/buildVoxelDrawCommandsSpec.js @@ -16,7 +16,7 @@ describe("Scene/buildVoxelDrawCommands", function () { scene = createScene(); provider = await Cesium3DTilesVoxelProvider.fromUrl( - "./Data/Cesium3DTiles/Voxel/VoxelEllipsoid3DTiles/tileset.json" + "./Data/Cesium3DTiles/Voxel/VoxelEllipsoid3DTiles/tileset.json", ); }); diff --git a/packages/engine/Specs/Scene/computeFlyToLocationForRectangleSpec.js b/packages/engine/Specs/Scene/computeFlyToLocationForRectangleSpec.js index b4e849b001f8..0786e1f6b4f9 100644 --- a/packages/engine/Specs/Scene/computeFlyToLocationForRectangleSpec.js +++ b/packages/engine/Specs/Scene/computeFlyToLocationForRectangleSpec.js @@ -53,30 +53,30 @@ describe("Scene/computeFlyToLocationForRectangle", function () { spyOn( computeFlyToLocationForRectangle, - "_sampleTerrainMostDetailed" + "_sampleTerrainMostDetailed", ).and.returnValue(Promise.resolve(sampledResults)); // Basically do the computation ourselves with our known values; let expectedResult; if (sceneMode === SceneMode.SCENE3D) { expectedResult = scene.ellipsoid.cartesianToCartographic( - scene.camera.getRectangleCameraCoordinates(rectangle) + scene.camera.getRectangleCameraCoordinates(rectangle), ); } else { expectedResult = scene.mapProjection.unproject( - scene.camera.getRectangleCameraCoordinates(rectangle) + scene.camera.getRectangleCameraCoordinates(rectangle), ); } expectedResult.height += maxHeight; - return computeFlyToLocationForRectangle(rectangle, scene).then(function ( - result - ) { - expect(result).toEqual(expectedResult); - expect( - computeFlyToLocationForRectangle._sampleTerrainMostDetailed - ).toHaveBeenCalledWith(terrainProvider, cartographics); - }); + return computeFlyToLocationForRectangle(rectangle, scene).then( + function (result) { + expect(result).toEqual(expectedResult); + expect( + computeFlyToLocationForRectangle._sampleTerrainMostDetailed, + ).toHaveBeenCalledWith(terrainProvider, cartographics); + }, + ); } it("samples terrain and returns expected result in 3D", function () { @@ -97,18 +97,18 @@ describe("Scene/computeFlyToLocationForRectangle", function () { const rectangle = new Rectangle(0.2, 0.4, 0.6, 0.8); const expectedResult = scene.mapProjection.unproject( - scene.camera.getRectangleCameraCoordinates(rectangle) + scene.camera.getRectangleCameraCoordinates(rectangle), ); spyOn(computeFlyToLocationForRectangle, "_sampleTerrainMostDetailed"); - return computeFlyToLocationForRectangle(rectangle, scene).then(function ( - result - ) { - expect(result).toEqual(expectedResult); - expect( - computeFlyToLocationForRectangle._sampleTerrainMostDetailed - ).not.toHaveBeenCalled(); - }); + return computeFlyToLocationForRectangle(rectangle, scene).then( + function (result) { + expect(result).toEqual(expectedResult); + expect( + computeFlyToLocationForRectangle._sampleTerrainMostDetailed, + ).not.toHaveBeenCalled(); + }, + ); }); it("returns height above ellipsoid when terrain not available", function () { @@ -119,16 +119,16 @@ describe("Scene/computeFlyToLocationForRectangle", function () { spyOn(computeFlyToLocationForRectangle, "_sampleTerrainMostDetailed"); const expectedResult = scene.ellipsoid.cartesianToCartographic( - scene.camera.getRectangleCameraCoordinates(rectangle) + scene.camera.getRectangleCameraCoordinates(rectangle), + ); + return computeFlyToLocationForRectangle(rectangle, scene).then( + function (result) { + expect(result).toEqual(expectedResult); + expect( + computeFlyToLocationForRectangle._sampleTerrainMostDetailed, + ).not.toHaveBeenCalled(); + }, ); - return computeFlyToLocationForRectangle(rectangle, scene).then(function ( - result - ) { - expect(result).toEqual(expectedResult); - expect( - computeFlyToLocationForRectangle._sampleTerrainMostDetailed - ).not.toHaveBeenCalled(); - }); }); it("returns height above ellipsoid when terrain undefined", function () { @@ -137,15 +137,15 @@ describe("Scene/computeFlyToLocationForRectangle", function () { spyOn(computeFlyToLocationForRectangle, "_sampleTerrainMostDetailed"); const expectedResult = scene.ellipsoid.cartesianToCartographic( - scene.camera.getRectangleCameraCoordinates(rectangle) + scene.camera.getRectangleCameraCoordinates(rectangle), + ); + return computeFlyToLocationForRectangle(rectangle, scene).then( + function (result) { + expect(result).toEqual(expectedResult); + expect( + computeFlyToLocationForRectangle._sampleTerrainMostDetailed, + ).not.toHaveBeenCalled(); + }, ); - return computeFlyToLocationForRectangle(rectangle, scene).then(function ( - result - ) { - expect(result).toEqual(expectedResult); - expect( - computeFlyToLocationForRectangle._sampleTerrainMostDetailed - ).not.toHaveBeenCalled(); - }); }); }); diff --git a/packages/engine/Specs/Scene/createElevationBandMaterialSpec.js b/packages/engine/Specs/Scene/createElevationBandMaterialSpec.js index 1b1ee0ee4a7a..a67c0b57d2c9 100644 --- a/packages/engine/Specs/Scene/createElevationBandMaterialSpec.js +++ b/packages/engine/Specs/Scene/createElevationBandMaterialSpec.js @@ -1149,7 +1149,7 @@ describe("Scene/createElevationBandMaterial", function () { checkTexel( 0, new Color(0, 0, 0, 1), - createElevationBandMaterial._minimumHeight + createElevationBandMaterial._minimumHeight, ); }); @@ -1170,7 +1170,7 @@ describe("Scene/createElevationBandMaterial", function () { ]; spyOn(createElevationBandMaterial, "_useFloatTexture").and.returnValue( - false + false, ); createElevationBandMaterial({ scene: scene, @@ -1199,7 +1199,7 @@ describe("Scene/createElevationBandMaterial", function () { ]; spyOn(createElevationBandMaterial, "_useFloatTexture").and.returnValue( - true + true, ); createElevationBandMaterial({ scene: scene, diff --git a/packages/engine/Specs/Scene/createTangentSpaceDebugPrimitiveSpec.js b/packages/engine/Specs/Scene/createTangentSpaceDebugPrimitiveSpec.js index baf821b911ba..95373c5a6aa5 100644 --- a/packages/engine/Specs/Scene/createTangentSpaceDebugPrimitiveSpec.js +++ b/packages/engine/Specs/Scene/createTangentSpaceDebugPrimitiveSpec.js @@ -16,7 +16,7 @@ describe("Scene/createTangentSpaceDebugPrimitive", function () { const modelMatrix = Matrix4.multiplyByTranslation( Matrix4.IDENTITY, new Cartesian3(0.0, 0.0, 11000000.0), - new Matrix4() + new Matrix4(), ); const primitive = createTangentSpaceDebugPrimitive({ diff --git a/packages/engine/Specs/Scene/createWorldImageryAsyncSpec.js b/packages/engine/Specs/Scene/createWorldImageryAsyncSpec.js index 085fe985cecc..83698881426f 100644 --- a/packages/engine/Specs/Scene/createWorldImageryAsyncSpec.js +++ b/packages/engine/Specs/Scene/createWorldImageryAsyncSpec.js @@ -10,7 +10,7 @@ import createFakeBingMapsMetadataResponse from "../createFakeBingMapsMetadataRes describe("Core/createWorldImageryAsync", function () { it("resolves to IonImageryProvider instance with default parameters", async function () { spyOn(Resource.prototype, "fetchJsonp").and.callFake(() => - Promise.resolve(createFakeBingMapsMetadataResponse(BingMapsStyle.AERIAL)) + Promise.resolve(createFakeBingMapsMetadataResponse(BingMapsStyle.AERIAL)), ); const provider = await createWorldImageryAsync(); diff --git a/packages/engine/Specs/Scene/parseBatchTableSpec.js b/packages/engine/Specs/Scene/parseBatchTableSpec.js index 06a29a30f4c5..df0e4d0c3502 100644 --- a/packages/engine/Specs/Scene/parseBatchTableSpec.js +++ b/packages/engine/Specs/Scene/parseBatchTableSpec.js @@ -137,28 +137,28 @@ describe("Scene/parseBatchTable", function () { const properties = metadata.schema.classes[className].properties; expect(properties.uint8Property.componentType).toBe( - MetadataComponentType.UINT8 + MetadataComponentType.UINT8, ); expect(properties.uint16Property.componentType).toBe( - MetadataComponentType.UINT16 + MetadataComponentType.UINT16, ); expect(properties.uint32Property.componentType).toBe( - MetadataComponentType.UINT32 + MetadataComponentType.UINT32, ); expect(properties.int8Property.componentType).toBe( - MetadataComponentType.INT8 + MetadataComponentType.INT8, ); expect(properties.int16Property.componentType).toBe( - MetadataComponentType.INT16 + MetadataComponentType.INT16, ); expect(properties.int32Property.componentType).toBe( - MetadataComponentType.INT32 + MetadataComponentType.INT32, ); expect(properties.floatProperty.componentType).toBe( - MetadataComponentType.FLOAT32 + MetadataComponentType.FLOAT32, ); expect(properties.doubleProperty.componentType).toBe( - MetadataComponentType.FLOAT64 + MetadataComponentType.FLOAT64, ); const propertyTable = metadata.getPropertyTable(0); @@ -204,24 +204,24 @@ describe("Scene/parseBatchTable", function () { expect(properties.uvec3Property.type).toBe(MetadataType.VEC3); expect(properties.dvec4Property.type).toBe(MetadataType.VEC4); expect(properties.vec2Property.componentType).toBe( - MetadataComponentType.FLOAT32 + MetadataComponentType.FLOAT32, ); expect(properties.uvec3Property.componentType).toBe( - MetadataComponentType.UINT32 + MetadataComponentType.UINT32, ); expect(properties.dvec4Property.componentType).toBe( - MetadataComponentType.FLOAT64 + MetadataComponentType.FLOAT64, ); const propertyTable = metadata.getPropertyTable(0); expect(propertyTable.getProperty(0, "vec2Property")).toEqual( - new Cartesian2(0.0, 0.0) + new Cartesian2(0.0, 0.0), ); expect(propertyTable.getProperty(0, "uvec3Property")).toEqual( - new Cartesian3(0, 0, 0) + new Cartesian3(0, 0, 0), ); expect(propertyTable.getProperty(0, "dvec4Property")).toEqual( - new Cartesian4(0.0, 0.0, 0.0, 0.0) + new Cartesian4(0.0, 0.0, 0.0, 0.0), ); }); @@ -255,16 +255,16 @@ describe("Scene/parseBatchTable", function () { const propertyTable = metadata.getPropertyTable(0); expect(propertyTable.getProperty(0, "location")).toEqual( - jsonBatchTable.location[0] + jsonBatchTable.location[0], ); expect(propertyTable.getProperty(1, "location")).toEqual( - jsonBatchTable.location[1] + jsonBatchTable.location[1], ); expect(propertyTable.getProperty(0, "payload")).toEqual( - jsonBatchTable.payload[0] + jsonBatchTable.payload[0], ); expect(propertyTable.getProperty(1, "payload")).toEqual( - jsonBatchTable.payload[1] + jsonBatchTable.payload[1], ); }); @@ -476,9 +476,8 @@ describe("Scene/parseBatchTable", function () { // Since the original properties is an unordered collection, sort // to be sure of the order - const [heightAttribute, windDirectionAttribute] = customAttributes.sort( - sortByName - ); + const [heightAttribute, windDirectionAttribute] = + customAttributes.sort(sortByName); expect(heightAttribute.name).toBe("_HEIGHT"); expect(heightAttribute.count).toBe(3); expect(heightAttribute.type).toBe("SCALAR"); @@ -489,7 +488,7 @@ describe("Scene/parseBatchTable", function () { expect(windDirectionAttribute.count).toBe(3); expect(windDirectionAttribute.type).toBe("VEC2"); expect(windDirectionAttribute.componentDatatype).toBe( - ComponentDatatype.FLOAT + ComponentDatatype.FLOAT, ); expect(windDirectionAttribute.typedArray).toEqual(values.slice(3)); @@ -505,7 +504,7 @@ describe("Scene/parseBatchTable", function () { expect(heightClassProperty.name).toBe("height"); expect(heightClassProperty.type).toBe(MetadataType.SCALAR); expect(heightClassProperty.componentType).toBe( - MetadataComponentType.FLOAT32 + MetadataComponentType.FLOAT32, ); const windClassProperty = metadataClass.properties["windDirection"]; expect(windClassProperty.name).toBe("windDirection"); @@ -559,9 +558,8 @@ describe("Scene/parseBatchTable", function () { // Since the original properties is an unordered collection, sort // to be sure of the order. - const [numericAttribute, unicodeAttribute] = customAttributes.sort( - sortByName - ); + const [numericAttribute, unicodeAttribute] = + customAttributes.sort(sortByName); // Attributes are converted to upper-case like glTF attributes. expect(numericAttribute.name).toBe("_1234"); @@ -644,7 +642,7 @@ describe("Scene/parseBatchTable", function () { return classProperty.name; }); expect(classPropertyNames.sort()).toEqual( - Object.keys(binaryBatchTable).sort() + Object.keys(binaryBatchTable).sort(), ); const properties = propertyAttribute.properties; @@ -698,25 +696,24 @@ describe("Scene/parseBatchTable", function () { // Since the original properties is an unordered collection, sort // to be sure of the order - const [heightAttribute, windDirectionAttribute] = customAttributes.sort( - sortByName - ); + const [heightAttribute, windDirectionAttribute] = + customAttributes.sort(sortByName); expect(heightAttribute.name).toBe("_HEIGHT"); expect(heightAttribute.count).toBe(3); expect(heightAttribute.type).toBe("SCALAR"); expect(heightAttribute.componentDatatype).toBe(ComponentDatatype.FLOAT); expect(heightAttribute.typedArray).toEqual( - binaryBatchTable.height.typedArray + binaryBatchTable.height.typedArray, ); expect(windDirectionAttribute.name).toBe("_WINDDIRECTION"); expect(windDirectionAttribute.count).toBe(3); expect(windDirectionAttribute.type).toBe("VEC2"); expect(windDirectionAttribute.componentDatatype).toBe( - ComponentDatatype.FLOAT + ComponentDatatype.FLOAT, ); expect(windDirectionAttribute.typedArray).toEqual( - binaryBatchTable.windDirection.typedArray + binaryBatchTable.windDirection.typedArray, ); // No property table will be created. @@ -731,7 +728,7 @@ describe("Scene/parseBatchTable", function () { expect(heightClassProperty.name).toBe("height"); expect(heightClassProperty.type).toBe(MetadataType.SCALAR); expect(heightClassProperty.componentType).toBe( - MetadataComponentType.FLOAT32 + MetadataComponentType.FLOAT32, ); const windClassProperty = metadataClass.properties["windDirection"]; expect(windClassProperty.name).toBe("windDirection"); diff --git a/packages/engine/Specs/Scene/parseFeatureMetadataLegacySpec.js b/packages/engine/Specs/Scene/parseFeatureMetadataLegacySpec.js index 0f351ba9ec6a..e0cfb1881cc0 100644 --- a/packages/engine/Specs/Scene/parseFeatureMetadataLegacySpec.js +++ b/packages/engine/Specs/Scene/parseFeatureMetadataLegacySpec.js @@ -298,5 +298,5 @@ describe( expect(metadata.extensions).toBe(extensions); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/parseStructuralMetadataSpec.js b/packages/engine/Specs/Scene/parseStructuralMetadataSpec.js index 4b0915aa6f5e..e2b8c9383bdc 100644 --- a/packages/engine/Specs/Scene/parseStructuralMetadataSpec.js +++ b/packages/engine/Specs/Scene/parseStructuralMetadataSpec.js @@ -306,10 +306,10 @@ describe( expect(propertyAttribute.class).toBe(pointsClass); expect(propertyAttribute.getProperty("color").attribute).toBe("_COLOR"); expect(propertyAttribute.getProperty("intensity").attribute).toBe( - "_INTENSITY" + "_INTENSITY", ); expect(propertyAttribute.getProperty("pointSize").attribute).toBe( - "_POINT_SIZE" + "_POINT_SIZE", ); }); @@ -366,5 +366,5 @@ describe( expect(metadata.extensions).toBe(extensions); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/engine/Specs/Scene/processVoxelPropertiesSpec.js b/packages/engine/Specs/Scene/processVoxelPropertiesSpec.js index 0be881a18ee3..2e6ea2a90bb5 100644 --- a/packages/engine/Specs/Scene/processVoxelPropertiesSpec.js +++ b/packages/engine/Specs/Scene/processVoxelPropertiesSpec.js @@ -15,7 +15,7 @@ describe("Scene/processVoxelProperties", function () { scene = createScene(); provider = await Cesium3DTilesVoxelProvider.fromUrl( - "./Data/Cesium3DTiles/Voxel/VoxelEllipsoid3DTiles/tileset.json" + "./Data/Cesium3DTiles/Voxel/VoxelEllipsoid3DTiles/tileset.json", ); }); @@ -46,7 +46,7 @@ describe("Scene/processVoxelProperties", function () { shaderBuilder, "PropertyStatistics_a", "PropertyStatistics_a", - propertyStatisticsFields + propertyStatisticsFields, ); // Check for Statistics struct @@ -55,7 +55,7 @@ describe("Scene/processVoxelProperties", function () { shaderBuilder, "Statistics", "Statistics", - statisticsFields + statisticsFields, ); // Check for Metadata struct @@ -64,7 +64,7 @@ describe("Scene/processVoxelProperties", function () { shaderBuilder, "Metadata", "Metadata", - metadataFields + metadataFields, ); // Check for VoxelProperty structs @@ -78,7 +78,7 @@ describe("Scene/processVoxelProperties", function () { shaderBuilder, "VoxelProperty_a", "VoxelProperty_a", - voxelPropertyFields + voxelPropertyFields, ); // Check for Voxel struct @@ -100,7 +100,7 @@ describe("Scene/processVoxelProperties", function () { shaderBuilder, "Voxel", "Voxel", - voxelFields + voxelFields, ); // Check for FragmentInput struct @@ -109,7 +109,7 @@ describe("Scene/processVoxelProperties", function () { shaderBuilder, "FragmentInput", "FragmentInput", - fragmentInputFields + fragmentInputFields, ); // Check for Properties struct @@ -118,7 +118,7 @@ describe("Scene/processVoxelProperties", function () { shaderBuilder, "Properties", "Properties", - propertiesFields + propertiesFields, ); // Check clearProperties function diff --git a/packages/engine/Specs/Widget/CesiumWidgetSpec.js b/packages/engine/Specs/Widget/CesiumWidgetSpec.js index b59261f86d4a..9c7720b086a7 100644 --- a/packages/engine/Specs/Widget/CesiumWidgetSpec.js +++ b/packages/engine/Specs/Widget/CesiumWidgetSpec.js @@ -46,7 +46,7 @@ describe( options.contextOptions = defaultValue(options.contextOptions, {}); options.contextOptions.webgl = defaultValue( options.contextOptions.webgl, - {} + {}, ); if (!!window.webglStub) { options.contextOptions.getWebGLStub = getWebGLStub; @@ -69,7 +69,7 @@ describe( expect(widget.camera).toBeInstanceOf(Camera); expect(widget.clock).toBeInstanceOf(Clock); expect(widget.screenSpaceEventHandler).toBeInstanceOf( - ScreenSpaceEventHandler + ScreenSpaceEventHandler, ); expect(widget.useBrowserRecommendedResolution).toBe(true); widget.render(); @@ -233,13 +233,13 @@ describe( expect(contextAttributes.stencil).toEqual(webglOptions.stencil); expect(contextAttributes.antialias).toEqual(webglOptions.antialias); expect(contextAttributes.premultipliedAlpha).toEqual( - webglOptions.premultipliedAlpha + webglOptions.premultipliedAlpha, ); expect(contextAttributes.powerPreference).toEqual( - webglOptions.powerPreference + webglOptions.powerPreference, ); expect(contextAttributes.preserveDrawingBuffer).toEqual( - webglOptions.preserveDrawingBuffer + webglOptions.preserveDrawingBuffer, ); }); @@ -264,7 +264,7 @@ describe( }); expect(widget.scene.maximumRenderTimeChange).toBe( - Number.POSITIVE_INFINITY + Number.POSITIVE_INFINITY, ); }); @@ -374,11 +374,11 @@ describe( return !widget.useDefaultRenderLoop; }).then(function () { expect( - widget._element.querySelector(".cesium-widget-errorPanel") + widget._element.querySelector(".cesium-widget-errorPanel"), ).not.toBeNull(); const messages = widget._element.querySelectorAll( - ".cesium-widget-errorPanel-message" + ".cesium-widget-errorPanel-message", ); let found = false; @@ -392,11 +392,11 @@ describe( // click the OK button to dismiss the panel DomEventSimulator.fireClick( - widget._element.querySelector(".cesium-button") + widget._element.querySelector(".cesium-button"), ); expect( - widget._element.querySelector(".cesium-widget-errorPanel") + widget._element.querySelector(".cesium-widget-errorPanel"), ).toBeNull(); }); }); @@ -415,10 +415,10 @@ describe( return !widget.useDefaultRenderLoop; }).then(function () { expect( - widget._element.querySelector(".cesium-widget-errorPanel") + widget._element.querySelector(".cesium-widget-errorPanel"), ).toBeNull(); }); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/widgets/Source/Animation/Animation.js b/packages/widgets/Source/Animation/Animation.js index 5d2990993a0b..2e9e5d04d0e4 100644 --- a/packages/widgets/Source/Animation/Animation.js +++ b/packages/widgets/Source/Animation/Animation.js @@ -13,20 +13,20 @@ const xlinkNS = "http://www.w3.org/1999/xlink"; let widgetForDrag; const gradientEnabledColor0 = Color.fromCssColorString( - "rgba(247,250,255,0.384)" + "rgba(247,250,255,0.384)", ); const gradientEnabledColor1 = Color.fromCssColorString( - "rgba(143,191,255,0.216)" + "rgba(143,191,255,0.216)", ); const gradientEnabledColor2 = Color.fromCssColorString( - "rgba(153,197,255,0.098)" + "rgba(153,197,255,0.098)", ); const gradientEnabledColor3 = Color.fromCssColorString( - "rgba(255,255,255,0.086)" + "rgba(255,255,255,0.086)", ); const gradientDisabledColor0 = Color.fromCssColorString( - "rgba(255,255,255,0.267)" + "rgba(255,255,255,0.267)", ); const gradientDisabledColor1 = Color.fromCssColorString("rgba(255,255,255,0)"); @@ -35,7 +35,7 @@ const gradientPointerColor = Color.fromCssColorString("rgba(0,0,0,0.5)"); function getElementColor(element) { return Color.fromCssColorString( - window.getComputedStyle(element).getPropertyValue("color") + window.getComputedStyle(element).getPropertyValue("color"), ); } @@ -43,8 +43,7 @@ const svgIconsById = { animation_pathReset: { tagName: "path", transform: "translate(16,16) scale(0.85) translate(-16,-16)", - d: - "M24.316,5.318,9.833,13.682,9.833,5.5,5.5,5.5,5.5,25.5,9.833,25.5,9.833,17.318,24.316,25.682z", + d: "M24.316,5.318,9.833,13.682,9.833,5.5,5.5,5.5,5.5,25.5,9.833,25.5,9.833,17.318,24.316,25.682z", }, animation_pathPause: { tagName: "path", @@ -64,19 +63,16 @@ const svgIconsById = { animation_pathLoop: { tagName: "path", transform: "translate(16,16) scale(0.85) translate(-16,-16)", - d: - "M24.249,15.499c-0.009,4.832-3.918,8.741-8.75,8.75c-2.515,0-4.768-1.064-6.365-2.763l2.068-1.442l-7.901-3.703l0.744,8.694l2.193-1.529c2.244,2.594,5.562,4.242,9.26,4.242c6.767,0,12.249-5.482,12.249-12.249H24.249zM15.499,6.75c2.516,0,4.769,1.065,6.367,2.764l-2.068,1.443l7.901,3.701l-0.746-8.693l-2.192,1.529c-2.245-2.594-5.562-4.245-9.262-4.245C8.734,3.25,3.25,8.734,3.249,15.499H6.75C6.758,10.668,10.668,6.758,15.499,6.75z", + d: "M24.249,15.499c-0.009,4.832-3.918,8.741-8.75,8.75c-2.515,0-4.768-1.064-6.365-2.763l2.068-1.442l-7.901-3.703l0.744,8.694l2.193-1.529c2.244,2.594,5.562,4.242,9.26,4.242c6.767,0,12.249-5.482,12.249-12.249H24.249zM15.499,6.75c2.516,0,4.769,1.065,6.367,2.764l-2.068,1.443l7.901,3.701l-0.746-8.693l-2.192,1.529c-2.245-2.594-5.562-4.245-9.262-4.245C8.734,3.25,3.25,8.734,3.249,15.499H6.75C6.758,10.668,10.668,6.758,15.499,6.75z", }, animation_pathClock: { tagName: "path", transform: "translate(16,16) scale(0.85) translate(-16,-15.5)", - d: - "M15.5,2.374C8.251,2.375,2.376,8.251,2.374,15.5C2.376,22.748,8.251,28.623,15.5,28.627c7.249-0.004,13.124-5.879,13.125-13.127C28.624,8.251,22.749,2.375,15.5,2.374zM15.5,25.623C9.909,25.615,5.385,21.09,5.375,15.5C5.385,9.909,9.909,5.384,15.5,5.374c5.59,0.01,10.115,4.535,10.124,10.125C25.615,21.09,21.091,25.615,15.5,25.623zM8.625,15.5c-0.001-0.552-0.448-0.999-1.001-1c-0.553,0-1,0.448-1,1c0,0.553,0.449,1,1,1C8.176,16.5,8.624,16.053,8.625,15.5zM8.179,18.572c-0.478,0.277-0.642,0.889-0.365,1.367c0.275,0.479,0.889,0.641,1.365,0.365c0.479-0.275,0.643-0.887,0.367-1.367C9.27,18.461,8.658,18.297,8.179,18.572zM9.18,10.696c-0.479-0.276-1.09-0.112-1.366,0.366s-0.111,1.09,0.365,1.366c0.479,0.276,1.09,0.113,1.367-0.366C9.821,11.584,9.657,10.973,9.18,10.696zM22.822,12.428c0.478-0.275,0.643-0.888,0.366-1.366c-0.275-0.478-0.89-0.642-1.366-0.366c-0.479,0.278-0.642,0.89-0.366,1.367C21.732,12.54,22.344,12.705,22.822,12.428zM12.062,21.455c-0.478-0.275-1.089-0.111-1.366,0.367c-0.275,0.479-0.111,1.09,0.366,1.365c0.478,0.277,1.091,0.111,1.365-0.365C12.704,22.344,12.54,21.732,12.062,21.455zM12.062,9.545c0.479-0.276,0.642-0.888,0.366-1.366c-0.276-0.478-0.888-0.642-1.366-0.366s-0.642,0.888-0.366,1.366C10.973,9.658,11.584,9.822,12.062,9.545zM22.823,18.572c-0.48-0.275-1.092-0.111-1.367,0.365c-0.275,0.479-0.112,1.092,0.367,1.367c0.477,0.275,1.089,0.113,1.365-0.365C23.464,19.461,23.3,18.848,22.823,18.572zM19.938,7.813c-0.477-0.276-1.091-0.111-1.365,0.366c-0.275,0.48-0.111,1.091,0.366,1.367s1.089,0.112,1.366-0.366C20.581,8.702,20.418,8.089,19.938,7.813zM23.378,14.5c-0.554,0.002-1.001,0.45-1.001,1c0.001,0.552,0.448,1,1.001,1c0.551,0,1-0.447,1-1C24.378,14.949,23.929,14.5,23.378,14.5zM15.501,6.624c-0.552,0-1,0.448-1,1l-0.466,7.343l-3.004,1.96c-0.478,0.277-0.642,0.889-0.365,1.365c0.275,0.479,0.889,0.643,1.365,0.367l3.305-1.676C15.39,16.99,15.444,17,15.501,17c0.828,0,1.5-0.671,1.5-1.5l-0.5-7.876C16.501,7.072,16.053,6.624,15.501,6.624zM15.501,22.377c-0.552,0-1,0.447-1,1s0.448,1,1,1s1-0.447,1-1S16.053,22.377,15.501,22.377zM18.939,21.455c-0.479,0.277-0.643,0.889-0.366,1.367c0.275,0.477,0.888,0.643,1.366,0.365c0.478-0.275,0.642-0.889,0.366-1.365C20.028,21.344,19.417,21.18,18.939,21.455z", + d: "M15.5,2.374C8.251,2.375,2.376,8.251,2.374,15.5C2.376,22.748,8.251,28.623,15.5,28.627c7.249-0.004,13.124-5.879,13.125-13.127C28.624,8.251,22.749,2.375,15.5,2.374zM15.5,25.623C9.909,25.615,5.385,21.09,5.375,15.5C5.385,9.909,9.909,5.384,15.5,5.374c5.59,0.01,10.115,4.535,10.124,10.125C25.615,21.09,21.091,25.615,15.5,25.623zM8.625,15.5c-0.001-0.552-0.448-0.999-1.001-1c-0.553,0-1,0.448-1,1c0,0.553,0.449,1,1,1C8.176,16.5,8.624,16.053,8.625,15.5zM8.179,18.572c-0.478,0.277-0.642,0.889-0.365,1.367c0.275,0.479,0.889,0.641,1.365,0.365c0.479-0.275,0.643-0.887,0.367-1.367C9.27,18.461,8.658,18.297,8.179,18.572zM9.18,10.696c-0.479-0.276-1.09-0.112-1.366,0.366s-0.111,1.09,0.365,1.366c0.479,0.276,1.09,0.113,1.367-0.366C9.821,11.584,9.657,10.973,9.18,10.696zM22.822,12.428c0.478-0.275,0.643-0.888,0.366-1.366c-0.275-0.478-0.89-0.642-1.366-0.366c-0.479,0.278-0.642,0.89-0.366,1.367C21.732,12.54,22.344,12.705,22.822,12.428zM12.062,21.455c-0.478-0.275-1.089-0.111-1.366,0.367c-0.275,0.479-0.111,1.09,0.366,1.365c0.478,0.277,1.091,0.111,1.365-0.365C12.704,22.344,12.54,21.732,12.062,21.455zM12.062,9.545c0.479-0.276,0.642-0.888,0.366-1.366c-0.276-0.478-0.888-0.642-1.366-0.366s-0.642,0.888-0.366,1.366C10.973,9.658,11.584,9.822,12.062,9.545zM22.823,18.572c-0.48-0.275-1.092-0.111-1.367,0.365c-0.275,0.479-0.112,1.092,0.367,1.367c0.477,0.275,1.089,0.113,1.365-0.365C23.464,19.461,23.3,18.848,22.823,18.572zM19.938,7.813c-0.477-0.276-1.091-0.111-1.365,0.366c-0.275,0.48-0.111,1.091,0.366,1.367s1.089,0.112,1.366-0.366C20.581,8.702,20.418,8.089,19.938,7.813zM23.378,14.5c-0.554,0.002-1.001,0.45-1.001,1c0.001,0.552,0.448,1,1.001,1c0.551,0,1-0.447,1-1C24.378,14.949,23.929,14.5,23.378,14.5zM15.501,6.624c-0.552,0-1,0.448-1,1l-0.466,7.343l-3.004,1.96c-0.478,0.277-0.642,0.889-0.365,1.365c0.275,0.479,0.889,0.643,1.365,0.367l3.305-1.676C15.39,16.99,15.444,17,15.501,17c0.828,0,1.5-0.671,1.5-1.5l-0.5-7.876C16.501,7.072,16.053,6.624,15.501,6.624zM15.501,22.377c-0.552,0-1,0.447-1,1s0.448,1,1,1s1-0.447,1-1S16.053,22.377,15.501,22.377zM18.939,21.455c-0.479,0.277-0.643,0.889-0.366,1.367c0.275,0.477,0.888,0.643,1.366,0.365c0.478-0.275,0.642-0.889,0.366-1.365C20.028,21.344,19.417,21.18,18.939,21.455z", }, animation_pathWingButton: { tagName: "path", - d: - "m 4.5,0.5 c -2.216,0 -4,1.784 -4,4 l 0,24 c 0,2.216 1.784,4 4,4 l 13.71875,0 C 22.478584,27.272785 27.273681,22.511272 32.5,18.25 l 0,-13.75 c 0,-2.216 -1.784,-4 -4,-4 l -24,0 z", + d: "m 4.5,0.5 c -2.216,0 -4,1.784 -4,4 l 0,24 c 0,2.216 1.784,4 4,4 l 13.71875,0 C 22.478584,27.272785 27.273681,22.511272 32.5,18.25 l 0,-13.75 c 0,-2.216 -1.784,-4 -4,-4 l -24,0 z", }, animation_pathPointer: { tagName: "path", @@ -84,8 +80,7 @@ const svgIconsById = { }, animation_pathSwooshFX: { tagName: "path", - d: - "m 85,0 c 0,16.617 -4.813944,35.356 -13.131081,48.4508 h 6.099803 c 8.317138,-13.0948 13.13322,-28.5955 13.13322,-45.2124 0,-46.94483 -38.402714,-85.00262 -85.7743869,-85.00262 -1.0218522,0 -2.0373001,0.0241 -3.0506131,0.0589 45.958443,1.59437 82.723058,35.77285 82.723058,81.70532 z", + d: "m 85,0 c 0,16.617 -4.813944,35.356 -13.131081,48.4508 h 6.099803 c 8.317138,-13.0948 13.13322,-28.5955 13.13322,-45.2124 0,-46.94483 -38.402714,-85.00262 -85.7743869,-85.00262 -1.0218522,0 -2.0373001,0.0241 -3.0506131,0.0589 45.958443,1.59437 82.723058,35.77285 82.723058,81.70532 z", }, }; @@ -126,7 +121,7 @@ function svgText(x, y, msg) { function setShuttleRingPointer(shuttleRingPointer, knobOuter, angle) { shuttleRingPointer.setAttribute( "transform", - `translate(100,100) rotate(${angle})` + `translate(100,100) rotate(${angle})`, ); knobOuter.setAttribute("transform", `rotate(${angle})`); } @@ -324,7 +319,7 @@ function SvgButton(svgElement, viewModel) { viewModel.command, "canExecute", this.setEnabled, - this + this, ), ]; } @@ -354,7 +349,7 @@ SvgButton.prototype.setEnabled = function (enabled) { if (this._toggled) { this.svgElement.setAttribute( "class", - "cesium-animation-rectButton cesium-animation-buttonToggled" + "cesium-animation-rectButton cesium-animation-buttonToggled", ); return; } @@ -371,7 +366,7 @@ SvgButton.prototype.setToggled = function (toggled) { if (toggled) { this.svgElement.setAttribute( "class", - "cesium-animation-rectButton cesium-animation-buttonToggled" + "cesium-animation-rectButton cesium-animation-buttonToggled", ); } else { this.svgElement.setAttribute("class", "cesium-animation-rectButton"); @@ -507,19 +502,19 @@ function Animation(container, viewModel) { this._realtimeSVG = new SvgButton( wingButton(3, 4, "animation_pathClock"), - viewModel.playRealtimeViewModel + viewModel.playRealtimeViewModel, ); this._playReverseSVG = new SvgButton( rectButton(44, 99, "animation_pathPlayReverse"), - viewModel.playReverseViewModel + viewModel.playReverseViewModel, ); this._playForwardSVG = new SvgButton( rectButton(124, 99, "animation_pathPlay"), - viewModel.playForwardViewModel + viewModel.playForwardViewModel, ); this._pauseSVG = new SvgButton( rectButton(84, 99, "animation_pathPause"), - viewModel.pauseViewModel + viewModel.pauseViewModel, ); const buttonsG = document.createElementNS(svgNS, "g"); @@ -669,12 +664,12 @@ function Animation(container, viewModel) { if (isPaused) { that._shuttleRingPointer.setAttribute( "class", - "cesium-animation-shuttleRingPausePointer" + "cesium-animation-shuttleRingPausePointer", ); } else { that._shuttleRingPointer.setAttribute( "class", - "cesium-animation-shuttleRingPointer" + "cesium-animation-shuttleRingPointer", ); } } @@ -758,22 +753,22 @@ Animation.prototype.destroy = function () { this._shuttleRingBackPanel.removeEventListener( "mousedown", mouseCallback, - true + true, ); this._shuttleRingBackPanel.removeEventListener( "touchstart", mouseCallback, - true + true, ); this._shuttleRingSwooshG.removeEventListener( "mousedown", mouseCallback, - true + true, ); this._shuttleRingSwooshG.removeEventListener( "touchstart", mouseCallback, - true + true, ); doc.removeEventListener("mousemove", mouseCallback, true); doc.removeEventListener("touchmove", mouseCallback, true); @@ -783,12 +778,12 @@ Animation.prototype.destroy = function () { this._shuttleRingPointer.removeEventListener( "mousedown", mouseCallback, - true + true, ); this._shuttleRingPointer.removeEventListener( "touchstart", mouseCallback, - true + true, ); this._knobOuter.removeEventListener("mousedown", mouseCallback, true); this._knobOuter.removeEventListener("touchstart", mouseCallback, true); @@ -915,7 +910,7 @@ Animation.prototype.applyThemeChanges = function () { offset: "0%", "stop-color": makeColorString( buttonNormalBackColor, - gradientEnabledColor0 + gradientEnabledColor0, ), }, { @@ -923,7 +918,7 @@ Animation.prototype.applyThemeChanges = function () { offset: "12%", "stop-color": makeColorString( buttonNormalBackColor, - gradientEnabledColor1 + gradientEnabledColor1, ), }, { @@ -931,7 +926,7 @@ Animation.prototype.applyThemeChanges = function () { offset: "46%", "stop-color": makeColorString( buttonNormalBackColor, - gradientEnabledColor2 + gradientEnabledColor2, ), }, { @@ -939,7 +934,7 @@ Animation.prototype.applyThemeChanges = function () { offset: "81%", "stop-color": makeColorString( buttonNormalBackColor, - gradientEnabledColor3 + gradientEnabledColor3, ), }, ], @@ -957,7 +952,7 @@ Animation.prototype.applyThemeChanges = function () { offset: "0%", "stop-color": makeColorString( buttonHoverBackColor, - gradientEnabledColor0 + gradientEnabledColor0, ), }, { @@ -965,7 +960,7 @@ Animation.prototype.applyThemeChanges = function () { offset: "12%", "stop-color": makeColorString( buttonHoverBackColor, - gradientEnabledColor1 + gradientEnabledColor1, ), }, { @@ -973,7 +968,7 @@ Animation.prototype.applyThemeChanges = function () { offset: "46%", "stop-color": makeColorString( buttonHoverBackColor, - gradientEnabledColor2 + gradientEnabledColor2, ), }, { @@ -981,7 +976,7 @@ Animation.prototype.applyThemeChanges = function () { offset: "81%", "stop-color": makeColorString( buttonHoverBackColor, - gradientEnabledColor3 + gradientEnabledColor3, ), }, ], @@ -999,7 +994,7 @@ Animation.prototype.applyThemeChanges = function () { offset: "0%", "stop-color": makeColorString( buttonToggledBackColor, - gradientEnabledColor0 + gradientEnabledColor0, ), }, { @@ -1007,7 +1002,7 @@ Animation.prototype.applyThemeChanges = function () { offset: "12%", "stop-color": makeColorString( buttonToggledBackColor, - gradientEnabledColor1 + gradientEnabledColor1, ), }, { @@ -1015,7 +1010,7 @@ Animation.prototype.applyThemeChanges = function () { offset: "46%", "stop-color": makeColorString( buttonToggledBackColor, - gradientEnabledColor2 + gradientEnabledColor2, ), }, { @@ -1023,7 +1018,7 @@ Animation.prototype.applyThemeChanges = function () { offset: "81%", "stop-color": makeColorString( buttonToggledBackColor, - gradientEnabledColor3 + gradientEnabledColor3, ), }, ], @@ -1041,7 +1036,7 @@ Animation.prototype.applyThemeChanges = function () { offset: "0%", "stop-color": makeColorString( buttonDisabledBackColor, - gradientDisabledColor0 + gradientDisabledColor0, ), }, { @@ -1049,7 +1044,7 @@ Animation.prototype.applyThemeChanges = function () { offset: "75%", "stop-color": makeColorString( buttonDisabledBackColor, - gradientDisabledColor1 + gradientDisabledColor1, ), }, ], diff --git a/packages/widgets/Source/Animation/AnimationViewModel.js b/packages/widgets/Source/Animation/AnimationViewModel.js index 864b0bc51e6f..f00e762cd677 100644 --- a/packages/widgets/Source/Animation/AnimationViewModel.js +++ b/packages/widgets/Source/Animation/AnimationViewModel.js @@ -192,13 +192,13 @@ function AnimationViewModel(clockViewModel) { return multiplierToAngle( clockViewModel.multiplier, that._allShuttleRingTicks, - clockViewModel + clockViewModel, ); }, set: function (angle) { angle = Math.max( Math.min(angle, maxShuttleRingAngle), - -maxShuttleRingAngle + -maxShuttleRingAngle, ); const ticks = that._allShuttleRingTicks; @@ -342,9 +342,12 @@ function AnimationViewModel(clockViewModel) { tooltip: "Play Forward", }); - const playRealtimeCommand = createCommand(function () { - that._clockViewModel.clockStep = ClockStep.SYSTEM_CLOCK; - }, knockout.getObservable(this, "_isSystemTimeAvailable")); + const playRealtimeCommand = createCommand( + function () { + that._clockViewModel.clockStep = ClockStep.SYSTEM_CLOCK; + }, + knockout.getObservable(this, "_isSystemTimeAvailable"), + ); this._playRealtimeViewModel = new ToggleButtonViewModel(playRealtimeCommand, { toggled: knockout.computed(function () { diff --git a/packages/widgets/Source/BaseLayerPicker/BaseLayerPicker.css b/packages/widgets/Source/BaseLayerPicker/BaseLayerPicker.css index 8f623f369e49..4c96ecb200f5 100644 --- a/packages/widgets/Source/BaseLayerPicker/BaseLayerPicker.css +++ b/packages/widgets/Source/BaseLayerPicker/BaseLayerPicker.css @@ -28,14 +28,19 @@ transform: translate(0, -20%); visibility: hidden; opacity: 0; - transition: visibility 0s 0.2s, opacity 0.2s ease-in, transform 0.2s ease-in; + transition: + visibility 0s 0.2s, + opacity 0.2s ease-in, + transform 0.2s ease-in; } .cesium-baseLayerPicker-dropDown-visible { transform: translate(0, 0); visibility: visible; opacity: 1; - transition: opacity 0.2s ease-out, transform 0.2s ease-out; + transition: + opacity 0.2s ease-out, + transform 0.2s ease-out; } .cesium-baseLayerPicker-sectionTitle { @@ -105,7 +110,9 @@ .cesium-baseLayerPicker-item:hover .cesium-baseLayerPicker-itemIcon { border-color: #fff; - box-shadow: 0 0 8px #fff, 0 0 8px #fff; + box-shadow: + 0 0 8px #fff, + 0 0 8px #fff; } .cesium-baseLayerPicker-selectedItem .cesium-baseLayerPicker-itemLabel { diff --git a/packages/widgets/Source/BaseLayerPicker/BaseLayerPicker.js b/packages/widgets/Source/BaseLayerPicker/BaseLayerPicker.js index a1ec026cca76..0748df1688d2 100644 --- a/packages/widgets/Source/BaseLayerPicker/BaseLayerPicker.js +++ b/packages/widgets/Source/BaseLayerPicker/BaseLayerPicker.js @@ -111,7 +111,7 @@ function BaseLayerPicker(container, options) { "data-bind", "\ attr: { title: buttonTooltip },\ -click: toggleDropDown" +click: toggleDropDown", ); container.appendChild(element); @@ -121,7 +121,7 @@ click: toggleDropDown" imgElement.setAttribute( "data-bind", "\ -attr: { src: buttonImageUrl }, visible: !!buttonImageUrl" +attr: { src: buttonImageUrl }, visible: !!buttonImageUrl", ); element.appendChild(imgElement); @@ -130,7 +130,7 @@ attr: { src: buttonImageUrl }, visible: !!buttonImageUrl" dropPanel.setAttribute( "data-bind", '\ -css: { "cesium-baseLayerPicker-dropDown-visible" : dropDownVisible }' +css: { "cesium-baseLayerPicker-dropDown-visible" : dropDownVisible }', ); container.appendChild(dropPanel); @@ -138,7 +138,7 @@ css: { "cesium-baseLayerPicker-dropDown-visible" : dropDownVisible }' imageryTitle.className = "cesium-baseLayerPicker-sectionTitle"; imageryTitle.setAttribute( "data-bind", - "visible: imageryProviderViewModels.length > 0" + "visible: imageryProviderViewModels.length > 0", ); imageryTitle.innerHTML = "Imagery"; dropPanel.appendChild(imageryTitle); @@ -170,7 +170,7 @@ css: { "cesium-baseLayerPicker-dropDown-visible" : dropDownVisible }' css: { "cesium-baseLayerPicker-selectedItem" : $data === $parents[1].selectedImagery },\ attr: { title: tooltip },\ visible: creationCommand.canExecute,\ -click: function($data) { $parents[1].selectedImagery = $data; }' +click: function($data) { $parents[1].selectedImagery = $data; }', ); imageryChoices.appendChild(imageryProvider); @@ -189,7 +189,7 @@ click: function($data) { $parents[1].selectedImagery = $data; }' terrainTitle.className = "cesium-baseLayerPicker-sectionTitle"; terrainTitle.setAttribute( "data-bind", - "visible: terrainProviderViewModels.length > 0" + "visible: terrainProviderViewModels.length > 0", ); terrainTitle.innerHTML = "Terrain"; dropPanel.appendChild(terrainTitle); @@ -221,7 +221,7 @@ click: function($data) { $parents[1].selectedImagery = $data; }' css: { "cesium-baseLayerPicker-selectedItem" : $data === $parents[1].selectedTerrain },\ attr: { title: tooltip },\ visible: creationCommand.canExecute,\ -click: function($data) { $parents[1].selectedTerrain = $data; }' +click: function($data) { $parents[1].selectedTerrain = $data; }', ); terrainChoices.appendChild(terrainProvider); diff --git a/packages/widgets/Source/BaseLayerPicker/BaseLayerPickerViewModel.js b/packages/widgets/Source/BaseLayerPicker/BaseLayerPickerViewModel.js index 1e35d2f25a9d..3297b1f97a56 100644 --- a/packages/widgets/Source/BaseLayerPicker/BaseLayerPickerViewModel.js +++ b/packages/widgets/Source/BaseLayerPicker/BaseLayerPickerViewModel.js @@ -30,11 +30,11 @@ function BaseLayerPickerViewModel(options) { const globe = options.globe; const imageryProviderViewModels = defaultValue( options.imageryProviderViewModels, - [] + [], ); const terrainProviderViewModels = defaultValue( options.terrainProviderViewModels, - [] + [], ); //>>includeStart('debug', pragmas.debug); @@ -74,7 +74,7 @@ function BaseLayerPickerViewModel(options) { const imageryObservable = knockout.getObservable( this, - "imageryProviderViewModels" + "imageryProviderViewModels", ); const imageryProviders = knockout.pureComputed(function () { const providers = imageryObservable(); @@ -105,7 +105,7 @@ function BaseLayerPickerViewModel(options) { const terrainObservable = knockout.getObservable( this, - "terrainProviderViewModels" + "terrainProviderViewModels", ); const terrainProviders = knockout.pureComputed(function () { const providers = terrainObservable(); @@ -269,12 +269,11 @@ function BaseLayerPickerViewModel(options) { this._globe.terrainProvider = newProvider; } else if (defined(newProvider)) { let cancelUpdate = false; - const removeCancelListener = this._globe.terrainProviderChanged.addEventListener( - () => { + const removeCancelListener = + this._globe.terrainProviderChanged.addEventListener(() => { cancelUpdate = true; removeCancelListener(); - } - ); + }); const terrain = new Terrain(newProvider); const removeEventListener = terrain.readyEvent.addEventListener( @@ -289,7 +288,7 @@ function BaseLayerPickerViewModel(options) { ); this._globe.terrainProvider = terrainProvider; removeEventListener(); - } + }, ); } @@ -305,7 +304,7 @@ function BaseLayerPickerViewModel(options) { this.selectedImagery = defaultValue( options.selectedImageryProviderViewModel, - imageryProviderViewModels[0] + imageryProviderViewModels[0], ); this.selectedTerrain = options.selectedTerrainProviderViewModel; } diff --git a/packages/widgets/Source/BaseLayerPicker/createDefaultImageryProviderViewModels.js b/packages/widgets/Source/BaseLayerPicker/createDefaultImageryProviderViewModels.js index ab5d7c60079c..4238fdb61446 100644 --- a/packages/widgets/Source/BaseLayerPicker/createDefaultImageryProviderViewModels.js +++ b/packages/widgets/Source/BaseLayerPicker/createDefaultImageryProviderViewModels.js @@ -27,14 +27,14 @@ function createDefaultImageryProviderViewModels() { style: IonWorldImageryStyle.AERIAL, }); }, - }) + }), ); providerViewModels.push( new ProviderViewModel({ name: "Bing Maps Aerial with Labels", iconUrl: buildModuleUrl( - "Widgets/Images/ImageryProviders/bingAerialLabels.png" + "Widgets/Images/ImageryProviders/bingAerialLabels.png", ), tooltip: "Bing Maps aerial imagery with labels, provided by Cesium ion", category: "Cesium ion", @@ -43,7 +43,7 @@ function createDefaultImageryProviderViewModels() { style: IonWorldImageryStyle.AERIAL_WITH_LABELS, }); }, - }) + }), ); providerViewModels.push( @@ -57,14 +57,14 @@ function createDefaultImageryProviderViewModels() { style: IonWorldImageryStyle.ROAD, }); }, - }) + }), ); providerViewModels.push( new ProviderViewModel({ name: "ArcGIS World Imagery", iconUrl: buildModuleUrl( - "Widgets/Images/ImageryProviders/ArcGisMapServiceWorldImagery.png" + "Widgets/Images/ImageryProviders/ArcGisMapServiceWorldImagery.png", ), tooltip: "\ @@ -82,17 +82,17 @@ https://www.arcgis.com/home/item.html?id=10df2279f9684e4a9f6a7f08febac2a9", ArcGisBaseMapType.SATELLITE, { enablePickFeatures: false, - } + }, ); }, - }) + }), ); providerViewModels.push( new ProviderViewModel({ name: "ArcGIS World Hillshade", iconUrl: buildModuleUrl( - "Widgets/Images/ImageryProviders/ArcGisMapServiceWorldHillshade.png" + "Widgets/Images/ImageryProviders/ArcGisMapServiceWorldHillshade.png", ), tooltip: "\ @@ -107,17 +107,17 @@ https://www.arcgis.com/home/item.html?id=1b243539f4514b6ba35e7d995890db1d", ArcGisBaseMapType.HILLSHADE, { enablePickFeatures: false, - } + }, ); }, - }) + }), ); providerViewModels.push( new ProviderViewModel({ name: "Esri World Ocean", iconUrl: buildModuleUrl( - "Widgets/Images/ImageryProviders/ArcGisMapServiceWorldOcean.png" + "Widgets/Images/ImageryProviders/ArcGisMapServiceWorldOcean.png", ), tooltip: "\ @@ -135,17 +135,17 @@ https://www.arcgis.com/home/item.html?id=1e126e7520f9466c9ca28b8f28b5e500", ArcGisBaseMapType.OCEANS, { enablePickFeatures: false, - } + }, ); }, - }) + }), ); providerViewModels.push( new ProviderViewModel({ name: "Open\u00adStreet\u00adMap", iconUrl: buildModuleUrl( - "Widgets/Images/ImageryProviders/openStreetMap.png" + "Widgets/Images/ImageryProviders/openStreetMap.png", ), tooltip: "OpenStreetMap (OSM) is a collaborative project to create a free editable map \ @@ -156,14 +156,14 @@ of the world.\nhttp://www.openstreetmap.org", url: "https://tile.openstreetmap.org/", }); }, - }) + }), ); providerViewModels.push( new ProviderViewModel({ name: "Stadia x Stamen Watercolor", iconUrl: buildModuleUrl( - "Widgets/Images/ImageryProviders/stamenWatercolor.png" + "Widgets/Images/ImageryProviders/stamenWatercolor.png", ), tooltip: "Based on the original basemaps created for the Knight Foundation and reminiscent of hand drawn maps, the watercolor maps from Stamen Design apply raster effect area washes and organic edges over a paper texture to add warm pop to any map.\nhttps://docs.stadiamaps.com/map-styles/stamen-watercolor/", @@ -178,14 +178,14 @@ of the world.\nhttp://www.openstreetmap.org", © <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`, }); }, - }) + }), ); providerViewModels.push( new ProviderViewModel({ name: "Stadia x Stamen Toner", iconUrl: buildModuleUrl( - "Widgets/Images/ImageryProviders/stamenToner.png" + "Widgets/Images/ImageryProviders/stamenToner.png", ), tooltip: "Based on the original basemaps created for the Knight Foundation and the most popular of the excellent styles from Stamen Design, these high-contrast B+W (black and white) maps are the perfect backdrop for your colorful and eye-catching overlays.\nhttps://docs.stadiamaps.com/map-styles/stamen-toner/", @@ -200,14 +200,14 @@ of the world.\nhttp://www.openstreetmap.org", © <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`, }); }, - }) + }), ); providerViewModels.push( new ProviderViewModel({ name: "Stadia Alidade Smooth", iconUrl: buildModuleUrl( - "Widgets/Images/ImageryProviders/stadiaAlidadeSmooth.png" + "Widgets/Images/ImageryProviders/stadiaAlidadeSmooth.png", ), tooltip: "Stadia's custom Alidade Smooth style is designed for maps that use a lot of markers or overlays. It features a muted color scheme and fewer points of interest to allow your added data to shine.\nhttps://docs.stadiamaps.com/map-styles/alidade-smooth/", @@ -221,14 +221,14 @@ of the world.\nhttp://www.openstreetmap.org", © <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`, }); }, - }) + }), ); providerViewModels.push( new ProviderViewModel({ name: "Stadia Alidade Smooth Dark", iconUrl: buildModuleUrl( - "Widgets/Images/ImageryProviders/stadiaAlidadeSmoothDark.png" + "Widgets/Images/ImageryProviders/stadiaAlidadeSmoothDark.png", ), tooltip: "Stadia Alidade Smooth Dark, like its lighter cousin, is also designed to stay out of the way. It just flips the dark mode switch on the color scheme. With the lights out, your data can now literally shine.\nhttps://docs.stadiamaps.com/map-styles/alidade-smooth-dark/", @@ -242,7 +242,7 @@ of the world.\nhttp://www.openstreetmap.org", © <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`, }); }, - }) + }), ); providerViewModels.push( @@ -255,7 +255,7 @@ of the world.\nhttp://www.openstreetmap.org", creationFunction: function () { return IonImageryProvider.fromAssetId(3954); }, - }) + }), ); providerViewModels.push( @@ -267,14 +267,14 @@ of the world.\nhttp://www.openstreetmap.org", creationFunction: function () { return IonImageryProvider.fromAssetId(3845); }, - }) + }), ); providerViewModels.push( new ProviderViewModel({ name: "Earth at night", iconUrl: buildModuleUrl( - "Widgets/Images/ImageryProviders/earthAtNight.png" + "Widgets/Images/ImageryProviders/earthAtNight.png", ), tooltip: "The Earth at night, also known as The Black Marble, is a 500 meter resolution global composite imagery layer released by NASA.", @@ -282,24 +282,24 @@ of the world.\nhttp://www.openstreetmap.org", creationFunction: function () { return IonImageryProvider.fromAssetId(3812); }, - }) + }), ); providerViewModels.push( new ProviderViewModel({ name: "Natural Earth\u00a0II", iconUrl: buildModuleUrl( - "Widgets/Images/ImageryProviders/naturalEarthII.png" + "Widgets/Images/ImageryProviders/naturalEarthII.png", ), tooltip: "Natural Earth II, darkened for contrast.\nhttp://www.naturalearthdata.com/", category: "Cesium ion", creationFunction: function () { return TileMapServiceImageryProvider.fromUrl( - buildModuleUrl("Assets/Textures/NaturalEarthII") + buildModuleUrl("Assets/Textures/NaturalEarthII"), ); }, - }) + }), ); return providerViewModels; diff --git a/packages/widgets/Source/BaseLayerPicker/createDefaultTerrainProviderViewModels.js b/packages/widgets/Source/BaseLayerPicker/createDefaultTerrainProviderViewModels.js index ca9e7b2be41b..2cf4b667b1cf 100644 --- a/packages/widgets/Source/BaseLayerPicker/createDefaultTerrainProviderViewModels.js +++ b/packages/widgets/Source/BaseLayerPicker/createDefaultTerrainProviderViewModels.js @@ -20,14 +20,14 @@ function createDefaultTerrainProviderViewModels() { creationFunction: function () { return new EllipsoidTerrainProvider({ ellipsoid: Ellipsoid.WGS84 }); }, - }) + }), ); providerViewModels.push( new ProviderViewModel({ name: "Cesium World Terrain", iconUrl: buildModuleUrl( - "Widgets/Images/TerrainProviders/CesiumWorldTerrain.png" + "Widgets/Images/TerrainProviders/CesiumWorldTerrain.png", ), tooltip: "High-resolution global terrain tileset curated from several datasources and hosted by Cesium ion", @@ -38,7 +38,7 @@ function createDefaultTerrainProviderViewModels() { requestVertexNormals: true, }); }, - }) + }), ); return providerViewModels; diff --git a/packages/widgets/Source/Cesium3DTilesInspector/Cesium3DTilesInspector.js b/packages/widgets/Source/Cesium3DTilesInspector/Cesium3DTilesInspector.js index 742434dc7361..9cd5cacff3bf 100644 --- a/packages/widgets/Source/Cesium3DTilesInspector/Cesium3DTilesInspector.js +++ b/packages/widgets/Source/Cesium3DTilesInspector/Cesium3DTilesInspector.js @@ -24,7 +24,7 @@ function Cesium3DTilesInspector(container, scene) { performanceContainer.setAttribute("data-bind", "visible: performance"); const viewModel = new Cesium3DTilesInspectorViewModel( scene, - performanceContainer + performanceContainer, ); this._viewModel = viewModel; @@ -39,7 +39,7 @@ function Cesium3DTilesInspector(container, scene) { element.className = "cesium-cesiumInspector cesium-3DTilesInspector"; element.setAttribute( "data-bind", - 'css: { "cesium-cesiumInspector-visible" : inspectorVisible, "cesium-cesiumInspector-hidden" : !inspectorVisible}' + 'css: { "cesium-cesiumInspector-visible" : inspectorVisible, "cesium-cesiumInspector-hidden" : !inspectorVisible}', ); container.appendChild(element); @@ -56,43 +56,43 @@ function Cesium3DTilesInspector(container, scene) { panel, "Tileset", "tilesetVisible", - "toggleTileset" + "toggleTileset", ); const displayPanelContents = createSection( panel, "Display", "displayVisible", - "toggleDisplay" + "toggleDisplay", ); const updatePanelContents = createSection( panel, "Update", "updateVisible", - "toggleUpdate" + "toggleUpdate", ); const loggingPanelContents = createSection( panel, "Logging", "loggingVisible", - "toggleLogging" + "toggleLogging", ); const tileDebugLabelsPanelContents = createSection( panel, "Tile Debug Labels", "tileDebugLabelsVisible", - "toggleTileDebugLabels" + "toggleTileDebugLabels", ); const stylePanelContents = createSection( panel, "Style", "styleVisible", - "toggleStyle" + "toggleStyle", ); const optimizationPanelContents = createSection( panel, "Optimization", "optimizationVisible", - "toggleOptimization" + "toggleOptimization", ); const properties = document.createElement("div"); @@ -106,10 +106,10 @@ function Cesium3DTilesInspector(container, scene) { properties.appendChild(propertiesField); tilesetPanelContents.appendChild(properties); tilesetPanelContents.appendChild( - createButton("Pick Tileset", "togglePickTileset", "pickActive") + createButton("Pick Tileset", "togglePickTileset", "pickActive"), ); tilesetPanelContents.appendChild( - createButton("Trim Tiles Cache", "trimTilesCache") + createButton("Trim Tiles Cache", "trimTilesCache"), ); tilesetPanelContents.appendChild(createCheckbox("Enable Picking", "picking")); @@ -118,71 +118,77 @@ function Cesium3DTilesInspector(container, scene) { createCheckbox( "Wireframe", "wireframe", - "_tileset === undefined || hasEnabledWireframe" - ) + "_tileset === undefined || hasEnabledWireframe", + ), ); // Create warning text when the Wireframe checkbox is disabled const warningText = document.createElement("p"); warningText.setAttribute( "data-bind", - "visible: _tileset !== undefined && !hasEnabledWireframe" + "visible: _tileset !== undefined && !hasEnabledWireframe", ); warningText.setAttribute( "class", - "cesium-3DTilesInspector-disabledElementsInfo" + "cesium-3DTilesInspector-disabledElementsInfo", ); warningText.innerText = "Set enableDebugWireframe to true in the tileset constructor to enable this option."; wireframeCheckbox.appendChild(warningText); displayPanelContents.appendChild( - createCheckbox("Bounding Volumes", "showBoundingVolumes") + createCheckbox("Bounding Volumes", "showBoundingVolumes"), ); displayPanelContents.appendChild( - createCheckbox("Content Volumes", "showContentBoundingVolumes") + createCheckbox("Content Volumes", "showContentBoundingVolumes"), ); displayPanelContents.appendChild( - createCheckbox("Request Volumes", "showRequestVolumes") + createCheckbox("Request Volumes", "showRequestVolumes"), ); displayPanelContents.appendChild( - createCheckbox("Point Cloud Shading", "pointCloudShading") + createCheckbox("Point Cloud Shading", "pointCloudShading"), ); const pointCloudShadingContainer = document.createElement("div"); pointCloudShadingContainer.setAttribute( "data-bind", - "visible: pointCloudShading" + "visible: pointCloudShading", ); pointCloudShadingContainer.appendChild( - createRangeInput("Geometric Error Scale", "geometricErrorScale", 0, 2, 0.01) + createRangeInput( + "Geometric Error Scale", + "geometricErrorScale", + 0, + 2, + 0.01, + ), ); pointCloudShadingContainer.appendChild( - createRangeInput("Maximum Attenuation", "maximumAttenuation", 0, 32, 1) + createRangeInput("Maximum Attenuation", "maximumAttenuation", 0, 32, 1), ); pointCloudShadingContainer.appendChild( - createRangeInput("Base Resolution", "baseResolution", 0, 1, 0.01) + createRangeInput("Base Resolution", "baseResolution", 0, 1, 0.01), ); pointCloudShadingContainer.appendChild( - createCheckbox("Eye Dome Lighting (EDL)", "eyeDomeLighting") + createCheckbox("Eye Dome Lighting (EDL)", "eyeDomeLighting"), ); displayPanelContents.appendChild(pointCloudShadingContainer); const edlContainer = document.createElement("div"); edlContainer.setAttribute("data-bind", "visible: eyeDomeLighting"); edlContainer.appendChild( - createRangeInput("EDL Strength", "eyeDomeLightingStrength", 0, 2.0, 0.1) + createRangeInput("EDL Strength", "eyeDomeLightingStrength", 0, 2.0, 0.1), ); edlContainer.appendChild( - createRangeInput("EDL Radius", "eyeDomeLightingRadius", 0, 4.0, 0.1) + createRangeInput("EDL Radius", "eyeDomeLightingRadius", 0, 4.0, 0.1), ); pointCloudShadingContainer.appendChild(edlContainer); updatePanelContents.appendChild( - createCheckbox("Freeze Frame", "freezeFrame") + createCheckbox("Freeze Frame", "freezeFrame"), ); updatePanelContents.appendChild( - createCheckbox("Dynamic Screen Space Error", "dynamicScreenSpaceError") + createCheckbox("Dynamic Screen Space Error", "dynamicScreenSpaceError"), ); const sseContainer = document.createElement("div"); sseContainer.appendChild( @@ -191,14 +197,14 @@ function Cesium3DTilesInspector(container, scene) { "maximumScreenSpaceError", 0, 128, - 1 - ) + 1, + ), ); updatePanelContents.appendChild(sseContainer); const dynamicScreenSpaceErrorContainer = document.createElement("div"); dynamicScreenSpaceErrorContainer.setAttribute( "data-bind", - "visible: dynamicScreenSpaceError" + "visible: dynamicScreenSpaceError", ); dynamicScreenSpaceErrorContainer.appendChild( createRangeInput( @@ -207,8 +213,8 @@ function Cesium3DTilesInspector(container, scene) { 0, 1, 0.005, - "dynamicScreenSpaceErrorDensity" - ) + "dynamicScreenSpaceErrorDensity", + ), ); dynamicScreenSpaceErrorContainer.appendChild( createRangeInput( @@ -216,43 +222,43 @@ function Cesium3DTilesInspector(container, scene) { "dynamicScreenSpaceErrorFactor", 1, 32, - 0.1 - ) + 0.1, + ), ); updatePanelContents.appendChild(dynamicScreenSpaceErrorContainer); loggingPanelContents.appendChild( - createCheckbox("Performance", "performance") + createCheckbox("Performance", "performance"), ); loggingPanelContents.appendChild(performanceContainer); loggingPanelContents.appendChild( - createCheckbox("Statistics", "showStatistics") + createCheckbox("Statistics", "showStatistics"), ); const statistics = document.createElement("div"); statistics.className = "cesium-3dTilesInspector-statistics"; statistics.setAttribute( "data-bind", - "html: statisticsText, visible: showStatistics" + "html: statisticsText, visible: showStatistics", ); loggingPanelContents.appendChild(statistics); loggingPanelContents.appendChild( - createCheckbox("Pick Statistics", "showPickStatistics") + createCheckbox("Pick Statistics", "showPickStatistics"), ); const pickStatistics = document.createElement("div"); pickStatistics.className = "cesium-3dTilesInspector-statistics"; pickStatistics.setAttribute( "data-bind", - "html: pickStatisticsText, visible: showPickStatistics" + "html: pickStatisticsText, visible: showPickStatistics", ); loggingPanelContents.appendChild(pickStatistics); loggingPanelContents.appendChild( - createCheckbox("Resource Cache Statistics", "showResourceCacheStatistics") + createCheckbox("Resource Cache Statistics", "showResourceCacheStatistics"), ); const resourceCacheStatistics = document.createElement("div"); resourceCacheStatistics.className = "cesium-3dTilesInspector-statistics"; resourceCacheStatistics.setAttribute( "data-bind", - "html: resourceCacheStatisticsText, visible: showResourceCacheStatistics" + "html: resourceCacheStatisticsText, visible: showResourceCacheStatistics", ); loggingPanelContents.appendChild(resourceCacheStatistics); @@ -265,13 +271,13 @@ function Cesium3DTilesInspector(container, scene) { "options: colorBlendModes, " + 'optionsText: "text", ' + 'optionsValue: "value", ' + - "value: colorBlendMode" + "value: colorBlendMode", ); stylePanelEditor.appendChild(blendDropdown); const styleEditor = document.createElement("textarea"); styleEditor.setAttribute( "data-bind", - "textInput: styleString, event: { keydown: styleEditorKeyPress }" + "textInput: styleString, event: { keydown: styleEditorKeyPress }", ); stylePanelEditor.className = "cesium-cesiumInspector-styleEditor"; stylePanelEditor.appendChild(styleEditor); @@ -283,25 +289,25 @@ function Cesium3DTilesInspector(container, scene) { stylePanelEditor.appendChild(errorBox); tileDebugLabelsPanelContents.appendChild( - createCheckbox("Show Picked Only", "showOnlyPickedTileDebugLabel") + createCheckbox("Show Picked Only", "showOnlyPickedTileDebugLabel"), ); tileDebugLabelsPanelContents.appendChild( - createCheckbox("Geometric Error", "showGeometricError") + createCheckbox("Geometric Error", "showGeometricError"), ); tileDebugLabelsPanelContents.appendChild( - createCheckbox("Rendering Statistics", "showRenderingStatistics") + createCheckbox("Rendering Statistics", "showRenderingStatistics"), ); tileDebugLabelsPanelContents.appendChild( - createCheckbox("Memory Usage (MB)", "showMemoryUsage") + createCheckbox("Memory Usage (MB)", "showMemoryUsage"), ); tileDebugLabelsPanelContents.appendChild(createCheckbox("Url", "showUrl")); optimizationPanelContents.appendChild( - createCheckbox("Skip Tile LODs", "skipLevelOfDetail") + createCheckbox("Skip Tile LODs", "skipLevelOfDetail"), ); const skipScreenSpaceErrorFactorContainer = document.createElement("div"); skipScreenSpaceErrorFactorContainer.appendChild( - createRangeInput("Skip SSE Factor", "skipScreenSpaceErrorFactor", 1, 50, 1) + createRangeInput("Skip SSE Factor", "skipScreenSpaceErrorFactor", 1, 50, 1), ); optimizationPanelContents.appendChild(skipScreenSpaceErrorFactorContainer); const baseScreenSpaceError = document.createElement("div"); @@ -311,23 +317,23 @@ function Cesium3DTilesInspector(container, scene) { "baseScreenSpaceError", 0, 4096, - 1 - ) + 1, + ), ); optimizationPanelContents.appendChild(baseScreenSpaceError); const skipLevelsContainer = document.createElement("div"); skipLevelsContainer.appendChild( - createRangeInput("Min. levels to skip", "skipLevels", 0, 10, 1) + createRangeInput("Min. levels to skip", "skipLevels", 0, 10, 1), ); optimizationPanelContents.appendChild(skipLevelsContainer); optimizationPanelContents.appendChild( createCheckbox( "Load only tiles that meet the max SSE.", - "immediatelyLoadDesiredLevelOfDetail" - ) + "immediatelyLoadDesiredLevelOfDetail", + ), ); optimizationPanelContents.appendChild( - createCheckbox("Load siblings of visible tiles", "loadSiblings") + createCheckbox("Load siblings of visible tiles", "loadSiblings"), ); knockout.applyBindings(viewModel, element); diff --git a/packages/widgets/Source/Cesium3DTilesInspector/Cesium3DTilesInspectorViewModel.js b/packages/widgets/Source/Cesium3DTilesInspector/Cesium3DTilesInspectorViewModel.js index 093545e1572b..6c95c7aa9df3 100644 --- a/packages/widgets/Source/Cesium3DTilesInspector/Cesium3DTilesInspectorViewModel.js +++ b/packages/widgets/Source/Cesium3DTilesInspector/Cesium3DTilesInspectorViewModel.js @@ -112,13 +112,13 @@ function getStatistics(tileset, isPick) { s += // --- Memory statistics `<li><strong>Geometry Memory (MB): </strong>${formatMemoryString( - statistics.geometryByteLength + statistics.geometryByteLength, )}</li>` + `<li><strong>Texture Memory (MB): </strong>${formatMemoryString( - statistics.texturesByteLength + statistics.texturesByteLength, )}</li>` + `<li><strong>Batch Table Memory (MB): </strong>${formatMemoryString( - statistics.batchTableByteLength + statistics.batchTableByteLength, )}</li>`; s += "</ul>"; } @@ -131,10 +131,10 @@ function getResourceCacheStatistics() { return ` <ul class="cesium-cesiumInspector-statistics"> <li><strong>Geometry Memory (MB): </strong>${formatMemoryString( - statistics.geometryByteLength + statistics.geometryByteLength, )}</li> <li><strong>Texture Memory (MB): </strong>${formatMemoryString( - statistics.texturesByteLength + statistics.texturesByteLength, )}</li> </ul> `; @@ -782,7 +782,7 @@ function Cesium3DTilesInspectorViewModel(scene, performanceContainer) { if (value) { that._eventHandler.setInputAction( pickTileset, - ScreenSpaceEventType.LEFT_CLICK + ScreenSpaceEventType.LEFT_CLICK, ); } else { that._eventHandler.removeInputAction(ScreenSpaceEventType.LEFT_CLICK); @@ -1487,7 +1487,7 @@ Cesium3DTilesInspectorViewModel.prototype.compileStyle = function () { */ Cesium3DTilesInspectorViewModel.prototype.styleEditorKeyPress = function ( sender, - event + event, ) { if (event.keyCode === 9) { //tab diff --git a/packages/widgets/Source/CesiumInspector/CesiumInspector.js b/packages/widgets/Source/CesiumInspector/CesiumInspector.js index 54129b654178..085db17089d3 100644 --- a/packages/widgets/Source/CesiumInspector/CesiumInspector.js +++ b/packages/widgets/Source/CesiumInspector/CesiumInspector.js @@ -48,7 +48,7 @@ function CesiumInspector(container, scene) { element.className = "cesium-cesiumInspector"; element.setAttribute( "data-bind", - 'css: { "cesium-cesiumInspector-visible" : dropDownVisible, "cesium-cesiumInspector-hidden" : !dropDownVisible }' + 'css: { "cesium-cesiumInspector-visible" : dropDownVisible, "cesium-cesiumInspector-hidden" : !dropDownVisible }', ); container.appendChild(this._element); @@ -64,7 +64,7 @@ function CesiumInspector(container, scene) { panel, "General", "generalVisible", - "toggleGeneral" + "toggleGeneral", ); const debugShowFrustums = createCheckbox("Show Frustums", "frustums"); @@ -72,16 +72,16 @@ function CesiumInspector(container, scene) { frustumStatistics.className = "cesium-cesiumInspector-frustumStatistics"; frustumStatistics.setAttribute( "data-bind", - "visible: frustums, html: frustumStatisticText" + "visible: frustums, html: frustumStatisticText", ); debugShowFrustums.appendChild(frustumStatistics); generalSection.appendChild(debugShowFrustums); generalSection.appendChild( - createCheckbox("Show Frustum Planes", "frustumPlanes") + createCheckbox("Show Frustum Planes", "frustumPlanes"), ); generalSection.appendChild( - createCheckbox("Performance Display", "performance") + createCheckbox("Performance Display", "performance"), ); performanceContainer.className = "cesium-cesiumInspector-performanceDisplay"; @@ -99,7 +99,7 @@ function CesiumInspector(container, scene) { const gLabel = document.createElement("span"); gLabel.setAttribute( "data-bind", - 'html: "     Frustum:"' + 'html: "     Frustum:"', ); depthFrustum.appendChild(gLabel); @@ -126,7 +126,7 @@ function CesiumInspector(container, scene) { panel, "Primitives", "primitivesVisible", - "togglePrimitives" + "togglePrimitives", ); const pickPrimRequired = document.createElement("div"); pickPrimRequired.className = "cesium-cesiumInspector-pickSection"; @@ -138,7 +138,7 @@ function CesiumInspector(container, scene) { pickPrimitiveButton.className = "cesium-cesiumInspector-pickButton"; pickPrimitiveButton.setAttribute( "data-bind", - 'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickPrimitiveActive}, click: pickPrimitive' + 'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickPrimitiveActive}, click: pickPrimitive', ); let buttonWrap = document.createElement("div"); buttonWrap.className = "cesium-cesiumInspector-center"; @@ -149,21 +149,21 @@ function CesiumInspector(container, scene) { createCheckbox( "Show bounding sphere", "primitiveBoundingSphere", - "hasPickedPrimitive" - ) + "hasPickedPrimitive", + ), ); pickPrimRequired.appendChild( createCheckbox( "Show reference frame", "primitiveReferenceFrame", - "hasPickedPrimitive" - ) + "hasPickedPrimitive", + ), ); this._primitiveOnly = createCheckbox( "Show only selected", "filterPrimitive", - "hasPickedPrimitive" + "hasPickedPrimitive", ); pickPrimRequired.appendChild(this._primitiveOnly); @@ -172,7 +172,7 @@ function CesiumInspector(container, scene) { panel, "Terrain", "terrainVisible", - "toggleTerrain" + "toggleTerrain", ); const pickTileRequired = document.createElement("div"); pickTileRequired.className = "cesium-cesiumInspector-pickSection"; @@ -183,7 +183,7 @@ function CesiumInspector(container, scene) { pickTileButton.className = "cesium-cesiumInspector-pickButton"; pickTileButton.setAttribute( "data-bind", - 'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickTileActive}, click: pickTile' + 'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickTileActive}, click: pickTile', ); buttonWrap = document.createElement("div"); buttonWrap.appendChild(pickTileButton); @@ -258,19 +258,19 @@ function CesiumInspector(container, scene) { createCheckbox( "Show bounding volume", "tileBoundingSphere", - "hasPickedTile" - ) + "hasPickedTile", + ), ); pickTileRequired.appendChild( - createCheckbox("Show only selected", "filterTile", "hasPickedTile") + createCheckbox("Show only selected", "filterTile", "hasPickedTile"), ); terrainSection.appendChild(createCheckbox("Wireframe", "wireframe")); terrainSection.appendChild( - createCheckbox("Suspend LOD update", "suspendUpdates") + createCheckbox("Suspend LOD update", "suspendUpdates"), ); terrainSection.appendChild( - createCheckbox("Show tile coordinates", "tileCoordinates") + createCheckbox("Show tile coordinates", "tileCoordinates"), ); knockout.applyBindings(viewModel, this._element); diff --git a/packages/widgets/Source/CesiumInspector/CesiumInspectorViewModel.js b/packages/widgets/Source/CesiumInspector/CesiumInspectorViewModel.js index 25eb458a661d..e1c391af3644 100644 --- a/packages/widgets/Source/CesiumInspector/CesiumInspectorViewModel.js +++ b/packages/widgets/Source/CesiumInspector/CesiumInspectorViewModel.js @@ -432,7 +432,7 @@ function CesiumInspectorViewModel(scene, performanceContainer) { tileBoundariesLayer = scene.imageryLayers.addImageryProvider( new TileCoordinatesImageryProvider({ tilingScheme: scene.terrainProvider.tilingScheme, - }) + }), ); } else if (!that.tileCoordinates && defined(tileBoundariesLayer)) { scene.imageryLayers.remove(tileBoundariesLayer); @@ -512,7 +512,7 @@ function CesiumInspectorViewModel(scene, performanceContainer) { if (val) { eventHandler.setInputAction( pickPrimitive, - ScreenSpaceEventType.LEFT_CLICK + ScreenSpaceEventType.LEFT_CLICK, ); } else { eventHandler.removeInputAction(ScreenSpaceEventType.LEFT_CLICK); @@ -568,7 +568,7 @@ function CesiumInspectorViewModel(scene, performanceContainer) { if (val) { eventHandler.setInputAction( selectTile, - ScreenSpaceEventType.LEFT_CLICK + ScreenSpaceEventType.LEFT_CLICK, ); } else { eventHandler.removeInputAction(ScreenSpaceEventType.LEFT_CLICK); @@ -925,7 +925,7 @@ Object.defineProperties(CesiumInspectorViewModel.prototype, { CesiumInspectorViewModel.prototype._update = function () { if (this.frustums) { this.frustumStatisticText = frustumStatisticsToString( - this._scene.debugFrustumStatistics + this._scene.debugFrustumStatistics, ); } diff --git a/packages/widgets/Source/FullscreenButton/FullscreenButton.js b/packages/widgets/Source/FullscreenButton/FullscreenButton.js index 4dd5a677ae76..b03b1b49fe2c 100644 --- a/packages/widgets/Source/FullscreenButton/FullscreenButton.js +++ b/packages/widgets/Source/FullscreenButton/FullscreenButton.js @@ -48,7 +48,7 @@ function FullscreenButton(container, fullscreenElement) { attr: { title: tooltip },\ click: command,\ enable: isFullscreenEnabled,\ -cesiumSvgPath: { path: isFullscreen ? _exitFullScreenPath : _enterFullScreenPath, width: 128, height: 128 }" +cesiumSvgPath: { path: isFullscreen ? _exitFullScreenPath : _enterFullScreenPath, width: 128, height: 128 }", ); container.appendChild(element); diff --git a/packages/widgets/Source/FullscreenButton/FullscreenButtonViewModel.js b/packages/widgets/Source/FullscreenButton/FullscreenButtonViewModel.js index 15e01ec5ba1f..eca4b52bce4e 100644 --- a/packages/widgets/Source/FullscreenButton/FullscreenButtonViewModel.js +++ b/packages/widgets/Source/FullscreenButton/FullscreenButtonViewModel.js @@ -71,17 +71,20 @@ function FullscreenButtonViewModel(fullscreenElement, container) { return tmpIsFullscreen() ? "Exit full screen" : "Full screen"; }); - this._command = createCommand(function () { - if (Fullscreen.fullscreen) { - Fullscreen.exitFullscreen(); - } else { - Fullscreen.requestFullscreen(that._fullscreenElement); - } - }, knockout.getObservable(this, "isFullscreenEnabled")); + this._command = createCommand( + function () { + if (Fullscreen.fullscreen) { + Fullscreen.exitFullscreen(); + } else { + Fullscreen.requestFullscreen(that._fullscreenElement); + } + }, + knockout.getObservable(this, "isFullscreenEnabled"), + ); this._fullscreenElement = defaultValue( getElement(fullscreenElement), - ownerDocument.body + ownerDocument.body, ); this._callback = function () { diff --git a/packages/widgets/Source/Geocoder/Geocoder.css b/packages/widgets/Source/Geocoder/Geocoder.css index c7ade60dfcb8..fbcff4fad24a 100644 --- a/packages/widgets/Source/Geocoder/Geocoder.css +++ b/packages/widgets/Source/Geocoder/Geocoder.css @@ -10,7 +10,9 @@ padding: 0 32px 0 0; border-radius: 0; box-sizing: border-box; - transition: width ease-in-out 0.25s, background-color 0.2s ease-in-out; + transition: + width ease-in-out 0.25s, + background-color 0.2s ease-in-out; -webkit-appearance: none; } diff --git a/packages/widgets/Source/Geocoder/Geocoder.js b/packages/widgets/Source/Geocoder/Geocoder.js index f6ab8080ea31..37f438bb37e5 100644 --- a/packages/widgets/Source/Geocoder/Geocoder.js +++ b/packages/widgets/Source/Geocoder/Geocoder.js @@ -58,7 +58,7 @@ textInput: searchText,\ disable: isSearchInProgress,\ event: { keyup: handleKeyUp, keydown: handleKeyDown, mouseover: deselectSuggestion },\ css: { "cesium-geocoder-input-wide" : keepExpanded || searchText.length > 0 },\ -hasFocus: _focusTextbox' +hasFocus: _focusTextbox', ); this._onTextBoxFocus = function () { @@ -79,7 +79,7 @@ hasFocus: _focusTextbox' "data-bind", "\ click: search,\ -cesiumSvgPath: { path: isSearchInProgress ? _stopSearchPath : _startSearchPath, width: 32, height: 32 }" +cesiumSvgPath: { path: isSearchInProgress ? _stopSearchPath : _startSearchPath, width: 32, height: 32 }", ); form.appendChild(searchButton); @@ -89,7 +89,7 @@ cesiumSvgPath: { path: isSearchInProgress ? _stopSearchPath : _startSearchPath, searchSuggestionsContainer.className = "search-results"; searchSuggestionsContainer.setAttribute( "data-bind", - "visible: _suggestionsVisible" + "visible: _suggestionsVisible", ); const suggestionsList = document.createElement("ul"); @@ -101,7 +101,7 @@ cesiumSvgPath: { path: isSearchInProgress ? _stopSearchPath : _startSearchPath, "text: $data.displayName, \ click: $parent.activateSuggestion, \ event: { mouseover: $parent.handleMouseover}, \ -css: { active: $data === $parent._selectedSuggestion }" +css: { active: $data === $parent._selectedSuggestion }", ); searchSuggestionsContainer.appendChild(suggestionsList); diff --git a/packages/widgets/Source/Geocoder/GeocoderViewModel.js b/packages/widgets/Source/Geocoder/GeocoderViewModel.js index 97b48677a014..441031338431 100644 --- a/packages/widgets/Source/Geocoder/GeocoderViewModel.js +++ b/packages/widgets/Source/Geocoder/GeocoderViewModel.js @@ -161,7 +161,7 @@ function GeocoderViewModel(options) { */ this.destinationFound = defaultValue( options.destinationFound, - GeocoderViewModel.flyToDestination + GeocoderViewModel.flyToDestination, ); this._focusTextbox = false; @@ -318,7 +318,7 @@ function handleArrowUp(viewModel) { return; } const currentIndex = viewModel._suggestions.indexOf( - viewModel._selectedSuggestion + viewModel._selectedSuggestion, ); if (currentIndex === -1 || currentIndex === 0) { viewModel._selectedSuggestion = undefined; @@ -335,7 +335,7 @@ function handleArrowDown(viewModel) { } const numberOfSuggestions = viewModel._suggestions.length; const currentIndex = viewModel._suggestions.indexOf( - viewModel._selectedSuggestion + viewModel._selectedSuggestion, ); const next = (currentIndex + 1) % numberOfSuggestions; viewModel._selectedSuggestion = viewModel._suggestions[next]; @@ -358,7 +358,7 @@ function computeFlyToLocationForCartographic(cartographic, terrainProvider) { cartographic = positionOnTerrain[0]; cartographic.height += DEFAULT_HEIGHT; return cartographic; - } + }, ); } @@ -377,12 +377,12 @@ function flyToDestination(viewModel, destination) { CesiumMath.equalsEpsilon( destination.south, destination.north, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ) && CesiumMath.equalsEpsilon( destination.east, destination.west, - CesiumMath.EPSILON7 + CesiumMath.EPSILON7, ) ) { // destination is now a Cartographic @@ -474,7 +474,7 @@ async function geocode(viewModel, geocoderServices, geocodeType) { viewModel.destinationFound(viewModel, geocoderResults[0].destination); const credits = updateCredits( viewModel, - GeocoderService.getCreditsFromResult(geocoderResults[0]) + GeocoderService.getCreditsFromResult(geocoderResults[0]), ); // If the result does not contain any credits, default to the service credit. if (!defined(credits)) { diff --git a/packages/widgets/Source/HomeButton/HomeButton.js b/packages/widgets/Source/HomeButton/HomeButton.js index 342a7d8ab932..0f67ece61c05 100644 --- a/packages/widgets/Source/HomeButton/HomeButton.js +++ b/packages/widgets/Source/HomeButton/HomeButton.js @@ -39,7 +39,7 @@ function HomeButton(container, scene, duration) { "\ attr: { title: tooltip },\ click: command,\ -cesiumSvgPath: { path: _svgPath, width: 28, height: 28 }" +cesiumSvgPath: { path: _svgPath, width: 28, height: 28 }", ); container.appendChild(element); diff --git a/packages/widgets/Source/I3SBuildingSceneLayerExplorer/I3SBuildingSceneLayerExplorerViewModel.js b/packages/widgets/Source/I3SBuildingSceneLayerExplorer/I3SBuildingSceneLayerExplorerViewModel.js index f1ab2f4b1255..47fbc6fd049f 100644 --- a/packages/widgets/Source/I3SBuildingSceneLayerExplorer/I3SBuildingSceneLayerExplorerViewModel.js +++ b/packages/widgets/Source/I3SBuildingSceneLayerExplorer/I3SBuildingSceneLayerExplorerViewModel.js @@ -2,9 +2,10 @@ import { defined } from "@cesium/engine"; import knockout from "../ThirdParty/knockout.js"; function expandItemsHandler(data, event) { - const nestedList = event.currentTarget.parentElement.parentElement.querySelector( - `#${data.name}-expander` - ); + const nestedList = + event.currentTarget.parentElement.parentElement.querySelector( + `#${data.name}-expander`, + ); nestedList.classList.toggle("active"); event.currentTarget.textContent = event.currentTarget.textContent === "+" ? "-" : "+"; diff --git a/packages/widgets/Source/InfoBox/InfoBox.css b/packages/widgets/Source/InfoBox/InfoBox.css index 5041c550418e..26899af2a8b4 100644 --- a/packages/widgets/Source/InfoBox/InfoBox.css +++ b/packages/widgets/Source/InfoBox/InfoBox.css @@ -15,14 +15,19 @@ transform: translate(100%, 0); visibility: hidden; opacity: 0; - transition: visibility 0s 0.2s, opacity 0.2s ease-in, transform 0.2s ease-in; + transition: + visibility 0s 0.2s, + opacity 0.2s ease-in, + transform 0.2s ease-in; } .cesium-infoBox-visible { transform: translate(0, 0); visibility: visible; opacity: 1; - transition: opacity 0.2s ease-out, transform 0.2s ease-out; + transition: + opacity 0.2s ease-out, + transform 0.2s ease-out; } .cesium-infoBox-title { diff --git a/packages/widgets/Source/InfoBox/InfoBox.js b/packages/widgets/Source/InfoBox/InfoBox.js index 82dda94f90c8..5a4871249e28 100644 --- a/packages/widgets/Source/InfoBox/InfoBox.js +++ b/packages/widgets/Source/InfoBox/InfoBox.js @@ -32,7 +32,7 @@ function InfoBox(container) { infoElement.setAttribute( "data-bind", '\ -css: { "cesium-infoBox-visible" : showInfo, "cesium-infoBox-bodyless" : _bodyless }' +css: { "cesium-infoBox-visible" : showInfo, "cesium-infoBox-bodyless" : _bodyless }', ); container.appendChild(infoElement); @@ -50,7 +50,7 @@ css: { "cesium-infoBox-visible" : showInfo, "cesium-infoBox-bodyless" : _bodyles attr: { title: "Focus camera on object" },\ click: function () { cameraClicked.raiseEvent(this); },\ enable: enableCamera,\ -cesiumSvgPath: { path: cameraIconPath, width: 32, height: 32 }' +cesiumSvgPath: { path: cameraIconPath, width: 32, height: 32 }', ); infoElement.appendChild(cameraElement); @@ -60,7 +60,7 @@ cesiumSvgPath: { path: cameraIconPath, width: 32, height: 32 }' closeElement.setAttribute( "data-bind", "\ -click: function () { closeClicked.raiseEvent(this); }" +click: function () { closeClicked.raiseEvent(this); }", ); closeElement.innerHTML = "×"; infoElement.appendChild(closeElement); @@ -70,7 +70,7 @@ click: function () { closeClicked.raiseEvent(this); }" frame.setAttribute("sandbox", "allow-same-origin allow-popups allow-forms"); //allow-pointer-lock allow-scripts allow-top-navigation frame.setAttribute( "data-bind", - "style : { maxHeight : maxHeightOffset(40) }" + "style : { maxHeight : maxHeightOffset(40) }", ); frame.setAttribute("allowfullscreen", true); infoElement.appendChild(frame); @@ -138,7 +138,7 @@ click: function () { closeClicked.raiseEvent(this); }" // Measure and set the new custom height, based on text wrapped above. const height = frameContent.getBoundingClientRect().height; frame.style.height = `${height}px`; - } + }, ); }); diff --git a/packages/widgets/Source/InspectorShared.js b/packages/widgets/Source/InspectorShared.js index 25e4d1326b85..8fe28ca7b7ca 100644 --- a/packages/widgets/Source/InspectorShared.js +++ b/packages/widgets/Source/InspectorShared.js @@ -16,7 +16,7 @@ const InspectorShared = {}; InspectorShared.createCheckbox = function ( labelText, checkedBinding, - enableBinding + enableBinding, ) { //>>includeStart('debug', pragmas.debug); Check.typeOf.string("labelText", labelText); @@ -50,7 +50,7 @@ InspectorShared.createSection = function ( panel, headerText, sectionVisibleBinding, - toggleSectionVisibilityBinding + toggleSectionVisibilityBinding, ) { //>>includeStart('debug', pragmas.debug); Check.defined("panel", panel); @@ -58,14 +58,14 @@ InspectorShared.createSection = function ( Check.typeOf.string("sectionVisibleBinding", sectionVisibleBinding); Check.typeOf.string( "toggleSectionVisibilityBinding", - toggleSectionVisibilityBinding + toggleSectionVisibilityBinding, ); //>>includeEnd('debug'); const section = document.createElement("div"); section.className = "cesium-cesiumInspector-section"; section.setAttribute( "data-bind", - `css: { "cesium-cesiumInspector-section-collapsed": !${sectionVisibleBinding} }` + `css: { "cesium-cesiumInspector-section-collapsed": !${sectionVisibleBinding} }`, ); panel.appendChild(section); @@ -74,7 +74,7 @@ InspectorShared.createSection = function ( sectionHeader.appendChild(document.createTextNode(headerText)); sectionHeader.setAttribute( "data-bind", - `click: ${toggleSectionVisibilityBinding}` + `click: ${toggleSectionVisibilityBinding}`, ); section.appendChild(sectionHeader); @@ -100,7 +100,7 @@ InspectorShared.createRangeInput = function ( min, max, step, - inputValueBinding + inputValueBinding, ) { //>>includeStart('debug', pragmas.debug); Check.typeOf.string("rangeText", rangeText); @@ -121,7 +121,7 @@ InspectorShared.createRangeInput = function ( slider.step = defaultValue(step, "any"); slider.setAttribute( "data-bind", - `valueUpdate: "input", value: ${sliderValueBinding}` + `valueUpdate: "input", value: ${sliderValueBinding}`, ); const wrapper = document.createElement("div"); @@ -146,7 +146,7 @@ InspectorShared.createRangeInput = function ( InspectorShared.createButton = function ( buttonText, clickedBinding, - activeBinding + activeBinding, ) { //>>includeStart('debug', pragmas.debug); Check.typeOf.string("buttonText", buttonText); diff --git a/packages/widgets/Source/NavigationHelpButton/NavigationHelpButton.css b/packages/widgets/Source/NavigationHelpButton/NavigationHelpButton.css index 736c4d2932d9..beb556e803fc 100644 --- a/packages/widgets/Source/NavigationHelpButton/NavigationHelpButton.css +++ b/packages/widgets/Source/NavigationHelpButton/NavigationHelpButton.css @@ -12,7 +12,9 @@ border-radius: 10px; transform: scale(0.01); transform-origin: 234px -10px; - transition: visibility 0s 0.25s, transform 0.25s ease-in; + transition: + visibility 0s 0.25s, + transform 0.25s ease-in; } .cesium-navigation-help-visible { diff --git a/packages/widgets/Source/NavigationHelpButton/NavigationHelpButton.js b/packages/widgets/Source/NavigationHelpButton/NavigationHelpButton.js index 05b7573eb54d..1babb8aa1c6d 100644 --- a/packages/widgets/Source/NavigationHelpButton/NavigationHelpButton.js +++ b/packages/widgets/Source/NavigationHelpButton/NavigationHelpButton.js @@ -44,7 +44,7 @@ function NavigationHelpButton(options) { const showInsructionsDefault = defaultValue( options.instructionsInitiallyVisible, - false + false, ); viewModel.showInstructions = showInsructionsDefault; @@ -64,7 +64,7 @@ function NavigationHelpButton(options) { "\ attr: { title: tooltip },\ click: command,\ -cesiumSvgPath: { path: _svgPath, width: 32, height: 32 }" +cesiumSvgPath: { path: _svgPath, width: 32, height: 32 }", ); wrapper.appendChild(button); @@ -72,7 +72,7 @@ cesiumSvgPath: { path: _svgPath, width: 32, height: 32 }" instructionContainer.className = "cesium-navigation-help"; instructionContainer.setAttribute( "data-bind", - 'css: { "cesium-navigation-help-visible" : showInstructions}' + 'css: { "cesium-navigation-help-visible" : showInstructions}', ); wrapper.appendChild(instructionContainer); @@ -82,7 +82,7 @@ cesiumSvgPath: { path: _svgPath, width: 32, height: 32 }" "cesium-navigation-button cesium-navigation-button-left"; mouseButton.setAttribute( "data-bind", - 'click: showClick, css: {"cesium-navigation-button-selected": !_touch, "cesium-navigation-button-unselected": _touch}' + 'click: showClick, css: {"cesium-navigation-button-selected": !_touch, "cesium-navigation-button-unselected": _touch}', ); const mouseIcon = document.createElement("img"); mouseIcon.src = buildModuleUrl("Widgets/Images/NavigationHelp/Mouse.svg"); @@ -98,7 +98,7 @@ cesiumSvgPath: { path: _svgPath, width: 32, height: 32 }" "cesium-navigation-button cesium-navigation-button-right"; touchButton.setAttribute( "data-bind", - 'click: showTouch, css: {"cesium-navigation-button-selected": _touch, "cesium-navigation-button-unselected": !_touch}' + 'click: showTouch, css: {"cesium-navigation-button-selected": _touch, "cesium-navigation-button-unselected": !_touch}', ); const touchIcon = document.createElement("img"); touchIcon.src = buildModuleUrl("Widgets/Images/NavigationHelp/Touch.svg"); @@ -116,13 +116,13 @@ cesiumSvgPath: { path: _svgPath, width: 32, height: 32 }" "cesium-click-navigation-help cesium-navigation-help-instructions"; clickInstructions.setAttribute( "data-bind", - 'css: { "cesium-click-navigation-help-visible" : !_touch}' + 'css: { "cesium-click-navigation-help-visible" : !_touch}', ); clickInstructions.innerHTML = `\ <table>\ <tr>\ <td><img src="${buildModuleUrl( - "Widgets/Images/NavigationHelp/MouseLeft.svg" + "Widgets/Images/NavigationHelp/MouseLeft.svg", )}" width="48" height="48" /></td>\ <td>\ <div class="cesium-navigation-help-pan">Pan view</div>\ @@ -131,7 +131,7 @@ cesiumSvgPath: { path: _svgPath, width: 32, height: 32 }" </tr>\ <tr>\ <td><img src="${buildModuleUrl( - "Widgets/Images/NavigationHelp/MouseRight.svg" + "Widgets/Images/NavigationHelp/MouseRight.svg", )}" width="48" height="48" /></td>\ <td>\ <div class="cesium-navigation-help-zoom">Zoom view</div>\ @@ -141,7 +141,7 @@ cesiumSvgPath: { path: _svgPath, width: 32, height: 32 }" </tr>\ <tr>\ <td><img src="${buildModuleUrl( - "Widgets/Images/NavigationHelp/MouseMiddle.svg" + "Widgets/Images/NavigationHelp/MouseMiddle.svg", )}" width="48" height="48" /></td>\ <td>\ <div class="cesium-navigation-help-rotate">Rotate view</div>\ @@ -158,13 +158,13 @@ cesiumSvgPath: { path: _svgPath, width: 32, height: 32 }" "cesium-touch-navigation-help cesium-navigation-help-instructions"; touchInstructions.setAttribute( "data-bind", - 'css: { "cesium-touch-navigation-help-visible" : _touch}' + 'css: { "cesium-touch-navigation-help-visible" : _touch}', ); touchInstructions.innerHTML = `\ <table>\ <tr>\ <td><img src="${buildModuleUrl( - "Widgets/Images/NavigationHelp/TouchDrag.svg" + "Widgets/Images/NavigationHelp/TouchDrag.svg", )}" width="70" height="48" /></td>\ <td>\ <div class="cesium-navigation-help-pan">Pan view</div>\ @@ -173,7 +173,7 @@ cesiumSvgPath: { path: _svgPath, width: 32, height: 32 }" </tr>\ <tr>\ <td><img src="${buildModuleUrl( - "Widgets/Images/NavigationHelp/TouchZoom.svg" + "Widgets/Images/NavigationHelp/TouchZoom.svg", )}" width="70" height="48" /></td>\ <td>\ <div class="cesium-navigation-help-zoom">Zoom view</div>\ @@ -182,7 +182,7 @@ cesiumSvgPath: { path: _svgPath, width: 32, height: 32 }" </tr>\ <tr>\ <td><img src="${buildModuleUrl( - "Widgets/Images/NavigationHelp/TouchTilt.svg" + "Widgets/Images/NavigationHelp/TouchTilt.svg", )}" width="70" height="48" /></td>\ <td>\ <div class="cesium-navigation-help-rotate">Tilt view</div>\ @@ -191,7 +191,7 @@ cesiumSvgPath: { path: _svgPath, width: 32, height: 32 }" </tr>\ <tr>\ <td><img src="${buildModuleUrl( - "Widgets/Images/NavigationHelp/TouchRotate.svg" + "Widgets/Images/NavigationHelp/TouchRotate.svg", )}" width="70" height="48" /></td>\ <td>\ <div class="cesium-navigation-help-tilt">Rotate view</div>\ diff --git a/packages/widgets/Source/PerformanceWatchdog/PerformanceWatchdogViewModel.js b/packages/widgets/Source/PerformanceWatchdog/PerformanceWatchdogViewModel.js index 5f0fd411344b..653c344c088c 100644 --- a/packages/widgets/Source/PerformanceWatchdog/PerformanceWatchdogViewModel.js +++ b/packages/widgets/Source/PerformanceWatchdog/PerformanceWatchdogViewModel.js @@ -35,7 +35,7 @@ function PerformanceWatchdogViewModel(options) { */ this.lowFrameRateMessage = defaultValue( options.lowFrameRateMessage, - "This application appears to be performing poorly on your system. Please try using a different web browser or updating your video drivers." + "This application appears to be performing poorly on your system. Please try using a different web browser or updating your video drivers.", ); /** @@ -70,13 +70,13 @@ function PerformanceWatchdogViewModel(options) { if (!that.lowFrameRateMessageDismissed) { that.showingLowFrameRateMessage = true; } - } + }, ); this._unsubscribeNominalFrameRate = monitor.nominalFrameRate.addEventListener( function () { that.showingLowFrameRateMessage = false; - } + }, ); } diff --git a/packages/widgets/Source/ProjectionPicker/ProjectionPicker.css b/packages/widgets/Source/ProjectionPicker/ProjectionPicker.css index 80e0ac1cf674..f9d26457d548 100644 --- a/packages/widgets/Source/ProjectionPicker/ProjectionPicker.css +++ b/packages/widgets/Source/ProjectionPicker/ProjectionPicker.css @@ -13,7 +13,9 @@ span.cesium-projectionPicker-wrapper { .cesium-projectionPicker-hidden { visibility: hidden; opacity: 0; - transition: visibility 0s 0.25s, opacity 0.25s linear; + transition: + visibility 0s 0.25s, + opacity 0.25s linear; } .cesium-projectionPicker-wrapper .cesium-projectionPicker-none { @@ -45,5 +47,7 @@ span.cesium-projectionPicker-wrapper { .cesium-projectionPicker-wrapper .cesium-projectionPicker-selected { border-color: #2e2; - box-shadow: 0 0 8px #fff, 0 0 8px #fff; + box-shadow: + 0 0 8px #fff, + 0 0 8px #fff; } diff --git a/packages/widgets/Source/ProjectionPicker/ProjectionPicker.js b/packages/widgets/Source/ProjectionPicker/ProjectionPicker.js index d1cc1dee8cae..c596245dc8fb 100644 --- a/packages/widgets/Source/ProjectionPicker/ProjectionPicker.js +++ b/packages/widgets/Source/ProjectionPicker/ProjectionPicker.js @@ -63,7 +63,7 @@ css: { "cesium-projectionPicker-buttonPerspective": !_orthographic,\ "cesium-button-disabled" : sceneMode === _sceneMode.SCENE2D || _flightInProgress, \ "cesium-projectionPicker-selected": dropDownVisible },\ attr: { title: selectedTooltip },\ -click: toggleDropDown' +click: toggleDropDown', ); button.innerHTML = '\ @@ -83,7 +83,7 @@ css: { "cesium-projectionPicker-visible" : (dropDownVisible && _orthographic),\ "cesium-projectionPicker-hidden" : !dropDownVisible },\ attr: { title: tooltipPerspective },\ click: switchToPerspective,\ -cesiumSvgPath: { path: _perspectivePath, width: 64, height: 64 }' +cesiumSvgPath: { path: _perspectivePath, width: 64, height: 64 }', ); wrapper.appendChild(perspectiveButton); @@ -99,7 +99,7 @@ css: { "cesium-projectionPicker-visible" : (dropDownVisible && !_orthographic),\ "cesium-projectionPicker-hidden" : !dropDownVisible},\ attr: { title: tooltipOrthographic },\ click: switchToOrthographic,\ -cesiumSvgPath: { path: _orthographicPath, width: 64, height: 64 }' +cesiumSvgPath: { path: _orthographicPath, width: 64, height: 64 }', ); wrapper.appendChild(orthographicButton); diff --git a/packages/widgets/Source/ProjectionPicker/ProjectionPickerViewModel.js b/packages/widgets/Source/ProjectionPicker/ProjectionPickerViewModel.js index bf51b586a9af..7b370939c796 100644 --- a/packages/widgets/Source/ProjectionPicker/ProjectionPickerViewModel.js +++ b/packages/widgets/Source/ProjectionPicker/ProjectionPickerViewModel.js @@ -86,17 +86,15 @@ function ProjectionPickerViewModel(scene) { }); this._eventHelper = new EventHelper(); - this._eventHelper.add(scene.morphComplete, function ( - transitioner, - oldMode, - newMode, - isMorphing - ) { - that.sceneMode = newMode; - that._orthographic = - newMode === SceneMode.SCENE2D || - that._scene.camera.frustum instanceof OrthographicFrustum; - }); + this._eventHelper.add( + scene.morphComplete, + function (transitioner, oldMode, newMode, isMorphing) { + that.sceneMode = newMode; + that._orthographic = + newMode === SceneMode.SCENE2D || + that._scene.camera.frustum instanceof OrthographicFrustum; + }, + ); this._eventHelper.add(scene.preRender, function () { that._flightInProgress = defined(scene.camera._currentFlight); }); diff --git a/packages/widgets/Source/SceneModePicker/SceneModePicker.css b/packages/widgets/Source/SceneModePicker/SceneModePicker.css index 85ea7272233c..eb74f6091914 100644 --- a/packages/widgets/Source/SceneModePicker/SceneModePicker.css +++ b/packages/widgets/Source/SceneModePicker/SceneModePicker.css @@ -13,7 +13,9 @@ span.cesium-sceneModePicker-wrapper { .cesium-sceneModePicker-hidden { visibility: hidden; opacity: 0; - transition: visibility 0s 0.25s, opacity 0.25s linear; + transition: + visibility 0s 0.25s, + opacity 0.25s linear; } .cesium-sceneModePicker-wrapper .cesium-sceneModePicker-none { @@ -76,5 +78,7 @@ span.cesium-sceneModePicker-wrapper { .cesium-sceneModePicker-wrapper .cesium-sceneModePicker-selected { border-color: #2e2; - box-shadow: 0 0 8px #fff, 0 0 8px #fff; + box-shadow: + 0 0 8px #fff, + 0 0 8px #fff; } diff --git a/packages/widgets/Source/SceneModePicker/SceneModePicker.js b/packages/widgets/Source/SceneModePicker/SceneModePicker.js index 3ab0c6465ef9..83c028afc48a 100644 --- a/packages/widgets/Source/SceneModePicker/SceneModePicker.js +++ b/packages/widgets/Source/SceneModePicker/SceneModePicker.js @@ -77,7 +77,7 @@ css: { "cesium-sceneModePicker-button2D": sceneMode === _sceneMode.SCENE2D,\ "cesium-sceneModePicker-buttonColumbusView": sceneMode === _sceneMode.COLUMBUS_VIEW,\ "cesium-sceneModePicker-selected": dropDownVisible },\ attr: { title: selectedTooltip },\ -click: toggleDropDown' +click: toggleDropDown', ); button.innerHTML = '\ @@ -98,7 +98,7 @@ css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sc "cesium-sceneModePicker-hidden" : !dropDownVisible },\ attr: { title: tooltip3D },\ click: morphTo3D,\ -cesiumSvgPath: { path: _globePath, width: 64, height: 64 }' +cesiumSvgPath: { path: _globePath, width: 64, height: 64 }', ); wrapper.appendChild(morphTo3DButton); @@ -114,7 +114,7 @@ css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sc "cesium-sceneModePicker-hidden" : !dropDownVisible },\ attr: { title: tooltip2D },\ click: morphTo2D,\ -cesiumSvgPath: { path: _flatMapPath, width: 64, height: 64 }' +cesiumSvgPath: { path: _flatMapPath, width: 64, height: 64 }', ); wrapper.appendChild(morphTo2DButton); @@ -130,7 +130,7 @@ css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sc "cesium-sceneModePicker-hidden" : !dropDownVisible},\ attr: { title: tooltipColumbusView },\ click: morphToColumbusView,\ -cesiumSvgPath: { path: _columbusViewPath, width: 64, height: 64 }' +cesiumSvgPath: { path: _columbusViewPath, width: 64, height: 64 }', ); wrapper.appendChild(morphToCVButton); diff --git a/packages/widgets/Source/SelectionIndicator/SelectionIndicator.css b/packages/widgets/Source/SelectionIndicator/SelectionIndicator.css index a73a8ce5a723..e5c9fe1cfa7b 100644 --- a/packages/widgets/Source/SelectionIndicator/SelectionIndicator.css +++ b/packages/widgets/Source/SelectionIndicator/SelectionIndicator.css @@ -5,7 +5,9 @@ pointer-events: none; visibility: hidden; opacity: 0; - transition: visibility 0s 0.2s, opacity 0.2s ease-in; + transition: + visibility 0s 0.2s, + opacity 0.2s ease-in; } .cesium-selection-wrapper-visible { diff --git a/packages/widgets/Source/SelectionIndicator/SelectionIndicator.js b/packages/widgets/Source/SelectionIndicator/SelectionIndicator.js index 53c2ee83f9bf..d123c03dc091 100644 --- a/packages/widgets/Source/SelectionIndicator/SelectionIndicator.js +++ b/packages/widgets/Source/SelectionIndicator/SelectionIndicator.js @@ -35,7 +35,7 @@ function SelectionIndicator(container, scene) { "data-bind", '\ style: { "top" : _screenPositionY, "left" : _screenPositionX },\ -css: { "cesium-selection-wrapper-visible" : isVisible }' +css: { "cesium-selection-wrapper-visible" : isVisible }', ); container.appendChild(el); this._element = el; @@ -63,7 +63,7 @@ css: { "cesium-selection-wrapper-visible" : isVisible }' const viewModel = new SelectionIndicatorViewModel( scene, this._element, - this._container + this._container, ); this._viewModel = viewModel; diff --git a/packages/widgets/Source/SelectionIndicator/SelectionIndicatorViewModel.js b/packages/widgets/Source/SelectionIndicator/SelectionIndicatorViewModel.js index d6ba66c211ec..e5d5c63137be 100644 --- a/packages/widgets/Source/SelectionIndicator/SelectionIndicatorViewModel.js +++ b/packages/widgets/Source/SelectionIndicator/SelectionIndicatorViewModel.js @@ -23,7 +23,7 @@ const offScreen = "-1000px"; function SelectionIndicatorViewModel( scene, selectionIndicatorElement, - container + container, ) { //>>includeStart('debug', pragmas.debug); if (!defined(scene)) { @@ -110,7 +110,7 @@ SelectionIndicatorViewModel.prototype.update = function () { if (this.showSelection && defined(this.position)) { const screenPosition = this.computeScreenSpacePosition( this.position, - screenSpacePos + screenSpacePos, ); if (!defined(screenPosition)) { this._screenPositionX = offScreen; @@ -125,12 +125,12 @@ SelectionIndicatorViewModel.prototype.update = function () { screenPosition.x = Math.min( Math.max(screenPosition.x, -indicatorSize), - containerWidth + indicatorSize + containerWidth + indicatorSize, ) - halfSize; screenPosition.y = Math.min( Math.max(screenPosition.y, -indicatorSize), - containerHeight + indicatorSize + containerHeight + indicatorSize, ) - halfSize; this._screenPositionX = `${Math.floor(screenPosition.x + 0.25)}px`; diff --git a/packages/widgets/Source/SvgPathBindingHandler.js b/packages/widgets/Source/SvgPathBindingHandler.js index 5ffe18660450..773f98dac73d 100644 --- a/packages/widgets/Source/SvgPathBindingHandler.js +++ b/packages/widgets/Source/SvgPathBindingHandler.js @@ -59,7 +59,7 @@ const SvgPathBindingHandler = { if (value.css) { svg.setAttribute( "class", - `${svgClassName} ${knockout.unwrap(value.css)}` + `${svgClassName} ${knockout.unwrap(value.css)}`, ); } }, diff --git a/packages/widgets/Source/Timeline/Timeline.js b/packages/widgets/Source/Timeline/Timeline.js index 581bb7a33731..c2eb1c40d21f 100644 --- a/packages/widgets/Source/Timeline/Timeline.js +++ b/packages/widgets/Source/Timeline/Timeline.js @@ -250,13 +250,13 @@ Timeline.prototype.addTrack = function ( interval, heightInPx, color, - backgroundColor + backgroundColor, ) { const newTrack = new TimelineTrack( interval, heightInPx, color, - backgroundColor + backgroundColor, ); this._trackList.push(newTrack); this._lastHeight = undefined; @@ -294,7 +294,7 @@ Timeline.prototype.zoomTo = function (startTime, stopTime) { const clockSpan = JulianDate.secondsDifference(clockEnd, clockStart); const startOffset = JulianDate.secondsDifference( clockStart, - this._startJulian + this._startJulian, ); const endOffset = JulianDate.secondsDifference(clockEnd, this._endJulian); @@ -308,24 +308,24 @@ Timeline.prototype.zoomTo = function (startTime, stopTime) { this._endJulian = JulianDate.addSeconds( this._endJulian, startOffset, - new JulianDate() + new JulianDate(), ); this._startJulian = clockStart; this._timeBarSecondsSpan = JulianDate.secondsDifference( this._endJulian, - this._startJulian + this._startJulian, ); } else if (endOffset < 0) { // if timeline end is after clock end, shift left this._startJulian = JulianDate.addSeconds( this._startJulian, endOffset, - new JulianDate() + new JulianDate(), ); this._endJulian = clockEnd; this._timeBarSecondsSpan = JulianDate.secondsDifference( this._endJulian, - this._startJulian + this._startJulian, ); } } @@ -348,7 +348,7 @@ Timeline.prototype.zoomTo = function (startTime, stopTime) { Timeline.prototype.zoomFrom = function (amount) { let centerSec = JulianDate.secondsDifference( this._scrubJulian, - this._startJulian + this._startJulian, ); if (amount > 1 || centerSec < 0 || centerSec > this._timeBarSecondsSpan) { centerSec = this._timeBarSecondsSpan * 0.5; @@ -360,13 +360,13 @@ Timeline.prototype.zoomFrom = function (amount) { JulianDate.addSeconds( this._startJulian, centerSec - centerSec * amount, - new JulianDate() + new JulianDate(), ), JulianDate.addSeconds( this._endJulian, centerSecFlip * amount - centerSecFlip, - new JulianDate() - ) + new JulianDate(), + ), ); }; @@ -392,7 +392,7 @@ Timeline.prototype.makeLabel = function (time) { return `${timelineMonthNames[gregorian.month - 1]} ${gregorian.day} ${ gregorian.year } ${twoDigits(gregorian.hour)}:${twoDigits(gregorian.minute)}:${twoDigits( - gregorian.second + gregorian.second, )}${millisecondString}`; }; @@ -409,10 +409,10 @@ Timeline.prototype._makeTics = function () { const seconds = JulianDate.secondsDifference( this._scrubJulian, - this._startJulian + this._startJulian, ); const xPos = Math.round( - (seconds * this._topDiv.clientWidth) / this._timeBarSecondsSpan + (seconds * this._topDiv.clientWidth) / this._timeBarSecondsSpan, ); const scrubX = xPos - 8; let tic; @@ -436,7 +436,7 @@ Timeline.prototype._makeTics = function () { this._endJulian = JulianDate.addSeconds( this._startJulian, minimumDuration, - new JulianDate() + new JulianDate(), ); } else if (duration > maximumDuration) { duration = maximumDuration; @@ -444,7 +444,7 @@ Timeline.prototype._makeTics = function () { this._endJulian = JulianDate.addSeconds( this._startJulian, maximumDuration, - new JulianDate() + new JulianDate(), ); } @@ -463,31 +463,31 @@ Timeline.prototype._makeTics = function () { if (duration > 315360000) { // 3650+ days visible, epoch is start of the first visible century. epochJulian = JulianDate.fromDate( - new Date(Date.UTC(Math.floor(gregorianDate.year / 100) * 100, 0)) + new Date(Date.UTC(Math.floor(gregorianDate.year / 100) * 100, 0)), ); } else if (duration > 31536000) { // 365+ days visible, epoch is start of the first visible decade. epochJulian = JulianDate.fromDate( - new Date(Date.UTC(Math.floor(gregorianDate.year / 10) * 10, 0)) + new Date(Date.UTC(Math.floor(gregorianDate.year / 10) * 10, 0)), ); } else if (duration > 86400) { // 1+ day(s) visible, epoch is start of the year. epochJulian = JulianDate.fromDate( - new Date(Date.UTC(gregorianDate.year, 0)) + new Date(Date.UTC(gregorianDate.year, 0)), ); } else { // Less than a day on timeline, epoch is midnight of the visible day. epochJulian = JulianDate.fromDate( new Date( - Date.UTC(gregorianDate.year, gregorianDate.month, gregorianDate.day) - ) + Date.UTC(gregorianDate.year, gregorianDate.month, gregorianDate.day), + ), ); } // startTime: Seconds offset of the left side of the timeline from epochJulian. const startTime = JulianDate.secondsDifference( this._startJulian, - JulianDate.addSeconds(epochJulian, epsilonTime, new JulianDate()) + JulianDate.addSeconds(epochJulian, epsilonTime, new JulianDate()), ); // endTime: Seconds offset of the right side of the timeline from epochJulian. let endTime = startTime + duration; @@ -512,7 +512,7 @@ Timeline.prototype._makeTics = function () { // Width in pixels of a typical label, plus padding this._rulerEle.innerHTML = this.makeLabel( - JulianDate.addSeconds(this._endJulian, -minimumDuration, new JulianDate()) + JulianDate.addSeconds(this._endJulian, -minimumDuration, new JulianDate()), ); let sampleWidth = this._rulerEle.offsetWidth + 20; if (sampleWidth < 30) { @@ -616,7 +616,7 @@ Timeline.prototype._makeTics = function () { tic = getNextTic(tic, tinyTic) ) { tics += `<span class="cesium-timeline-ticTiny" style="left: ${Math.round( - timeBarWidth * getAlpha(tic) + timeBarWidth * getAlpha(tic), ).toString()}px;"></span>`; } } @@ -627,7 +627,7 @@ Timeline.prototype._makeTics = function () { tic = getNextTic(tic, subTic) ) { tics += `<span class="cesium-timeline-ticSub" style="left: ${Math.round( - timeBarWidth * getAlpha(tic) + timeBarWidth * getAlpha(tic), ).toString()}px;"></span>`; } } @@ -640,7 +640,7 @@ Timeline.prototype._makeTics = function () { let ticTime = JulianDate.addSeconds( startJulian, tic - startTime, - new JulianDate() + new JulianDate(), ); if (mainTic > 2.1) { const ticLeap = JulianDate.computeTaiMinusUtc(ticTime); @@ -649,7 +649,7 @@ Timeline.prototype._makeTics = function () { ticTime = JulianDate.addSeconds( startJulian, tic - startTime, - new JulianDate() + new JulianDate(), ); } } @@ -685,7 +685,7 @@ Timeline.prototype._makeTics = function () { 0, 0, this._trackListEle.width, - this._trackListEle.height + this._trackListEle.height, ); renderState.y = 0; @@ -704,10 +704,10 @@ Timeline.prototype.updateFromClock = function () { if (defined(this._scrubElement)) { const seconds = JulianDate.secondsDifference( this._scrubJulian, - this._startJulian + this._startJulian, ); const xPos = Math.round( - (seconds * this._topDiv.clientWidth) / this._timeBarSecondsSpan + (seconds * this._topDiv.clientWidth) / this._timeBarSecondsSpan, ); if (this._lastXPos !== xPos) { @@ -721,19 +721,19 @@ Timeline.prototype.updateFromClock = function () { this._setTimeBarTime( this._timelineDragLocation, (this._timelineDragLocation * this._timeBarSecondsSpan) / - this._topDiv.clientWidth + this._topDiv.clientWidth, ); this.zoomTo( JulianDate.addSeconds( this._startJulian, this._timelineDrag, - new JulianDate() + new JulianDate(), ), JulianDate.addSeconds( this._endJulian, this._timelineDrag, - new JulianDate() - ) + new JulianDate(), + ), ); } }; @@ -746,7 +746,7 @@ Timeline.prototype._setTimeBarTime = function (xPos, seconds) { this._scrubJulian = JulianDate.addSeconds( this._startJulian, seconds, - new JulianDate() + new JulianDate(), ); if (this._scrubElement) { const scrubX = xPos - 8; @@ -813,7 +813,7 @@ function createMouseMoveCallback(timeline) { timeline._timelineDragLocation = undefined; timeline._setTimeBarTime( x, - (x * timeline._timeBarSecondsSpan) / timeline._topDiv.clientWidth + (x * timeline._timeBarSecondsSpan) / timeline._topDiv.clientWidth, ); } } else if (timeline._mouseMode === timelineMouseMode.slide) { @@ -824,7 +824,7 @@ function createMouseMoveCallback(timeline) { (dx * timeline._timeBarSecondsSpan) / timeline._topDiv.clientWidth; timeline.zoomTo( JulianDate.addSeconds(timeline._startJulian, dsec, new JulianDate()), - JulianDate.addSeconds(timeline._endJulian, dsec, new JulianDate()) + JulianDate.addSeconds(timeline._endJulian, dsec, new JulianDate()), ); } } else if (timeline._mouseMode === timelineMouseMode.zoom) { @@ -842,7 +842,7 @@ function createMouseWheelCallback(timeline) { let dy = e.wheelDeltaY || e.wheelDelta || -e.detail; timelineWheelDelta = Math.max( Math.min(Math.abs(dy), timelineWheelDelta), - 1 + 1, ); dy /= timelineWheelDelta; timeline.zoomFrom(Math.pow(1.05, -dy)); @@ -859,12 +859,12 @@ function createTouchStartCallback(timeline) { if (len === 1) { seconds = JulianDate.secondsDifference( timeline._scrubJulian, - timeline._startJulian + timeline._startJulian, ); xPos = Math.round( (seconds * timeline._topDiv.clientWidth) / timeline._timeBarSecondsSpan + - leftX + leftX, ); if (Math.abs(e.touches[0].clientX - xPos) < 50) { timeline._touchMode = timelineTouchMode.scrub; @@ -881,7 +881,7 @@ function createTouchStartCallback(timeline) { timeline._touchState.centerX = (e.touches[0].clientX + e.touches[1].clientX) * 0.5 - leftX; timeline._touchState.spanX = Math.abs( - e.touches[0].clientX - e.touches[1].clientX + e.touches[0].clientX - e.touches[1].clientX, ); } else { timeline._touchMode = timelineTouchMode.ignore; @@ -933,7 +933,7 @@ function createTouchMoveCallback(timeline) { if (x >= 0 && x <= timeline._topDiv.clientWidth) { timeline._setTimeBarTime( x, - (x * timeline._timeBarSecondsSpan) / timeline._topDiv.clientWidth + (x * timeline._timeBarSecondsSpan) / timeline._topDiv.clientWidth, ); } } @@ -956,7 +956,7 @@ function createTouchMoveCallback(timeline) { (timeline._touchState.centerX * timeline._timeBarSecondsSpan - newCenter * timeline._timeBarSecondsSpan * zoom) / timeline._topDiv.clientWidth, - new JulianDate() + new JulianDate(), ); } else { // Slide to newCenter @@ -964,7 +964,7 @@ function createTouchMoveCallback(timeline) { newStartTime = JulianDate.addSeconds( timeline._startJulian, (dx * timeline._timeBarSecondsSpan) / timeline._topDiv.clientWidth, - new JulianDate() + new JulianDate(), ); } @@ -973,8 +973,8 @@ function createTouchMoveCallback(timeline) { JulianDate.addSeconds( newStartTime, timeline._timeBarSecondsSpan * zoom, - new JulianDate() - ) + new JulianDate(), + ), ); timeline._touchState.centerX = newCenter; timeline._touchState.spanX = newSpan; diff --git a/packages/widgets/Source/Timeline/TimelineHighlightRange.js b/packages/widgets/Source/Timeline/TimelineHighlightRange.js index 0d2baec78599..de11a00d388d 100644 --- a/packages/widgets/Source/Timeline/TimelineHighlightRange.js +++ b/packages/widgets/Source/Timeline/TimelineHighlightRange.js @@ -35,18 +35,18 @@ TimelineHighlightRange.prototype.render = function (renderState) { if (this._start && this._stop && this._color) { const highlightStart = JulianDate.secondsDifference( this._start, - renderState.epochJulian + renderState.epochJulian, ); let highlightLeft = Math.round( - renderState.timeBarWidth * renderState.getAlpha(highlightStart) + renderState.timeBarWidth * renderState.getAlpha(highlightStart), ); const highlightStop = JulianDate.secondsDifference( this._stop, - renderState.epochJulian + renderState.epochJulian, ); let highlightWidth = Math.round( - renderState.timeBarWidth * renderState.getAlpha(highlightStop) + renderState.timeBarWidth * renderState.getAlpha(highlightStop), ) - highlightLeft; if (highlightLeft < 0) { highlightWidth += highlightLeft; diff --git a/packages/widgets/Source/Timeline/TimelineTrack.js b/packages/widgets/Source/Timeline/TimelineTrack.js index c661df9cbd71..f9e0e26e697d 100644 --- a/packages/widgets/Source/Timeline/TimelineTrack.js +++ b/packages/widgets/Source/Timeline/TimelineTrack.js @@ -18,7 +18,7 @@ TimelineTrack.prototype.render = function (context, renderState) { const spanStop = JulianDate.addSeconds( renderState.startJulian, renderState.duration, - new JulianDate() + new JulianDate(), ); if ( @@ -39,7 +39,7 @@ TimelineTrack.prototype.render = function (context, renderState) { const currentTime = JulianDate.addSeconds( renderState.startJulian, (x / renderState.timeBarWidth) * renderState.duration, - new JulianDate() + new JulianDate(), ); if ( !defined(start) && @@ -66,7 +66,7 @@ TimelineTrack.prototype.render = function (context, renderState) { start, renderState.y, Math.max(stop - start, 1), - this.height + this.height, ); } } diff --git a/packages/widgets/Source/VRButton/VRButton.js b/packages/widgets/Source/VRButton/VRButton.js index 0c22bf11d8b4..48bc9b9b6e7a 100644 --- a/packages/widgets/Source/VRButton/VRButton.js +++ b/packages/widgets/Source/VRButton/VRButton.js @@ -51,7 +51,7 @@ css: { "cesium-button-disabled" : _isOrthographic }, \ attr: { title: tooltip },\ click: command,\ enable: isVREnabled,\ -cesiumSvgPath: { path: isVRMode ? _exitVRPath : _enterVRPath, width: 32, height: 32 }' +cesiumSvgPath: { path: isVRMode ? _exitVRPath : _enterVRPath, width: 32, height: 32 }', ); container.appendChild(element); diff --git a/packages/widgets/Source/VRButton/VRButtonViewModel.js b/packages/widgets/Source/VRButton/VRButtonViewModel.js index 1f5697fbb39e..21cc736d0813 100644 --- a/packages/widgets/Source/VRButton/VRButtonViewModel.js +++ b/packages/widgets/Source/VRButton/VRButtonViewModel.js @@ -149,9 +149,12 @@ function VRButtonViewModel(scene, vrElement) { this._locked = false; this._noSleep = new NoSleep(); - this._command = createCommand(function () { - toggleVR(that, scene, isVRMode, isOrthographic); - }, knockout.getObservable(this, "isVREnabled")); + this._command = createCommand( + function () { + toggleVR(that, scene, isVRMode, isOrthographic); + }, + knockout.getObservable(this, "isVREnabled"), + ); this._vrElement = defaultValue(getElement(vrElement), document.body); diff --git a/packages/widgets/Source/Viewer/Viewer.js b/packages/widgets/Source/Viewer/Viewer.js index 4b4f8cf35e26..26983bdc3819 100644 --- a/packages/widgets/Source/Viewer/Viewer.js +++ b/packages/widgets/Source/Viewer/Viewer.js @@ -152,7 +152,7 @@ function trackDataSourceClock(timeline, clock, dataSource) { stopTime = JulianDate.addSeconds( startTime, CesiumMath.EPSILON2, - scratchStopTime + scratchStopTime, ); } timeline.updateFromClock(); @@ -167,10 +167,8 @@ const cartesian3Scratch = new Cartesian3(); function pickImageryLayerFeature(viewer, windowPosition) { const scene = viewer.scene; const pickRay = scene.camera.getPickRay(windowPosition); - const imageryLayerFeaturePromise = scene.imageryLayers.pickImageryLayerFeatures( - pickRay, - scene - ); + const imageryLayerFeaturePromise = + scene.imageryLayers.pickImageryLayerFeatures(pickRay, scene); if (!defined(imageryLayerFeaturePromise)) { return; } @@ -204,7 +202,7 @@ function pickImageryLayerFeature(viewer, windowPosition) { if (defined(feature.position)) { const ecfPosition = viewer.scene.ellipsoid.cartographicToCartesian( feature.position, - cartesian3Scratch + cartesian3Scratch, ); entity.position = new ConstantPositionProperty(ecfPosition); } @@ -217,7 +215,7 @@ function pickImageryLayerFeature(viewer, windowPosition) { return; } viewer.selectedEntity = createNoFeaturesEntity(); - } + }, ); return loadingMessage; @@ -432,7 +430,7 @@ function Viewer(container, options) { ) { throw new DeveloperError( "options.selectedImageryProviderViewModel is not available when not using the BaseLayerPicker widget. \ -Either specify options.baseLayer instead or set options.baseLayerPicker to true." +Either specify options.baseLayer instead or set options.baseLayerPicker to true.", ); } @@ -443,7 +441,7 @@ Either specify options.baseLayer instead or set options.baseLayerPicker to true. ) { throw new DeveloperError( "options.selectedTerrainProviderViewModel is not available when not using the BaseLayerPicker widget. \ -Either specify options.terrainProvider instead or set options.baseLayerPicker to true." +Either specify options.terrainProvider instead or set options.baseLayerPicker to true.", ); } //>>includeEnd('debug') @@ -551,7 +549,7 @@ Either specify options.terrainProvider instead or set options.baseLayerPicker to viewerContainer.appendChild(selectionIndicatorContainer); selectionIndicator = new SelectionIndicator( selectionIndicatorContainer, - scene + scene, ); } @@ -567,12 +565,12 @@ Either specify options.terrainProvider instead or set options.baseLayerPicker to eventHelper.add( infoBoxViewModel.cameraClicked, Viewer.prototype._onInfoBoxCameraClicked, - this + this, ); eventHelper.add( infoBoxViewModel.closeClicked, Viewer.prototype._onInfoBoxClockClicked, - this + this, ); } @@ -602,7 +600,7 @@ Either specify options.terrainProvider instead or set options.baseLayerPicker to eventHelper.add( geocoder.viewModel.search.beforeExecute, Viewer.prototype._clearObjects, - this + this, ); } @@ -623,7 +621,7 @@ Either specify options.terrainProvider instead or set options.baseLayerPicker to eventHelper.add( homeButton.viewModel.command.beforeExecute, Viewer.prototype._clearTrackedObject, - this + this, ); } @@ -633,7 +631,7 @@ Either specify options.terrainProvider instead or set options.baseLayerPicker to //>>includeStart('debug', pragmas.debug); if (options.sceneModePicker === true && scene3DOnly) { throw new DeveloperError( - "options.sceneModePicker is not available when options.scene3DOnly is set to true." + "options.sceneModePicker is not available when options.scene3DOnly is set to true.", ); } //>>includeEnd('debug'); @@ -657,11 +655,11 @@ Either specify options.terrainProvider instead or set options.baseLayerPicker to if (createBaseLayerPicker) { const imageryProviderViewModels = defaultValue( options.imageryProviderViewModels, - createDefaultImageryProviderViewModels() + createDefaultImageryProviderViewModels(), ); const terrainProviderViewModels = defaultValue( options.terrainProviderViewModels, - createDefaultTerrainProviderViewModels() + createDefaultTerrainProviderViewModels(), ); baseLayerPicker = new BaseLayerPicker(toolbar, { @@ -676,7 +674,7 @@ Either specify options.terrainProvider instead or set options.baseLayerPicker to //Grab the dropdown for resize code. const elements = toolbar.getElementsByClassName( - "cesium-baseLayerPicker-dropDown" + "cesium-baseLayerPicker-dropDown", ); baseLayerPickerDropDown = elements[0]; } @@ -701,7 +699,7 @@ Either specify options.terrainProvider instead or set options.baseLayerPicker to //>>includeStart('debug', pragmas.debug); if (defined(options.terrainProvider)) { throw new DeveloperError( - "Specify either options.terrainProvider or options.terrain." + "Specify either options.terrainProvider or options.terrain.", ); } //>>includeEnd('debug') @@ -725,7 +723,7 @@ Either specify options.terrainProvider instead or set options.baseLayerPicker to //window.localStorage is null if disabled in Firefox or undefined in browsers with implementation if (defined(window.localStorage)) { const hasSeenNavHelp = window.localStorage.getItem( - "cesium-hasSeenNavHelp" + "cesium-hasSeenNavHelp", ); if (defined(hasSeenNavHelp) && Boolean(hasSeenNavHelp)) { showNavHelp = false; @@ -741,7 +739,7 @@ Either specify options.terrainProvider instead or set options.baseLayerPicker to container: toolbar, instructionsInitiallyVisible: defaultValue( options.navigationInstructionsInitiallyVisible, - showNavHelp + showNavHelp, ), }); } @@ -754,7 +752,7 @@ Either specify options.terrainProvider instead or set options.baseLayerPicker to viewerContainer.appendChild(animationContainer); animation = new Animation( animationContainer, - new AnimationViewModel(clockViewModel) + new AnimationViewModel(clockViewModel), ); } @@ -782,7 +780,7 @@ Either specify options.terrainProvider instead or set options.baseLayerPicker to viewerContainer.appendChild(fullscreenContainer); fullscreenButton = new FullscreenButton( fullscreenContainer, - options.fullscreenElement + options.fullscreenElement, ); //Subscribe to fullscreenButton.viewModel.isFullscreenEnabled so @@ -798,7 +796,7 @@ Either specify options.terrainProvider instead or set options.baseLayerPicker to timeline.container.style.right = `${fullscreenContainer.clientWidth}px`; timeline.resize(); } - } + }, ); } @@ -824,7 +822,7 @@ Either specify options.terrainProvider instead or set options.baseLayerPicker to timeline.container.style.right = `${vrContainer.clientWidth}px`; timeline.resize(); } - } + }, ); vrModeSubscription = subscribeAndEvaluate( @@ -832,7 +830,7 @@ Either specify options.terrainProvider instead or set options.baseLayerPicker to "isVRMode", function (isVRMode) { enableVRUI(that, isVRMode); - } + }, ); } @@ -845,7 +843,7 @@ Either specify options.terrainProvider instead or set options.baseLayerPicker to this._dataSourceChangedListeners = {}; this._automaticallyTrackDataSourceClocks = defaultValue( options.automaticallyTrackDataSourceClocks, - true + true, ); this._container = container; this._bottomContainer = bottomContainer; @@ -896,12 +894,12 @@ Either specify options.terrainProvider instead or set options.baseLayerPicker to eventHelper.add( dataSourceCollection.dataSourceAdded, Viewer.prototype._onDataSourceAdded, - this + this, ); eventHelper.add( dataSourceCollection.dataSourceRemoved, Viewer.prototype._onDataSourceRemoved, - this + this, ); // Prior to each render, check if anything needs to be resized. @@ -921,12 +919,12 @@ Either specify options.terrainProvider instead or set options.baseLayerPicker to eventHelper.add( dataSourceCollection.dataSourceAdded, Viewer.prototype._dataSourceAdded, - this + this, ); eventHelper.add( dataSourceCollection.dataSourceRemoved, Viewer.prototype._dataSourceRemoved, - this + this, ); // Subscribe to left clicks and zoom to the picked object. @@ -952,11 +950,11 @@ Either specify options.terrainProvider instead or set options.baseLayerPicker to cesiumWidget.screenSpaceEventHandler.setInputAction( pickAndSelectObject, - ScreenSpaceEventType.LEFT_CLICK + ScreenSpaceEventType.LEFT_CLICK, ); cesiumWidget.screenSpaceEventHandler.setInputAction( pickAndTrackObject, - ScreenSpaceEventType.LEFT_DOUBLE_CLICK + ScreenSpaceEventType.LEFT_DOUBLE_CLICK, ); } @@ -1746,10 +1744,10 @@ Viewer.prototype.destroy = function () { !this.screenSpaceEventHandler.isDestroyed() ) { this.screenSpaceEventHandler.removeInputAction( - ScreenSpaceEventType.LEFT_CLICK + ScreenSpaceEventType.LEFT_CLICK, ); this.screenSpaceEventHandler.removeInputAction( - ScreenSpaceEventType.LEFT_DOUBLE_CLICK + ScreenSpaceEventType.LEFT_DOUBLE_CLICK, ); } @@ -1795,7 +1793,7 @@ Viewer.prototype.destroy = function () { this._timeline.removeEventListener( "settime", onTimelineScrubfunction, - false + false, ); this._element.removeChild(this._timeline.container); this._timeline = this._timeline.destroy(); @@ -1842,12 +1840,12 @@ Viewer.prototype.destroy = function () { */ Viewer.prototype._dataSourceAdded = function ( dataSourceCollection, - dataSource + dataSource, ) { const entityCollection = dataSource.entities; entityCollection.collectionChanged.addEventListener( Viewer.prototype._onEntityCollectionChanged, - this + this, ); }; @@ -1856,12 +1854,12 @@ Viewer.prototype._dataSourceAdded = function ( */ Viewer.prototype._dataSourceRemoved = function ( dataSourceCollection, - dataSource + dataSource, ) { const entityCollection = dataSource.entities; entityCollection.collectionChanged.removeEventListener( Viewer.prototype._onEntityCollectionChanged, - this + this, ); if (defined(this.trackedEntity)) { @@ -1898,7 +1896,7 @@ Viewer.prototype._onTick = function (clock) { const trackedState = this._dataSourceDisplay.getBoundingSphere( trackedEntity, false, - boundingSphereScratch + boundingSphereScratch, ); if (trackedState === BoundingSphereState.DONE) { entityView.update(time, boundingSphereScratch); @@ -1918,7 +1916,7 @@ Viewer.prototype._onTick = function (clock) { const state = this._dataSourceDisplay.getBoundingSphere( selectedEntity, true, - boundingSphereScratch + boundingSphereScratch, ); if (state !== BoundingSphereState.FAILED) { position = boundingSphereScratch.center; @@ -1934,7 +1932,7 @@ Viewer.prototype._onTick = function (clock) { if (defined(selectionIndicatorViewModel)) { selectionIndicatorViewModel.position = Cartesian3.clone( position, - selectionIndicatorViewModel.position + selectionIndicatorViewModel.position, ); selectionIndicatorViewModel.showSelection = showSelection && enableCamera; selectionIndicatorViewModel.update(); @@ -1952,12 +1950,12 @@ Viewer.prototype._onTick = function (clock) { if (showSelection) { infoBoxViewModel.titleText = defaultValue( selectedEntity.name, - selectedEntity.id + selectedEntity.id, ); infoBoxViewModel.description = Property.getValueOrDefault( selectedEntity.description, time, - "" + "", ); } else { infoBoxViewModel.titleText = ""; @@ -1972,7 +1970,7 @@ Viewer.prototype._onTick = function (clock) { Viewer.prototype._onEntityCollectionChanged = function ( collection, added, - removed + removed, ) { const length = removed.length; for (let i = 0; i < length; i++) { @@ -2042,7 +2040,7 @@ Viewer.prototype._onDataSourceChanged = function (dataSource) { */ Viewer.prototype._onDataSourceAdded = function ( dataSourceCollection, - dataSource + dataSource, ) { if (this._automaticallyTrackDataSourceClocks) { this.clockTrackedDataSource = dataSource; @@ -2051,7 +2049,7 @@ Viewer.prototype._onDataSourceAdded = function ( const removalFunc = this._eventHelper.add( dataSource.changedEvent, Viewer.prototype._onDataSourceChanged, - this + this, ); this._dataSourceChangedListeners[id] = removalFunc; }; @@ -2061,7 +2059,7 @@ Viewer.prototype._onDataSourceAdded = function ( */ Viewer.prototype._onDataSourceRemoved = function ( dataSourceCollection, - dataSource + dataSource, ) { const resetClock = this.clockTrackedDataSource === dataSource; const id = dataSource.entities.id; @@ -2071,7 +2069,7 @@ Viewer.prototype._onDataSourceRemoved = function ( const numDataSources = dataSourceCollection.length; if (this._automaticallyTrackDataSourceClocks && numDataSources > 0) { this.clockTrackedDataSource = dataSourceCollection.get( - numDataSources - 1 + numDataSources - 1, ); } else { this.clockTrackedDataSource = undefined; @@ -2273,7 +2271,7 @@ function updateZoomTarget(viewer) { zoomOptions.offset = new HeadingPitchRange( 0.0, -0.5, - boundingSphere.radius + boundingSphere.radius, ); } @@ -2309,12 +2307,12 @@ function updateZoomTarget(viewer) { } // Otherwise, the first "frame" needs to have been rendered - const removeEventListener = target.frameChanged.addEventListener(function ( - timeDynamicPointCloud - ) { - zoomToBoundingSphere(timeDynamicPointCloud.boundingSphere); - removeEventListener(); - }); + const removeEventListener = target.frameChanged.addEventListener( + function (timeDynamicPointCloud) { + zoomToBoundingSphere(timeDynamicPointCloud.boundingSphere); + removeEventListener(); + }, + ); return; } @@ -2354,7 +2352,7 @@ function updateZoomTarget(viewer) { const state = viewer._dataSourceDisplay.getBoundingSphere( entities[i], false, - boundingSphereScratch + boundingSphereScratch, ); if (state === BoundingSphereState.PENDING) { @@ -2408,7 +2406,7 @@ function updateTrackedEntity(viewer) { //computed. In this case, we will track the entity once it comes back into existence. const currentPosition = Property.getValueOrUndefined( trackedEntity.position, - currentTime + currentTime, ); if (!defined(currentPosition)) { @@ -2420,7 +2418,7 @@ function updateTrackedEntity(viewer) { const state = viewer._dataSourceDisplay.getBoundingSphere( trackedEntity, false, - boundingSphereScratch + boundingSphereScratch, ); if (state === BoundingSphereState.PENDING) { return; diff --git a/packages/widgets/Source/Viewer/viewerCesium3DTilesInspectorMixin.js b/packages/widgets/Source/Viewer/viewerCesium3DTilesInspectorMixin.js index 1d6e985adc31..c8cf827bdb08 100644 --- a/packages/widgets/Source/Viewer/viewerCesium3DTilesInspectorMixin.js +++ b/packages/widgets/Source/Viewer/viewerCesium3DTilesInspectorMixin.js @@ -23,7 +23,7 @@ function viewerCesium3DTilesInspectorMixin(viewer) { viewer.container.appendChild(container); const cesium3DTilesInspector = new Cesium3DTilesInspector( container, - viewer.scene + viewer.scene, ); Object.defineProperties(viewer, { diff --git a/packages/widgets/Source/Viewer/viewerCesiumInspectorMixin.js b/packages/widgets/Source/Viewer/viewerCesiumInspectorMixin.js index 3d1ad208b481..a5e0afe8c9e6 100644 --- a/packages/widgets/Source/Viewer/viewerCesiumInspectorMixin.js +++ b/packages/widgets/Source/Viewer/viewerCesiumInspectorMixin.js @@ -29,7 +29,7 @@ function viewerCesiumInspectorMixin(viewer) { viewer.container.appendChild(cesiumInspectorContainer); const cesiumInspector = new CesiumInspector( cesiumInspectorContainer, - viewer.scene + viewer.scene, ); Object.defineProperties(viewer, { diff --git a/packages/widgets/Source/Viewer/viewerDragDropMixin.js b/packages/widgets/Source/Viewer/viewerDragDropMixin.js index 24f6b896f50c..6e11d882c7b0 100644 --- a/packages/widgets/Source/Viewer/viewerDragDropMixin.js +++ b/packages/widgets/Source/Viewer/viewerDragDropMixin.js @@ -48,7 +48,7 @@ function viewerDragDropMixin(viewer, options) { } if (viewer.hasOwnProperty("dropEnabled")) { throw new DeveloperError( - "dropEnabled is already defined by another mixin." + "dropEnabled is already defined by another mixin.", ); } if (viewer.hasOwnProperty("dropError")) { @@ -56,12 +56,12 @@ function viewerDragDropMixin(viewer, options) { } if (viewer.hasOwnProperty("clearOnDrop")) { throw new DeveloperError( - "clearOnDrop is already defined by another mixin." + "clearOnDrop is already defined by another mixin.", ); } if (viewer.hasOwnProperty("flyToOnDrop")) { throw new DeveloperError( - "flyToOnDrop is already defined by another mixin." + "flyToOnDrop is already defined by another mixin.", ); } //>>includeEnd('debug'); @@ -283,7 +283,7 @@ function createOnLoadCallback(viewer, file, proxy, clampToGround) { viewer.dropError.raiseEvent( viewer, fileName, - `Unrecognized file: ${fileName}` + `Unrecognized file: ${fileName}`, ); return; } diff --git a/packages/widgets/Source/VoxelInspector/VoxelInspector.js b/packages/widgets/Source/VoxelInspector/VoxelInspector.js index 26871cfbe81e..7cf771bc39e9 100644 --- a/packages/widgets/Source/VoxelInspector/VoxelInspector.js +++ b/packages/widgets/Source/VoxelInspector/VoxelInspector.js @@ -42,7 +42,7 @@ function VoxelInspector(container, scene) { element.className = "cesium-cesiumInspector cesium-VoxelInspector"; element.setAttribute( "data-bind", - 'css: { "cesium-cesiumInspector-visible" : inspectorVisible, "cesium-cesiumInspector-hidden" : !inspectorVisible}' + 'css: { "cesium-cesiumInspector-visible" : inspectorVisible, "cesium-cesiumInspector-hidden" : !inspectorVisible}', ); container.appendChild(element); @@ -59,55 +59,55 @@ function VoxelInspector(container, scene) { panel, "Display", "displayVisible", - "toggleDisplay" + "toggleDisplay", ); const transformPanelContents = createSection( panel, "Transform", "transformVisible", - "toggleTransform" + "toggleTransform", ); const boundsPanelContents = createSection( panel, "Bounds", "boundsVisible", - "toggleBounds" + "toggleBounds", ); const clippingPanelContents = createSection( panel, "Clipping", "clippingVisible", - "toggleClipping" + "toggleClipping", ); const shaderPanelContents = createSection( panel, "Shader", "shaderVisible", - "toggleShader" + "toggleShader", ); // Display displayPanelContents.appendChild(createCheckbox("Depth Test", "depthTest")); displayPanelContents.appendChild(createCheckbox("Show", "show")); displayPanelContents.appendChild( - createCheckbox("Disable Update", "disableUpdate") + createCheckbox("Disable Update", "disableUpdate"), ); displayPanelContents.appendChild(createCheckbox("Debug Draw", "debugDraw")); displayPanelContents.appendChild(createCheckbox("Jitter", "jitter")); displayPanelContents.appendChild( - createCheckbox("Nearest Sampling", "nearestSampling") + createCheckbox("Nearest Sampling", "nearestSampling"), ); displayPanelContents.appendChild( - createRangeInput("Screen Space Error", "screenSpaceError", 0, 128) + createRangeInput("Screen Space Error", "screenSpaceError", 0, 128), ); displayPanelContents.appendChild( - createRangeInput("Step Size", "stepSize", 0.0, 2.0) + createRangeInput("Step Size", "stepSize", 0.0, 2.0), ); // Transform @@ -116,31 +116,31 @@ function VoxelInspector(container, scene) { const maxAngle = CesiumMath.PI; transformPanelContents.appendChild( - createRangeInput("Translation X", "translationX", -maxTrans, +maxTrans) + createRangeInput("Translation X", "translationX", -maxTrans, +maxTrans), ); transformPanelContents.appendChild( - createRangeInput("Translation Y", "translationY", -maxTrans, +maxTrans) + createRangeInput("Translation Y", "translationY", -maxTrans, +maxTrans), ); transformPanelContents.appendChild( - createRangeInput("Translation Z", "translationZ", -maxTrans, +maxTrans) + createRangeInput("Translation Z", "translationZ", -maxTrans, +maxTrans), ); transformPanelContents.appendChild( - createRangeInput("Scale X", "scaleX", 0, +maxScale) + createRangeInput("Scale X", "scaleX", 0, +maxScale), ); transformPanelContents.appendChild( - createRangeInput("Scale Y", "scaleY", 0, +maxScale) + createRangeInput("Scale Y", "scaleY", 0, +maxScale), ); transformPanelContents.appendChild( - createRangeInput("Scale Z", "scaleZ", 0, +maxScale) + createRangeInput("Scale Z", "scaleZ", 0, +maxScale), ); transformPanelContents.appendChild( - createRangeInput("Heading", "angleX", -maxAngle, +maxAngle) + createRangeInput("Heading", "angleX", -maxAngle, +maxAngle), ); transformPanelContents.appendChild( - createRangeInput("Pitch", "angleY", -maxAngle, +maxAngle) + createRangeInput("Pitch", "angleY", -maxAngle, +maxAngle), ); transformPanelContents.appendChild( - createRangeInput("Roll", "angleZ", -maxAngle, +maxAngle) + createRangeInput("Roll", "angleZ", -maxAngle, +maxAngle), ); // Bounds @@ -151,20 +151,20 @@ function VoxelInspector(container, scene) { VoxelShapeType.getMinBounds(VoxelShapeType.ELLIPSOID).x, VoxelShapeType.getMinBounds(VoxelShapeType.ELLIPSOID).y, -Ellipsoid.WGS84.maximumRadius, - new Cartesian3() + new Cartesian3(), ); const ellipsoidMaxBounds = Cartesian3.fromElements( VoxelShapeType.getMaxBounds(VoxelShapeType.ELLIPSOID).x, VoxelShapeType.getMaxBounds(VoxelShapeType.ELLIPSOID).y, +10000000.0, - new Cartesian3() + new Cartesian3(), ); const cylinderMinBounds = VoxelShapeType.getMinBounds( - VoxelShapeType.CYLINDER + VoxelShapeType.CYLINDER, ); const cylinderMaxBounds = VoxelShapeType.getMaxBounds( - VoxelShapeType.CYLINDER + VoxelShapeType.CYLINDER, ); makeCoordinateRange( @@ -183,7 +183,7 @@ function VoxelInspector(container, scene) { boxMinBounds, boxMaxBounds, "shapeIsBox", - boundsPanelContents + boundsPanelContents, ); makeCoordinateRange( @@ -202,7 +202,7 @@ function VoxelInspector(container, scene) { ellipsoidMinBounds, ellipsoidMaxBounds, "shapeIsEllipsoid", - boundsPanelContents + boundsPanelContents, ); makeCoordinateRange( @@ -221,7 +221,7 @@ function VoxelInspector(container, scene) { cylinderMinBounds, cylinderMaxBounds, "shapeIsCylinder", - boundsPanelContents + boundsPanelContents, ); // Clipping @@ -241,7 +241,7 @@ function VoxelInspector(container, scene) { boxMinBounds, boxMaxBounds, "shapeIsBox", - clippingPanelContents + clippingPanelContents, ); makeCoordinateRange( @@ -260,7 +260,7 @@ function VoxelInspector(container, scene) { ellipsoidMinBounds, ellipsoidMaxBounds, "shapeIsEllipsoid", - clippingPanelContents + clippingPanelContents, ); makeCoordinateRange( @@ -279,7 +279,7 @@ function VoxelInspector(container, scene) { cylinderMinBounds, cylinderMaxBounds, "shapeIsCylinder", - clippingPanelContents + clippingPanelContents, ); // Shader @@ -289,13 +289,13 @@ function VoxelInspector(container, scene) { const shaderEditor = document.createElement("textarea"); shaderEditor.setAttribute( "data-bind", - "textInput: shaderString, event: { keydown: shaderEditorKeyPress }" + "textInput: shaderString, event: { keydown: shaderEditorKeyPress }", ); shaderPanelEditor.className = "cesium-cesiumInspector-styleEditor"; shaderPanelEditor.appendChild(shaderEditor); const compileShaderButton = createButton( "Compile (Ctrl+Enter)", - "compileShader" + "compileShader", ); shaderPanelEditor.appendChild(compileShaderButton); @@ -303,7 +303,7 @@ function VoxelInspector(container, scene) { compilationText.style.display = "block"; compilationText.setAttribute( "data-bind", - "text: shaderCompilationMessage, style: {color: shaderCompilationSuccess ? 'green' : 'red'}" + "text: shaderCompilationMessage, style: {color: shaderCompilationSuccess ? 'green' : 'red'}", ); shaderPanelEditor.appendChild(compilationText); @@ -371,14 +371,14 @@ function makeCoordinateRange( defaultMinBounds, defaultMaxBounds, allowedShape, - parentContainer + parentContainer, ) { const createRangeInput = InspectorShared.createRangeInput; const min = defaultMinBounds; const max = defaultMaxBounds; const boundsElement = parentContainer.appendChild( - document.createElement("div") + document.createElement("div"), ); boundsElement.setAttribute("data-bind", `if: ${allowedShape}`); boundsElement.appendChild(createRangeInput(maxXTitle, maxXVar, min.x, max.x)); diff --git a/packages/widgets/Source/VoxelInspector/VoxelInspectorViewModel.js b/packages/widgets/Source/VoxelInspector/VoxelInspectorViewModel.js index 317f57e6eed7..8ecc04914113 100644 --- a/packages/widgets/Source/VoxelInspector/VoxelInspectorViewModel.js +++ b/packages/widgets/Source/VoxelInspector/VoxelInspectorViewModel.js @@ -545,7 +545,7 @@ function VoxelInspectorViewModel(scene) { getPrimitiveFunction: function () { that.translationX = Matrix4.getTranslation( that._voxelPrimitive.modelMatrix, - new Cartesian3() + new Cartesian3(), ).x; }, }); @@ -560,7 +560,7 @@ function VoxelInspectorViewModel(scene) { getPrimitiveFunction: function () { that.translationY = Matrix4.getTranslation( that._voxelPrimitive.modelMatrix, - new Cartesian3() + new Cartesian3(), ).y; }, }); @@ -575,7 +575,7 @@ function VoxelInspectorViewModel(scene) { getPrimitiveFunction: function () { that.translationZ = Matrix4.getTranslation( that._voxelPrimitive.modelMatrix, - new Cartesian3() + new Cartesian3(), ).z; }, }); @@ -591,7 +591,7 @@ function VoxelInspectorViewModel(scene) { getPrimitiveFunction: function () { that.scaleX = Matrix4.getScale( that._voxelPrimitive.modelMatrix, - new Cartesian3() + new Cartesian3(), ).x; }, }); @@ -606,7 +606,7 @@ function VoxelInspectorViewModel(scene) { getPrimitiveFunction: function () { that.scaleY = Matrix4.getScale( that._voxelPrimitive.modelMatrix, - new Cartesian3() + new Cartesian3(), ).y; }, }); @@ -621,7 +621,7 @@ function VoxelInspectorViewModel(scene) { getPrimitiveFunction: function () { that.scaleZ = Matrix4.getScale( that._voxelPrimitive.modelMatrix, - new Cartesian3() + new Cartesian3(), ).z; }, }); @@ -667,13 +667,13 @@ function setModelMatrix(viewModel) { viewModel.translationX, viewModel.translationY, viewModel.translationZ, - scratchTranslation + scratchTranslation, ); const scale = Cartesian3.fromElements( viewModel.scaleX, viewModel.scaleY, viewModel.scaleZ, - scratchScale + scratchScale, ); const hpr = scratchHeadingPitchRoll; hpr.heading = viewModel.angleX; @@ -684,7 +684,7 @@ function setModelMatrix(viewModel) { viewModel._voxelPrimitive.modelMatrix = Matrix4.fromRotationTranslation( rotationScale, translation, - viewModel._voxelPrimitive.modelMatrix + viewModel._voxelPrimitive.modelMatrix, ); } @@ -720,21 +720,22 @@ Object.defineProperties(VoxelInspectorViewModel.prototype, { this._voxelPrimitive = voxelPrimitive; const that = this; - that._customShaderCompilationRemoveCallback = that._voxelPrimitive.customShaderCompilationEvent.addEventListener( - function (error) { - const shaderString = - that._voxelPrimitive.customShader.fragmentShaderText; - that.shaderString = formatShaderString(shaderString); - - if (!defined(error)) { - that.shaderCompilationMessage = "Shader compiled successfully!"; - that.shaderCompilationSuccess = true; - } else { - that.shaderCompilationMessage = error.message; - that.shaderCompilationSuccess = false; - } - } - ); + that._customShaderCompilationRemoveCallback = + that._voxelPrimitive.customShaderCompilationEvent.addEventListener( + function (error) { + const shaderString = + that._voxelPrimitive.customShader.fragmentShaderText; + that.shaderString = formatShaderString(shaderString); + + if (!defined(error)) { + that.shaderCompilationMessage = "Shader compiled successfully!"; + that.shaderCompilationSuccess = true; + } else { + that.shaderCompilationMessage = error.message; + that.shaderCompilationSuccess = false; + } + }, + ); that._modelMatrixReady = false; for (let i = 0; i < that._getPrimitiveFunctions.length; i++) { that._getPrimitiveFunctions[i](); @@ -806,7 +807,7 @@ VoxelInspectorViewModel.prototype.compileShader = function () { */ VoxelInspectorViewModel.prototype.shaderEditorKeyPress = function ( sender, - event + event, ) { if (event.keyCode === 9) { //tab diff --git a/packages/widgets/Source/subscribeAndEvaluate.js b/packages/widgets/Source/subscribeAndEvaluate.js index 510615498a98..6d32a2800417 100644 --- a/packages/widgets/Source/subscribeAndEvaluate.js +++ b/packages/widgets/Source/subscribeAndEvaluate.js @@ -20,7 +20,7 @@ function subscribeAndEvaluate( observablePropertyName, callback, target, - event + event, ) { callback.call(target, owner[observablePropertyName]); return knockout diff --git a/packages/widgets/Specs/Animation/AnimationViewModelSpec.js b/packages/widgets/Specs/Animation/AnimationViewModelSpec.js index e90fc79319a5..751f31a47472 100644 --- a/packages/widgets/Specs/Animation/AnimationViewModelSpec.js +++ b/packages/widgets/Specs/Animation/AnimationViewModelSpec.js @@ -35,7 +35,7 @@ describe("Widgets/Animation/AnimationViewModel", function () { expect(viewModel.playForwardViewModel.toggled).toEqual(false); expect(viewModel.playRealtimeViewModel.toggled).toEqual(true); expect(viewModel.shuttleRingAngle).toEqual( - AnimationViewModel._realtimeShuttleRingAngle + AnimationViewModel._realtimeShuttleRingAngle, ); } @@ -422,16 +422,16 @@ describe("Widgets/Animation/AnimationViewModel", function () { clockViewModel.startTime = JulianDate.addSeconds( clockViewModel.systemTime, -60, - new JulianDate() + new JulianDate(), ); clockViewModel.stopTime = JulianDate.addSeconds( clockViewModel.systemTime, -30, - new JulianDate() + new JulianDate(), ); expect(viewModel.playRealtimeViewModel.command.canExecute).toEqual(true); expect(viewModel.playRealtimeViewModel.tooltip).toEqual( - "Today (real-time)" + "Today (real-time)", ); //CLAMPED but unavailable when start/stop time does not include realtime @@ -439,16 +439,16 @@ describe("Widgets/Animation/AnimationViewModel", function () { clockViewModel.startTime = JulianDate.addSeconds( clockViewModel.systemTime, -60, - new JulianDate() + new JulianDate(), ); clockViewModel.stopTime = JulianDate.addSeconds( clockViewModel.systemTime, -30, - new JulianDate() + new JulianDate(), ); expect(viewModel.playRealtimeViewModel.command.canExecute).toEqual(false); expect(viewModel.playRealtimeViewModel.tooltip).toEqual( - "Current time not in range" + "Current time not in range", ); //CLAMPED but available when start/stop time includes realtime @@ -456,16 +456,16 @@ describe("Widgets/Animation/AnimationViewModel", function () { clockViewModel.startTime = JulianDate.addSeconds( clockViewModel.systemTime, -60, - new JulianDate() + new JulianDate(), ); clockViewModel.stopTime = JulianDate.addSeconds( clockViewModel.systemTime, 60, - new JulianDate() + new JulianDate(), ); expect(viewModel.playRealtimeViewModel.command.canExecute).toEqual(true); expect(viewModel.playRealtimeViewModel.tooltip).toEqual( - "Today (real-time)" + "Today (real-time)", ); //LOOP_STOP but unavailable when start/stop time does not include realtime @@ -473,16 +473,16 @@ describe("Widgets/Animation/AnimationViewModel", function () { clockViewModel.startTime = JulianDate.addSeconds( clockViewModel.systemTime, -60, - new JulianDate() + new JulianDate(), ); clockViewModel.stopTime = JulianDate.addSeconds( clockViewModel.systemTime, -30, - new JulianDate() + new JulianDate(), ); expect(viewModel.playRealtimeViewModel.command.canExecute).toEqual(false); expect(viewModel.playRealtimeViewModel.tooltip).toEqual( - "Current time not in range" + "Current time not in range", ); //LOOP_STOP but available when start/stop time includes realtime @@ -490,16 +490,16 @@ describe("Widgets/Animation/AnimationViewModel", function () { clockViewModel.startTime = JulianDate.addSeconds( clockViewModel.systemTime, -60, - new JulianDate() + new JulianDate(), ); clockViewModel.stopTime = JulianDate.addSeconds( clockViewModel.systemTime, 60, - new JulianDate() + new JulianDate(), ); expect(viewModel.playRealtimeViewModel.command.canExecute).toEqual(true); expect(viewModel.playRealtimeViewModel.tooltip).toEqual( - "Today (real-time)" + "Today (real-time)", ); }); @@ -619,7 +619,7 @@ describe("Widgets/Animation/AnimationViewModel", function () { viewModel.shuttleRingAngle = 0.0; expect(clockViewModel.multiplier).toEqual( - AnimationViewModel.defaultTicks[0] + AnimationViewModel.defaultTicks[0], ); }); @@ -667,10 +667,7 @@ describe("Widgets/Animation/AnimationViewModel", function () { animationViewModel.setShuttleRingTicks(ticks); expect(animationViewModel.getShuttleRingTicks()).toEqual([ - 0.0, - 2.0, - 4.0, - 8.0, + 0.0, 2.0, 4.0, 8.0, ]); }); }); diff --git a/packages/widgets/Specs/BaseLayerPicker/BaseLayerPickerViewModelSpec.js b/packages/widgets/Specs/BaseLayerPicker/BaseLayerPickerViewModelSpec.js index f4ab2aeddf71..13bcc3ab7eda 100644 --- a/packages/widgets/Specs/BaseLayerPicker/BaseLayerPickerViewModelSpec.js +++ b/packages/widgets/Specs/BaseLayerPicker/BaseLayerPickerViewModelSpec.js @@ -211,7 +211,7 @@ describe("Widgets/BaseLayerPicker/BaseLayerPickerViewModel", function () { viewModel.selectedTerrain = testProviderViewModel3; await testProviderViewModel.creationCommand(); expect(viewModel.buttonTooltip).toEqual( - `${testProviderViewModel.name}\n${testProviderViewModel3.name}` + `${testProviderViewModel.name}\n${testProviderViewModel3.name}`, ); viewModel.selectedImagery = undefined; diff --git a/packages/widgets/Specs/Cesium3DTilesInspector/Cesium3DTilesInspectorSpec.js b/packages/widgets/Specs/Cesium3DTilesInspector/Cesium3DTilesInspectorSpec.js index 39ded525e04b..4a76b8ac8530 100644 --- a/packages/widgets/Specs/Cesium3DTilesInspector/Cesium3DTilesInspectorSpec.js +++ b/packages/widgets/Specs/Cesium3DTilesInspector/Cesium3DTilesInspectorSpec.js @@ -51,5 +51,5 @@ describe( }).toThrowDeveloperError(); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/widgets/Specs/Cesium3DTilesInspector/Cesium3DTilesInspectorViewModelSpec.js b/packages/widgets/Specs/Cesium3DTilesInspector/Cesium3DTilesInspectorViewModelSpec.js index 51267ff50f61..0442fde73347 100644 --- a/packages/widgets/Specs/Cesium3DTilesInspector/Cesium3DTilesInspectorViewModelSpec.js +++ b/packages/widgets/Specs/Cesium3DTilesInspector/Cesium3DTilesInspectorViewModelSpec.js @@ -37,7 +37,7 @@ describe( it("can create and destroy", function () { const viewModel = new Cesium3DTilesInspectorViewModel( scene, - performanceContainer + performanceContainer, ); expect(viewModel._scene).toBe(scene); expect(viewModel.isDestroyed()).toEqual(false); @@ -61,7 +61,7 @@ describe( it("show properties", async function () { viewModel = new Cesium3DTilesInspectorViewModel( scene, - performanceContainer + performanceContainer, ); const tileset = await Cesium3DTileset.fromUrl(tilesetUrl); viewModel.tileset = tileset; @@ -77,7 +77,7 @@ describe( beforeAll(async function () { viewModel = new Cesium3DTilesInspectorViewModel( scene, - performanceContainer + performanceContainer, ); const tileset = await Cesium3DTileset.fromUrl(tilesetUrl); viewModel.tileset = tileset; @@ -167,22 +167,22 @@ describe( it("geometricErrorScale", function () { viewModel.geometricErrorScale = 1.0; expect(viewModel.tileset.pointCloudShading.geometricErrorScale).toBe( - 1.0 + 1.0, ); viewModel.geometricErrorScale = 0.0; expect(viewModel.tileset.pointCloudShading.geometricErrorScale).toBe( - 0.0 + 0.0, ); }); it("maximumAttenuation", function () { viewModel.maximumAttenuation = 1.0; expect(viewModel.tileset.pointCloudShading.maximumAttenuation).toBe( - 1.0 + 1.0, ); viewModel.maximumAttenuation = 0.0; expect( - viewModel.tileset.pointCloudShading.maximumAttenuation + viewModel.tileset.pointCloudShading.maximumAttenuation, ).not.toBeDefined(); }); @@ -191,7 +191,7 @@ describe( expect(viewModel.tileset.pointCloudShading.baseResolution).toBe(1.0); viewModel.baseResolution = 0.0; expect( - viewModel.tileset.pointCloudShading.baseResolution + viewModel.tileset.pointCloudShading.baseResolution, ).not.toBeDefined(); }); @@ -205,22 +205,22 @@ describe( it("eyeDomeLightingStrength", function () { viewModel.eyeDomeLightingStrength = 1.0; expect( - viewModel.tileset.pointCloudShading.eyeDomeLightingStrength + viewModel.tileset.pointCloudShading.eyeDomeLightingStrength, ).toBe(1.0); viewModel.eyeDomeLightingStrength = 0.0; expect( - viewModel.tileset.pointCloudShading.eyeDomeLightingStrength + viewModel.tileset.pointCloudShading.eyeDomeLightingStrength, ).toBe(0.0); }); it("eyeDomeLightingRadius", function () { viewModel.eyeDomeLightingRadius = 1.0; expect(viewModel.tileset.pointCloudShading.eyeDomeLightingRadius).toBe( - 1.0 + 1.0, ); viewModel.eyeDomeLightingRadius = 0.0; expect(viewModel.tileset.pointCloudShading.eyeDomeLightingRadius).toBe( - 0.0 + 0.0, ); }); }); @@ -229,7 +229,7 @@ describe( beforeAll(async function () { viewModel = new Cesium3DTilesInspectorViewModel( scene, - performanceContainer + performanceContainer, ); viewModel.tileset = await Cesium3DTileset.fromUrl(tilesetUrl); }); @@ -269,12 +269,12 @@ describe( viewModel.dynamicScreenSpaceErrorDensitySliderValue = rawSliderValue; expect( - viewModel.dynamicScreenSpaceErrorDensitySliderValue + viewModel.dynamicScreenSpaceErrorDensitySliderValue, ).toEqualEpsilon(rawSliderValue, CesiumMath.EPSILON8); expect(viewModel.tileset.dynamicScreenSpaceErrorDensity).toEqualEpsilon( scaledValue, - CesiumMath.EPSILON8 + CesiumMath.EPSILON8, ); }); }); @@ -302,7 +302,7 @@ describe( viewModel = new Cesium3DTilesInspectorViewModel( scene, - performanceContainer + performanceContainer, ); viewModel.tileset = await Cesium3DTileset.fromUrl(tilesetUrl); }); @@ -315,7 +315,7 @@ describe( viewModel.tileset.style = style; viewModel._update(); expect(JSON.stringify(style.style)).toBe( - JSON.stringify(JSON.parse(viewModel.styleString)) + JSON.stringify(JSON.parse(viewModel.styleString)), ); }); @@ -336,7 +336,7 @@ describe( viewModel._update(); expect(viewModel.tileset.style.style.color).toBe("color('red')"); expect(viewModel.tileset.style.style.meta.description).toBe( - "'Building id ${id} has height ${Height}.'" + "'Building id ${id} has height ${Height}.'", ); }); @@ -347,5 +347,5 @@ describe( }); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/widgets/Specs/CesiumInspector/CesiumInspectorSpec.js b/packages/widgets/Specs/CesiumInspector/CesiumInspectorSpec.js index b372cf789d59..8250282dfff1 100644 --- a/packages/widgets/Specs/CesiumInspector/CesiumInspectorSpec.js +++ b/packages/widgets/Specs/CesiumInspector/CesiumInspectorSpec.js @@ -51,5 +51,5 @@ describe( }).toThrowDeveloperError(); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/widgets/Specs/CesiumInspector/CesiumInspectorViewModelSpec.js b/packages/widgets/Specs/CesiumInspector/CesiumInspectorViewModelSpec.js index b8d99c10c0a4..29f535510379 100644 --- a/packages/widgets/Specs/CesiumInspector/CesiumInspectorViewModelSpec.js +++ b/packages/widgets/Specs/CesiumInspector/CesiumInspectorViewModelSpec.js @@ -58,7 +58,7 @@ describe( it("can create and destroy", function () { const viewModel = new CesiumInspectorViewModel( scene, - performanceContainer + performanceContainer, ); expect(viewModel.scene).toBe(scene); expect(viewModel.performanceContainer).toBe(performanceContainer); @@ -82,7 +82,7 @@ describe( it("show frustums", function () { const viewModel = new CesiumInspectorViewModel( scene, - performanceContainer + performanceContainer, ); viewModel.frustums = true; expect(viewModel.scene.debugShowFrustums).toBe(true); @@ -96,7 +96,7 @@ describe( it("show performance", function () { const viewModel = new CesiumInspectorViewModel( scene, - performanceContainer + performanceContainer, ); viewModel.performance = true; scene.render(); @@ -114,14 +114,14 @@ describe( CesiumMath.toRadians(-110.0), CesiumMath.toRadians(0.0), CesiumMath.toRadians(-90.0), - CesiumMath.toRadians(20.0) + CesiumMath.toRadians(20.0), ), - CesiumMath.toRadians(45) - ) + CesiumMath.toRadians(45), + ), ); const viewModel = new CesiumInspectorViewModel( scene, - performanceContainer + performanceContainer, ); scene.render(); viewModel.primitive = p; @@ -140,10 +140,10 @@ describe( CesiumMath.toRadians(-110.0), CesiumMath.toRadians(0.0), CesiumMath.toRadians(-90.0), - CesiumMath.toRadians(20.0) + CesiumMath.toRadians(20.0), ), - CesiumMath.toRadians(45) - ) + CesiumMath.toRadians(45), + ), ); const q = scene.primitives.add( @@ -152,14 +152,14 @@ describe( CesiumMath.toRadians(-10.0), CesiumMath.toRadians(0.0), CesiumMath.toRadians(-9.0), - CesiumMath.toRadians(20.0) - ) - ) + CesiumMath.toRadians(20.0), + ), + ), ); const viewModel = new CesiumInspectorViewModel( scene, - performanceContainer + performanceContainer, ); scene.render(); viewModel.primitive = p; @@ -179,15 +179,15 @@ describe( CesiumMath.toRadians(-110.0), CesiumMath.toRadians(0.0), CesiumMath.toRadians(-90.0), - CesiumMath.toRadians(20.0) + CesiumMath.toRadians(20.0), ), - CesiumMath.toRadians(45) - ) + CesiumMath.toRadians(45), + ), ); const viewModel = new CesiumInspectorViewModel( scene, - performanceContainer + performanceContainer, ); scene.render(); viewModel.primitive = p; @@ -202,37 +202,37 @@ describe( it("show wireframe", function () { const viewModel = new CesiumInspectorViewModel( scene, - performanceContainer + performanceContainer, ); viewModel.wireframe = true; expect(viewModel.scene.globe._surface.tileProvider._debug.wireframe).toBe( - true + true, ); viewModel.wireframe = false; expect(viewModel.scene.globe._surface.tileProvider._debug.wireframe).toBe( - false + false, ); }); it("suspend updates", function () { const viewModel = new CesiumInspectorViewModel( scene, - performanceContainer + performanceContainer, ); viewModel.suspendUpdates = true; expect(viewModel.scene.globe._surface._debug.suspendLodUpdate).toBe(true); viewModel.suspendUpdates = false; expect(viewModel.scene.globe._surface._debug.suspendLodUpdate).toBe( - false + false, ); }); it("show tile coords", function () { const viewModel = new CesiumInspectorViewModel( scene, - performanceContainer + performanceContainer, ); expect(viewModel.scene.imageryLayers.length).toBe(0); @@ -246,7 +246,7 @@ describe( it("show tile bounding sphere", function () { const viewModel = new CesiumInspectorViewModel( scene, - performanceContainer + performanceContainer, ); const tile = new QuadtreeTile({ tilingScheme: new WebMercatorTilingScheme(), @@ -259,19 +259,19 @@ describe( viewModel.tileBoundingSphere = true; expect( - viewModel.scene.globe._surface.tileProvider._debug.boundingSphereTile + viewModel.scene.globe._surface.tileProvider._debug.boundingSphereTile, ).toBe(tile); viewModel.tileBoundingSphere = false; expect( - viewModel.scene.globe._surface.tileProvider._debug.boundingSphereTile + viewModel.scene.globe._surface.tileProvider._debug.boundingSphereTile, ).toBe(undefined); }); it("filter tile", function () { const viewModel = new CesiumInspectorViewModel( scene, - performanceContainer + performanceContainer, ); const tile = new QuadtreeTile({ tilingScheme: new WebMercatorTilingScheme(), @@ -294,7 +294,7 @@ describe( it("does not try to render a non-renderable tile", function () { const viewModel = new CesiumInspectorViewModel( scene, - performanceContainer + performanceContainer, ); const tile = new QuadtreeTile({ tilingScheme: new WebMercatorTilingScheme(), @@ -313,5 +313,5 @@ describe( expect(viewModel.suspendUpdates).toBe(false); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/widgets/Specs/Geocoder/GeocoderSpec.js b/packages/widgets/Specs/Geocoder/GeocoderSpec.js index bcd1dded57a6..fbe1cd1b10d1 100644 --- a/packages/widgets/Specs/Geocoder/GeocoderSpec.js +++ b/packages/widgets/Specs/Geocoder/GeocoderSpec.js @@ -76,5 +76,5 @@ describe( }).toThrowDeveloperError(); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/widgets/Specs/Geocoder/GeocoderViewModelSpec.js b/packages/widgets/Specs/Geocoder/GeocoderViewModelSpec.js index 259763916407..350e4fd4e7ba 100644 --- a/packages/widgets/Specs/Geocoder/GeocoderViewModelSpec.js +++ b/packages/widgets/Specs/Geocoder/GeocoderViewModelSpec.js @@ -141,7 +141,7 @@ describe( const promise = new Promise((resolve) => { destinationFoundCallback = function (viewModel, destination) { GeocoderViewModel.flyToDestination(viewModel, destination).then( - resolve + resolve, ); }; }); @@ -212,7 +212,7 @@ describe( expect(geocoderViewModel._searchText).toEqual("a"); expect(destinationFoundCallback).toHaveBeenCalledWith( geocoderViewModel, - destination + destination, ); }); @@ -227,11 +227,11 @@ describe( await geocoderViewModel.search(); expect(geocoderViewModel._searchText).toEqual( - geocoderResults2[0].displayName + geocoderResults2[0].displayName, ); expect(destinationFoundCallback).toHaveBeenCalledWith( geocoderViewModel, - mockDestination + mockDestination, ); }); @@ -245,7 +245,7 @@ describe( geocoderViewModel._searchText = "sthsnth"; // an empty query will prevent geocoding await GeocoderViewModel._updateSearchSuggestions(geocoderViewModel); expect(geocoderViewModel._suggestions.length).toEqual( - geocoderResults1.length + geocoderResults2.length + geocoderResults1.length + geocoderResults2.length, ); expect(destinationFoundCallback).not.toHaveBeenCalled(); }); @@ -263,12 +263,12 @@ describe( await geocoderViewModel.search(); // await promise; expect(geocoderViewModel._searchText).toEqual( - geocoderResults2[0].displayName + geocoderResults2[0].displayName, ); expect(GeocoderViewModel.flyToDestination).not.toHaveBeenCalled(); expect(destinationFoundCallback).toHaveBeenCalledWith( geocoderViewModel, - mockDestination + mockDestination, ); }); @@ -286,26 +286,26 @@ describe( expect(geocoderViewModel._selectedSuggestion).toEqual(undefined); geocoderViewModel._handleArrowDown(geocoderViewModel); expect(geocoderViewModel._selectedSuggestion.displayName).toEqual( - "a" + "a", ); geocoderViewModel._handleArrowDown(geocoderViewModel); geocoderViewModel._handleArrowDown(geocoderViewModel); expect(geocoderViewModel._selectedSuggestion.displayName).toEqual( - "c" + "c", ); geocoderViewModel._handleArrowDown(geocoderViewModel); expect(geocoderViewModel._selectedSuggestion.displayName).toEqual( - "a" + "a", ); geocoderViewModel._handleArrowDown(geocoderViewModel); geocoderViewModel._handleArrowUp(geocoderViewModel); expect(geocoderViewModel._selectedSuggestion.displayName).toEqual( - "a" + "a", ); geocoderViewModel._handleArrowUp(geocoderViewModel); expect(geocoderViewModel._selectedSuggestion).toBeUndefined(); expect(destinationFoundCallback).not.toHaveBeenCalled(); - } + }, ); }); @@ -388,5 +388,5 @@ describe( expect(destinationFoundCallback).toHaveBeenCalled(); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/widgets/Specs/HomeButton/HomeButtonSpec.js b/packages/widgets/Specs/HomeButton/HomeButtonSpec.js index 23a6a84b2743..10909d425e1a 100644 --- a/packages/widgets/Specs/HomeButton/HomeButtonSpec.js +++ b/packages/widgets/Specs/HomeButton/HomeButtonSpec.js @@ -51,5 +51,5 @@ describe( }).toThrowDeveloperError(); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/widgets/Specs/HomeButton/HomeButtonViewModelSpec.js b/packages/widgets/Specs/HomeButton/HomeButtonViewModelSpec.js index b66e9ee7b8a5..4f2e5914947a 100644 --- a/packages/widgets/Specs/HomeButton/HomeButtonViewModelSpec.js +++ b/packages/widgets/Specs/HomeButton/HomeButtonViewModelSpec.js @@ -59,5 +59,5 @@ describe( viewModel.command(); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/widgets/Specs/I3SBSLExplorer/I3SBSLExplorerSpec.js b/packages/widgets/Specs/I3SBSLExplorer/I3SBSLExplorerSpec.js index 131ea187b0fb..7bc9ffff6d81 100644 --- a/packages/widgets/Specs/I3SBSLExplorer/I3SBSLExplorerSpec.js +++ b/packages/widgets/Specs/I3SBSLExplorer/I3SBSLExplorerSpec.js @@ -48,11 +48,11 @@ describe("Widgets/I3SBuildingSceneLayerExplorer/I3SBuildingSceneLayerExplorer", expect(container.children[0].childElementCount).toEqual(3); expect(container.children[0].children[0].localName).toEqual("h3"); expect(container.children[0].children[0].textContent).toEqual( - "Building explorer" + "Building explorer", ); expect(container.children[0].children[1].localName).toEqual("select"); expect(container.children[0].children[1].textContent).toEqual( - "Building layers not found" + "Building layers not found", ); expect(container.children[0].children[2].localName).toEqual("div"); expect(container.children[0].children[2].id).toEqual("bsl-wrapper"); @@ -85,14 +85,13 @@ describe("Widgets/I3SBuildingSceneLayerExplorer/I3SBuildingSceneLayerExplorer", i3sProvider.filterByAttributes = jasmine.createSpy(); const widget = new I3SBuildingSceneLayerExplorer( "testContainer", - i3sProvider + i3sProvider, ); expect(widget).toBeInstanceOf(I3SBuildingSceneLayerExplorer); const expander = document.querySelector(".expandItem"); - const nestedList = expander.parentElement.parentElement.querySelector( - "#Cat1-expander" - ); + const nestedList = + expander.parentElement.parentElement.querySelector("#Cat1-expander"); expect(expander.textContent).toEqual("+"); expect(nestedList.className).toEqual("nested"); DomEventSimulator.fireClick(expander); diff --git a/packages/widgets/Specs/I3SBSLExplorer/I3SBSLExplorerViewModelSpec.js b/packages/widgets/Specs/I3SBSLExplorer/I3SBSLExplorerViewModelSpec.js index 8d8c22af3c4f..08f8c8b1a667 100644 --- a/packages/widgets/Specs/I3SBSLExplorer/I3SBSLExplorerViewModelSpec.js +++ b/packages/widgets/Specs/I3SBSLExplorer/I3SBSLExplorerViewModelSpec.js @@ -67,22 +67,22 @@ describe("Widgets/I3SBuildingSceneLayerExplorer/I3SBuildingSceneLayerExplorerVie expect(viewModel.sublayers[0].sublayers[0].visibility).toEqual(true); expect(viewModel.sublayers[0].sublayers[0].sublayers.length).toEqual(2); expect(viewModel.sublayers[0].sublayers[0].sublayers[0].name).toEqual( - "SubCat1" + "SubCat1", ); expect(viewModel.sublayers[0].sublayers[0].sublayers[0].visibility).toEqual( - true + true, ); expect( - viewModel.sublayers[0].sublayers[0].sublayers[0].sublayers.length + viewModel.sublayers[0].sublayers[0].sublayers[0].sublayers.length, ).toEqual(0); expect(viewModel.sublayers[0].sublayers[0].sublayers[1].name).toEqual( - "SubCat2" + "SubCat2", ); expect(viewModel.sublayers[0].sublayers[0].sublayers[1].visibility).toEqual( - false + false, ); expect( - viewModel.sublayers[0].sublayers[0].sublayers[1].sublayers.length + viewModel.sublayers[0].sublayers[0].sublayers[1].sublayers.length, ).toEqual(0); expect(viewModel.topLayers.length).toEqual(3); @@ -91,7 +91,7 @@ describe("Widgets/I3SBuildingSceneLayerExplorer/I3SBuildingSceneLayerExplorerVie it("can create bsl explorer ViewModel if no Overview", function () { const viewModel = new I3SBuildingSceneLayerExplorerViewModel( - i3sProviderWithoutOverview + i3sProviderWithoutOverview, ); expect(viewModel.sublayers.length).toEqual(1); expect(viewModel.sublayers[0].name).toEqual("Full Model"); @@ -102,22 +102,22 @@ describe("Widgets/I3SBuildingSceneLayerExplorer/I3SBuildingSceneLayerExplorerVie expect(viewModel.sublayers[0].sublayers[0].visibility).toEqual(true); expect(viewModel.sublayers[0].sublayers[0].sublayers.length).toEqual(2); expect(viewModel.sublayers[0].sublayers[0].sublayers[0].name).toEqual( - "SubCat1" + "SubCat1", ); expect(viewModel.sublayers[0].sublayers[0].sublayers[0].visibility).toEqual( - true + true, ); expect( - viewModel.sublayers[0].sublayers[0].sublayers[0].sublayers.length + viewModel.sublayers[0].sublayers[0].sublayers[0].sublayers.length, ).toEqual(0); expect(viewModel.sublayers[0].sublayers[0].sublayers[1].name).toEqual( - "SubCat2" + "SubCat2", ); expect(viewModel.sublayers[0].sublayers[0].sublayers[1].visibility).toEqual( - false + false, ); expect( - viewModel.sublayers[0].sublayers[0].sublayers[1].sublayers.length + viewModel.sublayers[0].sublayers[0].sublayers[1].sublayers.length, ).toEqual(0); expect(viewModel.topLayers.length).toEqual(2); @@ -187,7 +187,7 @@ describe("Widgets/I3SBuildingSceneLayerExplorer/I3SBuildingSceneLayerExplorerVie i3sProviderWithoutOverview.filterByAttributes = jasmine.createSpy(); const viewModel = new I3SBuildingSceneLayerExplorerViewModel( - i3sProviderWithoutOverview + i3sProviderWithoutOverview, ); knockout.track(viewModel); diff --git a/packages/widgets/Specs/InfoBox/InfoBoxSpec.js b/packages/widgets/Specs/InfoBox/InfoBoxSpec.js index eb3131693caa..87becab3ad41 100644 --- a/packages/widgets/Specs/InfoBox/InfoBoxSpec.js +++ b/packages/widgets/Specs/InfoBox/InfoBoxSpec.js @@ -49,7 +49,7 @@ describe("Widgets/InfoBox/InfoBox", function () { infoBox.viewModel.description = '<div style="background-color: rgb(255, 255, 255);">Please do not crash</div>'; expect(infoElement.style["background-color"]).toEqual( - "rgb(255, 255, 255)" + "rgb(255, 255, 255)", ); return pollToPromise(function () { return node.innerHTML === infoBox.viewModel.description; diff --git a/packages/widgets/Specs/PerformanceWatchdog/PerformanceWatchdogSpec.js b/packages/widgets/Specs/PerformanceWatchdog/PerformanceWatchdogSpec.js index a6d37e6d4c36..37392e430f2f 100644 --- a/packages/widgets/Specs/PerformanceWatchdog/PerformanceWatchdogSpec.js +++ b/packages/widgets/Specs/PerformanceWatchdog/PerformanceWatchdogSpec.js @@ -70,5 +70,5 @@ describe( }).toThrowDeveloperError(); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/widgets/Specs/PerformanceWatchdog/PerformanceWatchdogViewModelSpec.js b/packages/widgets/Specs/PerformanceWatchdog/PerformanceWatchdogViewModelSpec.js index 7f737d46927c..111844304a47 100644 --- a/packages/widgets/Specs/PerformanceWatchdog/PerformanceWatchdogViewModelSpec.js +++ b/packages/widgets/Specs/PerformanceWatchdog/PerformanceWatchdogViewModelSpec.js @@ -199,5 +199,5 @@ describe( expect(viewModel.showingLowFrameRateMessage).toBe(false); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/widgets/Specs/ProjectionPicker/ProjectionPickerSpec.js b/packages/widgets/Specs/ProjectionPicker/ProjectionPickerSpec.js index ce99a4b39cb3..5e422e037993 100644 --- a/packages/widgets/Specs/ProjectionPicker/ProjectionPickerSpec.js +++ b/packages/widgets/Specs/ProjectionPicker/ProjectionPickerSpec.js @@ -96,7 +96,7 @@ describe( addCloseOnInputSpec("pointerDown", DomEventSimulator.firePointerDown); addDisabledDuringFlightSpec( "pointerDown", - DomEventSimulator.firePointerDown + DomEventSimulator.firePointerDown, ); addDisabledIn2DSpec("pointerDown", DomEventSimulator.firePointerDown); } else { @@ -105,7 +105,7 @@ describe( addDisabledDuringFlightSpec("mousedown", DomEventSimulator.fireMouseDown); addDisabledDuringFlightSpec( "touchstart", - DomEventSimulator.fireTouchStart + DomEventSimulator.fireTouchStart, ); addDisabledIn2DSpec("mousedown", DomEventSimulator.fireMouseDown); addDisabledIn2DSpec("touchstart", DomEventSimulator.fireTouchStart); @@ -129,5 +129,5 @@ describe( }).toThrowDeveloperError(); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/widgets/Specs/ProjectionPicker/ProjectionPickerViewModelSpec.js b/packages/widgets/Specs/ProjectionPicker/ProjectionPickerViewModelSpec.js index 5982b23a72b7..aed794b5bed9 100644 --- a/packages/widgets/Specs/ProjectionPicker/ProjectionPickerViewModelSpec.js +++ b/packages/widgets/Specs/ProjectionPicker/ProjectionPickerViewModelSpec.js @@ -94,5 +94,5 @@ describe( }).toThrowDeveloperError(); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/widgets/Specs/SceneModePicker/SceneModePickerSpec.js b/packages/widgets/Specs/SceneModePicker/SceneModePickerSpec.js index a311999f575c..123e4a9f217c 100644 --- a/packages/widgets/Specs/SceneModePicker/SceneModePickerSpec.js +++ b/packages/widgets/Specs/SceneModePicker/SceneModePickerSpec.js @@ -79,5 +79,5 @@ describe( }).toThrowDeveloperError(); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/widgets/Specs/SceneModePicker/SceneModePickerViewModelSpec.js b/packages/widgets/Specs/SceneModePicker/SceneModePickerViewModelSpec.js index 6bd6cefb22f4..81e1ca9ffeab 100644 --- a/packages/widgets/Specs/SceneModePicker/SceneModePickerViewModelSpec.js +++ b/packages/widgets/Specs/SceneModePicker/SceneModePickerViewModelSpec.js @@ -101,5 +101,5 @@ describe( }).toThrowDeveloperError(); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/widgets/Specs/SelectionIndicator/SelectionIndicatorSpec.js b/packages/widgets/Specs/SelectionIndicator/SelectionIndicatorSpec.js index c363ab246201..fa768a458aab 100644 --- a/packages/widgets/Specs/SelectionIndicator/SelectionIndicatorSpec.js +++ b/packages/widgets/Specs/SelectionIndicator/SelectionIndicatorSpec.js @@ -44,5 +44,5 @@ describe( }).toThrowDeveloperError(); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/widgets/Specs/SelectionIndicator/SelectionIndicatorViewModelSpec.js b/packages/widgets/Specs/SelectionIndicator/SelectionIndicatorViewModelSpec.js index 360f38b9e8fc..d68922c2afeb 100644 --- a/packages/widgets/Specs/SelectionIndicator/SelectionIndicatorViewModelSpec.js +++ b/packages/widgets/Specs/SelectionIndicator/SelectionIndicatorViewModelSpec.js @@ -25,11 +25,11 @@ describe( const viewModel = new SelectionIndicatorViewModel( scene, selectionIndicatorElement, - container + container, ); expect(viewModel.scene).toBe(scene); expect(viewModel.selectionIndicatorElement).toBe( - selectionIndicatorElement + selectionIndicatorElement, ); expect(viewModel.container).toBe(container); expect(viewModel.computeScreenSpacePosition).toBeDefined(); @@ -51,7 +51,7 @@ describe( expect(function () { return new SelectionIndicatorViewModel( scene, - selectionIndicatorElement + selectionIndicatorElement, ); }).toThrowDeveloperError(); }); @@ -60,7 +60,7 @@ describe( const viewModel = new SelectionIndicatorViewModel( scene, selectionIndicatorElement, - container + container, ); viewModel.animateAppear(); viewModel.animateDepart(); @@ -71,7 +71,7 @@ describe( const viewModel = new SelectionIndicatorViewModel( scene, selectionIndicatorElement, - container + container, ); viewModel.showSelection = true; viewModel.position = new Cartesian3(1.0, 2.0, 3.0); @@ -89,7 +89,7 @@ describe( const viewModel = new SelectionIndicatorViewModel( scene, selectionIndicatorElement, - container + container, ); expect(viewModel.isVisible).toBe(false); viewModel.showSelection = true; @@ -105,7 +105,7 @@ describe( const viewModel = new SelectionIndicatorViewModel( scene, selectionIndicatorElement, - container + container, ); viewModel.showSelection = true; viewModel.position = new Cartesian3(1.0, 2.0, 3.0); @@ -119,5 +119,5 @@ describe( document.body.removeChild(container); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/widgets/Specs/SvgPathBindingHandlerSpec.js b/packages/widgets/Specs/SvgPathBindingHandlerSpec.js index ecc403fed5e8..ebb5ebab0197 100644 --- a/packages/widgets/Specs/SvgPathBindingHandlerSpec.js +++ b/packages/widgets/Specs/SvgPathBindingHandlerSpec.js @@ -6,7 +6,7 @@ describe("ThirdParty/knockout", function () { div.setAttribute( "data-bind", '\ -cesiumSvgPath: { path: "M 100 100 L 300 100 L 200 300 Z", width: 28, height: 40, css: "someClass" }' +cesiumSvgPath: { path: "M 100 100 L 300 100 L 200 300 Z", width: 28, height: 40, css: "someClass" }', ); document.body.appendChild(div); @@ -32,7 +32,7 @@ cesiumSvgPath: { path: "M 100 100 L 300 100 L 200 300 Z", width: 28, height: 40, div.setAttribute( "data-bind", "\ -cesiumSvgPath: { path: p, width: w, height: h, css: c }" +cesiumSvgPath: { path: p, width: w, height: h, css: c }", ); document.body.appendChild(div); @@ -44,7 +44,7 @@ cesiumSvgPath: { path: p, width: w, height: h, css: c }" h: knockout.observable(40), c: knockout.observable("someClass"), }, - div + div, ); const svg = div.querySelector("svg.cesium-svgPath-svg"); @@ -63,8 +63,11 @@ cesiumSvgPath: { path: p, width: w, height: h, css: c }" it("check binding with observable parameter object", function () { const div = document.createElement("div"); - div.setAttribute("data-bind", "\ -cesiumSvgPath: svgPath"); + div.setAttribute( + "data-bind", + "\ +cesiumSvgPath: svgPath", + ); document.body.appendChild(div); diff --git a/packages/widgets/Specs/Viewer/ViewerSpec.js b/packages/widgets/Specs/Viewer/ViewerSpec.js index dc313e43702b..a8428eae1a3e 100644 --- a/packages/widgets/Specs/Viewer/ViewerSpec.js +++ b/packages/widgets/Specs/Viewer/ViewerSpec.js @@ -106,7 +106,7 @@ describe( expect(viewer.animation).toBeInstanceOf(Animation); expect(viewer.clockViewModel).toBeInstanceOf(ClockViewModel); expect(viewer.animation.viewModel.clockViewModel).toBe( - viewer.clockViewModel + viewer.clockViewModel, ); expect(viewer.timeline).toBeInstanceOf(Timeline); expect(viewer.fullscreenButton).toBeInstanceOf(FullscreenButton); @@ -120,7 +120,7 @@ describe( expect(viewer.canvas).toBe(viewer.cesiumWidget.canvas); expect(viewer.cesiumLogo).toBe(viewer.cesiumWidget.cesiumLogo); expect(viewer.screenSpaceEventHandler).toBe( - viewer.cesiumWidget.screenSpaceEventHandler + viewer.cesiumWidget.screenSpaceEventHandler, ); expect(viewer.useBrowserRecommendedResolution).toBe(true); expect(viewer.isDestroyed()).toEqual(false); @@ -133,7 +133,7 @@ describe( viewer = createViewer(container, { clockViewModel: clockViewModel }); expect(viewer.clockViewModel).toBe(clockViewModel); expect(viewer.animation.viewModel.clockViewModel).toBe( - viewer.clockViewModel + viewer.clockViewModel, ); viewer.destroy(); expect(clockViewModel.isDestroyed()).toBe(false); @@ -151,7 +151,7 @@ describe( const clockViewModel = new ClockViewModel( new Clock({ shouldAnimate: false, - }) + }), ); viewer = createViewer(container, { @@ -449,7 +449,7 @@ describe( fullscreenElement: testElement, }); expect(viewer.fullscreenButton.viewModel.fullscreenElement).toBe( - testElement + testElement, ); }); @@ -481,13 +481,13 @@ describe( expect(contextAttributes.stencil).toEqual(webglOptions.stencil); expect(contextAttributes.antialias).toEqual(webglOptions.antialias); expect(contextAttributes.powerPreference).toEqual( - webglOptions.powerPreference + webglOptions.powerPreference, ); expect(contextAttributes.premultipliedAlpha).toEqual( - webglOptions.premultipliedAlpha + webglOptions.premultipliedAlpha, ); expect(contextAttributes.preserveDrawingBuffer).toEqual( - webglOptions.preserveDrawingBuffer + webglOptions.preserveDrawingBuffer, ); }); @@ -522,10 +522,10 @@ describe( await pollToPromise(() => viewer.scene.imageryLayers.get(0).ready); expect(viewer.scene.imageryLayers.length).toEqual(1); expect(viewer.scene.imageryLayers.get(0).imageryProvider).toBe( - testProvider + testProvider, ); expect(viewer.baseLayerPicker.viewModel.selectedImagery).toBe( - testProviderViewModel + testProviderViewModel, ); }); @@ -539,16 +539,16 @@ describe( await pollToPromise(() => viewer.scene.imageryLayers.get(0).ready); expect(viewer.scene.imageryLayers.length).toEqual(1); expect(viewer.scene.imageryLayers.get(0).imageryProvider).toBe( - testProvider + testProvider, ); expect(viewer.baseLayerPicker.viewModel.selectedImagery).toBe( - testProviderViewModel + testProviderViewModel, ); expect( - viewer.baseLayerPicker.viewModel.imageryProviderViewModels.length + viewer.baseLayerPicker.viewModel.imageryProviderViewModels.length, ).toBe(models.length); expect( - viewer.baseLayerPicker.viewModel.imageryProviderViewModels[0] + viewer.baseLayerPicker.viewModel.imageryProviderViewModels[0], ).toEqual(models[0]); }); @@ -559,7 +559,7 @@ describe( }); expect(viewer.scene.imageryLayers.length).toEqual(1); expect(viewer.scene.imageryLayers.get(0).imageryProvider).toBe( - testProvider + testProvider, ); }); @@ -726,9 +726,8 @@ describe( dataSource.clock = new DataSourceClock(); dataSource.clock.startTime = JulianDate.fromIso8601("2013-08-01T18:00Z"); dataSource.clock.stopTime = JulianDate.fromIso8601("2013-08-21T02:00Z"); - dataSource.clock.currentTime = JulianDate.fromIso8601( - "2013-08-02T00:00Z" - ); + dataSource.clock.currentTime = + JulianDate.fromIso8601("2013-08-02T00:00Z"); dataSource.clock.clockRange = ClockRange.CLAMPED; dataSource.clock.clockStep = ClockStep.TICK_DEPENDENT; dataSource.clock.multiplier = 20.0; @@ -749,9 +748,8 @@ describe( dataSource1.clock = new DataSourceClock(); dataSource1.clock.startTime = JulianDate.fromIso8601("2013-08-01T18:00Z"); dataSource1.clock.stopTime = JulianDate.fromIso8601("2013-08-21T02:00Z"); - dataSource1.clock.currentTime = JulianDate.fromIso8601( - "2013-08-02T00:00Z" - ); + dataSource1.clock.currentTime = + JulianDate.fromIso8601("2013-08-02T00:00Z"); let dataSource2, dataSource3; viewer = createViewer(container); @@ -763,15 +761,12 @@ describe( dataSource2 = new MockDataSource(); dataSource2.clock = new DataSourceClock(); - dataSource2.clock.startTime = JulianDate.fromIso8601( - "2014-08-01T18:00Z" - ); - dataSource2.clock.stopTime = JulianDate.fromIso8601( - "2014-08-21T02:00Z" - ); - dataSource2.clock.currentTime = JulianDate.fromIso8601( - "2014-08-02T00:00Z" - ); + dataSource2.clock.startTime = + JulianDate.fromIso8601("2014-08-01T18:00Z"); + dataSource2.clock.stopTime = + JulianDate.fromIso8601("2014-08-21T02:00Z"); + dataSource2.clock.currentTime = + JulianDate.fromIso8601("2014-08-02T00:00Z"); viewer.dataSources.add(dataSource2); }) @@ -781,15 +776,12 @@ describe( dataSource3 = new MockDataSource(); dataSource3.clock = new DataSourceClock(); - dataSource3.clock.startTime = JulianDate.fromIso8601( - "2015-08-01T18:00Z" - ); - dataSource3.clock.stopTime = JulianDate.fromIso8601( - "2015-08-21T02:00Z" - ); - dataSource3.clock.currentTime = JulianDate.fromIso8601( - "2015-08-02T00:00Z" - ); + dataSource3.clock.startTime = + JulianDate.fromIso8601("2015-08-01T18:00Z"); + dataSource3.clock.stopTime = + JulianDate.fromIso8601("2015-08-21T02:00Z"); + dataSource3.clock.currentTime = + JulianDate.fromIso8601("2015-08-02T00:00Z"); viewer.dataSources.add(dataSource3); }) @@ -814,22 +806,19 @@ describe( dataSource.clock = new DataSourceClock(); dataSource.clock.startTime = JulianDate.fromIso8601("2013-08-01T18:00Z"); dataSource.clock.stopTime = JulianDate.fromIso8601("2013-08-21T02:00Z"); - dataSource.clock.currentTime = JulianDate.fromIso8601( - "2013-08-02T00:00Z" - ); + dataSource.clock.currentTime = + JulianDate.fromIso8601("2013-08-02T00:00Z"); dataSource.clock.clockRange = ClockRange.CLAMPED; dataSource.clock.clockStep = ClockStep.TICK_DEPENDENT; dataSource.clock.multiplier = 20.0; viewer = createViewer(container); return viewer.dataSources.add(dataSource).then(function () { - dataSource.clock.startTime = JulianDate.fromIso8601( - "2014-08-01T18:00Z" - ); + dataSource.clock.startTime = + JulianDate.fromIso8601("2014-08-01T18:00Z"); dataSource.clock.stopTime = JulianDate.fromIso8601("2014-08-21T02:00Z"); - dataSource.clock.currentTime = JulianDate.fromIso8601( - "2014-08-02T00:00Z" - ); + dataSource.clock.currentTime = + JulianDate.fromIso8601("2014-08-02T00:00Z"); dataSource.clock.clockRange = ClockRange.UNBOUNDED; dataSource.clock.clockStep = ClockStep.SYSTEM_CLOCK_MULTIPLIER; dataSource.clock.multiplier = 10.0; @@ -857,9 +846,8 @@ describe( dataSource1.clock = new DataSourceClock(); dataSource1.clock.startTime = JulianDate.fromIso8601("2013-08-01T18:00Z"); dataSource1.clock.stopTime = JulianDate.fromIso8601("2013-08-21T02:00Z"); - dataSource1.clock.currentTime = JulianDate.fromIso8601( - "2013-08-02T00:00Z" - ); + dataSource1.clock.currentTime = + JulianDate.fromIso8601("2013-08-02T00:00Z"); viewer = createViewer(container, { automaticallyTrackDataSourceClocks: false, @@ -874,7 +862,7 @@ describe( expect(viewer.clockTrackedDataSource).not.toBeDefined(); // The mock data source time is in the past, so will not be the default time. expect(viewer.clock.startTime).not.toEqual( - dataSource1.clock.startTime + dataSource1.clock.startTime, ); // Manually set the first data source as the tracked data source. @@ -884,15 +872,12 @@ describe( dataSource2 = new MockDataSource(); dataSource2.clock = new DataSourceClock(); - dataSource2.clock.startTime = JulianDate.fromIso8601( - "2014-08-01T18:00Z" - ); - dataSource2.clock.stopTime = JulianDate.fromIso8601( - "2014-08-21T02:00Z" - ); - dataSource2.clock.currentTime = JulianDate.fromIso8601( - "2014-08-02T00:00Z" - ); + dataSource2.clock.startTime = + JulianDate.fromIso8601("2014-08-01T18:00Z"); + dataSource2.clock.stopTime = + JulianDate.fromIso8601("2014-08-21T02:00Z"); + dataSource2.clock.currentTime = + JulianDate.fromIso8601("2014-08-02T00:00Z"); // Adding a second data source in manual mode still leaves the first one tracked. viewer.dataSources.add(dataSource2); @@ -920,11 +905,11 @@ describe( return !viewer.useDefaultRenderLoop; }).catch(function () { expect( - viewer._element.querySelector(".cesium-widget-errorPanel") + viewer._element.querySelector(".cesium-widget-errorPanel"), ).not.toBeNull(); const messages = viewer._element.querySelectorAll( - ".cesium-widget-errorPanel-message" + ".cesium-widget-errorPanel-message", ); let found = false; @@ -938,11 +923,11 @@ describe( // click the OK button to dismiss the panel DomEventSimulator.fireClick( - viewer._element.querySelector(".cesium-button") + viewer._element.querySelector(".cesium-button"), ); expect( - viewer._element.querySelector(".cesium-widget-errorPanel") + viewer._element.querySelector(".cesium-widget-errorPanel"), ).toBeNull(); }); }); @@ -961,7 +946,7 @@ describe( return !viewer.useDefaultRenderLoop; }).catch(function () { expect( - viewer._element.querySelector(".cesium-widget-errorPanel") + viewer._element.querySelector(".cesium-widget-errorPanel"), ).toBeNull(); }); }); @@ -980,7 +965,7 @@ describe( }); expect(viewer.scene.maximumRenderTimeChange).toBe( - Number.POSITIVE_INFINITY + Number.POSITIVE_INFINITY, ); }); @@ -990,7 +975,7 @@ describe( }); expect(viewer.scene._depthPlane._ellipsoidOffset).toBe( - Number.POSITIVE_INFINITY + Number.POSITIVE_INFINITY, ); }); @@ -999,7 +984,7 @@ describe( const entity = new Entity(); entity.position = new ConstantProperty( - new Cartesian3(123456, 123456, 123456) + new Cartesian3(123456, 123456, 123456), ); viewer.trackedEntity = entity; @@ -1017,7 +1002,7 @@ describe( const entity = new Entity(); entity.position = new ConstantPositionProperty( - new Cartesian3(123456, 123456, 123456) + new Cartesian3(123456, 123456, 123456), ); dataSource.entities.add(entity); @@ -1039,7 +1024,7 @@ describe( const entity = new Entity(); entity.position = new ConstantPositionProperty( - new Cartesian3(123456, 123456, 123456) + new Cartesian3(123456, 123456, 123456), ); dataSource.entities.add(entity); @@ -1065,7 +1050,7 @@ describe( const entity = new Entity(); entity.position = new ConstantPositionProperty( - new Cartesian3(123456, 123456, 123456) + new Cartesian3(123456, 123456, 123456), ); dataSource.entities.add(entity); @@ -1121,7 +1106,7 @@ describe( const entity = new Entity(); entity.position = new ConstantProperty( - new Cartesian3(123456, 123456, 123456) + new Cartesian3(123456, 123456, 123456), ); viewer.trackedEntity = entity; @@ -1143,7 +1128,7 @@ describe( const entity = new Entity(); entity.position = new ConstantProperty( - new Cartesian3(123456, 123456, 123456) + new Cartesian3(123456, 123456, 123456), ); const dataSource = new MockDataSource(); @@ -1159,9 +1144,9 @@ describe( return Cartesian3.equals( Matrix4.getTranslation( viewer.scene.camera.transform, - new Cartesian3() + new Cartesian3(), ), - entity.position.getValue() + entity.position.getValue(), ); }).then(function () { dataSource.entities.remove(entity); @@ -1180,9 +1165,9 @@ describe( return Cartesian3.equals( Matrix4.getTranslation( viewer.scene.camera.transform, - new Cartesian3() + new Cartesian3(), ), - entity.position.getValue() + entity.position.getValue(), ); }).then(function () { viewer.dataSources.remove(dataSource); @@ -1236,18 +1221,17 @@ describe( const expectedOffset = new HeadingPitchRange( 0.0, -0.5, - expectedBoundingSphere.radius + expectedBoundingSphere.radius, ); let wasCompleted = false; - spyOn(viewer.camera, "viewBoundingSphere").and.callFake(function ( - boundingSphere, - offset - ) { - expect(boundingSphere).toEqual(expectedBoundingSphere); - expect(offset).toEqual(expectedOffset); - wasCompleted = true; - }); + spyOn(viewer.camera, "viewBoundingSphere").and.callFake( + function (boundingSphere, offset) { + expect(boundingSphere).toEqual(expectedBoundingSphere); + expect(offset).toEqual(expectedOffset); + wasCompleted = true; + }, + ); const promise = viewer.zoomTo(tileset); viewer._postRender(); @@ -1268,19 +1252,18 @@ describe( const expectedOffset = new HeadingPitchRange( 0.4, 1.2, - 4.0 * expectedBoundingSphere.radius + 4.0 * expectedBoundingSphere.radius, ); const promise = viewer.zoomTo(tileset, expectedOffset); let wasCompleted = false; - spyOn(viewer.camera, "viewBoundingSphere").and.callFake(function ( - boundingSphere, - offset - ) { - expect(boundingSphere).toEqual(expectedBoundingSphere); - expect(offset).toEqual(expectedOffset); - wasCompleted = true; - }); + spyOn(viewer.camera, "viewBoundingSphere").and.callFake( + function (boundingSphere, offset) { + expect(boundingSphere).toEqual(expectedBoundingSphere); + expect(offset).toEqual(expectedOffset); + wasCompleted = true; + }, + ); viewer._postRender(); @@ -1303,12 +1286,11 @@ describe( }; } - const timeIntervalCollection = TimeIntervalCollection.fromIso8601DateArray( - { + const timeIntervalCollection = + TimeIntervalCollection.fromIso8601DateArray({ iso8601Dates: dates, dataCallback: dataCallback, - } - ); + }); const pointCloud = new TimeDynamicPointCloud({ intervals: timeIntervalCollection, @@ -1338,19 +1320,18 @@ describe( const expectedOffset = new HeadingPitchRange( 0.0, -0.5, - expectedBoundingSphere.radius + expectedBoundingSphere.radius, ); const promise = viewer.zoomTo(pointCloud); let wasCompleted = false; - spyOn(viewer.camera, "viewBoundingSphere").and.callFake(function ( - boundingSphere, - offset - ) { - expect(boundingSphere).toEqual(expectedBoundingSphere); - expect(offset).toEqual(expectedOffset); - wasCompleted = true; - }); + spyOn(viewer.camera, "viewBoundingSphere").and.callFake( + function (boundingSphere, offset) { + expect(boundingSphere).toEqual(expectedBoundingSphere); + expect(offset).toEqual(expectedOffset); + wasCompleted = true; + }, + ); viewer._postRender(); @@ -1368,19 +1349,18 @@ describe( const expectedOffset = new HeadingPitchRange( 0.4, 1.2, - 4.0 * expectedBoundingSphere.radius + 4.0 * expectedBoundingSphere.radius, ); const promise = viewer.zoomTo(pointCloud, expectedOffset); let wasCompleted = false; - spyOn(viewer.camera, "viewBoundingSphere").and.callFake(function ( - boundingSphere, - offset - ) { - expect(boundingSphere).toEqual(expectedBoundingSphere); - expect(offset).toEqual(expectedOffset); - wasCompleted = true; - }); + spyOn(viewer.camera, "viewBoundingSphere").and.callFake( + function (boundingSphere, offset) { + expect(boundingSphere).toEqual(expectedBoundingSphere); + expect(offset).toEqual(expectedOffset); + wasCompleted = true; + }, + ); viewer._postRender(); @@ -1394,7 +1374,7 @@ describe( async function loadVoxelPrimitive(viewer) { const voxelPrimitive = new VoxelPrimitive({ provider: await Cesium3DTilesVoxelProvider.fromUrl( - "./Data/Cesium3DTiles/Voxel/VoxelEllipsoid3DTiles/tileset.json" + "./Data/Cesium3DTiles/Voxel/VoxelEllipsoid3DTiles/tileset.json", ), }); viewer.scene.primitives.add(voxelPrimitive); @@ -1409,19 +1389,18 @@ describe( const expectedOffset = new HeadingPitchRange( 0.0, -0.5, - expectedBoundingSphere.radius + expectedBoundingSphere.radius, ); const promise = viewer.zoomTo(voxelPrimitive); let wasCompleted = false; - spyOn(viewer.camera, "viewBoundingSphere").and.callFake(function ( - boundingSphere, - offset - ) { - expect(boundingSphere).toEqual(expectedBoundingSphere); - expect(offset).toEqual(expectedOffset); - wasCompleted = true; - }); + spyOn(viewer.camera, "viewBoundingSphere").and.callFake( + function (boundingSphere, offset) { + expect(boundingSphere).toEqual(expectedBoundingSphere); + expect(offset).toEqual(expectedOffset); + wasCompleted = true; + }, + ); viewer._postRender(); @@ -1439,19 +1418,18 @@ describe( const expectedOffset = new HeadingPitchRange( 0.4, 1.2, - 4.0 * expectedBoundingSphere.radius + 4.0 * expectedBoundingSphere.radius, ); const promise = viewer.zoomTo(voxelPrimitive, expectedOffset); let wasCompleted = false; - spyOn(viewer.camera, "viewBoundingSphere").and.callFake(function ( - boundingSphere, - offset - ) { - expect(boundingSphere).toEqual(expectedBoundingSphere); - expect(offset).toEqual(expectedOffset); - wasCompleted = true; - }); + spyOn(viewer.camera, "viewBoundingSphere").and.callFake( + function (boundingSphere, offset) { + expect(boundingSphere).toEqual(expectedBoundingSphere); + expect(offset).toEqual(expectedOffset); + wasCompleted = true; + }, + ); viewer._postRender(); @@ -1479,18 +1457,17 @@ describe( spyOn(viewer._dataSourceDisplay, "getBoundingSphere").and.callFake( function () { return new BoundingSphere(); - } + }, ); - spyOn(viewer.camera, "viewBoundingSphere").and.callFake(function ( - boundingSphere, - offset - ) { - expect(boundingSphere).toBeDefined(); - // expect offset to be undefined - doesn't use default bc of how zoomTo for entities is set up - expect(offset).toBeUndefined(); - wasCompleted = true; - }); + spyOn(viewer.camera, "viewBoundingSphere").and.callFake( + function (boundingSphere, offset) { + expect(boundingSphere).toBeDefined(); + // expect offset to be undefined - doesn't use default bc of how zoomTo for entities is set up + expect(offset).toBeUndefined(); + wasCompleted = true; + }, + ); viewer._postRender(); @@ -1519,15 +1496,14 @@ describe( spyOn(viewer._dataSourceDisplay, "getBoundingSphere").and.callFake( function () { return new BoundingSphere(); - } + }, + ); + spyOn(viewer.camera, "viewBoundingSphere").and.callFake( + function (boundingSphere, offset) { + expect(expectedOffset).toEqual(offset); + wasCompleted = true; + }, ); - spyOn(viewer.camera, "viewBoundingSphere").and.callFake(function ( - boundingSphere, - offset - ) { - expect(expectedOffset).toEqual(offset); - wasCompleted = true; - }); viewer._postRender(); @@ -1582,16 +1558,15 @@ describe( const promise = viewer.flyTo(tileset); let wasCompleted = false; - spyOn(viewer.camera, "flyToBoundingSphere").and.callFake(function ( - target, - options - ) { - expect(options.offset).toBeDefined(); - expect(options.duration).toBeUndefined(); - expect(options.maximumHeight).toBeUndefined(); - wasCompleted = true; - options.complete(); - }); + spyOn(viewer.camera, "flyToBoundingSphere").and.callFake( + function (target, options) { + expect(options.offset).toBeDefined(); + expect(options.duration).toBeUndefined(); + expect(options.maximumHeight).toBeUndefined(); + wasCompleted = true; + options.complete(); + }, + ); viewer._postRender(); @@ -1612,16 +1587,15 @@ describe( const promise = viewer.flyTo(tileset, options); let wasCompleted = false; - spyOn(viewer.camera, "flyToBoundingSphere").and.callFake(function ( - target, - options - ) { - expect(options.offset).toBeDefined(); - expect(options.duration).toBeUndefined(); - expect(options.maximumHeight).toBeUndefined(); - wasCompleted = true; - options.complete(); - }); + spyOn(viewer.camera, "flyToBoundingSphere").and.callFake( + function (target, options) { + expect(options.offset).toBeDefined(); + expect(options.duration).toBeUndefined(); + expect(options.maximumHeight).toBeUndefined(); + wasCompleted = true; + options.complete(); + }, + ); viewer._postRender(); @@ -1647,15 +1621,14 @@ describe( const promise = viewer.flyTo(tileset, options); let wasCompleted = false; - spyOn(viewer.camera, "flyToBoundingSphere").and.callFake(function ( - target, - options - ) { - expect(options.duration).toBeDefined(); - expect(options.maximumHeight).toBeDefined(); - wasCompleted = true; - options.complete(); - }); + spyOn(viewer.camera, "flyToBoundingSphere").and.callFake( + function (target, options) { + expect(options.duration).toBeDefined(); + expect(options.maximumHeight).toBeDefined(); + wasCompleted = true; + options.complete(); + }, + ); viewer._postRender(); @@ -1670,16 +1643,15 @@ describe( const promise = viewer.flyTo(pointCloud); let wasCompleted = false; - spyOn(viewer.camera, "flyToBoundingSphere").and.callFake(function ( - target, - options - ) { - expect(options.offset).toBeDefined(); - expect(options.duration).toBeUndefined(); - expect(options.maximumHeight).toBeUndefined(); - wasCompleted = true; - options.complete(); - }); + spyOn(viewer.camera, "flyToBoundingSphere").and.callFake( + function (target, options) { + expect(options.offset).toBeDefined(); + expect(options.duration).toBeUndefined(); + expect(options.maximumHeight).toBeUndefined(); + wasCompleted = true; + options.complete(); + }, + ); viewer._postRender(); @@ -1697,16 +1669,15 @@ describe( const promise = viewer.flyTo(pointCloud, options); let wasCompleted = false; - spyOn(viewer.camera, "flyToBoundingSphere").and.callFake(function ( - target, - options - ) { - expect(options.offset).toBeDefined(); - expect(options.duration).toBeUndefined(); - expect(options.maximumHeight).toBeUndefined(); - wasCompleted = true; - options.complete(); - }); + spyOn(viewer.camera, "flyToBoundingSphere").and.callFake( + function (target, options) { + expect(options.offset).toBeDefined(); + expect(options.duration).toBeUndefined(); + expect(options.maximumHeight).toBeUndefined(); + wasCompleted = true; + options.complete(); + }, + ); viewer._postRender(); @@ -1729,15 +1700,14 @@ describe( const promise = viewer.flyTo(pointCloud, options); let wasCompleted = false; - spyOn(viewer.camera, "flyToBoundingSphere").and.callFake(function ( - target, - options - ) { - expect(options.duration).toBeDefined(); - expect(options.maximumHeight).toBeDefined(); - wasCompleted = true; - options.complete(); - }); + spyOn(viewer.camera, "flyToBoundingSphere").and.callFake( + function (target, options) { + expect(options.duration).toBeDefined(); + expect(options.maximumHeight).toBeDefined(); + wasCompleted = true; + options.complete(); + }, + ); viewer._postRender(); @@ -1755,16 +1725,15 @@ describe( const promise = viewer.flyTo(voxelPrimitive); let wasCompleted = false; - spyOn(viewer.camera, "flyToBoundingSphere").and.callFake(function ( - target, - options - ) { - expect(options.offset).toBeDefined(); - expect(options.duration).toBeUndefined(); - expect(options.maximumHeight).toBeUndefined(); - wasCompleted = true; - options.complete(); - }); + spyOn(viewer.camera, "flyToBoundingSphere").and.callFake( + function (target, options) { + expect(options.offset).toBeDefined(); + expect(options.duration).toBeUndefined(); + expect(options.maximumHeight).toBeUndefined(); + wasCompleted = true; + options.complete(); + }, + ); viewer._postRender(); @@ -1782,16 +1751,15 @@ describe( const promise = viewer.flyTo(voxelPrimitive, options); let wasCompleted = false; - spyOn(viewer.camera, "flyToBoundingSphere").and.callFake(function ( - target, - options - ) { - expect(options.offset).toBeDefined(); - expect(options.duration).toBeUndefined(); - expect(options.maximumHeight).toBeUndefined(); - wasCompleted = true; - options.complete(); - }); + spyOn(viewer.camera, "flyToBoundingSphere").and.callFake( + function (target, options) { + expect(options.offset).toBeDefined(); + expect(options.duration).toBeUndefined(); + expect(options.maximumHeight).toBeUndefined(); + wasCompleted = true; + options.complete(); + }, + ); viewer._postRender(); @@ -1816,15 +1784,14 @@ describe( const promise = viewer.flyTo(voxelPrimitive, options); let wasCompleted = false; - spyOn(viewer.camera, "flyToBoundingSphere").and.callFake(function ( - target, - options - ) { - expect(options.duration).toBeDefined(); - expect(options.maximumHeight).toBeDefined(); - wasCompleted = true; - options.complete(); - }); + spyOn(viewer.camera, "flyToBoundingSphere").and.callFake( + function (target, options) { + expect(options.duration).toBeDefined(); + expect(options.maximumHeight).toBeDefined(); + wasCompleted = true; + options.complete(); + }, + ); viewer._postRender(); @@ -1852,17 +1819,16 @@ describe( spyOn(viewer._dataSourceDisplay, "getBoundingSphere").and.callFake( function () { return new BoundingSphere(); - } + }, + ); + spyOn(viewer.camera, "flyToBoundingSphere").and.callFake( + function (target, options) { + expect(options.duration).toBeUndefined(); + expect(options.maximumHeight).toBeUndefined(); + wasCompleted = true; + options.complete(); + }, ); - spyOn(viewer.camera, "flyToBoundingSphere").and.callFake(function ( - target, - options - ) { - expect(options.duration).toBeUndefined(); - expect(options.maximumHeight).toBeUndefined(); - wasCompleted = true; - options.complete(); - }); viewer._postRender(); @@ -1892,16 +1858,15 @@ describe( const promise = viewer.flyTo(voxelPrimitive); let wasCompleted = false; - spyOn(viewer.camera, "flyToBoundingSphere").and.callFake(function ( - target, - options - ) { - expect(options.offset).toBeDefined(); - expect(options.duration).toBeUndefined(); - expect(options.maximumHeight).toBeUndefined(); - wasCompleted = true; - options.complete(); - }); + spyOn(viewer.camera, "flyToBoundingSphere").and.callFake( + function (target, options) { + expect(options.offset).toBeDefined(); + expect(options.duration).toBeUndefined(); + expect(options.maximumHeight).toBeUndefined(); + wasCompleted = true; + options.complete(); + }, + ); viewer._postRender(); @@ -1919,16 +1884,15 @@ describe( const promise = viewer.flyTo(voxelPrimitive, options); let wasCompleted = false; - spyOn(viewer.camera, "flyToBoundingSphere").and.callFake(function ( - target, - options - ) { - expect(options.offset).toBeDefined(); - expect(options.duration).toBeUndefined(); - expect(options.maximumHeight).toBeUndefined(); - wasCompleted = true; - options.complete(); - }); + spyOn(viewer.camera, "flyToBoundingSphere").and.callFake( + function (target, options) { + expect(options.offset).toBeDefined(); + expect(options.duration).toBeUndefined(); + expect(options.maximumHeight).toBeUndefined(); + wasCompleted = true; + options.complete(); + }, + ); viewer._postRender(); @@ -1953,15 +1917,14 @@ describe( const promise = viewer.flyTo(voxelPrimitive, options); let wasCompleted = false; - spyOn(viewer.camera, "flyToBoundingSphere").and.callFake(function ( - target, - options - ) { - expect(options.duration).toBeDefined(); - expect(options.maximumHeight).toBeDefined(); - wasCompleted = true; - options.complete(); - }); + spyOn(viewer.camera, "flyToBoundingSphere").and.callFake( + function (target, options) { + expect(options.duration).toBeDefined(); + expect(options.maximumHeight).toBeDefined(); + wasCompleted = true; + options.complete(); + }, + ); viewer._postRender(); @@ -1991,17 +1954,16 @@ describe( spyOn(viewer._dataSourceDisplay, "getBoundingSphere").and.callFake( function () { return new BoundingSphere(); - } + }, + ); + spyOn(viewer.camera, "flyToBoundingSphere").and.callFake( + function (target, options) { + expect(options.duration).toBeUndefined(); + expect(options.maximumHeight).toBeUndefined(); + wasCompleted = true; + options.complete(); + }, ); - spyOn(viewer.camera, "flyToBoundingSphere").and.callFake(function ( - target, - options - ) { - expect(options.duration).toBeUndefined(); - expect(options.maximumHeight).toBeUndefined(); - wasCompleted = true; - options.complete(); - }); viewer._postRender(); @@ -2035,17 +1997,16 @@ describe( spyOn(viewer._dataSourceDisplay, "getBoundingSphere").and.callFake( function () { return new BoundingSphere(); - } + }, + ); + spyOn(viewer.camera, "flyToBoundingSphere").and.callFake( + function (target, options) { + expect(options.duration).toBeDefined(); + expect(options.maximumHeight).toBeDefined(); + wasCompleted = true; + options.complete(); + }, ); - spyOn(viewer.camera, "flyToBoundingSphere").and.callFake(function ( - target, - options - ) { - expect(options.duration).toBeDefined(); - expect(options.maximumHeight).toBeDefined(); - wasCompleted = true; - options.complete(); - }); viewer._postRender(); @@ -2077,17 +2038,16 @@ describe( spyOn(viewer._dataSourceDisplay, "getBoundingSphere").and.callFake( function () { return new BoundingSphere(); - } + }, + ); + spyOn(viewer.camera, "flyToBoundingSphere").and.callFake( + function (target, options) { + expect(options.duration).toBeUndefined(); + expect(options.maximumHeight).toBeUndefined(); + wasCompleted = true; + options.complete(); + }, ); - spyOn(viewer.camera, "flyToBoundingSphere").and.callFake(function ( - target, - options - ) { - expect(options.duration).toBeUndefined(); - expect(options.maximumHeight).toBeUndefined(); - wasCompleted = true; - options.complete(); - }); viewer._postRender(); @@ -2117,13 +2077,13 @@ describe( viewer = viewer.destroy(); expect( - preMixinDataSource.entities.collectionChanged._listeners.length + preMixinDataSource.entities.collectionChanged._listeners.length, ).not.toEqual(preMixinListenerCount); expect( - postMixinDataSource.entities.collectionChanged._listeners.length + postMixinDataSource.entities.collectionChanged._listeners.length, ).not.toEqual(postMixinListenerCount); }); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/widgets/Specs/Viewer/viewerDragDropMixinSpec.js b/packages/widgets/Specs/Viewer/viewerDragDropMixinSpec.js index d730ac1f4136..882900e0b2b4 100644 --- a/packages/widgets/Specs/Viewer/viewerDragDropMixinSpec.js +++ b/packages/widgets/Specs/Viewer/viewerDragDropMixinSpec.js @@ -285,7 +285,7 @@ describe( expect(spyListener).toHaveBeenCalledWith( viewer, "czml1.czml", - jasmine.any(SyntaxError) + jasmine.any(SyntaxError), ); viewer.dropError.removeEventListener(spyListener); @@ -320,7 +320,7 @@ describe( expect(spyListener).toHaveBeenCalledWith( viewer, mockEvent.dataTransfer.files[0].name, - mockEvent.dataTransfer.files[0].errorMessage + mockEvent.dataTransfer.files[0].errorMessage, ); viewer.dropError.removeEventListener(spyListener); @@ -471,5 +471,5 @@ describe( }).toThrowDeveloperError(); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/widgets/Specs/Viewer/viewerPerformanceWatchdogMixinSpec.js b/packages/widgets/Specs/Viewer/viewerPerformanceWatchdogMixinSpec.js index 3526b0304dc5..fe64352157af 100644 --- a/packages/widgets/Specs/Viewer/viewerPerformanceWatchdogMixinSpec.js +++ b/packages/widgets/Specs/Viewer/viewerPerformanceWatchdogMixinSpec.js @@ -36,7 +36,7 @@ describe( lowFrameRateMessage: "Foo", }); expect(viewer.performanceWatchdog.viewModel.lowFrameRateMessage).toBe( - "Foo" + "Foo", ); }); @@ -46,5 +46,5 @@ describe( }).toThrowDeveloperError(); }); }, - "WebGL" + "WebGL", ); diff --git a/packages/widgets/Specs/VoxelInspector/VoxelInspectorSpec.js b/packages/widgets/Specs/VoxelInspector/VoxelInspectorSpec.js index c2f12bd41369..b269e347787e 100644 --- a/packages/widgets/Specs/VoxelInspector/VoxelInspectorSpec.js +++ b/packages/widgets/Specs/VoxelInspector/VoxelInspectorSpec.js @@ -51,5 +51,5 @@ describe( }).toThrowDeveloperError(); }); }, - "WebGL" + "WebGL", ); diff --git a/server.js b/server.js index 057beb0f0d98..b5092672ce6f 100644 --- a/server.js +++ b/server.js @@ -104,7 +104,7 @@ async function generateDevelopmentBuild() { }); console.log( - `Cesium built in ${formatTimeSinceInSeconds(startTime)} seconds.` + `Cesium built in ${formatTimeSinceInSeconds(startTime)} seconds.`, ); return contexts; @@ -140,7 +140,7 @@ async function generateDevelopmentBuild() { ], "text/plain": ["glsl"], }, - true + true, ); const app = express(); @@ -150,7 +150,7 @@ async function generateDevelopmentBuild() { res.header("Access-Control-Allow-Origin", "*"); res.header( "Access-Control-Allow-Headers", - "Origin, X-Requested-With, Content-Type, Accept" + "Origin, X-Requested-With, Content-Type, Accept", ); next(); }); @@ -193,19 +193,19 @@ async function generateDevelopmentBuild() { "Cesium.js", "/Build/CesiumUnminified/Cesium.js*", contexts.iife, - [iifeWorkersCache] + [iifeWorkersCache], ); const esmCache = createRoute( app, "index.js", "/Build/CesiumUnminified/index.js*", - contexts.esm + contexts.esm, ); const workersCache = createRoute( app, "Workers/*", "/Build/CesiumUnminified/Workers/*.js", - contexts.workers + contexts.workers, ); const glslWatcher = chokidar.watch(shaderFiles, { ignoreInitial: true }); @@ -232,7 +232,7 @@ async function generateDevelopmentBuild() { app, "TestWorkers/*", "/Build/Specs/TestWorkers/*", - contexts.testWorkers + contexts.testWorkers, ); chokidar .watch(["Specs/TestWorkers/*.js"], { ignoreInitial: true }) @@ -242,7 +242,7 @@ async function generateDevelopmentBuild() { app, "Specs/*", "/Build/Specs/*", - contexts.specs + contexts.specs, ); const specWatcher = chokidar.watch(specFiles, { ignoreInitial: true }); specWatcher.on("all", async (event) => { @@ -254,21 +254,24 @@ async function generateDevelopmentBuild() { }); // Rebuild jsHintOptions as needed and serve as-is - app.get("/Apps/Sandcastle/jsHintOptions.js", async function ( - //eslint-disable-next-line no-unused-vars - req, - res, - //eslint-disable-next-line no-unused-vars - next - ) { - if (!jsHintOptionsCache) { - jsHintOptionsCache = await createJsHintOptions(); - } + app.get( + "/Apps/Sandcastle/jsHintOptions.js", + async function ( + //eslint-disable-next-line no-unused-vars + req, + res, + //eslint-disable-next-line no-unused-vars + next, + ) { + if (!jsHintOptionsCache) { + jsHintOptionsCache = await createJsHintOptions(); + } - res.append("Cache-Control", "max-age=0"); - res.append("Content-Type", "application/javascript"); - res.send(jsHintOptionsCache); - }); + res.append("Cache-Control", "max-age=0"); + res.append("Content-Type", "application/javascript"); + res.send(jsHintOptionsCache); + }, + ); // Serve any static files starting with "Build/CesiumUnminified" from the // development build instead. That way, previous build output is preserved @@ -293,7 +296,8 @@ async function generateDevelopmentBuild() { return remoteUrl; } - const dontProxyHeaderRegex = /^(?:Host|Proxy-Connection|Connection|Keep-Alive|Transfer-Encoding|TE|Trailer|Proxy-Authorization|Proxy-Authenticate|Upgrade)$/i; + const dontProxyHeaderRegex = + /^(?:Host|Proxy-Connection|Connection|Keep-Alive|Transfer-Encoding|TE|Trailer|Proxy-Authorization|Proxy-Authenticate|Upgrade)$/i; //eslint-disable-next-line no-unused-vars function filterHeaders(req, headers) { @@ -360,7 +364,7 @@ async function generateDevelopmentBuild() { } res.status(code).send(body); - } + }, ); }); @@ -371,28 +375,28 @@ async function generateDevelopmentBuild() { if (argv.public) { console.log( "Cesium development server running publicly. Connect to http://localhost:%d/", - server.address().port + server.address().port, ); } else { console.log( "Cesium development server running locally. Connect to http://localhost:%d/", - server.address().port + server.address().port, ); } - } + }, ); server.on("error", function (e) { if (e.code === "EADDRINUSE") { console.log( "Error: Port %d is already in use, select a different port.", - argv.port + argv.port, ); console.log("Example: node server.js --port %d", argv.port + 1); } else if (e.code === "EACCES") { console.log( "Error: This process does not have permission to listen on port %d.", - argv.port + argv.port, ); if (argv.port < 1024) { console.log("Try a port number higher than 1024.");